PageSourceSearch

https://frederickwildman.com/wp-content/themes/affinity-custom-webpack/public/bundle.min.js?ver=1780421362

js frederickwildman.com collected 2026-10-02 07:06:24 UTC 130,718 bytes, 2 lines download raw bytes

1!function(){var e,t={
1"./src/js/_util.js":function(e,t,o){"use strict";o.r(t),o.d(t,{Util:function(){return n}});var r=o("./node_modules/jquery/dist/jquery.js"),n={$body:r("body"),wWidth:r(window).innerWidth(),wHeight:r(window).innerHeight(),$window:r(window),dataTrans:"",previousDataTrans:"",dataPage:"",pageType:"",primaryPage:!1,$curtain:r(".curtain-call"),$chatContainer:r(".chat-widget-container"),isMobile:function(){return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i250|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.
1substr(0,4)))},getURLPath:function(){return this.parsedUrl=new URL(window.location.href),this.parsedUrl.pathname},getRootURLPath:function(){return this.parsedUrl=new URL(window.location.href),this.parsedUrl.pathname.split("/")[1]},getExtendedURLPath:function(){return this.parsedUrl=new URL(window.location.href),this.parsedUrl.pathname},searchPageUrl:function(e){return this.parsedUrl=new URL(window.location.href),!!this.parsedUrl.pathname.split("/").includes(e,1)},searchPathNameArray:function(e){var t;return window.location.pathname.split("/").find((function(o,r){return t=o===e})),t},keys:{37:1,38:1,39:1,40:1},preventDefault:function(e){(e=e||window.event).preventDefault&&(e.preventDefault(),e.returnValue=!1)},preventDefaultForScrollKeys:function(e){if(n.keys[e.keyCode])return e.preventDefault(),!1},disableScroll:function(e){window.addEventListener&&(window.addEventListener("DOMMouseScroll",this.preventDefault,{passive:!1}),document.addEventListener("wheel",this.preventDefault,{passive:!1}),document.addEventListener("touchmove",this.preventDefault,{passive:!1}),window.onwheel=this.preventDefault,window.onmousewheel=document.onmousewheel=this.preventDefault,window.ontouchmove=this.preventDefault,document.onkeydown=this.preventDefaultForScrollKeys)},enableScroll:function(e){window.removeEventListener&&(window.removeEventListener("DOMMouseScroll",this.preventDefault,{passive:!1}),document.removeEventListener("wheel",this.preventDefault,{passive:!1}),document.removeEventListener("touchmove",this.preventDefault,{passive:!1}),window.onmousewheel=document.onmousewheel=null,window.onwheel=null,window.ontouchmove=null,document.onkeydown=null)},setCookie:function(e,t,o){var r="";if(o){var n=new Date;n.setTime(n.getTime()+24*o*60*60*1e3),r="; expires="+n.toUTCString()}document.cookie=e+"="+(t||"")+r+"; path=/"},getCookie:function(e){for(var t=e+"=",o=document.cookie.split(";"),r=0;r<o.length;r++){for(var n=o[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(t))return n.substring(t.length,n.length)}return null},eraseCookie:function(e){document.cookie=e+"=; Max-Age=-99999999;"},parseQuery:function(e){for(var t={},o=("?"===e[0]?e.substr(1):e).split("&"),r=0;r<o.length;r++){var n=o[r].split("=");
1t[decodeURIComponent(n[0])]=decodeURIComponent(n[1]||"")}return t},pad:function(e,t){return("000000000"+e).substr(-t)},setCSSvariable:function(){document.documentElement.style.setProperty("--vh","".concat(window.innerHeight/100,"px"))},unFocus:function(){if(document&&window){var e="::-moz-focus-inner{border:0 !important;}:focus{outline: none !important;",t=document.createElement("STYLE");window.unfocus=function(){document.getElementsByTagName("HEAD")[0].appendChild(t),document.addEventListener("mousedown",(function(){t.innerHTML=e+"}"})),document.addEventListener("keydown",(function(){t.innerHTML=""}))},unfocus.style=function(t){e+=t},unfocus()}},init:function(){}}},
1"./src/js/all-producers.js":function(e,t,o){"use strict";o.r(t);o("./node_modules/video.js/dist/video.es.js");var r=o("./node_modules/gsap/index.js"),n=o("./node_modules/gsap/ScrollTrigger.js"),i=o("./node_modules/gsap/ScrollToPlugin.js"),a=(o("./node_modules/swiper/swiper-bundle.mjs"),o("./node_modules/mixitup/dist/mixitup.js")),s=o.n(a),l=o("./node_modules/mixitup-multifilter/dist/mixitup-multifilter.js"),c=o.n(l),u=o("./node_modules/jquery/dist/jquery.js");function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r,n,i,a,s=[],l=!0,c=!1;try{if(i=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;l=!1}else for(;!(l=(r=i.call(o)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,n=e}finally{try{if(!l&&null!=o.return&&(a=o.return(),Object(a)!==a))return}finally{if(c)throw n}}return s}}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return m(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=Array(t);o<t;o++)r[o]=e[o];return r}r.gsap.registerPlugin(n.ScrollTrigger,i.ScrollToPlugin),s().use(c());var h={init:function(){document.querySelector(".producers-module__grid")&&(console.log("Initializing all producers page"),this.controlProducersFilter(),this.initFilters(),this.initSearch(),this.applyUrlFilters(),this.initScrollOptimizer())},controlProducersFilter:function(){u(".cta--search").on("click",(function(e){e.preventDefault(),u(this).parent(".cta-group--search").siblings(".producers-module__search").addClass("active")})),u(".producers-module__filter-header").on("click",(function(e){if(console.log("Filter header clicked"),e.preventDefault(),u(this).hasClass("active")){console.log("Closing filter dropdown"),u(this).removeClass("active"),u(this).siblings(".producers-module__filter-grid").stop().fadeOut(300,"swing"),u("html").removeClass("hidden");var t=window.scrollY;setTimeout((function(){window.scrollTo(0,t)}),50)}else{console.log("Opening filter dropdown"),u(this).addClass("active"),u(this).siblings(".producers-module__filter-grid").stop().fadeIn(300,"swing"),u("html").addClass("hidden");var o=u(".producers-module__filter-header").offset().top;console.log("Scrolling to position:",o),r.gsap.to(window,{duration:.5,scrollTo:{y:o,autoKill:!0},ease:"power2.out"})}})),u(".producers-module__filter-row").each((function(){var e=u(this),t=e.find(".producers-module__filter-more-btn"),o=e.find("ul.extra");o.length&&(t.css({display:"flex"}),t.on("click",(function(t){t.preventDefault(),t.stopPropagation(),console.log("More button clicked in",e.find(".producers-module__filter-category").text().trim()),u(this).toggleClass("active"),o.stop().slideToggle(300,"swing"),u(this).hasClass("active")?u(this).text("Less"):u(this).text("More")})))})),u(".producers-module__filter-category").on("click",(function(e){e.preventDefault(),u(this).hasClass("active")?(u(this).removeClass("active"),u(this).siblings(".producers-module__filter-list").stop().slideUp(300,"swing")):(u(this).addClass("active"),u(this).siblings(".producers-module__filter-list").stop().slideDown(300,"swing"))}));var e="mobile";u(window).on("resize",(function(){u(window).innerWidth()>760?"mobile"==e&&(u(".producers-module__filter-header").removeClass("active"),u(".producers-module__filter-grid").show(),u("html").removeClass("hidden"),e="desktop"):"desktop"==e&&(u(".producers-module__filter-grid").hide(),e="mobile")})).resize()},initFilters:function(){var e=document.querySelector(".producers-module__grid");if(e){var t=e.querySelectorAll(".producers-module__grid-item"),o=document.querySelectorAll('.producers-module__filter-list input[type="checkbox"]'),n=document.getElementById("portfolio-all"),i=document.querySelector(".clear-filters"),a=document.querySelector(".section--producers");r.gsap.defaults({duration:.3,ease:"power2.inOut"});var s,l,c,d=(s=function(){var e,n,i,s=Array.from(o).filter((function(e){return e.checked&&"portfolio-all"!==e.id&&e.id.startsWith("portfolio-")})).map((function(e){return e.getAttribute("data-filter")})),l=Array.from(o).filter((function(e){return e.checked&&e.id.startsWith("country-")})).map((function(e){return e.getAttribute("data-filter")})),c=Array.from(o).filter((function(e){return e.checked&&e.id.startsWith("web-region-")})).map((function(e){return e.getAttribute("data-filter")})),d=Array.from(o).filter((function(e){return e.checked&&e.id.startsWith("producer-")})).map((function(e){return e.getAttribute("data-filter")})),f=Array.from(o).filter((function(e){return e.checked&&e.id.startsWith("state-")})).map((function(e){return e.getAttribute("data-filter")})),m=Array.from(o).filter((function(e){return e.checked&&e.id.startsWith("product-type-")})).map((function(e){return e.getAttribute("data-filter")})),h=Array.from(o).filter((function(e){return e.checked&&e.id.startsWith("wine-category-")})).map((function(e){return e.getAttribute("data-filter")})),v=Array.from(o).filter((function(e){return e.checked&&e.id.startsWith("color-")}
1)).map((function(e){return e.getAttribute("data-filter")})),g=Array.from(o).filter((function(e){return e.checked&&e.id.startsWith("non-wine-category-")})).map((function(e){return e.getAttribute("data-filter")})),_=Array.from(o).some((function(e){return e.checked&&e.id.startsWith("product-type-")&&e.id.toLowerCase().includes("wine")&&!e.id.toLowerCase().includes("fortified")})),w=Array.from(o).some((function(e){return e.checked&&e.id.startsWith("product-type-")&&(e.id.toLowerCase().includes("spirit")||e.id.toLowerCase().includes("fortified"))}));document.querySelectorAll(".producers-module__filter-row").forEach((function(t){var o=t.querySelector(".producers-module__filter-category");o&&("Wine Categories"===o.textContent.trim()?e=t:"Wine Colors"===o.textContent.trim()?n=t:"Non-Wine Categories"===o.textContent.trim()&&(i=t))})),e&&(_||h.length>0?e.style.display="":(e.style.display="none",_||document.querySelectorAll('input[id^="wine-category-"]').forEach((function(e){e.checked=!1})))),n&&(_||v.length>0?n.style.display="":(n.style.display="none",_||document.querySelectorAll('input[id^="color-"]').forEach((function(e){e.checked=!1})))),i&&(w||g.length>0?i.style.display="":(i.style.display="none",w||document.querySelectorAll('input[id^="non-wine-category-"]').forEach((function(e){e.checked=!1})))),document.querySelectorAll(".producers-module__filter-list li.disabled").forEach((function(e){e.classList.remove("disabled");var t=e.querySelector('input[type="checkbox"]');t&&(t.disabled=!1)}));var y=[].concat(p(s),p(l),p(c),p(d),p(f),p(m),p(h),p(v),p(g)),b=new URL(window.location.pathname,window.location.origin),S=[];s.length>0&&S.push("portfolio=".concat(s.map((function(e){return e.replace(".","")})).join(","))),l.length>0&&S.push("country=".concat(l.map((function(e){return e.replace(".country-","")})).join(","))),c.length>0&&S.push("web_region=".concat(c.map((function(e){return e.replace(".web-region-","")})).join(","))),f.length>0&&S.push("state=".concat(f.map((function(e){return e.replace(".state-","")})).join(","))),d.length>0&&S.push("producer_filter=".concat(d.map((function(e){return e.replace(".producer-","")})).join(","))),m.length>0&&S.push("product_type=".concat(m.map((function(e){return e.replace(".product-type-","")})).join(","))),h.length>0&&S.push("wine_category=".concat(h.map((function(e){return e.replace(".wine-category-","")})).join(","))),v.length>0&&S.push("color=".concat(v.map((function(e){return e.replace(".color-","")})).join(","))),g.length>0&&S.push("non_wine_category=".concat(g.map((function(e){return e.replace(".non-wine-category-","")})).join(",")));var C=b.pathname;S.length>0&&(C+="?"+S.join("&")),window.history.replaceState({},"",C);var L=document.querySelector(".clear-filters span");L&&(L.textContent=y.length||"0");var E=new Set;t.forEach((function(e){var t=0===s.length||s.some((function(t){return e.classList.contains(t.replace(".",""))})),o=0===l.length||l.some((function(t){return e.classList.contains(t.replace(".",""))})),r=0===c.length||c.some((function(t){return e.classList.contains(t.replace(".",""))})),n=0===f.length||f.some((function(t){return e.classList.contains(t.replace(".",""))})),i=0===h.length||h.some((function(t){return e.classList.contains(t.replace(".",""))})),a=0===v.length||v.some((function(t){return e.classList.contains(t.replace(".",""))})),u=0===g.length||g.some((function(t){return e.classList.contains(t.replace(".",""))}));if(t&&o&&r&&n&&i&&a&&u){var d=Array.from(e.classList).filter((function(e){return e.startsWith("producer-")}));d.length>0&&E.add(d[0].replace("producer-",""))}}));var k=Array.from(document.querySelectorAll('.producers-module__filter-list input[type="checkbox"][id^="producer-"]')),A=[];k.forEach((function(e){var t=e.id.replace("producer-",""),o=e.closest("li");E.has(t)||0===y.length?(o.classList.remove("disabled"),e.disabled=!1,A.push(e)):(o.classList.add("disabled"),e.disabled=!0,e.checked&&(e.checked=!1))}));var x=document.querySelector(".producers-module__filter-row:nth-child(4) .producers-module__filter-list > ul:not(.extra)"),q=document.querySelector(".producers-module__filter-row:nth-child(4) .producers-module__filter-list > ul.extra"),j=document.querySelector(".producers-module__filter-row:nth-child(4) .producers-module__filter-more-btn");if(x&&q&&j){var T=x.querySelectorAll("li:not(.disabled)"),P=q.querySelectorAll("li:not(.disabled)");T.length,P.length,T.length<5&&P.length>0&&A.length>0&&(console.log("Moving producers from extra to main list. Currently have ".concat(T.length," visible in main, ").concat(P.length," in extra")),A.slice(0,5).forEac
1h((function(e){var t=e.closest("li");t.parentElement===q&&T.length<5&&(x.appendChild(t),console.log("Moved ".concat(e.id," to main list")))})));var I=q.querySelectorAll("li:not(.disabled)").length>0;j.style.display=I?"flex":"none";var D=document.querySelector(".producers-module__filter-row:nth-child(4) .producers-module__filter-category");0===A.length&&D?D.classList.add("no-results"):D&&D.classList.remove("no-results")}var O=new Set;t.forEach((function(e){var t=0===y.length,o=0===s.length||s.some((function(t){return e.classList.contains(t.replace(".",""))})),r=0===l.length||l.some((function(t){return e.classList.contains(t.replace(".",""))})),n=0===c.length||c.some((function(t){return e.classList.contains(t.replace(".",""))})),i=0===d.length||d.some((function(t){return e.classList.contains(t.replace(".",""))})),a=0===f.length||f.some((function(t){return e.classList.contains(t.replace(".",""))})),u=0===m.length||m.some((function(t){return e.classList.contains(t.replace(".",""))})),p=0===h.length||h.some((function(t){return e.classList.contains(t.replace(".",""))})),_=0===v.length||v.some((function(t){return e.classList.contains(t.replace(".",""))})),w=0===g.length||g.some((function(t){return e.classList.contains(t.replace(".",""))}));(t||o&&r&&n&&i&&a&&u&&p&&_&&w)&&O.add(e)})),function(e){if(u(".producers-module__filter-header").hasClass("active"))"function"==typeof e&&e();else{var t=a?a.offsetTop:0;window.scrollY>t+50?window.isScrolling||(window.isScrolling=!0,r.gsap.to(window,{duration:.5,scrollTo:{y:t,autoKill:!0},ease:"power2.out",onComplete:function(){window.isScrolling=!1,"function"==typeof e&&e()}})):"function"==typeof e&&e()}}((function(){!function(e,t){if(e.length){var o=document.querySelector(".producers-module__grid");if(o){o.classList.add("filtering");var r=Array.from(e);setTimeout((function(){r.forEach((function(e){t.has(e)||(e.style.display="none")})),r.forEach((function(e){t.has(e)&&(e.style.display="block",e.style.opacity="1",e.style.transform="scale(1)")})),setTimeout((function(){o.classList.remove("filtering")}),300)}),250)}}}(t,O)}))},l=100,function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var r=document.querySelector(".producers-module__grid");r&&r.classList.add("filtering"),clearTimeout(c),c=setTimeout((function(){return s.apply(void 0,t)}),l)});i&&i.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),console.log("Clear filters clicked"),o.forEach((function(e){e.checked=!1})),n&&(n.checked=!0),document.querySelectorAll(".producers-module__filter-list li.disabled").forEach((function(e){e.classList.remove("disabled");var t=e.querySelector('input[type="checkbox"]');t&&(t.disabled=!1)}));var t=document.querySelector(".producers-module__filter-row:nth-child(4) .producers-module__filter-category");t&&t.classList.remove("no-results");var r=document.querySelector(".producers-module__filter-row:nth-child(4) .producers-module__filter-list > ul:not(.extra)"),i=document.querySelector(".producers-module__filter-row:nth-child(4) .producers-module__filter-list > ul.extra"),a=document.querySelector(".producers-module__filter-row:nth-child(4) .producers-module__filter-more-btn");r&&i&&a&&i.querySelectorAll("li").length>0&&(a.style.display="flex");var s=u(".producers-module__filter-header"),l=u(".producers-module__filter-grid"),c=u(window).innerWidth();c<=760&&s.hasClass("active")?(s.removeClass("active"),l.stop().fadeOut(300,"swing",(function(){u("html").removeClass("hidden"),d()}))):d(),console.log("HTML hidden class removed:",!u("html").hasClass("hidden")),console.log("Filter header active class:",s.hasClass("active")),console.log("Window width:",c)})),o.forEach((function(e){e.addEventListener("change",(function(){"portfolio-all"===e.id?e.checked&&o.forEach((function(e){"portfolio-all"!==e.id&&e.id.startsWith("portfolio-")&&(e.checked=!1)})):e.id.startsWith("portfolio-")&&(n.checked=!1),d()}))})),setTimeout((function(){var e=Array.from(o).some((function(e){return e.checked&&e.id.startsWith("product-type-")&&e.id.toLowerCase().includes("wine")&&!e.id.toLowerCase().includes("fortified")})),t=Array.from(o).some((function(e){return e.checked&&e.id.startsWith("product-type-")&&(e.id.toLowerCase().includes("spirit")||e.id.toLowerCase().includes("fortified"))}));document.querySelectorAll(".producers-module__filter-row").forEach((function(o){var r=o.querySelector(".producers-module__filter-category");r&&("Wine Categories"===r.textContent.trim()||"Wine Colors"===r.textContent.trim()?e||(o.style.display="none"):"Non-Wine Categories"===r.textContent.trim()&&(t||(o.style.display="none")))}))}),100)}else console.log("Producers grid container not found")},initSearch:function(){var e=document.querySelector(".producers-module__grid");if(e){var t,o,n,i=e.querySelectorAll(".producers-module__grid-item"),a=document.querySelector(".producers-module__search input"),s=document.querySelector(".section--producers"),l=(t=function(e){e=e.toLowerCase().trim();var t=document.getElementById("portfolio-all");t&&(t.checked=!0),document.querySelectorAll('.producers-module__filter-list input[type="checkbox"]').forEach((function(e){"portfolio-all"!==e.id&&(e.checked=!1)})),document.querySelectorAll(".producers-module__filter-list li.disabled").forEach((function(e){e.classList.remove("disabled");var t=e.querySelector('input[type="checkbox"]');t&&(t.disabled=!1)}));var o,n,a=new Set;
1i.forEach((function(t){var o=t.querySelector(".producers-module__grid-item-title"),r=t.querySelector(".producers-module__grid-item-region");(e.length<3||o&&o.textContent.toLowerCase().includes(e)||r&&r.textContent.toLowerCase().includes(e))&&a.add(t)})),o=function(){!function(e,t){if(e.length){var o=document.querySelector(".producers-module__grid");if(o){o.classList.add("filtering");var r=Array.from(e);setTimeout((function(){r.forEach((function(e){t.has(e)||(e.style.display="none")})),r.forEach((function(e){t.has(e)&&(e.style.display="block",e.style.opacity="1",e.style.transform="scale(1)")})),setTimeout((function(){o.classList.remove("filtering")}),300)}),250)}}}(i,a)},n=s?s.offsetTop:0,window.scrollY>n+50?window.isScrolling||(window.isScrolling=!0,r.gsap.to(window,{duration:.5,scrollTo:{y:n,autoKill:!0},ease:"power2.out",onComplete:function(){window.isScrolling=!1,"function"==typeof o&&o()}})):"function"==typeof o&&o()},o=300,function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];clearTimeout(n),n=setTimeout((function(){return t.apply(void 0,r)}),o)});a&&a.addEventListener("input",(function(){l(a.value)}))}else console.log("Producers grid container not found")},applyUrlFilters:function(){var e=function(){var e={},t=window.location.search.substring(1);if(t){var o,r=function(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=f(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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 i,a=!0,s=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==o.return||o.return()}finally{if(s)throw i}}}}(t.split("&"));try{for(r.s();!(o=r.n()).done;){var n=d(o.value.split("="),2),i=n[0],a=n[1];e[decodeURIComponent(i)]=decodeURIComponent(a||"")}}catch(e){r.e(e)}finally{r.f()}}return e}(),t=e.portfolio,o=e.country,r=e.state,n=e.producer_filter||e.producer,i=e.product_type,a=e.wine_category,s=e.color,l=e.non_wine_category,c=e.web_region;if(t||o||r||n||i||a||s||l||c){console.log("Applying URL filters:",{portfolioParam:t,countryParam:o,stateParam:r,producerParam:n,productTypeParam:i,wineCategoryParam:a,colorParam:s,nonWineParam:l,webRegionParam:c}),document.body.classList.add("filtering-from-url");var u=document.getElementById("portfolio-all");setTimeout((function(){!function(){if(t){var e=t.split(",");console.log("Applying portfolio URL filters:",e),u&&(u.checked=!1),e.forEach((function(e){var t=document.getElementById("portfolio-".concat(e));t?(console.log("Found and checking portfolio filter:",t.id),t.checked=!0):console.log("Could not find checkbox for portfolio filter:",e)}))}if(o){var d=o.split(",");console.log("Applying country URL filters:",d),d.forEach((function(e){var t=document.getElementById("country-".concat(e));t?(console.log("Found and checking country filter:",t.id),t.checked=!0):console.log("Could not find checkbox for country filter:",e)}))}if(c){var p=c.split(",");console.log("Applying web region URL filters:",p),p.forEach((function(e){var t=document.getElementById("web-region-".concat(e));t?(console.log("Found and checking web region filter:",t.id),t.checked=!0):console.log("Could not find checkbox for web region filter:",e)}))}if(r){var f=r.split(",");console.log("Applying market URL filters:",f),f.forEach((function(e){var t=document.getElementById("state-".concat(e));t?(console.log("Found and checking market filter:",t.id),t.checked=!0):console.log("Could not find checkbox for market filter:",e)}))}if(n){var m=n.split(",");console.log("Applying producer URL filters:",m),m.forEach((function(e){var t=document.getElementById("producer-".concat(e));t?(console.log("Found and checking producer filter:",t.id),t.checked=!0):console.log("Could not find checkbox for producer filter:",e)}))}if(i){var h=i.split(",");console.log("Applying product type URL filters:",h),h.forEach((function(e){var t,o,r,n=document.getElementById("product-type-".concat(e));n?(console.log("Found and checking product type filter:",n.id),n.checked=!0,e.toLowerCase().includes("wine")&&!e.toLowerCase().includes("fortified")&&(
1document.querySelectorAll(".producers-module__filter-row").forEach((function(e){var r=e.querySelector(".producers-module__filter-category");r&&("Wine Categories"===r.textContent.trim()?t=e:"Wine Colors"===r.textContent.trim()&&(o=e))})),t&&(t.style.display=""),o&&(o.style.display="")),(e.toLowerCase().includes("spirit")||e.toLowerCase().includes("fortified"))&&(document.querySelectorAll(".producers-module__filter-row").forEach((function(e){var t=e.querySelector(".producers-module__filter-category");t&&"Non-Wine Categories"===t.textContent.trim()&&(r=e)})),r&&(r.style.display=""))):console.log("Could not find checkbox for product type filter:",e)}))}if(a){var v=a.split(",");console.log("Applying wine category URL filters:",v),v.forEach((function(e){var t=document.getElementById("wine-category-".concat(e));t?(console.log("Found and checking wine category filter:",t.id),t.checked=!0):console.log("Could not find checkbox for wine category filter:",e)}))}if(s){var g=s.split(",");console.log("Applying color URL filters:",g),g.forEach((function(e){var t=document.getElementById("color-".concat(e));t?(console.log("Found and checking color filter:",t.id),t.checked=!0):console.log("Could not find checkbox for color filter:",e)}))}if(l){var _=l.split(",");console.log("Applying non-wine category URL filters:",_),_.forEach((function(e){var t=document.getElementById("non-wine-category-".concat(e));t?(console.log("Found and checking non-wine category filter:",t.id),t.checked=!0):console.log("Could not find checkbox for non-wine category filter:",e)}))}var w=new Event("change"),y=document.querySelector('.producers-module__filter-list input[type="checkbox"]:checked');y?y.dispatchEvent(w):u&&u.dispatchEvent(w),setTimeout((function(){document.body.classList.remove("filtering-from-url")}),500)}()}),300)}},initScrollOptimizer:function(){var e;window.addEventListener("scroll",(function(){document.body.classList.contains("scrolling")||document.body.classList.add("scrolling"),clearTimeout(e),e=setTimeout((function(){document.body.classList.remove("scrolling")}),150)}),{passive:!0})}};t.default=h},
1"./src/js/app.js":function(e,t,o){"use strict";o.r(t);o("./src/js/_util.js");var r=o("./node_modules/gsap/index.js"),n=o("./node_modules/gsap/ScrollTrigger.js"),i=o("./node_modules/gsap/DrawSVGPlugin.js"),a=o("./node_modules/swiper/swiper-bundle.mjs"),s=o("./src/js/search.js"),l=o("./node_modules/jquery/dist/jquery.js");r.gsap.registerPlugin(n.ScrollTrigger,i.DrawSVGPlugin);var c={checkTouchDevice:function(){"ontouchstart"in document.documentElement?l("body").addClass("touch-device"):l("body").addClass("no-touch-device")},detectChromeWindows:function(){var e=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),t=/Windows/.test(navigator.userAgent);e&&t&&document.body.classList.add("chrome-windows")},mailgo:function(e){function mailgo(){return e.apply(this,arguments)}return mailgo.toString=function(){return e.toString()},mailgo}((function(){mailgo({dark:!1,showFooter:!1,actions:{telegram:!1,whatsapp:!1,skype:!1,copy:!0},details:{subject:!0,body:!1,to:!0,cc:!1,bcc:!1}}),this.handleMailgoAccessibility()})),handleMailgoAccessibility:function(){var e=function(e){e.forEach((function(e){e.getAttribute("aria-label")||e.setAttribute("aria-label","Mail action"),e.textContent.trim()||(e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1")),e.getAttribute("role")||e.setAttribute("role","button")}))},t=document.querySelectorAll('a[id^="m-"], a.m-open, a.m-custom-action, a[href^="#mailgo-"]');e(t),new MutationObserver((function(t){t.forEach((function(t){"childList"===t.type&&t.addedNodes.length&&t.addedNodes.forEach((function(t){if(1===t.nodeType){(t.id&&t.id.startsWith("m-")||t.classList&&(t.classList.contains("m-open")||t.classList.contains("m-custom-action"))||t.getAttribute&&t.getAttribute("href")&&t.getAttribute("href").startsWith("#mailgo-"))&&e([t]);var o=t.querySelectorAll('a[id^="m-"], a.m-open, a.m-custom-action, a[href^="#mailgo-"]');o.length&&e(o)}}))}))})).observe(document.body,{childList:!0,subtree:!0})},initPrintFunctionality:function(){var e=document.querySelectorAll(".cta--print");e.length&&(document.body.setAttribute("data-url",window.location.href),e.forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),window.print(),setTimeout((function(){document.body.classList.remove("is-printing")}),100)}))})))},prepareBackgroundImagesForPrint:function(){document.querySelectorAll("img").forEach((function(e){e.classList.contains("print-image")&&(e.style.display="block")}))},initSocialSharing:function(){document.querySelectorAll(".cta--share").forEach((function(e){var t;if(e){var o=null===(t=e.closest(".cta-wrapper"))||void 0===t?void 0:t.querySelector(".banner-module__social, .products-about-module__social");o&&(e.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation(),document.querySelectorAll(".banner-module__social.active, .products-about-module__social.active").forEach((function(e){var t;e!==o&&(e.classList.remove("active"),null===(t=e.closest(".cta-wrapper").querySelector(".cta--share"))||void 0===t||t.classList.remove("active"))})),o.classList.toggle("active"),e.classList.toggle("active")})),o.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation();var r=t.target.closest(".banner-module__social-item, .products-about-module__social-item");if(r){var n=r.dataset.network,i=window.location.href,a=document.title||"",s="";switch(n){case"facebook":s="https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(i));break;case"twitter":s="https://twitter.com/intent/tweet?url=".concat(encodeURIComponent(i),"&text=").concat(encodeURIComponent(a))}s&&(window.open(s,"_blank","width=600,height=400"),o.classList.remove("active"),e.classList.remove("active"))}})))}})),document.addEventListener("click",(function(e){e.target.closest(".cta-wrapper")||(document.querySelectorAll(".banner-module__social, .products-about-module__social").forEach((function(e){e.classList.remove("active")})),document.querySelectorAll(".cta--share").forEach((function(e){e.classList.remove("active")})))}))},checkDeviceWidth:function(){var e="mobile";l(window).on("resize",(function(){l(window).outerWidth()>1200?"mobile"==e&&(l(".header").removeClass("header--open"),l(".header, .header__wrapper, .header__overlay").removeClass("active"),l(".main-menu").removeClass("main-menu--open"),l(".main-menu__wrapper").scrollTop(0),l(".main-menu__toggle-btn--close").removeClass("main-menu__toggle-btn--close"),l(".main-menu__link.active").removeClass("active"),l(".main-menu__link").css({opacity:"1"}),l(".sub-menu__list").fadeOut(0),l(".sub-menu__list").slideUp(0),l(".header .search-bar").fadeOut(0),l("html").removeClass("hidden"),l(".producers-portfolio-module.active").removeClass("active"),l(".producers-portfolio-module__filter").css({display:"flex"}),l(".scores-module.active").removeClass("active"),l(".scores-module__filter").css({display:"flex"}),e="desktop"):"desktop"==e&&(l(".header, .header__wrapper, .header__overlay").removeClass("active"),l(".main-menu").removeClass("main-menu--open"),l(".main-menu__link.active").removeClass("active"),l(".main-menu__link").css({opacity:"1"}),l(".sub-menu__list").fadeOut(0),l(".sub-menu__list").slideUp(0),l(".header .search-bar").fadeOut(0),l(".producers-portfolio-module__filter").hide(),l(".
1scores-module__filter").hide(),e="mobile")})).resize()},controlAnimation:function(){l(window).on("resize",(function(){l("body").addClass("no-animation"),setTimeout((function(){l(".no-animation").removeClass("no-animation")}),200)})).resize()},controlAnchors:function(){var e;if(sessionStorage&&sessionStorage.getItem("session")){e=sessionStorage.getItem("session");var t=l(e.split("?")[0]);t.length&&setTimeout((function(){l("html, body").animate({scrollTop:t.offset().top},850,"swing"),sessionStorage.clear()}),300)}l('a[href*="#"]').on("click",(function(e){e.preventDefault();var t=l(this).attr("href"),o=this.hash.split("?"),r=o[0],n=o[1],i=l(r),a=new URL(t,window.location.origin);if(a.hostname===window.location.hostname&&a.pathname===window.location.pathname)l("header").hasClass("header--open")?l(".main-menu__toggle-btn").trigger("click"):l(".header__overlay").hasClass("active")&&l(".header__overlay").trigger("mouseenter"),l("html, body").animate({scrollTop:i.offset().top},850,"swing");else{sessionStorage.setItem("session",this.hash);var s=n?"".concat(a.pathname,"?").concat(n):a.pathname;window.location.href=s}}))},controlHeader:function(){var e=0;l(document).ready((function(){var e=l(window).scrollTop(),t=l(window).height(),o=l(document).height();e>0&&e+t<o-100&&l(".header").addClass("header--scroll")})),l(window).on("scroll",(function(){var t=l(window).scrollTop(),o=l(window).height(),r=l(document).height();t>0&&t+o<r-100?l(".header:not(.active)").toggleClass("header--hide",t>e):t+o>=r-50?l(".header:not(.active)").addClass("header--hide"):l(".header:not(.active)").removeClass("header--hide"),l(".header:not(.active)").toggleClass("header--scroll",t>0),e=t}))},initAgeGate:function(){var e=document.querySelector(".age-gate-module"),t=document.querySelector(".age-gate-module__btn"),o=document.getElementById("month"),r=document.getElementById("day"),n=document.getElementById("year"),i=new Date,a=i.getFullYear(),s=i.getMonth()+1,l=i.getDate(),c=a-21;document.cookie.includes("ageVerified=true")||(e.style.display="flex",o&&o.focus()),o&&o.addEventListener("input",(function(){this.value.length>=2&&r.focus()})),r&&r.addEventListener("input",(function(){this.value.length>=2&&n.focus()})),t.addEventListener("click",(function(t){t.preventDefault();var i=parseInt(o.value,10),u=parseInt(r.value,10),d=parseInt(n.value,10);!i||!u||!d||i<1||i>12||u<1||u>31||d<1900||d>a?alert("Please enter a valid birthdate."):d>c||d===c&&(i>s||i===s&&u>l)?alert("You must be 21 or older to enter."):(document.cookie="ageVerified=true; path=/; max-age=2592000",e.classList.add("hide"))}))},getCopyrightYear:function(){var e=(new Date).getFullYear();l(".footer .year").html(e)},controlMainMenu:function(){function e(){l(".header").removeClass("header--open"),l(".main-menu__toggle-btn").removeClass("main-menu__toggle-btn--close"),l(".header").removeClass("active"),l("html").removeClass("hidden")}l(".main-menu__toggle-btn").on("click",(function(){l(this).hasClass("main-menu__toggle-btn--close")?e():(l(".header").addClass("header--open"),l(".header, .header__wrapper, .header__overlay").removeClass("active"),l(".main-menu__wrapper").scrollTop(0),l(".main-menu__toggle-btn").addClass("main-menu__toggle-btn--close"),l(".header").addClass("active"),l(".sub-menu__list").fadeOut(0),l(".sub-menu__list").slideUp(0),l(".main-menu__link.active").removeClass("active"),l(".main-menu__link").css({opacity:"1"}),l("html").addClass("hidden"),l(".header .search-bar").stop().fadeOut(300))})),l(".main-menu__link").on("click",(function(e){var t=l(window).outerWidth();l(this).siblings(".sub-menu__list").length>0&&(e.preventDefault(),l(this).siblings(".sub-menu__list").is(":visible")?(l(this).removeClass("active"),t>1200?l(this).siblings(".sub-menu__list").stop().fadeOut(300):l(this).siblings(".sub-menu__list").stop().slideUp(300),l(".header, .header__wrapper, .header__overlay").removeClass("active"),l(".main-menu__link").css({opacity:"1"}),l(".header .search-btn").css({opacity:"1"})):(l(this).addClass("active").css({opacity:"1"}),t>1200?l(this).siblings(".sub-menu__list").stop().fadeIn(300):l(this).siblings(".sub-menu__list").stop().slideDown(300),l(".header, .header__wrapper, .header__overlay").addClass("active"),l(".main-menu__link").not(this).removeClass("active"),l(".main-menu__link").not(this).css({opacity:"0.4"}),l(".main-menu__link").not(this).siblings(".sub-menu__list").stop().fadeOut(300),t>1200?(l(".main-menu__link").not(this).siblings(".sub-menu__list").stop().fadeOut(300),l(".header .search-btn").css({opacity:"0.4"})):l(".main-menu__link").not(this).siblings(".sub-menu__list").stop().slideUp(300))),l(".header .search-bar").is(":visible")&&l(".header .search-bar").stop().fadeOut(300)})),l(".header .search-btn").on("click",(function(t){var o=l(window).outerWidth();l(".header .search-bar").is(":visible")?(o>1200&&l(".main-menu__link").css({opacity:"1"}),l(".header, .header__wrapper, .header__overlay").removeClass("active"),l(".header .search-bar").stop().fadeOut(300)):(o>1200?(l(".main-menu__link").css({opacity:"0.4"}),l(".header .main-menu__link").siblings(".sub-menu__list").is(":visible")&&(l(".header .main-menu__link.active").removeClass("active"),l(".header .main-menu__link").siblings(".sub-menu__list").stop().fadeOut(300))):e(),l(".header, .header__wrapper, .header__overlay").addClass("active"),l(".header .search-bar").stop().fadeIn(300),l(this).css({opacity:"1"}))})),l(".header__overlay").on("mouseenter",(function(){l(".main-menu__link").siblings(".sub-menu__list").stop().fadeOut(300),l(".main-menu__link.active").removeClass("active"),l(".header, .header__wrapper, .header__overlay").removeClass("active"),l(".main-menu__link").css({opacity:"1"}),l(".header .search-btn").css({opacity:"1"}),l(".header .search-bar").stop().fadeOut(300)})),l(".sub-menu__list").each((function(){l(this).parent(".main-menu__item").addClass("main-menu__item--has-sub-menu")}))},controlProducersIntro:function(){l(".cta--read-more").on("click",(function(e){e.preventDefault(),l(this).parents(".section--producers-intro").siblings(".section--producers-intro").find(".producers-intro-module--additional-info").is(":visible")?(l(this).removeClass("active"),l(this).parents(".section--producers-intro").siblings(".section--producers-intro").find(".producers-intro-module--additional-info").slide
1Up(400,"swing").css({opacity:"0"})):(l(this).addClass("active"),l(this).parents(".section--producers-intro").siblings(".section--producers-intro").find(".producers-intro-module--additional-info").slideDown(400,"swing").css({opacity:"1"}))}))},controlProductFilter:function(){l(".products-about-module__title h1").on("click",(function(e){if(e.preventDefault(),l(this).siblings(".products-about-module__dropdown").is(":visible"))l(this).siblings(".products-about-module__dropdown").stop().fadeOut(300),l(this).siblings(".products-about-module__overlay").stop().fadeOut(300);else{l(this).siblings(".products-about-module__dropdown").stop().fadeIn(300),l(this).siblings(".products-about-module__overlay").stop().fadeIn(300);var t=l(".products-about-module__producer").offset().top-4*l(window).width()/100;l("html, body").animate({scrollTop:t},500,"swing")}})),l(".products-about-module__overlay").on("click",(function(e){e.preventDefault(),l(this).stop().fadeOut(300),l(this).siblings(".products-about-module__dropdown").stop().fadeOut(300)}))},controlAbout:function(){l(".about-module__swiper").length&&l(window).on("scroll",(function(){l(this).scrollTop()>100?l(".about-module__swiper.step-1").removeClass("step-1").addClass("step-2"):l(".about-module__swiper.step-2").removeClass("step-2").addClass("step-1")}))},controlMarkets:function(){l(".no-touch-device .markets-module__item-content").on("mouseenter",(function(){l(this).parent(".markets-module__item").addClass("active")})),l(".no-touch-device .markets-module__item").on("mouseleave",(function(){l(this).removeClass("active")}))},controlAnchorBar:function(){if(document.body.classList.contains("single-producer")||document.body.classList.contains("single-products")){var e=function(){var e=u.offset().top,t=e+u.outerHeight(),o=l(window).scrollTop(),r=o+l(window).height();return t>o&&e<r};document.querySelectorAll("section[id]").length>0&&(document.querySelector(".anchor-bar").classList.add("active"),document.querySelectorAll("section[id]").forEach((function(e){var t=e.id,o=t.replace(/-/g," "),r=document.createElement("a");r.href="#"+t,r.textContent=o,document.querySelector(".anchor-bar__menu").appendChild(r)})),document.querySelectorAll('.anchor-bar__menu a[href^="#"]').forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault();var o=document.querySelector(this.hash);e.classList.add("current"),document.querySelectorAll(".anchor-bar__menu a").forEach((function(t){t!==e&&t.classList.remove("current")})),o&&window.scrollTo({top:o.offsetTop,behavior:"smooth"})}))}))),window.addEventListener("scroll",(function(){var e=window.scrollY;document.querySelectorAll("section[id]").forEach((function(t){var o=t.offsetTop;if(e>=o-100&&e<o+t.offsetHeight){var r=t.id;document.querySelectorAll(".anchor-bar__menu a").forEach((function(e){e.classList.remove("current")}));var n=document.querySelector('.anchor-bar__menu a[href^="#'+r+'"]');n&&n.classList.add("current")}})),e<100&&!document.body.firstChild.id&&document.querySelectorAll(".anchor-bar__menu a.current").forEach((function(e){e.classList.remove("current")}))}));var t,o=document.querySelector(".anchor-bar__menu"),r=document.querySelector(".anchor-bar__btn--left"),n=document.querySelector(".anchor-bar__btn--right"),i=function(){var e=o.scrollWidth>o.clientWidth;r.style.display=e?"flex":"none",n.style.display=e?"flex":"none"},a=function(){var e=o.querySelector(".current");if(e){var t=e.offsetLeft-(o.offsetWidth-e.offsetWidth)/2;o.scrollTo({left:t,behavior:"smooth"})}},s=function(){a(),i()},c=!1;r.addEventListener("click",(function(){c=!0;var e=Math.min(o.scrollLeft,o.offsetWidth);o.scrollBy({left:-e,behavior:"smooth"}),setTimeout((function(){c=!1}),300)})),n.addEventListener("click",(function(){c=!0;var e=o.scrollWidth-o.clientWidth-o.scrollLeft,t=Math.min(e,o.offsetWidth);o.scrollBy({left:t,behavior:"smooth"}),setTimeout((function(){c=!1}),300)})),o.addEventListener("scroll",i),s(),window.addEventListener("scroll",(function(){c||(clearTimeout(t),t=setTimeout((function(){a()}),300))})),window.addEventListener("resize",s);var u=l("footer"),d=l(".anchor-bar");l(window).on("scroll",(function(){e()?d.addClass("sticky"):d.removeClass("sticky")})),e()&&d.addClass("sticky")}},controlBackToTopBtn:function(){document.addEventListener("scroll",(function(){var e=document.querySelector(".footer__back-to-top-btn");window.scrollY>.25*(document.documentElement.scrollHeight-window.innerHeight)?e.classList.add("active"):e.classList.remove("active")})),document.querySelector(".footer__back-to-top-btn").addEventListener("click",(function(){window.scrollTo({top:0,behavior:"smooth"})}))},initSwipers:function(){l(".featured-news-module__swiper-container, .payment-module__swiper-container, .producers-news-module__swiper-container").each((function(e){var t="s"+Math.floor(1e3*Math.random());
1l(this).siblings(".featured-news-module__swiper-controls").find(".swiper-button").addClass(t),l(this).siblings(".featured-news-module__swiper-controls").find(".swiper-pagination").addClass(t),l(this).siblings(".producers-news-module__swiper-controls").find(".swiper-button").addClass(t),l(this).siblings(".producers-news-module__swiper-controls").find(".swiper-pagination").addClass(t),l(this).siblings(".payment-module__swiper-controls").find(".swiper-button").addClass(t),l(this).siblings(".payment-module__swiper-controls").find(".swiper-pagination").addClass(t);new a.default(l(this)[0],{centeredSlides:!1,spaceBetween:15,breakpoints:{761:{spaceBetween:17.5},1421:{spaceBetween:20}},slidesPerView:"auto",effect:"slide",parallax:!0,speed:600,loop:!1,grabCursor:!1,autoplay:!1,simulateTouch:!0,pagination:{el:".swiper-pagination."+t,clickable:!0},navigation:{nextEl:".swiper-button--next."+t,prevEl:".swiper-button--previous."+t}})})),l(".carousel-module__swiper-container").each((function(e){var t="s"+Math.floor(1e3*Math.random());l(this).siblings(".carousel-module__swiper-controls").find(".swiper-button").addClass(t),l(this).siblings(".carousel-module__swiper-controls").find(".swiper-pagination").addClass(t);new a.default(l(this)[0],{centeredSlides:!1,slidesPerView:"auto",effect:"fade",fadeEffect:{crossFade:!0},parallax:!0,speed:600,loop:!0,grabCursor:!0,autoplay:{delay:5e3,disableOnInteraction:!0},simulateTouch:!0,pagination:{el:".swiper-pagination."+t,clickable:!0},navigation:{nextEl:".swiper-button--next."+t,prevEl:".swiper-button--previous."+t}})})),l(".news-module__featured-news-swiper-container").each((function(e){var t="s"+Math.floor(1e3*Math.random());l(this).siblings(".news-module__featured-news-swiper-controls").find(".swiper-button").addClass(t),l(this).siblings(".news-module__featured-news-swiper-controls").find(".swiper-pagination").addClass(t);new a.default(l(this)[0],{centeredSlides:!1,slidesPerView:"auto",effect:"fade",fadeEffect:{crossFade:!0},parallax:!0,speed:600,loop:!0,grabCursor:!0,autoplay:{delay:5e3,disableOnInteraction:!0},simulateTouch:!0,pagination:{el:".swiper-pagination."+t,clickable:!0},navigation:{nextEl:".swiper-button--next."+t,prevEl:".swiper-button--previous."+t}})})),l(".about-module__swiper-container").each((function(e){var t="s"+Math.floor(1e3*Math.random());l(this).siblings(".about-module__swiper-controls").find(".swiper-button").addClass(t);new a.default(l(this)[0],{centeredSlides:!1,slidesPerView:"auto",effect:"fade",fadeEffect:{crossFade:!0},parallax:!0,speed:600,loop:!0,grabCursor:!1,autoplay:!1,simulateTouch:!0,pagination:{el:".swiper-pagination."+t,clickable:!0},navigation:{nextEl:".swiper-button--next."+t,prevEl:".swiper-button--previous."+t}})})),l(".featured-producers-module__swiper-container").each((function(e){var t="s"+e+2,o=l(this);o.closest(".featured-producers-module__swiper"),o.find(".featured-producers-module__swiper-slide");l(this).siblings(".featured-producers-module__swiper-controls").find(".swiper-scrollbar").addClass(t);new a.default(l(this)[0],{centeredSlides:!1,spaceBetween:15,breakpoints:{761:{spaceBetween:17.5},1421:{spaceBetween:20}},slidesPerView:"auto",observer:!0,observeParents:!0,effect:"slide",parallax:!0,simulateTouch:!0,grabCursor:!1,speed:600,scrollbar:{el:".swiper-scrollbar."+t,draggable:!0}})})),l(".team-module__swiper-container").each((function(e){var t="s"+Math.floor(1e3*Math.random());l(this).siblings(".team-module__swiper-controls").find(".swiper-scrollbar").addClass(t);new a.default(l(this)[0],{centeredSlides:!1,spaceBetween:15,breakpoints:{761:{spaceBetween:17.5},1421:{spaceBetween:20}},slidesPerView:"auto",observer:!0,observeParents:!0,effect:"slide",parallax:!0,simulateTouch:!0,grabCursor:!0,speed:600,scrollbar:{el:".swiper-scrollbar."+t,draggable:!0}})})),l(".products-awards-module__swiper-container").each((function(e){var t="s"+Math.floor(1e3*Math.random());l(this).siblings(".products-awards-module__swiper-controls").find(".swiper-button").addClass(t),l(this).siblings(".products-awards-module__swiper-controls").find(".swiper-pagination").addClass(t);new a.default(l(this)[0],{centeredSlides:!1,spaceBetween:88,breakpoints:{761:{spaceBetween:56},981:{spaceBetween:66},1201:{spaceBetween:76},1421:{spaceBetween:86}},slidesPerView:"auto",effect:"slide",parallax:!0,speed:600,loop:!1,grabCursor:!1,autoplay:!1,simulateTouch:!0,pagination:{el:".swiper-pagination."+t,clickable:!0},navigation:{nextEl:".swiper-button--next."+t,prevEl:".swiper-button--previous."+t}})}))},initProducersCursorLabel:function(){function e(){return window.innerWidth<768||"ontouchstart"in window}document.querySelectorAll(".featured-producers-module__swiper").forEach((function(t){t.querySelectorAll(".featured-producers-module__swiper-slide").forEach((function(e){e.addEventListener("mousedown",(function(t){0===t.button&&(t.preventDefault(),e.classList.add("dragging"),e.style.cursor="grabbing",Array.from(e.querySelectorAll("*")).forEac
1h((function(e){e.style.cursor="grabbing"})))})),e.addEventListener("click",(function(t){if(e.classList.contains("dragging"))return t.preventDefault(),e.classList.remove("dragging"),e.style.cursor="pointer",void Array.from(e.querySelectorAll("*")).forEach((function(e){e.style.cursor="pointer"}))})),e.addEventListener("mouseup",(function(){e.classList.contains("dragging")&&setTimeout((function(){e.classList.remove("dragging"),e.style.cursor="pointer",Array.from(e.querySelectorAll("*")).forEach((function(e){e.style.cursor="pointer"}))}),10)}))}));var o=t.querySelector(".featured-producers-module__cursor-label");if(o){var n=document.createElement("div");n.className="featured-producers-module__cursor-label",n.textContent="Drag",document.body.appendChild(n);var i=!1;r.gsap.set(n,{x:0,y:0,opacity:0,position:"fixed",zIndex:9999}),document.addEventListener("swiperGrabbing",(function(){e()||(i=!0,n.textContent="Grabbing",r.gsap.to(n,{scale:.9,duration:.2}))})),document.addEventListener("swiperReleased",(function(){i&&(i=!1,n.textContent="Drag",r.gsap.to(n,{scale:1,duration:.2}))})),t.addEventListener("mouseenter",(function(){e()||r.gsap.to(n,{opacity:1,duration:.2})})),t.addEventListener("mouseleave",(function(){r.gsap.to(n,{opacity:0,duration:.2})})),document.addEventListener("mousemove",(function(o){if(!e()){var i=t.getBoundingClientRect();o.clientX>=i.left&&o.clientX<=i.right&&o.clientY>=i.top&&o.clientY<=i.bottom&&r.gsap.to(n,{x:o.clientX+20,y:o.clientY-10,duration:.1,ease:"power1.out"})}})),t.addEventListener("mousedown",(function(){e()||(i=!0,n.textContent="Grabbing",r.gsap.to(n,{scale:.9,duration:.2}))})),document.addEventListener("mouseup",(function(){i&&(i=!1,n.textContent="Drag",r.gsap.to(n,{scale:1,duration:.2}))})),o&&o.parentNode.removeChild(o)}}))},hideShelfTalkerGenerators:function(){document.querySelectorAll('.producers-assets-module__item.mailgo[data-subject*="Shelf Talker Request"]').forEach((function(e){e&&e.parentNode&&e.parentNode.removeChild(e)})),document.querySelectorAll(".products-assets-module__item").forEach((function(e){e&&e.textContent&&e.textContent.trim().includes("Shelf Talker Generator")&&e.parentNode&&e.parentNode.removeChild(e),e&&e.getAttribute("href")&&e.getAttribute("href").includes("/trade#shelf-talker")&&e.parentNode&&e.parentNode.removeChild(e)}))},init:function(){this.checkTouchDevice(),this.detectChromeWindows(),this.checkDeviceWidth(),this.controlAnimation(),this.controlAnchors(),this.controlHeader(),this.initAgeGate(),this.controlMainMenu(),this.controlAbout(),this.controlMarkets(),this.controlProducersIntro(),this.controlProductFilter(),this.controlAnchorBar(),this.getCopyrightYear(),this.controlBackToTopBtn(),this.initSwipers(),this.mailgo(),this.initPrintFunctionality(),this.initSocialSharing(),this.hideShelfTalkerGenerators(),s.default.init()}};t.default=c},
1"./src/js/distributors.js":function(e,t,o){"use strict";o.r(t);var r=o("./node_modules/gsap/index.js"),n=o("./node_modules/gsap/ScrollTrigger.js"),i=o("./node_modules/jquery/dist/jquery.js");r.gsap.registerPlugin(n.ScrollTrigger);var a={init:function(){window.location.pathname.toLowerCase().includes("distributor")&&(console.log("Initializing Distributors module"),this.controlDistributorsFilter(),this.initializeDropdown(),this.initializeViewMore(),this.hideAllResults())},controlDistributorsFilter:function(){i(".distributors-module__search-btn").on("click",(function(e){if(e.preventDefault(),console.log("Search button clicked"),i(this).siblings(".distributors-module__dropdown").is(":visible"))i(this).parent(".distributors-module__search-item").css({"z-index":"10"}),i(this).siblings(".distributors-module__dropdown").stop().fadeOut(300),i(this).siblings(".distributors-module__overlay").stop().fadeOut(300);else{i(this).parent(".distributors-module__search-item").css({"z-index":"11"}),i(this).siblings(".distributors-module__dropdown").stop().fadeIn(300),i(this).siblings(".distributors-module__overlay").stop().fadeIn(300);var t=i(".distributors-module__search-btn").offset().top-4*i(window).width()/100;i("html, body").animate({scrollTop:t},500,"swing")}})),i(".distributors-module__overlay").on("click",(function(e){e.preventDefault(),console.log("Overlay clicked"),i(this).stop().fadeOut(300),i(this).siblings(".distributors-module__dropdown").stop().fadeOut(300)})),i(".cta--read-more:not(.cta--website)").on("click",(function(e){e.preventDefault();var t,o=i(this),r=o.closest(".distributors-module__results-column--producers"),n=window.innerWidth<=760;(t=n?r.find(".distributors-module__results-list--extra.distributors-module__results-list--mobile"):r.find(".distributors-module__results-list--extra.distributors-module__results-list--desktop")).length>0&&t.slideToggle(300,"swing",(function(){o.text(t.is(":visible")?"View Less":"View More")}))}))},initializeDropdown:function(){var e=this,t=document.querySelector(".distributors-module__dropdown"),o=document.querySelector(".distributors-module__search-btn-title"),r=document.querySelector(".distributors-module__search-btn-eyebrow");t&&t.addEventListener("click",(function(n){if("A"===n.target.tagName){n.preventDefault();var a=n.target.dataset.state,s=n.target.dataset.stateName;console.log("State selected:",a,s),o&&(o.textContent=s),r&&(r.textContent="State");var l=document.querySelector(".distributors-module__overlay"),c=document.querySelector(".distributors-module__search-item");i(t).stop().fadeOut(300),i(l).stop().fadeOut(300),c&&(c.style.zIndex="10"),e.showStateResults(a)}}))},hideAllResults:function(){console.log("Hiding all results"),document.querySelectorAll(".distributors-module__results-row").forEach((function(e){console.log("Hiding row:",e.dataset.state),r.gsap.to(e,{opacity:0,duration:.3,onComplete:function(){e.style.display="none",console.log("Row hidden:",e.dataset.state)}})})),this.resetViewMoreStates()},resetViewMoreStates:function(){console.log("Resetting all View More states");var e=document.querySelectorAll(".distributors-module__results-list--extra"),t=document.querySelectorAll(".cta--read-more:not(.cta--website)");e.forEach((function(e){e.style.display="none"})),t.forEach((function(e){e.textContent="View More"}))},showStateResults:function(e){console.log("Showing results for state:",e),document.querySelectorAll(".distributors-module__results-row").forEach((function(e){e.style.display="none",e.style.opacity="0"}));var t=document.querySelector('.distributors-module__results-row[data-state="'.concat(e,'"]'));if(t){console.log("Found results element, preparing to show"),t.style.opacity="0",t.style.display="flex",console.log("Initial state set");var o=t.querySelectorAll(".distributors-module__results-list--extra"),n=t.querySelectorAll(".cta--read-more:not(.cta--website)");o.forEach((function(e){e.style.display="none"})),n.forEach((function(e){e.textContent="View More"})),r.gsap.to(t,{opacity:1,duration:.3,onStart:function(){console.log("Starting show animation")}})}else console.log("No results found for state:",e)},initializeViewMore:function(){}};t.default=a},
1"./src/js/index.js":function(e,t,o){"use strict";o.r(t);var r=o("./node_modules/jquery/dist/jquery.js"),n=o.n(r),i=o("./src/js/app.js"),a=o("./src/js/producers.js"),s=o("./src/js/products.js"),l=o("./src/js/video.js"),c=o("./src/js/trade.js"),u=o("./src/js/all-producers.js"),d=o("./src/js/distributors.js"),p=o("./src/js/press.js"),f=o("./src/js/scores.js"),m=o("./src/js/search.js");n()((function(){i.default.init(),a.default.init(),s.default.init(),l.default.init(),c.default.init(),u.default.init(),d.default.init(),p.default.init(),f.default.init(),m.default.init()}))},
vendor: 4,299 bytes, line 1
1"./src/js/press.js":function(e,t,o){"use strict";o.r(t);var r=o("./node_modules/gsap/index.js"),n=o("./node_modules/gsap/ScrollTrigger.js");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},i(e)}function a(){a=function(){return t};var e,t={},o=Object.prototype,r=o.hasOwnProperty,n=Object.defineProperty||function(e,t,o){e[t]=o.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function d(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,o){return e[t]=o}}function p(e,t,o,r){var i=t&&t.prototype instanceof w?t:w,a=Object.create(i.prototype),s=new P(r||[]);return n(a,"_invoke",{value:x(e,o,s)}),a}function f(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",h="suspendedYield",v="executing",g="completed",_={};function w(){}function y(){}function b(){}var S={};d(S,l,(function(){return this}));var C=Object.getPrototypeOf,L=C&&C(C(I([])));L&&L!==o&&r.call(L,l)&&(S=L);var E=b.prototype=w.prototype=Object.create(S);function k(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function o(n,a,s,l){var c=f(e[n],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==i(d)&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,s,l)}),(function(e){o("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return o("throw",e,s,l)}))}l(c.arg)}var a;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function x(t,o,r){var n=m;return function(i,a){if(n===v)throw Error("Generator is already running");if(n===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=q(s,r);if(l){if(l===_)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===m)throw n=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=v;var c=f(t,o,r);if("normal"===c.type){if(n=r.done?g:h,c.arg===_)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=g,r.method="throw",r.arg=c.arg)}}}function q(t,o){var r=o.method,n=t.iterator[r];if(n===e)return o.delegate=null,"throw"===r&&t.iterator.return&&(o.method="return",o.arg=e,q(t,o),"throw"===o.method)||"return"!==r&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var i=f(n,t.iterator,o.arg);if("throw"===i.type)return o.method="throw",o.arg=i.arg,o.delegate=null,_;var a=i.arg;return a?a.done?(o[t.resultName]=a.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=e),o.delegate=null,_):a:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,_)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function I(t){if(t||""===t){var o=t[l];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function o(){for(;++n<t.length;)if(r.call(t,n))return o.value=t[n],o.done=!1,o;return o.value=e,o.done=!0,o};return a.next=a}}throw new TypeError(i(t)+" is not iterable")}return y.prototype=b,n(E,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:y,configurable:!0}),y.displayName=d(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,d(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},k(A.prototype),d(A.prototype,c,(function(){return this})),t.AsyncIterator=A,t.async=function(e,o,r,n,i){void 0===i&&(i=Prom
1ise);var a=new A(p(e,o,r,n),i);return t.isGeneratorFunction(o)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(E),d(E,u,"Generator"),d(E,l,(function(){return this})),d(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),o=[];for(var r in t)o.push(r);return o.reverse(),function e(){for(;o.length;){var r=o.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var o in this)"t"===o.charAt(0)&&r.call(this,o)&&!isNaN(+o.slice(1))&&(this[o]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var o=this;function n(r,n){return s.type="throw",s.arg=t,o.next=r,n&&(o.method="next",o.arg=e),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var o=this.tryEntries.length-1;o>=0;--o){var n=this.tryEntries[o];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,_):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),_},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),T(o),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var r=o.completion;if("throw"===r.type){var n=r.arg;T(o)}return n}}throw Error("illegal catch attempt")},delegateYield:function(t,o,r){return this.delegate={iterator:I(t),resultName:o,nextLoc:r},"next"===this.method&&(this.arg=e),_}},t}function s(e,t,o,r,n,i,a){try{var s=e[i](a),l=s.value}catch(e){return void o(e)}s.done?t(l):Promise.resolve(l).then(r,n)}r.gsap.registerPlugin(n.ScrollTrigger);var l={init:function(){window.location.pathname.toLowerCase().includes("press")&&(console.log("Initializing Press module"),this.initLoadMore())},initLoadMore:function(){var e=document.querySelector(".js-load-more-news");e&&e.addEventListener("click",function(){var e,t=(e=a().mark((function e(t){var o,n,i,s,l,c;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),o=t.currentTarget,n=o.dataset.shownPosts||"",o.classList.add("loading"),e.prev=4,e.next=7,fetch("/wp-admin/admin-ajax.php",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:"load_more_news",shown_posts:n})});case 7:return i=e.sent,e.next=10,i.json();case 10:(s=e.sent).success&&((l=document.querySelector(".news-module__all-news-grid")).insertAdjacentHTML("beforeend",s.data.html),o.closest(".news-module__load-more").style.display="none",c=Array.from(l.children).slice(-s.data.count),r.gsap.from(c,{duration:.6,y:30,opacity:0,stagger:.1,ease:"power2.out"})),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(4),console.error("Error loading more posts:",e.t0),o.classList.remove("loading");case 18:case"end":return e.stop()}}),e,null,[[4,14]])})),function(){var t=this,o=arguments;return new Promise((function(r,n){var i=e.apply(t,o);function a(e){s(i,r,n,a,l,"next",e)}function l(e){s(i,r,n,a,l,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}())}};t.default=l},
1"./src/js/producers.js":function(e,t,o){"use strict";o.r(t);o("./node_modules/video.js/dist/video.es.js");var r=o("./node_modules/gsap/index.js"),n=o("./node_modules/gsap/ScrollTrigger.js"),i=o("./node_modules/swiper/swiper-bundle.mjs"),a=o("./node_modules/mixitup/dist/mixitup.js"),s=o.n(a),l=o("./node_modules/mixitup-multifilter/dist/mixitup-multifilter.js"),c=o.n(l),u=o("./src/js/video.js"),d=o("./node_modules/jquery/dist/jquery.js");function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r,n,i,a,s=[],l=!0,c=!1;try{if(i=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;l=!1}else for(;!(l=(r=i.call(o)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,n=e}finally{try{if(!l&&null!=o.return&&(a=o.return(),Object(a)!==a))return}finally{if(c)throw n}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?f(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=Array(t);o<t;o++)r[o]=e[o];return r}r.gsap.registerPlugin(n.ScrollTrigger),s().use(c());var m={portfolioSwiper:null,mixer:null,allSlides:[],init:function(){var e=this;document.body.classList.contains("single-producer")&&(console.log("Initializing producers page"),u.default.init(".producers-video-module__video",{useScrollTrigger:!0}),d(document).ready((function(){e.initPortfolioFilters(),e.initPortfolioSwiper(),e.initSwipers(),e.controlProducersPortfolioFilter()})))},controlProducersPortfolioFilter:function(){d(".producers-portfolio-module__filter-btn").on("click",(function(e){if(e.preventDefault(),d(this).siblings(".producers-portfolio-module__filter").is(":visible"))d(this).parents(".producers-portfolio-module").removeClass("active"),d(this).siblings(".producers-portfolio-module__filter").fadeOut(300);else{d(this).parents(".producers-portfolio-module").addClass("active"),d(this).siblings(".producers-portfolio-module__filter").css("display","flex").hide().fadeIn(300);var t=d(".producers-portfolio-module__filter-btn").offset().top-8*d(window).width()/100;d("html, body").animate({scrollTop:t},500,"swing")}}))},initPortfolioFilters:function(){var e=this;if(document.querySelector(".producers-portfolio-module__swiper-wrapper")){console.log("Initializing portfolio filters"),this.allSlides=Array.from(document.querySelectorAll(".producers-portfolio-module__swiper-slide")).map((function(e){return{element:e.cloneNode(!0),product:e.getAttribute("data-product"),vintage:e.getAttribute("data-vintage"),appellation:e.getAttribute("data-appellation"),score:e.getAttribute("data-score"),farming:e.getAttribute("data-farming"),href:e.getAttribute("href"),sequence:parseInt(e.getAttribute("data-sequence"))||0}})),this.createConsolidatedView(),this.populateFilterOptions(),document.querySelectorAll(".producers-portfolio-module__filter-item select").forEach((function(t){t.addEventListener("change",(function(t){console.log("Filter changed:",t.target.id,"Value:",t.target.value),e.handleFilterChange()}))}));var t,o=document.querySelector(".producers-portfolio-module__filter-item--search input"),r=document.querySelector(".producers-portfolio-module__filter-item--search form");if(o)o.addEventListener("input",(function(o){var r=o.target.value.trim();console.log("Search input:",r),clearTimeout(t),t=setTimeout((function(){e.handleFilterChange(r)}),300)})),r&&r.addEventListener("submit",(function(t){t.preventDefault();var r=o.value.trim();e.handleFilterChange(r)}));this.initPortfolioSwiper()}},handleFilterChange:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";console.log("Handling filter change");var o={product:document.getElementById("filter-product").value,vintage:document.getElementById("filter-vintage").value,appellation:document.getElementById("filter-appellation").value,score:document.getElementById("filter-score").value,farming:d
1ocument.getElementById("filter-farming-practices").value};console.log("Active filters:",o),console.log("Search term:",t),this.portfolioSwiper&&(this.portfolioSwiper.destroy(!0,!0),this.portfolioSwiper=null);var r=document.querySelector(".producers-portfolio-module__swiper-wrapper");if(r){if(r.innerHTML="",Object.values(o).some((function(e){return""!==e}))||t.length>=3){var n=this.allSlides.filter((function(e){var r=e.product.trim(),n=e.vintage.trim(),i="".concat(r," ").concat(n).trim(),a={product:""===o.product||i.toLowerCase()===o.product.toLowerCase(),vintage:""===o.vintage||n===o.vintage,appellation:""===o.appellation||e.appellation===o.appellation,score:""===o.score||e.score===o.score,farming:""===o.farming||e.farming===o.farming,search:t.length<3||r.toLowerCase().includes(t.toLowerCase())},s=[];return""!==o.product&&s.push(a.product),""!==o.vintage&&s.push(a.vintage),""!==o.appellation&&s.push(a.appellation),""!==o.score&&s.push(a.score),""!==o.farming&&s.push(a.farming),t.length>=3&&s.push(a.search),0===s.length||s.some((function(e){return e}))})).reduce((function(e,t){var o=t.product.replace(/(?:\d{4}|^[Nn][Vv]\s+|^[Vv]\s+)\s*/i,"").trim();return e[o]||(e[o]=[]),e[o].push(t),e}),{}),i=[];Object.entries(n).forEach((function(e){var t=p(e,2),o=(t[0],t[1]);o.sort((function(e,t){return t.vintage.localeCompare(e.vintage)}));var r=o[0],n=r.element.cloneNode(!0),a=n.querySelector(".producers-portfolio-module__swiper-slide-title");if(a){var s=r.element.querySelector(".producers-portfolio-module__swiper-slide-title"),l=(s?s.textContent.trim():"").replace(/^(?:\d{4}|[Nn][Vv]|[Vv])\s+/i,""),c=r.vintage||"";a.textContent="".concat(l).concat(c?" "+c:"")}i.push({element:n,sequence:r.sequence||0})})),i.sort((function(e,t){return e.sequence-t.sequence}
1)),i.forEach((function(e){r.appendChild(e.element)}))}else this.createConsolidatedView();setTimeout((function(){e.initPortfolioSwiper()}),0)}},initPortfolioSwiper:function(){this.portfolioSwiper&&(this.portfolioSwiper.destroy(!0,!0),this.portfolioSwiper=null);var e=document.querySelector(".producers-portfolio-module__swiper-container");if(e){console.log("Initializing portfolio swiper");var t="portfolio-swiper",o=e.closest(".producers-portfolio-module__swiper").querySelector(".producers-portfolio-module__swiper-controls");if(o){o.querySelectorAll(".swiper-button").forEach((function(e){e.classList.add(t)}));var r=o.querySelector(".swiper-pagination");r&&r.classList.add(t)}this.portfolioSwiper=new i.default(e,{slidesPerView:"auto",spaceBetween:20,observer:!0,observeParents:!0,resizeObserver:!0,updateOnWindowResize:!0,autoHeight:!0,navigation:{nextEl:".swiper-button--next."+t,prevEl:".swiper-button--previous."+t},pagination:{el:".swiper-pagination."+t,clickable:!0,type:"bullets"},on:{init:function(){console.log("Swiper initialized");var e=document.querySelector(".producers-portfolio-module__swiper-wrapper");e&&(e.style.height="auto"),this.update()},resize:function(){var e=document.querySelector(".producers-portfolio-module__swiper-wrapper");e&&(e.style.height="auto"),this.update()},activeIndexChange:function(){this.pagination.update()},sliderMove:function(){this.pagination.update()},touchMove:function(){this.pagination.update()},setTransition:function(){this.pagination.update()}}})}},initSwipers:function(){d(".producers-banner-module__swiper-container").each((function(e){var t="s"+e+4;d(this).siblings(".swiper-button").addClass(t);new i.default(d(this)[0],{effect:"slide",slidesPerView:"auto",parallax:!0,speed:600,loop:!1,grabCursor:!0,autoplay:!1,simulateTouch:!0,navigation:{nextEl:".swiper-button--next."+t,prevEl:".swiper-button--previous."+t}})})),d(".products-news-module__swiper-container").each((function(e){var t="s"+e+1;d(this).siblings(".products-news-module__swiper-controls").find(".swiper-button").addClass(t),d(this).siblings(".products-news-module__swiper-controls").find(".swiper-pagination").addClass(t);var o=new i.default(d(this)[0],{slidesPerGroup:1,slidesPerView:1,spaceBetween:15,breakpoints:{761:{slidesPerView:3,centeredSlides:!1,spaceBetween:17.5},1421:{slidesPerView:3,spaceBetween:20}},effect:"slide",parallax:!0,speed:600,loop:!1,grabCursor:!1,autoplay:!1,simulateTouch:!0,pagination:{el:".swiper-pagination."+t,clickable:!0},navigation:{nextEl:".swiper-button--next."+t,prevEl:".swiper-button--previous."+t}});function r(e){var t=e.el;e.slides.length<=(e.params.slidesPerView||1)?(e.disable(),t.classList.add("swiper-disabled")):(e.enable(),t.classList.remove("swiper-disabled"))}r(o),window.addEventListener("resize",(function(){r(o)})),o.on("update",(function(){r(o)}))})),d(".products-awards-module__swiper-container").each((function(e){var t="s"+e+2;d(this).siblings(".products-awards-module__swiper-controls").find(".swiper-button").addClass(t),d(this).siblings(".products-awards-module__swiper-controls").find(".swiper-pagination").addClass(t);new i.default(d(this)[0],{centeredSlides:!1,spaceBetween:28,breakpoints:{761:{spaceBetween:58},981:{spaceBetween:68},1201:{spaceBetween:78},1421:{spaceBetween:88}},slidesPerView:"auto",effect:"slide",parallax:!0,speed:600,loop:!1,grabCursor:!0,autoplay:!1,simulateTouch:!0,pagination:{el:".swiper-pagination."+t,clickable:!0},navigation:{nextEl:".swiper-button--next."+t,prevEl:".swiper-button--previous."+t}})}))},handleSearch:function(e){var t={product:document.getElementById("filter-product").value,vintage:document.getElementById("filter-vintage").value,appellation:document.getElementById("filter-appellation").value,score:document.getElementById("filter-score").value,farmingPractices:document.getElementById("filter-farming-practices").value},o="";if(Object.entries(t).forEach((function(e){var t=p(e,2),r=t[0],n=t[1];n&&(o+="[data-".concat(r,'="').concat(n,'"]'))})),e.length>=3){var r='[data-product*="'.concat(e.toLowerCase(),'"]');o=o?"".concat(o).concat(r):r}o||(o="all"),this.mixer.filter(o)},createConsolidatedView:function(){var e=document.querySelector(".producers-portfolio-module__swiper-wrapper");if(e&&this.allSlides){var t=this.allSlides.reduce((function(e,t){var o=t.product.replace(/(?:\d{4}|^[Nn][Vv]\s+|^[Vv]\s+)\s*/i,"").trim();return e[o]||(e[o]=[]),e[o].push(t),e}),{});e.innerHTML="";var o=[];Object.entries(t).forEach((function(e){var t=p(e,2),r=(t[0],t[1]);r.sort((function(e,t){return t.vintage.localeCompare(e.vintage)}));var n=r[0],i=n.element.cloneNode(!0),a=i.querySelector(".producers-portfolio-module__swiper-slide-title");if(a){var s,l=((null===(s=n.element.querySelector(".producers-portfolio-module__swiper-slide-title"))||void 0===s?void 0:s.textContent)||"").trim().replace(/^(?:\d{4}|[Nn][Vv]|[Vv])\s+/i,"");a.textContent=l}o.push({element:i,sequence:n.sequence||0})})),o.sort((function(e,t){return e.sequence-t.sequence})),o.forEach((function(t){e.appendChild(t.element)}))}}
1,populateFilterOptions:function(){var e={product:new Map,vintage:new Set,appellation:new Set,score:new Set,farmingPractices:new Set},t=function(e){var t={"chateau la tour de l'eveque petale de rose":"Château la Tour de l'Evêque Pétale de Rose"},o=e.toLowerCase().trim();return t[o]?t[o]:e.toLowerCase().split(" ").map((function(e,t,o){if(/^\d+$/.test(e))return e;if(/^(igt|doc|docg|aoc|aop)$/i.test(e))return e.toUpperCase();var r=["a","an","the","and","but","or","for","nor","on","at","to","with","in","de","du","des","le","la","les","l'"];return r.includes(e)&&0!==t?e:e.includes("'")?e.split("'").map((function(e,t){return 0===t||e.length>0&&/^[a-z]/.test(e)&&!r.includes(e)?e.charAt(0).toUpperCase()+e.slice(1):e})).join("'"):e.replace(/(^|-)([a-z])/g,(function(e,t,o){return t+o.toUpperCase()}))})).join(" ").replace(/^\w/,(function(e){return e.toUpperCase()}))};this.allSlides.forEach((function(o){if(o.product){var r=o.product.replace(/(?:\d{4}|^[Nn][Vv]\s+|^[Vv]\s+)\s*/i,"").trim(),n=t(r);e.product.has(n)||e.product.set(n,new Set),o.vintage&&e.product.get(n).add(o.vintage)}o.vintage&&e.vintage.add(o.vintage),o.appellation&&e.appellation.add(t(o.appellation)),o.score&&e.score.add(t(o.score)),o.farming&&e.farmingPractices.add(t(o.farming))}));var o={product:Array.from(e.product.entries()).sort((function(e,t){var o=p(e,1)[0],r=p(t,1)[0];return o.localeCompare(r)})).map((function(e){var t=p(e,2),o=t[0],r=t[1];return Array.from(r).sort((function(e,t){return t.localeCompare(e)})).map((function(e){return"".concat(o," ").concat(e)}))})).flat(),vintage:Array.from(e.vintage).sort().reverse(),appellation:Array.from(e.appellation).sort(),score:Array.from(e.score).sort(),farmingPractices:Array.from(e.farmingPractices).sort()};this.populateDropdown("filter-product",o.product),this.populateDropdown("filter-vintage",o.vintage),this.populateDropdown("filter-appellation",o.appellation),this.populateDropdown("filter-score",o.score),this.populateDropdown("filter-farming-practices",o.farmingPractices)},populateDropdown:function(e,t){var o=document.getElementById(e);if(o){for(;o.options.length>1;)o.remove(1);t.forEach((function(e){var t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)}))}}};t.default=m},
1"./src/js/products.js":function(e,t,o){"use strict";o.r(t);o("./node_modules/video.js/dist/video.es.js");var r=o("./node_modules/gsap/index.js"),n=o("./node_modules/gsap/ScrollTrigger.js"),i=o("./node_modules/swiper/swiper-bundle.mjs"),a=o("./node_modules/swiper/modules/index.mjs"),s=o("./node_modules/mixitup/dist/mixitup.js"),l=o.n(s),c=o("./node_modules/mixitup-multifilter/dist/mixitup-multifilter.js"),u=o.n(c),d=o("./src/js/video.js"),p=o("./node_modules/mailgo/lib/mailgo.js"),f=o.n(p);window.mailgoDirectRender=p.mailgoDirectRender;var m=window.mailgoClickListener;window.mailgoClickListener=function(e){return e&&e.currentTarget&&e.currentTarget.classList.contains("mailgo-direct-render")&&e.preventDefault(),m(e)},r.gsap.registerPlugin(n.ScrollTrigger),l().use(u());var h={initProductSearch:function(){var e,t=document.querySelector('.products-about-module__dropdown input[type="text"]'),o=document.querySelector(".products-about-module__dropdown form"),r=document.querySelector(".products-about-module__dropdown ul"),n=null==r?void 0:r.querySelectorAll("li"),i=document.querySelector(".products-about-module__title");if(t&&r&&n&&i&&!i.classList.contains("single-product")){null==o||o.addEventListener("submit",(function(e){e.preventDefault()}));t.addEventListener("input",(function(t){var o=t.target.value.toLowerCase().trim();clearTimeout(e),e=setTimeout((function(){!function(e){e.length<3?n.forEach((function(e){e.style.display=""})):n.forEach((function(t){t.textContent.toLowerCase().replace(/\s+\d{4}$/,"").includes(e)?t.style.display="":t.style.display="none"}))}(o)}),300)}))}},initEmailInquiry:function(){f()({dark:!1,showFooter:!0,actions:{telegram:!1,whatsapp:!1,skype:!1,copy:!0},details:{subject:!0,body:!0,to:!0,cc:!1,bcc:!1},validateEmail:!0,validateTel:!0,ignoreList:[".no-mailgo"],showDefault:!1})},initPrintFunctionality:function(){var e=document.querySelectorAll(".cta--print");e.length&&(document.body.setAttribute("data-url",window.location.href),e.forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),window.print(),setTimeout((function(){document.body.classList.remove("is-printing")}),100)}))})))},prepareBackgroundImagesForPrint:function(){document.querySelectorAll("img").forEach((function(e){e.classList.contains("print-image")&&(e.style.display="block")}))},initSocialSharing:function(){console.log("Initializing social sharing");var e=document.querySelector(".products-about-module__email-form"),t=document.querySelector(".products-about-module__email-send");if(e&&t){var o=function(){var e,t=document.getElementById("share-email");if(t){var o=t.value.trim();if(o){var r=window.location.href,n=(null===(e=document.querySelector(".products-about-module__title h1"))||void 0===e?void 0:e.textContent)||document.title,i="Check out ".concat(n," on Frederick Wildman"),a="I thought you might be interested in this: ".concat(r),s=document.createElement("a");s.style.display="none",s.classList.add("mailgo"),s.setAttribute("data-address",o.split("@")[0]),s.setAttribute("data-domain",o.split("@")[1]||""),s.setAttribute("data-subject",i),s.setAttribute("data-body",a),s.href="#mailgo",document.body.appendChild(s),setTimeout((function(){s.click(),setTimeout((function(){document.body.removeChild(s)}),100)}),50)}else alert("Please enter a recipient email address")}};e.addEventListener("submit",(function(e){e.preventDefault(),o()})),t.addEventListener("click",(function(e){e.preventDefault(),o()}))}document.querySelectorAll(".products-about-module__social-item.no-mailgo").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation(),console.log("Email share clicked with direct handler");var o=e.getAttribute("href");console.log("Opening direct mailto URL:",o),window.location.href=o}))})),document.addEventListener("click",(function(e){if(e.target.closest(".cta--share")){e.preventDefault(),e.stopPropagation(),console.log("Share button clicked via delegation");var t=e.target.closest(".cta--share"),o=t.closest(".cta-wrapper"),r=null==o?void 0:o.querySelector(".products-about-module__social");console.log("Social container:",r),r&&(r.classList.contains("active")?(r.style.opacity="",r.style.visibility=""):(r.style.opacity="1",r.style.visibility="visible"),r.classList.toggle("active"),t.classList.toggle("active"),console.log("Toggled active class, current state:",r.classList.contains("active")))}else if(e.target.closest('.products-about-module__social-item[data-network="email"]')||e.target.closest(".products-about-module__social-item")&&e.target.closest(".products-about-module__social-item").querySelector('img[alt="Email"]')){var n;e.preventDefault(),e.stopPropagation(),console.log("Email share clicked");var i=window.location.href,a=(null===(n=document.querySelector(".products-about-module__title h1"))||void 0===n?void 0:n.textContent)||document.title||"This product";console.log("Title:",a,"URL:",i);var s="Check out ".concat(a),l="I thought you might be interested in this: ".concat(i),c="mailto:?subject=".concat(encodeURIComponent(s),"&body=").concat(encodeURIComponent(l));console.log("Opening mailto URL:",c),window.open(c,"_self")}else e.target.closest(".cta-wrapper")||(document.querySelectorAll(".products-about-module__social.active").forEach((function(e){e.classList.remove("active"),e.style.opacity="",e.style.visibility=""})),document.querySelectorAll(".cta--share.active").forEach((function(e){e.classList.remove("active")})))}
1))},initSwiper:function(){var e=document.querySelectorAll(".products-recipe-module__swiper-container");e.length&&e.forEach((function(e){if(e.querySelectorAll(".swiper-slide").length<=1){var t=e.parentElement.querySelector(".products-recipe-module__swiper-controls");t&&(t.style.display="none")}else new i.default(e,{modules:[a.Navigation,a.Pagination,a.Autoplay],centeredSlides:!1,slidesPerView:"auto",effect:"fade",fadeEffect:{crossFade:!0},parallax:!0,speed:600,loop:!0,grabCursor:!0,simulateTouch:!0,pagination:{el:e.parentElement.querySelector(".swiper-pagination"),clickable:!0},navigation:{prevEl:e.parentElement.querySelector(".swiper-button--previous"),nextEl:e.parentElement.querySelector(".swiper-button--next")},on:{init:function(){var t=e.querySelector(".swiper-slide-active");t&&(t.style.opacity=1)}}})}))},init:function(){var e=document.querySelector(".products-about-module");console.log("Products module found:",!!e),e&&(console.log("Initializing products page"),this.initProductSearch(),this.initEmailInquiry(),this.initPrintFunctionality(),this.initSocialSharing(),this.initSwiper(),d.default.init(".products-video-module__video",{useScrollTrigger:!0}))}};t.default=h},
1"./src/js/scores.js":function(e,t,o){"use strict";o.r(t);var r=o("./node_modules/gsap/index.js"),n=o("./node_modules/gsap/ScrollTrigger.js"),i=o("./node_modules/swiper/swiper.mjs"),a=o("./node_modules/swiper/modules/index.mjs"),s=o("./node_modules/jquery/dist/jquery.js");function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=Array(t);o<t;o++)r[o]=e[o];return r}r.gsap.registerPlugin(n.ScrollTrigger);var u={allScores:[],init:function(){console.log("Initializing Scores module"),this.initSwiper(),this.initQuoteReadMore(),this.controlScoresFilter(),this.initScoresFilters(),this.initSorting(),this.initLoadMore()},initQuoteReadMore:function(){document.addEventListener("click",(function(e){if(e.target.classList.contains("quote-read-more")){e.preventDefault();var t=e.target.dataset.fullQuote;e.target.parentElement.innerHTML='"'.concat(t,'"')}}))},controlScoresFilter:function(){s(".scores-module__filter-btn").on("click",(function(e){if(e.preventDefault(),s(this).siblings(".scores-module__filter").is(":visible"))s(this).parents(".scores-module").removeClass("active"),s(this).siblings(".scores-module__filter").fadeOut(300);else{s(this).parents(".scores-module").addClass("active"),s(this).siblings(".scores-module__filter").css("display","flex").hide().fadeIn(300);var t=s(".scores-module__filter-btn").offset().top-8*s(window).width()/100;s("html, body").animate({scrollTop:t},500,"swing")}})),s('.scores-module__all-scores-row a[aria-label="Show/Hide All Reviews"]').on("click",(function(e){e.preventDefault(),s(this).hasClass("active")?(s(this).removeClass("active"),s(this).parents(".scores-module__all-scores-list").find(".scores-module__all-scores-review").slideUp(300,"swing")):(s(this).addClass("active"),s(this).parents(".scores-module__all-scores-list").find(".scores-module__all-scores-review").slideDown(300,"swing"))})),s('.scores-module__all-scores-row a[aria-label="Show Review"]').on("click",(function(e){e.preventDefault(),s(this).parents(".scores-module__all-scores-row").children(".scores-module__all-scores-review").is(":visible")?s(this).parents(".scores-module__all-scores-row").children(".scores-module__all-scores-review").slideUp(300,"swing"):s(this).parents(".scores-module__all-scores-row").children(".scores-module__all-scores-review").slideDown(300,"swing")})),s('.scores-module__all-scores-row a[aria-label="Hide Review"]').on("click",(function(e){e.preventDefault(),s(this).parents(".scores-module__all-scores-row").children(".scores-module__all-scores-review").slideUp(300,"swing")}))},initScoresFilters:function(){var e=this;if(document.querySelector(".scores-module__all-scores-list")){console.log("Initializing scores filters"),this.collectAllScoresData(),this.populateFilterOptions(),document.querySelectorAll(".scores-module__filter-item select").forEach((function(t){t.addEventListener("change",(function(){e.updateFilterOptions(),e.handleFilterChange()}))}));var t,o=document.querySelector(".scores-module__filter-item--search input"),r=document.querySelector(".scores-module__filter-item--search form");if(o)o.addEventListener("input",(function(o){var r=o.target.value.trim();console.log("Search input:",r),clearTimeout(t),t=setTimeout((function(){e.updateFilterOptions(),e.handleFilterChange()}),300)})),r&&r.addEventListener("submit",(function(t){t.preventDefault(),e.updateFilterOptions(),e.handleFilterChange()}))}},collectAllScoresData:function(){var e=document.querySelectorAll(".scores-module__all-scores-row:not(.scores-module__all-scores-row--sorter)");this.allScores=Array.from(e).map((function(e){var t,o,r,n,i,a,s,l,c=e.querySelectorAll(".scores-module__all-scores-col"),u=e.querySelector(".scores-module__all-scores-review"),d=null===(t=c[1])||void 0===t?void 0:t.querySelector("a"),p=d?d.getAttribute("href"):"",f=d?d.textContent.trim():"",m=null===(o=c[3])||void 0===o?void 0:o.querySelector("a"),h=m?m.textContent.trim():"";return{element:e,producer:(null===(r=c[0])||void 0===r?void 0:r.textContent.trim())||"",product:f||"",productLink:p,vintage:(null===(n=c[2])||void 0===n?void 0:n.textContent.trim())||"",publication:h,score:(null===(i=c[4])||void 0===i?void 0:i.textContent.trim())||"",date:(null===(a=c[5])||void 0===a?void 0:a.textContent.trim())||"",reviewElement:u,reviewText:(null==u||null===(s=u.querySelector("p"))||void 0===s?void 0:s.textContent.trim())||"",reviewPublication:(null==u||null===(l=u.querySelector("b"))||void 0===l?void 0:l.textContent.trim())||""}})),console.log("Collected scores data:",this.allScores.length)},handleFilterChange:function(){var e,t,o,r,n,i=this;console.log("Handling filter change");var a={producer:(null===(e=document.getElementById("filter-producer"))||void 0===e?void 0:e.value)||"",product:(null===(t=document.getElementById("filter-product"))||void 0===t?void 0:t.value)||"",vintage:(null===(o=document.getElementById("filter-vintage"))||void 0===o?void 0:o.value)||"",publication:(null===(r=document.getElementById("filter-publication"))||void 0===r?void 0:r.value)||"",score:(null===(n=document.getElementById("filter-score"))||void 0===n?void 0:n.value)||""},s=document.querySelector(".scores-module__filter-item--search input"),c=s?s.value.trim():"";if(Object.values(a).some((function(e){return""!==e}))||c.length>=3){var u=l(this.allScores.filter((function(e){var t=!a.producer||e.producer.toLowerCase()===a.producer.toLowerCase(),o=!a.product||e.product.toLowerCase().includes(a.product.toLowerCase()),r=!a.vintage||e.vintage===a.vintage,n=!a.publication||e.publication.toLowerCase()===a.publication.toLowerCase(),i=!a.score||e.score===a.score,s=!c||
1c.length<3||e.product.toLowerCase().includes(c.toLowerCase())||e.producer.toLowerCase().includes(c.toLowerCase())||e.reviewText&&e.reviewText.toLowerCase().includes(c.toLowerCase());return t&&o&&r&&n&&i&&s}))).sort((function(e,t){var o,r,n,a,s,l;switch(i.currentSort.column){case"producer":default:s=e.producer.toLowerCase(),l=t.producer.toLowerCase();break;case"product":s=e.product.toLowerCase(),l=t.product.toLowerCase();break;case"vintage":s=e.vintage?parseInt((null===(o=e.vintage.match(/\d+/))||void 0===o?void 0:o[0])||0):0,l=t.vintage?parseInt((null===(r=t.vintage.match(/\d+/))||void 0===r?void 0:r[0])||0):0;break;case"publication":s=e.publication.toLowerCase(),l=t.publication.toLowerCase();break;case"score":s=e.score?parseFloat((null===(n=e.score.match(/\d+(\.\d+)?/))||void 0===n?void 0:n[0])||0):0,l=t.score?parseFloat((null===(a=t.score.match(/\d+(\.\d+)?/))||void 0===a?void 0:a[0])||0):0;break;case"date":var c=i.parseDate(e.date),u=i.parseDate(t.date);s=c?c.getTime():0,l=u?u.getTime():0}return"asc"===i.currentSort.direction?s>l?1:s<l?-1:0:s<l?1:s>l?-1:0}));this.updateScoresDisplay(u)}else this.sortScores()},updateScoresDisplay:function(e){var t=document.querySelector(".scores-module__all-scores-list");if(t){var o=t.querySelector(".scores-module__all-scores-row--sorter").querySelector('a[aria-label="Show/Hide All Reviews"]'),r=!!o&&o.classList.contains("active");if(t.querySelectorAll(".scores-module__all-scores-row:not(.scores-module__all-scores-row--sorter)").forEach((function(e){return e.remove()})),e.forEach((function(e,o){var r=e.element.cloneNode(!0);o>=15&&(r.style.display="none",r.classList.add("scores-module__hidden-row")),t.appendChild(r)})),0===e.length){var n=document.createElement("div");n.className="scores-module__all-scores-row scores-module__all-scores-row--no-results",n.innerHTML='<div class="scores-module__all-scores-col" style="text-align: center; width: 100%;">No matching scores found. Please adjust your filters.</div>',t.appendChild(n)}this.updateLoadMoreButton(e.length),this.reattachReviewEventListeners(r)}},reattachReviewEventListeners:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];s('.scores-module__all-scores-row a[aria-label="Show Review"]').off("click").on("click",(function(e){e.preventDefault(),s(this).parents(".scores-module__all-scores-row").children(".scores-module__all-scores-review").is(":visible")?s(this).parents(".scores-module__all-scores-row").children(".scores-module__all-scores-review").slideUp(300,"swing"):s(this).parents(".scores-module__all-scores-row").children(".scores-module__all-scores-review").slideDown(300,"swing")})),s('.scores-module__all-scores-row a[aria-label="Hide Review"]').off("click").on("click",(function(e){e.preventDefault(),s(this).parents(".scores-module__all-scores-row").children(".scores-module__all-scores-review").slideUp(300,"swing")}));var t=s('.scores-module__all-scores-row a[aria-label="Show/Hide All Reviews"]');t.off("click").on("click",(function(e){e.preventDefault(),s(this).hasClass("active")?(s(this).removeClass("active"),s(this).parents(".scores-module__all-scores-list").find(".scores-module__all-scores-review").slideUp(300,"swing")):(s(this).addClass("active"),s(this).parents(".scores-module__all-scores-list").find(".scores-module__all-scores-review").slideDown(300,"swing"))})),e&&(t.addClass("active"),s(".scores-module__all-scores-review").show())},populateFilterOptions:function(){if(this.allScores&&0!==this.allScores.length){var e={producer:new Set,product:new Set,vintage:new Set,publication:new Set,score:new Set};this.allScores.forEach((function(t){t.producer&&e.producer.add(t.producer),t.product&&e.product.add(t.product),t.vintage&&e.vintage.add(t.vintage),t.publication&&e.publication.add(t.publication),t.score&&e.score.add(t.score)}));var t={producer:Array.from(e.producer).sort(),product:Array.from(e.product).sort(),vintage:Array.from(e.vintage).sort().reverse(),publication:Array.from(e.publication).sort(),score:Array.from(e.score).sort((function(e,t){var o,r,n=e?parseFloat((null===(o=e.match(/\d+(\.\d+)?/))||void 0===o?void 0:o[0])||0):0;return(t?parseFloat((null===(r=t.match(/\d+(\.\d+)?/))||void 0===r?void 0:r[0])||0):0)-n}))};this.populateDropdown("filter-producer",t.producer),this.populateDropdown("filter-product",t.product),this.populateDropdown("filter-vintage",t.vintage),this.populateDropdown("filter-publication",t.publication),this.populateDropdown("filter-score",t.score)}},populateDropdown:function(e,t){var o=document.getElementById(e);if(o){for(;o.options.length>1;)o.remove(1);t.forEach((function(e){var t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)}))}},initSwiper:function(){var e=document.querySelectorAll(".scores-module__featured-scores-swiper-container");e.length&&e.forEach((function(e){if(e.querySelectorAll(".swiper-slide").length<=1){var t=e.parentElement.querySelector(".scores-module__featured-scores-swiper-control
1s");t&&(t.style.display="none")}else new i.default(e,{modules:[a.Navigation,a.Pagination,a.Autoplay],centeredSlides:!1,slidesPerView:"auto",effect:"fade",fadeEffect:{crossFade:!0},parallax:!0,speed:600,loop:!0,grabCursor:!0,simulateTouch:!0,pagination:{el:e.parentElement.querySelector(".swiper-pagination"),clickable:!0},navigation:{prevEl:e.parentElement.querySelector(".swiper-button--previous"),nextEl:e.parentElement.querySelector(".swiper-button--next")},on:{init:function(){var t=e.querySelector(".swiper-slide-active");t&&(t.style.opacity=1)}}})}))},initSorting:function(){var e=this,t=document.querySelectorAll(".scores-module__all-scores-row--sorter .scores-module__all-scores-col");t.length&&(this.currentSort={column:null,direction:null},this.currentSort.column="date",this.currentSort.direction="desc",this.updateSortIndicators(),this.sortScores(),t.forEach((function(t){t.addEventListener("click",(function(o){var r=t.getAttribute("data-sort");e.currentSort.column===r?e.currentSort.direction="asc"===e.currentSort.direction?"desc":"asc":(e.currentSort.column=r,e.currentSort.direction="vintage"===r||"score"===r?"desc":"asc"),e.updateSortIndicators(),e.sortScores()}))})),this.updateSortIndicators())},updateSortIndicators:function(){if(document.querySelectorAll(".scores-module__all-scores-row--sorter .scores-module__all-scores-col").forEach((function(e){e.classList.remove("sort-asc","sort-desc")})),this.currentSort.column){var e=document.querySelector('.scores-module__all-scores-row--sorter .scores-module__all-scores-col[data-sort="'.concat(this.currentSort.column,'"]'));e&&e.classList.add("sort-".concat(this.currentSort.direction))}},sortScores:function(){var e=this;if(this.allScores&&this.allScores.length&&this.currentSort.column){var t=l(this.allScores).sort((function(t,o){var r,n,i,a,s,l;switch(e.currentSort.column){case"producer":default:s=t.producer.toLowerCase(),l=o.producer.toLowerCase();break;case"product":s=t.product.toLowerCase(),l=o.product.toLowerCase();break;case"vintage":s=t.vintage?parseInt((null===(r=t.vintage.match(/\d+/))||void 0===r?void 0:r[0])||0):0,l=o.vintage?parseInt((null===(n=o.vintage.match(/\d+/))||void 0===n?void 0:n[0])||0):0;break;case"publication":s=t.publication.toLowerCase(),l=o.publication.toLowerCase();break;case"score":s=t.score?parseFloat((null===(i=t.score.match(/\d+(\.\d+)?/))||void 0===i?void 0:i[0])||0):0,l=o.score?parseFloat((null===(a=o.score.match(/\d+(\.\d+)?/))||void 0===a?void 0:a[0])||0):0;break;case"date":var c=e.parseDate(t.date),u=e.parseDate(o.date);s=c?c.getTime():0,l=u?u.getTime():0}return"asc"===e.currentSort.direction?s>l?1:s<l?-1:0:s<l?1:s>l?-1:0}));this.updateScoresDisplay(t)}},parseDate:function(e){if(!e)return null;var t=e.split("/");if(2===t.length){var o=parseInt(t[0])-1,r=parseInt(t[1]);return new Date(r,o,1)}return new Date(e)},updateFilterOptions:function(){var e,t,o,r,n,i={producer:(null===(e=document.getElementById("filter-producer"))||void 0===e?void 0:e.value)||"",product:(null===(t=document.getElementById("filter-product"))||void 0===t?void 0:t.value)||"",vintage:(null===(o=document.getElementById("filter-vintage"))||void 0===o?void 0:o.value)||"",publication:(null===(r=document.getElementById("filter-publication"))||void 0===r?void 0:r.value)||"",score:(null===(n=document.getElementById("filter-score"))||void 0===n?void 0:n.value)||""},a=document.querySelector(".scores-module__filter-item--search input"),s=a?a.value.trim():"",l=this.allScores.filter((function(e){var t=!i.producer||e.producer.toLowerCase()===i.producer.toLowerCase(),o=!i.product||e.product.toLowerCase()===i.product.toLowerCase(),r=!i.vintage||e.vintage===i.vintage,n=!i.publication||e.publication.toLowerCase()===i.publication.toLowerCase(),a=!i.score||e.score===i.score,l=!s||s.length<3||e.product.toLowerCase().includes(s.toLowerCase())||e.producer.toLowerCase().includes(s.toLowerCase())||e.reviewText&&e.reviewText.toLowerCase().includes(s.toLowerCase());return t&&o&&r&&n&&a&&l})),c={producer:new Set,product:new Set,vintage:new Set,publication:new Set,score:new Set};l.forEach((function(e){e.producer&&c.producer.add(e.producer),e.product&&c.product.add(e.product),e.vintage&&c.vintage.add(e.vintage),e.publication&&c.publication.add(e.publication),e.score&&c.score.add(e.score)}));var u={producer:Array.from(c.producer).sort(),product:Array.from(c.product).sort(),vintage:Array.from(c.vintage).sort().reverse(),publication:Array.from(c.publication).sort(),score:Array.from(c.score).sort((function(e,t){var o,r,n=e?parseFloat((null===(o=e.match(/\d+(\.\d+)?/))||void 0===o?void 0:o[0])||0):0;return(t?parseFloat((null===(r=t.match(/\d+(\.\d+)?/))||void 0===r?void 0:r[0])||0):0)-n}))};this.updateDropdown("filter-producer",u.producer,i.producer),this.updateDropdown("filter-product",u.product,i.product),this.updateDropdown("filter-vintage",u.vintage,i.vintage),this.updateDropdown("filter-publication",u.publication,i.publication),this.updateDropdown("filter-score",u.score,i.score)},updateDropdown:function(e,t,o){var r=document.getElementById(e);if(r){for(var n=o&&t.includes(o);r.options.length>1;)r.remove(1);t.forEach((function(e){var t=document.createElement("option");t.value=e,t.textContent=e,r.appendChild(t)})),n&&(r.value=o)}},initLoadMore:function(){var e=document.querySelector(".scores-module__load-more");
1if(!e){(e=document.createElement("button")).className="cta cta--read-more scores-module__load-more",e.textContent="Load More Ratings";var t=document.createElement("div");t.className="cta-group cta-group--center",t.appendChild(e);var o=document.querySelector(".scores-module__all-scores-list");o&&o.parentNode.insertBefore(t,o.nextSibling)}e.addEventListener("click",(function(){document.querySelectorAll(".scores-module__hidden-row").forEach((function(e){e.style.display="",e.classList.remove("scores-module__hidden-row")}));var t=e.parentElement;t&&t.classList.contains("cta-group")&&(t.style.display="none")}))},updateLoadMoreButton:function(e){var t=document.querySelector(".scores-module__load-more");if(t){var o=t.parentElement;o&&o.classList.contains("cta-group")&&(o.style.display=e>15?"":"none")}}};t.default=u},
1"./src/js/search.js":function(e,t,o){"use strict";o.r(t);var r=o("./node_modules/gsap/index.js"),n=o("./node_modules/gsap/ScrollTrigger.js"),i=o("./node_modules/jquery/dist/jquery.js");r.gsap.registerPlugin(n.ScrollTrigger);var a={init:function(){console.log("Search initialized"),this.searchBtn=i(".search-btn"),this.searchBar=i(".search-bar"),this.searchForm=i(".search-bar form"),this.searchInput=i(".search-bar form input"),this.suggestionsContainer=i(".search-bar__suggestions-list"),this.header=i(".header"),this.headerOverlay=i(".header__overlay"),this.maxRecentSearches=4,this.searchBtn.length&&this.searchBar.length&&(this.bindEvents(),this.loadRecentSearches())},bindEvents:function(){var e=this;this.suggestionsContainer.on("click",".search-bar__suggestions-btn",(function(t){t.preventDefault();var o=i(t.currentTarget).text().trim();e.setSearchTerm(o),e.submitSearch()})),i(document).on("keydown",(function(t){"Escape"===t.key&&e.isSearchBarOpen()&&e.closeSearchBar(),"/"!==t.key||e.isSearchBarOpen()||(t.preventDefault(),e.openSearchBar())})),this.searchForm.length&&this.searchForm.on("submit",(function(t){var o=e.searchInput.val().trim();o?e.addRecentSearch(o):(t.preventDefault(),e.searchInput.focus())}))},isSearchBarOpen:function(){return this.searchBar.is(":visible")},openSearchBar:function(){var e=this;this.headerOverlay.addClass("active"),this.header.find(".header__wrapper").addClass("active"),this.searchBar.stop().fadeIn(300),i(window).outerWidth()>1200&&(i(".main-menu__link").css({opacity:"0.4"}),i(".header .main-menu__link").siblings(".sub-menu__list").is(":visible")&&(i(".header .main-menu__link.active").removeClass("active"),i(".header .main-menu__link").siblings(".sub-menu__list").stop().fadeOut(300))),setTimeout((function(){e.searchInput.focus()}),300)},closeSearchBar:function(){this.headerOverlay.removeClass("active"),this.header.find(".header__wrapper").removeClass("active"),this.searchBar.stop().fadeOut(300),i(window).outerWidth()>1200&&i(".main-menu__link").css({opacity:"1"})},setSearchTerm:function(e){this.searchInput.length&&(this.searchInput.val(e),this.searchInput.focus())},submitSearch:function(){this.searchForm.length&&this.searchInput.val().trim()&&this.searchForm.submit()},loadRecentSearches:function(){var e=this.getRecentSearches();this.updateSuggestionsList(e)},getRecentSearches:function(){try{return JSON.parse(localStorage.getItem("recentSearches"))||[]}catch(e){return[]}},addRecentSearch:function(e){var t=this.getRecentSearches();(t=t.filter((function(t){return t.toLowerCase()!==e.toLowerCase()}))).unshift(e),t=t.slice(0,this.maxRecentSearches),localStorage.setItem("recentSearches",JSON.stringify(t)),this.updateSuggestionsList(t)},updateSuggestionsList:function(e){var t=this;this.suggestionsContainer.empty(),0!==e.length?(e.forEach((function(e){var o=i("<a>",{class:"search-bar__suggestions-btn",href:"javascript:void(0)",text:e});t.suggestionsContainer.append(o)})),this.suggestionsContainer.parent().show()):this.suggestionsContainer.parent().hide()}};t.default=a},
1"./src/js/trade.js":function(e,t,o){"use strict";o.r(t);var r=o("./node_modules/gsap/index.js"),n=o("./node_modules/gsap/ScrollTrigger.js"),i=o("./node_modules/jquery/dist/jquery.js");function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r,n,i,a,s=[],l=!0,c=!1;try{if(i=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;l=!1}else for(;!(l=(r=i.call(o)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,n=e}finally{try{if(!l&&null!=o.return&&(a=o.return(),Object(a)!==a))return}finally{if(c)throw n}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=Array(t);o<t;o++)r[o]=e[o];return r}r.gsap.registerPlugin(n.ScrollTrigger);var l={selectedProducer:null,selectedProduct:null,searchTimeout:null,isAnimating:!1,handleDownload:function(e,t){console.log("Download initiated:",{url:e,filename:t});try{fetch(e).then((function(e){return e.blob()})).then((function(e){var o=window.URL.createObjectURL(e),r=document.createElement("a");r.href=o,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(o)}))}catch(e){console.error("Download error:",e)}},initDropdowns:function(){var e,t=this;i(".trade-module__search-item--producer .trade-module__search-btn").addClass("active"),i(".trade-module__search-item--producer .trade-module__search-btn").on("click",(function(e){if(e.preventDefault(),!t.isAnimating){var o=i(e.currentTarget).closest(".trade-module__search-item"),r=o.find(".trade-module__dropdown"),n=o.find(".trade-module__overlay");if(r.is(":visible"))t.closeDropdown(o);else{t.isAnimating=!0;var a=i(".trade-module__search-item--product"),s=a.find(".trade-module__dropdown"),l=a.find(".trade-module__overlay");s.is(":visible")&&(a.css("z-index","10"),s.fadeOut(300),l.fadeOut(300)),o.css("z-index","11"),r.fadeIn(300),n.fadeIn(300,(function(){t.isAnimating=!1}));var c=i(".trade-module__search-btn").offset().top-4*i(window).width()/100;i("html, body").animate({scrollTop:c},500,"swing")}}})),i(".trade-module__search-item--product .trade-module__search-btn").on("click",(function(e){if(e.preventDefault(),!t.isAnimating&&t.selectedProducer){var o=i(e.currentTarget).closest(".trade-module__search-item"),r=o.find(".trade-module__dropdown"),n=o.find(".trade-module__overlay");if(r.is(":visible"))t.closeDropdown(o);else{t.isAnimating=!0;var a=i(".trade-module__search-item--producer"),s=a.find(".trade-module__dropdown"),l=a.find(".trade-module__overlay");s.is(":visible")&&(a.css("z-index","10"),s.fadeOut(300),l.fadeOut(300)),o.css("z-index","11"),r.fadeIn(300),n.fadeIn(300,(function(){t.isAnimating=!1}));var c=i(".trade-module__search-btn").offset().top-4*i(window).width()/100;i("html, body").animate({scrollTop:c},500,"swing")}}})),i(".trade-module__overlay").on("click",(function(e){if(e.preventDefault(),!t.isAnimating){var o=i(e.currentTarget).closest(".trade-module__search-item");t.closeDropdown(o)}})),i(".trade-module__search-item--producer").on("click","button[data-id]",(function(e){e.preventDefault();var o=i(e.currentTarget),r=o.data("id"),n=o.text();t.selectedProducer=r,t.selectedProduct=null,i(".trade-module__search-item--producer .trade-module__search-btn-title").text(n),i(".trade-module__search-item--producer .trade-module__search-btn").addClass("active"),i(".trade-module__search-item--product .trade-module__search-btn").addClass("active"),i(".trade-module__search-item--product").addClass("active");var a=i(".trade-module__search-item--product .trade-module__search-btn-title");a.text(a.data("default")),i(".search-assets-btn").addClass("active"),t.closeDropdown(o.closest(".trade-module__search-item")),t.loadProducts(r)})),i(".trade-module__search-item--product").on("click","button[data-id]",(function(e){e.preventDefault();var o=i(e.currentTarget),r=(o.data("id"),o.text()),n=o.data("slug");t.selectedProduct=n,i(".trade-module__search-item--product .trade-module__search-btn-title").text(r),i(".trade-module__search-item--product .trade-module__search-btn").addClass("active"),i(".search-assets-btn").addClass("active"),t.closeDropdown(o.closest(".trade-module__search-item"))})),i(".trade-module__dropdown input").on("input",(function(e){var o=i(e.currentTarget),r=o.closest(".trade-module__dropdown");clearTimeout(t.searchTimeout),t.searchTimeout=setTimeout((function(){var e=o.val().toLowerCase().trim();r.find("li").each((function(t,o){var r=i(o),n=r.text().toLowerCase();e.length<3?r.show():r.toggle(n.includes(e))}))}),300)})),i(".search-assets-btn").on("click",(function(e){e.preventDefault(),(t.selectedProducer||t.selectedProduct)&&t.loadAssets()})),i(".reset-btn").on("click",(function(e){e.preventDefault(),t.resetAll(),i(".reset-btn").removeClass("active")})),null!==(e=window.tradeConfig)&&void 0!==e&&e.currentProduct&&(this.selectedProduct=window.tradeConfig.currentProduct,this.selectedProducer=window.tradeConfig.currentProducer,this.selectedProducer&&(i(".trade-module__search-item--producer .trade-module__search-btn").addClass("active"),i(".trade-module__search-item--product .trade-module__search-btn").addClass("active"),i(".trade-module__search-item--product").addClass("active"),i(".search-assets-btn").addClass("active"),this.loadProducts(this.selectedProducer)),this.loadAssets())},closeDropdown:function(e){var t=this;if(!this.isAnimating){this.isAnimating=!0,e.css("z-index","10");var o=e.find(".trade-module__dropdown"),r=e.find(".trade-module__overlay");o.fadeOut(300),r.fadeOut(300,(function(){t.isAnimating=!1}))}},loadProducts:function(e){var t=i(".trade-module__search-item--product .trade-module__dropdown ul");t.empty(),t.html('<li><button type="button" style="pointer-events: none;">Loading products...</button></li>'),i.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:{action:"get_producer_products",producer_id:e},success:function(e){e.success&&e.data?(t.empty(),e.data.forEach((function(e){t.append('\n              <li>\n                <button type="button" data-id="'.concat(e.ID,'" data-slug="').concat(e.post_name,'">\n                  ').concat(e.post_title,"\n                </button>\n              </li>\n            "))}))):t.html('<li><button type="button" style="pointer-events: none;">No products found</button></li>')},error:function(){t.html('<li><button type="button" style="pointer-events: none;">Error loading products</button></li>')}})},loadAssets:function(){var e=this,t=i(".reset-btn");i(".search-assets-btn").addClass("active"),console.log("Loading assets for:",{product:this.selectedProduct,producer:this.selectedProducer}),i(".trade-module__results").html('<div class="trade-module__results-row">
1<h1 class="heading--large heading--mid">Loading assets...</h1></div>').show(),i.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:{action:"get_trade_assets",product:this.selectedProduct,producer:this.selectedProducer},success:function(o){if(console.log("Assets response:",o),o.data&&o.data.debug&&(console.group("🔍 Trade Assets Debug Info"),console.log("Request:",o.data.debug.request),o.data.debug.product_lookup&&console.log("Product Lookup:",o.data.debug.product_lookup),o.data.debug.producer_products&&console.log("Producer Products:",o.data.debug.producer_products),console.log("WP Query Args:",o.data.debug.wp_query_args),console.log("Query Results:",o.data.debug.query_results),console.log("Summary:",o.data.debug.summary),o.data.debug.query_results.posts_with_data.length>0&&(console.group("Posts Processed:"),o.data.debug.query_results.posts_with_data.forEach((function(e){console.log("".concat(e.included?"✅":"❌"," ").concat(e.post_title),e)})),console.groupEnd()),console.groupEnd()),o.success&&o.data){var r=o.data.categories||o.data;Object.values(r).some((function(e){return e.assets&&Object.keys(e.assets).length>0}))?e.renderResults(r):i(".trade-module__results").html('<div class="trade-module__results-row"><h1 class="heading--large heading--mid">No assets found</h1></div>')}else console.error("Invalid response format:",o),i(".trade-module__results").html('<div class="trade-module__results-row"><h1 class="heading--large heading--mid">No assets found</h1></div>');t.addClass("active")},error:function(e,t,o){console.error("AJAX error:",{status:t,error:o,response:e.responseText}),i(".trade-module__results").html('<div class="trade-module__results-row"><h1 class="heading--large heading--mid">Error loading assets</h1></div>')}})},renderResults:function(e){var t=i(".trade-module__results");t.empty();var o={bottle_front_no_vintage:1,bottle_back_no_vintage:2,bottle_front_with_vintage:3,bottle_back_with_vintage:4,label_front_no_vintage:5,label_back_no_vintage:6,label_front_with_vintage:7,label_back_with_vintage:8,tech_sheet:9,sell_sheet:10,shelf_talker:11,upc:12,gift_box:13,outer_case_shipper:14,logo:15,logo_vector:16,brand_brochure:17,map_graphic:18,photo_key_person:19,photo_key_person_2:20,photo_winemaker:21,photo_download_1:22,photo_download_2:23,photo_download_3:24,recipe_1_download:25,recipe_2_download:26,recipe_3_download:27,recipe_4_download:28,recipe_5_download:29,recipe_6_download:30,media_alert:31};Object.entries(window.tradeConfig.categories).forEach((function(r){var n,s=a(r,2),l=s[0],c=s[1];if(null!==(n=e[l])&&void 0!==n&&n.assets&&Object.keys(e[l].assets).length>0){var u=i('\n          <div class="trade-module__results-row">\n            <h1 id="'.concat(c.id,'" class="heading--large heading--mid">\n              ').concat(c.title,"\n            </h1>\n          </div>\n        ")),d=Object.entries(e[l].assets).reduce((function(e,t){var r=a(t,2),n=r[0],i=r[1];return"photography"!==l||["photo_download_1","photo_download_2","photo_download_3"].includes(n)?(i.forEach((function(t){e.push({type:n,asset:t,order:o[n]||999})})),e):e}),[]).sort((function(e,t){return(e.order||999)-(t.order||999)}));d.length>0&&(d.forEach((function(e){var t=e.type,o=e.asset,r=t.split("_").map((function(e){return"upc"===e.toLowerCase()?"UPC":e.charAt(0).toUpperCase()+e.slice(1)})).join(" ");"bottles_labels"===l&&(r.toLowerCase().includes("no vintage")||r.toLowerCase().includes("vintage"))&&(r=r.replace(/(No Vintage|Vintage)/i,"($1)"));var n=[],i=["ai","eps","tiff","zip","doc","docx"],a=function(e,t){var o=e.replace(/\.[^/.]+$/,"");return"".concat(o.toLowerCase().replace(/\s+/g,"_"),".").concat(t.toLowerCase())},s=function(e){return e&&e.includes("salsify.com")?e.replace("http://","https://"):e};if(o.image&&!o.file){var c,d=o.format?o.format.toUpperCase():"FILE",p=s(o.salsify_url||o.image.url),f=a(o.title,o.format||"jpg");!i.includes(null===(c=o.format)||void 0===c?void 0:c.toLowerCase())&&n.push('\n                  <a class="cta" href="'.concat(p,'" target="_blank">\n                    View ').concat(d,"\n                  </a>\n                ")),n.push('\n                <a class="cta download-asset" \n                   href="javascript:void(0);"\n                   data-url="'.concat(p,'"\n                   data-filename="').concat(f,'">\n                  Download ').concat(d,"\n                </a>\n              "))}if(o.file){var m,h=o.format?o.format.toUpperCase():"FILE",v=s(o.salsify_url||o.file.url),g=a(o.title,o.format||"file");!i.includes(null===(m=o.format)||void 0===m?void 0:m.toLowerCase())&&n.push('\n                  <a class="cta" href="'.concat(v,'" target="_blank">\n                    View ').concat(h,"\n                  </a>\n                ")),n.push('\n                <a class="cta download-asset" \n                   href="javascript:void(0);"\n                   data-url="'.concat(v,'"\n                   data-filename="').concat(g,'">\n                  Download ').concat(h,"\n                </a>\n              "))}var _=o.format&&"pdf"===o.format.toLowerCase(),w=o.format&&["pdf","ai","tiff","eps","zip","doc","docx"].includes(o.format.toLowerCase()),y=function(){return o.thumbnail_url?o.thumbnail_url:_?o.file&&o.file.icon?o.file.icon:o.image&&o.image.url&&"application/pdf"!==o.image.mime_type?o.image.url:"/wp-content/themes/affinity-custom-webpack/public/img/fw-pdf-icon.webp":w&&!_?"/wp-content/themes/affinity-custom-webpack/public/img/fw-file-icon.webp":o.image&&o.image.url?o.image.url:null},b=function(e){if(!e)return null;var t=e;try{e.includes("%")&&(t=decodeURIComponent(e))}catch(e){console.error("Error decoding filename:",e)}if(t.length>35){var o=t.split(".").pop(),r=t.substring(0,t.lastIndexOf("."));return r.substring(0,20)+"..."+r.substring(r.length-5)+"."+o}return t}(function(e){if(e.filename)return e.filename;if(e.file&&e.file.filename)return e.file.filename;if(e.image&&e.image.filename)return e.image.filename;if(e.title){var t=e.format||"file";return"".concat(e.title.toLowerCase().replace(/\s+/g,"_"),".").concat(t.toLowerCase())}return null}(o));u.append('\n              <div class="trade-module__results-item">\n                '.concat(y()?'\n                  <div class="trade-module__results-item-image" \n                       style="background-image: url(\''.concat(y(),'\');"\n                       role="img"\n                       aria-label="').concat(o.image&&o.image.alt?o.image.alt.replace(/"/g,"&quot;"):r.replace(/"/g,"&quot;"),'">\n                  </div>\n                '):"",'\n                <div class="trade-module__results-item-content">\n                  <div class="trade-module__results-item-title">\n                    ').concat(r,"\n                  </div>\n                  ").concat(b?'<div class="trade-module__results-item-filename">'.concat(b,"</div>"):"","\n                  ").concat(n.length>0?'\n                    <div class="cta-group cta-group--center">\n                      '.concat(n.join("\n"),"\n                    </div>\n                  "):"","\n                </div>\n              </div>\n            "))})),t.append(u))}})),t.children().length||t.html('<div class="trade-module__results-row">
1<h1 class="heading--large heading--mid">No assets found</h1></div>');var r=window.location.hash;if(r){var n=i(r);n.length&&i("html, body").animate({scrollTop:n.offset().top-100},500)}},resetAll:function(){this.selectedProducer=null,this.selectedProduct=null,i(".trade-module__search-btn").removeClass("active"),i(".trade-module__search-btn-title").each((function(e,t){var o=i(t);o.text(o.data("default"))})),i(".search-assets-btn").removeClass("active"),i(".trade-module__search-item--producer .trade-module__search-btn").addClass("active"),i(".trade-module__results").hide().empty(),window.history.replaceState({},"","/trade")},init:function(){var e=this;window.location.pathname.toLowerCase().includes("trade")&&(console.log("Initializing trade page"),this.initDropdowns(),i(document).on("click",".trade-module__results-item .download-asset",(function(t){t.preventDefault();var o=i(t.currentTarget),r=o.data("url"),n=o.data("filename");e.handleDownload(r,n)})))},handleReset:function(){i(".reset-btn").removeClass("active")}};t.default=l},
1"./src/js/video.js":function(e,t,o){"use strict";o.r(t);var r=o("./node_modules/gsap/index.js"),n=o("./node_modules/gsap/ScrollTrigger.js"),i=o("./node_modules/jquery/dist/jquery.js");function a(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return s(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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 i,a=!0,l=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==o.return||o.return()}finally{if(l)throw i}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=Array(t);o<t;o++)r[o]=e[o];return r}r.gsap.registerPlugin(n.ScrollTrigger);var l={players:[],mp4Players:[],youtubeAPILoaded:!1,init:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".video-module__video:not(.preview-only), .producers-video-module__video:not(.preview-only), .products-video-module__video:not(.preview-only)";console.log("Initializing video module for:",t);var o=document.querySelectorAll(t);o.length>0?(console.log("Found videos:",o.length),this.initVideoPlayer(t),this.controlVideo(t),this.initScrollTrigger(t),i(document).ready((function(){console.log("DOM ready, loading YouTube API"),document.querySelectorAll(".youtube-video").length>0?e.loadYouTubeAPI(t).catch((function(e){console.error("Error loading YouTube API:",e)})):console.log("No YouTube videos found, skipping API load")}))):console.log("No videos found for selector:",t)},loadYouTubeAPI:function(e){var t=this;return console.log("Loading YouTube API..."),new Promise((function(e){if(window.YT&&window.YT.Player)return console.log("YouTube API already loaded"),t.youtubeAPILoaded=!0,void e();var o="onYouTubeIframeAPIReady_"+Math.random().toString(36).substr(2,9);window[o]=function(){console.log("YouTube API Ready"),t.youtubeAPILoaded=!0,e(),delete window[o]};var r=document.createElement("script");r.src="https://www.youtube.com/iframe_api",r.onload=function(){window.onYouTubeIframeAPIReady=window[o]};var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(r,n),console.log("YouTube API script added")})).then((function(){t.initYouTubePlayers(e)}))},initYouTubePlayers:function(e){var t=this;console.log("Initializing YouTube players");var o=document.querySelectorAll(".youtube-video iframe");console.log("Found iframes:",o.length),o.forEach((function(e,o){var r=t.getYouTubeVideoId(e.src);if(console.log("Processing iframe",o,"with video ID:",r,"and src:",e.src),r){var n=document.createElement("div");n.id="youtube-player-".concat(o),e.parentNode.insertBefore(n,e),e.remove();try{new YT.Player("youtube-player-".concat(o),{videoId:r,playerVars:{autoplay:0,controls:1,rel:0,showinfo:0,title:0,modestbranding:1,autohide:1,enablejsapi:1,color:"white",cc_load_policy:0,iv_load_policy:3,playsinline:1,fs:1,start:0,end:null,mute:0,loop:0,origin:window.location.origin,playlist:r},events:{onReady:function(e){console.log("Player ready:",o),t.players[o]=e.target},onStateChange:function(e){if(console.log("Player state changed:",e.data),e.data===YT.PlayerState.ENDED){var o=n.closest(".full-video"),r=o.closest(".video-module__video");t.fadeOutVideo(o,r)}},onError:function(e){console.error("YouTube Player Error:",e.data)}}})}catch(e){console.error("Error creating YouTube player:",e)}}else console.error("No video ID found for iframe:",e)}))},getYouTubeVideoId:function(e){if(!e)return null;try{if(e.includes("embed/https")&&(e=e.split("embed/")[1]),e.includes("watch?v=")){var t=new URL(e),o=new URLSearchParams(t.search).get("v");if(o&&11===o.length)return o}if(e.includes("youtu.be/")){var r,n=null===(r=e.split("youtu.be/")[1])||void 0===r?void 0:r.split(/[#?]/)[0];if(n&&11===n.length)return n}if(e.includes("/embed/")){var i,s=null===(i=e.split("/embed/")[1])||void 0===i?void 0:i.split(/[#?]/)[0];
1if(s&&11===s.length)return s}if(11===e.length&&/^[a-zA-Z0-9_-]{11}$/.test(e))return e;var l=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);if(l&&11===l[2].length)return l[2];var c,u=a(e.match(/[a-zA-Z0-9_-]{11}/g)||[]);try{for(u.s();!(c=u.n()).done;){var d=c.value;if(11===d.length)return d}}catch(e){u.e(e)}finally{u.f()}}catch(e){console.error("Error parsing YouTube URL:",e)}return null},fadeOutVideo:function(e,t){var o=1,r=setInterval((function(){if(o>0)o-=.1,e.style.opacity=o;else if(clearInterval(r),e.style.display="none",t){var n=t.querySelector(".preview-video");n&&(n.style.display="block",n.style.opacity="1",n.currentTime=0,n.play().catch((function(e){console.log("Preview video autoplay prevented after full video ended:",e)})))}}),40)},initVideoPlayer:function(e){var t=this;console.log("Initializing video player");var o=document.querySelectorAll("video.preview-video");console.log("Found preview videos:",o.length),o.forEach((function(e){e instanceof HTMLVideoElement?(console.log("Setting up video:",e),e.muted=!0,e.loop=!0,e.playsInline=!0,e.play().catch((function(e){console.log("Preview video autoplay prevented:",e)}))):console.log("Not a video element:",e)}));var r=document.querySelectorAll("video.full-video-mp4");console.log("Found MP4 full videos:",r.length),r.forEach((function(e,o){e instanceof HTMLVideoElement&&(console.log("Setting up MP4 full video:",e),t.mp4Players[o]=e,e.addEventListener("ended",(function(){var o=e.closest(".full-video"),r=o.closest(".video-module__video");t.fadeOutVideo(o,r)})))}
1))},controlVideo:function(e){var t=document.querySelectorAll(e),o=this;t.forEach((function(e,t){var r=e.querySelector(".video-module__video-play-btn");if(r){r.addEventListener("click",(function(r){r.preventDefault();var n=e.hasAttribute("data-mp4"),i=n?e.querySelector(".mp4-video"):e.querySelector(".full-video"),a=e.querySelector(".preview-video");if(i&&!i.style.display||"none"===i.style.display){i.style.display="block",i.style.opacity="0";var s=0,l=setInterval((function(){if(s<1)s+=.1,i.style.opacity=s,a.style.opacity=1-s;else if(clearInterval(l),a.style.display="none",a&&!a.paused&&a.pause(),n){var e=i.querySelector("video");e&&e.play().catch((function(e){console.error("Error playing MP4 video:",e)}))}else o.players[t]&&o.players[t].playVideo()}),40)}}));var n=e.querySelector(".video-module__video-ada-btn");n&&n.addEventListener("click",(function(t){t.preventDefault();var o=e.querySelector(".preview-video");n.classList.contains("paused")?(n.classList.remove("paused"),o.play()):(n.classList.add("paused"),o.pause())}))}}))},initScrollTrigger:function(e){var t=this;console.log("Initializing ScrollTrigger for:",e);[".video-module__video-player",".producers-video-module__video-player",".products-video-module__video-player"].forEach((function(e){var o=document.querySelectorAll(e);console.log("Found ".concat(o.length," video players for selector: ").concat(e)),o.forEach((function(e,o){console.log("Creating ScrollTrigger for:",e),n.ScrollTrigger.create({trigger:e,start:"top bottom",end:"bottom top",onEnter:function(){console.log("Video entered viewport")},onLeave:function(){console.log("Video left viewport"),t.players[o]&&t.players[o].getPlayerState()===YT.PlayerState.PLAYING&&t.players[o].pauseVideo(),t.mp4Players[o]&&!t.mp4Players[o].paused&&t.mp4Players[o].pause()},onEnterBack:function(){console.log("Video entered viewport from bottom")},onLeaveBack:function(){console.log("Video left viewport from top"),t.players[o]&&t.players[o].getPlayerState()===YT.PlayerState.PLAYING&&t.players[o].pauseVideo(),t.mp4Players[o]&&!t.mp4Players[o].paused&&t.mp4Players[o].pause()}})}))}))}};t.default=l}
1,"?34aa":function(){}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var i=o[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}r.m=t,e=[],r.O=function(t,o,n,i){if(!o){var a=1/0;for(u=0;u<e.length;u++){o=e[u][0],n=e[u][1],i=e[u][2];for(var s=!0,l=0;l<o.length;l++)(!1&i||a>=i)&&Object.keys(r.O).every((function(e){return r.O[e](o[l])}))?o.splice(l--,1):(s=!1,i<a&&(a=i));if(s){e.splice(u--,1);var c=n();void 0!==c&&(t=c)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[o,n,i]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={bundle:0};r.O.j=function(t){return 0===e[t]};var t=function(t,o){var n,i,a=o[0],s=o[1],l=o[2],c=0;if(a.some((function(t){return 0!==e[t]}))){for(n in s)r.o(s,n)&&(r.m[n]=s[n]);if(l)var u=l(r)}for(t&&t(o);c<a.length;c++)i=a[c],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(u)},o=self.webpackChunkaffinity_custom_webpack=self.webpackChunkaffinity_custom_webpack||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))}();var n=r.O(void 0,["vendors"],(function(){return r("./src/js/index.js")}));n=r.O(n)}();
2//# sourceMappingURL=bundle.min.js.map

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.