1import{a as De}from"./chunk-IPINZA7D.js";import{a as Fe}from"./chunk-LSPRO44Y.js";import{a as Te}from"./chunk-QOZ4BDD3.js";import{b as Ne}from"./chunk-TEOJU564.js";import{c as O}from"./chunk-QDWNG7EU.js";import{a as Ie}from"./chunk-HTAQM2JG.js";import{a as ye}from"./chunk-46YXM6WT.js";import"./chunk-RYNJ2ZID.js";import"./chunk-Z2AEYF7J.js";import{a as q}from"./chunk-ARRYUDMY.js";import{a as z}from"./chunk-JPZKREEN.js";import"./chunk-II4ZMOIB.js";import"./chunk-YSBNZ2D4.js";import"./chunk-Q4KEB2AR.js";import{c as B}from"./chunk-GVDOXYUI.js";import"./chunk-EHIBENBU.js";import"./chunk-6OYEC3VN.js";import"./chunk-IKELL5US.js";import"./chunk-GFFPIZE2.js";import"./chunk-VYZSFR3D.js";import"./chunk-OSTPGULE.js";import"./chunk-KIOUS7YV.js";import{a as Ce}from"./chunk-JXMTAIBB.js";import{b as R}from"./chunk-LWUUEIQO.js";import{a as he}from"./chunk-ZFUIHNPN.js";import"./chunk-KJIUKXJ4.js";import"./chunk-BCT6AZ4D.js";import"./chunk-GBA5HQ3D.js";import"./chunk-L2XAKF7E.js";import"./chunk-ARHQJIEW.js";import"./chunk-J4G6UZTT.js";import{a as I}from"./chunk-SCJMMS4R.js";import"./chunk-N2OMGYSR.js";import"./chunk-GLB6FXVW.js";import"./chunk-7YDYSXNF.js";import"./chunk-PLWO6N5B.js";import"./chunk-NYVODJB2.js";import{Ug as Se,Ya as ve,Zj as be}from"./chunk-JWTTV2TH.js";import"./chunk-HKNOB5YZ.js";import{A as ge,z as de}from"./chunk-NGZBGJL5.js";import{J as fe,d as b,f as le,g as pe,j as x,m as ce,v as ue}from"./chunk-UBDARBLF.js";import{Aa as ne,Pa as ae,bd as se,fa as ie,vd as S,wd as me}from"./chunk-DM3NC7AB.js";import{$b as g,Bc as v,Cc as s,Dc as m,Ea as Z,Ec as M,Fa as Q,Hd as l,Ia as J,Id as c,Jb as i,Kd as ee,Ne as re,Oe as oe,Pc as D,Wb as n,X as d,_a as h,ac as X,d as H,e as F,ed as a,fd as A,gd as p,sc as N,uc as C,ve as te,w as W,wc as y,x as K,zd as P}from"./chunk-WVBH4ZDA.js";import"./chunk-YDOXD4O3.js";var f=class o{constructor(e){this.localStorage=e;
1this.customerFormDataSubject=new F(null);this.customerFormTriggerValidation=new H;this.customerFormErrorMsg=new F(!1);this.storeTrayNumber=new F(null);this.storeUserName=new F(null)}get customerFormData$(){return this.customerFormDataSubject.asObservable()}setCustomerFormData(e){this.customerFormDataSubject.next(e)}get customerFormSubmit$(){return this.customerFormTriggerValidation.asObservable()}triggerCustomerFormSubmit(e){this.customerFormTriggerValidation.next(e)}get customerFormErrorMsg$(){return this.customerFormErrorMsg.asObservable()}setCustomerFormErrorMsg(e){this.customerFormErrorMsg.next(e)}clearLocalStorageFittingTray(){this.localStorage.removeItem("fittingAddedTray"),this.localStorage.removeItem("productsAddedToTray"),this.localStorage.removeItem("variantAvailability")}get trayNumber$(){return this.storeTrayNumber.asObservable()}setTrayNumber(e){this.storeTrayNumber.next(e)}get userName$(){return this.storeUserName.asObservable()}setUserName(e){this.storeUserName.next(e)}static{this.\u0275fac=function(t){return new(t||o)(J(I))}}static{this.\u0275prov=Z({token:o,factory:o.\u0275fac,providedIn:"root"})}};var L=()=>["form-input-error","form-filled"],j=class o{constructor(e,t){this.customerDetailsService=e;this.translation=t;this.isVisible=h(!1);this.subscriptions$=[];this.validationMessages={};this.phoneNumberInputError=!1;this.phoneNumberErrorMsg="";this.phoneNumberInputField=Se;this.customerInfoForm=new pe({firstName:new x("",[b.required,b.pattern("^[A-Za-z]+$")]),lastName:new x("",[b.required,b.pattern("^[A-Za-z]+$")]),email:new x("",[b.required,b.pattern(ve)]),phone:new x("",[b.pattern("^[0-9]{3}-[0-9]{3}-[0-9]{4}$")])})}ngOnInit(){this.mapErrorFieldValidation(),this.customerDetailsService.customerFormSubmit$.subscribe(e=>{e&&this.onSubmit()})}mapErrorFieldValidation(){this.subscriptions$.push(K([this.translation.translate("shippingPageFormFields.checkoutaddressform.invalidFirstNamePickup"),this.translation.translate("shippingPageFormFields.checkoutaddressform.invalidlastNamePickup"),this.translation.translate("shippingPageFormFields.checkoutaddressform.invalidEmailFormat"),this.translation.translate("shippingPageFormFields.checkoutaddressform.invalidPhone")]).pipe(d(1),W(([e,t,r,u])=>{this.validationMessages={firstName:{required:e,pattern:e},lastName:{required:t,pattern:t},email:{required:r,pattern:r},phone:{pattern:u}}})).subscribe())}inputFormFieldValidation(e){e===this.phoneNumberInputField&&this.validatePhoneNumber(this.phoneNumberInputField)}validatePhoneNumber(e){let t=this.isPhoneValid(),r=this.checkError("customerInfoForm",e);this.phoneNumberInputError=t&&r,this.phoneNumberErrorMsg=this.errorMessage("customerInfoForm",e)}isPhoneValid(){let e=this.customerInfoForm.controls[this.phoneNumberInputField],t=!e.valid&&(e.dirty||e.touched)||!e.valid&&e.errors?.pattern;return this.phoneMask=t,t}checkError(e,t){return z.checkError(this.customerInfoForm,t)}errorMessage(e,t){return z.errorMessage(this.customerInfoForm,t,this.validationMessages)}onSubmit(){Object.values(this.customerInfoForm.controls).forEach(e=>e.markAsTouched()),this.customerInfoForm.valid&&this.customerDetailsService.setCustomerFormData(this.customerInfoForm.value)}getTranslationText(e){let t="",r=this.translation.translate(e).pipe(d(1)).subscribe(u=>{t=u});return this.subscriptions$.push(r),t}static{this.\u0275fac=function(t){return new(t||o)(n(f),n(se))}}static{this.\u0275cmp=g({type:o,selectors:[["app-customer"]],standalone:!1,decls:20,vars:59,consts:[[3,"ngSubmit","formGroup"],[1,"form-group","first-name-field"],[3,"type","required","formInputid","control","ngClass","hasError","errorContainerText","helperTextId","maxLength"],[1,"form-group","last-name-field"],[1,"form-group","email-field"],[1,"form-group","phone-number-field"],[3,"blurEvent","type","required","formInputid","phoneHyphenatedFormat","control","ngClass","hasError","errorContainerText"],[1,"optional-text"]],template:function(t,r){t&1&&(s(0,"form",0),D("ngSubmit",function(){return r.onSubmit()}),s(1,"div",1)(2,"app-amor-form-input",2),a(3),l(4,"cxTranslate"),m()(),s(5,"div",3)(6,"app-amor-form-input",2),a(7),l(8,"cxTranslate"),m()(),s(9,"div",4)(10,"app-amor-form-input",2),a(11),l(12,"cxTranslate"),m()(),s(13,"div",5)(14,"app-amor-form-input",6),D("blurEvent",function(){return r.inputFormFieldValidation("phone")}),a(15),l(16,"cxTranslate"),m(),s(17,"span",7),a(18),l(19,"cxTranslate"),m()()()),t&2&&(v("formGroup",r.customerInfoForm),i(2),v("type","text")("required",!0)("formInputid","firstName")("control",r.customerInfoForm.controls.firstName)("ngClass",P(55,L))("hasError",r.checkError("customerInfoForm","firstName"))("errorContainerText",r.errorMessage("customerInfoForm","firstName"))("helperTextId","")("maxLength",40),N("aria-describedby","formInputid-errors"),i(),p(" ",c(4,45,"login.firstNameLabel")," "),i(3),v("type","text")("required",!0)("formInputid","lastName")("control",r.customerInfoForm.controls.lastName)("ngClass",P(56,L))("hasError",r.checkError("customerInfoForm","lastName"))("errorContainerText",r.errorMessage("customerInfoForm","lastName"))("helperTextId","")("maxLength",40),N("aria-describedby","formInputid-errors"),i(),p(" ",c(8,47,"login.lastNameLabel")," "),i(3),v("type","email")("required",!0)("formInputid","email")("control",r.customerInfoForm.controls.email)("ngClass",P(57,L))("hasError",r.checkError("customerInfoForm","email"))("errorContainerText",r.errorMessage("customerInfoForm","email"))("helperTextId","")("maxLength",254),N("aria-describedby","formInputid-errors"),i(),p(" ",c(12,49,"login.emailAddressLabel")," "),i(3),v("type","text")("required",!1)("formInputid","phone")("phoneHyphenatedFormat",!0)("control",r.customerInfoForm.controls.phone)("ngClass",P(58,L))("hasError",r.phoneNumberInputError)("errorContainerText",r.phoneNumberErrorMsg),N("aria-describedby","formInputid-errors"),i(),p(" ",c(16,51,"storeFlyout.PhoneNumber")," "),i(3),p(" ",c(19,53,"storePDP.messageAndDataRates")," "))},dependencies:[te,B,ce,le,ue,S],encapsulation:2})}};var V=class o{constructor(e){this.customerDetailsService=e;this.trayNumber="";this.FITTING_TRAY="fittingAddedTray"}ngOnInit(){this.customerDetailsService.trayNumber$.subscribe(e=>{this.trayNumber=e||""})}static{this.\u0275fac=function(t){return new(t||o)(n(f))}}static{this.\u0275cmp=g({type:o,selectors:[["app-tray-number"]],standalone:!1,decls:6,vars:4,consts:[[1,"tray-number-box"],[1,"label"],[1,"value"]],template:function(t,r){t&1&&(s(0,"div",0)(1,"span",1),a(2),l(3,"cxTranslate"),m(),s(4,"span",2),a(5),m()()),t&2&&(i(2),p("",c(3,2,"storePDP.yourTrayNumberLabel"),":"),i(3),A(r.trayNumber))},dependencies:[S],encapsulation:2})}};function Me(o,e){o&1&&(a(0),l(1,"cxTranslate")),o&2&&p(" ",c(1,1,"storePDP.tryOnNowLabel")," ")}function Ae(o,e){o&1&&(a(0),l(1,"cxTranslate")),o&2&&p(" ",c(1,1,"storePDP.ContinueLabel")," ")}var U=class o{constructor(e,t,r,u,_){this.localStorage=e;this.storeRouteService=t;this.sotfHttpService=r;this.customerDetailsService=u;this.errorAlertService=_;this.buttonSize=he;this.trayID="";this.isDisabledButton=h(!1)}ngOnInit(){this.trayData=this.localStorage.getItem("fittingAddedTray"),this.trayData&&(this.trayID=this.trayData.trayId||"")}
1onStartTryOnClick(){this.customerDetailsService.triggerCustomerFormSubmit(!0),this.isDisabledButton.set(!0),this.customerDetailsService.customerFormData$.pipe(d(1)).subscribe(e=>{if(e){let t={firstName:e?.firstName,lastName:e?.lastName,email:e?.email,phone:e?.phone};if(this.localStorage.setItem("customerDetails",t),this.trayID!==""){let r={trayStatus:"SUBMIT",customerName:e?.firstName+" "+e?.lastName,email:e?.email,phone:e?.phone,storeId:this.trayData?.storeId};this.sotfHttpService.updateFittingTray(this.trayID,r).pipe(d(1)).subscribe({next:u=>{u?.errors?(this.errorAlertService.setTriggeredErrorAlert(!0),this.isDisabledButton.set(!1)):this.storeRouteService.setConfirmationSlotPage("confirmationPage"),this.isDisabledButton.set(!1)},error:()=>{this.isDisabledButton.set(!1),this.errorAlertService.setTriggeredErrorAlert(!0)}})}else this.storeRouteService.setConfirmationSlotPage("almostTherePage")}else this.isDisabledButton.set(!1)})}static{this.\u0275fac=function(t){return new(t||o)(n(I),n(O),n(Te),n(f),n(Ie))}}static{this.\u0275cmp=g({type:o,selectors:[["app-confirmation-try-button"]],standalone:!1,decls:5,vars:5,consts:[[1,"start-tryon-btn-container"],[1,"btn-container"],[3,"buttonClick","disabled","buttonSize","buttonPrimary","buttonType"]],template:function(t,r){t&1&&(s(0,"div",0)(1,"div",1)(2,"app-amor-button",2),D("buttonClick",function(){return r.onStartTryOnClick()}),C(3,Me,2,3)(4,Ae,2,3),m()()()),t&2&&(i(2),v("disabled",r.isDisabledButton())("buttonSize",r.buttonSize.fullWidth)("buttonPrimary",!0)("buttonType","primary"),i(),y(r.trayID!==""?3:4))},dependencies:[R,S],styles:[".start-tryon-btn-container[_ngcontent-%COMP%]{z-index:100;display:flex;padding:16px 15px;justify-content:center;align-items:center;flex-shrink:0;position:fixed;bottom:0;left:0;right:0}.start-tryon-btn-container[_ngcontent-%COMP%] .btn-container[_ngcontent-%COMP%]{width:100%}"]})}};function Re(o,e){o&1&&M(0,"cx-page-slot",0)(1,"cx-page-slot",1)(2,"cx-page-slot",2)}function Be(o,e){o&1&&M(0,"cx-page-slot",3)(1,"cx-page-slot",2)}function Oe(o,e){o&1&&M(0,"cx-page-slot",4)(1,"cx-page-slot",2)}var $=class o{constructor(e,t,r,u,_,Le){this.storeRouteService=e;this.localStorage=t;this.customerDetailsService=r;this.windowRef=u;this.trayFillService=_;this.baseSiteService=Le;this.isPageSlotVisible=h("customerInfoPage");this.fittingTrayAction=q}ngOnInit(){this.baseSiteService.get().pipe(d(1)).subscribe({next:e=>{e?.signetSiteProperties?.isSotfMagicLoupeEnabled?this.setPageSlotVisible():this.storeRouteService.goToUnAvailableServicePage()},error:()=>{this.storeRouteService.goToUnAvailableServicePage()}})}setPageSlotVisible(){let e=this.localStorage.getItem("fittingAddedTray")?.productTrayCount;if(!(e&&e>0)){this.redirectToTrayPage();return}let t=this.localStorage.getItem("pageSlotStatus");this.storeRouteService.getConfirmationSlotPage().subscribe(r=>{let u=this.localStorage.getItem("fittingAddedTray")?.trayNumber;if(t&&(r=t,this.localStorage.removeItem("pageSlotStatus")),r==="confirmationPage"){this.customerDetailsService.setTrayNumber(u?.toString()??null);let _=this.localStorage.getItem("customerDetails");_&&this.customerDetailsService.setUserName(_.firstName||""),this.trayFillService.dispatchTrayEvent(be),setTimeout(()=>{this.localStorage.removeItem("customerDetails"),this.customerDetailsService.clearLocalStorageFittingTray()},2e3)}this.isPageSlotVisible.set(r),this.scrollToTop()})}redirectToTrayPage(){this.storeRouteService.goTrayPage()}scrollToTop(){this.windowRef.nativeWindow?.scrollTo(0,0)}static{this.\u0275fac=function(t){return new(t||o)(n(O),n(I),n(f),n(ne),n(De),n(ae))}}static{this.\u0275cmp=g({type:o,selectors:[["app-confirmation-routing"]],standalone:!1,decls:3,vars:3,consts:[["position","CustomerInfoSlot"],["position","PrivacyPolicyAndTermsSlot"],["position","PrivacyPolicySlotConfirmationPage"],["position","ConfirmationPageSlot"],["position","AlmostThereTextSlot"]],template:function(t,r){t&1&&(C(0,Re,3,0),C(1,Be,2,0),C(2,Oe,2,0)),t&2&&(y(r.isPageSlotVisible()===r.fittingTrayAction.customerInfoPage?0:-1),i(),y(r.isPageSlotVisible()===r.fittingTrayAction.confirmationPage?1:-1),i(),y(r.isPageSlotVisible()===r.fittingTrayAction.almostTherePage?2:-1))},dependencies:[de],encapsulation:2})}};var G=class o{constructor(e){this.customerDetailsService=e;this.userName=""}ngOnInit(){this.customerDetailsService.userName$.pipe(d(1)).subscribe(e=>{this.userName=e||""})}static{this.\u0275fac=function(t){return new(t||o)(n(f))}}static{this.\u0275cmp=g({type:o,selectors:[["app-confirmation-user-name"]],standalone:!1,decls:8,vars:8,consts:[[1,"confirmationLabel"],[1,"body-Name"],[1,"user-name"]],template:function(t,r){t&1&&(s(0,"div",0)(1,"p",1),a(2),l(3,"cxTranslate"),s(4,"span",2),a(5),l(6,"slice"),m(),a(7,"!"),m()()),t&2&&(i(2),p("",c(3,2,"storePDP.confirmationLabel")," "),i(3),A(ee(6,4,r.userName,0,18)))},dependencies:[re,S],encapsulation:2})}};var xe=class o{static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275mod=X({type:o})}static{this.\u0275inj=Q({providers:[ie({cmsComponents:{CustomerNameFlexComponent:{component:j},TrayNumberFlexComponent:{component:V},ConfirmationTryButtonFlexComponent:{component:U},ConfirmationBottomScannerImageFlexComponent:{component:Fe},ConfirmationRoutingFlexComponent:{component:$},SelectionSetFlexComponent:{component:G}}})],imports:[Ne,oe,ye,Ce,R,me,ge,B,fe]})}};export{xe as ConfirmationModule};
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.