(()=>{var t={457:(t,e,o)=>{"use strict";o.d(e,{Z:()=>i});o(422);const i=new class{constructor(){return this.component=this.component.bind(this),this.component}component(t,e,...o){if("function"==typeof t)return t({...e,children:o});o&&(o=o.filter((t=>null!==t))),e&&(e.class&&(e.className=e.class),delete e.children);let i="fragment"!==t?function(t,e){e=e||{};let o=document.createElement(t);try{o=Object.assign(o,e)}catch{const t=Object.keys(e);for(let i=0;it.match(/^data-/)))&&(alert("Do not use data-* in your JSX component! Use dataSet instead!! - Check the console.trace for more info"),window.__aleartedJSXData=!0),e?.ref&&("function"==typeof e.ref?e.ref(i):e.ref=i),e?.on&&Object.entries(e.on).forEach((([t,e])=>{i.addEventListener(t,e)})),e?.style&&Object.entries(e.style).forEach((([t,e])=>{i.style.setProperty(t,e)})),i}}},356:()=>{__loadjs=function(){var t=function(){},e={},o={},i={};function n(t,e){if(t){var n=i[t];if(o[t]=e,n)for(;n.length;)n[0](t,e),n.splice(0,1)}}function r(e,o){e.call&&(e={success:e}),o.length?(e.error||t)(o):(e.success||t)(e)}function s(e,o,i,n){var r,c,a=document,d=i.async,u=(i.numRetries||0)+1,l=i.before||t,p=e.replace(/[\?|#].*$/,""),f=e.replace(/^(css|img)!/,"");n=n||0,/(^css!|\.css$)/.test(p)?((c=a.createElement("link")).rel="stylesheet",c.href=f,(r="hideFocus"in c)&&c.relList&&(r=0,c.rel="preload",c.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(p)?(c=a.createElement("img")).src=f:((c=a.createElement("script")).src=e,c.async=void 0===d||d),!(c.onload=c.onerror=c.onbeforeload=function(t){var a=t.type[0];if(r)try{c.sheet.cssText.length||(a="e")}catch(t){18!=t.code&&(a="e")}if("e"==a){if((n+=1){!function(){function t(){var t=Array.prototype.slice.call(arguments),e=document.createDocumentFragment();t.forEach((function(t){var o=t instanceof Node;e.appendChild(o?t:document.createTextNode(String(t)))})),this.appendChild(e)}[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(e){e.hasOwnProperty("append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value:t})}))}()}},e={};function o(i){var n=e[i];if(void 0!==n)return n.exports;var r=e[i]={exports:{}};return t[i](r,r.exports,o),r.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t;o.g.importScripts&&(t=o.g.location+"");var e=o.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var i=e.getElementsByTagName("script");i.length&&(t=i[i.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t})(),(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e){var o=function(e,o){if("object"!=t(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,o||"default");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(e)}(e,"string");return"symbol"==t(o)?o:o+""}function i(t,o,i){return(o=e(o))in t?Object.defineProperty(t,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[o]=i,t}var n=o(457).Z;function r(t={},e=document){return Object.entries(t).reduce(((t,[o,i])=>{const n="string"==typeof i,r=n?"querySelector":"querySelectorAll",s=n?i:i[0];return t[o]=e?.[r]?.(s),!n&&t[o]&&(t[o]=[...t[o]]),t}),{})}window.__requiredFieldsSelectors="";function s(t,e,o,i){var n=new Date;n.setTime(n.getTime()+24*o*60*60*1e3);let r=t+"="+e+";"+("expires="+n.toUTCString())+";path=/";i&&(r+=`;SameSite=${i}`),document.cookie=r}const c=(t,e)=>{e?sessionStorage.setItem(t,"string"!=typeof e?JSON.stringify(e):e):sessionStorage.removeItem(t)};const a=t=>{const e=sessionStorage.getItem(t);return e?function(t){try{JSON.parse(t)}catch(t){return!1}return!0}(e)?JSON.parse(e):e:null},d={CartGoal:{Model:"CartGoal"},PreOrder:{Model:"PreOrder"},InCart:{Model:"InCart",discountProductsField:"recommended_products"},PrePurchase:{Model:"PrePurchase",discountProductsField:"recommended_products"},QuantityDiscount:{Model:"QuantityDiscount",discountProductsField:"target_products"},Bundle:{Model:"Bundle",discountProductsField:"products"}};function u(t,e){if(t===e)return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;let o=Object.keys(t),i=Object.keys(e);if(o.length!==i.length)return!1;for(let n of o){if(!i.includes(n))return!1;if("object"==typeof t[n]&&null!==t[n]&&"object"==typeof e[n]&&null!==e[n]){if(!u(t[n],e[n]))return!1}else if(t[n]!==e[n])return!1}return!0}function l(t){if("object"!=typeof t||null===t)return t;let e=Array.isArray(t)?[]:{};for(let o in t)"object"==typeof t[o]&&null!=t[o]?e[o]=l(t[o]):e[o]=t[o];return e}o.p;const p=async(t,e,o=()=>!0)=>{let i=(window.FoxKitPlugins||{})[t];const n=sessionStorage.getItem(`FoxKit:pluginData:${t}`);if(n)try{i=JSON.parse(n)}catch(t){i=null}if(!i){const e=window.Shopify.shop;try{const o=await fetch(`${window.FoxKitV2.appURL}/api/public/plugins?shop=${e}&plugins[0]=${t}`),n=await o.json();n.payload&&(i=n.payload?.[t],i=i.map((t=>({...t,locales:!window.FoxKitSettings.primaryLocale&&t?.locales?.[window.Shopify.locale]}))),window.FoxKitPlugins[t]=i,sessionStorage.setItem(`FoxKit:pluginData:${t}`,JSON.stringify(i)))}catch(t){}}if(!Array.isArray(i))return i;const r=i.filter((t=>{let i=!0;for(const[o,n]of Object.entries(e))t[o]!==n&&(i=!1);const n=o(t);return i&&n})),s=new Date(Math.max.apply(null,r.map((t=>new Date(t.createdAt)))));return r.find((t=>new Date(t.createdAt).getTime()==s.getTime()))},f={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"₿",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"¥",CNY:"¥",COP:"$",COU:"COU",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"₸",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"S$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",STN:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"лв",VEF:"Bs",VES:"Bs.S",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",XSU:"Sucre",XUA:"XUA",YER:"﷼",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"};const h=function(t){if("string"!=typeof t)return;const e=t.toUpperCase();return Object.prototype.hasOwnProperty.call(f,e)?f[e]:void 0},m=(t,e)=>t.concat().sort(((t,o)=>t[e]>o[e]?1:t[e]t.includes("price"))).forEach((e=>{const{[e]:r}=t;if(r&&"number"==typeof r){let t=r-(e.includes("line")?i:o);t<0&&(t=0),n[e]=t}})),t._foxItemPrices=n}else delete t._foxItemPrices}}async function g(t){const{items:e,currency:o,attributes:i={}}=t;let{_foxCartDiscounts:n=[]}=i;const r=[];let s=!0;const c={...window.Shopify.currency,published:window.Shopify?.currency?.active},{rate:a}=c;"string"==typeof n&&(n=JSON.parse(n),i._foxCartDiscounts=n);const u=n.filter((t=>"QuantityDiscount"===t.plugin));for(const t of u){const{product_id:o,offer_id:i}=t,n=e.filter((({product_id:t,cached:e})=>t===o&&!e)),r=n.reduce(((t,{quantity:e})=>t+e),0);if(r){const t=await p("QuantityDiscount",{_id:i,active:!0,deleted:!1});if(t){const{discounts:e,title:o}=t;if(e?.length){const t=m(e.filter((({min_qty:t})=>r>=t)),"min_qty").pop();t&&n.forEach((e=>{e.properties=e.properties||{},e.properties._foxQtyDiscount={...t,offer_id:i,title:o,plugin:"QTY_DISCOUNT"}}))}}}}return e.map((async t=>{if(t?.cached)return t;const{variant_id:i,quantity:n,key:c,discounts:u=[]}=t;let l,f,m,{properties:g={}}=t;g||(g={});const _=u?.filter((t=>!t?.title?.startsWith(`${window.FoxKitSettings.discountPrefix}-`)&&t?.amount))?.length,S=window.FoxKitSettings?.combineWithProductDiscounts;if(!_||S)for(const[t,e]of Object.entries(g))if("_foxQtyDiscount"===t)f=e;else if(t===window.FoxKitV2.FOXKIT_LINE_OFFER_KEY){const[t,o]=(e||"").split(":");t&&(m={plugin:t,offer_id:o})}if(l={...f,...w(f,t,a)},m){"string"==typeof m&&(m=JSON.parse(m),g._foxDiscount=m);const{offer_id:o,plugin:i}=m,{Model:n}=d[i]||{};let r=!0;if("Bundle"===i){const t=e.filter((t=>t?.properties?.["_FoxKit offer"]===`Bundle:${o}`));1===t.length&&(r=!1)}if(n&&r){const e=await p(n,{id:o})||await p(n,{_id:o})||{},{active:r,discount:s,active_discount:c,title:d}=e;if(r&&c){const{discounted_amount:e,line_discounted_amount:n}=w(s,t,a);e>l.discounted_amount&&(l={...s,plugin:i,offer_id:o,title:d,discounted_amount:e,line_discounted_amount:n})}}}const b=[];g&&Object.entries(g).forEach((([t,e])=>{t.startsWith("_")||b.push({key:t,value:e})}));const x=function(t,e){if(!t||!t.plugin)return null;const{type:o,value:i,plugin:n,title:r}=t,s=h(e)||e||"",c="PERCENTAGE"===o?"%":s;return{valueType:o,value:i,title:`${n.toUpperCase()}_${i}${c}_OFF`,description:`[FoxKit App] ${r||`${n} ${i}${c} Off`}`}}(l,o);r.push({key:c,quantity:n,appliedDiscount:x,customAttributes:b,variantId:`gid://shopify/ProductVariant/${i}`}),void 0!==x?.value&&(s=!1),y(t,l)})),t.__isNormalCart=s,{cart:t,draftOrderLineItems:r}}const _=["original_total_price","total_price","items_subtotal_price"],S=["quantity","variant_id","price","original_price","discounted_price","line_price","original_line_price","total_discount","discounts","product_id","final_price","final_line_price","properties"],b=async t=>{let e,o;if("draft_order"===window.FoxKitSettings.discountApplyBy){const{cart:i,draftOrderLineItems:n}=await g(t);e=i,o=n}else{const o=await async function(t){const{items:e,attributes:o={}}=t;let{_foxCartDiscounts:i=[]}=o;const n={...window.Shopify.currency,published:window.Shopify?.currency?.active},{rate:r}=n;"string"==typeof i&&(i=JSON.parse(i),o._foxCartDiscounts=i);const s=i.filter((t=>"QuantityDiscount"===t.plugin));for(const t of s){const{product_id:o,offer_id:i,shortId:n}=t,r=e.filter((({product_id:t,cached:e})=>t===o&&!e)),s=r.reduce(((t,{quantity:e})=>t+e),0);if(s){const t=await p("QuantityDiscount",{_id:i,active:!0,deleted:!1});if(t){const{discounts:e,title:o}=t;if(e?.length){const t=e.filter((({min_qty:t})=>s>=t)).pop();t&&r.forEach((e=>{e.properties=e.properties||{},e.properties._foxQtyDiscount={...t,offer_id:i,shortId:n,title:o,plugin:"QTY_DISCOUNT"}}))}}}}return e.map((async t=>{if(t?.cached)return t;let o,i,n,{properties:s={},discounts:c=[]}=t;s||(s={});const a=c?.filter((t=>!t?.title?.startsWith(`${window.FoxKitSettings.discountPrefix}-`)&&t?.amount))?.length,u=window.FoxKitSettings?.combineWithProductDiscounts;if(!a||u)for(const[t,e]of Object.entries(s))if("_foxQtyDiscount"===t)i=e;else if(t===window.FoxKitV2.FOXKIT_LINE_OFFER_KEY){const[t,o]=(e||"").split(":");t&&(n={plugin:t,offer_id:o})}if(o={...i,...w(i,t,r)},n){"string"==typeof n&&(n=JSON.parse(n),s._foxDiscount=n);const{offer_id:i,plugin:c,shortId:a}=n,{Model:u}=d[c]||{};let l=!0;if("Bundle"===c){const t=e.filter((t=>t?.properties?.["_FoxKit offer"]===`Bundle:${i}`));1===t.length&&(l=!1)}if(u&&l){const e=await p(u,{id:i})||await p(u,{_id:i})||{},{active:n,discount:s,active_discount:d,title:l}=e;if(n&&d){const{discounted_amount:e,line_discounted_amount:n}=w(s,t,r);e>o.discounted_amount&&(o={...s,offer_id:i,shortId:a,plugin:c,title:l,discounted_amount:e,line_discounted_amount:n})}}}y(t,o)})),{cart:t}}(t);e=o.cart}const{items:i}=e;let n=0,r=0;if(i.forEach((t=>{const{_foxItemPrices:e,discounts:o=[]}=t;if(e){const{discountToApply:{line_discounted_amount:t=0}={}}=e;n+=t}r+=o?.filter((t=>t?.title?.startsWith(`${window.FoxKitSettings.discountPrefix}-`)))?.reduce(((t,e)=>t+=e?.amount||0),0)})),n&&"shopify_functions"!==window.FoxKitV2?.configs?.discountApplyBy){const t={total_discounted_amount:n};_.forEach((o=>{let i=e[o]-n;i<0&&(i=0),t[o]=i+r})),e._foxCartPrices=t}return{cart:e,draftOrderLineItems:o}},x=async t=>{const{getSessionStorage:e,_isEqual:o,_pick:i}=window.FoxKitV2.Utils,{getPluginData:n}=window.FoxKitV2.Helpers;if(!t||!t?.items?.length)return{cart:t};const r=l(t);delete r.sections;const s=e("_foxCartItems")||[],c=t.items;if(!c?.length)return{cart:t};const a=window.FoxKitV2.cart?.attributes?._foxCartDiscounts??[];let d=[],u=[];for(const t of c)u.push((async()=>{const e=s?.find((({key:e})=>e===t?.key)),r=!!e&&o(i(e,S),i(t,S));let c;if(r)c={...e,cache:r};else{const e=t.product_id,o=await window.FoxKitV2.Utils.getCollectionIdsByProductHandle(t?.handle),i=await n({plg:"quantityDiscount",productId:e,collectionIds:o}),s=a.findIndex((t=>t.product_id===e));if(i){const t={offer_id:i._id,shortId:i.id,plugin:"QuantityDiscount",product_id:e,smallestMinQty:(l(i?.discounts)||[]).sort(((t,e)=>t.min_qty-e.min_qty))?.[0]?.min_qty};-1!==s?a[s]=t:a.push(t)}else-1!==s&&a.splice(s,1);c={...t,cache:r}}d.push(c)})());await Promise.all(u),r.items=d,a?.length&&(r.attributes._foxCartDiscounts=a),r._foxCurrency={...window.Shopify.currency,published:window.Shopify?.currency?.active};const{cart:p,draftOrderLineItems:f}=await b(r),h=p;return h.items=h.items.sort(((e,o)=>t.items.findIndex((t=>t?.key===e?.key))-t.items.findIndex((t=>t?.key===o?.key)))),{cart:h,draftOrderLineItems:f}};class C{constructor(){this.events={}}get evts(){return Object.keys(this.events)}subscribe(t,e){return this.events[t]=this.events[t]||[],this.events[t].push(e),()=>this.unSubscribe(t,e)}unSubscribe(t,e){const o=this.events[t];if(o&&Array.isArray(o))for(let t=0;t{t(...e)}))}}var F=o(457).Z;const v={mode:"same-origin",credentials:"same-origin",headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/json"}};function K(){return JSON.parse(JSON.stringify(v))}const P=(t,e=K())=>fetch(t,e).then((function(t){if(!t.ok)throw t;return t.json()})),D=new Map,E=(t,e=K())=>new Promise(((o,i)=>{let n=D.get(t);if(n)return o(n);fetch(t,e).then((e=>{n=e.text(),D.set(t,n),o(n)})).catch(i)})),O=new Map,A=new Map,I=(t,e=v)=>new Promise(((o,i)=>{if(A.get(t))return o(A.get(t));fetch(t,e).then((e=>{if(e.ok){const i=e.json();return o(i),A.set(t,i),i}i(e)})).catch(i)})),$=async({ids:t=[],handles:e=[]})=>{async function o(t){const e=[],o=[];for(const e of t)o.push(I(`${window.FoxKitSettings.baseUrl}products/${e}.js`));const i=await Promise.allSettled(o);for(const t of i)"fulfilled"===t.status&&t?.value&&e.push(t.value);return e}let i=[];if(window.FoxKitSettings?.multipleLanguages){const n=t?.map((t=>`id:${t}`))?.join("%20OR%20");try{i=await I(`${window.FoxKitSettings.baseUrl}search?q=${n}&view=foxkit`)}catch(t){i=await o(e)}}else i=await o(e);return i},k=async t=>await I(`${window.FoxKitSettings.baseUrl}products/${t}.js`);function T(t,e){"string"==typeof t&&(t=t.replace(".",""));let o="";const i=/\{\{\s*(\w+)\s*\}\}/,n=e||"${{amount}}";function r(t,e=2,o=",",i="."){if(isNaN(t)||null==t)return 0;const n=(t=(t/100).toFixed(e)).split(".");return n[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1${o}`)+(n[1]?i+n[1]:"")}switch(n.match(i)[1]){case"amount":o=r(t,2);break;case"amount_no_decimals":o=r(t,0);break;case"amount_with_comma_separator":o=r(t,2,".",",");break;case"amount_no_decimals_with_comma_separator":o=r(t,0,".",",")}return n.replace(i,o)}const N={newest:"created-descending",oldest:"created-ascending",default:"manual",best_selling:"best-selling",randomly:"manual"},L=async(t,e="")=>{try{const o=N?.[e]||"";return await window.FoxKitV2.Helpers.fetchHTML(`${window.FoxKitSettings.baseUrl}collections/${t}?section_id=foxkit-json&sort_by=${o}`,"[data-collection-json]")||[]}catch(t){return[]}};const M=async function(t,e,o){const i=`gid://shopify/Product/${e}`;o?.length&&(o=o.map((t=>`gid://shopify/Collection/${t}`)));const n={shop:window.Shopify.shop,active:!0};let r=null;if("Bundle"===t?(r=await p(t,n,(t=>t.show_target_only&&t.target_product===i)),r||(r=await p(t,n,(t=>!t.show_target_only&&[i].every((e=>t.products?.includes(e))))))):"PreOrder"===t?(r=await p(t,n,(t=>!t.applies_to&&t.target_product===i)),r||(r=await p(t,n,(t=>"specific_products"===t.applies_to&&[i].every((e=>t.target_products?.includes(e)))||t.target_product===i)))):r=await p(t,n,(t=>"specific_products"===t.applies_to&&[i].every((e=>t.target_products?.includes(e)))||t.target_product===i)),r||o?.length&&(r=await p(t,n,(t=>"specific_collection"===t.applies_to&&o.includes(t.target_collection)))),r||(r=await p(t,n,(t=>"all_products"===t.applies_to))),r){r.product_id=Number(e);const{productHandles:o=[],recommend_to:n,recommend_intent:s,products:c=[],recommended_collection:a,recommended_products:d}=r;if(n){let c=[];if("specific_products"===n&&(c=await $({ids:d.map((t=>t?.replace("gid://shopify/Product/",""))),handles:o})),"specific_collection"===n){const t=a?.handle,e=r.collection_sort_key,o=await L(t,e);c=o.filter((t=>t.available)),r.productHandles=o?.map((t=>t?.handle))??[]}if("app_recommend"===n){const t=await(async(t,e)=>{try{const o=await window.FoxKitV2.Helpers.fetchJSON(`${window.FoxKitSettings.baseUrl}recommendations/products.json?product_id=${t}&intent=${e}`);return o?.products||[]}catch(t){return[]}})(e,s);c=t,r.productHandles=t?.map((t=>t?.handle))??[]}Array.isArray(c)&&c?.length&&(c=c.filter(Boolean).filter((t=>t?.id!=i)),"InCart"===t&&(c=c.slice(0,3)),"ProductRecommendation"===t&&"randomly"===r.collection_sort_key&&(c=function(t){let e,o,i=t.length;for(;0!==i;)o=Math.floor(Math.random()*i),i-=1,e=t[i],t[i]=t[o],t[o]=e;return t}(c)),r.products=c??[])}if("Bundle"===t&&c&&Array.isArray(c)){let t=await $({ids:c.map((t=>t?.replace("gid://shopify/Product/",""))),handles:o});Array.isArray(t)&&(t=t.filter(Boolean).filter((({value:t})=>t!==i)),r.products=t)}}return r},j={global:{cartGoal:"CartGoal",stockCountdown:"StockCountdown",cartCountdown:"CartCountdown",salesNotification:"SaleNotification",luckyWheel:"LuckyWheel",popup:"PopUp",messenger:"Messenger",bis:"BIS"},product:{countdown:"Countdown",preOrder:"PreOrder",prePurchase:"PrePurchase",quantityDiscount:"QuantityDiscount",sizeChart:"SizeChart",bundle:"Bundle",productRecommendations:"ProductRecommendation",inCart:"InCart"}};async function R(t={}){const{plg:e,productId:o,collectionIds:i}=t;let n={};if(o){if(e){const t=j.product[e],n=await M(t,o,i);return n&&n.active?n:null}{let t=[];for(const[n,r]of Object.entries(j.product)){if(e&&e!==n)return;t.push((async()=>{const t=await M(r,o,i);return{plugin:n,pluginData:t}})())}const r=await Promise.allSettled(t);for(const t of r)if("fulfilled"===t.status&&t?.value){const{plugin:e,pluginData:o}=t.value;o&&o.active&&(n[e]=o)}}}return n}const U="foxkit_add_to_cart",B="foxkit_plugin_viewed";function H({plugin:t,pluginId:e,productId:o,variantId:i,selectedItems:n,foxKitEventId:r,...s},c){window.Shopify.analytics?.publish(c,{shop:window.FoxKitV2.shop,plugin:t,pluginId:e,productId:o,variantId:i,selectedItems:n,foxKitEventId:r,...s}),c===B&&["LuckyWheel","PopUp"].includes(t)&&navigator.sendBeacon("https://foxkit.app/track/batch",JSON.stringify({events:[{shop:window.Shopify.shop,plugin:t}],metadata:{eventId:generateId(),appType:"foxkit",appId:"d4b61aaa-4d7c-11ee-be56-0242ac120002"}}))}const q="_fk_cart_update";o(356);var V=o(457).Z;window.FoxKitV2=new class{constructor(){i(this,"initCart",(async()=>{const t=await this.getCart(),{cart:e,draftOrderLineItems:o}=await(async t=>{if(!t||!t?.items?.length)return{cart:t};const e={...t};delete e.sections;const o=t.items;if(!o?.length)return{cart:t};const i=[];let n=[];for(const t of o)n.push((async()=>{const e=t?.product_id,o=await window.FoxKitV2.Utils.getCollectionIdsByProductHandle(t?.handle),n=await window.FoxKitV2.Helpers.getPluginData({plg:"quantityDiscount",productId:e,collectionIds:o});n&&i.push({offer_id:n._id,shortId:n.id,plugin:"QuantityDiscount",product_id:e,smallestMinQty:(l(n?.discounts)||[]).sort(((t,e)=>t.min_qty-e.min_qty))?.[0]?.min_qty})})());await Promise.all(n),i?.length&&(e.attributes._foxCartDiscounts=i),e._foxCurrency={...window.Shopify.currency,published:window.Shopify?.currency?.active};const{cart:r,draftOrderLineItems:s}=await b(e);return{cart:r,draftOrderLineItems:s}})(t)||{};c(this.CACHE_FOX_CART_ITEMS,e?.items),this.cart=e,this.draftOrderLineItems=o,this.renderCartSummary()})),i(this,"refreshCart",(()=>{window.FoxkitEvents.subscribe("ON_CART_UPDATE",(async t=>{const{cart:e,draftOrderLineItems:o}=await x(t)||{};c(this.CACHE_FOX_CART_ITEMS,e?.items),this.cart=e,this.draftOrderLineItems=o,this.renderCartSummary()})),window.FoxkitEvents.subscribe("ON_ITEM_ADDED",(async()=>{const t=await this.getCart(),{cart:e,draftOrderLineItems:o}=await x(t)||{};c(this.CACHE_FOX_CART_ITEMS,e?.items),this.cart=e,this.draftOrderLineItems=o,this.renderCartSummary()}))})),i(this,"initTranslations",(async()=>{const t=window.Shopify.locale||"en";if(this.transations&&this.transations[t])window.__i18n.setLocales(t,this.transations[t]);else{const e=await this.fetchShopLocales(t);if(e&&e.ok&&e.payload){const{locale:t,data:o}=e.payload;this.transations[t]=o,window.__i18n.setLocales(t,o)}}})),i(this,"fetchPluginsData",(async()=>{const t=window.Shopify.shop,e=["PrePurchase","PreOrder","InCart","SizeChart"];let o=e.map(((t,e)=>`plugins[${e}]=${t}`)).join("&");"product"===window.FoxKitSettings.templateName&&(o+="&template=product");const i=sessionStorage.getItem("FoxKit:pluginData");let n;if(i)try{n=JSON.parse(i),n.payload?.SizeChart||"product"!==window.FoxKitSettings.templateName||(n=null)}catch(t){n=null}if(!n)try{const e=await fetch(`${this.appURL}/api/public/plugins?shop=${t}&${o}`);n=await e.json(),n.payload&&sessionStorage.setItem("FoxKit:pluginData",JSON.stringify(n))}catch(t){return}n.payload&&(e.forEach((t=>{let e=n.payload[t];e&&(window.FoxKitPlugins[t]="SizeChart"===t?e.map((t=>({...t,locales:!window.FoxKitSettings.primaryLocale&&t?.locales?.[window.Shopify.locale]}))):e)})),this.initGlobalPlugins(),n.payload.SizeChart&&this.initSizeChart())})),i(this,"fetchShopLocales",(t=>new Promise(((e,o)=>{fetch(`${this.appURL}/api/public/locale?shop=${this.shop}&locale=${t}`).then((t=>t.json())).then(e).catch(o)})))),i(this,"initGlobalPlugins",(()=>{const{PrePurchase:t,PreOrder:e}=window.FoxKitPlugins;this.initInCart(),t&&t.length&&this.initPrePurchase(),e&&e.length&&this.initPreOrder()})),i(this,"renderElements",(()=>{const{CartCountdown:t,CartGoal:e}=window.FoxKitPlugins;if(t?.active){const e=document.querySelectorAll("foxkit-cart-countdown");if(!e?.length){const e=document.querySelectorAll(".foxkit-cart-countdown-hook");e?.length?e.forEach((e=>{const o=document.createElement("foxkit-cart-countdown");t.show_on_drawer?o&&e.appendChild(o):o&&!e.classList.contains("foxkit-cart-countdown-hook-drawer")&&e.appendChild(o)})):this.cartForms?.length&&this.cartForms.forEach((t=>{const e=document.createElement("foxkit-cart-countdown");e&&t.parentNode.insertBefore(e,t)}))}}if(e?.active){const t=document.querySelectorAll("foxkit-cart-goal");if(!t?.length){const t=document.querySelectorAll(".foxkit-cart-goal-hook");t?.length?t.forEach((t=>{const e=document.createElement("foxkit-cart-goal");t.appendChild(e)})):this.cartForms?.length&&this.cartForms.forEach((t=>{const e=document.createElement("foxkit-cart-goal");t.parentNode.insertBefore(e,t)}))}}window.FoxKitSettings.optimizePerformance||this.initSizeChart()})),i(this,"initSizeChart",(()=>{const{SizeChart:t}=window.FoxKitPlugins;if(t?.length){const t=document.querySelectorAll(this.selectors.openSizeChartBtn);if("product"===this.configs.templateName&&t.length)try{let t={plg:"sizeChart"};t.productId=this.configs.product.id,t.collectionIds=this.configs?.product?.collections?.map((t=>t?.id)),(async()=>{const e=await R(t);e&&e.active&&__loadjs(FoxKitAssets.sizechart,(()=>{new window.FoxKitModules.SizeChart(e)}))})()}catch(t){}}})),i(this,"getCart",(()=>P(this.shopRootUrl+"cart.json"))),i(this,"updateCartCount",(async()=>{const t=document.querySelectorAll(this.selectors.cartCount);if(!t?.length)return;const e=await window.FoxKitV2.getCart();t.forEach((t=>{t.textContent=e?.item_count||"",t.classList?.remove("hidden","opacity-0"),t.removeAttribute("hidden"),t.removeAttribute("aria-hidden"),"0"===t.style?.opacity&&(t.style.opacity=""),"none"===t.style?.display&&(t.style.display="")}))})),i(this,"renderCartSummary",((t=!0)=>{this.domNodes=r(this.selectors),this.cartForms=document.querySelectorAll(this.selectors.cart),!t&&window.MinimogTheme||window.FoxkitEvents.emit("ON_FOXKIT_CART_UPDATE",this.cart);const e=this.getFoxKitVolumeCartAttributes();if(window.FoxKitPlugins?.CartGoal?.active&&this.freeShip?this.applyAttributeToCart({"FoxKit CartGoal":!0,"FoxKit volume discount":e}):this.applyAttributeToCart({"FoxKit CartGoal":null,"FoxKit volume discount":e}),"shopify_functions"!==this.configs.discountApplyBy){if(this.domNodes=r(this.selectors),this.updateCartCount(),document.querySelectorAll(".foxkit-cart-discounts").forEach((t=>t.remove())),this.hasDiscount=!!this.cart._foxCartPrices?.total_discounted_amount,this.toggleCheckoutEvent(this.hasDiscount),this.cart._foxCartPrices){const{total_discounted_amount:t,total_price:e}=this.cart._foxCartPrices,{moneyFormat:o}=FoxKitSettings,i=document.querySelectorAll("[data-foxkit-cart-summary]");i.length?i.forEach((e=>{e.appendChild(this.generateCartDiscount(t))})):this.domNodes.cartSummary.forEach((e=>{e.prepend(this.generateCartDiscount(t))})),this.domNodes.subtotalValue?.forEach((t=>t.innerHTML=T(e,o)))}window.FoxKitPlugins?.CartGoal?.active&&this.freeShip?this.cartForms.forEach((t=>{const e=t.getAttribute("id")||"",o=t.querySelector('[name="attributes[FoxKit CartGoal]"]')||document.querySelector(`[form="${e}"][name="attributes[FoxKit CartGoal]"]`);let i=o;i||(i=document.createElement("input")),o||(i.type="hidden",i.name="attributes[FoxKit CartGoal]"),i.value=this.freeShip?!!this.freeShip:"",o||t.prepend(i)})):this.cart,this.getDiscountOffer()}})),i(this,"getDiscountOffer",(async()=>{this.cart.item_count&&"discount_code"===this.configs?.discountApplyBy&&(this.discount=await async function(t){const e=window.Shopify.shop,o=await window.FoxKitV2.Helpers.fetchJSON(`${window.FoxKitV2.appURL}/api/public/v3/cart?shop=${e}`,{method:"POST",body:"string"==typeof t?t:JSON.stringify(t)});return o?.payload}(this.cart),this.updateDiscountToCartForm())})),i(this,"updateDiscountToCartForm",(async()=>{if("discount_code"!==this.configs?.discountApplyBy)return;this.discountMessage&&this.discountMessage.remove(),this.discountMessage=document.createElement("p");const t=window.__i18n.tr("fox_discount_noti",{price:T(this.cart._foxCartPrices?.total_discounted_amount,this.configs.moneyFormat),discount_title:window.__i18n.tr("discount_title")});this.discountMessage.classList.add("foxkit-discount-message"),this.discountMessage.innerHTML=t;let e=[];var o;this?.discount?.code&&e.push(this.discount.code),this.cartForms.forEach((t=>{const o=t.getAttribute("id")||"",i=t.querySelector('[name="discount"]')||document.querySelector(`[form="${o}"][name="discount"]`);let n=i;n||(n=document.createElement("input")),i||(n.type="hidden",n.name="discount"),"hidden"!==i?.getAttribute("type")&&(this.discountMessage?n.before(this.discountMessage):n.setAttribute("aria-disabled","true")),n.value=e.join(","),window.MinimogTheme&&localStorage.setItem("minimog-discount-code",e.join(",")),i&&!e.length&&(n.removeAttribute("aria-disabled"),this.discountMessage&&this.discountMessage.remove()),i||t.prepend(n)})),this?.discount?.code&&await async function(t){if(t)try{await fetch(`${FoxKitSettings.shopDomain}/discount/${t}`),window.FoxKitAfterApplyDiscount&&window.FoxKitAfterApplyDiscount()}catch(t){}}(this.discount.code),e?.length?s("discount_code",e.join(","),void 0,"Lax"):(o="discount_code",document.cookie=o+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;",window.MinimogTheme&&localStorage.removeItem("minimog-discount-code"))})),i(this,"generateCartDiscount",(t=>{const e=V("ul",{className:"foxkit-cart-discounts scd-cart__discounts"});t=T(t,FoxKitSettings.moneyFormat);const o=V("li",null);return o.innerHTML=` ${window.__i18n.tr("discount_title")} (-${t})`,e.appendChild(o),e})),i(this,"handleCheckout",(async t=>{t.preventDefault(),t.stopPropagation();const e=t.target;this.domNodes.checkoutButton.forEach((t=>{t.setAttribute("disabled",!0),t.classList.add("sf-spinner-loading")}));try{const t=await async function({cart:t,freeShipping:e,draftOrderLineItems:o}){const i={cart:t,freeShipping:e,draftOrderLineItems:o},n=window.Shopify.shop,r=await window.FoxKitV2.Helpers.fetchJSON(`${window.FoxKitV2.appURL}/api/public/v3/checkout?shop=${n}`,{method:"POST",body:JSON.stringify(i)});return r?.payload}({cart:this.cart,draftOrderLineItems:this.draftOrderLineItems,freeShipping:this.freeShip}),{invoiceUrl:o}=t||{};o?window.location.href=`${o}?locale=${window.Shopify.locale}`:(this.toggleCheckoutEvent(),e.removeAttribute("disabled"),e.click())}catch(t){this.toggleCheckoutEvent(),e.removeAttribute("disabled"),e.click()}})),i(this,"toggleCheckoutEvent",((t=!1)=>{const e="draft_order"===this.configs?.discountApplyBy;this.domNodes.checkoutButton?.length&&e&&this.domNodes.checkoutButton.forEach((e=>{e.removeEventListener("click",this.handleCheckout,!0),t&&e.addEventListener("click",this.handleCheckout,!0)}))})),i(this,"handleSubscribe",(t=>{const e=new Headers;e.append("Content-Type","application/x-www-form-urlencoded");const o={method:"POST",headers:e,body:new URLSearchParams({data:JSON.stringify(t)})};return new Promise(((t,e)=>{fetch(`${this.appURL}/api/public/subscribe?shop=${window.Shopify.shop}`,o).then((t=>t.json())).then(t).catch(e)}))})),i(this,"goToCart",(()=>{window.location.href=this.configs.routes.cart})),this.shop=window.Shopify.shop,c("_foxKit_shop",window.Shopify.shop),c("_foxKit_currency",{primary:window.FoxKitSettings?.currencyCode,...window.Shopify.currency}),this.shopRootUrl=window.Shopify.routes.root,this.configs=window.FoxKitSettings||{},this.Utils={},this.appURL=this.configs.foxKitBaseUrl?`https://${this.configs.foxKitBaseUrl}`:"",this.transations=window.FoxKitStrings||{},this.settings={},this.discount=null,this.freeShip=!1,this.selectors={productForm:'product-form form, form.product-form, form.main-product-form, form.product-single__form, form[action*="/cart/add"]',atcButton:'[name="add"], [name="foxkit-add"], button[type="submit"], button.add-to-cart, .add-to-cart-btn, .add_to_cart, button[name="add"], button#AddToCart, button.product-form__submit',cart:'form[action$="/cart"], cart-items form:not(.foxkit-product-form), form#cart, form#CartDrawer, cart-drawer form:not(.foxkit-product-form), #CartDrawer form:not(.foxkit-product-form), form#CartDrawer-Form, form#cart-drawer-form',cartDrawer:"cart-drawer, drawer-cart, #foxkit-cart-drawer-hook",openSizeChartBtn:"[data-open-sizeguide], .open-foxkit-sizechart, foxkit-sizechart-opener, .foxkit-sizechart-opener",cartCount:".cart-count-bubble > span:first-child, .sf-cart-count, [data-cart-count-number], .foxkit-cart-count, [data-cart-count], .header__cart-count .count-bubble, .cart-count",subtotalValue:[".totals__subtotal-value, [data-foxkit-subtotal], [data-cart-subtotal-price], .sf-cart-subtotal__price, .foxkit-cart-subtotal, [data-cart-price], #CartDrawer [data-subtotal], .cart__page [data-subtotal]"],cartSummary:[".cart__footer > .cart__blocks > .js-contents, .sf-cart__summary .scd__summary, .scd__footer .scd__summary, .cart-drawer__footer, .m-cart__summary, #CartDrawer [data-discounts], .cart__page [data-discounts], [data-foxkit-discount]"],checkoutButton:['button[id="checkout"], button[name="checkout"], input[id="checkout"], input[name="checkout"], [data-foxkit-button-checkout]']},this.configs.selectors&&Object.keys(this.configs.selectors).forEach((t=>{const e=this.configs.selectors[t],o=(t=>{try{return document.querySelector(t),!0}catch(t){return!1}})(e),i=this.selectors[t];o&&i&&("string"==typeof i?this.selectors[t]+=`,${e}`:this.selectors[t][0]+=`,${e}`)})),this.domNodes=r(this.selectors),this.productForms=Array.from(document.querySelectorAll(this.selectors.productForm)).filter((t=>{const e=t.getAttribute("id")||"";return!e.includes("instalment")&&!e.includes("installment")&&!t.classList.contains("installment")})),this.cartForms=document.querySelectorAll(this.selectors.cart),function(){window.FoxkitEvents=new C;const t=document.querySelectorAll("form[action*='/cart/add']:not(.installment)");let e=!1;for(const o of t){const t=o.getAttribute("id"),i=o.querySelector('[name="id"]')||document.querySelector(`input[name="id"][form="${t}"]`);i&&"SELECT"===i?.tagName&&(e=!0),i&&new MutationObserver((t=>{for(let e of t)if("attributes"===e.type&&"value"===e.attributeName){const t=o.dataset.productId?Number(o.dataset.productId):null,e=Number(i.value);window?.FoxkitEvents.emit("ON_VARIANT_CHANGE",e,t)}})).observe(i,{attributes:!0})}if(e&&t[0]){let e=new URLSearchParams(location.search).get("variant");const o={subtree:!0,childList:!0};new MutationObserver((function(){const o=new URLSearchParams(location.search).get("variant");if(o!==e){const e=t[0].dataset.productId?Number(t[0].dataset.productId):new FormData(t[0]).get("product-id");window?.FoxkitEvents.emit("ON_VARIANT_CHANGE",o?Number.parseInt(o):o,e)}e=o})).observe(document,o)}!function(t,e){"function"==typeof e&&(t.fetch=function(){const t=e.apply(this,arguments);return t.then((t=>{const e=`${window.location.origin}/`,o=`${window.location.origin}${window.FoxKitSettings.baseUrl}`,i=[e,o].reduce(((t,e)=>(t.push(`${e}cart/add`,`${e}cart/add.js`),t)),[]),n=[e,o].reduce(((t,e)=>(t.push(`${e}cart/change`,`${e}cart/change.js`,`${e}cart/update.js`,`${e}cart/update`,`${e}cart/clear`,`${e}cart/clear.js`),t)),[]);i.includes(t.url)&&200===t.status&&t.clone().json().then((t=>{const e=arguments?.[1]?.body;let o,i=1;if(e instanceof FormData)for(const[t,n]of e.entries())"quantity"===t&&(i=n),"foxKitEventId"===t&&(o=n);const n=window.FoxKitV2?.cart?.original_total_price+t?.final_price*i;c(q,n),window?.FoxkitEvents?.emit("ON_ITEM_ADDED",t),window.FoxKitAddToCart&&window.FoxKitAddToCart(t);const[r,s]=(t?.properties?.[window.FoxKitV2.FOXKIT_LINE_OFFER_KEY]??"").split(":");r&&H({plugin:r,pluginId:s,productId:t?.product_id,variantId:t?.variant_id,foxKitEventId:o},U);const a="FoxKit Pre Order"===t?.selling_plan_allocation?.selling_plan?.name&&t.selling_plan_allocation.selling_plan?.description;a&&H({plugin:"PreOrder",pluginId:a,productId:t?.product_id,variantId:t?.variant_id,foxKitEventId:o},U)})),n.includes(t.url)&&200===t.status&&t.clone().json().then((t=>{const e=arguments[1].body;if(e&&"string"==typeof e)try{const t=JSON.parse(e);if("object"==typeof t&&1===Object.keys(t).length&&"attributes"===Object.keys(t)[0]&&"object"==typeof t.attributes&&(Object.keys(t.attributes).includes("FoxKit CartGoal")||Object.keys(t.attributes).includes("FoxKit volume discount")))return}catch(t){}const o=t?.original_total_price;a(q)!=o&&(window?.FoxkitEvents?.emit("ON_CART_UPDATE",t),window.FoxKitCartUpdate&&window.FoxKitCartUpdate(t),c(q,o))}))})),t})}(window,window.fetch)}(),this.initTranslations(),this.refreshCart(),window.FoxKitSettings.optimizePerformance?this.fetchPluginsData():this.initGlobalPlugins(),this.renderElements(),this.initCart(),this.CACHE_FOX_CART_ITEMS="_foxCartItems",this.FOXKIT_LINE_OFFER_KEY="_FoxKit offer"}initPrePurchase(){__loadjs([FoxKitAssets.prePurchase,FoxKitAssets.prePurchaseStyle],(()=>{new window.FoxKitModules.PrePurchase}))}initInCart(){!document.querySelectorAll("foxkit-incart-upsell").length>0&&__loadjs([FoxKitAssets.inCart],(()=>{const{InCart:t}=window.FoxKitPlugins;t&&t.length?window.FoxKitModules.InCart.init():window.FoxKitModules.InCart.init(!0)}))}initPreOrder(){this.productForms?.length&&this.productForms.map((async t=>{const e=t.querySelector("[data-foxkit-product-json]");let o=this.configs.product,i=this.configs.product?.id,n=this.configs?.product?.collections?.map((t=>t.id));if(e&&(o=JSON.parse(e.innerHTML),i=o.id,n=o.collectionIds.split(",")),i){let e={plg:"preOrder"};e.productId=i,e.collectionIds=n;const r=await R(e);r&&__loadjs(FoxKitAssets.preorder,(()=>{window.FoxKitV2.ActivePrerOrder=new window.FoxKitModules.Preorder({config:r,form:t,productId:i,productData:o})}))}}))}getFoxKitVolumeCartAttributes(){const t=this.cart.items;if(!t?.length)return null;const e=[];for(const[o,i]of t.entries())if("QTY_DISCOUNT"===i?._foxItemPrices?.discountToApply?.plugin){const{offer_id:t,shortId:n}=i._foxItemPrices.discountToApply,r=n||t;e.push(`${r}:${o}`)}return e.length?e.join(","):null}async applyAttributeToCart(t){if(!u(t,Object.keys(t).reduce(((t,e)=>(t[e]=this.cart.attributes?.[e]||null,t)),{}))){await(async(t,e)=>{const o={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({[t]:e})};await fetch(`${window.FoxKitSettings.routes.cart_update_url}`,o)})("attributes",t);for(const e in t)this.cart.attributes[e]=t[e]}}},window.FoxKitV2.Utils={queryDomNodes:r,productFormCheck:function(t){const e=['[name*="properties"][required]:not([hidden]):not([foxkit-hidden]):not([type="hidden"])'];window.__requiredFieldsSelectors&&e.push(window.__requiredFieldsSelectors);const o=t.querySelectorAll(e.join(",")),i=[];return o.forEach((e=>{if("radio"===e.type){const o=t.querySelectorAll(`input[name="${e.name}"]`);Array.from(o).some((t=>t.checked))||i.push(e)}else e.value||i.push(e)})),i},formatMoney:T,addEventDelegate:({context:t=document.documentElement,event:e="click",selector:o,handler:i,capture:n=!1})=>{const r=function(t){for(let e=t.target;e&&e!==this;e=e.parentNode)if(e.matches(o)){i.call(e,t,e);break}};return t.addEventListener(e,r,n),()=>{t.removeEventListener(e,r,n)}},getCookie:function(t){for(var e=t+"=",o=decodeURIComponent(document.cookie).split(";"),i=0;i{const e=n("div",null);return e.innerHTML=t,e},emailIsValid:function(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)},setSessionStorage:c,getSessionStorage:a,_isEqual:u,_pick:function(t,e){return e.reduce(((e,o)=>(t&&t.hasOwnProperty(o)&&(e[o]=t[o]),e)),{})},debounce:function(t,e=300){let o;return(...i)=>{clearTimeout(o),o=setTimeout((()=>t.apply(this,i)),e)}},getCollectionIdsByProductHandle:async t=>{try{const e=`_foxKit_${t}_collectionIds`,o=window.FoxKitV2.Utils.getSessionStorage(e);if(o)return o;const i=await window.FoxKitV2.Helpers.fetchHTML(`${window.FoxKitSettings.baseUrl}products/${t}?section_id=foxkit-json`,"[data-product-collections-json]"),n=(i||[]).map((t=>t.id));return window.FoxKitV2.Utils.setSessionStorage(e,n),n}catch(t){return[]}},getProductsDataByCollectionHandle:L},window.FoxKitV2.Helpers={getPluginData:R,getFlashSaleCountdown:async t=>{if(!t)return null;const e=`gid://shopify/Collection/${t}`;let o=null;const i={shop:window.Shopify.shop,active:!0};return o=await p("Countdown",i,(t=>"specific_collection"===t.applies_to&&t.target_collection===e&&!0===t.show_flashsale)),o},fetchJSON:P,fetchCache:E,fetchProductJSON:async t=>await I(`${window.FoxKitSettings.baseUrl}products/${t}.js`),fetchProductsByHandles:async(t=[])=>{let e=[];for(const o of t)e.push(k(o));const o=await Promise.allSettled(e);return o?.filter((t=>"fulfilled"===t.status)).map((t=>t?.value))??[]},fetchSection:(t,e={})=>{const{url:o,fromCache:i=!1,params:n={}}=e;return new Promise(((e,r)=>{const s=new URL(o||window.location.href);if(s.searchParams.set("section_id",t),Object.entries(n).forEach((([t,e])=>s.searchParams.set(t,e))),i){const t=O.get(s);if(t)return e(t)}fetch(s,K()).then((e=>{if(e.ok)return e.text();r(`Failed to load section: ${t}`)})).then((t=>{const o=F("div",null);o.innerHTML=t,O.set(s,o),e(o)})).catch(r)}))},fetchHTML:async(t,e)=>{const o=await E(t);if(o){const t=document.createElement("div");t.innerHTML=o;const i=t.querySelector(e);if(i)return"string"==typeof i?.innerHTML?JSON.parse(i.innerHTML):i?.innerHTML}return null},fetchJsonCache:I,getDiscountSummary:function(t){const e=document.createElement("span"),o="PERCENTAGE"===t?.type?`${t?.value}%`:window.FoxKitV2.Utils.formatMoney(100*t?.value*Number(window.Shopify?.currency?.rate||1),FoxKitSettings.moneyFormat);return e.innerHTML=window.__i18n.tr("discount_summary",{discount_value:o}),e},triggerCartUpdate:async function(t){window.Shopify&&"function"==typeof window.Shopify.onItemAdded&&window.Shopify.onItemAdded(t),window.FoxKitV2&&"function"==typeof window.FoxKitV2.onItemAdded&&window.FoxKitV2.onItemAdded(t),document.dispatchEvent(new CustomEvent("cart:refresh:opend")),document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})),document.dispatchEvent(new CustomEvent("cart:build")),document.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{open:!0}}))},loadJs:__loadjs}})()})();