PageSourceSearch

https://www.trikinematics.com/wp-content/plugins/smart-woocommerce-search/assets/dist/js/main.js?ver=2.15.0

js trikinematics.com collected 2026-10-08 10:20:12 UTC 47,641 bytes, 49 lines download raw bytes

1(T=>{T(function(){var _=window.swsL10n||{};if(_)for(var t in _.widgets)if(T(_.widgets[t].selector).length){let e=_.widgets[t],s={id:t,serviceUrl:_.restUrl+"id="+encodeURIComponent(t),layout:_.widgets[t].layout,columns:_.widgets[t].columns,productSlug:_.widgets[t].productSlug,maxHeight:_.widgets[t].popupHeight,maxHeightMobile:_.widgets[t].popupHeightMobile,minChars:_.widgets[t].charCount,disableAjax:_.widgets[t].disableAjax,no_results_text:_.widgets[t].noResultsText,loaderIcon:_.widgets[t].loaderIcon,loaderImage:_.widgets[t].loaderImage,preventBadQueries:_.widgets[t].preventBadQueries,fullScreenMode:_.widgets[t].fullScreenMode,placeholder:_.widgets[t].placeholder,recentSearches:_.widgets[t].recentSearches,recentSearchesTitle:_.widgets[t].recentSearchesTitle,keywords:_.widgets[t].keywords,keywordsLabel:_.widgets[t].keywordsLabel,selectedCategories:_.widgets[t].selectedCategories,selectedCategoriesLabel:_.widgets[t].selectedCategoriesLabel,selectedCategoriesLocation:_.widgets[t].selectedCategoriesLocation,selectedCategoriesMobile:_.widgets[t].selectedCategoriesMobile,selectedCategoriesCount:_.widgets[t].selectedCategoriesCount,selectedCategoriesOnOpen:_.widgets[t].selectedCategoriesOnOpen,selectedProducts:_.widgets[t].selectedProducts,selectedProductsLabel:_.widgets[t].selectedProductsLabel,selectedProductsMobile:_.widgets[t].selectedProductsMobile,promoBannerLocation:_.widgets[t].promoBannerLocation,promoBannerImage:_.widgets[t].promoBannerImage,promoBannerLink:_.widgets[t].promoBannerLink,promoBannerOnOpen:_.widgets[t].promoBannerOnOpen,selectedPromoBannerMobile:_.widgets[t].selectedPromoBannerMobile};T(e.selector).each(function(){var y=e.fullScreenMode,b=768<=T(window).width();if("desktop_only"==y&&b||"mobile_only"==y&&!b||"enable"==y){b=this;y=s;let m=y.placeholder||"",w=T(b),v="FORM"===b.tagName||"form"===b.tagName?w:w.find("form"),f=v.find(".smart-search-popup");if(!w.hasClass("ysm-active")&&!v.hasClass("ysm-active")){if(v.addClass("ysm-active").addClass("ysm-hide"),!T(document.body).toggleClass("ysm-widget-active",!T(document.body).hasClass("ysm-widget-active")))return;T(document.body).hasClass("ysm-widget-active")&&(w.parents(".et_pb_column").css({overflow:"visible",zIndex:"10"}),w.parents(".et_pb_module").css("overflow","visible")),T('<div class="smart-search-fullscreen"><div class="smart-search-fullscreen-backdrop"></div><div class="smart-search-fullscreen-inner"><div class="smart-search-input-wrapper"><input type="search" class="ssf-search-input" placeholder="'+m+'" name="s" id="smart-search-fullscreen-'+y.id+'"><span class="ssf-search-icon-search"><svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="currentColor"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg></span><span class="ssf-search-icon-close" aria-label="close"><svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="currentColor"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg></span></div><div class="smart-search-results-main"><div class="smart-search-results">\t<div class="smart-search-results-inner"></div></div></div></div></div>').appendTo(v);let e=v.find(".smart-search-fullscreen"),s=v.find(".smart-search-fullscreen-backdrop"),t=w.find('input[type="search"]').length?w.find('input[type="search"]'):w.find('input[type="text"]'),o=(w.find(".ssf-search-input").length,w.find(".ssf-search-input")),a=v.find(".smart-search-results-main"),l=v.find(".smart-search-results"),c=l.find(".smart-search-results-inner"),i=v.find(".ssf-search-icon-close"),r=w.find(".search-submit").length?w.find(".search-submit"):"",d=JSON.parse(localStorage.getItem("swsLatestSearches"))||[],h=[];b={id:"",serviceUrl:_.restUrl,layout:"",columns:1,productSlug:"product",maxHeight:500,maxHeightMobile:400,minChars:3,disableAjax:!1,no_results_text:"",loaderIcon:"",preventBadQueries:!0,cache:!0};let u=T.extend({},b,y),p=(e=!1)=>{!0===e&&T(".sws-search-recent-wrapper").removeClass("sws-search-recent-wrapper--hidden_mod");e=JSON.parse(localStorage.getItem("swsLatestSearches")).slice(-5);
1T(".sws-search-recent-list").empty(),e.forEach(e=>{T(".sws-search-recent-list").append(`
2							<li class="sws-search-recent-list-item">
3								<span class="sws-search-recent-list-item-trigger">${e}</span>
4								<span class="sws-search-recent-list-item-delete" data-item="${e}" aria-label="close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg></span>
5							</li>
6						`)})};if(u.selectedCategories||u.promoBannerImage){a.addClass("smart-search-results-main--column_mod"),u.selectedCategoriesMobile&&a.addClass("smart-search-results-main--hidden_mobile_mod"),u.selectedCategoriesOnOpen&&a.addClass("smart-search-results-main--on_open_mod"),T('<div class="sws-sidebar-holder"></div>').prependTo(a),T('<div class="sws-sidebar sws-sidebar--left-mod"><div class="sws-sidebar-widget sws-sidebar--left_slot"></div><div class="sws-sidebar-widget sws-sidebar--left_slot_2"></div></div>').prependTo(a),T('<div class="sws-sidebar sws-sidebar--right-mod"><div class="sws-sidebar-widget sws-sidebar--right_slot"></div><div class="sws-sidebar-widget sws-sidebar--right_slot_2"></div></div>').appendTo(a);let e=T('<div class="sws-selected-categories "><h4 class="sws-selected-categories-title">'+u.selectedCategoriesLabel+'</h4><ul class="sws-selected-categories-list"></ul></div>');u.selectedCategories||(e="");var b=a.find(".sws-sidebar--left-mod .sws-sidebar--left_slot"),y=a.find(".sws-sidebar--left-mod .sws-sidebar--left_slot_2"),C=a.find(".sws-sidebar--right-mod .sws-sidebar--right_slot"),S=a.find(".sws-sidebar--right-mod .sws-sidebar--right_slot_2");let s="";s=u.promoBannerLink.length?T('<div class="sws-promo-banner"><a href="'+u.promoBannerLink+'" target="_blank"> '+u.promoBannerImage+"</a></div>"):T('<div class="sws-promo-banner">'+u.promoBannerImage+"</div>"),T(".sws-sidebar-holder").hide(),u.selectedCategories&&e.prependTo(a.find(".sws-sidebar--"+u.selectedCategoriesLocation)),u.promoBannerImage&&(u.promoBannerOnOpen&&a.addClass("smart-search-results-main--banner_on_open_mod"),s.prependTo(a.find(".sws-sidebar--"+u.promoBannerLocation)),u.selectedPromoBannerMobile)&&T(".sws-promo-banner").addClass("sws-promo-banner--hidden_mobile_mod"),C.is(":empty")&&S.is(":empty")&&a.addClass("smart-search-results-main--widgets-on-left--mod"),b.is(":empty")&&y.is(":empty")&&(T(".sws-sidebar-holder").show(),a.addClass("smart-search-results-main--widgets-on-right--mod")),u.selectedCategories&&u.selectedCategories.forEach(e=>{a.find(".sws-selected-categories-list").append(`
7						<li class="sws-selected-categories-item">
8							<a class="sws-selected-categories-link" href="${e.url}">
9								${e.name}
10								${u.selectedCategoriesCount&&0<e.count?`(${e.count})`:""}
11							</a>
12						</li>
13					`)})}u.recentSearches&&(T('<div class="sws-search-recent-wrapper sws-search-recent-wrapper--hidden_mod"><h4 class="sws-search-recent-title">'+u.recentSearchesTitle+'</h4><ul class="sws-search-recent-list"></ul></div>').prependTo(a),d.length)&&p(!0),u.loaderImage.length&&o.parent().append("<img src="+u.loaderImage+' class="sws-loader-image" alt="Loading...">'),u.selectedProducts&&(a.addClass("smart-search-results-recent-products--mod"),l.addClass("smart-search-results-hidden"),T('<div class="sws-recent-products-wrapper"><h3 class="sws-recent-products-heading">'+u.selectedProductsLabel+'</h3><div class="swiper swsProductsSwiper sws-recent-products"><div class="swiper-wrapper"></div></div><div class="swiper-button-next"></div><div class="swiper-button-prev"></div></div>').insertBefore(a.find(".smart-search-results")),u.selectedProductsMobile&&T(".sws-recent-products-wrapper").addClass("sws-recent-products-wrapper--hidden_mobile_mod"),u.selectedProducts.forEach(t=>{var e=`
14					  <div class="swiper-slide">
15						  <div class="sws-selected-products-item">
16							<a class="sws-selected-products-picture" href="${t.permalink}"><picture>${t.image}</picture></a>
17							<div class="smart-search-post-category">${t.category}</div>
18							<a class="sws-selected-products-title" href="${t.permalink}">${t.name}</a>
19							<div class="sws-selected-products-meta">
20								${0<t.rating_count?`<div class="sws-product-rating" style="display: flex; gap: 2px; float: left;">
21									${[...Array(5)].map((e,s)=>{s+=1;return t.average_rating>=s?'<span style="color: #ffc107; font-size: 20px;">★</span>':t.average_rating>=s-.5?'<span style="color: #ffc107; font-size: 20px;">☆</span>':'<span style="color: #ddd; font-size: 20px;">☆</span>'}).join("")}
22								</div>`:""}
23								${t.price}
24								${"variable"===t.type?`<a href="${t.permalink}" class="button product_type_variable" target="_blank" rel="nofollow">
25								   		<img src="${t.icon_variable}" alt="">
26									</a>`:`<a href="?add-to-cart=${t.id}" 
27										class="button add_to_cart_button ajax_add_to_cart" 
28										data-product_id="${t.id}" 
29										aria-label="Add “${t.name}” to your cart" 
30										rel="nofollow">
31										<img src="${t.icon}" alt="">
32								 	</a>`}
33							</div>
34						  </div>
35					  </div>
36					`;a.find(".swiper-wrapper").append(e)}),(C=document.createElement("script")).src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",C.async=!0,C.onload=function(){new Swiper(".swsProductsSwiper",{slidesPerView:"auto",spaceBetween:0,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},pagination:{el:".swiper-pagination",clickable:!0}})}
36,document.body.appendChild(C)),T(document).off("click",".sws-search-recent-list-item-trigger").on("click",".sws-search-recent-list-item-trigger",e=>{e.stopPropagation();var s=T(e.target).text();T(e.currentTarget).parents("form").find('input[type="search"]').val(s).focus()}),T(document).off("click",".sws-search-recent-list-item-delete").on("click",".sws-search-recent-list-item-delete",function(e){e.stopPropagation();let s=T(this).data("item");e=JSON.parse(localStorage.getItem("swsLatestSearches")).filter(e=>e!==s);localStorage.setItem("swsLatestSearches",JSON.stringify(e)),d=JSON.parse(localStorage.getItem("swsLatestSearches")),p(!0),0==d.length&&T(".sws-search-recent-wrapper").addClass("sws-search-recent-wrapper--hidden_mod")});let n=()=>{e.addClass("ssf-active"),d=JSON.parse(localStorage.getItem("swsLatestSearches"))||[],setTimeout(()=>{e.addClass("ssf-animated"),T(document.body).addClass("ysm-widget-opened"),T(".ssf-search-input").focus()},100)},g=()=>{e.removeClass("ssf-active ssf-animated"),T(document.body).removeClass("ysm-widget-opened"),T(".sws-search-recent-wrapper").removeClass("sws-search-recent-wrapper--hidden_by_keywords"),T(".smart-search-keywords-wrapper").addClass("smart-search-keywords-wrapper--hidden_mod"),setTimeout(()=>{T(".ssf-search-input").val(""),l.css({maxHeight:0}),T(".smart-search-view-all-holder").hide(),T(".smart-search-suggestions").empty(),v.addClass("ysm-hide"),v.removeClass("sws-no-results"),u.selectedProducts&&(T(".sws-recent-products-wrapper").show(),l.addClass("smart-search-results-hidden"))},500)};t.on("click",()=>{n()}),r.length&&r.on("click",()=>{n()}),T(document).on("keydown",e=>{"Tab"===e.key&&setTimeout(()=>{T(document.activeElement).is(t)&&n()},0),"Escape"===e.key&&g()}),s.on("click",()=>{g()}),0<i.length&&i.on("click",function(){g()});var x,k=Math.min(window.screen.width,window.screen.height)<768?u.maxHeightMobile:u.maxHeight;v.on("submit",function(e){var s=o.val();if(""===s||s.length<u.minChars)return!1;var t=_.searchPageUrl;s=(s=s.replace(/\+/g,"%2b")).replace(/\s/g,"+"),t=(t+=-1!==t.indexOf("?")?"&":"?")+"s="+s+"&search_id="+u.id,"product"===u.layout&&(t+="&post_type="+u.productSlug),e.preventDefault(),location.href=t}),u.disableAjax||(x=0,o.outerWidth()&&(x=o.outerWidth(),f.css({width:x+"px"})),-1!==navigator.userAgent.indexOf("Windows")&&-1!==navigator.userAgent.indexOf("Firefox")&&l.addClass("smart-search-firefox"),T(window).on("resize",function(){f.css({width:o.outerWidth()+"px"})}),o.devbridgeAutocomplete({minChars:u.minChars,appendTo:c,serviceUrl:u.serviceUrl,maxHeight:1e5,dataType:"json",deferRequestBy:100,noCache:!u.cache,containerClass:"smart-search-suggestions",triggerSelectOnValidInput:!1,showNoSuggestionNotice:!!u.no_results_text.length,noSuggestionNotice:u.no_results_text,preventBadQueries:u.preventBadQueries,ajaxSettings:{beforeSend:function(e){_.nonce&&e.setRequestHeader("X-WP-Nonce",_.nonce)}},formatResult:function(e,s){return e.data},onSearchStart:function(e){-1!==this.value.indexOf("  ")&&(this.value=this.value.replace(/\s+/g," ")),e.query=e.query.replace(/%20/g," "),this.value!=e.query+" "&&(u.loaderImage.length||o.css({"background-image":"url("+u.loaderIcon+")","background-repeat":"no-repeat","background-position":"50% 50%"}),T(".sws-loader-image").addClass("sws-loader-image--visible"),v.addClass("ysm-hide").removeClass("sws-no-results"),a.addClass("sws-hiding-results"),l.removeClass("smart-search-results-hidden"))},onSelect:function(e){-1!=e.id&&e.url&&!e.addToCart&&(window.location.href=e.url)},transformResult:function(e){e="string"==typeof e?T.parseJSON(e):e;o.val();return e&&e.view_all_link&&""!=e.view_all_link&&(a.find(".smart-search-view-all-holder").length||a.addClass("has-viewall-button").append('<div class="smart-search-view-all-holder"></div>'),a.find(".smart-search-view-all-holder").html(e.view_all_link)),o.css("background-image","none"),T(".sws-loader-image").removeClass("sws-loader-image--visible"),e},onSearchComplete:function(s,t){if(T.trim(s)===T.trim(o.val())){x||(x=o.outerWidth(),f.css({width:x+"px"})),o.css("background-image","none"),T(".sws-loader-image").removeClass("sws-loader-image--visible");var i=(s,t,i)=>{if(o.val().length<u.minChars)s.hide();else{var r=o.devbridgeAutocomplete();let e=u.serviceUrl;t=(e=T.isFunction(e)?e.call(r.element,t):e)+"?"+T.param({query:t});r.cachedResponse&&r.cachedResponse[t]&&i(r.cachedResponse[t]),s.show()}},r=a.find(".smart-search-view-all-holder");if((r.length||u.keywords)&&(r.length&&i(r,s,e=>{r.html(e.view_all_link)}),u.keywords)&&(n=T(".sws-search-recent-wrapper"),i(T(".smart-search-keywords-wrapper"),s,e=>{h=e.keywords,console.log("triggered keywords")}),a.find(".smart-search-keywords-wrapper").length||a.addClass("sws-has-keywords").prepend('<div class="smart-search-keywords-wrapper smart-search-keywords-wrapper--hidden_mod"><h3 class="smart-search-keywords-title">'+u.keywordsLabel+'</h3><ul class="smart-search-keywords-list"></ul></div>'),h.length&&(T(".smart-search-keywords-list").empty(),T(".smart-search-keywords-wrapper").removeClass("smart-search-keywords-wrapper--hidden_mod"),h.forEach(e
36=>{T(".smart-search-keywords-list").append(`
37											<li class="sws-search-recent-list-item">
38												<span class="sws-search-recent-list-item-trigger">${e}</span>
39											</li>
40										`)})),n.length)&&(h.length?(T(".smart-search-keywords-wrapper").removeClass("smart-search-keywords-wrapper--hidden_mod"),n.addClass("sws-search-recent-wrapper--hidden_by_keywords")):(T(".smart-search-keywords-wrapper").addClass("smart-search-keywords-wrapper--hidden_mod"),n.removeClass("sws-search-recent-wrapper--hidden_by_keywords"))),0<t.length){v.removeClass("ysm-hide").removeClass("sws-no-results"),a.removeClass("sws-hiding-results"),l.removeClass("smart-search-results-hidden");var i=l.outerWidth(),n=u.columns,t=(0===i&&(i=o.outerWidth(),l.width(i+"px")),i<200*n&&(n=Math.floor(i/200)),window.innerHeight);let e=0;i=t-180-(r.length?60:0)-(e=u.recentSearches||u.keywords?768<=T(window).width()?45:110:e);i<k?l.css({maxHeight:i+"px"}):l.css({maxHeight:k+"px"}),l.outerHeight()||(t=c.find(".smart-search-suggestions").outerHeight())&&(t=parseInt(t,10),l.height(k<t?k:t)),l.attr("data-columns",n).nanoScroller({contentClass:"smart-search-results-inner",alwaysVisible:!1,iOSNativeScrolling:!0}),u.recentSearches&&(i=s,d.includes(i)||(d.push(i),10<d.length&&d.shift(),localStorage.setItem("swsLatestSearches",JSON.stringify(d))),d.length)&&p(!0),u.selectedProducts&&T(".sws-recent-products-wrapper").hide()}else u.no_results_text.length?(v.removeClass("ysm-hide").addClass("sws-no-results"),a.removeClass("sws-hiding-results")):v.addClass("ysm-hide").addClass("sws-no-results")}},onSearchError:function(e,s,t,i){"error"===t&&((t=s.getResponseHeader("X-Wp-Nonce"))&&_.nonce!==t?(window.swsL10n.nonce=t,o.devbridgeAutocomplete().onValueChange()):_.nonce&&(window.swsL10n.nonce="",o.devbridgeAutocomplete().onValueChange()))},onInvalidateSelection:function(){},onHide:function(){}}).on("focus",function(){o.devbridgeAutocomplete().onValueChange()}))}}else{S=this;b=s;let e=T(S),o=e.find('input[type="search"]').length?e.find('input[type="search"]'):e.find('input[type="text"]'),a="FORM"===S.tagName||"form"===S.tagName?e:e.find("form"),l=JSON.parse(localStorage.getItem("swsLatestSearches"))||[],c=[];if(o.length&&!e.hasClass("ysm-active")&&!a.hasClass("ysm-active")){if(a.addClass("ysm-active").addClass("ysm-hide"),!T(document.body).toggleClass("ysm-widget-active",!T(document.body).hasClass("ysm-widget-active")))return;T(document.body).hasClass("ysm-widget-active")&&(e.parents(".et_pb_column").css({overflow:"visible",zIndex:"10"}),e.parents(".et_pb_module").css("overflow","visible"));var S={id:"",serviceUrl:_.restUrl,layout:"",columns:1,productSlug:"product",maxHeight:500,maxHeightMobile:400,minChars:3,disableAjax:!1,no_results_text:"",loaderIcon:"",preventBadQueries:!0,cache:!0},d=T.extend({},S,b);if(a.on("submit",function(e){var s=o.val();if(""===s||s.length<d.minChars)return!1;var t=_.searchPageUrl;s=(s=s.replace(/\+/g,"%2b")).replace(/\s/g,"+"),t=(t+=-1!==t.indexOf("?")?"&":"?")+"s="+s+"&search_id="+d.id,"product"===d.layout&&(t+="&post_type="+d.productSlug),e.preventDefault(),location.href=t}),!d.disableAjax){T('<div class="smart-search-popup"><div class="smart-search-results"><div class="smart-search-results-inner"></div></div></div>').appendTo(a);var h=a.find(".smart-search-popup"),u=0,p=(o.outerWidth()&&(u=o.outerWidth(),h.css({width:u+"px"})),a.find(".smart-search-results")),g=p.find(".smart-search-results-inner"),m=Math.min(window.screen.width,window.screen.height)<768?d.maxHeightMobile:d.maxHeight;p.css({maxHeight:m+"px"}),-1!==navigator.userAgent.indexOf("Windows")&&-1!==navigator.userAgent.indexOf("Firefox")&&p.addClass("smart-search-firefox");let n=(e=!1)=>{!0===e&&T(".sws-search-recent-wrapper").removeClass("sws-search-recent-wrapper--hidden_mod");e=JSON.parse(localStorage.getItem("swsLatestSearches")).slice(-5);T(".sws-search-recent-list").empty(),e.forEach(e=>{T(".sws-search-recent-list").append(`
41							<li class="sws-search-recent-list-item">
42								<span class="sws-search-recent-list-item-trigger">${e}</span>
43								<span class="sws-search-recent-list-item-delete" data-item="${e}" aria-label="close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg></span>
44							</li>
45						`)})};
45T(document).off("click",".sws-search-recent-list-item-trigger").on("click",".sws-search-recent-list-item-trigger",e=>{e.stopPropagation();var s=T(e.target).text();T(e.currentTarget).parents("form").find('input[type="search"]').val(s).focus()}),T(document).off("click",".sws-search-recent-list-item-delete").on("click",".sws-search-recent-list-item-delete",function(e){e.stopPropagation();let s=T(this).data("item");e=JSON.parse(localStorage.getItem("swsLatestSearches")).filter(e=>e!==s);localStorage.setItem("swsLatestSearches",JSON.stringify(e)),l=JSON.parse(localStorage.getItem("swsLatestSearches")),n(!0),0==l.length&&T(".sws-search-recent-wrapper").addClass("sws-search-recent-wrapper--hidden_mod")}),d.recentSearches&&(T('<div class="sws-search-recent-wrapper"><h4 class="sws-search-recent-title">'+d.recentSearchesTitle+'</h4><ul class="sws-search-recent-list"></ul></div>').prependTo(h),l.length)&&n(!0),T(window).on("resize",function(){h.css({width:o.outerWidth()+"px"})}),T(document).on("click",".smart-search-popup-backdrop",()=>{a.addClass("ysm-hide").removeClass("sws-no-results")}),T(window).on("touchstart",function(e){(T(e.target).hasClass("ysm-active")?T(e.target):T(e.target).parents(".ysm-active")).length||T(".ysm-active").addClass("ysm-hide")}),d.loaderImage.length&&o.parent().append("<img src="+d.loaderImage+' class="sws-loader-image" alt="Loading...">'),o.devbridgeAutocomplete({minChars:d.minChars,appendTo:g,serviceUrl:d.serviceUrl,maxHeight:1e5,dataType:"json",deferRequestBy:100,noCache:!d.cache,containerClass:"smart-search-suggestions",triggerSelectOnValidInput:!1,showNoSuggestionNotice:!!d.no_results_text.length,noSuggestionNotice:d.no_results_text,preventBadQueries:d.preventBadQueries,ajaxSettings:{beforeSend:function(e){_.nonce&&e.setRequestHeader("X-WP-Nonce",_.nonce)}},formatResult:function(e,s){return e.data},onSearchStart:function(e){-1!==this.value.indexOf("  ")&&(this.value=this.value.replace(/\s+/g," ")),e.query=e.query.replace(/%20/g," "),this.value!=e.query+" "&&(d.loaderImage.length||o.css({"background-image":"url("+d.loaderIcon+")","background-repeat":"no-repeat","background-position":"50% 50%"}),T(".sws-loader-image").addClass("sws-loader-image--visible"),a.addClass("ysm-hide").removeClass("sws-no-results"))},onSelect:function(e){-1!=e.id&&e.url&&!e.addToCart&&(window.location.href=e.url)},transformResult:function(e){e="string"==typeof e?T.parseJSON(e):e;o.val();return e&&e.view_all_link&&""!=e.view_all_link&&(h.find(".smart-search-view-all-holder").length||h.addClass("has-viewall-button").append('<div class="smart-search-view-all-holder"></div>'),h.find(".smart-search-view-all-holder").html(e.view_all_link)),o.css("background-image","none"),T(".sws-loader-image").removeClass("sws-loader-image--visible"),e.keywords.length?h.addClass("hidden-searches"):h.removeClass("hidden-searches"),e},onSearchComplete:function(e,s){var t,i,r;T.trim(e)===T.trim(o.val())&&(u||(u=o.outerWidth(),h.css({width:u+"px"})),o.css("background-image","none"),T(".sws-loader-image").removeClass("sws-loader-image--visible"),0<s.length?(a.removeClass("ysm-hide").removeClass("sws-no-results"),s=T(".sws-search-recent-wrapper"),t=h.find(".smart-search-view-all-holder"),setTimeout(function(){var e=p.outerWidth(),s=d.columns;0===e&&(e=o.outerWidth(),p.width(e+"px")),e<200*s&&(s=Math.floor(e/200)),p.outerHeight()||(e=g.find(".smart-search-suggestions").outerHeight())&&(e=parseInt(e,10),p.height(m<e?m:e)),p.attr("data-columns",s).nanoScroller({contentClass:"smart-search-results-inner",alwaysVisible:!1,iOSNativeScrolling:!0})},100),(t.length||d.keywords)&&(r=(s,t,i)=>{if(o.val().length<d.minChars)s.hide();else{var r=o.devbridgeAutocomplete();let e=d.serviceUrl;t=(e=T.isFunction(e)?e.call(r.element,t):e)+"?"+T.param({query:t});r.cachedResponse&&r.cachedResponse[t]&&i(r.cachedResponse[t]),s.show()}},t.length&&r(t,e,e=>{t.html(e.view_all_link)}),d.keywords)&&(i=T(".sws-search-recent-wrapper"),r(T(".smart-search-keywords-wrapper"),e,e=>{c=e.keywords}),h.find(".smart-search-keywords-wrapper").length||h.addClass("sws-has-keywords").prepend('<div class="smart-search-keywords-wrapper smart-search-keywords-wrapper--hidden_mod"><h3 class="smart-search-keywords-title">'+d.keywordsLabel+'</h3><ul class="smart-search-keywords-list"></ul></div>'),c.length&&(T(".smart-search-keywords-list").empty(),T(".smart-search-keywords-wrapper").removeClass("smart-search-keywords-wrapper--hidden_mod"),c.forEac
45h(e=>{T(".smart-search-keywords-list").append(`
46											<li class="sws-search-recent-list-item">
47												<span class="sws-search-recent-list-item-trigger">${e}</span>
48											</li>
49										`)})),i.length)&&(c.length?(T(".smart-search-keywords-wrapper").removeClass("smart-search-keywords-wrapper--hidden_mod"),T(".sws-search-recent-wrapper").addClass("sws-search-recent-wrapper--hidden_by_keywords")):(T(".smart-search-keywords-wrapper").addClass("smart-search-keywords-wrapper--hidden_mod"),T(".sws-search-recent-wrapper").removeClass("sws-search-recent-wrapper--hidden_by_keywords"))),d.recentSearches&&(r=e,l.includes(r)||(l.push(r),10<l.length&&l.shift(),localStorage.setItem("swsLatestSearches",JSON.stringify(l))),l.length)&&(0==s.length&&T('<div class="sws-search-recent-wrapper"><h4 class="sws-search-recent-title">'+d.recentSearchesTitle+'</h4><ul class="sws-search-recent-list"></ul></div>').prependTo(h),n(!0))):(d.no_results_text.length?a.removeClass("ysm-hide"):a.addClass("ysm-hide")).addClass("sws-no-results"))},onSearchError:function(e,s,t,i){if("error"===t){t=s.getResponseHeader("X-Wp-Nonce");if(t&&_.nonce!==t)return window.swsL10n.nonce=t,void o.devbridgeAutocomplete().onValueChange();if(_.nonce)return window.swsL10n.nonce="",void o.devbridgeAutocomplete().onValueChange()}a.addClass("ysm-hide").removeClass("sws-no-results")},onInvalidateSelection:function(){},onHide:function(e){a.addClass("ysm-hide").removeClass("sws-no-results")}}).on("focus",function(){o.devbridgeAutocomplete().onValueChange()})}}}})}})})(jQuery),(e=>{"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports&&"function"==typeof require?e(require("jquery")):e(jQuery)})(function(u){var t={escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},createNode:function(e){var s=document.createElement("div");return s.className=e,s.style.position="absolute",s.style.display="none",s}},i=27,r=9,n=13,o=38,a=39,l=40;function c(e,s){function t(){}var i=this,r={ajaxSettings:{},autoSelectFirst:!1,appendTo:document.body,serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:c.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:t,onSearchComplete:t,onSearchError:t,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(e,s,t){return-1!==e.value.toLowerCase().indexOf(t)},paramName:"query",transformResult:function(e){return"string"==typeof e?u.parseJSON(e):e},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1};i.element=e,i.el=u(e),i.suggestions=[],i.badQueries=[],i.selectedIndex=-1,i.currentValue=i.element.value,i.intervalId=0,i.cachedResponse={},i.onChangeInterval=null,i.onChange=null,i.isLocal=!1,i.suggestionsContainer=null,i.noSuggestionsContainer=null,i.options=u.extend({},r,s),i.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},i.hint=null,i.hintValue="",i.selection=null,i.initialize(),i.setOptions(s)}c.utils=t,(u.Autocomplete=c).formatResult=function(e,s){s="("+t.escapeRegExChars(s)+")";return e.value.replace(new RegExp(s,"gi"),"<strong>$1</strong>").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/&lt;(\/?strong)&gt;/g,"<$1>")},c.prototype={killerFn:null,initialize:function(){var e,s=this,t="."+s.classes.suggestion,i=s.classes.selected,r=s.options;s.element.setAttribute("autocomplete","off"),s.killerFn=function(e){0===u(e.target).closest(r.appendTo).length&&(s.killSuggestions(),s.disableKillerFn())},s.noSuggestionsContainer=u('<div class="autocomplete-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),s.suggestionsContainer=c.utils.createNode(r.containerClass),(e=u(s.suggestionsContainer)).appendTo(r.appendTo),"auto"!==r.width&&e.width(r.width),e.on("mouseover.autocomplete",t,function(){s.activate(u(this).data("index"))}),e.on("mouseout.autocomplete",function(){s.selectedIndex=-1,e.children("."+i).removeClass(i)}),e.on("click.autocomplete",t,function(e){s.select(u(this).data("index"),e)}),s.fixPositionCapture=function(){s.visible&&s.fixPosition()},u(window).on("resize.autocomplete",s.fixPositionCapture),s.el.on("key
49down.autocomplete",function(e){s.onKeyPress(e)}),s.el.on("keyup.autocomplete",function(e){s.onKeyUp(e)}),s.el.on("blur.autocomplete",function(){s.onBlur()}),s.el.on("focus.autocomplete",function(){s.onFocus()}),s.el.on("change.autocomplete",function(e){s.onKeyUp(e)}),s.el.on("input.autocomplete",function(e){s.onKeyUp(e)})},onFocus:function(){this.fixPosition(),0===this.options.minChars&&0===this.el.val().length&&this.onValueChange()},onBlur:function(){this.enableKillerFn()},abortAjax:function(){this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=null)},setOptions:function(e){var s=this,t=s.options;u.extend(t,e),s.isLocal=u.isArray(t.lookup),s.isLocal&&(t.lookup=s.verifySuggestionsFormat(t.lookup)),t.orientation=s.validateOrientation(t.orientation,"bottom"),u(s.suggestionsContainer).css({"max-height":t.maxHeight+"px",width:t.width+"px","z-index":t.zIndex})},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){this.disabled=!0,clearInterval(this.onChangeInterval),this.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var e,s,t,i,r,n,o,a,l=this,c=u(l.suggestionsContainer),d=c.parent().get(0);d!==document.body&&!l.options.forceFixPosition||(n=l.options.orientation,e=c.outerHeight(),s=l.el.outerHeight(),t={top:(a=l.el.offset()).top,left:a.left},"auto"===n&&(o=u(window).height(),i=-(r=u(window).scrollTop())+a.top-e,r=r+o-(a.top+s+e),n=Math.max(i,r)===i?"top":"bottom"),t.top+="top"===n?-e:s,d!==document.body&&(o=c.css("opacity"),l.visible||c.css("opacity",0).show(),a=c.offsetParent().offset(),t.top-=a.top,t.left-=a.left,l.visible||c.css("opacity",o).hide()),"auto"===l.options.width&&(t.width=l.el.outerWidth()-2+"px"),c.css(t))},enableKillerFn:function(){u(document).on("click.autocomplete",this.killerFn)},disableKillerFn:function(){u(document).off("click.autocomplete",this.killerFn)},killSuggestions:function(){var e=this;e.stopKillSuggestions(),e.intervalId=window.setInterval(function(){e.visible&&(e.el.val(e.currentValue),e.hide()),e.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var e=this.el.val().length,s=this.element.selectionStart;return"number"==typeof s?s===e:!document.selection||((s=document.selection.createRange()).moveStart("character",-e),e===s.text.length)},onKeyPress:function(e){var s=this;if(s.disabled||s.visible||e.which!==l||!s.currentValue){if(!s.disabled&&s.visible){switch(e.which){case i:s.el.val(s.currentValue),s.hide();break;case a:if(s.hint&&s.options.onHint&&s.isCursorAtEnd()){s.selectHint();break}return;case r:if(s.hint&&s.options.onHint)return void s.selectHint();if(-1===s.selectedIndex)return void s.hide();if(s.select(s.selectedIndex),!1===s.options.tabDisabled)return;break;case n:if(-1===s.selectedIndex)return void s.hide();s.select(s.selectedIndex);break;case o:s.moveUp();break;case l:s.moveDown();break;default:return}e.stopImmediatePropagation(),e.preventDefault()}}else s.suggest()},onKeyUp:function(e){var s=this;if(!s.disabled){switch(e.which){case o:case l:return}clearInterval(s.onChangeInterval),s.currentValue!==s.el.val()&&(s.findBestHint(),0<s.options.deferRequestBy?s.onChangeInterval=setInterval(function(){s.onValueChange()},s.options.deferRequestBy):s.onValueChange())}},onValueChange:function(){var e=this,s=e.options,t=e.el.val(),i=e.getQuery(t);e.selection&&e.currentValue!==i&&(e.selection=null,(s.onInvalidateSelection||u.noop).call(e.element)),clearInterval(e.onChangeInterval),e.currentValue=t,e.selectedIndex=-1,s.triggerSelectOnValidInput&&e.isExactMatch(i)?e.select(0):i.length<s.minChars?e.hide():e.getSuggestions(i)},isExactMatch:function(e){var s=this.suggestions;return 1===s.length&&s[0].value.toLowerCase()===e.toLowerCase()},getQuery:function(e){return u.trim(e)},getSuggestionsLocal:function(s){var e=this.options,t=s.toLowerCase(),i=e.lookupFilter,r=parseInt(e.lookupLimit,10),e={suggestions:u.grep(e.lookup,function(e){return i(e,s,t)})};return r&&e.suggestions.length>r&&(e.suggestions=e.suggestions.slice(0,r)),e},getSuggestions:function(i){var e,s,t,r=this,n=r.options,o=n.serviceUrl;n.params[n.paramName]=i,e=n.ignoreParams?null:n.params,!1!==n.onSearchStart.call(r.element,n.params)&&(u.isFunction(n.lookup)?n.lookup(i,function(e){r.suggestions=e.suggestions,r.suggest(),n.onSearchComplete.call(r.element,i,e.suggestions)}):(t=r.isLocal?r.getSuggestionsLocal(i):(u.isFunction(o)&&(o=o.call(r.element,i)),s=o+"?"+u.param(e||{}),r.cachedResponse[s]))&&u.isArray(t.suggestions)?(r.suggestions=t.suggestions,r.suggest(),n.onSearchComplete.call(r.element,i,t.suggestions)):r.isBadQuery(i)?n.onSearchComplete.call(r.element,i,[]):(r.abortAjax(),t={url:o,data:e,type:n.type,dataType:n.dataType},u.extend(t,n.ajaxSettings),r.currentRequest=u.ajax(t).done(function(e){r.currentRequest=null,e=n.transformResult(e,i),r.processResponse(e,i,s),n.onSearchComplete.call(r.element,i,e.suggestions)}).fail(function(e,s,t){n.onSearchError.call(r.element,i,e,s,t)})))},isBadQuery:function(e){if(this.options.preventBadQueries)for(var s=this.badQueries,t=s.length;t--;)if(0===e.indexOf(s[t]))return!0;return!1},hide:function(){var e=this,s=u(e.suggestionsContainer);u.isFunction(e.options.onHide)&&e.visible&&e.options.onHide.call(e.element,s),e.visible=!1,e.selectedIndex=-1,
49clearInterval(e.onChangeInterval),u(e.suggestionsContainer).hide(),e.signalHint(null)},suggest:function(){var e,s,t,i,r,n,o,a,l,c,d,h;0===this.suggestions.length?this.options.showNoSuggestionNotice?this.noSuggestions():this.hide():(s=(e=this).options,t=s.groupBy,i=s.formatResult,r=e.getQuery(e.currentValue),n=e.classes.suggestion,o=e.classes.selected,a=u(e.suggestionsContainer),l=u(e.noSuggestionsContainer),c=s.beforeRender,d="",s.triggerSelectOnValidInput&&e.isExactMatch(r)?e.select(0):(u.each(e.suggestions,function(e,s){t&&(d+=(e=>(e=e.data[t],h===e?"":'<div class="autocomplete-group"><strong>'+(h=e)+"</strong></div>"))(s)),d+='<div class="'+n+'" data-index="'+e+'">'+i(s,r)+"</div>"}),this.adjustContainerWidth(),l.detach(),a.html(d),u.isFunction(c)&&c.call(e.element,a),e.fixPosition(),a.show(),s.autoSelectFirst&&(e.selectedIndex=0,a.scrollTop(0),a.children("."+n).first().addClass(o)),e.visible=!0,e.findBestHint()))},noSuggestions:function(){var e=u(this.suggestionsContainer),s=u(this.noSuggestionsContainer);this.adjustContainerWidth(),s.detach(),e.empty(),e.append(s),this.fixPosition(),e.show(),this.visible=!0},adjustContainerWidth:function(){var e=this.options,s=u(this.suggestionsContainer);"auto"===e.width&&(e=this.el.outerWidth()-2,s.width(0<e?e:300))},findBestHint:function(){var i=this.el.val().toLowerCase(),r=null;i&&(u.each(this.suggestions,function(e,s){var t=0===s.value.toLowerCase().indexOf(i);return t&&(r=s),!t}),this.signalHint(r))},signalHint:function(e){var s="",t=this;e&&(s=t.currentValue+e.value.substr(t.currentValue.length)),t.hintValue!==s&&(t.hintValue=s,t.hint=e,(this.options.onHint||u.noop)(s))},verifySuggestionsFormat:function(e){return e.length&&"string"==typeof e[0]?u.map(e,function(e){return{value:e,data:null}}):e},validateOrientation:function(e,s){return e=u.trim(e||"").toLowerCase(),e=-1===u.inArray(e,["auto","bottom","top"])?s:e},processResponse:function(e,s,t){var i=this,r=i.options;e.suggestions=i.verifySuggestionsFormat(e.suggestions),r.noCache||(i.cachedResponse[t]=e,r.preventBadQueries&&0===e.suggestions.length&&i.badQueries.push(s)),s===i.getQuery(i.currentValue)&&(i.suggestions=e.suggestions,i.suggest())},activate:function(e){var s=this,t=s.classes.selected,i=u(s.suggestionsContainer),r=i.find("."+s.classes.suggestion);return i.find("."+t).removeClass(t),s.selectedIndex=e,-1!==s.selectedIndex&&r.length>s.selectedIndex?(i=r.get(s.selectedIndex),u(i).addClass(t),i):null},selectHint:function(){var e=u.inArray(this.hint,this.suggestions);this.select(e)},select:function(e,s){u(s.target).hasClass("smart-search-add_to_cart")||(this.hide(),this.onSelect(e))},moveUp:function(){var e=this;-1!==e.selectedIndex&&(0===e.selectedIndex?(u(e.suggestionsContainer).children().first().removeClass(e.classes.selected),e.selectedIndex=-1,e.el.val(e.currentValue),e.findBestHint()):e.adjustScroll(e.selectedIndex-1))},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(e){var s,t,i,r=this,n=r.activate(e);n&&(s=u(n).outerHeight(),n=n.offsetTop,i=(t=u(r.suggestionsContainer).scrollTop())+r.options.maxHeight-s,n<t?u(r.suggestionsContainer).scrollTop(n):i<n&&u(r.suggestionsContainer).scrollTop(n-r.options.maxHeight+s),r.options.preserveInput||r.el.val(r.getValue(r.suggestions[e].value)),r.signalHint(null))},onSelect:function(e){var s=this,t=s.options.onSelect,e=s.suggestions[e];s.currentValue=s.getValue(e.value),s.currentValue===s.el.val()||s.options.preserveInput||s.el.val(s.currentValue),s.signalHint(null),s.suggestions=[],s.selection=e,u.isFunction(t)&&t.call(s.element,e)},getValue:function(e){var s,t=this.options.delimiter;return!t||1===(t=(s=this.currentValue).split(t)).length?e:s.substr(0,s.length-t[t.length-1].length)+e},dispose:function(){this.el.off(".autocomplete").removeData("autocomplete"),this.disableKillerFn(),u(window).off("resize.autocomplete",this.fixPositionCapture),u(this.suggestionsContainer).remove()}},u.fn.autocomplete=u.fn.devbridgeAutocomplete=function(t,i){var r="autocomplete";return 0===arguments.length?this.first().data(r):this.each(function(){var e=u(this),s=e.data(r);"string"==typeof t?s&&"function"==typeof s[t]&&s[t](i):(s&&s.dispose&&s.dispose(),s=new c(this,t),e.data(r,s))})}}),(s=>{"function"==typeof define&&define.amd?define(["jquery"],function(e){return s(e,window,document)}):"object"==typeof exports?module.exports=s(require("jquery"),window,document):s(jQuery,window,document)}
49)(function(i,n,t){var l,c,r,d,s,h,u,p,o,a,g,m,w,v,f,y,b,C,S,x,k,_,T;function e(e,s){this.el=e,this.options=s,c=c||b(),this.$el=i(this.el),this.doc=i(this.options.documentContext||t),this.win=i(this.options.windowContext||n),this.body=this.doc.find("body"),this.$content=this.$el.children("."+this.options.contentClass),this.$content.attr("tabindex",this.options.tabIndex||0),this.content=this.$content[0],this.previousPosition=0,this.options.iOSNativeScrolling&&null!=this.el.style.WebkitOverflowScrolling?this.nativeScrolling():this.generate(),this.createEvents(),this.addEvents(),this.reset()}y={paneClass:"nano-pane",sliderClass:"nano-slider",contentClass:"nano-content",enabledClass:"has-scrollbar",flashedClass:"flashed",activeClass:"active",iOSNativeScrolling:!1,preventPageScrolling:!1,disableResize:!1,alwaysVisible:!1,flashDelay:1500,sliderMinHeight:20,sliderMaxHeight:null,documentContext:null,windowContext:null},m="scroll",s="mousedown",h="mouseenter",u="mousemove",o="mousewheel",p="mouseup",g="resize",v="up",r="DOMMouseScroll",d="down",w="touchmove",l="Microsoft Internet Explorer"===n.navigator.appName&&/msie 7./i.test(n.navigator.appVersion)&&n.ActiveXObject,c=null,x=n.requestAnimationFrame,f=n.cancelAnimationFrame,_=t.createElement("div").style,T=(()=>{for(var e,s=["t","webkitT","MozT","msT","OT"],t=e=0,i=s.length;e<i;t=++e)if(s[t],s[t]+"ransform"in _)return s[t].substr(0,s[t].length-1);return!1})(),k=function(e){return!1!==T&&(""===T?e:T+e.charAt(0).toUpperCase()+e.substr(1))}("transform"),C=!1!==k,b=function(){var e=t.createElement("div"),s=e.style;return s.position="absolute",s.width="100px",s.height="100px",s.overflow=m,s.top="-9999px",t.body.appendChild(e),s=e.offsetWidth-e.clientWidth,t.body.removeChild(e),s},S=function(){var e=n.navigator.userAgent,s=/(?=.+Mac OS X)(?=.+Firefox)/.test(e);return!!s&&(e=(e=/Firefox\/\d{2}\./.exec(e))&&e[0].replace(/\D+/g,""),s)&&23<+e},e.prototype.preventScrolling=function(e,s){this.isActive&&(e.type===r?(s===d&&0<e.originalEvent.detail||s===v&&e.originalEvent.detail<0)&&e.preventDefault():e.type===o&&e.originalEvent&&e.originalEvent.wheelDelta&&(s===d&&e.originalEvent.wheelDelta<0||s===v&&0<e.originalEvent.wheelDelta)&&e.preventDefault())},e.prototype.nativeScrolling=function(){this.$content.css({WebkitOverflowScrolling:"touch"}),this.iOSNativeScrolling=!0,this.isActive=!0},e.prototype.updateScrollValues=function(){var e=this.content;this.maxScrollTop=e.scrollHeight-e.clientHeight,this.prevScrollTop=this.contentScrollTop||0,this.contentScrollTop=e.scrollTop,e=this.contentScrollTop>this.previousPosition?"down":this.contentScrollTop<this.previousPosition?"up":"same",this.previousPosition=this.contentScrollTop,"same"!=e&&this.$el.trigger("update",{position:this.contentScrollTop,maximum:this.maxScrollTop,direction:e}),this.iOSNativeScrolling||(this.maxSliderTop=this.paneHeight-this.sliderHeight,this.sliderTop=0===this.maxScrollTop?0:this.contentScrollTop*this.maxSliderTop/this.maxScrollTop)},e.prototype.setOnScrollStyles=function(){var e,s;C?(e={})[k]="translate(0, "+this.sliderTop+"px)":e={top:this.sliderTop},x?(f&&this.scrollRAF&&f(this.scrollRAF),this.scrollRAF=x((s=this,function(){return s.scrollRAF=null,s.slider.css(e)}))):this.slider.css(e)},e.prototype.createEvents=function(){var s,t,i,r,n,o,a,l;this.events={down:function(e){return l.isBeingDragged=!0,l.offsetY=e.pageY-l.slider.offset().top,l.slider.is(e.target)||(l.offsetY=0),l.pane.addClass(l.options.activeClass),l.doc.bind(u,l.events.drag).bind(p,l.events.up),l.body.bind(h,l.events.enter),!1},drag:function(e){return a.sliderY=e.pageY-a.$el.offset().top-a.paneTop-(a.offsetY||.5*a.sliderHeight),a.scroll(),a.contentScrollTop>=a.maxScrollTop&&a.prevScrollTop!==a.maxScrollTop?a.$el.trigger("scrollend"):0===a.contentScrollTop&&0!==a.prevScrollTop&&a.$el.trigger("scrolltop"),!1},up:function(e){return o.isBeingDragged=!1,o.pane.removeClass(o.options.activeClass),o.doc.unbind(u,o.events.drag).unbind(p,o.events.up),o.body.unbind(h,o.events.enter),!1},resize:function(e){n.reset()},panedown:function(e){return r.sliderY=(e.offsetY||e.originalEvent.layerY)-.5*r.sliderHeight,r.scroll(),r.events.down(e),!1},scroll:function(e){i.updateScrollValues(),i.isBeingDragged||(i.iOSNativeScrolling||(i.sliderY=i.sliderTop,i.setOnScrollStyles()),null!=e&&(i.maxScrollTop<=i.contentScrollTop?(i.options.preventPageScrolling&&i.preventScrolling(e,d),i.prevScrollTop!==i.maxScrollTop&&i.$el.trigger("scrollend")):0===i.contentScrollTop&&(i.options.preventPageScrolling&&i.preventScrolling(e,v),0!==i.prevScrollTop)&&i.$el.trigger("scrolltop")))},wheel:function(e){if(null!=e)return(e=e.delta||e.wheelDelta||e.originalEvent&&e.originalEvent.wheelDelta||-e.detail||e.originalEvent&&-e.originalEvent.detail)&&(t.sliderY+=-e/3),t.scroll(),!1},enter:(s=t=i=r=n=o=a=l=this,function(e){return s.isBeingDragged&&1!==(e.buttons||e.which)?(e=s.events).up.apply(e,arguments):void 0})}},e.prototype.addEvents=function(){var e;this.removeEvents(),e=this.events,this.options.disableResize||this.win.bind(g,e[g]),this.iOSNativeScrolling||(this.slider.bind(s,e[d]),this.pane.bind(s,e.panedown).bind(o+" "+r,e.wheel)),this.$content.bind(m+" "+o+" "+r+" "+w,e[m])},e.prototype.removeEvents=function(){var e=this.events;this.win.unbind(g,e[g]),this.iOSNativeScrolling||(this.slider.unbind(),this.pane.unbind()),this.$content.unbind(m+" "+o+" "+r+" "+w,e[m])},e.prototype.generate=function(){var e,s,t=this.options,i=t.paneClass,r=t.sliderClass;return(s=this.$el.children("."+i)).length||s.children("."+r).length||this.$el.append('<div class="'+i+'"><div class="'+r+'" /></div>'),this.pane=this.$el.children("."+i),this.slider=this.pane.find("."+r),0===c&&S()?e={right:-14,paddingRight:+n.getComputedStyle(this.content,null).getPropertyValue("padding-right").replace(/[^0-9.]+/g,"")+14}:c&&(e={right:-c},this.$el.addClass(t.enabledClass)),null!=e&&this.$content.css(e),this},e.prototype.restore=function(){this.stopped=!1,this.iOSNativeScrolling||this.pane.show(),this.addEvents()},e.prototype.reset=function(){var e,s,t,i,r,n,o,a;if(!this.iOSNativeScrolling)return this.$el.find("."+this.options.paneClass).length||this.generate().stop(),this.stopped&&this.restore(
49),t=(s=(e=this.content).style).overflowY,l&&this.$content.css({height:this.$content.height()}),o=e.scrollHeight+c,0<(n=parseInt(this.$el.css("max-height"),10))&&(this.$el.height(""),this.$el.height(e.scrollHeight>n?n:e.scrollHeight)),i=(n=this.pane.outerHeight(!1))+(r=parseInt(this.pane.css("top"),10))+parseInt(this.pane.css("bottom"),10),(a=Math.round(i/o*n))<this.options.sliderMinHeight?a=this.options.sliderMinHeight:null!=this.options.sliderMaxHeight&&a>this.options.sliderMaxHeight&&(a=this.options.sliderMaxHeight),t===m&&s.overflowX!==m&&(a+=c),this.maxSliderTop=i-a,this.contentHeight=o,this.paneHeight=n,this.paneOuterHeight=i,this.sliderHeight=a,this.paneTop=r,this.slider.height(a),this.events.scroll(),this.pane.show(),this.isActive=!0,e.scrollHeight===e.clientHeight||this.pane.outerHeight(!0)>=e.scrollHeight&&t!==m?(this.pane.hide(),this.isActive=!1):this.el.clientHeight===e.scrollHeight&&t===m?this.slider.hide():this.slider.show(),this.pane.css({opacity:this.options.alwaysVisible?1:"",visibility:this.options.alwaysVisible?"visible":""}),"static"!==(s=this.$content.css("position"))&&"relative"!==s||(o=parseInt(this.$content.css("right"),10))&&this.$content.css({right:"",marginRight:o}),this;this.contentHeight=this.content.scrollHeight},e.prototype.scroll=function(){if(this.isActive)return this.sliderY=Math.max(0,this.sliderY),this.sliderY=Math.min(this.maxSliderTop,this.sliderY),this.$content.scrollTop(this.maxScrollTop*this.sliderY/this.maxSliderTop),this.iOSNativeScrolling||(this.updateScrollValues(),this.setOnScrollStyles()),this},e.prototype.scrollBottom=function(e){if(this.isActive)return this.$content.scrollTop(this.contentHeight-this.$content.height()-e).trigger(o),this.stop().restore(),this},e.prototype.scrollTop=function(e){if(this.isActive)return this.$content.scrollTop(+e).trigger(o),this.stop().restore(),this},e.prototype.scrollTo=function(e){if(this.isActive)return this.scrollTop(this.$el.find(e).get(0).offsetTop),this},e.prototype.stop=function(){return f&&this.scrollRAF&&(f(this.scrollRAF),this.scrollRAF=null),this.stopped=!0,this.removeEvents(),this.iOSNativeScrolling||this.pane.hide(),this},e.prototype.destroy=function(){return this.stopped||this.stop(),!this.iOSNativeScrolling&&this.pane.length&&this.pane.remove(),l&&this.$content.height(""),this.$content.removeAttr("tabindex"),this.$el.hasClass(this.options.enabledClass)&&(this.$el.removeClass(this.options.enabledClass),this.$content.css({right:""})),this},e.prototype.flash=function(){var e;if(!this.iOSNativeScrolling&&this.isActive)return this.reset(),this.pane.addClass(this.options.flashedClass),setTimeout(function(){e.pane.removeClass(e.options.flashedClass)},(e=this).options.flashDelay),this},a=e,i.fn.nanoScroller=function(t){return this.each(function(){var e,s;if((s=this.nanoscroller)||(e=i.extend({},y,t),this.nanoscroller=s=new a(this,e)),t&&"object"==typeof t){if(i.extend(s.options,t),null!=t.scrollBottom)return s.scrollBottom(t.scrollBottom);if(null!=t.scrollTop)return s.scrollTop(t.scrollTop);if(t.scrollTo)return s.scrollTo(t.scrollTo);if("bottom"===t.scroll)return s.scrollBottom(0);if("top"===t.scroll)return s.scrollTop(0);if(t.scroll&&t.scroll instanceof i)return s.scrollTo(t.scroll);if(t.stop)return s.stop();if(t.destroy)return s.destroy();if(t.flash)return s.flash()}return s.reset()})},i.fn.nanoScroller.Constructor=a});

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.