1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Teaser-BzoSBM4f.js","assets/index-BWMC8nQi.js","assets/index-DXR3qgbX.css","assets/Teaser-5UwmTB52.css","assets/Toggle-DaXZQzEC.js","assets/Toggle-AwN5tk0Q.css"])))=>i.map(i=>d[i]); 2import{aX as R,v as H,aQ as Q,Z as $,ao as W,ak as X,au as v,al as Y,aY as J,aE as _,aF as U,an as x,r as A,j as S,ae as L,aq as O,ah as l,c as i,aZ as ee,aC as j,aD as y,ar as d,e as te,ad as h,ai as le}from"./index-BWMC8nQi.js";import{l as u}from"./lodash-DYx2SUAT.js";const se={name:"VDashboardNewsletter",components:{MaButton:$,MaCheckbox:Q,MaDropdown:H,MaRadioButton:R,Teaser:_(()=>U(()=>import("./Teaser-BzoSBM4f.js"),__vite__mapDeps([0,1,2,3]))),Toggle:_(()=>U(()=>import("./Toggle-DaXZQzEC.js"),__vite__mapDeps([4,1,2,5])))},setup(){const e=x(),{getParams:n}=W,P=X.initializeContentfulApi(),{formLabels:D}=e.getters["ContentfulStore/getAppContent"],p=A([]),c=A(!0),b=A(!1),I=A(null),s=A(null),m=S(()=>e.getters["AuthenticationStore/getAuthToken"]),g=S(()=>e.getters["ApplicationStore/broadcastChannelEvent"]),T=S(()=>e.getters["NewsletterStore/getDealAlarmSelections"]),t=S(()=>e.getters["ApplicationStore/getIsLoading"]),z=S(()=>e.getters["NewsletterStore/getCustomerCenterSettings"].optIn&&e.getters["NewsletterStore/getDealAlarmSettings"].optIn&&e.getters["NewsletterStore/getPriceAlarmSettings"].optIn&&e.getters["NewsletterStore/getProductInfoSettings"].optIn&&e.getters["NewsletterStore/getSurveySettings"].optIn),q=async()=>{window.EventBus.emit("showMaLoader",!0);const a=u.cloneDeep(p.value),o=u.cloneDeep(s.value),r=[];let f=null,k=null,M=null,B=null,E=null;a.includes("customerCenter")&&(f=await e.dispatch("NewsletterStore/updateCustomerCenterSettings",o.customerCenter?.optIn),f&&r.push("customerCenter")),a.includes("dealAlarm")&&(k=await e.dispatch("NewsletterStore/updateDealAlarmSettings",{active:o.dealAlarm.optIn,conditionType:o.dealAlarm.conditionType,makes:o.dealAlarm.makes,paymentTypes:o.dealAlarm.paymentTypes,vehicleTypes:o.dealAlarm.vehicleTypes,fuelTypes:o.dealAlarm.fuelTypes}),k&&r.push("dealAlarm")),a.includes("priceAlarm")&&(M=await e.dispatch("NewsletterStore/updatePriceAlarmSettings",o.priceAlarm?.optIn),M&&r.push("priceAlarm")),a.includes("productInfo")&&(B=await e.dispatch("NewsletterStore/updateProductInfoSettings",o.productInfo?.optIn),B&&r.push("productInfo")),a.includes("survey")&&(E=await e.dispatch("NewsletterStore/updateSurveySettings",o.survey?.optIn),E&&r.push("survey")),window.EventBus.emit("showMaLoader",!1);let C="",N="info",V=!0;const K=5e3;u.isEqual(a.sort(),r.sort())?(C="Vielen Dank. Ihre Eingaben wurden erfolgreich gespeichert.",N="success",await e.dispatch("ApplicationStore/postBroadcastMessage",{component:null,eventName:"updateSettingsNewsletter",page:"VDashboardNewsletter",data:{tmpSettings:o}})):a.length>r.length?(C="Leider konnten nicht alle Ãnderungen gespeichert werden. Bitte versuchen Sie es zu einem späteren Zeitpunkt erneut.",N="error",V=!1):r.length===0&&(C="Leider ist ein Fehler aufgetreten, bitte versuchen Sie es erneut.",N="error",V=!1),window.EventBus.emit("showCBaseNotification",{textContent:C,notificationType:N,autoClose:V,millisecondsToClose:K})},G=async()=>{const a={customerCenter:"SF5U8EDYFlAZdyQ49QEWH",dealAlarm:"3oPun7PoaMQeTWsNw17adp",priceAlarm:"qpPG5OkA3fmECH4IpoDcb",productInfo:"5OcGMpTvj4dN9jS6NK6plu",survey:"2htGflPyM9g5X8cLndtPOl"};await P.byEntryIds([a.customerCenter,a.dealAlarm,a.priceAlarm,a.productInfo,a.survey]).getClient().fetch().then(o=>{const r=[];o.items?.forEach(f=>{r.push({icon:f.fields.icon,shortText:f.fields.shortText,title:f.fields.title})}),I.value=r})},Z=()=>{b.value?(s.value.customerCenter.optIn=e.getters["NewsletterStore/getCustomerCenterSettings"].optIn,s.value.dealAlarm.optIn=e.getters["NewsletterStore/getDealAlarmSettings"].optIn,s.value.priceAlarm.optIn=e.getters["NewsletterStore/getPriceAlarmSettings"].optIn,s.value.productInfo.optIn=e.getters["NewsletterStore/getProductInfoSettings"].optIn,s.value.survey.optIn=e.getters["NewsletterStore/getSurveySettings"].optIn):(s.value.customerCenter.optIn=!0,s.value.dealAlarm.optIn=!0,s.value.priceAlarm.optIn=!0,s.value.productInfo.optIn=!0,s.value.survey.optIn=!0)},w=a=>{p.value.includes(a)?p.value=p.value.filter(o=>o!==a):p.value.push(a),b.value=F()},F=()=>s.value?.customerCenter?.optIn&&s.value?.dealAlarm?.optIn&&s.value?.priceAlarm?.optIn&&s.value?.productInfo?.optIn&&s.value?.survey?.optIn;return v(()=>s?.value?.customerCenter,()=>{c.value||w("customerCenter")},{deep:!0}),v(()=>s?.value?.dealAlarm,()=>{c.value||w("dealAlarm")},{deep:!0}),v(()=>s?.value?.priceAlarm,()=>{c.value||w("priceAlarm")},{deep:!0}),v(()=>s?.value?.productInfo,()=>{c.value||w("productInfo")},{deep:!0}),v(()=>s?.value?.survey,()=>{c.value||w("survey")},{deep:!0}),v(g,a=>{const{eventName:o,data:r}=a;o==="updateSubscribePriceAlarm"&&(e.commit("NewsletterStore/setPriceAlarmSettings",{data:{priceAlarm:{optIn:r.state}}}),s.value.priceAlarm.optIn=r.state),o==="updateSettingsNewsletter"&&(e.commit("NewsletterStore/setNewsletterSettings",{data:r.tmpSettings}),s.value=u.cloneDeep(r.tmpSettings))}),Y(async()=>{window.EventBus.emit("showMaLoader",!0),e.subscribe(a=>{a.type==="NewsletterStore/setCustomerCenterSettings"&&(s.value.customerCenter=u.cloneDeep(e.getters["NewsletterStore/getCustomerCenterSettings"])),a.type==="NewsletterStore/setNewsletterSettings"&&(s.value=u.cloneDeep(e.getters["NewsletterStore/getNewsletterSettings"])),a.type==="NewsletterStore/setDealAlarmSettings"&&(s.value.dealAlarm=u.cloneDeep(e.getters["NewsletterStore/getDealAlarmSettings"])),a.type==="NewsletterStore/setPriceAlarmSettings"&&(s.value.priceAlarm=u.cloneDeep(e.getters["NewsletterStore/getPriceAlarmSettings"])),a.type==="NewsletterStore/setProductInfoSettings"&&(s.value.productInfo=u.cloneDeep(e.getters["NewsletterStore/getProductInfoSettings"])),a.type==="NewsletterStore/setSurveySett
2ings"&&(s.value.survey=u.cloneDeep(e.getters["NewsletterStore/getSurveySettings"]))}),await G(),T?.value||await e.dispatch("NewsletterStore/fetchDealAlarmSelections"),await e.dispatch("NewsletterStore/fetchNewsletterSettings"),n("optin")&&window.EventBus.emit("showCBaseNotification",{textContent:"Ihre Newsletter-Anmeldung wurde erfolgreich bestätigt.",notificationType:"success",autoClose:!0,millisecondsToClose:5e3}),await J(()=>{c.value=!1}),window.EventBus.emit("showMaLoader",!1)}),{authToken:m,changedSettings:p,formLabels:D,subscribedToAll:b,getDealAlarmSelections:T,getIsLoading:t,isSubscribedToAll:z,newsletterContent:I,settings:s,submitPreferences:q,handleSubscribedToAllGlobally:Z}}},ne={key:0,class:"dashboard-view dashboard-newsletter mb-6"},ae={class:"dashboard-header"},oe={class:"dashboard-content mt-1"},re={class:"deal-alarm-container d-flex flex-nowrap align-items-center"},ie={class:"h5"},de={class:"deal-alarm-preferences--component mb-4"},ue={class:"deal-alarm-preferences--wrapper"},pe={class:"dealalarm-preferences--content"},ce={autocomplete:"off"},me={class:"form--inner"},ge={class:"d-flex justify-content-between genericPreferences mb-2"},fe={class:"customerType d-flex"},ve={class:"row mb-2"},he={class:"col-12 col-sm-6"},be={class:"col-12 col-sm-6"},we={class:"row"},Ae={class:"col-12 col-sm-6"},Se={class:"col-12 col-sm-6"},ye={class:"align-items-center d-flex flex-nowrap mb-2"},Ie={class:"h5"},Te={class:"price-alarm-container align-items-start d-flex flex-nowrap mb-4"},Ce={class:"price-alarm-description"},Ne={class:"align-items-center d-flex flex-nowrap mb-2"},Ve={class:"h5"},Pe={class:"survey-container align-items-start d-flex flex-nowrap mb-4"},De={class:"survey-description"},ke={class:"align-items-center d-flex flex-nowrap mb-2"},Me={class:"h5"},Be={class:"product-info-container align-items-start d-flex flex-nowrap mb-4"},Ee={class:"customer-center-description m-0"},_e={class:"align-items-center d-flex flex-nowrap mb-2"},Ue={class:"h5"},Le={class:"customer-center-container align-items-start d-flex flex-nowrap mb-4"},Oe={class:"customer-center-description m-0"},je={class:"dashboard-newsletter-button"};function ze(e,n,P,D,p,c){const b=h("Teaser"),I=h("MaCheckbox"),s=h("MaRadioButton"),m=h("Toggle"),g=h("MaDropdown"),T=h("MaButton");return e.getIsLoading?j("",!0):(L(),O("div",ne,[l("div",ae,[i(b,{title:"Meine Newsletter"})]),l("div",oe,[e.isSubscribedToAll?j("",!0):(L(),O("div",{key:0,class:"dataUsage-wrapper",onClick:n[2]||(n[2]=(...t)=>e.handleSubscribedToAllGlobally&&e.handleSubscribedToAllGlobally(...t))},[i(I,{"error-bottom":"",id:"subscribedToAll",name:"subscribedToAll",modelValue:e.subscribedToAll,"onUpdate:modelValue":n[0]||(n[0]=t=>e.subscribedToAll=t),label:e.formLabels.dataUsage,onClick:n[1]||(n[1]=ee(()=>{},["prevent"]))},null,8,["modelValue","label"])])),l("div",re,[l("span",{class:y(["icon",e.newsletterContent.find(t=>t.title==="Dealalarm")?.icon])},null,2),l("h3",ie,d(e.newsletterContent.find(t=>t.title==="Dealalarm")?.title),1)]),l("div",de,[l("div",ue,[l("p",null,d(e.newsletterContent.find(t=>t.title==="Dealalarm")?.shortText),1),l("div",pe,[l("form",ce,[l("div",me,[l("div",ge,[l("div",fe,[i(s,{class:"mr-1",id:"radio_privat",name:"conditionType",inputValue:"private",label:"Privat",style:{"margin-right":"2rem"},modelValue:e.settings.dealAlarm.conditionType,"onUpdate:modelValue":n[3]||(n[3]=t=>e.settings.dealAlarm.conditionType=t)},null,8,["modelValue"]),i(s,{id:"radio_gewerbe",name:"conditionType",inputValue:"business",label:"Gewerbe",modelValue:e.settings.dealAlarm.conditionType,"onUpdate:modelValue":n[4]||(n[4]=t=>e.settings.dealAlarm.conditionType=t)},null,8,["modelValue"])]),i(m,{class:"bigger",id:"dealAlarmOptIn",name:"dealAlarmOptIn",modelValue:e.settings.dealAlarm.optIn,"onUpdate:modelValue":n[5]||(n[5]=t=>e.settings.dealAlarm.optIn=t),labelTextActive:"Angemeldet",labelTextInactive:"Abgemeldet",labelTextPending:e.settings.dealAlarm.pending?"Wartet auf Bestätigung":null},null,8,["modelValue","labelTextPending"])]),l("div",ve,[l("div",he,[i(g,{modelValue:e.settings.dealAlarm.makes,"onUpdate:modelValue":n[6]||(n[6]=t=>e.settings.dealAlarm.makes=t),options:e.getDealAlarmSelections.makes,id:"makes",name:"makes",label:"Hersteller",placeholder:"Hersteller",ref:"select_makes",required:"",disabled:!e.settings.dealAlarm.optIn,mode:"multiple",labelProp:"name",valueProp:"id",object:!0,"close-on-select":!1,"hide-selected":!1},null,8,["modelValue","options","disabled"])]),l("div",be,[i(g,{modelValue:e.settings.dealAlarm.vehicleTypes,"onUpdate:modelValue":n[7]||(n[7]=t=>e.settings.dealAlarm.vehicleTypes=t),options:e.getDealAlarmSelections.vehicleTypes,id:"vehicleTypes",name:"vehicleTypes",label:"Fahrzeugtyp",placeholder:"Fahrzeugtyp",ref:"select_vehicleTypes",required:"",disabled:!e.settings.dealAlarm.optIn,mode:"multiple",labelProp:"name",valueProp:"id",object:!0,"close-on-select":!1,"hide-selected":!1},null,8,["modelValue","options","disabled"])])]),l("div",we,[l("div",Ae,[i(g,{modelValue:e.settings.dealAlarm.paymentTypes,"onUpdate:modelValue":n[8]||(n[8]=t=>e.settings.dealAlarm.paymentTypes=t),options:e.getDealAlarmSelections.paymentTypes,id:"paymentTypes",name:"paymentTypes",label:"Zahlungsart",placeholder:"Zahlungsart",ref:"select_paymentTypes",required:"",disabled:!e.settings.dealAlarm.optIn,mode:"multiple",labelProp:"name",valueProp:"id",object:!0,"close-on-select":!1,"hide-selected":!1},null,8,["modelValue","options","disabled"])]),l("div",Se,[i(g,{modelValue:e.settings.dealAlarm.fuelTypes,"onUpdate:modelValue":n[9]||(n[9]=t=>e.settings.dealAlarm.fuelTypes=t),options:e.getDealAlarmSelections.fuelTypes,id:"fuelTypes",name:"fuelTypes",label:"Kraftstoff",placeholder:"Kraftstoff",ref:"select_fuelTypes",required:"",disabled:!e.settings.dealAlarm.optIn,mode:"multiple",labelProp:"name",valueProp:"id",object:!0,"close-on-select":!1,"hide-selected":!1},null,8,["modelValue","options","disabled"])])])])])])])]),l("div",ye,[l("span",{class:y(["icon",e.newsletterContent.find(t=>t.title==="Preisalarm")?.icon])},null,2),l("h3",Ie,d(e.newsletterContent.find(t=>
2t.title==="Preisalarm")?.title),1)]),l("div",Te,[l("p",Ce,d(e.newsletterContent.find(t=>t.title==="Preisalarm")?.shortText),1),i(m,{class:"bigger right",id:"priceAlarmOptin",name:"priceAlarmOptin",modelValue:e.settings.priceAlarm.optIn,"onUpdate:modelValue":n[10]||(n[10]=t=>e.settings.priceAlarm.optIn=t),labelTextActive:"Angemeldet",labelTextInactive:"Abgemeldet"},null,8,["modelValue"])]),l("div",Ne,[l("span",{class:y(["icon",e.newsletterContent.find(t=>t.title==="Umfragen")?.icon])},null,2),l("h3",Ve,d(e.newsletterContent.find(t=>t.title==="Umfragen")?.title),1)]),l("div",Pe,[l("p",De,d(e.newsletterContent.find(t=>t.title==="Umfragen")?.shortText),1),i(m,{class:"bigger right",id:"surveyOptin",name:"surveyOptin",modelValue:e.settings.survey.optIn,"onUpdate:modelValue":n[11]||(n[11]=t=>e.settings.survey.optIn=t),labelTextActive:"Angemeldet",labelTextInactive:"Abgemeldet"},null,8,["modelValue"])]),l("div",ke,[l("span",{class:y(["icon",e.newsletterContent.find(t=>t.title==="Produktinfos")?.icon])},null,2),l("h3",Me,d(e.newsletterContent.find(t=>t.title==="Produktinfos")?.title),1)]),l("div",Be,[l("p",Ee,d(e.newsletterContent.find(t=>t.title==="Produktinfos")?.shortText),1),i(m,{class:"bigger right",id:"productInfoOptin",name:"productInfoOptin",modelValue:e.settings.productInfo.optIn,"onUpdate:modelValue":n[12]||(n[12]=t=>e.settings.productInfo.optIn=t),labelTextActive:"Angemeldet",labelTextInactive:"Abgemeldet"},null,8,["modelValue"])]),l("div",_e,[l("span",{class:y(["icon",e.newsletterContent.find(t=>t.title==="Neuerungen im Kundencenter")?.icon])},null,2),l("h3",Ue,d(e.newsletterContent.find(t=>
2t.title==="Neuerungen im Kundencenter")?.title),1)]),l("div",Le,[l("p",Oe,d(e.newsletterContent.find(t=>t.title==="Neuerungen im Kundencenter")?.shortText),1),i(m,{class:"bigger right",id:"customerCenterOptin",name:"customerCenterOptin",modelValue:e.settings.customerCenter.optIn,"onUpdate:modelValue":n[13]||(n[13]=t=>e.settings.customerCenter.optIn=t),labelTextActive:"Angemeldet",labelTextInactive:"Abgemeldet"},null,8,["modelValue"])]),n[14]||(n[14]=l("div",{class:"form-footer d-flex justify-content-between align-items-center"},[l("div",{class:"body-small"},[l("p",{class:"privacy--text"},[te("Informationen dazu, wie Ihre personenbezogenen Daten verarbeitet werden, finden Sie in unserer "),l("a",{target:"_blank",href:"https://www.meinauto.de/datenschutz/"},"Datenschutzrichtlinie.")])])],-1)),l("div",je,[i(T,{text:"Speichern",type:"button",disabled:e.changedSettings.length===0,onClick:e.submitPreferences},null,8,["disabled","onClick"])])])]))}const Ze=le(se,[["render",ze]]);export{Ze 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.