<commit_before>/**
 * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
 * Released under MIT license, http://github.com/requirejs/almond/LICENSE
 */

!function(e,t){"function"==typeof define&&define.amd?define([],t):e.lstrQuickSwitcher=t()}(this,function(){var e,t,s;!function(i){function r(e,t){return y.call(e,t)}function n(e,t){var s,i,r,n,c,l,a,o,h,u,d,f,m=t&&t.split("/"),p=w.map,v=p&&p["*"]||{};if(e){for(e=e.split("/"),c=e.length-1,w.nodeIdCompat&&x.test(e[c])&&(e[c]=e[c].replace(x,"")),"."===e[0].charAt(0)&&m&&(f=m.slice(0,m.length-1),e=f.concat(e)),h=0;h<e.length;h++)if(d=e[h],"."===d)e.splice(h,1),h-=1;else if(".."===d){if(0===h||1===h&&".."===e[2]||".."===e[h-1])continue;h>0&&(e.splice(h-1,2),h-=2)}e=e.join("/")}if((m||v)&&p){for(s=e.split("/"),h=s.length;h>0;h-=1){if(i=s.slice(0,h).join("/"),m)for(u=m.length;u>0;u-=1)if(r=p[m.slice(0,u).join("/")],r&&(r=r[i])){n=r,l=h;break}if(n)break;!a&&v&&v[i]&&(a=v[i],o=h)}!n&&a&&(n=a,l=o),n&&(s.splice(0,l,n),e=s.join("/"))}return e}function c(e,t){return function(){var s=C.call(arguments,0);return"string"!=typeof s[0]&&1===s.length&&s.push(null),m.apply(i,s.concat([e,t]))}}function l(e){return function(t){return n(t,e)}}function a(e){return function(t){b[e]=t}}function o(e){if(r(k,e)){var t=k[e];delete k[e],g[e]=!0,f.apply(i,t)}if(!r(b,e)&&!r(g,e))throw new Error("No "+e);return b[e]}function h(e){var t,s=e?e.indexOf("!"):-1;return s>-1&&(t=e.substring(0,s),e=e.substring(s+1,e.length)),[t,e]}function u(e){return e?h(e):[]}function d(e){return function(){return w&&w.config&&w.config[e]||{}}}var f,m,p,v,b={},k={},w={},g={},y=Object.prototype.hasOwnProperty,C=[].slice,x=/\.js$/;p=function(e,t){var s,i=h(e),r=i[0],c=t[1];return e=i[1],r&&(r=n(r,c),s=o(r)),r?e=s&&s.normalize?s.normalize(e,l(c)):n(e,c):(e=n(e,c),i=h(e),r=i[0],e=i[1],r&&(s=o(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:s}},v={require:function(e){return c(e)},exports:function(e){var t=b[e];return"undefined"!=typeof t?t:b[e]={}},module:function(e){return{id:e,uri:"",exports:b[e],config:d(e)}}},f=function(e,t,s,n){var l,h,d,f,m,w,y,C=[],x=typeof s;if(n=n||e,w=u(n),"undefined"===x||"function"===x){for(t=!t.length&&s.length?["require","exports","module"]:t,m=0;m<t.length;m+=1)if(f=p(t[m],w),h=f.f,"require"===h)C[m]=v.require(e);else if("exports"===h)C[m]=v.exports(e),y=!0;else if("module"===h)l=C[m]=v.module(e);else if(r(b,h)||r(k,h)||r(g,h))C[m]=o(h);else{if(!f.p)throw new Error(e+" missing "+h);f.p.load(f.n,c(n,!0),a(h),{}),C[m]=b[h]}d=s?s.apply(b[e],C):void 0,e&&(l&&l.exports!==i&&l.exports!==b[e]?b[e]=l.exports:d===i&&y||(b[e]=d))}else e&&(b[e]=s)},e=t=m=function(e,t,s,r,n){if("string"==typeof e)return v[e]?v[e](t):o(p(e,u(t)).f);if(!e.splice){if(w=e,w.deps&&m(w.deps,w.callback),!t)return;t.splice?(e=t,t=s,s=null):e=i}return t=t||function(){},"function"==typeof s&&(s=r,r=n),r?f(i,e,t,s):setTimeout(function(){f(i,e,t,s)},4),m},m.config=function(e){return m(e)},e._defined=b,s=function(e,t,s){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(s=t,t=[]),r(b,e)||r(k,e)||(k[e]=[e,t,s])},s.amd={jQuery:!0}}(),s("../node_modules/almond/almond",function(){}),s("filters",[],function(){return{isFuzzyMatch:function(e,t){for(var s=0,i=0;s<e.length&&i<t.length;s++)for(;i<t.length&&(i++,e.charAt(s)!==t.charAt(i)););return i<t.length},areWordsFound:function(e,t){for(var s=e.split(/[^\w]/),i=0;i<s.length;i++)if(t.indexOf(s[i])===-1)return!1;return!0},isMatch:function(e,t){return t.indexOf(e)!==-1||!!this.areWordsFound(e,t)}}}),s("tracker/statistic",[],function(){var e=function(){return Math.floor((new Date).getTime()/1e3)},t={create:function(e){var s=Object.create(t);return s.init(e),s},init:function(e){return e?(this.timestamps=e.timestamps,void(this.count=e.count)):(this.timestamps=[],void(this.count=0))},increment:function(){for(this.timestamps.push(e()),++this.count;this.timestamps.length>10;)this.timestamps.shift()},score:function(){if(!this.timestamps.length)return 0;var t=e(),s=this.timestamps.reduce(function(e,s){return s>t-14400?e+100:s>t-86400?e+80:s>t-259200?e+60:s>t-25200?e+40:s>t-108e3?e+20:s>t-324e3?e+10:e},0);return this.count*s/this.timestamps.length}};return t}),s("tracker/selection",["tracker/statistic"],function(e){var t=function(e){return e.toLowerCase()};return{init:function(s){if(s){var i=this;return this.overall=e.create(s.overall),this.searchKeys={},void Object.keys(s.searchKeys).forEach(function(r){r=t(r);var n=e.create(s.searchKeys[r]);i.searchKeys[r]=n})}this.overall=e.create(),this.searchKeys={}},increment:function(s){this.overall.increment(),s&&(s=t(s),this.searchKeys[s]||(this.searchKeys[s]=e.create()),this.searchKeys[s].increment())},score:function(e){return e=t(e),e&&this.searchKeys[e]?this.searchKeys[e].score():.5*this.overall.score()}}}),s("tracker",["tracker/selection"],function(e){return{init:function(t){if(this.name=t,this.localStorageName="qswitcher-tracker-"+t,this.selections={},window.localStorage){var s=localStorage.getItem(this.localStorageName);if(s){this.selections=JSON.parse(s);var i=this;Object.keys(this.selections).forEach(function(t){var s=Object.create(e);s.init(i.selections[t]),i.selections[t]=s})}}},trackSelection:function(t,s){if(t.trackerId){var i=t.trackerId;this.selections[i]||(this.selections[i]=Object.create(e),this.selections[i].init()),this.selections[i].increment(s),this.save()}},sort:function(e,t){var s=this,i=0;return e.forEach(function(e){e._qswitcherOriginalOrder=i,e._qswitcherScore=s.scoreSelection(e,t),i++}),e.sort(function(e,t){return e._qswitcherScore==t._qswitcherScore?e._qswitcherOriginalOrder<t._qswitcherOriginalOrder?-1:1:e._qswitcherScore>t._qswitcherScore?-1:1}),e.forEach(function(e){delete e._qswitcherOriginalOrder,delete e._qswitcherScore}),e},save:function(){window.localStorage&&localStorage.setItem(this.localStorageName,JSON.stringify(this.selections))},scoreSelection:function(e,t){var s=this.selections[e.trackerId];return"undefined"==typeof s?0:s.score(t)}}}),s("factories",["tracker"],function(e){var t={};return{tracker:function(s){if("undefined"!=typeof t[s])return t[s];var i=Object.create(e);return i.init(s),t[s]=i,t[s]}}}),s("selected-result",["factories"],function(e){return{init:function(e,t,s){this.selectedValue=e,this.searchText=t,this.domEvent=s},trackAs:function(t){e.tracker(t).trackSelection(this.selectedValue,this.searchText)}}}),s("sorters",["factories"],function(e){return{tracker:function(t){return e.tracker(t)}}});var i=function(e,t,s){var i=jQuery,r={filters:e,sorters:s},n=function(e){return"function"==typeof e?e():e},c={init:function(e,t){this.$parentDom=null,this.$liCollection=null,this.valueObjects=null,this.selectedIndex=null,this.$results=null,this.$noSearchTerms=null,this.$noResults=null,this.$loading=null,this.$breadcrumb=null,this.$search=null,this.searchText="",this.searchDelayTimeout=null,this.searchId=0,this.modifierKey="ctrlKey",navigator.platform.toLowerCase().indexOf("mac")!=-1&&(this.modifierKey="metaKey"),t=i.extend({searchCallback:function(){},selectCallback:function(){},selectChildSearchCallback:function(){},searchDelay:1e3,hotKey:"K"},t),this.hotKey=t.hotKey.toUpperCase(),this.setOptions({searchCallback:t.searchCallback,selectCallback:t.selectCallback,selectChildSearchCallback:t.selectChildSearchCallback,searchDelay:t.searchDelay}),this.initDomElement(e),this.callbackStack=[],this.abortSearchCallback=null},initDomElement:function(e){var t=this;this.$parentDom=e,this.$domElement=i('<div class="lstr-qswitcher-overlay"></div><div class="lstr-qswitcher-container">  <form class="lstr-qswitcher-popup">    <div class="lstr-qswitcher-breadcrumb">    </div>    <div class="lstr-qswitcher-help">      <ul>        <li><em>&#8597;</em> to navigate</li>        <li><em>&#8629;</em> to select</li>        <li><em>&#9003;</em> to clear</li>        <li><em>esc</em> to dismiss</li>      </ul>    </div>    <input type="text" class="lstr-qswitcher-search form-control" />    <div class="lstr-qswitcher-loading">Loading...</div>    <div class="lstr-qswitcher-no-terms"></div>    <div class="lstr-qswitcher-no-results">No results found</div>    <div class="lstr-qswitcher-oops-results">      Oops! Something went wrong while trying to load your results.    </div>    <div class="lstr-qswitcher-results"></div>  </form></div>'),e.append(this.$domElement),this.$breadcrumb=this.$domElement.find(".lstr-qswitcher-breadcrumb"),this.$search=this.$domElement.find(".lstr-qswitcher-search"),this.$loading=this.$domElement.find(".lstr-qswitcher-loading"),this.$results=this.$domElement.find(".lstr-qswitcher-results"),this.$noSearchTerms=this.$domElement.find(".lstr-qswitcher-no-terms"),this.$noResults=this.$domElement.find(".lstr-qswitcher-no-results"),this.$oopsResults=this.$domElement.find(".lstr-qswitcher-oops-results");var s=this.$domElement;s.find(".lstr-qswitcher-popup").on("submit",function(e){e.preventDefault()}),e.find(".lstr-qswitcher-overlay").on("click",function(e){t.closeSwitcher(),e.preventDefault()}),e.on("keydown",function(e){var s=String.fromCharCode(e.which);e[t.modifierKey]&&s===t.hotKey&&(t.toggleSwitcher(),e.preventDefault())}),i("html").on("keydown",".lstr-qswitcher-noscroll",function(e){38===e.which?(t.selectIndex(t.selectedIndex-1),t.scrollToSelectedItem(),e.preventDefault()):40===e.which?(t.selectIndex(t.selectedIndex+1),t.scrollToSelectedItem(),e.preventDefault()):27===e.which?(t.toggleSwitcher(),e.preventDefault()):13===e.keyCode&&(t.triggerSelect(t.selectedIndex,e),e.preventDefault())}),this.$search.on("keyup",function(e){var s=t.$search.val();t.searchDelayTimeout&&(clearTimeout(t.searchDelayTimeout),t.searchDelayTimeout=null),s!==t.searchText?t.searchDelayTimeout=setTimeout(function(){t.selectIndex(null),t.searchText=s,t.renderList()},t.searchDelay):8===e.which&&""===s&&(t.popCallback(),t.renderList())}),s.on("mouseover",".lstr-qswitcher-results li",function(){var e=i(this);t.selectIndex(e.data("lstr-qswitcher").index)}),s.on("click",".lstr-qswitcher-results li",function(e){var s=i(this);t.triggerSelect(s.data("lstr-qswitcher").index,e)})},renderList:function(){this.abortSearchCallback&&(this.abortSearchCallback(),this.abortSearchCallback=null),this.renderBreadcrumb(),this.usePane(this.$loading);var e=Object.create(r);++this.searchId,e.setResults=this.setResults.bind(this,this.searchId),e.setError=this.setError.bind(this,this.searchId),this.abortSearchCallback=this.searchCallback(this.searchText,e)},setResults:function(e,t){if(e===this.searchId){var s=this;if(s.valueObjects=[],0==t.length)return this.$results.html(""),void this.usePane(this.searchText?this.$noResults:this.$noSearchTerms);var r=i("<ul>");t.forEach(function(e,t){var n=i("<li>"),c=i("<div>");if(r.append(n),n.append(c),s.setListText(c,e),e.description){var l=i('<span class="lstr-qswitcher-results-description"></span>');s.setListText(l,e.description),n.prepend(l)}n.data("lstr-qswitcher",{index:t}),c.addClass("lstr-qswitcher-result-container"),e.searchCallback&&n.addClass("lstr-qswitcher-result-category"),s.valueObjects[t]={index:t,value:e,$li:n}}),this.$results.html(r),this.usePane(this.$results),s.selectIndex(0)}},setError:function(e){e===this.searchId&&this.usePane(this.$oopsResults)},renderBreadcrumb:function(){var e=i("<ul>");this.callbackStack.forEach(function(t,s){var r=i("<li>");r.text(t.text),e.append(r)}),this.$breadcrumb.html(e)},setListText:function(e,t){return t.html?void e.html(n(t.html)):t.text?void e.html(n(t.text)):void e.text(t)},selectIndex:function(e){if(this.selectedIndex!==e){if(null!==this.selectedIndex&&this.valueObjects[this.selectedIndex]&&this.valueObjects[this.selectedIndex].$li.removeClass("lstr-qswitcher-result-selected"),null===e||0===this.valueObjects.length)return void(this.selectedIndex=null);this.selectedIndex=e%this.valueObjects.length,this.selectedIndex<0&&(this.selectedIndex=this.valueObjects.length-1),this.valueObjects[this.selectedIndex].$li.addClass("lstr-qswitcher-result-selected")}},scrollToSelectedItem:function(){if(null!==this.selectedIndex){var e=this.valueObjects[this.selectedIndex].$li,t=this.$results,s=e.offset().top-e.parent().offset().top,i=s+e.outerHeight(!0),r=t.scrollTop(),n=r+t.outerHeight(!0);(i>n||s<r)&&t.scrollTop(s)}},toggleSwitcher:function(){this.useRootCallback(),this.$search.val(""),this.searchText="",this.renderList(),this.$parentDom.toggleClass("lstr-qswitcher-noscroll"),this.$search.focus()},closeSwitcher:function(){this.$parentDom.removeClass("lstr-qswitcher-noscroll")},triggerSelect:function(e,s){if(null!==e){var i=this.valueObjects[e].value,r=Object.create(t);if(r.init(i,this.searchText,s),i.searchCallback){if(!1===this.selectChildSearchCallback(r))return;return this.callbackStack.push({text:i.breadcrumbText,parent:this.options}),this.options=i,this.searchCallback=i.searchCallback,i.searchDelay&&(this.searchDelay=i.searchDelay),i.selectCallback&&(this.selectCallback=i.selectCallback),i.selectChildSearchCallback&&(this.selectChildSearchCallback=i.selectChildSearchCallback),this.valueObjects=[],this.selectIndex(null),this.$search.val(""),this.searchText="",void this.renderList()}!1!==this.selectCallback(r)&&this.closeSwitcher()}},popCallback:function(){var e=this.callbackStack.pop();return!!e&&(this.setOptions(e.parent),!0)},useRootCallback:function(){for(;this.callbackStack.length>0;)this.popCallback()},usePane:function(e){this.$results.hide(),this.$noSearchTerms.hide(),this.$noResults.hide(),this.$oopsResults.hide(),this.$loading.hide(),e.show()},setOptions:function(e){this.options=e,this.searchCallback=e.searchCallback,this.searchDelay=e.searchDelay,this.selectCallback=e.selectCallback,this.selectChildSearchCallback=e.selectChildSearchCallback}};return lstrQuickSwitcher=function(e){var t=i("body"),s=Object.create(c);s.init(t,e)},lstrQuickSwitcher};return s("quick-switcher",["filters","selected-result","sorters"],i),t("quick-switcher")});<commit_msg>Build set of changes that fixed highlighting<commit_after>/**
 * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
 * Released under MIT license, http://github.com/requirejs/almond/LICENSE
 */

!function(e,t){"function"==typeof define&&define.amd?define([],t):e.lstrQuickSwitcher=t()}(this,function(){var e,t,s;!function(i){function r(e,t){return y.call(e,t)}function n(e,t){var s,i,r,n,c,l,a,o,h,u,d,f,m=t&&t.split("/"),p=w.map,v=p&&p["*"]||{};if(e){for(e=e.split("/"),c=e.length-1,w.nodeIdCompat&&S.test(e[c])&&(e[c]=e[c].replace(S,"")),"."===e[0].charAt(0)&&m&&(f=m.slice(0,m.length-1),e=f.concat(e)),h=0;h<e.length;h++)if(d=e[h],"."===d)e.splice(h,1),h-=1;else if(".."===d){if(0===h||1===h&&".."===e[2]||".."===e[h-1])continue;h>0&&(e.splice(h-1,2),h-=2)}e=e.join("/")}if((m||v)&&p){for(s=e.split("/"),h=s.length;h>0;h-=1){if(i=s.slice(0,h).join("/"),m)for(u=m.length;u>0;u-=1)if(r=p[m.slice(0,u).join("/")],r&&(r=r[i])){n=r,l=h;break}if(n)break;!a&&v&&v[i]&&(a=v[i],o=h)}!n&&a&&(n=a,l=o),n&&(s.splice(0,l,n),e=s.join("/"))}return e}function c(e,t){return function(){var s=C.call(arguments,0);return"string"!=typeof s[0]&&1===s.length&&s.push(null),m.apply(i,s.concat([e,t]))}}function l(e){return function(t){return n(t,e)}}function a(e){return function(t){b[e]=t}}function o(e){if(r(k,e)){var t=k[e];delete k[e],g[e]=!0,f.apply(i,t)}if(!r(b,e)&&!r(g,e))throw new Error("No "+e);return b[e]}function h(e){var t,s=e?e.indexOf("!"):-1;return s>-1&&(t=e.substring(0,s),e=e.substring(s+1,e.length)),[t,e]}function u(e){return e?h(e):[]}function d(e){return function(){return w&&w.config&&w.config[e]||{}}}var f,m,p,v,b={},k={},w={},g={},y=Object.prototype.hasOwnProperty,C=[].slice,S=/\.js$/;p=function(e,t){var s,i=h(e),r=i[0],c=t[1];return e=i[1],r&&(r=n(r,c),s=o(r)),r?e=s&&s.normalize?s.normalize(e,l(c)):n(e,c):(e=n(e,c),i=h(e),r=i[0],e=i[1],r&&(s=o(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:s}},v={require:function(e){return c(e)},exports:function(e){var t=b[e];return"undefined"!=typeof t?t:b[e]={}},module:function(e){return{id:e,uri:"",exports:b[e],config:d(e)}}},f=function(e,t,s,n){var l,h,d,f,m,w,y,C=[],S=typeof s;if(n=n||e,w=u(n),"undefined"===S||"function"===S){for(t=!t.length&&s.length?["require","exports","module"]:t,m=0;m<t.length;m+=1)if(f=p(t[m],w),h=f.f,"require"===h)C[m]=v.require(e);else if("exports"===h)C[m]=v.exports(e),y=!0;else if("module"===h)l=C[m]=v.module(e);else if(r(b,h)||r(k,h)||r(g,h))C[m]=o(h);else{if(!f.p)throw new Error(e+" missing "+h);f.p.load(f.n,c(n,!0),a(h),{}),C[m]=b[h]}d=s?s.apply(b[e],C):void 0,e&&(l&&l.exports!==i&&l.exports!==b[e]?b[e]=l.exports:d===i&&y||(b[e]=d))}else e&&(b[e]=s)},e=t=m=function(e,t,s,r,n){if("string"==typeof e)return v[e]?v[e](t):o(p(e,u(t)).f);if(!e.splice){if(w=e,w.deps&&m(w.deps,w.callback),!t)return;t.splice?(e=t,t=s,s=null):e=i}return t=t||function(){},"function"==typeof s&&(s=r,r=n),r?f(i,e,t,s):setTimeout(function(){f(i,e,t,s)},4),m},m.config=function(e){return m(e)},e._defined=b,s=function(e,t,s){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(s=t,t=[]),r(b,e)||r(k,e)||(k[e]=[e,t,s])},s.amd={jQuery:!0}}(),s("../node_modules/almond/almond",function(){}),s("filters",[],function(){return{isFuzzyMatch:function(e,t){for(var s=0,i=0;s<e.length&&i<t.length;s++)for(;i<t.length&&(i++,e.charAt(s)!==t.charAt(i)););return i<t.length},areWordsFound:function(e,t){for(var s=e.split(/[^\w]/),i=0;i<s.length;i++)if(t.indexOf(s[i])===-1)return!1;return!0},isMatch:function(e,t){return t.indexOf(e)!==-1||!!this.areWordsFound(e,t)}}}),s("tracker/statistic",[],function(){var e=function(){return Math.floor((new Date).getTime()/1e3)},t={create:function(e){var s=Object.create(t);return s.init(e),s},init:function(e){return e?(this.timestamps=e.timestamps,void(this.count=e.count)):(this.timestamps=[],void(this.count=0))},increment:function(){for(this.timestamps.push(e()),++this.count;this.timestamps.length>10;)this.timestamps.shift()},score:function(){if(!this.timestamps.length)return 0;var t=e(),s=this.timestamps.reduce(function(e,s){return s>t-14400?e+100:s>t-86400?e+80:s>t-259200?e+60:s>t-25200?e+40:s>t-108e3?e+20:s>t-324e3?e+10:e},0);return this.count*s/this.timestamps.length}};return t}),s("tracker/selection",["tracker/statistic"],function(e){var t=function(e){return e.toLowerCase()};return{init:function(s){if(s){var i=this;return this.overall=e.create(s.overall),this.searchKeys={},void Object.keys(s.searchKeys).forEach(function(r){r=t(r);var n=e.create(s.searchKeys[r]);i.searchKeys[r]=n})}this.overall=e.create(),this.searchKeys={}},increment:function(s){this.overall.increment(),s&&(s=t(s),this.searchKeys[s]||(this.searchKeys[s]=e.create()),this.searchKeys[s].increment())},score:function(e){return e=t(e),e&&this.searchKeys[e]?this.searchKeys[e].score():.5*this.overall.score()}}}),s("tracker",["tracker/selection"],function(e){return{init:function(t){if(this.name=t,this.localStorageName="qswitcher-tracker-"+t,this.selections={},window.localStorage){var s=localStorage.getItem(this.localStorageName);if(s){this.selections=JSON.parse(s);var i=this;Object.keys(this.selections).forEach(function(t){var s=Object.create(e);s.init(i.selections[t]),i.selections[t]=s})}}},trackSelection:function(t,s){if(t.trackerId){var i=t.trackerId;this.selections[i]||(this.selections[i]=Object.create(e),this.selections[i].init()),this.selections[i].increment(s),this.save()}},sort:function(e,t){var s=this,i=0;return e.forEach(function(e){e._qswitcherOriginalOrder=i,e._qswitcherScore=s.scoreSelection(e,t),i++}),e.sort(function(e,t){return e._qswitcherScore==t._qswitcherScore?e._qswitcherOriginalOrder<t._qswitcherOriginalOrder?-1:1:e._qswitcherScore>t._qswitcherScore?-1:1}),e.forEach(function(e){delete e._qswitcherOriginalOrder,delete e._qswitcherScore}),e},save:function(){window.localStorage&&localStorage.setItem(this.localStorageName,JSON.stringify(this.selections))},scoreSelection:function(e,t){var s=this.selections[e.trackerId];return"undefined"==typeof s?0:s.score(t)}}}),s("factories",["tracker"],function(e){var t={};return{tracker:function(s){if("undefined"!=typeof t[s])return t[s];var i=Object.create(e);return i.init(s),t[s]=i,t[s]}}}),s("selected-result",["factories"],function(e){return{init:function(e,t,s){this.selectedValue=e,this.searchText=t,this.domEvent=s},trackAs:function(t){e.tracker(t).trackSelection(this.selectedValue,this.searchText)}}}),s("sorters",["factories"],function(e){return{tracker:function(t){return e.tracker(t)}}});var i=function(e,t,s){var i=jQuery,r={filters:e,sorters:s},n=function(e){return"function"==typeof e?e():e},c={init:function(e,t){this.$parentDom=null,this.$liCollection=null,this.valueObjects=null,this.selectedIndex=null,this.$results=null,this.$noSearchTerms=null,this.$noResults=null,this.$loading=null,this.$breadcrumb=null,this.$search=null,this.searchText="",this.searchDelayTimeout=null,this.searchId=0,this.modifierKey="ctrlKey",navigator.platform.toLowerCase().indexOf("mac")!=-1&&(this.modifierKey="metaKey"),t=i.extend({searchCallback:function(){},selectCallback:function(){},selectChildSearchCallback:function(){},searchDelay:1e3,hotKey:"K"},t),this.hotKey=t.hotKey.toUpperCase(),this.setOptions({searchCallback:t.searchCallback,selectCallback:t.selectCallback,selectChildSearchCallback:t.selectChildSearchCallback,searchDelay:t.searchDelay}),this.initDomElement(e),this.callbackStack=[],this.abortSearchCallback=null},initDomElement:function(e){var t=this;this.$parentDom=e,this.$domElement=i('<div class="lstr-qswitcher-overlay"></div><div class="lstr-qswitcher-container">  <form class="lstr-qswitcher-popup">    <div class="lstr-qswitcher-breadcrumb">    </div>    <div class="lstr-qswitcher-help">      <ul>        <li><em>&#8597;</em> to navigate</li>        <li><em>&#8629;</em> to select</li>        <li><em>&#9003;</em> to clear</li>        <li><em>esc</em> to dismiss</li>      </ul>    </div>    <input type="text" class="lstr-qswitcher-search form-control" />    <div class="lstr-qswitcher-loading">Loading...</div>    <div class="lstr-qswitcher-no-terms"></div>    <div class="lstr-qswitcher-no-results">No results found</div>    <div class="lstr-qswitcher-oops-results">      Oops! Something went wrong while trying to load your results.    </div>    <div class="lstr-qswitcher-results"></div>  </form></div>'),e.append(this.$domElement),this.$breadcrumb=this.$domElement.find(".lstr-qswitcher-breadcrumb"),this.$search=this.$domElement.find(".lstr-qswitcher-search"),this.$loading=this.$domElement.find(".lstr-qswitcher-loading"),this.$results=this.$domElement.find(".lstr-qswitcher-results"),this.$noSearchTerms=this.$domElement.find(".lstr-qswitcher-no-terms"),this.$noResults=this.$domElement.find(".lstr-qswitcher-no-results"),this.$oopsResults=this.$domElement.find(".lstr-qswitcher-oops-results");var s=this.$domElement;s.find(".lstr-qswitcher-popup").on("submit",function(e){e.preventDefault()}),e.find(".lstr-qswitcher-overlay").on("click",function(e){t.closeSwitcher(),e.preventDefault()}),e.on("keydown",function(e){var s=String.fromCharCode(e.which);e[t.modifierKey]&&s===t.hotKey&&(t.toggleSwitcher(),e.preventDefault())}),i("html").on("keydown",".lstr-qswitcher-noscroll",function(e){38===e.which?(t.selectIndex(t.selectedIndex-1),t.scrollToSelectedItem(),e.preventDefault()):40===e.which?(t.selectIndex(t.selectedIndex+1),t.scrollToSelectedItem(),e.preventDefault()):27===e.which?(t.toggleSwitcher(),e.preventDefault()):13===e.keyCode&&(t.triggerSelect(t.selectedIndex,e),e.preventDefault())}),this.$search.on("keyup",function(e){var s=t.$search.val();t.searchDelayTimeout&&(clearTimeout(t.searchDelayTimeout),t.searchDelayTimeout=null),s!==t.searchText?t.searchDelayTimeout=setTimeout(function(){t.selectIndex(null),t.searchText=s,t.renderList()},t.searchDelay):8===e.which&&""===s&&(t.popCallback(),t.renderList())}),s.on("mouseover",".lstr-qswitcher-results li",function(){var e=i(this);t.selectIndex(e.data("lstr-qswitcher").index)}),s.on("click",".lstr-qswitcher-results li",function(e){var s=i(this);t.triggerSelect(s.data("lstr-qswitcher").index,e)})},renderList:function(){this.abortSearchCallback&&(this.abortSearchCallback(),this.abortSearchCallback=null),this.renderBreadcrumb(),this.usePane(this.$loading);var e=Object.create(r);++this.searchId,e.setResults=this.setResults.bind(this,this.searchId),e.setError=this.setError.bind(this,this.searchId),this.abortSearchCallback=this.searchCallback(this.searchText,e)},setResults:function(e,t){if(e===this.searchId){var s=this;if(s.valueObjects=[],0==t.length)return this.$results.html(""),void this.usePane(this.searchText?this.$noResults:this.$noSearchTerms);var r=i("<ul>");t.forEach(function(e,t){var n=i("<li>"),c=i("<div>");if(r.append(n),n.append(c),s.setListText(c,e),e.description){var l=i('<span class="lstr-qswitcher-results-description"></span>');s.setListText(l,e.description),n.prepend(l)}n.data("lstr-qswitcher",{index:t}),c.addClass("lstr-qswitcher-result-container"),e.searchCallback&&n.addClass("lstr-qswitcher-result-category"),s.valueObjects[t]={index:t,value:e,$li:n}}),this.$results.html(r),this.usePane(this.$results),s.selectIndex(0)}},setError:function(e){e===this.searchId&&this.usePane(this.$oopsResults)},renderBreadcrumb:function(){var e=i("<ul>");this.callbackStack.forEach(function(t,s){var r=i("<li>");r.text(t.text),e.append(r)}),this.$breadcrumb.html(e)},setListText:function(e,t){return t.html?void e.html(n(t.html)):t.text?void e.html(n(t.text)):void e.text(t)},selectIndex:function(e){return null!==this.selectedIndex&&this.valueObjects[this.selectedIndex]&&this.valueObjects[this.selectedIndex].$li.removeClass("lstr-qswitcher-result-selected"),null===e||0===this.valueObjects.length?void(this.selectedIndex=null):(this.selectedIndex=e%this.valueObjects.length,this.selectedIndex<0&&(this.selectedIndex=this.valueObjects.length-1),void this.valueObjects[this.selectedIndex].$li.addClass("lstr-qswitcher-result-selected"))},scrollToSelectedItem:function(){if(null!==this.selectedIndex){var e=this.valueObjects[this.selectedIndex].$li,t=this.$results,s=e.offset().top-e.parent().offset().top,i=s+e.outerHeight(!0),r=t.scrollTop(),n=r+t.outerHeight(!0);(i>n||s<r)&&t.scrollTop(s)}},toggleSwitcher:function(){this.useRootCallback(),this.$search.val(""),this.searchText="",this.renderList(),this.$parentDom.toggleClass("lstr-qswitcher-noscroll"),this.$search.focus()},closeSwitcher:function(){this.$parentDom.removeClass("lstr-qswitcher-noscroll")},triggerSelect:function(e,s){if(null!==e){var i=this.valueObjects[e].value,r=Object.create(t);if(r.init(i,this.searchText,s),i.searchCallback){if(!1===this.selectChildSearchCallback(r))return;return this.callbackStack.push({text:i.breadcrumbText,parent:this.options}),this.options=i,this.searchCallback=i.searchCallback,i.searchDelay&&(this.searchDelay=i.searchDelay),i.selectCallback&&(this.selectCallback=i.selectCallback),i.selectChildSearchCallback&&(this.selectChildSearchCallback=i.selectChildSearchCallback),this.valueObjects=[],this.selectIndex(null),this.$search.val(""),this.searchText="",void this.renderList()}!1!==this.selectCallback(r)&&this.closeSwitcher()}},popCallback:function(){var e=this.callbackStack.pop();return!!e&&(this.setOptions(e.parent),!0)},useRootCallback:function(){for(;this.callbackStack.length>0;)this.popCallback()},usePane:function(e){this.$results.hide(),this.$noSearchTerms.hide(),this.$noResults.hide(),this.$oopsResults.hide(),this.$loading.hide(),e.show()},setOptions:function(e){this.options=e,this.searchCallback=e.searchCallback,this.searchDelay=e.searchDelay,this.selectCallback=e.selectCallback,this.selectChildSearchCallback=e.selectChildSearchCallback}};return lstrQuickSwitcher=function(e){var t=i("body"),s=Object.create(c);s.init(t,e)},lstrQuickSwitcher};return s("quick-switcher",["filters","selected-result","sorters"],i),t("quick-switcher")});
{'fraction_non_alphanumeric': 0.26322984494729645, 'fraction_numerical': 0.01057668093679174, 'mean_word_length': 13.622830089426618, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 123, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '327708', 'n_tokens_mistral': 11034, 'n_tokens_neox': 11098, 'n_words': 418}