PageSourceSearch

https://www.lonestar.edu/js/addsearch/ui.min.js?v=202508122

js lonestar.edu collected 2026-10-01 10:30:20 UTC 10,390 bytes, 149 lines download raw bytes

1!(function (e) {
2	var a = {};
3	function t(n) {
4		if (a[n]) return a[n].exports;
5		var s = (a[n] = { i: n, l: !1, exports: {} });
6		return e[n].call(s.exports, s, s.exports, t), (s.l = !0), s.exports;
7	}
8	(t.m = e),
9		(t.c = a),
10		(t.d = function (e, a, n) {
11			t.o(e, a) || Object.defineProperty(e, a, { enumerable: !0, get: n });
12		}),
13		(t.r = function (e) {
14			'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }), Object.defineProperty(e, '__esModule', { value: !0 });
15		}),
16		(t.t = function (e, a) {
17			if ((1 & a && (e = t(e)), 8 & a)) return e;
18			if (4 & a && 'object' == typeof e && e && e.__esModule) return e;
19			var n = Object.create(null);
20			if ((t.r(n), Object.defineProperty(n, 'default', { enumerable: !0, value: e }), 2 & a && 'string' != typeof e))
21				for (var s in e)
22					t.d(
23						n,
24						s,
25						function (a) {
26							return e[a];
27						}.bind(null, s)
28					);
29			return n;
30		}),
31		(t.n = function (e) {
32			var a =
33				e && e.__esModule
34					? function () {
35							return e.default;
36					  }
37					: function () {
38							return e;
39					  };
40			return t.d(a, 'a', a), a;
41		}),
42		(t.o = function (e, a) {
43			return Object.prototype.hasOwnProperty.call(e, a);
44		}),
45		(t.p = ''),
46		t((t.s = 0));
47})([
48	function (e, a, t) {
49		t(1), (e.exports = t(2));
50	},
51	function (e, a, t) {},
52	function (e, a) {
53		var t = new AddSearchClient('dded8a60295fe9cc7de4a72c5639039c');
54		
55		// EDUB
56		t.setSearchOperator('and');
57		
58		window.searchResultsPageUrl && (n.searchResultsPageUrl = window.searchResultsPageUrl);
59		var s = new AddSearchUI(t, { hasAiAnswers: true }),
60			i = new AddSearchClient('dded8a60295fe9cc7de4a72c5639039c');
61			
62		// Instantiate AI Answers UI (place among your existing components)
63		s.aiAnswersResult({
64			containerId: 'ai-answers-result-container',
65			mainHeadlineText: 'AI-generated answer',
66			answerMaxHeight: 150,
67			sourcesHeadlineText: 'Based on the following sources:',
68			hasHideToggle: true
69		});
70		// Quan's modal
71		const addSearchUIModal = new AddSearchUI(i, { hasAiAnswers: true });
72
73		addSearchUIModal.searchField({
74			containerId: 'searchfield-container-modal',
75			placeholder: 'Type your question',
76			button: 'Go'
77		});
78		addSearchUIModal.aiAnswersResult({
79			containerId: 'ai-answers-result-container-modal',
80			mainHeadlineText: 'AI-generated answer',
81			answerMaxHeight: 200,
82			sourcesHeadlineText: 'Based on the following sources:',
83		});
84			
85		// Quan's modal	
86		var d = new AddSearchClient('dded8a60295fe9cc7de4a72c5639039c');
87		d.setPaging(1, 5, 'relevance', 'desc'), t.addFacetField('custom_fields.camp');
88
89		if (
90			(document.getElementById('autocomplete-container') &&
91				s.autocomplete({
92					containerId: 'autocomplete-container',
93					template:
94						'\n  <div class="addsearch-autocomplete">\n   {{#gt suggestions.length 0}}\n   <div class="adds-suggestions-main-wrapper">  \n    <h3 class="adds-title">Suggestions</h3>\n    <ul class="suggestions adds-suggestions-container">\n      {{#each ../suggestions}}\n        <li class="adds-suggestion" data-keyword="{{value}}" data-index="{{@index}}" {{#equals ../../activeSuggestionIndex @index}}class="active"{{/equals}}>\n          {{value}}\n        </li>\n      {{/each}}\n    </ul>\n   </div>\n  {{/gt}}\n    {{#gt searchResults.hits.length 0}}\n    {{keyword}}\n      <div class="adds-hits-main-wrapper">\n        <h3 class="adds-title">Results</h3>\n        <ul class="suggestions adds-suggestions-container">\n        {{#each ../searchResults.hits}}\n        <li>\n        <a href="{{url}}" data-analytics-click="{{id}}" class="adds-hit">\n        <div class="adds-hit-wrapper">\n           \x3c!-- <div class="adds-hit-top">\n             <div class="adds-main-image {{#unless images.main}}noimage{{/unless}}">\n               {{#if images.main}}<div class="adds-aspect"><img src="{{images.main}}" alt="{{title}}" /></div>{{/if}} \n             </div>\n            </div> --\x3e\n            <div class="adds-hit-bottom">\n                <h2 class="adds-hit-title">\n                    {{#if custom_fields.name}}{{custom_fields.name}}{{else}}{{title}}{{/if}}\n                </h2>           \n            </div>\n            <div class="adds-highlight">        \n               {{{highlight}}}\n            </div>\n               {{#if custom_fields.camp}}\n                  <div class="adds-category-wrapper">
94\n                    <span class="adds-category">\n                      Campus: {{custom_fields.camp}}\n                    </span>\n                  </div>\n              {{/if}}\n           </div>\n           </a>\n           </li>\n        {{/each}}\n        </ul>\n      </div>\n    {{/gt}}    \n  </div>\n',
95					hideAutomatically: !1,
96					sources: [
97						{ type: AddSearchUI.AUTOCOMPLETE_TYPE.SUGGESTIONS, client: d, jsonKey: 'results' },
98						{ type: AddSearchUI.AUTOCOMPLETE_TYPE.SEARCH, client: i, jsonKey: 'hits' },
99					],
100				}),
101			document.getElementById('searchfield-container') &&
102				s.searchField({
103					containerId: 'searchfield-container',
104					placeholder: 'Keyword..',
105					button: 'Search',
106					icon: !0,
107					template:
108						'\n  <div class="addsearch-searchfield-container">\n    <form class="addsearch-searchfield" autocomplete="off" action="?" role="search">\n      <div class="search-field-wrapper">     \n        <input type="search" placeholder="{{placeholder}}" aria-label="Search field" class="{{#not icon false}}icon{{/not}} addsearch" />\n      </div>\n      {{#if button}}\n        <button type="button" aria-label="Search button" >{{button}}</button>\n      {{/if}}\n    </form>\n  </div>\n',
109				}),
110			document.getElementById('searchresults-container') &&
111				s.searchResults({
112					containerId: 'searchresults-container',
113					template:
114						'\n   <div class="addsearch-searchresults">    \n    {{#if resultcount}}\n      {{> numberOfResultsTemplate }}\n    {{/if}}\n    <div class="adds-hits-main-wrapper">\n    {{#each hits}}\n      <div class="adds-hit{{#equals type "PROMOTED"}} promoted{{/equals}}">\n        <div class="adds-hit-wrapper" {{#if style}} style="background-color:{{style.background_color}}"{{/if}}>\n           {{#if style.image_url}}<div class="adds-hit-top">\n               <div class="adds-main-image">\n                <div class="adds-aspect"><img src="{{style.image_url}}" alt="{{title}}" /></div>    \n               </div>\n           </div>{{/if}}\n            <div class="adds-hit-bottom">\n              <h2 class="adds-hit-title">\n                <a href="{{url}}" class="" {{#if style}} style="color:{{style.text_color}}!important"{{/if}}>\n                   {{#if title}} {{title}} {{else}} {{url}} {{/if}}\n                </a>\n              </h2>    \n              <div class="adds-highlight" {{#if style}} style="color:{{style.text_color}}!important"{{/if}}>        \n                {{{highlight}}}{{#not type "PROMOTED"}}&#8230;{{/not}}\n              </div>\n              {{#if categories}}\n                  <div class="adds-category-wrapper">\n                    {{#gt categories.length 1}}\n                    <span class="adds-category">\n                      {{selectCategory ..}}\n                    </span>\n                    {{/gt}}\n                  </div> \n              {{/if}}\n              {{#if custom_fields.camp}}\n                  <div class="adds-category-wrapper">\n                    <span class="adds-category">\n                      Campus: {{custom_fields.camp}}\n                    </span>\n                  </div>\n              {{/if}}            \n              </div>      \n          </div>\n      </div>\n    {{/each}}\n    </div>\n  </div>\n',
115					template_resultcount:
116						'\n  <div class="number-of-results">\n    {{#gt page 1}}Page {{../page}} of {{/gt}}\n    {{total_hits}}{{#equals total_hits 10000}}+{{/equals}} results for <em>{{keyword}}</em>\n  </div>\n',
117				}),
118			document.getElementById('selected-filters-container') &&
119				s.activeFilters({
120					containerId: 'selected-filters-container',
121					template:
122						'\n    <div class="addsearch-active-filters">       \n        {{#each active}}\n        <div class="item"><span>{{label}}</span>\n            <button data-type="{{type}}" data-name="{{name}}" data-value="{{value}}">&#215;</button>\n        </div>\n        {{/each}}\n        {{#if clearAll}}\n            {{#gt active.length 1}}\n                <div class="item"><button data-clearall="true">Clear all</button></div>\n            {{/gt}}\n        {{/if}}\n    </div>\n',
123				}),
124			document.getElementById('facets-container-campus'))
125		) {
126			var c = '   \n     <div class="addsearch-facets adds-filters-group">\n      {{#if facets}}\n      <h3 class="adds-filter-title">\n        '.concat(
127				'Campus',
128				'\n        <span class="adds-open-group-icon"></span>\n       </h3>\n       {{/if}}\n        <ul class="adds-filter-parent-container">\n         {{#each facets}}\n          <li  data-facet="{{value}}" class="adds-sub-filter-title">\n            <label class="adds-label">\n              <input type="checkbox" value="{{value}}" class="adds-checkbox" />\n              <span class="adds-value">{{value}}</span> <em class="adds-count">({{count}})</em>\n            </label>\n          </li>\n          {{/each}}\n       </ul>\n    </div>    \n  '
129			);
130			s.facets({ containerId: 'facets-container-campus', field: 'custom_fields.camp', sticky: !0, template: c });
131		}
132		function l(e, a) {
133			e.classList.contains(a) ? e.classList.remove(a) : e.classList.add(a);
134		}
135		document.getElementById('pagination-container') && s.pagination({ containerId: 'pagination-container' }),
136			s.start(),
137			document.addEventListener('click', function (e) {
138				e.target &&
139					(e.target.classList.contains('adds-open-sub-group-icon') || e.target.classList.contains('adds-filter-title') || e.target.classList.contains('adds-open-group-icon')) &&
140					(e.target.classList.contains('adds-filter-title') && l(e.target.parentElement, 'adds-shrink'),
141					(e.target.classList.contains('adds-open-sub-group-icon') || e.target.classList.contains('adds-open-group-icon')) && l(e.target.parentElement.parentElement, 'adds-shrink'));
142			});
143		var r = document.querySelector('.adds-filter-toggle');
144		r &&
145			r.addEventListener('click', function () {
146				l(document.querySelector('.adds-filters-main-wrapper'), 'adds-close');
147			});
148	},
149]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.