{"version":3,"names":[],"mappings":"","sources":["topicpage-detail.bundle.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i 0) {\n ko.mapping.fromJS(viewModel.GridData, {}, viewModel.allResults);\n ko.mapping.fromJS(viewModel.TopicGridData, {}, viewModel.allTopicData);\n\n if (viewModel.GridData().length == 0) {\n viewModel.showHeaderLabel(false);\n }\n\n var initCount = viewModel.initialTake();\n\n if (viewModel.allResults().length <= initCount) {\n viewModel.showMoreButton(false);\n initCount = viewModel.allResults().length;\n }\n\n for (var i = 0; i < initCount; i++) {\n viewModel.visibleResults.push(viewModel.GridData()[i]);\n }\n } else {\n viewModel.showMoreButton = ko.observable(false);\n }\n\n viewModel.getQueryParameter = function (parameter) {\n\n var currUrl = window.location.href;\n var value = \"\";\n if (currUrl.indexOf(parameter) > 0) {\n var parameterLength = (parameter + \"=\").length;\n var startIdx = currUrl.indexOf(parameter) + parameterLength;\n var endIdx = currUrl.length;\n if (currUrl.indexOf(\"&\") > 0) {\n if (currUrl.indexOf(\"?\" + parameter) > 0) {\n endIdx = currUrl.indexOf(\"&\");\n }\n }\n value = currUrl.substring(startIdx, endIdx);\n }\n return value;\n };\n\n //// Build query string based on filters\n viewModel.QueryString = function () {\n var queryString = \"\";\n\n if (viewModel.SelectedCategory() != null && viewModel.SelectedCategory().length > 0) {\n queryString += queryString != \"\" ? \"&\" : \"?\";\n queryString += \"category=\" + encodeURIComponent(viewModel.SelectedCategory());\n }\n\n if (viewModel.SelectedTimeStamp() != null && viewModel.SelectedTimeStamp().length > 0) {\n queryString += queryString != \"\" ? \"&\" : \"?\";\n queryString += \"time=\" + encodeURIComponent(viewModel.SelectedTimeStamp());\n }\n\n return queryString;\n };\n\n //// Run search by pushing new state\n viewModel.Search = function (queryString) {\n\n var qs = viewModel.QueryString();\n\n if (queryString != \"\" && queryString != \"undefined\" && queryString != null) {\n qs = queryString;\n }\n\n History.pushState({ qs: qs }, History.options.initialTitle, qs);\n viewModel.GridData([]);\n viewModel.LoadDataFromServer();\n };\n\n viewModel.AllSearch = function (qsType) {\n\n var currUrl = window.location.href;\n var newUrl = window.location.href;\n\n if (qsType == \"time\") {\n var currTime = viewModel.getQueryParameter(\"time\");\n viewModel.TimeStamp(\"\");\n if (currTime != \"\") {\n if (currUrl.indexOf(\"?time\") > 0) {\n newUrl = currUrl.replace(\"?time=\" + currTime, \"\");\n } else {\n newUrl = currUrl.replace(\"&time=\" + currTime, \"\");\n }\n }\n }\n\n if (qsType == \"category\") {\n var currCat = viewModel.getQueryParameter(\"category\");\n viewModel.Category(\"\");\n if (currCat != \"\") {\n if (currUrl.indexOf(\"?category\") > 0) {\n newUrl = currUrl.replace(\"?category=\" + currCat, \"\");\n if (newUrl.indexOf(\"&time\") > 0) {\n newUrl = newUrl.replace(\"&\", \"?\");\n }\n }\n }\n }\n\n viewModel.Search(newUrl);\n };\n\n //// Load data from server\n viewModel.LoadDataFromServer = function () {\n viewModel.isTopicPage(true);\n var viewModelToSend = ko.GetRequestObject(viewModel);\n\n $.ajax({\n url: option.serviceUrl,\n type: \"POST\",\n dataType: \"json\",\n contentType: \"application/json; charset=utf-8\",\n data: ko.mapping.toJSON(viewModelToSend),\n cache: false,\n success: function success(data) {\n var results = ko.observableArray();\n\n //emptying current array\n viewModel.visibleResults([]);\n viewModel.allResults([]);\n\n ko.mapping.fromJS(data.GridData, {}, results);\n ko.mapping.fromJS(data.GridData, {}, viewModel.allResults);\n\n var count = viewModel.allResults().length > viewModel.initialTake() ? viewModel.initialTake() : viewModel.allResults().length;\n\n for (var i = 0; i < count; i++) {\n viewModel.visibleResults.push(results()[i]);\n }\n\n if (viewModel.allResults().length <= count) {\n viewModel.showMoreButton(false);\n } else {\n viewModel.showMoreButton(true);\n }\n },\n error: function error(xhr, textStatus, errorThrown) {\n console.log(xhr);\n console.log(\"textStatus : \" + textStatus);\n console.log(\"errorThrown : \" + errorThrown);\n }\n });\n };\n\n viewModel.LoadMore = function (id) {\n\n var visibleResultsLength = viewModel.visibleResults().length;\n //var skip = viewModel.skip();\n\n //for (var i = visibleResultsLength; i < visibleResultsLength + skip; i++) {\n // viewModel.visibleResults.push(viewModel.allResults()[i]);\n //}\n var skip = viewModel.skip();\n\n if (publicationTag) {\n var tagResults = viewModel.TopicGridData[publicationTag];\n if (tagResults && tagResults() && tagResults().length > 0) {\n var additionalResultsLength = 0;\n if (tagResults().length <= viewModel.visibleResults().length + skip) {\n additionalResultsLength = tagResults().length;\n viewModel.showMoreButton(false);\n } else {\n additionalResultsLength = viewModel.visibleResults().length + skip;\n viewModel.showMoreButton(true);\n }\n\n for (var i = viewModel.visibleResults().length; i < additionalResultsLength; i++) {\n viewModel.visibleResults.push(tagResults()[i]);\n }\n } else {}\n } else {\n var additionalResultsLength = 0;\n if (viewModel.allResults().length <= viewModel.visibleResults().length + skip) {\n additionalResultsLength = viewModel.allResults().length;\n viewModel.showMoreButton(false);\n } else {\n additionalResultsLength = viewModel.visibleResults().length + skip;\n viewModel.showMoreButton(true);\n }\n\n for (var i = viewModel.visibleResults().length; i < additionalResultsLength; i++) {\n viewModel.visibleResults.push(viewModel.allResults()[i]);\n }\n }\n };\n\n viewModel.LoadTags = function (id) {\n if (id) {\n var tagResults = viewModel.TopicGridData[id];\n if (tagResults && tagResults() && tagResults().length > 0) {\n viewModel.visibleResults([]);\n var takeLength = viewModel.initialTake();\n if (tagResults().length < takeLength) {\n takeLength = tagResults().length;\n }\n for (var i = 0; i < takeLength; i++) {\n viewModel.visibleResults.push(tagResults()[i]);\n }\n if (tagResults().length <= viewModel.visibleResults().length) {\n viewModel.showMoreButton(false);\n } else {\n viewModel.showMoreButton(true);\n }\n clearTagClasses();\n $(\".topic-detail__tags[data-tag-id='\" + id + \"']\").toggleClass(\"topic-detail__tags--active\");\n\n publicationTag = id;\n } else {}\n }\n };\n\n viewModel.ClearTag = function () {\n publicationTag = '';\n clearTagClasses();\n viewModel.visibleResults([]);\n if (viewModel.allResults().length > 0) {\n if (viewModel.allResults().length == 0) {\n viewModel.showHeaderLabel(false);\n }\n\n var initCount = viewModel.initialTake();\n\n if (viewModel.allResults().length <= initCount) {\n viewModel.showMoreButton(false);\n initCount = viewModel.allResults().length;\n }\n\n for (var i = 0; i < initCount; i++) {\n viewModel.visibleResults.push(viewModel.GridData()[i]);\n }\n } else {\n viewModel.showMoreButton = ko.observable(false);\n }\n };\n\n function clearTagClasses() {\n $(\".topic-detail__tags\").each(function () {\n $(this).removeClass(\"topic-detail__tags--active\");\n });\n }\n\n ko.applyBindings(viewModel, pageContent.get(0));\n\n // Custom binding hor history click\n ko.bindingHandlers.bindHistoryClick = {\n init: function init(element, valueAccessor) {\n var anchorTag = $(element);\n var observable = valueAccessor();\n\n anchorTag.on(\"click tap\", function (e) {\n e.preventDefault();\n\n var qs = viewModel.QueryString();\n History.replaceState({ qs: qs }, History.options.initialTitle, qs);\n\n window.location = observable.Url();\n });\n }\n };\n};\n\n},{}],2:[function(require,module,exports){\n\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n(typeof JSON === \"undefined\" ? \"undefined\" : _typeof(JSON)) != \"object\" && (JSON = {}), function () {\n \"use strict\";\n function f(e) {\n return e < 10 ? \"0\" + e : e;\n }function quote(e) {\n return escapable.lastIndex = 0, escapable.test(e) ? '\"' + e.replace(escapable, function (e) {\n var t = meta[e];return typeof t == \"string\" ? t : \"\\\\u\" + (\"0000\" + e.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' : '\"' + e + '\"';\n }function str(e, t) {\n var n,\n r,\n i,\n s,\n o = gap,\n u,\n a = t[e];a && (typeof a === \"undefined\" ? \"undefined\" : _typeof(a)) == \"object\" && typeof a.toJSON == \"function\" && (a = a.toJSON(e)), typeof rep == \"function\" && (a = rep.call(t, e, a));switch (typeof a === \"undefined\" ? \"undefined\" : _typeof(a)) {case \"string\":\n return quote(a);case \"number\":\n return isFinite(a) ? String(a) : \"null\";case \"boolean\":case \"null\":\n return String(a);case \"object\":\n if (!a) return \"null\";gap += indent, u = [];if (Object.prototype.toString.apply(a) === \"[object Array]\") {\n s = a.length;for (n = 0; n < s; n += 1) {\n u[n] = str(n, a) || \"null\";\n }return i = u.length === 0 ? \"[]\" : gap ? \"[\\n\" + gap + u.join(\",\\n\" + gap) + \"\\n\" + o + \"]\" : \"[\" + u.join(\",\") + \"]\", gap = o, i;\n }if (rep && (typeof rep === \"undefined\" ? \"undefined\" : _typeof(rep)) == \"object\") {\n s = rep.length;for (n = 0; n < s; n += 1) {\n typeof rep[n] == \"string\" && (r = rep[n], i = str(r, a), i && u.push(quote(r) + (gap ? \": \" : \":\") + i));\n }\n } else for (r in a) {\n Object.prototype.hasOwnProperty.call(a, r) && (i = str(r, a), i && u.push(quote(r) + (gap ? \": \" : \":\") + i));\n }return i = u.length === 0 ? \"{}\" : gap ? \"{\\n\" + gap + u.join(\",\\n\" + gap) + \"\\n\" + o + \"}\" : \"{\" + u.join(\",\") + \"}\", gap = o, i;}\n }typeof Date.prototype.toJSON != \"function\" && (Date.prototype.toJSON = function (e) {\n return isFinite(this.valueOf()) ? this.getUTCFullYear() + \"-\" + f(this.getUTCMonth() + 1) + \"-\" + f(this.getUTCDate()) + \"T\" + f(this.getUTCHours()) + \":\" + f(this.getUTCMinutes()) + \":\" + f(this.getUTCSeconds()) + \"Z\" : null;\n }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (e) {\n return this.valueOf();\n });var cx = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n escapable = /[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n gap,\n indent,\n meta = { \"\\b\": \"\\\\b\", \"\t\": \"\\\\t\", \"\\n\": \"\\\\n\", \"\\f\": \"\\\\f\", \"\\r\": \"\\\\r\", '\"': '\\\\\"', \"\\\\\": \"\\\\\\\\\" },\n rep;typeof JSON.stringify != \"function\" && (JSON.stringify = function (e, t, n) {\n var r;gap = \"\", indent = \"\";if (typeof n == \"number\") for (r = 0; r < n; r += 1) {\n indent += \" \";\n } else typeof n == \"string\" && (indent = n);rep = t;if (!t || typeof t == \"function\" || (typeof t === \"undefined\" ? \"undefined\" : _typeof(t)) == \"object\" && typeof t.length == \"number\") return str(\"\", { \"\": e });throw new Error(\"JSON.stringify\");\n }), typeof JSON.parse != \"function\" && (JSON.parse = function (text, reviver) {\n function walk(e, t) {\n var n,\n r,\n i = e[t];if (i && (typeof i === \"undefined\" ? \"undefined\" : _typeof(i)) == \"object\") for (n in i) {\n Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n), r !== undefined ? i[n] = r : delete i[n]);\n }return reviver.call(e, t, i);\n }var j;text = String(text), cx.lastIndex = 0, cx.test(text) && (text = text.replace(cx, function (e) {\n return \"\\\\u\" + (\"0000\" + e.charCodeAt(0).toString(16)).slice(-4);\n }));if (/^[\\],:{}\\s]*$/.test(text.replace(/\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g, \"@\").replace(/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g, \"]\").replace(/(?:^|:|,)(?:\\s*\\[)+/g, \"\"))) return j = eval(\"(\" + text + \")\"), typeof reviver == \"function\" ? walk({ \"\": j }, \"\") : j;throw new SyntaxError(\"JSON.parse\");\n });\n}(), function (e, t) {\n \"use strict\";\n var n = e.History = e.History || {},\n r = e.jQuery;if (typeof n.Adapter != \"undefined\") throw new Error(\"History.js Adapter has already been loaded...\");n.Adapter = { bind: function bind(e, t, n) {\n r(e).bind(t, n);\n }, trigger: function trigger(e, t, n) {\n r(e).trigger(t, n);\n }, extractEventData: function extractEventData(e, n, r) {\n var i = n && n.originalEvent && n.originalEvent[e] || r && r[e] || t;return i;\n }, onDomLoad: function onDomLoad(e) {\n r(e);\n } }, typeof n.init != \"undefined\" && n.init();\n}(window), function (e, t) {\n \"use strict\";\n var n = e.document,\n r = e.setTimeout || r,\n i = e.clearTimeout || i,\n s = e.setInterval || s,\n o = e.History = e.History || {};if (typeof o.initHtml4 != \"undefined\") throw new Error(\"History.js HTML4 Support has already been loaded...\");o.initHtml4 = function () {\n if (typeof o.initHtml4.initialized != \"undefined\") return !1;o.initHtml4.initialized = !0, o.enabled = !0, o.savedHashes = [], o.isLastHash = function (e) {\n var t = o.getHashByIndex(),\n n;return n = e === t, n;\n }, o.isHashEqual = function (e, t) {\n return e = encodeURIComponent(e).replace(/%25/g, \"%\"), t = encodeURIComponent(t).replace(/%25/g, \"%\"), e === t;\n }, o.saveHash = function (e) {\n return o.isLastHash(e) ? !1 : (o.savedHashes.push(e), !0);\n }, o.getHashByIndex = function (e) {\n var t = null;return typeof e == \"undefined\" ? t = o.savedHashes[o.savedHashes.length - 1] : e < 0 ? t = o.savedHashes[o.savedHashes.length + e] : t = o.savedHashes[e], t;\n }, o.discardedHashes = {}, o.discardedStates = {}, o.discardState = function (e, t, n) {\n var r = o.getHashByState(e),\n i;return i = { discardedState: e, backState: n, forwardState: t }, o.discardedStates[r] = i, !0;\n }, o.discardHash = function (e, t, n) {\n var r = { discardedHash: e, backState: n, forwardState: t };return o.discardedHashes[e] = r, !0;\n }, o.discardedState = function (e) {\n var t = o.getHashByState(e),\n n;return n = o.discardedStates[t] || !1, n;\n }, o.discardedHash = function (e) {\n var t = o.discardedHashes[e] || !1;return t;\n }, o.recycleState = function (e) {\n var t = o.getHashByState(e);return o.discardedState(e) && delete o.discardedStates[t], !0;\n }, o.emulated.hashChange && (o.hashChangeInit = function () {\n o.checkerFunction = null;var t = \"\",\n r,\n i,\n u,\n a,\n f = Boolean(o.getHash());return o.isInternetExplorer() ? (r = \"historyjs-iframe\", i = n.createElement(\"iframe\"), i.setAttribute(\"id\", r), i.setAttribute(\"src\", \"#\"), i.style.display = \"none\", n.body.appendChild(i), i.contentWindow.document.open(), i.contentWindow.document.close(), u = \"\", a = !1, o.checkerFunction = function () {\n if (a) return !1;a = !0;var n = o.getHash(),\n r = o.getHash(i.contentWindow.document);return n !== t ? (t = n, r !== n && (u = r = n, i.contentWindow.document.open(), i.contentWindow.document.close(), i.contentWindow.document.location.hash = o.escapeHash(n)), o.Adapter.trigger(e, \"hashchange\")) : r !== u && (u = r, f && r === \"\" ? o.back() : o.setHash(r, !1)), a = !1, !0;\n }) : o.checkerFunction = function () {\n var n = o.getHash() || \"\";return n !== t && (t = n, o.Adapter.trigger(e, \"hashchange\")), !0;\n }, o.intervalList.push(s(o.checkerFunction, o.options.hashChangeInterval)), !0;\n }, o.Adapter.onDomLoad(o.hashChangeInit)), o.emulated.pushState && (o.onHashChange = function (t) {\n var n = t && t.newURL || o.getLocationHref(),\n r = o.getHashByUrl(n),\n i = null,\n s = null,\n u = null,\n a;return o.isLastHash(r) ? (o.busy(!1), !1) : (o.doubleCheckComplete(), o.saveHash(r), r && o.isTraditionalAnchor(r) ? (o.Adapter.trigger(e, \"anchorchange\"), o.busy(!1), !1) : (i = o.extractState(o.getFullUrl(r || o.getLocationHref()), !0), o.isLastSavedState(i) ? (o.busy(!1), !1) : (s = o.getHashByState(i), a = o.discardedState(i), a ? (o.getHashByIndex(-2) === o.getHashByState(a.forwardState) ? o.back(!1) : o.forward(!1), !1) : (o.pushState(i.data, i.title, encodeURI(i.url), !1), !0))));\n }, o.Adapter.bind(e, \"hashchange\", o.onHashChange), o.pushState = function (t, n, r, i) {\n r = encodeURI(r).replace(/%25/g, \"%\");if (o.getHashByUrl(r)) throw new Error(\"History.js does not support states with fragment-identifiers (hashes/anchors).\");if (i !== !1 && o.busy()) return o.pushQueue({ scope: o, callback: o.pushState, args: arguments, queue: i }), !1;o.busy(!0);var s = o.createStateObject(t, n, r),\n u = o.getHashByState(s),\n a = o.getState(!1),\n f = o.getHashByState(a),\n l = o.getHash(),\n c = o.expectedStateId == s.id;return o.storeState(s), o.expectedStateId = s.id, o.recycleState(s), o.setTitle(s), u === f ? (o.busy(!1), !1) : (o.saveState(s), c || o.Adapter.trigger(e, \"statechange\"), !o.isHashEqual(u, l) && !o.isHashEqual(u, o.getShortUrl(o.getLocationHref())) && o.setHash(u, !1), o.busy(!1), !0);\n }, o.replaceState = function (t, n, r, i) {\n r = encodeURI(r).replace(/%25/g, \"%\");if (o.getHashByUrl(r)) throw new Error(\"History.js does not support states with fragment-identifiers (hashes/anchors).\");if (i !== !1 && o.busy()) return o.pushQueue({ scope: o, callback: o.replaceState, args: arguments, queue: i }), !1;o.busy(!0);var s = o.createStateObject(t, n, r),\n u = o.getHashByState(s),\n a = o.getState(!1),\n f = o.getHashByState(a),\n l = o.getStateByIndex(-2);return o.discardState(a, s, l), u === f ? (o.storeState(s), o.expectedStateId = s.id, o.recycleState(s), o.setTitle(s), o.saveState(s), o.Adapter.trigger(e, \"statechange\"), o.busy(!1)) : o.pushState(s.data, s.title, s.url, !1), !0;\n }), o.emulated.pushState && o.getHash() && !o.emulated.hashChange && o.Adapter.onDomLoad(function () {\n o.Adapter.trigger(e, \"hashchange\");\n });\n }, typeof o.init != \"undefined\" && o.init();\n}(window), function (e, t) {\n \"use strict\";\n var n = e.console || t,\n r = e.document,\n i = e.navigator,\n s = !1,\n o = e.setTimeout,\n u = e.clearTimeout,\n a = e.setInterval,\n f = e.clearInterval,\n l = e.JSON,\n c = e.alert,\n h = e.History = e.History || {},\n p = e.history;try {\n s = e.sessionStorage, s.setItem(\"TEST\", \"1\"), s.removeItem(\"TEST\");\n } catch (d) {\n s = !1;\n }l.stringify = l.stringify || l.encode, l.parse = l.parse || l.decode;if (typeof h.init != \"undefined\") throw new Error(\"History.js Core has already been loaded...\");h.init = function (e) {\n return typeof h.Adapter == \"undefined\" ? !1 : (typeof h.initCore != \"undefined\" && h.initCore(), typeof h.initHtml4 != \"undefined\" && h.initHtml4(), !0);\n }, h.initCore = function (d) {\n if (typeof h.initCore.initialized != \"undefined\") return !1;h.initCore.initialized = !0, h.options = h.options || {}, h.options.hashChangeInterval = h.options.hashChangeInterval || 100, h.options.safariPollInterval = h.options.safariPollInterval || 500, h.options.doubleCheckInterval = h.options.doubleCheckInterval || 500, h.options.disableSuid = h.options.disableSuid || !1, h.options.storeInterval = h.options.storeInterval || 1e3, h.options.busyDelay = h.options.busyDelay || 250, h.options.debug = h.options.debug || !1, h.options.initialTitle = h.options.initialTitle || r.title, h.options.html4Mode = h.options.html4Mode || !1, h.options.delayInit = h.options.delayInit || !1, h.intervalList = [], h.clearAllIntervals = function () {\n var e,\n t = h.intervalList;if (typeof t != \"undefined\" && t !== null) {\n for (e = 0; e < t.length; e++) {\n f(t[e]);\n }h.intervalList = null;\n }\n }, h.debug = function () {\n (h.options.debug || !1) && h.log.apply(h, arguments);\n }, h.log = function () {\n var e = typeof n != \"undefined\" && typeof n.log != \"undefined\" && typeof n.log.apply != \"undefined\",\n t = r.getElementById(\"log\"),\n i,\n s,\n o,\n u,\n a;e ? (u = Array.prototype.slice.call(arguments), i = u.shift(), typeof n.debug != \"undefined\" ? n.debug.apply(n, [i, u]) : n.log.apply(n, [i, u])) : i = \"\\n\" + arguments[0] + \"\\n\";for (s = 1, o = arguments.length; s < o; ++s) {\n a = arguments[s];if ((typeof a === \"undefined\" ? \"undefined\" : _typeof(a)) == \"object\" && typeof l != \"undefined\") try {\n a = l.stringify(a);\n } catch (f) {}i += \"\\n\" + a + \"\\n\";\n }return t ? (t.value += i + \"\\n-----\\n\", t.scrollTop = t.scrollHeight - t.clientHeight) : e || c(i), !0;\n }, h.getInternetExplorerMajorVersion = function () {\n var e = h.getInternetExplorerMajorVersion.cached = typeof h.getInternetExplorerMajorVersion.cached != \"undefined\" ? h.getInternetExplorerMajorVersion.cached : function () {\n var e = 3,\n t = r.createElement(\"div\"),\n n = t.getElementsByTagName(\"i\");while ((t.innerHTML = \"\") && n[0]) {}return e > 4 ? e : !1;\n }();return e;\n }, h.isInternetExplorer = function () {\n var e = h.isInternetExplorer.cached = typeof h.isInternetExplorer.cached != \"undefined\" ? h.isInternetExplorer.cached : Boolean(h.getInternetExplorerMajorVersion());return e;\n }, h.options.html4Mode ? h.emulated = { pushState: !0, hashChange: !0 } : h.emulated = { pushState: !Boolean(e.history && e.history.pushState && e.history.replaceState && !/ Mobile\\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent) && !/AppleWebKit\\/5([0-2]|3[0-2])/i.test(i.userAgent)), hashChange: Boolean(!(\"onhashchange\" in e || \"onhashchange\" in r) || h.isInternetExplorer() && h.getInternetExplorerMajorVersion() < 8) }, h.enabled = !h.emulated.pushState, h.bugs = { setHash: Boolean(!h.emulated.pushState && i.vendor === \"Apple Computer, Inc.\" && /AppleWebKit\\/5([0-2]|3[0-3])/.test(i.userAgent)), safariPoll: Boolean(!h.emulated.pushState && i.vendor === \"Apple Computer, Inc.\" && /AppleWebKit\\/5([0-2]|3[0-3])/.test(i.userAgent)), ieDoubleCheck: Boolean(h.isInternetExplorer() && h.getInternetExplorerMajorVersion() < 8), hashEscape: Boolean(h.isInternetExplorer() && h.getInternetExplorerMajorVersion() < 7) }, h.isEmptyObject = function (e) {\n for (var t in e) {\n if (e.hasOwnProperty(t)) return !1;\n }return !0;\n }, h.cloneObject = function (e) {\n var t, n;return e ? (t = l.stringify(e), n = l.parse(t)) : n = {}, n;\n }, h.getRootUrl = function () {\n var e = r.location.protocol + \"//\" + (r.location.hostname || r.location.host);if (r.location.port || !1) e += \":\" + r.location.port;return e += \"/\", e;\n }, h.getBaseHref = function () {\n var e = r.getElementsByTagName(\"base\"),\n t = null,\n n = \"\";return e.length === 1 && (t = e[0], n = t.href.replace(/[^\\/]+$/, \"\")), n = n.replace(/\\/+$/, \"\"), n && (n += \"/\"), n;\n }, h.getBaseUrl = function () {\n var e = h.getBaseHref() || h.getBasePageUrl() || h.getRootUrl();return e;\n }, h.getPageUrl = function () {\n var e = h.getState(!1, !1),\n t = (e || {}).url || h.getLocationHref(),\n n;return n = t.replace(/\\/+$/, \"\").replace(/[^\\/]+$/, function (e, t, n) {\n return (/\\./.test(e) ? e : e + \"/\"\n );\n }), n;\n }, h.getBasePageUrl = function () {\n var e = h.getLocationHref().replace(/[#\\?].*/, \"\").replace(/[^\\/]+$/, function (e, t, n) {\n return (/[^\\/]$/.test(e) ? \"\" : e\n );\n }).replace(/\\/+$/, \"\") + \"/\";return e;\n }, h.getFullUrl = function (e, t) {\n var n = e,\n r = e.substring(0, 1);return t = typeof t == \"undefined\" ? !0 : t, /[a-z]+\\:\\/\\//.test(e) || (r === \"/\" ? n = h.getRootUrl() + e.replace(/^\\/+/, \"\") : r === \"#\" ? n = h.getPageUrl().replace(/#.*/, \"\") + e : r === \"?\" ? n = h.getPageUrl().replace(/[\\?#].*/, \"\") + e : t ? n = h.getBaseUrl() + e.replace(/^(\\.\\/)+/, \"\") : n = h.getBasePageUrl() + e.replace(/^(\\.\\/)+/, \"\")), n.replace(/\\#$/, \"\");\n }, h.getShortUrl = function (e) {\n var t = e,\n n = h.getBaseUrl(),\n r = h.getRootUrl();return h.emulated.pushState && (t = t.replace(n, \"\")), t = t.replace(r, \"/\"), h.isTraditionalAnchor(t) && (t = \"./\" + t), t = t.replace(/^(\\.\\/)+/g, \"./\").replace(/\\#$/, \"\"), t;\n }, h.getLocationHref = function (e) {\n return e = e || r, e.URL === e.location.href ? e.location.href : e.location.href === decodeURIComponent(e.URL) ? e.URL : e.location.hash && decodeURIComponent(e.location.href.replace(/^[^#]+/, \"\")) === e.location.hash ? e.location.href : e.URL.indexOf(\"#\") == -1 && e.location.href.indexOf(\"#\") != -1 ? e.location.href : e.URL || e.location.href;\n }, h.store = {}, h.idToState = h.idToState || {}, h.stateToId = h.stateToId || {}, h.urlToId = h.urlToId || {}, h.storedStates = h.storedStates || [], h.savedStates = h.savedStates || [], h.normalizeStore = function () {\n h.store.idToState = h.store.idToState || {}, h.store.urlToId = h.store.urlToId || {}, h.store.stateToId = h.store.stateToId || {};\n }, h.getState = function (e, t) {\n typeof e == \"undefined\" && (e = !0), typeof t == \"undefined\" && (t = !0);var n = h.getLastSavedState();return !n && t && (n = h.createStateObject()), e && (n = h.cloneObject(n), n.url = n.cleanUrl || n.url), n;\n }, h.getIdByState = function (e) {\n var t = h.extractId(e.url),\n n;if (!t) {\n n = h.getStateString(e);if (typeof h.stateToId[n] != \"undefined\") t = h.stateToId[n];else if (typeof h.store.stateToId[n] != \"undefined\") t = h.store.stateToId[n];else {\n for (;;) {\n t = new Date().getTime() + String(Math.random()).replace(/\\D/g, \"\");if (typeof h.idToState[t] == \"undefined\" && typeof h.store.idToState[t] == \"undefined\") break;\n }h.stateToId[n] = t, h.idToState[t] = e;\n }\n }return t;\n }, h.normalizeState = function (e) {\n var t, n;if (!e || (typeof e === \"undefined\" ? \"undefined\" : _typeof(e)) != \"object\") e = {};if (typeof e.normalized != \"undefined\") return e;if (!e.data || _typeof(e.data) != \"object\") e.data = {};return t = {}, t.normalized = !0, t.title = e.title || \"\", t.url = h.getFullUrl(e.url ? e.url : h.getLocationHref()), t.hash = h.getShortUrl(t.url), t.data = h.cloneObject(e.data), t.id = h.getIdByState(t), t.cleanUrl = t.url.replace(/\\??\\&_suid.*/, \"\"), t.url = t.cleanUrl, n = !h.isEmptyObject(t.data), (t.title || n) && h.options.disableSuid !== !0 && (t.hash = h.getShortUrl(t.url).replace(/\\??\\&_suid.*/, \"\"), /\\?/.test(t.hash) || (t.hash += \"?\"), t.hash += \"&_suid=\" + t.id), t.hashedUrl = h.getFullUrl(t.hash), (h.emulated.pushState || h.bugs.safariPoll) && h.hasUrlDuplicate(t) && (t.url = t.hashedUrl), t;\n }, h.createStateObject = function (e, t, n) {\n var r = { data: e, title: t, url: n };return r = h.normalizeState(r), r;\n }, h.getStateById = function (e) {\n e = String(e);var n = h.idToState[e] || h.store.idToState[e] || t;return n;\n }, h.getStateString = function (e) {\n var t, n, r;return t = h.normalizeState(e), n = { data: t.data, title: e.title, url: e.url }, r = l.stringify(n), r;\n }, h.getStateId = function (e) {\n var t, n;return t = h.normalizeState(e), n = t.id, n;\n }, h.getHashByState = function (e) {\n var t, n;return t = h.normalizeState(e), n = t.hash, n;\n }, h.extractId = function (e) {\n var t, n, r, i;return e.indexOf(\"#\") != -1 ? i = e.split(\"#\")[0] : i = e, n = /(.*)\\&_suid=([0-9]+)$/.exec(i), r = n ? n[1] || e : e, t = n ? String(n[2] || \"\") : \"\", t || !1;\n }, h.isTraditionalAnchor = function (e) {\n var t = !/[\\/\\?\\.]/.test(e);return t;\n }, h.extractState = function (e, t) {\n var n = null,\n r,\n i;return t = t || !1, r = h.extractId(e), r && (n = h.getStateById(r)), n || (i = h.getFullUrl(e), r = h.getIdByUrl(i) || !1, r && (n = h.getStateById(r)), !n && t && !h.isTraditionalAnchor(e) && (n = h.createStateObject(null, null, i))), n;\n }, h.getIdByUrl = function (e) {\n var n = h.urlToId[e] || h.store.urlToId[e] || t;return n;\n }, h.getLastSavedState = function () {\n return h.savedStates[h.savedStates.length - 1] || t;\n }, h.getLastStoredState = function () {\n return h.storedStates[h.storedStates.length - 1] || t;\n }, h.hasUrlDuplicate = function (e) {\n var t = !1,\n n;return n = h.extractState(e.url), t = n && n.id !== e.id, t;\n }, h.storeState = function (e) {\n return h.urlToId[e.url] = e.id, h.storedStates.push(h.cloneObject(e)), e;\n }, h.isLastSavedState = function (e) {\n var t = !1,\n n,\n r,\n i;return h.savedStates.length && (n = e.id, r = h.getLastSavedState(), i = r.id, t = n === i), t;\n }, h.saveState = function (e) {\n return h.isLastSavedState(e) ? !1 : (h.savedStates.push(h.cloneObject(e)), !0);\n }, h.getStateByIndex = function (e) {\n var t = null;return typeof e == \"undefined\" ? t = h.savedStates[h.savedStates.length - 1] : e < 0 ? t = h.savedStates[h.savedStates.length + e] : t = h.savedStates[e], t;\n }, h.getCurrentIndex = function () {\n var e = null;return h.savedStates.length < 1 ? e = 0 : e = h.savedStates.length - 1, e;\n }, h.getHash = function (e) {\n var t = h.getLocationHref(e),\n n;return n = h.getHashByUrl(t), n;\n }, h.unescapeHash = function (e) {\n var t = h.normalizeHash(e);return t = decodeURIComponent(t), t;\n }, h.normalizeHash = function (e) {\n var t = e.replace(/[^#]*#/, \"\").replace(/#.*/, \"\");return t;\n }, h.setHash = function (e, t) {\n var n, i;return t !== !1 && h.busy() ? (h.pushQueue({ scope: h, callback: h.setHash, args: arguments, queue: t }), !1) : (h.busy(!0), n = h.extractState(e, !0), n && !h.emulated.pushState ? h.pushState(n.data, n.title, n.url, !1) : h.getHash() !== e && (h.bugs.setHash ? (i = h.getPageUrl(), h.pushState(null, null, i + \"#\" + e, !1)) : r.location.hash = e), h);\n }, h.escapeHash = function (t) {\n var n = h.normalizeHash(t);return n = e.encodeURIComponent(n), h.bugs.hashEscape || (n = n.replace(/\\%21/g, \"!\").replace(/\\%26/g, \"&\").replace(/\\%3D/g, \"=\").replace(/\\%3F/g, \"?\")), n;\n }, h.getHashByUrl = function (e) {\n var t = String(e).replace(/([^#]*)#?([^#]*)#?(.*)/, \"$2\");return t = h.unescapeHash(t), t;\n }, h.setTitle = function (e) {\n var t = e.title,\n n;t || (n = h.getStateByIndex(0), n && n.url === e.url && (t = n.title || h.options.initialTitle));try {\n r.getElementsByTagName(\"title\")[0].innerHTML = t.replace(\"<\", \"<\").replace(\">\", \">\").replace(\" & \", \" & \");\n } catch (i) {}return r.title = t, h;\n }, h.queues = [], h.busy = function (e) {\n typeof e != \"undefined\" ? h.busy.flag = e : typeof h.busy.flag == \"undefined\" && (h.busy.flag = !1);if (!h.busy.flag) {\n u(h.busy.timeout);var t = function t() {\n var e, n, r;if (h.busy.flag) return;for (e = h.queues.length - 1; e >= 0; --e) {\n n = h.queues[e];if (n.length === 0) continue;r = n.shift(), h.fireQueueItem(r), h.busy.timeout = o(t, h.options.busyDelay);\n }\n };h.busy.timeout = o(t, h.options.busyDelay);\n }return h.busy.flag;\n }, h.busy.flag = !1, h.fireQueueItem = function (e) {\n return e.callback.apply(e.scope || h, e.args || []);\n }, h.pushQueue = function (e) {\n return h.queues[e.queue || 0] = h.queues[e.queue || 0] || [], h.queues[e.queue || 0].push(e), h;\n }, h.queue = function (e, t) {\n return typeof e == \"function\" && (e = { callback: e }), typeof t != \"undefined\" && (e.queue = t), h.busy() ? h.pushQueue(e) : h.fireQueueItem(e), h;\n }, h.clearQueue = function () {\n return h.busy.flag = !1, h.queues = [], h;\n }, h.stateChanged = !1, h.doubleChecker = !1, h.doubleCheckComplete = function () {\n return h.stateChanged = !0, h.doubleCheckClear(), h;\n }, h.doubleCheckClear = function () {\n return h.doubleChecker && (u(h.doubleChecker), h.doubleChecker = !1), h;\n }, h.doubleCheck = function (e) {\n return h.stateChanged = !1, h.doubleCheckClear(), h.bugs.ieDoubleCheck && (h.doubleChecker = o(function () {\n return h.doubleCheckClear(), h.stateChanged || e(), !0;\n }, h.options.doubleCheckInterval)), h;\n }, h.safariStatePoll = function () {\n var t = h.extractState(h.getLocationHref()),\n n;if (!h.isLastSavedState(t)) return n = t, n || (n = h.createStateObject()), h.Adapter.trigger(e, \"popstate\"), h;return;\n }, h.back = function (e) {\n return e !== !1 && h.busy() ? (h.pushQueue({ scope: h, callback: h.back, args: arguments, queue: e }), !1) : (h.busy(!0), h.doubleCheck(function () {\n h.back(!1);\n }), p.go(-1), !0);\n }, h.forward = function (e) {\n return e !== !1 && h.busy() ? (h.pushQueue({ scope: h, callback: h.forward, args: arguments, queue: e }), !1) : (h.busy(!0), h.doubleCheck(function () {\n h.forward(!1);\n }), p.go(1), !0);\n }, h.go = function (e, t) {\n var n;if (e > 0) for (n = 1; n <= e; ++n) {\n h.forward(t);\n } else {\n if (!(e < 0)) throw new Error(\"History.go: History.go requires a positive or negative integer passed.\");for (n = -1; n >= e; --n) {\n h.back(t);\n }\n }return h;\n };if (h.emulated.pushState) {\n var v = function v() {};h.pushState = h.pushState || v, h.replaceState = h.replaceState || v;\n } else h.onPopState = function (t, n) {\n var r = !1,\n i = !1,\n s,\n o;return h.doubleCheckComplete(), s = h.getHash(), s ? (o = h.extractState(s || h.getLocationHref(), !0), o ? h.replaceState(o.data, o.title, o.url, !1) : (h.Adapter.trigger(e, \"anchorchange\"), h.busy(!1)), h.expectedStateId = !1, !1) : (r = h.Adapter.extractEventData(\"state\", t, n) || !1, r ? i = h.getStateById(r) : h.expectedStateId ? i = h.getStateById(h.expectedStateId) : i = h.extractState(h.getLocationHref()), i || (i = h.createStateObject(null, null, h.getLocationHref())), h.expectedStateId = !1, h.isLastSavedState(i) ? (h.busy(!1), !1) : (h.storeState(i), h.saveState(i), h.setTitle(i), h.Adapter.trigger(e, \"statechange\"), h.busy(!1), !0));\n }, h.Adapter.bind(e, \"popstate\", h.onPopState), h.pushState = function (t, n, r, i) {\n if (h.getHashByUrl(r) && h.emulated.pushState) throw new Error(\"History.js does not support states with fragement-identifiers (hashes/anchors).\");if (i !== !1 && h.busy()) return h.pushQueue({ scope: h, callback: h.pushState, args: arguments, queue: i }), !1;h.busy(!0);var s = h.createStateObject(t, n, r);return h.isLastSavedState(s) ? h.busy(!1) : (h.storeState(s), h.expectedStateId = s.id, p.pushState(s.id, s.title, s.url), h.Adapter.trigger(e, \"popstate\")), !0;\n }, h.replaceState = function (t, n, r, i) {\n if (h.getHashByUrl(r) && h.emulated.pushState) throw new Error(\"History.js does not support states with fragement-identifiers (hashes/anchors).\");if (i !== !1 && h.busy()) return h.pushQueue({ scope: h, callback: h.replaceState, args: arguments, queue: i }), !1;h.busy(!0);var s = h.createStateObject(t, n, r);return h.isLastSavedState(s) ? h.busy(!1) : (h.storeState(s), h.expectedStateId = s.id, p.replaceState(s.id, s.title, s.url), h.Adapter.trigger(e, \"popstate\")), !0;\n };if (s) {\n try {\n h.store = l.parse(s.getItem(\"History.store\")) || {};\n } catch (m) {\n h.store = {};\n }h.normalizeStore();\n } else h.store = {}, h.normalizeStore();h.Adapter.bind(e, \"unload\", h.clearAllIntervals), h.saveState(h.storeState(h.extractState(h.getLocationHref(), !0))), s && (h.onUnload = function () {\n var e, t, n;try {\n e = l.parse(s.getItem(\"History.store\")) || {};\n } catch (r) {\n e = {};\n }e.idToState = e.idToState || {}, e.urlToId = e.urlToId || {}, e.stateToId = e.stateToId || {};for (t in h.idToState) {\n if (!h.idToState.hasOwnProperty(t)) continue;e.idToState[t] = h.idToState[t];\n }for (t in h.urlToId) {\n if (!h.urlToId.hasOwnProperty(t)) continue;e.urlToId[t] = h.urlToId[t];\n }for (t in h.stateToId) {\n if (!h.stateToId.hasOwnProperty(t)) continue;e.stateToId[t] = h.stateToId[t];\n }h.store = e, h.normalizeStore(), n = l.stringify(e);try {\n s.setItem(\"History.store\", n);\n } catch (i) {\n if (i.code !== DOMException.QUOTA_EXCEEDED_ERR) throw i;s.length && (s.removeItem(\"History.store\"), s.setItem(\"History.store\", n));\n }\n }, h.intervalList.push(a(h.onUnload, h.options.storeInterval)), h.Adapter.bind(e, \"beforeunload\", h.onUnload), h.Adapter.bind(e, \"unload\", h.onUnload));if (!h.emulated.pushState) {\n h.bugs.safariPoll && h.intervalList.push(a(h.safariStatePoll, h.options.safariPollInterval));if (i.vendor === \"Apple Computer, Inc.\" || (i.appCodeName || \"\") === \"Mozilla\") h.Adapter.bind(e, \"hashchange\", function () {\n h.Adapter.trigger(e, \"popstate\");\n }), h.getHash() && h.Adapter.onDomLoad(function () {\n h.Adapter.trigger(e, \"hashchange\");\n });\n }\n }, (!h.options || !h.options.delayInit) && h.init();\n}(window);\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar isArray = function () {\n // Use compiler's own isArray when available\n if (Array.isArray) {\n return Array.isArray;\n }\n\n // Retain references to variables for performance\n // optimization\n var objectToStringFn = Object.prototype.toString,\n arrayToStringResult = objectToStringFn.call([]);\n\n return function (subject) {\n return objectToStringFn.call(subject) === arrayToStringResult;\n };\n}();\n\nfunction GetRequestObject(koObject) {\n var viewModelToUpdate = ko.mapping.toJS(koObject);\n for (var prop in viewModelToUpdate) {\n var parentProperty = viewModelToUpdate[prop];\n if (isArray(parentProperty)) {\n var arrayCopy = parentProperty.slice(0);\n parentProperty.length = 0;\n for (var i = 0; i < arrayCopy.length; i++) {\n if (prop != 'ArticleTypeFilters' && typeof arrayCopy[i].IsSelected !== 'undefined') {\n if (arrayCopy[i].IsSelected == true) {\n parentProperty.push(arrayCopy[i]);\n }\n } else {\n parentProperty.push(arrayCopy[i]);\n }\n };\n } else {\n for (var childProp in parentProperty) {\n var childProperty = parentProperty[childProp];\n if (isArray(childProperty)) {\n var arrayCopy = childProperty.slice(0);\n childProperty.length = 0;\n for (var i = 0; i < arrayCopy.length; i++) {\n if (prop != 'ArticleTypeFilters' && typeof arrayCopy[i].IsSelected !== 'undefined') {\n if (arrayCopy[i].IsSelected == true) {\n childProperty.push(arrayCopy[i]);\n }\n } else {\n childProperty.push(arrayCopy[i]);\n }\n };\n }\n }\n }\n }\n return viewModelToUpdate;\n}\n\nko.GetRequestObject = GetRequestObject;\nko.virtualElements.allowedBindings.bindFilterList = true;\nko.bindingHandlers.bindFilterList = {\n init: function init(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var acInput = $(element);\n var observable = valueAccessor();\n var allBindings = allBindingsAccessor();\n var searchFilters = bindingContext.$root.SearchFilters;\n var root = bindingContext.$root;\n\n observable.toggleSingleSelectFilter = function (data, event) {\n var selectedItem = this;\n event.preventDefault();\n event.stopPropagation();\n\n if (root.hasOwnProperty('HasPendingUpdates') && ko.isObservable(root['HasPendingUpdates'])) {\n root.HasPendingUpdates(true);\n }\n\n if (selectedItem.IsEnabled() == false) {\n if (selectedItem.IsSelected() == true) {\n selectedItem.IsSelected(false);\n if (!!allBindings && $.isFunction(allBindings.bindFilterListClearFunction)) {\n allBindings.bindFilterListClearFunction(allBindings.bindFilterListSearchFunction);\n } else {\n if (!!allBindings && $.isFunction(allBindings.bindFilterListSearchFunction)) {\n allBindings.bindFilterListSearchFunction();\n }\n }\n if (!!allBindings && allBindings.bindFilterListDeleteOnSelect == true) {\n observable.remove(selectedItem);\n }\n }\n return;\n }\n if (selectedItem.IsSelected() == true) {\n selectedItem.IsSelected(false);\n\n //Enabling Select after filter removed\n var selectedItemId = selectedItem.ID();\n $('select.dropdown option[value=\"' + selectedItemId + '\"]').parent().removeAttr(\"disabled\");\n } else {\n selectedItem.IsSelected(true);\n ko.utils.arrayForEach(observable(), function (item) {\n if (item.IsSelected() == true && item.Name() != selectedItem.Name()) {\n item.IsSelected(false);\n }\n });\n }\n if ($.isFunction(selectedItem.ClearFilter)) {\n selectedItem.ClearFilter();\n } else {\n if (!!allBindings && $.isFunction(allBindings.bindFilterListClearFunction)) {\n allBindings.bindFilterListClearFunction(allBindings.bindFilterListSearchFunction);\n } else {\n if (!!allBindings && $.isFunction(allBindings.bindFilterListSearchFunction)) {\n allBindings.bindFilterListSearchFunction();\n }\n }\n }\n if (!!allBindings && allBindings.bindFilterListDeleteOnSelect == true) {\n observable.remove(selectedItem);\n }\n };\n\n observable.toggleMultiSelectFilter = function (data, event) {\n var selectedItem = this;\n event.preventDefault();\n event.stopPropagation();\n\n if (root.hasOwnProperty('HasPendingUpdates') && ko.isObservable(root['HasPendingUpdates'])) {\n root.HasPendingUpdates(true);\n }\n\n if (selectedItem.IsEnabled() == false) {\n if (selectedItem.IsSelected() == true) {\n selectedItem.IsSelected(false);\n if (!!allBindings && $.isFunction(allBindings.bindFilterListClearFunction)) {\n allBindings.bindFilterListClearFunction(allBindings.bindFilterListSearchFunction);\n } else {\n if (!!allBindings && $.isFunction(allBindings.bindFilterListSearchFunction)) {\n allBindings.bindFilterListSearchFunction();\n }\n }\n }\n return;\n }\n if (selectedItem.IsSelected() == true) {\n selectedItem.IsSelected(false);\n } else {\n if (root.hasOwnProperty('IsSelectAll') && ko.isObservable(root['IsSelectAll'])) {\n root.IsSelectAll(false);\n }\n if (root.hasOwnProperty('IsClearAll') && ko.isObservable(root['IsClearAll'])) {\n root.IsClearAll(false);\n }\n\n //Disabling Select after filter chosen\n var selectedItemId = selectedItem.ID();\n $('select.dropdown option[value=\"' + selectedItemId + '\"]').parent().attr(\"disabled\", \"disabled\");\n\n selectedItem.IsSelected(true);\n }\n if ($.isFunction(selectedItem.ClearFilter)) {\n selectedItem.ClearFilter();\n } else {\n if (!!allBindings && $.isFunction(allBindings.bindFilterListClearFunction)) {\n allBindings.bindFilterListClearFunction(allBindings.bindFilterListSearchFunction);\n } else {\n if (!!allBindings && $.isFunction(allBindings.bindFilterListSearchFunction)) {\n allBindings.bindFilterListSearchFunction();\n }\n }\n }\n };\n\n observable.toggleDateRangeFilter = function (data, event) {\n var selectedItem = this;\n event.preventDefault();\n event.stopPropagation();\n\n if (selectedItem.IsEnabled() == false) {\n return;\n }\n if (ko.isObservable(searchFilters.DateRangeFrom) && ko.isObservable(searchFilters.DateRangeTo)) {\n selectedItem.IsSelected(!!searchFilters.DateRangeFrom() && searchFilters.DateRangeFrom() != '' || !!searchFilters.DateRangeTo() && searchFilters.DateRangeTo() != '');\n if (viewModel.AllowMultiSelect() == false) {\n ko.utils.arrayForEach(observable(), function (item) {\n if (item.ID != selectedItem.ID) {\n item.IsSelected(false);\n }\n });\n }\n }\n };\n\n observable.ClearAllFilters = function (data, event) {\n ko.utils.arrayForEach(observable(), function (item) {\n item.IsEnabled(true);\n item.IsSelected(false);\n });\n if (!!allBindings && $.isFunction(allBindings.bindFilterListSearchFunction)) {\n allBindings.bindFilterListSearchFunction();\n }\n };\n }\n};\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nrequire('./knockout/kosearch.js');\nrequire('./jquery.history.js');\nrequire('./features/topicpage-search.js');\n\n$('.js-binding-container').InitializeSearchPage({\n initialJsonData: initialJsonData,\n serviceUrl: \"/api/sitecore/insights/search\"\n});\n\n//// Handling Filter Active State\n$(document).ready(function () {\n var urlParams = new URLSearchParams(window.location.search);\n if (urlParams.has('category')) {\n var categoryLabelElement = document.getElementById('categoryDropDownLabel');\n if (categoryLabelElement != null) {\n var categoryDdElement = document.getElementById('categoryDropDown');\n for (var i = 0; i < categoryDdElement.length; i++) {\n var option = categoryDdElement.options[i];\n if (option.value == urlParams.get('category')) {\n categoryLabelElement.innerHTML = option.text;\n }\n }\n }\n }\n if (urlParams.has('time')) {\n var dateLabelElement = document.getElementById('dateDropDownLabel');\n if (dateLabelElement != null) {\n var dateDdElement = document.getElementById('dateDropDown');\n for (var i = 0; i < dateDdElement.length; i++) {\n var option = dateDdElement.options[i];\n if (option.value == urlParams.get('time')) {\n dateLabelElement.innerHTML = option.text;\n }\n }\n }\n }\n});\n\n},{\"./features/topicpage-search.js\":1,\"./jquery.history.js\":2,\"./knockout/kosearch.js\":3}]},{},[4]);\n"],"file":"topicpage-detail.bundle.js"}