1import{f as g,h as p}from"./__vite-products.a3673d24.js";const d=(e=[],t)=>e.map(n=>y(n,t)),y=(e={},t)=>Object.fromEntries(Object.entries(t).map(([n,r])=>{let s;return typeof r=="function"?s=r.call(r,e):typeof e[r]<"u"&&(s=e[r]),n==="custom"&&typeof s=="object"&&s!==null&&Object.keys(s).length===0&&(s=null),[n,s]}).filter(([n,r])=>r!==null)),h=({list:e,impressions:t})=>t.map(({handle:n,position:r})=>{const s=g(n),o=p(n),c=b(o),u=Object.fromEntries(Object.entries(o).filter(([i,l])=>/^custom/.test(i))),{customDemo:m,...a}=u;if(s){const i=o.options.map((l,f)=>({name:l.name,value:s.options[f]}));return{...s,id:o.id,title:o.title,url:o.url,handle:o.handle,images:o.images,optionInfos:i,position:r,list:e,...c,...Object.keys(a).length?a:{},variant:s}}return{...o,position:r,list:e,...c,sku:o.variant_sku,barcode:o.variant_barcode}}),w=(e,t)=>Object.entries(e).map(([n,{impressions:r,list:s}])=>({item_list_id:s,item_list_name:k(s),items:d(h({list:s,impressions:r}),t)})),b=e=>{var r;if(!e.collection_names)return{};const t=((r=window.themeVariables.tracking)==null?void 0:r.gtm_use_product_type_as_item_category)&&e.type,n=e.collection_names.map((s,o)=>[`item_category${o?o+(t?2:1):t?2:""}`,s]);return t&&n.unshift(["item_category",e.type]),n.length>5&&(n.length=5),Object.fromEntries(n)},N=({original_price:e,compare_at_price:t,discounted_price:n,price:r})=>parseFloat((j({original_price:e,compare_at_price:t,discounted_price:n,price:r})-O({original_price:e,compare_at_price:t,discounted_price:n,price:r})).toFixed(2)),j=({original_price:e,compare_at_price:t,discounted_price:n,price:r})=>{const s=n||r||0;let o=!t||isNaN(t)?e:t;return o=o||0,o<s?s/100:(o||s)/100},O=({original_price:e,compare_at_price:t,discounted_price:n,price:r})=>{const s=n||r||0;let o=!t||isNaN(t)?e:t;return o=o||0,o<s?0:(o-s)/100},k=e=>(e||"").split(/\|/)[0].replace(/[:_]/g," "),I=({line_level_discount_allocations:e})=>e&&e.map(({discount_application:n})=>n.title).join(", ")||null,C=e=>Object.fromEntries(Object.entries(e).filter(([t,n])=>t!=="customDemo"&&/^custom/.test(t)).map(([t,n])=>{const r=t.replace(/^custom/,"");return[r.charAt(0).toLowerCase()+r.slice(1),n]})),D=({line_level_discount_allocations:e})=>{if(!e)return null;let t=e.filter(({discount_application:n})=>n.type==="discount_code");return t.length?(t=t.map(({discount_application:n})=>n.title).join(", "),t||null):null},q=({cart_level_discount_applications:e})=>{if(!e||!e.length)return null;let t=e.filter(n=>n.type==="discount_code");return t.length?(t=t.map(n=>n.title).join(", "),t||null):null},L=(e,t)=>{const n={};return Object.entries(e).forEach(([r,s])=>{const o=t[r];if(!o){n[r]=s;return}JSON.stringify(o).length!==JSON.stringify(s).length&&(n[r]=s)}),Object.keys(n).length!==0?n:{}},E=e=>{switch(e.split(/\|/)[0]){case"product:main":case"product:quick_view":case"product:quick_popover":return!0;default:return!1}},S=e=>{const t=e.split(/\|/)[0];return t==="product:quick_view"||t==="product:quick_popover"},V=e=>{const t=e.querySelector("quantity-selector input[type='text']");return t?parseInt(t.value):1},M=({images:e})=>{let t=e[0]||null;return t&&!/^https?:\/\//.test(t)&&(t=`https://${t}`),t};export{j as a,O as b,C as c,w as d,L as e,M as f,k as g,N as h,E as i,I as j,D as k,y as l,S as m,V as n,d as o,b as p,q};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.