YITH WooCommerce Ajax Product Filter - Version 4.15.0

Version Description

  • Released on 5 October 2022 =

  • New: support for WooCommerce 7.0

  • Tweak: remove auto-complete for dropdown search inputs

  • Update: YITH plugin framework

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Ajax Product Filter
Version 4.15.0
Comparing to
See all releases

Code changes from version 4.14.0 to 4.15.0

assets/js/shortcodes/modules/yith-wcan-dropdown.js CHANGED
@@ -116,6 +116,7 @@ export default class YITH_WCAN_Dropdown {
116
  $search = $( '<input/>', {
117
  name: 's',
118
  class: 'search-field',
 
119
  type: 'search',
120
  placeholder: this.options.labels.searchPlaceholder,
121
  } );
116
  $search = $( '<input/>', {
117
  name: 's',
118
  class: 'search-field',
119
+ autocomplete: 'off',
120
  type: 'search',
121
  placeholder: this.options.labels.searchPlaceholder,
122
  } );
assets/js/yith-wcan-shortcodes.js CHANGED
@@ -537,6 +537,7 @@ var YITH_WCAN_Dropdown = /*#__PURE__*/function () {
537
  $search = $('<input/>', {
538
  name: 's',
539
  "class": 'search-field',
 
540
  type: 'search',
541
  placeholder: this.options.labels.searchPlaceholder
542
  });
537
  $search = $('<input/>', {
538
  name: 's',
539
  "class": 'search-field',
540
+ autocomplete: 'off',
541
  type: 'search',
542
  placeholder: this.options.labels.searchPlaceholder
543
  });
assets/js/yith-wcan-shortcodes.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://yith-woocommerce-ajax-navigation/./assets/js/shortcodes/config.js","webpack://yith-woocommerce-ajax-navigation/./assets/js/shortcodes/modules/yith-wcan-filter.js","webpack://yith-woocommerce-ajax-navigation/./assets/js/shortcodes/modules/yith-wcan-reset-button.js","webpack://yith-woocommerce-ajax-navigation/./assets/js/shortcodes/modules/yith-wcan-dropdown.js","webpack://yith-woocommerce-ajax-navigation/./assets/js/shortcodes/modules/yith-wcan-preset.js","webpack://yith-woocommerce-ajax-navigation/./assets/js/shortcodes/index.js"],"names":["$","jQuery","$body","YITH_WCAN_Filter","location","search","initPopState","initialized","yith_wcan_shortcodes","reload_on_back","pushUrlToHistory","window","document","title","on","history","state","_yithWcan","reload","filters","target","preset","targetUrl","$target","customFilters","triggerHandler","block","buildUrl","ajax_filters","doingAjax","_doAjax","done","response","searchAlternativeUrl","_beforeFilter","refreshFragments","pageTitle","originalSearch","unblock","_afterFilter","trigger","closest","submit","filtered","Object","keys","length","queryParam","query_param","params","url","base_url","origin","pathname","self","haveFilters","session_param","replace","RegExp","searchParams","split","reduce","a","v","items","isFilterParam","i","_cleanParam","defaultUrl","matches","indexOf","match","current","change_browser_url","navigator","userAgent","method","responseDom","createElement","$response","innerHTML","$preset","$destination","find","replaceWith","first","content","param","process_sanitize","skip_sanitize","encodeURIComponent","xhr","abort","headers","$el","background","loader","message","overlayCSS","opacity","supportedParams","customParams","concat","supported_taxonomies","map","YITH_WCAN_Reset_Button","el","$reset","ev","preventDefault","each","data","deactivateAllFilters","closeModal","addClass","YITH_WCAN_Dropdown","opts","$originalSelect","is","defaultPerPage","defaultOrder","defaultAll","defaults","showSearch","paginate","perPage","order","getElements","labels","emptyLabel","empty_option","searchPlaceholder","search_placeholder","noItemsFound","no_items","showMore","show_more","options","_hideSelect","_initTemplate","_initActions","hide","$mainSpan","$labelSpan","html","getLabel","$dropdownSpan","$matchingItemsList","append","_initSearchTemplate","_initShowMoreTemplate","after","$_main","$_label","$_dropdown","$_items","$dropdwonSpan","$container","$search","name","type","placeholder","prependTo","$_search","$showMore","text","loadNextPage","bind","$_showMore","stopPropagation","toggleDropdown","_populateItems","$li","value","isActive","hasClass","isValueSelected","toggleClass","_changeItemStatus","siblings","removeClass","input","parent","prop","change","selfOriginated","_selectItem","_deselectItem","updateLabel","globalThis","yith_wcan_dropdown_init","_closeAllDropdowns","_afterDropdownOpen","dropdowns","filter","select","closeDropdown","_closeOtherDropdowns","val","limit","matchingElements","$options","getOptions","promise","Promise","resolve","t","label","regex","show","test","push","then","retrievedElements","_formatItems","indexes","hasMore","sort","b","mod","slice","active","option","getOptionByValue","$item","attr","$anchor","template","count","href","rel","$checkbox","$label","prepend","page","parseInt","getMatchingElements","resultSet","matchingItems","_emptyItems","_hideLoadMore","currentPage","unshift","_generateItem","_showLoadMore","status","$option","hasSelectedValues","getSelectedLabels","join","getSelectedOptions","found","getSelectedValues","toString","values","YITH_WCAN_Preset","_regiterStatus","_initFilterButton","_initResponsive","_initFilters","getFilters","$filter","_initFilter","maybeShowClearAllFilters","$filterButtons","modal_on_mobile","media","matchMedia","mobile_media_query","isMobile","_afterLayoutChange","resize","handleChange","$currentFilter","multiple","$items","not","children","activeFilters","maybeFilter","maybeToggleClearAllFilters","maybeToggleClearFilter","delegateTarget","call","$input","_initTooltip","_initPriceSlider","_initDropdown","_initCollapsable","maybeShowClearFilter","_initCustomInput","$dropdown","$current","position","th","tooltip","wrapperWidth","outerWidth","left","width","container","css","toFixed","fadeIn","fadeOut","remove","selectWoo","_initDropdownObject","terms_per_page","$minInput","$maxInput","min","parseFloat","max","currentMin","currentMax","step","handleSliderChange","sliderTimeout","clearTimeout","setTimeout","ionRangeSlider","skin","from","to","min_interval","values_separator","prettify","formatPrice","onChange","onFinish","add","off","_initTitleCollapsable","_initHierarchyCollapsable","$title","_initToggle","parents","show_current_children","$t","$toggle","appendTo","slideToggle","containerClass","wrap","originalFilters","getFiltersProperties","_addCloseModalButton","_addApplyFiltersModalButton","_switchToCollapsables","removeAttr","_removeCloseModalButton","_removeApplyFiltersModalButton","_switchBackCollapsables","$closeButton","close","modalElements","closeButton","$filterButton","show_results","applyFiltersButton","removeData","$filters","isFilterActive","end","currentFilters","currentStr","JSON","stringify","originalStr","dirty","$initiator","maybeRegisterStatusChange","instant_filters","product_filter","doFilter","newPreset","scroll_top","targetOffset","offset","top","scroll_target","$scrollTarget","animate","scrollTop","getActiveFilters","filterType","filteredActive","Math","abs","properties","filteredProperties","$active","activeTerms","taxonomy","isAttr","relation","get","pop","glue","rating_filter","price_ranges","min_price","max_price","onsale_filter","instock_filter","featured_filter","orderby","filterProperties","getFilterProperties","mergeProperties","hasProp","includes","maybeHideClearFilter","isAnyFilterActive","maybeHideClearAllFilters","show_clear_filter","clear_selection","role","deactivateFilter","clear_all_selections","$activeItems","click","formattedRange","$priceSlider","getFiltersByProperties","toggles_open_on_modal","_openAllCollapsables","_closeAllCollapsables","price","accounting","formatMoney","symbol","currency_format","decimal","thousand","precision","format","set1","set2","hasOwnProperty","newValue","index","arr","queryTypeParam"],"mappings":";;;;;AAAa;AAEb;;AAEA,IAAMA,CAAC,GAAGC,MAAV,C,CAAkB;;AAClB,IAAMC,KAAK,GAAGF,CAAC,CAAE,MAAF,CAAf;;;ACLa;AAEb;;;;;;;;;;;;AAEA;;IAEqBG,gB;AACpB;AAGA;AAGA;AAGA;AAGA;AAGA;AACA,8BAAc;AAAA;;AAAA,iCAfR,IAeQ;;AAAA,uCAZF,KAYE;;AAAA,4CATGC,QAAQ,CAACC,MASZ;;AAAA,yCANA,KAMA;;AAAA,sCAHH,KAGG;;AACb,SAAKC,YAAL;AACA,SAAKC,WAAL,GAAmB,IAAnB;AACA,G,CAED;;;;;WACA,wBAAe;AACd,UAAK,CAAEC,oBAAoB,CAACC,cAA5B,EAA6C;AAC5C;AACA;;AAED,WAAKC,gBAAL,CAAuBC,MAAM,CAACP,QAA9B,EAAwCQ,QAAQ,CAACC,KAAjD,EAAwD,IAAxD,EAA8D,IAA9D;AAEAb,OAAC,CAAEW,MAAF,CAAD,CAAYG,EAAZ,CAAgB,UAAhB,EAA4B,YAAY;AAAA;;AACvC,YAAK,2BAAEH,MAAM,CAACI,OAAP,CAAeC,KAAjB,kDAAE,sBAAsBC,SAAxB,CAAL,EAAyC;AACxC;AACA;;AAEDN,cAAM,CAACP,QAAP,CAAgBc,MAAhB,CAAwB,IAAxB;AACA,OAND;AAOA,K,CAED;;;;WACA,kBAAUC,OAAV,EAAmBC,MAAnB,EAA2BC,MAA3B,EAAoC;AAAA;;AACnC,UAAIC,SAAJ;AAAA,UACCC,OAAO,GAAGH,MA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,CAAsB/P,CAAC,CAAE,IAAF,CAAvB;AACA,KAJF;AAMAA,KAAC,CAAE,0BAAF,CAAD,CACEoR,GADF,CACO,WADP,EAEEtK,IAFF,CAEQ,YAAY;AAClB,UAAIL,sBAAJ,CAA4BzG,CAAC,CAAE,IAAF,CAA7B;AACA,KAJF;AAKA,GAfH,EAiBEwC,OAjBF,CAiBW,2BAjBX;AAmBAqJ,YAAU,CAACyL,cAAX,GAA4B,IAAInX,gBAAJ,EAA5B;AACA,CArBK,CAAN,C","file":"yith-wcan-shortcodes.js","sourcesContent":["'use strict';\n\n/* global globalThis, jQuery, yith_wcan_shortcodes, accounting */\n\nconst $ = jQuery; // we can do this as WebPack will compact all together inside a closure.\nconst $body = $( 'body' );\n\nexport { $, $body };\n","'use strict';\n\n/* global globalThis, jQuery, yith_wcan_shortcodes, accounting */\n\nimport { $, $body } from '../config.js';\n\nexport default class YITH_WCAN_Filter {\n\t// currently executing xhr\n\txhr = null;\n\n\t// flag set during ajax call handling\n\tdoingAjax = false;\n\n\t// register original url search param\n\toriginalSearch = location.search;\n\n\t// flag set once init has executed\n\tinitialized = false;\n\n\t// flag set when page has at least one active filter.\n\tfiltered = false;\n\n\t// init object\n\tconstructor() {\n\t\tthis.initPopState();\n\t\tthis.initialized = true;\n\t}\n\n\t// init page reload when popstate event alter filters\n\tinitPopState() {\n\t\tif ( ! yith_wcan_shortcodes.reload_on_back ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.pushUrlToHistory( window.location, document.title, null, true );\n\n\t\t$( window ).on( 'popstate', function () {\n\t\t\tif ( ! window.history.state?._yithWcan ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twindow.location.reload( true );\n\t\t} );\n\t}\n\n\t// execute call to filter products in current view\n\tdoFilter( filters, target, preset ) {\n\t\tlet targetUrl,\n\t\t\t$target = target ? $( target ) : $( 'body' ),\n\t\t\tcustomFilters;\n\n\t\t// filter properties\n\t\tcustomFilters = $( document ).triggerHandler(\n\t\t\t'yith_wcan_filters_parameters',\n\t\t\t[ filters ]\n\t\t);\n\n\t\tif ( !! customFilters ) {\n\t\t\tfilters = customFilters;\n\t\t}\n\n\t\t// block elements before filtering\n\t\t$target && this.block( $target );\n\n\t\t// calculate target url\n\t\ttargetUrl = this.buildUrl( filters );\n\n\t\t// if no ajax, simply change page url\n\t\tif ( ! yith_wcan_shortcodes.ajax_filters ) {\n\t\t\tthis.pushUrlToHistory( targetUrl, document.title, filters );\n\n\t\t\twindow.location = targetUrl;\n\t\t\treturn;\n\t\t}\n\n\t\t// start doing ajax\n\t\tthis.doingAjax = true;\n\n\t\treturn this._doAjax( targetUrl ).done( ( response ) => {\n\t\t\ttargetUrl = this.searchAlternativeUrl( response, targetUrl );\n\n\t\t\tthis._beforeFilter( response, filters );\n\n\t\t\tthis.refreshFragments( target, preset, response );\n\t\t\tthis.pushUrlToHistory( targetUrl, response.pageTitle, filters );\n\t\t\tthis.originalSearch = location.search;\n\n\t\t\t$target && this.unblock( $target );\n\n\t\t\tthis._afterFilter( response, filters );\n\n\t\t\tthis.doingAjax = false;\n\t\t} );\n\t}\n\n\t// actions performed before filter\n\t_beforeFilter( response, filters ) {\n\t\t$( document ).trigger( 'yith-wcan-ajax-loading', [\n\t\t\tresponse,\n\t\t\tfilters,\n\t\t] );\n\t}\n\n\t// actions performed after filter\n\t_afterFilter( response, filters ) {\n\t\t$( '.woocommerce-ordering' ).on(\n\t\t\t'change',\n\t\t\t'select.orderby',\n\t\t\tfunction () {\n\t\t\t\t$( this ).closest( 'form' ).submit();\n\t\t\t}\n\t\t);\n\n\t\tthis.filtered = filters && !! Object.keys( filters ).length;\n\t\tthis.filtered\n\t\t\t? $body.addClass( 'filtered' )\n\t\t\t: $body.removeClass( 'filtered' );\n\n\t\t$( window ).trigger( 'scroll' );\n\n\t\t$( document )\n\t\t\t.trigger( 'yith-wcan-ajax-filtered', [ response, filters ] )\n\t\t\t.trigger( 'yith_wcwl_reload_fragments' );\n\t}\n\n\t// build url to show\n\tbuildUrl( filters ) {\n\t\tlet queryParam = yith_wcan_shortcodes.query_param,\n\t\t\tparams = {},\n\t\t\tlocation = window.location,\n\t\t\turl = !! yith_wcan_shortcodes.base_url\n\t\t\t\t? yith_wcan_shortcodes.base_url\n\t\t\t\t: location?.origin + location?.pathname,\n\t\t\tsearch = '',\n\t\t\tself = this;\n\n\t\tconst haveFilters =\n\t\t\ttypeof filters === 'object' && Object.keys( filters ).length;\n\n\t\t// remove filter session from current url, if any\n\t\tif ( !! yith_wcan_shortcodes.session_param ) {\n\t\t\turl = url.replace(\n\t\t\t\tnew RegExp(\n\t\t\t\t\t'/' + yith_wcan_shortcodes.session_param + '/[^/]*/'\n\t\t\t\t),\n\t\t\t\t''\n\t\t\t);\n\t\t}\n\n\t\tif ( haveFilters ) {\n\t\t\tparams[ queryParam ] = 1;\n\t\t}\n\n\t\tif ( !! this.originalSearch ) {\n\t\t\tconst searchParams = this.originalSearch\n\t\t\t\t.replace( '?', '' )\n\t\t\t\t.split( '&' )\n\t\t\t\t.reduce( ( a, v ) => {\n\t\t\t\t\tconst items = v.split( '=' );\n\n\t\t\t\t\tif ( items.length === 2 ) {\n\t\t\t\t\t\tif ( this.isFilterParam( items[ 0 ] ) ) {\n\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ta[ items[ 0 ] ] = items[ 1 ];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn a;\n\t\t\t\t}, {} );\n\n\t\t\tparams = $.extend( params, searchParams );\n\t\t}\n\n\t\tif ( haveFilters ) {\n\t\t\tparams = $.extend( params, filters );\n\t\t}\n\n\t\tsearch = Object.keys( params )\n\t\t\t.reduce( function ( a, i ) {\n\t\t\t\tconst v = params[ i ];\n\n\t\t\t\tif ( ! v || ! i ) {\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\n\t\t\t\ta += self._cleanParam( i ) + '=' + self._cleanParam( v ) + '&';\n\n\t\t\t\treturn a;\n\t\t\t}, '?' )\n\t\t\t.replace( /&$/g, '' )\n\t\t\t.replace( /%2B/g, '+' )\n\t\t\t.replace( /%2C/g, ',' );\n\n\t\tif ( search.length > 1 ) {\n\t\t\turl += search;\n\t\t}\n\n\t\treturn url;\n\t}\n\n\t// retrieves alternative sharing url in response body\n\tsearchAlternativeUrl( response, defaultUrl = '' ) {\n\t\tlet url = defaultUrl,\n\t\t\tmatches;\n\n\t\tif ( -1 === response.indexOf( 'yith_wcan:sharing_url' ) ) {\n\t\t\treturn url;\n\t\t}\n\n\t\tmatches = response.match(\n\t\t\t/<meta name=\"yith_wcan:sharing_url\" content=\"([^\"]*)\">/\n\t\t);\n\t\turl = matches && 1 in matches ? matches[ 1 ] : url;\n\n\t\treturn url;\n\t}\n\n\t// push url to browser history\n\tpushUrlToHistory( url, title, filters, current ) {\n\t\tif (\n\t\t\t! yith_wcan_shortcodes.change_browser_url ||\n\t\t\tnavigator.userAgent.match( /msie/i )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet method = 'pushState';\n\n\t\tif ( !! current ) {\n\t\t\tmethod = 'replaceState';\n\t\t}\n\n\t\twindow.history[ method ](\n\t\t\t{\n\t\t\t\t_yithWcan: true,\n\t\t\t\tpageTitle: title,\n\t\t\t\tfilters,\n\t\t\t},\n\t\t\t'',\n\t\t\turl\n\t\t);\n\t}\n\n\t// replaces elements in the page with refreshed ones\n\trefreshFragments( target, preset, response ) {\n\t\tconst responseDom = document.createElement( 'html' ),\n\t\t\t$response = $( responseDom );\n\n\t\tresponseDom.innerHTML = response;\n\n\t\tif ( target ) {\n\t\t\tlet $preset = $( preset ),\n\t\t\t\t$target = $( target ),\n\t\t\t\t$destination;\n\n\t\t\tif ( $preset.length ) {\n\t\t\t\t$destination = $response.find( preset );\n\n\t\t\t\tif ( $destination.length ) {\n\t\t\t\t\t$preset.replaceWith( $destination.first() );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $target.length ) {\n\t\t\t\t$destination = $response.find( target );\n\n\t\t\t\tif ( $destination.length ) {\n\t\t\t\t\t$target.replaceWith( $destination.first() );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst content = $( yith_wcan_shortcodes.content );\n\n\t\t\tif ( content.length ) {\n\t\t\t\tcontent.replaceWith(\n\t\t\t\t\t$response.find( yith_wcan_shortcodes.content )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$( 'body' ).replaceWith( $response.find( 'body' ) );\n\t\t\t}\n\t\t}\n\n\t\t$( document ).trigger( 'yith_wcan_init_shortcodes' );\n\t}\n\n\t// clean url parameters\n\t_cleanParam( param ) {\n\t\tif (\n\t\t\t! yith_wcan_shortcodes?.process_sanitize ||\n\t\t\tyith_wcan_shortcodes?.skip_sanitize\n\t\t) {\n\t\t\treturn param;\n\t\t}\n\n\t\treturn encodeURIComponent( param );\n\t}\n\n\t// executes Ajax calls\n\t_doAjax( url, params ) {\n\t\tif ( this.xhr ) {\n\t\t\tthis.xhr.abort();\n\t\t}\n\n\t\tparams = $.extend(\n\t\t\t{\n\t\t\t\turl,\n\t\t\t\theaders: {\n\t\t\t\t\t'X-YITH-WCAN': 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\tparams\n\t\t);\n\n\t\tthis.xhr = $.ajax( params );\n\n\t\treturn this.xhr;\n\t}\n\n\t// block dom elements\n\tblock( $el ) {\n\t\tif ( typeof $.fn.block === 'undefined' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet background = '#fff center center no-repeat';\n\n\t\tif ( yith_wcan_shortcodes?.loader ) {\n\t\t\tbackground = `url('${ yith_wcan_shortcodes.loader }') ${ background }`;\n\t\t}\n\n\t\t$el.block( {\n\t\t\tmessage: null,\n\t\t\toverlayCSS: {\n\t\t\t\tbackground,\n\t\t\t\topacity: 0.7,\n\t\t\t},\n\t\t} );\n\t}\n\n\t// unblock dom elements\n\tunblock( $el ) {\n\t\tif ( typeof $.fn.unblock === 'undefined' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$el.unblock();\n\t}\n\n\t// checks if param is one used by layared nav to filter products.\n\tisFilterParam( param ) {\n\t\tlet supportedParams = [\n\t\t\t\t'rating_filter',\n\t\t\t\t'min_price',\n\t\t\t\t'max_price',\n\t\t\t\t'price_ranges',\n\t\t\t\t'onsale_filter',\n\t\t\t\t'instock_filter',\n\t\t\t\t'featured_filter',\n\t\t\t\t'orderby',\n\t\t\t\t'product-page',\n\t\t\t\tyith_wcan_shortcodes.query_param,\n\t\t\t],\n\t\t\tcustomParams;\n\n\t\t// filter properties\n\t\tcustomParams = $( document ).triggerHandler(\n\t\t\t'yith_wcan_supported_filters_parameters',\n\t\t\t[ supportedParams ]\n\t\t);\n\n\t\tif ( !! customParams ) {\n\t\t\tsupportedParams = customParams;\n\t\t}\n\n\t\tsupportedParams = supportedParams.concat(\n\t\t\tyith_wcan_shortcodes.supported_taxonomies.map( ( i ) =>\n\t\t\t\ti.replace( 'pa_', 'filter_' )\n\t\t\t)\n\t\t);\n\n\t\tif ( -1 !== supportedParams.indexOf( param ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( -1 !== param.indexOf( 'filter_' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( -1 !== param.indexOf( 'query_type_' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n}\n","'use strict';\n\n/* global globalThis, jQuery, yith_wcan_shortcodes, accounting */\n\nimport { $ } from '../config.js';\n\nexport default class YITH_WCAN_Reset_Button {\n\t// current button\n\t$reset = null;\n\n\t// init object\n\tconstructor( el ) {\n\t\t// current button\n\t\tthis.$reset = el;\n\n\t\tthis.$reset.on( 'click', function ( ev ) {\n\t\t\tev.preventDefault();\n\n\t\t\t$( '.yith-wcan-filters' ).each( function () {\n\t\t\t\tconst preset = $( this ).data( 'preset' );\n\n\t\t\t\tpreset.deactivateAllFilters( true );\n\t\t\t\tpreset.closeModal();\n\t\t\t} );\n\t\t} );\n\n\t\tthis.$reset.data( 'reset', this ).addClass( 'enhanced' );\n\t}\n}\n","'use strict';\n\n/* global globalThis, jQuery, yith_wcan_shortcodes, accounting */\n\nimport { $ } from '../config.js';\n\nexport default class YITH_WCAN_Dropdown {\n\t// current button\n\t$originalSelect = null;\n\n\t// main element\n\t$_main = null;\n\n\t// label element\n\t$_label = null;\n\n\t// dropdown\n\t$_dropdown = null;\n\n\t// search input\n\t$_search = null;\n\n\t// show more link\n\t$_showMore = null;\n\n\t// items list\n\t$_items = null;\n\n\t// current page\n\tcurrentPage = 1;\n\n\t// options\n\toptions = {};\n\n\t// init object\n\tconstructor( el, opts ) {\n\t\tthis.$originalSelect = el;\n\n\t\tif ( ! this.$originalSelect.is( 'select' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst defaultPerPage = this.$originalSelect.data( 'per_page' ),\n\t\t\tdefaultOrder = this.$originalSelect.data( 'order' ),\n\t\t\tdefaultAll = this.$originalSelect.data( 'all-label' ),\n\t\t\tdefaults = {\n\t\t\t\tshowSearch: this.$originalSelect.data( 'show_search' ),\n\t\t\t\tpaginate: this.$originalSelect.data( 'paginate' ),\n\t\t\t\tperPage: defaultPerPage ? defaultPerPage : 10,\n\t\t\t\torder: defaultOrder ? defaultOrder : 'ASC',\n\t\t\t\tgetElements: null,\n\t\t\t\tlabels: {\n\t\t\t\t\temptyLabel: defaultAll\n\t\t\t\t\t\t? defaultAll\n\t\t\t\t\t\t: yith_wcan_shortcodes.labels?.empty_option,\n\t\t\t\t\tsearchPlaceholder:\n\t\t\t\t\t\tyith_wcan_shortcodes.labels?.search_placeholder,\n\t\t\t\t\tnoItemsFound: yith_wcan_shortcodes.labels?.no_items,\n\t\t\t\t\tshowMore: yith_wcan_shortcodes.labels?.show_more,\n\t\t\t\t},\n\t\t\t};\n\n\t\tthis.options = $.extend( defaults, opts );\n\n\t\tthis._hideSelect();\n\t\tthis._initTemplate();\n\t\tthis._initActions();\n\n\t\tthis.$originalSelect.data( 'dropdown', this ).addClass( 'enhanced' );\n\t}\n\n\t// hide select\n\t_hideSelect() {\n\t\tthis.$originalSelect.hide();\n\t}\n\n\t// create dropdown\n\t_initTemplate() {\n\t\tconst $mainSpan = $( '<div/>', {\n\t\t\t\tclass: 'yith-wcan-dropdown closed',\n\t\t\t} ),\n\t\t\t$labelSpan = $( '<div/>', {\n\t\t\t\tclass: 'dropdown-label',\n\t\t\t\thtml: this.getLabel(),\n\t\t\t} ),\n\t\t\t$dropdownSpan = $( '<div>', {\n\t\t\t\tclass: 'dropdown-wrapper',\n\t\t\t} ),\n\t\t\t$matchingItemsList = $( '<ul/>', {\n\t\t\t\tclass: 'matching-items filter-items',\n\t\t\t} );\n\n\t\t$dropdownSpan.append( $matchingItemsList );\n\t\t$mainSpan.append( $labelSpan ).append( $dropdownSpan );\n\n\t\tif ( this.options.showSearch ) {\n\t\t\tthis._initSearchTemplate( $dropdownSpan );\n\t\t}\n\n\t\tif ( this.options.paginate ) {\n\t\t\tthis._initShowMoreTemplate( $dropdownSpan );\n\t\t}\n\n\t\tthis.$originalSelect.after( $mainSpan );\n\t\tthis.$_main = $mainSpan;\n\t\tthis.$_label = $labelSpan;\n\t\tthis.$_dropdown = $dropdownSpan;\n\t\tthis.$_items = $matchingItemsList;\n\t}\n\n\t// create search field\n\t_initSearchTemplate( $dropdwonSpan ) {\n\t\tconst $container = $( '<div/>', {\n\t\t\t\tclass: 'search-field-container',\n\t\t\t} ),\n\t\t\t$search = $( '<input/>', {\n\t\t\t\tname: 's',\n\t\t\t\tclass: 'search-field',\n\t\t\t\ttype: 'search',\n\t\t\t\tplaceholder: this.options.labels.searchPlaceholder,\n\t\t\t} );\n\n\t\t$container.append( $search ).prependTo( $dropdwonSpan );\n\t\tthis.$_search = $search;\n\t}\n\n\t// create showMore field\n\t_initShowMoreTemplate( $dropdwonSpan ) {\n\t\tconst $showMore = $( '<a/>', {\n\t\t\tclass: 'show-more',\n\t\t\ttext: this.options.labels.showMore?.replace(\n\t\t\t\t'%d',\n\t\t\t\tthis.options.perPage\n\t\t\t),\n\t\t} );\n\n\t\t$showMore.on( 'click', this.loadNextPage.bind( this ) ).hide();\n\n\t\t$dropdwonSpan.append( $showMore );\n\t\tthis.$_showMore = $showMore;\n\t}\n\n\t// init actions performed over dropdown elements\n\t_initActions() {\n\t\tconst self = this;\n\n\t\t// main open event\n\t\tthis.$_main?.on( 'click', ( ev ) => {\n\t\t\tev.stopPropagation();\n\t\t\tself.toggleDropdown();\n\t\t} );\n\t\tthis.$_dropdown.on( 'click', ( ev ) => {\n\t\t\tev.stopPropagation();\n\t\t} );\n\n\t\t// search event\n\t\tthis.$_search?.on( 'keyup search', () => {\n\t\t\tself._populateItems();\n\t\t} );\n\n\t\t// select event\n\t\tthis.$_items.on( 'change', ':input', function () {\n\t\t\tlet $li = $( this ).closest( 'li' ),\n\t\t\t\tvalue = $li.data( 'value' ),\n\t\t\t\tisActive = false;\n\n\t\t\tif (\n\t\t\t\t$li.hasClass( 'disabled' ) &&\n\t\t\t\t! self.isValueSelected( value )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$li.toggleClass( 'active' );\n\t\t\tisActive = $li.hasClass( 'active' );\n\n\t\t\tself._changeItemStatus( value, isActive );\n\t\t} );\n\t\tthis.$_items.on( 'click', 'li:not(.checkbox) a', function ( ev ) {\n\t\t\tlet $li = $( this ).closest( 'li' ),\n\t\t\t\tvalue = $li.data( 'value' ),\n\t\t\t\tisActive = false;\n\n\t\t\tev.preventDefault();\n\n\t\t\tif (\n\t\t\t\t$li.hasClass( 'disabled' ) &&\n\t\t\t\t! self.isValueSelected( value )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$li.toggleClass( 'active' );\n\t\t\tisActive = $li.hasClass( 'active' );\n\n\t\t\tif ( isActive ) {\n\t\t\t\t$li.siblings().removeClass( 'active' );\n\t\t\t}\n\n\t\t\tself._changeItemStatus( value, isActive );\n\t\t} );\n\t\tthis.$_items.on( 'click', 'label > a', function ( ev ) {\n\t\t\tconst input = $( this ).parent().find( ':input' );\n\n\t\t\tev.preventDefault();\n\n\t\t\tif (\n\t\t\t\tinput.is( '[type=\"radio\"]' ) ||\n\t\t\t\tinput.is( '[type=\"checkbox\"]' )\n\t\t\t) {\n\t\t\t\tinput.prop( 'checked', ! input.prop( 'checked' ) );\n\t\t\t}\n\n\t\t\tinput.change();\n\t\t} );\n\n\t\t// select change\n\t\tthis.$originalSelect.on( 'change', ( ev, selfOriginated ) => {\n\t\t\tif ( selfOriginated ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tself.$_items.find( 'li' ).each( function () {\n\t\t\t\tconst value = $( this ).data( 'value' );\n\n\t\t\t\tif ( self.isValueSelected( value ) ) {\n\t\t\t\t\tself._selectItem( value );\n\t\t\t\t} else {\n\t\t\t\t\tself._deselectItem( value );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tself.updateLabel();\n\t\t} );\n\n\t\t// close dropdown on external click; do this handler only once for any dropdown in the page\n\t\tif ( ! globalThis?.yith_wcan_dropdown_init ) {\n\t\t\t$( document ).on( 'click', this._closeAllDropdowns );\n\t\t\tglobalThis.yith_wcan_dropdown_init = true;\n\t\t}\n\t}\n\n\t// open dropdown\n\topenDropdown() {\n\t\tthis.$_main?.addClass( 'open' ).removeClass( 'closed' );\n\t\tthis._afterDropdownOpen();\n\t}\n\n\t// close dropdown\n\tcloseDropdown() {\n\t\tthis.$_main?.removeClass( 'open' ).addClass( 'closed' );\n\t}\n\n\t// close all dropdowns\n\t_closeAllDropdowns() {\n\t\tconst dropdowns = $( document )\n\t\t\t.find( 'select.enhanced' )\n\t\t\t.filter( function ( i, select ) {\n\t\t\t\tconst $el = $( select );\n\n\t\t\t\treturn !! $el.data( 'dropdown' );\n\t\t\t} );\n\n\t\tdropdowns.each( function () {\n\t\t\t$( this ).data( 'dropdown' ).closeDropdown();\n\t\t} );\n\t}\n\n\t// close other dropdowns\n\t_closeOtherDropdowns() {\n\t\tconst self = this,\n\t\t\tdropdowns = $( document )\n\t\t\t\t.find( 'select.enhanced' )\n\t\t\t\t.filter( function ( i, select ) {\n\t\t\t\t\tconst $el = $( select );\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t!! $el.data( 'dropdown' ) &&\n\t\t\t\t\t\t! $el.is( self.$originalSelect )\n\t\t\t\t\t);\n\t\t\t\t} );\n\n\t\tdropdowns.each( function () {\n\t\t\t$( this ).data( 'dropdown' ).closeDropdown();\n\t\t} );\n\t}\n\n\t// toggle dropdown\n\ttoggleDropdown() {\n\t\tthis.$_main?.toggleClass( 'open' ).toggleClass( 'closed' );\n\n\t\tif ( this.$_main?.hasClass( 'open' ) ) {\n\t\t\tthis._afterDropdownOpen();\n\t\t}\n\t}\n\n\t// perform operations after dropdown is open\n\t_afterDropdownOpen() {\n\t\tthis._closeOtherDropdowns();\n\n\t\tif ( this.$_search?.length ) {\n\t\t\tthis.$_search.val( '' );\n\t\t}\n\n\t\tthis._populateItems();\n\t}\n\n\t// get elements\n\tgetMatchingElements( search, limit ) {\n\t\tlet matchingElements = [],\n\t\t\t$options = this.getOptions(),\n\t\t\tpromise;\n\n\t\tpromise = new Promise( ( resolve ) => {\n\t\t\t// first of all, search across select option\n\t\t\t$options.each( function () {\n\t\t\t\tconst t = $( this ),\n\t\t\t\t\tvalue = t.val(),\n\t\t\t\t\tlabel = t.html(),\n\t\t\t\t\tregex = new RegExp( '.*' + search + '.*', 'i' ),\n\t\t\t\t\tshow =\n\t\t\t\t\t\t! search || regex.test( value ) || regex.test( label );\n\n\t\t\t\tif ( show ) {\n\t\t\t\t\tmatchingElements.push( {\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// then retrieve additional items\n\t\t\tif ( this.options.getElements ) {\n\t\t\t\t// we're expecting key => value pairs\n\t\t\t\tthis.options\n\t\t\t\t\t.getElements( search )\n\t\t\t\t\t.then( ( retrievedElements ) => {\n\t\t\t\t\t\tif ( retrievedElements ) {\n\t\t\t\t\t\t\t// reformat retrieved array\n\t\t\t\t\t\t\tretrievedElements = retrievedElements.reduce(\n\t\t\t\t\t\t\t\t( a, v, i ) => {\n\t\t\t\t\t\t\t\t\ta.push( { label: i, value: v } );\n\t\t\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t[]\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// merge found results with options\n\t\t\t\t\t\t\tmatchingElements = $.extend(\n\t\t\t\t\t\t\t\tmatchingElements,\n\t\t\t\t\t\t\t\tretrievedElements\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresolve( this._formatItems( matchingElements, limit ) );\n\t\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tresolve( this._formatItems( matchingElements, limit ) );\n\t\t\t}\n\t\t} );\n\n\t\treturn promise;\n\t}\n\n\t// format items as key/value pairs for further processing\n\t_formatItems( items, limit ) {\n\t\tlet indexes = [],\n\t\t\thasMore = false;\n\n\t\t// remove duplicates and sort array of results\n\t\titems\n\t\t\t.filter( ( v ) => {\n\t\t\t\tif ( -1 === indexes.indexOf( v.value ) ) {\n\t\t\t\t\tindexes.push( v.value );\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t} )\n\t\t\t.sort( ( a, b ) => {\n\t\t\t\tconst order = this.options.order,\n\t\t\t\t\tmod = order === 'ASC' ? 1 : -1;\n\n\t\t\t\tif ( a.value < b.value ) {\n\t\t\t\t\treturn -1 * mod;\n\t\t\t\t} else if ( a.value > b.value ) {\n\t\t\t\t\treturn mod;\n\t\t\t\t}\n\n\t\t\t\treturn 0;\n\t\t\t} );\n\n\t\t// paginate when needed\n\t\tif ( limit ) {\n\t\t\thasMore = limit < Object.keys( items ).length;\n\t\t\titems = items.slice( 0, limit );\n\t\t}\n\n\t\treturn {\n\t\t\titems,\n\t\t\thasMore,\n\t\t};\n\t}\n\n\t// generate item to append to items list\n\t_generateItem( value, label ) {\n\t\tlet active = this.isValueSelected( value ),\n\t\t\toption = this.getOptionByValue( value ),\n\t\t\t$item = $( '<li/>', {\n\t\t\t\t'data-value': value,\n\t\t\t\tclass: option.length ? option.attr( 'class' ) : '',\n\t\t\t} ),\n\t\t\t$anchor;\n\n\t\tif ( option.length ) {\n\t\t\tconst template = option.data( 'template' ),\n\t\t\t\tcount = option.data( 'count' );\n\n\t\t\tlabel = template ? template : label;\n\n\t\t\tif ( !! count ) {\n\t\t\t\tlabel += count;\n\t\t\t}\n\t\t}\n\n\t\t$anchor = $( '<a/>', {\n\t\t\thref: option.length ? option.data( 'filter_url' ) : '#',\n\t\t\thtml: label,\n\t\t\trel: 'nofollow',\n\t\t\t'data-title': option.length ? option.data( 'title' ) : '',\n\t\t} );\n\n\t\tif ( this.$originalSelect.prop( 'multiple' ) ) {\n\t\t\tconst $checkbox = $( '<input/>', {\n\t\t\t\t\ttype: 'checkbox',\n\t\t\t\t\tvalue,\n\t\t\t\t} ),\n\t\t\t\t$label = $( '<label>' );\n\n\t\t\t$checkbox.prop( 'checked', active );\n\t\t\t$label.prepend( $checkbox ).append( $anchor );\n\t\t\t$item.append( $label ).addClass( 'checkbox' );\n\t\t} else {\n\t\t\t$item.append( $anchor );\n\t\t}\n\n\t\tactive ? $item.addClass( 'active' ) : $item.removeClass( 'active' );\n\n\t\treturn $item;\n\t}\n\n\t// populate items list\n\t_populateItems( page ) {\n\t\tlet search = this.$_search?.length ? this.$_search.val() : '',\n\t\t\tperPage = this.options.paginate ? this.options.perPage : 0,\n\t\t\tlimit;\n\n\t\tpage = page ? parseInt( page ) : 1;\n\t\tlimit = page * perPage;\n\n\t\tthis.getMatchingElements( search, limit ).then( ( resultSet ) => {\n\t\t\tlet matchingItems = resultSet.items,\n\t\t\t\titems = [],\n\t\t\t\thasMore = false;\n\n\t\t\t// remove all previous items\n\t\t\tthis._emptyItems();\n\t\t\tthis._hideLoadMore();\n\n\t\t\tif ( ! matchingItems.length ) {\n\t\t\t\titems.push(\n\t\t\t\t\t$( '<li/>', { text: this.options.labels.noItemsFound } )\n\t\t\t\t);\n\n\t\t\t\tthis.currentPage = 1;\n\t\t\t} else {\n\t\t\t\tfor ( const v of matchingItems ) {\n\t\t\t\t\tif ( v.value === '' ) {\n\t\t\t\t\t\titems.unshift( this._generateItem( v.value, v.label ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\titems.push( this._generateItem( v.value, v.label ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.currentPage = page;\n\t\t\t\thasMore = resultSet.hasMore;\n\t\t\t}\n\n\t\t\tthis.$_items.append( items );\n\n\t\t\tthis.$originalSelect.trigger( 'yith_wcan_dropdown_updated' );\n\n\t\t\tif ( hasMore ) {\n\t\t\t\tthis._showLoadMore();\n\t\t\t}\n\t\t} );\n\t}\n\n\t// load next page of items\n\tloadNextPage() {\n\t\tconst page = this.currentPage + 1;\n\n\t\tthis._populateItems( page );\n\t}\n\n\t// set an item as active\n\t_selectItem( value ) {\n\t\treturn this._changeItemStatus( value, true );\n\t}\n\n\t// disable an item\n\t_deselectItem( value ) {\n\t\treturn this._changeItemStatus( value, false );\n\t}\n\n\t// change item status\n\t_changeItemStatus( value, status ) {\n\t\tconst $option = this.$originalSelect.find(\n\t\t\t`option[value=\"${ value }\"]`\n\t\t);\n\n\t\tif ( $option.length ) {\n\t\t\t$option.prop( 'selected', status );\n\n\t\t\tthis.closeDropdown();\n\t\t\tthis.updateLabel();\n\n\t\t\tthis.$originalSelect.trigger( 'change', [ true ] );\n\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t// empty items list\n\t_emptyItems() {\n\t\tthis.$_items.html( '' );\n\t}\n\n\t// show \"Load more\" link\n\t_showLoadMore() {\n\t\tthis.$_showMore.show();\n\t}\n\n\t// hide \"Load more\" link\n\t_hideLoadMore() {\n\t\tthis.$_showMore.hide();\n\t}\n\n\t// returns select label\n\tgetLabel() {\n\t\treturn this.hasSelectedValues()\n\t\t\t? this.getSelectedLabels().join( ', ' )\n\t\t\t: this.options.labels.emptyLabel;\n\t}\n\n\t// update label to match new selection\n\tupdateLabel() {\n\t\tconst label = this.getLabel();\n\n\t\tthis.$_label?.html( label );\n\t}\n\n\t// returns select options\n\tgetOptions() {\n\t\treturn this.$originalSelect.find( 'option' );\n\t}\n\n\t// checks whether select has selected values\n\thasSelectedValues() {\n\t\treturn this.getSelectedOptions().length;\n\t}\n\n\t// checks whether a value is selected\n\tisValueSelected( value ) {\n\t\tconst found = this.getSelectedValues().indexOf( value.toString() );\n\n\t\treturn -1 !== found;\n\t}\n\n\t// retrieve selected options\n\tgetSelectedOptions() {\n\t\treturn this.$originalSelect.find( 'option' ).filter( ':selected' );\n\t}\n\n\t// retrieves an option node by value\n\tgetOptionByValue( value ) {\n\t\treturn this.$originalSelect.find( `option[value=\"${ value }\"]` );\n\t}\n\n\t// retrieve labels for selected options\n\tgetSelectedLabels() {\n\t\tconst labels = [];\n\n\t\tthis.getSelectedOptions().each( function () {\n\t\t\tlet $option = $( this ),\n\t\t\t\ttemplate = $option.data( 'template' );\n\n\t\t\ttemplate = template\n\t\t\t\t? template\n\t\t\t\t: $option.html().replace( /\\([0-9]*\\)/, '' );\n\n\t\t\tlabels.push( template );\n\t\t} );\n\n\t\treturn labels;\n\t}\n\n\t// retrieve values for selected options\n\tgetSelectedValues() {\n\t\tconst values = [];\n\n\t\tthis.getSelectedOptions().each( function () {\n\t\t\tvalues.push( $( this ).val() );\n\t\t} );\n\n\t\treturn values;\n\t}\n\n\tdestroy() {\n\t\t// TBD\n\t}\n}\n","'use strict';\n\n/* global globalThis, jQuery, yith_wcan_shortcodes, accounting */\n\nimport { $ } from '../config.js';\nimport YITH_WCAN_Dropdown from './yith-wcan-dropdown';\n\nexport default class YITH_WCAN_Preset {\n\t// main preset node\n\tpreset = false;\n\t$preset = false;\n\n\t// target of the filter, if any\n\ttarget = false;\n\t$target = false;\n\n\t// filters node\n\t$filters = false;\n\n\t// filter button\n\t$filterButtons = false;\n\n\t// nodes created just for modal layout\n\tmodalElements = {};\n\n\t// retains current status of filters\n\tactiveFilters = false;\n\n\t// mobile flag\n\tisMobile = false;\n\n\t// slider timeout\n\tsliderTimeout = false;\n\n\t// registers when status has changed\n\toriginalFilters = null;\n\tdirty = false;\n\n\t// init object\n\tconstructor( el ) {\n\t\t// main preset node\n\t\tthis.preset = '#' + el.attr( 'id' );\n\t\tthis.$preset = el;\n\n\t\t// target of the filter, if any\n\t\tthis.target = this.$preset.data( 'target' );\n\t\tthis.$target = this.target ? $( this.target ) : false;\n\n\t\tthis._regiterStatus();\n\t\tthis._initFilterButton();\n\t\tthis._initResponsive();\n\t\tthis._initFilters();\n\t\tthis._initActions();\n\n\t\tthis.$preset\n\t\t\t.data( 'preset', this )\n\t\t\t.addClass( 'enhanced' )\n\t\t\t.trigger( 'yith_wcan_preset_initialized', [ this ] );\n\t}\n\n\t// init filters\n\t_initFilters() {\n\t\tconst self = this;\n\n\t\tthis.getFilters().each( function () {\n\t\t\tconst $filter = $( this );\n\n\t\t\tself._initFilter( $filter );\n\t\t} );\n\n\t\tthis.maybeShowClearAllFilters();\n\t}\n\n\t// init filter button\n\t_initFilterButton() {\n\t\tthis.$filterButtons = this.$preset.find( '.apply-filters' );\n\n\t\tif ( ! this.$filterButtons.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// manage filter button\n\t\tthis.$filterButtons\n\t\t\t.on( 'click', ( ev ) => {\n\t\t\t\tev.preventDefault();\n\t\t\t\tthis.filter();\n\t\t\t} )\n\t\t\t.hide();\n\t}\n\n\t// init generic actions\n\t_initActions() {\n\t\tthis.$preset.find( 'form' ).on( 'submit', ( ev ) => {\n\t\t\tev.preventDefault();\n\t\t} );\n\t}\n\n\t// init responsive\n\t_initResponsive() {\n\t\tif ( ! yith_wcan_shortcodes.modal_on_mobile ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst media = window.matchMedia(\n\t\t\t`(max-width: ${ yith_wcan_shortcodes.mobile_media_query }px)`\n\t\t);\n\n\t\t$( window )\n\t\t\t.on( 'resize', () => {\n\t\t\t\tconst isMobile = !! media.matches;\n\n\t\t\t\tif ( isMobile !== this.isMobile ) {\n\t\t\t\t\tthis.isMobile = isMobile;\n\t\t\t\t\tthis._afterLayoutChange();\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.resize();\n\t}\n\n\t// init filter\n\t_initFilter( $filter ) {\n\t\tconst self = this,\n\t\t\thandleChange = function ( ev ) {\n\t\t\t\tconst t = $( this ),\n\t\t\t\t\t$currentFilter = t.closest( '.yith-wcan-filter' ),\n\t\t\t\t\tmultiple = $currentFilter.length\n\t\t\t\t\t\t? 'yes' === $currentFilter.data( 'multiple' )\n\t\t\t\t\t\t: false,\n\t\t\t\t\t$item = t.closest( '.filter-item' ),\n\t\t\t\t\t$items = $item.length\n\t\t\t\t\t\t? $currentFilter.find( '.filter-item' ).not( $item )\n\t\t\t\t\t\t: [];\n\n\t\t\t\tif ( $item.is( '.disabled' ) && ! $item.is( '.active' ) ) {\n\t\t\t\t\tev.preventDefault();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tev.preventDefault();\n\n\t\t\t\t$items.length &&\n\t\t\t\t\t! multiple &&\n\t\t\t\t\t$items\n\t\t\t\t\t\t.removeClass( 'active' )\n\t\t\t\t\t\t.children( 'label' )\n\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t.parent( '.checked' )\n\t\t\t\t\t\t.removeClass( 'checked' );\n\t\t\t\t$item.length && $item.toggleClass( 'active' );\n\n\t\t\t\t// reset active filters.\n\t\t\t\tself.activeFilters = false;\n\n\t\t\t\tself.maybeFilter( $filter );\n\t\t\t\tself.maybeToggleClearAllFilters();\n\t\t\t\tself.maybeToggleClearFilter( $currentFilter );\n\t\t\t};\n\n\t\t// handle filter activation/deactivation by click on label (no input involved)\n\t\t$filter\n\t\t\t.find( '.filter-item' )\n\t\t\t.not( '.checkbox' )\n\t\t\t.not( '.radio' )\n\t\t\t.on( 'click', 'a', function ( ev ) {\n\t\t\t\tconst t = $( this ),\n\t\t\t\t\t$item = t.closest( '.filter-item' );\n\n\t\t\t\tif ( ! $( ev?.delegateTarget ).is( $item ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\thandleChange.call( this, ev );\n\t\t\t} );\n\n\t\t// handle filter activation/deactivation from input change\n\t\t$filter.find( ':input' ).on( 'change', function ( ev ) {\n\t\t\tconst t = $( this ),\n\t\t\t\t$item = t.closest( '.filter-item' );\n\n\t\t\tif ( $item.is( '.disabled' ) && ! $item.is( '.active' ) ) {\n\t\t\t\tt.prop( 'checked', false );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\thandleChange.call( this, ev );\n\t\t} );\n\n\t\t// handle filter activation/deactivation by click on label (there is an input whose state can be switched)\n\t\t$filter.find( 'label > a' ).on( 'click', function ( ev ) {\n\t\t\tconst t = $( this ),\n\t\t\t\t$item = t.closest( '.filter-item' );\n\n\t\t\tev.preventDefault();\n\n\t\t\tif ( $item.is( '.disabled' ) && ! $item.is( '.active' ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst $input = t.parent().find( ':input' );\n\n\t\t\tif (\n\t\t\t\t$input.is( '[type=\"radio\"]' ) ||\n\t\t\t\t$input.is( '[type=\"checkbox\"]' )\n\t\t\t) {\n\t\t\t\t$input.prop( 'checked', ! $input.prop( 'checked' ) );\n\t\t\t}\n\n\t\t\t$input.change();\n\t\t} );\n\n\t\t// init tooltip\n\t\tthis._initTooltip( $filter );\n\n\t\t// init price slider\n\t\tthis._initPriceSlider( $filter );\n\n\t\t// init dropdown\n\t\tthis._initDropdown( $filter );\n\n\t\t// init collapsable\n\t\tthis._initCollapsable( $filter );\n\n\t\t// init clear anchors\n\t\tthis.maybeShowClearFilter( $filter );\n\n\t\t// init custom inputs\n\t\tif ( this.$preset?.hasClass( 'custom-style' ) ) {\n\t\t\tthis._initCustomInput( $filter );\n\t\t\t$filter.on( 'yith_wcan_dropdown_updated', function () {\n\t\t\t\tconst $dropdown = $( this ),\n\t\t\t\t\t$current = $dropdown.closest( '.yith-wcan-filter' );\n\n\t\t\t\tself._initCustomInput( $current );\n\t\t\t} );\n\t\t}\n\t}\n\n\t// init tooltip\n\t_initTooltip( $filter, position ) {\n\t\t$filter.find( '[data-title]' ).each( function () {\n\t\t\tconst t = $( this );\n\n\t\t\tif ( t.hasClass( 'tooltip-added' ) || ! t.data( 'title' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tt.on( 'mouseenter', function () {\n\t\t\t\tlet th = $( this ),\n\t\t\t\t\ttooltip = null,\n\t\t\t\t\twrapperWidth = th.outerWidth(),\n\t\t\t\t\tleft = 0,\n\t\t\t\t\twidth = 0;\n\n\t\t\t\tif (\n\t\t\t\t\t! position ||\n\t\t\t\t\t( 'top' !== position && 'right' !== position )\n\t\t\t\t) {\n\t\t\t\t\tconst container = th.closest( '.filter-item' );\n\n\t\t\t\t\tposition =\n\t\t\t\t\t\tcontainer.hasClass( 'color' ) ||\n\t\t\t\t\t\tcontainer.hasClass( 'label' )\n\t\t\t\t\t\t\t? 'top'\n\t\t\t\t\t\t\t: 'right';\n\t\t\t\t}\n\n\t\t\t\ttooltip = $( '<span>', {\n\t\t\t\t\tclass: 'yith-wcan-tooltip',\n\t\t\t\t\thtml: th.data( 'title' ),\n\t\t\t\t} );\n\n\t\t\t\tth.append( tooltip );\n\n\t\t\t\twidth = tooltip.outerWidth() + 6;\n\t\t\t\ttooltip.outerWidth( width );\n\n\t\t\t\tif ( 'top' === position ) {\n\t\t\t\t\tleft = ( wrapperWidth - width ) / 2;\n\t\t\t\t} else {\n\t\t\t\t\tleft = wrapperWidth + 15;\n\t\t\t\t}\n\n\t\t\t\ttooltip.css( { left: left.toFixed( 0 ) + 'px' } ).fadeIn( 200 );\n\n\t\t\t\tth.addClass( 'with-tooltip' );\n\t\t\t} ).on( 'mouseleave', function () {\n\t\t\t\tconst th = $( this );\n\n\t\t\t\tth.find( '.yith-wcan-tooltip' ).fadeOut( 200, function () {\n\t\t\t\t\tth.removeClass( 'with-tooltip' )\n\t\t\t\t\t\t.find( '.yith-wcan-tooltip' )\n\t\t\t\t\t\t.remove();\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\tt.addClass( 'tooltip-added' );\n\t\t} );\n\t}\n\n\t// init dropdown\n\t_initDropdown( $filter ) {\n\t\tconst $dropdown = $filter.find( 'select.filter-dropdown' );\n\n\t\tif ( ! $dropdown.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t$dropdown.hasClass( 'select2-hidden-accessible' ) &&\n\t\t\t'undefined' !== typeof $.fn.selectWoo\n\t\t) {\n\t\t\t$dropdown.selectWoo( 'destroy' );\n\t\t}\n\n\t\tthis._initDropdownObject( $dropdown, {\n\t\t\tpaginate: true,\n\t\t\tperPage: yith_wcan_shortcodes.terms_per_page,\n\t\t} );\n\t}\n\n\t// init dropdown object\n\t_initDropdownObject( $dropdown, opts ) {\n\t\treturn new YITH_WCAN_Dropdown( $dropdown, opts );\n\t}\n\n\t// init price slider\n\t_initPriceSlider( $filter ) {\n\t\tif ( ! $filter.hasClass( 'filter-price-slider' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst self = this,\n\t\t\t$container = $filter.find( '.price-slider' ),\n\t\t\t$minInput = $container.find( '.price-slider-min' ),\n\t\t\t$maxInput = $container.find( '.price-slider-max' ),\n\t\t\tmin = parseFloat( $container.data( 'min' ) ),\n\t\t\tmax = parseFloat( $container.data( 'max' ) ),\n\t\t\tcurrentMin = parseFloat( $minInput.val() ),\n\t\t\tcurrentMax = parseFloat( $maxInput.val() ),\n\t\t\tstep = parseFloat( $container.data( 'step' ) ),\n\t\t\thandleSliderChange = function () {\n\t\t\t\tif ( self.sliderTimeout ) {\n\t\t\t\t\tclearTimeout( self.sliderTimeout );\n\t\t\t\t}\n\n\t\t\t\tself.sliderTimeout = setTimeout( () => {\n\t\t\t\t\tself.maybeFilter( $filter );\n\t\t\t\t}, 200 );\n\t\t\t};\n\n\t\t$filter.find( '.price-slider-ui' ).ionRangeSlider( {\n\t\t\tskin: 'round',\n\t\t\ttype: 'double',\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tstep,\n\t\t\tfrom: currentMin,\n\t\t\tto: currentMax,\n\t\t\tmin_interval: step,\n\t\t\tvalues_separator: ' - ',\n\t\t\tprettify: ( v ) => this.formatPrice( v ),\n\t\t\tonChange: ( data ) => {\n\t\t\t\t$minInput.val( data.from );\n\t\t\t\t$maxInput.val( data.to );\n\t\t\t},\n\t\t\tonFinish: handleSliderChange,\n\t\t} );\n\n\t\t$minInput\n\t\t\t.add( $maxInput )\n\t\t\t.off( 'change' )\n\t\t\t.on( 'keyup', () => {\n\t\t\t\tif ( ! $minInput.val() || ! $maxInput.val() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\thandleSliderChange();\n\t\t\t} );\n\t}\n\n\t// init collapsable\n\t_initCollapsable( $filter ) {\n\t\tthis._initTitleCollapsable( $filter );\n\t\tthis._initHierarchyCollapsable( $filter );\n\t}\n\n\t// init toggle on click of the title\n\t_initTitleCollapsable( $filter ) {\n\t\tconst $title = $filter.find( '.collapsable' );\n\n\t\tif ( ! $title.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._initToggle( $title, $title, $filter.find( '.filter-content' ) );\n\t}\n\n\t// init toggle on click of the parent li\n\t_initHierarchyCollapsable( $filter ) {\n\t\tconst $items = $filter.find( '.hierarchy-collapsable' );\n\n\t\tif ( ! $items.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// set parents of currently active term as open\n\t\tconst self = this,\n\t\t\tactive = $filter.find( '.active' );\n\n\t\tif ( active.length ) {\n\t\t\tactive\n\t\t\t\t.parents( '.hierarchy-collapsable' )\n\t\t\t\t.removeClass( 'closed' )\n\t\t\t\t.addClass( 'opened' );\n\n\t\t\tif (\n\t\t\t\tactive.hasClass( 'hierarchy-collapsable' ) &&\n\t\t\t\tyith_wcan_shortcodes.show_current_children\n\t\t\t) {\n\t\t\t\tactive.removeClass( 'closed' ).addClass( 'opened' );\n\t\t\t}\n\t\t}\n\n\t\t$items.each( function () {\n\t\t\tconst $t = $( this ),\n\t\t\t\t$toggle = $( '<span/>', {\n\t\t\t\t\tclass: 'toggle-handle',\n\t\t\t\t} );\n\n\t\t\t$toggle.appendTo( $t );\n\n\t\t\tself._initToggle( $toggle, $t, $t.children( 'ul.filter-items' ) );\n\t\t} );\n\t}\n\n\t// init toggle to generic toggle/target pair\n\t_initToggle( $toggle, $container, $target ) {\n\t\tif ( $container.hasClass( 'closed' ) ) {\n\t\t\t$target.hide();\n\t\t}\n\n\t\t$toggle.off( 'click' ).on( 'click', ( ev ) => {\n\t\t\tev.stopPropagation();\n\t\t\tev.preventDefault();\n\n\t\t\t$target.slideToggle( 400, () => {\n\t\t\t\t$container.toggleClass( 'opened' ).toggleClass( 'closed' );\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// init custom input\n\t_initCustomInput( $filter ) {\n\t\t$filter.find( ':input' ).each( function () {\n\t\t\tlet input = $( this ),\n\t\t\t\ttype = input.attr( 'type' ),\n\t\t\t\tcontainerClass = `${ type }button`,\n\t\t\t\tcontainer;\n\n\t\t\tif ( 'checkbox' !== type && 'radio' !== type ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( input.closest( `.${ containerClass }` ).length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( input.is( ':checked' ) ) {\n\t\t\t\tcontainerClass += ' checked';\n\t\t\t}\n\n\t\t\tcontainer = $( '<span/>', {\n\t\t\t\tclass: containerClass,\n\t\t\t} );\n\n\t\t\tinput.wrap( container ).on( 'change', function () {\n\t\t\t\tconst t = $( this );\n\n\t\t\t\tt.prop( 'checked' )\n\t\t\t\t\t? t.parent().addClass( 'checked' )\n\t\t\t\t\t: t.parent().removeClass( 'checked' );\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// register initial status\n\t_regiterStatus() {\n\t\tthis.originalFilters = this.getFiltersProperties();\n\t}\n\n\t// trigger handling after layout change\n\t_afterLayoutChange() {\n\t\tif ( this.isMobile ) {\n\t\t\tthis.$preset\n\t\t\t\t.addClass( 'filters-modal' )\n\t\t\t\t.attr( 'role', 'dialog' )\n\t\t\t\t.attr( 'tabindex', '-1' )\n\t\t\t\t.hide();\n\n\t\t\tthis._addCloseModalButton();\n\t\t\tthis._addApplyFiltersModalButton();\n\t\t\tthis._switchToCollapsables();\n\n\t\t\tthis.$filterButtons?.hide();\n\t\t} else {\n\t\t\tthis.$preset\n\t\t\t\t.removeClass( 'filters-modal' )\n\t\t\t\t.removeClass( 'open' )\n\t\t\t\t.removeAttr( 'role' )\n\t\t\t\t.removeAttr( 'tabindex' )\n\t\t\t\t.show();\n\n\t\t\t$( 'body' )\n\t\t\t\t.css( 'overflow', 'auto' )\n\t\t\t\t.removeClass( 'yith-wcan-preset-modal-open' );\n\n\t\t\tthis._removeCloseModalButton();\n\t\t\tthis._removeApplyFiltersModalButton();\n\t\t\tthis._switchBackCollapsables();\n\n\t\t\tthis.$filterButtons?.show();\n\t\t}\n\t}\n\n\t// add modal close button\n\t_addCloseModalButton() {\n\t\tconst $closeButton = $( '<a/>', {\n\t\t\tclass: 'close-button',\n\t\t\thtml: '&times;',\n\t\t\t'data-dismiss': 'modal',\n\t\t\t'aria-label': yith_wcan_shortcodes.labels.close,\n\t\t} );\n\n\t\t$closeButton\n\t\t\t.prependTo( this.$preset )\n\t\t\t.on( 'click', this.closeModal.bind( this ) );\n\t\tthis.modalElements.closeButton = $closeButton;\n\t}\n\n\t// remove modal close button\n\t_removeCloseModalButton() {\n\t\tthis.modalElements?.closeButton?.remove();\n\t}\n\n\t// show main filter button for the modal\n\t_addApplyFiltersModalButton() {\n\t\tconst $filterButton = $( '<button/>', {\n\t\t\tclass: 'apply-filters main-modal-button',\n\t\t\thtml: yith_wcan_shortcodes.labels.show_results,\n\t\t\t'data-dismiss': 'modal',\n\t\t} );\n\n\t\t$filterButton.appendTo( this.$preset ).on( 'click', () => {\n\t\t\tthis.filter();\n\t\t\tthis.closeModal();\n\t\t} );\n\t\tthis.modalElements.applyFiltersButton = $filterButton;\n\t}\n\n\t// hide main filter button for the modal\n\t_removeApplyFiltersModalButton() {\n\t\tthis.modalElements?.applyFiltersButton?.remove();\n\t}\n\n\t// convert all filters to collapsable\n\t_switchToCollapsables() {\n\t\tconst self = this;\n\n\t\tthis.getFilters().each( function () {\n\t\t\tconst $filter = $( this ),\n\t\t\t\t$title = $filter.find( '.filter-title' );\n\n\t\t\tif ( ! $title.length || $title.hasClass( 'collapsable' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$title.addClass( 'collapsable' ).data( 'disable-collapse', true );\n\n\t\t\tself._initTitleCollapsable( $filter );\n\t\t} );\n\t}\n\n\t// switch back filters to their previous collapsable state\n\t_switchBackCollapsables() {\n\t\tthis.getFilters().each( function () {\n\t\t\tconst $filter = $( this ),\n\t\t\t\t$title = $filter.find( '.filter-title' );\n\n\t\t\tif (\n\t\t\t\t! $title.length ||\n\t\t\t\t! $title.hasClass( 'collapsable' ) ||\n\t\t\t\t! $title.data( 'disable-collapse' )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$title\n\t\t\t\t.removeClass( 'collapsable' )\n\t\t\t\t.removeData( 'disable-collapse', true )\n\t\t\t\t.off( 'click' );\n\n\t\t\t$filter.find( '.filter-content' ).show();\n\t\t} );\n\t}\n\n\t// close all collpasable before showing modal\n\t_openAllCollapsables() {\n\t\tthis.$filters\n\t\t\t.not( '.no-title' )\n\t\t\t.not( ( i, v ) => {\n\t\t\t\treturn this.isFilterActive( $( v ) );\n\t\t\t} )\n\t\t\t.find( '.filter-content' )\n\t\t\t.show()\n\t\t\t.end()\n\t\t\t.find( '.filter-title' )\n\t\t\t.removeClass( 'closed' )\n\t\t\t.addClass( 'opened' );\n\t}\n\n\t// close all collpasable before showing modal\n\t_closeAllCollapsables() {\n\t\tthis.$filters\n\t\t\t.not( '.no-title' )\n\t\t\t.not( ( i, v ) => {\n\t\t\t\treturn this.isFilterActive( $( v ) );\n\t\t\t} )\n\t\t\t.find( '.filter-content' )\n\t\t\t.hide()\n\t\t\t.end()\n\t\t\t.find( '.filter-title' )\n\t\t\t.addClass( 'closed' )\n\t\t\t.removeClass( 'opened' );\n\t}\n\n\t// update status change flag, if filters have changed\n\tmaybeRegisterStatusChange() {\n\t\tconst currentFilters = this.getFiltersProperties(),\n\t\t\tcurrentStr = JSON.stringify( currentFilters ),\n\t\t\toriginalStr = JSON.stringify( this.originalFilters );\n\n\t\tthis.dirty = currentStr !== originalStr;\n\t}\n\n\t// apply filters when possible\n\tmaybeFilter( $initiator ) {\n\t\t// register status change\n\t\tthis.maybeRegisterStatusChange();\n\n\t\t// filter, or show filter button.\n\t\tif ( yith_wcan_shortcodes.instant_filters && ! this.isMobile ) {\n\t\t\tthis.filter();\n\t\t} else if (\n\t\t\t! yith_wcan_shortcodes.instant_filters &&\n\t\t\t! this.isMobile\n\t\t) {\n\t\t\tthis.dirty\n\t\t\t\t? this.$filterButtons?.show()\n\t\t\t\t: this.$filterButtons?.hide();\n\t\t} else if ( this.isMobile && this.dirty ) {\n\t\t\tthis.$preset.addClass( 'with-filter-button' );\n\t\t\tthis.modalElements.applyFiltersButton?.show();\n\t\t}\n\t}\n\n\t// main filtering method\n\tfilter() {\n\t\tconst filter = window?.product_filter;\n\n\t\tfilter\n\t\t\t?.doFilter( this.getFiltersProperties(), this.target, this.preset )\n\t\t\t?.done( () => {\n\t\t\t\tlet newPreset = $( this.preset );\n\n\t\t\t\tif ( newPreset.length && yith_wcan_shortcodes.scroll_top ) {\n\t\t\t\t\t// by default, scroll till top of first preset in the page.\n\t\t\t\t\tlet targetOffset = newPreset.offset().top;\n\n\t\t\t\t\tif ( !! yith_wcan_shortcodes.scroll_target ) {\n\t\t\t\t\t\t// when we have a specific target, use that for the offset.\n\t\t\t\t\t\tconst $scrollTarget = $(\n\t\t\t\t\t\t\tyith_wcan_shortcodes.scroll_target\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\ttargetOffset = $scrollTarget.length\n\t\t\t\t\t\t\t? $scrollTarget.offset().top\n\t\t\t\t\t\t\t: targetOffset;\n\t\t\t\t\t} else if ( this.isMobile ) {\n\t\t\t\t\t\t// otherwise, if we're on mobile, scroll to the top of the page\n\t\t\t\t\t\t// (preset could be in an unexpected location).\n\t\t\t\t\t\ttargetOffset = 100;\n\t\t\t\t\t}\n\n\t\t\t\t\t$( 'body, html' ).animate( {\n\t\t\t\t\t\tscrollTop: targetOffset - 100,\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t// register new filters, clear status flag\n\t\t\t\tthis.originalFilters = this.getFiltersProperties();\n\t\t\t\tthis.dirty = false;\n\t\t\t} );\n\n\t\tif ( this.isMobile ) {\n\t\t\tthis.$preset.removeClass( 'with-filter-button' );\n\t\t\tthis.modalElements.applyFiltersButton?.hide();\n\t\t\tthis.closeModal();\n\t\t}\n\t}\n\n\t// get all filter nodes\n\tgetFilters() {\n\t\tif ( false === this.$filters ) {\n\t\t\tthis.$filters = this.$preset.find( '.yith-wcan-filter' );\n\t\t}\n\n\t\treturn this.$filters;\n\t}\n\n\t// retrieves all filters that we want to apply\n\tgetActiveFilters() {\n\t\tif ( false === this.activeFilters ) {\n\t\t\tthis.activeFilters = this.getFiltersProperties();\n\t\t}\n\n\t\treturn this.activeFilters;\n\t}\n\n\t// check whether there is any filter active\n\tisAnyFilterActive() {\n\t\treturn !! Object.keys( this.getActiveFilters() ).length;\n\t}\n\n\t// checks whether current filter is active\n\tisFilterActive( $filter ) {\n\t\tlet filterType = $filter.data( 'filter-type' ),\n\t\t\tactive,\n\t\t\tfilteredActive;\n\n\t\tswitch ( filterType ) {\n\t\t\tcase 'tax':\n\t\t\tcase 'review':\n\t\t\tcase 'price_range':\n\t\t\t\tconst $dropdown = $filter.find( '.filter-dropdown' );\n\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tconst val = $dropdown.val();\n\n\t\t\t\t\tactive = 'object' === typeof val ? !! val?.length : !! val;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t// if we use type other than dropdown, fallthrough\n\t\t\tcase 'stock_sale':\n\t\t\t\tactive = $filter\n\t\t\t\t\t.find( '.filter-item' )\n\t\t\t\t\t.filter( '.active' ).length;\n\t\t\t\tbreak;\n\t\t\tcase 'price_slider':\n\t\t\t\tconst step = parseFloat(\n\t\t\t\t\t\t$filter.find( '.price-slider' ).data( 'step' )\n\t\t\t\t\t),\n\t\t\t\t\tmin = parseFloat(\n\t\t\t\t\t\t$filter.find( '.price-slider' ).data( 'min' )\n\t\t\t\t\t),\n\t\t\t\t\tmax = parseFloat(\n\t\t\t\t\t\t$filter.find( '.price-slider' ).data( 'max' )\n\t\t\t\t\t),\n\t\t\t\t\tcurrentMin = parseFloat(\n\t\t\t\t\t\t$filter.find( '.price-slider-min' ).val()\n\t\t\t\t\t),\n\t\t\t\t\tcurrentMax = parseFloat(\n\t\t\t\t\t\t$filter.find( '.price-slider-max' ).val()\n\t\t\t\t\t);\n\n\t\t\t\tactive =\n\t\t\t\t\tMath.abs( currentMin - min ) >= step ||\n\t\t\t\t\tMath.abs( currentMax - max ) >= step;\n\t\t\t\tbreak;\n\t\t\tcase 'orderby':\n\t\t\t\tactive =\n\t\t\t\t\t'menu_order' !== $filter.find( '.filter-order-by' ).val();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tactive = false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tfilteredActive = $filter.triggerHandler( 'yith_wcan_is_filter_active', [\n\t\t\tactive,\n\t\t\tthis,\n\t\t] );\n\t\tactive =\n\t\t\ttypeof filteredActive !== 'undefined' ? filteredActive : active;\n\n\t\treturn active;\n\t}\n\n\t// count the number of active items per filter\n\tcountActiveItems( $filter ) {\n\t\tlet filterType = $filter.data( 'filter-type' ),\n\t\t\tcount;\n\n\t\tswitch ( filterType ) {\n\t\t\tcase 'tax':\n\t\t\tcase 'review':\n\t\t\tcase 'price_range':\n\t\t\t\tconst $dropdown = $filter.find( '.filter-dropdown' );\n\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tconst val = $dropdown.val();\n\n\t\t\t\t\tcount = 'object' === typeof val ? val?.length : +!! val;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t// if we use type other than dropdown, fallthrough\n\t\t\tcase 'stock_sale':\n\t\t\t\tcount = $filter\n\t\t\t\t\t.find( '.filter-items' )\n\t\t\t\t\t.find( '.active' ).length;\n\t\t\t\tbreak;\n\t\t\tcase 'orderby':\n\t\t\t\tif ( this.isFilterActive( $filter ) ) {\n\t\t\t\t\tcount = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'price_slider':\n\t\t\tdefault:\n\t\t\t\tcount = 0;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn count;\n\t}\n\n\t// retrieves filter properties for the filter\n\tgetFilterProperties( $filter ) {\n\t\tlet filterType = $filter.data( 'filter-type' ),\n\t\t\tmultiple = 'yes' === $filter.data( 'multiple' ),\n\t\t\t$dropdown = $filter.find( '.filter-dropdown' ),\n\t\t\tproperties = {},\n\t\t\tfilteredProperties,\n\t\t\t$active;\n\n\t\tswitch ( filterType ) {\n\t\t\tcase 'tax':\n\t\t\t\tlet activeTerms = [],\n\t\t\t\t\ttaxonomy = $filter.data( 'taxonomy' ),\n\t\t\t\t\tisAttr = 0 === taxonomy.indexOf( 'filter' ),\n\t\t\t\t\trelation = $filter.data( 'relation' );\n\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tif ( multiple ) {\n\t\t\t\t\t\tactiveTerms = $dropdown.val();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tactiveTerms.push( $dropdown.val() );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$active = $filter\n\t\t\t\t\t\t.find( '.filter-item' )\n\t\t\t\t\t\t.filter( '.active' )\n\t\t\t\t\t\t.children( 'a, label' );\n\n\t\t\t\t\tactiveTerms = $active.get().reduce( function ( a, v ) {\n\t\t\t\t\t\tlet val;\n\n\t\t\t\t\t\tv = $( v );\n\t\t\t\t\t\tval = v.is( 'label' )\n\t\t\t\t\t\t\t? v.find( ':input' ).val()\n\t\t\t\t\t\t\t: v.data( 'term-slug' );\n\n\t\t\t\t\t\tif ( ! val ) {\n\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ta.push( val );\n\n\t\t\t\t\t\treturn a;\n\t\t\t\t\t}, activeTerms );\n\t\t\t\t}\n\n\t\t\t\tif ( ! multiple ) {\n\t\t\t\t\tproperties[ taxonomy ] = activeTerms.pop();\n\t\t\t\t} else {\n\t\t\t\t\tconst glue = ! isAttr && 'and' === relation ? '+' : ',';\n\t\t\t\t\tproperties[ taxonomy ] = activeTerms.join( glue );\n\t\t\t\t}\n\n\t\t\t\tif ( isAttr ) {\n\t\t\t\t\tproperties[ taxonomy.replace( 'filter_', 'query_type_' ) ] =\n\t\t\t\t\t\trelation;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 'review':\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tproperties.rating_filter = $dropdown.val();\n\t\t\t\t} else {\n\t\t\t\t\t$active = $filter\n\t\t\t\t\t\t.find( '.filter-item' )\n\t\t\t\t\t\t.filter( '.active' )\n\t\t\t\t\t\t.children( 'a, label' );\n\n\t\t\t\t\tif ( ! multiple ) {\n\t\t\t\t\t\t$active = $active.first();\n\t\t\t\t\t\tproperties.rating_filter = $active.is( 'label' )\n\t\t\t\t\t\t\t? $active.find( ':input' ).val()\n\t\t\t\t\t\t\t: $active.data( 'rating' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tproperties.rating_filter = $active\n\t\t\t\t\t\t\t.get()\n\t\t\t\t\t\t\t.reduce( function ( a, v ) {\n\t\t\t\t\t\t\t\tlet val;\n\n\t\t\t\t\t\t\t\tv = $( v );\n\t\t\t\t\t\t\t\tval = v.is( 'label' )\n\t\t\t\t\t\t\t\t\t? v.find( ':input' ).val()\n\t\t\t\t\t\t\t\t\t: v.data( 'rating' );\n\n\t\t\t\t\t\t\t\tif ( ! val ) {\n\t\t\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ta.push( val );\n\n\t\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t\t}, [] )\n\t\t\t\t\t\t\t.join( ',' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'price_range':\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tif ( multiple ) {\n\t\t\t\t\t\tproperties.price_ranges = $dropdown.val().join( ',' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tproperties.min_price = $dropdown\n\t\t\t\t\t\t\t.val()\n\t\t\t\t\t\t\t.split( '-' )[ 0 ];\n\t\t\t\t\t\tproperties.max_price = $dropdown\n\t\t\t\t\t\t\t.val()\n\t\t\t\t\t\t\t.split( '-' )[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$active = $filter\n\t\t\t\t\t\t.find( '.filter-item' )\n\t\t\t\t\t\t.filter( '.active' )\n\t\t\t\t\t\t.children( 'a, label' );\n\n\t\t\t\t\tif ( multiple ) {\n\t\t\t\t\t\tproperties.price_ranges = $active\n\t\t\t\t\t\t\t.get()\n\t\t\t\t\t\t\t.reduce( ( a, v ) => {\n\t\t\t\t\t\t\t\tlet min = $( v ).data( 'range-min' ),\n\t\t\t\t\t\t\t\t\tmax = $( v ).data( 'range-max' );\n\n\t\t\t\t\t\t\t\ta += ( max ? `${ min }-${ max }` : min ) + ',';\n\n\t\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t\t}, '' )\n\t\t\t\t\t\t\t.replace( /^(.*),$/, '$1' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tproperties.min_price = parseFloat(\n\t\t\t\t\t\t\t$active.first().data( 'range-min' )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tproperties.max_price = parseFloat(\n\t\t\t\t\t\t\t$active.first().data( 'range-max' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'price_slider':\n\t\t\t\tproperties.min_price = parseFloat(\n\t\t\t\t\t$filter.find( '.price-slider-min' ).val()\n\t\t\t\t);\n\t\t\t\tproperties.max_price = parseFloat(\n\t\t\t\t\t$filter.find( '.price-slider-max' ).val()\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'stock_sale':\n\t\t\t\tif ( $filter.find( '.filter-on-sale' ).is( '.active' ) ) {\n\t\t\t\t\tproperties.onsale_filter = 1;\n\t\t\t\t}\n\t\t\t\tif ( $filter.find( '.filter-in-stock' ).is( '.active' ) ) {\n\t\t\t\t\tproperties.instock_filter = 1;\n\t\t\t\t}\n\t\t\t\tif ( $filter.find( '.filter-featured' ).is( '.active' ) ) {\n\t\t\t\t\tproperties.featured_filter = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'orderby':\n\t\t\t\tproperties.orderby = $filter.find( '.filter-order-by' ).val();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tfilteredProperties = $filter.triggerHandler(\n\t\t\t'yith_wcan_filter_properties',\n\t\t\t[ properties, self ]\n\t\t);\n\t\tproperties =\n\t\t\ttypeof filteredProperties !== 'undefined'\n\t\t\t\t? filteredProperties\n\t\t\t\t: properties;\n\n\t\treturn properties;\n\t}\n\n\t// retrieves properties for all filters of the preset\n\tgetFiltersProperties() {\n\t\tlet properties = {};\n\t\tconst self = this;\n\n\t\tthis.getFilters().each( function () {\n\t\t\tconst $filter = $( this );\n\n\t\t\tif ( self.isFilterActive( $filter ) ) {\n\t\t\t\tconst filterProperties = self.getFilterProperties( $filter );\n\n\t\t\t\tproperties = self.mergeProperties(\n\t\t\t\t\tproperties,\n\t\t\t\t\tfilterProperties,\n\t\t\t\t\t$filter\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn properties;\n\t}\n\n\t// retrieve filters matching any of the properties passed\n\tgetFiltersByProperties( properties ) {\n\t\tconst self = this;\n\n\t\treturn this.getFilters().filter( function () {\n\t\t\tconst $filter = $( this );\n\n\t\t\tif ( self.isFilterActive( $filter ) ) {\n\t\t\t\tlet filterProperties = self.getFilterProperties( $filter ),\n\t\t\t\t\thasProp = false;\n\n\t\t\t\tfor ( const prop in properties ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t[ 'min_price', 'max_price', 'price_ranges' ].includes(\n\t\t\t\t\t\t\tprop\n\t\t\t\t\t\t) &&\n\t\t\t\t\t\t( filterProperties.min_price ||\n\t\t\t\t\t\t\tfilterProperties.price_ranges )\n\t\t\t\t\t) {\n\t\t\t\t\t\thasProp = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if ( filterProperties[ prop ] ) {\n\t\t\t\t\t\thasProp = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn hasProp;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t} );\n\t}\n\n\t// show clear selection anchor\n\tmaybeToggleClearFilter( $filter ) {\n\t\tif ( ! this.isFilterActive( $filter ) ) {\n\t\t\tthis.maybeHideClearFilter( $filter );\n\t\t} else {\n\t\t\tthis.maybeShowClearFilter( $filter );\n\t\t}\n\t}\n\n\t// show clear all selections anchor\n\tmaybeToggleClearAllFilters() {\n\t\tif ( ! this.isAnyFilterActive() ) {\n\t\t\tthis.maybeHideClearAllFilters();\n\t\t} else {\n\t\t\tthis.maybeShowClearAllFilters();\n\t\t}\n\t}\n\n\t// show clear selection anchor\n\tmaybeShowClearFilter( $filter ) {\n\t\tif (\n\t\t\t! this.isFilterActive( $filter ) ||\n\t\t\t! yith_wcan_shortcodes.show_clear_filter\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// remove clear selection link if already added.\n\t\t$filter.find( '.clear-selection' ).remove();\n\n\t\t// add new clear selection link.\n\t\t$( '<a/>', {\n\t\t\tclass: 'clear-selection',\n\t\t\ttext: yith_wcan_shortcodes.labels.clear_selection,\n\t\t\trole: 'button',\n\t\t} )\n\t\t\t.prependTo( $filter.find( '.filter-content' ) )\n\t\t\t.on( 'click', ( ev ) => {\n\t\t\t\tev.preventDefault();\n\n\t\t\t\tthis.deactivateFilter(\n\t\t\t\t\t$filter,\n\t\t\t\t\tfalse,\n\t\t\t\t\tyith_wcan_shortcodes.instant_filters\n\t\t\t\t);\n\t\t\t\tthis.maybeHideClearFilter( $filter );\n\n\t\t\t\tif ( yith_wcan_shortcodes.instant_filters ) {\n\t\t\t\t\tthis.closeModal();\n\t\t\t\t}\n\t\t\t} );\n\t}\n\n\t// show clearAll anchor, when on mobile layout\n\tmaybeShowClearAllFilters() {\n\t\tif ( ! this.isAnyFilterActive() || ! this.isMobile ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// remove clear selection link if already added.\n\t\tthis.$preset.find( '.clear-selection' ).remove();\n\n\t\t// add new clear selection link.\n\t\t$( '<a/>', {\n\t\t\tclass: 'clear-selection',\n\t\t\ttext: yith_wcan_shortcodes.labels.clear_all_selections,\n\t\t\trole: 'button',\n\t\t} )\n\t\t\t.prependTo( this.$preset.find( '.filters-container' ) )\n\t\t\t.on( 'click', ( ev ) => {\n\t\t\t\tev.preventDefault();\n\n\t\t\t\tthis.deactivateAllFilters(\n\t\t\t\t\tyith_wcan_shortcodes.instant_filters\n\t\t\t\t);\n\t\t\t\tthis.maybeHideClearAllFilters();\n\n\t\t\t\tif ( yith_wcan_shortcodes.instant_filters ) {\n\t\t\t\t\tthis.closeModal();\n\t\t\t\t}\n\t\t\t} );\n\t}\n\n\t// hide clear selection anchor\n\tmaybeHideClearFilter( $filter ) {\n\t\tif (\n\t\t\tthis.isFilterActive( $filter ) ||\n\t\t\t! yith_wcan_shortcodes.show_clear_filter\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// remove clear selection link.\n\t\t$filter.find( '.clear-selection' ).remove();\n\t}\n\n\t// show clearAll anchor, when on mobile layout\n\tmaybeHideClearAllFilters() {\n\t\tif ( this.isAnyFilterActive() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// remove clear selection link.\n\t\tthis.$preset\n\t\t\t.find( '.filters-container' )\n\t\t\t.children( '.clear-selection' )\n\t\t\t.remove();\n\t}\n\n\t// deactivate filter\n\tdeactivateFilter( $filter, properties, doFilter ) {\n\t\tconst filterType = $filter.data( 'filter-type' ),\n\t\t\t$items = $filter.find( '.filter-item' ),\n\t\t\t$activeItems = $items.filter( '.active' ),\n\t\t\t$dropdown = $filter.find( '.filter-dropdown' );\n\n\t\tswitch ( filterType ) {\n\t\t\tcase 'tax':\n\t\t\t\tconst taxonomy = $filter.data( 'taxonomy' );\n\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tif ( ! properties ) {\n\t\t\t\t\t\t$dropdown.find( 'option' ).prop( 'selected', false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$dropdown.find( 'option' ).each( function () {\n\t\t\t\t\t\t\tconst $option = $( this );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t$option.val().toString() ===\n\t\t\t\t\t\t\t\tproperties[ taxonomy ].toString()\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t$option.prop( 'selected', false );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\n\t\t\t\t\t$dropdown.change();\n\t\t\t\t} else if ( ! properties ) {\n\t\t\t\t\t$activeItems.children( 'label' ).children( 'a' ).click();\n\t\t\t\t\t$activeItems.removeClass( 'active' );\n\t\t\t\t} else {\n\t\t\t\t\t$activeItems.each( function () {\n\t\t\t\t\t\tlet $item = $( this ),\n\t\t\t\t\t\t\t$label = $item.children( 'label' ),\n\t\t\t\t\t\t\t$anchor = $item.children( 'a' ),\n\t\t\t\t\t\t\tvalue;\n\n\t\t\t\t\t\tvalue = $label.length\n\t\t\t\t\t\t\t? $label.find( ':input' ).val()\n\t\t\t\t\t\t\t: $anchor.data( 'term-slug' );\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tvalue.toString() ===\n\t\t\t\t\t\t\tproperties[ taxonomy ].toString()\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t$item.children( 'label' ).children( 'a' ).click();\n\t\t\t\t\t\t\t$item.removeClass( 'active' );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'review':\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tif ( ! properties ) {\n\t\t\t\t\t\t$dropdown.find( 'option' ).prop( 'selected', false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$dropdown.find( 'option' ).each( function () {\n\t\t\t\t\t\t\tconst $option = $( this );\n\n\t\t\t\t\t\t\tif ( $option.val() === properties.rating_filter ) {\n\t\t\t\t\t\t\t\t$option.prop( 'selected', false );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\n\t\t\t\t\t$dropdown.change();\n\t\t\t\t} else if ( ! properties ) {\n\t\t\t\t\t$activeItems.children( 'label' ).children( 'a' ).click();\n\t\t\t\t\t$activeItems.removeClass( 'active' );\n\t\t\t\t} else {\n\t\t\t\t\t$activeItems.each( function () {\n\t\t\t\t\t\tlet $item = $( this ),\n\t\t\t\t\t\t\t$label = $item.children( 'label' ),\n\t\t\t\t\t\t\t$anchor = $item.children( 'a' ),\n\t\t\t\t\t\t\tvalue;\n\n\t\t\t\t\t\tvalue = $label.length\n\t\t\t\t\t\t\t? $label.find( ':input' ).val()\n\t\t\t\t\t\t\t: $anchor.data( 'rating' );\n\n\t\t\t\t\t\tif ( value === properties.rating_filter ) {\n\t\t\t\t\t\t\t$item.children( 'label' ).children( 'a' ).click();\n\t\t\t\t\t\t\t$item.removeClass( 'active' );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'price_range':\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tif ( ! properties ) {\n\t\t\t\t\t\t$dropdown.find( 'option' ).prop( 'selected', false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$dropdown.find( 'option' ).each( function () {\n\t\t\t\t\t\t\tconst $option = $( this ),\n\t\t\t\t\t\t\t\tformattedRange =\n\t\t\t\t\t\t\t\t\tproperties.min_price +\n\t\t\t\t\t\t\t\t\t( properties.max_price\n\t\t\t\t\t\t\t\t\t\t? `-${ properties.max_price }`\n\t\t\t\t\t\t\t\t\t\t: '' );\n\n\t\t\t\t\t\t\tif ( $option.val() === formattedRange ) {\n\t\t\t\t\t\t\t\t$option.prop( 'selected', false );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\n\t\t\t\t\t$dropdown.change();\n\t\t\t\t} else if ( ! properties ) {\n\t\t\t\t\t$activeItems.children( 'label' ).children( 'a' ).click();\n\t\t\t\t\t$activeItems.removeClass( 'active' );\n\t\t\t\t} else {\n\t\t\t\t\t$activeItems.each( function () {\n\t\t\t\t\t\tlet $item = $( this ),\n\t\t\t\t\t\t\t$label = $item.children( 'label' ),\n\t\t\t\t\t\t\t$anchor = $item.children( 'a' ),\n\t\t\t\t\t\t\tformattedRange,\n\t\t\t\t\t\t\tvalue;\n\n\t\t\t\t\t\tvalue = $label.length\n\t\t\t\t\t\t\t? $label.find( ':input' ).val()\n\t\t\t\t\t\t\t: $anchor.data( 'min_price' ) +\n\t\t\t\t\t\t\t ( $anchor.data( 'max_price' )\n\t\t\t\t\t\t\t\t\t? '-' + $anchor.data( 'max_price' )\n\t\t\t\t\t\t\t\t\t: '' );\n\n\t\t\t\t\t\tif ( properties.min_price ) {\n\t\t\t\t\t\t\tformattedRange =\n\t\t\t\t\t\t\t\tproperties.min_price +\n\t\t\t\t\t\t\t\t( properties.max_price\n\t\t\t\t\t\t\t\t\t? '-' + properties.max_price\n\t\t\t\t\t\t\t\t\t: '' );\n\t\t\t\t\t\t} else if ( properties.price_ranges ) {\n\t\t\t\t\t\t\tformattedRange = properties.price_ranges;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( value === formattedRange ) {\n\t\t\t\t\t\t\t$item.children( 'label' ).children( 'a' ).click();\n\t\t\t\t\t\t\t$item.removeClass( 'active' );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'price_slider':\n\t\t\t\tconst $priceSlider = $filter.find( '.price-slider' );\n\n\t\t\t\t$filter\n\t\t\t\t\t.find( '.price-slider-min' )\n\t\t\t\t\t.val( $priceSlider.data( 'min' ) );\n\t\t\t\t$filter\n\t\t\t\t\t.find( '.price-slider-max' )\n\t\t\t\t\t.val( $priceSlider.data( 'max' ) )\n\t\t\t\t\t.change();\n\t\t\t\tbreak;\n\t\t\tcase 'orderby':\n\t\t\t\t$filter.find( 'select' ).val( 'menu_order' );\n\t\t\t\tbreak;\n\t\t\tcase 'stock_sale':\n\t\t\t\tif ( ! properties ) {\n\t\t\t\t\t$filter\n\t\t\t\t\t\t.find( '.filter-in-stock' )\n\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t.change();\n\t\t\t\t\t$filter\n\t\t\t\t\t\t.find( '.filter-on-sale' )\n\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t.change();\n\t\t\t\t\t$filter\n\t\t\t\t\t\t.find( '.filter-featured' )\n\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t.change();\n\n\t\t\t\t\t$items.removeClass( 'active' );\n\t\t\t\t} else {\n\t\t\t\t\tif ( properties?.instock_filter ) {\n\t\t\t\t\t\t$filter\n\t\t\t\t\t\t\t.find( '.filter-in-stock' )\n\t\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t\t.change()\n\t\t\t\t\t\t\t.closest( '.filter-item' )\n\t\t\t\t\t\t\t.removeClass( 'active' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( properties?.onsale_filter ) {\n\t\t\t\t\t\t$filter\n\t\t\t\t\t\t\t.find( '.filter-on-sale' )\n\t\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t\t.change()\n\t\t\t\t\t\t\t.closest( '.filter-item' )\n\t\t\t\t\t\t\t.removeClass( 'active' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( properties?.featured_filter ) {\n\t\t\t\t\t\t$filter\n\t\t\t\t\t\t\t.find( '.filter-featured' )\n\t\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t\t.change()\n\t\t\t\t\t\t\t.closest( '.filter-item' )\n\t\t\t\t\t\t\t.removeClass( 'active' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$items.removeClass( 'active' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis.activeFilters = false;\n\n\t\tif ( doFilter ) {\n\t\t\tthis.filter();\n\t\t}\n\t}\n\n\t// deactivate all filters\n\tdeactivateAllFilters( doFilter ) {\n\t\tconst self = this,\n\t\t\t$filters = this.getFilters();\n\n\t\t$filters.each( function () {\n\t\t\tconst $filter = $( this );\n\n\t\t\tself.deactivateFilter( $filter );\n\t\t} );\n\n\t\tthis.activeFilters = false;\n\n\t\tif ( doFilter ) {\n\t\t\tthis.filter();\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// deactivate filters that matches a specific set of properties\n\tdeactivateFilterByProperties( properties, doFilter ) {\n\t\tconst self = this,\n\t\t\t$filters = this.getFiltersByProperties( properties );\n\n\t\tif ( ! $filters.length ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$filters.each( function () {\n\t\t\tconst $filter = $( this );\n\n\t\t\tself.deactivateFilter( $filter, properties, doFilter );\n\t\t} );\n\n\t\treturn true;\n\t}\n\n\t// open filters as a modal, when in mobile layout\n\topenModal() {\n\t\tif ( ! this.isMobile ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( yith_wcan_shortcodes.toggles_open_on_modal ) {\n\t\t\tthis._openAllCollapsables();\n\t\t} else {\n\t\t\tthis._closeAllCollapsables();\n\t\t}\n\n\t\t$( 'body' )\n\t\t\t.css( 'overflow', 'hidden' )\n\t\t\t.addClass( 'yith-wcan-preset-modal-open' );\n\n\t\tthis.$preset.show();\n\n\t\tsetTimeout( () => {\n\t\t\tthis.$preset.addClass( 'open' );\n\t\t}, 100 );\n\t}\n\n\t// close filters modal, when in mobile layout\n\tcloseModal() {\n\t\tif ( ! this.isMobile ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.$preset.removeClass( 'open' );\n\n\t\tsetTimeout( () => {\n\t\t\tthis.$preset.hide();\n\t\t\t$( 'body' )\n\t\t\t\t.css( 'overflow', 'auto' )\n\t\t\t\t.removeClass( 'yith-wcan-preset-modal-open' );\n\t\t}, 300 );\n\t}\n\n\t// utility that formats the price according to store configuration.\n\tformatPrice( price ) {\n\t\tif ( 'undefined' !== typeof accounting ) {\n\t\t\tprice = accounting.formatMoney( price, {\n\t\t\t\tsymbol: yith_wcan_shortcodes.currency_format?.symbol,\n\t\t\t\tdecimal: yith_wcan_shortcodes.currency_format?.decimal,\n\t\t\t\tthousand: yith_wcan_shortcodes.currency_format?.thousand,\n\t\t\t\tprecision: 0,\n\t\t\t\tformat: yith_wcan_shortcodes.currency_format?.format,\n\t\t\t} );\n\t\t}\n\n\t\treturn price;\n\t}\n\n\t// utility that merges together sets of filter properties\n\tmergeProperties( set1, set2, $filter ) {\n\t\t// search for common properties\n\t\tfor ( const prop in set2 ) {\n\t\t\tif ( ! set2.hasOwnProperty( prop ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( !! set1[ prop ] ) {\n\t\t\t\tswitch ( prop ) {\n\t\t\t\t\tcase 'rating_filter':\n\t\t\t\t\tcase 'min_price':\n\t\t\t\t\tcase 'max_price':\n\t\t\t\t\tcase 'onsale_filter':\n\t\t\t\t\tcase 'instock_filter':\n\t\t\t\t\tcase 'orderby':\n\t\t\t\t\t\t// just override default value\n\t\t\t\t\t\tset1[ prop ] = set2[ prop ];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif ( 0 === prop.indexOf( 'query_type_' ) ) {\n\t\t\t\t\t\t\t// query_type param\n\t\t\t\t\t\t\tset1[ prop ] = set2[ prop ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// we're dealing with taxonomy\n\t\t\t\t\t\t\tconst isAttr = 0 === prop.indexOf( 'filter_' ),\n\t\t\t\t\t\t\t\tglue = isAttr ? ',' : '+';\n\n\t\t\t\t\t\t\tlet newValue =\n\t\t\t\t\t\t\t\tset1[ prop ].replace( ',', glue ) +\n\t\t\t\t\t\t\t\tglue +\n\t\t\t\t\t\t\t\tset2[ prop ].replace( ',', glue );\n\n\t\t\t\t\t\t\tnewValue = newValue\n\t\t\t\t\t\t\t\t.split( glue )\n\t\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t\t( value, index, arr ) =>\n\t\t\t\t\t\t\t\t\t\tarr.indexOf( value ) === index\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.join( glue );\n\n\t\t\t\t\t\t\tset1[ prop ] = newValue;\n\n\t\t\t\t\t\t\tif ( isAttr ) {\n\t\t\t\t\t\t\t\tconst queryTypeParam = prop.replace(\n\t\t\t\t\t\t\t\t\t'filter_',\n\t\t\t\t\t\t\t\t\t'query_type_'\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tset1[ queryTypeParam ] = 'and';\n\t\t\t\t\t\t\t\tset2[ queryTypeParam ] = 'and';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdelete set2[ prop ];\n\t\t\t}\n\t\t}\n\n\t\t$.extend( set1, set2 );\n\n\t\treturn set1;\n\t}\n}\n","'use strict';\n\n/* global globalThis, jQuery, yith_wcan_shortcodes, accounting */\n\nimport YITH_WCAN_Filter from './modules/yith-wcan-filter';\nimport YITH_WCAN_Reset_Button from './modules/yith-wcan-reset-button';\nimport YITH_WCAN_Preset from './modules/yith-wcan-preset';\n\njQuery( function ( $ ) {\n\t$( document )\n\t\t.on(\n\t\t\t'yith_wcan_init_shortcodes yith_plugin_fw_gutenberg_success_do_shortcode',\n\t\t\tfunction () {\n\t\t\t\t$( '.yith-wcan-filters' )\n\t\t\t\t\t.not( '.enhanced' )\n\t\t\t\t\t.each( function () {\n\t\t\t\t\t\tnew YITH_WCAN_Preset( $( this ) );\n\t\t\t\t\t} );\n\n\t\t\t\t$( '.yith-wcan-reset-filters' )\n\t\t\t\t\t.not( '.enhanced' )\n\t\t\t\t\t.each( function () {\n\t\t\t\t\t\tnew YITH_WCAN_Reset_Button( $( this ) );\n\t\t\t\t\t} );\n\t\t\t}\n\t\t)\n\t\t.trigger( 'yith_wcan_init_shortcodes' );\n\n\tglobalThis.product_filter = new YITH_WCAN_Filter();\n} );\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://yith-woocommerce-ajax-navigation/./assets/js/shortcodes/config.js","webpack://yith-woocommerce-ajax-navigation/./assets/js/shortcodes/modules/yith-wcan-filter.js","webpack://yith-woocommerce-ajax-navigation/./assets/js/shortcodes/modules/yith-wcan-reset-button.js","webpack://yith-woocommerce-ajax-navigation/./assets/js/shortcodes/modules/yith-wcan-dropdown.js","webpack://yith-woocommerce-ajax-navigation/./assets/js/shortcodes/modules/yith-wcan-preset.js","webpack://yith-woocommerce-ajax-navigation/./assets/js/shortcodes/index.js"],"names":["$","jQuery","$body","YITH_WCAN_Filter","location","search","initPopState","initialized","yith_wcan_shortcodes","reload_on_back","pushUrlToHistory","window","document","title","on","history","state","_yithWcan","reload","filters","target","preset","targetUrl","$target","customFilters","triggerHandler","block","buildUrl","ajax_filters","doingAjax","_doAjax","done","response","searchAlternativeUrl","_beforeFilter","refreshFragments","pageTitle","originalSearch","unblock","_afterFilter","trigger","closest","submit","filtered","Object","keys","length","queryParam","query_param","params","url","base_url","origin","pathname","self","haveFilters","session_param","replace","RegExp","searchParams","split","reduce","a","v","items","isFilterParam","i","_cleanParam","defaultUrl","matches","indexOf","match","current","change_browser_url","navigator","userAgent","method","responseDom","createElement","$response","innerHTML","$preset","$destination","find","replaceWith","first","content","param","process_sanitize","skip_sanitize","encodeURIComponent","xhr","abort","headers","$el","background","loader","message","overlayCSS","opacity","supportedParams","customParams","concat","supported_taxonomies","map","YITH_WCAN_Reset_Button","el","$reset","ev","preventDefault","each","data","deactivateAllFilters","closeModal","addClass","YITH_WCAN_Dropdown","opts","$originalSelect","is","defaultPerPage","defaultOrder","defaultAll","defaults","showSearch","paginate","perPage","order","getElements","labels","emptyLabel","empty_option","searchPlaceholder","search_placeholder","noItemsFound","no_items","showMore","show_more","options","_hideSelect","_initTemplate","_initActions","hide","$mainSpan","$labelSpan","html","getLabel","$dropdownSpan","$matchingItemsList","append","_initSearchTemplate","_initShowMoreTemplate","after","$_main","$_label","$_dropdown","$_items","$dropdwonSpan","$container","$search","name","autocomplete","type","placeholder","prependTo","$_search","$showMore","text","loadNextPage","bind","$_showMore","stopPropagation","toggleDropdown","_populateItems","$li","value","isActive","hasClass","isValueSelected","toggleClass","_changeItemStatus","siblings","removeClass","input","parent","prop","change","selfOriginated","_selectItem","_deselectItem","updateLabel","globalThis","yith_wcan_dropdown_init","_closeAllDropdowns","_afterDropdownOpen","dropdowns","filter","select","closeDropdown","_closeOtherDropdowns","val","limit","matchingElements","$options","getOptions","promise","Promise","resolve","t","label","regex","show","test","push","then","retrievedElements","_formatItems","indexes","hasMore","sort","b","mod","slice","active","option","getOptionByValue","$item","attr","$anchor","template","count","href","rel","$checkbox","$label","prepend","page","parseInt","getMatchingElements","resultSet","matchingItems","_emptyItems","_hideLoadMore","currentPage","unshift","_generateItem","_showLoadMore","status","$option","hasSelectedValues","getSelectedLabels","join","getSelectedOptions","found","getSelectedValues","toString","values","YITH_WCAN_Preset","_regiterStatus","_initFilterButton","_initResponsive","_initFilters","getFilters","$filter","_initFilter","maybeShowClearAllFilters","$filterButtons","modal_on_mobile","media","matchMedia","mobile_media_query","isMobile","_afterLayoutChange","resize","handleChange","$currentFilter","multiple","$items","not","children","activeFilters","maybeFilter","maybeToggleClearAllFilters","maybeToggleClearFilter","delegateTarget","call","$input","_initTooltip","_initPriceSlider","_initDropdown","_initCollapsable","maybeShowClearFilter","_initCustomInput","$dropdown","$current","position","th","tooltip","wrapperWidth","outerWidth","left","width","container","css","toFixed","fadeIn","fadeOut","remove","selectWoo","_initDropdownObject","terms_per_page","$minInput","$maxInput","min","parseFloat","max","currentMin","currentMax","step","handleSliderChange","sliderTimeout","clearTimeout","setTimeout","ionRangeSlider","skin","from","to","min_interval","values_separator","prettify","formatPrice","onChange","onFinish","add","off","_initTitleCollapsable","_initHierarchyCollapsable","$title","_initToggle","parents","show_current_children","$t","$toggle","appendTo","slideToggle","containerClass","wrap","originalFilters","getFiltersProperties","_addCloseModalButton","_addApplyFiltersModalButton","_switchToCollapsables","removeAttr","_removeCloseModalButton","_removeApplyFiltersModalButton","_switchBackCollapsables","$closeButton","close","modalElements","closeButton","$filterButton","show_results","applyFiltersButton","removeData","$filters","isFilterActive","end","currentFilters","currentStr","JSON","stringify","originalStr","dirty","$initiator","maybeRegisterStatusChange","instant_filters","product_filter","doFilter","newPreset","scroll_top","targetOffset","offset","top","scroll_target","$scrollTarget","animate","scrollTop","getActiveFilters","filterType","filteredActive","Math","abs","properties","filteredProperties","$active","activeTerms","taxonomy","isAttr","relation","get","pop","glue","rating_filter","price_ranges","min_price","max_price","onsale_filter","instock_filter","featured_filter","orderby","filterProperties","getFilterProperties","mergeProperties","hasProp","includes","maybeHideClearFilter","isAnyFilterActive","maybeHideClearAllFilters","show_clear_filter","clear_selection","role","deactivateFilter","clear_all_selections","$activeItems","click","formattedRange","$priceSlider","getFiltersByProperties","toggles_open_on_modal","_openAllCollapsables","_closeAllCollapsables","price","accounting","formatMoney","symbol","currency_format","decimal","thousand","precision","format","set1","set2","hasOwnProperty","newValue","index","arr","queryTypeParam"],"mappings":";;;;;AAAa;AAEb;;AAEA,IAAMA,CAAC,GAAGC,MAAV,C,CAAkB;;AAClB,IAAMC,KAAK,GAAGF,CAAC,CAAE,MAAF,CAAf;;;ACLa;AAEb;;;;;;;;;;;;AAEA;;IAEqBG,gB;AACpB;AAGA;AAGA;AAGA;AAGA;AAGA;AACA,8BAAc;AAAA;;AAAA,iCAfR,IAeQ;;AAAA,uCAZF,KAYE;;AAAA,4CATGC,QAAQ,CAACC,MASZ;;AAAA,yCANA,KAMA;;AAAA,sCAHH,KAGG;;AACb,SAAKC,YAAL;AACA,SAAKC,WAAL,GAAmB,IAAnB;AACA,G,CAED;;;;;WACA,wBAAe;AACd,UAAK,CAAEC,oBAAoB,CAACC,cAA5B,EAA6C;AAC5C;AACA;;AAED,WAAKC,gBAAL,CAAuBC,MAAM,CAACP,QAA9B,EAAwCQ,QAAQ,CAACC,KAAjD,EAAwD,IAAxD,EAA8D,IAA9D;AAEAb,OAAC,CAAEW,MAAF,CAAD,CAAYG,EAAZ,CAAgB,UAAhB,EAA4B,YAAY;AAAA;;AACvC,YAAK,2BAAEH,MAAM,CAACI,OAAP,CAAeC,KAAjB,kDAAE,sBAAsBC,SAAxB,CAAL,EAAyC;AACxC;AACA;;AAEDN,cAAM,CAACP,QAAP,CAAgBc,MAAhB,CAAwB,IAAxB;AACA,OAND;AAOA,K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AAC,CAAEY,QAAF,CAAD,CACEE,EADF,CAEE,yEAFF,EAGE,YAAY;AACXd,KAAC,CAAE,oBAAF,CAAD,CACEqR,GADF,CACO,WADP,EAEEvK,IAFF,CAEQ,YAAY;AAClB,UAAIkJ,gBAAJ,CAAsBhQ,CAAC,CAAE,IAAF,CAAvB;AACA,KAJF;AAMAA,KAAC,CAAE,0BAAF,CAAD,CACEqR,GADF,CACO,WADP,EAEEvK,IAFF,CAEQ,YAAY;AAClB,UAAIL,sBAAJ,CAA4BzG,CAAC,CAAE,IAAF,CAA7B;AACA,KAJF;AAKA,GAfH,EAiBEwC,OAjBF,CAiBW,2BAjBX;AAmBAsJ,YAAU,CAACyL,cAAX,GAA4B,IAAIpX,gBAAJ,EAA5B;AACA,CArBK,CAAN,C","file":"yith-wcan-shortcodes.js","sourcesContent":["'use strict';\n\n/* global globalThis, jQuery, yith_wcan_shortcodes, accounting */\n\nconst $ = jQuery; // we can do this as WebPack will compact all together inside a closure.\nconst $body = $( 'body' );\n\nexport { $, $body };\n","'use strict';\n\n/* global globalThis, jQuery, yith_wcan_shortcodes, accounting */\n\nimport { $, $body } from '../config.js';\n\nexport default class YITH_WCAN_Filter {\n\t// currently executing xhr\n\txhr = null;\n\n\t// flag set during ajax call handling\n\tdoingAjax = false;\n\n\t// register original url search param\n\toriginalSearch = location.search;\n\n\t// flag set once init has executed\n\tinitialized = false;\n\n\t// flag set when page has at least one active filter.\n\tfiltered = false;\n\n\t// init object\n\tconstructor() {\n\t\tthis.initPopState();\n\t\tthis.initialized = true;\n\t}\n\n\t// init page reload when popstate event alter filters\n\tinitPopState() {\n\t\tif ( ! yith_wcan_shortcodes.reload_on_back ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.pushUrlToHistory( window.location, document.title, null, true );\n\n\t\t$( window ).on( 'popstate', function () {\n\t\t\tif ( ! window.history.state?._yithWcan ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twindow.location.reload( true );\n\t\t} );\n\t}\n\n\t// execute call to filter products in current view\n\tdoFilter( filters, target, preset ) {\n\t\tlet targetUrl,\n\t\t\t$target = target ? $( target ) : $( 'body' ),\n\t\t\tcustomFilters;\n\n\t\t// filter properties\n\t\tcustomFilters = $( document ).triggerHandler(\n\t\t\t'yith_wcan_filters_parameters',\n\t\t\t[ filters ]\n\t\t);\n\n\t\tif ( !! customFilters ) {\n\t\t\tfilters = customFilters;\n\t\t}\n\n\t\t// block elements before filtering\n\t\t$target && this.block( $target );\n\n\t\t// calculate target url\n\t\ttargetUrl = this.buildUrl( filters );\n\n\t\t// if no ajax, simply change page url\n\t\tif ( ! yith_wcan_shortcodes.ajax_filters ) {\n\t\t\tthis.pushUrlToHistory( targetUrl, document.title, filters );\n\n\t\t\twindow.location = targetUrl;\n\t\t\treturn;\n\t\t}\n\n\t\t// start doing ajax\n\t\tthis.doingAjax = true;\n\n\t\treturn this._doAjax( targetUrl ).done( ( response ) => {\n\t\t\ttargetUrl = this.searchAlternativeUrl( response, targetUrl );\n\n\t\t\tthis._beforeFilter( response, filters );\n\n\t\t\tthis.refreshFragments( target, preset, response );\n\t\t\tthis.pushUrlToHistory( targetUrl, response.pageTitle, filters );\n\t\t\tthis.originalSearch = location.search;\n\n\t\t\t$target && this.unblock( $target );\n\n\t\t\tthis._afterFilter( response, filters );\n\n\t\t\tthis.doingAjax = false;\n\t\t} );\n\t}\n\n\t// actions performed before filter\n\t_beforeFilter( response, filters ) {\n\t\t$( document ).trigger( 'yith-wcan-ajax-loading', [\n\t\t\tresponse,\n\t\t\tfilters,\n\t\t] );\n\t}\n\n\t// actions performed after filter\n\t_afterFilter( response, filters ) {\n\t\t$( '.woocommerce-ordering' ).on(\n\t\t\t'change',\n\t\t\t'select.orderby',\n\t\t\tfunction () {\n\t\t\t\t$( this ).closest( 'form' ).submit();\n\t\t\t}\n\t\t);\n\n\t\tthis.filtered = filters && !! Object.keys( filters ).length;\n\t\tthis.filtered\n\t\t\t? $body.addClass( 'filtered' )\n\t\t\t: $body.removeClass( 'filtered' );\n\n\t\t$( window ).trigger( 'scroll' );\n\n\t\t$( document )\n\t\t\t.trigger( 'yith-wcan-ajax-filtered', [ response, filters ] )\n\t\t\t.trigger( 'yith_wcwl_reload_fragments' );\n\t}\n\n\t// build url to show\n\tbuildUrl( filters ) {\n\t\tlet queryParam = yith_wcan_shortcodes.query_param,\n\t\t\tparams = {},\n\t\t\tlocation = window.location,\n\t\t\turl = !! yith_wcan_shortcodes.base_url\n\t\t\t\t? yith_wcan_shortcodes.base_url\n\t\t\t\t: location?.origin + location?.pathname,\n\t\t\tsearch = '',\n\t\t\tself = this;\n\n\t\tconst haveFilters =\n\t\t\ttypeof filters === 'object' && Object.keys( filters ).length;\n\n\t\t// remove filter session from current url, if any\n\t\tif ( !! yith_wcan_shortcodes.session_param ) {\n\t\t\turl = url.replace(\n\t\t\t\tnew RegExp(\n\t\t\t\t\t'/' + yith_wcan_shortcodes.session_param + '/[^/]*/'\n\t\t\t\t),\n\t\t\t\t''\n\t\t\t);\n\t\t}\n\n\t\tif ( haveFilters ) {\n\t\t\tparams[ queryParam ] = 1;\n\t\t}\n\n\t\tif ( !! this.originalSearch ) {\n\t\t\tconst searchParams = this.originalSearch\n\t\t\t\t.replace( '?', '' )\n\t\t\t\t.split( '&' )\n\t\t\t\t.reduce( ( a, v ) => {\n\t\t\t\t\tconst items = v.split( '=' );\n\n\t\t\t\t\tif ( items.length === 2 ) {\n\t\t\t\t\t\tif ( this.isFilterParam( items[ 0 ] ) ) {\n\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ta[ items[ 0 ] ] = items[ 1 ];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn a;\n\t\t\t\t}, {} );\n\n\t\t\tparams = $.extend( params, searchParams );\n\t\t}\n\n\t\tif ( haveFilters ) {\n\t\t\tparams = $.extend( params, filters );\n\t\t}\n\n\t\tsearch = Object.keys( params )\n\t\t\t.reduce( function ( a, i ) {\n\t\t\t\tconst v = params[ i ];\n\n\t\t\t\tif ( ! v || ! i ) {\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\n\t\t\t\ta += self._cleanParam( i ) + '=' + self._cleanParam( v ) + '&';\n\n\t\t\t\treturn a;\n\t\t\t}, '?' )\n\t\t\t.replace( /&$/g, '' )\n\t\t\t.replace( /%2B/g, '+' )\n\t\t\t.replace( /%2C/g, ',' );\n\n\t\tif ( search.length > 1 ) {\n\t\t\turl += search;\n\t\t}\n\n\t\treturn url;\n\t}\n\n\t// retrieves alternative sharing url in response body\n\tsearchAlternativeUrl( response, defaultUrl = '' ) {\n\t\tlet url = defaultUrl,\n\t\t\tmatches;\n\n\t\tif ( -1 === response.indexOf( 'yith_wcan:sharing_url' ) ) {\n\t\t\treturn url;\n\t\t}\n\n\t\tmatches = response.match(\n\t\t\t/<meta name=\"yith_wcan:sharing_url\" content=\"([^\"]*)\">/\n\t\t);\n\t\turl = matches && 1 in matches ? matches[ 1 ] : url;\n\n\t\treturn url;\n\t}\n\n\t// push url to browser history\n\tpushUrlToHistory( url, title, filters, current ) {\n\t\tif (\n\t\t\t! yith_wcan_shortcodes.change_browser_url ||\n\t\t\tnavigator.userAgent.match( /msie/i )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet method = 'pushState';\n\n\t\tif ( !! current ) {\n\t\t\tmethod = 'replaceState';\n\t\t}\n\n\t\twindow.history[ method ](\n\t\t\t{\n\t\t\t\t_yithWcan: true,\n\t\t\t\tpageTitle: title,\n\t\t\t\tfilters,\n\t\t\t},\n\t\t\t'',\n\t\t\turl\n\t\t);\n\t}\n\n\t// replaces elements in the page with refreshed ones\n\trefreshFragments( target, preset, response ) {\n\t\tconst responseDom = document.createElement( 'html' ),\n\t\t\t$response = $( responseDom );\n\n\t\tresponseDom.innerHTML = response;\n\n\t\tif ( target ) {\n\t\t\tlet $preset = $( preset ),\n\t\t\t\t$target = $( target ),\n\t\t\t\t$destination;\n\n\t\t\tif ( $preset.length ) {\n\t\t\t\t$destination = $response.find( preset );\n\n\t\t\t\tif ( $destination.length ) {\n\t\t\t\t\t$preset.replaceWith( $destination.first() );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $target.length ) {\n\t\t\t\t$destination = $response.find( target );\n\n\t\t\t\tif ( $destination.length ) {\n\t\t\t\t\t$target.replaceWith( $destination.first() );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst content = $( yith_wcan_shortcodes.content );\n\n\t\t\tif ( content.length ) {\n\t\t\t\tcontent.replaceWith(\n\t\t\t\t\t$response.find( yith_wcan_shortcodes.content )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$( 'body' ).replaceWith( $response.find( 'body' ) );\n\t\t\t}\n\t\t}\n\n\t\t$( document ).trigger( 'yith_wcan_init_shortcodes' );\n\t}\n\n\t// clean url parameters\n\t_cleanParam( param ) {\n\t\tif (\n\t\t\t! yith_wcan_shortcodes?.process_sanitize ||\n\t\t\tyith_wcan_shortcodes?.skip_sanitize\n\t\t) {\n\t\t\treturn param;\n\t\t}\n\n\t\treturn encodeURIComponent( param );\n\t}\n\n\t// executes Ajax calls\n\t_doAjax( url, params ) {\n\t\tif ( this.xhr ) {\n\t\t\tthis.xhr.abort();\n\t\t}\n\n\t\tparams = $.extend(\n\t\t\t{\n\t\t\t\turl,\n\t\t\t\theaders: {\n\t\t\t\t\t'X-YITH-WCAN': 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\tparams\n\t\t);\n\n\t\tthis.xhr = $.ajax( params );\n\n\t\treturn this.xhr;\n\t}\n\n\t// block dom elements\n\tblock( $el ) {\n\t\tif ( typeof $.fn.block === 'undefined' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet background = '#fff center center no-repeat';\n\n\t\tif ( yith_wcan_shortcodes?.loader ) {\n\t\t\tbackground = `url('${ yith_wcan_shortcodes.loader }') ${ background }`;\n\t\t}\n\n\t\t$el.block( {\n\t\t\tmessage: null,\n\t\t\toverlayCSS: {\n\t\t\t\tbackground,\n\t\t\t\topacity: 0.7,\n\t\t\t},\n\t\t} );\n\t}\n\n\t// unblock dom elements\n\tunblock( $el ) {\n\t\tif ( typeof $.fn.unblock === 'undefined' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$el.unblock();\n\t}\n\n\t// checks if param is one used by layared nav to filter products.\n\tisFilterParam( param ) {\n\t\tlet supportedParams = [\n\t\t\t\t'rating_filter',\n\t\t\t\t'min_price',\n\t\t\t\t'max_price',\n\t\t\t\t'price_ranges',\n\t\t\t\t'onsale_filter',\n\t\t\t\t'instock_filter',\n\t\t\t\t'featured_filter',\n\t\t\t\t'orderby',\n\t\t\t\t'product-page',\n\t\t\t\tyith_wcan_shortcodes.query_param,\n\t\t\t],\n\t\t\tcustomParams;\n\n\t\t// filter properties\n\t\tcustomParams = $( document ).triggerHandler(\n\t\t\t'yith_wcan_supported_filters_parameters',\n\t\t\t[ supportedParams ]\n\t\t);\n\n\t\tif ( !! customParams ) {\n\t\t\tsupportedParams = customParams;\n\t\t}\n\n\t\tsupportedParams = supportedParams.concat(\n\t\t\tyith_wcan_shortcodes.supported_taxonomies.map( ( i ) =>\n\t\t\t\ti.replace( 'pa_', 'filter_' )\n\t\t\t)\n\t\t);\n\n\t\tif ( -1 !== supportedParams.indexOf( param ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( -1 !== param.indexOf( 'filter_' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( -1 !== param.indexOf( 'query_type_' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n}\n","'use strict';\n\n/* global globalThis, jQuery, yith_wcan_shortcodes, accounting */\n\nimport { $ } from '../config.js';\n\nexport default class YITH_WCAN_Reset_Button {\n\t// current button\n\t$reset = null;\n\n\t// init object\n\tconstructor( el ) {\n\t\t// current button\n\t\tthis.$reset = el;\n\n\t\tthis.$reset.on( 'click', function ( ev ) {\n\t\t\tev.preventDefault();\n\n\t\t\t$( '.yith-wcan-filters' ).each( function () {\n\t\t\t\tconst preset = $( this ).data( 'preset' );\n\n\t\t\t\tpreset.deactivateAllFilters( true );\n\t\t\t\tpreset.closeModal();\n\t\t\t} );\n\t\t} );\n\n\t\tthis.$reset.data( 'reset', this ).addClass( 'enhanced' );\n\t}\n}\n","'use strict';\n\n/* global globalThis, jQuery, yith_wcan_shortcodes, accounting */\n\nimport { $ } from '../config.js';\n\nexport default class YITH_WCAN_Dropdown {\n\t// current button\n\t$originalSelect = null;\n\n\t// main element\n\t$_main = null;\n\n\t// label element\n\t$_label = null;\n\n\t// dropdown\n\t$_dropdown = null;\n\n\t// search input\n\t$_search = null;\n\n\t// show more link\n\t$_showMore = null;\n\n\t// items list\n\t$_items = null;\n\n\t// current page\n\tcurrentPage = 1;\n\n\t// options\n\toptions = {};\n\n\t// init object\n\tconstructor( el, opts ) {\n\t\tthis.$originalSelect = el;\n\n\t\tif ( ! this.$originalSelect.is( 'select' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst defaultPerPage = this.$originalSelect.data( 'per_page' ),\n\t\t\tdefaultOrder = this.$originalSelect.data( 'order' ),\n\t\t\tdefaultAll = this.$originalSelect.data( 'all-label' ),\n\t\t\tdefaults = {\n\t\t\t\tshowSearch: this.$originalSelect.data( 'show_search' ),\n\t\t\t\tpaginate: this.$originalSelect.data( 'paginate' ),\n\t\t\t\tperPage: defaultPerPage ? defaultPerPage : 10,\n\t\t\t\torder: defaultOrder ? defaultOrder : 'ASC',\n\t\t\t\tgetElements: null,\n\t\t\t\tlabels: {\n\t\t\t\t\temptyLabel: defaultAll\n\t\t\t\t\t\t? defaultAll\n\t\t\t\t\t\t: yith_wcan_shortcodes.labels?.empty_option,\n\t\t\t\t\tsearchPlaceholder:\n\t\t\t\t\t\tyith_wcan_shortcodes.labels?.search_placeholder,\n\t\t\t\t\tnoItemsFound: yith_wcan_shortcodes.labels?.no_items,\n\t\t\t\t\tshowMore: yith_wcan_shortcodes.labels?.show_more,\n\t\t\t\t},\n\t\t\t};\n\n\t\tthis.options = $.extend( defaults, opts );\n\n\t\tthis._hideSelect();\n\t\tthis._initTemplate();\n\t\tthis._initActions();\n\n\t\tthis.$originalSelect.data( 'dropdown', this ).addClass( 'enhanced' );\n\t}\n\n\t// hide select\n\t_hideSelect() {\n\t\tthis.$originalSelect.hide();\n\t}\n\n\t// create dropdown\n\t_initTemplate() {\n\t\tconst $mainSpan = $( '<div/>', {\n\t\t\t\tclass: 'yith-wcan-dropdown closed',\n\t\t\t} ),\n\t\t\t$labelSpan = $( '<div/>', {\n\t\t\t\tclass: 'dropdown-label',\n\t\t\t\thtml: this.getLabel(),\n\t\t\t} ),\n\t\t\t$dropdownSpan = $( '<div>', {\n\t\t\t\tclass: 'dropdown-wrapper',\n\t\t\t} ),\n\t\t\t$matchingItemsList = $( '<ul/>', {\n\t\t\t\tclass: 'matching-items filter-items',\n\t\t\t} );\n\n\t\t$dropdownSpan.append( $matchingItemsList );\n\t\t$mainSpan.append( $labelSpan ).append( $dropdownSpan );\n\n\t\tif ( this.options.showSearch ) {\n\t\t\tthis._initSearchTemplate( $dropdownSpan );\n\t\t}\n\n\t\tif ( this.options.paginate ) {\n\t\t\tthis._initShowMoreTemplate( $dropdownSpan );\n\t\t}\n\n\t\tthis.$originalSelect.after( $mainSpan );\n\t\tthis.$_main = $mainSpan;\n\t\tthis.$_label = $labelSpan;\n\t\tthis.$_dropdown = $dropdownSpan;\n\t\tthis.$_items = $matchingItemsList;\n\t}\n\n\t// create search field\n\t_initSearchTemplate( $dropdwonSpan ) {\n\t\tconst $container = $( '<div/>', {\n\t\t\t\tclass: 'search-field-container',\n\t\t\t} ),\n\t\t\t$search = $( '<input/>', {\n\t\t\t\tname: 's',\n\t\t\t\tclass: 'search-field',\n\t\t\t\tautocomplete: 'off',\n\t\t\t\ttype: 'search',\n\t\t\t\tplaceholder: this.options.labels.searchPlaceholder,\n\t\t\t} );\n\n\t\t$container.append( $search ).prependTo( $dropdwonSpan );\n\t\tthis.$_search = $search;\n\t}\n\n\t// create showMore field\n\t_initShowMoreTemplate( $dropdwonSpan ) {\n\t\tconst $showMore = $( '<a/>', {\n\t\t\tclass: 'show-more',\n\t\t\ttext: this.options.labels.showMore?.replace(\n\t\t\t\t'%d',\n\t\t\t\tthis.options.perPage\n\t\t\t),\n\t\t} );\n\n\t\t$showMore.on( 'click', this.loadNextPage.bind( this ) ).hide();\n\n\t\t$dropdwonSpan.append( $showMore );\n\t\tthis.$_showMore = $showMore;\n\t}\n\n\t// init actions performed over dropdown elements\n\t_initActions() {\n\t\tconst self = this;\n\n\t\t// main open event\n\t\tthis.$_main?.on( 'click', ( ev ) => {\n\t\t\tev.stopPropagation();\n\t\t\tself.toggleDropdown();\n\t\t} );\n\t\tthis.$_dropdown.on( 'click', ( ev ) => {\n\t\t\tev.stopPropagation();\n\t\t} );\n\n\t\t// search event\n\t\tthis.$_search?.on( 'keyup search', () => {\n\t\t\tself._populateItems();\n\t\t} );\n\n\t\t// select event\n\t\tthis.$_items.on( 'change', ':input', function () {\n\t\t\tlet $li = $( this ).closest( 'li' ),\n\t\t\t\tvalue = $li.data( 'value' ),\n\t\t\t\tisActive = false;\n\n\t\t\tif (\n\t\t\t\t$li.hasClass( 'disabled' ) &&\n\t\t\t\t! self.isValueSelected( value )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$li.toggleClass( 'active' );\n\t\t\tisActive = $li.hasClass( 'active' );\n\n\t\t\tself._changeItemStatus( value, isActive );\n\t\t} );\n\t\tthis.$_items.on( 'click', 'li:not(.checkbox) a', function ( ev ) {\n\t\t\tlet $li = $( this ).closest( 'li' ),\n\t\t\t\tvalue = $li.data( 'value' ),\n\t\t\t\tisActive = false;\n\n\t\t\tev.preventDefault();\n\n\t\t\tif (\n\t\t\t\t$li.hasClass( 'disabled' ) &&\n\t\t\t\t! self.isValueSelected( value )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$li.toggleClass( 'active' );\n\t\t\tisActive = $li.hasClass( 'active' );\n\n\t\t\tif ( isActive ) {\n\t\t\t\t$li.siblings().removeClass( 'active' );\n\t\t\t}\n\n\t\t\tself._changeItemStatus( value, isActive );\n\t\t} );\n\t\tthis.$_items.on( 'click', 'label > a', function ( ev ) {\n\t\t\tconst input = $( this ).parent().find( ':input' );\n\n\t\t\tev.preventDefault();\n\n\t\t\tif (\n\t\t\t\tinput.is( '[type=\"radio\"]' ) ||\n\t\t\t\tinput.is( '[type=\"checkbox\"]' )\n\t\t\t) {\n\t\t\t\tinput.prop( 'checked', ! input.prop( 'checked' ) );\n\t\t\t}\n\n\t\t\tinput.change();\n\t\t} );\n\n\t\t// select change\n\t\tthis.$originalSelect.on( 'change', ( ev, selfOriginated ) => {\n\t\t\tif ( selfOriginated ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tself.$_items.find( 'li' ).each( function () {\n\t\t\t\tconst value = $( this ).data( 'value' );\n\n\t\t\t\tif ( self.isValueSelected( value ) ) {\n\t\t\t\t\tself._selectItem( value );\n\t\t\t\t} else {\n\t\t\t\t\tself._deselectItem( value );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tself.updateLabel();\n\t\t} );\n\n\t\t// close dropdown on external click; do this handler only once for any dropdown in the page\n\t\tif ( ! globalThis?.yith_wcan_dropdown_init ) {\n\t\t\t$( document ).on( 'click', this._closeAllDropdowns );\n\t\t\tglobalThis.yith_wcan_dropdown_init = true;\n\t\t}\n\t}\n\n\t// open dropdown\n\topenDropdown() {\n\t\tthis.$_main?.addClass( 'open' ).removeClass( 'closed' );\n\t\tthis._afterDropdownOpen();\n\t}\n\n\t// close dropdown\n\tcloseDropdown() {\n\t\tthis.$_main?.removeClass( 'open' ).addClass( 'closed' );\n\t}\n\n\t// close all dropdowns\n\t_closeAllDropdowns() {\n\t\tconst dropdowns = $( document )\n\t\t\t.find( 'select.enhanced' )\n\t\t\t.filter( function ( i, select ) {\n\t\t\t\tconst $el = $( select );\n\n\t\t\t\treturn !! $el.data( 'dropdown' );\n\t\t\t} );\n\n\t\tdropdowns.each( function () {\n\t\t\t$( this ).data( 'dropdown' ).closeDropdown();\n\t\t} );\n\t}\n\n\t// close other dropdowns\n\t_closeOtherDropdowns() {\n\t\tconst self = this,\n\t\t\tdropdowns = $( document )\n\t\t\t\t.find( 'select.enhanced' )\n\t\t\t\t.filter( function ( i, select ) {\n\t\t\t\t\tconst $el = $( select );\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t!! $el.data( 'dropdown' ) &&\n\t\t\t\t\t\t! $el.is( self.$originalSelect )\n\t\t\t\t\t);\n\t\t\t\t} );\n\n\t\tdropdowns.each( function () {\n\t\t\t$( this ).data( 'dropdown' ).closeDropdown();\n\t\t} );\n\t}\n\n\t// toggle dropdown\n\ttoggleDropdown() {\n\t\tthis.$_main?.toggleClass( 'open' ).toggleClass( 'closed' );\n\n\t\tif ( this.$_main?.hasClass( 'open' ) ) {\n\t\t\tthis._afterDropdownOpen();\n\t\t}\n\t}\n\n\t// perform operations after dropdown is open\n\t_afterDropdownOpen() {\n\t\tthis._closeOtherDropdowns();\n\n\t\tif ( this.$_search?.length ) {\n\t\t\tthis.$_search.val( '' );\n\t\t}\n\n\t\tthis._populateItems();\n\t}\n\n\t// get elements\n\tgetMatchingElements( search, limit ) {\n\t\tlet matchingElements = [],\n\t\t\t$options = this.getOptions(),\n\t\t\tpromise;\n\n\t\tpromise = new Promise( ( resolve ) => {\n\t\t\t// first of all, search across select option\n\t\t\t$options.each( function () {\n\t\t\t\tconst t = $( this ),\n\t\t\t\t\tvalue = t.val(),\n\t\t\t\t\tlabel = t.html(),\n\t\t\t\t\tregex = new RegExp( '.*' + search + '.*', 'i' ),\n\t\t\t\t\tshow =\n\t\t\t\t\t\t! search || regex.test( value ) || regex.test( label );\n\n\t\t\t\tif ( show ) {\n\t\t\t\t\tmatchingElements.push( {\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// then retrieve additional items\n\t\t\tif ( this.options.getElements ) {\n\t\t\t\t// we're expecting key => value pairs\n\t\t\t\tthis.options\n\t\t\t\t\t.getElements( search )\n\t\t\t\t\t.then( ( retrievedElements ) => {\n\t\t\t\t\t\tif ( retrievedElements ) {\n\t\t\t\t\t\t\t// reformat retrieved array\n\t\t\t\t\t\t\tretrievedElements = retrievedElements.reduce(\n\t\t\t\t\t\t\t\t( a, v, i ) => {\n\t\t\t\t\t\t\t\t\ta.push( { label: i, value: v } );\n\t\t\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t[]\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// merge found results with options\n\t\t\t\t\t\t\tmatchingElements = $.extend(\n\t\t\t\t\t\t\t\tmatchingElements,\n\t\t\t\t\t\t\t\tretrievedElements\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresolve( this._formatItems( matchingElements, limit ) );\n\t\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tresolve( this._formatItems( matchingElements, limit ) );\n\t\t\t}\n\t\t} );\n\n\t\treturn promise;\n\t}\n\n\t// format items as key/value pairs for further processing\n\t_formatItems( items, limit ) {\n\t\tlet indexes = [],\n\t\t\thasMore = false;\n\n\t\t// remove duplicates and sort array of results\n\t\titems\n\t\t\t.filter( ( v ) => {\n\t\t\t\tif ( -1 === indexes.indexOf( v.value ) ) {\n\t\t\t\t\tindexes.push( v.value );\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t} )\n\t\t\t.sort( ( a, b ) => {\n\t\t\t\tconst order = this.options.order,\n\t\t\t\t\tmod = order === 'ASC' ? 1 : -1;\n\n\t\t\t\tif ( a.value < b.value ) {\n\t\t\t\t\treturn -1 * mod;\n\t\t\t\t} else if ( a.value > b.value ) {\n\t\t\t\t\treturn mod;\n\t\t\t\t}\n\n\t\t\t\treturn 0;\n\t\t\t} );\n\n\t\t// paginate when needed\n\t\tif ( limit ) {\n\t\t\thasMore = limit < Object.keys( items ).length;\n\t\t\titems = items.slice( 0, limit );\n\t\t}\n\n\t\treturn {\n\t\t\titems,\n\t\t\thasMore,\n\t\t};\n\t}\n\n\t// generate item to append to items list\n\t_generateItem( value, label ) {\n\t\tlet active = this.isValueSelected( value ),\n\t\t\toption = this.getOptionByValue( value ),\n\t\t\t$item = $( '<li/>', {\n\t\t\t\t'data-value': value,\n\t\t\t\tclass: option.length ? option.attr( 'class' ) : '',\n\t\t\t} ),\n\t\t\t$anchor;\n\n\t\tif ( option.length ) {\n\t\t\tconst template = option.data( 'template' ),\n\t\t\t\tcount = option.data( 'count' );\n\n\t\t\tlabel = template ? template : label;\n\n\t\t\tif ( !! count ) {\n\t\t\t\tlabel += count;\n\t\t\t}\n\t\t}\n\n\t\t$anchor = $( '<a/>', {\n\t\t\thref: option.length ? option.data( 'filter_url' ) : '#',\n\t\t\thtml: label,\n\t\t\trel: 'nofollow',\n\t\t\t'data-title': option.length ? option.data( 'title' ) : '',\n\t\t} );\n\n\t\tif ( this.$originalSelect.prop( 'multiple' ) ) {\n\t\t\tconst $checkbox = $( '<input/>', {\n\t\t\t\t\ttype: 'checkbox',\n\t\t\t\t\tvalue,\n\t\t\t\t} ),\n\t\t\t\t$label = $( '<label>' );\n\n\t\t\t$checkbox.prop( 'checked', active );\n\t\t\t$label.prepend( $checkbox ).append( $anchor );\n\t\t\t$item.append( $label ).addClass( 'checkbox' );\n\t\t} else {\n\t\t\t$item.append( $anchor );\n\t\t}\n\n\t\tactive ? $item.addClass( 'active' ) : $item.removeClass( 'active' );\n\n\t\treturn $item;\n\t}\n\n\t// populate items list\n\t_populateItems( page ) {\n\t\tlet search = this.$_search?.length ? this.$_search.val() : '',\n\t\t\tperPage = this.options.paginate ? this.options.perPage : 0,\n\t\t\tlimit;\n\n\t\tpage = page ? parseInt( page ) : 1;\n\t\tlimit = page * perPage;\n\n\t\tthis.getMatchingElements( search, limit ).then( ( resultSet ) => {\n\t\t\tlet matchingItems = resultSet.items,\n\t\t\t\titems = [],\n\t\t\t\thasMore = false;\n\n\t\t\t// remove all previous items\n\t\t\tthis._emptyItems();\n\t\t\tthis._hideLoadMore();\n\n\t\t\tif ( ! matchingItems.length ) {\n\t\t\t\titems.push(\n\t\t\t\t\t$( '<li/>', { text: this.options.labels.noItemsFound } )\n\t\t\t\t);\n\n\t\t\t\tthis.currentPage = 1;\n\t\t\t} else {\n\t\t\t\tfor ( const v of matchingItems ) {\n\t\t\t\t\tif ( v.value === '' ) {\n\t\t\t\t\t\titems.unshift( this._generateItem( v.value, v.label ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\titems.push( this._generateItem( v.value, v.label ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.currentPage = page;\n\t\t\t\thasMore = resultSet.hasMore;\n\t\t\t}\n\n\t\t\tthis.$_items.append( items );\n\n\t\t\tthis.$originalSelect.trigger( 'yith_wcan_dropdown_updated' );\n\n\t\t\tif ( hasMore ) {\n\t\t\t\tthis._showLoadMore();\n\t\t\t}\n\t\t} );\n\t}\n\n\t// load next page of items\n\tloadNextPage() {\n\t\tconst page = this.currentPage + 1;\n\n\t\tthis._populateItems( page );\n\t}\n\n\t// set an item as active\n\t_selectItem( value ) {\n\t\treturn this._changeItemStatus( value, true );\n\t}\n\n\t// disable an item\n\t_deselectItem( value ) {\n\t\treturn this._changeItemStatus( value, false );\n\t}\n\n\t// change item status\n\t_changeItemStatus( value, status ) {\n\t\tconst $option = this.$originalSelect.find(\n\t\t\t`option[value=\"${ value }\"]`\n\t\t);\n\n\t\tif ( $option.length ) {\n\t\t\t$option.prop( 'selected', status );\n\n\t\t\tthis.closeDropdown();\n\t\t\tthis.updateLabel();\n\n\t\t\tthis.$originalSelect.trigger( 'change', [ true ] );\n\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t// empty items list\n\t_emptyItems() {\n\t\tthis.$_items.html( '' );\n\t}\n\n\t// show \"Load more\" link\n\t_showLoadMore() {\n\t\tthis.$_showMore.show();\n\t}\n\n\t// hide \"Load more\" link\n\t_hideLoadMore() {\n\t\tthis.$_showMore.hide();\n\t}\n\n\t// returns select label\n\tgetLabel() {\n\t\treturn this.hasSelectedValues()\n\t\t\t? this.getSelectedLabels().join( ', ' )\n\t\t\t: this.options.labels.emptyLabel;\n\t}\n\n\t// update label to match new selection\n\tupdateLabel() {\n\t\tconst label = this.getLabel();\n\n\t\tthis.$_label?.html( label );\n\t}\n\n\t// returns select options\n\tgetOptions() {\n\t\treturn this.$originalSelect.find( 'option' );\n\t}\n\n\t// checks whether select has selected values\n\thasSelectedValues() {\n\t\treturn this.getSelectedOptions().length;\n\t}\n\n\t// checks whether a value is selected\n\tisValueSelected( value ) {\n\t\tconst found = this.getSelectedValues().indexOf( value.toString() );\n\n\t\treturn -1 !== found;\n\t}\n\n\t// retrieve selected options\n\tgetSelectedOptions() {\n\t\treturn this.$originalSelect.find( 'option' ).filter( ':selected' );\n\t}\n\n\t// retrieves an option node by value\n\tgetOptionByValue( value ) {\n\t\treturn this.$originalSelect.find( `option[value=\"${ value }\"]` );\n\t}\n\n\t// retrieve labels for selected options\n\tgetSelectedLabels() {\n\t\tconst labels = [];\n\n\t\tthis.getSelectedOptions().each( function () {\n\t\t\tlet $option = $( this ),\n\t\t\t\ttemplate = $option.data( 'template' );\n\n\t\t\ttemplate = template\n\t\t\t\t? template\n\t\t\t\t: $option.html().replace( /\\([0-9]*\\)/, '' );\n\n\t\t\tlabels.push( template );\n\t\t} );\n\n\t\treturn labels;\n\t}\n\n\t// retrieve values for selected options\n\tgetSelectedValues() {\n\t\tconst values = [];\n\n\t\tthis.getSelectedOptions().each( function () {\n\t\t\tvalues.push( $( this ).val() );\n\t\t} );\n\n\t\treturn values;\n\t}\n\n\tdestroy() {\n\t\t// TBD\n\t}\n}\n","'use strict';\n\n/* global globalThis, jQuery, yith_wcan_shortcodes, accounting */\n\nimport { $ } from '../config.js';\nimport YITH_WCAN_Dropdown from './yith-wcan-dropdown';\n\nexport default class YITH_WCAN_Preset {\n\t// main preset node\n\tpreset = false;\n\t$preset = false;\n\n\t// target of the filter, if any\n\ttarget = false;\n\t$target = false;\n\n\t// filters node\n\t$filters = false;\n\n\t// filter button\n\t$filterButtons = false;\n\n\t// nodes created just for modal layout\n\tmodalElements = {};\n\n\t// retains current status of filters\n\tactiveFilters = false;\n\n\t// mobile flag\n\tisMobile = false;\n\n\t// slider timeout\n\tsliderTimeout = false;\n\n\t// registers when status has changed\n\toriginalFilters = null;\n\tdirty = false;\n\n\t// init object\n\tconstructor( el ) {\n\t\t// main preset node\n\t\tthis.preset = '#' + el.attr( 'id' );\n\t\tthis.$preset = el;\n\n\t\t// target of the filter, if any\n\t\tthis.target = this.$preset.data( 'target' );\n\t\tthis.$target = this.target ? $( this.target ) : false;\n\n\t\tthis._regiterStatus();\n\t\tthis._initFilterButton();\n\t\tthis._initResponsive();\n\t\tthis._initFilters();\n\t\tthis._initActions();\n\n\t\tthis.$preset\n\t\t\t.data( 'preset', this )\n\t\t\t.addClass( 'enhanced' )\n\t\t\t.trigger( 'yith_wcan_preset_initialized', [ this ] );\n\t}\n\n\t// init filters\n\t_initFilters() {\n\t\tconst self = this;\n\n\t\tthis.getFilters().each( function () {\n\t\t\tconst $filter = $( this );\n\n\t\t\tself._initFilter( $filter );\n\t\t} );\n\n\t\tthis.maybeShowClearAllFilters();\n\t}\n\n\t// init filter button\n\t_initFilterButton() {\n\t\tthis.$filterButtons = this.$preset.find( '.apply-filters' );\n\n\t\tif ( ! this.$filterButtons.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// manage filter button\n\t\tthis.$filterButtons\n\t\t\t.on( 'click', ( ev ) => {\n\t\t\t\tev.preventDefault();\n\t\t\t\tthis.filter();\n\t\t\t} )\n\t\t\t.hide();\n\t}\n\n\t// init generic actions\n\t_initActions() {\n\t\tthis.$preset.find( 'form' ).on( 'submit', ( ev ) => {\n\t\t\tev.preventDefault();\n\t\t} );\n\t}\n\n\t// init responsive\n\t_initResponsive() {\n\t\tif ( ! yith_wcan_shortcodes.modal_on_mobile ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst media = window.matchMedia(\n\t\t\t`(max-width: ${ yith_wcan_shortcodes.mobile_media_query }px)`\n\t\t);\n\n\t\t$( window )\n\t\t\t.on( 'resize', () => {\n\t\t\t\tconst isMobile = !! media.matches;\n\n\t\t\t\tif ( isMobile !== this.isMobile ) {\n\t\t\t\t\tthis.isMobile = isMobile;\n\t\t\t\t\tthis._afterLayoutChange();\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.resize();\n\t}\n\n\t// init filter\n\t_initFilter( $filter ) {\n\t\tconst self = this,\n\t\t\thandleChange = function ( ev ) {\n\t\t\t\tconst t = $( this ),\n\t\t\t\t\t$currentFilter = t.closest( '.yith-wcan-filter' ),\n\t\t\t\t\tmultiple = $currentFilter.length\n\t\t\t\t\t\t? 'yes' === $currentFilter.data( 'multiple' )\n\t\t\t\t\t\t: false,\n\t\t\t\t\t$item = t.closest( '.filter-item' ),\n\t\t\t\t\t$items = $item.length\n\t\t\t\t\t\t? $currentFilter.find( '.filter-item' ).not( $item )\n\t\t\t\t\t\t: [];\n\n\t\t\t\tif ( $item.is( '.disabled' ) && ! $item.is( '.active' ) ) {\n\t\t\t\t\tev.preventDefault();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tev.preventDefault();\n\n\t\t\t\t$items.length &&\n\t\t\t\t\t! multiple &&\n\t\t\t\t\t$items\n\t\t\t\t\t\t.removeClass( 'active' )\n\t\t\t\t\t\t.children( 'label' )\n\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t.parent( '.checked' )\n\t\t\t\t\t\t.removeClass( 'checked' );\n\t\t\t\t$item.length && $item.toggleClass( 'active' );\n\n\t\t\t\t// reset active filters.\n\t\t\t\tself.activeFilters = false;\n\n\t\t\t\tself.maybeFilter( $filter );\n\t\t\t\tself.maybeToggleClearAllFilters();\n\t\t\t\tself.maybeToggleClearFilter( $currentFilter );\n\t\t\t};\n\n\t\t// handle filter activation/deactivation by click on label (no input involved)\n\t\t$filter\n\t\t\t.find( '.filter-item' )\n\t\t\t.not( '.checkbox' )\n\t\t\t.not( '.radio' )\n\t\t\t.on( 'click', 'a', function ( ev ) {\n\t\t\t\tconst t = $( this ),\n\t\t\t\t\t$item = t.closest( '.filter-item' );\n\n\t\t\t\tif ( ! $( ev?.delegateTarget ).is( $item ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\thandleChange.call( this, ev );\n\t\t\t} );\n\n\t\t// handle filter activation/deactivation from input change\n\t\t$filter.find( ':input' ).on( 'change', function ( ev ) {\n\t\t\tconst t = $( this ),\n\t\t\t\t$item = t.closest( '.filter-item' );\n\n\t\t\tif ( $item.is( '.disabled' ) && ! $item.is( '.active' ) ) {\n\t\t\t\tt.prop( 'checked', false );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\thandleChange.call( this, ev );\n\t\t} );\n\n\t\t// handle filter activation/deactivation by click on label (there is an input whose state can be switched)\n\t\t$filter.find( 'label > a' ).on( 'click', function ( ev ) {\n\t\t\tconst t = $( this ),\n\t\t\t\t$item = t.closest( '.filter-item' );\n\n\t\t\tev.preventDefault();\n\n\t\t\tif ( $item.is( '.disabled' ) && ! $item.is( '.active' ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst $input = t.parent().find( ':input' );\n\n\t\t\tif (\n\t\t\t\t$input.is( '[type=\"radio\"]' ) ||\n\t\t\t\t$input.is( '[type=\"checkbox\"]' )\n\t\t\t) {\n\t\t\t\t$input.prop( 'checked', ! $input.prop( 'checked' ) );\n\t\t\t}\n\n\t\t\t$input.change();\n\t\t} );\n\n\t\t// init tooltip\n\t\tthis._initTooltip( $filter );\n\n\t\t// init price slider\n\t\tthis._initPriceSlider( $filter );\n\n\t\t// init dropdown\n\t\tthis._initDropdown( $filter );\n\n\t\t// init collapsable\n\t\tthis._initCollapsable( $filter );\n\n\t\t// init clear anchors\n\t\tthis.maybeShowClearFilter( $filter );\n\n\t\t// init custom inputs\n\t\tif ( this.$preset?.hasClass( 'custom-style' ) ) {\n\t\t\tthis._initCustomInput( $filter );\n\t\t\t$filter.on( 'yith_wcan_dropdown_updated', function () {\n\t\t\t\tconst $dropdown = $( this ),\n\t\t\t\t\t$current = $dropdown.closest( '.yith-wcan-filter' );\n\n\t\t\t\tself._initCustomInput( $current );\n\t\t\t} );\n\t\t}\n\t}\n\n\t// init tooltip\n\t_initTooltip( $filter, position ) {\n\t\t$filter.find( '[data-title]' ).each( function () {\n\t\t\tconst t = $( this );\n\n\t\t\tif ( t.hasClass( 'tooltip-added' ) || ! t.data( 'title' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tt.on( 'mouseenter', function () {\n\t\t\t\tlet th = $( this ),\n\t\t\t\t\ttooltip = null,\n\t\t\t\t\twrapperWidth = th.outerWidth(),\n\t\t\t\t\tleft = 0,\n\t\t\t\t\twidth = 0;\n\n\t\t\t\tif (\n\t\t\t\t\t! position ||\n\t\t\t\t\t( 'top' !== position && 'right' !== position )\n\t\t\t\t) {\n\t\t\t\t\tconst container = th.closest( '.filter-item' );\n\n\t\t\t\t\tposition =\n\t\t\t\t\t\tcontainer.hasClass( 'color' ) ||\n\t\t\t\t\t\tcontainer.hasClass( 'label' )\n\t\t\t\t\t\t\t? 'top'\n\t\t\t\t\t\t\t: 'right';\n\t\t\t\t}\n\n\t\t\t\ttooltip = $( '<span>', {\n\t\t\t\t\tclass: 'yith-wcan-tooltip',\n\t\t\t\t\thtml: th.data( 'title' ),\n\t\t\t\t} );\n\n\t\t\t\tth.append( tooltip );\n\n\t\t\t\twidth = tooltip.outerWidth() + 6;\n\t\t\t\ttooltip.outerWidth( width );\n\n\t\t\t\tif ( 'top' === position ) {\n\t\t\t\t\tleft = ( wrapperWidth - width ) / 2;\n\t\t\t\t} else {\n\t\t\t\t\tleft = wrapperWidth + 15;\n\t\t\t\t}\n\n\t\t\t\ttooltip.css( { left: left.toFixed( 0 ) + 'px' } ).fadeIn( 200 );\n\n\t\t\t\tth.addClass( 'with-tooltip' );\n\t\t\t} ).on( 'mouseleave', function () {\n\t\t\t\tconst th = $( this );\n\n\t\t\t\tth.find( '.yith-wcan-tooltip' ).fadeOut( 200, function () {\n\t\t\t\t\tth.removeClass( 'with-tooltip' )\n\t\t\t\t\t\t.find( '.yith-wcan-tooltip' )\n\t\t\t\t\t\t.remove();\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\tt.addClass( 'tooltip-added' );\n\t\t} );\n\t}\n\n\t// init dropdown\n\t_initDropdown( $filter ) {\n\t\tconst $dropdown = $filter.find( 'select.filter-dropdown' );\n\n\t\tif ( ! $dropdown.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t$dropdown.hasClass( 'select2-hidden-accessible' ) &&\n\t\t\t'undefined' !== typeof $.fn.selectWoo\n\t\t) {\n\t\t\t$dropdown.selectWoo( 'destroy' );\n\t\t}\n\n\t\tthis._initDropdownObject( $dropdown, {\n\t\t\tpaginate: true,\n\t\t\tperPage: yith_wcan_shortcodes.terms_per_page,\n\t\t} );\n\t}\n\n\t// init dropdown object\n\t_initDropdownObject( $dropdown, opts ) {\n\t\treturn new YITH_WCAN_Dropdown( $dropdown, opts );\n\t}\n\n\t// init price slider\n\t_initPriceSlider( $filter ) {\n\t\tif ( ! $filter.hasClass( 'filter-price-slider' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst self = this,\n\t\t\t$container = $filter.find( '.price-slider' ),\n\t\t\t$minInput = $container.find( '.price-slider-min' ),\n\t\t\t$maxInput = $container.find( '.price-slider-max' ),\n\t\t\tmin = parseFloat( $container.data( 'min' ) ),\n\t\t\tmax = parseFloat( $container.data( 'max' ) ),\n\t\t\tcurrentMin = parseFloat( $minInput.val() ),\n\t\t\tcurrentMax = parseFloat( $maxInput.val() ),\n\t\t\tstep = parseFloat( $container.data( 'step' ) ),\n\t\t\thandleSliderChange = function () {\n\t\t\t\tif ( self.sliderTimeout ) {\n\t\t\t\t\tclearTimeout( self.sliderTimeout );\n\t\t\t\t}\n\n\t\t\t\tself.sliderTimeout = setTimeout( () => {\n\t\t\t\t\tself.maybeFilter( $filter );\n\t\t\t\t}, 200 );\n\t\t\t};\n\n\t\t$filter.find( '.price-slider-ui' ).ionRangeSlider( {\n\t\t\tskin: 'round',\n\t\t\ttype: 'double',\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tstep,\n\t\t\tfrom: currentMin,\n\t\t\tto: currentMax,\n\t\t\tmin_interval: step,\n\t\t\tvalues_separator: ' - ',\n\t\t\tprettify: ( v ) => this.formatPrice( v ),\n\t\t\tonChange: ( data ) => {\n\t\t\t\t$minInput.val( data.from );\n\t\t\t\t$maxInput.val( data.to );\n\t\t\t},\n\t\t\tonFinish: handleSliderChange,\n\t\t} );\n\n\t\t$minInput\n\t\t\t.add( $maxInput )\n\t\t\t.off( 'change' )\n\t\t\t.on( 'keyup', () => {\n\t\t\t\tif ( ! $minInput.val() || ! $maxInput.val() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\thandleSliderChange();\n\t\t\t} );\n\t}\n\n\t// init collapsable\n\t_initCollapsable( $filter ) {\n\t\tthis._initTitleCollapsable( $filter );\n\t\tthis._initHierarchyCollapsable( $filter );\n\t}\n\n\t// init toggle on click of the title\n\t_initTitleCollapsable( $filter ) {\n\t\tconst $title = $filter.find( '.collapsable' );\n\n\t\tif ( ! $title.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._initToggle( $title, $title, $filter.find( '.filter-content' ) );\n\t}\n\n\t// init toggle on click of the parent li\n\t_initHierarchyCollapsable( $filter ) {\n\t\tconst $items = $filter.find( '.hierarchy-collapsable' );\n\n\t\tif ( ! $items.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// set parents of currently active term as open\n\t\tconst self = this,\n\t\t\tactive = $filter.find( '.active' );\n\n\t\tif ( active.length ) {\n\t\t\tactive\n\t\t\t\t.parents( '.hierarchy-collapsable' )\n\t\t\t\t.removeClass( 'closed' )\n\t\t\t\t.addClass( 'opened' );\n\n\t\t\tif (\n\t\t\t\tactive.hasClass( 'hierarchy-collapsable' ) &&\n\t\t\t\tyith_wcan_shortcodes.show_current_children\n\t\t\t) {\n\t\t\t\tactive.removeClass( 'closed' ).addClass( 'opened' );\n\t\t\t}\n\t\t}\n\n\t\t$items.each( function () {\n\t\t\tconst $t = $( this ),\n\t\t\t\t$toggle = $( '<span/>', {\n\t\t\t\t\tclass: 'toggle-handle',\n\t\t\t\t} );\n\n\t\t\t$toggle.appendTo( $t );\n\n\t\t\tself._initToggle( $toggle, $t, $t.children( 'ul.filter-items' ) );\n\t\t} );\n\t}\n\n\t// init toggle to generic toggle/target pair\n\t_initToggle( $toggle, $container, $target ) {\n\t\tif ( $container.hasClass( 'closed' ) ) {\n\t\t\t$target.hide();\n\t\t}\n\n\t\t$toggle.off( 'click' ).on( 'click', ( ev ) => {\n\t\t\tev.stopPropagation();\n\t\t\tev.preventDefault();\n\n\t\t\t$target.slideToggle( 400, () => {\n\t\t\t\t$container.toggleClass( 'opened' ).toggleClass( 'closed' );\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// init custom input\n\t_initCustomInput( $filter ) {\n\t\t$filter.find( ':input' ).each( function () {\n\t\t\tlet input = $( this ),\n\t\t\t\ttype = input.attr( 'type' ),\n\t\t\t\tcontainerClass = `${ type }button`,\n\t\t\t\tcontainer;\n\n\t\t\tif ( 'checkbox' !== type && 'radio' !== type ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( input.closest( `.${ containerClass }` ).length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( input.is( ':checked' ) ) {\n\t\t\t\tcontainerClass += ' checked';\n\t\t\t}\n\n\t\t\tcontainer = $( '<span/>', {\n\t\t\t\tclass: containerClass,\n\t\t\t} );\n\n\t\t\tinput.wrap( container ).on( 'change', function () {\n\t\t\t\tconst t = $( this );\n\n\t\t\t\tt.prop( 'checked' )\n\t\t\t\t\t? t.parent().addClass( 'checked' )\n\t\t\t\t\t: t.parent().removeClass( 'checked' );\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// register initial status\n\t_regiterStatus() {\n\t\tthis.originalFilters = this.getFiltersProperties();\n\t}\n\n\t// trigger handling after layout change\n\t_afterLayoutChange() {\n\t\tif ( this.isMobile ) {\n\t\t\tthis.$preset\n\t\t\t\t.addClass( 'filters-modal' )\n\t\t\t\t.attr( 'role', 'dialog' )\n\t\t\t\t.attr( 'tabindex', '-1' )\n\t\t\t\t.hide();\n\n\t\t\tthis._addCloseModalButton();\n\t\t\tthis._addApplyFiltersModalButton();\n\t\t\tthis._switchToCollapsables();\n\n\t\t\tthis.$filterButtons?.hide();\n\t\t} else {\n\t\t\tthis.$preset\n\t\t\t\t.removeClass( 'filters-modal' )\n\t\t\t\t.removeClass( 'open' )\n\t\t\t\t.removeAttr( 'role' )\n\t\t\t\t.removeAttr( 'tabindex' )\n\t\t\t\t.show();\n\n\t\t\t$( 'body' )\n\t\t\t\t.css( 'overflow', 'auto' )\n\t\t\t\t.removeClass( 'yith-wcan-preset-modal-open' );\n\n\t\t\tthis._removeCloseModalButton();\n\t\t\tthis._removeApplyFiltersModalButton();\n\t\t\tthis._switchBackCollapsables();\n\n\t\t\tthis.$filterButtons?.show();\n\t\t}\n\t}\n\n\t// add modal close button\n\t_addCloseModalButton() {\n\t\tconst $closeButton = $( '<a/>', {\n\t\t\tclass: 'close-button',\n\t\t\thtml: '&times;',\n\t\t\t'data-dismiss': 'modal',\n\t\t\t'aria-label': yith_wcan_shortcodes.labels.close,\n\t\t} );\n\n\t\t$closeButton\n\t\t\t.prependTo( this.$preset )\n\t\t\t.on( 'click', this.closeModal.bind( this ) );\n\t\tthis.modalElements.closeButton = $closeButton;\n\t}\n\n\t// remove modal close button\n\t_removeCloseModalButton() {\n\t\tthis.modalElements?.closeButton?.remove();\n\t}\n\n\t// show main filter button for the modal\n\t_addApplyFiltersModalButton() {\n\t\tconst $filterButton = $( '<button/>', {\n\t\t\tclass: 'apply-filters main-modal-button',\n\t\t\thtml: yith_wcan_shortcodes.labels.show_results,\n\t\t\t'data-dismiss': 'modal',\n\t\t} );\n\n\t\t$filterButton.appendTo( this.$preset ).on( 'click', () => {\n\t\t\tthis.filter();\n\t\t\tthis.closeModal();\n\t\t} );\n\t\tthis.modalElements.applyFiltersButton = $filterButton;\n\t}\n\n\t// hide main filter button for the modal\n\t_removeApplyFiltersModalButton() {\n\t\tthis.modalElements?.applyFiltersButton?.remove();\n\t}\n\n\t// convert all filters to collapsable\n\t_switchToCollapsables() {\n\t\tconst self = this;\n\n\t\tthis.getFilters().each( function () {\n\t\t\tconst $filter = $( this ),\n\t\t\t\t$title = $filter.find( '.filter-title' );\n\n\t\t\tif ( ! $title.length || $title.hasClass( 'collapsable' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$title.addClass( 'collapsable' ).data( 'disable-collapse', true );\n\n\t\t\tself._initTitleCollapsable( $filter );\n\t\t} );\n\t}\n\n\t// switch back filters to their previous collapsable state\n\t_switchBackCollapsables() {\n\t\tthis.getFilters().each( function () {\n\t\t\tconst $filter = $( this ),\n\t\t\t\t$title = $filter.find( '.filter-title' );\n\n\t\t\tif (\n\t\t\t\t! $title.length ||\n\t\t\t\t! $title.hasClass( 'collapsable' ) ||\n\t\t\t\t! $title.data( 'disable-collapse' )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$title\n\t\t\t\t.removeClass( 'collapsable' )\n\t\t\t\t.removeData( 'disable-collapse', true )\n\t\t\t\t.off( 'click' );\n\n\t\t\t$filter.find( '.filter-content' ).show();\n\t\t} );\n\t}\n\n\t// close all collpasable before showing modal\n\t_openAllCollapsables() {\n\t\tthis.$filters\n\t\t\t.not( '.no-title' )\n\t\t\t.not( ( i, v ) => {\n\t\t\t\treturn this.isFilterActive( $( v ) );\n\t\t\t} )\n\t\t\t.find( '.filter-content' )\n\t\t\t.show()\n\t\t\t.end()\n\t\t\t.find( '.filter-title' )\n\t\t\t.removeClass( 'closed' )\n\t\t\t.addClass( 'opened' );\n\t}\n\n\t// close all collpasable before showing modal\n\t_closeAllCollapsables() {\n\t\tthis.$filters\n\t\t\t.not( '.no-title' )\n\t\t\t.not( ( i, v ) => {\n\t\t\t\treturn this.isFilterActive( $( v ) );\n\t\t\t} )\n\t\t\t.find( '.filter-content' )\n\t\t\t.hide()\n\t\t\t.end()\n\t\t\t.find( '.filter-title' )\n\t\t\t.addClass( 'closed' )\n\t\t\t.removeClass( 'opened' );\n\t}\n\n\t// update status change flag, if filters have changed\n\tmaybeRegisterStatusChange() {\n\t\tconst currentFilters = this.getFiltersProperties(),\n\t\t\tcurrentStr = JSON.stringify( currentFilters ),\n\t\t\toriginalStr = JSON.stringify( this.originalFilters );\n\n\t\tthis.dirty = currentStr !== originalStr;\n\t}\n\n\t// apply filters when possible\n\tmaybeFilter( $initiator ) {\n\t\t// register status change\n\t\tthis.maybeRegisterStatusChange();\n\n\t\t// filter, or show filter button.\n\t\tif ( yith_wcan_shortcodes.instant_filters && ! this.isMobile ) {\n\t\t\tthis.filter();\n\t\t} else if (\n\t\t\t! yith_wcan_shortcodes.instant_filters &&\n\t\t\t! this.isMobile\n\t\t) {\n\t\t\tthis.dirty\n\t\t\t\t? this.$filterButtons?.show()\n\t\t\t\t: this.$filterButtons?.hide();\n\t\t} else if ( this.isMobile && this.dirty ) {\n\t\t\tthis.$preset.addClass( 'with-filter-button' );\n\t\t\tthis.modalElements.applyFiltersButton?.show();\n\t\t}\n\t}\n\n\t// main filtering method\n\tfilter() {\n\t\tconst filter = window?.product_filter;\n\n\t\tfilter\n\t\t\t?.doFilter( this.getFiltersProperties(), this.target, this.preset )\n\t\t\t?.done( () => {\n\t\t\t\tlet newPreset = $( this.preset );\n\n\t\t\t\tif ( newPreset.length && yith_wcan_shortcodes.scroll_top ) {\n\t\t\t\t\t// by default, scroll till top of first preset in the page.\n\t\t\t\t\tlet targetOffset = newPreset.offset().top;\n\n\t\t\t\t\tif ( !! yith_wcan_shortcodes.scroll_target ) {\n\t\t\t\t\t\t// when we have a specific target, use that for the offset.\n\t\t\t\t\t\tconst $scrollTarget = $(\n\t\t\t\t\t\t\tyith_wcan_shortcodes.scroll_target\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\ttargetOffset = $scrollTarget.length\n\t\t\t\t\t\t\t? $scrollTarget.offset().top\n\t\t\t\t\t\t\t: targetOffset;\n\t\t\t\t\t} else if ( this.isMobile ) {\n\t\t\t\t\t\t// otherwise, if we're on mobile, scroll to the top of the page\n\t\t\t\t\t\t// (preset could be in an unexpected location).\n\t\t\t\t\t\ttargetOffset = 100;\n\t\t\t\t\t}\n\n\t\t\t\t\t$( 'body, html' ).animate( {\n\t\t\t\t\t\tscrollTop: targetOffset - 100,\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t// register new filters, clear status flag\n\t\t\t\tthis.originalFilters = this.getFiltersProperties();\n\t\t\t\tthis.dirty = false;\n\t\t\t} );\n\n\t\tif ( this.isMobile ) {\n\t\t\tthis.$preset.removeClass( 'with-filter-button' );\n\t\t\tthis.modalElements.applyFiltersButton?.hide();\n\t\t\tthis.closeModal();\n\t\t}\n\t}\n\n\t// get all filter nodes\n\tgetFilters() {\n\t\tif ( false === this.$filters ) {\n\t\t\tthis.$filters = this.$preset.find( '.yith-wcan-filter' );\n\t\t}\n\n\t\treturn this.$filters;\n\t}\n\n\t// retrieves all filters that we want to apply\n\tgetActiveFilters() {\n\t\tif ( false === this.activeFilters ) {\n\t\t\tthis.activeFilters = this.getFiltersProperties();\n\t\t}\n\n\t\treturn this.activeFilters;\n\t}\n\n\t// check whether there is any filter active\n\tisAnyFilterActive() {\n\t\treturn !! Object.keys( this.getActiveFilters() ).length;\n\t}\n\n\t// checks whether current filter is active\n\tisFilterActive( $filter ) {\n\t\tlet filterType = $filter.data( 'filter-type' ),\n\t\t\tactive,\n\t\t\tfilteredActive;\n\n\t\tswitch ( filterType ) {\n\t\t\tcase 'tax':\n\t\t\tcase 'review':\n\t\t\tcase 'price_range':\n\t\t\t\tconst $dropdown = $filter.find( '.filter-dropdown' );\n\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tconst val = $dropdown.val();\n\n\t\t\t\t\tactive = 'object' === typeof val ? !! val?.length : !! val;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t// if we use type other than dropdown, fallthrough\n\t\t\tcase 'stock_sale':\n\t\t\t\tactive = $filter\n\t\t\t\t\t.find( '.filter-item' )\n\t\t\t\t\t.filter( '.active' ).length;\n\t\t\t\tbreak;\n\t\t\tcase 'price_slider':\n\t\t\t\tconst step = parseFloat(\n\t\t\t\t\t\t$filter.find( '.price-slider' ).data( 'step' )\n\t\t\t\t\t),\n\t\t\t\t\tmin = parseFloat(\n\t\t\t\t\t\t$filter.find( '.price-slider' ).data( 'min' )\n\t\t\t\t\t),\n\t\t\t\t\tmax = parseFloat(\n\t\t\t\t\t\t$filter.find( '.price-slider' ).data( 'max' )\n\t\t\t\t\t),\n\t\t\t\t\tcurrentMin = parseFloat(\n\t\t\t\t\t\t$filter.find( '.price-slider-min' ).val()\n\t\t\t\t\t),\n\t\t\t\t\tcurrentMax = parseFloat(\n\t\t\t\t\t\t$filter.find( '.price-slider-max' ).val()\n\t\t\t\t\t);\n\n\t\t\t\tactive =\n\t\t\t\t\tMath.abs( currentMin - min ) >= step ||\n\t\t\t\t\tMath.abs( currentMax - max ) >= step;\n\t\t\t\tbreak;\n\t\t\tcase 'orderby':\n\t\t\t\tactive =\n\t\t\t\t\t'menu_order' !== $filter.find( '.filter-order-by' ).val();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tactive = false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tfilteredActive = $filter.triggerHandler( 'yith_wcan_is_filter_active', [\n\t\t\tactive,\n\t\t\tthis,\n\t\t] );\n\t\tactive =\n\t\t\ttypeof filteredActive !== 'undefined' ? filteredActive : active;\n\n\t\treturn active;\n\t}\n\n\t// count the number of active items per filter\n\tcountActiveItems( $filter ) {\n\t\tlet filterType = $filter.data( 'filter-type' ),\n\t\t\tcount;\n\n\t\tswitch ( filterType ) {\n\t\t\tcase 'tax':\n\t\t\tcase 'review':\n\t\t\tcase 'price_range':\n\t\t\t\tconst $dropdown = $filter.find( '.filter-dropdown' );\n\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tconst val = $dropdown.val();\n\n\t\t\t\t\tcount = 'object' === typeof val ? val?.length : +!! val;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t// if we use type other than dropdown, fallthrough\n\t\t\tcase 'stock_sale':\n\t\t\t\tcount = $filter\n\t\t\t\t\t.find( '.filter-items' )\n\t\t\t\t\t.find( '.active' ).length;\n\t\t\t\tbreak;\n\t\t\tcase 'orderby':\n\t\t\t\tif ( this.isFilterActive( $filter ) ) {\n\t\t\t\t\tcount = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'price_slider':\n\t\t\tdefault:\n\t\t\t\tcount = 0;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn count;\n\t}\n\n\t// retrieves filter properties for the filter\n\tgetFilterProperties( $filter ) {\n\t\tlet filterType = $filter.data( 'filter-type' ),\n\t\t\tmultiple = 'yes' === $filter.data( 'multiple' ),\n\t\t\t$dropdown = $filter.find( '.filter-dropdown' ),\n\t\t\tproperties = {},\n\t\t\tfilteredProperties,\n\t\t\t$active;\n\n\t\tswitch ( filterType ) {\n\t\t\tcase 'tax':\n\t\t\t\tlet activeTerms = [],\n\t\t\t\t\ttaxonomy = $filter.data( 'taxonomy' ),\n\t\t\t\t\tisAttr = 0 === taxonomy.indexOf( 'filter' ),\n\t\t\t\t\trelation = $filter.data( 'relation' );\n\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tif ( multiple ) {\n\t\t\t\t\t\tactiveTerms = $dropdown.val();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tactiveTerms.push( $dropdown.val() );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$active = $filter\n\t\t\t\t\t\t.find( '.filter-item' )\n\t\t\t\t\t\t.filter( '.active' )\n\t\t\t\t\t\t.children( 'a, label' );\n\n\t\t\t\t\tactiveTerms = $active.get().reduce( function ( a, v ) {\n\t\t\t\t\t\tlet val;\n\n\t\t\t\t\t\tv = $( v );\n\t\t\t\t\t\tval = v.is( 'label' )\n\t\t\t\t\t\t\t? v.find( ':input' ).val()\n\t\t\t\t\t\t\t: v.data( 'term-slug' );\n\n\t\t\t\t\t\tif ( ! val ) {\n\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ta.push( val );\n\n\t\t\t\t\t\treturn a;\n\t\t\t\t\t}, activeTerms );\n\t\t\t\t}\n\n\t\t\t\tif ( ! multiple ) {\n\t\t\t\t\tproperties[ taxonomy ] = activeTerms.pop();\n\t\t\t\t} else {\n\t\t\t\t\tconst glue = ! isAttr && 'and' === relation ? '+' : ',';\n\t\t\t\t\tproperties[ taxonomy ] = activeTerms.join( glue );\n\t\t\t\t}\n\n\t\t\t\tif ( isAttr ) {\n\t\t\t\t\tproperties[ taxonomy.replace( 'filter_', 'query_type_' ) ] =\n\t\t\t\t\t\trelation;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 'review':\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tproperties.rating_filter = $dropdown.val();\n\t\t\t\t} else {\n\t\t\t\t\t$active = $filter\n\t\t\t\t\t\t.find( '.filter-item' )\n\t\t\t\t\t\t.filter( '.active' )\n\t\t\t\t\t\t.children( 'a, label' );\n\n\t\t\t\t\tif ( ! multiple ) {\n\t\t\t\t\t\t$active = $active.first();\n\t\t\t\t\t\tproperties.rating_filter = $active.is( 'label' )\n\t\t\t\t\t\t\t? $active.find( ':input' ).val()\n\t\t\t\t\t\t\t: $active.data( 'rating' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tproperties.rating_filter = $active\n\t\t\t\t\t\t\t.get()\n\t\t\t\t\t\t\t.reduce( function ( a, v ) {\n\t\t\t\t\t\t\t\tlet val;\n\n\t\t\t\t\t\t\t\tv = $( v );\n\t\t\t\t\t\t\t\tval = v.is( 'label' )\n\t\t\t\t\t\t\t\t\t? v.find( ':input' ).val()\n\t\t\t\t\t\t\t\t\t: v.data( 'rating' );\n\n\t\t\t\t\t\t\t\tif ( ! val ) {\n\t\t\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ta.push( val );\n\n\t\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t\t}, [] )\n\t\t\t\t\t\t\t.join( ',' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'price_range':\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tif ( multiple ) {\n\t\t\t\t\t\tproperties.price_ranges = $dropdown.val().join( ',' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tproperties.min_price = $dropdown\n\t\t\t\t\t\t\t.val()\n\t\t\t\t\t\t\t.split( '-' )[ 0 ];\n\t\t\t\t\t\tproperties.max_price = $dropdown\n\t\t\t\t\t\t\t.val()\n\t\t\t\t\t\t\t.split( '-' )[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$active = $filter\n\t\t\t\t\t\t.find( '.filter-item' )\n\t\t\t\t\t\t.filter( '.active' )\n\t\t\t\t\t\t.children( 'a, label' );\n\n\t\t\t\t\tif ( multiple ) {\n\t\t\t\t\t\tproperties.price_ranges = $active\n\t\t\t\t\t\t\t.get()\n\t\t\t\t\t\t\t.reduce( ( a, v ) => {\n\t\t\t\t\t\t\t\tlet min = $( v ).data( 'range-min' ),\n\t\t\t\t\t\t\t\t\tmax = $( v ).data( 'range-max' );\n\n\t\t\t\t\t\t\t\ta += ( max ? `${ min }-${ max }` : min ) + ',';\n\n\t\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t\t}, '' )\n\t\t\t\t\t\t\t.replace( /^(.*),$/, '$1' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tproperties.min_price = parseFloat(\n\t\t\t\t\t\t\t$active.first().data( 'range-min' )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tproperties.max_price = parseFloat(\n\t\t\t\t\t\t\t$active.first().data( 'range-max' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'price_slider':\n\t\t\t\tproperties.min_price = parseFloat(\n\t\t\t\t\t$filter.find( '.price-slider-min' ).val()\n\t\t\t\t);\n\t\t\t\tproperties.max_price = parseFloat(\n\t\t\t\t\t$filter.find( '.price-slider-max' ).val()\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'stock_sale':\n\t\t\t\tif ( $filter.find( '.filter-on-sale' ).is( '.active' ) ) {\n\t\t\t\t\tproperties.onsale_filter = 1;\n\t\t\t\t}\n\t\t\t\tif ( $filter.find( '.filter-in-stock' ).is( '.active' ) ) {\n\t\t\t\t\tproperties.instock_filter = 1;\n\t\t\t\t}\n\t\t\t\tif ( $filter.find( '.filter-featured' ).is( '.active' ) ) {\n\t\t\t\t\tproperties.featured_filter = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'orderby':\n\t\t\t\tproperties.orderby = $filter.find( '.filter-order-by' ).val();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tfilteredProperties = $filter.triggerHandler(\n\t\t\t'yith_wcan_filter_properties',\n\t\t\t[ properties, self ]\n\t\t);\n\t\tproperties =\n\t\t\ttypeof filteredProperties !== 'undefined'\n\t\t\t\t? filteredProperties\n\t\t\t\t: properties;\n\n\t\treturn properties;\n\t}\n\n\t// retrieves properties for all filters of the preset\n\tgetFiltersProperties() {\n\t\tlet properties = {};\n\t\tconst self = this;\n\n\t\tthis.getFilters().each( function () {\n\t\t\tconst $filter = $( this );\n\n\t\t\tif ( self.isFilterActive( $filter ) ) {\n\t\t\t\tconst filterProperties = self.getFilterProperties( $filter );\n\n\t\t\t\tproperties = self.mergeProperties(\n\t\t\t\t\tproperties,\n\t\t\t\t\tfilterProperties,\n\t\t\t\t\t$filter\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn properties;\n\t}\n\n\t// retrieve filters matching any of the properties passed\n\tgetFiltersByProperties( properties ) {\n\t\tconst self = this;\n\n\t\treturn this.getFilters().filter( function () {\n\t\t\tconst $filter = $( this );\n\n\t\t\tif ( self.isFilterActive( $filter ) ) {\n\t\t\t\tlet filterProperties = self.getFilterProperties( $filter ),\n\t\t\t\t\thasProp = false;\n\n\t\t\t\tfor ( const prop in properties ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t[ 'min_price', 'max_price', 'price_ranges' ].includes(\n\t\t\t\t\t\t\tprop\n\t\t\t\t\t\t) &&\n\t\t\t\t\t\t( filterProperties.min_price ||\n\t\t\t\t\t\t\tfilterProperties.price_ranges )\n\t\t\t\t\t) {\n\t\t\t\t\t\thasProp = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if ( filterProperties[ prop ] ) {\n\t\t\t\t\t\thasProp = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn hasProp;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t} );\n\t}\n\n\t// show clear selection anchor\n\tmaybeToggleClearFilter( $filter ) {\n\t\tif ( ! this.isFilterActive( $filter ) ) {\n\t\t\tthis.maybeHideClearFilter( $filter );\n\t\t} else {\n\t\t\tthis.maybeShowClearFilter( $filter );\n\t\t}\n\t}\n\n\t// show clear all selections anchor\n\tmaybeToggleClearAllFilters() {\n\t\tif ( ! this.isAnyFilterActive() ) {\n\t\t\tthis.maybeHideClearAllFilters();\n\t\t} else {\n\t\t\tthis.maybeShowClearAllFilters();\n\t\t}\n\t}\n\n\t// show clear selection anchor\n\tmaybeShowClearFilter( $filter ) {\n\t\tif (\n\t\t\t! this.isFilterActive( $filter ) ||\n\t\t\t! yith_wcan_shortcodes.show_clear_filter\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// remove clear selection link if already added.\n\t\t$filter.find( '.clear-selection' ).remove();\n\n\t\t// add new clear selection link.\n\t\t$( '<a/>', {\n\t\t\tclass: 'clear-selection',\n\t\t\ttext: yith_wcan_shortcodes.labels.clear_selection,\n\t\t\trole: 'button',\n\t\t} )\n\t\t\t.prependTo( $filter.find( '.filter-content' ) )\n\t\t\t.on( 'click', ( ev ) => {\n\t\t\t\tev.preventDefault();\n\n\t\t\t\tthis.deactivateFilter(\n\t\t\t\t\t$filter,\n\t\t\t\t\tfalse,\n\t\t\t\t\tyith_wcan_shortcodes.instant_filters\n\t\t\t\t);\n\t\t\t\tthis.maybeHideClearFilter( $filter );\n\n\t\t\t\tif ( yith_wcan_shortcodes.instant_filters ) {\n\t\t\t\t\tthis.closeModal();\n\t\t\t\t}\n\t\t\t} );\n\t}\n\n\t// show clearAll anchor, when on mobile layout\n\tmaybeShowClearAllFilters() {\n\t\tif ( ! this.isAnyFilterActive() || ! this.isMobile ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// remove clear selection link if already added.\n\t\tthis.$preset.find( '.clear-selection' ).remove();\n\n\t\t// add new clear selection link.\n\t\t$( '<a/>', {\n\t\t\tclass: 'clear-selection',\n\t\t\ttext: yith_wcan_shortcodes.labels.clear_all_selections,\n\t\t\trole: 'button',\n\t\t} )\n\t\t\t.prependTo( this.$preset.find( '.filters-container' ) )\n\t\t\t.on( 'click', ( ev ) => {\n\t\t\t\tev.preventDefault();\n\n\t\t\t\tthis.deactivateAllFilters(\n\t\t\t\t\tyith_wcan_shortcodes.instant_filters\n\t\t\t\t);\n\t\t\t\tthis.maybeHideClearAllFilters();\n\n\t\t\t\tif ( yith_wcan_shortcodes.instant_filters ) {\n\t\t\t\t\tthis.closeModal();\n\t\t\t\t}\n\t\t\t} );\n\t}\n\n\t// hide clear selection anchor\n\tmaybeHideClearFilter( $filter ) {\n\t\tif (\n\t\t\tthis.isFilterActive( $filter ) ||\n\t\t\t! yith_wcan_shortcodes.show_clear_filter\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// remove clear selection link.\n\t\t$filter.find( '.clear-selection' ).remove();\n\t}\n\n\t// show clearAll anchor, when on mobile layout\n\tmaybeHideClearAllFilters() {\n\t\tif ( this.isAnyFilterActive() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// remove clear selection link.\n\t\tthis.$preset\n\t\t\t.find( '.filters-container' )\n\t\t\t.children( '.clear-selection' )\n\t\t\t.remove();\n\t}\n\n\t// deactivate filter\n\tdeactivateFilter( $filter, properties, doFilter ) {\n\t\tconst filterType = $filter.data( 'filter-type' ),\n\t\t\t$items = $filter.find( '.filter-item' ),\n\t\t\t$activeItems = $items.filter( '.active' ),\n\t\t\t$dropdown = $filter.find( '.filter-dropdown' );\n\n\t\tswitch ( filterType ) {\n\t\t\tcase 'tax':\n\t\t\t\tconst taxonomy = $filter.data( 'taxonomy' );\n\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tif ( ! properties ) {\n\t\t\t\t\t\t$dropdown.find( 'option' ).prop( 'selected', false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$dropdown.find( 'option' ).each( function () {\n\t\t\t\t\t\t\tconst $option = $( this );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t$option.val().toString() ===\n\t\t\t\t\t\t\t\tproperties[ taxonomy ].toString()\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t$option.prop( 'selected', false );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\n\t\t\t\t\t$dropdown.change();\n\t\t\t\t} else if ( ! properties ) {\n\t\t\t\t\t$activeItems.children( 'label' ).children( 'a' ).click();\n\t\t\t\t\t$activeItems.removeClass( 'active' );\n\t\t\t\t} else {\n\t\t\t\t\t$activeItems.each( function () {\n\t\t\t\t\t\tlet $item = $( this ),\n\t\t\t\t\t\t\t$label = $item.children( 'label' ),\n\t\t\t\t\t\t\t$anchor = $item.children( 'a' ),\n\t\t\t\t\t\t\tvalue;\n\n\t\t\t\t\t\tvalue = $label.length\n\t\t\t\t\t\t\t? $label.find( ':input' ).val()\n\t\t\t\t\t\t\t: $anchor.data( 'term-slug' );\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tvalue.toString() ===\n\t\t\t\t\t\t\tproperties[ taxonomy ].toString()\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t$item.children( 'label' ).children( 'a' ).click();\n\t\t\t\t\t\t\t$item.removeClass( 'active' );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'review':\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tif ( ! properties ) {\n\t\t\t\t\t\t$dropdown.find( 'option' ).prop( 'selected', false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$dropdown.find( 'option' ).each( function () {\n\t\t\t\t\t\t\tconst $option = $( this );\n\n\t\t\t\t\t\t\tif ( $option.val() === properties.rating_filter ) {\n\t\t\t\t\t\t\t\t$option.prop( 'selected', false );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\n\t\t\t\t\t$dropdown.change();\n\t\t\t\t} else if ( ! properties ) {\n\t\t\t\t\t$activeItems.children( 'label' ).children( 'a' ).click();\n\t\t\t\t\t$activeItems.removeClass( 'active' );\n\t\t\t\t} else {\n\t\t\t\t\t$activeItems.each( function () {\n\t\t\t\t\t\tlet $item = $( this ),\n\t\t\t\t\t\t\t$label = $item.children( 'label' ),\n\t\t\t\t\t\t\t$anchor = $item.children( 'a' ),\n\t\t\t\t\t\t\tvalue;\n\n\t\t\t\t\t\tvalue = $label.length\n\t\t\t\t\t\t\t? $label.find( ':input' ).val()\n\t\t\t\t\t\t\t: $anchor.data( 'rating' );\n\n\t\t\t\t\t\tif ( value === properties.rating_filter ) {\n\t\t\t\t\t\t\t$item.children( 'label' ).children( 'a' ).click();\n\t\t\t\t\t\t\t$item.removeClass( 'active' );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'price_range':\n\t\t\t\tif ( $dropdown.length ) {\n\t\t\t\t\tif ( ! properties ) {\n\t\t\t\t\t\t$dropdown.find( 'option' ).prop( 'selected', false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$dropdown.find( 'option' ).each( function () {\n\t\t\t\t\t\t\tconst $option = $( this ),\n\t\t\t\t\t\t\t\tformattedRange =\n\t\t\t\t\t\t\t\t\tproperties.min_price +\n\t\t\t\t\t\t\t\t\t( properties.max_price\n\t\t\t\t\t\t\t\t\t\t? `-${ properties.max_price }`\n\t\t\t\t\t\t\t\t\t\t: '' );\n\n\t\t\t\t\t\t\tif ( $option.val() === formattedRange ) {\n\t\t\t\t\t\t\t\t$option.prop( 'selected', false );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\n\t\t\t\t\t$dropdown.change();\n\t\t\t\t} else if ( ! properties ) {\n\t\t\t\t\t$activeItems.children( 'label' ).children( 'a' ).click();\n\t\t\t\t\t$activeItems.removeClass( 'active' );\n\t\t\t\t} else {\n\t\t\t\t\t$activeItems.each( function () {\n\t\t\t\t\t\tlet $item = $( this ),\n\t\t\t\t\t\t\t$label = $item.children( 'label' ),\n\t\t\t\t\t\t\t$anchor = $item.children( 'a' ),\n\t\t\t\t\t\t\tformattedRange,\n\t\t\t\t\t\t\tvalue;\n\n\t\t\t\t\t\tvalue = $label.length\n\t\t\t\t\t\t\t? $label.find( ':input' ).val()\n\t\t\t\t\t\t\t: $anchor.data( 'min_price' ) +\n\t\t\t\t\t\t\t ( $anchor.data( 'max_price' )\n\t\t\t\t\t\t\t\t\t? '-' + $anchor.data( 'max_price' )\n\t\t\t\t\t\t\t\t\t: '' );\n\n\t\t\t\t\t\tif ( properties.min_price ) {\n\t\t\t\t\t\t\tformattedRange =\n\t\t\t\t\t\t\t\tproperties.min_price +\n\t\t\t\t\t\t\t\t( properties.max_price\n\t\t\t\t\t\t\t\t\t? '-' + properties.max_price\n\t\t\t\t\t\t\t\t\t: '' );\n\t\t\t\t\t\t} else if ( properties.price_ranges ) {\n\t\t\t\t\t\t\tformattedRange = properties.price_ranges;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( value === formattedRange ) {\n\t\t\t\t\t\t\t$item.children( 'label' ).children( 'a' ).click();\n\t\t\t\t\t\t\t$item.removeClass( 'active' );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'price_slider':\n\t\t\t\tconst $priceSlider = $filter.find( '.price-slider' );\n\n\t\t\t\t$filter\n\t\t\t\t\t.find( '.price-slider-min' )\n\t\t\t\t\t.val( $priceSlider.data( 'min' ) );\n\t\t\t\t$filter\n\t\t\t\t\t.find( '.price-slider-max' )\n\t\t\t\t\t.val( $priceSlider.data( 'max' ) )\n\t\t\t\t\t.change();\n\t\t\t\tbreak;\n\t\t\tcase 'orderby':\n\t\t\t\t$filter.find( 'select' ).val( 'menu_order' );\n\t\t\t\tbreak;\n\t\t\tcase 'stock_sale':\n\t\t\t\tif ( ! properties ) {\n\t\t\t\t\t$filter\n\t\t\t\t\t\t.find( '.filter-in-stock' )\n\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t.change();\n\t\t\t\t\t$filter\n\t\t\t\t\t\t.find( '.filter-on-sale' )\n\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t.change();\n\t\t\t\t\t$filter\n\t\t\t\t\t\t.find( '.filter-featured' )\n\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t.change();\n\n\t\t\t\t\t$items.removeClass( 'active' );\n\t\t\t\t} else {\n\t\t\t\t\tif ( properties?.instock_filter ) {\n\t\t\t\t\t\t$filter\n\t\t\t\t\t\t\t.find( '.filter-in-stock' )\n\t\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t\t.change()\n\t\t\t\t\t\t\t.closest( '.filter-item' )\n\t\t\t\t\t\t\t.removeClass( 'active' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( properties?.onsale_filter ) {\n\t\t\t\t\t\t$filter\n\t\t\t\t\t\t\t.find( '.filter-on-sale' )\n\t\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t\t.change()\n\t\t\t\t\t\t\t.closest( '.filter-item' )\n\t\t\t\t\t\t\t.removeClass( 'active' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( properties?.featured_filter ) {\n\t\t\t\t\t\t$filter\n\t\t\t\t\t\t\t.find( '.filter-featured' )\n\t\t\t\t\t\t\t.find( ':input' )\n\t\t\t\t\t\t\t.prop( 'checked', false )\n\t\t\t\t\t\t\t.change()\n\t\t\t\t\t\t\t.closest( '.filter-item' )\n\t\t\t\t\t\t\t.removeClass( 'active' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$items.removeClass( 'active' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis.activeFilters = false;\n\n\t\tif ( doFilter ) {\n\t\t\tthis.filter();\n\t\t}\n\t}\n\n\t// deactivate all filters\n\tdeactivateAllFilters( doFilter ) {\n\t\tconst self = this,\n\t\t\t$filters = this.getFilters();\n\n\t\t$filters.each( function () {\n\t\t\tconst $filter = $( this );\n\n\t\t\tself.deactivateFilter( $filter );\n\t\t} );\n\n\t\tthis.activeFilters = false;\n\n\t\tif ( doFilter ) {\n\t\t\tthis.filter();\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// deactivate filters that matches a specific set of properties\n\tdeactivateFilterByProperties( properties, doFilter ) {\n\t\tconst self = this,\n\t\t\t$filters = this.getFiltersByProperties( properties );\n\n\t\tif ( ! $filters.length ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$filters.each( function () {\n\t\t\tconst $filter = $( this );\n\n\t\t\tself.deactivateFilter( $filter, properties, doFilter );\n\t\t} );\n\n\t\treturn true;\n\t}\n\n\t// open filters as a modal, when in mobile layout\n\topenModal() {\n\t\tif ( ! this.isMobile ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( yith_wcan_shortcodes.toggles_open_on_modal ) {\n\t\t\tthis._openAllCollapsables();\n\t\t} else {\n\t\t\tthis._closeAllCollapsables();\n\t\t}\n\n\t\t$( 'body' )\n\t\t\t.css( 'overflow', 'hidden' )\n\t\t\t.addClass( 'yith-wcan-preset-modal-open' );\n\n\t\tthis.$preset.show();\n\n\t\tsetTimeout( () => {\n\t\t\tthis.$preset.addClass( 'open' );\n\t\t}, 100 );\n\t}\n\n\t// close filters modal, when in mobile layout\n\tcloseModal() {\n\t\tif ( ! this.isMobile ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.$preset.removeClass( 'open' );\n\n\t\tsetTimeout( () => {\n\t\t\tthis.$preset.hide();\n\t\t\t$( 'body' )\n\t\t\t\t.css( 'overflow', 'auto' )\n\t\t\t\t.removeClass( 'yith-wcan-preset-modal-open' );\n\t\t}, 300 );\n\t}\n\n\t// utility that formats the price according to store configuration.\n\tformatPrice( price ) {\n\t\tif ( 'undefined' !== typeof accounting ) {\n\t\t\tprice = accounting.formatMoney( price, {\n\t\t\t\tsymbol: yith_wcan_shortcodes.currency_format?.symbol,\n\t\t\t\tdecimal: yith_wcan_shortcodes.currency_format?.decimal,\n\t\t\t\tthousand: yith_wcan_shortcodes.currency_format?.thousand,\n\t\t\t\tprecision: 0,\n\t\t\t\tformat: yith_wcan_shortcodes.currency_format?.format,\n\t\t\t} );\n\t\t}\n\n\t\treturn price;\n\t}\n\n\t// utility that merges together sets of filter properties\n\tmergeProperties( set1, set2, $filter ) {\n\t\t// search for common properties\n\t\tfor ( const prop in set2 ) {\n\t\t\tif ( ! set2.hasOwnProperty( prop ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( !! set1[ prop ] ) {\n\t\t\t\tswitch ( prop ) {\n\t\t\t\t\tcase 'rating_filter':\n\t\t\t\t\tcase 'min_price':\n\t\t\t\t\tcase 'max_price':\n\t\t\t\t\tcase 'onsale_filter':\n\t\t\t\t\tcase 'instock_filter':\n\t\t\t\t\tcase 'orderby':\n\t\t\t\t\t\t// just override default value\n\t\t\t\t\t\tset1[ prop ] = set2[ prop ];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif ( 0 === prop.indexOf( 'query_type_' ) ) {\n\t\t\t\t\t\t\t// query_type param\n\t\t\t\t\t\t\tset1[ prop ] = set2[ prop ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// we're dealing with taxonomy\n\t\t\t\t\t\t\tconst isAttr = 0 === prop.indexOf( 'filter_' ),\n\t\t\t\t\t\t\t\tglue = isAttr ? ',' : '+';\n\n\t\t\t\t\t\t\tlet newValue =\n\t\t\t\t\t\t\t\tset1[ prop ].replace( ',', glue ) +\n\t\t\t\t\t\t\t\tglue +\n\t\t\t\t\t\t\t\tset2[ prop ].replace( ',', glue );\n\n\t\t\t\t\t\t\tnewValue = newValue\n\t\t\t\t\t\t\t\t.split( glue )\n\t\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t\t( value, index, arr ) =>\n\t\t\t\t\t\t\t\t\t\tarr.indexOf( value ) === index\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.join( glue );\n\n\t\t\t\t\t\t\tset1[ prop ] = newValue;\n\n\t\t\t\t\t\t\tif ( isAttr ) {\n\t\t\t\t\t\t\t\tconst queryTypeParam = prop.replace(\n\t\t\t\t\t\t\t\t\t'filter_',\n\t\t\t\t\t\t\t\t\t'query_type_'\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tset1[ queryTypeParam ] = 'and';\n\t\t\t\t\t\t\t\tset2[ queryTypeParam ] = 'and';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdelete set2[ prop ];\n\t\t\t}\n\t\t}\n\n\t\t$.extend( set1, set2 );\n\n\t\treturn set1;\n\t}\n}\n","'use strict';\n\n/* global globalThis, jQuery, yith_wcan_shortcodes, accounting */\n\nimport YITH_WCAN_Filter from './modules/yith-wcan-filter';\nimport YITH_WCAN_Reset_Button from './modules/yith-wcan-reset-button';\nimport YITH_WCAN_Preset from './modules/yith-wcan-preset';\n\njQuery( function ( $ ) {\n\t$( document )\n\t\t.on(\n\t\t\t'yith_wcan_init_shortcodes yith_plugin_fw_gutenberg_success_do_shortcode',\n\t\t\tfunction () {\n\t\t\t\t$( '.yith-wcan-filters' )\n\t\t\t\t\t.not( '.enhanced' )\n\t\t\t\t\t.each( function () {\n\t\t\t\t\t\tnew YITH_WCAN_Preset( $( this ) );\n\t\t\t\t\t} );\n\n\t\t\t\t$( '.yith-wcan-reset-filters' )\n\t\t\t\t\t.not( '.enhanced' )\n\t\t\t\t\t.each( function () {\n\t\t\t\t\t\tnew YITH_WCAN_Reset_Button( $( this ) );\n\t\t\t\t\t} );\n\t\t\t}\n\t\t)\n\t\t.trigger( 'yith_wcan_init_shortcodes' );\n\n\tglobalThis.product_filter = new YITH_WCAN_Filter();\n} );\n"],"sourceRoot":""}
assets/js/yith-wcan-shortcodes.min.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e=jQuery,t=e("body");function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var l=function(){function l(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),n(this,"xhr",null),n(this,"doingAjax",!1),n(this,"originalSearch",location.search),n(this,"initialized",!1),n(this,"filtered",!1),this.initPopState(),this.initialized=!0}var r,s,o;return r=l,(s=[{key:"initPopState",value:function(){yith_wcan_shortcodes.reload_on_back&&(this.pushUrlToHistory(window.location,document.title,null,!0),e(window).on("popstate",(function(){var e;null!==(e=window.history.state)&&void 0!==e&&e._yithWcan&&window.location.reload(!0)})))}},{key:"doFilter",value:function(t,i,a){var n,l,r=this,s=e(i||"body");return(l=e(document).triggerHandler("yith_wcan_filters_parameters",[t]))&&(t=l),s&&this.block(s),n=this.buildUrl(t),yith_wcan_shortcodes.ajax_filters?(this.doingAjax=!0,this._doAjax(n).done((function(e){n=r.searchAlternativeUrl(e,n),r._beforeFilter(e,t),r.refreshFragments(i,a,e),r.pushUrlToHistory(n,e.pageTitle,t),r.originalSearch=location.search,s&&r.unblock(s),r._afterFilter(e,t),r.doingAjax=!1}))):(this.pushUrlToHistory(n,document.title,t),void(window.location=n))}},{key:"_beforeFilter",value:function(t,i){e(document).trigger("yith-wcan-ajax-loading",[t,i])}},{key:"_afterFilter",value:function(i,a){e(".woocommerce-ordering").on("change","select.orderby",(function(){e(this).closest("form").submit()})),this.filtered=a&&!!Object.keys(a).length,this.filtered?t.addClass("filtered"):t.removeClass("filtered"),e(window).trigger("scroll"),e(document).trigger("yith-wcan-ajax-filtered",[i,a]).trigger("yith_wcwl_reload_fragments")}},{key:"buildUrl",value:function(t){var a,n=this,l=yith_wcan_shortcodes.query_param,r={},s=window.location,o=yith_wcan_shortcodes.base_url?yith_wcan_shortcodes.base_url:(null==s?void 0:s.origin)+(null==s?void 0:s.pathname),c=this,h="object"===i(t)&&Object.keys(t).length;if(yith_wcan_shortcodes.session_param&&(o=o.replace(new RegExp("/"+yith_wcan_shortcodes.session_param+"/[^/]*/"),"")),h&&(r[l]=1),this.originalSearch){var d=this.originalSearch.replace("?","").split("&").reduce((function(e,t){var i=t.split("=");if(2===i.length){if(n.isFilterParam(i[0]))return e;e[i[0]]=i[1]}return e}),{});r=e.extend(r,d)}return h&&(r=e.extend(r,t)),(a=Object.keys(r).reduce((function(e,t){var i=r[t];return i&&t?e+=c._cleanParam(t)+"="+c._cleanParam(i)+"&":e}),"?").replace(/&$/g,"").replace(/%2B/g,"+").replace(/%2C/g,",")).length>1&&(o+=a),o}},{key:"searchAlternativeUrl",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=i;return-1===e.indexOf("yith_wcan:sharing_url")?a:a=(t=e.match(/<meta name="yith_wcan:sharing_url" content="([^"]*)">/))&&1 in t?t[1]:a}},{key:"pushUrlToHistory",value:function(e,t,i,a){if(yith_wcan_shortcodes.change_browser_url&&!navigator.userAgent.match(/msie/i)){var n="pushState";a&&(n="replaceState"),window.history[n]({_yithWcan:!0,pageTitle:t,filters:i},"",e)}}},{key:"refreshFragments",value:function(t,i,a){var n=document.createElement("html"),l=e(n);if(n.innerHTML=a,t){var r,s=e(i),o=e(t);s.length&&(r=l.find(i)).length&&s.replaceWith(r.first()),o.length&&(r=l.find(t)).length&&o.replaceWith(r.first())}else{var c=e(yith_wcan_shortcodes.content);c.length?c.replaceWith(l.find(yith_wcan_shortcodes.content)):e("body").replaceWith(l.find("body"))}e(document).trigger("yith_wcan_init_shortcodes")}},{key:"_cleanParam",value:function(e){var t,i;return null===(t=yith_wcan_shortcodes)||void 0===t||!t.process_sanitize||null!==(i=yith_wcan_shortcodes)&&void 0!==i&&i.skip_sanitize?e:encodeURIComponent(e)}},{key:"_doAjax",value:function(t,i){return this.xhr&&this.xhr.abort(),i=e.extend({url:t,headers:{"X-YITH-WCAN":1}},i),this.xhr=e.ajax(i),this.xhr}},{key:"block",value:function(t){var i;if(void 0!==e.fn.block){var a="#fff center center no-repeat";null!==(i=yith_wcan_shortcodes)&&void 0!==i&&i.loader&&(a="url('".concat(yith_wcan_shortcodes.loader,"') ").concat(a)),t.block({message:null,overlayCSS:{background:a,opacity:.7}})}}},{key:"unblock",value:function(t){void 0!==e.fn.unblock&&t.unblock()}},{key:"isFilterParam",value:function(t){var i,a=["rating_filter","min_price","max_price","price_ranges","onsale_filter","instock_filter","featured_filter","orderby","product-page",yith_wcan_shortcodes.query_param];return(i=e(document).triggerHandler("yith_wcan_supported_filters_parameters",[a]))&&(a=i),-1!==(a=a.concat(yith_wcan_shortcodes.supported_taxonomies.map((function(e){return e.replace("pa_","filter_")})))).indexOf(t)||-1!==t.indexOf("filter_")||-1!==t.indexOf("query_type_")}}])&&a(r.prototype,s),o&&a(r,o),l}();var r=function t(i){var a,n,l;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l=null,(n="$reset")in(a=this)?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,this.$reset=i,this.$reset.on("click",(function(t){t.preventDefault(),e(".yith-wcan-filters").each((function(){var t=e(this).data("preset");t.deactivateAllFilters(!0),t.closeModal()}))})),this.$reset.data("reset",this).addClass("enhanced")};function s(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var a=0,n=function(){};return{s:n,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return r=e.done,e},e:function(e){s=!0,l=e},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw l}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,a=new Array(t);i<t;i++)a[i]=e[i];return a}function c(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function h(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var d=function(){function t(i,a){var n,l,r,s;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),h(this,"$originalSelect",null),h(this,"$_main",null),h(this,"$_label",null),h(this,"$_dropdown",null),h(this,"$_search",null),h(this,"$_showMore",null),h(this,"$_items",null),h(this,"currentPage",1),h(this,"options",{}),this.$originalSelect=i,this.$originalSelect.is("select")){var o=this.$originalSelect.data("per_page"),c=this.$originalSelect.data("order"),d=this.$originalSelect.data("all-label"),u={showSearch:this.$originalSelect.data("show_search"),paginate:this.$originalSelect.data("paginate"),perPage:o||10,order:c||"ASC",getElements:null,labels:{emptyLabel:d||(null===(n=yith_wcan_shortcodes.labels)||void 0===n?void 0:n.empty_option),searchPlaceholder:null===(l=yith_wcan_shortcodes.labels)||void 0===l?void 0:l.search_placeholder,noItemsFound:null===(r=yith_wcan_shortcodes.labels)||void 0===r?void 0:r.no_items,showMore:null===(s=yith_wcan_shortcodes.labels)||void 0===s?void 0:s.show_more}};this.options=e.extend(u,a),this._hideSelect(),this._initTemplate(),this._initActions(),this.$originalSelect.data("dropdown",this).addClass("enhanced")}}var i,a,n;return i=t,(a=[{key:"_hideSelect",value:function(){this.$originalSelect.hide()}},{key:"_initTemplate",value:function(){var t=e("<div/>",{class:"yith-wcan-dropdown closed"}),i=e("<div/>",{class:"dropdown-label",html:this.getLabel()}),a=e("<div>",{class:"dropdown-wrapper"}),n=e("<ul/>",{class:"matching-items filter-items"});a.append(n),t.append(i).append(a),this.options.showSearch&&this._initSearchTemplate(a),this.options.paginate&&this._initShowMoreTemplate(a),this.$originalSelect.after(t),this.$_main=t,this.$_label=i,this.$_dropdown=a,this.$_items=n}},{key:"_initSearchTemplate",value:function(t){var i=e("<div/>",{class:"search-field-container"}),a=e("<input/>",{name:"s",class:"search-field",type:"search",placeholder:this.options.labels.searchPlaceholder});i.append(a).prependTo(t),this.$_search=a}},{key:"_initShowMoreTemplate",value:function(t){var i,a=e("<a/>",{class:"show-more",text:null===(i=this.options.labels.showMore)||void 0===i?void 0:i.replace("%d",this.options.perPage)});a.on("click",this.loadNextPage.bind(this)).hide(),t.append(a),this.$_showMore=a}},{key:"_initActions",value:function(){var t,i,a=this;null===(t=this.$_main)||void 0===t||t.on("click",(function(e){e.stopPropagation(),a.toggleDropdown()})),this.$_dropdown.on("click",(function(e){e.stopPropagation()})),null===(i=this.$_search)||void 0===i||i.on("keyup search",(function(){a._populateItems()})),this.$_items.on("change",":input",(function(){var t,i=e(this).closest("li"),n=i.data("value");if(i.hasClass("disabled")&&!a.isValueSelected(n))return!1;i.toggleClass("active"),t=i.hasClass("active"),a._changeItemStatus(n,t)})),this.$_items.on("click","li:not(.checkbox) a",(function(t){var i,n=e(this).closest("li"),l=n.data("value");if(t.preventDefault(),n.hasClass("disabled")&&!a.isValueSelected(l))return!1;n.toggleClass("active"),(i=n.hasClass("active"))&&n.siblings().removeClass("active"),a._changeItemStatus(l,i)})),this.$_items.on("click","label > a",(function(t){var i=e(this).parent().find(":input");t.preventDefault(),(i.is('[type="radio"]')||i.is('[type="checkbox"]'))&&i.prop("checked",!i.prop("checked")),i.change()})),this.$originalSelect.on("change",(function(t,i){i||(a.$_items.find("li").each((function(){var t=e(this).data("value");a.isValueSelected(t)?a._selectItem(t):a._deselectItem(t)})),a.updateLabel())})),null!==globalThis&&void 0!==globalThis&&globalThis.yith_wcan_dropdown_init||(e(document).on("click",this._closeAllDropdowns),globalThis.yith_wcan_dropdown_init=!0)}},{key:"openDropdown",value:function(){var e;null===(e=this.$_main)||void 0===e||e.addClass("open").removeClass("closed"),this._afterDropdownOpen()}},{key:"closeDropdown",value:function(){var e;null===(e=this.$_main)||void 0===e||e.removeClass("open").addClass("closed")}},{key:"_closeAllDropdowns",value:function(){e(document).find("select.enhanced").filter((function(t,i){return!!e(i).data("dropdown")})).each((function(){e(this).data("dropdown").closeDropdown()}))}},{key:"_closeOtherDropdowns",value:function(){var t=this;e(document).find("select.enhanced").filter((function(i,a){var n=e(a);return!!n.data("dropdown")&&!n.is(t.$originalSelect)})).each((function(){e(this).data("dropdown").closeDropdown()}))}},{key:"toggleDropdown",value:function(){var e,t;null===(e=this.$_main)||void 0===e||e.toggleClass("open").toggleClass("closed"),null!==(t=this.$_main)&&void 0!==t&&t.hasClass("open")&&this._afterDropdownOpen()}},{key:"_afterDropdownOpen",value:function(){var e;this._closeOtherDropdowns(),null!==(e=this.$_search)&&void 0!==e&&e.length&&this.$_search.val(""),this._populateItems()}},{key:"getMatchingElements",value:function(t,i){var a=this,n=[],l=this.getOptions();return new Promise((function(r){l.each((function(){var i=e(this),a=i.val(),l=i.html(),r=new RegExp(".*"+t+".*","i");(!t||r.test(a)||r.test(l))&&n.push({value:a,label:l})})),a.options.getElements?a.options.getElements(t).then((function(t){t&&(t=t.reduce((function(e,t,i){return e.push({label:i,value:t}),e}),[]),n=e.extend(n,t)),r(a._formatItems(n,i))})):r(a._formatItems(n,i))}))}},{key:"_formatItems",value:function(e,t){var i=this,a=[],n=!1;return e.filter((function(e){return-1===a.indexOf(e.value)&&(a.push(e.value),!0)})).sort((function(e,t){var a="ASC"===i.options.order?1:-1;return e.value<t.value?-1*a:e.value>t.value?a:0})),t&&(n=t<Object.keys(e).length,e=e.slice(0,t)),{items:e,hasMore:n}}},{key:"_generateItem",value:function(t,i){var a,n=this.isValueSelected(t),l=this.getOptionByValue(t),r=e("<li/>",{"data-value":t,class:l.length?l.attr("class"):""});if(l.length){var s=l.data("template"),o=l.data("count");i=s||i,o&&(i+=o)}if(a=e("<a/>",{href:l.length?l.data("filter_url"):"#",html:i,rel:"nofollow","data-title":l.length?l.data("title"):""}),this.$originalSelect.prop("multiple")){var c=e("<input/>",{type:"checkbox",value:t}),h=e("<label>");c.prop("checked",n),h.prepend(c).append(a),r.append(h).addClass("checkbox")}else r.append(a);return n?r.addClass("active"):r.removeClass("active"),r}},{key:"_populateItems",value:function(t){var i,a,n=this,l=null!==(i=this.$_search)&&void 0!==i&&i.length?this.$_search.val():"",r=this.options.paginate?this.options.perPage:0;a=(t=t?parseInt(t):1)*r,this.getMatchingElements(l,a).then((function(i){var a=i.items,l=[],r=!1;if(n._emptyItems(),n._hideLoadMore(),a.length){var o,c=s(a);try{for(c.s();!(o=c.n()).done;){var h=o.value;""===h.value?l.unshift(n._generateItem(h.value,h.label)):l.push(n._generateItem(h.value,h.label))}}catch(e){c.e(e)}finally{c.f()}n.currentPage=t,r=i.hasMore}else l.push(e("<li/>",{text:n.options.labels.noItemsFound})),n.currentPage=1;n.$_items.append(l),n.$originalSelect.trigger("yith_wcan_dropdown_updated"),r&&n._showLoadMore()}))}},{key:"loadNextPage",value:function(){var e=this.currentPage+1;this._populateItems(e)}},{key:"_selectItem",value:function(e){return this._changeItemStatus(e,!0)}},{key:"_deselectItem",value:function(e){return this._changeItemStatus(e,!1)}},{key:"_changeItemStatus",value:function(e,t){var i=this.$originalSelect.find('option[value="'.concat(e,'"]'));return!!i.length&&(i.prop("selected",t),this.closeDropdown(),this.updateLabel(),this.$originalSelect.trigger("change",[!0]),!0)}},{key:"_emptyItems",value:function(){this.$_items.html("")}},{key:"_showLoadMore",value:function(){this.$_showMore.show()}},{key:"_hideLoadMore",value:function(){this.$_showMore.hide()}},{key:"getLabel",value:function(){return this.hasSelectedValues()?this.getSelectedLabels().join(", "):this.options.labels.emptyLabel}},{key:"updateLabel",value:function(){var e,t=this.getLabel();null===(e=this.$_label)||void 0===e||e.html(t)}},{key:"getOptions",value:function(){return this.$originalSelect.find("option")}},{key:"hasSelectedValues",value:function(){return this.getSelectedOptions().length}},{key:"isValueSelected",value:function(e){return-1!==this.getSelectedValues().indexOf(e.toString())}},{key:"getSelectedOptions",value:function(){return this.$originalSelect.find("option").filter(":selected")}},{key:"getOptionByValue",value:function(e){return this.$originalSelect.find('option[value="'.concat(e,'"]'))}},{key:"getSelectedLabels",value:function(){var t=[];return this.getSelectedOptions().each((function(){var i=e(this),a=i.data("template");a=a||i.html().replace(/\([0-9]*\)/,""),t.push(a)})),t}},{key:"getSelectedValues",value:function(){var t=[];return this.getSelectedOptions().each((function(){t.push(e(this).val())})),t}},{key:"destroy",value:function(){}}])&&c(i.prototype,a),n&&c(i,n),t}();function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function p(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var v=function(){function t(i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),p(this,"preset",!1),p(this,"$preset",!1),p(this,"target",!1),p(this,"$target",!1),p(this,"$filters",!1),p(this,"$filterButtons",!1),p(this,"modalElements",{}),p(this,"activeFilters",!1),p(this,"isMobile",!1),p(this,"sliderTimeout",!1),p(this,"originalFilters",null),p(this,"dirty",!1),this.preset="#"+i.attr("id"),this.$preset=i,this.target=this.$preset.data("target"),this.$target=!!this.target&&e(this.target),this._regiterStatus(),this._initFilterButton(),this._initResponsive(),this._initFilters(),this._initActions(),this.$preset.data("preset",this).addClass("enhanced").trigger("yith_wcan_preset_initialized",[this])}var i,a,n;return i=t,(a=[{key:"_initFilters",value:function(){var t=this;this.getFilters().each((function(){var i=e(this);t._initFilter(i)})),this.maybeShowClearAllFilters()}},{key:"_initFilterButton",value:function(){var e=this;this.$filterButtons=this.$preset.find(".apply-filters"),this.$filterButtons.length&&this.$filterButtons.on("click",(function(t){t.preventDefault(),e.filter()})).hide()}},{key:"_initActions",value:function(){this.$preset.find("form").on("submit",(function(e){e.preventDefault()}))}},{key:"_initResponsive",value:function(){var t=this;if(yith_wcan_shortcodes.modal_on_mobile){var i=window.matchMedia("(max-width: ".concat(yith_wcan_shortcodes.mobile_media_query,"px)"));e(window).on("resize",(function(){var e=!!i.matches;e!==t.isMobile&&(t.isMobile=e,t._afterLayoutChange())})).resize()}}},{key:"_initFilter",value:function(t){var i,a=this,n=function(i){var n=e(this),l=n.closest(".yith-wcan-filter"),r=!!l.length&&"yes"===l.data("multiple"),s=n.closest(".filter-item"),o=s.length?l.find(".filter-item").not(s):[];if(s.is(".disabled")&&!s.is(".active"))return i.preventDefault(),!1;i.preventDefault(),o.length&&!r&&o.removeClass("active").children("label").find(":input").prop("checked",!1).parent(".checked").removeClass("checked"),s.length&&s.toggleClass("active"),a.activeFilters=!1,a.maybeFilter(t),a.maybeToggleClearAllFilters(),a.maybeToggleClearFilter(l)};t.find(".filter-item").not(".checkbox").not(".radio").on("click","a",(function(t){var i=e(this).closest(".filter-item");if(!e(null==t?void 0:t.delegateTarget).is(i))return!1;n.call(this,t)})),t.find(":input").on("change",(function(t){var i=e(this),a=i.closest(".filter-item");if(a.is(".disabled")&&!a.is(".active"))return i.prop("checked",!1),!1;n.call(this,t)})),t.find("label > a").on("click",(function(t){var i=e(this),a=i.closest(".filter-item");if(t.preventDefault(),a.is(".disabled")&&!a.is(".active"))return!1;var n=i.parent().find(":input");(n.is('[type="radio"]')||n.is('[type="checkbox"]'))&&n.prop("checked",!n.prop("checked")),n.change()})),this._initTooltip(t),this._initPriceSlider(t),this._initDropdown(t),this._initCollapsable(t),this.maybeShowClearFilter(t),null!==(i=this.$preset)&&void 0!==i&&i.hasClass("custom-style")&&(this._initCustomInput(t),t.on("yith_wcan_dropdown_updated",(function(){var t=e(this).closest(".yith-wcan-filter");a._initCustomInput(t)})))}},{key:"_initTooltip",value:function(t,i){t.find("[data-title]").each((function(){var t=e(this);!t.hasClass("tooltip-added")&&t.data("title")&&(t.on("mouseenter",(function(){var t,a=e(this),n=null,l=a.outerWidth(),r=0;if(!i||"top"!==i&&"right"!==i){var s=a.closest(".filter-item");i=s.hasClass("color")||s.hasClass("label")?"top":"right"}n=e("<span>",{class:"yith-wcan-tooltip",html:a.data("title")}),a.append(n),t=n.outerWidth()+6,n.outerWidth(t),r="top"===i?(l-t)/2:l+15,n.css({left:r.toFixed(0)+"px"}).fadeIn(200),a.addClass("with-tooltip")})).on("mouseleave",(function(){var t=e(this);t.find(".yith-wcan-tooltip").fadeOut(200,(function(){t.removeClass("with-tooltip").find(".yith-wcan-tooltip").remove()}))})),t.addClass("tooltip-added"))}))}},{key:"_initDropdown",value:function(t){var i=t.find("select.filter-dropdown");i.length&&(i.hasClass("select2-hidden-accessible")&&void 0!==e.fn.selectWoo&&i.selectWoo("destroy"),this._initDropdownObject(i,{paginate:!0,perPage:yith_wcan_shortcodes.terms_per_page}))}},{key:"_initDropdownObject",value:function(e,t){return new d(e,t)}},{key:"_initPriceSlider",value:function(e){var t=this;if(e.hasClass("filter-price-slider")){var i=this,a=e.find(".price-slider"),n=a.find(".price-slider-min"),l=a.find(".price-slider-max"),r=parseFloat(a.data("min")),s=parseFloat(a.data("max")),o=parseFloat(n.val()),c=parseFloat(l.val()),h=parseFloat(a.data("step")),d=function(){i.sliderTimeout&&clearTimeout(i.sliderTimeout),i.sliderTimeout=setTimeout((function(){i.maybeFilter(e)}),200)};e.find(".price-slider-ui").ionRangeSlider({skin:"round",type:"double",min:r,max:s,step:h,from:o,to:c,min_interval:h,values_separator:" - ",prettify:function(e){return t.formatPrice(e)},onChange:function(e){n.val(e.from),l.val(e.to)},onFinish:d}),n.add(l).off("change").on("keyup",(function(){n.val()&&l.val()&&d()}))}}},{key:"_initCollapsable",value:function(e){this._initTitleCollapsable(e),this._initHierarchyCollapsable(e)}},{key:"_initTitleCollapsable",value:function(e){var t=e.find(".collapsable");t.length&&this._initToggle(t,t,e.find(".filter-content"))}},{key:"_initHierarchyCollapsable",value:function(t){var i=t.find(".hierarchy-collapsable");if(i.length){var a=this,n=t.find(".active");n.length&&(n.parents(".hierarchy-collapsable").removeClass("closed").addClass("opened"),n.hasClass("hierarchy-collapsable")&&yith_wcan_shortcodes.show_current_children&&n.removeClass("closed").addClass("opened")),i.each((function(){var t=e(this),i=e("<span/>",{class:"toggle-handle"});i.appendTo(t),a._initToggle(i,t,t.children("ul.filter-items"))}))}}},{key:"_initToggle",value:function(e,t,i){t.hasClass("closed")&&i.hide(),e.off("click").on("click",(function(e){e.stopPropagation(),e.preventDefault(),i.slideToggle(400,(function(){t.toggleClass("opened").toggleClass("closed")}))}))}},{key:"_initCustomInput",value:function(t){t.find(":input").each((function(){var t,i=e(this),a=i.attr("type"),n="".concat(a,"button");"checkbox"!==a&&"radio"!==a||i.closest(".".concat(n)).length||(i.is(":checked")&&(n+=" checked"),t=e("<span/>",{class:n}),i.wrap(t).on("change",(function(){var t=e(this);t.prop("checked")?t.parent().addClass("checked"):t.parent().removeClass("checked")})))}))}},{key:"_regiterStatus",value:function(){this.originalFilters=this.getFiltersProperties()}},{key:"_afterLayoutChange",value:function(){var t,i;this.isMobile?(this.$preset.addClass("filters-modal").attr("role","dialog").attr("tabindex","-1").hide(),this._addCloseModalButton(),this._addApplyFiltersModalButton(),this._switchToCollapsables(),null===(t=this.$filterButtons)||void 0===t||t.hide()):(this.$preset.removeClass("filters-modal").removeClass("open").removeAttr("role").removeAttr("tabindex").show(),e("body").css("overflow","auto").removeClass("yith-wcan-preset-modal-open"),this._removeCloseModalButton(),this._removeApplyFiltersModalButton(),this._switchBackCollapsables(),null===(i=this.$filterButtons)||void 0===i||i.show())}},{key:"_addCloseModalButton",value:function(){var t=e("<a/>",{class:"close-button",html:"&times;","data-dismiss":"modal","aria-label":yith_wcan_shortcodes.labels.close});t.prependTo(this.$preset).on("click",this.closeModal.bind(this)),this.modalElements.closeButton=t}},{key:"_removeCloseModalButton",value:function(){var e,t;null===(e=this.modalElements)||void 0===e||null===(t=e.closeButton)||void 0===t||t.remove()}},{key:"_addApplyFiltersModalButton",value:function(){var t=this,i=e("<button/>",{class:"apply-filters main-modal-button",html:yith_wcan_shortcodes.labels.show_results,"data-dismiss":"modal"});i.appendTo(this.$preset).on("click",(function(){t.filter(),t.closeModal()})),this.modalElements.applyFiltersButton=i}},{key:"_removeApplyFiltersModalButton",value:function(){var e,t;null===(e=this.modalElements)||void 0===e||null===(t=e.applyFiltersButton)||void 0===t||t.remove()}},{key:"_switchToCollapsables",value:function(){var t=this;this.getFilters().each((function(){var i=e(this),a=i.find(".filter-title");a.length&&!a.hasClass("collapsable")&&(a.addClass("collapsable").data("disable-collapse",!0),t._initTitleCollapsable(i))}))}},{key:"_switchBackCollapsables",value:function(){this.getFilters().each((function(){var t=e(this),i=t.find(".filter-title");i.length&&i.hasClass("collapsable")&&i.data("disable-collapse")&&(i.removeClass("collapsable").removeData("disable-collapse",!0).off("click"),t.find(".filter-content").show())}))}},{key:"_openAllCollapsables",value:function(){var t=this;this.$filters.not(".no-title").not((function(i,a){return t.isFilterActive(e(a))})).find(".filter-content").show().end().find(".filter-title").removeClass("closed").addClass("opened")}},{key:"_closeAllCollapsables",value:function(){var t=this;this.$filters.not(".no-title").not((function(i,a){return t.isFilterActive(e(a))})).find(".filter-content").hide().end().find(".filter-title").addClass("closed").removeClass("opened")}},{key:"maybeRegisterStatusChange",value:function(){var e=this.getFiltersProperties(),t=JSON.stringify(e),i=JSON.stringify(this.originalFilters);this.dirty=t!==i}},{key:"maybeFilter",value:function(e){if(this.maybeRegisterStatusChange(),yith_wcan_shortcodes.instant_filters&&!this.isMobile)this.filter();else if(yith_wcan_shortcodes.instant_filters||this.isMobile){if(this.isMobile&&this.dirty){var t;this.$preset.addClass("with-filter-button"),null===(t=this.modalElements.applyFiltersButton)||void 0===t||t.show()}}else{var i,a;this.dirty?null===(i=this.$filterButtons)||void 0===i||i.show():null===(a=this.$filterButtons)||void 0===a||a.hide()}}},{key:"filter",value:function(){var t,i,a,n=this,l=null===(t=window)||void 0===t?void 0:t.product_filter;null==l||null===(i=l.doFilter(this.getFiltersProperties(),this.target,this.preset))||void 0===i||i.done((function(){var t=e(n.preset);if(t.length&&yith_wcan_shortcodes.scroll_top){var i=t.offset().top;if(yith_wcan_shortcodes.scroll_target){var a=e(yith_wcan_shortcodes.scroll_target);i=a.length?a.offset().top:i}else n.isMobile&&(i=100);e("body, html").animate({scrollTop:i-100})}n.originalFilters=n.getFiltersProperties(),n.dirty=!1})),this.isMobile&&(this.$preset.removeClass("with-filter-button"),null===(a=this.modalElements.applyFiltersButton)||void 0===a||a.hide(),this.closeModal())}},{key:"getFilters",value:function(){return!1===this.$filters&&(this.$filters=this.$preset.find(".yith-wcan-filter")),this.$filters}},{key:"getActiveFilters",value:function(){return!1===this.activeFilters&&(this.activeFilters=this.getFiltersProperties()),this.activeFilters}},{key:"isAnyFilterActive",value:function(){return!!Object.keys(this.getActiveFilters()).length}},{key:"isFilterActive",value:function(e){var t,i;switch(e.data("filter-type")){case"tax":case"review":case"price_range":var a=e.find(".filter-dropdown");if(a.length){var n=a.val();t="object"===u(n)?!(null==n||!n.length):!!n;break}case"stock_sale":t=e.find(".filter-item").filter(".active").length;break;case"price_slider":var l=parseFloat(e.find(".price-slider").data("step")),r=parseFloat(e.find(".price-slider").data("min")),s=parseFloat(e.find(".price-slider").data("max")),o=parseFloat(e.find(".price-slider-min").val()),c=parseFloat(e.find(".price-slider-max").val());t=Math.abs(o-r)>=l||Math.abs(c-s)>=l;break;case"orderby":t="menu_order"!==e.find(".filter-order-by").val();break;default:t=!1}return t=void 0!==(i=e.triggerHandler("yith_wcan_is_filter_active",[t,this]))?i:t}},{key:"countActiveItems",value:function(e){var t;switch(e.data("filter-type")){case"tax":case"review":case"price_range":var i=e.find(".filter-dropdown");if(i.length){var a=i.val();t="object"===u(a)?null==a?void 0:a.length:+!!a;break}case"stock_sale":t=e.find(".filter-items").find(".active").length;break;case"orderby":this.isFilterActive(e)&&(t=1);break;case"price_slider":default:t=0}return t}},{key:"getFilterProperties",value:function(t){var i,a,n=t.data("filter-type"),l="yes"===t.data("multiple"),r=t.find(".filter-dropdown"),s={};switch(n){case"tax":var o=[],c=t.data("taxonomy"),h=0===c.indexOf("filter"),d=t.data("relation");if(r.length?l?o=r.val():o.push(r.val()):o=(a=t.find(".filter-item").filter(".active").children("a, label")).get().reduce((function(t,i){var a;return(a=(i=e(i)).is("label")?i.find(":input").val():i.data("term-slug"))?(t.push(a),t):t}),o),l){var u=h||"and"!==d?",":"+";s[c]=o.join(u)}else s[c]=o.pop();h&&(s[c.replace("filter_","query_type_")]=d);break;case"review":r.length?s.rating_filter=r.val():(a=t.find(".filter-item").filter(".active").children("a, label"),l?s.rating_filter=a.get().reduce((function(t,i){var a;return(a=(i=e(i)).is("label")?i.find(":input").val():i.data("rating"))?(t.push(a),t):t}),[]).join(","):(a=a.first(),s.rating_filter=a.is("label")?a.find(":input").val():a.data("rating")));break;case"price_range":r.length?l?s.price_ranges=r.val().join(","):(s.min_price=r.val().split("-")[0],s.max_price=r.val().split("-")[1]):(a=t.find(".filter-item").filter(".active").children("a, label"),l?s.price_ranges=a.get().reduce((function(t,i){var a=e(i).data("range-min"),n=e(i).data("range-max");return t+=(n?"".concat(a,"-").concat(n):a)+","}),"").replace(/^(.*),$/,"$1"):(s.min_price=parseFloat(a.first().data("range-min")),s.max_price=parseFloat(a.first().data("range-max"))));break;case"price_slider":s.min_price=parseFloat(t.find(".price-slider-min").val()),s.max_price=parseFloat(t.find(".price-slider-max").val());break;case"stock_sale":t.find(".filter-on-sale").is(".active")&&(s.onsale_filter=1),t.find(".filter-in-stock").is(".active")&&(s.instock_filter=1),t.find(".filter-featured").is(".active")&&(s.featured_filter=1);break;case"orderby":s.orderby=t.find(".filter-order-by").val()}return s=void 0!==(i=t.triggerHandler("yith_wcan_filter_properties",[s,self]))?i:s}},{key:"getFiltersProperties",value:function(){var t={},i=this;return this.getFilters().each((function(){var a=e(this);if(i.isFilterActive(a)){var n=i.getFilterProperties(a);t=i.mergeProperties(t,n,a)}})),t}},{key:"getFiltersByProperties",value:function(t){var i=this;return this.getFilters().filter((function(){var a=e(this);if(i.isFilterActive(a)){var n=i.getFilterProperties(a),l=!1;for(var r in t){if(["min_price","max_price","price_ranges"].includes(r)&&(n.min_price||n.price_ranges)){l=!0;break}if(n[r]){l=!0;break}}return l}return!1}))}},{key:"maybeToggleClearFilter",value:function(e){this.isFilterActive(e)?this.maybeShowClearFilter(e):this.maybeHideClearFilter(e)}},{key:"maybeToggleClearAllFilters",value:function(){this.isAnyFilterActive()?this.maybeShowClearAllFilters():this.maybeHideClearAllFilters()}},{key:"maybeShowClearFilter",value:function(t){var i=this;this.isFilterActive(t)&&yith_wcan_shortcodes.show_clear_filter&&(t.find(".clear-selection").remove(),e("<a/>",{class:"clear-selection",text:yith_wcan_shortcodes.labels.clear_selection,role:"button"}).prependTo(t.find(".filter-content")).on("click",(function(e){e.preventDefault(),i.deactivateFilter(t,!1,yith_wcan_shortcodes.instant_filters),i.maybeHideClearFilter(t),yith_wcan_shortcodes.instant_filters&&i.closeModal()})))}},{key:"maybeShowClearAllFilters",value:function(){var t=this;this.isAnyFilterActive()&&this.isMobile&&(this.$preset.find(".clear-selection").remove(),e("<a/>",{class:"clear-selection",text:yith_wcan_shortcodes.labels.clear_all_selections,role:"button"}).prependTo(this.$preset.find(".filters-container")).on("click",(function(e){e.preventDefault(),t.deactivateAllFilters(yith_wcan_shortcodes.instant_filters),t.maybeHideClearAllFilters(),yith_wcan_shortcodes.instant_filters&&t.closeModal()})))}},{key:"maybeHideClearFilter",value:function(e){!this.isFilterActive(e)&&yith_wcan_shortcodes.show_clear_filter&&e.find(".clear-selection").remove()}},{key:"maybeHideClearAllFilters",value:function(){this.isAnyFilterActive()||this.$preset.find(".filters-container").children(".clear-selection").remove()}},{key:"deactivateFilter",value:function(t,i,a){var n=t.data("filter-type"),l=t.find(".filter-item"),r=l.filter(".active"),s=t.find(".filter-dropdown");switch(n){case"tax":var o=t.data("taxonomy");s.length?(i?s.find("option").each((function(){var t=e(this);t.val().toString()===i[o].toString()&&t.prop("selected",!1)})):s.find("option").prop("selected",!1),s.change()):i?r.each((function(){var t=e(this),a=t.children("label"),n=t.children("a");(a.length?a.find(":input").val():n.data("term-slug")).toString()===i[o].toString()&&(t.children("label").children("a").click(),t.removeClass("active"))})):(r.children("label").children("a").click(),r.removeClass("active"));break;case"review":s.length?(i?s.find("option").each((function(){var t=e(this);t.val()===i.rating_filter&&t.prop("selected",!1)})):s.find("option").prop("selected",!1),s.change()):i?r.each((function(){var t=e(this),a=t.children("label"),n=t.children("a");(a.length?a.find(":input").val():n.data("rating"))===i.rating_filter&&(t.children("label").children("a").click(),t.removeClass("active"))})):(r.children("label").children("a").click(),r.removeClass("active"));break;case"price_range":s.length?(i?s.find("option").each((function(){var t=e(this),a=i.min_price+(i.max_price?"-".concat(i.max_price):"");t.val()===a&&t.prop("selected",!1)})):s.find("option").prop("selected",!1),s.change()):i?r.each((function(){var t,a,n=e(this),l=n.children("label"),r=n.children("a");a=l.length?l.find(":input").val():r.data("min_price")+(r.data("max_price")?"-"+r.data("max_price"):""),i.min_price?t=i.min_price+(i.max_price?"-"+i.max_price:""):i.price_ranges&&(t=i.price_ranges),a===t&&(n.children("label").children("a").click(),n.removeClass("active"))})):(r.children("label").children("a").click(),r.removeClass("active"));break;case"price_slider":var c=t.find(".price-slider");t.find(".price-slider-min").val(c.data("min")),t.find(".price-slider-max").val(c.data("max")).change();break;case"orderby":t.find("select").val("menu_order");break;case"stock_sale":i?(null!=i&&i.instock_filter&&t.find(".filter-in-stock").find(":input").prop("checked",!1).change().closest(".filter-item").removeClass("active"),null!=i&&i.onsale_filter&&t.find(".filter-on-sale").find(":input").prop("checked",!1).change().closest(".filter-item").removeClass("active"),null!=i&&i.featured_filter&&t.find(".filter-featured").find(":input").prop("checked",!1).change().closest(".filter-item").removeClass("active")):(t.find(".filter-in-stock").find(":input").prop("checked",!1).change(),t.find(".filter-on-sale").find(":input").prop("checked",!1).change(),t.find(".filter-featured").find(":input").prop("checked",!1).change(),l.removeClass("active"));break;default:l.removeClass("active")}this.activeFilters=!1,a&&this.filter()}},{key:"deactivateAllFilters",value:function(t){var i=this;return this.getFilters().each((function(){var t=e(this);i.deactivateFilter(t)})),this.activeFilters=!1,t&&this.filter(),!0}},{key:"deactivateFilterByProperties",value:function(t,i){var a=this,n=this.getFiltersByProperties(t);return!!n.length&&(n.each((function(){var n=e(this);a.deactivateFilter(n,t,i)})),!0)}},{key:"openModal",value:function(){var t=this;this.isMobile&&(yith_wcan_shortcodes.toggles_open_on_modal?this._openAllCollapsables():this._closeAllCollapsables(),e("body").css("overflow","hidden").addClass("yith-wcan-preset-modal-open"),this.$preset.show(),setTimeout((function(){t.$preset.addClass("open")}),100))}},{key:"closeModal",value:function(){var t=this;this.isMobile&&(this.$preset.removeClass("open"),setTimeout((function(){t.$preset.hide(),e("body").css("overflow","auto").removeClass("yith-wcan-preset-modal-open")}),300))}},{key:"formatPrice",value:function(e){var t,i,a,n;return"undefined"!=typeof accounting&&(e=accounting.formatMoney(e,{symbol:null===(t=yith_wcan_shortcodes.currency_format)||void 0===t?void 0:t.symbol,decimal:null===(i=yith_wcan_shortcodes.currency_format)||void 0===i?void 0:i.decimal,thousand:null===(a=yith_wcan_shortcodes.currency_format)||void 0===a?void 0:a.thousand,precision:0,format:null===(n=yith_wcan_shortcodes.currency_format)||void 0===n?void 0:n.format})),e}},{key:"mergeProperties",value:function(t,i,a){for(var n in i)if(i.hasOwnProperty(n)&&t[n]){switch(n){case"rating_filter":case"min_price":case"max_price":case"onsale_filter":case"instock_filter":case"orderby":t[n]=i[n];break;default:if(0===n.indexOf("query_type_"))t[n]=i[n];else{var l=0===n.indexOf("filter_"),r=l?",":"+",s=t[n].replace(",",r)+r+i[n].replace(",",r);if(s=s.split(r).filter((function(e,t,i){return i.indexOf(e)===t})).join(r),t[n]=s,l){var o=n.replace("filter_","query_type_");t[o]="and",i[o]="and"}}}delete i[n]}return e.extend(t,i),t}}])&&f(i.prototype,a),n&&f(i,n),t}();jQuery((function(e){e(document).on("yith_wcan_init_shortcodes yith_plugin_fw_gutenberg_success_do_shortcode",(function(){e(".yith-wcan-filters").not(".enhanced").each((function(){new v(e(this))})),e(".yith-wcan-reset-filters").not(".enhanced").each((function(){new r(e(this))}))})).trigger("yith_wcan_init_shortcodes"),globalThis.product_filter=new l}))})();
1
+ (()=>{"use strict";var e=jQuery,t=e("body");function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var l=function(){function l(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),n(this,"xhr",null),n(this,"doingAjax",!1),n(this,"originalSearch",location.search),n(this,"initialized",!1),n(this,"filtered",!1),this.initPopState(),this.initialized=!0}var r,s,o;return r=l,(s=[{key:"initPopState",value:function(){yith_wcan_shortcodes.reload_on_back&&(this.pushUrlToHistory(window.location,document.title,null,!0),e(window).on("popstate",(function(){var e;null!==(e=window.history.state)&&void 0!==e&&e._yithWcan&&window.location.reload(!0)})))}},{key:"doFilter",value:function(t,i,a){var n,l,r=this,s=e(i||"body");return(l=e(document).triggerHandler("yith_wcan_filters_parameters",[t]))&&(t=l),s&&this.block(s),n=this.buildUrl(t),yith_wcan_shortcodes.ajax_filters?(this.doingAjax=!0,this._doAjax(n).done((function(e){n=r.searchAlternativeUrl(e,n),r._beforeFilter(e,t),r.refreshFragments(i,a,e),r.pushUrlToHistory(n,e.pageTitle,t),r.originalSearch=location.search,s&&r.unblock(s),r._afterFilter(e,t),r.doingAjax=!1}))):(this.pushUrlToHistory(n,document.title,t),void(window.location=n))}},{key:"_beforeFilter",value:function(t,i){e(document).trigger("yith-wcan-ajax-loading",[t,i])}},{key:"_afterFilter",value:function(i,a){e(".woocommerce-ordering").on("change","select.orderby",(function(){e(this).closest("form").submit()})),this.filtered=a&&!!Object.keys(a).length,this.filtered?t.addClass("filtered"):t.removeClass("filtered"),e(window).trigger("scroll"),e(document).trigger("yith-wcan-ajax-filtered",[i,a]).trigger("yith_wcwl_reload_fragments")}},{key:"buildUrl",value:function(t){var a,n=this,l=yith_wcan_shortcodes.query_param,r={},s=window.location,o=yith_wcan_shortcodes.base_url?yith_wcan_shortcodes.base_url:(null==s?void 0:s.origin)+(null==s?void 0:s.pathname),c=this,h="object"===i(t)&&Object.keys(t).length;if(yith_wcan_shortcodes.session_param&&(o=o.replace(new RegExp("/"+yith_wcan_shortcodes.session_param+"/[^/]*/"),"")),h&&(r[l]=1),this.originalSearch){var d=this.originalSearch.replace("?","").split("&").reduce((function(e,t){var i=t.split("=");if(2===i.length){if(n.isFilterParam(i[0]))return e;e[i[0]]=i[1]}return e}),{});r=e.extend(r,d)}return h&&(r=e.extend(r,t)),(a=Object.keys(r).reduce((function(e,t){var i=r[t];return i&&t?e+=c._cleanParam(t)+"="+c._cleanParam(i)+"&":e}),"?").replace(/&$/g,"").replace(/%2B/g,"+").replace(/%2C/g,",")).length>1&&(o+=a),o}},{key:"searchAlternativeUrl",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=i;return-1===e.indexOf("yith_wcan:sharing_url")?a:a=(t=e.match(/<meta name="yith_wcan:sharing_url" content="([^"]*)">/))&&1 in t?t[1]:a}},{key:"pushUrlToHistory",value:function(e,t,i,a){if(yith_wcan_shortcodes.change_browser_url&&!navigator.userAgent.match(/msie/i)){var n="pushState";a&&(n="replaceState"),window.history[n]({_yithWcan:!0,pageTitle:t,filters:i},"",e)}}},{key:"refreshFragments",value:function(t,i,a){var n=document.createElement("html"),l=e(n);if(n.innerHTML=a,t){var r,s=e(i),o=e(t);s.length&&(r=l.find(i)).length&&s.replaceWith(r.first()),o.length&&(r=l.find(t)).length&&o.replaceWith(r.first())}else{var c=e(yith_wcan_shortcodes.content);c.length?c.replaceWith(l.find(yith_wcan_shortcodes.content)):e("body").replaceWith(l.find("body"))}e(document).trigger("yith_wcan_init_shortcodes")}},{key:"_cleanParam",value:function(e){var t,i;return null===(t=yith_wcan_shortcodes)||void 0===t||!t.process_sanitize||null!==(i=yith_wcan_shortcodes)&&void 0!==i&&i.skip_sanitize?e:encodeURIComponent(e)}},{key:"_doAjax",value:function(t,i){return this.xhr&&this.xhr.abort(),i=e.extend({url:t,headers:{"X-YITH-WCAN":1}},i),this.xhr=e.ajax(i),this.xhr}},{key:"block",value:function(t){var i;if(void 0!==e.fn.block){var a="#fff center center no-repeat";null!==(i=yith_wcan_shortcodes)&&void 0!==i&&i.loader&&(a="url('".concat(yith_wcan_shortcodes.loader,"') ").concat(a)),t.block({message:null,overlayCSS:{background:a,opacity:.7}})}}},{key:"unblock",value:function(t){void 0!==e.fn.unblock&&t.unblock()}},{key:"isFilterParam",value:function(t){var i,a=["rating_filter","min_price","max_price","price_ranges","onsale_filter","instock_filter","featured_filter","orderby","product-page",yith_wcan_shortcodes.query_param];return(i=e(document).triggerHandler("yith_wcan_supported_filters_parameters",[a]))&&(a=i),-1!==(a=a.concat(yith_wcan_shortcodes.supported_taxonomies.map((function(e){return e.replace("pa_","filter_")})))).indexOf(t)||-1!==t.indexOf("filter_")||-1!==t.indexOf("query_type_")}}])&&a(r.prototype,s),o&&a(r,o),l}();var r=function t(i){var a,n,l;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l=null,(n="$reset")in(a=this)?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,this.$reset=i,this.$reset.on("click",(function(t){t.preventDefault(),e(".yith-wcan-filters").each((function(){var t=e(this).data("preset");t.deactivateAllFilters(!0),t.closeModal()}))})),this.$reset.data("reset",this).addClass("enhanced")};function s(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var a=0,n=function(){};return{s:n,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return r=e.done,e},e:function(e){s=!0,l=e},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw l}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,a=new Array(t);i<t;i++)a[i]=e[i];return a}function c(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function h(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var d=function(){function t(i,a){var n,l,r,s;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),h(this,"$originalSelect",null),h(this,"$_main",null),h(this,"$_label",null),h(this,"$_dropdown",null),h(this,"$_search",null),h(this,"$_showMore",null),h(this,"$_items",null),h(this,"currentPage",1),h(this,"options",{}),this.$originalSelect=i,this.$originalSelect.is("select")){var o=this.$originalSelect.data("per_page"),c=this.$originalSelect.data("order"),d=this.$originalSelect.data("all-label"),u={showSearch:this.$originalSelect.data("show_search"),paginate:this.$originalSelect.data("paginate"),perPage:o||10,order:c||"ASC",getElements:null,labels:{emptyLabel:d||(null===(n=yith_wcan_shortcodes.labels)||void 0===n?void 0:n.empty_option),searchPlaceholder:null===(l=yith_wcan_shortcodes.labels)||void 0===l?void 0:l.search_placeholder,noItemsFound:null===(r=yith_wcan_shortcodes.labels)||void 0===r?void 0:r.no_items,showMore:null===(s=yith_wcan_shortcodes.labels)||void 0===s?void 0:s.show_more}};this.options=e.extend(u,a),this._hideSelect(),this._initTemplate(),this._initActions(),this.$originalSelect.data("dropdown",this).addClass("enhanced")}}var i,a,n;return i=t,(a=[{key:"_hideSelect",value:function(){this.$originalSelect.hide()}},{key:"_initTemplate",value:function(){var t=e("<div/>",{class:"yith-wcan-dropdown closed"}),i=e("<div/>",{class:"dropdown-label",html:this.getLabel()}),a=e("<div>",{class:"dropdown-wrapper"}),n=e("<ul/>",{class:"matching-items filter-items"});a.append(n),t.append(i).append(a),this.options.showSearch&&this._initSearchTemplate(a),this.options.paginate&&this._initShowMoreTemplate(a),this.$originalSelect.after(t),this.$_main=t,this.$_label=i,this.$_dropdown=a,this.$_items=n}},{key:"_initSearchTemplate",value:function(t){var i=e("<div/>",{class:"search-field-container"}),a=e("<input/>",{name:"s",class:"search-field",autocomplete:"off",type:"search",placeholder:this.options.labels.searchPlaceholder});i.append(a).prependTo(t),this.$_search=a}},{key:"_initShowMoreTemplate",value:function(t){var i,a=e("<a/>",{class:"show-more",text:null===(i=this.options.labels.showMore)||void 0===i?void 0:i.replace("%d",this.options.perPage)});a.on("click",this.loadNextPage.bind(this)).hide(),t.append(a),this.$_showMore=a}},{key:"_initActions",value:function(){var t,i,a=this;null===(t=this.$_main)||void 0===t||t.on("click",(function(e){e.stopPropagation(),a.toggleDropdown()})),this.$_dropdown.on("click",(function(e){e.stopPropagation()})),null===(i=this.$_search)||void 0===i||i.on("keyup search",(function(){a._populateItems()})),this.$_items.on("change",":input",(function(){var t,i=e(this).closest("li"),n=i.data("value");if(i.hasClass("disabled")&&!a.isValueSelected(n))return!1;i.toggleClass("active"),t=i.hasClass("active"),a._changeItemStatus(n,t)})),this.$_items.on("click","li:not(.checkbox) a",(function(t){var i,n=e(this).closest("li"),l=n.data("value");if(t.preventDefault(),n.hasClass("disabled")&&!a.isValueSelected(l))return!1;n.toggleClass("active"),(i=n.hasClass("active"))&&n.siblings().removeClass("active"),a._changeItemStatus(l,i)})),this.$_items.on("click","label > a",(function(t){var i=e(this).parent().find(":input");t.preventDefault(),(i.is('[type="radio"]')||i.is('[type="checkbox"]'))&&i.prop("checked",!i.prop("checked")),i.change()})),this.$originalSelect.on("change",(function(t,i){i||(a.$_items.find("li").each((function(){var t=e(this).data("value");a.isValueSelected(t)?a._selectItem(t):a._deselectItem(t)})),a.updateLabel())})),null!==globalThis&&void 0!==globalThis&&globalThis.yith_wcan_dropdown_init||(e(document).on("click",this._closeAllDropdowns),globalThis.yith_wcan_dropdown_init=!0)}},{key:"openDropdown",value:function(){var e;null===(e=this.$_main)||void 0===e||e.addClass("open").removeClass("closed"),this._afterDropdownOpen()}},{key:"closeDropdown",value:function(){var e;null===(e=this.$_main)||void 0===e||e.removeClass("open").addClass("closed")}},{key:"_closeAllDropdowns",value:function(){e(document).find("select.enhanced").filter((function(t,i){return!!e(i).data("dropdown")})).each((function(){e(this).data("dropdown").closeDropdown()}))}},{key:"_closeOtherDropdowns",value:function(){var t=this;e(document).find("select.enhanced").filter((function(i,a){var n=e(a);return!!n.data("dropdown")&&!n.is(t.$originalSelect)})).each((function(){e(this).data("dropdown").closeDropdown()}))}},{key:"toggleDropdown",value:function(){var e,t;null===(e=this.$_main)||void 0===e||e.toggleClass("open").toggleClass("closed"),null!==(t=this.$_main)&&void 0!==t&&t.hasClass("open")&&this._afterDropdownOpen()}},{key:"_afterDropdownOpen",value:function(){var e;this._closeOtherDropdowns(),null!==(e=this.$_search)&&void 0!==e&&e.length&&this.$_search.val(""),this._populateItems()}},{key:"getMatchingElements",value:function(t,i){var a=this,n=[],l=this.getOptions();return new Promise((function(r){l.each((function(){var i=e(this),a=i.val(),l=i.html(),r=new RegExp(".*"+t+".*","i");(!t||r.test(a)||r.test(l))&&n.push({value:a,label:l})})),a.options.getElements?a.options.getElements(t).then((function(t){t&&(t=t.reduce((function(e,t,i){return e.push({label:i,value:t}),e}),[]),n=e.extend(n,t)),r(a._formatItems(n,i))})):r(a._formatItems(n,i))}))}},{key:"_formatItems",value:function(e,t){var i=this,a=[],n=!1;return e.filter((function(e){return-1===a.indexOf(e.value)&&(a.push(e.value),!0)})).sort((function(e,t){var a="ASC"===i.options.order?1:-1;return e.value<t.value?-1*a:e.value>t.value?a:0})),t&&(n=t<Object.keys(e).length,e=e.slice(0,t)),{items:e,hasMore:n}}},{key:"_generateItem",value:function(t,i){var a,n=this.isValueSelected(t),l=this.getOptionByValue(t),r=e("<li/>",{"data-value":t,class:l.length?l.attr("class"):""});if(l.length){var s=l.data("template"),o=l.data("count");i=s||i,o&&(i+=o)}if(a=e("<a/>",{href:l.length?l.data("filter_url"):"#",html:i,rel:"nofollow","data-title":l.length?l.data("title"):""}),this.$originalSelect.prop("multiple")){var c=e("<input/>",{type:"checkbox",value:t}),h=e("<label>");c.prop("checked",n),h.prepend(c).append(a),r.append(h).addClass("checkbox")}else r.append(a);return n?r.addClass("active"):r.removeClass("active"),r}},{key:"_populateItems",value:function(t){var i,a,n=this,l=null!==(i=this.$_search)&&void 0!==i&&i.length?this.$_search.val():"",r=this.options.paginate?this.options.perPage:0;a=(t=t?parseInt(t):1)*r,this.getMatchingElements(l,a).then((function(i){var a=i.items,l=[],r=!1;if(n._emptyItems(),n._hideLoadMore(),a.length){var o,c=s(a);try{for(c.s();!(o=c.n()).done;){var h=o.value;""===h.value?l.unshift(n._generateItem(h.value,h.label)):l.push(n._generateItem(h.value,h.label))}}catch(e){c.e(e)}finally{c.f()}n.currentPage=t,r=i.hasMore}else l.push(e("<li/>",{text:n.options.labels.noItemsFound})),n.currentPage=1;n.$_items.append(l),n.$originalSelect.trigger("yith_wcan_dropdown_updated"),r&&n._showLoadMore()}))}},{key:"loadNextPage",value:function(){var e=this.currentPage+1;this._populateItems(e)}},{key:"_selectItem",value:function(e){return this._changeItemStatus(e,!0)}},{key:"_deselectItem",value:function(e){return this._changeItemStatus(e,!1)}},{key:"_changeItemStatus",value:function(e,t){var i=this.$originalSelect.find('option[value="'.concat(e,'"]'));return!!i.length&&(i.prop("selected",t),this.closeDropdown(),this.updateLabel(),this.$originalSelect.trigger("change",[!0]),!0)}},{key:"_emptyItems",value:function(){this.$_items.html("")}},{key:"_showLoadMore",value:function(){this.$_showMore.show()}},{key:"_hideLoadMore",value:function(){this.$_showMore.hide()}},{key:"getLabel",value:function(){return this.hasSelectedValues()?this.getSelectedLabels().join(", "):this.options.labels.emptyLabel}},{key:"updateLabel",value:function(){var e,t=this.getLabel();null===(e=this.$_label)||void 0===e||e.html(t)}},{key:"getOptions",value:function(){return this.$originalSelect.find("option")}},{key:"hasSelectedValues",value:function(){return this.getSelectedOptions().length}},{key:"isValueSelected",value:function(e){return-1!==this.getSelectedValues().indexOf(e.toString())}},{key:"getSelectedOptions",value:function(){return this.$originalSelect.find("option").filter(":selected")}},{key:"getOptionByValue",value:function(e){return this.$originalSelect.find('option[value="'.concat(e,'"]'))}},{key:"getSelectedLabels",value:function(){var t=[];return this.getSelectedOptions().each((function(){var i=e(this),a=i.data("template");a=a||i.html().replace(/\([0-9]*\)/,""),t.push(a)})),t}},{key:"getSelectedValues",value:function(){var t=[];return this.getSelectedOptions().each((function(){t.push(e(this).val())})),t}},{key:"destroy",value:function(){}}])&&c(i.prototype,a),n&&c(i,n),t}();function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function p(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var v=function(){function t(i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),p(this,"preset",!1),p(this,"$preset",!1),p(this,"target",!1),p(this,"$target",!1),p(this,"$filters",!1),p(this,"$filterButtons",!1),p(this,"modalElements",{}),p(this,"activeFilters",!1),p(this,"isMobile",!1),p(this,"sliderTimeout",!1),p(this,"originalFilters",null),p(this,"dirty",!1),this.preset="#"+i.attr("id"),this.$preset=i,this.target=this.$preset.data("target"),this.$target=!!this.target&&e(this.target),this._regiterStatus(),this._initFilterButton(),this._initResponsive(),this._initFilters(),this._initActions(),this.$preset.data("preset",this).addClass("enhanced").trigger("yith_wcan_preset_initialized",[this])}var i,a,n;return i=t,(a=[{key:"_initFilters",value:function(){var t=this;this.getFilters().each((function(){var i=e(this);t._initFilter(i)})),this.maybeShowClearAllFilters()}},{key:"_initFilterButton",value:function(){var e=this;this.$filterButtons=this.$preset.find(".apply-filters"),this.$filterButtons.length&&this.$filterButtons.on("click",(function(t){t.preventDefault(),e.filter()})).hide()}},{key:"_initActions",value:function(){this.$preset.find("form").on("submit",(function(e){e.preventDefault()}))}},{key:"_initResponsive",value:function(){var t=this;if(yith_wcan_shortcodes.modal_on_mobile){var i=window.matchMedia("(max-width: ".concat(yith_wcan_shortcodes.mobile_media_query,"px)"));e(window).on("resize",(function(){var e=!!i.matches;e!==t.isMobile&&(t.isMobile=e,t._afterLayoutChange())})).resize()}}},{key:"_initFilter",value:function(t){var i,a=this,n=function(i){var n=e(this),l=n.closest(".yith-wcan-filter"),r=!!l.length&&"yes"===l.data("multiple"),s=n.closest(".filter-item"),o=s.length?l.find(".filter-item").not(s):[];if(s.is(".disabled")&&!s.is(".active"))return i.preventDefault(),!1;i.preventDefault(),o.length&&!r&&o.removeClass("active").children("label").find(":input").prop("checked",!1).parent(".checked").removeClass("checked"),s.length&&s.toggleClass("active"),a.activeFilters=!1,a.maybeFilter(t),a.maybeToggleClearAllFilters(),a.maybeToggleClearFilter(l)};t.find(".filter-item").not(".checkbox").not(".radio").on("click","a",(function(t){var i=e(this).closest(".filter-item");if(!e(null==t?void 0:t.delegateTarget).is(i))return!1;n.call(this,t)})),t.find(":input").on("change",(function(t){var i=e(this),a=i.closest(".filter-item");if(a.is(".disabled")&&!a.is(".active"))return i.prop("checked",!1),!1;n.call(this,t)})),t.find("label > a").on("click",(function(t){var i=e(this),a=i.closest(".filter-item");if(t.preventDefault(),a.is(".disabled")&&!a.is(".active"))return!1;var n=i.parent().find(":input");(n.is('[type="radio"]')||n.is('[type="checkbox"]'))&&n.prop("checked",!n.prop("checked")),n.change()})),this._initTooltip(t),this._initPriceSlider(t),this._initDropdown(t),this._initCollapsable(t),this.maybeShowClearFilter(t),null!==(i=this.$preset)&&void 0!==i&&i.hasClass("custom-style")&&(this._initCustomInput(t),t.on("yith_wcan_dropdown_updated",(function(){var t=e(this).closest(".yith-wcan-filter");a._initCustomInput(t)})))}},{key:"_initTooltip",value:function(t,i){t.find("[data-title]").each((function(){var t=e(this);!t.hasClass("tooltip-added")&&t.data("title")&&(t.on("mouseenter",(function(){var t,a=e(this),n=null,l=a.outerWidth(),r=0;if(!i||"top"!==i&&"right"!==i){var s=a.closest(".filter-item");i=s.hasClass("color")||s.hasClass("label")?"top":"right"}n=e("<span>",{class:"yith-wcan-tooltip",html:a.data("title")}),a.append(n),t=n.outerWidth()+6,n.outerWidth(t),r="top"===i?(l-t)/2:l+15,n.css({left:r.toFixed(0)+"px"}).fadeIn(200),a.addClass("with-tooltip")})).on("mouseleave",(function(){var t=e(this);t.find(".yith-wcan-tooltip").fadeOut(200,(function(){t.removeClass("with-tooltip").find(".yith-wcan-tooltip").remove()}))})),t.addClass("tooltip-added"))}))}},{key:"_initDropdown",value:function(t){var i=t.find("select.filter-dropdown");i.length&&(i.hasClass("select2-hidden-accessible")&&void 0!==e.fn.selectWoo&&i.selectWoo("destroy"),this._initDropdownObject(i,{paginate:!0,perPage:yith_wcan_shortcodes.terms_per_page}))}},{key:"_initDropdownObject",value:function(e,t){return new d(e,t)}},{key:"_initPriceSlider",value:function(e){var t=this;if(e.hasClass("filter-price-slider")){var i=this,a=e.find(".price-slider"),n=a.find(".price-slider-min"),l=a.find(".price-slider-max"),r=parseFloat(a.data("min")),s=parseFloat(a.data("max")),o=parseFloat(n.val()),c=parseFloat(l.val()),h=parseFloat(a.data("step")),d=function(){i.sliderTimeout&&clearTimeout(i.sliderTimeout),i.sliderTimeout=setTimeout((function(){i.maybeFilter(e)}),200)};e.find(".price-slider-ui").ionRangeSlider({skin:"round",type:"double",min:r,max:s,step:h,from:o,to:c,min_interval:h,values_separator:" - ",prettify:function(e){return t.formatPrice(e)},onChange:function(e){n.val(e.from),l.val(e.to)},onFinish:d}),n.add(l).off("change").on("keyup",(function(){n.val()&&l.val()&&d()}))}}},{key:"_initCollapsable",value:function(e){this._initTitleCollapsable(e),this._initHierarchyCollapsable(e)}},{key:"_initTitleCollapsable",value:function(e){var t=e.find(".collapsable");t.length&&this._initToggle(t,t,e.find(".filter-content"))}},{key:"_initHierarchyCollapsable",value:function(t){var i=t.find(".hierarchy-collapsable");if(i.length){var a=this,n=t.find(".active");n.length&&(n.parents(".hierarchy-collapsable").removeClass("closed").addClass("opened"),n.hasClass("hierarchy-collapsable")&&yith_wcan_shortcodes.show_current_children&&n.removeClass("closed").addClass("opened")),i.each((function(){var t=e(this),i=e("<span/>",{class:"toggle-handle"});i.appendTo(t),a._initToggle(i,t,t.children("ul.filter-items"))}))}}},{key:"_initToggle",value:function(e,t,i){t.hasClass("closed")&&i.hide(),e.off("click").on("click",(function(e){e.stopPropagation(),e.preventDefault(),i.slideToggle(400,(function(){t.toggleClass("opened").toggleClass("closed")}))}))}},{key:"_initCustomInput",value:function(t){t.find(":input").each((function(){var t,i=e(this),a=i.attr("type"),n="".concat(a,"button");"checkbox"!==a&&"radio"!==a||i.closest(".".concat(n)).length||(i.is(":checked")&&(n+=" checked"),t=e("<span/>",{class:n}),i.wrap(t).on("change",(function(){var t=e(this);t.prop("checked")?t.parent().addClass("checked"):t.parent().removeClass("checked")})))}))}},{key:"_regiterStatus",value:function(){this.originalFilters=this.getFiltersProperties()}},{key:"_afterLayoutChange",value:function(){var t,i;this.isMobile?(this.$preset.addClass("filters-modal").attr("role","dialog").attr("tabindex","-1").hide(),this._addCloseModalButton(),this._addApplyFiltersModalButton(),this._switchToCollapsables(),null===(t=this.$filterButtons)||void 0===t||t.hide()):(this.$preset.removeClass("filters-modal").removeClass("open").removeAttr("role").removeAttr("tabindex").show(),e("body").css("overflow","auto").removeClass("yith-wcan-preset-modal-open"),this._removeCloseModalButton(),this._removeApplyFiltersModalButton(),this._switchBackCollapsables(),null===(i=this.$filterButtons)||void 0===i||i.show())}},{key:"_addCloseModalButton",value:function(){var t=e("<a/>",{class:"close-button",html:"&times;","data-dismiss":"modal","aria-label":yith_wcan_shortcodes.labels.close});t.prependTo(this.$preset).on("click",this.closeModal.bind(this)),this.modalElements.closeButton=t}},{key:"_removeCloseModalButton",value:function(){var e,t;null===(e=this.modalElements)||void 0===e||null===(t=e.closeButton)||void 0===t||t.remove()}},{key:"_addApplyFiltersModalButton",value:function(){var t=this,i=e("<button/>",{class:"apply-filters main-modal-button",html:yith_wcan_shortcodes.labels.show_results,"data-dismiss":"modal"});i.appendTo(this.$preset).on("click",(function(){t.filter(),t.closeModal()})),this.modalElements.applyFiltersButton=i}},{key:"_removeApplyFiltersModalButton",value:function(){var e,t;null===(e=this.modalElements)||void 0===e||null===(t=e.applyFiltersButton)||void 0===t||t.remove()}},{key:"_switchToCollapsables",value:function(){var t=this;this.getFilters().each((function(){var i=e(this),a=i.find(".filter-title");a.length&&!a.hasClass("collapsable")&&(a.addClass("collapsable").data("disable-collapse",!0),t._initTitleCollapsable(i))}))}},{key:"_switchBackCollapsables",value:function(){this.getFilters().each((function(){var t=e(this),i=t.find(".filter-title");i.length&&i.hasClass("collapsable")&&i.data("disable-collapse")&&(i.removeClass("collapsable").removeData("disable-collapse",!0).off("click"),t.find(".filter-content").show())}))}},{key:"_openAllCollapsables",value:function(){var t=this;this.$filters.not(".no-title").not((function(i,a){return t.isFilterActive(e(a))})).find(".filter-content").show().end().find(".filter-title").removeClass("closed").addClass("opened")}},{key:"_closeAllCollapsables",value:function(){var t=this;this.$filters.not(".no-title").not((function(i,a){return t.isFilterActive(e(a))})).find(".filter-content").hide().end().find(".filter-title").addClass("closed").removeClass("opened")}},{key:"maybeRegisterStatusChange",value:function(){var e=this.getFiltersProperties(),t=JSON.stringify(e),i=JSON.stringify(this.originalFilters);this.dirty=t!==i}},{key:"maybeFilter",value:function(e){if(this.maybeRegisterStatusChange(),yith_wcan_shortcodes.instant_filters&&!this.isMobile)this.filter();else if(yith_wcan_shortcodes.instant_filters||this.isMobile){if(this.isMobile&&this.dirty){var t;this.$preset.addClass("with-filter-button"),null===(t=this.modalElements.applyFiltersButton)||void 0===t||t.show()}}else{var i,a;this.dirty?null===(i=this.$filterButtons)||void 0===i||i.show():null===(a=this.$filterButtons)||void 0===a||a.hide()}}},{key:"filter",value:function(){var t,i,a,n=this,l=null===(t=window)||void 0===t?void 0:t.product_filter;null==l||null===(i=l.doFilter(this.getFiltersProperties(),this.target,this.preset))||void 0===i||i.done((function(){var t=e(n.preset);if(t.length&&yith_wcan_shortcodes.scroll_top){var i=t.offset().top;if(yith_wcan_shortcodes.scroll_target){var a=e(yith_wcan_shortcodes.scroll_target);i=a.length?a.offset().top:i}else n.isMobile&&(i=100);e("body, html").animate({scrollTop:i-100})}n.originalFilters=n.getFiltersProperties(),n.dirty=!1})),this.isMobile&&(this.$preset.removeClass("with-filter-button"),null===(a=this.modalElements.applyFiltersButton)||void 0===a||a.hide(),this.closeModal())}},{key:"getFilters",value:function(){return!1===this.$filters&&(this.$filters=this.$preset.find(".yith-wcan-filter")),this.$filters}},{key:"getActiveFilters",value:function(){return!1===this.activeFilters&&(this.activeFilters=this.getFiltersProperties()),this.activeFilters}},{key:"isAnyFilterActive",value:function(){return!!Object.keys(this.getActiveFilters()).length}},{key:"isFilterActive",value:function(e){var t,i;switch(e.data("filter-type")){case"tax":case"review":case"price_range":var a=e.find(".filter-dropdown");if(a.length){var n=a.val();t="object"===u(n)?!(null==n||!n.length):!!n;break}case"stock_sale":t=e.find(".filter-item").filter(".active").length;break;case"price_slider":var l=parseFloat(e.find(".price-slider").data("step")),r=parseFloat(e.find(".price-slider").data("min")),s=parseFloat(e.find(".price-slider").data("max")),o=parseFloat(e.find(".price-slider-min").val()),c=parseFloat(e.find(".price-slider-max").val());t=Math.abs(o-r)>=l||Math.abs(c-s)>=l;break;case"orderby":t="menu_order"!==e.find(".filter-order-by").val();break;default:t=!1}return t=void 0!==(i=e.triggerHandler("yith_wcan_is_filter_active",[t,this]))?i:t}},{key:"countActiveItems",value:function(e){var t;switch(e.data("filter-type")){case"tax":case"review":case"price_range":var i=e.find(".filter-dropdown");if(i.length){var a=i.val();t="object"===u(a)?null==a?void 0:a.length:+!!a;break}case"stock_sale":t=e.find(".filter-items").find(".active").length;break;case"orderby":this.isFilterActive(e)&&(t=1);break;case"price_slider":default:t=0}return t}},{key:"getFilterProperties",value:function(t){var i,a,n=t.data("filter-type"),l="yes"===t.data("multiple"),r=t.find(".filter-dropdown"),s={};switch(n){case"tax":var o=[],c=t.data("taxonomy"),h=0===c.indexOf("filter"),d=t.data("relation");if(r.length?l?o=r.val():o.push(r.val()):o=(a=t.find(".filter-item").filter(".active").children("a, label")).get().reduce((function(t,i){var a;return(a=(i=e(i)).is("label")?i.find(":input").val():i.data("term-slug"))?(t.push(a),t):t}),o),l){var u=h||"and"!==d?",":"+";s[c]=o.join(u)}else s[c]=o.pop();h&&(s[c.replace("filter_","query_type_")]=d);break;case"review":r.length?s.rating_filter=r.val():(a=t.find(".filter-item").filter(".active").children("a, label"),l?s.rating_filter=a.get().reduce((function(t,i){var a;return(a=(i=e(i)).is("label")?i.find(":input").val():i.data("rating"))?(t.push(a),t):t}),[]).join(","):(a=a.first(),s.rating_filter=a.is("label")?a.find(":input").val():a.data("rating")));break;case"price_range":r.length?l?s.price_ranges=r.val().join(","):(s.min_price=r.val().split("-")[0],s.max_price=r.val().split("-")[1]):(a=t.find(".filter-item").filter(".active").children("a, label"),l?s.price_ranges=a.get().reduce((function(t,i){var a=e(i).data("range-min"),n=e(i).data("range-max");return t+=(n?"".concat(a,"-").concat(n):a)+","}),"").replace(/^(.*),$/,"$1"):(s.min_price=parseFloat(a.first().data("range-min")),s.max_price=parseFloat(a.first().data("range-max"))));break;case"price_slider":s.min_price=parseFloat(t.find(".price-slider-min").val()),s.max_price=parseFloat(t.find(".price-slider-max").val());break;case"stock_sale":t.find(".filter-on-sale").is(".active")&&(s.onsale_filter=1),t.find(".filter-in-stock").is(".active")&&(s.instock_filter=1),t.find(".filter-featured").is(".active")&&(s.featured_filter=1);break;case"orderby":s.orderby=t.find(".filter-order-by").val()}return s=void 0!==(i=t.triggerHandler("yith_wcan_filter_properties",[s,self]))?i:s}},{key:"getFiltersProperties",value:function(){var t={},i=this;return this.getFilters().each((function(){var a=e(this);if(i.isFilterActive(a)){var n=i.getFilterProperties(a);t=i.mergeProperties(t,n,a)}})),t}},{key:"getFiltersByProperties",value:function(t){var i=this;return this.getFilters().filter((function(){var a=e(this);if(i.isFilterActive(a)){var n=i.getFilterProperties(a),l=!1;for(var r in t){if(["min_price","max_price","price_ranges"].includes(r)&&(n.min_price||n.price_ranges)){l=!0;break}if(n[r]){l=!0;break}}return l}return!1}))}},{key:"maybeToggleClearFilter",value:function(e){this.isFilterActive(e)?this.maybeShowClearFilter(e):this.maybeHideClearFilter(e)}},{key:"maybeToggleClearAllFilters",value:function(){this.isAnyFilterActive()?this.maybeShowClearAllFilters():this.maybeHideClearAllFilters()}},{key:"maybeShowClearFilter",value:function(t){var i=this;this.isFilterActive(t)&&yith_wcan_shortcodes.show_clear_filter&&(t.find(".clear-selection").remove(),e("<a/>",{class:"clear-selection",text:yith_wcan_shortcodes.labels.clear_selection,role:"button"}).prependTo(t.find(".filter-content")).on("click",(function(e){e.preventDefault(),i.deactivateFilter(t,!1,yith_wcan_shortcodes.instant_filters),i.maybeHideClearFilter(t),yith_wcan_shortcodes.instant_filters&&i.closeModal()})))}},{key:"maybeShowClearAllFilters",value:function(){var t=this;this.isAnyFilterActive()&&this.isMobile&&(this.$preset.find(".clear-selection").remove(),e("<a/>",{class:"clear-selection",text:yith_wcan_shortcodes.labels.clear_all_selections,role:"button"}).prependTo(this.$preset.find(".filters-container")).on("click",(function(e){e.preventDefault(),t.deactivateAllFilters(yith_wcan_shortcodes.instant_filters),t.maybeHideClearAllFilters(),yith_wcan_shortcodes.instant_filters&&t.closeModal()})))}},{key:"maybeHideClearFilter",value:function(e){!this.isFilterActive(e)&&yith_wcan_shortcodes.show_clear_filter&&e.find(".clear-selection").remove()}},{key:"maybeHideClearAllFilters",value:function(){this.isAnyFilterActive()||this.$preset.find(".filters-container").children(".clear-selection").remove()}},{key:"deactivateFilter",value:function(t,i,a){var n=t.data("filter-type"),l=t.find(".filter-item"),r=l.filter(".active"),s=t.find(".filter-dropdown");switch(n){case"tax":var o=t.data("taxonomy");s.length?(i?s.find("option").each((function(){var t=e(this);t.val().toString()===i[o].toString()&&t.prop("selected",!1)})):s.find("option").prop("selected",!1),s.change()):i?r.each((function(){var t=e(this),a=t.children("label"),n=t.children("a");(a.length?a.find(":input").val():n.data("term-slug")).toString()===i[o].toString()&&(t.children("label").children("a").click(),t.removeClass("active"))})):(r.children("label").children("a").click(),r.removeClass("active"));break;case"review":s.length?(i?s.find("option").each((function(){var t=e(this);t.val()===i.rating_filter&&t.prop("selected",!1)})):s.find("option").prop("selected",!1),s.change()):i?r.each((function(){var t=e(this),a=t.children("label"),n=t.children("a");(a.length?a.find(":input").val():n.data("rating"))===i.rating_filter&&(t.children("label").children("a").click(),t.removeClass("active"))})):(r.children("label").children("a").click(),r.removeClass("active"));break;case"price_range":s.length?(i?s.find("option").each((function(){var t=e(this),a=i.min_price+(i.max_price?"-".concat(i.max_price):"");t.val()===a&&t.prop("selected",!1)})):s.find("option").prop("selected",!1),s.change()):i?r.each((function(){var t,a,n=e(this),l=n.children("label"),r=n.children("a");a=l.length?l.find(":input").val():r.data("min_price")+(r.data("max_price")?"-"+r.data("max_price"):""),i.min_price?t=i.min_price+(i.max_price?"-"+i.max_price:""):i.price_ranges&&(t=i.price_ranges),a===t&&(n.children("label").children("a").click(),n.removeClass("active"))})):(r.children("label").children("a").click(),r.removeClass("active"));break;case"price_slider":var c=t.find(".price-slider");t.find(".price-slider-min").val(c.data("min")),t.find(".price-slider-max").val(c.data("max")).change();break;case"orderby":t.find("select").val("menu_order");break;case"stock_sale":i?(null!=i&&i.instock_filter&&t.find(".filter-in-stock").find(":input").prop("checked",!1).change().closest(".filter-item").removeClass("active"),null!=i&&i.onsale_filter&&t.find(".filter-on-sale").find(":input").prop("checked",!1).change().closest(".filter-item").removeClass("active"),null!=i&&i.featured_filter&&t.find(".filter-featured").find(":input").prop("checked",!1).change().closest(".filter-item").removeClass("active")):(t.find(".filter-in-stock").find(":input").prop("checked",!1).change(),t.find(".filter-on-sale").find(":input").prop("checked",!1).change(),t.find(".filter-featured").find(":input").prop("checked",!1).change(),l.removeClass("active"));break;default:l.removeClass("active")}this.activeFilters=!1,a&&this.filter()}},{key:"deactivateAllFilters",value:function(t){var i=this;return this.getFilters().each((function(){var t=e(this);i.deactivateFilter(t)})),this.activeFilters=!1,t&&this.filter(),!0}},{key:"deactivateFilterByProperties",value:function(t,i){var a=this,n=this.getFiltersByProperties(t);return!!n.length&&(n.each((function(){var n=e(this);a.deactivateFilter(n,t,i)})),!0)}},{key:"openModal",value:function(){var t=this;this.isMobile&&(yith_wcan_shortcodes.toggles_open_on_modal?this._openAllCollapsables():this._closeAllCollapsables(),e("body").css("overflow","hidden").addClass("yith-wcan-preset-modal-open"),this.$preset.show(),setTimeout((function(){t.$preset.addClass("open")}),100))}},{key:"closeModal",value:function(){var t=this;this.isMobile&&(this.$preset.removeClass("open"),setTimeout((function(){t.$preset.hide(),e("body").css("overflow","auto").removeClass("yith-wcan-preset-modal-open")}),300))}},{key:"formatPrice",value:function(e){var t,i,a,n;return"undefined"!=typeof accounting&&(e=accounting.formatMoney(e,{symbol:null===(t=yith_wcan_shortcodes.currency_format)||void 0===t?void 0:t.symbol,decimal:null===(i=yith_wcan_shortcodes.currency_format)||void 0===i?void 0:i.decimal,thousand:null===(a=yith_wcan_shortcodes.currency_format)||void 0===a?void 0:a.thousand,precision:0,format:null===(n=yith_wcan_shortcodes.currency_format)||void 0===n?void 0:n.format})),e}},{key:"mergeProperties",value:function(t,i,a){for(var n in i)if(i.hasOwnProperty(n)&&t[n]){switch(n){case"rating_filter":case"min_price":case"max_price":case"onsale_filter":case"instock_filter":case"orderby":t[n]=i[n];break;default:if(0===n.indexOf("query_type_"))t[n]=i[n];else{var l=0===n.indexOf("filter_"),r=l?",":"+",s=t[n].replace(",",r)+r+i[n].replace(",",r);if(s=s.split(r).filter((function(e,t,i){return i.indexOf(e)===t})).join(r),t[n]=s,l){var o=n.replace("filter_","query_type_");t[o]="and",i[o]="and"}}}delete i[n]}return e.extend(t,i),t}}])&&f(i.prototype,a),n&&f(i,n),t}();jQuery((function(e){e(document).on("yith_wcan_init_shortcodes yith_plugin_fw_gutenberg_success_do_shortcode",(function(){e(".yith-wcan-filters").not(".enhanced").each((function(){new v(e(this))})),e(".yith-wcan-reset-filters").not(".enhanced").each((function(){new r(e(this))}))})).trigger("yith_wcan_init_shortcodes"),globalThis.product_filter=new l}))})();
init.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/
5
  * Description: <code><strong>YITH WooCommerce AJAX Product Filter</strong></code> allows your users to find the product they are looking for as quickly as possible. Thanks to the plugin you will be able to set up one or more search filters for your WooCommerce products and improve the user experience of your shop. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>
6
- * Version: 4.14.0
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-navigation
10
  * Domain Path: /languages/
11
  *
12
- * WC requires at least: 6.7
13
- * WC tested up to: 6.9
14
  *
15
  * @author YITH
16
  * @package YITH\AjaxProductFilter
@@ -45,7 +45,7 @@ if ( ! defined( 'ABSPATH' ) ) {
45
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
46
  ! defined( 'YITH_WCAN_INC' ) && define( 'YITH_WCAN_INC', YITH_WCAN_DIR . 'includes/' );
47
  ! defined( 'YITH_WCAN_ASSETS' ) && define( 'YITH_WCAN_ASSETS', YITH_WCAN_URL . 'assets/' );
48
- ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '4.14.0' );
49
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
50
  ! defined( 'YITH_WCAN_SLUG' ) && define( 'YITH_WCAN_SLUG', 'yith-woocommerce-ajax-navigation' );
51
  ! defined( 'YITH_WCAN_INIT' ) && define( 'YITH_WCAN_INIT', plugin_basename( __FILE__ ) );
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/
5
  * Description: <code><strong>YITH WooCommerce AJAX Product Filter</strong></code> allows your users to find the product they are looking for as quickly as possible. Thanks to the plugin you will be able to set up one or more search filters for your WooCommerce products and improve the user experience of your shop. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>
6
+ * Version: 4.15.0
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-navigation
10
  * Domain Path: /languages/
11
  *
12
+ * WC requires at least: 6.8
13
+ * WC tested up to: 7.0
14
  *
15
  * @author YITH
16
  * @package YITH\AjaxProductFilter
45
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
46
  ! defined( 'YITH_WCAN_INC' ) && define( 'YITH_WCAN_INC', YITH_WCAN_DIR . 'includes/' );
47
  ! defined( 'YITH_WCAN_ASSETS' ) && define( 'YITH_WCAN_ASSETS', YITH_WCAN_URL . 'assets/' );
48
+ ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '4.15.0' );
49
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
50
  ! defined( 'YITH_WCAN_SLUG' ) && define( 'YITH_WCAN_SLUG', 'yith-woocommerce-ajax-navigation' );
51
  ! defined( 'YITH_WCAN_INIT' ) && define( 'YITH_WCAN_INIT', plugin_basename( __FILE__ ) );
languages/yith-woocommerce-ajax-navigation.pot CHANGED
@@ -5,7 +5,7 @@ msgstr ""
5
  "Project-Id-Version: YITH WooCommerce Ajax Navigation\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/yith-woocommerce-ajax-product-filter\n"
8
- "POT-Creation-Date: 2022-09-20 12:09:06+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
5
  "Project-Id-Version: YITH WooCommerce Ajax Navigation\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/yith-woocommerce-ajax-product-filter\n"
8
+ "POT-Creation-Date: 2022-10-05 14:27:13+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
plugin-fw/assets/js/yith-bh-onboarding.js CHANGED
@@ -1,6 +1,7 @@
1
  (function($) {
2
 
3
  var init = function() {
 
4
  var currentTab = $('.yith-bh-onboarding-tabs__nav li.selected').data('tab');
5
  $('#' + currentTab).fadeIn();
6
  };
@@ -60,6 +61,7 @@
60
  );
61
 
62
  });
 
63
  init();
64
 
65
  })(jQuery);
1
  (function($) {
2
 
3
  var init = function() {
4
+ $('#yith-bh-onboarding').fadeIn();
5
  var currentTab = $('.yith-bh-onboarding-tabs__nav li.selected').data('tab');
6
  $('#' + currentTab).fadeIn();
7
  };
61
  );
62
 
63
  });
64
+
65
  init();
66
 
67
  })(jQuery);
plugin-fw/assets/js/yith-bh-onboarding.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){var a;t(document).on("click",".yith-bh-onboarding-tabs__nav li",function(a){var n=t(this);t(".yith-bh-onboarding-tabs__nav li").removeClass("selected"),n.addClass("selected"),t(".yith-bh-onboarding-tabs__tab").hide(),t("#"+n.data("tab")).fadeIn()}),t(document).on("submit","form",function(a){a.preventDefault();var n=t(this);if(!0===t(document).triggerHandler("yith_onboarding_form_submit_validation"))return t(document).trigger("yith_onboarding_validate_form_submit",[n]),!1;t(".yith-bh-onboarding-tabs__content").block({message:"",overlayCSS:{backgroundColor:"#FFFFFF",opacity:.8,cursor:"wait"}}),t.ajax({type:"POST",data:n.serialize(),url:yith_bh_onboarding.ajax_url,success:function(t){t.success&&parent.document.querySelector(".components-modal__frame button").click()},complete:function(){t(".yith-bh-onboarding-tabs__content").unblock()}})}),a=t(".yith-bh-onboarding-tabs__nav li.selected").data("tab"),t("#"+a).fadeIn()}(jQuery);
1
+ !function(t){t(document).on("click",".yith-bh-onboarding-tabs__nav li",function(n){var a=t(this);t(".yith-bh-onboarding-tabs__nav li").removeClass("selected"),a.addClass("selected"),t(".yith-bh-onboarding-tabs__tab").hide(),t("#"+a.data("tab")).fadeIn()}),t(document).on("submit","form",function(n){n.preventDefault();var a=t(this);if(!0===t(document).triggerHandler("yith_onboarding_form_submit_validation"))return t(document).trigger("yith_onboarding_validate_form_submit",[a]),!1;t(".yith-bh-onboarding-tabs__content").block({message:"",overlayCSS:{backgroundColor:"#FFFFFF",opacity:.8,cursor:"wait"}}),t.ajax({type:"POST",data:a.serialize(),url:yith_bh_onboarding.ajax_url,success:function(t){t.success&&parent.document.querySelector(".components-modal__frame button").click()},complete:function(){t(".yith-bh-onboarding-tabs__content").unblock()}})}),function(){t("#yith-bh-onboarding").fadeIn();var n=t(".yith-bh-onboarding-tabs__nav li.selected").data("tab");t("#"+n).fadeIn()}()}(jQuery);
plugin-fw/init.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 3.9.15
5
  * Author: YITH
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author YITH
10
- * @version 3.9.15
11
  * @package YITH\PluginFramework
12
  */
13
 
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 3.9.16
5
  * Author: YITH
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author YITH
10
+ * @version 3.9.16
11
  * @package YITH\PluginFramework
12
  */
13
 
plugin-fw/languages/yith-plugin-fw-el.po CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: YITH Framework\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
- "POT-Creation-Date: 2022-08-10 12:46:35+00:00\n"
8
  "PO-Revision-Date: 2021-02-11 18:07:46+0000\n"
9
  "Language: el_GR\n"
10
  "MIME-Version: 1.0\n"
4
  msgstr ""
5
  "Project-Id-Version: YITH Framework\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
+ "POT-Creation-Date: 2022-10-04 10:25:50+00:00\n"
8
  "PO-Revision-Date: 2021-02-11 18:07:46+0000\n"
9
  "Language: el_GR\n"
10
  "MIME-Version: 1.0\n"
plugin-fw/languages/yith-plugin-fw-es_ES.mo CHANGED
Binary file
plugin-fw/languages/yith-plugin-fw-es_ES.po CHANGED
@@ -4,8 +4,8 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: YITH Framework\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
- "POT-Creation-Date: 2022-08-10 12:46:35+00:00\n"
8
- "PO-Revision-Date: 2022-08-10 11:52:30+0000\n"
9
  "Language: es\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -972,7 +972,7 @@ msgstr "para ver algunos casos de uso útiles."
972
  #: templates/panel/help-tab.php:152
973
  msgctxt "Help tab view FAQs link"
974
  msgid "Check the FAQs"
975
- msgstr "Comprueba los FAQ"
976
 
977
  #: templates/panel/help-tab.php:155
978
  msgctxt "Help tab view FAQs link"
@@ -982,12 +982,12 @@ msgstr "para encontrar respuestas a tus dudas."
982
  #: templates/panel/help-tab.php:170
983
  msgctxt "Help tab FAQ title"
984
  msgid "Last FAQs in our Help Center"
985
- msgstr "Últimos FAQs en nuestro Centro de Ayuda"
986
 
987
  #: templates/panel/help-tab.php:184
988
  msgctxt "Help tab FAQ link"
989
  msgid "View all FAQs >"
990
- msgstr "Ver todos los FAQs >"
991
 
992
  #: templates/panel/help-tab.php:193
993
  msgctxt "Help tab submit ticket title"
4
  msgstr ""
5
  "Project-Id-Version: YITH Framework\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
+ "POT-Creation-Date: 2022-10-04 10:25:50+00:00\n"
8
+ "PO-Revision-Date: 2022-09-22 14:14:01+0000\n"
9
  "Language: es\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
972
  #: templates/panel/help-tab.php:152
973
  msgctxt "Help tab view FAQs link"
974
  msgid "Check the FAQs"
975
+ msgstr "Comprueba las FAQ"
976
 
977
  #: templates/panel/help-tab.php:155
978
  msgctxt "Help tab view FAQs link"
982
  #: templates/panel/help-tab.php:170
983
  msgctxt "Help tab FAQ title"
984
  msgid "Last FAQs in our Help Center"
985
+ msgstr "Últimas FAQ en nuestro Centro de ayuda"
986
 
987
  #: templates/panel/help-tab.php:184
988
  msgctxt "Help tab FAQ link"
989
  msgid "View all FAQs >"
990
+ msgstr "Ver todas las FAQs >"
991
 
992
  #: templates/panel/help-tab.php:193
993
  msgctxt "Help tab submit ticket title"
plugin-fw/languages/yith-plugin-fw-it_IT.mo CHANGED
Binary file
plugin-fw/languages/yith-plugin-fw-it_IT.po CHANGED
@@ -4,8 +4,8 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: YITH Framework\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
- "POT-Creation-Date: 2022-08-10 12:46:35+00:00\n"
8
- "PO-Revision-Date: 2022-08-10 12:35:50+0000\n"
9
  "Language: it\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -124,7 +124,7 @@ msgstr "Scopri cosa puoi fare con questo potente strumento"
124
 
125
  #: includes/class-yit-plugin-panel.php:1050
126
  msgid "Watch our <mark>\"First Steps\" video</mark>"
127
- msgstr "Guarda il nostro <mark>video \"Primi Step\" video</mark>"
128
 
129
  #: includes/class-yit-plugin-panel.php:1051
130
  msgid "See how it works before you start using it"
4
  msgstr ""
5
  "Project-Id-Version: YITH Framework\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
+ "POT-Creation-Date: 2022-10-04 10:25:50+00:00\n"
8
+ "PO-Revision-Date: 2022-08-12 07:42:56+0000\n"
9
  "Language: it\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
124
 
125
  #: includes/class-yit-plugin-panel.php:1050
126
  msgid "Watch our <mark>\"First Steps\" video</mark>"
127
+ msgstr "Guarda il nostro <mark>video \"Primi Step\"</mark>"
128
 
129
  #: includes/class-yit-plugin-panel.php:1051
130
  msgid "See how it works before you start using it"
plugin-fw/languages/yith-plugin-fw-nl_NL.po CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: YITH Framework\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
- "POT-Creation-Date: 2022-08-10 12:46:35+00:00\n"
8
  "PO-Revision-Date: 2021-12-13 12:45:02+0000\n"
9
  "Language: nl\n"
10
  "MIME-Version: 1.0\n"
4
  msgstr ""
5
  "Project-Id-Version: YITH Framework\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
+ "POT-Creation-Date: 2022-10-04 10:25:50+00:00\n"
8
  "PO-Revision-Date: 2021-12-13 12:45:02+0000\n"
9
  "Language: nl\n"
10
  "MIME-Version: 1.0\n"
plugin-fw/languages/yith-plugin-fw-ru_RU.po CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: YITH Framework\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
- "POT-Creation-Date: 2022-08-10 12:46:35+00:00\n"
8
  "PO-Revision-Date: 2022-04-05 17:22:32+0000\n"
9
  "Language: ru\n"
10
  "MIME-Version: 1.0\n"
4
  msgstr ""
5
  "Project-Id-Version: YITH Framework\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
+ "POT-Creation-Date: 2022-10-04 10:25:50+00:00\n"
8
  "PO-Revision-Date: 2022-04-05 17:22:32+0000\n"
9
  "Language: ru\n"
10
  "MIME-Version: 1.0\n"
plugin-fw/languages/yith-plugin-fw-zh_CN.po CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: YITH Framework\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
- "POT-Creation-Date: 2022-08-10 12:46:35+00:00\n"
8
  "PO-Revision-Date: 2022-06-29 13:12:18+0000\n"
9
  "Language: zh\n"
10
  "MIME-Version: 1.0\n"
4
  msgstr ""
5
  "Project-Id-Version: YITH Framework\n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
+ "POT-Creation-Date: 2022-10-04 10:25:50+00:00\n"
8
  "PO-Revision-Date: 2022-06-29 13:12:18+0000\n"
9
  "Language: zh\n"
10
  "MIME-Version: 1.0\n"
plugin-fw/languages/yith-plugin-fw.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
- "POT-Creation-Date: 2022-08-10 12:46:35+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: YITH <plugins@yithemes.com>\n"
7
+ "POT-Creation-Date: 2022-10-04 10:25:50+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
plugin-fw/templates/bh-onboarding/onboarding-tabs.php CHANGED
@@ -12,7 +12,7 @@
12
  defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
13
  $tabs = $options['tabs'];
14
  ?>
15
- <div class="woocommerce yith-plugin-fw-panel" id="yith-bh-onboarding">
16
  <header>
17
  <div class="yith-bh-onboarding-logo">
18
  <?php if ( isset( $options['logo'] ) ) : ?>
12
  defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
13
  $tabs = $options['tabs'];
14
  ?>
15
+ <div class="woocommerce yith-plugin-fw-panel" id="yith-bh-onboarding" style="display: none">
16
  <header>
17
  <div class="yith-bh-onboarding-logo">
18
  <?php if ( isset( $options['logo'] ) ) : ?>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: woocommerce ajax product filter download, woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation, woocommerce layered navigation, woocommerce layered nav, product filter, product filters, ajax product filter, woocommerce ajax product filter, woocommerce filters, sidebar filter, sidebar ajax filter, ajax price filter, price filter, product sorting, woocommerce filter, taxonomy filter, attribute filter, attributes filter, woocommerce product sort, ajax sort, woocommerce ajax product filter, advanced product filters, ajax product filters, filters, woocommerce ajax product filters, woocommerce product filters, woocommerce product filters, category filter, attribute filters, woocommerce products filter, woocommerce price filter, yit, yith, yithemes
5
  Requires at least: 5.8
6
  Tested up to: 6.0
7
- Stable tag: 4.14.0
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -152,6 +152,12 @@ If none of the previous listed actions helps you solve the problem, then, submit
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
 
155
  = 4.14.0 - Released on 20 September 2022 =
156
 
157
  * New: support for WooCommerce 6.9
4
  Tags: woocommerce ajax product filter download, woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation, woocommerce layered navigation, woocommerce layered nav, product filter, product filters, ajax product filter, woocommerce ajax product filter, woocommerce filters, sidebar filter, sidebar ajax filter, ajax price filter, price filter, product sorting, woocommerce filter, taxonomy filter, attribute filter, attributes filter, woocommerce product sort, ajax sort, woocommerce ajax product filter, advanced product filters, ajax product filters, filters, woocommerce ajax product filters, woocommerce product filters, woocommerce product filters, category filter, attribute filters, woocommerce products filter, woocommerce price filter, yit, yith, yithemes
5
  Requires at least: 5.8
6
  Tested up to: 6.0
7
+ Stable tag: 4.15.0
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
152
 
153
  == Changelog ==
154
 
155
+ = 4.15.0 - Released on 5 October 2022 =
156
+
157
+ * New: support for WooCommerce 7.0
158
+ * Tweak: remove auto-complete for dropdown search inputs
159
+ * Update: YITH plugin framework
160
+
161
  = 4.14.0 - Released on 20 September 2022 =
162
 
163
  * New: support for WooCommerce 6.9