var products=namespace("tl.products"),resellers;products.Finder=function(){this.attributeOptions={};this.modelAttributes={};this.upsrbAttributes={};this.runtimeModels={};this.keywordSearchModels={};this.mountFinderDeviceModels={};this.subgroupModels={};this.selectionsTracker={}};products.Finder.prototype.addVirtualQuantityToAttributeOptions=function(){var n="",i,t;if(this.attributeOptions.hasOwnProperty(1525)?n="1525qty":this.attributeOptions.hasOwnProperty(2062)?n="2062qty":this.attributeOptions.hasOwnProperty(2046)?n="2046qty":this.attributeOptions.hasOwnProperty(2221)&&(n="2221qty"),n!==""){this.attributeOptions[n]={};this.attributeOptions[n].options={};n==="1525qty"&&(this.attributeOptions[n].filterStyleId=7);for(i in this.modelAttributes)this.modelAttributes[i].attributes.hasOwnProperty(n)&&(t=parseInt(this.modelAttributes[i].attributes[n]),this.modelAttributes[i].attributes[n]=t,this.attributeOptions[n].options[t]={},this.attributeOptions[n].options[t].selectable=!0,this.attributeOptions[n].options[t].selected=!1)}};products.Finder.prototype.applyLazyLoadingGroupImages=function(){$("#products .item img.list-group-image").lazyload({threshold:600,effect:"fadeIn"})};products.Finder.prototype.calcMaxRuntime=function(n){var t=typeof n!="undefined"?n:30;return maxRt=t<10?20:Math.round(t*2)};products.Finder.prototype.dataLayerAddFilterClick=function(n){var t=this,n=n||undefined,i=n===undefined?$():$(n)};products.Finder.prototype.findMatchInGroups=function(n){var n=n||{},t=n.hasOwnProperty("groupOne")?n.groupOne:[],i=n.hasOwnProperty("groupTwo")?n.groupTwo:[],f=n.hasOwnProperty("groupOneDelim")?n.groupOneDelim:",",o=n.hasOwnProperty("groupTwoDelim")?n.groupTwoDelim:",",r=[],e=[],s=new RegExp(f+"\\s+","g"),u;switch(typeof t){case"object":t.constructor===Array&&(r=t.map(function(n){return n.toUpperCase()}));break;case"string":r=t.toString().toUpperCase().replace(s,f).split(f)}switch(typeof i){case"object":i.constructor===Array&&(e=i.map(function(n){return n.toUpperCase()}));break;case"string":e=i.toString().toUpperCase().replace(s,o).split(o)}for(u=0;u<=r.length;u++)if(e.indexOf(r[u])!==-1)return!0;return!1};products.Finder.prototype.getModelsByAttribute=function(n){var r=[],h=[],c=[],l=[],p=[],nt=[1525,1975].indexOf(parseInt(n))>=0,a,v,w,u,f,e,d,y,g,s,i,t,o;for(a in this.modelAttributes){v=this.modelAttributes[a].attributes;switch(n){case"1080":case"1085":(v.hasOwnProperty(1080)||v.hasOwnProperty(1085))&&r.push(a);break;default:v.hasOwnProperty(n)&&r.push(a)}}switch(n){case"1080":case"1085":if(this.attributeOptions.hasOwnProperty(1080))for(u in this.attributeOptions[1080].options)this.attributeOptions[1080].options[u].selected&&c.push(u);if(this.attributeOptions.hasOwnProperty(1085))for(u in this.attributeOptions[1085].options)this.attributeOptions[1085].options[u].selected&&l.push(u);break;case"1975":case"1525":w=parseInt(n);for(u in this.attributeOptions[w].options)this.attributeOptions[w].options[u].selected&&p.push(u)}for(f=0;f<r.length;f++){e=this.modelAttributes[r[f]].attributes;switch(n){case"1975":case"1525":var i=!0,t=e[n],o=[];if(typeof t=="object")for(d in t)o.push(d.toUpperCase());else o=t.toString().toUpperCase().replace(/;\s+/g,";").split(";");for(y=0;y<p.length;y++)if(g=p[y].toUpperCase(),o.indexOf(g)===-1){i=!1;continue}i&&h.indexOf(r[f])<0&&h.push(r[f]);break;default:for(s in this.attributeOptions[n].options)if(this.attributeOptions[n].options[s].selected){i=!1;switch(n){case"1080":case"1085":var tt=e.hasOwnProperty(1080)?e[1080]:"",it=e.hasOwnProperty(1085)?e[1085]:"",b=tt.toString().toUpperCase().replace(/;\s+/g,";").split(";"),k=it.toString().toUpperCase().replace(/;\s+/g,";").split(";");if(c.length&&l.length){var rt=this.findMatchInGroups({groupOne:c,groupTwo:b}),ut=this.findMatchInGroups({groupOne:c,groupTwo:k}),ft=this.findMatchInGroups({groupOne:l,groupTwo:b}),et=this.findMatchInGroups({groupOne:l,groupTwo:k});(rt&&et||ut&&ft)&&(i=!0)}else(b.indexOf(s.toUpperCase())!==-1||k.indexOf(s.toUpperCase())!==-1)&&(i=!0);break;case"1693":t=e[n];o=t.toString().toUpperCase().replace(/(\s+)?\([0-9]\)(\s+)?/g,"").replace(/;\s+/g,";").split(";");o.indexOf(s.toUpperCase())!==-1&&(i=!0);break;default:t=e[n];typeof t=="object"?t.hasOwnProperty(s)&&(i=!0):typeof t=="boolean"?t&&(i=!0):(o=t.toString().toUpperCase().replace(/;\s+/g,";").split(";"),o.indexOf(s.toUpperCase())!==-1&&(i=!0))}i&&h.indexOf(r[f])<0&&h.push(r[f])}}}return h.length>0||nt?h:r};products.Finder.prototype.getSortedModelIDs=function(n){var f=[],i=[],e=[],o=this.modelAttributes,u,r,t;if(n=="avgPriceHigh"||n=="avgPriceLow")for(r in this.modelAttributes)u=this.modelAttributes[r],u.avgPrice==null?e.push(u):i.push(u);else for(r in this.modelAttributes)i.push(this.modelAttributes[r]);for(i.sort(function(t,i){switch(n){default:return t.modelID>i.modelID?1:-1;case"modelNumber":return t.modelNumber.toString()>i.modelNumber.toString()?1:-1;case"avgRating":return t.avgRating<i.avgRating?1:-1;case"popular":return t.clickCount<i.clickCount?1:-1;case"rank":return t.rank<i.rank?1:-1;case"avgPriceHigh":return t.avgPrice<i.avgPrice?1:-1;case"avgPriceLow":return t.avgPrice>i.avgPrice?1:-1;case"newest":return new Date(t.publishDate)<new Date(i.publishDate)?1:-1;case"featured":return t.featuredRank<i.featuredRank?1:-1;case/keyAttr-[0-9]+/.test(n)&&n:var r=n.split("-"),u=parseInt(t.attributes[r[1]])||t.attributes[r[1]],f=parseInt(i.attributes[r[1]])||i.attributes[r[1]];if(r.length==3)switch(r[2]){case"low":return u>f?1:-1;case"high":return u<f?1:-1}return u>f?1:-1}}),t=0;t<i.length;t++)f.push(i[t].modelID);if(n=="avgPriceHigh"||n=="avgPriceLow")for(t=0;t<e.length;t++)f.push(e[t].modelID);return f};products.Finder.prototype.getVisibleModelsCount=function(){var n=0;for(var t in this.modelAttributes)this.modelAttributes[t].display&&n++;return n};products.Finder.prototype.isPositiveInteger=function(n){return parseFloat(n)===n>>>0};products.Finder.prototype.hasAttributeOptionSelected=function(){var n,t;for(n in this.attributeOptions)if(this.attributeOptions[n].hasOwnProperty("options"))for(t in this.attributeOptions[n].options)if(this.attributeOptions[n].options[t].selected)return!0;return!1};products.Finder.prototype.resetAllModelDisplayAndAttributeOptions=function(){var t,n,i;for(t in this.modelAttributes)this.modelAttributes[t].display=!0;for(n in this.attributeOptions)for(i in this.attributeOptions[n].options)this.attributeOptions[n].options[i].selectable=!0};products.Finder.prototype.updateAttributeOption=function(n,t,i){var u=[1692,1845,1962,1963,1965,1967,1968,1969,1970,1971,1972,1973,1975,2022,2024,2025,2026,2027,2028,2029,2030,2031,2043,2102,2103,2328,2356],r;if(u=u.concat([2131,2132,2134,2135,2136,2137,2138,2139,2140,2159,2175]),typeof n!="undefined"&&typeof t!="undefined"&&typeof i!="undefined"&&this.attributeOptions.hasOwnProperty(n)){if(u.indexOf(n)>=0)for(r in this.attributeOptions[n].options)this.attributeOptions[n].options[r].selected&&(this.attributeOptions[n].options[r].selected=!1,this.updateSelectionsTracker(n,r,!1));this.attributeOptions[n].options.hasOwnProperty(t)&&(i&&(this.attributeOptions[n].options[t].selectable=!0),this.attributeOptions[n].options[t].selected=i,this.updateSelectionsTracker(n,t,i))}};products.Finder.prototype.updateAttributeOptionsBySelectionsTracker=function(){var n,t;if(Object.keys(this.selectionsTracker).length)for(n in this.selectionsTracker)if(this.attributeOptions.hasOwnProperty(n))for(t in this.selectionsTracker[n])this.attributeOptions[n].options.hasOwnProperty(t)&&(this.attributeOptions[n].options[t].selected=!0)};products.Finder.prototype.updateAttributeOptionsByVisibleModelsAttributes=function(){var t="",i="",e,o,n,r,h,f,s,u;for(e in this.modelAttributes){o=this.modelAttributes[e].display?!0:!1;for(n in this.modelAttributes[e].attributes)if(this.attributeOptions.hasOwnProperty(n)&&(r=this.modelAttributes[e].attributes[n],h=[7,17].indexOf(parseInt(this.attributeOptions[n].filterStyleId))>=0?!0:!1,o))if(typeof r=="object")for(f in r)this.attributeOptions[n].options.hasOwnProperty(f)&&(this.attributeOptions[n].options[f].selectable=!0);else if(typeof r=="boolean"){if(r===!0)for(f in this.attributeOptions[n].options)this.attributeOptions[n].options[f].selectable=!0}else{if(s=r.toString().replace(/;\s+/g,";").split(";"),[1080,1085].indexOf(parseInt(n))>=0){if(this.attributeOptions.hasOwnProperty(1080))for(u in this.attributeOptions[1080].options)if(this.attributeOptions[1080].options[u].selected){t=u;break}if(this.attributeOptions.hasOwnProperty(1085))for(u in this.attributeOptions[1085].options)if(this.attributeOptions[1085].options[u].selected){i=u;break}}s.forEach(function(r){var u;switch(n){case"1080":case"1085":if(this.attributeOptions.hasOwnProperty(1080)&&this.attributeOptions[1080].options.hasOwnProperty(r)&&(t.length?this.attributeOptions[1080].options[t].selectable=!0:this.attributeOptions[1080].options[r].selectable=!0,i.length&&this.attributeOptions[1080].options.hasOwnProperty(i))){this.attributeOptions[1080].options[i].selectable=!1;for(u in this.modelAttributes)this.modelAttributes[u].display&&this.modelAttributes[u].attributes.hasOwnProperty(1080)&&this.modelAttributes[u].attributes.hasOwnProperty(1085)&&this.modelAttributes[u].attributes[1080]==i&&this.modelAttributes[u].attributes[1085]==i&&(this.attributeOptions[1080].options[i].selectable=!0)}if(this.attributeOptions.hasOwnProperty(1085)&&this.attributeOptions[1085].options.hasOwnProperty(r)&&(i.length?this.attributeOptions[1085].options[i].selectable=!0:this.attributeOptions[1085].options[r].selectable=!0,t.length&&this.attributeOptions[1085].options.hasOwnProperty(t))){this.attributeOptions[1085].options[t].selectable=!1;for(u in this.modelAttributes)this.modelAttributes[u].display&&this.modelAttributes[u].attributes.hasOwnProperty(1080)&&this.modelAttributes[u].attributes.hasOwnProperty(1085)&&this.modelAttributes[u].attributes[1080]==t&&this.modelAttributes[u].attributes[1085]==t&&(this.attributeOptions[1085].options[t].selectable=!0)}break;case"1693":r=r.replace(/(\s+)?\([0-9]\)(\s+)?/g,"");default:this.attributeOptions[n].options.hasOwnProperty(r)&&(this.attributeOptions[n].options[r].selectable=!0)}},this)}}};products.Finder.prototype.updateModelDisplayByAttributesOptions=function(){var t=[],r=[],n=[],u,f,i,e,o,s;if(Object.keys(this.runtimeModels).length){for(u in this.runtimeModels)t.push(u);t.length&&n.push(t)}Object.keys(this.mountFinderDeviceModels).length&&this.mountFinderDeviceModels.length&&n.push(this.mountFinderDeviceModels);Object.keys(this.subgroupModels).length&&this.subgroupModels.length&&n.push(this.subgroupModels);Object.keys(this.keywordSearchModels).length&&this.keywordSearchModels.length&&n.push(this.keywordSearchModels);for(f in this.modelAttributes)r.push(f);for(i in this.attributeOptions){t=r;for(e in this.attributeOptions[i].options)if(this.attributeOptions[i].options[e].selected){t=this.getModelsByAttribute(i);break}n.push(t)}if(n.length){o=n.reduce(function(n,t){return t.filter(function(t){return n.indexOf(t)===-1?!1:!0})});for(s in this.modelAttributes)this.modelAttributes[s].display=!1;o.forEach(function(n){this.modelAttributes[n].display=!0},this)}};products.Finder.prototype.updateModelDisplayHavingPrices=function(){if(this.modelsHavingPrices.length)for(var n in this.modelAttributes)this.modelAttributes[n].display&&this.modelsHavingPrices.indexOf(n)===-1&&(this.modelAttributes[n].display=!1)};products.Finder.prototype.updateSelectionsTracker=function(n,t,i){typeof n!="undefined"&&typeof t!="undefined"&&typeof i!="undefined"&&(i?(this.selectionsTracker.hasOwnProperty(n)||(this.selectionsTracker[n]={}),this.selectionsTracker[n][t]={}):this.selectionsTracker.hasOwnProperty(n)&&(this.selectionsTracker[n].hasOwnProperty(t)&&delete this.selectionsTracker[n][t],Object.keys(this.selectionsTracker[n]).length===0&&delete this.selectionsTracker[n]))};products.Finder.prototype.UPSRB_updateModelDisplayAndSelectableAttributes=function(){var e,i,r,s="",h="",c="",l=[],a=[],v=[],u=[],f,n,y,p,t,w,o,b;for(t in this.attributeOptions)for(f in this.attributeOptions[t].options)if(this.attributeOptions[t].options[f].selected){switch(parseInt(t)){case 9e3:s=f;break;case 9001:h=f;break;case 9002:c=f}break}for(n in this.upsrbAttributes)e=this.upsrbAttributes[n].MODEL_ID,i=this.upsrbAttributes[n].UPS_MANUFACTURER,r=this.upsrbAttributes[n].UPS_MODEL_NUMBER,battVersion=this.upsrbAttributes[n].VERSION,s.length>0&&s===i&&l.push(n),h.length>0&&h===r&&a.push(n),c.length>0&&c===battVersion&&v.push(n);if(l.length>0&&u.push(l),a.length>0&&u.push(a),v.length>0&&u.push(v),u.length){y=u.reduce(function(n,t){return t.filter(function(t){return n.indexOf(t)===-1?!1:!0})});for(p in this.modelAttributes)this.modelAttributes[p].display=!1;for(t in this.attributeOptions)for(w in this.attributeOptions[t].options)this.attributeOptions[t].options[w].selectable=!1;for(o=0,b=y.length;o<b;o++)currBattery=this.upsrbAttributes[y[o]],e=currBattery.MODEL_ID,i=currBattery.UPS_MANUFACTURER,r=currBattery.UPS_MODEL_NUMBER,battVersion=currBattery.VERSION,this.modelAttributes.hasOwnProperty(e)&&(this.modelAttributes[e].display=!0),this.attributeOptions[9e3].options.hasOwnProperty(i)&&(this.attributeOptions[9e3].options[i].selectable=!0),this.attributeOptions[9001].options.hasOwnProperty(r)&&(this.attributeOptions[9001].options[r].selectable=!0),this.attributeOptions[9002].options.hasOwnProperty(battVersion)&&(this.attributeOptions[9002].options[battVersion].selectable=!0)}else this.resetAllModelDisplayAndAttributeOptions()};resellers=namespace("tl.resellers");resellers.ProductFinder=function(){var n=this;this.objFinder=new products.Finder;this.displayStyle=1;this.DOMRefs={attributeOptions:$("#attributeOptions"),btnDeleteFilters:$("#btnDeleteFilters"),btnLoadRuntime:$("#runtime button"),btnResetFilters:$(".btnResetFilters"),btnSaveFilters:$("#btnSaveFilters"),collapseAll:$("#collapseAll"),copyClipboard:$(".copyClipboard"),grid:$("#grid"),hColor:$("#hc"),helpIcon:$(".icoHelp"),jqLoad:$("#jqLoad"),list:$("#list"),listCondensed:$("#listCondensed"),listTools:$("#listTools"),listSort:$("#listSort"),matchCount:$("#matchCount"),matchText:$("#matchText"),modelAttributes:$("#modelAttributes"),modelList:$("#modelList"),partnerName:$("#partnerName"),pfnav:$("#pfnav"),pgidSelect:$("#pgidSelect"),pid:$("#pid"),popCompare:$("#popCompare"),popCompareTable:$("#popCompareTable"),popLoadCalc:$("#popLoadCalc"),popLists:$("#popLists"),productFilters:$("#productFilters"),productGroupID:$("#productGroupID"),productGroupName:$("#productGroupName"),productLineID:$("#productLineID"),products:$("#products"),productsItem:$("#products .item"),productTypes:$("#productTypes"),rbChargingPorts:$("#rbChargingPorts"),rbLoadRuntimeSQLNoMatches:$("#rbLoadRuntimeSQLNoMatches"),rbRuntimErrorRetrieving:$("#rbRuntimErrorRetrieving"),rbInvalidMinAndMax:$("#rbInvalidMinAndMax"),rbInvalidMinimum:$("#rbInvalidMinimum"),rbTotalOutlets:$("#rbTotalOutlets"),rbType:$("#rbType"),runtime:$("#runtime"),selectionsTracker:$("#selectionsTracker"),selectText:$("#selectText").val(),sgidSelect:$("#sgidSelect"),sidebar:$("#sidebar"),stop:$("#stop"),styleID:$("#styleID"),topFilter:$("#topFilter"),totalLoad:$("#totalLoad"),upsLoad:$("#totalLoad #upsLoad"),upsMaxRt:$("#runtime #upsMaxRt"),upsMinRt:$("#runtime #upsMinRt"),upsrbAttributes:$("#upsrbAttributes"),userFilterButtons:$("#userFilterButtons"),userFilters:$("#userFilters"),userLang:$("#userLang").val()};this.DOMEls={div:$(document.createElement("div")),h3:$(document.createElement("h3")),h4:$(document.createElement("h4")),h5:$(document.createElement("h5")),ul:$(document.createElement("ul")),li:$(document.createElement("li")),em:$(document.createElement("em")),inp:$(document.createElement("input")),bold:$(document.createElement("strong"))};dataLayer.push({partnerName:n.DOMRefs.partnerName.val(),category:n.DOMRefs.productGroupName.val()});this.isUPSRB=parseInt(n.DOMRefs.productGroupID.val())===17?!0:!1;this.objFinder.attributeOptions=this.DOMRefs.attributeOptions.data("json");this.objFinder.modelAttributes=this.DOMRefs.modelAttributes.data("json");this.objFinder.upsrbAttributes=this.DOMRefs.upsrbAttributes.data("json");this.addVirtualQuantityToAttributeOptions();this.attachDisplaySwitchEvents();this.attachSideBarEvents();this.attachPopUpEvents();this.attachToolsButtonEvents();this.attachUPSRBModelLinkEvents();this.DOMRefs.userFilters.on("click","button",function(){var t=$(this);t.hasClass("remove")&&n.deselectFilter(t.data("btn-value"))});this.isUPSRB||this.updateAttributeOptionsByVisibleModelsAttributes();this.filterSidebarBySelectableAttributeOptions();this.updateAttributeOptionsBySelectionsTracker();this.applyPreSelectedAttributeOptions();this.isUPSRB&&this.toggleUPSRBVersionFilter();this.objFinder.applyLazyLoadingGroupImages();typeof n.DOMRefs.productGroupID.val()!="undefined"&&this.ajxGetSgids(n.DOMRefs.productGroupID.val());$(".panel.panel-default.hidden",this.DOMRefs.sidebar).each(function(n,t){$(t).removeClass("hidden")});$(".thumbnail > a, a.modelNumber",n.DOMRefs.productsItem).click(function(){dataLayer.push({event:"gtm.product.finder.model.selection",modelNumber:$(this).data("model-number")})})};resellers.ProductFinder.prototype.addVirtualQuantityToAttributeOptions=function(){var n=this;(n.objFinder.addVirtualQuantityToAttributeOptions(""),typeof n.objFinder.attributeOptions!="undefined")&&(n.objFinder.attributeOptions.hasOwnProperty(1525)?n.buildAndInsertVirtualQuantityFilter(1525):n.objFinder.attributeOptions.hasOwnProperty(2062)&&n.buildAndInsertVirtualQuantityFilter(2062))};resellers.ProductFinder.prototype.applyPreSelectedAttributeOptions=function(){var i=this;for(var r in i.objFinder.attributeOptions){var t=$("#filter_"+r).length?$("#filter_"+r):$("#filter_sf"),e=t.parent(".list-group"),f=e.find(".collapsed"),u=t.data("filter-styleid"),n=[];switch(u){case 5:n=t.find(".type input");n.length||(n=t.find(".subType input"));break;case 6:n=t.find(".filter input");break;case 7:n=t.find(".filter input");break;case 8:n=t.find(".boxLink");break;case 10:n=t.find(".filter input");break;case 11:n=t.find(".colors");break;case 12:n=t.find("#attr_"+r+" input")}n.length&&n.each(function(){var n=$(this),t=u==8||u==11?n.data("value"):n.val();i.objFinder.attributeOptions[r].options.hasOwnProperty(t)&&i.objFinder.attributeOptions[r].options[t].selected&&(n.click(),f.length&&f.each(function(n,t){$(t).click()}))})}(i.DOMRefs.upsLoad.val()!=""||i.DOMRefs.upsMinRt.val()!=""||i.DOMRefs.upsMaxRt.val()!="")&&i.DOMRefs.btnLoadRuntime.click()};resellers.ProductFinder.prototype.attachDisplaySwitchEvents=function(){var n=this;n.DOMRefs.list.click(function(t){t.preventDefault();n.DOMRefs.productsItem.find(".thumbnail").find("img").each(function(){var n=$(this).attr("data-small-image");$(this).attr("data-original",n);$(this).css("visibility","visible")});n.DOMRefs.list.removeClass("invert").blur().siblings().addClass("invert");n.DOMRefs.productsItem.removeClass("grid-group-item").removeClass("condensed-group-item").addClass("list-group-item");n.displayStyle=1;n.objFinder.applyLazyLoadingGroupImages()});n.DOMRefs.listCondensed.click(function(t){t.preventDefault();n.DOMRefs.listCondensed.removeClass("invert").blur().siblings().addClass("invert");n.DOMRefs.productsItem.removeClass("list-group-item").removeClass("grid-group-item").addClass("condensed-group-item");n.displayStyle=2});n.DOMRefs.grid.click(function(t){t.preventDefault();n.DOMRefs.productsItem.find(".thumbnail").find("img").each(function(){var n=$(this).attr("data-medium-image");$(this).attr("data-original",n);$(this).css("visibility","visible")});n.DOMRefs.productsItem.find(".thumbnail").find("img").each(function(){var n=$(this),i=n.attr("src"),t;typeof i!="undefined"&&n.attr("src").substring(0,4)!="data"&&(t=$(this).attr("data-medium-image"),$(this).attr("src",t),$(this).css("visibility","visible"))});n.DOMRefs.grid.removeClass("invert").blur().siblings().addClass("invert");n.DOMRefs.productsItem.removeClass("list-group-item").removeClass("condensed-group-item").addClass("grid-group-item");n.displayStyle=3;n.objFinder.applyLazyLoadingGroupImages()});switch(parseInt(n.DOMRefs.styleID.val())){case 1:n.DOMRefs.list.click();break;case 2:n.DOMRefs.listCondensed.click();break;case 3:n.DOMRefs.grid.click()}};resellers.ProductFinder.prototype.attachPopUpEvents=function(){var n=this;n.DOMRefs.helpIcon.on("click",function(n){n.stopPropagation();var i=$("#popHelp"),t=$(this).closest(".filterHead").data("target");t=t.replace("filter_","help_");$(".helpTopic",i).hide();$(t).show();i.modal("show")});n.DOMRefs.popLoadCalc.on("click",function(n){n.preventDefault();var t=$(this),i=t.attr("href"),r=t.data("width"),u=t.data("height");tl.utilities.popup(i,r,u,!1,0)});$(".modalLink",n.DOMRefs.products).on("click",function(n){n.preventDefault();var t=$(this).data("target"),i=$(this).attr("data-clean-model-number");$(t).find(".modal-header").find("h3").empty().append(i)});n.DOMRefs.popLists.on("click","button.listApply",function(){var t=$(this).parents(".filterList").find("input");t.each(function(){var t=$(this);t.is(":checked")?n.userFilterAdd(t.val(),t.data("filter-text"),"filterBtn"):n.userFilterRemove(t.val())});n.toggleFilterBar();$(this).parents(".filterList").css("display","none")});n.DOMRefs.popLists.on("click","button.close",function(){$(this).parents(".filterList").css("display","none")});n.DOMRefs.popLists.on("click","button.listClose",function(){$(this).parents(".filterList").css("display","none")})};resellers.ProductFinder.prototype.attachSideBarEvents=function(){var n=this;n.DOMRefs.productTypes.on("change",".type input",function(){var t=$(this),u=t.parents(".typeList").data("attrid"),i=!1,r;n.userFilterRemoveAll("typeBtn");t.is(":checked")&&(t.val()==""||(r="<strong>"+n.DOMRefs.rbType.val()+"<\/strong>: "+t.data("filter-text"),n.userFilterAdd(t.val(),r,"typeBtn"),i=!0));n.toggleFilterBar();n.updateAttributeOption(attrID=u,attrVal=t.val(),selected=i);n.updateAndFilterByAttributesAndModelObjects();n.objFinder.dataLayerAddFilterClick(this)});n.DOMRefs.productTypes.on("change",".subType input",function(){var t=$(this),r=t.parents(".subTypeList").data("attrid"),i=!1;n.userFilterRemoveAll("subTypeBtn");t.is(":checked")&&(t.val()==""||(n.userFilterAdd(t.val(),t.data("filter-text"),"subTypeBtn"),i=!0));n.toggleFilterBar();n.updateAttributeOption(attrID=r,attrVal=t.val(),selected=i);n.updateAndFilterByAttributesAndModelObjects();n.objFinder.dataLayerAddFilterClick(this)});n.DOMRefs.sidebar.on("change",".filterOptions input",function(){var t=$(this),r=t.parents(".filterOptions"),i=r.data("attrid"),u=!1,f,e;i=="many"&&(i=t.parents(".filter").data("attrid"));t.is(":checked")?(f=["2062qty"].indexOf(i)>=0?!0:!1,e=r.hasClass("radios")?!0:!1,(f||e)&&($(".filter input:checked",r).each(function(){$(this).prop("checked",!1);$(this).attr("checked",!1);n.userFilterRemove($(this).val());n.updateAttributeOption(attrID=i,attrVal=$(this).val(),selected=!1)}),t.prop("checked",!0),t.attr("checked",!0)),n.userFilterAdd(t.val(),t.data("filter-text"),"filterBtn"),u=!0):n.userFilterRemove(t.val());n.toggleFilterBar();n.updateAttributeOption(attrID=i,attrVal=t.val(),selected=u);n.updateAndFilterByAttributesAndModelObjects();n.objFinder.dataLayerAddFilterClick(this)});n.DOMRefs.sidebar.on("click",".seeAll a",function(t){var i=$(this).data("target"),r=$("#"+i);r.css({display:"block",left:t.pageX-420,top:t.pageY-500});n.objFinder.dataLayerAddFilterClick(this)});n.DOMRefs.sidebar.on("click",".btnRange",function(){var t=$(this).closest(".range"),i=t.find(".inputMin").val(),r=t.find(".inputMax").val(),u;if(!n.objFinder.isPositiveInteger(i)){alert(n.DOMRefs.rbInvalidMinimum.val());return}if(!n.objFinder.isPositiveInteger(r))if(t.attr("id")==="filter_9999")r=n.objFinder.calcMaxRuntime(i);else{alert(n.DOMRefs.rbInvalidMinAndMax.val());return}u=t.parent().find("h3").text()+": "+i+"-"+r;n.userFilterRemoveAll("rangeBtn");n.userFilterAdd(u,u,"rangeBtn");n.toggleFilterBar();$(this).parents("#runtime").length&&n.updateRuntimeModels();n.objFinder.dataLayerAddFilterClick(this)});n.DOMRefs.sidebar.on("click",".boxLink",function(){var t=$(this),i=t.data("value"),u=t.parents(".filterOptions").data("attrid"),r=!1;t.attr("disabled")||(t.hasClass("boxLinkActive")?(n.userFilterRemove(i),t.removeClass("boxLinkActive"),r=!1):(n.userFilterAdd(i,t.data("filter-text"),"filterBtn"),t.addClass("boxLinkActive"),r=!0),n.toggleFilterBar(),n.updateAttributeOption(attrID=u,attrVal=i,selected=r),n.updateAndFilterByAttributesAndModelObjects(),n.objFinder.dataLayerAddFilterClick(this))});n.DOMRefs.sidebar.on("click",".colors",function(){var t=$(this),i=t.data("value"),u=t.parents(".filterOptions").data("attrid"),r=!1;t.attr("disabled")||(t.hasClass("colorActive")?(n.userFilterRemove(i),t.removeClass("colorActive"),r=!1):(n.userFilterAdd(i,t.data("filter-text"),"filterBtn"),t.addClass("colorActive"),r=!0),n.toggleFilterBar(),n.updateAttributeOption(attrID=u,attrVal=i,selected=r),n.updateAndFilterByAttributesAndModelObjects(),n.objFinder.dataLayerAddFilterClick(this))});n.DOMRefs.btnResetFilters.on("click",function(){n.DOMRefs.pgidSelect.trigger("change")})};resellers.ProductFinder.prototype.attachToolsButtonEvents=function(){var n=this,t=n.DOMRefs.matchCount.text();n.DOMRefs.copyClipboard.on("click",function(n){n.preventDefault();tl.utilities.copyClipboard("productfinder",this)});n.DOMRefs.listSort.change(function(){for(var f=$(this),i,r=[],u=n.objFinder.getSortedModelIDs(f.val()),t=0;t<=u.length;t++)i=n.DOMRefs.productsItem.filter("#model_"+u[t]),r.push(i[0]);n.DOMRefs.productsItem.detach();n.DOMRefs.products.append(r);n.objFinder.applyLazyLoadingGroupImages()});n.DOMRefs.pgidSelect.change(function(){var i=$(this),e=i.prop("selectedIndex"),u=$(i.prop("options")[e]).data("filters"),t="/resellers/product-finder?pgid="+i.val(),r=$("#tl-finder"),f;if(i.val()==37){f=n.DOMRefs.pid.length>0?"pid="+n.DOMRefs.pid.val():"tlpp=true";window.location=tl.basePath+"/products/cable-finder?"+f;return}u.length>0&&(t+="&"+u);n.DOMRefs.pid.length>0&&(t+="&pid="+n.DOMRefs.pid.val());t+="&style="+n.displayStyle;n.DOMRefs.hColor.length>0&&(t+="&hc="+n.DOMRefs.hColor.val());n.DOMRefs.pfnav.length>0&&(t+="&pfnav="+n.DOMRefs.pfnav.val());n.DOMRefs.jqLoad.length>0&&(t+="&jqLoad="+n.DOMRefs.jqLoad.val());n.DOMRefs.collapseAll.length>0&&(t+="&collapseAll="+n.DOMRefs.collapseAll.val());n.DOMRefs.stop.length>0&&(t+="&stop="+n.DOMRefs.stop.val());r.length?($("head > script[async]").remove(),t="https://www.tripplite.com"+t,r.empty().append('<img src="//assets.tripplite.com/icon/preloader.gif">'),r.load(t,function(){$.ajax({url:"https://www.tripplite.com/assets/js/tripplite.js",dataType:"script"}).done(function(){$.ajax({url:"https://www.tripplite.com/assets/js/tripplite.products.finder.js",dataType:"script",cache:!1}).done(function(){$.ajax({url:"https://www.tripplite.com/assets/js/tripplite.resellers.productFinder.js",dataType:"script",cache:!1})})})})):location=tl.basePath+t});n.DOMRefs.sgidSelect.change(function(){var i=$(this).val(),t,r;i==0?n.objFinder.subgroupModels=[]:(t=[],r=n.DOMRefs.products.find(".item").filter(function(){return $(this).attr("data-sgids").indexOf(i)>=0}).map(function(){t.push($(this).attr("data-clean-model-number"))}),n.objFinder.subgroupModels=t);n.updateAndFilterByAttributesAndModelObjects()})};resellers.ProductFinder.prototype.attachUPSRBModelLinkEvents=function(){var n=this;n.isUPSRB&&$(".thumbnail > a, a.modelNumber",n.DOMRefs.productsItem).click(function(t){var u=0,f=0,e=0,i=n.DOMEls.div.clone().attr("id","upsrb-message").addClass("alert alert-danger"),o=$(".filterHead.collapsed",n.DOMRefs.sidebar),r,s;$("#upsrb-message").remove();for(r in n.objFinder.attributeOptions)for(s in n.objFinder.attributeOptions[r].options)if(n.objFinder.attributeOptions[r].options[s].selectable)switch(parseInt(r)){case 9e3:u++;break;case 9001:f++;break;case 9002:e++}u!==1||f!==1?(t.preventDefault(),t.stopPropagation(),i.html("Please select BRAND and UPS MODEL to proceed"),i.insertBefore(n.DOMRefs.products),o.each(function(n,t){$(t).trigger("click")})):e>1&&(t.preventDefault(),t.stopPropagation(),i.html("Select a UPS VERSION for a final recommendation and important installation tips"),i.insertBefore(n.DOMRefs.products),o.each(function(n,t){$(t).trigger("click")}))})};resellers.ProductFinder.prototype.buildAndInsertVirtualQuantityFilter=function(n){var i=this,u,t,f;if(typeof n!="undefined"){var o=i.DOMRefs.rbTotalOutlets.val(),s=i.DOMRefs.rbChargingPorts.val(),h=n==1525?o:s,e=$("#attr_"+n),r=e.clone();r.attr("id","attr_"+n+"qty");u=r.children(".filterHead");u.children("p.h3").html(h);u.attr("data-attrid",n+"qty");u.attr("data-target","#filter_"+n+"qty");t=r.children(".filterOptions");t.attr("id","filter_"+n+"qty");t.attr("data-attrid",n+"qty");t.attr("data-filter-styleid","6");t.empty();for(f in i.objFinder.attributeOptions[n+"qty"].options)t.append(i.DOMEls.li.clone().addClass("filter").append('<input type="checkbox" class="m-Right5" data-filter-text="'+f+'" value="'+f+'">').append(f));r.insertBefore(e)}};resellers.ProductFinder.prototype.deselectAllFilterOptions=function(){var i=this,n,t;n=$(".type input:checked",i.DOMRefs.sidebar);n.length&&n.each(function(){t=$(this);t.val()!=""&&t.prop("checked",!1)});n=$(".subType input:checked",i.DOMRefs.sidebar);n.length&&n.each(function(){t=$(this);t.val()!=""&&t.prop("checked",!1)});n=$(".filter input:checked",i.DOMRefs.sidebar);n.length&&n.each(function(){t=$(this);t.prop("checked",!1)});n=$(".boxLinkActive",i.DOMRefs.sidebar);n.length&&n.each(function(){t=$(this);t.prop("checked",!1)});n=$(".colorActive",i.DOMRefs.sidebar);n.length&&n.each(function(){t=$(this);t.prop("checked",!1)})};resellers.ProductFinder.prototype.deselectFilter=function(n){var r=this,i,t,u,f;i=$(".type input",r.DOMRefs.sidebar);i.length&&i.each(function(){return t=$(this),t.val()==n?($('.type input[value=""]',r.DOMRefs.sidebar).click(),!0):void 0});i=$(".subType input",r.DOMRefs.sidebar);i.length&&i.each(function(){return t=$(this),t.val()==n?($('.subType input[value=""]',r.DOMRefs.sidebar).click(),!0):void 0});i=$(".filter input",r.DOMRefs.sidebar);i.length&&i.each(function(){return t=$(this),t.val()==n?(t.prop("checked",!1),t.trigger("change"),!0):void 0});i=$(".boxLinkActive",r.DOMRefs.sidebar);i.length&&i.each(function(){return t=$(this),t.data("value")==n?(t.trigger("click"),!0):void 0});i=$(".colorActive",r.DOMRefs.sidebar);i.length&&i.each(function(){return t=$(this),t.data("value")==n?(t.trigger("click"),!0):void 0});u=typeof n=="string"?n.search(":"):-1;u>=0&&(f=n.slice(0,u),i=$(".range",r.DOMRefs.sidebar),i.each(function(){return t=$(this),t.parent().find("h3").text()==f?(t.find(".inputMin").val(""),t.find(".inputMax").val(""),t.parents("#runtime").length&&(r.DOMRefs.upsLoad.val(""),r.updateRuntimeModels("clearRTModels"),r.userFilterRemove(n),r.toggleFilterBar()),!0):void 0}))};resellers.ProductFinder.prototype.filterModelListByModelAttributesDisplay=function(){var n=this;for(var t in n.objFinder.modelAttributes)n.objFinder.modelAttributes[t].display?$("#model_"+t).removeClass("hide"):$("#model_"+t).addClass("hide");n.objFinder.applyLazyLoadingGroupImages()};resellers.ProductFinder.prototype.filterSidebarBySelectableAttributeOptions=function(){var i=this,n,u;for(n in i.objFinder.attributeOptions){var r=$("#filter_"+n).length?$("#filter_"+n):$("#filter_sf"),e=r.data("filter-styleid"),t=[],f=[];switch(e){case 5:t=r.find(".type input");t.length||(t=r.find(".subType input"));t.length&&t.each(function(){var t=$(this),r=$(this).parent();t.val()!=""&&(t.prop("disabled",!0),t.attr("disabled",!0),r.addClass("hidden"));i.objFinder.attributeOptions[n].options.hasOwnProperty(t.val())&&i.objFinder.attributeOptions[n].options[t.val()].selectable&&(t.removeProp("disabled"),t.removeAttr("disabled"),r.removeClass("hidden"))});break;case 6:case 7:case 10:case 16:t=r.find(".filter input");t.length&&(t.each(function(){var t=$(this),r=$(this).parent();t.prop("disabled",!0);t.attr("disabled",!0);r.addClass("hidden");i.objFinder.attributeOptions[n].options.hasOwnProperty(t.val())&&i.objFinder.attributeOptions[n].options[t.val()].selectable&&(t.removeClass("hidden"),t.removeProp("disabled"),t.removeAttr("disabled"),r.removeClass("hidden"),f.push(t))}),f.length!=1||f[0].is(":checked")||f[0].addClass("hidden"));break;case 8:t=r.find(".boxLink");t.length&&t.each(function(){var t=$(this);t.prop("hide",!0);t.attr("hide",!0);t.addClass("hide");i.objFinder.attributeOptions[n].options.hasOwnProperty(t.data("value"))&&i.objFinder.attributeOptions[n].options[t.data("value")].selectable&&(t.removeProp("hide"),t.removeAttr("hide"),t.removeClass("hide"))});break;case 11:t=r.find(".colors");t.length&&t.each(function(){var t=$(this);t.prop("hide",!0);t.attr("hide",!0);t.addClass("hide");i.objFinder.attributeOptions[n].options.hasOwnProperty(t.data("value"))&&i.objFinder.attributeOptions[n].options[t.data("value")].selectable&&(t.removeProp("hide"),t.removeAttr("hide"),t.removeClass("hide"))});break;case 12:u=r.find("#attr_"+n+" input");u.prop("disabled",!0);u.attr("disabled",!0);i.objFinder.attributeOptions[n].options.hasOwnProperty(u.val())&&i.objFinder.attributeOptions[n].options[u.val()].selectable&&(u.removeProp("disabled"),u.removeAttr("disabled"))}}};resellers.ProductFinder.prototype.ajxGetSgids=function(n){var t=this,i='<option value="0">--- '+t.DOMRefs.selectText+"---<\/option>";t.DOMRefs.sgidSelect.empty();t.DOMRefs.sgidSelect.attr("disabled","disabled");t.DOMRefs.sgidSelect.append(i);$.ajax({url:"/api/resellers/getSgids",accept:"application/json",data:{pgid:n},contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){if(n.length>0)for(var r=0;r<n.length;r++)n[r].ProductCount>0&&(i='<option value="'+n[r].Id+'">'+n[r].Names[t.DOMRefs.userLang]+"<\/option>",t.DOMRefs.sgidSelect.append(i));t.DOMRefs.sgidSelect.removeAttr("disabled")},error:function(xhr){var err=eval("("+xhr.responseText+")");console.log(err.Message)},cache:!1})};resellers.ProductFinder.prototype.insertUPSRBNotes=function(){var n=this,p,f,e,o,s,u,h="",c="",l="",a=0,v=0,y=0,r,i,t;$("#upsrb-notes").remove();$("#upsrb-message").remove();for(r in n.objFinder.attributeOptions)for(i in n.objFinder.attributeOptions[r].options)if(n.objFinder.attributeOptions[r].options[i].selectable)switch(parseInt(r)){case 9e3:a++;h=i;break;case 9001:v++;c=i;break;case 9002:y++;l=i}if(a===1&&v===1&&y<=1)for(t in n.objFinder.upsrbAttributes)if(p=n.objFinder.upsrbAttributes[t].MODEL_ID,f=n.objFinder.upsrbAttributes[t].UPS_MANUFACTURER,e=n.objFinder.upsrbAttributes[t].UPS_MODEL_NUMBER,o=n.objFinder.upsrbAttributes[t].VERSION,s=n.objFinder.upsrbAttributes[t].NOTES,h===f&&c===e&&l===o){u=n.DOMEls.div.clone();u.attr("id","upsrb-notes").html(s).addClass("alert alert-warning");u.insertAfter(n.DOMRefs.products);break}};resellers.ProductFinder.prototype.toggleFilterBar=function(){var n=this;$(".btn-group",n.DOMRefs.userFilters).length?n.DOMRefs.userFilters.slideDown("fast").removeClass("hidden"):n.DOMRefs.userFilters.slideUp("fast").addClass("hidden")};resellers.ProductFinder.prototype.toggleUPSRBVersionFilter=function(){var t=this,o=$("#filter_9000 input:checked"),s=$("#filter_9001 input:checked"),e=$("#filter_9002 input:checked"),i=0,r=0,u=0,n,f;for(n in t.objFinder.attributeOptions)for(f in t.objFinder.attributeOptions[n].options)if(t.objFinder.attributeOptions[n].options[f].selectable)switch(parseInt(n)){case 9e3:i++;break;case 9001:r++;break;case 9002:u++}$("#attr_9002").addClass("hide");i==1&&r==1&&u>1&&$("#attr_9002").removeClass("hide");e.length>0&&$("#attr_9002").removeClass("hide")};resellers.ProductFinder.prototype.updateAndFilterByAttributesAndModelObjects=function(){var n=this;n.isUPSRB?(n.objFinder.UPSRB_updateModelDisplayAndSelectableAttributes(),n.insertUPSRBNotes(),n.toggleUPSRBVersionFilter()):(n.objFinder.updateModelDisplayByAttributesOptions(),n.updateAttributeOptionsByVisibleModelsAttributes());n.filterModelListByModelAttributesDisplay();n.filterSidebarBySelectableAttributeOptions();n.updateMatchCountByVisibleModels()};resellers.ProductFinder.prototype.updateAttributeOption=function(n,t,i){var r=this;typeof n!="undefined"&&typeof t!="undefined"&&typeof i!="undefined"&&(r.objFinder.updateAttributeOption(n,t,i),r.DOMRefs.selectionsTracker.val(JSON.stringify(r.objFinder.selectionsTracker)))};resellers.ProductFinder.prototype.updateAttributeOptionsBySelectionsTracker=function(){var n=this;if(typeof n.DOMRefs.selectionsTracker.val()!="undefined"&&n.DOMRefs.selectionsTracker.val()!=""){if(n.objFinder.selectionsTracker=JSON.parse(n.DOMRefs.selectionsTracker.val()),n.objFinder.updateAttributeOptionsBySelectionsTracker(),n.DOMRefs.runtime.length){var i=n.DOMRefs.upsLoad.parents(".filterOptions").data("attrid"),r=n.DOMRefs.upsMinRt.parents(".filterOptions").data("attrid"),t=[];n.objFinder.selectionsTracker.hasOwnProperty(i)&&n.DOMRefs.upsLoad.val(Object.keys(n.objFinder.selectionsTracker[i])[0]);n.objFinder.selectionsTracker.hasOwnProperty(r)&&(t=Object.keys(n.objFinder.selectionsTracker[r])[0].split(":"),n.DOMRefs.upsMinRt.val(t[0]),n.DOMRefs.upsMaxRt.val(t[1]))}n.deselectAllFilterOptions()}};resellers.ProductFinder.prototype.updateAttributeOptionsByVisibleModelsAttributes=function(){var n=this,t,i,r,u;for(t in n.objFinder.attributeOptions)if(i=[6,7].indexOf(parseInt(n.objFinder.attributeOptions[t].filterStyleID))>=0?!0:!1,i&&(r=$("#filter_"+t+" input:checked",n.DOMRefs.sidebar).length?!0:!1),!i||i&&!r)for(u in n.objFinder.attributeOptions[t].options)n.objFinder.attributeOptions[t].options[u].selectable=!1;n.objFinder.updateAttributeOptionsByVisibleModelsAttributes()};resellers.ProductFinder.prototype.updateMatchCountByVisibleModels=function(){var n=this,i=n.DOMRefs.matchCount.parent(),t=n.objFinder.getVisibleModelsCount();n.DOMRefs.matchCount.text(t);t===1?n.DOMRefs.matchText.text(" Match"):n.DOMRefs.matchText.text(" Matches")};resellers.ProductFinder.prototype.updateModelListRuntimeDetails=function(n){var t=this,c=typeof n!="undefined"?!0:!1,u,e,f,s,h,r,o,i;if($(".runtime-group",t.DOMRefs.productsItem).each(function(n,t){t.remove()}),!c)for(o in t.objFinder.runtimeModels){for(u=t.DOMEls.div.clone().addClass("runtime-group").css("margin-left","120px"),runtimeHead=t.DOMEls.bold.clone().html("Runtime(s):"),e=t.DOMEls.ul.clone().addClass("runtime-list"),r=t.objFinder.runtimeModels[o],s=$("#model_"+o,t.DOMRefs.products),h=$(".item-caption > p",s),i=0;i<r.length;i++)f=t.DOMEls.li.clone().addClass("runtime-item"),runtimeMins=t.DOMEls.em.clone().html(Math.round(r[i].minutes_runtime)+" min"),f.append(runtimeMins),r[i].battery_description!=="INCLUDED BATTERIES"&&f.append(": + ("+r[i].battery_qty+") "+r[i].battery_description),e.append(f);u.append(runtimeHead);u.append(e);u.insertAfter(h)}};resellers.ProductFinder.prototype.updateRuntimeModels=function(n){var t=this,r=typeof n!="undefined"?!0:!1,f=t.objFinder.isPositiveInteger(t.DOMRefs.upsLoad.val())?t.DOMRefs.upsLoad.val():1500,i=t.objFinder.isPositiveInteger(t.DOMRefs.upsMinRt.val())?t.DOMRefs.upsMinRt.val():30,u=t.objFinder.isPositiveInteger(t.DOMRefs.upsMaxRt.val())?t.DOMRefs.upsMaxRt.val():t.objFinder.calcMaxRuntime(i);r?(t.objFinder.runtimeModels={},t.updateAndFilterByAttributesAndModelObjects(),t.updateModelListRuntimeDetails(r)):$.ajax({url:"/products/ajxGetModelsByRuntimes",data:{load:f,minRT:i,maxRT:u},success:function(n){n.SUCCESS?(t.objFinder.runtimeModels=n.DATA,t.updateAndFilterByAttributesAndModelObjects(),t.updateModelListRuntimeDetails()):(t.userFilterRemove(t.DOMRefs.runtime.find("h3").text()+": "+i+"-"+u),n.RETURNCODE=="SQL_NO_MATCHES"?alert(t.DOMRefs.rbLoadRuntimeSQLNoMatches.val()):alert(t.DOMRefs.rbRuntimErrorRetrieving.val()+": "+n.MESSAGE))},cache:!1})};resellers.ProductFinder.prototype.userFilterAdd=function(n,t,i){var r=this,e='<button type="button" class="btn btn-grey invert" data-btn-value="'+n+'">'+t+"<\/button>",o='<button type="button" class="btn btn-grey remove" data-btn-value="'+n+'"><span>&times;<\/span><\/button>',u='<div class="'+i+' btn-group btn-group-xs">'+e+o+"<\/div>",f;switch(i){case"typeBtn":r.DOMRefs.userFilterButtons.prepend(u);break;case"subTypeBtn":f=$(".typeBtn",r.DOMRefs.userFilters);f.length?$(u).insertAfter(f):r.DOMRefs.userFilterButtons.prepend(u);break;default:r.DOMRefs.userFilterButtons.append(u)}};resellers.ProductFinder.prototype.userFilterRemove=function(n){var t=this;$("button",t.DOMRefs.userFilters).each(function(){var t=$(this);t.data("btn-value")==n&&t.parents(".btn-group").remove()})};resellers.ProductFinder.prototype.userFilterRemoveAll=function(n){var t=this,i=$(".btn-group",t.DOMRefs.userFilters);i.each(function(){currButton=$(this);currButton.hasClass(n)&&currButton.remove()})};$(document).ready(function(){var n=new resellers.ProductFinder})