1import{_ as me}from"./NavigationBreadcrumbs.vue-BKPgvEFF.js";import{_ as pe}from"./UtilsSnackbar.vue-Bj0zn9NL.js";import{d as H,f as h,o as c,e as o,g as r,i as u,t as b,w as _,k as j,b as fe,h as E,r as g,c as w,p as ue,F as ve,u as t,a as k,R as ge,z as _e,V as he}from"./vendors-BEoIbp2n.js";import{x as G,b as be,c as K,aL as ye,aw as Ae,R as ke,y as xe}from"./entry-BamniLrv.js";import{_ as Pe}from"./InputsSelect.vue-CqvdytSf.js";import{_ as $e}from"./InputsTextFields.vue-CvQGDrks.js";import{_ as we}from"./AtomsMessageShort.vue-55k9RfMt.js";import{c as O}from"./countryPrefixes-Du7-KdUp.js";import{u as Ce}from"./useBrands-Df7JxWJQ.js";import"./MoleculesLinkWrapper.vue-CZGdusVi.js";import"./vue-dragscroll-6Jm3xeGP.js";import"./warning-DWCNyZ8j.js";import"./CreditCard-ED8PtmTw.js";import"./ShippingAndReturns-D-n4crj4.js";import"./Return-BD_XUy0A.js";import"./Returns-DtvNvweo.js";import"./Info-DfG6-BbT.js";const qe={class:"bg-primitives-off-white p-md gap-y-md text-primitives-black flex flex-col"},Se={class:"text-medium-5 flex flex-col justify-between md:flex-row"},ze={key:0,class:"text-light-5"},Re=H({__name:"MyAccountContactPreferences",props:{showRequired:{type:Boolean},title:{},isAllSelected:{type:Boolean}},emits:["selectAll","deselectAll"],setup(C){return(a,m)=>{const l=G;return c(),h("div",qe,[o("div",Se,[o("p",null,b(a.title),1),a.showRequired?(c(),h("span",ze," ("+b(a.$ts("fieldRequired"))+") ",1)):u("",!0)]),r(l,{"button-attrs":{type:"button"},anatomy:"link",class:"self-start",onClick:m[0]||(m[0]=R=>a.isAllSelected?a.$emit("deselectAll"):a.$emit("selectAll"))},{label:_(()=>[j(b(a.isAllSelected?a.$ts("myAccount.registration.contactPreferences.deSelectAll"):a.$ts("myAccount.registration.contactPreferences.selectAll")),1)]),_:1}),o("div",null,[fe(a.$slots,"default")])])}}}),Be=C=>C.split(" ").pop(),Ne={class:"relative"},Me={class:"gap-y-sm md:gap-y-md my-8 flex flex-col md:my-10 lg:my-14"},Te={class:"text-book-6 text-primitives-black"},De={class:"bg-primitives-white gap-y-sm md:gap-y-md flex flex-col p-4 md:p-6"},Fe={class:"gap-y-sm md:gap-y-md flex flex-col"},Ue={key:0},Ie={key:0,class:"gap-md flex items-end"},Le={class:"w-2/5"},Ee={class:"w-3/5"},Ke={key:0,class:"formkit-messages pointer-events-none list-none"},Oe={class:"formkit-message text-light-8 pointer-events-none mt-2 text-[red]","data-message-type":"validation"},He={class:"bg-primitives-white gap-y-sm md:gap-y-md flex flex-col p-4 md:p-6"},je={class:"markdown-text text-light-6 text-primitives-grey-200"},ct=H({__name:"contact",async setup(C){let a,m;const{ts:l}=be(),{profile:R,country:J}=K(),{customer:n,updateCustomerMetadata:Q}=([a,m]=E(()=>ke()),a=await a,m(),a),{getBrandAcronym:W}=ye(),{allBrands:q}=([a,m]=E(()=>Ce()),a=await a,m(),a),{privacyPolicy:X}=K(),p=g(!1),Y=[{label:l("myAccount.logged.shortcuts.profile"),url:R},{label:l("myAccount.logged.profileContent.contactPreferences")}],B=[{label:l("myAccount.registration.contactPreferences.marketingPurposesOptions.yes"),value:!0},{label:l("myAccount.registration.contactPreferences.marketingPurposesOptions.no"),value:!1}],y=w(()=>{var e,i,d;return((d=(i=(e=q==null?void 0:q.value)==null?void 0:e.content)==null?void 0:i.brands)==null?void 0:d.map(f=>({label:f.label,value:W(f.value)})))??[]}),S=[{label:l("myAccount.registration.contactPreferences.channel.newsletter"),value:"Email"},{label:l("myAccount.registration.contactPreferences.channel.phone"),value:"Phone"},{label:l("myAccount.registration.contactPreferences.channel.smsOrMms"),value:"SMS/MMS"},{label:l("myAccount.registration.contactPreferences.channel.chat"),value:"Chat"}],s=g({contact_authorization:(n==null?void 0:n.value.contactAuthorization)??!1,marketing_authorization:(n==null?void 0:n.value.marketingAuthorization)??!1,brands_preferences:n==null?void 0:n.value.brandPreference,channels_preferences:n==null?void 0:n.value.channelsPreference,prefix:n==null?void 0:n.value.prefix,phoneNumber:n==null?void 0:n.value.phoneNumber});ue(()=>n==null?void 0:n.value,e=>{s.value={contact_authorization:(e==null?void 0:e.contactAuthorization)??!1,marketing_authorization:(e==null?void 0:e.marketingAuthorization)??!1,brands_preferences:e==null?void 0:e.brandPreference,channels_preferences:e==null?void 0:e.channelsPreference,prefix:e==null?void 0:e.prefix,phoneNumber:e==null?void 0:e.phoneNumber}},{immediate:!0});const Z=()=>{s.value.brands_preferences=y.value.map(e=>e.value).filter(e=>e!==void 0),P.value=!1},V=w(()=>{var d,f;const e=(d=y==null?void 0:y.value)==null?void 0:d.length,i=(f=s.value.brands_preferences)==null?void 0:f.length;return e===i}),ee=()=>{s.value.channels_preferences=S.map(e=>e.value),P.value=!1},te=w(()=>{var d;const e=S.length,i=(d=s.value.channels_preferences)==null?void 0:d.length;return e===i}),ne=O.map(e=>({label:`${e==null?void 0:e.code} ${e==null?void 0:e.dial_code}`,value:`${e==null?void 0:e.code} ${e==null?void 0:e.dial_code}`})),ae=w(()=>O.filter(e=>
1e.code===J.toLocaleUpperCase())[0].dial_code),v=g(null),se=()=>{p.value=!1,v.value&&(clearTimeout(v.value),v.value=null)},x=g(!1),z=g(null),ie=async()=>{x.value||(x.value=!0,p.value=!0,v.value=setTimeout(()=>{p.value=!1},7e3),z.value=setTimeout(()=>{x.value=!1},8e3),Q(s.value,!1))},P=g(!1);return Ae({title:`${l("myAccount.logged.profileContent.contactPreferences")} | Armani`}),ve(()=>{v.value&&clearTimeout(v.value),z.value&&clearTimeout(z.value)}),(e,i)=>{const d=me,f=pe,A=ge,N=Re,le=Pe,oe=$e,re=we,ce=xe,de=G;return c(),h("div",Ne,[r(t(he),{"config-file":"true"},{default:_(()=>[o("div",Me,[r(d,{items:Y}),o("p",Te,b(e.$ts("myAccount.registration.contactPreferences.contactPreferencesTitlePage")),1)]),t(p)?(c(),k(f,{key:0,class:"sticky inset-x-0 top-6 z-50","is-feedback":"",message:e.$ts("myAccount.registration.contactPreferences.contactsUpdated"),"onUpdate:close":se},null,8,["message"])):u("",!0),t(n)?(c(),k(A,{key:1,id:"user-contact-preferences",modelValue:t(s),"onUpdate:modelValue":i[2]||(i[2]=$=>_e(s)?s.value=$:null),name:"user-contact-preferences",type:"form",actions:!1,"incomplete-message":!1,classes:{form:"gap-y-sm md:gap-y-md flex flex-col relative"},onSubmit:ie},{default:_(()=>{var $,M;return[o("div",De,[r(A,{name:"marketing_authorization",classes:{options:"flex gap-xl",label:"text-medium-5",legend:"text-light-6 font-light mb-6 text-primitives-black"},type:"myRadio",label:e.$ts("myAccount.registration.contactPreferences.marketingPurposesByChannel"),options:B,validation:"required","validation-messages":{required:e.$ts("fieldRequired")}},null,8,["label","validation-messages"]),($=t(s))!=null&&$.marketing_authorization?(c(),k(N,{key:0,title:e.$ts("myAccount.registration.contactPreferences.selectBrands"),"show-required":"","is-all-selected":t(V),onSelectAll:Z,onDeselectAll:i[0]||(i[0]=()=>{t(s).brands_preferences=[],P.value=!0})},{default:_(()=>[r(A,{type:"myCheckbox",name:"brands_preferences",options:t(y),validation:t(s).marketing_authorization&&t(s).brands_preferences?"required|min:1":"","validation-visibility":"submit","validation-messages":{required:e.$ts("contactPreferenceBrandsAndTopicsFieldRequired")},classes:{option:"text-medium-5 md:w-1/2",options:"flex flex-col md:flex-row md:flex-wrap gap-y-sm md:gap-y-md"}},null,8,["options","validation","validation-messages"])]),_:1},8,["title","is-all-selected"])):u("",!0),(M=t(s))!=null&&M.marketing_authorization?(c(),k(N,{key:1,title:e.$ts("myAccount.registration.contactPreferences.selectChannel"),"show-required":"","is-all-selected":t(te),onSelectAll:ee,onDeselectAll:i[1]||(i[1]=()=>{t(s).channels_preferences=[]})},{default:_(()=>{var T,D,F,U,I,L;return[o("fieldset",Fe,[r(A,{type:"myCheckbox",name:"channels_preferences",options:S,validation:t(s).marketing_authorization&&t(s).channels_preferences?"required|min:1":"","validation-visibility":"submit","validation-messages":{required:e.$ts("contactPreferenceFieldRequired")},classes:{option:"text-medium-5 md:w-1/2",options:"flex flex-col md:flex-wrap gap-y-sm md:gap-y-md"}},null,8,["validation","validation-messages"]),(D=(T=t(s))==null?void 0:T.channels_preferences)!=null&&D.includes("SMS/MMS")||(U=(F=t(s))==null?void 0:F.channels_preferences)!=null&&U.includes("Phone")?(c(),h("div",Ue,[(I=t(n))!=null&&I.phoneNumber?(c(),k(re,{key:1,class:"mt-2 w-full",icon:"info",text:e.$ts("myAccount.registration.contactPreferences.editPhoneNumberNotice")},null,8,["text"])):(c(),h("div",Ie,[o("div",Le,[r(le,{id:"prefix",label:e.$ts("myAccount.registration.personalInfo.prefix"),name:"prefix",validation:"required","validation-messages":{required:e.$ts("fieldRequired")},options:t(ne),value:(L=t(n))!=null&&L.prefix?("extractDialcode"in e?e.extractDialcode:t(Be))(t(n).prefix):t(ae)},null,8,["label","validation-messages","options","value"])]),o("div",Ee,[r(oe,{label:e.$ts("myAccount.registration.contactPreferences.channel.phoneNumber"),name:"phoneNumber",validation:"required","validation-messages":{required:e.$ts("fieldRequired")},type:"mask",mask:"{#|repeat}","show-mask":"false",autocomplete:"tel"},null,8,["label","validation-messages"])])]))])):u("",!0)]),t(P)?(c(),h("ul",Ke,[o("li",Oe,b(e.$ts("fieldRequired")),1)])):u("",!0)]}),_:1},8,["title","is-all-selected"])):u("",!0)]),o("div",He,[r(A,{name:"contact_authorization",classes:{options:"flex gap-xl",label:"text-medium-5",legend:"text-light-6 font-light mb-6 text-primitives-black"},type:"myRadio",label:e.$ts("myAccount.registration.contactPreferences.profilingConsentTextLabel"),options:B,validation:"required","validation-messages":{required:e.$ts("fieldRequired")}},null,8,["label","validation-messages"])]),o("div",je,[r(ce,{content:e.$ts("myAccount.registration.contactPreferences.privacyPolicy",{policy:t(l)("myAccount.registration.contactPreferences.privacyPolicyBold",{link:t(X)})})},null,8,["content"])]),r(de,{class:"mx-auto","button-attrs":{type:"submit"},success:!t(p)&&t(x),loading:t(p),disabled:t(p)},{label:_(()=>[j(b(e.$ts("save")),1)]),_:1},8,["success","loading","disabled"])]}),_:1},8,["modelValue"])):u("",!0)]),_:1})])}}});
1export{ct as default}; 2//# sourceMappingURL=contact-DtuSploZ.js.map
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.