1(function(){'use strict';var __assign=(window&&window.__assign)||function(){__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p)) 2t[p]=s[p]} 3return t};return __assign.apply(this,arguments)};var defaults={lines:12,length:7,width:5,radius:10,scale:1.0,corners:1,color:'#000',fadeColor:'transparent',animation:'spinner-line-fade-default',rotate:0,direction:1,speed:1,zIndex:2e9,className:'spinner',top:'50%',left:'50%',shadow:'0 0 1px transparent',position:'absolute',};var Spinner=(function(){function Spinner(opts){if(opts===void 0){opts={}} 4this.opts=__assign(__assign({},defaults),opts)} 5Spinner.prototype.spin=function(target){this.stop();this.el=document.createElement('div');this.el.className=this.opts.className;this.el.setAttribute('role','progressbar');this.el.style.position=this.opts.position;this.el.style.width="0";this.el.style.zIndex=this.opts.zIndex.toString();this.el.style.left=this.opts.left;this.el.style.top=this.opts.top;this.el.style.transform="scale(".concat(this.opts.scale,")");if(target){target.insertBefore(this.el,target.firstChild||null)} 6drawLines(this.el,this.opts);return this};Spinner.prototype.stop=function(){if(this.el){if(this.el.parentNode){this.el.parentNode.removeChild(this.el)} 7this.el=undefined} 8return this};return Spinner}());function getColor(color,idx){return typeof color=='string'?color:color[idx%color.length]} 9function drawLines(el,opts){var borderRadius=(Math.round(opts.corners*opts.width*500)/1000)+'px';var shadow='none';if(opts.shadow===!0){shadow='0 2px 4px #000'}else if(typeof opts.shadow==='string'){shadow=opts.shadow} 10var shadows=parseBoxShadow(shadow);for(var i=0;i<opts.lines;i++){var degrees=~~(360/opts.lines*i+opts.rotate);var backgroundLine=document.createElement('div');backgroundLine.style.position='absolute';backgroundLine.style.top="".concat(-opts.width/2,"px");backgroundLine.style.width=(opts.length+opts.width)+'px';backgroundLine.style.height=opts.width+'px';backgroundLine.style.background=getColor(opts.fadeColor,i);backgroundLine.style.borderRadius=borderRadius;backgroundLine.style.transformOrigin='left';backgroundLine.style.transform="rotate(".concat(degrees,"deg) translateX(").concat(opts.radius,"px)");var delay=i*opts.direction/opts.lines/opts.speed;delay-=1/opts.speed;var line=document.createElement('div');line.style.width='100%';line.style.height='100%';line.style.background=getColor(opts.color,i);line.style.borderRadius=borderRadius;line.style.boxShadow=normalizeShadow(shadows,degrees);line.style.animation="".concat(1/opts.speed,"s linear ").concat(delay,"s infinite ").concat(opts.animation);backgroundLine.appendChild(line);el.appendChild(backgroundLine)}} 11function parseBoxShadow(boxShadow){var regex=/^\s*([a-zA-Z]+\s+)?(-?\d+(\.\d+)?)([a-zA-Z]*)\s+(-?\d+(\.\d+)?)([a-zA-Z]*)(.*)$/;var shadows=[];for(var _i=0,_a=boxShadow.split(',');_i<_a.length;_i++){var shadow=_a[_i];var matches=shadow.match(regex);if(matches===null){continue} 12var x=+matches[2];var y=+matches[5];var xUnits=matches[4];var yUnits=matches[7];if(x===0&&!xUnits){xUnits=yUnits} 13if(y===0&&!yUnits){yUnits=xUnits} 14if(xUnits!==yUnits){continue} 15shadows.push({prefix:matches[1]||'',x:x,y:y,xUnits:xUnits,yUnits:yUnits,end:matches[8],})} 16return shadows} 17function normalizeShadow(shadows,degrees){var normalized=[];for(var _i=0,shadows_1=shadows;_i<shadows_1.length;_i++){var shadow=shadows_1[_i];var xy=convertOffset(shadow.x,shadow.y,degrees);normalized.push(shadow.prefix+xy[0]+shadow.xUnits+' '+xy[1]+shadow.yUnits+shadow.end)} 18return normalized.join(', ')} 19function convertOffset(x,y,degrees){var radians=degrees*Math.PI/180;var sin=Math.sin(radians);var cos=Math.cos(radians);return[Math.round((x*cos+y*sin)*1000)/1000,Math.round((-x*sin+y*cos)*1000)/1000,]}(function(){var plugin_name="searchwp_live_search";function SearchwpLiveSearch(element){this.config=null;this.input_el=element;this.results_id=null;this.results_el=null;this.parent_el=null;this.results_showing=!1;this.form_el=null;this.timer=!1;this.last_string='';this.spinner=null;this.spinner_showing=!1;this.has_results=!1;this.current_request=!1;this.results_destroy_on_blur=!0;this.a11y_keys=[27,40,13,38,9];this.init()} 20SearchwpLiveSearch.prototype={init:function(){var self=this,$input
20=this.input_el;this.form_el=$input.parents('form:eq(0)');this.results_id=this.uniqid('searchwp_live_search_results_');var valid_config=!1;var config_template=$input.data('swpconfig');if(config_template&&typeof config_template!=='undefined'){for(var config_key in searchwp_live_search_params.config){if(config_template===config_key){valid_config=!0;this.config=searchwp_live_search_params.config[config_key]}}}else{for(var default_key in searchwp_live_search_params.config){if('default'===default_key){valid_config=!0;this.config=searchwp_live_search_params.config[default_key]}}} 21if(!valid_config){alert(searchwp_live_search_params.msg_no_config_found)}else{var engine=$input.data('swpengine');if(!engine){engine=this.config.engine} 22$input.data('swpengine',engine);$input.attr('autocomplete','off');$input.attr('aria-owns',this.results_id);$input.attr('aria-autocomplete','both');$input.attr('aria-label',searchwp_live_search_params.aria_instructions);var results_el_html='<div aria-expanded="false" class="searchwp-live-search-results" id="'+this.results_id+'" tabindex="0"></div>';var swpparentel=$input.data('swpparentel');if(swpparentel){this.parent_el=jQuery(swpparentel);this.parent_el.append(results_el_html)}else if(this.config.parent_el){this.parent_el=jQuery(this.config.parent_el);this.parent_el.append(results_el_html)}else{jQuery('body').append(jQuery(results_el_html))} 23this.results_el=jQuery('#'+this.results_id);this.position_results();jQuery(window).resize(function(){self.position_results()});if(this.config.spinner){if(typeof this.config.spinner.scale==='undefined'){this.config.spinner.scale=1} 24if(typeof this.config.spinner.fadeColor==='undefined'){this.config.spinner.fadeColor='transparent'} 25if(typeof this.config.spinner.animation==='undefined'){this.config.spinner.animation='searchwp-spinner-line-fade-quick'} 26if(typeof this.config.spinner.position==='undefined'){this.config.spinner.position='absolute'} 27this.spinner=new Spinner(this.config.spinner)}
28if(typeof this.config.abort_on_enter==='undefined'){this.config.abort_on_enter=!0} 29$input.keyup(function(e){if(jQuery.inArray(e.keyCode,self.a11y_keys)>-1){return} 30if(self.current_request&&(self.config.abort_on_enter&&e.keyCode===13)){self.current_request.abort()} 31if(!jQuery.trim(self.input_el.val()).length){self.destroy_results()}else if(!self.results_showing){self.position_results();self.results_el.addClass('searchwp-live-search-results-showing').attr('role','listbox');self.show_spinner();self.results_showing=!0} 32if(self.has_results&&!self.spinner_showing&&self.last_string!==jQuery.trim(self.input_el.val())){self.results_el.empty();self.show_spinner()} 33if(e.currentTarget.value.length>=self.config.input.min_chars){self.results_el.removeClass('searchwp-live-search-no-min-chars')}else{self.results_el.addClass('searchwp-live-search-no-min-chars')} 34self.position_results()}).keyup(jQuery.proxy(this.maybe_search,this));if(this.config.results_destroy_on_blur||typeof this.config.results_destroy_on_blur==='undefined'){jQuery('html').click(function(e){if(!jQuery(e.target).parents('.searchwp-live-search-results').length){self.destroy_results()}})} 35$input.click(function(e){e.stopPropagation()})}},keyboard_navigation:function(){var self=this,$input=this.input_el,$results=this.results_el,focused_class='searchwp-live-search-result--focused',item_class='.searchwp-live-search-result',a11y_keys=this.a11y_keys;jQuery(document).off('keyup.searchwp_a11y').on('keyup.searchwp_a11y',function(e){if(!$results.hasClass('searchwp-live-search-results-showing')){jQuery(document).off('keyup.searchwp_a11y');return} 36if(jQuery.inArray(e.keyCode,a11y_keys)===-1){return} 37e.preventDefault();if(e.keyCode===27){self.destroy_results();jQuery(document).off('keyup.searchwp_a11y');$input.focus();jQuery(document).trigger('searchwp_live_escape_results');return} 38if(e.keyCode===40){var $current=jQuery($results[0]).find('.'+focused_class);if($current.length===1&&$current.next().length===1){$current.removeClass(focused_class).attr('aria-selected','false').next().addClass(focused_class).attr('aria-selected','true').find('a').focus()}else{$current.removeClass(focused_class).attr('aria-selected','false');$results.find(item_class+':first').addClass(focused_class).attr('aria-selected','true').find('a').focus()} 39jQuery(document).trigger('searchwp_live_key_arrowdown_pressed')} 40if(e.keyCode===38){var $currentItem=jQuery($results[0]).find('.'+focused_class);if($currentItem.length===1&&$currentItem.prev().length===1){$currentItem.removeClass(focused_class).attr('aria-selected','false').prev().addClass(focused_class).attr('aria-selected','true').find('a').focus()}else{$currentItem.removeClass(focused_class).attr('aria-selected','false');$results.find(item_class+':last').addClass(focused_class).attr('aria-selected','true').find('a').focus()} 41jQuery(document).trigger('searchwp_live_key_arrowup_pressed')} 42if(e.keyCode===13){jQuery(document).trigger('searchwp_live_key_enter_pressed')} 43if(e.keyCode===9){jQuery(document).trigger('searchwp_live_key_tab_pressed')}});jQuery(document).trigger('searchwp_live_keyboad_navigation')},aria_expanded:function(is_expanded){var $resultsEl=this.results_el;if(is_expanded){$resultsEl.attr('aria-expanded','true')}else{$resultsEl.attr('aria-expanded','false')} 44jQuery(document).trigger('searchwp_live_aria_expanded')},position_results:function(){var $input=this.input_el,$parent_form=$input.parents('form:eq(0)'),$results=this.results_el,isGutenbergButtonInside=$parent_form.hasClass('wp-block-search__button-inside'),input_offset={},results_top_offset=0;if($input.is(':hidden')){return} 45if(isGutenbergButtonInside){$input=$parent_form} 46input_offset=$input.offset();input_offset.left+=parseInt(this.config.results.offset.x,10);input_offset.top+=parseInt(this.config.results.offset.y,10);switch(this.config.results.position){case 'top':results_top_offset=0-$results.height();break;default:results_top_offset=$input.outerHeight()} 47$results.css('left',input_offset.left);$results.css('top',(input_offset.top+results_top_offset)+'px');if('auto'===this.config.results.width){$results.width($input.outerWidth()-parseInt($results.css('paddingRight').replace('px',''),10)-parseInt($results.css('paddingLeft').replace('px',''),10))} 48jQuery(document).trigger('searchwp_live_position_results',[$results.css('left'),$results.css('top'),$results.width()])},destroy_results:function(e){this.hide_spinner();this.aria_expanded(!1);this.results_el.empty().removeClass('searchwp-live-search-results-showing');this.results_el.removeAttr('role');this.results_showing=!1;this.has_results=!1;jQuery(document).trigger('searchwp_live_destroy_results')},maybe_search:function(e){if(jQuery.inArray(e.keyCode,this.a11y_keys)>-1){return} 49clearTimeout(this.timer);if(e.currentTarget.value.length>=this.config.input.min_chars){if(this.current_request){this.current_request.abort()} 50this.timer=setTimeout(jQuery.proxy(this.search,this,e),this.config.input.delay)}},show_spinner:function(){if(this.config.spinner&&!this.spinner_showing){this.spinner.spin(document.getElementById(this.results_id));this.spinner_showing=!0;jQuery(document).trigger('searchwp_live_show_spinner')}},hide_spinner:function(){if(this.config.spinner){this.spinner.stop();this.spinner_showing=!1;jQuery(document).trigger('searchwp_live_hide_spinner')}},search:function(e){var self=this,$form=this.form_el,values=$form.serialize(),action=$form.attr('action')?$form.attr('action'):'',$input=this.input_el,$results=this.results_el;jQuery(document).trigger('searchwp_live_search_start',[$input,$results,$form,action,values]);this.aria_expanded(!1);values+='&action=searchwp_live_search&swpengine='+$input.data('swpengine');values+='&swpquery='+encodeURIComponent($input.val());values+='&origin_id='+parseInt(searchwp_live_search_params.origin_id,10);if(action.indexOf('?')!==-1){action=action.split('?');values+='&'+action[1]} 51this.last_string=$input.val();this.has_results=!0;this.current_request=jQuery.ajax({url:searchwp_live_search_params.ajaxurl,type:"GET",data:values,complete:function(){jQuery(document).trigger('searchwp_live_search_complete',[$input,$results,$form,action,values]);self.spinner_showing=!1;this.current_request=!1;jQuery(document).trigger('searchwp_live_search_shutdown',[$input,$results,$form,action,values])},success:function(response){if(response===0){response=""} 52jQuery(document).trigger('searchwp_live_search_success',[$input,$results,$form,action,values]);$results.html(response);self.position_results();self.aria_expanded(!0);self.keyboard_navigation();jQuery(document).trigger('searchwp_live_search_shutdown',[$input,$results,$form,action,values])}})},uniqid:function(prefix,more_entropy){if(typeof prefix==='undefined'){prefix=""} 53var retId;var formatSeed=function(seed,reqWidth){seed=parseInt(seed,10).toString(16);if(reqWidth<seed.length){return seed.slice(seed.length-reqWidth)} 54if(reqWidth>seed.length){return new Array(1+(reqWidth-seed.length)).join('0')+seed} 55return seed};if(!this.php_js){this.php_js={}} 56if(!this.php_js.uniqidSeed){this.php_js.uniqidSeed=Math.floor(Math.random()*0x75bcd15)} 57this.php_js.uniqidSeed++;retId=prefix;retId+=formatSeed(parseInt(new Date().getTime()/1000,10),8);retId+=formatSeed(this.php_js.uniqidSeed,5);if(more_entropy){retId+=(Math.random()*10).toFixed(8).toString()} 58return retId}};jQuery.fn[plugin_name]=function(options){this.each(function(){if(!jQuery.data(this,"plugin_"+plugin_name)){jQuery.data(this,"plugin_"+plugin_name,new SearchwpLiveSearch(jQuery(this)))}});return this}})();jQuery(document).ready(function(){if(typeof jQuery().searchwp_live_search=='function'){jQuery('input[data-swplive="true"]').searchwp_live_search();if(typeof _SEARCHWP_LIVE_AJAX_SEARCH_BLOCKS!=='undefined'&&_SEARCHWP_LIVE_AJAX_SEARCH_BLOCKS){jQuery('input.wp-block-search__input').each(function(){jQuery(this).attr('data-swpengine',_SEARCHWP_LIVE_AJAX_SEARCH_ENGINE);jQuery(this).attr('data-swpconfig',_SEARCHWP_LIVE_AJAX_SEARCH_CONFIG);jQuery(this).searchwp_live_search()})}}})})()
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.