function selectModenaBanklink(id, value){
console.log('[mdn] selectModenaBanklink', id, value);
try {
const targetId=id?.startsWith('modena_banklinks_option_')
? id
: `modena_banklinks_option_${id}`;
const el=document.getElementById(targetId);
const hidden=document.getElementById('modena_selected_payment_method');
if(el?.classList.contains('modena_banklink_checked')&&hidden?.value===value){
return
}
unselectAllModenaBanklinks();
el?.classList.add('modena_banklink_checked');
hidden&&(hidden.value=value);
window.currentSelectedId=targetId;
window.currentSelectedValue=value;
} catch (e){
console.warn('selectModenaBanklink error', e);
}}
function unselectAllModenaBanklinks(){
document
.querySelectorAll('[id^="modena_banklinks_option_"]')
.forEach(unselectModenaBanklink);
}
function unselectModenaBanklink(banklink){
banklink?.classList?.remove('modena_banklink_checked');
}
function modenaSelectLocality(code){
document.querySelectorAll('.modena_locality_tab').forEach(t=> {
t.classList.toggle('modena_locality_tab_active', t.dataset.locality===code);
});
const hiddenLocality=document.getElementById('modena_selected_locality');
if(hiddenLocality) hiddenLocality.value=code;
const allOptions=document.querySelectorAll('#modena_banklinks_wrapper div');
allOptions.forEach(opt=> {
opt.style.display=opt.classList.contains(`locality_${code}`) ? '':'none';
});
const hiddenMethod=document.getElementById('modena_selected_payment_method');
const visibleOptions=document.querySelectorAll(`#modena_banklinks_wrapper .locality_${code}`);
let kept=false;
if(hiddenMethod?.value){
visibleOptions.forEach(opt=> {
if(opt.getAttribute('code')===hiddenMethod.value){
selectModenaBanklink(opt.id, hiddenMethod.value);
kept=true;
}});
}
if(!kept){
const firstOption=visibleOptions[0];
const codeAttr=firstOption?.getAttribute('code');
if(firstOption&&codeAttr) selectModenaBanklink(firstOption.id, codeAttr);
}};
!function(){var e,t,n={1610:function(e,t,n){"use strict";n.d(t,{C:function(){return r}});const r=function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},2151:function(e){"use strict";e.exports=globalThis.ctEvents},2491:function(e,t,n){var r,o,i;
i=function(){var e,t,n=document,r=n.getElementsByTagName("head")[0],o="push",i="readyState",c="onreadystatechange",u={},a={},l={},s={};function d(e,t){for(var n=0,r=e.length;n<r;++n)if(!t(e[n]))return!1;return 1}function f(e,t){d(e,function(e){return t(e),1})}function m(t,n,r){t=t[o]?t:[t];var i=n&&n.call,c=i?n:r,p=i?t.join(""):n,b=t.length;function v(e){return e.call?e():u[e]}function g(){if(! --b)for(var e in u[p]=1,c&&c(),l)d(e.split("|"),v)&&!f(l[e],v)&&(l[e]=[])}return setTimeout(function(){f(t,function t(n,r){return null===n?g():(r||/^https?:\/\//.test(n)||!e||(n=-1===n.indexOf(".js")?e+n+".js":e+n),s[n]?(p&&(a[p]=1),2==s[n]?g():setTimeout(function(){t(n,!0)},0)):(s[n]=1,p&&(a[p]=1),void h(n,g)))})},0),m}function h(e,o){var u,a=n.createElement("script");a.onload=a.onerror=a[c]=function(){a[i]&&!/^c|loade/.test(a[i])||u||(a.onload=a[c]=null,u=1,s[e]=2,o())},a.async=1,a.src=t?e+(-1===e.indexOf("?")?"?":"&")+t:e,r.insertBefore(a,r.lastChild)}return m.get=h,m.order=function(e,t,n){!function r(o){o=e.shift(),e.length?m(o,r):m(o,t,n)}()},m.path=function(t){e=t},m.urlArgs=function(e){t=e},m.ready=function(e,t,n){e=e[o]?e:[e];var r,i=[];return!f(e,function(e){u[e]||i[o](e)})&&d(e,function(e){return u[e]})?t():(r=e.join("|"),l[r]=l[r]||[],l[r][o](t),n&&n(i)),m},m.done=function(e){m([null],e)},m},e.exports?e.exports=i():void 0===(o="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=o)},3793:function(e,t,n){"use strict";n.d(t,{U:function(){return u}});n(2151);let r=null,o=matchMedia("all and (max-width: 689px)"),i=matchMedia("all and (max-width: 999px)");const c=function(){r=o.matches?"mobile":i.matches?"tablet":"desktop"};c(),o.addListener(function(){return c()}),i.addListener(function(){return c()});const u=function(){let{withTablet:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e?r:"tablet"===r?"mobile":r}},3986:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,{A:function(){return r}})},4100:function(e,t,n){"use strict";n.d(t,{F:function(){return c},W:function(){return u}});var r=n(4705),o=n(6555);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}const c=function(e,t){if(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({container:null,openStrategy:"full"},t),document.body.hasAttribute("data-panel")&&"skip"!==t.openStrategy)return;(0,o.JJ)(t.container).then(function(){"skip"!==t.openStrategy&&(document.body.dataset.panel="",t.container.classList.add("active"),requestAnimationFrame(function(){requestAnimationFrame(function(){document.body.dataset.panel="in"+(t.container.dataset.behaviour.indexOf("left")>-1?":left":t.container.dataset.behaviour.indexOf("right")>-1?":right":"")})})),"full"!==t.openStrategy&&"skip"!==t.openStrategy||n.e(447).then(n.bind(n,8447)).then(function(n){let{handleClick:r}=n;r(e,t)})})},u=function(e,t){let{event:n,focus:r=!1}=t;c(n,{isModal:!0,container:document.querySelector(e.dataset.togglePanel||e.hash),clickOutside:!0,focus:r})}},4705:function(e,t,n){"use strict";function r(e){return r="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},r(e)}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{A:function(){return i}})},5747:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});let r=null;window.IntersectionObserver&&(r=new IntersectionObserver(function(e){return e.filter(function(e){let{isIntersecting:t}=e;return t}).map(function(e){let{target:t}=e;return t}).filter(function(e){return(e.dataset.reveal||"").indexOf("no")>-1}).map(function(e,t){let n=(e.dataset.reveal||"").indexOf("bottom")>-1;e.dataset.reveal=n?`yes:${t+1}`:"yes"})}));const o=function(e){if(!window.IntersectionObserver)return;let t=e.querySelectorAll('[data-reveal*="no"]');0!==t.length&&t[0].dataset.reveal&&[...t].map(function(e){return r.observe(e)})}},6555:function(e,t,n){"use strict";n.d(t,{JJ:function(){return g},MK:function(){return v},qN:function(){return p},yc:function(){return h}});var r=n(4705),o=n(3986),i=n(2151),c=n.n(i),u=n(1610),a=n(8043),l=n.n(a);const s=["mount","el"];function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const m=function(e){let{els:t,events:n,forcedEvents:r,load:i,mount:c,condition:a,trigger:d}=e;t||(t=[]),n||(n=[]),r||(r=[]),d||(d=[]),d=d.map(function(e){return"string"==typeof e?{id:e}:e}),c||(c=function(e){let{mount:t,el:n}=e,r=(0,o.A)(e,s);return n?t(n,r):t()}),t&&"[object Function]"==={}.toString.call(t)&&(t=t());const m=(Array.isArray(t)?t:[t]).reduce(function(e,t){return[...e,...Array.isArray(t)?t:"string"==typeof t?document.querySelectorAll(t):[t]]},[]);0!==m.length&&(a&&!a({els:t,allEls:m})||(0!==d.length?d.forEach(function(e){if("click"===e.id&&m.map(function(t){t.hasLazyLoadClickListener||(t.hasLazyLoadClickListener=!0,t.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault(),i().then(function(n){return c(f(f({},n),{},{event:e,el:t}))})},f({},e.once?{once:!0}:{})))}),"change"===e.id&&m.map(function(e){if(e.hasLazyLoadChangeListener)return;e.hasLazyLoadChangeListener=!0;const t=function(t){t.preventDefault(),i().then(function(n){return c(f(f({},n),{},{event:t,el:e}))})};l()?l()(e).on("change",t):e.addEventListener("change",t)}),"scroll"===e.id&&m.map(function(e){e.hasLazyLoadScrollListener||(e.hasLazyLoadScrollListener=!0,setTimeout(function(){let t=scrollY,n=function(r){if(e.parentNode)return Math.abs(scrollY-t)>30?(document.removeEventListener("scroll",n),void i().then(function(t){return c(f(f({},t),{},{event:r,el:e}))})):void 0;document.removeEventListener("scroll",n)};document.addEventListener("scroll",n)},500))}),"slight-mousemove"===e.id&&!document.body.hasSlightMousemoveListenerTheme){document.body.hasSlightMousemoveListenerTheme=!0;const e=function(e){m.map(function(e){i().then(function(t){return c(f(f({},t),{},{el:e}))})})};document.addEventListener("mousemove",e,{once:!0})}"input"===e.id&&m.map(function(e){e.hasLazyLoadInputListener||(e.hasLazyLoadInputListener=!0,e.addEventListener("input",function(t){return i().then(function(t){return c(f(f({},t),{},{el:e}))})},{once:!0}))}),"hover-with-touch"===e.id&&m.map(function(e){if(e.dataset.autoplay&&parseFloat(e.dataset.autoplay)){return void(e.getBoundingClientRect().width>0&&!e.hasLazyLoadMouseOverAutoplayListener&&(e.hasLazyLoadMouseOverAutoplayListener=!0,setTimeout(function(){i().then(function(t){return c(f(f({},t),{},{el:e}))})},10)))}e.hasLazyLoadMouseOverListener||(e.hasLazyLoadMouseOverListener=!0,e.forcedMount=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i().then(function(n){return c(f(f({},n),{},{el:e},t))})},["mouseover",...(0,u.C)()?["touchstart"]:[]].map(function(t){e.addEventListener(t,function(t){"touchstart"===t.type?document.addEventListener("touchmove",function(){e.forcedMount({event:t})},{once:!0}):e.forcedMount({event:t})},{once:!0,passive:!0})}))}),"hover-with-click"===e.id&&m.map(function(t){if(t.hasLazyLoadClickHoverListener)return;t.hasLazyLoadClickHoverListener=!0;const n=function(e){i().then(function(n){return c(f(f({},n),{},{event:e,el:t}))})};let r=!1;const o=function(t){return!!e.ignoredEls&&e.ignoredEls.some(function(e){return t.target.closest(e)||t.target.matches(e)})},a=new AbortController;t.addEventListener("mouseover",function(e){o(e)||((0,u.C)()&&(r=setTimeout(function(){r=!0,n(e),a.abort()},500)),(0,u.C)()||(a.abort(),n(e)))},{signal:a.signal}),(0,u.C)()&&t.addEventListener("click",function(e){o(e)||(a.abort(),e.preventDefault(),!0!==r&&(!1!==r&&clearTimeout(r),n(e)))},{signal:a.signal}),t.addEventListener("focus",n,{once:!0})}),"hover"===e.id&&m.map(function(e){e.hasLazyLoadMouseOverListener||(e.hasLazyLoadHoverListener=!0,e.addEventListener("mouseover",function(t){i().then(function(n){return c(f(f({},n),{},{event:t,el:e}))})},{once:!0}))}),"submit"===e.id&&m.map(function(t){t.hasLazyLoadSubmitListener||(t.hasLazyLoadSubmitListener=!0,t.addEventListener("submit",function(n){n.submitter&&e.ignoreSubmitter&&e.ignoreSubmitter.find(function(e){return n.submitter.matches(e)})||(n.preventDefault(),i().then(function(e){return c(f(f({},e),{},{event:n,el:t}))}))}))})}):i().then(function(e){m.map(function(t){c(f(f({},e),{},{el:t}))})})))},h=function(e){/comp|inter|loaded/.test(document.readyState)?e():document.addEventListener("DOMContentLoaded",e,!1)},p=function(e,t){const{immediate:n=!1,skipEvents:r=!1}=t||{};r||[...new Set(e.reduce(function(e,t){return[...e,...t.events||[],...t.forcedEvents||[]]},[]))].map(function(t){c().on(t,function(){e.filter(function(e){let{events:n=[]}=e;return n.indexOf(t)>-1}).map(function(e){return m(f(f({},e),{},{trigger:[]}))}),e.filter(function(e){let{forcedEvents:n=[]}=e;return n.indexOf(t)>-1}).map(function(e){return m(f(f(f({},e),e.forcedEventsElsSkip?{}:{els:["body"]}),{},{condition:function(){return!0},trigger:[]}))})})});const o=function(){e.filter(function(e){let{onLoad:t=!0}=e;return"[object Function]"==={}.toString.call(t)?t():!!t}).map(m)};n?o():h(o)};const b={},v=function(e){return new Promise(function(t,n){if(b[e]||document.querySelector(`[href="${e}"]`))return b[e]=!0,void t();requestAnimationFrame(function(){!function(e,t){var n;function r(){!n&&t&&(n=!0,t.call(e))}e.addEventListener&&e.addEventListener("load",r),e.attachEvent&&e.attachEvent("onload",r),"isApplicationInstalled"in navigator&&"onloadcssdefined"in e&&e.onloadcssdefined(r)}(function(e,t){var n=document,r=n.createElement("link");if(t);else{var o=(n.body||n.getElementsByTagName("head")[0]).childNodes;o[o.length-1]}var i=n.styleSheets;r.rel="stylesheet",r.href=e,document.body.appendChild(r);var c=function(e){for(var t=r.href,n=i.length;n--;)if(i[n].href===t)return e();setTimeout(function(){c(e)})};function u(){r.addEventListener&&r.removeEventListener("load",u)}return r.addEventListener&&r.addEventListener("load",u),r.onloadcssdefined=c,c(u),r}(e),function(){b[e]=!0,requestAnimationFrame(function(){t()})})})})},g=function(e){if(!e||!ct_localizations.dynamic_styles_selectors)return Promise.resolve();let t;"string"==typeof e?(t=document.createElement("div"),t.innerHTML=e):t=e;const n=ct_localizations.dynamic_styles_selectors.filter(function(e){return!b[e.url]&&(t.matches(e.selector)||t.querySelector(e.selector))}).map(function(e){return v(e.url)});return n.length>0?Promise.all(n):Promise.resolve()}},6816:function(e,t,n){"use strict";n.d(t,{o:function(){return o}});const r=[".ct-offcanvas-trigger",'.ct-header-account[href*="account-modal"]','[href="#ct-compare-modal"][data-behaviour="modal"]','[data-shortcut="compare"][data-behaviour="modal"]'],o=function(e){return r.some(function(t){return e.matches(t)})}},8043:function(e){"use strict";e.exports=globalThis.jQuery},9125:function(e,t,n){n.p=ct_localizations.public_url},9749:function(e,t,n){"use strict";n.r(t),n.d(t,{areWeDealingWithSafari:function(){return M},getCurrentScreen:function(){return s.U},handleEntryPoints:function(){return l.qN},loadDynamicChunk:function(){return P},loadStyle:function(){return l.MK},onDocumentLoaded:function(){return l.yc},preloadAssetsForContent:function(){return l.JJ},preloadLazyAssets:function(){return I},registerDynamicChunk:function(){return q}});var r=n(4705),o=n(3986);n(9125);const i=new class{constructor(){(0,r.A)(this,"_callbacksMap",{})}on(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(e){t(e.detail)};this._callbacksMap[t]=r,document.addEventListener(e,r,n)}once(e,t){document.addEventListener(e,function(e){t(e.detail)},{once:!0})}off(e,t){document.removeEventListener(e,this._callbacksMap[t])}trigger(e,t){document.dispatchEvent(new CustomEvent(e,{detail:t}))}};window.ctEvents=i;var c=n(2151),u=n.n(c),a=n(5747),l=n(6555),s=n(3793),d=n(2491),f=n.n(d),m=n(4100),h=n(6816);const p={};var b=n(8043),v=n.n(b),g=n(1610);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const O={click:function(e,t,r,o){return[...document.querySelectorAll(e.selector)].map(function(e){if(e.hasLazyLoadClickListener)return;e.hasLazyLoadClickListener=!0;const i=function(i){t.ignore_click&&(i.target.matches(t.ignore_click)||i.target.closest(t.ignore_click))||(i.preventDefault(),e.closest(".ct-panel.active")&&(0,h.o)(e)||(t.has_loader?"button"===t.has_loader.type?n.e(783).then(n.bind(n,6783)).then(function(n){let{bootButtonLoaderFlow:c}=n;c({el:e,chunk:t,event:i,loadedChunks:o,loadChunkWithPayload:r})}):n.e(328).then(n.bind(n,2328)).then(function(n){let{bootModalLoaderFlow:c}=n;c({el:e,event:i,chunk:t,loadedChunks:o,loadChunkWithPayload:r})}):r(t,{event:i},e)))};e.dynamicJsChunkStop=function(){e.removeEventListener("click",i)},e.addEventListener("click",i)})},scroll:function(e,t,n,r){p[t.id]||(p[t.id]=!0,setTimeout(function(){let e=scrollY,r=function(o){if(Math.abs(scrollY-e)>30||window.innerHeight+Math.round(scrollY)>=document.body.offsetHeight)return document.removeEventListener("scroll",r),void n(t)};r(),document.addEventListener("scroll",r,{passive:!0})},500))},"window-event":function(e,t,n){e.eventName&&[...document.querySelectorAll(e.selector)].map(function(r){const o="hasWindowEventListener"+e.eventName;r[o]||(r[o]=!0,window.addEventListener(e.eventName,function(e){n(t,{event:e})}))})},submit:function(e,t,n){[...document.querySelectorAll(e.selector)].map(function(e){e.hasLazyLoadSubmitListener||(e.hasLazyLoadSubmitListener=!0,v()?v()(e).on("submit",function(r){r.preventDefault(),n(t,{event:r},e)}):e.addEventListener("submit",function(r){r.preventDefault(),n(t,{event:r},e)}))})},hover:function(e,t,n){t.skipOnTouchDevices&&(0,g.C)()||[...document.querySelectorAll(e.selector)].map(function(e){e.hasLazyLoadHoverListener||(e.hasLazyLoadHoverListener=!0,e.addEventListener("mouseover",function(r){r.preventDefault(),n(t,{event:r},e)}))})},"slight-mousemove":function(e,t,n){const r=document.querySelector(e.selector);if(!document.body.hasSlightMousemoveListener&&r){document.body.hasSlightMousemoveListener=!0;const r=function(o){document.removeEventListener("mousemove",r),n(t,{event:o},[...document.querySelectorAll(e.selector)])};document.addEventListener("mousemove",r)}},"jquery-event":function(e,t,n){e=L({matchTarget:!0},e),document.body.ctHasJqueryEventListener||(document.body.ctHasJqueryEventListener={}),document.body.ctHasJqueryEventListener[t.id]||(document.body.ctHasJqueryEventListener[t.id]=!0,e.events.map(function(r){v()(document.body).on(r,function(r,o){let i=document.body;if(e.matchTarget){if(!r.target.closest(".product"))return;if(i=r.target.closest(".product").querySelector(e.selector),!i)return}for(var c=arguments.length,u=new Array(c>2?c-2:0),a=2;a<c;a++)u[a-2]=arguments[a];n(t,{event:r,eventData:o,eventArguments:u},i)})}))},"dom-event":function(e,t,n){e=L({selector:"body"},e);[...document.querySelectorAll(e.selector)].forEach(function(r){r&&(r.ctHasDomEventListener||(r.ctHasDomEventListener={}),r.ctHasDomEventListener[t.id]||(r.ctHasDomEventListener[t.id]=!0,e.events.map(function(e){r.addEventListener(e,function(e){n(t,{event:e},r)})})))})},cookie:function(e,t,n){t.cookieAbsent&&-1===document.cookie.indexOf(t.cookieAbsent)&&n(t,{})}};function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let S={},E=null;const P=function(e){return new Promise(function(t,n){let r=ct_localizations.dynamic_js_chunks.find(function(t){return t.id===e});if(r||n(),S[r.id])t({chunk:S[r.id],isInitial:!1});else if(S[r.id]={state:"loading"},r.global_data&&r.global_data.map(function(e){e.var&&e.data&&(window[e.var]=e.data)}),r.raw_html&&(document.querySelector(r.raw_html.selector)||document.body.insertAdjacentHTML("beforeend",r.raw_html.html)),r.deps){const e=r.deps.filter(function(e){return!document.querySelector(`script[src*="${r.deps_data[e]}"]`)});e.map(function(e){return r.deps_data[e]});[...e,"root"].map(function(e){return function(){return new Promise(function(n){"root"!==e?f()([r.deps_data[e]],function(){n()}):f()([r.url],function(){n(),t({chunk:S[r.id],isInitial:!0})})})}}).reduce(function(e,t){return e.then(function(e){return t()})},Promise.resolve())}else f()(r.url,function(){t({chunk:S[r.id],isInitial:!0})})})},j=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=function(){S[e.id].mount&&(n?S[e.id].mount(n,t):[...document.querySelectorAll(e.selector)].map(function(n){S[e.id].mount(n,t)}))};P(e.id).then(function(e){let{isInitial:n}=e;n&&r(),!n&&t&&r()}).catch(function(t){console.error("Cannot load chunk",e.id,t)})},A=function(){ct_localizations.dynamic_js_chunks.map(function(e){if(!e.id)return;if(!document.querySelector(e.selector))return;let t=[];e.trigger&&(t=Array.isArray(e.trigger)?e.trigger:[e.trigger]),t=t.map(function(t){return t.trigger?t:{trigger:t,selector:e.selector}});(0===t.length||t.find(function(e){return"initial-mount"===e.trigger}))&&j(e,null),t.map(function(t){"initial-mount"!==t.trigger&&("intersection-observer"!==t.trigger?function(e,t,n,r){(e.trigger||O[e.trigger])&&O[e.trigger](e,t,n,r)}(t,e,j,S):function(e){window.IntersectionObserver&&(E||(E=new IntersectionObserver(function(e){e.map(function(e){let{boundingClientRect:t,target:n,isIntersecting:r}=e;const o=n.__chunk__;if(!r&&t.y>0)return;let i="target-before-bottom";!r&&t.y<0&&(i="target-after-bottom"),("target-before-bottom"!==i||S[o.id])&&j(o,{state:i,target:n},o.el)})})),[...document.querySelectorAll(e.selector)].map(function(t){if(t.ioObserving)return;t.ioObserving=!0;const n=document.querySelector(e.target);n&&(n.__chunk__=k(k({},e),{},{el:t}),E.observe(n))}))}(e))})})},q=function(e,t){S[e]&&"loading"!==S[e].state||(S[e]=t)},_=[{els:function(){return[...document.querySelectorAll('header [data-device="desktop"] [data-id*="menu"] > .menu'),...document.querySelectorAll(".ct-header-account > ul")].filter(function(e){return function(e){return e.querySelector(".menu-item-has-children")||e.querySelector(".page_item_has_children")}(e)})},load:function(){return n.e(907).then(n.bind(n,5907))},events:["ct:header:refresh-menu-submenus"]},{els:function(){return[...document.querySelectorAll('header [data-device="desktop"] [data-id^="menu"][data-responsive]')]},load:function(){return n.e(892).then(n.bind(n,892))},events:["ct:header:responsive-menu:refresh"],condition:function(){return"desktop"===(0,s.U)()&&[...document.querySelectorAll('header [data-device="desktop"] [data-id^="menu"][data-responsive]')].some(function(e){if(!e.firstElementChild)return!1;const t=e.firstElementChild.getBoundingClientRect(),n=[...e.closest("[data-row]").querySelectorAll("[data-items] > [data-id]")].filter(function(t){return t!==e}).filter(function(n){const r=n.getBoundingClientRect();return[t,...[...e.firstElementChild.children].map(function(e){return e.getBoundingClientRect()})].some(function(e){const t=r.left<e.left&&r.right>e.left,n=r.right>e.right&&r.left<e.right,o=r.left>e.left&&r.right<e.right;return t||n||o})}),r=e.parentElement.getBoundingClientRect(),o=t.left>r.left,i=t.right<r.right,c=o&&i&&0===n.length;return c&&(e.dataset.responsive="yes"),!c})}}],C=[{els:function(){return[[...document.querySelectorAll(".ct-search-form[data-live-results]")].filter(function(e){return!e.matches('[id="search-modal"] .ct-search-form[data-live-results]')&&!e.matches(".ct-sidebar .ct-widget .woocommerce-product-search")})]},load:function(){return n.e(662).then(n.bind(n,7662))},mount:function(e){let{mount:t,el:n}=e;return t(n,{})},trigger:["input"]},{els:".ct-sidebar .ct-widget .ct-search-form:not(.woocommerce-product-search)[data-live-results]",load:function(){return n.e(662).then(n.bind(n,7662))},trigger:["input"]},{els:".ct-sidebar .ct-widget .woocommerce-product-search",load:function(){return n.e(662).then(n.bind(n,7662))},mount:function(e){let{mount:t,el:n}=e;return t(n,{})},trigger:["input"]},{els:'[id="search-modal"] .ct-search-form[data-live-results]',load:function(){return n.e(662).then(n.bind(n,7662))},mount:function(e){let{mount:t,el:n}=e;return t(n,{mode:"modal",perPage:6})},trigger:["input"]}],D=["mount","el"];function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const M=/apple/i.test(navigator.vendor);document.addEventListener("click",function(e){return 0});let z=[..._,...C,{els:"[data-parallax]",load:function(){return n.e(173).then(n.bind(n,1173))},events:["blocksy:parallax:init"]},{els:'.flexy-container[data-flexy*="no"]',load:function(){return Promise.all([n.e(71),n.e(229)]).then(n.bind(n,229))},trigger:["hover-with-touch"]},{els:'.ct-share-box [data-network="pinterest"]',load:function(){return n.e(688).then(n.bind(n,9688))},trigger:["click"]},{els:'.ct-share-box [data-network="clipboard"]',load:function(){return n.e(688).then(n.bind(n,9688))},trigger:["click"]},{els:'.ct-media-container[data-media-id]:not([data-state*="hover"]), .ct-dynamic-media[data-media-id]:not([data-state*="hover"])',load:function(){return n.e(338).then(n.bind(n,6338))},trigger:["click","slight-mousemove","scroll"]},{els:'.ct-media-container[data-media-id][data-state*="hover"], .ct-dynamic-media[data-media-id][data-state*="hover"]',load:function(){return n.e(338).then(n.bind(n,6338))},trigger:["click","hover-with-touch"]},{els:'.ct-share-box [data-network]:not([data-network="pinterest"]):not([data-network="email"]):not([data-network="clipboard"])',load:function(){return n.e(688).then(n.bind(n,9688))},trigger:["hover"],condition:function(){return!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}},{els:function(){const e=[".ct-language-switcher > .ct-active-language",'.ct-header-account[data-interaction="dropdown"] > .ct-account-item'],t=document.querySelector('.ct-header-cart > .ct-cart-content:not([data-count="0"])');return t&&!t.closest("#offcanvas")&&e.push(".ct-header-cart > .ct-cart-item"),e},load:function(){return n.e(199).then(n.bind(n,6199))},trigger:["hover-with-click"]},{els:'.ct-back-to-top, .ct-shortcuts-bar [data-shortcut*="scroll_top"]',load:function(){return n.e(643).then(n.bind(n,5643))},events:["ct:back-to-top:mount"],trigger:["scroll"]},{els:'.ct-pagination[data-pagination="load_more"] .ct-load-more',load:function(){return n.e(41).then(n.bind(n,8041))},trigger:[{id:"click",once:!0}],mount:function(e){let{mount:t,el:n,event:r}=e;return t(n.closest(".ct-pagination"),{event:r})}},{els:'.ct-pagination[data-pagination="infinite_scroll"]',load:function(){return n.e(41).then(n.bind(n,8041))},trigger:["scroll"]},{els:function(){return[...new Set([...document.querySelectorAll('[data-reveal*="no"]')].map(function(e){return e.closest(".entries, .products")}).filter(function(e){return!!e}))]},load:function(){return new Promise(function(e){return e({mount:a.F})})}},{els:[".ct-has-link-overlay.is-layout-slider .flexy-item:has(> * > .ct-link-overlay)",".ct-has-link-overlay:not(.is-layout-slider) *:has(> .ct-link-overlay)"],load:function(){return n.e(198).then(n.bind(n,198))},trigger:["click"]},{els:[".ct-modal-action"],load:function(){return new Promise(function(e){return e({mount:m.W})})},events:["ct:header:update"],trigger:["click"]},{els:[".ct-expandable-trigger"],load:function(){return n.e(85).then(n.bind(n,1085))},trigger:["click"]},{els:[".ct-header-search"],load:function(){return new Promise(function(e){return e({mount:m.W})})},mount:function(e){let{mount:t,el:n}=e;t(n,T(T({},(0,o.A)(e,D)),{},{focus:!0}))},events:[],trigger:["click"]}];document.body.className.indexOf("woocommerce")>-1&&n.e(100).then(n.bind(n,100)).then(function(e){let{wooEntryPoints:t}=e;z=[...z,...t],(0,l.qN)(z,{immediate:!0,skipEvents:!0})}),(0,l.qN)(z,{immediate:/comp|inter|loaded/.test(document.readyState)});const N=function(){[...document.querySelectorAll(".ct-header-trigger"),...document.querySelectorAll(".ct-offcanvas-trigger")].map(function(e){e&&!e.hasListener&&(e.hasListener=!0,e.addEventListener("click",function(t){if(t.preventDefault(),!e.dataset.togglePanel&&!e.hash)return;let n=document.querySelector(e.dataset.togglePanel||e.hash);n&&(0,m.F)(t,{container:n,closeWhenLinkInside:!e.closest(".ct-header-cart"),computeScrollContainer:function(){return n.querySelector(".cart_list")&&!n.querySelector('[data-id="cart"] .cart_list')?n.querySelector(".cart_list"):"mobile"===(0,s.U)()&&n.querySelector('[data-device="mobile"] > .ct-panel-content-inner')?n.querySelector('[data-device="mobile"] > .ct-panel-content-inner'):n.querySelector(".ct-panel-content > .ct-panel-content-inner")}})}))})},F=function(e){e.length>0&&Promise.all(e.filter(function(e){let{check:t}=e;return t()}).map(function(e){let{promise:t}=e;return t()})).then(function(e){e.map(function(e){let{mount:t}=e;return t()})})},I=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(0,l.MK)(ct_localizations.dynamic_styles.lazy_load),n.e(783).then(n.bind(n,6783)),n.e(328).then(n.bind(n,2328)),n.e(318).then(n.bind(n,3318)),e&&u().trigger("blocksy:frontend:init")};(0,l.yc)(function(){document.body.addEventListener("mouseover",function(){I(!1);const e=document.querySelector("#search-modal .ct-search-form input");e&&e.value.trim().length>0&&e.dispatchEvent(new Event("input",{bubbles:!0}))},{once:!0,passive:!0});let e=[...document.querySelectorAll('.comment-form [class*="comment-form-field"]')].reduce(function(e,t){return[...e,t.querySelector("input,textarea")]},[]).filter(function(e){return"hidden"!==e.type&&"checkbox"!==e.type});const t=function(){e.map(function(e){e.parentNode.classList.remove("ct-not-empty"),e.value&&e.value.trim().length>0&&e.parentNode.classList.add("ct-not-empty")})};setTimeout(function(){t()},10),e.map(function(e){return e.addEventListener("input",t)}),A(),setTimeout(function(){N()}),F([{promise:function(){return n.e(641).then(n.bind(n,641))},check:function(){return!![...document.childNodes].find(function(e){return 8===e.nodeType&&e.nodeValue.toLowerCase().includes("litespeed")})}}])});let H=!0;u().on("blocksy:frontend:init",function(){(0,l.qN)(z,{immediate:!0,skipEvents:!0}),A(),N(),(0,l.JJ)(document.querySelector("#main-container")),H?H=!1:F([{promise:function(){return n.e(74).then(n.bind(n,7074))},check:function(){return!0}},{promise:function(){return n.e(801).then(n.bind(n,5801))},check:function(){return!!window.gsInitTabs}},{promise:function(){return n.e(24).then(n.bind(n,6024))},check:function(){return!!window.wpcf7}},{promise:function(){return n.e(818).then(n.bind(n,9818))},check:function(){return!!window.turnstile}},{promise:function(){return n.e(943).then(n.bind(n,1943))},check:function(){return!!window.elementorFrontend}},{promise:function(){return n.e(615).then(n.bind(n,2615))},check:function(){return!!window.premiumWooProducts}},{promise:function(){return n.e(807).then(n.bind(n,1807))},check:function(){return!!window._wapf}}])}),u().on("ct:overlay:handle-click",function(e){let{e:t,href:n,container:r,options:o={}}=e;(0,m.F)(t,T(T(T({},n?{container:document.querySelector(n)}:{}),r?{container:r}:{}),o))})}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e].call(i.exports,i,i.exports,o),i.exports}o.m=n,o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=function(e){return Promise.all(Object.keys(o.f).reduce(function(t,n){return o.f[n](e,t),t},[]))},o.u=function(e){return e+"."+{21:"7e3870fb9ddf496b6426",24:"d946ff6a26745c0a316f",41:"a7a1ea2f223af5307414",71:"756aa48f177c2ffe12e4",74:"58cabeaaf75c326ea7fa",85:"852c77193e9f1151c09c",100:"d97f8597e8b55c992feb",173:"5219bb2777d1227439e6",185:"94e67b44c386f42ed129",198:"382ec50759bf63c3266d",199:"0539428797542adbc395",229:"6b448b463d2850a0ebcf",288:"86fccb7b68e2d644a815",318:"d74364c3b1720874d700",328:"abeed6c20623ea057c19",338:"10052ef5f4908a935519",447:"6a62b75b9473b31f8406",474:"920441f43c3dbbd16e46",507:"03629c714bb98b0e33ce",615:"2c688bd02d660c4ff51d",641:"656abb12c469e8c7581a",643:"60b9308e4aa6d8b74291",662:"2374281cbf1f74783adf",688:"ce15744564fb24242e1e",708:"aa0f909eb786bd549ea0",783:"e17d921f2cfdf8fbd0b1",801:"96637952e7eeb591b20b",807:"fde009baa0d33f39147b",818:"36b42f2f4f046eccb100",834:"929b5733684776118167",892:"e5f652f3f981cb511bc3",902:"77258081d145d6dfa53b",907:"1390f43c75fed76e2bb4",943:"a62ea2677a2f38a994a3",957:"f30ba4321059f57f993c",995:"a876638cc4771f4d220a"}[e]+".js"},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e={},t="ctFrontend:",o.l=function(n,r,i,c){if(e[n])e[n].push(r);else{var u,a;if(void 0!==i)for(var l=document.getElementsByTagName("script"),s=0;s<l.length;s++){var d=l[s];if(d.getAttribute("src")==n||d.getAttribute("data-webpack")==t+i){u=d;break}}u||(a=!0,(u=document.createElement("script")).charset="utf-8",o.nc&&u.setAttribute("nonce",o.nc),u.setAttribute("data-webpack",t+i),u.src=n),e[n]=[r];var f=function(t,r){u.onerror=u.onload=null,clearTimeout(m);var o=e[n];if(delete e[n],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(function(e){return e(r)}),t)return t(r)},m=setTimeout(f.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=f.bind(null,u.onerror),u.onload=f.bind(null,u.onload),a&&document.head.appendChild(u)}},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="",function(){var e={792:0};o.f.j=function(t,n){var r=o.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(function(n,o){r=e[t]=[n,o]});n.push(r[2]=i);var c=o.p+o.u(t),u=new Error;o.l(c,function(n){if(o.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),c=n&&n.target&&n.target.src;u.message="Loading chunk "+t+" failed.\n("+i+": "+c+")",u.name="ChunkLoadError",u.type=i,u.request=c,r[1](u)}},"chunk-"+t,t)}};var t=function(t,n){var r,i,[c,u,a]=n,l=0;if(c.some(function(t){return 0!==e[t]})){for(r in u)o.o(u,r)&&(o.m[r]=u[r]);if(a)a(o)}for(t&&t(n);l<c.length;l++)i=c[l],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=globalThis.blocksyJsonP=globalThis.blocksyJsonP||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var i=o(9749);globalThis.ctFrontend=i}();
function wcml_reset_cart_fragments(){try{document.body.dispatchEvent(new Event("wc_fragment_refresh")),sessionStorage.removeItem("wc_fragments")}catch(err){}}function wcml_cart_clear_removed_items(){var xhr=new XMLHttpRequest,formData=new FormData;formData.append("action","wcml_cart_clear_removed_items"),formData.append("wcml_nonce",document.querySelector("#wcml_clear_removed_items_nonce").value),xhr.open("POST",woocommerce_params.ajax_url),xhr.onload=function(){200===xhr.status&&(window.location=window.location.href)},xhr.send(formData)}document.addEventListener("DOMContentLoaded",(function(){document.addEventListener("click",(function(e){e.target.matches(".wcml_removed_cart_items_clear")&&(e.preventDefault(),wcml_cart_clear_removed_items())}));var name;(!sessionStorage.getItem("woocommerce_cart_hash")&&(name="woocommerce_cart_hash",!document.cookie.match("(^|;)\\s*"+name+"\\s*=\\s*([^;]+)")?.pop())||1==actions.is_lang_switched||1==actions.force_reset)&&setTimeout(wcml_reset_cart_fragments,0)}));
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.sbjs=e()}}(function(){return function e(t,r,n){function a(s,o){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!o&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[s]={exports:{}};t[s][0].call(p.exports,function(e){var r=t[s][1][e];return a(r||e)},p,p.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(e,t,r){"use strict";var n=e("./init"),a={init:function(e){this.get=n(e),e&&e.callback&&"function"==typeof e.callback&&e.callback(this.get)}};t.exports=a},{"./init":6}],2:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/utils"),i={containers:{current:"sbjs_current",current_extra:"sbjs_current_add",first:"sbjs_first",first_extra:"sbjs_first_add",session:"sbjs_session",udata:"sbjs_udata",promocode:"sbjs_promo"},service:{migrations:"sbjs_migrations"},delimiter:"|||",aliases:{main:{type:"typ",source:"src",medium:"mdm",campaign:"cmp",content:"cnt",term:"trm",id:"id",platform:"plt",format:"fmt",tactic:"tct"},extra:{fire_date:"fd",entrance_point:"ep",referer:"rf"},session:{pages_seen:"pgs",current_page:"cpg"},udata:{visits:"vst",ip:"uip",agent:"uag"},promo:"code"},pack:{main:function(e){return i.aliases.main.type+"="+e.type+i.delimiter+i.aliases.main.source+"="+e.source+i.delimiter+i.aliases.main.medium+"="+e.medium+i.delimiter+i.aliases.main.campaign+"="+e.campaign+i.delimiter+i.aliases.main.content+"="+e.content+i.delimiter+i.aliases.main.term+"="+e.term+i.delimiter+i.aliases.main.id+"="+e.id+i.delimiter+i.aliases.main.platform+"="+e.platform+i.delimiter+i.aliases.main.format+"="+e.format+i.delimiter+i.aliases.main.tactic+"="+e.tactic},extra:function(e){return i.aliases.extra.fire_date+"="+a.setDate(new Date,e)+i.delimiter+i.aliases.extra.entrance_point+"="+document.location.href+i.delimiter+i.aliases.extra.referer+"="+(document.referrer||n.none)},user:function(e,t){return i.aliases.udata.visits+"="+e+i.delimiter+i.aliases.udata.ip+"="+t+i.delimiter+i.aliases.udata.agent+"="+navigator.userAgent},session:function(e){return i.aliases.session.pages_seen+"="+e+i.delimiter+i.aliases.session.current_page+"="+document.location.href},promo:function(e){return i.aliases.promo+"="+a.setLeadingZeroToInt(a.randomInt(e.min,e.max),e.max.toString().length)}}};t.exports=i},{"./helpers/utils":5,"./terms":9}],3:[function(e,t,r){"use strict";var n=e("../data").delimiter;t.exports={useBase64:!1,setBase64Flag:function(e){this.useBase64=e},encodeData:function(e){return encodeURIComponent(e).replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")},decodeData:function(e){try{return decodeURIComponent(e).replace(/\%21/g,"!").replace(/\%7E/g,"~").replace(/\%2A/g,"*").replace(/\%27/g,"'").replace(/\%28/g,"(").replace(/\%29/g,")")}catch(t){try{return unescape(e)}catch(r){return""}}},set:function(e,t,r,n,a){var i,s;if(r){var o=new Date;o.setTime(o.getTime()+60*r*1e3),i="; expires="+o.toGMTString()}else i="";s=n&&!a?";domain=."+n:"";var c=this.encodeData(t);this.useBase64&&(c=btoa(c).replace(/=+$/,"")),document.cookie=this.encodeData(e)+"="+c+i+s+"; path=/"},get:function(e){for(var t=this.encodeData(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t)){var i=a.substring(t.length,a.length);if(/^[A-Za-z0-9+/]+$/.test(i))try{i=atob(i.padEnd(4*Math.ceil(i.length/4),"="))}catch(s){}return this.decodeData(i)}}return null},destroy:function(e,t,r){this.set(e,"",-1,t,r)},parse:function(e){var t=[],r={};if("string"==typeof e)t.push(e);else for(var a in e)e.hasOwnProperty(a)&&t.push(e[a]);for(var i=0;i<t.length;i++){var s;r[this.unsbjs(t[i])]={},s=this.get(t[i])?this.get(t[i]).split(n):[];for(var o=0;o<s.length;o++){var c=s[o].split("="),u=c.splice(0,1);u.push(c.join("=")),r[this.unsbjs(t[i])][u[0]]=this.decodeData(u[1])}}return r},unsbjs:function(e){return e.replace("sbjs_","")}}},{"../data":2}],4:[function(e,t,r){"use strict";t.exports={parse:function(e){for(var t=this.parseOptions,r=t.parser[t.strictMode?"strict":"loose"].exec(e),n={},a=14;a--;)n[t.key[a]]=r[a]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(e,r,a){r&&(n[t.q.name][r]=a)}),n},parseOptions:{strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},getParam:function(e){for(var t={},r=(e||window.location.search.substring(1)).split("&"),n=0;n<r.length;n++){var a=r[n].split("=");if("undefined"==typeof t[a[0]])t[a[0]]=a[1];else if("string"==typeof t[a[0]]){var i=[t[a[0]],a[1]];t[a[0]]=i}else t[a[0]].push(a[1])}return t},getHost:function(e){return this.parse(e).host.replace("www.","")}}},{}],5:[function(e,t,r){"use strict";t.exports={escapeRegexp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},setDate:function(e,t){var r=e.getTimezoneOffset()/60,n=e.getHours(),a=t||0===t?t:-r;return e.setHours(n+r+a),e.getFullYear()+"-"+this.setLeadingZeroToInt(e.getMonth()+1,2)+"-"+this.setLeadingZeroToInt(e.getDate(),2)+" "+this.setLeadingZeroToInt(e.getHours(),2)+":"+this.setLeadingZeroToInt(e.getMinutes(),2)+":"+this.setLeadingZeroToInt(e.getSeconds(),2)},setLeadingZeroToInt:function(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r},randomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}}},{}],6:[function(e,t,r){"use strict";var n=e("./data"),a=e("./terms"),i=e("./helpers/cookies"),s=e("./helpers/uri"),o=e("./helpers/utils"),c=e("./params"),u=e("./migrations");t.exports=function(e){var t,r,p,f,m,d,l,g,h,y,_,v,b,x=c.fetch(e),k=s.getParam(),w=x.domain.host,q=x.domain.isolate,I=x.lifetime;function j(e){switch(e){case a.traffic.utm:t=a.traffic.utm,r="undefined"!=typeof k.utm_source?k.utm_source:"undefined"!=typeof k.gclid?"google":"undefined"!=typeof k.yclid?"yandex":a.none,p="undefined"!=typeof k.utm_medium?k.utm_medium:"undefined"!=typeof k.gclid?"cpc":"undefined"!=typeof k.yclid?"cpc":a.none,f="undefined"!=typeof k.utm_campaign?k.utm_campaign:"undefined"!=typeof k[x.campaign_param]?k[x.campaign_param]:"undefined"!=typeof k.gclid?"google_cpc":"undefined"!=typeof k.yclid?"yandex_cpc":a.none,m="undefined"!=typeof k.utm_content?k.utm_content:"undefined"!=typeof k[x.content_param]?k[x.content_param]:a.none,l=k.utm_id||a.none,g=k.utm_source_platform||a.none,h=k.utm_creative_format||a.none,y=k.utm_marketing_tactic||a.none,d="undefined"!=typeof k.utm_term?k.utm_term:"undefined"!=typeof k[x.term_param]?k[x.term_param]:function(){var e=document.referrer;if(k.utm_term)return k.utm_term;if(!(e&&s.parse(e).host&&s.parse(e).host.match(/^(?:.*\.)?yandex\..{2,9}$/i)))return!1;try{return s.getParam(s.parse(document.referrer).query).text}catch(t){return!1}}()||a.none;break;case a.traffic.organic:t=a.traffic.organic,r=r||s.getHost(document.referrer),p=a.referer.organic,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.referral:t=a.traffic.referral,r=r||s.getHost(document.referrer),p=p||a.referer.referral,f=a.none,m=s.parse(document.referrer).path,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.typein:t=a.traffic.typein,r=x.typein_attributes.source,p=x.typein_attributes.medium,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;default:t=a.oops,r=a.oops,p=a.oops,f=a.oops,m=a.oops,d=a.oops,l=a.oops,g=a.oops,h=a.oops,y=a.oops}var i={type:t,source:r,medium:p,campaign:f,content:m,term:d,id:l,platform:g,format:h,tactic:y};return n.pack.main(i)}function R(e){var t=document.referrer;switch(e){case a.traffic.organic:return!!t&&H(t)&&function(e){var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp("yandex")+"\\..{2,9}$"),n=new RegExp(".*"+o.escapeRegexp("text")+"=.*"),a=new RegExp("^(?:www\\.)?"+o.escapeRegexp("google")+"\\..{2,9}$");if(s.parse(e).query&&s.parse(e).host.match(t)&&s.parse(e).query.match(n))return r="yandex",!0;if(s.parse(e).host.match(a))return r="google",!0;if(!s.parse(e).query)return!1;for(var i=0;i<x.organics.length;i++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.organics[i].host)+"$","i"))&&s.parse(e).query.match(new RegExp(".*"+o.escapeRegexp(x.organics[i].param)+"=.*","i")))return r=x.organics[i].display||x.organics[i].host,!0;if(i+1===x.organics.length)return!1}}(t);case a.traffic.referral:return!!t&&H(t)&&function(e){if(!(x.referrals.length>0))return r=s.getHost(e),!0;for(var t=0;t<x.referrals.length;t++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.referrals[t].host)+"$","i")))return r=x.referrals[t].display||x.referrals[t].host,p=x.referrals[t].medium||a.referer.referral,!0;if(t+1===x.referrals.length)return r=s.getHost(e),!0}}(t);default:return!1}}function H(e){if(x.domain){if(q)return s.getHost(e)!==s.getHost(w);var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp(w)+"$","i");return!s.getHost(e).match(t)}return s.getHost(e)!==s.getHost(document.location.href)}function D(){i.set(n.containers.current_extra,n.pack.extra(x.timezone_offset),I,w,q),i.get(n.containers.first_extra)||i.set(n.containers.first_extra,n.pack.extra(x.timezone_offset),I,w,q)}return i.setBase64Flag(x.base64),u.go(I,w,q),i.set(n.containers.current,function(){var e;if("undefined"!=typeof k.utm_source||"undefined"!=typeof k.utm_medium||"undefined"!=typeof k.utm_campaign||"undefined"!=typeof k.utm_content||"undefined"!=typeof k.utm_term||"undefined"!=typeof k.utm_id||"undefined"!=typeof k.utm_source_platform||"undefined"!=typeof k.utm_creative_format||"undefined"!=typeof k.utm_marketing_tactic||"undefined"!=typeof k.gclid||"undefined"!=typeof k.yclid||"undefined"!=typeof k[x.campaign_param]||"undefined"!=typeof k[x.term_param]||"undefined"!=typeof k[x.content_param])D(),e=j(a.traffic.utm);else if(R(a.traffic.organic))D(),e=j(a.traffic.organic);else if(!i.get(n.containers.session)&&R(a.traffic.referral))D(),e=j(a.traffic.referral);else{if(i.get(n.containers.first)||i.get(n.containers.current))return i.get(n.containers.current);D(),e=j(a.traffic.typein)}return e}(),I,w,q),i.get(n.containers.first)||i.set(n.containers.first,i.get(n.containers.current),I,w,q),i.get(n.containers.udata)?(_=parseInt(i.parse(n.containers.udata)[i.unsbjs(n.containers.udata)][n.aliases.udata.visits])||1,_=i.get(n.containers.session)?_:_+1,v=n.pack.user(_,x.user_ip)):(_=1,v=n.pack.user(_,x.user_ip)),i.set(n.containers.udata,v,I,w,q),i.get(n.containers.session)?(b=parseInt(i.parse(n.containers.session)[i.unsbjs(n.containers.session)][n.aliases.session.pages_seen])||1,b+=1):b=1,i.set(n.containers.session,n.pack.session(b),x.session_length,w,q),x.promocode&&!i.get(n.containers.promocode)&&i.set(n.containers.promocode,n.pack.promo(x.promocode),I,w,q),i.parse(n.containers)}},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(e,t,r){"use strict";var n=e("./data"),a=e("./helpers/cookies");t.exports={go:function(e,t,r){var i,s=this.migrations,o={l:e,d:t,i:r};if(a.get(n.containers.first)||a.get(n.service.migrations)){if(!a.get(n.service.migrations))for(i=0;i<s.length;i++)s[i].go(s[i].id,o)}else{var c=[];for(i=0;i<s.length;i++)c.push(s[i].id);var u="";for(i=0;i<c.length;i++)u+=c[i]+"=1",i<c.length-1&&(u+=n.delimiter);a.set(n.service.migrations,u,o.l,o.d,o.i)}},migrations:[{id:"1418474375998",version:"1.0.0-beta",go:function(e,t){var r=e+"=1",i=e+"=0",s=function(e,t,r){return t||r?e:n.delimiter};try{var o=[];for(var c in n.containers)n.containers.hasOwnProperty(c)&&o.push(n.containers[c]);for(var u=0;u<o.length;u++)if(a.get(o[u])){var p=a.get(o[u]).replace(/(\|)?\|(\|)?/g,s);a.destroy(o[u],t.d,t.i),a.destroy(o[u],t.d,!t.i),a.set(o[u],p,t.l,t.d,t.i)}a.get(n.containers.session)&&a.set(n.containers.session,n.pack.session(0),t.l,t.d,t.i),a.set(n.service.migrations,r,t.l,t.d,t.i)}catch(f){a.set(n.service.migrations,i,t.l,t.d,t.i)}}}]}},{"./data":2,"./helpers/cookies":3}],8:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/uri");t.exports={fetch:function(e){var t=e||{},r={};if(r.lifetime=this.validate.checkFloat(t.lifetime)||6,r.lifetime=parseInt(30*r.lifetime*24*60),r.session_length=this.validate.checkInt(t.session_length)||30,r.timezone_offset=this.validate.checkInt(t.timezone_offset),r.base64=t.base64||!1,r.campaign_param=t.campaign_param||!1,r.term_param=t.term_param||!1,r.content_param=t.content_param||!1,r.user_ip=t.user_ip||n.none,t.promocode?(r.promocode={},r.promocode.min=parseInt(t.promocode.min)||1e5,r.promocode.max=parseInt(t.promocode.max)||999999):r.promocode=!1,t.typein_attributes&&t.typein_attributes.source&&t.typein_attributes.medium?(r.typein_attributes={},r.typein_attributes.source=t.typein_attributes.source,r.typein_attributes.medium=t.typein_attributes.medium):r.typein_attributes={source:"(direct)",medium:"(none)"},t.domain&&this.validate.isString(t.domain)?r.domain={host:t.domain,isolate:!1}:t.domain&&t.domain.host?r.domain=t.domain:r.domain={host:a.getHost(document.location.hostname),isolate:!1},r.referrals=[],t.referrals&&t.referrals.length>0)for(var i=0;i<t.referrals.length;i++)t.referrals[i].host&&r.referrals.push(t.referrals[i]);if(r.organics=[],t.organics&&t.organics.length>0)for(var s=0;s<t.organics.length;s++)t.organics[s].host&&t.organics[s].param&&r.organics.push(t.organics[s]);return r.organics.push({host:"bing.com",param:"q",display:"bing"}),r.organics.push({host:"yahoo.com",param:"p",display:"yahoo"}),r.organics.push({host:"about.com",param:"q",display:"about"}),r.organics.push({host:"aol.com",param:"q",display:"aol"}),r.organics.push({host:"ask.com",param:"q",display:"ask"}),r.organics.push({host:"globososo.com",param:"q",display:"globo"}),r.organics.push({host:"go.mail.ru",param:"q",display:"go.mail.ru"}),r.organics.push({host:"rambler.ru",param:"query",display:"rambler"}),r.organics.push({host:"tut.by",param:"query",display:"tut.by"}),r.referrals.push({host:"t.co",display:"twitter.com"}),r.referrals.push({host:"plus.url.google.com",display:"plus.google.com"}),r},validate:{checkFloat:function(e){return!(!e||!this.isNumeric(parseFloat(e)))&&parseFloat(e)},checkInt:function(e){return!(!e||!this.isNumeric(parseInt(e)))&&parseInt(e)},isNumeric:function(e){return!isNaN(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)}}}},{"./helpers/uri":4,"./terms":9}],9:[function(e,t,r){"use strict";t.exports={traffic:{utm:"utm",organic:"organic",referral:"referral",typein:"typein"},referer:{referral:"referral",organic:"organic",social:"social"},none:"(none)",oops:"(Houston, we have a problem)"}},{}]},{},[1])(1)});
!function(t){"use strict";const e=t.params,n=(document.querySelector.bind(document),(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t)),i=()=>null,s=t=>null===t||t===undefined?"":t,o="wc/store/checkout";function a(t){document.querySelectorAll("wc-order-attribution-inputs").forEach((t,e)=>{e>0&&t.remove()});for(const e of document.querySelectorAll("wc-order-attribution-inputs"))e.values=t}function r(t){window.wp&&window.wp.data&&window.wp.data.dispatch&&window.wc&&window.wc.wcBlocksData&&window.wp.data.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY).setExtensionData("woocommerce/order-attribution",t,!0)}function c(){return"undefined"!=typeof sbjs}function d(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const e=window.wp.data.subscribe(function(){e(),r(t.getAttributionData())},o)}}t.getAttributionData=function(){const s=e.allowTracking&&c()?n:i,o=c()?sbjs.get:{},a=Object.entries(t.fields).map(([t,e])=>[t,s(o,e)]);return Object.fromEntries(a)},t.setOrderTracking=function(n){if(e.allowTracking=n,n){if(!c())return;sbjs.init({lifetime:Number(e.lifetime),session_length:Number(e.session),base64:Boolean(e.base64),timezone_offset:"0"})}else!function(){const t=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(e=>{document.cookie=`${e}=; path=/; max-age=-999; domain=.${t};`})}();const i=t.getAttributionData();a(i),r(i)},t.setOrderTracking(e.allowTracking),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",d):d(),window.customElements.define("wc-order-attribution-inputs",class extends HTMLElement{constructor(){if(super(),this._fieldNames=Object.keys(t.fields),this.hasOwnProperty("_values")){let t=this.values;delete this.values,this.values=t||{}}}connectedCallback(){this.innerHTML="";const t=new DocumentFragment;for(const n of this._fieldNames){const i=document.createElement("input");i.type="hidden",i.name=`${e.prefix}${n}`,i.value=s(this.values&&this.values[n]||""),t.appendChild(i)}this.appendChild(t)}set values(t){if(this._values=t,this.isConnected)for(const t of this._fieldNames){const n=this.querySelector(`input[name="${e.prefix}${t}"]`);n?n.value=s(this.values[t]):console.warn(`Field "${t}" not found. `+"Most likely, the '<wc-order-attribution-inputs>' element was manipulated.")}}get values(){return this._values}})}(window.wc_order_attribution);
!(function(e){var n=!1;if(("function"==typeof define&&define.amd&&(define(e),(n=!0)),"object"==typeof exports&&((module.exports=e()),(n=!0)),!n)){var o=window.Cookies,t=(window.Cookies=e());t.noConflict=function(){return(window.Cookies=o),t}}})(function(){function e(){for(var e=0,n={};e<arguments.length;e++){var o=arguments[e];for(var t in o)n[t]=o[t]}
return n}
return(function n(o){function t(n,r,i){var c;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(i=e({path:"/"},t.defaults,i)).expires){var a=new Date();a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),(i.expires=a)}
i.expires=i.expires?i.expires.toUTCString():"";try{(c=JSON.stringify(r)),/^[\{\[]/.test(c)&&(r=c)}catch(e){}(r=o.write?o.write(r,n):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)),(n=(n=(n=encodeURIComponent(String(n))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape));var s="";for(var f in i)i[f]&&((s+="; "+f),!0!==i[f]&&(s+="="+i[f]));return(document.cookie=n+"="+r+s)}
n||(c={});for(var p=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,u=0;u<p.length;u++){var l=p[u].split("="),C=l.slice(1).join("=");this.json||'"'!==C.charAt(0)||(C=C.slice(1,-1));try{var g=l[0].replace(d,decodeURIComponent);if(((C=o.read?o.read(C,g):o(C,g)||C.replace(d,decodeURIComponent)),this.json))
try{C=JSON.parse(C)}catch(e){}
if(n===g){c=C;break}
n||(c[g]=C)}catch(e){}}
return c}}
return((t.set=t),(t.get=function(e){return t.call(t,e)}),(t.getJSON=function(){return t.apply({json:!0},[].slice.call(arguments))}),(t.defaults={}),(t.remove=function(n,o){t(n,"",e(o,{expires:-1}))}),(t.withConverter=n),t)})(function(){})});
document.addEventListener('DOMContentLoaded',function(){if(Cookies.get('seopress-user-consent-close')==undefined&&Cookies.get('seopress-user-consent-accept')==undefined){document.querySelectorAll('.seopress-user-consent.seopress-user-message, .seopress-user-consent-backdrop').forEach(function(element){element.classList.remove('seopress-user-consent-hide')})}
const seopressUserConsentAcceptBtn=document.getElementById('seopress-user-consent-accept');if(seopressUserConsentAcceptBtn)seopressUserConsentAcceptBtn.addEventListener('click',function(){document.querySelectorAll('.seopress-user-consent.seopress-user-message, .seopress-user-consent-backdrop').forEach(function(element){element.classList.add('seopress-user-consent-hide')});Cookies.remove('seopress-user-consent-close');Cookies.set('seopress-user-consent-accept','1',{expires:Number(seopressAjaxGAUserConsent.seopress_cookies_expiration_days)});fetch(seopressAjaxGAUserConsent.seopress_cookies_user_consent,{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded',},body:new URLSearchParams({action:'seopress_cookies_user_consent',consent:'update',_ajax_nonce:seopressAjaxGAUserConsent.seopress_nonce,})}).then(response=>response.json()).then(data=>{if(data.data){const executeScript=(scriptContent,targetElement)=>{if(!scriptContent)return;const tempDiv=document.createElement('div');tempDiv.innerHTML=scriptContent;const scripts=tempDiv.querySelectorAll('script');scripts.forEach(oldScript=>{const newScript=document.createElement('script');Array.from(oldScript.attributes).forEach(attr=>newScript.setAttribute(attr.name,attr.value));newScript.textContent=oldScript.textContent;targetElement.appendChild(newScript)});const nonScriptNodes=Array.from(tempDiv.childNodes).filter(node=>node.nodeName!=='SCRIPT');nonScriptNodes.forEach(node=>targetElement.appendChild(node.cloneNode(!0)))};const head=document.head;const body=document.body;if(data.data.gtag_js)executeScript(data.data.gtag_js,head);if(data.data.matomo_js)executeScript(data.data.matomo_js,head);if(data.data.clarity_js)executeScript(data.data.clarity_js,head);if(data.data.custom)executeScript(data.data.custom,head);if(data.data.head_js)executeScript(data.data.head_js,head);if(data.data.body_js)executeScript(data.data.body_js,body);if(data.data.matomo_body_js)executeScript(data.data.matomo_body_js,body);if(data.data.footer_js)executeScript(data.data.footer_js,body);}}).catch(error=>{console.error('Error:',error)})});const seopressUserConsentCloseBtn=document.getElementById('seopress-user-consent-close');if(seopressUserConsentCloseBtn)seopressUserConsentCloseBtn.addEventListener('click',function(){document.querySelectorAll('.seopress-user-consent.seopress-user-message, .seopress-user-consent-backdrop').forEach(function(element){element.classList.add('seopress-user-consent-hide')});Cookies.remove('seopress-user-consent-accept');Cookies.set('seopress-user-consent-close','1',{expires:Number(seopressAjaxGAUserConsent.seopress_cookies_expiration_days)});fetch(seopressAjaxGAUserConsent.seopress_cookies_user_consent,{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded',},body:new URLSearchParams({action:'seopress_cookies_user_consent_close',consent:'update',_ajax_nonce:seopressAjaxGAUserConsent.seopress_nonce,})}).then(response=>response.json()).then(data=>{if(data.data){const executeScript=(scriptContent,targetElement)=>{if(!scriptContent)return;const tempDiv=document.createElement('div');tempDiv.innerHTML=scriptContent;const scripts=tempDiv.querySelectorAll('script');scripts.forEach(oldScript=>{const newScript=document.createElement('script');Array.from(oldScript.attributes).forEach(attr=>newScript.setAttribute(attr.name,attr.value));newScript.textContent=oldScript.textContent;targetElement.appendChild(newScript)});const nonScriptNodes=Array.from(tempDiv.childNodes).filter(node=>node.nodeName!=='SCRIPT');nonScriptNodes.forEach(node=>targetElement.appendChild(node.cloneNode(!0)))};const head=document.head;if(data.data.gtag_consent_js)executeScript(data.data.gtag_consent_js,head);if(data.data.clarity_consent_js)executeScript(data.data.clarity_consent_js,head);}}).catch(error=>{console.error('Error:',error)})});const seopressUserConsentEditBtn=document.getElementById('seopress-user-consent-edit');if(seopressUserConsentEditBtn)seopressUserConsentEditBtn.addEventListener('click',function(){document.querySelectorAll('.seopress-user-consent.seopress-user-message, .seopress-user-consent-backdrop').forEach(function(element){element.classList.remove('seopress-user-consent-hide')})})});
jQuery(document).ready(function ($){
var variable_id=jQuery('[name="product_id"]').val();
var available_ids=[];
var variable_bulk_table="";
function get_table(product_id, updateBulkTable=false){
if(typeof jQuery('.wdp_bulk_table_content').attr('data-available-ids')!=='undefined'){
available_ids=JSON.parse(jQuery('.wdp_bulk_table_content').attr('data-available-ids'));
}
if(available_ids.indexOf(parseInt(product_id))===-1){
return;
}
if(product_id===variable_id&&variable_bulk_table&&!updateBulkTable){
jQuery('.wdp_bulk_table_content').html(variable_bulk_table)
return true;
}
let attributes={};
jQuery('form.variations_form[data-product_id=' + variable_id + '] select').each(function (index, item){
if(jQuery(item).attr("data-attribute_name")){
attributes[jQuery(item).attr("data-attribute_name")]=jQuery(this).val();
}});
var data={
action: 'get_table_with_product_bulk_table',
product_id: parseInt(product_id),
attributes: attributes,
...jQuery('form.cart').triggerHandler('wdp_get_custom_data')
};
return jQuery.ajax({
url: script_data.ajaxurl,
data: data,
dataType: 'json',
type: 'POST',
success: function (response){
if(response.success){
jQuery('.wdp_bulk_table_content').each(function (_, item){
let jQItem=jQuery(item);
let availableIds=JSON.parse(jQItem.attr('data-available-ids'));
if(availableIds.indexOf(parseInt(product_id))===-1){
return;
}
jQItem.html(jQuery(response.data).children()).trigger('update');
});
init_custom_event();
if(product_id===variable_id){
variable_bulk_table=response.data;
}}else{
get_table(variable_id);
}},
error: function (response){
get_table(variable_id);
}});
}
function init_custom_event(){
jQuery('.wdp_bulk_table_content').on('get_table', function (e, $obj_id){
if(typeof $obj_id==='undefined'||!$obj_id){
get_table(variable_id);
}else{
get_table($obj_id);
}});
}
function init_events(){
if(jQuery('.wdp_bulk_table_content').length > 0){
jQuery('.variations_form').on('found_variation', { variationForm: this },
function (event, variation){
if(typeof variation==='undefined'){
get_table(variable_id);
return true;
}
get_table(variation.variation_id);
return true;
})
.on('click', '.reset_variations',
{ variationForm: this },
function (event, variation){
get_table(variable_id);
return true;
})
.on('reset_data',
function (event){
get_table(variable_id);
return true;
});
jQuery('form.cart').on('adp_found_variation', function (e, { product_id, variation_id}){
get_table(variation_id||product_id, true);
return true;
});
init_custom_event();
}}
if(script_data.js_init_trigger){
$(document).on(script_data.js_init_trigger, function (){
init_events();
});
}
jQuery('form.cart').on('adp_variations_form', function(){
init_events();
});
setTimeout(function (){
jQuery('.variations_form').on("wc_variation_form", function (){
init_events();
})
}, 0);
function watchForQuickView(){
let observer=new MutationObserver(function (mutations){
mutations.forEach(function (mutation){
mutation.addedNodes.forEach(function (node){
if($(node).hasClass('product-lightbox-inner')||$(node).find('.product-lightbox-inner').length){
init_events();
}});
});
});
observer.observe(document.body, { childList: true, subtree: true });
}
watchForQuickView();
});