1import{$ as K,a0 as O,c as g,o as r,d as e,t as a,F as A,q as T,N as J,av as Q,u as I,p as _,w as X,h as y,v as q,g as o,b as Y,r as k,l as Z,j as $,B as S,m as ee,W as te,f as v,O as B,s as se,K as ne}from"./CjXW0tVs.js";import oe from"./D8L7DFyP.js";import{_ as re}from"./_jNyNLO-.js";import ae from"./DKBnmzWv.js";import{_ as le}from"./B6nZoVyJ.js";import{_ as ie}from"./Du7D9B7P.js";import ce from"./C9LAk_lh.js";import{u as de}from"./C5qttOpm.js";import{h as _e,b as ue}from"./CHokJBag.js";import"./pWadYsIJ.js";import"./kmF5d1yy.js";import"./DLvL10aD.js";import"./DPgYBNnF.js";import"./Bkk41BO9.js";import"./D4RB4MK1.js";import"./CKH0mVqp.js";import"./CK8PORR4.js";import"./CEwMvTy3.js";import"./BQguEG_I.js";import"./BypKqouU.js";import"./C1xe_jy3.js";import"./Bi27KXly.js";import"./CqjJJ7ok.js";import"./CRbJLj_3.js";import"./BPbqyytc.js";import"./DHIdw9DK.js";import"./lIZA8kGU.js";const pe={class:"category-tab-list"},me={class:"sr-only"},ge={class:"category-tab-list-inner"},we=["id","value"],he=["for"],fe={__name:"CategorySelector",props:K(["categories"],{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(c){const l=O(c,"modelValue");return(u,n)=>(r(),g("div",pe,[e("legend",me,a(u.$t("global.Categories")),1),e("div",ge,[(r(!0),g(A,null,T(c.categories,(w,p)=>(r(),g("div",{key:`category-${p}`},[J(e("input",{id:`newsletter-category-${p}`,"onUpdate:modelValue":n[0]||(n[0]=h=>l.value=h),class:"sr-only peer",type:"radio",name:"newsletter-category",value:w},null,8,we),[[Q,l.value]]),e("label",{for:`newsletter-category-${p}`,class:"category-label"},a(w||u.$t("global.All_products")),9,he)]))),128))])]))}},be={class:"benefits-card"},ve={class:"font-base font-semibold pb-1"},ye={class:"text-sm"},ke={__name:"BenefitsSliderBase",props:{benefits:{type:Array,required:!0},icons:{type:Array,required:!0},fallbackIcon:{type:String,default:"tabler:gift"}},setup(c){const{t:l}=I();return(u,n)=>{const w=q,p=ce;return r(),_(p,{text:o(l)("newsletter.What_you_get_by_sign_up_newsletter"),objectsArray:c.benefits,showNavigation:!0,isAutoWidth:!0},{slide:X(({item:h,index:x})=>[e("div",be,[y(w,{name:c.icons[x]||c.fallbackIcon},null,8,["name"]),e("span",ve,a(h.header),1),e("p",ye,a(h.text),1)])]),_:1},8,["text","objectsArray"])}}},$e={__name:"NewsletterBenefitsSlider",props:{benefits:{type:Array,required:!0}},setup(c){const l=["tabler:speakerphone","heroicons:receipt-percent","tabler:armchair","tabler:book","tabler:gift"];return(u,n)=>(r(),_(ke,{benefits:c.benefits,icons:l},null,8,["benefits"]))}},xe={id:"newsletterPage"},Ne={class:"newsletter-header"},Me={key:0,class:"newsletter-banner-container"},Ce={class:"newsletter-header-content"},Ve={class:"container my-16 flex flex-col gap-16"},De={class:"newsletter-products"},Se={class:"newsletter-products-header"},Be={class:"howto-section"},Ae={class:"howto-section-inner"},Te={class:"cards-grid"},Ie={class:"howto-card"},qe={class:"howto-card--description"},Le={class:"howto-card--index"},Re={class:"howto-card--heading"},je={class:"howto-card--subheading"},ze={key:1,class:"howto-placeholder"},Ee={class:"placeholder--signup"},Ge={class:"text-neutral-200 min-w-0 flex-1 truncate"},Fe={class:"ms-auto shrink-0 px-3 py-2 bg-primary text-nowrap rounded-md text-white"},He={class:"placeholder--policy"},Pe=["innerHTML"],ft={__name:"newsletter",async setup(c){let l,u;const{t:n}=I(),{isMobile:w}=de(),p=Y(),h=n("newsletter.Newsletter_benefits_with_headings").split(";").map(s=>{const t=s.split("/");switch(t.length){case 2:return{header:t[0],text:t[1]};case 1:return{header:t[0]};default:return console.error("Error parsing newsletter.Newsletter_benefits_with_headings"),{}}}),x=[{text:n("newsletter.Sign_up_for_newsletter"),description:n("newsletter.Sign_up_for_newsletter_description"),image:"sign_up_placeholder"},{text:n("newsletter.Confirm_subscription"),description:n("newsletter.Check_your_email_and_confirm_signing_up_reduced"),image:n("newsletter.Check_your_email_and_confirm_signing_up_img")},{text:n("newsletter.Take_advantage_discounts"),description:n("newsletter.Thats_all_thanks_for_trust"),image:n("newsletter.Thats_all_thanks_for_trust_img")}],i=k(null),f=k(1),N=k(0);w?N.value=10:N.value=15;
1const{data:b,pending:V,refresh:L}=([l,u]=Z(()=>se("newsletter_discount_code",{query:{selected_category:i,page:f,page_size:N},cache:!1})),l=await l,u(),l),m=k([]),M=$(()=>{const s=b?.value?.available_categories;return s?.length?[null,...s]:[]}),R=$(()=>{const s=b?.value?.pagination;return s?{current:m.value.length,max:s?.total_count}:{}});i.value=M.value?.[0];const j=()=>f.value=Math.min(f.value+1,b?.value?.pagination?.total_pages||1),z=()=>new Date(b?.value?.end_date||""),E=$(()=>n("newsletter.Newsletter_banner_desk")!="newsletter.Newsletter_banner_desk"),G=$(()=>n("newsletter.Newsletter_banner_mobile")!="newsletter.Newsletter_banner_mobile");return S(b,s=>{const t=s?.products??[];if(f.value===1){m.value=t;return}m.value=[...m.value,...t]},{immediate:!0}),S(i,async s=>{f.value=1,m.value=[],i.value=s,await L()}),ee(()=>{_e("page_view",{}),p.query.newsletter==="confirmed"&&(te("success",[{text:n("toast.Newsletter_confirmed")}]),ue("newsletter_confirmation",{event_category:"newsletter",event_label:"confirmed_via_url"}))}),(s,t)=>{const C=ne,F=oe,D=fe,H=re,P=ae,U=q;return r(),g("div",xe,[e("section",Ne,[o(E)||o(G)?(r(),g("div",Me,[s.$t("newsletter.Newsletter_banner_desk")?(r(),_(C,{key:0,preload:"",loading:"lazy",fetchpriority:"high",class:"hidden sm:flex newsletter-banner",src:s.$t("newsletter.Newsletter_banner_desk"),alt:"","aria-hidden":"true"},null,8,["src"])):v("",!0),s.$t("newsletter.Newsletter_banner_mobile")?(r(),_(C,{key:1,preload:"",loading:"lazy",fetchpriority:"high",class:"flex sm:hidden newsletter-banner-mobile",src:s.$t("newsletter.Newsletter_banner_mobile"),alt:"","aria-hidden":"true"},null,8,["src"])):v("",!0),t[3]||(t[3]=e("div",{class:"newsletter-image-overlay"},null,-1))])):v("",!0),e("div",Ce,[t[4]||(t[4]=e("div",null,null,-1)),y(F,{row:!0,"is-newsletter-page":!0,class:"w-full lg:max-w-[600px]"})])]),e("div",Ve,[e("section",De,[e("div",Se,[e("div",null,[e("h1",null,a(s.$t("newsletter.Great_products_in_the_best_prices")),1),e("p",null,a(s.$t("newsletter.Product_section_information")),1),s.$device.isMobile?v("",!0):(r(),_(D,{key:0,modelValue:o(i),"onUpdate:modelValue":t[0]||(t[0]=d=>B(i)?i.value=d:null),categories:o(M)},null,8,["modelValue","categories"]))]),y(H,{targetDate:z()},null,8,["targetDate"]),s.$device.isMobile?(r(),_(D,{key:0,modelValue:o(i),"onUpdate:modelValue":t[1]||(t[1]=d=>B(i)?i.value=d:null),categories:o(M)},null,8,["modelValue","categories"])):v("",!0)]),o(V)&&!o(m).length?(r(),_(P,{key:0})):(r(),_(ie,{key:1,products:o(m),source:"newsletter",source_id:"",gridComponent:le,"pagination-progress":o(R),onShowMoreClick:t[2]||(t[2]=d=>j()),"disable-pagination":o(V)},null,8,["products","pagination-progress","disable-pagination"]))]),t[5]||(t[5]=e("hr",{class:"newsletter-full-bleed-separator"},null,-1)),y($e,{benefits:o(h)},null,8,["benefits"])]),e("div",Be,[e("div",Ae,[e("h2",null,a(o(n)("newsletter.How_does_it_work")),1),e("div",Te,[t[7]||(t[7]=e("div",{class:"connector-line--horizontal"},null,-1)),t[8]||(t[8]=e("div",{class:"connector-line--vertical"},null,-1)),(r(),g(A,null,T(x,(d,W)=>e("div",Ie,[e("div",qe,[e("span",Le,a(s.$n(W+1,{minimumIntegerDigits:2,useGrouping:!1})),1),e("p",Re,a(d.text),1),e("p",je,a(d.description),1)]),d.image!=="sign_up_placeholder"?(r(),_(C,{key:0,class:"object-contain h-[75px] md:h-[100px]",src:d.image},null,8,["src"])):(r(),g("div",ze,[e("div",Ee,[y(U,{class:"min-w-6 min-h-6",name:"tabler:mail"}),e("div",Ge,a(o(n)("newsletter.Enter_your_email")),1),e("span",Fe,a(o(n)("global.Sign_up")),1)]),e("div",He,[t[6]||(t[6]=e("input",{class:"rounded text-success-success-500",type:"checkbox",checked:!0,id:"placeholder-checkbox",disabled:"disabled"},null,-1)),e("p",{class:"prose text-xs ml-2",innerHTML:s.$t("newsletter.Newsletter_accept_policy_rules_compact",{policyLink:o(n)("url.privacy_policy"),rulesLink:o(n)("newsletter.Newsletter_rules")})},null,8,Pe)])]))])),64))])])])])}}};export{ft as default};
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.