1(()=>{"use strict";var e=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))},t=function(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}
1if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},n=/ /g,r=function(){function r(e){this.baseURI="https://api.binderpos.com/shopify/filterTags/",this.divToAppendTo=document.querySelector(e.divToAppendTo),this.collectionType=e.collectionType,this.requestPath=e.requestPath,this.collectionHandle=e.collectionHandle,this.activeTags=e.activeTags.length>0?JSON.parse(e.activeTags):"",this.currentTags=e.collectionTags.length>0?JSON.parse(e.collectionTags):"",this.supportedTags=void 0,this.filterTags=void 0}return r.prototype.init=function(){var e=this;localStorage.getItem(this.collectionType)?(this.supportedTags=JSON.parse(localStorage.getItem(this.collectionType)),0==this.supportedTags.length&&(this.divToAppendTo.innerHTML='<p style="white-space: break-spaces; text-align: center;">Filters for '+this.collectionType+" not currently supported.</p>"),this.processBinderTags(),this.loadBinderTags().then((function(t){e.supportedTags=t,e.setLocalStorage()}))):(this.divToAppendTo.innerHTML='<p style="white-space: break-spaces; text-align: center;">Fetching Filters for the First Time</p>',this.loadBinderTags().then((function(t){0==t.length?e.divToAppendTo.innerHTML='<p style="white-space: break-spaces; text-align: center;">Filters for '+e.collectionType+" not currently supported.</p>":e.divToAppendTo.innerHTML="",e.supportedTags=t,e.setLocalStorage(),e.processBinderTags()})))},r.prototype.handleize=function(e){e=e.toLowerCase();for(var t=['"',"'","\\","(",")","[","]"],n=0;n<t.length;++n)e=e.replace(t[n],"");return"-"==(e=e.replace(/[^a-z^A-Z^0-9^é]+/g,"-")).charAt(e.length-1)&&(e=e.replace(/-+\z/,"")),"-"==e.charAt(0)&&(e=e.replace(/\A-+/,"")),e=e.replace("ø","o").replace("æ","ae").replace("å","a")},r.prototype.setLocalStorage=function(){localStorage.setItem(this.collectionType,JSON.stringify(this.supportedTags))},r.prototype.processBinderTags=function(){var e=this;this.supportedTags.forEach((function(t){e.filterTags=e.generateDisplayTags(t.tags);var n=e.generateFilterListCategory(t);e.filterTags.forEach((function(r){e.generateFilterListItem(r,n,t)}))})),this.initInputHandlers()},r.prototype.initInputHandlers=function(){var e=this;document.querySelectorAll("[filterCheckbox]").forEach((function(t){t.addEventListener("keyup",e.filter)}))},r.prototype.filter=function(e){for(var t=e.target.value.replace(n,"_").toUpperCase(),r=document.querySelectorAll("ul."+e.target.id+" li"),a=0;a<r.length;a++)r[a].getAttribute("filter-name").toUpperCase().includes(t)?r[a].classList.remove("hide"):r[a].classList.add("hide")},r.prototype.generateFilterListItem=function(e,t,r){var a=document.createElement("li");a.setAttribute("filter-name",e.tag.replace(n,"_").toUpperCase());var i=document.createElement("span");i.className="custom-checkbox";var o=document.createElement("a");e.active?(o.setAttribute("data-tagname",e.handle),o.className="selected",o.setAttribute("title","Remove "+e.tag+" from your selection"),o.href="#"):(0==this.activeTags.length?o.href="/collections/"+(this.collectionHandle?this.collectionHandle:"all")+"/"+e.handle:o.href=this.requestPath+"+"+e.handle,o.setAttribute("title","Filter by "+r.name+": "+e.tag));var s=document.createElement("span");s.className="filter-box",t.appendChild(a),a.appendChild(i),i.appendChild(o),o.appendChild(s),o.innerHTML+=" "+e.tag},r.prototype.generateFilterListCategory=function(e){var t=document.createElement("strong");if(t.innerHTML=e.name,this.divToAppendTo.appendChild(t),this.filterTags.length>6){var r=document.createElement("input");r.setAttribute("filterCheckbox",null),r.className="checkbox__search",r.setAttribute("placeholder","Search "+e.name+"s"),r.id=e.name.replace(n,"_").toUpperCase(),this.divToAppendTo.appendChild(r)}var a=document.createElement("ul");return a.className=e.name.replace(n,"_").toUpperCase(),this.divToAppendTo.appendChild(a),a},r.prototype.titleCaseWord=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):e},r.prototype.stringIncludes=function(e,t){return e.includes(t)},r.prototype.generateDisplayTags=function(e){var t=this;if(this.currentTags.length>=1e3||0===this.currentTags.length)this.filtered=e.map((function(e){return{tag:e,handle:t.handleize(e),active:!1}}));else{var n=e.map((function(e){return e.replace(/"/g,"'").toUpperCase()}));this.filtered=this.currentTags.filter((function(e){return t.stringIncludes(n,e.tag.toUpperCase())}))}return this.filtered.map((function(e){return t.stringIncludes(t.activeTags,e.tag)?(e.active=!0,e):(e.active=!1,e)}))},r.prototype.createShortCode=function(e){switch(e.toLowerCase()){case"mtg single":return"mtg";case"pokemon single":return"pkm";case"yu gi oh single":case"yugioh single":return"ygo";case"dragon ball super single":return"dbs";case"flesh and blood single":return"fab";default:return null}},r.prototype.fetchApi=function(e){return fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}}).then((function(e){if(!e.ok)throw new Error(e.statusText);return e.json()}))},r.prototype.loadBinderTags=function(){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return null===(e=this.createShortCode(this.collectionType))?[3,2]:[4,this.fetchApi(this.baseURI+e)];case 1:return[2,t.sent()];case 2:return[2,[]]}}))}))},r}();window.CollectionFilters=r})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.