PageSourceSearch

https://www.globkurier.pl/default-src_order_order_module_ts.71335bd59d376674.js

js globkurier.pl collected 2026-09-24 19:02:37 UTC 857,082 bytes, 1 lines download raw bytes

1(self.webpackChunkariadna=self.webpackChunkariadna||[]).push([["default-src_order_order_module_ts"],{42903:(G,k,s)=>{"use strict";s.d(k,{z:()=>U});var e=s(84320),l=s(54438),v=s(89417),C=s(61486),b=s(51188),f=s(21413),R=s(5964),_=s(56977),P=s(79808),S=s(96458),y=s(60635),E=s(73955),I=s(56089),D=s(14704),x=s(45170),L=s(59640),$=s(99952);const Y=()=>["/register"],Q=()=>["/password-reset"];function ae(q,j){if(1&q&&(l.j41(0,"p",10),l.EFF(1),l.k0s()),2&q){const B=l.XpG();l.R7$(),l.SpI(" ",B.validationErrors.general," ")}}function re(q,j){if(1&q){const B=l.RV6();l.j41(0,"button",29),l.bIt("click",function(){l.eBV(B);const X=l.XpG();return l.Njj(X.windowService.nativeWindow.location.assign("/"))}),l.j41(1,"i",30),l.EFF(2,"\xa0"),l.k0s(),l.EFF(3),l.nI1(4,"translate"),l.k0s()}2&q&&(l.R7$(3),l.SpI(" ",l.bMT(4,1,"COMMON.BACK")," "))}let U=(()=>{class q{constructor(B,M,X,J,F,T){this.config=B,this.windowService=M,this.formBuilder=X,this.store=J,this.route=F,this.cookieService=T,this.redirectUrl=(0,l.geq)(null),this.showReturnButton=(0,l.hFB)(!1),this.loginSuccess=(0,l.CGW)(),this.allegroCredentialsForm=new v.gE({}),this.googleCredentialsForm=new v.gE({}),this.unsubscribeObservable=new f.B,this.initCredentials(),this.validationErrors=this.getInitValidationErrors(),this.store.select(S.ng).pipe((0,R.p)(ue=>!!ue)).subscribe(ue=>{this.validationErrors=ue.authorization?ue.authorization.validationErrors:this.getInitValidationErrors()})}ngOnInit(){this.cookieService.remove("blocked-account-message"),this.route.snapshot.queryParams.returnUrl&&this.redirectUrl.set(this.route.snapshot.queryParams.returnUrl)}initCredentials(){this.credentialsForm=this.formBuilder.group({email:["",v.k0.compose([v.k0.required,v.k0.pattern(y.gM)])],password:["",v.k0.compose([v.k0.required,v.k0.minLength(6)])]})}clearValidationErrors(){this.validationErrors&&(this.validationErrors=this.getInitValidationErrors())}getInitValidationErrors(){return{fields:{email:"",password:""},general:[]}}onSubmit(){this.store.dispatch(C.v.createLoginAction(this.credentialsForm.value.email,this.credentialsForm.value.password,this.redirectUrl())),this.store.dispatch(e.U.createResetProductFiltersAction()),this.store.select(S.ng).pipe((0,R.p)(B=>!!B),(0,_.Q)(this.unsubscribeObservable)).subscribe(B=>{B&&B?.authorization?.isLoggedIn&&(this.loginSuccess.emit(),this.unsubscribeObservable.next(),this.unsubscribeObservable.complete())})}ngOnDestroy(){this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}static{this.\u0275fac=function(M){return new(M||q)(l.rXU(P.vQ),l.rXU(x.s),l.rXU(v.ok),l.rXU(L.il),l.rXU(b.nX),l.rXU($.O1))}}static{this.\u0275cmp=l.VBU({type:q,selectors:[["ardn-login-form"]],inputs:{redirectUrl:[1,"redirectUrl"],showReturnButton:[1,"showReturnButton"]},outputs:{redirectUrl:"redirectUrlChange",loginSuccess:"loginSuccess"},standalone:!0,features:[l.aNF],decls:57,vars:58,consts:[["allegroForm",""],["googleForm",""],["novalidate","",1,"form","align-left",3,"ngSubmit","formGroup"],[1,"form__privileges-part"],[1,"field"],["for","email",1,"label",3,"ardnDataTestId"],["formControlName","email","id","email","type","email",1,"input",3,"keyup","ardnDataTestId"],[3,"clientSideValidation","serverSideValidation","clientErrorMessage","ardnDataTestId"],["for","password",1,"label",3,"ardnDataTestId"],["formControlName","password","id","password","type","password",1,"input",3,"keyup","ardnDataTestId"],[1,"form-error"],[1,"field","align-center"],["id","login-button","type","submit",1,"btn","btn--block","btn--primary",3,"ardnDataTestId"],["method","post",3,"formGroup","action"],["type","hidden","name","token"],["type","hidden","name","lang","value","pl"],["type","hidden","name","successReturnLink",3,"value"],["type","hidden","name","failedReturnLink",3,"value"],["id","login-via-allegro-button",1,"btn","btn--block","btn--alternative","btn__allegro",3,"click","ardnDataTestId"],[1,"login-icon"],["src","assets/img/logos/allegro-icon.png"],[1,"login-text"],["id","login-via-google-button",1,"btn","btn--block","btn--alternative","btn__google",3,"click","ardnDataTestId"],["src","assets/img/logos/google-icon.png"],[1,"field","align-center","font-size-small"],[3,"routerLink"],[1,"link",3,"routerLink"],[1,"field","align-left","font-size-small","return-mobile"],["type","button",1,"return-btn"],["type","button",1,"return-btn",3,"click"],[1,"fa","fa-angle-left","return-arrow"]],template:function(M,X){if(1&M){const J=l.RV6();l.j41(0,"form",2),l.bIt("ngSubmit",function(){return l.eBV(J),l.Njj(X.onSubmit())}),l.j41(1,"div",3)(2,"div",4)(3,"label",5),l.EFF(4),l.nI1(5,"translate"),l.k0s(),l.j41(6,"input",6),l.bIt("keyup",function(){return l.eBV(J),l.Njj(X.clearValidationErrors())}),l.k0s(),l.nrm(7,"ardn-field-validator",7),l.k0s(),l.j41(8,"div",4)(9,"label",8),l.EFF(10),l.nI1(11,"translate"),l.k0s(),l.j41(12,"input",9),l.bIt("keyup",function(){return l.eBV(J),l.Njj(X.clearValidationErrors())}),l.k0s(),l.nrm(13,"ardn-field-validator",7),l.k0s()(),l.DNE(14,ae,2,1,"p",10),l.j41(15,"div",11)(16,"button",12),l.EFF(17),l.nI1(18,"translate"),l.k0s()()(),l.j41(19,"div",11)(20,"form",13,0),l.nrm(22,"input",14)(23,"input",15)(24,"input",16)(25,"input",17),l.k0s(),l.j41(26,"button",18),l.bIt("click",function(){l.eBV(J);
1const T=l.sdS(21);return l.Njj(T.submit())}),l.j41(27,"div",19),l.nrm(28,"img",20),l.k0s(),l.j41(29,"div",21),l.EFF(30),l.nI1(31,"translate"),l.k0s()()(),l.j41(32,"div",11)(33,"form",13,1),l.nrm(35,"input",14)(36,"input",15)(37,"input",16)(38,"input",17),l.k0s(),l.j41(39,"button",22),l.bIt("click",function(){l.eBV(J);const T=l.sdS(34);return l.Njj(T.submit())}),l.j41(40,"div",19),l.nrm(41,"img",23),l.k0s(),l.j41(42,"div",21),l.EFF(43),l.nI1(44,"translate"),l.k0s()()(),l.j41(45,"div",24),l.EFF(46),l.nI1(47,"translate"),l.j41(48,"a",25),l.EFF(49),l.nI1(50,"translate"),l.k0s()(),l.j41(51,"div",24)(52,"a",26),l.EFF(53),l.nI1(54,"translate"),l.k0s()(),l.j41(55,"div",27),l.DNE(56,re,5,3,"button",28),l.k0s()}2&M&&(l.Y8G("formGroup",X.credentialsForm),l.R7$(3),l.Y8G("ardnDataTestId","ardn-login-form-email-label"),l.R7$(),l.JRh(l.bMT(5,40,"COMMON.USERNAME")),l.R7$(2),l.Y8G("ardnDataTestId","ardn-login-form-email-input"),l.R7$(),l.Y8G("clientSideValidation",X.credentialsForm.get("email"))("serverSideValidation",null==X.validationErrors||null==X.validationErrors.fields?null:X.validationErrors.fields.email)("clientErrorMessage","COMMON.ERRORS.EMAIL_CONTENT")("ardnDataTestId","ardn-login-form-email-field-validator"),l.R7$(2),l.Y8G("ardnDataTestId","ardn-login-form-password-label"),l.R7$(),l.JRh(l.bMT(11,42,"COMMON.PASSWORD")),l.R7$(2),l.Y8G("ardnDataTestId","ardn-login-form-password-input"),l.R7$(),l.Y8G("clientSideValidation",X.credentialsForm.get("password"))("serverSideValidation",null==X.validationErrors||null==X.validationErrors.fields?null:X.validationErrors.fields.password)("clientErrorMessage","COMMON.ERRORS.TOO_SHORT")("ardnDataTestId","ardn-login-form-password-field-validator"),l.R7$(),l.vxM(null!=X.validationErrors&&X.validationErrors.general?14:-1),l.R7$(2),l.Y8G("ardnDataTestId","ardn-login-form-submit-button"),l.R7$(),l.SpI(" ",l.bMT(18,44,"COMMON.LOGIN")," "),l.R7$(3),l.Y8G("formGroup",X.allegroCredentialsForm)("action",X.config.apiURL+"auth/login/allegro",l.B4B),l.R7$(4),l.Mz_("value","",X.windowService.nativeWindow.location.origin,"/dashboard-new"),l.R7$(),l.Mz_("value","",X.windowService.nativeWindow.location.origin,"/"),l.R7$(),l.Y8G("ardnDataTestId","ardn-login-form-submit-allegro-button"),l.R7$(4),l.SpI(" ",l.bMT(31,46,"COMMON.LOGIN_ALLEGRO")," "),l.R7$(3),l.Y8G("formGroup",X.allegroCredentialsForm)("action",X.config.apiURL+"auth/login/google",l.B4B),l.R7$(4),l.Mz_("value","",X.windowService.nativeWindow.location.origin,"/dashboard-new"),l.R7$(),l.Mz_("value","",X.windowService.nativeWindow.location.origin,"/google/"),l.R7$(),l.Y8G("ardnDataTestId","ardn-login-form-submit-google-button"),l.R7$(4),l.SpI(" ",l.bMT(44,48,"COMMON.LOGIN_GOOGLE")," "),l.R7$(3),l.SpI(" ",l.bMT(47,50,"COMMON.REGISTER_NEED")," "),l.R7$(2),l.Y8G("routerLink",l.lJ4(56,Y)),l.R7$(),l.JRh(l.bMT(50,52,"COMMON.REGISTER")),l.R7$(3),l.Y8G("routerLink",l.lJ4(57,Q)),l.R7$(),l.JRh(l.bMT(54,54,"COMMON.LOST_PASSWORD")),l.R7$(3),l.vxM(X.showReturnButton()?-1:56))},dependencies:[v.YN,v.qT,v.me,v.BC,v.cb,v.X1,v.j4,v.JD,I.Q,E.h,E.D9,D.Z,b.Wk],styles:[".form-error[_ngcontent-%COMP%]{margin:5px 0 10px!important}.form__privileges-part[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{margin-bottom:0}.btn__google[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]{background-color:#fff;border-color:#c8c7c7;border-width:2px;color:#000;display:flex;align-items:center;justify-content:center;padding:0}@media only screen and (min-width: 340px) and (max-width: 1190px){.btn__google[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]{line-height:1.1;text-align:center;padding:2px}}.btn__google[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%]{margin-right:10px;padding-right:10px;display:flex;place-content:center center;scale:80%;padding-left:10px}@media only screen and (min-width: 1025px) and (max-width: 1110px){.btn__google[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%]{padding-right:0;padding-left:15px}}@media only screen and (min-width: 1111px) and (max-width: 1156px){.btn__google[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%]{padding-right:15px;padding-left:25px}}.btn__google[_ngcontent-%COMP%]   .login-text[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]   .login-text[_ngcontent-%COMP%]{padding-right:10px}@media only screen and (min-width: 1111px) and (max-width: 1156px){.btn__google[_ngcontent-%COMP%]   .login-text[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]   .login-text[_ngcontent-%COMP%]{padding-right:25px}}.return-arrow[_ngcontent-%COMP%]{color:#96c21f}.return-btn[_ngcontent-%COMP%]{border:none;color:#000;cursor:pointer;display:inline-block}@media (max-width: 640px){.return-mobile[_ngcontent-%COMP%]{width:88px}}"]})}}return q})()}
1,45713:(G,k,s)=>{"use strict";s.d(k,{P:()=>l});var e=s(49969);const l=(0,e.hZ)("slideInOut",[(0,e.kY)(":enter",[(0,e.iF)({opacity:0}),(0,e.i0)("200ms ease-in",(0,e.iF)({opacity:1}))]),(0,e.kY)(":leave",[(0,e.iF)({opacity:1}),(0,e.i0)("200ms ease-out",(0,e.iF)({opacity:0}))])])},60448:(G,k,s)=>{"use strict";s.d(k,{m:()=>_});var e=s(54438),l=s(89079),v=s(89417),C=s(70152),b=s(5964),f=s(25399),R=s(31576);let _=(()=>{class P{constructor(y,E,I){this.formBuilder=y,this.scrollService=E,this.countryService=I,this.validityChanged=(0,e.CGW)(),this.readonlyFields=(0,e.hFB)([]),this.serverSideValidationErrors=(0,e.geq)({fields:{},general:[]}),this.notValidateDisabled=(0,e.hFB)(!1),this.isValid=null,this.destroyRef=(0,e.WQX)(e.abz),this.onChange=()=>{},this.onTouched=()=>{},this.addressDataForm=this.formBuilder.group({})}initUserDataForm(){this.addressDataForm=this.getFormFields(),this.addressDataForm.get("type")&&this.addConditionalValidationForCompanyFields(),this.addPostCodeValidation(),this.addressDataForm.valueChanges.pipe((0,C.B)(10),(0,l.pQ)(this.destroyRef)).subscribe(y=>{this.onChange(y),this.validityChanged?.emit(this.addressDataForm.valid)})}addPostCodeValidation(){this.addressDataForm.get("countryId")?.valueChanges.pipe((0,b.p)(y=>!!y),(0,l.pQ)(this.destroyRef)).subscribe(y=>{this.countryService.getCountryCached(y).subscribe(E=>{E?.hasPostCodes?this.addressDataForm.get("postCode")?.setValidators(v.k0.compose([v.k0.required,v.k0.minLength(2)])):this.addressDataForm.get("postCode").clearValidators(),this.addressDataForm.get("postCode")?.updateValueAndValidity()})})}addConditionalValidationForCompanyFields(){this.addressDataForm.get("type").valueChanges.pipe((0,l.pQ)(this.destroyRef)).subscribe(y=>{"COMPANY"===y?(this.addressDataForm.get("nip").setValidators(v.k0.compose([v.k0.required,v.k0.minLength(2)])),this.addressDataForm.get("companyName").setValidators(v.k0.compose([v.k0.required,v.k0.minLength(1)]))):(this.addressDataForm.get("nip").clearValidators(),this.addressDataForm.get("companyName").clearValidators()),this.addressDataForm.get("nip").updateValueAndValidity(),this.addressDataForm.get("companyName").updateValueAndValidity()})}ngOnInit(){this.initUserDataForm(),this.disableReadonlyFields()}disableReadonlyFields(){for(const y of this.readonlyFields())this.addressDataForm.get(y)&&this.addressDataForm.get(y).disable()}writeValue(y){null!==y&&this.addressDataForm.patchValue(y)}registerOnChange(y){this.onChange=y}registerOnTouched(y){this.onTouched=y}isCompany(){return this.addressDataForm.get("type")&&"COMPANY"===this.addressDataForm.get("type").value}validateForm(y){const E=[];return Object.keys(this.addressDataForm.controls).forEach(I=>{this.addressDataForm.get(I).markAsTouched({onlySelf:!0}),E.push(I)}),this.scrollService.findInvalidFieldAndScroll(E,this.addressDataForm,y)}getAddressDataForm(){return this.addressDataForm}static{this.\u0275fac=function(E){return new(E||P)(e.rXU(v.ok),e.rXU(f.b),e.rXU(R.o))}}static{this.\u0275dir=e.FsC({type:P,inputs:{readonlyFields:[1,"readonlyFields"],serverSideValidationErrors:[1,"serverSideValidationErrors"],notValidateDisabled:[1,"notValidateDisabled"]},outputs:{validityChanged:"validityChanged",serverSideValidationErrors:"serverSideValidationErrorsChange"}})}}return P})()},90195:(G,k,s)=>{"use strict";s.d(k,{z:()=>Bt});var e=s(54438),l=s(89417),v=s(45713),C=s(60448),b=s(60635),f=s(79808),R=s(73955),_=s(21413),P=s(93207),S=s(70152),y=s(96697),E=s(60177),I=s(14704),D=s(29952),x=s.n(D),L=s(41623),$=s(84412);const Y={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-4
16-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|[24-689])\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|33|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4}
1)","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-4
vendor: 10,694 bytes, line 1
1])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|31)"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-35])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-
15])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2
1-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}",[6,7,8,9,10,11]],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2
1-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[259]\\d{6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[0135-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[245]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","38\\d{6}|[78]\\d{9,13}|(?:20|9\\d)\\d{8}",[8,10,11,12,13,14],[["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["3"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7}
1)","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-5]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|77|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4}
1)","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[468]))\\d{4}|(?:305[3-9]|472[24]|505[2-57-9]|983[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[6,7,8,9,10,11,12,13],[["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4}
1)","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function Q(a,c){var d=Array.prototype.slice.call(c);return d.push(Y),a.apply(this,d)}var ae={}.constructor;function re(a){return null!=a&&a.constructor===ae}function U(a,c){var d=Object.keys(a);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(a);c&&(h=h.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),d.push.apply(d,h)}return d}function j(a,c,d){return c in a?Object.defineProperty(a,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[c]=d,a}function J(a,c){(null==c||c>a.length)&&(c=a.length);for(var d=0,h=new Array(c);d<c;d++)h[d]=a[d];return h}function ue(a){var K,le,se,d=function B(a,c){return function T(a){if(Array.isArray(a))return a}(a)||function F(a,c){var d=null==a?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(null!=d){var W,K,h=[],O=!0,V=!1;try{for(d=d.call(a);!(O=(W=d.next()).done)&&(h.push(W.value),!c||h.length!==c);O=!0);}catch(le){V=!0,K=le}finally{try{!O&&null!=d.return&&d.return()}finally{if(V)throw K}}return h}}(a,c)||function X(a,c){if(a){if("string"==typeof a)return J(a,c);var d=Object.prototype.toString.call(a).slice(8,-1);if("Object"===d&&a.constructor&&(d=a.constructor.name),"Map"===d||"Set"===d)return Array.from(a);if("Arguments"===d||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return J(a,c)}}(a,c)||function M(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Array.prototype.slice.call(a),4),h=d[0],O=d[1],V=d[2],W=d[3];if("string"!=typeof h)throw new TypeError("A text for parsing must be a string.");if(K=h,O&&"string"!=typeof O){if(!re(O))throw new Error("Invalid second argument: ".concat(O));V?(le=O,se=V):se=O}else W?(le=V,se=W):(le=void 0,se=V),O&&(le=function q(a){for(var c=1;c<arguments.length;c++){var d=null!=arguments[c]?arguments[c]:{};c%2?U(Object(d),!0).forEach(function(h){j(a,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(d)):U(Object(d)).forEach(function(h){Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(d,h))})}return a}({defaultCountry:O},le));return{text:K,options:le,metadata:se}}var Ve=2,Be=17,Ke=3,Ce="0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9",ee="".concat("-\u2010-\u2015\u2212\u30fc\uff0d").concat("\uff0f/").concat("\uff0e.").concat(" \xa0\xad\u200b\u2060\u3000").concat("()\uff08\uff09\uff3b\uff3d\\[\\]").concat("~\u2053\u223c\uff5e");function Z(a){return(Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(a)}function he(a,c){for(var d=0;d<c.length;d++){var h=c[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(a,h.key,h)}}function Ie(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function et(a){var c="function"==typeof Map?new Map:void 0;return et=function(h){if(null===h||!function ye(a){return-1!==Function.toString.call(a).indexOf("[native code]")}(h))return h;if("function"!=typeof h)throw new TypeError("Super expression must either be null or a function");if(typeof c<"u"){if(c.has(h))return c.get(h);c.set(h,O)}function O(){return ce(h,arguments,Xe(this).constructor)}return O.prototype=Object.create(h.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),xe(O,h)},et(a)}function ce(a,c,d){return(ce=me()?Reflect.construct:function(O,V,W){var K=[null];
1K.push.apply(K,V);var se=new(Function.bind.apply(O,K));return W&&xe(se,W.prototype),se}).apply(null,arguments)}function me(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xe(a,c){return(xe=Object.setPrototypeOf||function(h,O){return h.__proto__=O,h})(a,c)}function Xe(a){return(Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(d){return d.__proto__||Object.getPrototypeOf(d)})(a)}var pe=function(a){!function Te(a,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(c&&c.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),c&&xe(a,c)}(d,a);var c=function Oe(a){var c=me();return function(){var O,h=Xe(a);if(c){var V=Xe(this).constructor;O=Reflect.construct(h,arguments,V)}else O=h.apply(this,arguments);return function qe(a,c){if(c&&("object"===Z(c)||"function"==typeof c))return c;if(void 0!==c)throw new TypeError("Derived constructors may only return object or undefined");return Ie(a)}(this,O)}}(d);function d(h){var O;return function _e(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function")}(this,d),O=c.call(this,h),Object.setPrototypeOf(Ie(O),d.prototype),O.name=O.constructor.name,O}return function oe(a,c,d){return c&&he(a.prototype,c),d&&he(a,d),Object.defineProperty(a,"prototype",{writable:!1}),a}(d)}(et(Error));function tt(a,c){a=a.split("-"),c=c.split("-");for(var d=a[0].split("."),h=c[0].split("."),O=0;O<3;O++){var V=Number(d[O]),W=Number(h[O]);if(V>W)return 1;if(W>V)return-1;if(!isNaN(V)&&isNaN(W))return 1;if(isNaN(V)&&!isNaN(W))return-1}return a[1]&&c[1]?a[1]>c[1]?1:a[1]<c[1]?-1:0:!a[1]&&c[1]?1:a[1]&&!c[1]?-1:0}function Se(a){return(Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(a)}function H(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function")}function ie(a,c){for(var d=0;d<c.length;d++){var h=c[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(a,h.key,h)}}function fe(a,c,d){return c&&ie(a.prototype,c),d&&ie(a,d),Object.defineProperty(a,"prototype",{writable:!1}),a}var zt=/^\d+$/,Pe=function(){function a(c){H(this,a),function De(a){if(!a)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!re(a)||!re(a.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(re(a)?"an object of shape: { "+Object.keys(a).join(", ")+" }":"a "+Yn(a)+": "+a,"."))}(c),this.metadata=c,Kt.call(this,c)}return fe(a,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(d){return"001"!==d})}},{key:"getCountryMetadata",value:function(d){return this.metadata.countries[d]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(d){return void 0!==this.getCountryMetadata(d)}},{key:"hasCallingCode",value:function(d){if(this.getCountryCodesForCallingCode(d))return!0;if(this.nonGeographic()){if(this.nonGeographic()[d])return!0}else{var h=this.countryCallingCodes()[d];if(h&&1===h.length&&"001"===h[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(d){return this.nonGeographic()?!!this.nonGeographic()[d]:!this.getCountryCodesForCallingCode(d)}},{key:"country",value:function(d){return this.selectNumberingPlan(d)}},{key:"selectNumberingPlan",value:function(d,h){if(d&&zt.test(d)&&(h=d,d=null),d&&"001"!==d){if(!this.hasCountry(d))throw new Error("Unknown country: ".concat(d));this.numberingPlan=new Tt(this.getCountryMetadata(d),this)}else if(h){if(!this.hasCallingCode(h))throw new Error("Unknown calling code: ".concat(h));this.numberingPlan=new Tt(this.getNumberingPlanMetadata(h),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(d){var h=this.countryCallingCodes()[d];if(h)return 1===h.length&&3===h[0].length?void 0:h}},{key:"getCountryCodeForCallingCode",value:function(d){var h=this.getCountryCodesForCallingCode(d);if(h)return h[0]}},{key:"getNumberingPlanMetadata",value:function(d){var h=this.getCountryCodeForCallingCode(d);if(h)return this.getCountryMetadata(h);if(this.nonGeographic()){var O=this.nonGeographic()[d];if(O)return O}else{var V=this.countryCallingCodes()[d];if(V&&1===V.length&&"001"===V[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(d){return this.numberingPlan.type(d)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(d){return this.selectNumberingPlan(d)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}]),a}(),Tt=function(){function a(c,d){H(this,a),this.globalMetadataObject=d,this.metadata=c,Kt.call(this,d.metadata)}return fe(a,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(d){return d[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var d=this;return(this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[]).map(function(O){return new Xn(O,d)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(d){return d[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return!(this.types()&&0===this.types().length||!this.t
vendor: 1,366 bytes, line 1
1ypes())}},{key:"type",value:function(d){if(this.hasTypes()&&ve(this.types(),d))return new z(ve(this.types(),d),this)}},{key:"ext",value:function(){return this.v1||this.v2?" ext. ":this.metadata[13]||" ext. "}}]),a}(),Xn=function(){function a(c,d){H(this,a),this._format=c,this.metadata=d}return fe(a,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||ut.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),a}(),ut=/^\(?\$1\)?$/,z=function(){function a(c,d){H(this,a),this.type=c,this.metadata=d}return fe(a,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.t
1ype[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),a}();function ve(a,c){switch(c){case"FIXED_LINE":return a[0];case"MOBILE":return a[1];case"TOLL_FREE":return a[2];case"PREMIUM_RATE":return a[3];case"PERSONAL_NUMBER":return a[4];case"VOICEMAIL":return a[5];case"UAN":return a[6];case"PAGER":return a[7];case"VOIP":return a[8];case"SHARED_COST":return a[9]}}var Yn=function(c){return Se(c)};function It(a,c){if((c=new Pe(c)).hasCountry(a))return c.country(a).countryCallingCode();throw new Error("Unknown country: ".concat(a))}function Kt(a){var c=a.version;"number"==typeof c?(this.v1=1===c,this.v2=2===c,this.v3=3===c,this.v4=4===c):c?-1===tt(c,"1.2.0")?this.v2=!0:-1===tt(c,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}var pt=function(c){return"([".concat(Ce,"]{1,").concat(c,"})")};function Qt(a){var V="[ \xa0\\t,]*",W="[:\\.\uff0e]?[ \xa0\\t,-]*",K="#?",Ue="[ \xa0\\t]*";return";ext="+pt("20")+"|"+V+"(?:e?xt(?:ensi(?:o\u0301?|\xf3))?n?|\uff45?\uff58\uff54\uff4e?|\u0434\u043e\u0431|anexo)"+W+pt("20")+"#?|"+V+"(?:[x\uff58#\uff03~\uff5e]|int|\uff49\uff4e\uff54)"+W+pt("9")+"#?|[- ]+"+pt("6")+"#|"+Ue+"(?:,{2}|;)"+W+pt("15")+"#?|"+Ue+"(?:,)+"+W+pt("9")+K}var nt="["+Ce+"]{"+Ve+"}",Jt="[+\uff0b]{0,1}(?:["+ee+"]*["+Ce+"]){3,}["+ee+Ce+"]*",Zt=new RegExp("^[+\uff0b]{0,1}(?:["+ee+"]*["+Ce+"]){1,2}$","i"),Dt=Jt+"(?:"+Qt()+")?",yt=new RegExp("^"+nt+"$|^"+Dt+"$","i"),qt=new RegExp("(?:"+Qt()+")$","i"),qn={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","\uff10":"0","\uff11":"1","\uff12":"2","\uff13":"3","\uff14":"4","\uff15":"5","\uff16":"6","\uff17":"7","\uff18":"8","\uff19":"9","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u06f0":"0","\u06f1":"1","\u06f2":"2","\u06f3":"3","\u06f4":"4","\u06f5":"5","\u06f6":"6","\u06f7":"7","\u06f8":"8","\u06f9":"9"};function rn(a,c){(null==c||c>a.length)&&(c=a.length);for(var d=0,h=new Array(c);d<c;d++)h[d]=a[d];return h}function on(a){for(var h,c="",d=function nn(a,c){var d=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(d)return(d=d.call(a)).next.bind(d);if(Array.isArray(a)||(d=function er(a,c){if(a){if("string"==typeof a)return rn(a,c);var d=Object.prototype.toString.call(a).slice(8,-1);if("Object"===d&&a.constructor&&(d=a.constructor.name),"Map"===d||"Set"===d)return Array.from(a);if("Arguments"===d||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return rn(a,c)}}(a))||c&&a&&"number"==typeof a.length){d&&(a=d);var h=0;return function(){return h>=a.length?{done:!0}:{done:!1,value:a[h++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(a.split(""));!(h=d()).done;)c+=tr(h.value,c)||"";return c}function tr(a,c,d){return"+"===a?c?void("function"==typeof d&&d("end")):"+":function tn(a){return qn[a]}(a)}function sn(a,c){(null==c||c>a.length)&&(c=a.length);for(var d=0,h=new Array(c);d<c;d++)h[d]=a[d];return h}function Mt(a,c){return an(a,void 0,c)}function an(a,c,d){var h=d.type(c),O=h&&h.possibleLengths()||d.possibleLengths();if(!O)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===c){if(!d.type("FIXED_LINE"))return an(a,"MOBILE",d);var V=d.type("MOBILE");V&&(O=function ir(a,c){for(var O,d=a.slice(),h=function nr(a,c){var d=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(d)return(d=d.call(a)).next.bind(d);if(Array.isArray(a)||(d=function rr(a,c){if(a){if("string"==typeof a)return sn(a,c);var d=Object.prototype.toString.call(a).slice(8,-1);if("Object"===d&&a.constructor&&(d=a.constructor.name),"Map"===d||"Set"===d)return Array.from(a);if("Arguments"===d||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return sn(a,c)}}(a))||c&&a&&"number"==typeof a.length){d&&(a=d);var h=0;return function(){return h>=a.length?{done:!0}:{done:!1,value:a[h++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(c);!(O=h()).done;){var V=O.value;a.indexOf(V)<0&&d.push(V)}return d.sort(function(W,K){return W-K})}(O,V.possibleLengths()))}else if(c&&!h)return"INVALID_LENGTH";var W=a.length,K=O[0];return K===W?"IS_POSSIBLE":K>W?"TOO_SHORT":O[O.length-1]<W?"TOO_LONG":O.indexOf(W,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function dn(a,c){return"IS_POSSIBLE"===Mt(a,c)}function Ye(a,c){return a=a||"",new RegExp("^(?:"+c+")$").test(a)}
1function cn(a,c){(null==c||c>a.length)&&(c=a.length);for(var d=0,h=new Array(c);d<c;d++)h[d]=a[d];return h}var sr=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function gt(a,c,d){if(c=c||{},a.country||a.countryCallingCode){(d=new Pe(d)).selectNumberingPlan(a.country,a.countryCallingCode);var h=c.v2?a.nationalNumber:a.phone;if(Ye(h,d.nationalNumberPattern())){if(Ft(h,"FIXED_LINE",d))return d.type("MOBILE")&&""===d.type("MOBILE").pattern()||!d.type("MOBILE")||Ft(h,"MOBILE",d)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var V,O=function ln(a,c){var d=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(d)return(d=d.call(a)).next.bind(d);if(Array.isArray(a)||(d=function Ae(a,c){if(a){if("string"==typeof a)return cn(a,c);var d=Object.prototype.toString.call(a).slice(8,-1);if("Object"===d&&a.constructor&&(d=a.constructor.name),"Map"===d||"Set"===d)return Array.from(a);if("Arguments"===d||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return cn(a,c)}}(a))||c&&a&&"number"==typeof a.length){d&&(a=d);var h=0;return function(){return h>=a.length?{done:!0}:{done:!1,value:a[h++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(sr);!(V=O()).done;){var W=V.value;if(Ft(h,W,d))return W}}}}function Ft(a,c,d){return!(!(c=d.type(c))||!c.pattern()||c.possibleLengths()&&c.possibleLengths().indexOf(a.length)<0)&&Ye(a,c.pattern())}var ft=/(\$\d)/;var pn=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function hn(a,c){(null==c||c>a.length)&&(c=a.length);for(var d=0,h=new Array(c);d<c;d++)h[d]=a[d];return h}function mn(a,c){var d=Object.keys(a);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(a);c&&(h=h.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),d.push.apply(d,h)}return d}function gn(a){for(var c=1;c<arguments.length;c++){var d=null!=arguments[c]?arguments[c]:{};c%2?mn(Object(d),!0).forEach(function(h){gr(a,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(d)):mn(Object(d)).forEach(function(h){Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(d,h))})}return a}function gr(a,c,d){return c in a?Object.defineProperty(a,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[c]=d,a}var at={formatExtension:function(c,d,h){return"".concat(c).concat(h.ext()).concat(d)}};function St(a,c,d,h,O){var V=function Cr(a,c){for(var h,d=function hr(a,c){var d=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(d)return(d=d.call(a)).next.bind(d);if(Array.isArray(a)||(d=function mr(a,c){if(a){if("string"==typeof a)return hn(a,c);var d=Object.prototype.toString.call(a).slice(8,-1);if("Object"===d&&a.constructor&&(d=a.constructor.name),"Map"===d||"Set"===d)return Array.from(a);if("Arguments"===d||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return hn(a,c)}}(a))||c&&a&&"number"==typeof a.length){d&&(a=d);var h=0;return function(){return h>=a.length?{done:!0}:{done:!1,value:a[h++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(a);!(h=d()).done;){var O=h.value;if(O.leadingDigitsPatterns().length>0){var V=O.leadingDigitsPatterns()[O.leadingDigitsPatterns().length-1];if(0!==c.search(V))continue}if(Ye(c,O.pattern()))return O}}(h.formats(),a);return V?function Et(a,c,d){var h=d.useInternationalFormat,O=d.withNationalPrefix,K=a.replace(new RegExp(c.pattern()),h?c.internationalFormat():O&&c.nationalPrefixFormattingRule()?c.format().replace(ft,c.nationalPrefixFormattingRule()):c.format());return h?function vt(a){return a.replace(new RegExp("[".concat(ee,"]+"),"g")," ").trim()}(K):K}(a,V,{useInternationalFormat:"INTERNATIONAL"===d,withNationalPrefix:!(V.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&O&&!1===O.nationalPrefix),carrierCode:c,metadata:h}):a}function Nt(a,c,d,h){return c?h(a,c,d):a}function fn(a,c){var d=Object.keys(a);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(a);c&&(h=h.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),d.push.apply(d,h)}return d}function Cn(a){for(var c=1;c<arguments.length;c++){var d=null!=arguments[c]?arguments[c]:{};
1c%2?fn(Object(d),!0).forEach(function(h){_r(a,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(d)):fn(Object(d)).forEach(function(h){Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(d,h))})}return a}function _r(a,c,d){return c in a?Object.defineProperty(a,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[c]=d,a}function _n(a,c){for(var d=0;d<c.length;d++){var h=c[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(a,h.key,h)}}var Er=function(){function a(c,d,h){if(function Or(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function")}(this,a),!c)throw new TypeError("`country` or `countryCallingCode` not passed");if(!d)throw new TypeError("`nationalNumber` not passed");if(!h)throw new TypeError("`metadata` not passed");var O=function On(a,c){var d,h,O=new Pe(c);return We(a)?(O.selectNumberingPlan(d=a),h=O.countryCallingCode()):h=a,{country:d,countryCallingCode:h}}(c,h),W=O.countryCallingCode;this.country=O.country,this.countryCallingCode=W,this.nationalNumber=d,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return h}}return function yr(a,c,d){c&&_n(a.prototype,c),d&&_n(a,d),Object.defineProperty(a,"prototype",{writable:!1})}(a,[{key:"setExt",value:function(d){this.ext=d}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:function ar(a,c,d){var O=new Pe(d).getCountryCodesForCallingCode(a);return O?O.filter(function(V){return function dr(a,c,d){var h=new Pe(d);return h.selectNumberingPlan(c),h.numberingPlan.possibleLengths().indexOf(a.length)>=0}(c,V,d)}):[]}(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return function or(a,c,d){if(void 0===c&&(c={}),d=new Pe(d),c.v2){if(!a.countryCallingCode)throw new Error("Invalid phone number object passed");d.selectNumberingPlan(a.countryCallingCode)}else{if(!a.phone)return!1;if(a.country){if(!d.hasCountry(a.country))throw new Error("Unknown country: ".concat(a.country));d.country(a.country)}else{if(!a.countryCallingCode)throw new Error("Invalid phone number object passed");d.selectNumberingPlan(a.countryCallingCode)}}if(d.possibleLengths())return dn(a.phone||a.nationalNumber,d);if(a.countryCallingCode&&d.isNonGeographicCallingCode(a.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return function un(a,c,d){return c=c||{},(d=new Pe(d)).selectNumberingPlan(a.country,a.countryCallingCode),d.hasTypes()?void 0!==gt(a,c,d.metadata):Ye(c.v2?a.nationalNumber:a.phone,d.nationalNumberPattern())}(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){return new Pe(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(d){return this.number===d.number&&this.ext===d.ext}},{key:"getType",value:function(){return gt(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(d,h){return function fr(a,c,d,h){if(d=d?gn(gn({},at),d):at,h=new Pe(h),a.country&&"001"!==a.country){if(!h.hasCountry(a.country))throw new Error("Unknown country: ".concat(a.country));h.country(a.country)}else{if(!a.countryCallingCode)return a.phone||"";h.selectNumberingPlan(a.countryCallingCode)}var W,O=h.countryCallingCode(),V=d.v2?a.nationalNumber:a.phone;switch(c){case"NATIONAL":return V?Nt(W=St(V,a.carrierCode,"NATIONAL",h,d),a.ext,h,d.formatExtension):"";case"INTERNATIONAL":return V?(W=St(V,null,"INTERNATIONAL",h,d),Nt(W="+".concat(O," ").concat(W),a.ext,h,d.formatExtension)):"+".concat(O);case"E.164":return"+".concat(O).concat(V);case"RFC3966":return function st(a){var c=a.number,d=a.ext;if(!c)return"";if("+"!==c[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(c).concat(d?";ext="+d:"")}({number:"+".concat(O).concat(V),ext:a.ext});case"IDD":if(!d.fromCountry)return;var K=function dt(a,c,d,h,O){if(It(h,O.metadata)===d){var W=St(a,c,"NATIONAL",O);return"1"===d?d+" "+W:W}
1var K=function $t(a,c,d){var h=new Pe(d);return h.selectNumberingPlan(a,c),h.defaultIDDPrefix()?h.defaultIDDPrefix():pn.test(h.IDDPrefix())?h.IDDPrefix():void 0}(h,void 0,O.metadata);if(K)return"".concat(K," ").concat(d," ").concat(St(a,null,"INTERNATIONAL",O))}(V,a.carrierCode,O,d.fromCountry,h);return Nt(K,a.ext,h,d.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(c,'"'))}}(this,d,h?Cn(Cn({},h),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(d){return this.format("NATIONAL",d)}},{key:"formatInternational",value:function(d){return this.format("INTERNATIONAL",d)}},{key:"getURI",value:function(d){return this.format("RFC3966",d)}}]),a}(),We=function(c){return/^[A-Z]{2}$/.test(c)},Sr=new RegExp("(["+Ce+"])");function kt(a,c){var d=function Pr(a,c){if(a&&c.numberingPlan.nationalPrefixForParsing()){var d=new RegExp("^(?:"+c.numberingPlan.nationalPrefixForParsing()+")"),h=d.exec(a);if(h){var O,V,se,W=h.length-1,K=W>0&&h[W];if(c.nationalPrefixTransformRule()&&K?(O=a.replace(d,c.nationalPrefixTransformRule()),W>1&&(V=h[1])):(O=a.slice(h[0].length),K&&(V=h[1])),K){var Ee=a.indexOf(h[1]);a.slice(0,Ee)===c.numberingPlan.nationalPrefix()&&(se=c.numberingPlan.nationalPrefix())}else se=h[0];return{nationalNumber:O,nationalPrefix:se,carrierCode:V}}}return{nationalNumber:a}}(a,c),h=d.carrierCode,O=d.nationalNumber;if(O!==a){if(!function Ar(a,c,d){return!(Ye(a,d.nationalNumberPattern())&&!Ye(c,d.nationalNumberPattern()))}(a,O,c))return{nationalNumber:a};if(c.possibleLengths()&&!function Rr(a,c){switch(Mt(a,c)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(O,c))return{nationalNumber:a}}return{nationalNumber:O,carrierCode:h}}function yn(a,c){(null==c||c>a.length)&&(c=a.length);for(var d=0,h=new Array(c);d<c;d++)h[d]=a[d];return h}var $r=!1;function rt(a,c){var d=c.nationalNumber,h=c.defaultCountry,O=c.metadata;if($r&&O.isNonGeographicCallingCode(a))return"001";var V=O.getCountryCodesForCallingCode(a);return V?1===V.length?V[0]:function Fr(a,c){var d=c.countries,O=c.metadata;O=new Pe(O);for(var W,V=function Dr(a,c){var d=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(d)return(d=d.call(a)).next.bind(d);if(Array.isArray(a)||(d=function Mr(a,c){if(a){if("string"==typeof a)return yn(a,c);var d=Object.prototype.toString.call(a).slice(8,-1);if("Object"===d&&a.constructor&&(d=a.constructor.name),"Map"===d||"Set"===d)return Array.from(a);if("Arguments"===d||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return yn(a,c)}}(a))||c&&a&&"number"==typeof a.length){d&&(a=d);var h=0;return function(){return h>=a.length?{done:!0}:{done:!1,value:a[h++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(d);!(W=V()).done;){var K=W.value;if(O.country(K),O.leadingDigits()){if(a&&0===a.search(O.leadingDigits()))return K}else if(gt({phone:a,country:K},void 0,O.metadata))return K}}(d,{countries:V,defaultCountry:h,metadata:O.metadata}):void 0}var bt="+",Vt="(["+Ce+"]|[\\-\\.\\(\\)]?)",Vr=new RegExp("^\\"+bt+Vt+"*["+Ce+"]"+Vt+"*$","g"),En=new RegExp("^(["+Ce+"]+((\\-)*["+Ce+"])*\\.)*[a-zA-Z]+((\\-)*["+Ce+"])*\\.?$","g"),Sn="tel:",Gt=";phone-context=",Gr=";isub=";var Lt=250,wr=new RegExp("[+\uff0b"+Ce+"]"),Br=new RegExp("[^"+Ce+"#]+$"),Xr=!1;function Yr(a,c,d){if(c=c||{},d=new Pe(d),c.defaultCountry&&!d.hasCountry(c.defaultCountry))throw c.v2?new pe("INVALID_COUNTRY"):new Error("Unknown country: ".concat(c.defaultCountry));var h=function Wr(a,c,d){var h=function jr(a,c){var O,d=c.extractFormattedPhoneNumber,h=function bn(a){var c=a.indexOf(Gt);if(c<0)return null;var d=c+Gt.length;if(d>=a.length)return"";var h=a.indexOf(";",d);return h>=0?a.substring(d,h):a.substring(d)}(a);if(!function Lr(a){return null===a||0!==a.length&&(Vr.test(a)||En.test(a))}(h))throw new pe("NOT_A_NUMBER");if(null===h)O=d(a)||"";else{O="",h.charAt(0)===bt&&(O+=h);var W,V=a.indexOf(Sn);W=V>=0?V+Sn.length:0;var K=a.indexOf(Gt);O+=a.substring(W,K)}var le=O.indexOf(Gr);if(le>0&&(O=O.substring(0,le)),""!==O)return O}(a,{extractFormattedPhoneNumber:function(W){return function jt(a,c,d){if(a){if(a.length>Lt){if(d)throw new pe("TOO_LONG");return}if(!1===c)return a;var h=a.search(wr);if(!(h<0))return a.slice(h).replace(Br,"")}}(W,d,c)}});if(!h)return{};if(!function zn(a){return a.length>=Ve&&yt.test(a)}(h))return function Kn(a){return Zt.test(a)}(h)?{error:"TOO_SHORT"}:{};var O=function Qn(a){var c=a.search(qt);if(c<0)return{};for(var d=a.slice(0,c),h=a.match(qt),O=1;O<h.length;){if(h[O])return{number:d,ext:h[O]};O++}}(h);return O.ext?O:{number:h}}(a,c.v2,c.extract),O=h.number,V=h.ext;if(!O){if(c.v2)throw new pe("TOO_SHORT"===h.error?"TOO_SHORT":"NOT_A_NUMBER");return{}}var K=function An(a,c,d,h){var le,O=function Ir(a,c,d,h){if(!a)return{};var O;if("+"!==a[0]){var V=function br(a,c,d,h){if(c){var O=new Pe(h);O.selectNumberingPlan(c,d);var V=new RegExp(O.IDDPrefix());if(0===a.search(V)){var W=(a=a.slice(a.match(V)[0].length)).match(Sr);if(!(W&&null!=W[1]&&W[1].length>0&&"0"===W[1]))return a}}}(a,c,d,h);if(!V||V===a){if(c||d){var W=function Tr(a,c,d,h){var O=c?It(c,h):d;if(0===a.indexOf(O)){(h=new Pe(h)).selectNumberingPlan(c,d);var V=a.slice(O.length),K=kt(V,h).nationalNumber,se=kt(a,h).nationalNumber;if(!Ye(se,h.nationalNumberPattern())&&Ye(K,h.nationalNumberPattern())||"TOO_LONG"===Mt(se,h))return{countryCallingCode:O,number:V}}return{number:a}}(a,c,d,h),K=W.countryCallingCode;if(K)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:K,number:W.number}}return{number:a}}O=!0,a="+"+V}if("0"===a[1])return{};
1h=new Pe(h);for(var se=2;se-1<=Ke&&se<=a.length;){var Ee=a.slice(1,se);if(h.hasCallingCode(Ee))return h.selectNumberingPlan(Ee),{countryCallingCodeSource:O?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:Ee,number:a.slice(se)};se++}return{}}(on(a),c,d,h.metadata),V=O.countryCallingCodeSource,W=O.countryCallingCode,K=O.number;if(W)h.selectNumberingPlan(W);else{if(!K||!c&&!d)return{};h.selectNumberingPlan(c,d),c?le=c:Xr&&h.isNonGeographicCallingCode(d)&&(le="001"),W=d||It(c,h.metadata)}if(!K)return{countryCallingCodeSource:V,countryCallingCode:W};var se=kt(on(K),h),Ee=se.nationalNumber,Ue=se.carrierCode,He=rt(W,{nationalNumber:Ee,defaultCountry:c,metadata:h});return He&&(le=He,"001"===He||h.country(le)),{country:le,countryCallingCode:W,countryCallingCodeSource:V,nationalNumber:Ee,carrierCode:Ue}}(O,c.defaultCountry,c.defaultCallingCode,d),le=K.country,se=K.nationalNumber,Ee=K.countryCallingCode,Ue=K.countryCallingCodeSource,He=K.carrierCode;if(!d.hasSelectedNumberingPlan()){if(c.v2)throw new pe("INVALID_COUNTRY");return{}}if(!se||se.length<Ve){if(c.v2)throw new pe("TOO_SHORT");return{}}if(se.length>Be){if(c.v2)throw new pe("TOO_LONG");return{}}if(c.v2){var lt=new Er(Ee,se,d.metadata);return le&&(lt.country=le),He&&(lt.carrierCode=He),V&&(lt.ext=V),lt.__countryCallingCodeSource=Ue,lt}var _t=!!(c.extended?d.hasSelectedNumberingPlan():le)&&Ye(se,d.nationalNumberPattern());return c.extended?{country:le,countryCallingCode:Ee,carrierCode:He,valid:_t,possible:!!_t||!(!0!==c.extended||!d.possibleLengths()||!dn(se,d)),phone:se,ext:V}:_t?function Pn(a,c,d){var h={country:a,phone:c};return d&&(h.ext=d),h}(le,se,V):{}}function Rn(a,c){var d=Object.keys(a);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(a);c&&(h=h.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),d.push.apply(d,h)}return d}function Ct(a){for(var c=1;c<arguments.length;c++){var d=null!=arguments[c]?arguments[c]:{};c%2?Rn(Object(d),!0).forEach(function(h){Hr(a,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(d)):Rn(Object(d)).forEach(function(h){Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(d,h))})}return a}function Hr(a,c,d){return c in a?Object.defineProperty(a,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[c]=d,a}function Tn(a,c,d){return Yr(a,Ct(Ct({},c),{},{v2:!0}),d)}function In(a,c){var d=Object.keys(a);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(a);c&&(h=h.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),d.push.apply(d,h)}return d}function wt(a){for(var c=1;c<arguments.length;c++){var d=null!=arguments[c]?arguments[c]:{};c%2?In(Object(d),!0).forEach(function(h){Dn(a,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(d)):In(Object(d)).forEach(function(h){Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(d,h))})}return a}function Dn(a,c,d){return c in a?Object.defineProperty(a,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[c]=d,a}function Mn(a,c){var d=Object.keys(a);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(a);c&&(h=h.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),d.push.apply(d,h)}return d}function Fn(a){for(var c=1;c<arguments.length;c++){var d=null!=arguments[c]?arguments[c]:{};c%2?Mn(Object(d),!0).forEach(function(h){Kr(a,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(d)):Mn(Object(d)).forEach(function(h){Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(d,h))})}return a}function Kr(a,c,d){return c in a?Object.defineProperty(a,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[c]=d,a}function Qr(){var a=ue(arguments),d=a.options,h=a.metadata,O=function zr(a,c,d){c&&c.defaultCountry&&!function Wn(a,c){return c.countries.hasOwnProperty(a)}(c.defaultCountry,d)&&(c=wt(wt({},c),{},{defaultCountry:void 0}));try{return Tn(a,c,d)}catch(h){if(!(h instanceof pe))throw h}}(a.text,d=Fn(Fn({},d),{},{extract:!1}),h);return O&&O.isPossible()||!1}function Zr(){var a=ue(arguments);return Tn(a.text,a.options,a.metadata)}let ei=(()=>
1{class a{constructor(d){this.el=d,this.phone=(0,e.hFB)(),this.hasInputPending=new $.t(!1)}ngOnChanges(d){this.isValidValueChange(d)&&!this.hasInputPending.value&&this.formatPhoneNumber()}isValidValueChange(d){return!!d.phone.currentValue}formatPhoneNumber(){const d=this.el?.nativeElement?.value;if(d&&function Jr(){return Q(Qr,arguments)}(d)){const h=function qr(){return Q(Zr,arguments)}(d);this.el.nativeElement.value=h.formatInternational()}}delayPhoneNumberFormatting(){this.hasInputPending.next(!0),setTimeout(()=>{this.hasInputPending.next(!1)})}static{this.\u0275fac=function(h){return new(h||a)(e.rXU(e.aKT))}}static{this.\u0275dir=e.FsC({type:a,selectors:[["","ardnInternationalPhoneNumberFormatter",""]],hostBindings:function(h,O){1&h&&e.bIt("blur",function(){return O.formatPhoneNumber()})("input",function(){return O.delayPhoneNumberFormatting()})},inputs:{phone:[1,"phone"]},standalone:!0,features:[e.OA$]})}}return a})(),ti=(()=>{class a{get modelValue(){return this._modelValue}constructor(d){this.changeDetector=d,this.allowedCharacters=["0","1","2","3","4","5","6","7","8","9","+",L.$.ArrowLeft,L.$.ArrowRight,L.$.Backspace,L.$.Delete,L.$.End,L.$.Home,L.$.Tab,L.$.Enter,L.$.Escape],this.editShortcutsKeys=["a","c","v","x"],this.idName=(0,e.hFB)(),this.isDisabled=(0,e.hFB)(!1),this._modelValue="",this.propagateChange=()=>{},this.onTouchedCallback=()=>{}}onKeyUp(){}onKeyDown(d){this.isAllowedCharPassed(d)||this.isAllowedShortcutPassed(d)||d.preventDefault()}onChange(){this.propagateChange(this._modelValue)}onFocusOut(){this.onTouchedCallback()}registerOnChange(d){this.propagateChange=d}writeValue(d){d&&(d=this.prepareValue(d)),this._modelValue=d,this.prop
1agateChange(this._modelValue),this.changeDetector.markForCheck()}registerOnTouched(d){this.onTouchedCallback=d}prepareValue(d){return d=(d=d.replace(/\s/g,"")).replace(/^00/,"+"),this.filterIllegalCharacters(d)}isAllowedCharPassed(d){return x()(this.allowedCharacters,d.key)}isAllowedShortcutPassed(d){return x()(this.editShortcutsKeys,d.key)&&(d.ctrlKey||d.metaKey)}filterIllegalCharacters(d){const h=d.replace(/[^0-9+]/g,""),O="+"===h.charAt(0),V=h.replace(/\+/g,"");return O?"+"+V:V}static{this.\u0275fac=function(h){return new(h||a)(e.rXU(e.gRc))}}static{this.\u0275cmp=e.VBU({type:a,selectors:[["ardn-phone-input"]],inputs:{idName:[1,"idName"],isDisabled:[1,"isDisabled"]},standalone:!0,features:[e.Jv_([{provide:l.kq,useExisting:(0,e.Rfq)(()=>a),multi:!0}]),e.aNF],decls:1,vars:5,consts:[["type","tel","ardnInternationalPhoneNumberFormatter","",1,"input","phone-input",3,"keydown","keyup","change","input","blur","value","disabled","phone","ardnDataTestId"]],template:function(h,O){1&h&&(e.j41(0,"input",0),e.bIt("keydown",function(W){return O.onKeyDown(W)})("keyup",function(){return O.onKeyUp()})("change",function(){return O.onChange()})("input",function(W){return O.writeValue(W.target.value)})("blur",function(){return O.onFocusOut()}),e.k0s()),2&h&&(e.Y8G("value",O.modelValue)("disabled",O.isDisabled())("phone",O.modelValue)("ardnDataTestId","ardn-phone-input-form-phone-input"),e.BMQ("id",O.idName()))},dependencies:[I.Z,ei],styles:["input[type=number][_ngcontent-%COMP%]{appearance:textfield}input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button{appearance:none;margin:0}"]})}}return a})();var ni=s(60213),ri=s(56089),$n=s(25523),ii=s(12747),oi=s(75813),si=s(35082),ai=s(90159),di=s(45170),li=s(25399),ci=s(31576);const ui=["countryDropDown"],Nn=["timer"],pi=a=>({"none-pointer-events":a});function hi(a,c){1&a&&(e.j41(0,"span"),e.EFF(1,"*"),e.k0s())}function mi(a,c){if(1&a){const d=e.RV6();e.j41(0,"div",10)(1,"label",42),e.EFF(2),e.nI1(3,"translate"),e.j41(4,"span",15),e.EFF(5,"*"),e.k0s()(),e.j41(6,"input",43),e.bIt("change",function(){e.eBV(d);const O=e.XpG();return e.Njj(O.onChangeNip())})("keyup",function(){e.eBV(d);const O=e.XpG();return e.Njj(O.onChangeNip())})("paste",function(){e.eBV(d);const O=e.XpG();return e.Njj(O.onChangeNip())}),e.k0s(),e.nrm(7,"ardn-field-validator",13)(8,"ardn-field-validator",44),e.k0s()}if(2&a){const d=e.XpG();e.R7$(),e.Y8G("ardnDataTestId","ardn-user-address-form-form-nip-label"),e.R7$(),e.SpI(" ",e.bMT(3,13,"COMMON.ADDRESS.NIP")," "),e.R7$(4),e.FS9("id","nip-"+d.serverSideErrorFormFieldName()),e.Y8G("ardnDataTestId","ardn-user-address-form-form-nip-input"),e.R7$(),e.Y8G("clientSideValidation",d.addressDataForm.get("nip"))("serverSideValidation",d.getError("nip"))("clientErrorMessage","COMMON.ERRORS.TOO_SHORT")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-nip-field-validator"),e.R7$(),e.Y8G("serverSideValidation",null==d.nipValidationErrors?null:d.nipValidationErrors.fields["address[nip]"])("clientErrorMessage","COMMON.ERRORS.TOO_SHORT")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-address-nip-field-validator")}}function gi(a,c){if(1&a&&(e.j41(0,"div",10)(1,"label",45),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.nrm(4,"input",46)(5,"ardn-field-validator",13),e.k0s()),2&a){const d=e.XpG();e.R7$(),e.Y8G("ardnDataTestId","ardn-user-address-form-form-companyName-label"),e.R7$(),e.SpI(" ",e.bMT(3,9,"COMMON.ADDRESS.COMPANY_NAME")," "),e.R7$(2),e.FS9("id","companyName-"+d.serverSideErrorFormFieldName()),e.Y8G("ardnDataTestId","ardn-user-address-form-form-companyName-input"),e.R7$(),e.Y8G("clientSideValidation",d.addressDataForm.get("companyName"))("serverSideValidation",d.getError("companyName"))("clientErrorMessage","COMMON.ERRORS.TOO_SHORT")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-address-companyName-field-validator")}}function fi(a,c){if(1&a&&e.nrm(0,"ardn-field-validator",39),2&a){const d=e.XpG();e.Y8G("clientSideValidation",d.addressDataForm.get("phone"))("serverSideValidation",d.serverSideValidationErrors().fields.verificationCode)("ardnDataTestId","ardn-user-address-form-form-address-phone-field-validator")}}
1function Ci(a,c){if(1&a){const d=e.RV6();e.j41(0,"a",50),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"ardn-timer",52,1),e.bIt("timerEnded",function(){e.eBV(d);const O=e.XpG(2);return e.Njj(O.onTimerFinished())}),e.k0s(),e.EFF(5),e.nI1(6,"translate"),e.k0s()}2&a&&(e.R7$(),e.SpI(" ",e.bMT(2,3,"REGISTER_PAGE.SEND_CODE_AGAIN_IN")," "),e.R7$(2),e.Y8G("duration",30),e.R7$(2),e.SpI(" ",e.bMT(6,5,"REGISTER_PAGE.SECONDS")," "))}function _i(a,c){if(1&a){const d=e.RV6();e.j41(0,"a",53),e.bIt("click",function(){e.eBV(d);const O=e.XpG(2);return e.Njj(O.resendCode())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&a&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"REGISTER_PAGE.SEND_CODE_AGAIN")," "))}function Oi(a,c){if(1&a&&(e.j41(0,"div",40),e.nrm(1,"ardn-code-input",47)(2,"ardn-field-validator",48),e.j41(3,"div",49),e.EFF(4),e.nI1(5,"translate"),e.DNE(6,Ci,7,7,"a",50)(7,_i,3,3,"a",51),e.k0s()()),2&a){const d=e.XpG();e.R7$(),e.Y8G("formControl",d.verificationCodeCtrl)("size",6)("ardnDataTestId","ardn-register-page-form-code-input"),e.R7$(),e.Y8G("clientSideValidation",d.verificationCodeCtrl)("serverSideValidation",d.serverSideValidationErrors().fields.verificationCode)("errorMessage",d.codeVerificationError)("ardnDataTestId","ardn-register-page-form-code-validator"),e.R7$(2),e.SpI(" ",e.bMT(5,9,"REGISTER_PAGE.CODE_NOT_RECEIVED")," "),e.R7$(2),e.vxM(d.isSendSmsBlocked?6:7)}}function yi(a,c){1&a&&(e.j41(0,"div",41)(1,"span",41),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&a&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"COMMON.REQUIRED_FIELD")," "))}let Bt=(()=>{class a extends C.m{constructor(d,h,O,V,W,K,le,se,Ee,Ue){super(Ee,se,Ue),this.config=d,this.postCodeService=h,this.platformId=O,this.userService=V,this.changeDetector=W,this.translate=K,this.windowService=le,this.scrollService=se,this.formBuilder=Ee,this.countryService=Ue,this.loggedIn=(0,e.hFB)(!1),this.isRegisterFromIntegration=(0,e.hFB)(!1),this.serverSideErrorFormFieldName=(0,e.hFB)("address"),this.saveEventDetector=(0,e.hFB)(null),this.companyNameLoaded=!1,this.downloadCompanyNameLinkVisible=!0,this.nipValidationErrors={fields:{},general:[]},this.nip="",this.MIN_NIP_LENGTH_VALID=3,this.phoneVerificationError="",this.codeVerificationError="",this.isCodeSendClicked=!1,this.disableCodeButton=!1,this.isSendSmsBlocked=!0,this.responseSubject=new _.B,this.onVerificationCodeSet=(0,e.CGW)(),this.isRegisterFromIntegration()&&setTimeout(()=>{this.disableCompanyName()}),setTimeout(()=>{this.saveEventDetector()?.subscribe(()=>{this.isCodeSendClicked=!1,this.disableCodeButton=!1,this.isSendSmsBlocked=!0,this.tempPhoneNumber=null,this.verificationCodeCtrl.reset(),this.initialPhoneNumber=this.addressDataForm.get("phone").value,delete this.serverSideValidationErrors().fields.verificationCode})},100)}getFormFields(){return this.formBuilder.group({type:[{value:null,disabled:this.loggedIn()&&!this.isRegisterFromIntegration()}],email:["",l.k0.compose([l.k0.required,l.k0.pattern(b.gM)])],name:["",l.k0.compose([l.k0.required,l.k0.minLength(3)])],surname:["",l.k0.compose([l.k0.required,l.k0.minLength(3)])],countryId:["",l.k0.required],nip:[""],companyName:[""],street:["",l.k0.compose([l.k0.required,l.k0.minLength(1)])],houseNumber:["",[l.k0.required]],apartmentNumber:["",l.k0.compose([l.k0.maxLength(20),b.af])],postCode:[""],city:["",l.k0.compose([l.k0.required,l.k0.minLength(3)])],phone:["",l.k0.compose([l.k0.required,b.V$])]})}isInOrderStep(){return!!(0,E.UE)(this.platformId)&&"/order"===this.windowService.nativeWindow.location?.pathname}getCompanyNameFromApi(){if(this.addressDataForm.get("countryId").value&&this.addressDataForm.get("nip").value){const d={countryId:this.addressDataForm.get("countryId").value,tin:this.addressDataForm.get("nip").value};this.userService.getUserCompany(d).subscribe({next:h=>{h.companyName&&(this.addressDataForm.get("companyName").patchValue(h.companyName),this.downloadCompanyNameLinkVisible=!1,this.companyNameLoaded=!0)},error:()=>{this.downloadCompanyNameLinkVisible=!1,this.companyNameLoaded=!1}})}}disableCompanyName(){const h=this.getAddressDataForm().get("companyName");h.disable(),h.updateValueAndValidity()}enableCompanyName(){const h=this.getAddressDataForm().get("companyName");
1h.enable(),h.updateValueAndValidity()}clearCompanyNameValidation(){this.getAddressDataForm().get("companyName").clearValidators()}getCompanyName(){return this.getAddressDataForm().get("companyName").value}getNip(){return this.getAddressDataForm().get("nip").value}onChangeNip(){if(this.isRegisterFromIntegration()&&this.getAddressDataForm()){this.clearNipValidationErrors();const d=this.getNip();this.nip!==d&&this.isCompany&&(this.nip=d,d&&d.length>this.MIN_NIP_LENGTH_VALID&&this.updateCompanyNameByNip(d))}}getCountry(d){this.isRegisterFromIntegration()&&d&&d.id&&this.disableEnableCompanyName(d.id)}setCountry(d){setTimeout(()=>{this.country=d})}getError(d){return this.serverSideValidationErrors?this.serverSideValidationErrors().fields[`${this.serverSideErrorFormFieldName()}[${d}]`]:null}disableEnableCompanyName(d){(0,P.s)(this.countryService.getCountryCached(d)).then(h=>{this.countryRegisteringUser=h,this.clearNipValidationErrors(),h.isUEMember?this.disableCompanyName():this.enableCompanyName()}).catch(()=>{this.enableCompanyName()})}updateCompanyNameByNip(d){const h={countryId:this.countryRegisteringUser.id,tin:d};this.updateCompanyName(""),(0,P.s)(this.userService.getUserCompany(h)).then(O=>{this.clearNipValidationErrors(),(O||0===O.companyName.length)&&(this.updateCompanyName(O.companyName),this.disableCompanyName(),this.config.defaultLocationId.toUpperCase()!==this.countryRegisteringUser.isoCode&&(this.updateCompanyName(""),this.enableCompanyName()))}).catch(O=>{O?O&&O.fields&&O.fields.nip&&(this.nipValidationErrors={fields:{"address[nip]":O.fields.nip},general:[]},this.updateCompanyName(""),this.disableCompanyName(),this.changeDetector.markForCheck()):(this.updateCompanyName(""),this.countryRegisteringUser.isUEMember?(this.nipValidationErrors={fields:{"address[nip]":this.translate.instant("ORDER_PAGE.USER_DATA_STEP.WRONG_VALUE")},general:[]},this.disableCompanyName()):this.enableCompanyName())})}updateCompanyName(d){const h=this.getAddressDataForm().get("companyName");h.patchValue(d),h.updateValueAndValidity(),this.changeDetector.markForCheck()}clearNipValidationErrors(){this.nipValidationErrors={fields:{},general:[]}}isSendCodeButtonDisabled(){const d=this.addressDataForm.get("phone")?.value;return this.disableCodeButton=!0,d!==this.tempPhoneNumber&&d!==this.initialPhoneNumber&&(this.disableCodeButton=!1,this.isCodeSendClicked=!1),this.changeDetector.markForCheck(),this.addressDataForm.get("phone")?.invalid||this.disableCodeButton}sendVerificationSmsRequest(){this.userService.sendSmsVerificationCode(this.prepareSmsVerificationRequest(),!0).subscribe({next:()=>{this.isSendSmsBlocked=!0,this.isCodeSendClicked=!0,this.disableCodeButton=!0,this.phoneVerificationError="",this.codeVerificationError="",this.verificationCodeCtrl=new l.MJ("",l.k0.required),this.verificationCodeCtrl.valueChanges.pipe((0,S.B)(400)).subscribe(d=>this.onVerificationCodeSet.emit(d)),delete this.serverSideValidationErrors()?.fields.verificationCode,this.changeDetector.detectChanges(),setTimeout(()=>this.timerComponent?.startCountdown(),100)},error:d=>{if(d?.fields){if(!d.fields.phone)return void this.resendCode();this.isCodeSendClicked=!1,this.disableCodeButton=!1,this.phoneVerificationError=this.redefinePhoneNumberError(d),this.changeDetector.detectChanges()}}})}onTimerFinished(){this.isSendSmsBlocked=!1}resendCode(){this.responseSubject.pipe((0,y.s)(1)).subscribe(()=>{this.sendVerificationSmsRequest(),this.isSendSmsBlocked=!0,this.changeDetector.detectChanges(),this.timerComponent.startCountdown()})}prepareSmsVerificationRequest(){const d=this.addressDataForm.get("phone")?.value;return this.tempPhoneNumber=d,{phone:this.tempPhoneNumber}}redefinePhoneNumberError(d){return d?.fields.phone?d.fields.phone.toString():""}static{this.\u0275fac=function(h){return new(h||a)(e.rXU(f.vQ),e.rXU(si.z),e.rXU(e.Agw),e.rXU(ai.D),e.rXU(e.gRc),e.rXU(R.c$),e.rXU(di.s),e.rXU(li.b),e.rXU(l.ok),e.rXU(ci.o))}}static{this.\u0275cmp=e.VBU({type:a,selectors:[["ardn-user-address-form"]],viewQuery:function(h,O){if(1&h&&(e.GBs(ui,7),e.GBs(Nn,5)),2&h){let V;e.mGM(V=e.lsd())&&(O.countryDropDown=V.first),e.mGM(V=e.lsd())&&(O.timerComponent=V.first)}},inputs:{loggedIn:[1,"loggedIn"],isRegisterFromIntegration:[1,"isRegisterFromIntegration"],serverSideErrorFormFieldName:[1,"serverSideErrorFormFieldName"],saveEventDetector:[1,"saveEventDetector"]},outputs:{onVerificationCodeSet:"onVerificationCodeSet"},standalone:!0,features:[e.Jv_([{provide:l.kq,useExisting:(0,e.Rfq)(()=>a),multi:!0}]),e.Vt3,e.aNF],decls:110,vars:146,consts:[["countryDropDown",""],["t
1imer",""],["novalidate","",3,"formGroup"],[1,"field","account-type"],[1,"label","no-margin"],[1,"radio","radio--inline"],["for","acount-private",3,"ardnDataTestId"],["id","acount-private","type","radio","value","PERSON","formControlName","type",3,"ardnDataTestId"],["for","account-business",3,"ardnDataTestId"],["id","account-business","type","radio","value","COMPANY","formControlName","type",3,"ardnDataTestId"],[1,"field"],["for","email",1,"label",3,"ardnDataTestId"],["type","email","formControlName","email",1,"input",3,"id","ardnDataTestId"],[1,"input-validation",3,"clientSideValidation","serverSideValidation","clientErrorMessage","notValidateDisabled","ardnDataTestId"],["for","name",1,"label",3,"ardnDataTestId"],[1,"label--required"],["formControlName","name",1,"input",3,"id","ardnDataTestId"],["for","surname",1,"label",3,"ardnDataTestId"],["formControlName","surname",1,"input",3,"id","ardnDataTestId"],[1,"field",3,"id"],[1,"label",3,"ardnDataTestId"],["formControlName","countryId",3,"defaultOptionEmiter","newCountrySelected","ardnDataTestId"],["id","comp-fields"],["for","street",1,"label",3,"ardnDataTestId"],["formControlName","street",1,"input",3,"id","ardnDataTestId"],[1,"row"],[1,"col","col-6","col-mobile-12"],["for","houseNumber",1,"label",3,"ardnDataTestId"],["formControlName","houseNumber",1,"input",3,"id","ardnDataTestId"],["for","apartmentNumber",1,"label",3,"ardnDataTestId"],["formControlName","apartmentNumber",1,"input",3,"id","ardnDataTestId"],["for","postCode",1,"label",3,"ardnDataTestId"],["formControlName","postCode",3,"id","country","formGroup","placeholder","ardnDataTestId"],["for","city",1,"label",3,"ardnDataTestId"],["formControlName","city",1,"input",3,"id","readonly","ngClass","ardnDataTestId"],[1,"field","input-wrapper"],["for","phone",1,"label",3,"ardnDataTestId"],["formControlName","phone",3,"id","isDisabled"],["id","send-code-button","type","button",1,"btn","btn--primary","btn--block","send-code-button",3,"click","ardnDataTestId","disabled"],[1,"input-validation",3,"clientSideValidation","serverSideValidation","ardnDataTestId"],[1,"field","relative","code-send"],[1,"required-info"],["for","nip",1,"label",3,"ardnDataTestId"],["formControlName","nip",1,"input",3,"change","keyup","paste","id","ardnDataTestId"],[1,"input-validation",3,"serverSideValidation","clientErrorMessage","notValidateDisabled","ardnDataTestId"],["for","companyName",1,"label",3,"ardnDataTestId"],["formControlName","companyName",1,"input",3,"id","ardnDataTestId"],["name","verificationCode","id","verificationCode-register",1,"mb-2",3,"formControl","size","ardnDataTestId"],[1,"input-validation",3,"clientSideValidation","serverSideValidation","errorMessage","ardnDataTestId"],[1,"resend-code"],[1,"link-disabled"],[1,"link-active"],[3,"timerEnded","duration"],[1,"link-active",3,"click"]],template:function(h,O){if(1&h){const V=e.RV6();e.j41(0,"form",2)(1,"fieldset",3)(2,"legend",4),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"div",5)(6,"label",6),e.nrm(7,"input",7),e.j41(8,"span"),e.EFF(9),e.nI1(10,"translate"),e.k0s()()(),e.j41(11,"div",5)(12,"label",8),e.nrm(13,"input",9),e.j41(14,"span"),e.EFF(15),e.nI1(16,"translate"),e.k0s()()()(),e.j41(17,"div",10)(18,"label",11),e.EFF(19),e.nI1(20,"translate"),e.DNE(21,hi,2,0,"span"),e.k0s(),e.nrm(22,"input",12)(23,"ardn-field-validator",13),e.k0s(),e.j41(24,"div",10)(25,"label",14),e.EFF(26),e.nI1(27,"translate"),e.j41(28,"span",15),e.EFF(29,"*"),e.k0s()(),e.nrm(30,"input",16)(31,"ardn-field-validator",13),e.k0s(),e.j41(32,"div",10)(33,"label",17),e.EFF(34),e.nI1(35,"translate"),e.j41(36,"span",15),e.EFF(37,"*"),e.k0s()(),e.nrm(38,"input",18)(39,"ardn-field-validator",13),e.k0s(),e.j41(40,"div",19)(41,"label",20),e.EFF(42),e.nI1(43,"translate"),e.k0s(),e.j41(44,"ardn-country-chooser",21,0),e.bIt("defaultOptionEmiter",function(K){return e.eBV(V),O.getCountry(K),e.Njj(O.setCountry(K))})("newCountrySelected",function(){return e.eBV(V),e.Njj(O.postCodeService.clearAddressForm(O.addressDataForm))}),e.k0s(),e.nrm(46,"ardn-field-validator",13),e.k0s(),e.j41(47,"div",22),e.DNE(48,mi,9,15,"div",10)(49,gi,6,11,"div",10),e.k0s(),e.j41(50,"div",10)(51,"label",23),e.
1EFF(52),e.nI1(53,"translate"),e.j41(54,"span",15),e.EFF(55,"*"),e.k0s()(),e.nrm(56,"input",24)(57,"ardn-field-validator",13),e.k0s(),e.j41(58,"div",25)(59,"div",26)(60,"div",10)(61,"label",27),e.EFF(62),e.nI1(63,"translate"),e.j41(64,"span",15),e.EFF(65,"*"),e.k0s()(),e.nrm(66,"input",28)(67,"ardn-field-validator",13),e.k0s()(),e.j41(68,"div",26)(69,"div",10)(70,"label",29),e.EFF(71),e.nI1(72,"translate"),e.k0s(),e.nrm(73,"input",30)(74,"ardn-field-validator",13),e.k0s()()(),e.j41(75,"div",25)(76,"div",26)(77,"div",10)(78,"label",31),e.EFF(79),e.nI1(80,"translate"),e.j41(81,"span",15),e.EFF(82,"*"),e.k0s()(),e.nrm(83,"ardn-post-code-drop-down",32),e.nI1(84,"translate"),e.nrm(85,"ardn-field-validator",13),e.k0s()(),e.j41(86,"div",26)(87,"div",10)(88,"label",33),e.EFF(89),e.nI1(90,"translate"),e.j41(91,"span",15),e.EFF(92,"*"),e.k0s()(),e.nrm(93,"input",34)(94,"ardn-field-validator",13),e.k0s()()(),e.j41(95,"div",35)(96,"label",36),e.EFF(97),e.nI1(98,"translate"),e.j41(99,"span",15),e.EFF(100,"*"),e.k0s()(),e.nrm(101,"ardn-phone-input",37),e.j41(102,"button",38),e.bIt("click",function(){return e.eBV(V),e.Njj(O.sendVerificationSmsRequest())}),e.EFF(103),e.nI1(104,"translate"),e.nI1(105,"uppercase"),e.k0s(),e.nrm(106,"ardn-field-validator",13),e.DNE(107,fi,1,3,"ardn-field-validator",39),e.k0s(),e.DNE(108,Oi,8,11,"div",40)(109,yi,4,3,"div",41),e.k0s()}if(2&h){let V;e.Y8G("formGroup",O.addressDataForm),e.R7$(3),e.JRh(e.bMT(4,112,"COMMON.ADDRESS.TYPE")),e.R7$(3),e.Y8G("ardnDataTestId","ardn-user-address-form-form-acount-private-label"),e.R7$(),e.Y8G("ardnDataTestId","ardn-user-address-form-form-acount-private-input"),e.R7$(2),e.JRh(e.bMT(10,114,"COMMON.ADDRESS.PERSON")),e.R7$(3),e.Y8G("ardnDataTestId","ardn-user-address-form-form-account-business-label"),e.R7$(),e.Y8G("ardnDataTestId","ardn-user-address-form-form-account-business-input"),e.R7$(2),e.JRh(e.bMT(16,116,"COMMON.ADDRESS.COMPANY")),e.R7$(3),e.Y8G("ardnDataTestId","ardn-user-address-form-form-email-label"),e.R7$(),e.SpI(" ",e.bMT(20,118,"COMMON.EMAIL")," "),e.R7$(2),e.vxM(O.isRegisterFromIntegration()?-1:21),e.R7$(),e.FS9("id","email-"+O.serverSideErrorFormFieldName()),e.Y8G("ardnDataTestId","ardn-user-address-form-form-email-input"),e.R7$(),e.Y8G("clientSideValidation",O.addressDataForm.get("email"))("serverSideValidation",O.getError("email"))("clientErrorMessage","COMMON.ERRORS.EMAIL_CONTENT")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-email-field-validator"),e.R7$(2),e.Y8G("ardnDataTestId","ardn-user-address-form-form-name-label"),e.R7$(),e.SpI(" ",e.bMT(27,120,"COMMON.ADDRESS.NAME")," "),e.R7$(4),e.FS9("id","name-"+O.serverSideErrorFormFieldName()),e.Y8G("ardnDataTestId","ardn-user-address-form-form-name-input"),e.R7$(),e.Y8G("clientSideValidation",O.addressDataForm.get("name"))("serverSideValidation",O.getError("name"))("clientErrorMessage","COMMON.ERRORS.TOO_SHORT")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-name-field-validator"),e.R7$(2),e.Y8G("ardnDataTestId","ardn-user-address-form-form-surname-label"),e.R7$(),e.SpI(" ",e.bMT(35,122,"COMMON.ADDRESS.SURNAME")," "),e.R7$(4),e.FS9("id","surname-"+O.serverSideErrorFormFieldName()),e.Y8G("ardnDataTestId","ardn-user-address-form-form-surname-input"),e.R7$(),e.Y8G("clientSideValidation",O.addressDataForm.get("surname"))("serverSideValidation",O.getError("surname"))("clientErrorMessage","COMMON.ERRORS.TOO_SHORT")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-surname-field-validator"),e.R7$(),e.FS9("id","countryId-"+O.serverSideErrorFormFieldName()),e.R7$(),e.Y8G("ardnDataTestId","ardn-user-address-form-form-countryId-label"),e.R7$(),e.SpI(" ",e.bMT(43,124,"COMMON.ADDRESS.COUNTRY")," "),e.R7$(2),e.Y8G("ardnDataTestId","ardn-user-address-form-form-countryId-country-chooser"),e.R7$(2),e.Y8G("clientSideValidation",O.addressDataForm.get("countryId"))("serverSideValidation",O.getError("country"))("clientErrorMessage","COMMON.ERRORS.REQUIRED")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-countryId-field-validator"),e.R7$(2),e.vxM(O.isCompany()?48:-1),e.R7$(),e.vxM(O.isCompany()?49:-1),e.R7$(2),e.Y8G("ardnDataTestId","ardn-user-address-form-form-street-label"),e.R7$(),e.SpI(" ",e.bMT(53,126,"COMMON.ADDRESS.STREET")," "),e.R7$(4),e.FS9("id","street-"+O.serverSideErrorFormFieldName()),e.Y8G("ardnDataTestId","ardn-user-address-form-form-street-input"),e.R7$(),e.Y8G("clientSideValidation",O.addressDataForm.get("street"))("serverSideValidation",O.getError("street"))("clientErrorMessage","COMMON.ERRORS.TOO_SHORT")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-address-street
1-field-validator"),e.R7$(4),e.Y8G("ardnDataTestId","ardn-user-address-form-form-houseNumber-label"),e.R7$(),e.SpI(" ",e.bMT(63,128,"COMMON.ADDRESS.HOUSE_NUMBER")," "),e.R7$(4),e.FS9("id","houseNumber-"+O.serverSideErrorFormFieldName()),e.Y8G("ardnDataTestId","ardn-user-address-form-form-houseNumber-input"),e.R7$(),e.Y8G("clientSideValidation",O.addressDataForm.get("houseNumber"))("serverSideValidation",O.getError("houseNumber"))("clientErrorMessage","COMMON.ERRORS.TOO_SHORT")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-address-houseNumber-field-validator"),e.R7$(3),e.Y8G("ardnDataTestId","ardn-user-address-form-form-apartmentNumber-label"),e.R7$(),e.SpI(" ",e.bMT(72,130,"COMMON.ADDRESS.APARTMENT_NUMBER")," "),e.R7$(2),e.FS9("id","apartmentNumber-"+O.serverSideErrorFormFieldName()),e.Y8G("ardnDataTestId","ardn-user-address-form-form-apartmentNumber-input"),e.R7$(),e.Y8G("clientSideValidation",O.addressDataForm.get("apartmentNumber"))("serverSideValidation",O.getError("apartmentNumber"))("clientErrorMessage","COMMON.ERRORS.APARTMENT_NUMBER_ERROR")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-address-apartmentNumber-field-validator"),e.R7$(4),e.Y8G("ardnDataTestId","ardn-user-address-form-form-postCode-label"),e.R7$(),e.SpI(" ",e.bMT(80,132,"COMMON.ADDRESS.POST_CODE")," "),e.R7$(4),e.FS9("id","postCode-"+O.serverSideErrorFormFieldName()),e.Y8G("country",O.country)("formGroup",O.addressDataForm)("placeholder",e.bMT(84,134,"ORDER_PAGE.ENTER_POSTCODE"))("ardnDataTestId","ardn-user-address-form-form-postCode-input"),e.R7$(2),e.Y8G("clientSideValidation",O.addressDataForm.get("postCode"))("serverSideValidation",O.getError("postCode"))("clientErrorMessage","COMMON.ERRORS.TOO_SHORT")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-address-postCode-field-validator"),e.R7$(3),e.Y8G("ardnDataTestId","ardn-user-address-form-form-city-label"),e.R7$(),e.SpI(" ",e.bMT(90,136,"COMMON.ADDRESS.CITY")," "),e.R7$(4),e.FS9("id","city-"+O.serverSideErrorFormFieldName()),e.Y8G("readonly",O.postCodeService.isCityReadOnly(O.country))("ngClass",e.eq3(144,pi,O.postCodeService.isCityReadOnly(O.country)))("ardnDataTestId","ardn-user-address-form-form-city-input"),e.R7$(),e.Y8G("clientSideValidation",O.addressDataForm.get("city"))("serverSideValidation",O.getError("city"))("clientErrorMessage","COMMON.ERRORS.TOO_SHORT")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-address-city-field-validator"),e.R7$(2),e.Y8G("ardnDataTestId","ardn-user-address-form-form-phone-label"),e.R7$(),e.SpI(" ",e.bMT(98,138,"COMMON.ADDRESS.PHONE")," "),e.R7$(4),e.FS9("id","phone-"+O.serverSideErrorFormFieldName()),e.Y8G("isDisabled",null==(V=O.addressDataForm.get("phone"))?null:V.disabled),e.R7$(),e.Y8G("ardnDataTestId","ardn-user-address-form-code-button")("disabled",O.isSendCodeButtonDisabled()),e.R7$(),e.SpI(" ",e.bMT(105,142,e.bMT(104,140,"REGISTER_PAGE.SEND_CODE"))," "),e.R7$(3),e.Y8G("clientSideValidation",O.addressDataForm.get("phone"))("serverSideValidation",O.getError("phone"))("clientErrorMessage","COMMON.ERRORS.INTERNATIONAL_PHONE")("notValidateDisabled",!0)("ardnDataTestId","ardn-user-address-form-form-address-phone-field-validator"),e.R7$(),e.vxM(O.isCodeSendClicked?-1:107),e.R7$(),e.vxM(O.isCodeSendClicked?108:-1),e.R7$(),e.vxM(O.isInOrderStep()?-1:109)}},dependencies:[E.MD,E.YU,E.Pc,l.X1,l.qT,l.me,l.Fm,l.BC,l.cb,l.l_,l.
1j4,l.JD,ti,oi.J,ii.B,ri.Q,R.h,R.D9,ni.R,I.Z,$n.g],styles:[".formutils[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;font-size:15px}.formutils[_ngcontent-%COMP%]   .not-found[_ngcontent-%COMP%]{color:red}.formutils[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{cursor:pointer}@media screen and (min-width: 960px) and (max-width: 1006px){.account-type[_ngcontent-%COMP%]{display:flex;flex-direction:column}.account-type[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{margin-left:0}}.input-wrapper[_ngcontent-%COMP%]{position:relative}.send-code-button[_ngcontent-%COMP%]{font-size:14px;width:130px;height:32px;position:absolute;top:27px;right:6px;align-items:center;justify-content:center;display:flex}.send-code-button.btn--disabled[_ngcontent-%COMP%], .btn[disabled][_ngcontent-%COMP%]{border:solid 1px #cbcfd4;background:#cbcfd4;color:#fff}[_nghost-%COMP%]     .iti{display:block!important;margin-bottom:5px}[_nghost-%COMP%]     .iti .dropdown-menu.country-dropdown{border-top-left-radius:0;border-top-right-radius:0;border-color:#c2c2c2;margin-top:-1px}[_nghost-%COMP%]     .iti .iti__country-list{box-shadow:none;font-size:14px;margin-left:15px;width:auto;max-height:200px}[_nghost-%COMP%]     .iti__selected-flag.dropdown-toggle{padding-left:22px;width:auto!important;padding-right:5px}[_nghost-%COMP%]     .iti.separate-dial-code input{padding-left:105px!important}[_nghost-%COMP%]     .iti .selected-dial-code{margin-top:1px!important}"],data:{animation:[v.P]}})}}return a})()},68935:(G,k,s)=>{"use strict";s.d(k,{h:()=>D});var e=s(27468),l=s(18810),v=s(5972),C=s.n(v),b=s(17295),f=s.n(b),R=s(43712),_=s.n(R),P=s(32849),S=s.n(P),y=s(99437),E=s(54438),I=s(18286);let D=(()=>{class x{constructor($){this.apiClientService=$}saveContacts($){const Y=$.map(Q=>this.sendRequest(_()(Q,["type"]),Q.type.toLowerCase()));return(0,e.p)(Y)}updateContacts($,Y){const Q=$.map(ae=>this.sendRequest(_()(ae,["type"]),Y.toLowerCase()));return(0,e.p)(Q)}deleteContact($,Y){return this.apiClientService.delete("user/addressBook/"+Y.toLowerCase(),!0,{id:$}).pipe((0,y.W)(Q=>(0,l.$)(()=>this.mapErrors(Q.error,Y))))}importAddressBook($,Y){return this.apiClientService.post(`user/addressBook/${Y.toLowerCase()}/import?fileType=csv`,!0,{file:$}).pipe((0,y.W)(Q=>(0,l.$)(()=>Q.error)))}sendRequest($,Y){return($=S()($,C())).id?this.apiClientService.put("user/addressBook/"+Y,!0,{contact:$}).pipe((0,y.W)(Q=>(0,l.$)(()=>this.mapErrors(Q.error,Y)))):this.apiClientService.post("user/addressBook/"+Y,!0,{contact:$}).pipe((0,y.W)(Q=>(0,l.$)(()=>this.mapErrors(Q.error,Y))))}mapErrors($,Y){return{...$,fields:{...f()($.fields,(Q,ae)=>ae.replace("contact",Y+"Address"))}}}static{this.\u0275fac=function(Y){return new(Y||x)(E.KVO(I.f))}}static{this.\u0275prov=E.jDH({token:x,factory:x.\u0275fac,providedIn:"root"})}}return x})()},39127:(G,k,s)=>{"use strict";s.d(k,{L:()=>R});var e=s(99437),l=s(18810),v=s(96354),C=s(89417),b=s(54438),f=s(18286);let R=(()=>{class _{constructor(S){this.apiClientService=S}getLegalDocumets(){return this.apiClientService.get("legalDocuments",!1)}updateEmailAgreements(S){return this.apiClientService.put("user/agreements/email",!0,{agreements:S}).pipe((0,e.W)(y=>(0,l.$)(()=>y.error)))}updateSmsAgreements(S){return this.apiClientService.put("user/agreements/sms",!0,{agreements:S}).pipe((0,e.W)(y=>(0,l.$)(()=>y.error)))}updateOtherAgreements(S){return this.apiClientService.put("user/agreements/other",!0,{agreements:S}).pipe((0,e.W)(y=>(0,l.$)(()=>y.error)))}updateDefaultAgreements(S){return this.apiClientService.put("user/default-agreements",!0,{defaultAgreements:{order:S}}).pipe((0,e.W)(y=>(0,l.$)(()=>y.error)))}getAgreements(S,y=!1){return this.apiClientService.get("agreements",y,{"filters[module]":S}).pipe((0,v.T)(E=>(E.results=E?.results?.sort((I,D)=>Number(D.onlyTrue)-Number(I.onlyTrue)),E)),(0,e.W)(E=>(0,l.$)(()=>E.error)))}extendAgreementsFormGroup(S,y,E={},I=!1,D=!1){y.forEach(x=>{S.addControl(x?.code,new C.MJ({value:E?.[x?.code]??!1,disabled:I??!x?.editable},D?null:x?.onlyTrue?C.k0.requiredTrue:null))})}static{this.\u0275fac=function(y){return new(y||_)(b.KVO(f.f))}}static{this.\u0275prov=b.jDH({token:_,factory:_.\u0275fac,providedIn:"root"})}}return _})()},76674:(G,k,s)=>{"use strict";s.d(k,{A:()=>_});var e=s(95488),l=s.n(e),v=s(81098),C=s(28217),b=s(84320),f=s(54438),R=s(59640);let _=(()=>{class P{constructor(y){this.store=y}sendToState(y,E){this.store.dispatch(v.M.createSetOrderDraftIdAction(y.draft.orderDraftId)),this.store.dispatch(v.M.createSetOriginIdAction(E)),this.dispatchSearchParams(y),y.draft.receiverAddress&&this.store.dispatch(v.M.createUpdateReceiverAddressAction(y.draft.receiverAddress)),y.draft.senderAddress&&this.store.dispatch(v.M.createUpdateSenderAddressAction(y.draft.senderAddress)),this.dispatchSuggestedPoints(y),this.dispatchShipmentOptions(y),y.draft.customs&&this.store.dispatch(v.M.createSetOrderCustoms(y.draft.customs))}dispatchSuggestedPoints(y){const E=y?.draft?.senderPoint??null,I=y?.draft?.receiverPoint??null;!E&&!I||this.store.dispatch(v.M.createSetSuggestedPointsAction({sender:E,receiver:I}))}dispatchSearchParams(y){if(y?.draft?.shipment&&Object.keys(y.draft.shipment).length>0){const E={width:y.draft.shipment.width,length:y.draft.shipment.length,height:y.draft.shipment.height,weight:y.draft.shipment.weight,quantity:y.draft.shipment.quantity,receiverCountryId:y.draft.receiverAddress?y.draft.receiverAddress.countryId:null,
1senderCountryId:y.draft.senderAddress?y.draft.senderAddress.countryId:null,productId:y.draft.shipment.productId?y.draft.shipment.productId:null};this.store.dispatch(b.U.createSetProductAction(null)),this.store.dispatch(b.U.createSetSearchParamsAction(E)),this.store.dispatch(v.M.createInitOrderAction({params:E,readonlyReceiverPostCodes:!1,readonlySenderPostCodes:!1,selectedProduct:null,selectedTemplate:null,products:(0,C.w)(),productFilters:{}}))}}dispatchShipmentOptions(y){const E={};y.draft.content&&(E.content=y.draft.content),y.draft.purpose&&(E.purpose=y.draft.purpose),y.draft.referenceNumber&&(E.referenceNumber=y.draft.referenceNumber),l()(E)||this.store.dispatch(v.M.createSetShipmentOptionsAction(E))}static{this.\u0275fac=function(E){return new(E||P)(f.KVO(R.il))}}static{this.\u0275prov=f.jDH({token:P,factory:P.\u0275fac,providedIn:"root"})}}return P})()},81868:(G,k,s)=>{"use strict";s.d(k,{D:()=>_});var e=s(96354),l=s(18810),v=s(99437),C=s(32849),b=s.n(C),f=s(54438),R=s(18286);let _=(()=>{class P{constructor(y){this.apiClientService=y}getPoints(y){const E=b()(y,I=>null==I);return this.apiClientService.get("points",!1,E,!1,"text").pipe((0,e.T)(I=>JSON.parse(I)),(0,v.W)(I=>(0,l.$)(()=>I)))}isWeeklyDeliveryAddonChecked(y){return!!y&&void 0!==y.find(E=>"WEEKEND_DELIVERY"===E.category)}static{this.\u0275fac=function(E){return new(E||P)(f.KVO(R.f))}}static{this.\u0275prov=f.jDH({token:P,factory:P.\u0275fac,providedIn:"root"})}}return P})()},84470:(G,k,s)=>{"use strict";s.d(k,{i:()=>l});var e=s(39121);class l{static createGetUserOrdersAction(C,b,f){return{type:e.zm,payload:{page:C,itemsPerPage:b,filters:f}}}static createResetUserOrdersAction(){return{type:e.uC}}static createGetUserOrdersSuccessAction(C){return{type:e.nM,payload:C}}static createGetUserOrdersErrorsAction(C){return{type:e.L8,payload:C}}static createGetUserOrderTemplatesAction(C,b,f){return{type:e.G7,payload:{page:C,itemsPerPage:b,filters:f}}}static createGetUserOrderTemplatesSuccessAction(C){return{type:e.A2,payload:C}}static createGetUserDraftsAction(C,b,f){return{type:e.iQ,payload:{page:C,itemsPerPage:b,filters:f}}}static createGetUserDraftsSuccessAction(C){return{type:e.mc,payload:C}}static createGetSubUsersAction(){return{type:e.Rg}}static createGetSubUsersSuccessAction(C){return{type:e.vJ,payload:C}}static createInitSubUserAction(){return{type:e.m2,payload:{id:0,email:"",name:"",surname:"",phone:"",isEdit:!0}}}static createRemoveSubUserAction(C){return{type:e.KJ,payload:C}}static createRemoveSubUserSuccessAction(C){return{type:e.Wx,payload:C}}static createAddSubUserAction(C){return{type:e.le,payload:{new:C}}}static createUpdateSubUserAction(C){return{type:e.po,payload:{updated:C}}}static createGetCodsAction(C){return{type:e.I8,payload:C}}static createGetCodsSuccessAction(C){return{type:e._l,payload:C}}static createInitCodAction(){return{type:e.QX,payload:{id:0,accountNumber:"",accountName:"",accountAddress:"",accountAddressContinued:"",swiftCode:"",currency:"PLN",isDefault:!1,isEdit:!0}}}static createRemoveCodAction(C,b){return{type:e.fs,payload:{id:C,subUserId:b}}}static createRemoveCodSuccessAction(C){return{type:e.L6,payload:C}}static createAddCodAction(C){return{type:e.QN,payload:{new:C}}}static createUpdateCodAction(C){return{type:e.Kq,payload:{updated:C}}}static resetCodAction(){return{type:e.sP}}static createGetTradePlatformAccountsAction(C){return{type:e.U7,payload:C}}static createDeleteUserDraftAction(C){return{type:e.Y$,payload:C}}static createDeleteUserDraftSuccessAction(C){return{type:e.Et,payload:C}}static createGetAddressBookReceiversListAction(C,b,f){return{type:e.$L,payload:{page:C,itemsPerPage:b,filters:f}}}static createGetAddressBookReceiversListSuccessAction(C){return{type:e.FE,payload:C}}static createGetAddressBookSendersListAction(C,b,f){return{type:e.Bo,payload:{page:C,itemsPerPage:b,filters:f}}}static createGetAddressBookSendersListSuccessAction(C){return{type:e.Rc,payload:C}}static createGetTradePlatformAccountsSuccessAction(C,b){return{type:e.At,payload:{platform:C,accounts:b}}}static createGetOrderLabelsAction(C){return{type:e.Zw,payload:C}}
1static createGetOrderLabelsSuccessAction(C){return{type:e.xK,payload:C}}static createGetReturnOrderLabelsAction(C){return{type:e.OM,payload:C}}static createGetReturnOrderLabelsSuccessSection(C){return{type:e.IL,payload:C}}static createGetOrderProtocolsListAction(C){return{type:e.OD,payload:C}}static createGetOrderProtocolsListSuccessAction(C){return{type:e.YK,payload:C}}static createGetOrderProtocolsAction(C){return{type:e.hC,payload:C}}static createGetOrdersProtocolsSuccessAction(C){return{type:e.xq,payload:C}}static createGetOrderProtocolsListErrorAction(C){return{type:e.Xt,payload:C}}static createGetOrderLabelsErrorAction(C){return{type:e.iL,payload:C}}static createClearValidationErrorsAction(){return{type:e.iL,payload:null}}static createGetHistoryPrepaidAction(C,b,f){return{type:e.j4,payload:{page:C,itemsPerPage:b,filters:f}}}static createGetHistoryPrepaidSuccessAction(C){return{type:e.lL,payload:C}}static createGetPartnerProgramOrdersAction(C,b,f){return{type:e.Uk,payload:{page:C,itemsPerPage:b,filters:f}}}static createGetPartnerProgramOrdersSuccessAction(C){return{type:e.H0,payload:C}}static createGetPartnerProgramSummaryAction(){return{type:e.xY}}static createGetPartnerProgramSummarySuccessAction(C){return{type:e.xA,payload:C}}static createUpdateSimilarDraftAction(C){return{type:e.Xn,payload:C}}static createUpdateOrderCopy(C){return{type:e.Ze,payload:C}}static createGetUserInvoicesAction(C,b,f){return{type:e.mw,payload:{page:C,itemsPerPage:b,filters:f}}}static createGetUserInvoicesSuccessAction(C){return{type:e.GI,payload:C}}static createGetCodReportAction(C,b,f){return{type:e.gd,payload:{page:C,itemsPerPage:b,filters:f}}}static createGetCodReportSuccessAction(C){return{type:e.AN,payload:C}}static createGetMassInvoicesAction(C){return{type:e.DX,payload:C}}static createGetMassInvoicesSuccessAction(C){return{type:e.L9,payload:C}}static createGetMassSpecificationsAction(C){return{type:e.hn,payload:C}}static createGetMassSpecificationsSuccessAction(C){return{type:e.Bl,payload:C}}}},39121:(G,k,s)=>{"use strict";s.d(k,{$L:()=>y,A2:()=>f,AN:()=>he,At:()=>L,Bl:()=>Oe,Bo:()=>E,DX:()=>oe,Et:()=>S,FE:()=>I,G7:()=>b,GI:()=>Re,H0:()=>Qe,I8:()=>qe,IL:()=>J,KJ:()=>re,Kq:()=>xe,L6:()=>ye,L8:()=>v,L9:()=>_e,NH:()=>Se,OD:()=>F,OM:()=>X,QN:()=>ce,QX:()=>et,Rc:()=>D,Rg:()=>$,U7:()=>x,Uk:()=>be,Wx:()=>U,Xn:()=>m,Xt:()=>Be,Y$:()=>P,YK:()=>T,Ze:()=>ge,Zw:()=>j,_l:()=>Ie,fs:()=>me,gd:()=>Z,hC:()=>ue,hn:()=>Te,iL:()=>M,iQ:()=>R,j4:()=>Ke,lL:()=>Ce,le:()=>ae,m2:()=>Q,mc:()=>_,mw:()=>ee,nM:()=>l,po:()=>q,sP:()=>Xe,uC:()=>C,vJ:()=>Y,xA:()=>Ze,xK:()=>B,xY:()=>Je,xq:()=>Ve,zm:()=>e});const e="ARDN_GET_USERS_ORDERS_ACTION",l="ARDN_GET_USERS_ORDERS_SUCCESS_ACTION",v="ARDN_GET_USERS_ORDERS_FAILED_ACTION",C="ARDN_RESET_USERS_ORDERS_ACTION",b="ARDN_GET_USERS_ORDER_TEMPLATES_ACTION",f="ARDN_GET_USERS_ORDER_TEMPLATES_SUCCESS_ACTION",R="ARDN_GET_USERS_DRAFTS_ACTION",_="ARDN_GET_USERS_DRAFTS_SUCCESS_ACTION",P="ARDN_DELETE_USERS_DRAFT_ACTION",S="ARDN_DELETE_USERS_DRAFT_SUCCESS_ACTION",y="ARDN_GET_ADDRESS_BOOK_RECEIVERS_LIST_ACTION",E="ARDN_GET_ADDRESS_BOOK_SENDERS_LIST_ACTION",I="ARDN_GET_ADDRESS_BOOK_RECEIVERS_LIST_SUCCESS_ACTION",D="ARDN_GET_ADDRESS_BOOK_SENDERS_LIST_SUCCESS_ACTION",x="ARDN_GET_TRADE_PLATFORM_ACCOUNTS_ACTION",L="ARDN_GET_TRADE_PLATFORM_ACCOUNTS_SUCCESS_ACTION",$="ARDN_GET_SUBUSERS_ACTION",Y="ARDN_GET_SUBUSERS_SUCCESS_ACTION",Q="ARDN_INIT_SUBUSER_ACTION",ae="ARDN_ADD_SUBUSER_ACTION",re="ARDN_REMOVE_SUBUSER_ACTION",U="ARDN_REMOVE_SUBUSER_SUCCESS_ACTION",q="ARDN_UPDATE_SUBUSER_ACTION",j="ARDN_GET_ORDER_LABELS",B="ARDN_GET_ORDER_LABELS_SUCCESS_ACTION",M="ARDN_GET_RETURN_ORDER_LABELS_ERROR_ACTION",X="ARDN_GET_RETURN_ORDER_LABELS",J="ARDN_GET_RETURN_ORDER_LABELS_SUCCESS_ACTION",F="ARDN_GET_ORDER_PROTOCOLS_LIST_ACTION",T="ARDN_GET_ORDER_PROTOCOLS_LIST_SUCCESS_ACTION",ue="ARDN_GET_ORDER_PROTOCOLS_ACTION",Ve="ARDN_GET_ORDER_PROTOCOLS_SUCCESS_ACTION",Be="ARDN_GET_ORDER_PROTOCOLS_LIST_ERROR_ACTION",Ke="ARDN_GET_HISTORY_PREPAID_ACTION",Ce="ARDN_GET_HISTORY_PREPAID_SUCCESS_ACTION",be="ARDN_GET_PARTNER_PROGRAM_ORDERS_ACTION",Qe="ARDN_GET_PARTNER_PROGRAM_ORDERS_SUCCESS_ACTION",Je="ARDN_GET_PARTNER_PROGRAM_SUMMARY_ACTION",Ze="ARDN_GET_PARTNER_PROGRAM_SUMMARY_SUCCESS_ACTION",m="ARDN_UPDATE_SIMILAR_DRAFT_ACTION",ge="ARDN_UPDATE_ORDER_COPY",ee="ARDN_GET_USERS_INVOICES_ACTION",Re="ARDN_GET_USERS_INVOICES_SUCCESS_ACTION",Z="ARDN_GET_COD_REPORT_ACTION",he="ARDN_GET_COD_REPORT_SUCCESS_ACTION",oe="ARDN_GET_USERS_MASS_INVOICES_ACTION",_e="ARDN_GET_USERS_MASS_INVOICES_SUCCESS_ACTION",Te="ARDN_GET_USERS_MASS_SPECIFICATIONS_ACTION",Oe="ARDN_GET_USERS_MASS_SPECIFICATIONS_SUCCESS_ACTION",qe="ARDN_GET_CODS_ACTION",Ie="ARDN_GET_CODS_SUCCESS_ACTION",et="ARDN_INIT_CODS_ACTION",ce="ARDN_ADD_CODS_ACTION",me="ARDN_REMOVE_CODS_ACTION",ye="ARDN_REMOVE_CODS_SUCCESS_ACTION",xe="ARDN_UPDATE_CODS_ACTION",Xe="ARDN_RESET_COD_ACTION",pe={page:0,itemsPerPage:10,total:0},tt={ordersPage:{list:{results:[],...pe},errors:null},orderTemplatesPage:{results:[],...pe},draftsPage:{results:[],...pe},invoicesPage:{page:0,itemsPerPage:10,total:0,results:[]},codReportPage:{results:[],...pe},subusersPage:{subusers:void 0},codsPage:{cods:void 0},addressBook:{receivers:{results:[],...pe},senders:{results:[],...pe}},lastDeletedDraftId:null,tradePlatformAccounts:{allegro:[],ebay:[]},protocols:{data:null,message:null,error:null},historyPrepaidPage:{results:[],...pe},partnerProgram:{orders:{results:[],...pe},summary:null},similarDraft:null,orderCopyStatus:{loaded:null,error:null},validationErrors:null};function Se(H=tt,ie){switch(ie.type){case Y:return{...H,subusersPage:{subusers:ie.payload}};case Q:return{...H,subusersPage:{subusers:[...H.subusersPage.subusers,ie.payload]}};case U:return{...H,subusersPage:{subusers:[...H.subusersPage.subusers.filter(fe=>fe.id!==ie.payload)]}};case ae:return{...H,subusersPage:{subusers:[...H.subusersPage.subusers.map(fe=>0!==fe.id?fe:ie.payload.new)]}};case q:return{...H,subusersPage:{subusers:[...H.subusersPage.subusers.map(fe=>fe.id!==ie.payload.updated.id?fe:ie.payload.updated)]}};case Ie:return{...H,codsPage:{cods:ie.payload}};case et:return{...H,codsPage:{cods:[...H.codsPage.cods,ie.payload]}};case ye:return{...H,codsPage:{cods:[...H.codsPage.cods.filter(fe=>fe.id!==ie.payload)]}};case ce:return{...H,codsPage:{cods:[...H.codsPage.cods.map(fe=>0!==fe.id?fe:ie.payload.new)]}};case xe:return{...H,codsPage:{cods:[...H.codsPage.cods.map(fe=>fe.id!==ie.payload.updated.id?fe:ie.payload.updated)]}};case Xe:return{...H,codsPage:{cods:null}};case e:case C:return{...H,ordersPage:{list:null,errors:null}};case l:return{...H,ordersPage:{list:ie.payload,errors:null}};case v:return{...H,ordersPage:{list:{page:0,total:0,itemsPerPage:0,results:[]},errors:ie.payload}};case b:return{...H,orderTemplatesPage:null};case f:return{...H,orderTemplatesPage:ie.payload};case R:return{...H,draftsPage:null};case _:return{...H,draftsPage:ie.payload};case S:return{...H,lastDeletedDraftId:ie.payload};case y:return{...H,addressBook:{...H.addressBook,receivers:null}};case E:return{...H,addressBook:{...H.addressBook,senders:null}};case I:return{...H,addressBook:{...H.addressBook,receivers:ie.payload}};case D:return{...H,addressBook:{...H.addressBook,senders:ie.payload}};case x:switch(ie.payload){case"ALLEGRO":return{...H,tradePlatformAccounts:{...H.tradePlatformAccounts,allegro:null}};case"EBAY":return{...H,tradePlatformAccounts:{...H.tradePlatformAccounts,ebay:null}};default:throw new Error("Unsupported platform")}case L:switch(ie.payload.platform){case"ALLEGRO":return{...H,tradePlatformAccounts:{...H.tradePlatformAccounts,allegro:ie.payload.accounts}};case"EBAY":return{...H,tradePlatformAccounts:{...H.tradePlatformAccounts,ebay:ie.payload.accounts}};default:throw new Error("Unsupported platform")}case j:return{...H};case B:return{...H,validationErrors:null};case M:return{...H,validationErrors:ie.payload};case F:return{...H};case T:return{...H,protocols:{error:null,message:null,data:ie.payload}};case ue:return{...H};case Ve:return{...H,protocols:{data:[...H.protocols.data],message:ie.payload,error:null}};case Be:return{...H,protocols:{data:[...H.protocols.data],message:null,error:ie.payload}};case Ke:return{...H,historyPrepaidPage:null};case Ce:return{...H,historyPrepaidPage:ie.payload};case be:return{...H,partnerProgram:{...H.partnerProgram,orders:null}};case Qe:return{...H,partnerProgram:{...H.partnerProgram,orders:ie.payload}};case Je:return{...H,partnerProgram:{...H.partnerProgram,summary:null}};case Ze:return{...H,partnerProgram:{...H.partnerProgram,summary:ie.payload}};case m:return{...H,similarDraft:ie.payload};case ge:return{...H,orderCopyStatus:ie.payload};case ee:return{...H,invoicesPage:null};case Re:return{...H,invoicesPage:ie.payload};case Z:return{...H,codReportPage:null};case he:return{...H,codReportPage:ie.payload};case oe:case Te:return{...H};default:return H}}},28643:(G,k,s)=>{"use strict";s.d(k,{Y:()=>ge});var e=s(54438),l=s(73955),v=s(39122),C=s(98791),b=s(23971),f=s(89079),R=s(25558),_=s(89417),P=s(99437),S=s(7673),y=s(70980),E=s(51221),I=s(20382),D=s(17780),x=s(5942),L=s(54257),$=s(50919),Y=s(77880),Q=s(73199),ae=s(16443),re=s(21083),U=s(42740),q=s(23738),j=s(13945),B=s(77208),M=s(85802);function X(ee,Re){1&ee&&(e.j41(0,"div",4),e.nrm(1,"ardn-spinner"),e.k0s())}function J(ee,Re){1&ee&&(e.j41(0,"p",5),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&ee&&(e.R7$(),e.JRh(e.bMT(2,1,"ORDER_PAGE.ORDER_CUSTOMS.SELECT_TEMPLATE_DIALOG.LOAD_ERROR")))}function F(ee,Re){1&ee&&(e.j41(0,"p",6),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&ee&&(e.R7$(),e.JRh(e.bMT(2,1,"ORDER_PAGE.ORDER_CUSTOMS.SELECT_TEMPLATE_DIALOG.EMPTY")))}function T(ee,Re){if(1&ee&&(e.j41(0,"span",11)(1,"span",12),e.EFF(2),e.k0s(),e.nrm(3,"ardn-carrier-logo",13),e.k0s()),2&ee){const Z=Re.$implicit,he=e.XpG(2);e.R7$(2),e.JRh(Z.name),e.R7$(),e.Y8G("logosMap",he.carrierLogosMap())("carrierName",Z.carrierName)}}function ue(ee,Re){if(1&ee&&(e.j41(0,"ardn-form-field")(1,"span",9),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"ardn-drop-down",10),e.nI1(5,"translate"),e.DNE(6,T,4,3,"ng-template",null,0,e.C5r),e.k0s()()),2&ee){const Z=e.XpG();e.R7$(2),e.JRh(e.bMT(3,6,"ORDER_PAGE.ORDER_CUSTOMS.SELECT_TEMPLATE_DIALOG.LABEL")),e.R7$(2),e.Y8G("formControl",Z.templateControl)("dataSource",Z.dataSource())("searchEnabled",!0)("displayCountSummary",!1)("placeholder",e.bMT(5,8,"ORDER_PAGE.ORDER_CUSTOMS.SELECT_TEMPLATE_DIALOG.PLACEHOLDER"))}}function Ve(ee,Re){if(1&ee){const Z=e.RV6();e.j41(0,"button",14),e.bIt("click",function(){e.eBV(Z);const oe=e.XpG();return e.Njj(oe.submit())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&ee){const Z=e.XpG();e.Y8G("disabled",!Z.templateControl.value||Z.loading()||Z.loadError()),e.R7$(),e.SpI(" ",e.bMT(2,2,"ORDER_PAGE.ORDER_CUSTOMS.SELECT_TEMPLATE_DIALOG.SUBMIT")," ")}}let Be=(()=>{class ee{constructor(Z,he,oe,_e,Te,Oe){this.data=Z,this.dialogRef=he,this.destroyRef=oe,this.dataSourceArray=_e,this.customsDeclarationTemplateService=Te,this.priceService=Oe,this.templateControl=new _.MJ(null),this.loading=(0,e.vPA)(!0),this.loadError=(0,e.vPA)(!1),this.hasTemplates=(0,e.vPA)(!0),this.dataSource=(0,e.vPA)(this.dataSourceArray.create([],"name")),this.carrierLogosMap=(0,e.vPA)(null),this.priceService.getCarriersFilterList().pipe((0,P.W)(()=>(0,S.of)({carriers:[]})),(0,f.pQ)(this.destroyRef)).subscribe(({carriers:qe})=>this.carrierLogosMap.set(new Map(qe.map(Ie=>[Ie.carrierName,Ie.logo])))),this.customsDeclarationTemplateService.getTemplates({senderCountryId:this.data.senderCountryId,receiverCountryId:this.data.receiverCountryId,carrierName:this.data.carrierName,limit:100}).pipe((0,P.W)(()=>(this.loadError.set(!0),(0,S.of)({results:[],total:0,offset:0,limit:100}))),(0,y.j)(()=>this.loading.set(!1)),(0,f.pQ)(this.destroyRef)).subscribe(({results:qe})=>{this.hasTemplates.set(qe.length>0),this.dataSource.set(this.dataSourceArray.create(qe,"name"))})}submit(){this.templateControl.value&&this.dialogRef.close(this.templateControl.value)}close(){this.dialogRef.close(void 0)}static{this.\u0275fac=function(he){return new(he||ee)(e.rXU(E.Q),e.rXU(Y.c),e.rXU(e.abz),e.rXU(Q.m),e.rXU(ae.M),e.rXU(re.d))}}static{this.\u0275cmp=e.VBU({type:ee,selectors:[["ardn-select-declaration-template-dialog"]],standalone:!0,features:[e.aNF],decls:17,vars:11,consts:[["resultItemTemplate",""],[1,"modal-title"],["ardnMiniIconButton","","type","button","color","secondary",1,"close-btn",3,"click"],["aria-hidden","true",1,"fas","fa-xmark"],[1,"loading-container"],[1,"form-error"],[1,"empty-message"],["ardnButton","","type","button","color","accent",3,"disabled"],["ardnButton","","type","button","color","outline-secondary",3,"click"],["label",""],["ardnInput","","displayField","name",3,"formControl","dataSource","searchEnabled","displayCountSummary","placeholder"],[1,"template-option"],[1,"template-option-name"],["size","sm",3,"logosMap","carrierName"],["ardnButton","","type","button","color","accent",3,"click","disabled"]],template:function(he,oe){1&he&&(e.j41(0,"header")(1,"h1",1),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"button",2),e.nI1(5,"translate"),e.bIt("click",function(){return oe.close()}),e.nrm(6,"i",3),e.k0s()(),e.j41(7,"main"),e.DNE(8,X,2,0,"div",4)(9,J,3,3,"p",5)(10,F,3,3,"p",6)(11,ue,8,10,"ardn-form-field"),e.k0s(),e.j41(12,"footer"),e.DNE(13,Ve,3,4,"button",7),e.j41(14,"button",8),e.bIt("click",function(){return oe.close()}),e.EFF(15),e.nI1(16,"translate"),e.k0s()()),2&he&&(e.R7$(2),e.JRh(e.bMT(3,5,"ORDER_PAGE.ORDER_CUSTOMS.SELECT_TEMPLATE_DIALOG.TITLE")),e.R7$(2),e.BMQ("aria-label",e.bMT(5,7,"COMMON.CLOSE")),e.R7$(4),e.vxM(oe.loading()?8:oe.loadError()?9:oe.hasTemplates()?11:10),e.R7$(5),e.vxM(oe.hasTemplates()?13:-1),e.R7$(2),e.SpI(" ",e.bMT(16,9,"COMMON.CANCEL")," "))},dependencies:[_.X1,_.BC,_.l_,l.h,l.D9,I.t,U.H,q.R,D.L,j.K,B.k,M.s,x.v,L.t,$.P],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:40px;font-size:16px;color:#1c274c;min-width:420px}header[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:flex-start;gap:16px}
1header[_ngcontent-%COMP%]   .modal-title[_ngcontent-%COMP%]{flex:1;margin:0;font-weight:600;font-size:30px}.close-btn[_ngcontent-%COMP%]{color:#1c274c;flex-shrink:0;transition:all .2s ease-in-out;display:flex;align-items:center;justify-content:center;margin:0}.close-btn[_ngcontent-%COMP%]:hover{transform:rotate(90deg)}.close-btn[_ngcontent-%COMP%]:active{transform:translateY(2px) rotate(90deg)!important}main[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}main[_ngcontent-%COMP%]   .form-error[_ngcontent-%COMP%]{margin:0}main[_ngcontent-%COMP%]   .empty-message[_ngcontent-%COMP%]{margin:0}.loading-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;margin:10px}.template-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%}.template-option-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:20px;justify-content:center}footer[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{min-width:160px}"]})}}return ee})();var Ke=s(45170),Ce=s(15930),be=s(59640),Qe=s(31576);function Je(ee,Re){1&ee&&(e.j41(0,"p",7),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&ee&&(e.R7$(),e.JRh(e.bMT(2,1,"COMMON.ERRORS.REQUIRED")))}function Ze(ee,Re){1&ee&&(e.j41(0,"p",7),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&ee&&(e.R7$(),e.JRh(e.bMT(2,1,"COMMON.ERRORS.FORM_HAS_ERRORS")))}function m(ee,Re){if(1&ee&&(e.j41(0,"div"),e.DNE(1,Je,3,3,"p",7)(2,Ze,3,3,"p",7),e.k0s()),2&ee){const Z=e.XpG();e.R7$(),e.vxM(Z.valid()||Z.hasOrderCustomsErrors()?-1:1),e.R7$(),e.vxM(!Z.isReadOnly()&&Z.hasOrderCustomsErrors()?2:-1)}}let ge=(()=>{class ee{get width(){return this.windowsService?.nativeWindow?.innerWidth}constructor(Z,he,oe,_e,Te){this.windowsService=Z,this.dialogService=he,this.translateService=oe,this.store=_e,this.countryService=Te,this.valid=(0,e.vPA)(!1),this.orderFormType=(0,e.hFB)(),this.order=(0,e.hFB)(),this.carrierName=(0,e.hFB)(),this.orderCustomsData=(0,e.geq)(),this.validationErrors=(0,e.geq)(null),this.translations=(0,e.hFB)(),this.isReadOnly=(0,e.hFB
1)(!1),this.isFormValid=(0,e.CGW)(),(0,e.QZP)(()=>{this.orderCustomsData()&&this.isValid(!0)},{allowSignalWrites:!0}),this.store.select(b.Nz).pipe((0,f.pQ)(),(0,R.n)(Oe=>this.countryService.getCountryByCountryId(Oe))).subscribe(Oe=>{Oe&&(this.receiverCountryId=(0,e.vPA)(Oe.id))}),this.store.select(b.ji).pipe((0,f.pQ)(),(0,R.n)(Oe=>this.countryService.getCountryByCountryId(Oe))).subscribe(Oe=>{Oe&&(this.senderCountryId=(0,e.vPA)(Oe.id))})}openTemplateSelector(){this.dialogService.open(Be,{data:{senderCountryId:this.senderCountryId?this.senderCountryId():this.order()?.senderAddress?.countryId,receiverCountryId:this.receiverCountryId?this.receiverCountryId():this.order()?.receiverAddress?.countryId,carrierName:this.carrierName()}}).afterClosed$.subscribe(Z=>{Z&&this.open(Z.fields)})}open(Z){const he=this.valid();this.isValid(!1),this.dialogService.open(C.K,{hasBackdrop:!1,height:"95%",minWidth:"95%",data:{titleText:this.translateService.instant("ORDER_PAGE.ORDER_CUSTOMS.ORDER_DECLARATION"),actionButtonText:this.translateService.instant(this.translations()?.action),receiverCountryId:this.receiverCountryId?this.receiverCountryId():this.order()?.receiverAddress?.countryId,order:this.order(),orderCustomsData:Z??this.orderCustomsData()?.fields,isReadOnly:this.isReadOnly(),serverSideErrors:this.validationErrors(),initialValidity:he}}).afterClosed$.subscribe(oe=>{"boolean"==typeof oe?this.isValid(oe):oe&&(this.isValid(!0),this.orderCustomsData.set({...this.orderCustomsData(),fields:oe}),this.validationErrors&&Object.keys(this.validationErrors().fields).forEach(Te=>{Te.includes("customs")&&this.serverSideValidityChanged({isValid:!0,key:Te})}))})}isValid(Z){this.valid.set(Z),this.isFormValid.emit(Z)}validate(){return this.valid()}hasOrderCustomsErrors(){return!!this.validationErrors()&&Object.keys(this.validationErrors()?.fields).some(Z=>Z.startsWith("customs"))}serverSideValidityChanged(Z){Z?.isValid&&delete this.validationErrors()?.fields?.[Z?.key]}static{this.\u0275fac=function(he){return new(he||ee)(e.rXU(Ke.s),e.rXU(Ce.o),e.rXU(l.c$),e.rXU(be.il),e.rXU(Qe.o))}}static{this.\u0275cmp=e.VBU({type:ee,selectors:[["ardn-order-customs"]],inputs:{orderFormType:[1,"orderFormType"],order:[1,"order"],carrierName:[1,"carrierName"],orderCustomsData:[1,"orderCustomsData"],validationErrors:[1,"validationErrors"],translations:[1,"translations"],isReadOnly:[1,"isReadOnly"]},outputs:{orderCustomsData:"orderCustomsDataChange",validationErrors:"validationErrorsChange",isFormValid:"isFormValid"},standalone:!0,features:[e.aNF],decls:16,vars:17,consts:[[1,"invoice-generator-details__container"],["type","button",1,"btn","btn--primary","btn--block","select-template-btn",3,"click","disabled"],[1,"divider"],[1,"btn","btn--block","generate-declaration-btn",3,"click","disabled","ardnTooltipster"],[1,"icon","icon-download"],["href","assets/img/sprites.svg#icon-download"],[1,"link-description",3,"innerText"],[1,"form-error"]],template:function(he,oe){if(1&he&&(e.j41(0,"div",0)(1,"fieldset")(2,"button",1),e.bIt("click",function(){return oe.openTemplateSelector()}),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"div",2),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"button",3),e.nI1(9,"translate"),e.bIt("click",function(){return oe.open()}),e.qSk(),e.j41(10,"svg",4),e.nrm(11,"use",5),e.k0s(),e.joV(),e.nrm(12,"span",6),e.nI1(13,"translate"),e.nI1(14,"translate"),e.k0s(),e.DNE(15,m,3,2,"div"),e.k0s()()),2&he){let _e,Te;e.R7$(2),e.Y8G("disabled",oe.isReadOnly()),e.R7$(),e.SpI(" ",e.bMT(4,7,"ORDER_PAGE.ORDER_CUSTOMS.SELECT_TEMPLATE_BUTTON")," "),e.R7$(3),e.JRh(e.bMT(7,9,"COMMON.OR")),e.R7$(2),e.Y8G("disabled","EDIT"===oe.orderFormType()&&!oe.orderCustomsData())("ardnTooltipster",e.bMT(9,11,null==(_e=oe.translations())?null:_e.generate)),e.R7$(4),e.Y8G("innerText",oe.orderCustomsData?e.bMT(13,13,null==(Te=oe.translations())?null:Te.edit):e.bMT(14,15,null==(Te=oe.translations())?null:Te.generate)),e.R7$(3),e.vxM(!oe.valid()||oe.hasOrderCustomsErrors()?15:-1)}},dependencies:[l.h,l.D9,v.d],styles:['.btn[_ngcontent-%COMP%]{height:initial;line-height:initial;padding:.6em 1.7em}.btn[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%]{font-size:1.5em;width:1.5em;margin-left:0}.divider[_ngcontent-%COMP%]{margin:12px 0;display:flex;align-items:center;text-align:center;color:#5b5b5b}.divider[_ngcontent-%COMP%]:before, .divider[_ngcontent-%COMP%]:after{content:"";flex:1;border-bottom:1px solid #9c9c9c}.divider[_ngcontent-%COMP%]:not(:empty):before{margin-right:1em}.divider[_ngcontent-%COMP%]:not(:empty):after{margin-left:1em}']})}}return ee})()},49427:(G,k,s)=>{"use strict";s.d(k,{y:()=>e});const e="gk_order_template_restore"},54085:(G,k,s)=>{"use strict";function e(l){return l?.id?{id:l.id,type:l.type,name:l.name,address:l.address,city:l.city,postCode:l.postCode,openingHours:l.openingHours,latitude:Number(l.latitude),longitude:Number(l.longitude),cashOnDeliveryAvailable:!1}:null}s.d(k,{u:()=>e})},45561:(G,k,s)=>{"use strict";s.r(k),s.d(k,{OrderModule:()=>Zh});var e=s(54438),l=s(60177),v=s(59640),C=s(77339),b=s(51188),f=s(73955),R=s(21626),_=s(62770),P=s(15187),S=s(49427),y=s(48125),E=s.n(y),I=s(32561),D=s.n(I),x=s(45065),L=s.n(x),$=s(59176),Y=s.n($),Q=s(17295),ae=s.n(Q),re=s(21413),U=s(5964),q=s(84572),j=s(23294),B=s(56977),M=s(96697),X=s(96354),J=s(96458),F=s(81098),T=s(23971),ue=s(99913),Ve=s(53452);let Be=(()=>{class i{convert(t){return{...Y()(t,["street","houseNumber","apartmentNumber","city","postCode","countryId","phone","email"]),name:"COMPANY"===t.type?t.companyName:t.name+" "+t.surname}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ke=s(43712),Ce=s.n(Ke),be=s(31576);let Qe=(()=>{class i{constructor(t){this.countryService=t}cleanPostCodeIfCountryDoesNotNeedIt(t){return this.countryService.getCountryCached(t.countryId).pipe((0,X.T)(n=>n.hasPostCodes?t:Ce()(t,["postCode"])))}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(be.o))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Je=s(41885);let Ze=(()=>{class i{constructor(t,n){this.citiesService=t,this.store=n}createUpdateSenderAddressAction(t){this.store.dispatch(F.M.createUpdateSenderAddressAction(t)),this.validAddressBookCityName(t,this.updateSender.bind(this))}createUpdateReceiverAddressAction(t){this.store.dispatch(F.M.createUpdateReceiverAddressAction(t)),this.validAddressBookCityName(t,this.updateReceiver.bind(this))}validAddressBookCityName(t,n){const r=t?.countryId,o=t?.postCode;!r||!o||setTimeout(()=>{this.citiesService.getCities(r,o).pipe((0,M.s)(1),(0,X.T)(u=>u.some(g=>g===t?.city)),(0,U.p)(u=>u)).subscribe({next:()=>{n(t)},error:()=>{n(t)}})})}updateSender(t){this.store.dispatch(F.M.createUpdateSenderAddressAction({...t,city:t.city}))}updateReceiver(t){this.store.dispatch(F.M.createUpdateReceiverAddressAction({...t,city:t.city}))}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(Je.d),e.KVO(v.il))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var m=s(89417),ge=s(39122),ee=s(5942),Re=s(38203),Z=s(14704),he=s(60448),oe=s(60635),_e=s(97144),Te=s(95488),Oe=s.n(Te),qe=s(32849),Ie=s.n(qe),et=s(88141),ce=s(70152),me=s(84320),ye=s(56089),xe=s(25523),Xe=s(98067),pe=s(53193),tt=s(73199),Se=s(99437),H=s(18810),ie=s(18286);let fe=(()=>{class i{constructor(t){this.apiClientService=t}getCountryStates(t){return this.apiClientService.get("states",!1,{countryId:t}).pipe((0,Se.W)(n=>(0,H.$)(()=>n)))}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(ie.f))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function qi(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-drop-down",1),e.bIt("ngModelChange",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.selectionChanged(r))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("dataSource",t.dataSource)("ngModel",null)("searchEnabled",!0)}}let Ht=(()=>{class i{constructor(t,n,r,o){this.store=t,this.dataSourceArray=n,this.changeDetection=r,this.stateService=o,this.countryId=(0,e.hFB
1)(),this.propagateChange=()=>{}}ngOnChanges(t){this.countryId()&&(this.stateService.getCountryStates(this.countryId()).subscribe(n=>{this.setDataSource(n)}),this.store.select((0,pe.D7)(2)).pipe((0,U.p)(n=>!!n&&"ACTIVE"===n.state)).subscribe(()=>{t.countryId&&this.setRememberedState()}))}setRememberedState(){this.dataSource&&(0,q.z)([this.store.select(T.mG),this.store.select(T.Eh),this.dataSource?.getObservable()]).subscribe(([t,n,r])=>{if(r?.results?.length>0&&(n||t)){const o=this.getRememberedState(r,t),u=this.getRememberedState(r,n);if(o||u)return this.childDropdown.writeValue(o??u),void this.childDropdown.refresh();this.store.dispatch(F.M.createResetStateIdAction())}})}selectionChanged(t){this.propagateChange(t.id)}registerOnChange(t){this.propagateChange=t}writeValue(t){}registerOnTouched(){}setDataSource(t){const n=t.map(r=>({...r,nameWithCode:`${r?.name} (${r?.code})`}));this.dataSource=this.dataSourceArray.create(n,"nameWithCode"),this.changeDetection.detectChanges()}getRememberedState(t,n){return t?.results?.find(r=>r?.id===n)}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(v.il),e.rXU(tt.m),e.rXU(e.gRc),e.rXU(fe))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-state-chooser"]],viewQuery:function(n,r){if(1&n&&e.GBs(ee.v,5),2&n){let o;e.mGM(o=e.lsd())&&(r.childDropdown=o.first)}},inputs:{countryId:[1,"countryId"]},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.OA$,e.aNF],decls:1,vars:1,consts:[["ngClass","select2dropdown--small","displayField","nameWithCode",3,"dataSource","ngModel","searchEnabled"],["ngClass","select2dropdown--small","displayField","nameWithCode",3,"ngModelChange","dataSource","ngModel","searchEnabled"]],template:function(n,r){1&n&&e.DNE(0,qi,1,3,"ardn-drop-down",0),2&n&&e.vxM(r.dataSource?0:-1)},dependencies:[ee.v,m.YN,m.BC,m.vS],encapsulation:2,changeDetection:0})}}return i})();const Bn=["*"];function Rt(i,p){1&i&&(e.j41(0,"div",3)(1,"a",4)(2,"p"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,1,"PRODUCT_ADDONS.TRANSPORT_PAID_BY_RECEIVER_INFO")))}let zt=(()=>{class i{constructor(t,n){this.fb=t,this.changeDetector=n,this.showInfo=!1,this.propagateChange=()=>null,this.freightForwardForm=this.fb.group({freightForward:!1})}ngOnInit(){this.freightForwardForm.get("freightForward").valueChanges.subscribe(t=>{this.showInfo=t,this.writeAndPropagateValue(t)})}registerOnChange(t){this.propagateChange=t}writeAndPropagateValue(t){this.writeValue(t),this.propagateChange(t),this.changeDetector.markForCheck()}writeValue(t){this.showInfo=!!t,this.freightForwardForm.get("freightForward").setValue(!!t,{emitEvent:!1}),this.changeDetector.markForCheck()}registerOnTouched(){}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(m.ok),e.rXU(e.gRc))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-freight-forward-category"]],standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.aNF],ngContentSelectors:Bn,decls:10,vars:5,consts:[[3,"formGroup"],[1,"checkbox"],["type","checkbox","formControlName","freightForward"],[1,"alert","alert--success"],[1,"alert__content"]],template:function(n,r){1&n&&(e.NAR(),e.j41(0,"fieldset",0)(1,"div")(2,"div",1)(3,"label"),e.nrm(4,"input",2),e.j41(5,"span"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()(),e.DNE(8,Rt,5,3,"div",3),e.k0s(),e.SdG(9),e.k0s()),2&n&&(e.Y8G("formGroup",r.freightForwardForm),e.R7$(6),e.SpI(" ",e.bMT(7,3,"PRODUCT_ADDONS.OPTIONS.TRANSPORT_PAID_BY_RECEIVER"),""),e.R7$(2),e.vxM(r.showInfo?8:-1))},dependencies:[f.h,f.D9,m.X1,m.Zm,m.BC,m.cb,m.j4,m.JD],styles:[".alert[_ngcontent-%COMP%]{margin-top:12px;margin-bottom:15px}.alert[_ngcontent-%COMP%]:after{display:none}.alert[_ngcontent-%COMP%]:before{display:none}.alert[_ngcontent-%COMP%]   .alert__content[_ngcontent-%COMP%]{padding:13px 20px;font-size:inherit}.alert[_ngcontent-%COMP%]   .alert__content[_ngcontent-%COMP%]:after{display:none}.alert[_ngcontent-%COMP%]   .alert__content[_ngcontent-%COMP%]:before{display:none}.order-setup__input[_ngcontent-%COMP%]{width:100%}.checkbox[_ngcontent-%COMP%]{margin:0}fieldset[_ngcontent-%COMP%]{padding:10px 20px;border-radius:5px;border:1px solid #dcdcdc}"]})}}return i})();var Pe=s(76357),Tt=s(77215);let Xn=(()=>{class i{constructor(t,n,r){this.parentFormGroup=t,this.el=n,this.renderer=r}ngAfterViewChecked(){this.parentFormGroup&&this.fieldName&&this.isRequired(this.fieldName)?this.showElement():this.hideElement()}isRequired(t){const n=this.parentFormGroup?.form?.get(t);return!(!n||!n.validator||!n.validator({})?.required)}hideElement(){this.renderer?.setStyle(this.el?.nativeElement,"display","none")}showElement(){this.renderer?.setStyle(this.el?.nativeElement,"display","inline")}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(m.j4,8),e.rXU(e.aKT),e.rXU(e.sFG))}}static{this.\u0275dir=e.FsC({type:i,selectors:[["","ardnHideIfNotRequired",""]],inputs:{fieldName:[0,"ardnHideIfNotRequired","fieldName"]},standalone:!0})}}return i})();var ut=s(1358),z=s(89079),ve=s(7673),De=s(25558);let Yn=(()=>{class i{constructor(t){this.apiClientService=t}search(t){return this.apiClientService.get("geocode/search",!1,{q:t})}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(ie.f))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const eo=i=>({"address-autocomplete__input--open":i});function It(i,p){if(1&i){const t=e.RV6();e.j41(0,"li",9),e.bIt("click",function(){const r=e.eBV(t).$implicit,o=e.XpG(3);return e.Njj(o.select(r))}),e.EFF(1),e.k0s()}if(2&i){const t=p.$implicit,n=e.XpG(3);e.Y8G("ardnDataTestId",n.dataTestId()+"-option"),e.R7$(),e.SpI(" ",t.fullAddress," ")}}function Wn(i,p){if(1&i&&(e.j41(0,"ul",6),e.Z7z(1,It,2,2,"li",8,e.Vm6),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Dyx(t.results)}}function Kt(i,p){1&i&&(e.j41(0,"div",7),e.nrm(1,"div",10),e.EFF(2),e.nI1(3,"translate"),e.k0s()),2&i&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"COMMON.LOADING")," "))}function Hn(i,p){1&i&&(e.j41(0,"div",7),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.NOT_FOUND")," "))}function pt(i,p){if(1&i&&(e.j41(0,"div",2)(1,"div",3)(2,"span",4)(3,"span",5),e.DNE(4,Wn,3,0,"ul",6)(5,Kt,4,3,"div",7)(6,Hn,3,3,"div",7),e.k0s()()()()),2&i){const t=e.XpG();e.R7$(4),e.vxM(t.results.length?4:-1),e.R7$(),e.vxM(t.isLoading?5:-1),e.R7$(),e.vxM(t.isLoading||t.results.length?-1:6)}}let Qt=(()=>
1{class i{static{this.debounceMs=350}static{this.minQueryLength=5}constructor(t,n,r){this.geocodeService=t,this.changeDetectorRef=n,this.elementRef=r,this.placeholder=(0,e.hFB)(""),this.dataTestId=(0,e.hFB)("ardn-address-autocomplete"),this.displayValue=(0,e.hFB)(""),this.addressSelected=(0,e.CGW)(),this.queryControl=new m.MJ(""),this.results=[],this.isLoading=!1,this.displayResults=!1,this.destroyRef=(0,e.WQX)(e.abz),(0,e.QZP)(()=>{this.queryControl.setValue(this.displayValue(),{emitEvent:!1})})}ngOnInit(){this.queryControl.valueChanges.pipe((0,X.T)(t=>(t??"").trim()),(0,ce.B)(i.debounceMs),(0,j.F)(),(0,et.M)(t=>this.beforeSearch(t)),(0,De.n)(t=>this.isSearchable(t)?this.geocodeService.search(t).pipe((0,Se.W)(()=>(0,ve.of)([]))):(0,ve.of)([])),(0,z.pQ)(this.destroyRef)).subscribe(t=>{this.results=t,this.isLoading=!1,this.changeDetectorRef.markForCheck()})}onDocumentClick(t){this.elementRef.nativeElement.contains(t.target)||this.close()}select(t){this.addressSelected.emit(t),this.queryControl.setValue(t.fullAddress,{emitEvent:!1}),this.close()}beforeSearch(t){const n=this.isSearchable(t);this.displayResults=n,this.isLoading=n,n||(this.results=[]),this.changeDetectorRef.markForCheck()}isSearchable(t){return t.length>=i.minQueryLength}close(){this.displayResults=!1,this.changeDetectorRef.markForCheck()}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Yn),e.rXU(e.gRc),e.rXU(e.aKT))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-address-autocomplete"]],hostBindings:function(n,r){1&n&&e.bIt("click",function(u){return r.onDocumentClick(u)},!1,e.EBC)},inputs:{placeholder:[1,"placeholder"],dataTestId:[1,"dataTestId"],displayValue:[1,"displayValue"]},outputs:{addressSelected:"addressSelected"},standalone:!0,features:[e.aNF],decls:4,vars:9,consts:[[1,"address-autocomplete"],["autocomplete","off",1,"address-autocomplete__input","input",3,"formControl","placeholder","ngClass","ardnDataTestId"],[1,"address-autocomplete__dropdown"],[1,"select2-container","select2-container--default","select2-container--open"],[1,"select2-dropdown","select2-dropdown--bellow"],[1,"select2-results"],[1,"select2-results__options"],[1,"select2-results__option","select2-results__message"],[1,"select2-results__option","address-autocomplete__option",3,"ardnDataTestId"],[1,"select2-results__option","address-autocomplete__option",3,"click","ardnDataTestId"],[1,"loader","loader--green"]],template:function(n,r){1&n&&(e.j41(0,"div",0),e.nrm(1,"input",1),e.nI1(2,"translate"),e.DNE(3,pt,7,3,"div",2),e.k0s()),2&n&&(e.R7$(),e.Y8G("formControl",r.queryControl)("placeholder",e.bMT(2,5,r.placeholder()))("ngClass",e.eq3(7,eo,r.displayResults))("ardnDataTestId",r.dataTestId()+"-input"),e.R7$(2),e.vxM(r.displayResults?3:-1))},dependencies:[m.X1,m.me,m.BC,m.l_,l.YU,f.h,f.D9,Z.Z],styles:[".address-autocomplete[_ngcontent-%COMP%]{position:relative;width:100%}.address-autocomplete__input[_ngcontent-%COMP%]{width:100%}.address-autocomplete__input--open[_ngcontent-%COMP%]{border-bottom-left-radius:0;border-bottom-right-radius:0}.address-autocomplete__dropdown[_ngcontent-%COMP%]{position:absolute;z-index:1000;width:100%}.address-autocomplete__option[_ngcontent-%COMP%]{cursor:pointer}.address-autocomplete__option[_ngcontent-%COMP%]:hover{background-color:#0000000d}"],changeDetection:0})}}return i})();var nt=s(25399),Jt=s(35082),Zt=s(6742);let Dt=(()=>{class i{transform(t){if(!t)return"";let n="";return t.street&&(n+=t.street),t.houseNumber&&(n+=" "+t.houseNumber),n=n.trim(),t.apartmentNumber&&(n+="/"+t.apartmentNumber),n}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=e.EJ8({name:"ardnAddressFirstLine",type:i,pure:!0,standalone:!0})}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const yt=i=>({"none-pointer-events":i}),zn=i=>[i],Kn=(i,p)=>[i,p];function qt(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",14)(1,"div",10)(2,"label",2),e.EFF(3),e.nI1(4,"translate"),e.j41(5,"span",3),e.
1EFF(6,"*"),e.k0s(),e.nrm(7,"ardn-country-post-code-sample",31),e.k0s(),e.j41(8,"ardn-post-code-drop-down",32),e.nI1(9,"translate"),e.nI1(10,"translate"),e.bIt("countrySelected",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.updateCityName(r))}),e.k0s(),e.j41(11,"ardn-field-validator",5),e.EFF(12),e.k0s()()()}if(2&i){let t,n;const r=e.XpG();e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-postCode-label"),e.R7$(),e.SpI(" ",e.bMT(4,17,"COMMON.ADDRESS.POST_CODE")," "),e.R7$(4),e.Y8G("country",r.country),e.R7$(),e.FS9("id","SENDER"===r.side()?"postCode-third-step-sender":"postCode-third-step-receiver"),e.Y8G("side",r.side())("formGroup",r.addressDataForm)("country",r.country)("readonly",r.addressDataForm.get("readonlyPostCode").value||r.isFieldLocked("postCode"))("ngClass",e.eq3(23,yt,r.addressDataForm.get("readonlyPostCode").value||r.isFieldLocked("postCode")))("readonlyTooltip",e.bMT(9,19,"ORDER_PAGE.READONLY_POST_CODE_TOOLTIP"))("placeholder",e.bMT(10,21,"ORDER_PAGE.ENTER_POSTCODE"))("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-ardn-post-code-drop-down"),e.R7$(3),e.Y8G("clientSideValidation",r.addressDataForm.get("postCode"))("clientErrorMessage","COMMON.ERRORS.TOO_SHORT")("serverSideValidation",null==(t=r.serverSideValidationErrors())?null:t.fields["address[postCode]"])("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-postCode-field-validator"),e.R7$(),e.SpI(" ",null==(n=r.serverSideValidationErrors())?null:n.fields.addressPostCode," ")}}
1function Qn(i,p){1&i&&(e.j41(0,"span",3),e.EFF(1,"*"),e.k0s())}function Jn(i,p){if(1&i&&(e.j41(0,"div",10)(1,"label",2),e.EFF(2),e.nI1(3,"translate"),e.DNE(4,Qn,2,0,"span",3),e.nI1(5,"async"),e.k0s(),e.nrm(6,"ardn-state-chooser",33)(7,"ardn-field-validator",5),e.k0s()),2&i){let t;const n=e.XpG();e.R7$(),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+n.side()+"-stateId-label"),e.R7$(),e.SpI(" ",e.bMT(3,9,"COMMON.ADDRESS.STATE")," "),e.R7$(2),e.vxM(e.bMT(5,11,n.stateIdRequired)?4:-1),e.R7$(2),e.Y8G("countryId",null==n.country?null:n.country.id)("ardnDataTestId","ardn-order-addresses-step-form-"+n.side()+"-ardn-state-chooser"),e.R7$(),e.Y8G("clientSideValidation",n.addressDataForm.get("stateId"))("clientErrorMessage","COMMON.ERRORS.REQUIRED")("serverSideValidation",null==(t=n.serverSideValidationErrors())?null:t.fields["address[stateId]"])("ardnDataTestId","ardn-order-addresses-step-form-"+n.side()+"-stateId-validator")}}function Zn(i,p){1&i&&(e.j41(0,"span",3),e.EFF(1,"*"),e.k0s())}function en(i,p){1&i&&(e.j41(0,"span",3),e.
1EFF(1,"*"),e.k0s())}function qn(i,p){if(1&i&&(e.j41(0,"div",10)(1,"label",2),e.EFF(2),e.nI1(3,"translate"),e.j41(4,"span",34),e.EFF(5),e.nI1(6,"translate"),e.k0s()(),e.nrm(7,"input",35)(8,"ardn-field-validator",5),e.k0s()),2&i){let t;const n=e.XpG();e.R7$(),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+n.side()+"-contactPhone-label"),e.R7$(),e.SpI(" ",e.bMT(3,9,"COMMON.CUSTOMER_PHONE_NUMBER")," "),e.R7$(3),e.JRh(e.bMT(6,11,"COMMON.OPTIONAL")),e.R7$(2),e.FS9("id","SENDER"===n.side()?"contactPhone-third-step-sender":""),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+n.side()+"-contactPhone-input"),e.R7$(),e.Y8G("clientSideValidation",null==n.addressDataForm?null:n.addressDataForm.get("contactPhone"))("clientErrorMessage","COMMON.ERRORS.PHONE")("serverSideValidation",null==(t=n.serverSideValidationErrors())?null:t.fields["address[contactPhone]"])("ardnDataTestId","ardn-order-addresses-step-form-"+n.side()+"-contactPhone-field-validator")}}function tn(i,p){if(1&i&&(e.j41(0,"div",10)(1,"label",2),e.EFF(2),e.nI1(3,"translate"),e.j41(4,"span",34),e.EFF(5),e.nI1(6,"translate"),e.k0s()(),e.nrm(7,"input",36)(8,"ardn-field-validator",5),e.k0s()),2&i){let t;const n=e.XpG(2);e.R7$(),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+n.side()+"-nip-label"),e.R7$(),e.SpI(" ",e.bMT(3,9,"COMMON.ADDRESS.NIP")," "),e.R7$(3),e.JRh(e.bMT(6,11,"COMMON.OPTIONAL")),e.R7$(2),e.FS9("id","RECEIVER"!==n.side()?"nip-third-step-receiver":"nip-third-step-sender"),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+n.side()+"-nip-input"),e.R7$(),e.Y8G("clientSideValidation",n.addressDataForm.get("nip"))("clientErrorMessage","COMMON.ERRORS.NIP")("serverSideValidation",null==(t=n.serverSideValidationErrors())?null:t.fields["address[nip]"])("ardnDataTestId","ardn-order-addresses-step-form-"+n.side()+"-nip-field-validator")}}function to(i,p){if(1&i&&(e.j41(0,"ardn-product-addon-freight-forward-category",30),e.DNE(1,tn,9,13,"div",10),e.k0s()),2&i){let t;const n=e.XpG();e.R7$(),e.vxM(null!=(t=n.addressDataForm.get("isFreightForward"))&&t.value?1:-1)}}let nn=(()=>{class i extends he.m{constructor(t,n,r,o,u,g,A,N){super(g,t,u),this.scrollService=t,this.postCodeService=n,this.store=r,this.changeDetector=o,this.countryService=u,this.formBuilder=g,this.properErrorMessageService=A,this.addressFirstLinePipe=N,this.side=(0,e.hFB)(),this.pickupFromPoint=(0,e.hFB)(),this.selectedCountryMessage="",this.disablePostCode=!1,this.isUserInPartnerProgram=!1,this.isFreightForwardEnabled=!1,this.isSalesMargin=!1,this.SearchCountryField=ut.XY,this.CountryISO=ut.ij,this.PhoneNumberFormat=ut.Hr,this.manualEditVisible=!1,this.autoFilledValues=new Map,this.unsubscribeObservable=new re.B,this.addressSearchLine=""}ngOnInit(){super.ngOnInit(),this.selectedCountryMessage="SENDER"===this.side()?"ORDER_PAGE.COUNTRY_OF_SENDER":"ORDER_PAGE.COUNTRY_OF_RECEIVER",this.stateIdRequired=this.store.select(T.ev).pipe((0,X.T)(t=>"SENDER"===this.side()?t?.senderStateId:t?.receiverStateId),(0,et.M)(t=>{t?this.addressDataForm.get("stateId").setValidators([m.k0.required]):this.addressDataForm.get("stateId").clearValidators()})),this.setRequiredFieldsValidation(),"SENDER"===this.side()&&this.store.select((0,ue.vY)("senderPostCode")).pipe((0,U.p)(t=>!!t),(0,j.F)()).subscribe(t=>{t&&(this.addressDataForm.get("postCode").patchValue(t),this.addressDataForm.markAsPristine(),this.addressDataForm.markAsUntouched(),this.addressDataForm.updateValueAndValidity())}),"RECEIVER"===this.side()&&(this.store.select(T.pG).pipe((0,j.F)(E()),(0,U.p)(t=>!!t&&!!t.shipment&&!!t.shipment.productId),(0,ce.B)(800),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.store.dispatch(F.M.createGetOrderPriceAction(t))}),this.store.select(T.Ll).pipe((0,j.F)(E()),(0,U.p)(t=>!!t.productId),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{t.grossOrderPrice&&this.store.dispatch(F.M.createGetOrderPaymentsAction(t))}),this.store.select(T.XH).pipe().subscribe(t=>{this.isFreightForwardEnabled=t}),this.store.select((0,ue.vY)("receiverPostCode")).pipe((0,U.p)(t=>!!t),(0,j.F)()).subscribe(t=>{t&&(this.addressDataForm.get("postCode").patchValue(t),this.addressDataForm.markAsPristine(),this.addressDataForm.markAsUntouched(),this.addressDataForm.updateValueAndValidity())}),this.disableFormGroupFieldsForPointDeliveryType())}isFieldRequired(t){const n=this.addressDataForm?.get(t);if(n?.validator){const r=n?.validator({});return!(!r||!r.required)}return!1}updateCityName(t){this.addressDataForm.get("city")?.patchValue(t?.name)}toggleManualEdit(){this.manualEditVisible=!this.manualEditVisible,this.autoFilledValues.clear()}onAddressSelected(t){const n=this.addressDataForm.getRawValue(),r=!!n.readonlyPostCode,o=t.countryId??n.c
1ountryId;this.writeValue({...n,street:t.street||"",houseNumber:t.buildingNumber,apartmentNumber:"",city:t.city||"",postCode:r?n.postCode:t.postCode||"",countryId:o,stateId:t.stateId??null}),this.rememberAutoFilledFields(t,r),this.addressDataForm.get("street")?.markAsTouched(),this.addressDataForm.get("houseNumber")?.markAsTouched(),this.changeDetector.markForCheck()}isFieldLocked(t){if(!this.autoFilledValues.has(t))return!1;const n=this.addressDataForm.get(t);return!!n?.valid&&n.value===this.autoFilledValues.get(t)}rememberAutoFilledFields(t,n){this.autoFilledValues.clear(),t.street&&this.autoFilledValues.set("street",t.street),t.buildingNumber&&this.autoFilledValues.set("houseNumber",t.buildingNumber),t.city&&this.autoFilledValues.set("city",t.city),t.postCode&&!n&&this.autoFilledValues.set("postCode",t.postCode)}revealFieldsIfPopulated(t){t&&(t.street||t.city||t.postCode)&&(this.manualEditVisible=!0)}buildSearchLine(t){return t?[this.addressFirstLinePipe.transform({...t,apartmentNumber:null}),[t.postCode,t.city].filter(o=>!!o).join(" ").trim()].filter(o=>!!o).join(", "):""}getFormFields(){let t={name:["",m.k0.compose([m.k0.required,m.k0.pattern(oe.Vm),m.k0.minLength(3)])],city:["",m.k0.compose([m.k0.required,m.k0.pattern(oe.bd),m.k0.minLength(3)])],street:["",m.k0.compose([m.k0.required,m.k0.minLength(1)])],houseNumber:["",m.k0.required],apartmentNumber:["",m.k0.compose([m.k0.maxLength(20),oe.af])],postCode:[""],phone:[""],email:[""],contactPerson:[""],contactPhone:[""],countryId:[],stateId:["",m.k0.required],readonlyPostCode:[]};return"SENDER"===this.side()&&(0,q.z)([this.store.select(J.FN),this.store.select(T.CS)]).subscribe(([n,r])=>{this.isSalesMargin=n,this.isSalesMargin&&r&&(this.isUserInPartnerProgram=!0)}),"RECEIVER"===this.side()&&(t={...t,email:[""],isFreightForward:[!1],nip:["",oe.MY]}),this.formBuilder.group(t)}writeValue(t){this.revealFieldsIfPopulated(t),this.addressSearchLine=this.buildSearchLine(t),t&&t.countryId?this.getCountry(t.countryId).subscribe(n=>{n?(this.country=n,this.disablePostCode=!n.hasPostCodes,this.disablePostCode?(this.addressDataForm.get("postCode").clearValidators(),t.postCode=null):this.addressDataForm.get("postCode").setValidators(m.k0.compose([m.k0.required,m.k0.minLength(2)])),"SENDER"===this.side()&&this.store.dispatch(me.U.createSetShipmentCountryLocationType(this.country.isUEMember,this.side())),"RECEIVER"===this.side()&&this.store.dispatch(me.U.createSetShipmentCountryLocationType(this.country.isUEMember,this.side())),super.writeValue(t)):super.writeValue(t)}):super.writeValue(t)}setRequiredFieldsValidation(){this.store.select(T.ev).pipe().subscribe(t=>{this.addressDataForm.get("phone").setValidators([m.k0.required]),this.addressDataForm.get("email").setValidators([m.k0.pattern(oe.gM),m.k0.required]),"SENDER"!==this.side()&&(t?.receiverPhone||this.addressDataForm.get("phone").clearValidators(),t?.receiverEmail||this.addressDataForm.get("email").clearValidators(),this.changeDetector.detectChanges())})}getCountry(t){return this.countryService.getCountriesCached().pipe((0,X.T)(n=>n.find(r=>r.id===t)))}insertTestAddresses(t){_e.c.production||t.altKey&&"t"===t.key&&this.addressDataForm.patchValue({name:"test",street:"test street",city:"Katowice",postCode:"40-600",houseNumber:12,phone:"+48888888888",email:"[email protected]",...Ie()(this.addressDataForm.value,Oe())})}ngOnDestroy(){this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}getProperErrorMessage(t){return this.properErrorMessageService.get(t,this.addressDataForm)}disableFormGroupFieldsForPointDeliveryType(){this.store.select(T.jj).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{"POINT"===t?(this.addressDataForm.get("street")?.clearValidators(),this.addressDataForm.get("houseNumber")?.clearValidators()):(this.addressDataForm?.get("street")?.setValidators(m.k0.compose([m.k0.required,m.k0.minLength(1)])),this.addressDataForm?.get("houseNumber")?.setValidators(m.k0.compose([m.k0.required]))),this.addressDataForm.updateValueAndValidity(),this.changeDetector.markForCheck()})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(nt.b),e.rXU(Jt.z),e.rXU(v.il),e.rXU(e.gRc),e.rXU(be.o),e.rXU(m.ok),e.rXU(Zt.D),e.rXU(Dt))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-shipment-address-form"]],hostBindings:function(n,r){1&n&&e.bIt("keydown",function(u){return r.insertTestAddresses(u)},!1,e.tSv)},inputs:{side:[1,"side"],pickupFromPoint:[1,"pickupFromPoint"]},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.Vt3,e.aNF],decls:91,vars:149,consts:[["novalidate","",3,"formGroup"],[1,"field","mt-6"],[1,"label",3,"ardnDataTestId"],[1,"label--required"],["formControlName","name",1,"name","input",3,"id","ardnDataTestId"],[3,"clientSideValidation","clientErrorMessage","serverSideValidation","ardnDataTestId"],[1,"field","mt-6",3,"hidden"],[3,"addressSelected","placeholder","displayValue","dataTestId"],["type","button",1,"address-search__toggle",3,"click","ardnDataTestId"],[1,"address-fields",3,"hidden"],[1,"field"],[1,"label--required",3,"ardnHideIfNotRequired"],["formControlName","street",1,"street","input",3,"id","readonly","ngClass","ardnDataTestId"],[1,"row"],[1,"col","col-6","col-mobile-12","v-align--bottom"],["formControlName","houseNumber",1,"house-number","input",3,"id","readonly","ngClass","ardnDataTestId"],["formControlName","apartmentNumber",1,"apartment-number","input",3,"id","ardnDataTestId"],[1,"label","label--relative",3,"ardnDataTestId"],[1,"flag-container"],[3,"isoCode","ardnTooltipster","ardnDataTestId"],["formControlName","city",1,"city","input",3,"id","readonly","ngClass","ardnDataTestId"],[3,"country","form","side"],["for","phone",1,"label",3,"ardnDataTestId"],[1,"info-icon","tooltip","tooltipstered","dialing-code-tooltip",3,"ardnTooltipster"],["name","phone","idName","phone","formControlName","phone",3,"id","cssClass","preferredCountries","enableAutoCountrySelect","enablePlaceholder","searchCountryFlag","searchCountryPlaceholder","selectFirstCountry","separateDialCode","phoneValidation","searchCountryField","selectedCountryISO","maxLength","ngClass"],[1,"input-validation",3,"clientSideValidation","clientErrorMessage","serverSideValidation","ardnDataTestId"],["formControlName","email","type","email",1,"email","input",3,"id","ardnDataTestId"],[1,"info-icon","tooltip","tooltipstered",3,"ardnTooltipster"],["formControlName","contactPerson",1,"contact-person","input",3,"id","ardnDataTestId"],[3,"serverSideValidation","ardnDataTestId"],["id","freight-forward","formControlName","isFreightForward"],[3,"country"],["formControlName","postCode",3,"countrySelected","id","side","formGroup","country","readonly","ngClass","readonlyTooltip","placeholder","ardnDataTestId"],["formControlName","stateId",3,"countryId","ardnDataTestId"],[1,"label--optional"],["formControlName","contactPhone",1,"contact-person","input",3,"id","ardnDataTestId"],["formControlName","nip",1,"input",3,"id","ardnDataTestId"]],template:function(n,r){if(1&n&&(e.j41(0,"form",0)(1,"div",1)(2,"label",2),e.EFF(3),e.nI1(4,"translate"),e.j41(5,"span",3),e.
1EFF(6,"*"),e.k0s()(),e.nrm(7,"input",4)(8,"ardn-field-validator",5),e.k0s(),e.j41(9,"div",6)(10,"label",2),e.EFF(11),e.nI1(12,"translate"),e.k0s(),e.j41(13,"ardn-address-autocomplete",7),e.bIt("addressSelected",function(u){return r.onAddressSelected(u)}),e.k0s(),e.j41(14,"button",8),e.bIt("click",function(){return r.toggleManualEdit()}),e.EFF(15),e.nI1(16,"translate"),e.k0s()(),e.j41(17,"div",9)(18,"button",8),e.bIt("click",function(){return r.toggleManualEdit()}),e.EFF(19),e.nI1(20,"translate"),e.k0s(),e.j41(21,"div",10)(22,"label",2),e.EFF(23),e.nI1(24,"translate"),e.j41(25,"span",11),e.EFF(26,"*"),e.k0s()(),e.nrm(27,"input",12)(28,"ardn-field-validator",5),e.k0s(),e.j41(29,"div",13)(30,"div",14)(31,"div",10)(32,"label",2),e.EFF(33),e.nI1(34,"translate"),e.j41(35,"span",11),e.EFF(36,"*"),e.k0s()(),e.nrm(37,"input",15)(38,"ardn-field-validator",5),e.k0s()(),e.j41(39,"div",14)(40,"div",10)(41,"label",2),e.EFF(42),e.nI1(43,"translate"),e.k0s(),e.nrm(44,"input",16)(45,"ardn-field-validator",5),e.k0s()()(),e.j41(46,"div",13),e.DNE(47,qt,13,25,"div",14),e.j41(48,"div",14)(49,"div",10)(50,"label",17),e.EFF(51),e.nI1(52,"translate"),e.j41(53,"span",3),e.
1EFF(54,"*"),e.k0s(),e.j41(55,"span",18),e.nrm(56,"ardn-flag",19),e.nI1(57,"translate"),e.k0s()(),e.nrm(58,"input",20)(59,"ardn-field-validator",5)(60,"ardn-city-name-alert",21),e.k0s()()(),e.DNE(61,Jn,8,13,"div",10),e.nI1(62,"async"),e.k0s(),e.j41(63,"div",10)(64,"label",22),e.EFF(65),e.nI1(66,"translate"),e.DNE(67,Zn,2,0,"span",3),e.j41(68,"span",23),e.nI1(69,"translate"),e.EFF(70,"i"),e.k0s()(),e.nrm(71,"ngx-intl-tel-input",24)(72,"ardn-field-validator",25),e.k0s(),e.j41(73,"div",10)(74,"label",2),e.EFF(75),e.nI1(76,"translate"),e.DNE(77,en,2,0,"span",3),e.k0s(),e.nrm(78,"input",26)(79,"ardn-field-validator",5),e.k0s(),e.j41(80,"div",10)(81,"label",2),e.EFF(82),e.nI1(83,"translate"),e.j41(84,"span",27),e.nI1(85,"translate"),e.EFF(86,"i"),e.k0s()(),e.nrm(87,"input",28)(88,"ardn-field-validator",29),e.k0s(),e.DNE(89,qn,9,13,"div",10)(90,to,2,1,"ardn-product-addon-freight-forward-category",30),e.k0s()),2&n){let o,u,g,A,N,w,te,ne,de;e.Y8G("formGroup",r.addressDataForm),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-name-label"),e.R7$(),e.SpI(" ",e.bMT(4,108,"SENDER"===r.side()&&r.isUserInPartnerProgram&&r.pickupFromPoint?"COMMON.CUSTOMER_NAME":"COMMON.NAME")," "),e.R7$(4),e.FS9("id","SENDER"===r.side()?"name-third-step-sender":"name-third-step-receiver"),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-name-input"),e.R7$(),e.Y8G("clientSideValidation",r.addressDataForm.get("name"))("clientErrorMessage",r.getProperErrorMessage("name"))("serverSideValidation",null==(o=r.serverSideValidationErrors())?null:o.fields["address[name]"])("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-name-field-validator"),e.R7$(),e.Y8G("hidden",r.manualEditVisible),e.R7$(),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-address-search-label"),e.R7$(),e.SpI(" ",e.bMT(12,110,"COMMON.ADDRESS.SEARCH")," "),e.R7$(2),e.Y8G("placeholder","COMMON.ADDRESS.SEARCH_PLACEHOLDER")("displayValue",r.addressSearchLine)("dataTestId","ardn-order-addresses-step-form-"+r.side()+"-address-autocomplete"),e.R7$(),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-address-manual-toggle"),e.R7$(),e.SpI(" ",e.bMT(16,112,"COMMON.ADDRESS.EDIT_MANUAL")," "),e.R7$(2),e.Y8G("hidden",!r.manualEditVisible),e.R7$(),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-address-search-toggle"),e.R7$(),e.SpI(" ",e.bMT(20,114,"COMMON.ADDRESS.BACK_TO_SEARCH")," "),e.R7$(3),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-street-label"),e.R7$(),e.SpI(" ",e.bMT(24,116,"COMMON.ADDRESS.STREET")," "),e.R7$(2),e.Y8G("ardnHideIfNotRequired","street"),e.R7$(2),e.FS9("id","SENDER"===r.side()?"street-third-step-sender":"street-third-step-receiver"),e.Y8G("readonly",r.isFieldLocked("street"))("ngClass",e.eq3(138,yt,r.isFieldLocked("street")))("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-street-input"),e.R7$(),e.Y8G("clientSideValidation",r.addressDataForm.get("street"))("clientErrorMessage",r.getProperErrorMessage("street"))("serverSideValidation",null==(u=r.serverSideValidationErrors())?null:u.fields["address[street]"])("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-street-field-validator"),e.R7$(4),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-houseNumber-label"),e.R7$(),e.SpI(" ",e.bMT(34,118,"COMMON.ADDRESS.HOUSE_NUMBER")," "),e.R7$(2),e.Y8G("ardnHideIfNotRequired","houseNumber"),e.R7$(2),e.FS9("id","SENDER"===r.side()?"houseNumber-third-step-sender":"houseNumber-third-step-receiver"),e.Y8G("readonly",r.isFieldLocked("house
1Number"))("ngClass",e.eq3(140,yt,r.isFieldLocked("houseNumber")))("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-houseNumber-input"),e.R7$(),e.Y8G("clientSideValidation",r.addressDataForm.get("houseNumber"))("clientErrorMessage",r.getProperErrorMessage("houseNumber"))("serverSideValidation",null==(g=r.serverSideValidationErrors())?null:g.fields["address[houseNumber]"])("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-houseNumber-field-validator"),e.R7$(3),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-apartmentNumber-label"),e.R7$(),e.SpI(" ",e.bMT(43,120,"COMMON.ADDRESS.APARTMENT_NUMBER")," "),e.R7$(2),e.FS9("id","SENDER"===r.side()?"apartmentNumber-third-step-sender":"apartmentNumber-third-step-receiver"),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-apartmentNumber-input"),e.R7$(),e.Y8G("clientSideValidation",r.addressDataForm.get("apartmentNumber"))("clientErrorMessage",r.getProperErrorMessage("apartmentNumber"))("serverSideValidation",null==(A=r.serverSideValidationErrors())?null:A.fields["address[apartmentNumber]"])("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-apartmentNumber-field-validator"),e.R7$(2),e.vxM(r.disablePostCode?-1:47),e.R7$(3),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-city-label"),e.R7$(),e.SpI(" ",e.bMT(52,122,"COMMON.ADDRESS.CITY")," "),e.R7$(5),e.Y8G("isoCode",null==r.country?null:r.country.isoCode)("ardnTooltipster",e.bMT(57,124,r.selectedCountryMessage)+": "+(null==r.country?null:r.country.name))("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-ardn-flag"),e.R7$(2),e.FS9("id","SENDER"===r.side()?"city-third-step-sender":"city-third-step-receiver"),e.Y8G("readonly",r.postCodeService.isCityReadOnly(r.country,r.side())||r.isFieldLocked("city"))("ngClass",e.eq3(142,yt,r.postCodeService.isCityReadOnly(r.country,r.side())||r.isFieldLocked("city")))("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-city-input"),e.R7$(),e.Y8G("clientSideValidation",r.addressDataForm.get("city"))("clientErrorMessage",r.getProperErrorMessage("city"))("serverSideValidation",null==(N=r.serverSideValidationErrors())?null:N.fields["address[city]"])("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-city-field-validator"),e.R7$(),e.Y8G("country",r.country)("form",r.addressDataForm)("side",r.side()),e.R7$(),e.vxM(e.bMT(62,126,r.stateIdRequired)&&r.country?61:-1),e.R7$(3),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-phone-label"),e.R7$(),e.SpI(" ",e.bMT(66,128,"COMMON.ADDRESS.PHONE")," "),e.R7$(2),e.vxM(r.isFieldRequired("phone")?67:-1),e.R7$(),e.Y8G("ardnTooltipster",e.bMT(69,130,"COMMON.ADDRESS.PHONE_NUMBER_TOOLTIP")),e.R7$(3),e.FS9("id","SENDER"===r.side()?"phone-third-step-sender":"phone-third-step-receiver"),e.Y8G("cssClass","input input-field")("preferredCountries",e.eq3(144,zn,r.CountryISO.Poland))("enableAutoCountrySelect",!0)("enablePlaceholder",!1)("searchCountryFlag",!0)("searchCountryPlaceholder","")("selectFirstCountry",!0)("separateDialCode",!0)("phoneValidation",!0)("searchCountryField",e.l_i(146,Kn,r.SearchCountryField.Iso2,r.SearchCountryField.Name))("selectedCountryISO",null!==(w=null==r.country||null==r.country.isoCode?null:r.country.isoCode.slice(0,2))&&void 0!==w?w:r.CountryISO.Poland)("maxLength",15)("ngClass","no-padding-top no-padding-bottom"),e.R7$(),e.Y8G("clientSideValidation",r.addressDataForm.get("phone"))("clientErrorMessage","COMMON.ERRORS.PHONE")("serverSideValidation",null==(te=r.serverSideValidationErrors())?null:te.fields["address[phone]"])("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-phone-field-validator"),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-email-label"),e.R7$(),e.SpI(" ",e.bMT(76,132,"COMMON.EMAIL")," "),e.R7$(2),e.vxM(r.isFieldRequired("email")?77:-1),e.R7$(),e.FS9("id","SENDER"===r.side()?"email-third-step-sender":"email-third-step-receiver"),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-email-input"),e.R7$(),e.Y8G("clientSideValidation",r.addressDataForm.get("email"))("clientErrorMessage","COMMON.ERRORS.EMAIL_CONTENT")("serverSideValidation",null==(ne=r.serverSideValidationErrors())?null:ne.fields["address[email]"])("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-email-field-validator"),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-contactPerson-label"),e.R7$(),e.SpI(" ",e.bMT(83,134,"COMMON.ADDRESS.CONTACT_PERSON")," "),e.R7$(2),e.Y8G("ardnTooltipster",e.bMT(85,136,"COMMON.ADDRESS.CONTACT_PERSON_TOOLTIP")),e.R7$(3),e.FS9("id","SENDER"===r.side()?"contactPerson-third-step-sender":"contactPerson-third-step-receiver"),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-contactPerson-input"),e.R7$(),e.Y8G("serverSideValidation",null==(de=r.serverSideValidationErrors())?null:de.fields["address[contactPerson]"])("ardnDataTestId","ardn-order-addresses-step-form-"+r.side()+"-contactPerson-field-validator"),e.R7$(),e.vxM(r.isUserInPartnerProgram?89:-1),e.R7$(),e.vxM(r.side()&&"RECEIVER"===r.side()&&r.isFreightForwardEnabled?90:-1)}},dependencies:[m.X1,m.qT,m.me,m.BC,m.cb,m.j4,m.JD,Z.Z,ye.Q,f.h,f.D9,xe.g,Xe.q,ge.d,Ht,l.Jj,zt,l.YU,Pe.W,Tt.j,Xn,ut.s0,ut.NA,ut.ZP,Qt],styles:["[_nghost-%COMP%]     .iti{display:block!important}[_nghost-%COMP%]     .iti .iti__country-list{box-shadow:none;font-size:14px;margin-left:15px;width:auto;max-height:200px}[_nghost-%COMP%]     .iti__selected-flag.dropdown-toggle{padding-left:22px;width:auto!important;padding-right:5px}[_nghost-%COMP%]     .iti.separate-dial-code{font-size:14px}[_nghost-%COMP%]     .iti.separate-dial-code input{padding-left:105px!important}[_nghost-%COMP%]     ngx-intl-tel-input{display:block;width:100%;height:40px}[_nghost-%COMP%]     ngx-intl-tel-input input{height:40px;font-size:14px}[_nghost-%COMP%]     ngx-intl-tel-input input#country-search-box{padding-left:50px!important}.flag-container[_ngcontent-%COMP%]{vertical-align:middle;position:absolute;right:0}.label--relative[_ngcontent-%COMP%]{position:relative}.v-align--bottom[_ngcontent-%COMP%]{vertical-align:bottom}.dialing-code-tooltip[_ngcontent-%COMP%]{position:relative}.row[_ngcontent-%COMP%]{display:flex}.address-search__toggle[_ngcontent-%COMP%]{margin-top:8px;padding:0;background:none;border:none;color:#96c21f;font-size:14px;text-decoration:underline;cursor:pointer}@media only screen and (min-width: 640px) and (max-width: 890px){ardn-country-post-code-sample[_ngcontent-%COMP%]{display:none}}"]})}}return i})();const er=["senderAddressComponent"],rn=["receiverAddressComponent"],on=()=>({standalone:!0});function tr(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-drop-down",25),e.nI1(1,"translate"),e.nI1(2,"translate"),e.bIt("ngModelChange",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.selectOrderSenderAddress(r))})("currentSearchValue",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.isFilteredData(r,"SENDER"))})("resultLength",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.verifyDataLength(r,"SENDER"))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("dataSource",t.sendersDataSource)("searchEnabled",!0)("searchPlaceholder",e.bMT(1,10,t.emptySenderAddressBook?"ORDER_PAGE.EMPTY_ADDRESS_BOOK":"ORDER_PAGE.FILTER_CONTACTS"))("isDisabledChecker",t.getIsAddressFromSenderAddressBookDisabledChecker())("numberOfItemsLoadedAtScrollEnd",10)("ngModel",null)("placeholder",e.bMT(2,12,"ORDER_PAGE.SELECT_SENDER_ADDRESS_FROM_ADDRESS_BOOK"))("parentName","order-addresses-step")("hidden",t.isListOfSavedSenderAddressesPopulated&&t.emptySenderAddressBook&&!t.isListSenderAddressFiltered)("ardnDataTestId","ardn-order-addresses-step-form-sender-address-name-drop-down")}}function nr(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",12)(1,"label",26)(2,"input",27),e.bIt("change",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.switchPickupType())}),e.k0s(),e.j41(3,"span",28),e.EFF(4),e.nI1(5,"translate"),e.k0s()(),e.j41(6,"label",29)(7,"input",30),e.bIt("change",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.switchPickupType())}),e.k0s(),e.j41(8,"span",28),e.EFF(9),e.nI1(10,"translate"),e.k0s()()()}if(2&i){const t=e.XpG();e.R7$(),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-sender-address-left-pickupFromPoint-label"),e.R7$(),e.Y8G("checked",!t.orderDraftId&&!t.postCodesModalSenderPostCode)("disabled",t.orderDraftId)("ardnDataTestId","ardn-order-addresses-step-form-sender-address-pickupFromPoint-input"),e.R7$(2),e.JRh(e.bMT(5,9,"COMMON.PICKUP_FROM_POINT")),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-addresses-step-form-sender-address-right-pickupFromPoint-label"),e.R7$(),e.Y8G("checked",t.orderDraftId||t.postCodesModalSenderPostCode)("ardnDataTestId","ardn-order-addresses-step-form-sender-address-right-pickupFromPoint-input"),e.R7$(2),e.JRh(e.bMT(10,11,"COMMON.PICKUP_FROM_SENDER"))}}function rr(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",14)(1,"div",31)(2,"label",32)(3,"input",33),e.mxI("ngModelChange",function(r){e.eBV(t);const o=e.XpG();return e.DH7(o.saveSender,r)||(o.saveSender=r),e.Njj(r)}),e.k0s(),e.j41(4,"span",28),e.EFF(5),e.nI1(6,"translate"),e.k0s()()()()}if(2&i){const t=e.XpG();e.R7$(2),e.Y8G("ardnDataTestId","ardn-shipment-address-form-sender-address-form-save-receiver-label"),e.R7$(),e.R50("ngModel",t.saveSender),e.Y8G("ardnDataTestId","ardn-shipment-address-form-sender-address-form-save-receiver-input"),e.R7$(2),e.JRh(e.bMT(6,4,"ORDER_PAGE.SAVE_SENDER_ADDRESS"))}}function sn(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",15)(1,"ardn-chip-radio",34),e.bIt("ngModelChange",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.onRoleSelected(r))}),e.k0s(),e.j41(2,"span",35),e.EFF(3),e.nI1(4,"translate"),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(),e.Y8G("options",t.customsRoleOptions)("ngModel",t.isImporter)("ngModelOptions",e.lJ4(6,on)),e.R7$(2),e.JRh(e.bMT(4,4,"ORDER_PAGE.ORDER_CUSTOMS.ROLE.HINT"))}}function ir(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-drop-down",25),e.nI1(1,"translate"),e.nI1(2,"translate"),e.bIt("ngModelChange",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.selectOrderReceiverAddress(r))})("currentSearchValue",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.isFilteredData(r,"RECEIVER"))})("resultLength",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.verifyDataLength(r,"RECEIVER"))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("dataSource",t.receiversDataSource)("searchEnabled",!0)("searchPlaceholder",e.bMT(1,10,t.emptyReceiverAddressBook?"ORDER_PAGE.EMPTY_ADDRESS_BOOK":"ORDER_PAGE.FILTER_CONTACTS"))("isDisabledChecker",t.getIsAddressFromReceiverAddressBookDisabledChecker())("numberOfItemsLoadedAtScrollEnd",10)("ngModel",null)("placeholder",e.bMT(2,12,"ORDER_PAGE.SELECT_RECEIVER_ADDRESS_FROM_ADDRESS_BOOK"))("parentName","order-addresses-step")("hidden",t.isListOfSavedReceiverAddressesPopulated&&t.emptyReceiverAddressBook&&!t.isListReceiverAddressFiltered)("ardnDataTestId","ardn-order-addresses-step-form-receiver-address-name-drop-down")}}function Mt(i,p){if(1&i){const t=e.RV6();e.j41(0,"a",36),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.copyUserAddressToReceiverAddress())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}
12&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"ORDER_PAGE.USE_USER_AS_SHIPMENT_ADDRESS")," "))}function an(i,p){1&i&&(e.j41(0,"a",21),e.nI1(1,"translate"),e.EFF(2),e.nI1(3,"translate"),e.k0s()),2&i&&(e.Y8G("ardnTooltipster",e.bMT(1,2,"ORDER_PAGE.CAN_NOT_USE_USER_AS_SHIPMENT_ADDRESS")),e.R7$(2),e.SpI(" ",e.bMT(3,4,"ORDER_PAGE.USE_USER_AS_SHIPMENT_ADDRESS")," "))}function or(i,p){1&i&&e.nrm(0,"div",22)}function dn(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",14)(1,"div",31)(2,"label",32)(3,"input",33),e.mxI("ngModelChange",function(r){e.eBV(t);const o=e.XpG();return e.DH7(o.saveReceiver,r)||(o.saveReceiver=r),e.Njj(r)}),e.k0s(),e.j41(4,"span",28),e.EFF(5),e.nI1(6,"translate"),e.k0s()()()()}if(2&i){const t=e.XpG();e.R7$(2),e.Y8G("ardnDataTestId","ardn-shipment-address-form-receiver-address-form-save-receiver-label"),e.R7$(),e.R50("ngModel",t.saveReceiver),e.Y8G("ardnDataTestId","ardn-shipment-address-form-receiver-address-form-save-receiver-input"),e.R7$(2),e.JRh(e.bMT(6,4,"ORDER_PAGE.SAVE_RECEIVER_ADDRESS"))}}function Ye(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",37),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.clickSwapAddresses())}),e.qSk(),e.j41(2,"svg",38),e.nrm(3,"use",39),e.k0s()()}2&i&&e.Y8G("ardnTooltipster",e.bMT(1,2,"ORDER_PAGE.SWAP_ADDRESSES"))("ardnDataTestId","ardn-shipment-address-form-swap-addresses")}let ln=(()=>{class i{constructor(t,n,r,o,u,g,A,N){this.store=t,this.apiDataSourceFactory=n,this.changeDetectorRef=r,this.userToShipmentAddressConverter=o,this.addressFilterService=u,this.shipmentAddressService=g,this.countryService=A,this.translateService=N,this.validityChanged=(0,e.CGW)(),this.senderAddress={name:"",street:"",houseNumber:"",apartmentNumber:"",city:"",postCode:"",countryId:null,stateId:null,phone:"",email:"",contactPerson:""},this.receiverAddress={name:"",street:"",houseNumber:"",apartmentNumber:"",city:"",postCode:"",countryId:null,stateId:null,phone:"",email:"",contactPerson:"",isFreightForward:!1,nip:""},this.isLoggedIn$=this.store.select(J.Ep),this.emptySenderAddressBook=!1,this.emptyReceiverAddressBook=!1,this.isListOfSavedSenderAddressesPopulated=!1,this.isListOfSavedReceiverAddressesPopulated=!1,this.isListSenderAddressFiltered=!1,this.isListReceiverAddressFiltered=!1,this.saveSender=!1,this.saveReceiver=!1,this.isUserInPartnerProgram=!1,this.pickupFromPoint=!0,this.isImporter=null,this.unsubscribeObservable=new re.B}get customsRoleOptions(){return[{value:!0,label:this.translateService.instant("ORDER_PAGE.ORDER_CUSTOMS.ROLE.IMPORTER")},{value:!1,label:this.translateService.instant("ORDER_PAGE.ORDER_CUSTOMS.ROLE.EXPORTER")}]}ngOnInit(){this.store.select(T.ji).pipe((0,j.F)(E()),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.senderCountryId=t,this.sendersDataSource=this.apiDataSourceFactory.create("user/addressBook/senders",this.senderCountryId?{limit:10,countryId:this.senderCountryId}:{limit:10}),this.resolveCustomsRole(this.senderCountryId,this.receiverCountryId)}),this.store.select(T.Nz).pipe((0,j.F)(E()),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.receiverCountryId=t,this.receiversDataSource=this.apiDataSourceFactory.create("user/addressBook/receivers",this.receiverCountryId?{limit:10,countryId:this.receiverCountryId}:{limit:10}),this.resolveCustomsRole(this.senderCountryId,this.receiverCountryId)}),this.store.select(T.Zo).pipe((0,j.F)(E()),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.isImporter=t,this.changeDetectorRef.markForCheck()}),this.store.select(T.NL).pipe((0,U.p)(t=>!!t)).subscribe(t=>this.orderDraftId=t),this.store.select(T.aT).pipe((0,U.p)(t=>!!t),(0,j.F)(E()),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.senderAddress=t}),this.store.select(T.Ui).pipe((0,U.p)(t=>!!t),(0,j.F)(E()),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.receiverAddress=t}),this.store.select(ue.jR).pipe((0,U.p)(t=>!!t)).subscribe(t=>{this.postCodesModalSenderPostCode=t}),this.store.select(T.Ff).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{if(!t)return;const n=L()(t.fields,(o,u)=>u.match(/^senderAddress/)),r=L()(t.fields,(o,u)=>u.match(/^receiverAddress/));this.senderAddressValidationErrors={fields:ae()(n,(o,u)=>u.replace("senderAddress","address")),general:[]},this.receiverAddressValidationErrors={fields:ae()(r,(o,u)=>u.replace("receiverAddress","address")),general:[]}}),this.setSenderAddressForSalesMarginAccount(),this.autoFillSenderAddressFromUserData(),setTimeout(()=>{this.sendersDataSource?.getObservable().pipe((0,M.s)(1)).subscribe(()=>{this.isListOfSavedSenderAddressesPopulated=!0}),this.receiversDataSource?.getObservable().pipe((0,M.s)(1)).subscribe(()=>{this.isListOfSavedReceiverAddressesPopulated=!0})})}
1ngOnDestroy(){this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}selectOrderSenderAddress(t){this.saveSender=!1,this.selectedSenderAddressBook=t,this.senderAddress=Y()(t,D()(this.senderAddress)),this.addressFilterService.cleanPostCodeIfCountryDoesNotNeedIt({...this.senderAddress,countryId:this.senderCountryId}).subscribe(n=>{this.shipmentAddressService.createUpdateSenderAddressAction(this.adjustPhoneNumber(n))})}selectOrderReceiverAddress(t){this.saveReceiver=!1,this.selectedReceiverAddressBook=t,this.receiverAddress=Y()(t,D()(this.receiverAddress)),this.addressFilterService.cleanPostCodeIfCountryDoesNotNeedIt({...this.receiverAddress,countryId:this.receiverCountryId}).subscribe(n=>{this.shipmentAddressService.createUpdateReceiverAddressAction(this.adjustPhoneNumber(n))})}dispatchData(){this.store.dispatch(F.M.createUpdateSenderAddressAction(this.adjustPhoneNumber(this.senderAddress))),this.store.dispatch(F.M.createUpdateReceiverAddressAction(this.adjustPhoneNumber(this.receiverAddress)))}onRoleSelected(t){this.dispatchIsImporter(!0===t)}setSenderAddressValidity(t){this.isSenderAddressValid!==t&&(this.isSenderAddressValid=t),this.emitAddressesValidity()}setReceiverAddressValidity(t){this.isReceiverAddressValid!==t&&(this.isReceiverAddressValid=t),this.emitAddressesValidity()}emitAddressesValidity(){this.validityChanged.emit(this.isSenderAddressValid&&this.isReceiverAddressValid)}clearValidationErrors(){this.receiverAddressValidationErrors={fields:{},general:[]},this.senderAddressValidationErrors={fields:{},general:[]}}getIsAddressFromReceiverAddressBookDisabledChecker(){return t=>this.receiverAddress.readonlyPostCode&&t.postCode!==this.receiverAddress.postCode}getIsAddressFromSenderAddressBookDisabledChecker(){return t=>this.senderAddress.readonlyPostCode&&t.postCode!==this.senderAddress.postCode}isContactToAdd(){return this.saveSender||this.saveReceiver}canCopyUserAddressToSenderAddress(){return this.store.select(T.nk)}copyUserAddressToSenderAddress(){this.store.select(T.qE).pipe((0,M.s)(1)).subscribe(t=>{this.store.select(T.aT).pipe((0,M.s)(1)).subscribe(n=>{const r=this.userToShipmentAddressConverter.convert(t);!0===n.readonlyPostCode&&(delete r.postCode,delete r.city),this.shipmentAddressService.createUpdateSenderAddressAction(this.adjustPhoneNumber(r))})})}autoFillSenderAddressFromUserData(){(0,q.z)([this.store.select(J.Ep),this.store.select(J.FN),this.store.select(T.NL),this.store.select(T.nk),this.store.select(T.aT)]).pipe((0,U.p)(([t,n,r,o,u])=>t&&!n&&!r&&o&&this.isSenderAddressEmpty(u)),(0,M.s)(1),(0,B.Q)(this.unsubscribeObservable)).subscribe(()=>this.copyUserAddressToSenderAddress())}isSenderAddressEmpty(t){return!t?.name&&!t?.street&&!t?.city}canCopyUserAddressToReceiverAddress(){return this.store.select(T.lV)}copyUserAddressToReceiverAddress(){this.store.select(T.qE).pipe((0,M.s)(1)).subscribe(t=>{this.store.select(T.aT).pipe((0,M.s)(1)).subscribe(n=>{const r=this.userToShipmentAddressConverter.convert(t);!0===n.readonlyPostCode&&(delete r.postCode,delete r.city),this.shipmentAddressService.createUpdateReceiverAddressAction(this.adjustPhoneNumber(r))})})}validate(){this.senderAddressComponent.validateForm("-third-step-sender")?this.receiverAddressComponent.validateForm():this.receiverAddressComponent.validateForm("-third-step-receiver")}getFormGroupFields(){const t=[];return Object.keys(this.senderAddressComponent.addressDataForm.controls).forEach(n=>{t.push(n)}),t}canSwapAddresses(){return this.store.select(T.PE).pipe((0,X.T)(t=>{const n=t.userAddress&&t.userAddress.countryId?t.userAddress.countryId:null,r=t.senderAddress&&t.senderAddress.countryId?t.senderAddress.countryId:null;return!!(n&&r&&this.receiverCountryId)&&n===r&&n===(t.receiverAddress&&t.receiverAddress.countryId?t.receiverAddress.countryId:null)}))}clickSwapAddresses(){const t={...this.receiverAddress,name:this.receiverAddress.name?this.receiverAddress.name:"",street:this.receiverAddress.street?this.receiverAddress.street:"",houseNumber:this.receiverAddress.houseNumber?this.receiverAddress.houseNumber:"",apartmentNumber:this.receiverAddress.ap
1artmentNumber?this.receiverAddress.apartmentNumber:"",city:this.receiverAddress.city?this.receiverAddress.city:"",postCode:this.receiverAddress.postCode?this.receiverAddress.postCode:"",phone:this.receiverAddress.phone?this.receiverAddress.phone:"",email:this.receiverAddress.email?this.receiverAddress.email:"",contactPerson:this.receiverAddress.contactPerson?this.receiverAddress.contactPerson:""},n={...this.senderAddress,name:this.senderAddress.name?this.senderAddress.name:"",street:this.senderAddress.street?this.senderAddress.street:"",houseNumber:this.senderAddress.houseNumber?this.senderAddress.houseNumber:"",apartmentNumber:this.senderAddress.apartmentNumber?this.senderAddress.apartmentNumber:"",city:this.senderAddress.city?this.senderAddress.city:"",postCode:this.senderAddress.postCode?this.senderAddress.postCode:"",phone:this.senderAddress.phone?this.senderAddress.phone:"",email:this.senderAddress.email?this.senderAddress.email:"",contactPerson:this.senderAddress.contactPerson?this.senderAddress.contactPerson:"",isFreightForward:!1,nip:this.senderAddress.nip?this.senderAddress.nip:""};this.shipmentAddressService.createUpdateSenderAddressAction(this.adjustPhoneNumber(t)),this.shipmentAddressService.createUpdateReceiverAddressAction(this.adjustPhoneNumber(n))}switchPickupType(){this.pickupFromPoint=!this.pickupFromPoint,this.updateSenderAddressByUserProfileAddress()}verifyDataLength(t,n){"SENDER"===n&&(this.emptySenderAddressBook=0===t),"RECEIVER"===n&&(this.emptyReceiverAddressBook=0===t)}isFilteredData(t,n){t&&("SENDER"===n&&(this.isListSenderAddressFiltered=!0),"RECEIVER"===n&&(this.isListReceiverAddressFiltered=!0))}isPickupFromPoint(){return this.pickupFromPoint}adjustPhoneNumber(t){let n="";if("object"==typeof t?.phone){const r=t?.phone;n=!r?.e164Number&&r?.number?n=r?.number:r?.e164Number}else"string"==typeof t?.phone&&(n=t?.phone);return{...t,phone:n}}resolveCustomsRole(t,n){if(t&&n){if(t===n)return void this.applyDefaultIsImporter(null);(0,q.z)([this.countryService.getCountryByCountryId(t),this.countryService.getCountryByCountryId(n)]).pipe((0,M.s)(1),(0,B.Q)(this.unsubscribeObservable)).subscribe(([r,o])=>{this.applyDefaultIsImporter(this.determineDefaultIsImporter(r,o))})}}determineDefaultIsImporter(t,n){return t&&n?!(t.isUEMember||!n.isUEMember)||!(t.isUEMember&&!n.isUEMember)&&null:null}applyDefaultIsImporter(t){null===t?null!=this.isImporter&&this.dispatchIsImporter(null):null==this.isImporter&&this.dispatchIsImporter(t),this.changeDetectorRef.markForCheck()}dispatchIsImporter(t){this.isImporter=t,this.store.dispatch(F.M.createSetOrderIsImporter(t))}updateSenderAddressByUserProfileAddress(){this.store.select(J.SF).pipe((0,U.p)(n=>!!n)).subscribe(n=>{if(this.pickupFromPoint)if(n.subUserAddress)this.setSenderAddressWithoutName(n.subUserAddress);else{if(!n.address)throw Error("SubUser and MainUser Address is null, address data is required");this.setSenderAddressWithoutName(n.address)}if(!this.pickupFromPoint&&this.postCodesModalSenderPostCode)if(n.subUserAddress)this.setSenderAddressWithoutName({...n.subUserAddress,postCode:this.postCodesModalSenderPostCode,city:""});else{if(!n.address)throw Error("SubUser and MainUser Address is null, address data is required");this.setSenderAddressWithoutName({...n.address,postCode:this.postCodesModalSenderPostCode,city:""})}})}setSenderAddressWithoutName(t){this.senderAddress={...t},setTimeout(()=>{this.senderAddressComponent.addressDataForm.patchValue({name:""}),this.senderAddressComponent.addressDataForm.markAsUntouched()},100)}setSenderAddressForSalesMarginAccount(){(0,q.z)([this.store.select(J.FN),this.store.select(T.CS)]).pipe((0,U.p)(([t,n])=>t&&n)).subscribe(()=>{if(!this.orderDraftId)return this.postCodesModalSenderPostCode&&this.disablePickupFromPoint(),void this.verifyIsUserInPartnerProgram();this.disablePickupFromPoint()})}verifyIsUserInPartnerProgram(){this.store.select(T.PE).pipe((0,U.p)(t=>!t?.orderReturnStatus?.loaded),(0,M.s)(1)).subscribe(()=>{this.isUserInPartnerProgram=!0,this.updateSenderAddressByUserProfileAddress()})}disablePickupFromPoint(){this.pickupFromPoint=!1}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(v.il),e.rXU(Ve.V),e.rXU(e.gRc),e.rXU(Be),e.rXU(Qe),e.rXU(Ze),e.rXU(be.o),e.rXU(f.c$))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-addresses-step"]],viewQuery:function(n,r){if(1&n&&(e.GBs(er,7),e.GBs(rn,7)),2&n){let o;e.mGM(o=e.lsd())&&(r.senderAddressComponent=o.first),e.mGM(o=e.lsd())&&(r.receiverAddressComponent=o.first)}},outputs:{validityChanged:"validityChanged"},decls:50,vars:56,consts:[["senderAddressComponent",""],["receiverAddressComponent",""],[1,"row","row--huge-gutter","row-portable--normal-gutter","slim-control
1s","relative"],["id","sender-address",1,"col","col-6","col-mobile-12"],[1,"h3","mt-4"],[1,"icon","icon--27","color-lighter","fill-primary","middle"],["href","assets/img/sprites.svg#icon-sender"],[1,"middle"],["displayField","name",3,"dataSource","searchEnabled","searchPlaceholder","isDisabledChecker","numberOfItemsLoadedAtScrollEnd","ngModel","placeholder","parentName","hidden","ardnDataTestId"],[1,"align-center"],[1,"link","link--use-user-address",3,"click","hidden"],[1,"link","link--use-user-address-disabled",3,"hidden","ardnTooltipster"],[1,"radio"],["side","SENDER",3,"validityChanged","ngModelChange","pickupFromPoint","serverSideValidationErrors","ngModel","ardnDataTestId"],[1,"field","with-padding"],[1,"field","with-padding","customs-role"],[1,"required-info"],["id","receiver-address",1,"col","col-6","col-mobile-12"],[1,"icon","icon-recipient","icon--27","color-lighter","fill-primary","middle"],["href","assets/img/sprites.svg#icon-recipient"],[1,"link","link--use-user-address"],[1,"link","link--use-user-address-disabled",3,"ardnTooltipster"],[1,"radio","receiver-radio"],[3,"validityChanged","ngModelChange","side","serverSideValidationErrors","ngModel","ardnDataTestId"],[1,"swap-addresses",3,"ardnTooltipster","ardnDataTestId"],["displayField","name",3,"ngModelChange","currentSearchValue","resultLength","dataSource","searchEnabled","searchPlaceholder","isDisabledChecker","numberOfItemsLoadedAtScrollEnd","ngModel","placeholder","parentName","hidden","ardnDataTestId"],[1,"align-left",3,"ardnDataTestId"],["type","radio","name","pickupFromPoint",3,"change","checked","disabled","ardnDataTestId"],[1,"agreement"],[1,"align-right",3,"ardnDataTestId"],["type","radio","name","pickupFromPoint",3,"change","checked","ardnDataTestId"],[1,"checkbox"],[3,"ardnDataTestId"],["type","checkbox",3,"ngModelChange","ngModel","ardnDataTestId"],[3,"ngModelChange","options","ngModel","ngModelOptions"],[1,"customs-role__label"],[1,"link","link--use-user-address",3,"click"],[1,"swap-addresses",3,"click","ardnTooltipster","ardnDataTestId"],[1,"icon","icon--27","swap-addresses--color","middle"],["href","assets/img/sprites.svg#icon-sync"]],template:function(n,r){if(1&n){const o=e.RV6();e.j41(0,"div",2)(1,"div",3)(2,"h3",4),e.qSk(),e.j41(3,"svg",5),e.nrm(4,"use",6),e.k0s(),e.joV(),e.j41(5,"span",7),e.EFF(6),e.nI1(7,"translate"),e.k0s()(),e.DNE(8,tr,3,14,"ardn-drop-down",8),e.nI1(9,"async"),e.j41(10,"div",9)(11,"a",10),e.nI1(12,"async"),e.bIt("click",function(){return e.eBV(o),e.Njj(r.copyUserAddressToSenderAddress())}),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.j41(15,"a",11),e.nI1(16,"async"),e.nI1(17,"translate"),e.EFF(18),e.nI1(19,"translate"),e.k0s()(),e.DNE(20,nr,11,13,"div",12),e.j41(21,"ardn-shipment-address-form",13,0),e.bIt("validityChanged",function(g){return e.eBV(o),e.Njj(r.setSenderAddressValidity(g))}),e.mxI("ngModelChange",function(g){return e.eBV(o),e.DH7(r.senderAddress,g)||(r.senderAddress=g),e.Njj(g)}),e.k0s(),e.DNE(23,rr,7,6,"div",14),e.nI1(24,"async"),e.DNE(25,sn,5,7,"div",15),e.j41(26,"span",16),e.EFF(27),e.nI1(28,"translate"),e.k0s()(),e.j41(29,"div",17)(30,"h3",4),e.qSk(),e.j41(31,"svg",18),e.nrm(32,"use",19),e.k0s(),e.joV(),e.j41(33,"span",7),e.EFF(34),e.nI1(35,"translate"),e.k0s()(),e.DNE(36,ir,3,14,"ardn-drop-down",8),e.nI1(37,"async"),e.j41(38,"div",9),e.DNE(39,Mt,3,3,"a",20),e.nI1(40,"async"),e.DNE(41,an,4,6,"a",21),e.nI1(42,"async"),e.k0s(),e.DNE(43,or,1,0,"div",22),e.j41(44,"ardn-shipment-address-form",23,1),e.bIt("validityChanged",function(g){return e.eBV(o),e.Njj(r.setReceiverAddressValidity(g))}),e.mxI("ngModelChange",function(g){return e.eBV(o),e.DH7(r.receiverAddress,g)||(r.receiverAddress=g),e.Njj(g)}),e.k0s(),e.DNE(46,dn,7,6,"div",14),e.nI1(47,"async"),e.k0s(),e.DNE(48,Ye,4,4,"div",24),e.nI1(49,"async"),e.k0s()}2&n&&(e.R7$(6),e.JRh(e.bMT(7,26,"ORDER_PAGE.ENTER_SENDER_ADDRESS")),e.R7$(2),e.vxM(e.bMT(9,28,r.isLoggedIn$)?8:-1),e.R7$(3),e.Y8G("hidden",!0!==e.bMT(12,30,r.canCopyUserAddressToSenderAddress())),e.R7$(2),e.SpI(" ",e.bMT(14,32,"ORDER_PAGE.USE_USER_AS_SHIPMENT_ADDRESS")," "),e.R7$(2),e.Y8G("hidden",e.bMT(16,34,r.canCopyUserAddressToSenderAddress()))("ardnTooltipster",e.bMT(17,36,"ORDER_PAGE.CAN_NOT_USE_USER_AS_
1SHIPMENT_ADDRESS")),e.R7$(3),e.SpI(" ",e.bMT(19,38,"ORDER_PAGE.USE_USER_AS_SHIPMENT_ADDRESS")," "),e.R7$(2),e.vxM(r.isUserInPartnerProgram?20:-1),e.R7$(),e.Y8G("pickupFromPoint",r.pickupFromPoint&&r.isUserInPartnerProgram)("serverSideValidationErrors",r.senderAddressValidationErrors),e.R50("ngModel",r.senderAddress),e.Y8G("ardnDataTestId","ardn-shipment-address-form-sender-address"),e.R7$(2),e.vxM(e.bMT(24,40,r.isLoggedIn$)?23:-1),e.R7$(2),e.vxM(null!==r.isImporter?25:-1),e.R7$(2),e.SpI(" ",e.bMT(28,42,"COMMON.REQUIRED_FIELD")," "),e.R7$(7),e.JRh(e.bMT(35,44,"ORDER_PAGE.ENTER_RECEIVER_ADDRESS")),e.R7$(2),e.vxM(e.bMT(37,46,r.isLoggedIn$)?36:-1),e.R7$(3),e.vxM(e.bMT(40,48,r.canCopyUserAddressToReceiverAddress())?39:-1),e.R7$(2),e.vxM(!0!==e.bMT(42,50,r.canCopyUserAddressToReceiverAddress())?41:-1),e.R7$(2),e.vxM(r.isUserInPartnerProgram?43:-1),e.R7$(),e.Y8G("side","RECEIVER")("serverSideValidationErrors",r.receiverAddressValidationErrors),e.R50("ngModel",r.receiverAddress),e.Y8G("ardnDataTestId","ardn-shipment-address-form-receiver-address"),e.R7$(2),e.vxM(e.bMT(47,52,r.isLoggedIn$)?46:-1),e.R7$(2),e.vxM((r.isUserInPartnerProgram?r.isPickupFromPoint():e.bMT(49,54,r.canSwapAddresses()))?48:-1))},dependencies:[m.Zm,m.BC,m.vS,ge.d,ee.v,Re.t,Z.Z,nn,l.Jj,f.D9],styles:[".link--use-user-address[_ngcontent-%COMP%], .link--use-user-address-disabled[_ngcontent-%COMP%]{display:inline-block;font-size:15px}.link--use-user-address[_ngcontent-%COMP%]{cursor:pointer}.link--use-user-address-disabled[_ngcontent-%COMP%]{color:#cbcfd4}.link--use-user-address-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}.field.with-padding[_ngcontent-%COMP%]{padding:10px 20px}.customs-role[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.customs-role__label[_ngcontent-%COMP%]{font-weight:500}.customs-role[_ngcontent-%COMP%]     ardn-chip-radio{align-items:flex-start}.customs-role[_ngcontent-%COMP%]     .chip-option{transform-origin:left center}.customs-role[_ngcontent-%COMP%]     .chip-hint, .customs-role[_ngcontent-%COMP%]     .chip-error{display:none}.required-info[_ngcontent-%COMP%]{padding-left:20px}.swap-addresses[_ngcontent-%COMP%]{width:max-content;position:absolute;left:calc(50% + 40px);top:calc(50% - 110px);cursor:pointer}.swap-addresses--color[_ngcontent-%COMP%]{fill:#5b5b5b}@media only screen and (max-width: 1100px){.swap-addresses[_ngcontent-%COMP%]{display:none}}.radio[_ngcontent-%COMP%]{margin-top:15px}.align-left[_ngcontent-%COMP%]{margin-right:20px}@media (min-width: 1077px){.align-right[_ngcontent-%COMP%]{float:right}}  .select2-container .select2-dropdown .select2-search__field{padding-right:0}.receiver-radio[_ngcontent-%COMP%]{margin-top:20.4px}"],changeDetection:0})}}return i})();var Ae=s(79808),cn=s(22419);function sr(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-drop-down",1),e.nI1(1,"translate"),e.bIt("ngModelChange",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.selectionChanged(r))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("dataSource",t.dataSource)("ngModel",t.initPurpose)("placeholder",e.bMT(1,3,"COMMON.SELECT_PLACEHOLDER"))}}let gt=(()=>{class i{constructor(t,n,r,o){this.config=t,this.changeDetector=n,this.translateService=r,this.dataSourceArray=o,this.isCompany=(0,e.hFB)(null),this.propagateChange=()=>{}}ngOnInit(){this.translateService.get(this.getTranslationKeysOfPurposes()).subscribe(t=>{this.purposeList=this.config.shipmentPurposes.filter(n=>!this.isCompany()||n!==cn.e.GIFT).map(n=>({key:n,label:t["ORDER.PURPOSE."+n]})),this.dataSource=this.dataSourceArray.create(this.purposeList,"key")})}selectionChanged(t){this.writeAndPropagateValue(t),this.changeDetector.markForCheck()}
1writeAndPropagateValue(t){this.writeValue(t.key),this.propagateChange(t.key)}registerOnChange(t){this.propagateChange=t}writeValue(t){if(!t)return;const n=this.purposeList.find(r=>r.key===t);n&&(this.initPurpose=n)}registerOnTouched(){}getTranslationKeysOfPurposes(){return this.config.shipmentPurposes.map(t=>"ORDER.PURPOSE."+t)}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Ae.vQ),e.rXU(e.gRc),e.rXU(f.c$),e.rXU(tt.m))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-purpose-chooser"]],inputs:{isCompany:[1,"isCompany"]},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.aNF],decls:1,vars:1,consts:[["ngClass","select2dropdown--small","displayField","label",3,"dataSource","ngModel","placeholder"],["ngClass","select2dropdown--small","displayField","label",3,"ngModelChange","dataSource","ngModel","placeholder"]],template:function(n,r){1&n&&e.DNE(0,sr,2,5,"ardn-drop-down",0),2&n&&e.vxM(r.dataSource?0:-1)},dependencies:[ee.v,f.h,f.D9,m.YN,m.BC,m.vS],encapsulation:2})}}return i})();var Ft=s(21517),un=s.n(Ft),ar=s(89488),dr=s.n(ar);class vt{static create(p){return new this(p)}static createCheckboxAddons(p,t){const n=[],r=dr()(p.map(o=>t.getAddonCategory(o)));for(const o of r){const u=p.filter(A=>t.getAddonCategory(A)===o).map(A=>({type:"CHECKBOX",addons:[A]}));n.push({categoryName:o,addonsGroup:u})}return new this(n)}static createRadioAddons(p,t,n){const r=[];for(const o of this.getFullRequiredAltAddons(p,n))r.push({categoryName:t.getAddonCategory(o[0]),addonsGroup:[{required:!0,type:"RADIO",addons:o}]});return new this(r)}static getFullRequiredAltAddons(p,t){const n=[];for(const r of t){const o=r.map(u=>p.filter(g=>g.id===u));n.push(un()(o))}return n}constructor(p=[]){this._productAddonsCategories=p}get productAddonsCategories(){return this._productAddonsCategories}isEmpty(){return this.productAddonsCategories.length>0}addCategory(p){this._productAddonsCategories.find(t=>t.categoryName===p)||this.productAddonsCategories.push({categoryName:p,addonsGroup:[]})}getCategories(){return Oe()(this._productAddonsCategories)?[]:this.productAddonsCategories.map(p=>p.categoryName)}getAddons(p){return this.productAddonsCategories.find(t=>t.categoryName===p)}}var ft=s(69714),Et=s(84412),pn=s(65245),$t=s(99172),lr=s(13946),cr=s(70980),ur=s(9812),ht=s.n(ur),pr=s(29952),Ne=s.n(pr),mt=s(31775),ot=s(30415),st=s(17352);const hr=i=>({"addon-additional-info__description--show-expanded":i});function mr(i,p){if(1&i&&(e.j41(0,"div",1)(1,"span",4),e.EFF(2),e.k0s()()),2&i){const t=e.XpG();e.R7$(2),e.JRh(t.content())}}function hn(i,p){if(1&i&&(e.j41(0,"div",2)(1,"span",4),e.EFF(2),e.nI1(3,"ardnCurrency"),e.k0s()()),2&i){const t=e.XpG();e.R7$(2),e.SpI("+ ",e.i5U(3,1,t.price(),t.currency()),"")}}function mn(i,p){if(1&i){const t=e.RV6();e.j41(0,"a",8),e.bIt("click",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onClickMore())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&i){const t=e.XpG(2);e.R7$(),e.SpI(" ",e.bMT(2,1,t.expanded?"PRODUCT_ADDONS.COLLAPSE":"PRODUCT_ADDONS.READ_MORE")," ")}}function gn(i,p){if(1&i&&e.nrm(0,"span",7),2&i){const t=e.XpG(2);e.Y8G("ngClass",e.eq3(2,hr,t.expanded))("innerHTML",t.options().addonDescriptionExp,e.npT)}}function gr(i,p){if(1&i&&(e.j41(0,"div",3),e.nrm(1,"span",5),e.DNE(2,mn,3,3,"a",6)(3,gn,1,4,"span",7),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("innerHTML",t.options().addonDescription,e.npT),e.R7$(),e.vxM(t.options().addonDescriptionExp?2:-1),e.R7$(),e.vxM(t.options().addonDescriptionExp?3:-1)}}let at=(()=>{class i{constructor(){this.content=(0,e.hFB)(),this.price=(0,e.hFB)(null),this.options=(0,e.hFB)(),this.currency=(0,e.hFB)(),this.expanded=!1}isAddonDescriptionExists(){return!!this.options()?.addonDescription}onClickMore(){this.expanded=!this.expanded}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-additional-info"]],inputs:{content:[1,"content"],price:[1,"price"],options:[1,"options"],currency:[1,"currency"]},standalone:!0,features:[e.aNF],decls:4,vars:3,consts:[[1,"addon-additional-info"],[1,"addon-additional-info__content"],[1,"addon-additional-info__price"],[1,"addon-additional-info__description"],[1,"color-progress"],[1,"addon-additional-info__description--short",3,"innerHTML"],[1,"addon-additional-info__description--more"],[1,"addon-additional-info__description--expanded",3,"ngClass","innerHTML"],[1,"addon-additional-info__description--more",3,"click"]],template:function(n,r){1&n&&(e.j41(0,"div",0),e.DNE(1,mr,3,1,"div",1)(2,hn,4,4,"div",2)(3,gr,4,3,"div",3),e.k0s()),2&n&&(e.R7$(),e.vxM(r.content()?1:-1),e.R7$(),e.vxM(r.price()?2:-1),e.R7$(),e.vxM(r.isAddonDescriptionExists()?3:-1))},dependencies:[st.W,f.h,f.D9,l.YU],styles:[".addon-additional-info[_ngcontent-%COMP%]{position:relative;margin-left:33px}.addon-additional-info__content[_ngcontent-%COMP%]{padding-right:100px}.addon-additional-info__price[_ngcontent-%COMP%]{position:absolute;right:0;top:0;font-size:13px;font-weight:500}.addon-additional-info__description[_ngcontent-%COMP%]{display:inline-block;font-size:1.3rem;line-height:1.8rem;font-style:italic;margin-top:.5rem}.addon-additional-info__description--short[_ngcontent-%COMP%]     p{display:inherit!important}.addon-additional-info__description--more[_ngcontent-%COMP%]{text-decoration:underline;display:inline;cursor:pointer}.addon-additional-info__description--expanded[_ngcontent-%COMP%]{display:none;height:0;margin-top:1rem}.addon-additional-info__description--show-expanded[_ngcontent-%COMP%]{display:block;height:100%}"]})}}return i})();function fr(i,p){if(1&i&&(e.j41(0,"span",1),e.EFF(1),e.nI1(2,"ardnCurrency"),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.SpI(" + ",e.i5U(2,1,t.addonPrice(),t.currency())," ")}}function St(i,p){1&i&&(e.j41(0,"span",2),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"ORDER_PAGE.INCLUDED")," "))}function Cr(i,p){if(1&i&&e.DNE(0,St,3,3,"span",2),2&i){const t=e.XpG(2);e.vxM(t.addonInPrice()?0:-1)}}function Nt(i,p){if(1&i&&(e.j41(0,"div",0),e.DNE(1,fr,3,4,"span",1)(2,Cr,1,1),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.vxM(t.addonPrice()>0?1:0===t.addonPrice()?2:-1)}}let dt=(()=>
1{class i{constructor(){this.addonPrice=(0,e.hFB)(),this.addonInPrice=(0,e.hFB)(),this.currency=(0,e.hFB)()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-price"]],inputs:{addonPrice:[1,"addonPrice"],addonInPrice:[1,"addonInPrice"],currency:[1,"currency"]},standalone:!0,features:[e.aNF],decls:1,vars:1,consts:[[1,"product-addon-price"],[1,"product-addon-price__content","color-progress"],[1,"product-addon-price__content","color-primary"]],template:function(n,r){1&n&&e.DNE(0,Nt,3,1,"div",0),2&n&&e.vxM(null!==r.addonPrice()&&void 0!==r.addonPrice()?0:-1)},dependencies:[st.W,f.h,f.D9],styles:[".product-addon-price[_ngcontent-%COMP%]{display:inline-block;margin-left:8px;width:80px;white-space:nowrap;text-align:right}"]})}}return i})();function fn(i,p){1&i&&(e.j41(0,"span",6),e.EFF(1,"*"),e.k0s())}function Cn(i,p){if(1&i&&(e.j41(0,"span",7),e.EFF(1,"i"),e.k0s()),2&i){const t=e.XpG().$implicit;e.Y8G("ardnTooltipster",null==t?null:t.tooltip)}}function _r(i,p){if(1&i&&(e.j41(0,"div",9),e.nrm(1,"input",13),e.k0s()),2&i){let t;const n=e.XpG().$implicit;e.R7$(),e.Y8G("formControlName",n.name)("type",null==n?null:n.type)("placeholder",null!==(t=null==n?null:n.placeholder)&&void 0!==t?t:"")}}function Or(i,p){if(1&i&&(e.j41(0,"div",10),e.nrm(1,"ardn-number-input",14),e.k0s()),2&i){let t;const n=e.XpG().$implicit;e.R7$(),e.Y8G("formControlName",n.name)("placeholder",null!==(t=null==n?null:n.placeholder)&&void 0!==t?t:"")("min",.01)("maxFractionDigits",2)("showArrow",!1)}}function _n(i,p){if(1&i&&(e.j41(0,"div",11),e.nrm(1,"input",15),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.Y8G("formControlName",t.name)}}function yr(i,p){if(1&i&&(e.j41(0,"div",2)(1,"div",4)(2,"label",5),e.EFF(3),e.DNE(4,fn,2,0,"span",6)(5,Cn,2,1,"span",7),e.k0s()(),e.j41(6,"div",8),e.DNE(7,_r,2,3,"div",9)(8,Or,2,5,"div",10)(9,_n,2,1,"div",11),e.nrm(10,"ardn-field-validator",12),e.k0s()()),2&i){let t;const n=p.$implicit,r=e.XpG();e.R7$(3),e.SpI(" ",null==n?null:n.label," "),e.R7$(),e.vxM(null!=n&&n.required?4:-1),e.R7$(),e.vxM(null!=n&&n.tooltip?5:-1),e.R7$(2),e.vxM("text"===(t=n.type)?7:"number"===t?8:"time"===t?9:-1),e.R7$(3),e.Y8G("clientSideValidation",r.form.get(n.name))("clientErrorMessage",r.getCustomErrorMessage(n.name))("serverSideValidation",r.getValidationError(n.name))("notValidateDisabled",!0)}}function vr(i,p){1&i&&(e.j41(0,"p",3),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.ERRORS.TIME_RANGE")," "))}const Er=/^([01]\d|2[0-3]):([0-5]\d)$/;let We=(()=>{class i{constructor(t,n,r){this.fb=t,this.scrollService=n,this.dataSourceArrayFactoryService=r,this.fields=(0,e.hFB)([]),this.form=this.fb.group({}),this.serverValidationErrors=(0,e.hFB)({}),this.validityChanged=(0,e.CGW)(),this.disabled=!1,this.onChange=()=>{},this.onTouched=()=>{}}ngOnChanges(t){t?.fields?.currentValue!==t?.fields?.previousValue&&this.rebuildFormFromFields()}writeValue(t){this.form&&Object.keys(this.form.controls).length?this.form.patchValue(t||{},{emitEvent:!1}):this.rebuildFormFromFields(t||{})}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this.form&&(t?this.form.disable({emitEvent:!1}):this.form.enable({emitEvent:!1}))}markAllTouched(){Object.values(this.form.controls).forEach(t=>t.markAsTouched()),this.onTouched()}getValidationError(t){const n=this.serverValidationErrors();if(!n)return null;const r=Object.keys(n).find(o=>o.endsWith(`[fields][${t}]`));return r?n[r]:null}validate(t){const n=[];Object.keys(this.form.controls).forEach(r=>{this.form.get(r).markAsTouched({onlySelf:!0}),n.push(r)}),t||this.scrollService.findInvalidFieldAndScroll(n,this.form)}getCustomErrorMessage(t){const n=this.form.get(t);if(n.errors){if(n?.hasError("required"))return"COMMON.ERRORS.REQUIRED";if(n?.hasError("pattern"))return"COMMON.ERRORS.INVALID"}return null}rebuildFormFromFields(t){const n={};(this.fields()??[]).forEach(r=>{const o=[];r.required&&o.push(m.k0.required),"time"===r.type&&o.push(m.k0.pattern(Er));const u=t&&void 0!==t[r.name]?t[r.name]:r.value??null;switch(r.type){case"select":r.dataSource=this.generateOptions(r.options);break;case"multiselect":r.dataSource=this.generateMultiselectOptions(r.options)}n[r.name]=new m.MJ({value:u,disabled:this.disabled},o)}),this.form=this.fb.group(n),this.form?.get("timeFrom")&&this.form?.get("timeTo")&&this.form.setValidators((0,oe.$V)("timeFrom","timeTo")),this.validityChanged.emit(this.form.valid),this.form.valueChanges.subscribe(r=>this.onChange(r)),this.form.statusChanges.subscribe(()=>{this.validityChanged.emit(this.form.valid)})}generateOptions(t){return this.dataSourceArrayFactoryService.create(t,"name")}generateMultiselectOptions(t=[]){return t.map(n=>({id:n?.name,itemName:n?.name,value:n?.value}))}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(m.ok),e.rXU(nt.b),e.rXU(tt.m))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-category-fields"]],inputs:{fields:[1,"fields"],serverValidationErrors:[1,"serverValidationErrors"]},outputs:{validityChanged:"validityChanged"},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.OA$,e.aNF],decls:5,vars:2,consts:[[3,"formGroup"],[1,"addon-category__fields"],[1,"field"],[1,"form-error"],[1,"order-setup__label"],[1,"label"],[1,"label--required"],[1,"info-icon","tooltip",3,"ardnTooltipster"],[1,"order-setup__input"],[1,"text-input"],[1,"number-input"],[1,"timepicker-input"],[1,"input-validation",3,"clientSideValidation","clientErrorMessage","serverSideValidation","notValidateDisabled"],[1,"input",3,"formControlName","type","placeholder"],[3,"formControlName","placeholder","min","maxFractionDigits","showArrow"],["type","time","step","60",1,"timepicker-element",3,"formControlName"]],template:function(n,r){1&n&&(e.j41(0,"form",0)(1,"div",1),e.Z7z(2,yr,11,8,"div",2,e.fX1),e.k0s(),e.DNE(4,vr,3,3,"p",3),e.k0s()),2&n&&(e.Y8G("formGroup",r.form),e.R7$(2),e.Dyx(r.fields()),e.R7$(2),e.vxM(null!=r.form&&r.form.hasError("invalidTimeRange")?4:-1))},dependencies:[l.MD,ge.d,ye.Q,m.X1,m.qT,m.me,m.BC,m.cb,m.j4,m.JD,f.h,f.D9,ot.N],styles:[".addon-category__fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding-top:10px;clear:both}.addon-category__fields[_ngcontent-%COMP%]   .field[_ngcontent-%COMP%]{margin-bottom:10px}@media only screen and (max-width: 40em){.addon-category__fields[_ngcontent-%COMP%]   .field[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{padding:0 10px}}.timepicker-input[_ngcontent-%COMP%]{position:relative;display:flex}.timepicker-element[_ngcontent-%COMP%]{margin:0;padding:10px;height:40px;background:#fff;border-radius:5px;color:#5b5b5b;border:solid 1px #bcbcbc;box-sizing:border-box;width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.has-error[_ngcontent-%COMP%]   .timepicker-element[_ngcontent-%COMP%]{color:#f72323;background-color:#fff1f1;border-color:#f72323}"]})}}return i})();var On=s(29084);const Sr=i=>({"like-label":i});function br(i,p){if(1&i&&e.nrm(0,"ardn-product-addon-additional-info",5),2&i){const t=e.XpG().$implicit;e.Y8G("content",t.additionalInfo)("price",t.price)("currency",t.currency)("ardnDataTestId","ardn-product-addon-additional-info-"+(null==t?null:t.id))}}function Pr(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.j41(3,"span",15),e.EFF(4),e.nI1(5,"translate"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,2,"TOOLTIP.STANDARD_PALLET_CONTENT_2")),e.R7$(3),e.JRh(e.bMT(5,4,"TOOLTIP.COURIER_MESSAGE_PALLET")))}function kt(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.DNE(3,Pr,6,6)),2&i){const t=e.XpG(3);e.R7$(),e.JRh(e.bMT(2,2,"TOOLTIP.STANDARD_PALLET_CONTENT_1")),e.R7$(2),e.vxM(t.isExpandedPackageInfo?3:-1)}}function Ar(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.j41(3,"b"),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"span",15),e.EFF(7),e.nI1(8,"translate"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,3,"TOOLTIP.STANDARD_PARCEL_CONTENT_2")),e.R7$(3),e.JRh(e.bMT(5,5,"TOOLTIP.STANDARD_PARCEL_CONTENT_3")),e.R7$(3),e.JRh(e.bMT(8,7,"TOOLTIP.COURIER_MESSAGE_PARCEL")))}function Rr(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.DNE(3,Ar,9,9)),2&i){const t=e.XpG(3);e.R7$(),e.JRh(e.bMT(2,2,"TOOLTIP.STANDARD_PARCEL_CONTENT_1")),e.R7$(2),e.vxM(t.isExpandedPackageInfo?3:-1)}}function Tr(i,p){if(1&i&&(e.j41(0,"div",14),e.nrm(1,"ardn-picture",16),e.nI1(2,"translate"),e.k0s()),2&i){const t=p.$implicit;e.R7$(),e.Y8G("mainImageSource","/assets/img/packages/"+t.source+".webp")("fallbackImageSource","/assets/img/packages/"+t.source+".jpg")("altDescription",e.bMT(2,5,t.altDescription))("width",80)("height",80)}}function Ir(i,p){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"div",10)(2,"div",11),e.DNE(3,kt,4,4)(4,Rr,4,4),e.j41(5,"a",12),e.bIt("click",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onClickShowMore())}),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"div",13),e.Z7z(9,Tr,3,7,"div",14,e.fX1),e.k0s()()()()}if(2&i){const t=e.XpG(2);e.R7$(3),e.vxM(t.isPalette?3:4),e.R7$(3),e.JRh(e.bMT(7,2,t.isExpandedPackageInfo?"TOOLTIP.HIDE_CONTENT":"TOOLTIP.SHOW_MORE_CONTENT")),e.R7$(3),e.Dyx(t.addonImages)}}function Dr(i,p){if(1&i&&(e.j41(0,"span",7),e.nI1(1,"translate"),e.EFF(2,"i"),e.k0s()),2&i){const t=e.XpG().$implicit;e.Y8G("ardnTooltipster",e.bMT(1,1,"TOOLTIP."+t.tooltip))}}function Mr(i,p){if(1&i&&(e.j41(0,"span",7),e.EFF(1,"i"),e.k0s()),2&i){const t=e.XpG().$implicit;e.Y8G("ardnTooltipster",t.description)}}function yn(i,p){if(1&i&&e.nrm(0,"ardn-product-addon-price",8),2&i){const t=e.XpG().$implicit;e.Y8G("addonPrice",t.price)("addonInPrice",t.inPrice)("currency",t.currency)("ardnDataTestId","ardn-product-addon-price"+(null==t?null:t.id))}}function Fr(i,p){if(1&i&&(e.j41(0,"div",9),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.JRh(t.priceDescription)}}function $r(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",1)(1,"label",2)(2,"input",3),e.bIt("change",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.onSelect())}),e.k0s(),e.j41(3,"span",4),e.EFF(4),e.k0s()(),e.DNE(5,br,1,4,"ardn-product-addon-additional-info",5)(6,Ir,11,4,"div"),e.j41(7,"div",6),e.DNE(8,Dr,3,3,"span",7)(9,Mr,2,1,"span",7)(10,yn,1,4,"ardn-product-addon-price",8),e.k0s(),e.DNE(11,Fr,2,1,"div",9),e.k0s()}if(2&i){const t=p.$implicit,n=e.XpG();e.R7$(),e.Y8G("ardnDataTestId","ardn-product-addon-radio-form-"+(null==t?null:t.id)+"-label")("ngClass",e.eq3(14,Sr,(null==t?null:t.id)===n.hiddenRadioAddonId())),e.R7$(),e.Y8G("value",t)("ardnDataTestId","ardn-product-addon-radio-form-"+(null==t?null:t.id)+"-input"),e.BMQ("disabled",t.disabled?"":null)("checked",t.checked?"":null)("addon",n.showAddonId()?t.id:null),e.R7$(2),e.JRh(t.addonName),e.R7$(),e.vxM(n.isShowAdditionalInformation(t)?5:-1),e.R7$(),e.vxM(t.addonName===n.standardType?6:-1),e.R7$(2),e.vxM(t.tooltip?8:-1),e.R7$(),e.vxM(t.description?9:-1),e.R7$(),e.vxM(n.showPrice()?10:-1),e.R7$(),e.vxM(t.priceDescription?11:-1)}}let rt=(()=>{class i{constructor(t,n,r){this.translate=t,this.formBuilder=n,this.store=r,this.radioAddonForm=this.formBuilder.group({radioControl:null}
1),this.addons=(0,e.hFB)(null),this.showPrice=(0,e.hFB)(!0),this.compareCheckedParams=(0,e.hFB)(!1),this.propagateValueParams=(0,e.hFB)(!0),this.showAddonId=(0,e.hFB)(!1),this.defaultSelected=(0,e.hFB)(!0),this.hiddenRadioAddonId=(0,e.hFB)(null),this.cachedChosenRadio=(0,e.hFB)(null),this.isPalette=!1,this.stateEmitter=(0,e.CGW)(),this.isExpandedPackageInfo=!0,this.isShipmentTypeSet=!1,this.standardType=this.translate.instant("PRODUCT_ADDONS.OPTIONS.STANDARD_PARCEL_SHIPMENT_TYPE"),this.nonStandardType=this.translate.instant("PRODUCT_ADDONS.OPTIONS.NON_STANDARD_PARCEL_SHIPMENT_TYPE"),this.addonParcelImages=[{source:"koperta",altDescription:"TOOLTIP.ALT_DESCRIPTIONS.ENVELOPE"},{source:"karton",altDescription:"TOOLTIP.ALT_DESCRIPTIONS.CARDBOARD"},{source:"opona",altDescription:"TOOLTIP.ALT_DESCRIPTIONS.TYRE"}],this.addonPaletteImages=[{source:"paleta",altDescription:"TOOLTIP.ALT_DESCRIPTIONS.PALETTE"}],this.propagateChange=()=>{},this.store?.select(T.t6)?.pipe((0,U.p)(o=>!!o)).subscribe(o=>{this.isPalette="PALLET"===o.packageType,this.standardType=this.translate.instant(this.isPalette?"PRODUCT_ADDONS.OPTIONS.STANDARD_PALLET_SHIPMENT_TYPE":"PRODUCT_ADDONS.OPTIONS.STANDARD_PARCEL_SHIPMENT_TYPE"),this.nonStandardType=this.translate.instant(this.isPalette?"PRODUCT_ADDONS.OPTIONS.NON_STANDARD_PALLET_SHIPMENT_TYPE":"PRODUCT_ADDONS.OPTIONS.NON_STANDARD_PARCEL_SHIPMENT_TYPE"),this.addonImages=this.isPalette?this.addonPaletteImages:this.addonParcelImages}),(0,e.QZP)(()=>
1{this.addons(),this.initForm(),this.propagateValueParams()&&this.propagateValue()})}ngAfterViewInit(){this.stateEmitter.emit()}onClickShowMore(){this.isExpandedPackageInfo=!this.isExpandedPackageInfo}onSelect(){!this.defaultSelected()&&!this.isShipmentTypeSet&&(this.isExpandedPackageInfo=!1,this.isShipmentTypeSet=!0)}compareChecked(t,n){if(t&&n)for(let r=0;r<t?.length;r++)if(t?.[r]&&n?.[r]&&t?.[r].checked!==n?.[r].checked)return!1;return!0}propagateValue(){setTimeout(()=>{this.selectedAddon&&Ne()(this.addons(),this.selectedAddon)?this.propagateChange(this.selectedAddon):this.propagateChange(this.addons()?.[0])},0)}initForm(){let t=this.addons().filter(n=>!0===n.checked)?.[0];this.defaultSelected()&&!t&&(t=this.addons()?.[0]),!this.compareCheckedParams()&&this.selectedAddon&&Ne()(this.addons(),this.selectedAddon)&&(t=this.selectedAddon),this.selectedAddon=t,this.radioAddonForm.get("radioControl").setValue(t),this.radioAddonForm.valueChanges.subscribe(()=>{this.selectedAddon=this.radioAddonForm?.value?.radioControl,this.cachedChosenRadio()&&this.cachedChosenRadio().next(this.radioAddonForm.getRawValue().radioControl.id),this.prop
1agateValueParams()&&this.propagateChange(this.addons().find(n=>n.id===this.radioAddonForm.value.radioControl.id))})}registerOnChange(t){this.propagateChange=t}writeValue(t){t&&(this.selectedAddon=t,this.radioAddonForm.patchValue({radioControl:t||this.addons()?.[0]}))}registerOnTouched(){}isShowAdditionalInformation(t){return!!t?.additionalInfo||!!t?.options?.addonDescription}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(f.c$),e.rXU(m.ok),e.rXU(v.il))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-radio"]],inputs:{addons:[1,"addons"],showPrice:[1,"showPrice"],compareCheckedParams:[1,"compareCheckedParams"],propagateValueParams:[1,"propagateValueParams"],showAddonId:[1,"showAddonId"],defaultSelected:[1,"defaultSelected"],hiddenRadioAddonId:[1,"hiddenRadioAddonId"],cachedChosenRadio:[1,"cachedChosenRadio"]},outputs:{stateEmitter:"stateEmitter"},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.aNF],decls:3,vars:1,consts:[[3,"formGroup"],[1,"radio"],[3,"ardnDataTestId","ngClass"],["type","radio","formControlName","radioControl",1,"package-info-title",3,"change","value","ardnDataTestId"],[2,"font-weight","bold","word-break","break-word"],[3,"content","price","currency","ardnDataTestId"],[1,"order-setup__info"],[1,"info-icon","tooltip","tooltipstered",3,"ardnTooltipster"],[3,"addonPrice","addonInPrice","currency","ardnDataTestId"],[1,"order-setup__description","color-progress"],[1,"html-tooltip-container"],[1,"package-info-content"],[1,"package-info-content-show-hide",3,"click"],[1,"html-tooltip-container","display-flex"],[1,"package-info-img-container"],[1,"package-info-underline"],[3,"mainImageSource","fallbackImageSource","altDescription","width","height"]],template:function(n,r){1&n&&(e.j41(0,"div",0),e.Z7z(1,$r,12,16,"div",1,e.fX1),e.k0s()),2&n&&(e.Y8G("formGroup",r.radioAddonForm),e.R7$(),e.Dyx(r.addons()))},dependencies:[m.X1,m.me,m.Fm,m.BC,m.cb,m.j4,m.JD,Z.Z,at,f.h,f.D9,On.W,ge.d,dt,l.YU],styles:[".tooltipster-close[_ngcontent-%COMP%]{pointer-events:all;position:absolute;right:5px;top:5px;cursor:pointer}.info-icon.html-tooltip[_ngcontent-%COMP%]{position:absolute;right:0;top:0}.html-tooltip-container[_ngcontent-%COMP%]{max-width:700px;pointer-events:all}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-title[_ngcontent-%COMP%]{text-transform:uppercase;font-weight:700;font-size:14px}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]{line-height:1.7}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   .standard-package-info-content-read-more[_ngcontent-%COMP%]{text-decoration:underline;font-style:italic;cursor:pointer;white-space:nowrap}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   .package-info-content-show-hide[_ngcontent-%COMP%]{margin-left:4px;text-decoration:underline;cursor:pointer;white-space:nowrap}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   .package-info-underline[_ngcontent-%COMP%]{text-decoration:underline}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   .package-info-img-container[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{max-width:80px}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{list-style:disc;margin-left:20px}.display-flex[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}",".like-label[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:before, .like-label[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:after{display:none}"]})}}return i})();var bt=s(60213),Nr=s(85401),Vt=s(57725);var Ut=s(30554);const vn=function Ur(i){return i==i&&!(0,Ut.A)(i)};var En=s(2662);const bn=function Gr(i,p){return function(t){return null!=t&&t[i]===p&&(void 0!==p||i in Object(t))}},jr=function Lr(i){var p=function Sn(i){for(var p=(0,En.A)(i),t=p.length;t--;){var n=p[t],r=i[n];p[t]=[n,r,vn(r)]}return p}(i);return 1==p.length&&p[0][2]?bn(p[0][0],p[0][1]):function(t){return t===i||function xt(i,p,t,n){var r=t.length,o=r,u=!n;if(null==i)return!o;for(i=Object(i);r--;){var g=t[r];if(u&&g[2]?g[1]!==i[g[0]]:!(g[0]in i))return!1}for(;++r<o;){var A=(g=t[r])[0],N=i[A],w=g[1];if(u&&g[2]){if(void 0===N&&!(A in i))return!1}else{var te=new Nr.A;if(n)var ne=n(N,w,A,i,p,te);if(!(void 0===ne?(0,Vt.A)(w,N,3,n,te):ne))return!1}}return!0}(t,i,p)}};var Lt=s(34501);const Yr=function Xr(i,p){return null!=i&&p in Object(i)};var jt=s(28954),Wr=s(66513),Pn=s(43744),An=s(28606),Rn=s(15481),Ct=s(24662);const wt=function In(i,p){return null!=i&&function Hr(i,p,t){for(var n=-1,r=(p=(0,jt.A)(p,i)).length,o=!1;++n<r;){var u=(0,Ct.A)(p[n]);if(!(o=null!=i&&t(i,u)))break;i=i[u]}return o||++n!=r?o:!!(r=null==i?0:i.length)&&(0,Rn.A)(r)&&(0,An.A)(u,r)&&((0,Pn.A)(i)||(0,Wr.A)(i))}(i,p,Yr)};var Dn=s(93097);const Kr=function Fn(i,p){return(0,Dn.A)(i)&&vn(p)?bn((0,Ct.A)(i),p):function(t){var n=function wr(i,p,t){var n=null==i?void 0:(0,Lt.A)(i,p);return void 0===n?t:n}(t,i);return void 0===n&&n===p?wt(t,i):(0,Vt.A)(p,n,3)}};var Qr=s(57003);const ni=function ti(i){return(0,Dn.A)(i)?function Jr(i){return function(p){return p?.[i]}}((0,Ct.A)(i)):function qr(i){return function(p){return(0,Lt.A)(p,i)}}(i)},$n=function ri(i){return"function"==typeof i?i:null==i?Qr.A:"object"==typeof i?(0,Pn.A)(i)?Kr(i[0],i[1]):jr(i):ni(i)};var ai=s(56689),di=s(81984);const ci=function li(i,p,t,n){if(!(0,Ut.A)(i))return i;for(var r=-1,o=(p=(0,jt.A)(p,i)).length,u=o-1,g=i;null!=g&&++r<o;){var A=(0,Ct.A)(p[r]),N=t;if("__proto__"===A||"constructor"===A||"prototype"===A)return i;if(r!=u){var w=g[A];void 0===(N=n?n(w,A,g):void 0)&&(N=(0,Ut.A)(w)?w:(0,An.A)(p[r+1])?[]:{})}(0,di.A)(g,A,N),g=g[A]}return i},Nn=function ui(i,p,t){for(var n=-1,r=p.length,o={};++n<r;){var u=p[n],g=(0,Lt.A)(i,u);t(g,u)&&ci(o,(0,jt.A)(u,i),g)}return o};var pi=s(57372);const fi=function gi(i,p){return function hi(i,p){if(null==i)return{};var t=(0,ai.A)((0,pi.A)(i),function(n){return[n]});return p=$n(p),Nn(i,t,function(n,r){return p(n,r[0])})}(i,function oi(i){if("function"!=typeof i)throw new TypeError("Expected a function");return function(){var p=arguments;switch(p.length){case 0:return!i.call(this);case 1:return!i.call(this,p[0]);case 2:return!i.call(this,p[0],p[1]);case 3:return!i.call(this,p[0],p[1],p[2])}return!i.apply(this,p)}}($n(p)))};function Ci(i,p){if(1&i&&(e.j41(0,"form",1)(1,"div",2)(2,"div",3)(3,"span",4)(4,"span",5),e.EFF(5),e.nI1(6,"translate"),e.j41(7,"span",6),e.EFF(8,"*"),e.k0s()()()(),e.j41(9,"div",7),e.nrm(10,"input",8)(11,"ardn-field-validator",9),e.k0s()(),e.j41(12,"div",2)(13,"div",3)(14,"span",4)(15,"span",5),e.EFF(16),e.nI1(17,"translate"),e.j41(18,"span",6),e.EFF(19,"*"),e.k0s()()()(),e.j41(20,"div",7),e.nrm(21,"ardn-country-chooser",10,0)(23,"ardn-field-validator",9),e.k0s()(),e.j41(24,"div",2)(25,"div",3)(26,"span",4)(27,"span",5),e.EFF(28),e.nI1(29,"translate"),e.j41(30,"span",6),e.EFF(31,"*"),e.k0s()()()(),e.j41(32,"div",7),e.nrm(33,"input",11)(34,"ardn-field-validator",9),e.k0s()(),e.j41(35,"div",2)(36,"div",3)(37,"span",4)(38,"span",5),e.EFF(39),e.nI1(40,"translate"),e.j41(41,"span",6),e.EFF(42,"*"),e.k0s()()()(),e.j41(43,"div",7),e.nrm(44,"input",12)(45,"ardn-field-validator",9),e.k0s()(),e.j41(46,"div",2)(47,"div",3)(48,"span",4)(49,"span",5),e.EFF(50),e.nI1(51,"translate"),e.k0s()()(),e.j41(52,"div",7),e.nrm(53,"input",13)(54,"ardn-field-validator",9),e.k0s()(),e.j41(55,"div",2)(56,"div",3)(57,"span",4)(58,"span",5),e.EFF(59),e.nI1(60,"translate"),e.j41(61,"span",6),e.EFF(62,"*"),e.k0s()()()(),e.j41(63,"div",7),e.nrm(64,"input",14)(65,"ardn-field-validator",9),e.k0s()(),e.j41(66,"div",2)(67,"div",3)(68,"span",4)(69,"span",5),e.EFF(70),e.nI1(71,"translate"),e.j41(72,"span",6),e.EFF(73,"*"),e.k0s()()()(),e.j41(74,"div",7),e.nrm(75,"input",15)(76,"ardn-field-validator",9),e.k0s()()()),2&i){const t=e.XpG();e.Y8G("formGroup",t.returnShipmentForm),e.R7$(5),e.SpI(" ",e.bMT(6,30,"COMMON.NAME")," "),e.R7$(6),e.Y8G("clientSideValidation",t.returnShipmentForm.get("name"))("clientErrorMessage",t.returnProperErrorMessage("name"))("serverSideValidation",null==t.serverErrors?null:t.serverErrors.name),e.R7$(5),e.SpI(" ",e.bMT(17,32,"COMMON.ADDRESS.COUNTRY")," "),e.R7$(5),e.Y8G("disabled",!0),e.R7$(2),e.Y8G("clientSideValidation",t.returnShipmentForm.get("countryId"))("clientErrorMessage",t.returnProperErrorMessage("countryId"))("serverSideValidation",null==t.serverErrors?null:t.serverErrors.countryId),e.R7$(5),e.SpI(" ",e.bMT(29,34,"COMMON.ADDRESS.STREET")," "),e.R7$(6),e.Y8G("clientSideValidation",t.returnShipmentForm.get("street"))("clientErrorMessage",t.returnProperErrorMessage("street"))("serverSideValidation",null==t.serverErrors?null:t.serverErrors.street),e.R7$(5),e.SpI(" ",e.bMT(40,36,"COMMON.ADDRESS.HOUSE_NUMBER")," "),e.R7$(6),e.Y8G("clientSideValidation",t.returnShipmentForm.get("houseNumber"))("clientErrorMessage",t.returnProperErrorMessage("houseNumber"))("serverSideValidation",null==t.serverErrors?null:t.serverErrors.house
1Number),e.R7$(5),e.SpI(" ",e.bMT(51,38,"COMMON.ADDRESS.APARTMENT_NUMBER")," "),e.R7$(4),e.Y8G("clientSideValidation",t.returnShipmentForm.get("apartmentNumber"))("clientErrorMessage",t.returnProperErrorMessage("apartmentNumber"))("serverSideValidation",null==t.serverErrors?null:t.serverErrors.apartmentNumber),e.R7$(5),e.SpI(" ",e.bMT(60,40,"COMMON.ADDRESS.POST_CODE")," "),e.R7$(6),e.Y8G("clientSideValidation",t.returnShipmentForm.get("postCode"))("clientErrorMessage",t.returnProperErrorMessage("postCode"))("serverSideValidation",null==t.serverErrors?null:t.serverErrors.postCode),e.R7$(5),e.SpI(" ",e.bMT(71,42,"COMMON.ADDRESS.CITY")," "),e.R7$(6),e.Y8G("clientSideValidation",t.returnShipmentForm.get("city"))("clientErrorMessage",t.returnProperErrorMessage("city"))("serverSideValidation",null==t.serverErrors?null:t.serverErrors.city)}}let _i=(()=>{class i{constructor(t,n,r,o){this.formBuilder=t,this.store=n,this.properErrorMessageService=r,this.changeDetector=o,this.addon=(0,e.hFB)(),this.validityChanged=(0,e.CGW)(),this.returnShipmentForm=this.initFormFields(),this.serverErrors={},this.setShipmentForms()}ngOnChanges(t){t?.addon?.currentValue?.checked!==t?.addon?.previousValue?.checked&&this.toggleValidators(t?.addon?.currentValue?.checked)}ngOnInit(){this.returnShipmentForm.valueChanges.pipe((0,ce.B)(50)).subscribe(()=>{this.validityChanged.emit(this.returnShipmentForm?.valid),this.updateAddon()}),this.getServerValidationErrors()}returnProperErrorMessage(t){return this.properErrorMessageService.get(t,this.returnShipmentForm)}updateAddon(){this.returnShipmentForm?.valid&&this.store.select(T.k$).pipe((0,M.s)(1),(0,X.T)(t=>t.find(n=>n.id===this.addon()?.id)),(0,U.p)(t=>!!t)).subscribe(()=>{const t=fi(this.returnShipmentForm?.getRawValue(),i=>!i||""===i);this.store.dispatch(F.M.createSetAddonReturnShipmentAddress(t))})}setShipmentForms(){(0,q.z)([this.store.select(J.pu),this.store.select(T.aT),this.store.select(T.Np)]).pipe((0,M.s)(1)).subscribe(([t,n,r])=>{r?this.setFormValues(r):(this.setShipmentClientType(t),this.setShipmentField("countryId",n?.countryId))})}setFormValues(t){Object.keys(t).forEach(r=>{this.returnShipmentForm.controls?.[r]&&this.returnShipmentForm.controls?.[r].setValue(t?.[r])})}initFormFields(){return this.formBuilder.group({type:[{value:"PERSON"}],name:["",m.k0.compose([m.k0.required,m.k0.minLength(3)])],countryId:["",m.k0.required],street:["",m.k0.compose([m.k0.required,m.k0.minLength(1)])],houseNumber:["",[m.k0.required]],apartmentNumber:["",m.k0.compose([m.k0.maxLength(20),oe.af])],postCode:["",m.k0.compose([m.k0.required])],city:["",m.k0.compose([m.k0.required,m.k0.minLength(3)])]})}setShipmentClientType(t){t&&this.returnShipmentForm?.get("type")?.patchValue(t)}setShipmentField(t,n){n&&this.returnShipmentForm?.get(t)?.patchValue(n)}getServerValidationErrors(){this.store.select(T.Ff).pipe((0,U.p)(t=>!!t?.fields),(0,X.T)(t=>t?.fields?.addons)).subscribe(t=>{const n=t?.filter(r=>this.addon()?.id===r?.addonId);this.mapServerErrors(n),this.changeDetector.detectChanges()})}mapServerErrors(t){const n={};t?.forEach(r=>n[r.fieldName]=r.message),this.serverErrors=n,this.changeDetector.detectChanges()}toggleValidators(t){const n={name:[m.k0.required,m.k0.minLength(3)],countryId:[m.k0.required],street:[m.k0.required,m.k0.minLength(1)],houseNumber:[m.k0.required],apartmentNumber:[m.k0.maxLength(20),oe.af],postCode:[m.k0.required],city:[m.k0.required,m.k0.minLength(3)]};Object.entries(this.returnShipmentForm.controls).forEach(([r,o])=>{t&&n[r]?o.setValidators(n[r]):o.clearValidators(),o.updateValueAndValidity()})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(m.ok),e.rXU(v.il),e.rXU(Zt.D),e.rXU(e.gRc))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-return-shipment-address-category"]],inputs:{addon:[1,"addon"]},outputs:{validityChanged:"validityChanged"},standalone:!0,features:[e.OA$,e.aNF],decls:1,vars:1,consts:[["countryDropDown",""],["novalidate","",3,"formGroup"],[1,"field"],[1,"order-setup__label"],[1,"v-align"],[1,"v-align__content"],[1,"label--required"],[1,"order-setup__input","field"],["formControlName","name",1,"input"],[1,"input-validation",3,"clientSideValidation","clientErrorMessage","serverSideValidation"],["formControlName","countryId",3,"disabled"],["formControlName","street",1,"input"],["formControlName","houseNumber",1,"input"],["formControlName","apartmentNumber",1,"input"],["formControlName","postCode",1,"input"],["formControlName","city",1,"input"]],template:function(n,r){if(1&n&&e.DNE(0,Ci,77,44,"form",1),2&n){let o;e.vxM(null!=(o=r.addon())&&o.checked?0:-1)}},dependencies:[f.h,f.D9,m.X1,m.qT,m.me,m.BC,m.cb,m.j4,m.JD,ye.Q,bt.R],styles:[".order-setup__label[_ngcontent-%COMP%]{width:30%}.order-setup__input[_ngcontent-%COMP%]{width:70%}"]}
1)}}return i})();var yi=s(54338),Bt=s(345);function a(i,p){if(1&i&&(e.j41(0,"span",2),e.nrm(1,"img",10),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("src",t.addon.addonLogo,e.B4B)}}function c(i,p){if(1&i&&e.nrm(0,"ardn-product-addon-additional-info",4),2&i){const t=e.XpG(2);e.Y8G("content",t.addon.additionalInfo)("price",t.addon.price)("currency",t.addon.currency)}}function d(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-return-shipment-address-category",11),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.emitValidation(null==o.addon?null:o.addon.category,r))}),e.k0s()}if(2&i){const t=e.XpG(2);e.Y8G("addon",t.addon)}}function h(i,p){if(1&i&&(e.j41(0,"span",7),e.EFF(1,"i"),e.k0s()),2&i){const t=e.XpG(2);e.Y8G("ardnTooltipster",t.addon.description)}}function O(i,p){if(1&i&&e.nrm(0,"div",9),2&i){const t=e.XpG(2);e.Y8G("innerHTML",t.attributeContent,e.npT)}}function V(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",0)(1,"label")(2,"input",1),e.bIt("change",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.writeAndPropagateValue(r.target))}
1),e.k0s(),e.DNE(3,a,2,1,"span",2),e.j41(4,"span",3),e.EFF(5),e.k0s()(),e.DNE(6,c,1,3,"ardn-product-addon-additional-info",4)(7,d,1,1,"ardn-product-addon-return-shipment-address-category",5),e.j41(8,"div",6),e.DNE(9,h,2,1,"span",7),e.nrm(10,"ardn-product-addon-price",8),e.k0s(),e.DNE(11,O,1,1,"div",9),e.k0s()}if(2&i){const t=e.XpG();e.R7$(2),e.Y8G("checked",t.addon.isRequired||t.addon.checked)("disabled",t.addon.isRequired||(null==t.addon?null:t.addon.disabled)),e.R7$(),e.vxM(null!=t.addon&&t.addon.addonLogo?3:-1),e.R7$(2),e.JRh(t.addon.addonName),e.R7$(),e.vxM(t.addon.additionalInfo?6:-1),e.R7$(),e.vxM("RETURN_SHIPMENT_ADDRESS"===(null==t.addon?null:t.addon.category)?7:-1),e.R7$(2),e.vxM(t.addon.description?9:-1),e.R7$(),e.Y8G("addonPrice",t.addon.price)("addonInPrice",t.addon.inPrice)("currency",t.addon.currency),e.R7$(),e.vxM(null!=t.addon&&t.addon.attributes?11:-1)}}let W=(()=>{class i{set addon(t){this._addon=t,this.attributeContent=this.sanitizer.bypassSecurityTrustHtml(this._addon?.attributes),this.product()&&this.config.customCollectionTypeCarriersToProductAddon.addonsIds.some(n=>n===this._addon.id)&&this.config.customCollectionTypeCarriersToProductAddon.productsIds.some(n=>n===this.product()?.id)&&this.store.select(T.ff).pipe((0,U.p)(n=>!!n)).subscribe(n=>{"ORDERED_COURIER"===n||"PICKUP"===n?(this._addon.checked=!1,this._addon.disabled=!0):this._addon.disabled=!1,this.changeDetection.detectChanges()})}get addon(){return this._addon}constructor(t,n,r,o){this.config=t,this.store=n,this.changeDetection=r,this.sanitizer=o,this.product=(0,e.hFB)(),this.validityChanged=(0,e.CGW)(),this.propagateChange=()=>{}}emitValidation(t,n){this.validityChanged.emit({addonName:t,isValid:n})}writeAndPropagateValue(t){this.propagateChange(t.checked)}registerOnChange(t){this.propagateChange=t}writeValue(){}registerOnTouched(){}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Ae.vQ),e.rXU(v.il),e.rXU(e.gRc),e.rXU(Bt.up))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-checkbox"]],inputs:{product:[1,"product"],addon:"addon"},outputs:{validityChanged:"validityChanged"},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.aNF],decls:1,vars:1,consts:[[1,"checkbox"],["type","checkbox",3,"change","checked","disabled"],[1,"order-addon-icon"],[1,"order-addon-name"],[3,"content","price","currency"],[3,"addon"],[1,"order-setup__info"],[1,"info-icon","tooltip","tooltipstered",3,"ardnTooltipster"],[3,"addonPrice","addonInPrice","currency"],[1,"external-container-addon-attributes",3,"innerHTML"],["alt","","width","20px","ardnLazyLoad","",1,"mr-1",3,"src"],[3,"validityChanged","addon"]],template:function(n,r){1&n&&e.DNE(0,V,12,11,"div",0),2&n&&e.vxM("COURIER_WITH_LABEL"!==r.addon.category?0:-1)},dependencies:[at,dt,ge.d,_i,yi.L],styles:[".order-addon-icon[_ngcontent-%COMP%]{width:35px}"],changeDetection:0})}}return i})();var K=s(38171);function le(i,p){if(1&i){const t=e.RV6();e.j41(0,"div"),e.SS7(1),e.j41(2,"ardn-product-addon-checkbox",7),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(3);return e.Njj(o.emitValidation(r,"checkbox"))}),e.k0s()()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(2),r=n.getAddon(t,"CHECKBOX");e.R7$(2),e.Y8G("formControlName","checked")("product",n.product())("addon",n.getAddon(t,"CHECKBOX"))("ardnDataTestId","ardn-product-addon-category-form-"+t+"-addon-"+(null==r?null:r.id)+"-ardn-product-addon-checkbox")}}function se(i,p){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"ardn-product-addon-radio",8),e.bIt("stateEmitter",function(){e.eBV(t);const r=e.XpG(3);return e.Njj(r.handleRadioAddonCompletion())}),e.k0s()()}if(2&i){let t;const n=e.XpG().$implicit,r=e.XpG(2);e.R7$(),e.Y8G("addons",r.getAddon(n,"RADIO"))("ardnDataTestId","ardn-product-addon-category-form-"+n+"-addon-"+(null==(t=r.product())?null:t.id)+"-ardn-product-addon-radio")}}function Ee(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-category-fields",9),e.bIt("validityChanged",function(r){e.eBV(t),e.XpG();const o=e.r8f(0),u=e.XpG(3);return e.Njj(u.emitValidation({addonName:null==o?null:o.category,isValid:r},"fields"))}),e.k0s(),e.nrm(1,"ardn-field-validator",10)}if(2&i){e.XpG();const t=e.r8f(1),n=e.XpG().$implicit,r=e.XpG(2);e.Y8G("fields",t)("serverValidationErrors",r.optionsServerErrors),e.R7$(),e.Y8G("clientSideValidation",r.addonCategoryForm.get(n).get("fields"))("serverSideValidation",null==r.optionsServerErrors?null:r.optionsServerErrors.fields)}}function Ue(i,p){if(1&i&&(e.j41(0,"div"),e.nrm(1,"input",11)(2,"ardn-field-validator",12),e.k0s()),2&i){e.XpG();const t=e.r8f(0),n=e.XpG().$implicit,r=e.XpG(2);e.R7$(),e.Y8G("ardnDataTestId","ardn-product-addon-category-form-"+n+"-addon-"+(null==t?null:t.id)+"-value-input"),e.BMQ("maxlength",20),e.R7$(),e.Y8G("clientSideValidation",r.addonCategoryForm.get(n).get("addonValue"))("clientErrorMessage","COMMON.ERRORS.REQUIRED")("ardnDataTestId","ardn-product-addon-category-form-"+n+"-addon-"+(null==t?null:t.id)+"-value-field-validator")}}function He(i,p){if(1&i&&(e.SS7(0)(1),e.DNE(2,Ee,2,4)(3,Ue,3,5,"div")),2&i){const t=e.XpG().$implicit,n=e.XpG(2),r=e.bH3(n.getAddon(t,"CHECKBOX"));e.R7$();
1const o=e.bH3(n.getAddonFieldsSchema(null==r?null:r.id));e.R7$(),e.vxM(n.isChecked(t)&&null!=o&&o.length?2:-1),e.R7$(),e.vxM(n.isChecked(t)&&n.addonNeedsValueInput(r)?3:-1)}}function lt(i,p){if(1&i&&(e.j41(0,"div")(1,"span",5),e.DNE(2,le,3,4,"div")(3,se,2,2,"div"),e.k0s()(),e.j41(4,"div",6)(5,"span",5),e.DNE(6,He,4,4),e.k0s()()),2&i){let t,n;const r=p.$implicit,o=e.XpG(2);e.R7$(),e.FS9("formGroupName",r),e.R7$(),e.vxM("CHECKBOX"===(t=o.getAddonType(r))?2:"RADIO"===t?3:-1),e.R7$(3),e.FS9("formGroupName",r),e.R7$(),e.vxM("CHECKBOX"===(n=o.getAddonType(r))?6:-1)}}function _t(i,p){if(1&i&&(e.j41(0,"fieldset",0)(1,"legend",2)(2,"span",3),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"div",4),e.Z7z(6,lt,7,4,null,null,e.fX1),e.k0s()()),2&i){const t=e.XpG();e.Y8G("formGroup",t.addonCategoryForm),e.R7$(3),e.SpI(" ",e.bMT(4,2,"PRODUCT_ADDONS."+t.categoryTitle())," "),e.R7$(3),e.Dyx(t.getCategories())}}function vi(i,p){if(1&i){const t=e.RV6();e.j41(0,"div"),e.SS7(1),e.j41(2,"ardn-product-addon-checkbox",13),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(3);return e.Njj(o.emitValidation(r,"checkbox"))}),e.k0s()()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(2),r=n.getAddon(t,"CHECKBOX");e.R7$(2),e.Y8G("formControlName","checked")("addon",n.getAddon(t,"CHECKBOX"))("ardnDataTestId","ardn-product-addon-category-form-compact-"+t+"-addon-"+(null==r?null:r.id)+"-ardn-product-addon-checkbox")}}function Ei(i,p){if(1&i&&(e.j41(0,"div"),e.nrm(1,"ardn-product-addon-radio",14),e.k0s()),2&i){let t;const n=e.XpG().$implicit,r=e.XpG(2);e.R7$(),e.Y8G("formControlName","selectedAddon")("addons",r.getAddon(n,"RADIO"))("ardnDataTestId","ardn-product-addon-category-form-compact-"+n+"-addon-"+(null==(t=r.product())?null:t.id)+"-ardn-product-addon-radio")}}function Si(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-category-fields",9),e.bIt("validityChanged",function(r){e.eBV(t),e.XpG();const o=e.r8f(0),u=e.XpG(3);return e.Njj(u.emitValidation({addonName:null==o?null:o.category,isValid:r},"fields"))}),e.k0s(),e.nrm(1,"ardn-field-validator",10)}if(2&i){e.XpG();const t=e.r8f(1),n=e.XpG().$implicit,r=e.XpG(2);e.Y8G("fields",t)("serverValidationErrors",r.optionsServerErrors),e.R7$(),e.Y8G("clientSideValidation",r.addonCategoryForm.get(n).get("fields"))("serverSideValidation",null==r.optionsServerErrors?null:r.optionsServerErrors.fields)}}function bi(i,p){if(1&i&&(e.j41(0,"div",15),e.nrm(1,"input",11)(2,"ardn-field-validator",12),e.k0s()),2&i){e.XpG();const t=e.r8f(0),n=e.XpG().$implicit,r=e.XpG(2);e.R7$(),e.Y8G("ardnDataTestId","ardn-product-addon-category-form-compact-"+n+"-addon-"+(null==t?null:t.id)+"-value-input"),e.BMQ("maxlength",20),e.R7$(),e.Y8G("clientSideValidation",r.addonCategoryForm.get(n).get("addonValue"))("clientErrorMessage","COMMON.ERRORS.REQUIRED")("ardnDataTestId","ardn-product-addon-category-form-compact-"+n+"-addon-"+(null==t?null:t.id)+"-value-field-validator")}}function is(i,p){if(1&i&&(e.SS7(0)(1),e.DNE(2,Si,2,4)(3,bi,3,5,"div",15)),2&i){const t=e.XpG().$implicit,n=e.XpG(2),r=e.bH3(n.getAddon(t,"CHECKBOX"));e.R7$();const o=e.bH3(n.getAddonFieldsSchema(null==r?null:r.id));e.R7$(),e.vxM(n.isChecked(t)&&null!=o&&o.length?2:-1),e.R7$(),e.vxM(n.isChecked(t)&&n.addonNeedsValueInput(r)?3:-1)}}function os(i,p){if(1&i&&(e.j41(0,"div")(1,"span",5),e.DNE(2,vi,3,3,"div")(3,Ei,2,3,"div"),e.k0s()(),e.j41(4,"div",6)(5,"span",5),e.DNE(6,is,4,4),e.k0s()()),2&i){let t,n;const r=p.$implicit,o=e.XpG(2);e.R7$(),e.FS9("formGroupName",r),e.R7$(),e.vxM("CHECKBOX"===(t=o.getAddonType(r))?2:"RADIO"===t?3:-1),e.R7$(3),e.FS9("formGroupName",r),e.R7$(),e.vxM("CHECKBOX"===(n=o.getAddonType(r))?6:-1)}}function ss(i,p){if(1&i&&(e.j41(0,"div",1),e.Z7z(1,os,7,4,null,null,e.fX1),e.k0s()),2&i){const t=e.XpG();e.Y8G("formGroup",t.addonCategoryForm),e.R7$(),e.Dyx(t.getCategories())}}let kn=(()=>{class i{static{this.ADDONS_WITH_VALUE_INPUT=["SENT"]}constructor(t,n,r,o){this.formBuilder=t,this.changeDetector=n,this.orderService=r,this.store=o,this.product=(0,e.hFB)(),this.addonsCategory=(0,e.hFB)(),this.categoryTitle=(0,e.hFB)(),this.compact=(0,e.hFB)(),this.stateEmitter=(0,e.CGW)(),this.validityChanged=(0,e.CGW)(),this.insuranceRequiredChanged=(0,e.CGW)(),this.value=[],this.addonsServerValidationErrors=(0,e.hFB
1)([]),this.optionsServerErrors={},this.categoryValid={addonName:"",isValid:!0},this.categoryAdditionalFieldsValid=null,this.destroyRef=(0,e.WQX)(e.abz),this.propagateChange=()=>null}ngOnChanges(t){t?.addonsServerValidationErrors?.currentValue===t?.addonsServerValidationErrors?.previousValue?(this.buildAddonsForm(),this.updateFormValue(Object.values(this.addonCategoryForm.value))):this.optionsServerErrors=this.getServerErrors()}ngOnInit(){this.buildAddonsForm()}ngAfterViewInit(){this.updateFormValue(Object.values(this.addonCategoryForm.value)),this.store?.select(T.Nk)?.pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(t=>{t?.length&&this.setMemorizedCategoryCheckBoxAddons(t)})}handleRadioAddonCompletion(){this.store?.select(T.Nk)?.pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(t=>{t&&setTimeout(()=>{this.setMemorizedCategoryRadioAddons(t)},50)})}updateFormValue(t){const n=this.getSelectedCheckboxAddons(t);let r=this.getSelectedRadioAddons(t);0===r?.length&&(r=this.getFirstRequiredAddons(t)),this.writeAndPropagateValue([].concat(n,r))}getCategories(){return Object.keys(this.addonCategoryForm.controls)}getAddon(t,n){return"RADIO"===n?this.addonCategoryForm.get(t).controls.addons.value:this.addonCategoryForm.get(t).value}getAddonType(t){return t?.split("_")[0]}getAddonFieldsSchema(t){return this.findGroupFieldsByAddonId(t)}emitValidation(t,n){let r="";("checkbox"===n||"radio"===n)&&(this.categoryValid=t,r=this.categoryValid?.addonName),"fields"===n&&(this.categoryAdditionalFieldsValid=t,r=this.categoryAdditionalFieldsValid?.addonName),this.categoryValid&&this.categoryAdditionalFieldsValid?this.validityChanged.emit({addonName:r,isValid:this.categoryValid.isValid&&this.categoryAdditionalFieldsValid.isValid}):this.categoryValid&&!this.categoryAdditionalFieldsValid&&this.validityChanged.emit(t)}isChecked(t){return this.addonCategoryForm?.get(t+".checked")?.value}addonNeedsValueInput(t){return i.ADDONS_WITH_VALUE_INPUT.includes(t?.category)}validate(t){this.fieldsComponent&&this.fieldsComponent?.validate(t)}registerOnChange(t){this.propagateChange=t}writeAndPropagateValue(t){this.writeValue(t),this.propagateChange(t),this.insuranceRequiredChanged.emit(!!t?.some(n=>n?.insuranceRequired)),this.changeDetector.markForCheck()}writeValue(t){this.value=t,this.orderService.isApplyingRestoredAddons&&this.syncCheckboxFormFromValue(t)}syncCheckboxFormFromValue(t){if(!t||!this.addonCategoryForm)return;const n=new Set(t.map(o=>o.id));let r=!1;Object.keys(this.addonCategoryForm.controls).forEach(o=>{const u=this.addonCategoryForm.get(o),g=u?.get("checked");if(!g)return;const A=u.get("id")?.value,w=!!u.get("isRequired")?.value||n.has(A);g.value!==w&&(g.patchValue(w,{emitEvent:!1}),r=!0)}),r&&this.changeDetector.markForCheck(),this.insuranceRequiredChanged.emit(this.hasCheckedInsuranceRequiredAddon())}hasCheckedInsuranceRequiredAddon(){return Object.keys(this.addonCategoryForm.controls).some(t=>{const n=this.addonCategoryForm.get(t);return!!n?.get("checked")?.value&&!!n?.get("insuranceRequired")?.value})}registerOnTouched(){}getServerErrors(){if(!this.addonsServerValidationErrors())return{};const t={},r=this.addonsCategory().addonsGroup.reduce((u,g)=>ht()(g.addons)?[...u,...g.addons]:[...u,g.addons],[]).map(u=>u.id);return this.addonsServerValidationErrors().filter(u=>Ne()(r,u.addonId)).forEach(u=>t[u.fieldName]=u.message),t}setMemorizedCategoryRadioAddons(t){this.store?.select(T.Nk)?.pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(n=>{n&&(t=n)}),t&&"RECEIVER"===this.categoryTitle()&&this.productAddonRadio.addons().forEach(n=>{t.some(r=>r.id===n.id)&&(this.productAddonRadio.radioAddonForm.get("radioControl").patchValue(n),this.value=[n])})}setMemorizedCategoryCheckBoxAddons(t){Object.keys(this.addonCategoryForm.controls).forEach(n=>{const r=this.addonCategoryForm.get(n),o=r?.get("id")?.value,u=t.find(g=>g?.id===o);u&&(r?.get("checked")?.patchValue(!0),null!=u.options?.sentNumber&&r?.get("addonValue")?.patchValue(u.options.sentNumber,{emitEvent:!1}),this.value.includes(r.value)||this.value.push(r.value))}),this.addonCategoryForm.updateValueAndValidity()}getSelectedCheckboxAddons(t){return Object.values(t).filter(n=>n.checked).map(n=>{if(void 0!==n.addonValue){const{addonValue:r,...o}=n;return{...o,options:{...o.options||{},sentNumber:null!==r?r:null}}}return n})}getSelectedRadioAddons(t){return Object.values(t).filter(n=>n.selectedAddon).map(n=>n.selectedAddon)}getFirstRequiredAddons(t){if(t?.length)for(const n in t)if(t[n]?.addons?.length){const r=t[n].addons;if(this.isRequiredAddons(r))return[r[0]]}return[]}isRequiredAddons(t){for(const n in t){if(!t)continue;const r=t[n].id;if(this.addonsCategory()?.addonsGroup?.length)for(const o in this.addonsCategory().addonsGroup){if(!this.addonsCategory().addonsGroup[o])continue;const u=this.addonsCategory().addonsGroup[o];if(u.required)for(const g in u.addons)if(u.addons[g]&&u.addons[g].id===r)return!0}}return!1}buildAddonsForm(){this.addonCategoryForm=this.formBuilder.group({});const t=this.orderService.cachedAddons.value;t?.length&&t.forEach(n=>{this.addonsCategory().addonsGroup.forEach(r=>{const o=r.addons.find(u=>u.id===n.id);o&&(o.checked=!0,n.options&&(o.options={...o.options,...n.options}))})});for(let n=0;n<this.addonsCategory().addonsGroup.length;n++){const r=this.addonsCategory().addonsGroup[n],o=r.type+"_"+n;if("CHECKBOX"===r.type){const u=this.createCheckboxFormGroup(r.addons?.[0]);r?.fields?.length&&(u.addControl("fields",new m.MJ(null)),u.get("checked")?.valueChanges.subscribe(g=>{g||(u.get("fields")?.reset(),this.emitValidation({addonName:r.addons?.[0]?.category,isValid:!0},"fields"))})),this.addonCategoryForm.addControl(o,u)}"RADIO"===r.type&&this.addonCategoryForm.addControl(o,this.createRadioFormGroup(r.addons))}this.addonCategoryForm.valueChanges.subscribe(n=>{this.updateFormValue(n)})}createCheckboxFormGroup(t){const{id:n,category:r,addonName:o,addonLogo:u,price:g,checked:A,isRequired:N,disabled:w,tooltip:te,description:ne,currency:de,inPrice:Fe,attributes:Le,insuranceRequired:it}=t,we=this.formBuilder.group({id:n,addonName:o,addonLogo:u,category:r,price:g,checked:A||N,isRequired:N,disabled:w,tooltip:te,description:ne,currency:de,inPrice:Fe,attributes:Le,insuranceRequired:it});if(this.addonNeedsValueInput(t)){const $e=new m.MJ(null!=t.options?.sentNumber?String(t.options.sentNumber):null);we.addControl("addonValue",$e),(A||N)&&($e.setValidators([m.k0.required]),$e.updateValueAndValidity({emitEvent:!1})),we.get("checked")?.valueChanges.pipe((0,z.pQ)(this.destroyRef)).subscribe(Wt=>{Wt?$e.setValidators([m.k0.required]):($e.clearValidators(),$e.reset(null,{emitEvent:!1})),$e.updateValueAndValidity({emitEvent:!1}),this.validityChanged.emit({addonName:t.category,isValid:$e.valid})}),$e.valueChanges.pipe((0,z.pQ)(this.destroyRef)).subscribe(()=>{this.validityChanged.emit({addonName:t.category,isValid:$e.valid})})}return we}createRadioFormGroup(t){return this.formBuilder.group({selectedAddon:"",add
1ons:[t]})}findGroupFieldsByAddonId(t){for(const n of this.addonsCategory().addonsGroup)if(n.addons.some(r=>r.id===t))return n?.fields??[];return[]}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(m.ok),e.rXU(e.gRc),e.rXU(K.Q),e.rXU(v.il))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-category"]],viewQuery:function(n,r){if(1&n&&(e.GBs(rt,5),e.GBs(We,5)),2&n){let o;e.mGM(o=e.lsd())&&(r.productAddonRadio=o.first),e.mGM(o=e.lsd())&&(r.fieldsComponent=o.first)}},inputs:{product:[1,"product"],addonsCategory:[1,"addonsCategory"],categoryTitle:[1,"categoryTitle"],compact:[1,"compact"],addonsServerValidationErrors:[1,"addonsServerValidationErrors"]},outputs:{stateEmitter:"stateEmitter",validityChanged:"validityChanged",insuranceRequiredChanged:"insuranceRequiredChanged"},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.OA$,e.aNF],decls:2,vars:1,consts:[[1,"order-setup__field",3,"formGroup"],[3,"formGroup"],[1,"order-setup__label"],[1,"label"],[1,"order-setup__input"],[3,"formGroupName"],[1,"field"],[3,"validityChanged","formControlName","product","addon","ardnDataTestId"],["formControlName","selectedAddon",3,"stateEmitter","addons","ardnDataTestId"],["formControlName","fields",3,"validityChanged","fields","serverValidationErrors"],[1,"input-validation",3,"clientSideValidation","serverSideValidation"],["type","text","formControlName","addonValue",1,"input",3,"ardnDataTestId"],[3,"clientSideValidation","clientErrorMessage","ardnDataTestId"],[3,"validityChanged","formControlName","addon","ardnDataTestId"],[3,"formControlName","addons","ardnDataTestId"],[1,"number-input"]],template:function(n,r){1&n&&e.DNE(0,_t,8,4,"fieldset",0)(1,ss,3,1,"div",1),2&n&&e.vxM(r.compact()?1:0)},dependencies:[f.h,f.D9,m.X1,m.me,m.BC,m.cb,m.j4,m.JD,m.$R,W,Z.Z,rt,We,ye.Q],styles:[".order-setup__field[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{margin-bottom:1.2rem;display:grid}.order-setup__field[_ngcontent-%COMP%]   div.field[_ngcontent-%COMP%]{display:block}.order-setup__field[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]:last-child{margin-bottom:0}"],changeDetection:0})}}return i})();var as=s(84418),Pi=s.n(as),Vn=s(48453);let no=(()=>{class i{getAddonsRangeValue(t,n){return n.reduce((r,o)=>{const u="max"===t?o.maxValue:o.minValue;return"max"===t?Math.max(r,u):Math.min(r,u)},"max"===t?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Xt=s(98480);const ds=i=>({currency:i}),ls=i=>({field:i}),cs=(i,p,t)=>({min:i,max:p,currency:t});function us(i,p){if(1&i&&(e.j41(0,"div",9)(1,"span",15),e.EFF(2,"i"),e.k0s()()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ardnTooltipster",t.getTooltipForInsuranceCheckbox(null==t.defaultCashOnDelivery?null:t.defaultCashOnDelivery.number))}}function ps(i,p){if(1&i&&(e.j41(0,"div",9)(1,"span",15),e.EFF(2,"i"),e.k0s()()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ardnTooltipster",t.getTooltipForFreightForwardCheckbox(t.isFreightForward))}}function hs(i,p){if(1&i&&e.nrm(0,"ardn-product-addon-category",16),2&i){const t=p.$implicit;e.Y8G("formControlName",null==t?null:t.categoryName)("categoryTitle",null==t?null:t.categoryName)("addonsCategory",t)}}function ms(i,p){if(1&i&&e.Z7z(0,hs,1,3,"ardn-product-addon-category",16,e.fX1),2&i){const t=e.XpG(2);e.Dyx(t.availableAdditionalAddons)}}function gs(i,p){if(1&i&&(e.j41(0,"div",14),e.DNE(1,ms,2,0),e.k0s()),2&i){const t=e.XpG();e.Y8G("formGroupName","additionalAddons"),e.R7$(),e.vxM(null!=t.availableAdditionalAddons&&t.availableAdditionalAddons.length?1:-1)}}function fs(i,p){if(1&i&&e.nrm(0,"ardn-product-addon-additional-info",21),2&i){const t=e.XpG().$implicit;e.Y8G("content",t.additionalInfo)("price",t.price)("currency",t.currency)("ardnDataTestId","ardn-product-addon-insurance-category-form-selectedAddonCheckbox-"+(null==t?null:t.id)+"-ardn-product-addon-additional-info")}}function Cs(i,p){if(1&i&&(e.j41(0,"span",15),e.nI1(1,"translate"),e.EFF(2,"i"),e.k0s()),2&i){const t=e.XpG().$implicit;e.Y8G("ardnTooltipster",e.bMT(1,1,"TOOLTIP."+t.tooltip))}}function _s(i,p){if(1&i&&(e.j41(0,"span",15),e.EFF(1,"i"),e.k0s()),2&i){const t=e.XpG().$implicit;e.Y8G("ardnTooltipster",t.description)}}function Os(i,p){if(1&i&&(e.j41(0,"div",24),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.JRh(t.priceDescription)}}function ys(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",17)(1,"label",19)(2,"input",20),e.bIt("click",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onClickSelectedAddonCheckbox(r))}),e.k0s(),e.j41(3,"span"),e.EFF(4),e.k0s()(),e.DNE(5,fs,1,4,"ardn-product-addon-additional-info",21),e.j41(6,"div",22),e.DNE(7,Cs,3,3,"span",15)(8,_s,2,1,"span",15),e.nrm(9,"ardn-product-addon-price",23),e.k0s(),e.DNE(10,Os,2,1,"div",24),e.k0s()}if(2&i){const t=p.$implicit;e.R7$(),e.Y8G("ardnDataTestId","ardn-product-addon-insurance-category-form-selectedAddonCheckbox-"+(null==t?null:t.id)+"-label"),e.R7$(),e.Y8G("value",null==t?null:t.id)("ardnDataTestId","ardn-product-addon-insurance-category-form-selectedAddonCheckbox-"+(null==t?null:t.id)+"-input"),e.R7$(2),e.JRh(t.addonName),e.R7$(),e.vxM(t.additionalInfo?5:-1),e.R7$(2),e.vxM(t.tooltip?7:-1),e.R7$(),e.vxM(t.description?8:-1),e.R7$(),e.Y8G("addonPrice",t.price)("addonInPrice",t.inPrice)("currency",t.currency)("ardnDataTestId","ardn-product-addon-insurance-category-form-selectedAddonCheckbox-"+(null==t?null:t.id)+"-ardn-product-addon-price"),e.R7$(),e.vxM(t.priceDescription?10:-1)}}function vs(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-category-fields",25),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.additionalFieldsValidityChanged(r,"fields"))}),e.k0s()}if(2&i){let t;const n=e.XpG(2);e.Y8G("fields",null==(t=n.addonsCategory())?null:t.fields)("serverValidationErrors",n.optionsServerErrors)}}function Es(i,p){if(1&i&&(e.j41(0,"div",2),e.nrm(1,"div",3),e.j41(2,"div",10),e.Z7z(3,ys,11,12,"div",17,e.fX1),e.k0s()(),e.DNE(5,vs,1,2,"ardn-product-addon-category-fields",18)),2&i){let t;const n=e.XpG();e.R7$(3),e.Dyx(n.availableAddons),e.R7$(2),e.vxM(null!=(t=n.addonsCategory())&&null!=t.fields&&t.fields.length&&n.isSelectedCheckboxInsurance?5:-1)}}function Ss(i,p){if(1&i&&(e.j41(0,"div",2),e.nrm(1,"div",3),e.j41(2,"div",10)(3,"p",26),e.EFF(4),e.k0s()()()),2&i){const t=e.XpG();e.R7$(4),e.SpI(" ",t.getGeneralServerError()," ")}}function bs(i,p){1&i&&(e.j41(0,"div",2),e.nrm(1,"div",3),e.j41(2,"div",10)(3,"p",26),e.EFF(4),e.nI1(5,"translate"),e.k0s()()()),2&i&&(e.R7$(4),e.JRh(e.bMT(5,1,"COMMON.ERRORS.OPTION_REQUIRED")))}let Ai=(()=>
1{class i{set defaultCashOnDelivery(t){if(t!==this._defaultCashOnDelivery){if(this._defaultCashOnDelivery=t,!t?.isInsuranceRequired)return void this.releaseMandatoryInsuranceIfNotRequired();if(t?.number){this.isInsuranceCheckboxDisabled=!0,this.isCarrierInsuranceSet=!0,this.insuranceCategoryForm?.get("selectedAddonCheckbox")?.disable();const n=this.insuranceCategoryForm?.get("insuranceValue")?.value;n&&this.insuranceCategoryForm.get("insuranceValue").patchValue(n)}t?.number&&Number(t?.number)>0&&!this.userChangeInsuranceValue?(this.isInsuranceCheckboxDisabled=!0,this.insuranceCategoryForm?(this.isCarrierInsuranceSet=!0,this.insuranceCategoryForm.get("selectedAddonCheckbox").disable()):this.buildAddonsForm(),this.applyInsuranceValueValidators(),this.insuranceCategoryForm.get("insuranceValue").patchValue(t.number),this.isSelectedCheckboxInsurance=!0):null===t.number&&(!this.isRequiredAddons()&&!this.insuranceRequiredByAddon()||this.userChangeInsuranceValue?this.isInsuranceCheckboxDisabled=this.isRequiredAddons()||this.insuranceRequiredByAddon():this.setDefaultValueToInsuranceValue())}}get defaultCashOnDelivery(){return this._defaultCashOnDelivery}set isFreightForward(t){const n=this._isFreightForward;this._isFreightForward=t,this._isFreightForward?(this.insuranceCategoryForm||this.buildAddonsForm(),this.markInsuranceAsMandatory(),this.insuranceCategoryForm.get("selectedAddonCheckbox")?.disable(),this.insuranceCategoryForm.get("insuranceValue").updateValueAndValidity()):n&&this.releaseMandatoryInsuranceIfNotRequired()}get isFreightForward(){return this._isFreightForward}constructor(t,n,r,o,u,g,A,N){this.store=t,this.formBuilder=n,this.translateService=r,this.scrollService=o,this.currencyService=u,this.addonsService=g,this.currencyPrecisionService=A,this.changeDetector=N,this.validityChanged=(0,e.CGW)(),this.inputValueChanged=(0,e.CGW)(),this.fieldsChanged=(0,e.CGW)(),this.addonsCategory=(0,e.hFB)(),this.addonsAdditionalCategories=(0,e.hFB)(),this.addonsServerValidationErrors=(0,e.hFB)([]),this.insuranceRequiredByAddon=(0,e.hFB)(!1),this.optionsServerErrors={},this.selectedFromDraft=!1,this.availableAddons=[],this.selectedAddons=[],this.availableAdditionalAddons=[],this.minInsuranceValue=0,this.maxInsuranceValue=Number.MAX_SAFE_INTEGER,this.isInsuranceCheckboxDisabled=!1,this.isSelectedCheckboxInsurance=!1,this.isCarrierInsuranceSet=!1,this.isPremiumInsuranceSet=!1,this.isInsuranceValueValid=!1,this._defaultCashOnDelivery=null,this._isFreightForward=!1,this.dataFromDraft=!1,this.userChangeInsuranceValue=!1,this.insuranceValueValid=!1,this.categoryFieldsValid=!1,this.destroyRef=(0,e.WQX)(e.abz),this.propagateChange=()=>{},this.orderCurrency=(0,z.ot)(this.store.select(T.ig),{initialValue:null}),(0,e.QZP)(()=>{this.currencyPrecisionService.currencies(),this.changeDetector.markForCheck()}),(0,e.QZP)(()=>{const w=this.insuranceRequiredByAddon();this.insuranceCategoryForm&&(w?this.userChangeInsuranceValue?this.enforceMandatoryInsuranceForCurrentValue():this.setDefaultValueToInsuranceValue():this.releaseMandatoryInsuranceIfNotRequired(),this.changeDetector.markForCheck())},{allowSignalWrites:!0})}get insuranceValuePrecision(){return this.currencyPrecisionService.getPrecision(this.orderCurrency())}ngOnChanges(){this.isSelectedCheckboxInsurance?(this.optionsServerErrors=this.getServerErrors(),this.optionsServerErrors["[value]"]&&this.insuranceCategoryForm.get("insuranceValue").touched&&this.scrollService.scrollToFieldId("insuranceValue")):(this.optionsServerErrors={},this.insuranceCategoryForm&&(this.insuranceCategoryForm.get("insuranceValue").setValue(""),this.insuranceCategoryForm.get("insuranceValue").setValidators([]),this.insuranceCategoryForm.get("insuranceValue").updateValueAndValidity(),this.insuranceCategoryForm?.get("fields")?.reset(),this.additionalFieldsValidityChanged(!0,"fields")))}ngOnInit(){const t=this.getAddonsFromAddonsCategory(),n=this.getAdditionalAddonsFromCategory();this.isCarrierInsuranceSet=t?.length>0&&!n?.length||this.isFreightForward,this.isPremiumInsuranceSet=!t?.length&&n?.length>0,this.isCarrierInsuranceSet?(this.addonsCurrencyValue=this.getAddonsValueCurrency(),this.minInsuranceValue=this.addonsService.getAddonsRangeValue("min",t),this.maxInsuranceValue=this.addonsService.getAddonsRangeValue("max",t)):this.isPremiumInsuranceSet?(this.addonsCurrencyValue=this.getAdditionalAddonsValueCurrency(),this.minInsuranceValue=this.addonsService.getAddonsRangeValue("min",
1n),this.maxInsuranceValue=this.addonsService.getAddonsRangeValue("max",n)):(this.addonsCurrencyValue=this.getAddonsValueCurrency(),this.minInsuranceValue=Math.min(this.addonsService.getAddonsRangeValue("min",t),this.addonsService.getAddonsRangeValue("min",n)),this.maxInsuranceValue=Math.max(this.addonsService.getAddonsRangeValue("max",t),this.addonsService.getAddonsRangeValue("max",n))),this.availableAddons=[],this.selectedAddons=[],this.availableAdditionalAddons=[],this.buildAddonsForm(),this.defaultCashOnDelivery?.number?this.isSelectedCheckboxInsurance=!0:this.dataFromDraft||(this.isRequiredAddons()||this.insuranceRequiredByAddon())&&this.setDefaultValueToInsuranceValue(),this._isFreightForward&&(this.applyInsuranceValueValidators(),this.insuranceCategoryForm.get("insuranceValue").updateValueAndValidity(),this.insuranceCategoryForm.get("selectedAddonCheckbox")?.disable()),this.insuranceCategoryForm.get("insuranceValue").valueChanges.pipe((0,ce.B)(300),(0,z.pQ)(this.destroyRef)).subscribe(r=>{this.isInsuranceValueValid=this.insuranceCategoryForm.get("insuranceValue").valid;const o=r?Number(r):null;if(this.additionalFieldsValidityChanged(this.isInsuranceValueValid,"insuranceValue"),this.insuranceCategoryForm?.get("fields")||this.additionalFieldsValidityChanged(!0,"fields"),this.isInsuranceValueValid&&Number(o)){this.inputValueChanged.emit(o);const g=this.getAddons(o,!1);if(this.availableAddons=g,this.availableAdditionalAddons=this.getAdditionalAddons(o),this.handleAvailableAddonState(g,this.availableAdditionalAddons),o>9){if(g&&g.length&&(this.isCarrierInsuranceSet?(this.selectedAddons=this.availableAddons,this.insuranceCategoryForm.get("selectedAddonCheckbox").setValue(g[0].id)):this.insuranceCategoryForm.get("selectedAddonCheckbox").setValue(null),g[0].fields=this.insuranceCategoryForm?.get("fields")?.value,this.availableAddons=g),this.availableAdditionalAddons.length){const A=this.insuranceCategoryForm.get("additionalAddons")?.value;this.propagateChange(this.mapAdditionalAddons(A))}else this.propagateChange(this.mapAdditionalAddons(null));this.validityChanged.emit(this.isPremiumInsuranceSet||this.isCarrierInsuranceSet)}else{if(!(o<10))return this.propagateChange([]),void this.validityChanged.emit(this.isPremiumInsuranceSet||this.isCarrierInsuranceSet);if(g&&g.length&&(this.isCarrierInsuranceSet?(this.selectedAddons=this.availableAddons,this.insuranceCategoryForm.get("selectedAddonCheckbox").setValue(g[0].id)):this.insuranceCategoryForm.get("selectedAddonCheckbox").setValue(null),g[0].fields=this.insuranceCategoryForm?.get("fields")?.value,this.availableAddons=g),this.availableAdditionalAddons.length){const A=this.insuranceCategoryForm.get("additionalAddons")?.value;this.propagateChange(this.mapAdditionalAddons(A))}else this.propagateChange(this.mapAdditionalAddons(null));this.validityChanged.emit(this.isPremiumInsuranceSet||this.isCarrierInsuranceSet)}}else this.resetAddons()}),this.insuranceCategoryForm.get("insuranceValue").valueChanges.pipe((0,ce.B)(2e3),(0,z.pQ)(this.destroyRef)).subscribe(r=>{this.isInsuranceValueValid=this.insuranceCategoryForm.get("insuranceValue").valid;const o=r?Number(r):null;if(this.additionalFieldsValidityChanged(this.isInsuranceValueValid,"insuranceValue"),this.insuranceCategoryForm?.get("fields")||this.additionalFieldsValidityChanged(!0,"fields"),this.isInsuranceValueValid&&Number(o)){if(o<10){const g=this.getAddons(o);if(this.availableAddons=g,this.availableAdditionalAddons=this.getAdditionalAddons(o),this.handleAvailableAddonState(g,this.availableAdditionalAddons),g&&g.length&&(this.isCarrierInsuranceSet?(this.selectedAddons=this.availableAddons,this.insuranceCategoryForm.get("selectedAddonCheckbox").setValue(g[0].id)):this.insuranceCategoryForm.get("selectedAddonCheckbox").setValue(null),g[0].fields=this.insuranceCategoryForm?.get("fields")?.value,this.availableAddons=g),this.availableAdditionalAddons.length){const A=this.insuranceCategoryForm.get("additionalAddons")?.value;this.propagateChange(this.mapAdditionalAddons(A))}else this.propagateChange(this.mapAdditionalAddons(null))}this.addonToCheck&&(this.insuranceCategoryForm.get("selectedAddonCheckbox").setValue(this.addonToCheck),this.addonToCheck=null),this.validityChanged.emit(this.isPremiumInsuranceSet||this.isCarrierInsuranceSet)}else this.resetAddons()}),this.insuranceCategoryForm?.get("fields")?.valueChanges.pipe((0,ce.B)(50),(0,j.F)(E()),(0,z.pQ)(this.destroyRef)).subscribe(r=>{const o=this.availableAddons,u=this.insuranceCategoryForm.get("additionalAddons")?.value;
1o?.length&&(o[0].fields=r,this.availableAddons=o,this.propagateChange(this.mapAdditionalAddons(u)))}),this.insuranceCategoryForm?.get("additionalAddons")?.valueChanges.pipe((0,z.pQ)(this.destroyRef)).subscribe(r=>{const o=r?[].concat(...Object.values(r)):[];this.isPremiumInsuranceSet=o?.some(u=>!0===u?.checked),this.isSingleInsuranceUnchecked()?this.resetInsurance(!1):(this.propagateChange(this.mapAdditionalAddons(r)),this.validityChanged.emit(this.isPremiumInsuranceSet||this.isCarrierInsuranceSet))}),(0,q.z)([this.store.select(T.PE),this.store.select(mt.pO??null)]).pipe((0,j.F)(E()),(0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(([r,o])=>{let u=null;if(o&&(u=o.filter(g=>g.draft.orderDraftId===r.orderDraftId)[0]),u?.draft?.addons&&u){const A=this.addonsCategory().addonsGroup.map(w=>w.addons).reduce((w,te)=>w.concat(te)).filter(w=>u.draft.addons.map(te=>te.id).includes(w.id)),N=u.draft.addons.filter(w=>A.map(te=>te.id).includes(w.id))[0];A?.length&&N?.value&&(this.dataFromDraft=!0,this.setAddonsFromDraft(N.value))}})}ngAfterViewInit(){this.store.select(T.Nk).pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(t=>{const n=t.filter(r=>"INSURANCE"===r.category)[0];n&&this.setMemorizedInsurance(n)})}onClickCheckboxInsurance(t){this.resetInsurance(t.target.checked)}onClickSelectedAddonCheckbox(t){this.isCarrierInsuranceSet=t.target.checked;const n=this.insuranceCategoryForm.get("additionalAddons")?.value,r=n?[].concat(...Object.values(n)):[];this.isPremiumInsuranceSet=r?.some(o=>!0===o?.checked),this.isSingleInsuranceUnchecked()?this.resetInsurance(!1):(this.selectedAddons=this.isCarrierInsuranceSet?this.availableAddons:[],this.propagateChange(this.mapAdditionalAddons(n)),this.validityChanged.emit(this.isPremiumInsuranceSet||this.isCarrierInsuranceSet))}isSingleInsuranceUnchecked(){const t=!this.isCarrierInsuranceSet&&this.getAddonsFromAddonsCategory()?.length>0&&!this.getAdditionalAddonsFromCategory()?.length,n=!this.isPremiumInsuranceSet&&!this.getAddonsFromAddonsCategory()?.length&&this.getAdditionalAddonsFromCategory()?.length>0;return t||n}resetInsurance(t){this.isSelectedCheckboxInsurance=t,this.availableAddons=[],this.selectedAddons=[],this.availableAdditionalAddons=[],this.isInsuranceValueValid=!1;const n=this.insuranceCategoryForm?.get("fields");this.isSelectedCheckboxInsurance?(n||this.additionalFieldsValidityChanged(!0,"fields"),this.applyInsuranceValueValidators()):(this.isCarrierInsuranceSet=this.addonsExists()&&!this.additionalAddonsExists()||this.isFreightForward,this.isPremiumInsuranceSet=!this.addonsExists()&&this.additionalAddonsExists(),this.insuranceCategoryForm.get("insuranceValue").setValue(""),this.insuranceCategoryForm.get("insuranceValue").setValidators([]),this.insuranceCategoryForm.get("insuranceValue").updateValueAndValidity(),this.propagateChange([]),this.userChangeInsuranceValue=!1,this.insuranceCategoryForm?.get("fields")?.reset(),this.additionalFieldsValidityChanged(!0,"fields"))}onClickInsuranceValue(){this.isSelectedCheckboxInsurance||(this.isSelectedCheckboxInsurance=!0,this.applyInsuranceValueValidators(),this.insuranceCategoryForm.get("insuranceValue").updateValueAndValidity())}onChangeInsuranceValue(){this.userChangeInsuranceValue=!0}getAddons(t=0,n=!1){if(this.addonsExists()){const r=this.getAddonsFromAddonsCategory();for(const o in r)if(t>=r[o].minValue&&t<=r[o].maxValue){const u={...r[o]};return n||(u.options.value=t),this.isCarrierInsuranceSet&&(u.checked=!0),[u]}return[]}return[]}getAdditionalAddons(t=0){if(this.addonsAdditionalCategories()&&this.addonsAdditionalCategories()[0]?.addonsGroup?.length>0){const n=Pi()(this.addonsAdditionalCategories()),r=this.getAdditionalAddonsFromCategory();for(const o in r)if(t>=r[o].minValue&&t<=r[o].maxValue){const u={...r[o]};return this.isPremiumInsuranceSet&&(u.checked=!0),n[0].addonsGroup=[{type:"CHECKBOX",addons:[u]}],n}return[]}return[]}getPlaceholder(t){return t?this.translateService.instant("PRODUCT_ADDONS.OPTIONS.INSURANCE_PLACEHOLDER_MAX",{max:this.maxInsuranceValue,currency:this.addonsCurrencyValue}):""}addonsExists(){return this.addonsCategory()?.addonsGroup?.length>0}additionalAddonsExists(){return this.getAdditionalAddonsFromCategory()?.length>0}getTooltipForInsuranceCheckbox(t){const n=this.defaultCashOnDelivery?.productAddonCurrency;return n&&n!==this.currencyService?.defaultFallbackCurrencyKey&&n!==this.addonsCurrencyValue?this.translateService.instant("TOOLTIP.INSURE_CURRENCY"):t?this.translateService.instant("TOOLTIP.INSURANCE_AMOUNT_MUST_EQUAL_OR_GREATER"):this.isRequiredAddons()||this.insuranceRequiredByAddon()?this.translateService.instant("TOOLTIP.OPTION_IS_NOT_AVAILABLE_FOR_COURIER"):null}getTooltipForFreightForwardCheckbox(t){return t?this.translateService.instant("TOOLTIP.INSURANCE_AND_TRANSPORT_PAID_BY_RECEIVER_SELECTED"):null}getAddonsFromAddonsCategory(){if(this.addonsExists()&&this.addonsCategory()?.addonsGroup[0]?.addons){if(this.addonsCategory().addonsGroup.length>1){const t=this.addonsCategory().addonsGroup,n=[];for(const r in t)t[r]&&t[r].addons&&(n[r]=t[r].addons[0]);return this.sortAddons(n)}return this.sortAddons(this.addonsCategory().addonsGroup[0].addons)}return null}getAdditionalAddonsFromCategory(){if(this.addonsAdditionalCategories()&&this.addonsAdditionalCategories()[0]?.addonsGroup?.length&&this.addonsAdditionalCategories()[0]?.addonsGroup[0]?.addons){if(this.addonsAdditionalCategories()[0].addonsGroup.length>1){const t=Pi()(this.addonsAdditionalCategories()[0].addonsGroup),n=[];for(const r in t)t[r]&&t[r].addons&&(n[r]=t[r].addons[0]);return this.sortAddons(n)}return this.sortAddons(this.addonsAdditionalCategories()[0].addonsGroup[0].addons)}return null}sortAddons(t){return t.sort((n,r)=>Number(n.maxValue)<Number(r.maxValue)?-1:Number(n.maxValue)>Number(r.maxValue)?1:0)}isRequiredAddons(){return this.addonsExists()&&!!this.addonsCategory().addonsGroup[0].required}handleAvailableAddonState(t,n){const r=t?.length,o=n?.length;r&&!o&&this.isPremiumInsuranceSet&&(this.isPremiumInsuranceSet=!1),!r&&o&&this.isCarrierInsuranceSet&&(this.isCarrierInsuranceSet=!1)}getDefaultAddons(){const t=this.getAddons(1,!0);return t&&t.length?{...t[0]}:null}getMaxFreeInsuranceAddons(){const t=this.getAddons(1,!0);let n=null;for(const r in t)if(t[r]){const o=t[r];(null===n&&0===o.price||0===o.price&&o.maxValue>n.maxValue)&&(n=o,n.options.value=n.maxValue)}return n}getGeneralServerError(){return this.addonsServerValidationErrors()&&"string"==typeof this.addonsServerValidationErrors()?this.addonsServerValidationErrors():null}
1registerOnChange(t){this.propagateChange=t}writeValue(t){t?.length&&(this.isSelectedCheckboxInsurance=!0,t.forEach(n=>{switch(n.category){case"INSURANCE":this.insuranceCategoryForm.patchValue({insuranceValue:n.options.value,fields:n.fields}),this.addonToCheck=n.id,this.isCarrierInsuranceSet=!0;break;case"INSURANCE_CARGO":this.insuranceCategoryForm.get("insuranceValue").value!==n.value&&(this.insuranceCategoryForm.get("insuranceValue").setValue(n.value),this.isPremiumInsuranceSet=!0)}}))}registerOnTouched(){}checkCorrectionsData(){if(!this.isSelectedCheckboxInsurance)return;this.applyInsuranceValueValidators();const t=this.insuranceCategoryForm.get("insuranceValue");return t.updateValueAndValidity(),t.valid?void 0:(t.markAsTouched(),!1)}validate(t){const n=[];return Object.keys(this.insuranceCategoryForm.controls).forEach(r=>{const o=this.insuranceCategoryForm.get(r);n.push(r),o.markAsTouched({onlySelf:!0})}),this.fieldsComponent?.validate(),!0!==t&&(this.scrollService.findInvalidFieldAndScroll(n,this.insuranceCategoryForm),!0)}additionalFieldsValidityChanged(t,n){"insuranceValue"===n&&(this.insuranceValueValid=t),"fields"===n&&(this.categoryFieldsValid=t),this.validityChanged.emit(this.insuranceValueValid&&this.categoryFieldsValid)}handleValidInsuranceValue(t){const n=this.getAddons(t);this.selectedAddons=n,n?.length&&(this.insuranceCategoryForm.get("selectedAddonCheckbox")?.setValue(n[0].id),n[0].fields=this.insuranceCategoryForm.get("fields")?.value),this.propagateChange(n)}patchInsuranceValue(t){const n=this.insuranceCategoryForm.get("insuranceValue");n?.patchValue(t),n?.updateValueAndValidity()}applyInsuranceValueValidators(){this.insuranceCategoryForm.get("insuranceValue").setValidators([m.k0.compose([m.k0.required,m.k0.min(this.minInsuranceValue),m.k0.max(this.maxInsuranceValue)])])}resetAddons(){this.availableAddons=[],this.selectedAddons=[],this.availableAdditionalAddons=[],this.isInsuranceValueValid=!1,this.propagateChange([])}setAddonsFromDraft(t){if(t&&Number(t))return void this.resetAddons();this.isSelectedCheckboxInsurance=!0,this.applyInsuranceValueValidators(),this.userChangeInsuranceValue=!0,t&&this.defaultCashOnDelivery?.number&&(this.isInsuranceCheckboxDisabled=!0),this.patchInsuranceValue(Number(t));const n=this.insuranceCategoryForm.get("insuranceValue").valid;this.additionalFieldsValidityChanged(n,"insuranceValue"),n?this.handleValidInsuranceValue(Number(t)):this.resetAddons()}getAddonsValueCurrency(){const t=this.getAddonsFromAddonsCategory();return t?.length?t[0]?.valueCurrency:null}getAdditionalAddonsValueCurrency(){const t=this.getAdditionalAddonsFromCategory();return t?.length?t[0]?.valueCurrency:null}setDefaultValueToInsuranceValue(){this.markInsuranceAsMandatory();const t=this.getDefaultAddons();this.patchInsuranceValue(Number(t?t.maxValue:null)),this.selectMandatoryInsuranceAddon(t?.maxValue)}enforceMandatoryInsuranceForCurrentValue(){this.markInsuranceAsMandatory(),this.selectMandatoryInsuranceAddon(Number(this.insuranceCategoryForm.get("insuranceValue")?.value))}releaseMandatoryInsuranceIfNotRequired(){this.isRequiredAddons()||this.insuranceRequiredByAddon()||this._isFreightForward||this._defaultCashOnDelivery?.isInsuranceRequired||(this.isInsuranceCheckboxDisabled=!1,this.insuranceCategoryForm?.get("selectedAddonCheckbox")?.enable())}markInsuranceAsMandatory(){this.isInsuranceCheckboxDisabled=!0,this.isSelectedCheckboxInsurance=!0,this.isCarrierInsuranceSet=!0,this.applyInsuranceValueValidators()}selectMandatoryInsuranceAddon(t){if(!t)return;const n=this.getAddons(t);this.availableAddons=n,this.selectedAddons=n,n?.length&&(this.insuranceCategoryForm.get("selectedAddonCheckbox").setValue(n[0].id),this.insuranceCategoryForm.get("selectedAddonCheckbox").disable(),n[0].fields=this.insuranceCategoryForm?.get("fields")?.value),setTimeout(()=>{this.propagateChange(n)})}buildAddonsForm(){this.insuranceCategoryForm=this.formBuilder.group({}),this.insuranceCategoryForm.addControl("selectedAddonCheckbox",new m.MJ),this.insuranceCategoryForm.addControl("insuranceValue",new m.MJ("",[m.k0.min(this.minInsuranceValue),m.k0.max(this.maxInsuranceValue)])),this.addonsCategory()?.fields?.length&&this.insuranceCategoryForm.addControl("fields",new m.MJ(null)),this.addonsAdditionalCategories()?.length&&this.setAddons()}getServerErrors(){if(!this.addonsServerValidationErrors())return{};const t={},n=this.addonsCategory().addonsGroup.reduce((N,w)=>ht()(w.addons)?[...N,...w.addons]:[...N,w.addons],[]),o=this.getAdditionalAddonsFromCategory()?.map(N=>N.id)??[],u=n?.map(N=>N.id)??[],g=o.concat(u);return this.addonsServerValidationErrors().filter(N=>
1Ne()(g,N.addonId)).forEach(N=>t[N.fieldName]=N.message),t}setMemorizedInsurance(t){this.isSelectedCheckboxInsurance=!0,this.insuranceCategoryForm.get("selectedAddonCheckbox").patchValue(t.id),this.patchInsuranceValue(Number(t.options.value))}setAddons(){const t={},n=this.addonsAdditionalCategories().map(r=>r.categoryName);for(const r of n)t[r]=new m.MJ([]);this.insuranceCategoryForm.setControl("additionalAddons",this.formBuilder.group(t))}mapAdditionalAddons(t){const n=t?[].concat(...Object.values(t)):[];return n?.map(r=>{r.value=this.insuranceCategoryForm.get("insuranceValue")?.value}),[...new Set([...this.selectedAddons,...n])]}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(v.il),e.rXU(m.ok),e.rXU(f.c$),e.rXU(nt.b),e.rXU(Vn.P),e.rXU(no),e.rXU(Xt.x),e.rXU(e.gRc))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-insurance-category"]],viewQuery:function(n,r){if(1&n&&e.GBs(We,5),2&n){let o;e.mGM(o=e.lsd())&&(r.fieldsComponent=o.first)}},inputs:{addonsCategory:[1,"addonsCategory"],addonsAdditionalCategories:[1,"addonsAdditionalCategories"],addonsServerValidationErrors:[1,"addonsServerValidationErrors"],insuranceRequiredByAddon:[1,"insuranceRequiredByAddon"],defaultCashOnDelivery:"defaultCashOnDelivery",isFreightForward:"isFreightForward"},outputs:{validityChanged:"validityChanged",inputValueChanged:"inputValueChanged",fieldsChanged:"fieldsChanged"},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.OA$,e.aNF],decls:26,vars:39,consts:[[3,"formGroup"],[1,"order-setup__field","addon-insurance"],[1,"field"],[1,"order-setup__label"],[1,"label","order-setup--c-inherit"],[1,"order-setup__input","order-setup--inline-flex",3,"ngClass"],[1,"checkbox","addon-insurance__checkbox"],["for","checkbox-insurance",3,"ardnDataTestId"],["id","checkbox-insurance","type","checkbox",3,"click","checked","ardnDataTestId"],[1,"order-setup--ml-auto"],[1,"order-setup__input"],[1,"number-input-options"],["id","insuranceValue","formControlName","insuranceValue","idName","insurance-value",3,"click","change","maxFractionDigits","placeholder","showArrow","min","alwaysPropagateChange","setMinValue","ardnDataTestId"],[1,"input-validation",3,"clientSideValidation","clientErrorMessage","clientTranslationParams","serverSideValidation","ardnDataTestId"],[1,"additional-addons",3,"formGroupName"],[1,"info-icon","tooltip","tooltipstered",3,"ardnTooltipster"],[1,"addon-category",3,"formControlName","categoryTitle","addonsCategory"],[1,"checkbox"],["formControlName","fields",3,"fields","serverValidationErrors"],["for","selectedAddonCheckbox",3,"ardnDataTestId"],["id","selectedAddonCheckbox","type","checkbox","formControlName","selectedAddonCheckbox",3,"click","value","ardnDataTestId"],[3,"content","price","currency","ardnDataTestId"],[1,"order-setup__info","radio--padding"],[3,"addonPrice","addonInPrice","currency","ardnDataTestId"],[1,"order-setup__description","color-progress"],["formControlName","fields",3,"validityChanged","fields","serverValidationErrors"],[1,"form-error"]],template:function(n,r){1&n&&(e.j41(0,"div",0)(1,"fieldset",1)(2,"div",2)(3,"legend",3)(4,"span",4),e.EFF(5),e.nI1(6,"translate"),e.k0s()(),e.j41(7,"div",5)(8,"div",6)(9,"label",7)(10,"input",8),e.bIt("click",function(u){return r.onClickCheckboxInsurance(u)}),e.k0s(),e.j41(11,"span"),e.EFF(12),e.nI1(13,"translate"),e.k0s()()(),e.DNE(14,us,3,1,"div",9)(15,ps,3,1,"div",9),e.k0s()(),e.j41(16,"div",2),e.nrm(17,"div",3),e.j41(18,"div",10)(19,"div",11)(20,"ardn-number-input",12),e.bIt("click",function(){return r.onClickInsuranceValue()})("change",function(){return r.onChangeInsuranceValue()}),e.k0s()(),e.nrm(21,"ardn-field-validator",13),e.k0s()(),e.DNE(22,gs,2,2,"div",14)(23,Es,6,1)(24,Ss,5,1,"div",2)(25,bs,6,3,"div",2),e.k0s()()),2&n&&(e.Y8G("formGroup",r.insuranceCategoryForm),e.R7$(5),e.SpI(" ",e.i5U(6,26,"PRODUCT_ADDONS.INSURANCE",e.eq3(31,ds,r.addonsCurrencyValue))," "),e.R7$(2),e.Y8G("ngClass",e.eq3(33,ls,!r.isInsuranceCheckboxDisabled)),e.R7$(2),e.Y8G("ardnDataTestId","ardn-product-addon-insurance-category-form-checkbox-insurance-label"),e.R7$(),e.Y8G("checked",r.isSelectedCheckboxInsurance)("ardnDataTestId","ardn-product-addon-insurance-category-form-checkbox-insurance-input"),e.BMQ("disabled",r.isInsuranceCheckboxDisabled?"":null),e.R7$(2),e.JRh(e.bMT(13,29,"PRODUCT_ADDONS.INSURE_SHIPMENT")),e.R7$(2),e.vxM(r.getTooltipForInsuranceCheckbox(null==r.defaultCashOnDelivery?null:r.defaultCashOnDelivery.number)?14:-1),e.R7$(),e.vxM(r.isFreightForward?15:-1),e.R7$(5),e.Y8G("maxFractionDigits",r.insuranceValuePrecision)("placeholder",r.getPlaceholder(r.isSelectedCheckboxInsurance))("showArrow",!1)("min",r.minInsuranceValue)("alwaysPropagateChange",!0)("setMinValue",!1)("ardnDataTestId","ardn-product-addon-insurance-category-form-insuranceValue-ardn-number-input"),e.R7$(),e.Y8G("clientSideValidation",r.insuranceCategoryForm.get("insuranceValue"))("clientErrorMessage","PRODUCT_ADDONS.OPTIONS.COD_VALUE_MIN_MAX_ERROR")("clientTranslationParams",e.sMw(35,cs,r.minInsuranceValue,r.max
1InsuranceValue,r.addonsCurrencyValue))("serverSideValidation",null==r.optionsServerErrors?null:r.optionsServerErrors["[value]"])("ardnDataTestId","ardn-product-addon-insurance-category-form-insuranceValue-ardn-number-field-validator"),e.R7$(),e.vxM(r.isSelectedCheckboxInsurance&&r.insuranceCategoryForm.get("additionalAddons")&&r.isInsuranceValueValid?22:-1),e.R7$(),e.vxM(r.isSelectedCheckboxInsurance&&r.availableAddons.length?23:-1),e.R7$(),e.vxM(null!==r.getGeneralServerError()?24:-1),e.R7$(),e.vxM(!r.isInsuranceValueValid||r.isPremiumInsuranceSet||r.isCarrierInsuranceSet?-1:25))},dependencies:[m.X1,m.Zm,m.BC,m.cb,m.j4,m.JD,m.$R,f.h,f.D9,l.YU,Z.Z,ot.N,ye.Q,ge.d,at,dt,We,kn],styles:[".addon-insurance__checkbox[_ngcontent-%COMP%], .addon-insurance[_ngcontent-%COMP%]   .field[_ngcontent-%COMP%]{margin-bottom:5px}.addon-insurance[_ngcontent-%COMP%]   .additional-addons[_ngcontent-%COMP%]{clear:both;margin-top:10px;padding-top:10px}.addon-insurance[_ngcontent-%COMP%]   .additional-addons[_ngcontent-%COMP%]     .addon-category:not(:last-of-type) fieldset{padding-top:10px;border-top:solid 1px #f3f3f3;border-bottom:none}.addon-insurance[_ngcontent-%COMP%]   .additional-addons[_ngcontent-%COMP%]     .addon-category:not(:last-of-type) fieldset.order-setup__field{margin-bottom:0;padding-bottom:0}.addon-insurance[_ngcontent-%COMP%]   .additional-addons[_ngcontent-%COMP%]     .addon-category:last-of-type fieldset{padding-bottom:0;border-bottom:0;margin-bottom:0}"],changeDetection:0})}}return i})();var Ps=s(39974),As=s(54360);function Ri(i,p){return(0,Ps.N)(function Rs(i,p,t){const n="index"===t;return(r,o)=>{let u=0;r.subscribe((0,As._)(o,g=>{const A=u++;i.call(p,g,A,r)&&(o.next(n?A:g),o.complete())},()=>{o.next(n?-1:void 0),o.complete()}))}}(i,p,"value"))}var ct=s(40571),Ts=s(15231);const Ti=i=>({minLength:i}),Is=()=>({standalone:!0});function Ds(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",1),e.nrm(1,"div",2),e.j41(2,"div",8)(3,"ardn-product-addon-radio",18),e.bIt("change",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.onChangeAddonRadio(r))}),e.k0s(),e.nrm(4,"input",19),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(3),e.Y8G("formControlName","selectedAddon")("addons",t.selectedCheckboxes)("compareCheckedParams",!0)("propagateValueParams",!1)("showAddonId",!0)("hiddenRadioAddonId",t.noCodId)("ardnDataTestId","ardn-product-addon-cod-options-ardn-product-addon-radio"),e.R7$(),e.Y8G("ardnDataTestId","ardn-product-addon-cod-options-form-cashOnDelivery-input")}}function Ms(i,p){if(1&i&&(e.j41(0,"span",28),e.nI1(1,"translate"),e.EFF(2,"i"),e.k0s()),2&i){const t=e.XpG().$implicit;e.Y8G("ardnTooltipster",e.bMT(1,1,"TOOLTIP."+t.addons[0].tooltip))}}function Fs(i,p){if(1&i&&(e.j41(0,"span",28),e.EFF(1,"i"),e.k0s()),2&i){const t=e.XpG().$implicit;e.Y8G("ardnTooltipster",t.addons[0].description)}}function $s(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",23),e.bIt("click",function(r){const o=e.eBV(t).$implicit,u=e.XpG(2);return e.Njj(u.onClickTiles(o.addons[0].id,r))}),e.j41(1,"div",24),e.EFF(2),e.k0s(),e.j41(3,"div",25),e.EFF(4),e.k0s(),e.j41(5,"div",26),e.EFF(6),e.nI1(7,"ardnCurrency"),e.k0s(),e.j41(8,"div",27),e.DNE(9,Ms,3,3,"span",28)(10,Fs,2,1,"span",28),e.k0s()()}if(2&i){const t=p.$implicit,n=e.XpG(2);e.Y8G("className","tiles__item"+(n.selectedAddon===t.addons[0].id?" tiles--selected":""))("ardnDataTestId","ardn-product-addon-cod-options-form-cashOnDelivery-tiles-"+(null==t||null==t.addons[0]?null:t.addons[0].id)),e.R7$(2),e.JRh(t.addons[0].daysToReturn),e.R7$(2),e.JRh(n.getTilesDescription(t.addons[0].daysToReturn)),e.R7$(2),e.SpI("+ ",e.i5U(7,7,t.addons[0].price,t.addons[0].currency),""),e.R7$(3),e.vxM(t.addons[0].tooltip?9:-1),e.R7$(),e.vxM(t.addons[0].description?10:-1)}}function Ns(i,p){if(1&i&&(e.j41(0,"div",1),e.nrm(1,"div",2),e.j41(2,"div",8)(3,"div",20),e.Z7z(4,$s,11,10,"div",21,e.fX1),e.nrm(6,"input",22),e.k0s()()()),2&i){const t=e.XpG();e.R7$(3),e.Y8G("ardnDataTestId","ardn-product-addon-cod-options-form-cashOnDelivery-tiles"),e.R7$(),e.Dyx(t.getOtherAddons()),e.R7$(2),e.BMQ("disabled",!1)("visible",!1)}}function ks(i,p){if(1&i){const t=e.RV6();e.j41(0,"legend",2)(1,"label",29)(2,"span",4)(3,"span",5),e.EFF(4),e.nI1(5,"translate"),e.k0s()()()(),e.j41(6,"div",8)(7,"ardn-drop-down",30),e.nI1(8,"translate"),e.nI1(9,"translate"),e.bIt("ngModelChange",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.selectCod(r))})("currentSearchValue",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.isFilteredData(r))}),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(),e.Y8G("ardnDataTestId","ardn-product-addon-cod-options-select-cod-label"),e.R7$(3),e.SpI(" ",e.bMT(5,11,"PRODUCT_ADDONS.OPTIONS.COD_SELECT")," "),e.R7$(3),e.Y8G("dataSource",t.codSource)("searchEnabled",!0)("searchPlaceholder",e.bMT(8,13,"PRODUCT_ADDONS.OPTIONS.FILTER_COD"))("isDisabledChecker",!1)("ngModel",t.selectedDefaultCod)("ngModelOptions",e.lJ4(17,Is))("placeholder",e.bMT(9,15,"COMMON.SELECT_PLACEHOLDER"))("parentName","order-customs-step")("ardnDataTestId","ardn-order-shipment-options-step-form-order-customs-invoices-drop-down")}}function Vs(i,p){if(1&i&&(e.j41(0,"div",1)(1,"div",2)(2,"label",31)(3,"span",4)(4,"span",5),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"ardn-swift-info-tip",32),e.k0s()()(),e.j41(8,"div",8),e.nrm(9,"input",33)(10,"ardn-field-validator",10),e.k0s()()),2&i){const t=e.XpG();e.R7$(2),e.Y8G("ardnDataTestId","ardn-product-addon-cod-options-form-swiftCode-label"),e.R7$(3),e.SpI(" ",e.bMT(6,7,"PRODUCT_ADDONS.OPTIONS.COD_SWIFT_NUMBER")," "),e.R7$(4),e.Y8G("ardnDataTestId","ardn-product-addon-cod-options-form-swiftCode-input"),e.R7$(),e.Y8G("clientSideValidation",t.optionsForm.get("swiftCode"))("clientErrorMessage","COMMON.ERRORS.REQUIRED")("serverSideValidation",t.getValidationError("swiftCode"))("ardnDataTestId","ardn-product-addon-cod-options-form-swiftCode-field-validator")}}let Ii=(()=>{class i{constructor(t,n,r,o,u,g,A){this.injector=t,this.formBuilder=n,this.translateService=r,this.scrollService=o,this.store=u,this.currencyService=g,this.dataSourceArray=A,this.noCodId=-1,this.destroyRef=(0,e.WQX)(e.abz),this.selectedNoCodAddon=!1,this.selectedCheckboxes=[],this.selectedAddon=null,this.validateOptions=!1,this.isAdminLoggedIn=this.store.select(J.R),this.minFormGroupFieldLength=3,this.minAddonValue=(0,e.hFB
1)(),this.maxAddonValue=(0,e.hFB)(),this.serverValidationErrors=(0,e.hFB)({}),this.codValues=(0,e.hFB)(),this.codDraftValues=(0,e.hFB)(),this.memorizedCODAddon=(0,e.hFB)(),this.unsortedAdditions=(0,e.hFB)(),this.country=(0,e.hFB)(),this.addonsCurrencyValue=(0,e.hFB)(),this.filteredAdditions=(0,e.hFB)(),this.validityChanged=(0,e.CGW)(),this.isListCodFiltered=!1,this.emptyCods=!1,this.selectedDefaultCod=null,this.propagateChange=()=>{},this.getCurrentCurrency(),this.buildAddonsForm(),(0,e.QZP)(()=>{this.filteredAdditions(),this.selectedCheckboxes=this.getAddons(this.parentControl.value?.selectedAddon)})}ngOnInit(){this.setValidatorsForAdditionalFields(),this.optionsForm.valueChanges.pipe((0,ce.B)(10),(0,j.F)(E()),(0,z.pQ)(this.destroyRef)).subscribe(()=>{this.validityChanged.emit(this.optionsForm.valid),this.propagateChange(this.getAddonOptions())}),this.loadCods()}ngAfterViewInit(){if(this.codValues()||this.memorizedCODAddon()||this.codDraftValues())if(this.memorizedCODAddon())this.store.select(ct.J).pipe(Ri(t=>t?.order?.shipment?.addons.some(n=>"CASH_ON_DELIVERY"===n?.category)),(0,z.pQ)(this.destroyRef)).subscribe(()=>{setTimeout(()=>{const t={accountNumber:this.memorizedCODAddon().options.bankAccountNumber,swiftCode:this.memorizedCODAddon().options.swiftCode,accountName:this.memorizedCODAddon().options.name,accountAddress:this.memorizedCODAddon().options.addressLine1,accountAddressContinued:this.memorizedCODAddon().options.addressLine2};if(this.setOptionsValues(t),this.memorizedCODAddon().id!==this.parentControl.value?.selectedAddon){const n=this.memorizedCODAddon().id;this.optionsForm.get("selectedAddon").patchValue(this.parentControl.value?.selectedAddon),this.optionsForm.get("selectedOtherAddon").patchValue(Number(n)),this.selectedNoCodAddon=!0,this.selectedCheckboxes=this.getAddons(this.parentControl.value?.selectedAddon,n),this.selectedAddon=n}},50)});else if(this.codDraftValues())this.setOptionsValues(this.codDraftValues());else if(this.codValues()&&this.setDefaultCodOptionValues(),!this.codValues())return}setDefaultCodOptionValues(){const t=this.codValues().find(n=>n.currency===this.addonsCurrencyValue()&&n.isDefault);t&&(this.selectedDefaultCod=t,this.setOptionsValues(t),this.isSwiftCodeRequired()&&this.optionsForm.get("swiftCode").patchValue(t.swiftCode))}onChangeAddonRadio(t){if(this.selectedNoCodAddon=Number((t.target||t.currentTarget).getAttribute("addonid"))===this.noCodId,this.optionsForm.get("selectedAddon").patchValue(Number(this.parentControl.value?.selectedAddon)),this.selectedNoCodAddon){const r=this.getOtherAddons();if(r&&r.length){const o=r[0].addons[0].id;this.selectedAddon=o,this.selectedCheckboxes=this.getAddons(this.parentControl.value?.selectedAddon,o),this.optionsForm.get("selectedOtherAddon").patchValue(this.selectedAddon)}}else this.selectedCheckboxes=this.getAddons(this.parentControl.value?.selectedAddon),this.selectedAddon=this.parentControl.value?.selectedAddon,this.optionsForm.get("selectedOtherAddon").patchValue("")}isSwiftCodeRequired(){const t=this.optionsForm.get("bankAccountNumber")?.value,n=this.addonsCurrencyValue()&&"PLN"!==this.addonsCurrencyValue(),r=t&&!t?.toLowerCase().startsWith("pl"),o=n||r;return this.updateSwiftCodeOptionsForm(o),o}isFilteredData(t){t&&(this.isListCodFiltered=!0)}selectCod(t){this.optionsForm.get("bankAccountNumber").patchValue(t.accountNumber),this.optionsForm.get("name").patchValue(t.accountName),this.optionsForm.get("addressLine1").patchValue(t.accountAddress),this.optionsForm.get("addressLine2").patchValue(t.accountAddressContinued),this.isSwiftCodeRequired()&&this.optionsForm.get("swiftCode").patchValue(t.swiftCode)}loadCods(){this.codValues()?.length?this.codSource=this.dataSourceArray.create(this.codValues(),"accountName"):this.emptyCods=!0}updateSwiftCodeOptionsForm(t){t&&!this.optionsForm.get("swiftCode")&&(this.optionsForm.addControl("swiftCode",new m.MJ("",m.k0.compose([m.k0.required]))),this.optionsForm.get("swiftCode").updateValueAndValidity(),this.optionsForm.get("swiftCode")?.markAsTouched()),!t&&this.optionsForm.get("swiftCode")&&this.optionsForm.removeControl("swiftCode")}
1setOptionsValues(t){this.selectCod(t),this.updateValidityForAdditionalFields()}setValidatorsForAdditionalFields(t=!1){t?(this.optionsForm.get("bankAccountNumber").setValidators(m.k0.compose([m.k0.required,oe.fP])),this.optionsForm.get("name").setValidators(m.k0.compose([m.k0.required,m.k0.minLength(this.minFormGroupFieldLength)])),this.optionsForm.get("addressLine1").setValidators(m.k0.compose([m.k0.required,m.k0.minLength(this.minFormGroupFieldLength)])),this.isSwiftCodeRequired()&&this.optionsForm.get("swiftCode").setValidators(m.k0.compose([m.k0.required]))):(this.optionsForm.get("bankAccountNumber").setValidators([oe.fP,m.k0.required]),this.optionsForm.get("name").setValidators([m.k0.required,m.k0.minLength(this.minFormGroupFieldLength)]),this.optionsForm.get("addressLine1").setValidators([m.k0.required,m.k0.minLength(this.minFormGroupFieldLength)]),this.isSwiftCodeRequired()&&this.optionsForm.get("swiftCode").setValidators([m.k0.required])),this.optionsForm.get("addressLine2").setValidators([m.k0.minLength(this.minFormGroupFieldLength)]),this.updateValidityForAdditionalFields()}updateValidityForAdditionalFields(){this.optionsForm.updateValueAndValidity()}getAddonOptions(){const t=this.optionsForm.value;return t.cashOnDelivery=this.parentControl.value?.cashOnDelivery,t.selectedAddon=this.parentControl.value?.selectedAddon,t}buildAddonsForm(){this.optionsForm=this.formBuilder.group({}),this.optionsForm.addControl("cashOnDelivery",new m.MJ("",[])),this.optionsForm.addControl("selectedAddon",new m.MJ("",[])),this.optionsForm.addControl("selectedOtherAddon",new m.MJ("",[])),this.optionsForm.addControl("bankAccountNumber",new m.MJ("",[])),this.optionsForm.addControl("name",new m.MJ("",[])),this.optionsForm.addControl("addressLine1",new m.MJ("",[])),this.optionsForm.addControl("addressLine2",new m.MJ("",[]))}getAddons(t=null,n=null){let r=this.getDefaultAddon();t&&(r=this.getAddonById(t,!this.selectedNoCodAddon));const o=this.getOtherAddons(t);let u=[];return r&&(u=[r],o&&o?.length&&u.push(this.createNoCodOption(n))),u}getAddonById(t,n){if(this.filteredAdditions()?.length){const r=this.filteredAdditions().find(o=>o.addons?.[0].id===t);if(r?.addons?.[0]){const o=r.addons?.[0];return o.checked=n,o}}return null}getDefaultAddon(){if(this.filteredAdditions()?.length){const t=this.getDefaultDaysToReturn(this.unsortedAdditions()),n=this.filteredAdditions().filter(r=>r.addons?.[0].daysToReturn===t);if(n&&0===n.length){if(this.filteredAdditions()?.[0]?.addons?.[0]){const r=this.filteredAdditions()?.[0].addons?.[0];return r.checked=!this.selectedNoCodAddon,r}return n?.[0].addons?.[0]}if(n?.[0]?.addons?.[0]){const r=n?.[0].addons?.[0];return r.checked=!this.selectedNoCodAddon,r}}return null}getOtherAddons(t=null){const n=t?this.getAddonById(t,!this.selectedNoCodAddon):this.getDefaultAddon();let r=[];const o=this.getDefaultDaysToReturn(this.unsortedAdditions());return n&&n.id&&(r=this.filteredAdditions().filter(u=>Number(u.addons?.[0].id)!==Number(n.id)&&Number(u.addons[0].daysToReturn)!==o)),r&&r.length?r:[]}getDefaultDaysToReturn(t){if(t?.length){const n=t?.[0];if(n?.addons?.[0]?.daysToReturn)return n.addons?.[0].daysToReturn}return null}otherAddonsExists(){return!!this.getOtherAddons()?.length}getTilesDescription(t){return(t=Number(t))<1?this.translateService.instant("PRODUCT_ADDONS.OPTIONS.COD_WORKING_DAYS"):t>0&&t<5?this.translateService.instant("PRODUCT_ADDONS.OPTIONS.COD_WORKING_DAY"):t>=5?this.translateService.instant("PRODUCT_ADDONS.OPTIONS.COD_WORKING_DAYS"):null}createNoCodOption(t=null){let n=null,r=null,o=null,u=null;if(t>0){const g=this.getOtherAddons().filter(A=>A.addons[0].id===t);g&&g.length&&(n=g?.[0].addons?.[0].price,r=g?.[0].addons?.[0].priceGross,o=g?.[0].addons?.[0].currency,u=g?.[0].addons?.[0].valueCurrency)}return{id:this.noCodId,addonName:this.translateService.instant("PRODUCT_ADDONS.OPTIONS.COD_DIFFERENT_REFOUND_DATE")+":",price:n,priceGross:r,minValue:null,maxValue:null,category:"CASH_ON_DELIVERY",isRequired:!1,checked:this.selectedNoCodAddon,verificationRequired:!1,options:{},currency:o,valueCurrency:u,insuranceRequired:!1}}onClickTiles(t,n){this.optionsForm.get("selectedAddon").patchValue(this.parentControl.value?.selectedAddon),this.optionsForm.get("selectedOtherAddon").patchValue(t),this.selectedNoCodAddon=!0,this.selectedCheckboxes=this.getAddons(this.parentControl.value?.selectedAddon,t),this.selectedAddon=t,n?.stopPropagation()}
1registerOnChange(t){this.propagateChange=t}writeValue(t){const n={accountNumber:t.bankAccountNumber,swiftCode:t.swiftCode,accountName:t.name,accountAddress:t.addressLine1,accountAddressContinued:t.addressLine2};this.optionsForm.patchValue(t),this.selectedNoCodAddon=!!t.selectedOtherAddon,this.selectedCheckboxes=this.getAddons(t.selectedAddon),this.selectedAddon=this.selectedNoCodAddon?t.selectedOtherAddon:t.selectedAddon,this.setOptionsValues(n)}registerOnTouched(){}getValidationError(t){return this.serverValidationErrors()[t]?this.serverValidationErrors()[t]:null}checkCorrectionsData(){return this.validateOptions=!0,this.setValidatorsForAdditionalFields(!0),this.optionsForm.valid}validate(t){const n=[];Object.keys(this.optionsForm.controls).forEach(r=>{this.optionsForm.get(r).markAsTouched({onlySelf:!0}),n.push(r)}),t||this.scrollService.findInvalidFieldAndScroll(n,this.optionsForm)}get ngControl(){return this.injector.get(m.vO,null)}get parentControl(){return this.ngControl?.control}getCurrentCurrency(){this.currencyService.getCurrencyObservable().subscribe(t=>{this.currentCurrency=t})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(e.zZn),e.rXU(m.ok),e.rXU(f.c$),e.rXU(nt.b),e.rXU(v.il),e.rXU(Vn.P),e.rXU(tt.m))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-cod-options"]],viewQuery:function(n,r){if(1&n&&e.GBs(rt,5),2&n){let o;e.mGM(o=e.lsd())&&(r.radioAddonComponent=o.first)}},inputs:{minAddonValue:[1,"minAddonValue"],maxAddonValue:[1,"maxAddonValue"],serverValidationErrors:[1,"serverValidationErrors"],codValues:[1,"codValues"],codDraftValues:[1,"codDraftValues"],memorizedCODAddon:[1,"memorizedCODAddon"],unsortedAdditions:[1,"unsortedAdditions"],country:[1,"country"],addonsCurrencyValue:[1,"addonsCurrencyValue"],filteredAdditions:[1,"filteredAdditions"]},outputs:{validityChanged:"validityChanged"},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.aNF],decls:55,vars:57,consts:[[1,"order-setup__options",3,"formGroup"],[1,"field"],[1,"order-setup__label"],["for","bankaccountnumber",1,"label",3,"ardnDataTestId"],[1,"v-align"],[1,"v-align__content"],[1,"label--required"],[1,"info-icon","tooltip","tooltipstered","account-number-tooltip",3,"ardnTooltipster"],[1,"order-setup__input","field"],["id","bankaccountnumber","formControlName","bankAccountNumber",1,"input",3,"placeholder","readonly","ardnDataTestId"],[1,"input-validation",3,"clientSideValidation","clientErrorMessage","serverSideValidation","ardnDataTestId"],["for","name",1,"label",3,"ardnDataTestId"],["id","name","formControlName","name",1,"input",3,"ardnDataTestId"],[1,"input-validation",3,"clientSideValidation","clientErrorMessage","clientTranslationParams","serverSideValidation","ardnDataTestId"],["for","addressline1",1,"label",3,"ardnDataTestId"],["id","addressline1","formControlName","addressLine1",1,"input",3,"ardnDataTestId"],["for","addressline2",1,"label",3,"ardnDataTestId"],["id","addressline2","formControlName","addressLine2",1,"input",3,"ardnDataTestId"],["id","selectedAddon",3,"change","formControlName","addons","compareCheckedParams","propagateValueParams","showAddonId","hiddenRadioAddonId","ardnDataTestId"],["id","cashOnDelivery","type","text","formControlName","cashOnDelivery",1,"tiles__other-addon",3,"ardnDataTestId"],[1,"tiles",3,"ardnDataTestId"],[3,"className","ardnDataTestId"],["type","text","id","selectedOtherAddon","formControlName","selectedOtherAddon",1,"tiles__other-addon"],[3,"click","className","ardnDataTestId"],[1,"tiles__days"],[1,"tiles__description"],[1,"tiles__price","color-progress"],[1,"tiles__tooltip"],[1,"info-icon","tooltip","tooltipstered","tiles--bg-white",3,"ardnTooltipster"],[1,"label",3,"ardnDataTestId"],["displayField","accountName",3,"ngModelChange","currentSearchValue","dataSource","searchEnabled","searchPlaceholder","isDisabledChecker","ngModel","ngModelOptions","placeholder","parentName","ardnDataTestId"],["for","swiftCode",1,"label",3,"ardnDataTestId"],[1,"swift-info-tip"],["id","swiftCode","formControlName","swiftCode",1,"input",3,"ardnDataTestId"]],template:function(n,r){1&n&&(e.j41(0,"div",0),e.DNE(1,Ds,5,8,"div",1)(2,Ns,7,3,"div",1)(3,ks,10,18),e.j41(4,"div",1)(5,"div",2)(6,"label",3)(7,"span",4)(8,"span",5),e.EFF(9),e.nI1(10,"translate"),e.j41(11,"span",6),e.EFF(12,"*"),e.k0s()(),e.j41(13,"span",7),e.nI1(14,"translate"),e.EFF(15,"i"),e.k0s()()()(),e.j41(16,"div",8),e.nrm(17,"input",9),e.nI1(18,"async"),e.nrm(19,"ardn-field-validator",10),e.k0s()(),e.DNE(20,Vs,11,9,"div",1),e.j41(21,"div",1)(22,"div",2)(23,"label",11)(24,"span",4)(25,"span",5),e.EFF(26),e.nI1(27,"translate"),e.j41(28,"span",6),e.EFF(29,"*"),e.k0s()()()()(),e.j41(30,"div",8),e.nrm(31,"input",12)(32,"ardn-field-validator",13),e.k0s()(),e.j41(33,"div",1)(34,"div",2)(35,"label",14)(36,"span",4)(37,"span",5),e.EFF(38),e.nI1(39,"translate"),e.j41(40,"span",6),e.EFF(41,"*"),e.k0s()()()()(),e.j41(42,"div",8),e.nrm(43,"input",15)(44,"ardn-field-validator",13),e.k0s()(),e.j41(45,"div",1)(46,"div",2)(47,"label",16)(48,"span",4)(49,"span",5),e.EFF(50),e.nI1(51,"translate"),e.k0s()()()(),e.j41(52,"div",8),e.nrm(53,"input",17)(54,"ardn-field-validator",13),e.k0s()()()),2&n&&(e.Y8G("formGroup",r.optionsForm),e.R7$(),e.vxM(r.selectedCheckboxes.length?1:-1),e.R7$(),e.vxM(r.otherAddonsExists()?2:-1),e.R7$(),e.vxM(r.emptyCods?-1:3),e.R7$(3),e.Y8G("ardnDataTestId","ardn-product-addon-cod-options-form-bankaccountnumber-label"),e.R7$(3),e.SpI(" ",e.bMT(10,39,"PRODUCT_ADDONS.OPTIONS.COD_ACCOUNT_NUMBER")," "),e.R7$(4),e.Y8G("ardnTooltipster",e.bMT(14,41,"TOOLTIP.ACCOUNT_NUMBER")),e.R7$(4),e.Y8G("placeholder","PLXXXXXXXXXXXXXXXXXXXXXXXXXX")("readonly",e.bMT(18,43,r.isAdminLoggedIn))("ardnDataTestId","ardn-product-addon-cod-options-form-bankAccountNumber-input"),e.R7$(2),e.Y8G("clientSideValidation",r.optionsForm.get("bankAccountNumber"))("clientErrorMessage","COMMON.ERRORS.INVALID_IBAN")("serverSideValidation",r.getValidationError("bankAccountNumber"))("ardnDataTestId","ardn-product-addon-cod-options-form-bankAccountNumber-field-validator"),e.R7$(),e.vxM(r.isSwiftCodeRequired()?20:-1),e.R7$(3),e.Y8G("ardnDataTestId","ardn-product-addon-cod-options-form-name-label"),e.R7$(3),e.SpI(" ",e.bMT(27,45,"PRODUCT_ADDONS.OPTIONS.COD_NAME")," "),e.R7$(5),e.Y8G("ardnDataTestId","ardn-product-addon-cod-options-form-name-input"),e.R7$(),e.Y8G("clientSideValidation",r.optionsForm.get("name"))("clientErrorMessage","COMMON.ERRORS.MIN_LENGTH")("clientTranslationParams",e.eq3(51,Ti,r.minFormGroupFieldLength))("serverSideValidation",r.getValidationError("name"))("ardnDataTestId","ardn-product-addon-cod-options-form-name-field-validator"),e.R7$(3),e.Y8G("ardnDataTestId","ardn-product-addon-cod-options-form-addressline1-label"),e.R7$(3),e.SpI(" ",e.bMT(39,47,"PRODUCT_ADDONS.OPTIONS.COD_ADDRESS_LINE_1")," "),e.R7$(5),e.Y8G("ardnDataTestId","ardn-product-addon-cod-options-form-addressLine1-input"),e.R7$(),e.Y8G("clientSideValidation",r.optionsForm.get("addressLine1"))("clientErrorMessage","COMMON.ERRORS.MIN_LENGTH")("clientTranslationParams",e.eq3(53,Ti,r.minFormGroupFieldLength))("serverSideValidation",r.getValidationError("addressLine1"))("ardnDataTestId","ardn-product-addon-cod-options-form-addressLine1-field-validator"),e.R7$(3),e.Y8G("ardnDataTestId","ardn-product-addon-cod-options-form-addressLine2-label"),e.R7$(3),e.SpI(" ",e.bMT(51,49,"PRODUCT_ADDONS.OPTIONS.COD_ADDRESS_LINE_2")," "),e.R7$(3),e.Y8G("ardnDataTestId","ardn-product-addon-cod-options-form-addressLine2-input"),e.R7$(),e.Y8G("clientSideValidation",r.optionsForm.get("addressLine2"))("clientErrorMessage","COMMON.ERRORS.MIN_LENGTH")("clientTranslationParams",e.eq3(55,Ti,r.minFormGroupFieldLength))("serverSideValidation",r.getValidationError("addressLine2"))("ardnDataTestId","ardn-product-addon-cod-options-form-addressLine2-field-validator"))},dependencies:[rt,m.X1,m.me,m.BC,m.cb,m.j4,m.JD,Z.Z,st.W,ge.d,f.h,f.D9,ye.Q,Ts.e,l.Jj,ee.v,m.YN,m.vS],styles:['.order-setup__options[_ngcontent-%COMP%]{padding-top:15px;clear:both}.order-setup__options[_ngcontent-%COMP%]   .tiles[_ngcontent-%COMP%]{display:flex;margin-right:-10px;flex-wrap:wrap;justify-content:space-between}.order-setup__options[_ngcontent-%COMP%]   .tiles[_ngcontent-%COMP%]:after{content:"";flex:auto}.order-setup__options[_ngcontent-%COMP%]   .tiles--selected[_ngcontent-%COMP%]{border:2px solid #79a600!important}.order-setup__options[_ngcontent-%COMP%]   .tiles__item[_ngcontent-%COMP%]{border:1px solid #bcbcbc;border-radius:5px;padding:5px;margin-bottom:15px;position:relative;text-align:center;margin-right:10px;box-sizing:border-box;width:22.6%;cursor:pointer}.order-setup__options[_ngcontent-%COMP%]   .tiles__days[_ngcontent-%COMP%]{color:#000;font-size:18px;font-weight:700}.order-setup__options[_ngcontent-%COMP%]   .tiles__description[_ngcontent-%COMP%]{color:#393939;font-size:12px;overflow:hidden}.order-setup__options[_ngcontent-%COMP%]   .tiles__price[_ngcontent-%COMP%]{font-size:12px}.order-setup__options[_ngcontent-%COMP%]   .tiles__tooltip[_ngcontent-%COMP%]{position:absolute;top:-10px;right:10px}.order-setup__options[_ngcontent-%COMP%]   .tiles--bg-white[_ngcontent-%COMP%]{background-color:#fff}.order-setup__options[_ngcontent-%COMP%]   .tiles__other-addon[_ngcontent-%COMP%]{display:none}.order-setup__options[_ngcontent-%COMP%]   .field[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{color:#5b5b5b}.order-setup__options[_ngcontent-%COMP%]   .account-number-tooltip[_ngcontent-%COMP%]{position:absolute;font-size:.65em;margin-left:.5em}.swift-info-tip[_ngcontent-%COMP%]     .tooltipstered{position:absolute;font-size:.65em;margin-left:.5em}']})}}return i})();const xs=i=>({currency:i}),Us=(i,p)=>({max:i,currency:p});function Gs(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-category-fields",16),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.additionalFieldsValidityChanged(r,"fields"))}),e.k0s()}if(2&i){let t;const n=e.XpG(2);e.Y8G("fields",null==(t=n.addonsCategory())?null:t.fields)("serverValidationErrors",n.optionsServerErrors)}}function Ls(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-cod-options",13),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.additionalFieldsValidityChanged(r,"options"))}),e.k0s(),e.DNE(1,Gs,1,2,"ardn-product-addon-category-fields",14),e.nrm(2,"ardn-field-validator",15)}if(2&i){let t;const n=e.XpG();e.Y8G("minAddonValue",n.minAddonValue)("maxAddonValue",n.maxAddonValue)("serverValidationErrors",n.optionsServerErrors)("codValues",n.codValues())("codDraftValues",n.codDraftValues())("filteredAdditions",n.filteredAdditions)("unsortedAdditions",n.unsortedFilteredAdditions)("country",n.country)("memorizedCODAddon",n.memorizedCODAddon)("addonsCurrencyValue",n.addonsCurrencyValue)("ardnDataTestId","ardn-product-addon-cod-category-form-cashOnDelivery-ardn-product-addon-cod-options"),e.R7$(),e.vxM(null!=(t=n.addonsCategory())&&t.fields?1:-1),e.R7$(),e.Y8G("clientSideValidation",n.categoryForm.get("fields"))("serverSideValidation",null==n.optionsServerErrors?null:n.optionsServerErrors.fields)}}let Di=(()=>{class i{constructor(t,n,r,o,u,g){this.formBuilder=t,this.translateService=n,this.store=r,this.changeDetector=o,this.countryService=u,this.currencyPrecisionService=g,this.addonsCategory=(0,e.hFB
1)(),this.addonsServerValidationErrors=(0,e.hFB)([]),this.codValues=(0,e.geq)(),this.codDraftValues=(0,e.geq)(),this.validityChanged=(0,e.CGW)(),this.inputValueChanged=(0,e.CGW)(),this.cashOnDeliveryChanged=(0,e.CGW)(),this.displayAdditionalFields=!1,this.optionsServerErrors={},this.isSelectedCashOnDelivery=!1,this.selectedAddonId=null,this.cashOnDeliveryValue=null,this.filteredAdditions=[],this.unsortedFilteredAdditions=[],this.countryId=null,this.isResolvingSelectedAddon=!1,this.codOptionsValid=!1,this.categoryFieldsValid=!1,this.destroyRef=(0,e.WQX)(e.abz),this.selectedFormOption=null,this.validateOptions=!1,this.propagateChange=()=>{},this.buildAddonsForm(),this.orderCurrency=(0,z.ot)(this.store.select(T.ig),{initialValue:null}),(0,e.QZP)(()=>this.categoryFieldsValid=!this.addonsCategory().fields||this.categoryFieldsValid),(0,e.QZP)(()=>{this.currencyPrecisionService.currencies(),this.changeDetector.markForCheck()})}get cashOnDeliveryPrecision(){return this.currencyPrecisionService.getPrecision(this.orderCurrency())}ngAfterViewInit(){this.memorizedCODAddon&&(this.isSelectedCashOnDelivery=!0,this.cashOnDeliveryValue=this.memorizedCODAddon.options.value,this.numberInputComponent.setValue(this.cashOnDeliveryValue))}ngOnChanges(t){t.addonsCategory?.previousValue!==t.addonsCategory?.currentValue&&(this.addonsExists()?(this.minAddonValue=1,this.maxAddonValue=this.getAddonsMaxValue()):this.categoryForm.get("selectedCashOnDelivery").disable()),this.optionsServerErrors=this.getOptionServerErrors()}ngOnInit(){this.minAddonValue=1,this.maxAddonValue=this.getAddonsMaxValue(),this.setAddonsValueCurrency(),this.store.select(ct.J).pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(t=>{if(t.order.shipmentTemp){const n=t.order.shipmentTemp.addons.find(r=>"CASH_ON_DELIVERY"===r.category);this.memorizedCODAddon=n||null}}),(0,q.z)([this.store.select(T.PE),this.store.select(mt.pO??null)]).pipe((0,j.F)(E()),(0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(([t,n])=>{let r=null;if(n&&(r=n.find(o=>o.draft.orderDraftId===t.orderDraftId)),r){const o=this.addonsCategory().addonsGroup.map(N=>N.addons).reduce((N,w)=>N.concat(w));if(!r?.draft?.addons)return;const u=o.filter(N=>r.draft.addons.map(w=>w.id).includes(N.id));this.buildAddonsForm(),this.addonsExists()?(this.minAddonValue=1,this.maxAddonValue=this.getAddonsMaxValue()):this.categoryForm.get("selectedCashOnDelivery").disable();const g=r.draft.addons.find(N=>u.map(w=>w.id).includes(N.id));if(!g)return;const A=this.codValues().find(N=>N.currency===this.addonsCurrencyValue&&N.isDefault);if(g?.bankAccountNumber||g?.name||g?.addressLine1||g?.addressLine2||g?.swiftCode){const N={accountNumber:g?.bankAccountNumber?.toString(),swiftCode:g?.swiftCode?.toString(),accountName:g?.name?.toString(),accountAddress:g?.addressLine1?.toString(),accountAddressContinued:g?.addressLine2?.toString()};this.codDraftValues.set(N)}else this.codDraftValues.set({...A,value:g.value});u?.length&&g?.value&&this.setAddonsFromDraft(g.value)}t?.userAddress?.countryId&&(this.countryId=t.userAddress.countryId)}),this.categoryForm.get("selectedCashOnDelivery").valueChanges.subscribe(t=>{this.isSelectedCashOnDelivery=t,this.setCashOnDeliveryStatus(this.isSelectedCashOnDelivery),this.isSelectedCashOnDelivery?(this.categoryForm.get("cashOnDelivery").setValidators([m.k0.compose([m.k0.required,m.k0.min(this.minAddonValue),m.k0.max(this.maxAddonValue)])]),this.categoryForm.get("cashOnDelivery").updateValueAndValidity()):(this.displayAdditionalFields=!1,this.categoryForm.get("cashOnDelivery").setValue(""),this.categoryForm.get("cashOnDelivery").setValidators([]),this.categoryForm.get("cashOnDelivery").updateValueAndValidity(),this.categoryForm?.get("fields")?.reset(),this.additionalFieldsValidityChanged(!0,"fields"),setTimeout(()=>{this.selectedAddonId=null,this.cashOnDeliveryValue=null;const n={...this.categoryForm.get("options").value};n.selectedAddon="",n.cashOnDelivery="",this.categoryForm.get("options").patchValue(n),this.propagateChange([]),this.cashOnDeliveryChanged.emit(null),this.validityChanged.emit(!0)}))}),this.categoryForm.get("cashOnDelivery").valueChanges.pipe((0,j.F)(),(0,z.pQ)(this.destroyRef)).subscribe(()=>{const t=this.categoryForm.get("cashOnDelivery");this.isResolvingSelectedAddon=t.valid&&!!Number(t.value)}),this.categoryForm.get("cashOnDelivery").valueChanges.pipe((0,ce.B)(500),(0,j.F)(E()),(0,z.pQ)(this.destroyRef)).subscribe(()=>{const t=this.categoryForm.get("cashOnDelivery").valid,n=Number(this.categoryForm.get("cashOnDelivery").value);if(this.validityChanged.emit(t),t&&n)if(n>9)if(this.filteredAdditions=this.getAddonsAtPrice(n),this.unsortedFilteredAdditions=this.getAddonsAtPrice(n,!1),this.filteredAdditions.length>0){this.displayAdditionalFields=!0;const r=this.getDefaultDaysToReturn(this.unsortedFilteredAdditions);let o=this.getAddonAtDaysToReturn(this.filteredAdditions,r);if(o||(o=this.filteredAdditions[0].addons[0]),o){const u=o.id;setTimeout(()=>{this.cashOnDeliveryValue=n,this.cashOnDeliveryChanged.emit(this.getCashOnDelivery(n,u)),this.isResolvingSelectedAddon=!1},500),this.selectedAddonId=o.id;const g={...this.categoryForm.get("options").value};g.selectedAddon=o.id,g.selectedOtherAddon="",g.cashOnDelivery=n,this.categoryForm.get("options").patchValue(g),o=this.updateAddonFromForm(o),this.selectedFormOption=o}
1else this.displayAdditionalFields=!1,this.propagateChange([]),this.isResolvingSelectedAddon=!1}else this.displayAdditionalFields=!1,this.propagateChange([]),this.isResolvingSelectedAddon=!1;else n<10&&(this.displayAdditionalFields=!1,this.propagateChange([]));else this.categoryFormOptionsSubscriber(),this.propagateChange([]),this.isResolvingSelectedAddon=!1,this.displayAdditionalFields=!1}),this.categoryForm.get("cashOnDelivery").valueChanges.pipe((0,ce.B)(2e3),(0,j.F)(E()),(0,z.pQ)(this.destroyRef)).subscribe(()=>{const t=this.categoryForm.get("cashOnDelivery").value;if(Number(t)&&t<10){const n=this.categoryForm.get("cashOnDelivery").valid;if(this.validityChanged.emit(n),n)if(this.filteredAdditions=this.getAddonsAtPrice(t),this.unsortedFilteredAdditions=this.getAddonsAtPrice(t,!1),this.filteredAdditions.length>0){this.displayAdditionalFields=!0;const r=this.getDefaultDaysToReturn(this.unsortedFilteredAdditions);let o=this.getAddonAtDaysToReturn(this.filteredAdditions,r);if(o||(o=this.filteredAdditions[0].addons[0]),o){const u=o.id;setTimeout(()=>{this.cashOnDeliveryValue=t,this.cashOnDeliveryChanged.emit(this.getCashOnDelivery(t,u)),this.isResolvingSelectedAddon=!1},500),this.selectedAddonId=o.id;const g={...this.categoryForm.get("options").value};g.selectedAddon=o.id,(!g.selectedOtherAddon||g.selectedOtherAddon&&!this.filteredAdditions.find(A=>A.addons[0].id===g.selectedOtherAddon))&&(g.selectedOtherAddon=""),g.cashOnDelivery=t,this.categoryForm.get("options").patchValue(g)}else this.displayAdditionalFields=!1,this.propagateChange([]),this.isResolvingSelectedAddon=!1}else this.displayAdditionalFields=!1,this.propagateChange([]),this.isResolvingSelectedAddon=!1;else this.displayAdditionalFields=!1,this.propagateChange([]),this.isResolvingSelectedAddon=!1}this.loadCachedAddon()}),this.categoryFormOptionsSubscriber(),this.categoryForm?.get("fields")?.valueChanges.pipe((0,ce.B)(50),(0,j.F)(E()),(0,z.pQ)(this.destroyRef)).subscribe(()=>{if(!this.isSelectedCashOnDelivery)return;const t={...this.categoryForm.get("options").value};let n=null;if(t?.selectedAddon||t?.selectedOtherAddon){let r=t?.selectedAddon;if(t?.selectedOtherAddon&&(r=t?.selectedOtherAddon),r&&(n=this.addonsCategory().addonsGroup.filter(o=>o.addons[0].id===r)),n[0]?.addons){const o=this.updateAddonFromForm(n[0].addons[0]);this.selectedFormOption=o,this.propagateChange([o])}}this.fieldsComponent?.validate()})}categoryFormOptionsSubscriber(){this.categoryForm.get("options").valueChanges.pipe((0,ce.B)(50),(0,j.F)(E()),(0,z.pQ)(this.destroyRef)).subscribe(t=>{if(!this.isSelectedCashOnDelivery)return;let n=null;if(t.selectedAddon||t.selectedOtherAddon){let r=t.selectedAddon;if(t.selectedOtherAddon&&(r=t.selectedOtherAddon),r&&(n=this.addonsCategory().addonsGroup.filter(o=>o.addons[0].id===r)),n[0]?.addons){const o=this.updateAddonFromForm(n[0].addons[0]);
1this.selectedFormOption=o,this.selectedAddonId=o.id,this.propagateChange([o]),this.cashOnDeliveryChanged.emit(this.getCashOnDelivery(o?.options?.value))}}this.validateOptions&&this.optionsComponent.validate(),this.country||this.getUserCountry()})}buildAddonsForm(){this.categoryForm=this.formBuilder.group({selectedCashOnDelivery:[""],cashOnDelivery:[""],options:[""],fields:[""]})}onClickCashOnDelivery(){this.addonsExists()&&!this.isSelectedCashOnDelivery&&(this.isSelectedCashOnDelivery=!0,this.categoryForm.get("cashOnDelivery").setValidators([m.k0.compose([m.k0.required,m.k0.min(this.minAddonValue),m.k0.max(this.maxAddonValue)])]),this.categoryForm.get("cashOnDelivery").updateValueAndValidity())}onKeyDown(t){if(t?.key&&","===t.key){const n=this.categoryForm.get("cashOnDelivery").value;this.categoryForm.get("cashOnDelivery").patchValue(n+"."),t.preventDefault()}}addonsExists(){return this.addonsCategory()?.addonsGroup?.length>0}getPlaceholder(){if(this.isSelectedCashOnDelivery&&this.addonsExists()){const t=this.getAddonsMaxValue();return this.translateService.instant("PRODUCT_ADDONS.OPTIONS.INSURANCE_PLACEHOLDER_MAX",{max:t,currency:this.addonsCurrencyValue})}return""}getUserCountry(){this.getCountry(this.countryId).pipe((0,z.pQ)(this.destroyRef)).subscribe(t=>{this.country=t})}getCountry(t){return this.countryService.getCountriesCached().pipe((0,X.T)(n=>n.find(r=>r.id===t)))}getAddonsMaxValue(){return this.addonsExists()?this.addonsCategory().addonsGroup.reduce((n,r)=>r.addons[0].maxValue>n.addons[0].maxValue?r:n).addons[0].maxValue:null}setAddonsFromDraft(t){if(t&&Number(t)){this.categoryForm.get("selectedCashOnDelivery").patchValue(!0),this.isSelectedCashOnDelivery=!0,this.categoryForm.get("cashOnDelivery").setValidators([m.k0.compose([m.k0.required,m.k0.min(this.minAddonValue),m.k0.max(this.maxAddonValue)])]),this.categoryForm.get("cashOnDelivery").patchValue(t);const n=this.categoryForm.get("cashOnDelivery").valid;if(this.validityChanged.emit(n),n)if(this.filteredAdditions=this.getAddonsAtPrice(Number(t)),this.unsortedFilteredAdditions=this.getAddonsAtPrice(Number(t),!1),this.filteredAdditions.length>0){this.displayAdditionalFields=!0;const r=this.getDefaultDaysToReturn(this.unsortedFilteredAdditions);let o=this.getAddonAtDaysToReturn(this.filteredAdditions,r);if(o||(o=this.filteredAdditions[0].addons[0]),o){this.selectedAddonId=o.id,this.cashOnDeliveryValue=t;const u={...this.categoryForm.get("options").value};u.selectedAddon=o.id,u.selectedOtherAddon="",u.cashOnDelivery=t;const g=o.id;setTimeout(()=>{const A=this.updateAddonFromForm(o);this.selectedFormOption=A,this.propagateChange([A]),this.cashOnDeliveryChanged.emit(this.getCashOnDelivery(A?.options?.value,g))}),this.selectedFormOption=o}else this.displayAdditionalFields=!1,this.propagateChange([])}else this.displayAdditionalFields=!1,this.propagateChange([]);else this.displayAdditionalFields=!1,this.propagateChange([])}}getValidationError(t){if(!this.isSelectedCashOnDelivery)return null;let n=this.translateService.instant("COMMON.ERRORS.INVALID");return"cashOnDelivery"===t&&(n=null,this.optionsServerErrors&&this.optionsServerErrors.value&&(n=this.optionsServerErrors.value)),n}getAddonsAtPrice(t,n=!0){let r=this.addonsCategory().addonsGroup.filter(o=>t===Number(this.minAddonValue)?t>=Number(o.addons[0].minValue)&&t<Number(o.addons[0].maxValue):(Number(this.maxAddonValue),t>Number(o.addons[0].minValue)&&t<=Number(o.addons[0].maxValue)));return n&&(r=r.sort((o,u)=>Number(o.addons[0].daysToReturn)<Number(u.addons[0].daysToReturn)?-1:Number(o.addons[0].daysToReturn)>Number(u.addons[0].daysToReturn)?1:0)),r}getAddonAtDaysToReturn(t,n){const r=t.find(o=>Number(o.addons[0].daysToReturn)===n);return r?.addons?.length?r.addons[0]:null}getDefaultDaysToReturn(t){if(t?.length){const n=t[0];if(n?.addons[0]?.daysToReturn)return n.addons[0].daysToReturn}return null}updateAddonFromForm(t){const n=this.categoryForm.get("cashOnDelivery").value,r=this.categoryForm.get("options").value,o={...t},u=this.categoryForm?.get("fields")?.value??null;return o.options.value=n,o.options.bankAccountNumber=r.bankAccountNumber,o.options.name=r.name,o.options.addressLine1=r.addressLine1,o.options.addressLine2=r.addressLine2,o.options.swiftCode=r?.swiftCode,o.fields=u,o}additionalFieldsValidityChanged(t,n){"options"===n&&(this.codOptionsValid=t),"fields"===n&&(this.categoryFieldsValid=t),this.validityChanged.emit(this.codOptionsValid&&this.categoryFieldsValid)}
1registerOnChange(t){this.propagateChange=t}writeValue(t){if(t?.length){const n=this.getAddonsAtPrice(Number(t[0].options.value)).map(r=>r.addons[0]).reduce((r,o)=>o.daysToReturn<r.daysToReturn?o:r);this.selectedAddonId=n.id,this.categoryForm.patchValue({cashOnDelivery:t[0].options.value,fields:t[0].fields,options:{addressLine1:t[0].options.addressLine1,addressLine2:t[0].options.addressLine2,bankAccountNumber:t[0].options.bankAccountNumber,swiftCode:t[0].options.swiftCode,cashOnDelivery:Number(t[0].options.value),name:t[0].options.name,selectedAddon:n.id,selectedOtherAddon:t[0].id===n.id?"":t[0].id},selectedCashOnDelivery:!0}),t[0].id!==n.id&&(this.cachedAddonToLoad=t[0].id)}}registerOnTouched(){}validate(t){this.optionsComponent&&this.optionsComponent.validate(t),this.fieldsComponent&&this.fieldsComponent?.validate(t)}loadCachedAddon(){this.cachedAddonToLoad&&this.optionsComponent&&this.categoryForm.get("options").value?.selectedOtherAddon!==this.cachedAddonToLoad&&(this.optionsComponent.onClickTiles(this.cachedAddonToLoad),this.cachedAddonToLoad=null)}getOptionServerErrors(){if(!this.addonsServerValidationErrors())return{};const n=this.getAddons().map(u=>u.id),r={};return"object"!=typeof this.addonsServerValidationErrors()||this.addonsServerValidationErrors().filter(u=>Ne()(n,u.addonId)).forEach(u=>r[u.fieldName]=u.message),r}checkCorrectionsData(){if(!this.isSelectedCashOnDelivery)return;const t=this.categoryForm.get("cashOnDelivery");return t.setValidators([m.k0.compose([m.k0.required,m.k0.min(this.minAddonValue),m.k0.max(this.maxAddonValue)])]),t.updateValueAndValidity(),t.valid?!this.isResolvingSelectedAddon&&(this.optionsComponent?(this.validateOptions=!0,this.optionsComponent.checkCorrectionsData()):void 0):(t.markAsTouched(),this.changeDetector.markForCheck(),!1)}setCashOnDeliveryStatus(t){this.store.dispatch(F.M.createSetShipmentOptionsAction({cashOnDelivery:t}))}getAddons(){return this.addonsCategory().addonsGroup.reduce((t,n)=>ht()(n.addons)?[...t,...n.addons]:[...t,n.addons],[])}setAddonsValueCurrency(){const t=this.getAddons();t?.length&&(this.addonsCurrencyValue=t[0]?.valueCurrency,this.cashOnDeliveryChanged.emit(this.getCashOnDelivery()))}getCashOnDelivery(t,n=this.selectedAddonId){return{number:t,isInsuranceRequired:this.getAddons().find(r=>r?.id===n)?.insuranceRequired,productAddonCurrency:this.addonsCurrencyValue}}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(m.ok),e.rXU(f.c$),e.rXU(v.il),e.rXU(e.gRc),e.rXU(be.o),e.rXU(Xt.x))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-cod-category"]],viewQuery:function(n,r){if(1&n&&(e.GBs(ot.N,5),e.GBs(Ii,5),e.GBs(We,5)),2&n){let o;e.mGM(o=e.lsd())&&(r.numberInputComponent=o.first),e.mGM(o=e.lsd())&&(r.optionsComponent=o.first),e.mGM(o=e.lsd())&&(r.fieldsComponent=o.first)}},inputs:{addonsCategory:[1,"addonsCategory"],addonsServerValidationErrors:[1,"addonsServerValidationErrors"],codValues:[1,"codValues"],codDraftValues:[1,"codDraftValues"]},outputs:{codValues:"codValuesChange",codDraftValues:"codDraftValuesChange",validityChanged:"validityChanged",inputValueChanged:"inputValueChanged",cashOnDeliveryChanged:"cashOnDeliveryChanged"},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.OA$,e.aNF],decls:21,vars:30,consts:[[3,"formGroup"],[1,"order-setup__field"],[1,"field"],[1,"order-setup__label"],[1,"label","order-setup--c-inherit"],[1,"order-setup__input","field","cod-category--margin"],[1,"checkbox"],["for","posting-cash-on-delivery",3,"ardnDataTestId"],["id","posting-cash-on-delivery","type","checkbox","formControlName","selectedCashOnDelivery",3,"checked","ardnDataTestId"],[1,"order-setup__input"],[1,"number-input-options"],["formControlName","cashOnDelivery","idName","cash-on-delivery",3,"click","maxFractionDigits","placeholder","showArrow","min","setMinValue","alwaysPropagateChange","isDisabled","ardnDataTestId"],[1,"input-validation",3,"clientSideValidation","clientErrorMessage","clientTranslationParams","serverSideValidation","ardnDataTestId"],["formControlName","options",3,"validityChanged","minAddonValue","maxAddonValue","serverValidationErrors","codValues","codDraftValues","filteredAdditions","unsortedAdditions","country","memorizedCODAddon","addonsCurrencyValue","ardnDataTestId"],["formControlName","fields",3,"fields","serverValidationErrors"],[1,"input-validation",3,"clientSideValidation","serverSideValidation"],["formControlName","fields",3,"validityChanged","fields","serverValidationErrors"]],template:function(n,r){1&n&&(e.j41(0,"div",0)(1,"fieldset",1)(2,"div",2)(3,"legend",3)(4,"span",4),e.EFF(5),e.nI1(6,"translate"),e.k0s()(),e.j41(7,"div",5)(8,"div",6)(9,"label",7),e.nrm(10,"input",8),e.j41(11,"span"),e.EFF(12),e.nI1(13,"translate"),e.k0s()()()()(),e.j41(14,"div",2),e.nrm(15,"div",3),e.j41(16,"div",9)(17,"div",10)(18,"ardn-number-input",11),e.bIt("click",function(){return r.onClickCashOnDelivery()}),e.k0s()(),e.nrm(19,"ardn-field-validator",12),e.k0s()(),e.DNE(20,Ls,3,14),e.k0s()()),2&n&&(e.Y8G("formGroup",r.categoryForm),e.R7$(5),e.SpI(" ",e.i5U(6,20,"PRODUCT_ADDONS.CASH_ON_DELIVERY",e.eq3(25,xs,r.addonsCurrencyValue))," "),e.R7$(4),e.Y8G("ardnDataTestId","ardn-product-addon-cod-category-form-selectedCashOnDelivery-label"),e.R7$(),e.Y8G("checked",r.isSelectedCashOnDelivery)("ardnDataTestId","ardn-product-addon-cod-category-form-selectedCashOnDelivery-input"),e.R7$(2),e.JRh(e.bMT(13,23,"PRODUCT_ADDONS.POSTING_CASH_ON_DELIVERY")),e.R7$(6),e.Y8G("maxFractionDigits",r.cashOnDeliveryPrecision)("placeholder",r.getPlaceholder())("showArrow",!1)("min",r.minAddonValue)("setMinValue",!1)("alwaysPropagateChange",!0)("isDisabled",!r.addonsExists())("ardnDataTestId","ardn-product-addon-cod-category-form-selectedCashOnDelivery-ardn-number-input"),e.R7$(),e.Y8G("clientSideValidation",r.categoryForm.get("cashOnDelivery"))("clientErrorMessage","PRODUCT_ADDONS.OPTIONS.COD_VALUE_MAX")("clientTranslationParams",e.l_i(27,Us,r.getAddonsMaxValue()?r.getAddonsMaxValue():0,r.add
1onsCurrencyValue))("serverSideValidation",r.getValidationError("cashOnDelivery"))("ardnDataTestId","ardn-product-addon-cod-category-form-cashOnDelivery-field-validator"),e.R7$(),e.vxM(r.displayAdditionalFields?20:-1))},dependencies:[ot.N,Z.Z,ye.Q,Ii,f.h,f.D9,m.X1,m.Zm,m.BC,m.cb,m.j4,m.JD,We],styles:[".cod-category--margin[_ngcontent-%COMP%]{margin-bottom:5px}"]})}}return i})();var js=s(54084),ws=s.n(js),Bs=s(33813),Xs=s.n(Bs),ro=s(56331);function Ys(i,p){1&i&&(e.j41(0,"div",1)(1,"div",3),e.EFF(2,"Loading..."),e.k0s()())}function Ws(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.j41(3,"span",18),e.EFF(4),e.nI1(5,"translate"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,2,"TOOLTIP.NOT_STANDARD_PALLET_CONTENT_2")),e.R7$(3),e.JRh(e.bMT(5,4,"TOOLTIP.COURIER_MESSAGE_PALLET")))}function Hs(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.DNE(3,Ws,6,6)),2&i){const t=e.XpG(3);e.R7$(),e.JRh(e.bMT(2,2,"TOOLTIP.NOT_STANDARD_PALLET_CONTENT_1")),e.R7$(2),e.vxM(t.isExpandedPackageInfo?3:-1)}}function zs(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.j41(3,"b"),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"span"),e.EFF(7),e.nI1(8,"translate"),e.k0s(),e.j41(9,"span",18),e.EFF(10),e.nI1(11,"translate"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,4,"TOOLTIP.NOT_STANDARD_PARCEL_CONTENT_2")),e.R7$(3),e.JRh(e.bMT(5,6,"TOOLTIP.NOT_STANDARD_PARCEL_CONTENT_3")),e.R7$(3),e.JRh(e.bMT(8,8,"TOOLTIP.NOT_STANDARD_PARCEL_CONTENT_4")),e.R7$(3),e.JRh(e.bMT(11,10,"TOOLTIP.COURIER_MESSAGE_PARCEL")))}function Ks(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.DNE(3,zs,12,12)),2&i){const t=e.XpG(3);e.R7$(),e.JRh(e.bMT(2,2,"TOOLTIP.NOT_STANDARD_PARCEL_CONTENT_1")),e.R7$(2),e.vxM(t.isExpandedPackageInfo?3:-1)}}function Qs(i,p){if(1&i&&(e.j41(0,"div",16),e.nrm(1,"ardn-picture",19),e.nI1(2,"translate"),e.k0s()),2&i){const t=p.$implicit;e.R7$(),e.Y8G("mainImageSource","/assets/img/packages/"+t.source+".webp")("fallbackImageSource","/assets/img/packages/"+t.source+".jpg")("altDescription",e.bMT(2,5,t.altDescription))("width",80)("height",80)}}function Js(i,p){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"div",12)(2,"div",13),e.DNE(3,Hs,4,4)(4,Ks,4,4),e.j41(5,"a",14),e.bIt("click",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onClickShowMore())}),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"div",15),e.Z7z(9,Qs,3,7,"div",16,e.fX1),e.k0s()(),e.j41(11,"div",13)(12,"a",17),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.EFF(15),e.nI1(16,"translate"),e.k0s()()()}if(2&i){const t=e.XpG(2);e.R7$(3),e.vxM(t.isPalette?3:4),e.R7$(3),e.JRh(e.bMT(7,4,t.isExpandedPackageInfo?"TOOLTIP.HIDE_CONTENT":"TOOLTIP.SHOW_MORE_CONTENT")),e.R7$(3),e.Dyx(t.addonImages),e.R7$(4),e.JRh(e.bMT(14,6,"TOOLTIP.MORE_DETAILS_1")),e.R7$(2),e.SpI(" ",e.bMT(16,8,"TOOLTIP.MORE_DETAILS_2")," ")}}function Zs(i,p){1&i&&(e.j41(0,"div")(1,"p",20),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&i&&(e.R7$(2),e.JRh(e.bMT(3,1,"COMMON.ERRORS.REQUIRED")))}function qs(i,p){if(1&i&&(e.j41(0,"div",11),e.nrm(1,"ardn-product-addon-category",21),e.k0s()),2&i){const t=e.XpG(2);e.Y8G("formGroup",t.nonStandardsForm),e.R7$(),e.Y8G("compact",!0)("addonsCategory",t.addonsCategory())("ardnDataTestId","ardn-product-addon-category")}}function ea(i,p){if(1&i){const t=e.RV6();e.j41(0,"fieldset",2)(1,"legend",4)(2,"span",5),e.EFF(3),e.nI1(4,"translate"),e.j41(5,"span",6),e.EFF(6,"*"),e.k0s()()(),e.j41(7,"div",7)(8,"div",8)(9,"span",9)(10,"ardn-product-addon-radio",10),e.bIt("stateEmitter",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.handleRadioAddonCompletion())}),e.k0s()(),e.DNE(11,Js,17,10,"div")(12,Zs,4,3,"div"),e.k0s(),e.DNE(13,qs,2,4,"div",11),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(3),e.SpI("",e.bMT(4,11,"ORDER_PAGE.SHIPMENT_TYPE")," "),e.R7$(5),e.Y8G("formGroup",t.shipmentTypeForm),e.R7$(2),e.Y8G("formControlName","selectedAddon")("addons",t.addons)("showPrice",!1)("defaultSelected",t.disableSelect)("cachedChosenRadio",t.orderService.cachedShipmentType)("ardnDataTestId","ardn-product-addon-radio"),e.R7$(),e.vxM(t.addonName===t.nonStandardAddonName?11:-1),e.R7$(),e.vxM(!t.isDisabledSelectAndValidOnLoad&&t.shipmentTypeCategoryChanges?12:-1),e.R7$(),e.vxM(t.showNonStandardsForm()?13:-1)}}let Mi=(()=>{class i{constructor(t,n,r,o,u,g,A){this.orderService=t,this.formBuilder=n,this.translateService=r,this.wordpressService=o,this.changeDetector=u,this.store=g,this.translate=A,this.validityChanged=(0,e.CGW)(),this.addonsCategory=(0,e.geq)(),this.shipmentTypeCategoryChanges=!0,this.isDisabledSelectAndValidOnLoad=!0,this.addonsLoader=!1,this.nonStandardAddonName=this.translate.instant("PRODUCT_ADDONS.OPTIONS.NON_STANDARD_PARCEL_SHIPMENT_TYPE"),this.addonParcelImages=[{source:"karton_nieregularny",altDescription:"TOOLTIP.ALT_DESCRIPTIONS.IRREGULAR_CARDBOARD"},{source:"tuba",altDescription:"TOOLTIP.ALT_DESCRIPTIONS.TUBE"},{source:"karton_znieksztalcony",altDescription:"TOOLTIP.ALT_DESCRIPTIONS.DISTORTED_CARDBOARD"},{source:"polaczone_kartony",altDescription:"TOOLTIP.ALT_DESCRIPTIONS.CONNECTED_CARDBOARDS"},{source:"karton_ze_stretchem",altDescription:"TOOLTIP.ALT_DESCRIPTIONS.CARDBOARD_WITH_STRETCH"},{source:"karton_znieksztalcony_2",altDescription:"TOOLTIP.ALT_DESCRIPTIONS.DISTORTED_CARDBOARD_2"},{source:"cztery_opony",altDescription:"TOOLTIP.ALT_DESCRIPTIONS.FOUR_TYRES"}],this.addonPaletteImages=[{source:"paleta_niestandardowa",altDescription:"TOOLTIP.ALT_DESCRIPTIONS.NON_STANDARD_PALETTE"}],this.isExpandedPackageInfo=!0,this.isShipmentTypeSet=!1,this.isPalette=!1,this.standardShipmentAddonId=-1,this.prop
1agateChange=()=>{}}ngOnInit(){this.addonsLoader=!0,this.store?.select(T.t6)?.pipe((0,U.p)(t=>!!t)).subscribe(t=>{this.isPalette="PALLET"===t.packageType,this.nonStandardAddonName=this.translate.instant(this.isPalette?"PRODUCT_ADDONS.OPTIONS.NON_STANDARD_PALLET_SHIPMENT_TYPE":"PRODUCT_ADDONS.OPTIONS.NON_STANDARD_PARCEL_SHIPMENT_TYPE"),this.addonImages=this.isPalette?this.addonPaletteImages:this.addonParcelImages}),this.getMessageFromWP(32227,()=>{this.getMessageFromWP(32231,t=>{this.createAddons(t)})})}handleRadioAddonCompletion(){this.store?.select(ct.J)?.pipe(Ri(t=>t?.order?.selectedProduct?.addonsAreLoaded)).subscribe(t=>{const n=t.order?.shipmentTemp;this.orderService.cachedShipmentType.value&&setTimeout(()=>{this.setCachedShipmentType()}),n&&setTimeout(()=>{this.setMemorizedShipmentStatus(n)})})}onClickShowMore(){this.isExpandedPackageInfo=!this.isExpandedPackageInfo}setCachedShipmentType(){const t=this.orderService.cachedShipmentType.value;let n=this.addons.find(r=>r.id===t);!n&&t!==this.standardShipmentAddonId&&(n=this.addons.find(r=>r.id!==this.standardShipmentAddonId)),this.shipmentTypeForm.get("shipmentType.selectedAddon").setValue(n)}setMemorizedShipmentStatus(t){const n=t.addons.filter(o=>"NOT_STANDARD"===o.category),r=t.addons.filter(o=>"NOT_STANDARD"!==o.category);0===n.length&&!this.disableSelect&&this.shipmentTypeForm.get("shipmentType.selectedAddon").patchValue(this.standardShipmentAddonId),ht()(n)&&0!==n.length&&this.shipmentTypeForm.get("shipmentType.selectedAddon").value.id!==n[0].id&&this.shipmentTypeForm.get("shipmentType.selectedAddon").patchValue(n[0].id),this.nonStandardAddons.forEach(o=>{o.checked=!!r.includes(o)}),this.shipmentTypeForm.updateValueAndValidity()}getMessageFromWP(t,n){this.wordpressService.getWithSeparatorHr(t).subscribe({next:r=>n(r),error:()=>{n()}})}createAddons(t=null){this.initAddons(t),this?.addons?.filter(n=>{n.addonName===this.nonStandardAddonName&&(this.addonName=n.addonName)}),this.addonsLoader=!1,this.changeDetector.detectChanges()}initAddons(t){this.addonsCategory.set(this.sortAddonsCategory(this.addonsCategory())),this.addons=this.getAddonsWithStandardShipmentOption(t),this.nonStandardAddons=this.getNonStandardAddons(),this.shipmentTypeForm=this.formBuilder.group({shipmentType:this.createRadioFormGroup(this.addons)}),this.nonStandardsForm=this.formBuilder.group({nonStandards:new m.MJ([])}),this.shipmentTypeForm.get("shipmentType").setValidators(m.k0.required),this.shipmentTypeForm.get("shipmentType").updateValueAndValidity(),this.shipmentTypeForm.get("shipmentType").valueChanges.subscribe(n=>{const r=n.selectedAddon,o=this.selectedNonStandard(r);this.selectedAddon=r,!this.disableSelect&&this.isDisabledSelectAndValidOnLoad?(this.validityChanged.emit(!1),this.isDisabledSelectAndValidOnLoad=!1):(this.validityChanged.emit(!0),this.shipmentTypeCategoryChanges=!1),!this.disableSelect&&!this.isShipmentTypeSet&&!this.shipmentTypeCategoryChanges&&(this.isExpandedPackageInfo=!1,this.isShipmentTypeSet=!0),1===this.nonStandardAddons.length&&o&&this.propagateChange([r]),o||this.propagateChange([])}),this.nonStandardsForm.get("nonStandards").valueChanges.subscribe(n=>{this.propagateChange(n||[])})}getNonStandardAddons(){const t=Object.assign({},this.addonsCategory()),n=[];if(t?.addonsGroup)for(const r of t.addonsGroup){const o=Array.isArray(r.addons)?r.addons[0]:r.addons;n.push(Object.assign({},o))}return n}getAddonsWithStandardShipmentOption(t){const n=this.createStandardShipmentOption(),r=this.parseNonStandardAddons(t),o=[];return o.push(n),r?(o.push(r),r.isRequired&&(n.disabled=!0,r.checked=!0),this.disableSelect=o.some(u=>u.checked||u.disabled)):this.disableSelect=!0,o}parseNonStandardAddons(t){if(!this.addonsCategory()||!this.addonsCategory().addonsGroup)return;const n=Object.assign({},this.addonsCategory()),r=[];if(n)for(const o of n.addonsGroup){const u=Array.isArray(o.addons)?o.addons[0]:o.addons;r.push(Object.assign({},u))}return 0!==r.length?(1===r.length?r[0].additionalInfo=r[0].addonName:r[0].price=void 0,r.some(o=>o.isRequired)&&(r[0].isRequired=!0),r[0].addonName=this.translate.instant(this.isPalette?"PRODUCT_ADDONS.OPTIONS.NON_STANDARD_PALLET_SHIPMENT_TYPE":"PRODUCT_ADDONS.OPTIONS.NON_STANDARD_PARCEL_SHIPMENT_TYPE"),r[0].description=null,t&&(r[0].options={addonDescription:null,addonDescriptionExp:null}),r[0]):void 0}selectedNonStandard(t){return t?.id!==this.standardShipmentAddonId}createStandardShipmentOption(){return{id:this.standardShipmentAddonId,addonName:this.translate.instant(this.isPalette?"PRODUCT_ADDONS.OPTIONS.STANDARD_PALLET_SHIPMENT_TYPE":"PRODUCT_ADDONS.OPTIONS.STANDARD_PARCEL_SHIPMENT_TYPE"),price:0,priceGross:0,minValue:null,maxValue:null,category:"NOT_STANDARD",isRequired:!1,checked:!1,verificationRequired:!1,options:{addonDescription:null,addonDescriptionExp:null},currency:null,valueCurrency:null,insuranceRequired:!1}}createRadioFormGroup(t){return this.formBuilder.group({selectedAddon:t[1]?.isRequired?t[1]:"",addons:[t]})}sortAddonsCategory(t){if(!t)return;const n=Object.assign({},t);return n.addonsGroup&&n.addonsGroup.sort(r=>r.addons[0].isRequired?-1:1),n}showNonStandardsForm(){return this.nonStandardAddons.length>1&&this.selectedAddon?.id!==this.standardShipmentAddonId}getAddons(){return this.addons}
1registerOnChange(t){this.propagateChange=t}writeValue(){}registerOnTouched(){}validate(){return this.shipmentTypeForm?.markAsTouched({onlySelf:!0}),!(!this.isDisabledSelectAndValidOnLoad&&this.shipmentTypeCategoryChanges)&&(this.shipmentTypeForm?.valid||!1)}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(K.Q),e.rXU(m.ok),e.rXU(f.c$),e.rXU(ro.B),e.rXU(e.gRc),e.rXU(v.il),e.rXU(f.c$))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-shipment-type-category"]],inputs:{addonsCategory:[1,"addonsCategory"]},outputs:{validityChanged:"validityChanged",addonsCategory:"addonsCategoryChange"},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.aNF],decls:3,vars:2,consts:[[1,"slim-controls"],[1,"loader--center"],[1,"order-setup__field","order-setup__field--info"],[1,"loader","loader--green"],[1,"order-setup__label"],["for","o4-package-content",1,"label"],[1,"label--required"],[1,"order-setup__input"],[3,"formGroup"],["formGroupName","shipmentType"],[3,"stateEmitter","formControlName","addons","showPrice","defaultSelected","cachedChosenRadio","ardnDataTestId"],[1,"order-setup__input-side",3,"formGroup"],[1,"html-tooltip-container"],[1,"package-info-content"],[1,"package-info-content-show-hide",3,"click"],[1,"html-tooltip-container","display-flex"],[1,"package-info-img-container"],["href","https://www.globkurier.pl/porady/przesylka-niestandardowa-najwazniejsze-informacje","target","_blank",1,"standard-package-info-content-read-more"],[1,"package-info-underline"],[3,"mainImageSource","fallbackImageSource","altDescription","width","height"],[1,"form-error"],["formControlName","nonStandards",3,"compact","addonsCategory","ardnDataTestId"]],template:function(n,r){1&n&&(e.j41(0,"div",0),e.DNE(1,Ys,3,0,"div",1)(2,ea,14,13,"fieldset",2),e.k0s()),2&n&&(e.R7$(),e.vxM(r.addonsLoader?1:-1),e.R7$(),e.vxM(r.addonsLoader?-1:2))},dependencies:[f.h,f.D9,m.X1,m.BC,m.cb,m.j4,m.JD,m.$R,rt,Z.Z,On.W,kn],styles:[".slim-controls[_ngcontent-%COMP%]   .order-setup__field[_ngcontent-%COMP%]{padding-bottom:8px}.slim-controls[_ngcontent-%COMP%]     .radio{margin-bottom:5px}.slim-controls[_ngcontent-%COMP%]   .order-setup__input[_ngcontent-%COMP%]   .form-error[_ngcontent-%COMP%]{margin:5px 0 10px}.slim-controls[_ngcontent-%COMP%]   .loader--center[_ngcontent-%COMP%]{text-align:center}@media only screen and (min-width: 40.0625em){.slim-controls[_ngcontent-%COMP%]   .loader--center[_ngcontent-%COMP%]{margin:1rem 1rem 1rem 34%}}",".tooltipster-close[_ngcontent-%COMP%]{pointer-events:all;position:absolute;right:5px;top:5px;cursor:pointer}.info-icon.html-tooltip[_ngcontent-%COMP%]{position:absolute;right:0;top:0}.html-tooltip-container[_ngcontent-%COMP%]{max-width:700px;pointer-events:all}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-title[_ngcontent-%COMP%]{text-transform:uppercase;font-weight:700;font-size:14px}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]{line-height:1.7}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   .standard-package-info-content-read-more[_ngcontent-%COMP%]{text-decoration:underline;font-style:italic;cursor:pointer;white-space:nowrap}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   .package-info-content-show-hide[_ngcontent-%COMP%]{margin-left:4px;text-decoration:underline;cursor:pointer;white-space:nowrap}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   .package-info-underline[_ngcontent-%COMP%]{text-decoration:underline}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   .package-info-img-container[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{max-width:80px}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{list-style:disc;margin-left:20px}.display-flex[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}"]})}}return i})();var io=s(27659),je=function(i){return i.SENDER="SENDER",i.RECEIVER="RECEIVER",i}(je||{}),ta=s(6922),Fi=s(28643),Pt=s(90202);const na=i=>({currency:i}),ra=i=>({field:i}),ia=(i,p,t)=>({min:i,max:p,currency:t});function oa(i,p){if(1&i&&(e.j41(0,"div",7),e.EFF(1),e.nI1(2,"ardnCurrency"),e.k0s()),2&i){const t=e.XpG(2);e.Y8G("ardnDataTestId","ardn-product-addon-declared-value-category-from-customs-value"),e.R7$(),e.SpI(" ",e.i5U(2,2,t.customsValue(),t.customsCurrency())," ")}}
1function sa(i,p){1&i&&(e.j41(0,"div",8),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.Y8G("ardnDataTestId","ardn-product-addon-declared-value-category-from-customs-hint"),e.R7$(),e.SpI(" ",e.bMT(2,2,"PRODUCT_ADDONS.DECLARED_VALUE_FILL_CUSTOMS_FIRST")," "))}function aa(i,p){1&i&&(e.j41(0,"div",9),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.Y8G("ardnDataTestId","ardn-product-addon-declared-value-category-from-customs-error"),e.R7$(),e.SpI(" ",e.bMT(2,2,"PRODUCT_ADDONS.DECLARED_VALUE_FROM_CUSTOMS_OUT_OF_RANGE")," "))}function da(i,p){if(1&i&&(e.j41(0,"div",2)(1,"legend",3)(2,"span",4),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"div",5)(6,"span",6),e.EFF(7),e.nI1(8,"translate"),e.nI1(9,"translate"),e.k0s(),e.DNE(10,oa,3,5,"div",7)(11,sa,3,4,"div",8)(12,aa,3,4,"div",9),e.k0s()()),2&i){const t=e.XpG();e.R7$(3),e.SpI(" ",e.bMT(4,6,"PRODUCT_ADDONS.DECLARED_VALUE_SHIPMENT")," "),e.R7$(3),e.Y8G("ardnDataTestId","ardn-product-addon-declared-value-category-from-customs-label"),e.R7$(),e.Lme(" ",e.bMT(8,8,"PRODUCT_ADDONS.DECLARED_VALUE_SHIPMENT")," ",e.bMT(9,10,"PRODUCT_ADDONS.DECLARED_VALUE_FROM_CUSTOMS")," "),e.R7$(3),e.vxM(t.isCustomsFilled()?10:11),e.R7$(2),e.vxM(t.isCustomsDrivenValueUnresolved?12:-1)}}function la(i,p){1&i&&(e.j41(0,"p",17),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.ERRORS.REQUIRED")," "))}function ca(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",2)(1,"legend",3)(2,"span",4),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"div",10)(6,"div",11)(7,"label",12)(8,"input",13),e.bIt("click",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.onClickCheckboxDeclaredValue(r))}),e.k0s(),e.j41(9,"span"),e.EFF(10),e.nI1(11,"translate"),e.k0s()()()()(),e.j41(12,"div",2),e.nrm(13,"div",3),e.j41(14,"div",14)(15,"div",15)(16,"ardn-number-input",16),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.onClickDeclaredValue())}),e.k0s()(),e.DNE(17,la,3,3,"p",17),e.nrm(18,"ardn-field-validator",18),e.k0s()()}if(2&i){let t;const n=e.XpG();e.R7$(3),e.SpI(" ",e.i5U(4,21,"PRODUCT_ADDONS.DECLARED_VALUE",e.eq3(26,na,n.addonsCurrencyValue))," "),e.R7$(2),e.Y8G("ngClass",e.eq3(28,ra,!n.isDeclaredValueCheckboxDisabled||!!n.getMaxFreeDeclaredValueAddons())),e.R7$(2),e.Y8G("ardnDataTestId","ardn-product-addon-declared-value-category-form-checkbox-insurance-label"),e.R7$(),e.Y8G("checked",n.isSelectedCheckboxDeclaredValue)("disabled",n.isDeclaredValueCheckboxDisabled)("ardnDataTestId","ardn-product-addon-declared-value-category-form-checkbox-insurance-input"),e.R7$(2),e.JRh(e.bMT(11,24,"PRODUCT_ADDONS.DECLARED_VALUE_SHIPMENT")),e.R7$(6),e.Y8G("maxFractionDigits",n.declaredValuePrecision)("placeholder",n.getPlaceholder(n.isSelectedCheckboxDeclaredValue))("showArrow",!1)("min",n.minDeclaredValue)("alwaysPropagateChange",!0)("isDisabled",!n.addonsExists())("setMinValue",!1)("ardnDataTestId","ardn-product-addon-declared-value-category-form-declaredValue-ardn-number-input"),e.R7$(),e.vxM(null!=n.declaredValueCategoryForm&&null!=(t=n.declaredValueCategoryForm.get("declaredValue").errors)&&t.required?17:-1),e.R7$(),e.Y8G("clientSideValidation",n.declaredValueCategoryForm.get("declaredValue"))("clientErrorMessage","PRODUCT_ADDONS.OPTIONS.COD_VALUE_MIN_MAX_ERROR")("clientTranslationParams",e.sMw(30,ia,n.minDeclaredValue,n.maxDeclaredValue,n.addonsCurrencyValue))("serverSideValidation",null==n.optionsServerErrors?null:n.optionsServerErrors["[value]"])("ardnDataTestId","ardn-product-addon-declared-value-category-form-declaredValue-ardn-number-field-validator")}}function ua(i,p){if(1&i&&e.nrm(0,"ardn-product-addon-additional-info",21),2&i){const t=e.XpG().$implicit;e.Y8G("content",t.additionalInfo)("price",t.price)("currency",t.currency)("ardnDataTestId","ardn-product-addon-declared-value-category-form-selectedAddonRadio-"+(null==t?null:t.id)+"-ardn-product-addon-additional-info")}}function pa(i,p){if(1&i&&(e.j41(0,"span",23),e.nI1(1,"translate"),e.EFF(2,"i"),e.k0s()),2&i){const t=e.XpG().$implicit;e.Y8G("ardnTooltipster",e.bMT(1,1,"TOOLTIP."+t.tooltip))}}function ha(i,p){if(1&i&&(e.j41(0,"span",23),e.EFF(1,"i"),e.k0s()),2&i){const t=e.XpG().$implicit;e.Y8G("ardnTooltipster",t.description)}}function ma(i,p){if(1&i&&(e.j41(0,"div",25),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.JRh(t.priceDescription)}}function ga(i,p){if(1&i&&(e.j41(0,"div",19)(1,"label"),e.nrm(2,"input",20),e.j41(3,"span"),e.EFF(4),e.k0s()(),e.DNE(5,ua,1,4,"ardn-product-addon-additional-info",21),e.j41(6,"div",22),e.DNE(7,pa,3,3,"span",23)(8,ha,2,1,"span",23),e.nrm(9,"ardn-product-addon-price",24),e.k0s(),e.DNE(10,ma,2,1,"div",25),e.k0s()),2&i){const t=p.$implicit;e.R7$(2),e.Y8G("value",t.id)("ardnDataTestId","ardn-product-addon-declared-value-category-form-selectedAddonRadio-"+(null==t?null:t.id)+"-input"),e.BMQ("disabled",t.disabled)("checked",t.checked),e.R7$(2),e.JRh(t.addonName),e.R7$(),e.vxM(t.additionalInfo?5:-1),e.R7$(2),e.vxM(t.tooltip?7:-1),e.R7$(),e.vxM(t.description?8:-1),e.R7$(),e.Y8G("addonPrice",t.price)("addonInPrice",t.inPrice)("currency",t.currency)("ardnDataTestId","ardn-product-addon-declared-value-category-form-selectedAddonRadio-"+(null==t?null:t.id)+"-ardn-product-addon-price"),e.R7$(),e.vxM(t.priceDescription?10:-1)}}function fa(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-category-fields",26),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.additionalFieldsValidityChanged(r,"fields"))}),e.k0s(),e.nrm(1,"ardn-field-validator",27)}if(2&i){let t;const n=e.XpG(2);e.Y8G("fields",null==(t=n.addonsCategory())?null:t.fields)("serverValidationErrors",n.optionsServerErrors),e.R7$(),e.Y8G("clientSideValidation",n.declaredValueCategoryForm.get("fields"))("serverSideValidation",null==n.optionsServerErrors?null:n.optionsServerErrors.fields)}}function Ca(i,p){if(1&i&&(e.j41(0,"div",2),e.nrm(1,"div",3),e.j41(2,"div",14),e.Z7z(3,ga,11,13,"div",19,e.fX1),e.k0s()(),e.DNE(5,fa,2,4)),2&i){let t;const n=e.XpG();e.R7$(3),e.Dyx(n.selectedAddons()),e.R7$(2),e.vxM(null!=(t=n.addonsCategory())&&null!=t.fields&&t.fields.length&&n.isSelectedCheckboxDeclaredValue?5:-1)}}function _a(i,p){if(1&i&&(e.j41(0,"div",2),e.nrm(1,"div",3),e.j41(2,"div",14)(3,"p",28),e.EFF(4),e.k0s()()()),2&i){const t=e.XpG();e.R7$(4),e.SpI(" ",t.getGeneralFieldServerError()," ")}}let $i=(()=>{class i{constructor(t,n,r,o,u,g,A,N){this.store=t,this.formBuilder=n,this.translateService=r,this.scrollService=o,this.addonsService=u,this.currencyPrecisionService=g,this.orderCustomsService=A,this.changeDetector=N,this.validityChanged=(0,e.CGW)(),this.inputValueChanged=(0,e.CGW)(),this.addonsCategory=(0,e.hFB
1)(),this.serverValidationErrors=(0,e.hFB)(),this.optionsServerErrors={},this.generalFieldServerError={general:[],fields:{}},this.selectedFromDraft=!1,this.selectedAddons=(0,e.vPA)([]),this.minDeclaredValue=0,this.maxDeclaredValue=Number.MAX_SAFE_INTEGER,this.isDeclaredValueCheckboxDisabled=!1,this.isSelectedCheckboxDeclaredValue=!1,this.isCustomsDrivenValueUnresolved=!1,this.declaredValueValueValid=!1,this.categoryFieldsValid=!1,this.dataFromDraft=!1,this.customsDrivenApplied=!1,this.customsDrivenValueUnresolvedFor=null,this.destroyRef=(0,e.WQX)(e.abz),this.propagateChange=()=>{},this.orderCurrency=(0,z.ot)(this.store.select(T.ig),{initialValue:null}),this.customs=(0,z.ot)(this.store.select(T.pu),{initialValue:null}),this.customsValue=(0,e.EWP)(()=>this.orderCustomsService.getTotalValue(this.customs())),this.customsCurrency=(0,e.EWP)(()=>this.orderCustomsService.getCurrency(this.customs())),this.customsConfig=(0,z.ot)(this.orderCustomsService.orderCustomsConfig$,{initialValue:null}),this.isCustomsAvailable=(0,e.EWP)(()=>!!this.customsConfig()),this.isCustomsFilled=(0,e.EWP)(()=>!!this.customsValue()),(0,e.QZP)(()=>{this.currencyPrecisionService.currencies(),this.changeDetector.markForCheck()}),(0,e.QZP)(()=>{const w=this.isCustomsAvailable(),te=this.orderCustomsService.getTotalValue(this.customs());this.declaredValueCategoryForm&&(w&&te?(this.applyCustomsDrivenValue(te),this.customsDrivenApplied=!0):w?(this.awaitCustomsDeclaration(),this.customsDrivenApplied=!0):this.customsDrivenApplied&&(this.releaseCustomsDrivenValue(),this.customsDrivenApplied=!1),this.changeDetector.markForCheck())},{allowSignalWrites:!0})}get declaredValuePrecision(){return this.currencyPrecisionService.getPrecision(this.orderCurrency())}ngOnChanges(){this.isSelectedCheckboxDeclaredValue?(this.optionsServerErrors=this.getServerErrors(),this.generalFieldServerError={general:[],fields:{}},this.optionsServerErrors["[value]"]&&this.declaredValueCategoryForm.get("declaredValue").touched&&this.scrollService.scrollToFieldId("declaredValue")):(this.generalFieldServerError=this.serverValidationErrors(),this.optionsServerErrors={},this.declaredValueCategoryForm&&(this.declaredValueCategoryForm.get("declaredValue").setValue(""),this.declaredValueCategoryForm.get("declaredValue").setValidators([]),this.declaredValueCategoryForm.get("declaredValue").updateValueAndValidity(),this.declaredValueCategoryForm?.get("fields")?.reset(),this.additionalFieldsValidityChanged(!0,"fields")))}ngOnInit(){const t=this.getAddonsFromAddonsCategory();this.addonsCurrencyValue=this.getAddonsValueCurrency(),this.minDeclaredValue=this.addonsService.getAddonsRangeValue("min",t),this.maxDeclaredValue=this.addonsService.getAddonsRangeValue("max",t),this.selectedAddons.set([]),this.buildAddonsForm(),this.dataFromDraft||this.isRequiredAddons()&&this.setDefaultValueToDeclaredValue(),this.addonsExists()&&this.addonsCategory().addonsGroup?.[0]?.addons?.[0]?.isRequired&&(this.applyDeclaredValueValidators(),this.declaredValueCategoryForm.get("declaredValue")?.updateValueAndValidity(),this.validityChanged.emit(this.declaredValueCategoryForm.get("declaredValue").valid)),this.declaredValueCategoryForm.get("declaredValue").valueChanges.pipe((0,ce.B)(300),(0,z.pQ)(this.destroyRef)).subscribe(n=>{if(this.isCustomsAvailable())return;const r=this.declaredValueCategoryForm.get("declaredValue").valid,o=n?Number(n):null;if(this.additionalFieldsValidityChanged(r,"declaredValue"),this.declaredValueCategoryForm?.get("fields")||this.additionalFieldsValidityChanged(!0,"fields"),r&&Number(o)){this.inputValueChanged.emit(o);const g=this.getAddons(o,!1);if(this.selectedAddons.set(g),o>9)g&&g.length&&(this.declaredValueCategoryForm.get("selectedAddonRadio").setValue(g[0].id),g[0].fields=this.declaredValueCategoryForm?.get("fields")?.value),this.propagateChange(g);else if(o<10){if(!g||!g.length)return void this.propagateChange([]);this.declaredValueCategoryForm.get("selectedAddonRadio").setValue(g[0].id),g[0].fields=this.declaredValueCategoryForm?.get("fields")?.value,this.propagateChange(g)}}else this.resetAddons()}),this.declaredValueCategoryForm.get("declaredValue").valueChanges.pipe((0,ce.B)(2e3),(0,z.pQ)(this.destroyRef)).subscribe(n=>
1{if(this.isCustomsAvailable())return;const r=this.declaredValueCategoryForm.get("declaredValue").valid,o=n?Number(n):null;if(this.additionalFieldsValidityChanged(r,"declaredValue"),this.declaredValueCategoryForm?.get("fields")||this.additionalFieldsValidityChanged(!0,"fields"),r&&Number(o)&&o<10){const g=this.getAddons(o);this.selectedAddons.set(g),g&&g.length?(this.declaredValueCategoryForm.get("selectedAddonRadio").setValue(g[0].id),g[0].fields=this.declaredValueCategoryForm?.get("fields")?.value,this.propagateChange(g)):this.propagateChange([])}}),this.declaredValueCategoryForm?.get("fields")?.valueChanges.pipe((0,ce.B)(50),(0,j.F)(E()),(0,z.pQ)(this.destroyRef)).subscribe(n=>{const r=this.selectedAddons();r?.length&&(r[0].fields=n,this.propagateChange(r))}),(0,q.z)([this.store.select(T.PE),this.store.select(mt.pO??null)]).pipe((0,j.F)(E()),(0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(([n,r])=>{let o=null;if(r&&(o=r.filter(u=>u.draft.orderDraftId===n.orderDraftId)[0]),o?.draft?.addons&&o){const u=this.addonsCategory().addonsGroup.map(A=>A.addons).reduce((A,N)=>A.concat(N)),g=o.draft.addons.find(A=>"DECLARED_VALUE"===A.category);u?.length&&g?.value&&(this.dataFromDraft=!0,this.setAddonsFromDraft(g.value))}}),this.store.select(T.cd).pipe((0,U.p)(n=>!!n&&!n.loading),(0,z.pQ)(this.destroyRef)).subscribe(n=>{this.isCustomsAvailable()?this.isCustomsFilled()&&this.adoptPricedDeclaredValueAddon(n.components?.addons??[]):!this.selectedAddons().length||!n.components?.addons?.length||this.selectedAddons.update(r=>r.map(o=>{const u=n.components.addons.find(g=>g.id===o.id);return u?{...o,price:u.price,priceGross:u.priceGross}:o}))})}ngAfterViewInit(){this.store.select(T.Nk).pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(t=>{const n=t.filter(r=>"DECLARED_VALUE"===r.category)[0];n&&this.setMemorizedDeclaredValue(n)})}onClickCheckboxDeclaredValue(t){this.isSelectedCheckboxDeclaredValue=t.target.checked,this.selectedAddons.set([]);const r=this.declaredValueCategoryForm.get("declaredValue"),o=[];this.addonsExists()&&this.addonsCategory().addonsGroup?.[0]?.addons?.[0]?.isRequired&&o.push(m.k0.required),this.isSelectedCheckboxDeclaredValue?o.push(m.k0.min(this.minDeclaredValue),m.k0.max(this.maxDeclaredValue)):(r?.setValue(""),this.propagateChange([]),this.declaredValueCategoryForm?.get("fields")?.reset(),this.additionalFieldsValidityChanged(!0,"fields")),r?.setValidators(o),r?.updateValueAndValidity()}onClickDeclaredValue(){this.isCustomsAvailable()||this.addonsExists()&&!this.isSelectedCheckboxDeclaredValue&&(this.isSelectedCheckboxDeclaredValue=!0,this.applyDeclaredValueValidators(),this.declaredValueCategoryForm.get("declaredValue").updateValueAndValidity())}getAddons(t=0,n=!1){if(this.addonsExists()&&this.addonsCategory().addonsGroup.length){const r=this.getAddonsFromAddonsCategory();for(const o in r)if(t>=r[o].minValue&&t<=r[o].maxValue){const u={...r[o]};return n||(u.options.value=t),u.checked=!0,[u]}return[]}return[]}getPlaceholder(t){if(t&&this.addonsExists()){const n=this.addonsService.getAddonsRangeValue("max",this.getAddonsFromAddonsCategory());return this.translateService.instant("PRODUCT_ADDONS.OPTIONS.DECLARED_VALUE_PLACEHOLDER_MAX",{max:n,currency:this.addonsCurrencyValue})}return""}addonsExists(){return this.addonsCategory()?.addonsGroup?.length>0}getTooltipForFreightForwardCheckbox(t){return t?this.translateService.instant("TOOLTIP.DECLARED_VALUE_AND_TRANSPORT_PAID_BY_RECEIVER_SELECTED"):null}getMaxFreeDeclaredValueAddons(){const t=this.getAddons(1,!0);let n=null;for(const r in t)if(t[r]){const o=t[r];(null===n&&0===o.price||0===o.price&&o.maxValue>n.maxValue)&&(n=o,n.options.value=n.maxValue)}return n}getGeneralFieldServerError(){return this.generalFieldServerError?.fields.addons&&"string"==typeof this.generalFieldServerError?.fields.addons?this.generalFieldServerError?.fields.addons:this.generalFieldServerError?.fields&&this.generalFieldServerError?.fields.declaredValue?this.generalFieldServerError?.fields.declaredValue:null}registerOnChange(t){this.propagateChange=t}writeValue(t){t?.length&&(this.isSelectedCheckboxDeclaredValue=!0,this.declaredValueCategoryForm.patchValue({selectedAddonRadio:t[0].id,declaredValue:t[0].options.value??t[0].declaredValueFromCustoms?.value,fields:t[0].fields}))}registerOnTouched(){}checkCorrectionsData(){if(!this.isSelectedCheckboxDeclaredValue||this.isCu
1stomsAvailable())return;this.applyDeclaredValueValidators();const t=this.declaredValueCategoryForm.get("declaredValue");return t.updateValueAndValidity(),t.valid?void 0:(t.markAsTouched(),!1)}validate(t){const n=[];return Object.keys(this.declaredValueCategoryForm.controls).forEach(r=>{const o=this.declaredValueCategoryForm.get(r);n.push(r),o.markAsTouched({onlySelf:!0})}),this.fieldsComponent?.validate(),!0!==t&&(this.scrollService.findInvalidFieldAndScroll(n,this.declaredValueCategoryForm),!0)}additionalFieldsValidityChanged(t,n){"declaredValue"===n&&(this.declaredValueValueValid=t),"fields"===n&&(this.categoryFieldsValid=t),this.validityChanged.emit(this.declaredValueValueValid&&this.categoryFieldsValid)}getAddonsFromAddonsCategory(){if(this.addonsExists()&&this.addonsCategory().addonsGroup.length&&this.addonsCategory()?.addonsGroup[0]?.addons){if(this.addonsCategory().addonsGroup.length>1){const t=this.addonsCategory().addonsGroup,n=[];for(const r in t)t[r]&&t[r].addons&&(n[r]=t[r].addons[0]);return this.sortAddons(n)}return this.sortAddons(this.addonsCategory().addonsGroup[0].addons)}return null}sortAddons(t){return t.sort((n,r)=>Number(n.maxValue)<Number(r.maxValue)?-1:Number(n.maxValue)>Number(r.maxValue)?1:0)}handleValidDeclaredValue(t){const n=this.getAddons(t);this.selectedAddons.set(n),n?.length&&(this.declaredValueCategoryForm.get("selectedAddonRadio")?.setValue(n[0].id),n[0].fields=this.declaredValueCategoryForm.get("fields")?.value),this.propagateChange(n)}isRequiredAddons(){return this.addonsExists()&&!!this.addonsCategory()?.addonsGroup[0]?.required}isDeclaredValueValid(){return!!this.declaredValueCategoryForm.get("declaredValue")?.valid}patchDeclaredValue(t){const n=this.declaredValueCategoryForm.get("declaredValue");n?.patchValue(t),n?.updateValueAndValidity()}applyDeclaredValueValidators(){this.declaredValueCategoryForm.get("declaredValue")?.setValidators(m.k0.compose([m.k0.required,m.k0.min(this.minDeclaredValue),m.k0.max(this.maxDeclaredValue)]))}resetAddons(){this.selectedAddons.set([]),this.propagateChange([])}setAddonsFromDraft(t){if(!this.isCustomsAvailable())if(t&&Number(t)){this.isSelectedCheckboxDeclaredValue=!0,this.applyDeclaredValueValidators(),this.patchDeclaredValue(Number(t));const n=this.isDeclaredValueValid();this.additionalFieldsValidityChanged(n,"declaredValue"),n?this.handleValidDeclaredValue(Number(t)):this.resetAddons()}else this.resetAddons()}applyCustomsDrivenValue(t){this.isSelectedCheckboxDeclaredValue=!0,this.isDeclaredValueCheckboxDisabled=!0;const n=this.declaredValueCategoryForm.get("declaredValue");n?.patchValue(t,{emitEvent:!1}),n?.setValidators([]),n?.updateValueAndValidity({emitEvent:!1}),this.isCustomsDrivenValueUnresolved&&this.customsDrivenValueUnresolvedFor!==t&&(this.isCustomsDrivenValueUnresolved=!1,this.customsDrivenValueUnresolvedFor=null),this.additionalFieldsValidityChanged(!this.isCu
1stomsDrivenValueUnresolved,"declaredValue"),this.declaredValueCategoryForm.get("fields")||this.additionalFieldsValidityChanged(!0,"fields"),this.selectedAddons().length&&!this.selectedAddons()[0].declaredValueFromCustoms&&(this.selectedAddons.set([]),this.declaredValueCategoryForm.get("selectedAddonRadio")?.setValue("",{emitEvent:!1}),setTimeout(()=>{this.propagateChange([])}))}adoptPricedDeclaredValueAddon(t){const n=t.find(g=>"DECLARED_VALUE"===g.category),r=n?this.getCustomsDrivenAddonById(n.id):null;if(!r)return void this.reportUnresolvedCustomsDrivenValue();const o={...r,...n,checked:!0,disabled:!0};this.isCustomsDrivenValueUnresolved=!1,this.customsDrivenValueUnresolvedFor=null,this.additionalFieldsValidityChanged(!0,"declaredValue"),this.changeDetector.markForCheck();const u=this.selectedAddons()[0];u&&E()(u,o)||(this.selectedAddons.set([o]),this.declaredValueCategoryForm.get("selectedAddonRadio")?.setValue(o.id,{emitEvent:!1}),this.propagateChange([o]))}reportUnresolvedCustomsDrivenValue(){this.isCustomsDrivenValueUnresolved=!0,this.customsDrivenValueUnresolvedFor=this.customsValue(),this.selectedAddons.set([]),this.declaredValueCategoryForm.get("selectedAddonRadio")?.setValue("",{emitEvent:!1}),this.additionalFieldsValidityChanged(!1,"declaredValue"),this.changeDetector.markForCheck(),this.propagateChange([])}awaitCustomsDeclaration(){this.isSelectedCheckboxDeclaredValue=!1,this.isDeclaredValueCheckboxDisabled=!0,this.isCustomsDrivenValueUnresolved=!1,this.customsDrivenValueUnresolvedFor=null,this.selectedAddons.set([]);const t=this.declaredValueCategoryForm.get("declaredValue");t?.setValue("",{emitEvent:!1}),t?.setValidators([]),t?.updateValueAndValidity({emitEvent:!1}),this.additionalFieldsValidityChanged(!0,"declaredValue"),this.additionalFieldsValidityChanged(!0,"fields"),setTimeout(()=>{this.propagateChange([])})}getCustomsDrivenAddonById(t){const n=(this.getAddonsFromAddonsCategory()??[]).find(o=>o.id===t);if(!n)return null;const r=this.asCustomsDrivenAddon(n,this.customsValue(),this.customsCurrency());return r.fields=this.declaredValueCategoryForm?.get("fields")?.value,r}asCustomsDrivenAddon(t,n,r){const o={...t.options};return delete o.value,{...t,options:o,checked:!0,disabled:!0,declaredValueFromCustoms:{value:n,currency:r}}}releaseCustomsDrivenValue(){if(this.isCustomsDrivenValueUnresolved=!1,this.customsDrivenValueUnresolvedFor=null,this.selectedAddons.set([]),this.isRequiredAddons())return void this.setDefaultValueToDeclaredValue();const t=this.declaredValueCategoryForm.get("declaredValue");this.isDeclaredValueCheckboxDisabled=!1,this.isSelectedCheckboxDeclaredValue=!1,t?.setValue("",{emitEvent:!1}),t?.setValidators([]),t?.updateValueAndValidity({emitEvent:!1}),this.additionalFieldsValidityChanged(!0,"declaredValue"),setTimeout(()=>{this.propagateChange([])})}getAddonsValueCurrency(){const t=this.getAddonsFromAddonsCategory();return t?.length?t[0]?.valueCurrency:null}buildAddonsForm(){this.declaredValueCategoryForm=this.formBuilder.group({}),this.declaredValueCategoryForm.addControl("selectedAddonRadio",new m.MJ("",[])),this.declaredValueCategoryForm.addControl("declaredValue",new m.MJ("",[m.k0.min(this.minDeclaredValue),m.k0.max(this.maxDeclaredValue)])),this.addonsCategory()?.fields?.length&&this.declaredValueCategoryForm.addControl("fields",new m.MJ(null))}getServerErrors(){if(!this.serverValidationErrors()?.fields.addons)return{};const t=this.addonsCategory().addonsGroup.reduce((g,A)=>ht()(A.addons)?[...g,...A.addons]:[...g,A.addons],[]),n=this.serverValidationErrors()?.fields.addons,r=t.map(g=>g.id),o=n?.filter(g=>Ne()(r,g.addonId)),u={};return o?.forEach(g=>u[g.fieldName]=g.message),u}setMemorizedDeclaredValue(t){this.isCustomsAvailable()||(this.isSelectedCheckboxDeclaredValue=!0,this.declaredValueCategoryForm.get("selectedAddonRadio").patchValue(t.id),this.patchDeclaredValue(t.options.value),this.declaredValueCategoryForm.updateValueAndValidity())}setDefaultValueToDeclaredValue(){this.isDeclaredValueCheckboxDisabled=!0,this.isSelectedCheckboxDeclaredValue=!0,this.applyDeclaredValueValidators();const t=this.getDefaultAddons();if(this.patchDeclaredValue(Number(t?t.maxValue:null)),t?.maxValue){const n=this.getAddons(t.maxValue);this.selectedAddons.set(n),n?.length&&(this.declaredValueCategoryForm.get("selectedAddonRadio").setValue(n[0].id),n[0].fields=this.declaredValueCategoryForm?.get("fields")?.value),setTimeout(()=>
1{this.propagateChange(n)})}}getDefaultAddons(){const t=this.getAddons(1,!0);return t&&t.length?{...t[0]}:null}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(v.il),e.rXU(m.ok),e.rXU(f.c$),e.rXU(nt.b),e.rXU(no),e.rXU(Xt.x),e.rXU(Pt.I),e.rXU(e.gRc))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-declared-value-category"]],viewQuery:function(n,r){if(1&n&&e.GBs(We,5),2&n){let o;e.mGM(o=e.lsd())&&(r.fieldsComponent=o.first)}},inputs:{addonsCategory:[1,"addonsCategory"],serverValidationErrors:[1,"serverValidationErrors"]},outputs:{validityChanged:"validityChanged",inputValueChanged:"inputValueChanged"},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.OA$,e.aNF],decls:6,vars:4,consts:[[3,"formGroup"],[1,"order-setup__field","addon-declared-value"],[1,"field"],[1,"order-setup__label"],[1,"label","order-setup--c-inherit"],[1,"order-setup__input","addon-declared-value__from-customs"],[1,"order-setup--c-inherit",3,"ardnDataTestId"],[1,"addon-declared-value__from-customs-value",3,"ardnDataTestId"],[1,"addon-declared-value__from-customs-hint",3,"ardnDataTestId"],[1,"addon-declared-value__from-customs-error",3,"ardnDataTestId"],[1,"order-setup__input","order-setup--inline-flex",3,"ngClass"],[1,"checkbox","addon-declared-value__checkbox"],["for","checkbox-declared-value",3,"ardnDataTestId"],["id","checkbox-declared-value","type","checkbox",3,"click","checked","disabled","ardnDataTestId"],[1,"order-setup__input"],[1,"number-input-options"],["id","declaredValue","formControlName","declaredValue","idName","declared-value",3,"click","maxFractionDigits","placeholder","showArrow","min","alwaysPropagateChange","isDisabled","setMinValue","ardnDataTestId"],[1,"form-error","mb-0"],[1,"input-validation",3,"clientSideValidation","clientErrorMessage","clientTranslationParams","serverSideValidation","ardnDataTestId"],[1,"radio","radio--padding"],["id","selectedAddonRadio","type","radio","formControlName","selectedAddonRadio",3,"value","ardnDataTestId"],[3,"content","price","currency","ardnDataTestId"],[1,"order-setup__info","radio--padding"],[1,"info-icon","tooltip","tooltipstered",3,"ardnTooltipster"],[3,"addonPrice","addonInPrice","currency","ardnDataTestId"],[1,"order-setup__description","color-progress"],["formControlName","fields",3,"validityChanged","fields","serverValidationErrors"],[1,"input-validation",3,"clientSideValidation","serverSideValidation"],[1,"form-error"]],template:function(n,r){1&n&&(e.j41(0,"div",0)(1,"fieldset",1),e.DNE(2,da,13,12,"div",2)(3,ca,19,34)(4,Ca,6,1)(5,_a,5,1,"div",2),e.k0s()()),2&n&&(e.Y8G("formGroup",r.declaredValueCategoryForm),e.R7$(2),e.vxM(r.isCustomsAvailable()?2:3),e.R7$(2),e.vxM(r.selectedAddons().length?4:-1),e.R7$(),e.vxM(null!==r.getGeneralFieldServerError()?5:-1))},dependencies:[m.X1,m.me,m.Fm,m.BC,m.cb,m.j4,m.JD,f.h,f.D9,l.YU,Z.Z,ot.N,ye.Q,ge.d,at,dt,We,st.W],styles:[".radio--padding[_ngcontent-%COMP%]{padding-top:15px}.addon-declared-value__checkbox[_ngcontent-%COMP%]{margin-bottom:5px}.addon-declared-value__from-customs-value[_ngcontent-%COMP%]{margin-top:5px}.addon-declared-value__from-customs-hint[_ngcontent-%COMP%]{margin-top:5px;color:#5b5b5b}.addon-declared-value__from-customs-error[_ngcontent-%COMP%]{margin-top:5px;color:#f72323}.addon-declared-value[_ngcontent-%COMP%]   .field[_ngcontent-%COMP%]{margin-bottom:5px}"],changeDetection:0})}}return i})();var ze=function(i){return i.SENDER="sender",i.RECEIVER="receiver",i.CROSSBORDER="crossborder",i}(ze||{}),Ni=s(10522),xn=s(81868),ki=s(16972),Oa=s(29188),Vi=s(90159),ya=s(90693),oo=s(67641),so=s(56347);let va=(()=>{class i extends so.g{constructor(t){super(),this.translate=t}renderHtmlContent(){return'\n      <div class="package-info-content">\n        '+this.translate.instant("ORDER_PAGE.INFOTIP.SHIPMENT_TYPE.CHECK")+'        \n        <a\n          href="https://www.globkurier.pl/faq/towary-wykluczone"\n          target="_blank"\n          class="standard-package-info-content-read-more"\n        ><b>'+this.translate.instant("ORDER_PAGE.INFOTIP.SHIPMENT_TYPE.URL")+"</b></a> "+this.translate.instant("ORDER_PAGE.INFOTIP.SHIPMENT_TYPE.DETAILS")+".\n      </div>\n    "}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(f.c$))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-shipment-type-tooltipster"]],standalone:!0,features:[e.Vt3,e.aNF],decls:2,vars:2,consts:[[1,"info-icon","tooltip","tooltipstered",3,"isHTML","ardnTooltipster"]],template:function(n,r){1&n&&(e.j41(0,"span",0),e.EFF(1," i\n"),e.k0s()),2&n&&e.Y8G("isHTML",!0)("ardnTooltipster",r.renderHtmlContent())},dependencies:[ge.d],styles:[".tooltipster-content[_ngcontent-%COMP%]{padding-right:32px;padding-top:9px}.tooltipster-base[_ngcontent-%COMP%]{pointer-events:all}"]})}}return i})();const Ea=["ardn-service-code-custom-label",""];function Sa(i,p){if(1&i&&(e.EFF(0),e.nI1(1,"translate")),2&i){const t=e.XpG();e.SpI(" ",e.bMT(1,1,t.serviceCodeLabel),"\n")}}function ba(i,p){if(1&i&&(e.EFF(0),e.nI1(1,"translate")),2&i){const t=e.XpG();e.SpI(" ",e.bMT(1,1,t.defaultLabel()),"\n")}}let ao=(()=>{class i{constructor(t,n){this.config=t,this.store=n,this.serviceCodeLabel=null,this.defaultLabel=(0,e.hFB
1)("")}ngOnInit(){this.store.select(T.xQ).subscribe(n=>{const r=this.config.productServiceCodesTypes[n];r&&(this.serviceCodeLabel=r.label)})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Ae.vQ),e.rXU(v.il))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["","ardn-service-code-custom-label",""]],inputs:{defaultLabel:[1,"defaultLabel"]},standalone:!0,features:[e.aNF],attrs:Ea,decls:2,vars:1,template:function(n,r){1&n&&e.DNE(0,Sa,2,3)(1,ba,2,3),2&n&&e.vxM(r.serviceCodeLabel?0:1)},dependencies:[f.h,f.D9],encapsulation:2})}}return i})();function Pa(i,p){if(1&i&&(e.j41(0,"div")(1,"span",6)(2,"div"),e.nrm(3,"ardn-product-addon-radio",7),e.k0s()()()),2&i){let t;const n=p.$implicit,r=e.XpG();e.R7$(),e.FS9("formGroupName",n),e.R7$(2),e.Y8G("addons",r.getAddon(n))("defaultSelected",!1)("ardnDataTestId","ardn-product()-addon-category-form-"+n+"-addon-"+(null==(t=r.product())?null:t.id)+"-ardn-product()-addon-radio")}}function Aa(i,p){1&i&&(e.j41(0,"div")(1,"p",8),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&i&&(e.R7$(2),e.JRh(e.bMT(3,1,"COMMON.ERRORS.REQUIRED")))}let lo=(()=>{class i{constructor(t,n,r){this.formBuilder=t,this.orderService=n,this.changeDetector=r,this.product=(0,e.hFB)(),this.addonsCategory=(0,e.hFB)(),this.categoryTitle=(0,e.hFB)(),this.validityChanged=(0,e.CGW)(),this.value=[],this.productTradeDocumentsTypeCategoryChanges=!0,this.isDisabledSelectAndValidOnLoad=!0,this.propagateChange=()=>null}ngOnInit(){this.buildAddonsForm()}ngAfterViewInit(){this.productAddonRadio?.addons?.length>1||(this.isDisabledSelectAndValidOnLoad=!1)}updateFormValue(t){let n=this.getSelectedRadioAddons(t);0===n?.length&&(n=this.getFirstRequiredAddons(t)),this.isDisabledSelectAndValidOnLoad?(this.validityChanged.emit(!1),this.isDisabledSelectAndValidOnLoad=!1):(this.validityChanged.emit(!0),this.productTradeDocumentsTypeCategoryChanges=!1),this.writeAndPropagateValue(n)}getCategories(){return Object.keys(this.addonCategoryForm.controls)}getAddon(t){return this.addonCategoryForm.get(t).controls.addons.value}validate(){return this.addonCategoryForm.markAsTouched({onlySelf:!0}),!(!this.isDisabledSelectAndValidOnLoad&&this.productTradeDocumentsTypeCategoryChanges)&&this.addonCategoryForm.valid}getSelectedRadioAddons(t){return Object.values(t).filter(n=>n.selectedAddon).map(n=>n.selectedAddon)}getFirstRequiredAddons(t){if(t?.length)for(const n in t)if(t[n]?.addons?.length){const r=t[n].addons;if(this.isRequiredAddons(r))return[r[0]]}return[]}isRequiredAddons(t){for(const n in t)t&&this.addonsCategory()?.addonsGroup?.length&&this.isAddonCategoryGroup(this.addonsCategory().addonsGroup,t[n].id);return!1}isAddonCategoryGroup(t,n){for(const r in t){if(!t[r])continue;const o=this.addonsCategory().addonsGroup[r];if(o.required)return this.isAddonGroups(o.addons,o,n)}return!1}isAddonGroups(t,n,r){for(const o in t)if(n.addons[o]&&n.addons[o].id===r)return!0;return!1}buildAddonsForm(){this.addonCategoryForm=this.formBuilder.group({});const t=this.orderService.cachedAddons.value;t?.length&&t.forEach(n=>{this.addonsCategory().addonsGroup.forEach(r=>{const o=r.addons.find(u=>u.id===n.id);o&&(o.checked=!0)})});for(let n=0;n<this.addonsCategory().addonsGroup.length;n++)this.addonCategoryForm.addControl(`${this.addonsCategory().addonsGroup[n].type}_${n}`,this.createRadioFormGroup(this.addonsCategory().addonsGroup[n].addons));this.addonCategoryForm?.valueChanges.subscribe(n=>{this.updateFormValue(n)})}createRadioFormGroup(t){return this.formBuilder.group({selectedAddon:"",addons:[t]})}registerOnChange(t){this.propagateChange=t}writeAndPropagateValue(t){this.writeValue(t),this.propagateChange(t),this.changeDetector.markForCheck()}writeValue(t){this.value=t}registerOnTouched(){}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(m.ok),e.rXU(K.Q),e.rXU(e.gRc))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-trade-documents-category"]],viewQuery:function(n,r){if(1&n&&e.GBs(rt,5),2&n){let o;e.mGM(o=e.lsd())&&(r.productAddonRadio=o.first)}},inputs:{product:[1,"product"],addonsCategory:[1,"addonsCategory"],categoryTitle:[1,"categoryTitle"]},outputs:{validityChanged:"validityChanged"},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.aNF],decls:15,vars:8,consts:[[1,"order-setup__field",3,"formGroup"],[1,"order-setup__label"],[1,"label"],[1,"label--required"],[1,"info-icon","tooltip","tooltipstered",3,"ardnTooltipster"],[1,"order-setup__input"],[3,"formGroupName"],["formControlName","selectedAddon",3,"addons","defaultSelected","ardnDataTestId"],[1,"form-error"]],template:function(n,r){1&n&&(e.j41(0,"fieldset",0)(1,"legend",1)(2,"span",2),e.EFF(3),e.nI1(4,"translate"),e.j41(5,"span",3),e.
1EFF(6,"*"),e.k0s(),e.EFF(7,"\xa0 "),e.j41(8,"span",4),e.nI1(9,"translate"),e.EFF(10,"i"),e.k0s()()(),e.j41(11,"div",5),e.Z7z(12,Pa,4,4,"div",null,e.fX1),e.DNE(14,Aa,4,3,"div"),e.k0s()()),2&n&&(e.Y8G("formGroup",r.addonCategoryForm),e.R7$(3),e.SpI(" ",e.bMT(4,4,"PRODUCT_ADDONS."+r.categoryTitle())," "),e.R7$(5),e.Y8G("ardnTooltipster",e.bMT(9,6,"PRODUCT_ADDONS."+r.categoryTitle()+"_LABEL_TOOLTIP")),e.R7$(4),e.Dyx(r.getCategories()),e.R7$(2),e.vxM(!r.isDisabledSelectAndValidOnLoad&&r.productTradeDocumentsTypeCategoryChanges?14:-1))},dependencies:[m.X1,m.BC,m.cb,m.j4,m.JD,m.$R,f.h,f.D9,ge.d,rt,Z.Z],encapsulation:2,changeDetection:0})}}return i})();const Ra=()=>["DUTY_DDP","DUTY_DDP_OUTER"],Ta=()=>["DUTY_DDP_PREMIUM","DUTY_DDP_MARKETPLACE"],Ia=i=>({carrier:i});function Da(i,p){if(1&i&&(e.j41(0,"span",10),e.EFF(1," i "),e.k0s()),2&i){const t=e.XpG().$implicit;e.Y8G("ardnTooltipster",t.description)}}function Ma(i,p){if(1&i&&e.nrm(0,"div",12),2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.Y8G("innerHTML",n.sanitizer.bypassSecurityTrustHtml(t.attributes),e.npT)}}function Fa(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-category-fields",15),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(3);return e.Njj(o.onAddonFieldsValidityChanged(r))}),e.k0s()}if(2&i){e.XpG();const t=e.r8f(10);e.Y8G("fields",t)}}function $a(i,p){if(1&i&&(e.j41(0,"span",22),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i){const t=e.XpG(6);e.R7$(),e.Lme(" (",e.bMT(2,2,"COMMON.POST_CODE_EG")," ",null==t.country||null==t.country.postCodeSamples?null:t.country.postCodeSamples.split(", ")[0],") ")}}function Na(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",18)(1,"div",19)(2,"label",20),e.EFF(3),e.nI1(4,"translate"),e.j41(5,"span",21),e.EFF(6,"*"),e.k0s(),e.DNE(7,$a,3,4,"span",22),e.k0s(),e.nrm(8,"ardn-post-code-drop-down",23),e.nI1(9,"translate"),e.nrm(10,"ardn-field-validator",17),e.k0s(),e.j41(11,"div",19)(12,"label",20),e.EFF(13),e.nI1(14,"translate"),e.j41(15,"span",21),e.EFF(16,"*"),e.k0s()(),e.j41(17,"ardn-country-chooser",24),e.bIt("defaultOptionEmiter",function(r){e.eBV(t);const o=e.XpG(5);return e.Njj(o.setCountry(r))})("newCountrySelected",function(){e.eBV(t);const r=e.XpG(5);return e.Njj(r.postCodeService.clearAddressForm(r.mainForm))}),e.k0s()()()}if(2&i){const t=e.XpG(5);e.R7$(3),e.SpI(" ",e.bMT(4,8,"COMMON.ADDRESS.POST_CODE")," "),e.R7$(4),e.vxM(null!=t.country&&t.country.postCodeSamples?7:-1),e.R7$(),e.Y8G("country",t.country)("formGroup",t.mainForm)("placeholder",e.bMT(9,10,"ORDER_PAGE.INCOTERMS.POSTAL_CODE")),e.R7$(2),e.Y8G("clientSideValidation",t.mainForm.get("dutyPostCode"))("clientErrorMessage","COMMON.ERRORS.TOO_SHORT"),e.R7$(3),e.SpI(" ",e.bMT(14,12,"COMMON.SETTINGS_DIALOG.COUNTRY_LABEL")," ")}}function ka(i,p){if(1&i&&(e.nrm(0,"input",16),e.nI1(1,"translate"),e.nrm(2,"ardn-field-validator",17),e.DNE(3,Na,18,14,"div",18)),2&i){const t=e.XpG(4);e.Y8G("placeholder",e.i5U(1,4,"ORDER_PAGE.INCOTERMS.ACCOUNT_NUMBER",e.eq3(7,Ia,t.carrierName))),e.R7$(2),e.Y8G("clientSideValidation",t.mainForm.get("dutyPayerNumber"))("clientErrorMessage","PRODUCT_ADDONS.OPTIONS.INCOTERMS_ACCOUNT"),e.R7$(),e.vxM("UPS"===t.carrierName?3:-1)}}function Va(i,p){if(1&i&&e.DNE(0,ka,4,9),2&i){const t=e.XpG().$implicit;e.vxM(e.lJ4(1,Ta).includes(null==t?null:t.category)?-1:0)}}function xa(i,p){if(1&i&&(e.j41(0,"div",7)(1,"label"),e.nrm(2,"input",8),e.j41(3,"span"),e.EFF(4),e.k0s()(),e.j41(5,"div",9),e.DNE(6,Da,2,1,"span",10),e.nrm(7,"ardn-product-addon-price",11),e.k0s(),e.DNE(8,Ma,1,1,"div",12),e.j41(9,"div",13),e.SS7(10),e.DNE(11,Fa,1,1,"ardn-product-addon-category-fields",14)(12,Va,1,2),e.k0s()()),2&i){const t=p.$implicit,n=e.XpG(2);e.R7$(2),e.FS9("value",t.category),e.BMQ("disabled",t.disabled?"":null),e.R7$(2),e.JRh(t.addonName),e.R7$(2),e.vxM(null!=t&&t.description?6:-1),e.R7$(),e.Y8G("addonPrice",null==t?null:t.price)("addonInPrice",null==t?null:t.inPrice)("currency",null==t?null:t.currency),e.R7$(),e.vxM(null!=t&&t.attributes?8:-1),e.R7$(2);const r=e.bH3(n.getFieldsForIncoterm(null==t?null:t.category));e.R7$(),e.vxM((null==t?null:t.category)===n.getIncotermValue()&&null!=r&&r.length?11:-1),e.R7$(),e.vxM(null!=t&&null!=t.category&&t.category.startsWith("DUTY_DDP")&&e.lJ4(11,Ra).includes(n.getIncotermValue())?12:-1)}}function Ua(i,p){if(1&i&&(e.j41(0,"form",6),e.Z7z(1,xa,13,12,"div",7,e.Vm6),e.k0s()),2&i){const t=e.XpG();e.Y8G("formGroup",t.mainForm),e.R7$(),e.Dyx(t.incoterms)}}let co=(()=>{class i extends so.g{constructor(t,n,r,o,u){super(),this.postCodeService=t,this.sanitizer=n,this.formBuilder=r,this.store=o,this.translateService=u,this.validityChanged=(0,e.CGW)(),this.addonsCategory=(0,e.hFB
1)(),this.incoterms=[],this.senderCountry=null,this.receiverCountry=null,this.isUpdating=!1,this.addonFieldsValid=!0,this.destroyRef=(0,e.WQX)(e.abz),this.propagateChange=()=>{},this.initFormGroup(),this.store.select(T.Km).pipe((0,M.s)(1)).subscribe(g=>{this.carrierName=g})}ngAfterViewInit(){if(this.incoterms?.length){const t=this.incoterms.find(u=>"DUTY_DDP_PREMIUM"===u?.category);if(this.inputValue)return this.mainForm.get("incoterm")?.patchValue(this.inputValue),void(this.inputValue=null);if(t&&!t?.disabled)return void this.mainForm.get("incoterm")?.patchValue(t?.category);const n=this.incoterms.find(u=>"DUTY_DAP_PREMIUM"===u?.category);if(n&&!n?.disabled)return void this.mainForm.get("incoterm")?.patchValue(n?.category);const r=this.incoterms.find(u=>"DUTY_DAP"===u?.category);if(r&&!r?.disabled)return void this.mainForm.get("incoterm")?.patchValue(r?.category);const o=this.incoterms.find(u=>u?.category.startsWith("DUTY_DDP")&&"DUTY_DDP_PREMIUM"!==u?.category);if(o&&!o?.disabled)return void this.mainForm.get("incoterm")?.patchValue(o?.category)}}ngOnChanges(){this.updateIncoterms()}ngOnInit(){this.mainForm.get("incoterm")?.valueChanges.pipe((0,X.T)(()=>{this.setValidation(),this.clearValueAndValidators(),this.resetAddonFieldsValidity()}),(0,ce.B)(300)).subscribe(()=>{this.propagateSelectedIncoterm()}),(0,q.z)([this.mainForm?.get("dutyPayerNumber").valueChanges,this.mainForm?.get("dutyPostCode").valueChanges,this.mainForm?.get("dutyCountryId").valueChanges]).subscribe(([t,n,r])=>{this.setValidation(),this.emitValidity(),this.store.dispatch(F.M.createSetAdditionalIncotermsParameters({dutyPayerNumber:t??null,dutyPostCode:n??null,dutyCountryId:r??null}))}),this.mainForm.get("addonFields")?.valueChanges.pipe((0,z.pQ)(this.destroyRef)).subscribe(()=>{this.propagateSelectedIncoterm()})}getAddon(t){return this.mainForm.get(t).controls.addons.value}registerOnChange(t){this.propagateChange=t}writeValue(t){this.inputValue=t[0]?.category,this.store.select(T.Z9).pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(n=>{this.mainForm.patchValue({dutyPayerNumber:n.dutyPayerNumber??null,dutyPostCode:n.dutyPostCode??null,dutyCountryId:n.dutyCountryId??null,addonFields:t[0]?.fields??null,incoterm:t[0]?.category})})}registerOnTouched(){}getFieldsForIncoterm(t){for(const n of this.addonsCategory()?.addonsGroup??[])if(n.addonFieldsSchemas?.[t])return n.addonFieldsSchemas[t];return[]}onAddonFieldsValidityChanged(t){this.addonFieldsValid=t,this.emitValidity()}initFormGroup(){this.mainForm=this.formBuilder.group({incoterm:[],dutyPayerNumber:[],dutyPostCode:[],dutyCountryId:[],addonFields:[]})}renderHtmlContent(){return'\n      <div class="package-info-content">\n        <div class="html-tooltip-container" style="margin-right: 20px;">\n          '+this.translateService.instant("TOOLTIP.INCOTERMS.TEXT")+'\n          <a\n            href="https://www.globkurier.pl/oferta/incoterms"\n            target="_blank"\n            class="standard-package-info-content-read-more"\n          ><strong>'+this.translateService.instant("TOOLTIP.INCOTERMS.HERE")+"</strong></a>\n        </div>\n      </div>\n    "}setCountry(t){this.country=t}getIncotermValue(){return this.mainForm.get("incoterm")?.value}propagateSelectedIncoterm(){const t=this.mainForm.get("addonFields")?.value,n=this.incoterms.filter(r=>r?.category===this.getIncotermValue());this.propagateChange(n.map(r=>t?{...r,fields:t}:r))}updateIncoterms(){this.incoterms=this.addonsCategory()?.addonsGroup?.filter(t=>"RADIO"===t?.type)?.flatMap(t=>t?.addons)??[]}emitValidity(){if("UPS"===this.carrierName)setTimeout(()=>{this.validityChanged.emit((this.mainForm?.valid??!1)&&this.addonFieldsValid)});else{const t=(this.mainForm.get("dutyPayerNumber")?.valid??!0)&&this.addonFieldsValid;this.validityChanged.emit(t)}}resetAddonFieldsValidity(){const t=this.getFieldsForIncoterm(this.getIncotermValue())?.some(n=>n.required);this.addonFieldsValid=!t}setValidation(){if(this.isUpdating)return;this.isUpdating=!0;const t=this.mainForm.get("dutyPayerNumber"),n=this.mainForm.get("dutyCountryId"),r=this.mainForm.get("dutyPostCode");["DUTY_DDP","DUTY_DDP_OUTER"].includes(this.getIncotermValue())?t?.setValidators(m.k0.required):t?.clearValidators(),"DUTY_DDP_OUTER"===this.getIncotermValue()&&"UPS"===this.carrierName?(n?.setValidators(m.k0.required),r?.setValidators([m.k0.required,m.k0.minLength(2)]
1)):(n?.clearValidators(),r?.clearValidators()),setTimeout(()=>{t?.updateValueAndValidity(),n?.updateValueAndValidity(),r?.updateValueAndValidity(),this.isUpdating=!1})}clearValueAndValidators(){this.isUpdating||(this.isUpdating=!0,this.mainForm.get("dutyPayerNumber")?.patchValue(null),this.mainForm.get("dutyPayerNumber")?.clearValidators(),"UPS"===this.carrierName&&(this.mainForm.get("dutyCountryId")?.patchValue(null),this.mainForm.get("dutyPostCode")?.patchValue(null),this.mainForm.get("dutyCountryId")?.clearValidators(),this.mainForm.get("dutyPostCode")?.clearValidators()),this.mainForm.get("addonFields")?.patchValue(null),setTimeout(()=>{this.mainForm.get("dutyPayerNumber")?.updateValueAndValidity(),this.mainForm.get("dutyCountryId")?.updateValueAndValidity(),this.mainForm.get("dutyPostCode")?.updateValueAndValidity(),this.mainForm.get("addonFields")?.updateValueAndValidity(),this.isUpdating=!1}))}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Jt.z),e.rXU(Bt.up),e.rXU(m.ok),e.rXU(v.il),e.rXU(f.c$))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-product-addon-incoterms"]],inputs:{addonsCategory:[1,"addonsCategory"]},outputs:{validityChanged:"validityChanged"},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.Vt3,e.OA$,e.aNF],decls:10,vars:6,consts:[[1,"order-setup__field","collectionType"],[1,"order-setup__label"],[1,"incoterms-label"],["for","o4-package-content",1,"label"],[1,"info-icon","tooltip","tooltipstered",3,"isHTML","ardnTooltipster"],[1,"order-setup__input"],[3,"formGroup"],[1,"radio","radio--padding"],["type","radio","formControlName","incoterm",3,"value"],[1,"order-setup__info"],[1,"info-icon","tooltip","tooltipstered",3,"ardnTooltipster"],[3,"addonPrice","addonInPrice","currency"],[1,"external-container-addon-attributes",3,"innerHTML"],[1,"order-setup__input","incoterms-account"],["formControlName","addonFields",3,"fields"],["formControlName","addonFields",3,"validityChanged","fields"],["formControlName","dutyPayerNumber","type","text",1,"input",3,"placeholder"],[1,"input-validation",3,"clientSideValidation","clientErrorMessage"],[1,"row","mt-4","incoterms-additional-inputs"],[1,"col","col-6","col-mobile-12"],[1,"label"],[1,"label--required"],[1,"label--optional"],["id","postCode-addressbook","formControlName","dutyPostCode",3,"country","formGroup","placeholder"],["formControlName","dutyCountryId",3,"defaultOptionEmiter","newCountrySelected"]],template:function(n,r){1&n&&(e.j41(0,"fieldset",0)(1,"legend",1)(2,"div",2)(3,"span",3),e.
1EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"span",4),e.EFF(7,"i"),e.k0s()()(),e.j41(8,"div",5),e.DNE(9,Ua,3,1,"form",6),e.k0s()()),2&n&&(e.R7$(4),e.SpI(" ",e.bMT(5,4,"ORDER_PAGE.INCOTERMS.HEADER")," "),e.R7$(2),e.Y8G("isHTML",!0)("ardnTooltipster",r.renderHtmlContent()),e.R7$(3),e.vxM(r.incoterms?9:-1))},dependencies:[f.h,f.D9,m.X1,m.qT,m.me,m.Fm,m.BC,m.cb,m.j4,m.JD,ge.d,dt,ye.Q,xe.g,bt.R,We],styles:[".incoterms-account[_ngcontent-%COMP%]{display:block;float:none;width:100%;padding:3px 0}.incoterms-additional-inputs[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{padding:0}.tooltip[_ngcontent-%COMP%]{position:absolute}.order-setup__label[_ngcontent-%COMP%]   .tooltip[_ngcontent-%COMP%]{font-size:13px;margin-left:.6em}.incoterms-label[_ngcontent-%COMP%]{padding-right:30px}",".product-addon-price[_ngcontent-%COMP%]{display:inline-block;margin-left:8px;width:80px;white-space:nowrap;text-align:right}",".tooltipster-close[_ngcontent-%COMP%]{pointer-events:all;position:absolute;right:5px;top:5px;cursor:pointer}.info-icon.html-tooltip[_ngcontent-%COMP%]{position:absolute;right:0;top:0}.html-tooltip-container[_ngcontent-%COMP%]{max-width:700px;pointer-events:all}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-title[_ngcontent-%COMP%]{text-transform:uppercase;font-weight:700;font-size:14px}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]{line-height:1.7}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   .standard-package-info-content-read-more[_ngcontent-%COMP%]{text-decoration:underline;font-style:italic;cursor:pointer;white-space:nowrap}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   .package-info-content-show-hide[_ngcontent-%COMP%]{margin-left:4px;text-decoration:underline;cursor:pointer;white-space:nowrap}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   .package-info-underline[_ngcontent-%COMP%]{text-decoration:underline}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   .package-info-img-container[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{max-width:80px}.html-tooltip-container[_ngcontent-%COMP%]   .package-info-content[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{list-style:disc;margin-left:20px}.display-flex[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}"],changeDetection:0})}}return i})();var At=s(16206),uo=s(83373),po=s(10467),Ga=s(59030),Un=s(93207);let ho=(()=>{class i{constructor(t){this.apiClientService=t,this.endpointUrl="order/pickupTimeRanges"}getPickUpTimeForDate(t){const n={...t,date:At.V.format(t.date)};return this.apiClientService.get(this.endpointUrl,!0,Ie()(n,r=>!r)).pipe((0,Se.W)(r=>(0,H.$)(()=>r.error)))}getPickUpTimeForNextDatesUntilFindAvailable(t){var n=this;const r={...t};return(0,Ga.v)((0,po.A)(function*(){const o=yield(0,Un.s)(n.getPickUpTimeForDate(r));return o.length>0?o.map(u=>({...u,date:new Date(u.date)})):[]}))}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(ie.f))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),xi=(()=>{class i{constructor(){this.memorizeSource=new Et.t(!0),this.isMemorized=this.memorizeSource.asObservable()}allowSetMemorizedData(t){this.memorizeSource.next(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const La=i=>({"border-less":i});function ja(i,p){1&i&&(e.j41(0,"div",6)(1,"div",7),e.EFF(2,"Loading..."),e.k0s()())}function wa(i,p){1&i&&(e.j41(0,"span",11),e.nI1(1,"translate"),e.EFF(2,"i"),e.k0s()),2&i&&e.Y8G("ardnTooltipster",e.bMT(1,1,"ORDER_PAGE.CANT_DETERMINED_PICKUP_DATE"))}function Ba(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-drop-down",13),e.nI1(1,"translate"),e.mxI("ngModelChange",function(r){e.eBV(t);const o=e.XpG(3);return e.DH7(o.pickUpTimeSelectOptions[0],r)||(o.pickUpTimeSelectOptions[0]=r),e.Njj(r)}),e.k0s()}if(2&i){const t=e.XpG(3);e.Y8G("dataSource",t.dataSource),e.R50("ngModel",t.pickUpTimeSelectOptions[0]),e.Y8G("placeholder",e.bMT(1,3,"COMMON.SELECT_PLACEHOLDER"))}}function Xa(i,p){if(1&i&&(e.j41(0,"div",8),e.DNE(1,Ba,2,5,"ardn-drop-down",12),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.vxM(t.dataSource?1:-1)}}function Ya(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-drop-down",13),e.nI1(1,"translate"),e.mxI("ngModelChange",function(r){e.eBV(t);const o=e.XpG(3);return e.DH7(o.pickUpTimeSelectOptions[0],r)||(o.pickUpTimeSelectOptions[0]=r),e.Njj(r)}),e.k0s()}if(2&i){const t=e.XpG(3);e.Y8G("dataSource",t.dataSource),e.R50("ngModel",t.pickUpTimeSelectOptions[0]),e.Y8G("placeholder",e.bMT(1,3,"COMMON.SELECT_PLACEHOLDER"))}}function Wa(i,p){if(1&i&&(e.j41(0,"div",8),e.DNE(1,Ya,2,5,"ardn-drop-down",12),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.vxM(t.dataSource?1:-1)}}function Ha(i,p){if(1&i&&(e.j41(0,"div",8),e.nrm(1,"ardn-date-picker",9)(2,"ardn-field-validator",10),e.k0s(),e.DNE(3,wa,3,3,"span",11)(4,Xa,2,1,"div",8)(5,Wa,2,1,"div",8)),2&i){const t=e.XpG();e.R7$(),e.Y8G("disablePastDates",!0)("daysToShowAhead",t.uniquePickUpDateRanges.length?0:t.daysToShowAhead)("disableUntil",t.uniquePickUpDateRanges.length?t.disableUntil:null)("daysToEnable",t.uniquePickUpDateRanges)("disabled",t.isDisabledDatePicker),e.R7$(),e.Y8G("clientSideValidation",t.pickUpDateForm.get("datePicker"))("clientErrorMessage","COMMON.ERRORS.REQUIRED"),e.R7$(),e.vxM(t.isLoading||t.uniquePickUpDateRanges.length?-1:3),e.R7$(),e.vxM(t.pickUpTimeSelectOptions.length>1?4:5)}}let mo=(()=>{class i{constructor(t,n,r,o,u,g,A){this.formBuilder=t,this.pickUpDateService=n,this.store=r,this.changeDetector=o,this.dataSourceArray=u,this.memorizeService=g,this.translateService=A,this.isFromMemorizedShipmentDate=!1,this.unsubscribeOb
1servable=new re.B,this.getPickUpRangesParams={date:null,weight:null,quantity:null,productId:null,senderCountryId:null,receiverCountryId:null,senderPostCode:null,receiverPostCode:null,senderCity:null,senderStreet:null,receiverCity:null},this.initializationData=(0,e.hFB)(null),this.isSetInitializationData=!1,this.borderLess=(0,e.hFB)(!1),this.disableUntil=null,this.daysToShowAhead=14,this.pickUpTimeSelectOptions=[],this.isDisabledDatePicker=!1,this.isLoading=!1,this.shouldUpdateFromTime=!0,this.pickUpDateForm=this.formBuilder.group({datePicker:[null,m.k0.required],timeSelect:[null,m.k0.required]}),this.uniquePickUpDateRanges=[],this.pickUpDateTimeRanges=[],this.propagateChange=()=>{}}ngOnInit(){this.disablePickUpDatePicker(),this.getPickUpRangesParams.date=new Date,this.pickUpDateForm.get("datePicker").patchValue(null),this.memorizeService.isMemorized.subscribe(n=>{this.shouldUpdateFromTime=n});let t=!0;(0,q.z)([this.pickUpDateForm.get("datePicker").valueChanges,this.store.select(T.PE),this.store.select(T.LK)]).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(([n,r,o
1])=>{let u=n;this.isSetInitializationData&&(u=new Date(this.initializationData().date));const g={...this.getPickUpRangesParams};if(this.getPickUpRangesParams={productId:r.shipment.productId,senderCountryId:r.senderAddress.countryId,receiverCountryId:r.receiverAddress.countryId,senderPostCode:r.senderAddress.postCode,receiverPostCode:r.receiverAddress.postCode,date:this.isSetInitializationData?u:n,weight:r.shipment.weight,quantity:r.shipment.quantity,senderCity:r.senderAddress.city,senderStreet:r.senderAddress.street,receiverCity:r.receiverAddress.city},r?.senderAddress?.stateId&&(this.getPickUpRangesParams={...this.getPickUpRangesParams,senderState:r?.senderAddress?.stateId}),r?.senderAddress?.houseNumber&&(this.getPickUpRangesParams={...this.getPickUpRangesParams,senderHouseNumber:r?.senderAddress?.houseNumber}),r?.receiverAddress?.stateId&&(this.getPickUpRangesParams={...this.getPickUpRangesParams,receiverState:r?.receiverAddress?.stateId}),this.hasEmptyAllRequiredPickUpRangesParams(this.getPickUpRangesParams)||this.isQueryParamsEqual(g,this.getPickUpRangesParams))return;this.disablePickUpTimeSelect(),this.pickUpTimeSelectOptions=[];const A=[{key:-1,label:this.translateService.instant("COMMON.CLOSEST_POSSIBLE")}];if(t)this.pickUpDateService.getPickUpTimeForNextDatesUntilFindAvailable(this.getPickUpRangesParams).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(N=>{if(this.pickUpDateTimeRanges=N,!this.pickUpDateTimeRanges||!this.pickUpDateTimeRanges.length){this.dataSource=null,this.enablePickUpDatePicker(),this.changeDetector.markForCheck();const w=this.isSetInitializationData?u:n,te=new Date;return te.setDate(w.getDate()-1),void(this.disableUntil=te)}if(t){const w={pickUpDate:this.pickUpDateTimeRanges?.[0]?.date,pickUpTimeFrom:this.pickUpDateTimeRanges?.[0]?.timeFrom,pickUpTimeTo:this.pickUpDateTimeRanges?.[0]?.timeTo};!this.isFromMemorizedShipmentDate&&o&&this.shouldUpdateFromTime&&(w.pickUpDate=o.pickUpDate,w.pickUpTimeFrom=o.pickUpTimeFrom,w.pickUpTimeTo=o.pickUpTimeTo),this.getPickUpRangesParams.date=w?.pickUpDate,this.pickUpDateForm.get("datePicker").patchValue(w.pickUpDate),this.propagateChange(w),t=!1}if(this.uniquePickUpDateRanges=[...new Set(this.pickUpDateTimeRanges.map(w=>At.V.format(w.date)))],N.length>0){this.pickUpTimes=this.pickUpDateTimeRanges;const w=this.isSetInitializationData?u:this.getPickUpRangesParams.date;if(this.pickUpTimeSelectOptions=this.pickUpDateTimeRanges.filter(te=>At.V.format(te.date)===At.V.format(w)).map((te,ne)=>({key:ne,label:te.timeFrom+" - "+te.timeTo})),this.pickUpTimeSelectOptions=A.concat(this.pickUpTimeSelectOptions),!this.isFromMemorizedShipmentDate&&o&&this.shouldUpdateFromTime){const te=this.pickUpTimeSelectOptions.filter(ne=>ne.label===`${o.pickUpTimeFrom} - ${o.pickUpTimeTo}`)[0]?.key;this.pickUpDateForm.get("timeSelect").patchValue({key:te,label:this.pickUpTimeSelectOptions[te]?.label}),this.isFromMemorizedShipmentDate=!0}this.dataSource=this.dataSourceArray.create(this.pickUpTimeSelectOptions,"key")}this.enablePickUpDatePicker(),this.enablePickUpTimeSelect(),this.changeDetector.markForCheck()});else{const N=this.isSetInitializationData?u:this.getPickUpRangesParams.date;this.pickUpTimes=[],this.pickUpTimeSelectOptions=this.pickUpDateTimeRanges.filter(w=>At.V.format(w.date)===At.V.format(N)).map((w,te)=>(this.pickUpTimes.push(w),{key:te,label:w.timeFrom+" - "+w.timeTo})),this.pickUpTimeSelectOptions=A.concat(this.pickUpTimeSelectOptions),this.dataSource=this.dataSourceArray.create(this.pickUpTimeSelectOptions,"key"),this.enablePickUpDatePicker(),this.enablePickUpTimeSelect(),this.changeDetector.markForCheck()}}),this.pickUpDateForm.get("datePicker").patchValue(this.getPickUpRangesParams.date),this.pickUpDateForm.get("timeSelect").valueChanges.pipe((0,ce.B)(100),(0,B.Q)(this.unsubscribeObservable)).subscribe(n=>{this.propagateChange(n?{pickUpDate:new Date(this.getPickUpRangesParams.date),pickUpTimeFrom:this.pickUpTimes[n.key]?.timeFrom,pickUpTimeTo:this.pickUpTimes[n.key]?.timeTo}:{pickUpDate:new Date(this.getPickUpRangesParams.date),pickUpTimeFrom:"",pickUpTimeTo:""})})}ngOnChanges(t){t.borderLess||E()(t.initializationData.currentValue,t.initializationData.previousValue)||t.initializationData.currentValue?.date&&!this.isSetInitializationData&&(this.isSetInitializationData=!0)}disablePickUpTimeSelect(){this.pickUpDateForm.get("timeSelect").disable()}enablePickUpTimeSelect(){this.pickUpDateForm.get("timeSelect").enable()}disablePickUpDatePicker(){this.isLoading=!0,this.isDisabledDatePicker=!0,this.pickUpDateForm.get("datePicker").disable()}enablePickUpDatePicker(){this.isLoading=!1,this.isDisabledDatePicker=!1,this.pickUpDateForm.get("datePicker").enable()}hasEmptyAllRequiredPickUpRangesParams(t){const n=Ce()(t,["senderPostCode","receiverPostCode","senderState","senderHouseNumber","receiverState"]);return Ne()(Object.values(n),null)||Ne()(Object.values(n),void 0)}isQueryParamsEqual(t,n){const r={...t},o={...n};return delete r.date,delete o.date,!(t.date.toDateString()!==n.date.toDateString()||!E()(r,o))}
1ngOnDestroy(){this.propagateChange({pickUpDate:new Date,pickUpTimeFrom:"",pickUpTimeTo:""}),this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}onChange(t){this.propagateChange(t.jsdate)}registerOnChange(t){this.propagateChange=t}writeValue(t){if(t)if(!t||t instanceof Date)this.pickUpDateForm.patchValue({datePicker:t});else{const n=this.pickUpTimeSelectOptions?.find(r=>{const o=r.label?.split(" - ");return o[0]===t.pickUpTimeFrom&&(!o[1]||o[1]===t.pickUpTimeTo)});this.pickUpDateForm.patchValue({datePicker:t.pickUpDate,timeSelect:n})}}registerOnTouched(){}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(m.ok),e.rXU(ho),e.rXU(v.il),e.rXU(e.gRc),e.rXU(tt.m),e.rXU(xi),e.rXU(f.c$))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-pickup-date"]],viewQuery:function(n,r){if(1&n&&e.GBs(ee.v,5),2&n){let o;e.mGM(o=e.lsd())&&(r.dropDownComponent=o.first)}},inputs:{initializationData:[1,"initializationData"],borderLess:[1,"borderLess"]},standalone:!0,features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}]),e.OA$,e.aNF],decls:12,vars:12,consts:[[3,"formGroup"],[1,"order-setup__field","order-setup__field--info",3,"ngClass"],[1,"order-setup__label"],["for","o4-package-content",1,"label"],[1,"info-icon","tooltip",3,"ardnTooltipster"],[1,"order-setup__input","field","pickup-date"],[1,"loader-fix-size-wrap"],[1,"loader","loader--gray"],[1,"pickup-date__element"],["formControlName","datePicker",3,"disablePastDates","daysToShowAhead","disableUntil","daysToEnable","disabled"],[3,"clientSideValidation","clientErrorMessage"],[1,"info-icon","tooltip","tooltipstered",3,"ardnTooltipster"],["formControlName","timeSelect","ngClass","select2dropdown--small","displayField","label",3,"dataSource","ngModel","placeholder"],["formControlName","timeSelect","ngClass","select2dropdown--small","displayField","label",3,"ngModelChange","dataSource","ngModel","placeholder"]],template:function(n,r){1&n&&(e.j41(0,"form",0)(1,"fieldset",1)(2,"legend",2)(3,"span",3),e.
1EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"span",4),e.nI1(7,"translate"),e.EFF(8,"i"),e.k0s()(),e.j41(9,"div",5),e.DNE(10,ja,3,0,"div",6)(11,Ha,6,9),e.k0s()()()),2&n&&(e.Y8G("formGroup",r.pickUpDateForm),e.R7$(),e.Y8G("ngClass",e.eq3(10,La,r.borderLess())),e.R7$(3),e.SpI(" ",e.bMT(5,6,"ORDER_PAGE.PREFERRED_PICKUP_DATE")," "),e.R7$(2),e.Y8G("ardnTooltipster",e.bMT(7,8,"TOOLTIP.PREFFERED_PICKUP_DATE")),e.R7$(4),e.vxM(r.isLoading?10:-1),e.R7$(),e.vxM(r.isLoading?-1:11))},dependencies:[m.X1,m.qT,m.BC,m.cb,m.j4,m.JD,f.h,f.D9,l.YU,ge.d,uo.I,ye.Q,ee.v],styles:[".pickup-date[_ngcontent-%COMP%]{display:inline-flex}@media only screen and (max-width: 40em){.pickup-date[_ngcontent-%COMP%]{width:100%}}.pickup-date__element[_ngcontent-%COMP%]{width:100%;margin-right:15px}.pickup-date__element[_ngcontent-%COMP%]:last-child{margin-right:0}.pickup-date[_ngcontent-%COMP%]     .info-icon{min-width:1.4em}.border-less[_ngcontent-%COMP%]{border-bottom:none!important}.order-setup__field[_ngcontent-%COMP%]{width:100%}.pickup-date__element[_ngcontent-%COMP%]     .datepickerelement{height:40px}"],changeDetection:0})}}return i})();var za=s(25007);let Ka=(()=>{class i{transform(t,n=2){const r=Math.pow(10,n);return Math.round((t+Number.EPSILON)*r)/r}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=e.EJ8({name:"ardnCeilRoundup",type:i,pure:!0,standalone:!0})}}return i})();var Qa=s(55464);const Ja=i=>({"loading-area":i});function Za(i,p){1&i&&(e.j41(0,"span",23),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,1,"ORDER_PAGE.NO_SUGGESTED_PRICE")))}function qa(i,p){if(1&i&&(e.EFF(0),e.nI1(1,"async"),e.nI1(2,"async"),e.nI1(3,"async"),e.nI1(4,"async"),e.nI1(5,"async"),e.nI1(6,"ardnCeilRoundup"),e.nI1(7,"async"),e.nI1(8,"ardnCurrency"),e.nI1(9,"translate")),2&i){let t;const n=e.XpG(2);e.Lme(" ",e.i5U(8,17,e.i5U(6,12,(null==(t=e.bMT(1,2,n.orderSelectedProductGrossPriceStandard))?null:t.grossPriceStandard)+(null==(t=e.bMT(2,4,n.orderPriceObservable))?null:t.addonsNetPrice)+(null==(t=e.bMT(3,6,n.orderPriceObservable))?null:t.addonsNetPrice)/100*(null==(t=e.bMT(4,8,n.orderPriceObservable))?null:t.vatPercent),n.getPrecision(null==(t=e.bMT(5,10,n.orderPriceObservable))?null:t.currency)),null==(t=e.bMT(7,15,n.orderPriceObservable))?null:t.currency)," ",e.bMT(9,20,"COMMON.GROSS")," ")}}function ed(i,p){if(1&i&&(e.EFF(0),e.nI1(1,"async"),e.nI1(2,"async"),e.nI1(3,"async"),e.nI1(4,"async"),e.nI1(5,"async"),e.nI1(6,"async"),e.nI1(7,"async"),e.nI1(8,"async"),e.nI1(9,"ardnCeilRoundup"),e.nI1(10,"async"),e.nI1(11,"ardnLocaleNumber")),2&i){let t;const n=e.XpG(2);e.SpI(" ",n.setSuggestedSalesMargin(e.i5U(11,22,e.i5U(9,17,(null==(t=e.bMT(1,1,n.orderSelectedProductGrossPriceStandard))?null:t.grossPriceStandard)+(null==(t=e.bMT(2,3,n.orderPriceObservable))?null:t.addonsNetPrice)+(null==(t=e.bMT(3,5,n.orderPriceObservable))?null:t.addonsNetPrice)/100*(null==(t=e.bMT(4,7,n.orderPriceObservable))?null:t.vatPercent)-((null==(t=e.bMT(5,9,n.orderPriceObservable))?null:t.totalNetPrice)+(null==(t=e.bMT(6,11,n.orderPriceObservable))?null:t.totalNetPrice)/100*(null==(t=e.bMT(7,13,n.orderPriceObservable))?null:t.vatPercent)),n.getPrecision(null==(t=e.bMT(8,15,n.orderPriceObservable))?null:t.currency)),n.getLocaleNumberFormat(null==(t=e.bMT(10,20,n.orderPriceObservable))?null:t.currency)))," ")}}function td(i,p){if(1&i&&(e.EFF(0),e.nI1(1,"async"),e.nI1(2,"async"),e.nI1(3,"ardnCeilRoundup"),e.nI1(4,"async"),e.nI1(5,"ardnLocaleNumber")),2&i){let t;const n=e.XpG(2);e.SpI(" ",e.i5U(5,10,e.i5U(3,5,null==(t=e.bMT(1,1,n.orderSalesMargin))?null:t.salesMargin,n.getPrecision(null==(t=e.bMT(2,3,n.orderPriceObservable))?null:t.currency)),n.getLocaleNumberFormat(null==(t=e.bMT(4,8,n.orderPriceObservable))?null:t.currency))," ")}}function nd(i,p){if(1&i&&(e.EFF(0),e.nI1(1,"async"),e.nI1(2,"async"),e.nI1(3,"async"),e.nI1(4,"async"),e.nI1(5,"async"),e.nI1(6,"async"),e.nI1(7,"async"),e.nI1(8,"async"),e.nI1(9,"async"),e.nI1(10,"async"),e.nI1(11,"async"),e.nI1(12,"ardnCeilRoundup"),e.nI1(13,"async"),e.nI1(14,"ardnLocaleNumber")),2&i){let t;const n=e.XpG(2);e.SpI(" ",e.i5U(14,28,e.i5U(12,23,(null==(t=e.bMT(1,1,n.orderPriceObservable))?null:t.totalNetPrice)+(null==(t=e.bMT(2,3,n.orderPriceObservable))?null:t.totalNetPrice)/100*(null==(t=e.bMT(3,5,n.orderPriceObservable))?null:t.vatPercent)+((null==(t=e.bMT(4,7,n.orderSelectedProductGrossPriceStandard))?null:t.grossPriceStandard)+(null==(t=e.bMT(5,9,n.orderPriceObservable))?null:t.addonsNetPrice)+(null==(t=e.bMT(6,11,n.orderPriceObservable))?null:t.addonsNetPrice)/100*(null==(t=e.bMT(7,13,n.orderPriceObservable))?null:t.vatPercent)-((null==(t=e.bMT(8,15,n.orderPriceObservable))?null:t.totalNetPrice)+(null==(t=e.bMT(9,17,n.orderPriceObservable))?null:t.totalNetPrice)/100*(null==(t=e.bMT(10,19,n.orderPriceObservable))?null:t.vatPercent))),n.getPrecision(null==(t=e.bMT(11,21,n.orderPriceObservable))?null:t.currency)),n.getLocaleNumberFormat(null==(t=e.bMT(13,26,n.orderPriceObservable))?null:t.currency))," ")}}function rd(i,p){if(1&i&&(e.EFF(0),e.nI1(1,"async"),e.nI1(2,"async"),e.nI1(3,"async"),e.nI1(4,"async"),e.nI1(5,"async"),e.nI1(6,"ardnCeilRoundup"),e.nI1(7,"async"),e.nI1(8,"ardnLocaleNumber")),2&i){let t;const n=e.XpG(2);e.SpI(" ",e.i5U(8,16,e.i5U(6,11,(null==(t=e.bMT(1,1,n.orderPriceObservable))?null:t.totalNetPrice)+(null==(t=e.bMT(2,3,n.orderPriceObservable))?null:t.totalNetPrice)/100*(null==(t=e.bMT(3,5,n.orderPriceObservable))?null:t.vatPercent)+(null==(t=e.bMT(4,7,n.orderSalesMargin))?null:t.salesMargin),n.getPrecision(null==(t=e.bMT(5,9,n.orderPriceObservable))?null:t.currency)),n.getLocaleNumberFormat(null==(t=e.bMT(7,14,n.orderPriceObservable))?null:t.currency))," ")}}function id(i,p){if(1&i&&(e.j41(0,"div",5)(1,"div",15)(2,"div",18)(3,"div",19)(4,"div",20)(5,"span",21),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"span",22),e.EFF(9),e.nI1(10,"async"),e.nI1(11,"async"),e.nI1(12,"async"),e.nI1(13,"async"),e.nI1(14,"ardnCeilRoundup"),e.nI1(15,"async"),e.nI1(16,"ardnCurrency"),e.nI1(17,"translate"),e.k0s()(),e.j41(18,"div",20)(19,"span",21),e.EFF(20),e.nI1(21,"translate"),e.k0s(),e.j41(22,"span",22),e.DNE(23,Za,3,3,"span",23),e.nI1(24,"async"),e.nI1(25,"async"),e.nI1(26,"ardnCeilRoundup"),e.DNE(27,qa,10,22),e.k0s()(),e.j41(28,"div",20)(29,"span",21),e.EFF(30),e.nI1(31,"translate"),e.k0s(),e.j41(32,"span",22),e.DNE(33,ed,12,25)(34,td,6,13),e.EFF(35),e.nI1(36,"async"),e.nI1(37,"translate"),e.k0s()(),e.j41(38,"div",24),e.EFF(39),e.nI1(40,"translate"),e.k0s(),e.j41(41,"div",25),e.DNE(42,nd,15,31)(43,rd,9,19),e.EFF(44),e.nI1(45,"async"),e.k0s()()()()()),2&i){let t,n,r,o;const u=e.XpG();e.R7$(6),e.SpI("",e.bMT(7,14,"ORDER_PAGE.SELL_PRODUCT_PRICE"),": "),e.R7$(3),e.Lme(" ",e.i5U(16,29,e.i5U(14,24,(null==(t=e.bMT(10,16,u.orderPriceObservable))?null:t.totalNetPrice)+(null==(t=e.bMT(11,18,u.orderPriceObservable))?null:t.totalNetPrice)/100*(null==(t=e.bMT(12,20,u.orderPriceObservable))?null:t.vatPercent),u.getPrecision(null==(t=e.bMT(13,22,u.orderPriceObservable))?null:t.currency)),null==(t=e.bMT(15,27,u.orderPriceObservable))?null:t.currency)," ",e.bMT(17,32,"COMMON.GROSS")," "),e.R7$(11),e.SpI("",e.bMT(21,34,"ORDER_PAGE.SUGGESTED_PRICE"),": "),e.R7$(3),e.vxM(u.hasSuggestedPrice(e.i5U(26,40,null==(n=e.bMT(24,36,u.orderSelectedProductGrossPriceStandard))?null:n.grossPriceStandard,u.getPrecision(null==(n=e.bMT(25,38,u.orderPriceObservable))?null:n.currency)))?27:23),e.R7$(7),e.SpI("",e.bMT(31,43,"ORDER_PAGE.SALE_MARGIN_PRICE"),": "),e.R7$(3),e.vxM("SUGGESTED"===u.parcelMarginType()?33:-1),e.R7$(),e.vxM("INDYVIDUAL"===u.parcelMarginType()?34:-1),e.R7$(),e.Lme(" ",null==(r=e.bMT(36,45,u.orderPriceObservable))?null:r.currency," ",e.bMT(37,47,"COMMON.GROSS")," "),e.R7$(4),e.SpI(" ",e.bMT(40,49,"ORDER_PAGE.CLIENT_CHARGE_PRICE"),": "),e.R7$(3),e.vxM("SUGGESTED"===u.parcelMarginType()?42:-1),e.R7$(),e.vxM("INDYVIDUAL"===u.parcelMarginType()?43:-1),e.R7$(),e.SpI(" ",null==(o=e.bMT(45,51,u.orderPriceObservable))?null:o.currency," ")}}function od(i,p){1&i&&(e.j41(0,"div",5)(1,"div",26)(2,"div",27),e.EFF(3),e.nI1(4,"translate"),e.nrm(5,"br"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()()),2&i&&(e.R7$(3),e.SpI(" ",e.bMT(4,2,"ORDER_PAGE.HAVE_DISCOUNT_CODE"),""),e.R7$(3),e.SpI(" ",e.bMT(7,4,"ORDER_PAGE.ADD_IT_AT_THE_END")," "))}let go=(()=>{class i{constructor(t,n,r){this.config=t,this.store=n,this.currencyPrecisionService=r,this.isLoading=!0,this.userProfile=null,this.parcelMarginType=(0,e.hFB
1)(),this.suggestedPrice=(0,e.CGW)(),this.unsubscribeObservable=new re.B}ngOnInit(){this.store.select(T.pG).pipe((0,j.F)(E()),(0,U.p)(t=>!!t?.shipment?.productId),(0,ce.B)(400),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.store.dispatch(F.M.createGetOrderPriceAction(t))}),this.orderSelectedProductGrossPriceStandard=this.store.select(T._P).pipe((0,j.F)(E())),this.orderPriceObservable=this.store.select(T.cd).pipe((0,j.F)(E()),(0,X.T)(t=>t.loading?(this.isLoading=!0,{currency:t?.components?.currency??"",totalNetPrice:0,netPriceWithoutFuelSurcharge:0,totalGrossPrice:0,productNetPrice:0,addonsNetPrice:0,vatPercent:0,discountNetPrice:0,fuelSurcharge:0,productsGrossPrice:0,fuelSurchargeGrossPrice:0,addons:[]}):(this.orderSalesMargin=this.store.select(T.Bz).pipe((0,j.F)(E())),this.isLoading=!1,t.components))),this.store.select(J.tB).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.userProfile=t}),this.store.select(T.C4).pipe((0,U.p)(t=>!!t)).subscribe(t=>{this.orderSelectedProduct=t}),this.discountCodeAllowedObservable=this.store.select(T.Sl)}ngOnDestroy(){this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}setSuggestedSalesMargin(t){const n=parseFloat(t.replace(",","."));return za.$.schedule(()=>this.store.dispatch(F.M.setSaleMarginAction(n))),n}setSuggestedPrice(t){return t}hasSuggestedPrice(t){const n=!!t;return this.suggestedPrice.emit(n),n}getPrecision(t){return this.currencyPrecisionService.getPrecision(t)}getLocaleNumberFormat(t){const n=this.getPrecision(t);return`1.${n}-${n}`}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Ae.vQ),e.rXU(v.il),e.rXU(Xt.x))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-price-summary"]],inputs:{parcelMarginType:[1,"parcelMarginType"]},outputs:{suggestedPrice:"suggestedPrice"},standalone:!0,features:[e.aNF],decls:58,vars:55,consts:[[1,"v-align","loading-area",3,"ngClass"],[1,"v-align__content"],[1,"order-setup__label"],[1,"label"],[1,"row"],[1,"col-tiny","col-12"],["data-qa","price summary product logo",1,"order-setup__logo"],[1,"loading-item","loading-logo"],["alt","",3,"src"],[1,"order-setup__price"],[1,"loading-item","loading-label"],["data-qa","price summary product net price"],[1,"loading-item","loading-value"],["data-qa","price summary addons net price"],["data-qa","price summary total net price"],[1,"order-setup__price","order-setup__price--total"],[1,"loading-item","loading-total-cost"],["data-qa","price summary total gross price",1,"color-primary"],[1,"loading-item"],[1,"sales-margin"],[1,"sales-margin__element"],[1,"sales-margin__element--label"],[1,"sales-margin__element--price"],[1,"no-suggested-price"],[1,"sales-margin__element--summary"],["data-qa","price summary total net price",1,"sales-margin__summary-price"],[1,"alert","alert--success","alert--no-icon"],[1,"alert__content","discount-code-info"]],template:function(n,r){if(1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),e.
1EFF(4),e.nI1(5,"translate"),e.k0s()(),e.j41(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7),e.nrm(10,"img",8),e.k0s()()(),e.j41(11,"div",5)(12,"div",9)(13,"div",10),e.EFF(14),e.nI1(15,"translate"),e.k0s(),e.j41(16,"strong",11)(17,"div",12),e.EFF(18),e.nI1(19,"async"),e.nI1(20,"async"),e.nI1(21,"ardnCurrency"),e.k0s()()()(),e.j41(22,"div",5)(23,"div",9)(24,"div",10),e.EFF(25),e.nI1(26,"translate"),e.k0s(),e.j41(27,"strong",13)(28,"div",12),e.EFF(29),e.nI1(30,"async"),e.nI1(31,"async"),e.nI1(32,"ardnCurrency"),e.k0s()()()(),e.j41(33,"div",5)(34,"div",9)(35,"div",10),e.EFF(36),e.nI1(37,"translate"),e.k0s(),e.j41(38,"strong",14)(39,"div",12),e.EFF(40),e.nI1(41,"async"),e.nI1(42,"async"),e.nI1(43,"ardnCurrency"),e.k0s()()()(),e.j41(44,"div",5)(45,"div",15)(46,"div",10),e.EFF(47),e.nI1(48,"translate"),e.k0s(),e.j41(49,"div",16)(50,"strong",17),e.EFF(51),e.nI1(52,"async"),e.nI1(53,"async"),e.nI1(54,"ardnCurrency"),e.k0s()()()(),e.DNE(55,id,46,53,"div",5)(56,od,8,6,"div",5),e.nI1(57,"async"),e.k0s()()()),2&n){let o,u,g,A;e.Y8G("ngClass",e.eq3(53,Ja,r.isLoading)),e.R7$(4),e.SpI(" ",e.bMT(5,13,"ORDER_PAGE.TOTAL_COST_OF_SERVICE")," "),e.R7$(6),e.FS9("src",null==r.orderSelectedProduct?null:r.orderSelectedProduct.carrierLogoLink,e.B4B),e.R7$(4),e.SpI(" ",e.bMT(15,15,"ORDER_PAGE.COURIER_COST")," "),e.R7$(4),e.SpI(" ",e.i5U(21,21,null==(o=e.bMT(19,17,r.orderPriceObservable))?null:o.productNetPrice,null==(o=e.bMT(20,19,r.orderPriceObservable))?null:o.currency)," "),e.R7$(7),e.SpI(" ",e.bMT(26,24,"ORDER_PAGE.ADDONS_FEES")," "),e.R7$(4),e.SpI(" ",e.i5U(32,30,null==(u=e.bMT(30,26,r.orderPriceObservable))?null:u.addonsNetPrice,null==(u=e.bMT(31,28,r.orderPriceObservable))?null:u.currency)," "),e.R7$(7),e.SpI(" ",e.bMT(37,33,"ORDER_PAGE.TOTAL_NET_COST")," "),e.R7$(4),e.SpI(" ",e.i5U(43,39,null==(g=e.bMT(41,35,r.orderPriceObservable))?null:g.totalNetPrice,null==(g=e.bMT(42,37,r.orderPriceObservable))?null:g.currency)," "),e.R7$(7),e.SpI(" ",e.bMT(48,42,"ORDER_PAGE.TOTAL_COST")," "),e.R7$(4),e.SpI(" ",e.i5U(54,48,null==(A=e.bMT(52,44,r.orderPriceObservable))?null:A.totalGrossPrice,null==(A=e.bMT(53,46,r.orderPriceObservable))?null:A.currency)," "),e.R7$(4),e.vxM(null!=r.userProfile&&r.userProfile.salesMargin?55:-1),e.R7$(),e.vxM(e.bMT(57,51,r.discountCodeAllowedObservable)?56:-1)}},dependencies:[l.YU,f.h,f.D9,l.Jj,st.W,Ka,Qa.K],styles:["@media screen and (min-width: 641px) and (max-width: 960px){.loading-area[_ngcontent-%COMP%]   .loading-logo[_ngcontent-%COMP%]{position:relative;left:calc(100% - 100px)}}.loading-area[_ngcontent-%COMP%]   .loading-label[_ngcontent-%COMP%]{width:229px}.loading-area[_ngcontent-%COMP%]   .loading-value[_ngcontent-%COMP%]{width:110px}.loading-area[_ngcontent-%COMP%]   .loading-total-cost[_ngcontent-%COMP%]{width:160px}.v-align__content[_ngcontent-%COMP%]   .order-setup__label[_ngcontent-%COMP%]{display:none}.v-align__content[_ngcontent-%COMP%]   .order-setup__label[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{display:unset}.v-align__content[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .sales-margin[_ngcontent-%COMP%]{border:1px solid #bcbcbc;border-radius:5px;padding:10px}.v-align__content[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .sales-margin__element--price[_ngcontent-%COMP%]{font-weight:700;color:#5b5b5b;margin-left:5px}.v-align__content[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .sales-margin__element--price[_ngcontent-%COMP%]   .no-suggested-price[_ngcontent-%COMP%]{font-size:12px;color:#5b5b5b;margin-left:0}.v-align__content[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .sales-margin__element--label[_ngcontent-%COMP%]{margin-left:0}.v-align__content[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .sales-margin__element--summary[_ngcontent-%COMP%]{margin-top:10px}.v-align__content[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .sales-margin__summary-price[_ngcontent-%COMP%]{font-size:25px;font-weight:700;text-align:left}.v-align__content[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .discount-code-info[_ngcontent-%COMP%]{padding:15px!important;font-size:15px;color:#9b9b9b}@media screen and (max-width: 960px){.v-align__content[_ngcontent-%COMP%]   .order-setup__label[_ngcontent-%COMP%]{display:block}}@media screen and (max-width: 960px) and (min-width: 641px){.v-align__content[_ngcontent-%COMP%]{display:flex}.v-align__content[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]{width:65%}}"],changeDetection:0})}}return i})();var sd=s(4510),fo=s(62316),ad=s(21083),dd=s(47640);const ld=["loadingMessage"],cd=["chooseMessage"],ud=["errorMessage"];function pd(i,p){1&i&&(e.j41(0,"span",10),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,1,"POINT.SUGGESTED")))}function hd(i,p){if(1&i&&(e.j41(0,"span",9),e.DNE(1,pd,3,3,"span",10),e.j41(2,"span",11),e.EFF(3),e.k0s()()),2&i){const t=p.$implicit;e.R7$(),e.vxM(t.isSuggested?1:-1),e.R7$(2),e.JRh(t.label)}}function md(i,p){1&i&&(e.j41(0,"span",10),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,1,"POINT.SUGGESTED")))}function gd(i,p){if(1&i&&(e.j41(0,"span",9),e.DNE(1,md,3,3,"span",10),e.nrm(2,"span",12),e.nI1(3,"ardnHighlight"),e.k0s()),2&i){const t=p.$implicit;e.XpG();const n=e.sdS(1);e.R7$(),e.vxM(t.isSuggested?1:-1),e.R7$(),e.Y8G("innerHTML",e.i5U(3,2,t.label,n.searchText),e.npT)}}function fd(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-drop-down",8,3),e.mxI("ngModelChange",function(r){e.eBV(t);const o=e.XpG();return e.DH7(o.selectedOption,r)||(o.selectedOption=r),e.Njj(r)}),e.bIt("ngModelChange",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.selectionChanged(r))})("opened",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.opened())})("completed",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.handleDropDownCompletion())}),e.DNE(2,hd,4,2,"ng-template",null,4,e.C5r)(4,gd,4,5,"ng-template",null,5,e.C5r),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("dataSource",t.dataSource)("searchEnabled",!0),e.R50("ngModel",t.selectedOption),e.Y8G("placeholder",t.placeholder)("disabled",t.disabled)("isPointSearch",t.isInPointSearch)("parentName","point-list")}}let Co=(()=>{class i{constructor(t,n,r,o,u,g,A,N){this.pointSearchService=t,this.pointsService=n,this.changeDetector=r,this.dataSourceObservable=o,this.store=u,this.snackbarService=g,this.translateService=A,this.priceService=N,this.productId=(0,e.hFB
1)(),this.isCashOnDeliveryAddonSelected=(0,e.hFB)(),this.postCode=(0,e.hFB)(null),this.countryId=(0,e.hFB)(null),this.type=(0,e.hFB)(null),this.addressType=(0,e.hFB)(null),this.chooseMessageTranslationKey=(0,e.hFB)(""),this.shipmentSide=(0,e.hFB)(),this.noPoints=new e.bkB,this.suggestedPointUnavailable=new e.bkB,this.isInPointSearch=!0,this.selectedOption=null,this.haveMemorizedAddressDataChanged=!1,this.pointListSubject=new re.B,this.selectedPoint=null,this.points=[],this.destroyRef=(0,e.WQX)(e.abz),this.suggestedPointId=null,this.suggestedPoint=null,this.suggestedPointUnavailableEmittedFor=null,this.onChanged=()=>{},this.onTouched=()=>{}}ngOnInit(){this.setMemorizedPoints(),this.placeholder=this.chooseMessageTemplate.nativeElement.outerHTML,this.dataSource=this.dataSourceObservable.create(this.pointListSubject,"label"),this.setSelectedPointIds(),this.store.select(T.k$).pipe((0,ce.B)(100)).subscribe(t=>{this.isWeeklyDeliveryAddonCheckboxSelected=this.pointsService.isWeeklyDeliveryAddonChecked(t)})}ngAfterContentInit(){this.pointSearchService.searchTextSubject.pipe((0,ce.B)(300),(0,j.F)(),(0,et.M)(()=>{this.dropDownComponent&&(this.dropDownComponent.pointsPending=!0)}),(0,De.n)(t=>t.length>2?this.pointsService.getPoints({productId:this.productId(),isCashOnDeliveryAddonSelected:this.isCashOnDeliveryAddonSelected(),filter:t,type:this.type(),countryId:this.countryId(),addressType:this.addressType()}).pipe((0,Se.W)(n=>((429===n?.status||0===n?.status)&&this.snackbarService.open(this.translateService.instant("POINT.SEARCH_TOO_MANY_REQUESTS"),{panelClass:"snackbar--error",duration:5e3}),(0,ve.of)(null)))):(0,ve.of)(null)),(0,z.pQ)(this.destroyRef)).subscribe(t=>this.setSearchedResult(t))}ngOnChanges(){this.selectedPoint?(this.store.select(T.Q7).pipe((0,U.p)(t=>!!t)).subscribe(t=>{this.isInPointSearch||(this.points=this.getPoints(t))}),this.getPointsObservable().subscribe(t=>{this.points=t,this.startLoadingAnimation(),this.pointListSubject.next(this.getPointsOptions()),this.stopLoadingAnimationWithSuccess(),this.points.find(r=>r.id===this.selectedOption.key)?(this.selectionChanged(this.selectedOption),this.writeAndPropagateValue(this.selectedPoint)):this.clearSelectionAfterPointBecameUnavailable(),this.dropDownComponent?.refresh(),this.changeDetector.markForCheck()})):(this.selectedOption=null,this.startLoadingAnimation(),this.getPointsObservable().subscribe({next:t=>{this.points=t,0===t.length&&setTimeout(()=>{this.pointSearchService.searchMode=!0},50),this.pointListSubject.next(this.getPointsOptions()),this.stopLoadingAnimationWithSuccess(),this.shipmentSide()===je.SENDER&&this.setPointFromTemplate(),this.selectedOption||this.highlightSuggestedPoint(),!this.selectedOption&&this.addressType()===ze.CROSSBORDER&&1===t.length&&(this.selectionChanged(this.getOption(t[0])),this.noPoints.emit(!1)),setTimeout(()=>{this.noPoints.emit(0===this.points.length),this.changeDetector.markForCheck()},3e3)},error:()=>{this.points=[],this.pointListSubject.next(this.getPointsOptions()),this.stopLoadingAnimationWithFailure(),this.noPoints.emit(!0)}}))}selectionChanged(t){if(this.selectedOption=t,this.selectedOption){let n=this.points.find(r=>r.id===this.selectedOption.key);n||(n=this.getPoint(this.selectedOption)),this.writeAndPropagateValue(n)}}opened(){this.onTouched()}registerOnChange(t){this.onChanged=t}registerOnTouched(t){this.onTouched=t}writeValue(t){t&&(this.selectedPoint=t,this.selectedOption=this.getOption(t))}addAndSelectPoint(t){t&&(this.points?this.points.includes(t)||this.points.push(t):this.points=[t]),this.pointListSubject.next(this.getPointsOptions()),t&&(this.selectedOption=this.getOption(t),this.writeAndPropagateValue(t)),this.noPoints.emit(!1)}handleDropDownCompletion(){this.haveMemorizedAddressDataChanged&&(this.memorizedSenderPoint||this.memorizedReceiverPoint)&&this.store.select(ct.J).pipe(Ri(t=>!t?.order?.shipment?.senderPoint&&!t.order?.shipment?.receiverPoint)).subscribe(t=>{setTimeout(()=>{const n=t.order.shipment.addons;let r=!1,o=!1;this.memorizedReceiverPoint&&(r=this.determineIfPointShouldBeLoaded(this.memorizedReceiverPoint.cashOnDeliveryAvailable,n)),this.memorizedSenderPoint&&(o=this.determineIfPointShouldBeLoaded(this.memorizedSenderPoint.cashOnDeliveryAvailable,n)),r&&this.setMemorizedPickupPoint(je.RECEIVER,this.memorizedReceiverPoint),o&&this.setMemorizedPickupPoint(je.SENDER,this.memorizedSenderPoint),this.dropDownComponent.refresh(),this.changeDetector.markForCheck()},50)})}determineIfPointShouldBeLoaded(t,n){const r=n.some(o=>"CASH_ON_DELIVERY"===o.category);return!!(r&&t||!r&&!t||!r&&t)}setMemorizedPickupPoint(t,n){if(this.shipmentSide()===t&&n&&!this.selectedPoint){const r=this.getOption(n);if(this.selectedPoint=n,this.selectionChanged(r),this.writeAndPropagateValue(n),this.dropDownComponent.data.some(o=>o.key===r.key)){const o=this.dropDownComponent.data.indexOf(this.dropDownComponent.data.filter(u=>u.key===r.key)[0]);this.dropDownComponent.highlightedResultItemIndex=o}}}highlightSuggestedPoint(){0!==this.points.length&&(0,q.z)([this.store.select(T.PE),this.store.select(T.T$)]).pipe((0,M.s)(1)).subscribe(([t,n])=>{const r=this.resolveSuggestedPointId(t,n);r&&(this.suggestedPoint=this.getSuggestedPointFromDraft(n),this.points.find(u=>u.id===r)?(this.suggestedPointId=r,this.setSuggestedPointUnavailable(null),this.pointListSubject.next(this.getPointsOptions()),this.noPoints.emit(!1)):this.setSuggestedPointUnavailable(r))})}resolveSuggestedPointId(t,n){const r=this.getSuggestedPointFromDraft(n);return r?.id?r.id:(this.shipmentSide()===je.SENDER?t?.senderAddress:t?.receiverAddress)?.pointId??null}getSuggestedPointFromDraft(t){return t?this.shipmentSide()===je.SENDER?t.sender:t.receiver:null}setSuggestedPointUnavailable(t){if(this.suggestedPointUnavailableEmittedFor===t)return;this.suggestedPointUnavailableEmittedFor=t;const n=t?{pointId:t,point:this.suggestedPoint}:null;setTimeout(()=>this.suggestedPointUnavailable.emit(n))}clearSelectionAfterPointBecameUnavailable(){const t=this.selectedOption?.key;if(this.dropDownComponent?.clearSelection(),this.selectedOption=null,this.writeAndPropagateValue(null),t){if(t===this.suggestedPointId)return this.suggestedPointId=null,void this.setSuggestedPointUnavailable(t);this.setSuggestedPointUnavailable(null)}}setPointFromTemplate(){if(!this.selectedPointsIds)return;const t=this.points.filter(n=>n.id===this.selectedPointsIds.senderPoint);t.length&&this.selectionChanged(this.getOption(t[0]))}stopLoadingAnimationWithSuccess(){this.disabled=!1,this.placeholder=this.chooseMessageTemplate.nativeElement.outerHTML,this.selectedPoint&&this.writeAndPropagateValue(null),this.changeDetector.markForCheck()}stopLoadingAnimationWithFailure(){this.disabled=!1,this.placeholder=this.errorMessageTemplate.nativeElement.outerHTML,this.changeDetector.markForCheck()}getPointsObservable(){return this.areAllGetPointsParamsSet()?this.store.select(T.Km).pipe((0,M.s)(1),(0,De.n)(t=>this.priceService.hasPointList(t)),(0,De.n)(t=>!1===t?(0,ve.of)([]):this.pointsService.getPoints({productId:this.productId(),isCashOnDeliveryAddonSelected:this.isCashOnDeliveryAddonSelected(),postCode:this.postCode(),type:this.t
1ype(),countryId:this.countryId(),addressType:this.addressType()}))):(0,ve.of)([])}areAllGetPointsParamsSet(){return 0===[this.productId(),this.postCode(),this.isCashOnDeliveryAddonSelected(),this.countryId(),this.addressType()].filter(r=>null==r).length}getPointsOptions(){const t=this.points.map(o=>this.getOption(o)),n=this.suggestedPointId?t.findIndex(o=>o.key===this.suggestedPointId):-1;if(n<0)return t;const[r]=t.splice(n,1);return[r,...t]}getOption(t){return{key:t.id,label:this.getLabel(t),isSuggested:!!this.suggestedPointId&&t.id===this.suggestedPointId}}getLabel(t){return`${t.id} ${t.city} ${t.postCode}, ${t.address}`}getPoint(t){let n;return this.store.select(T.Q7).pipe((0,U.p)(r=>!!r),(0,M.s)(1)).subscribe(r=>{n=this.getPoints(r)?.find(o=>o.id===t.key)}),n}writeAndPropagateValue(t){this.selectedPoint=t,this.onChanged(this.selectedPoint)}setMemorizedPoints(){this.store.select(T.PE).pipe((0,M.s)(1),(0,U.p)(t=>!!t)).subscribe(t=>{t.shipmentTemp&&(this.memorizedReceiverPoint=t.shipmentTemp.receiverPoint,this.memorizedSenderPoint=t.shipmentTemp.senderPoint),t.receiverAddressTemp&&t.senderAddressTemp&&(this.memorizedReceiverPoint||this.memorizedSenderPoint)&&(this.haveMemorizedAddressDataChanged=this.addressDataHasChanged(t))})}addressDataHasChanged(t){return!(!E()(this.getImportantAddressFields(t.senderAddressTemp),this.getImportantAddressFields(t.senderAddress))&&!E()(this.getImportantAddressFields(t.receiverAddressTemp),this.getImportantAddressFields(t.receiverAddress)))}getImportantAddressFields(t){return Y()(t,"city","street","houseNumber","postCode")}setSelectedPointIds(){this.store.select(ue.sc).pipe((0,U.p)(t=>!!t)).subscribe(t=>{t.senderAddress?.pointId&&(this.selectedPointsIds={senderPoint:t.senderAddress.pointId})})}setSearchedResult(t){this.dropDownComponent&&(this.dropDownComponent.pointsPending=!1),t&&(this.points=t,this.pointSearchService.total=this.points.length,this.pointListSubject.next(this.getPointsOptions()),this.pointSearchService.data.next(this.getPointsOptions()))}startLoadingAnimation(){this.disabled=!0,this.placeholder=this.loadingMessageTemplate.nativeElement.outerHTML}getPoints(t){return"SENDER"===this.shipmentSide()?t?.sender:t?.receiver}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(ki.U),e.rXU(xn.D),e.rXU(e.gRc),e.rXU(sd.y),e.rXU(v.il),e.rXU(fo.z),e.rXU(f.c$),e.rXU(ad.d))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-point-list"]],viewQuery:function(n,r){if(1&n&&(e.GBs(ld,7),e.GBs(cd,7),e.GBs(ud,7),e.GBs(ee.v,5)),2&n){let o;e.mGM(o=e.lsd())&&(r.loadingMessageTemplate=o.first),e.mGM(o=e.lsd())&&(r.chooseMessageTemplate=o.first),e.mGM(o=e.lsd())&&(r.errorMessageTemplate=o.first),e.mGM(o=e.lsd())&&(r.dropDownComponent=o.first)}},inputs:{productId:[1,"productId"],isCashOnDeliveryAddonSelected:[1,"isCashOnDeliveryAddonSelected"],postCode:[1,"postCode"],countryId:[1,"countryId"],type:[1,"type"],addressType:[1,"addressType"],chooseMessageTranslationKey:[1,"chooseMessageTranslationKey"],shipmentSide:[1,"shipmentSide"]},outputs:{noPoints:"noPoints",suggestedPointUnavailable:"suggestedPointUnavailable"},features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0},ki.U]),e.OA$],decls:21,vars:10,consts:[["loadingMessage",""],["chooseMessage",""],["errorMessage",""],["pointDropDown",""],["selectedItemTemplate",""],["resultItemTemplate",""],["ngClass","select2dropdown--small select2dropdown--nowrap","displayField","label",3,"dataSource","searchEnabled","ngModel","placeholder","disabled","isPointSearch","parentName"],[1,"loader","loader--gray"],["ngClass","select2dropdown--small select2dropdown--nowrap","displayField","label",3,"ngModelChange","opened","completed","dataSource","searchEnabled","ngModel","placeholder","disabled","isPointSearch","parentName"],[1,"point-option"],[1,"point-option__badge"],[1,"point-option__label"],[1,"point-option__label",3,"innerHTML"]],template:function(n,r){1&n&&(e.DNE(0,fd,6,7,"ardn-drop-down",6),e.j41(1,"template"),e.EFF(2,"\n  "),e.j41(3,"span",null,0),e.EFF(5),e.nI1(6,"translate"),e.j41(7,"div",7),e.EFF(8,"Loading..."),e.k0s(),e.EFF(9,"\n  "),e.k0s(),e.EFF(10,"\n  "),e.j41(11,"span",null,1),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.EFF(15,"\n  "),e.j41(16,"span",null,2),e.EFF(18),e.nI1(19,"translate"),e.k0s(),e.EFF(20,"\n"),e.k0s()),2&n&&(e.vxM(r.dataSource?
10:-1),e.R7$(5),e.SpI("\n    ",e.bMT(6,4,"COMMON.SEARCHING"),""),e.R7$(8),e.SpI("\n    ",e.bMT(14,6,r.chooseMessageTranslationKey()),"\n  "),e.R7$(5),e.SpI("\n    ",e.bMT(19,8,"POINT.CANNOT_GET_POINTS"),"\n  "))},dependencies:[l.YU,m.BC,m.vS,ee.v,f.D9,dd.v],styles:[".point-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;flex-wrap:wrap;gap:2px 6px;vertical-align:middle}.point-option__label[_ngcontent-%COMP%]{min-width:0}.point-option__badge[_ngcontent-%COMP%]{padding:1px 6px;border-radius:10px;background-color:#5bbd2c;color:#fff;font-size:11px;font-weight:600;line-height:16px;text-transform:uppercase;white-space:nowrap}"]})}}return i})();var Ui=s(97156);let Cd=(()=>{class i{constructor(t,n,r,o,u){this.formBuilder=t,this.store=n,this.changeDetector=r,this.pointsService=o,this.orderReturnService=u,this.shipmentSide=(0,e.hFB)(),this.carrierTypePaczkomat=(0,e.hFB)(!1),this.isCrossborder=(0,e.hFB)(!1),this.noPoints=new e.bkB,this.suggestedPointUnavailable=new e.bkB,this.pointListParameters={productId:null,isCashOnDeliveryAddonSelected:null,city:null,postCode:null,addressType:null,countryId:null,type:null},this.setAllPoints=!1,this.unsubscribeObservable=new re.B,this.onChanged=()=>{},this.onTouched=()=>{},this.form=t.group({selectedPoint:[null]})}ngOnInit(){this.store.select(T.PE).pipe((0,U.p)(t=>!!t.shipment&&!!t.receiverAddress&&!!t.senderAddress),(0,ce.B)(500),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{const n={productId:t.shipment.productId,isCashOnDeliveryAddonSelected:this.isCODAddonSelected(t.shipment.addons),city:"RECEIVER"===this.shipmentSide()?t.receiverAddress.city:t.senderAddress.city,postCode:"RECEIVER"===this.shipmentSide()?t.receiverAddress.postCode:t.senderAddress.postCode,countryId:"RECEIVER"===this.shipmentSide()?t.receiverAddress.countryId:t.senderAddress.countryId,type:this.pointsService.isWeeklyDeliveryAddonChecked(t?.shipment?.addons)?"APM":null,addressType:this.getPointAddressType()};E()(this.pointListParameters,n)||(this.pointListParameters=n),this.changeDetector.markForCheck()}),this.store.select(T.PE).pipe((0,U.p)(t=>!!t?.shipment?.mapModalShipmentPoint),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{const n=t?.shipment?.mapModalShipmentPoint;n?.shipmentPointType===this.shipmentSide()&&n?.selectedPoint&&(this.pointListComponent.addAndSelectPoint(n?.selectedPoint),this.store.dispatch(F.M.setMapModalShipmentParametersAction({selectedPoint:null})))}),this.setOnTouchPropagation(),this.form.get("selectedPoint").valueChanges.subscribe(t=>this.onChanged(t)),this.setPointsDuringOrderReturn()}ngOnDestroy(){this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}noPointsEvent(t){this.noPoints.emit(t)}registerOnChange(t){this.onChanged=t}registerOnTouched(t){this.onTouched=t}writeValue(t){t&&this.form.patchValue({selectedPoint:t})}getChooseMessageTranslationKey(){return this.carrierTypePaczkomat()?"RECEIVER"===this.shipmentSide()?"POINT.SELECT_RECEIVER_PARCEL_POINT":"POINT.SELECT_SENDER_PARCEL_POINT":"RECEIVER"===this.shipmentSide()?"POINT.SELECT_RECEIVER_POINT":"POINT.SELECT_SENDER_POINT"}isAllPointsSet(){return this.setAllPoints}isCODAddonSelected(t){return!!t&&void 0!==t.find(n=>"CASH_ON_DELIVERY"===n?.category)}setOnTouchPropagation(){const t=this.form.get("selectedPoint"),n=t.markAsTouched.bind(this);t.markAsTouched=()=>{n.apply(this),this.onTouched()}}selectPoint(t,n){const r=this.getPointAddressType(),o={productId:t?.selectedProduct?.id,isCashOnDeliveryAddonSelected:this.isCODAddonSelected(t?.shipment?.addons),addressType:r};this.pointsService.getPoints(o).subscribe(u=>{const g=u?.find(A=>A.id===n);this.store.dispatch(F.M.createSetShipmentOptionsAction(this.getShipmentSide(t,g))),this.pointListComponent.addAndSelectPoint(g)})}getPointAddressType(){switch(this.shipmentSide()){case"RECEIVER":return ze.RECEIVER;case"SENDER":return this.isCrossborder()?ze.CROSSBORDER:ze.SENDER}}getShipmentSide(t,n){return"RECEIVER"===this.shipmentSide()?{...t.shipment,receiverPoint:n}:{...t.shipment,senderPoint:n}}setPointsDuringOrderReturn(){this.store.select(ct.J).pipe((0,U.p)(t=>t?.ui?.pages?.order?.steps[3]?.isExpanded&&"ACTIVE"===t?.ui?.pages?.order?.steps[3]?.state&&!0===t?.order?.orderReturnStatus?.loaded),(0,v.Lt)(t=>t?.order),(0,ce.B)(300),(0,M.s)(1)).subscribe({next:t=>{t?.senderAddress?.pointId&&"SENDER"===this.shipmentSide()&&this.selectPoint(t,t?.senderAddress?.pointId),t?.receiverAddress?.pointId&&"RECEIVER"===this.shipmentSide()&&this.selectPoint(t,t?.receiverAddress?.pointId)},error:()=>{},complete:()=>{this.orderReturnService.stopGeneratingOrderReturn()}})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(m.ok),e.rXU(v.il),e.rXU(e.gRc),e.rXU(xn.D),e.rXU(Ui.M))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-point-selector"]],viewQuery:function(n,r){if(1&n&&e.GBs(Co,7),2&n){let o;e.mGM(o=e.lsd())&&(r.pointListComponent=o.first)}},inputs:{shipmentSide:[1,"shipmentSide"],carrierTypePaczkomat:[1,"carrierTypePaczkomat"],isCrossborder:[1,"isCrossborder"]}
1,outputs:{noPoints:"noPoints",suggestedPointUnavailable:"suggestedPointUnavailable"},features:[e.Jv_([{provide:m.kq,useExisting:(0,e.Rfq)(()=>i),multi:!0}])],decls:2,vars:9,consts:[[3,"formGroup"],["formControlName","selectedPoint",3,"noPoints","suggestedPointUnavailable","productId","isCashOnDeliveryAddonSelected","postCode","countryId","type","addressType","chooseMessageTranslationKey","shipmentSide"]],template:function(n,r){1&n&&(e.j41(0,"div",0)(1,"ardn-point-list",1),e.bIt("noPoints",function(u){return r.noPointsEvent(u)})("suggestedPointUnavailable",function(u){return r.suggestedPointUnavailable.emit(u)}),e.k0s()()),2&n&&(e.Y8G("formGroup",r.form),e.R7$(),e.Y8G("productId",r.pointListParameters.productId)("isCashOnDeliveryAddonSelected",r.pointListParameters.isCashOnDeliveryAddonSelected)("postCode",r.pointListParameters.postCode)("countryId",r.pointListParameters.countryId)("type",r.pointListParameters.type)("addressType",r.pointListParameters.addressType)("chooseMessageTranslationKey",r.getChooseMessageTranslationKey())("shipmentSide",r.shipmentSide()))},dependencies:[m.BC,m.cb,m.j4,m.JD,Co],styles:[".toggle-mode-button[_ngcontent-%COMP%]{cursor:pointer;margin:5px 0 20px;text-align:center;font-size:13px;color:#96c21f}"]})}}return i})(),_d=(()=>{class i{transform(t,n){return t.filter(r=>r.categoryName.startsWith(n+"_"))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=e.EJ8({name:"additionalCategoryAddons",type:i,pure:!0,standalone:!0})}}return i})();const Od=["receiverPoint"],yd=["senderPoint"],vd=["otherCategoryComponent"],Ed=["defaultCategoryComponent"],Sd=i=>({addonDescription:i}),bd=()=>["SHIPMENT_TYPE","PICKUP","TRADE_DOCUMENTS","DECLARED_VALUE","INSURANCE","INSURANCE_CARGO"],_o=i=>({pointName:i}),Pd=()=>({generate:"ORDER_PAGE.ORDER_CUSTOMS.ORDER_DECLARATION_GENERATE",edit:"ORDER_PAGE.ORDER_CUSTOMS.ORDER_DECLARATION_EDIT",action:"DASHBOARD_PAGE.INVOICE_GENERATOR_PAGE.MODAL.SAVE_AND_CLOSE_INVOICE"});function Ad(i,p){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"ardn-product-addon-shipment-type-category",30),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(3);return e.Njj(o.extendedAddonValidityChanged("SHIPMENT_TYPE",r))}),e.k0s()()}if(2&i){const t=e.XpG(3);e.R7$(),e.Y8G("formControlName","SHIPMENT_TYPE")("addonsCategory",t.productAddonsCategories.getAddons("SHIPMENT_TYPE"))("ardnDataTestId","ardn-product-addon-shipment-type-category-SHIPMENT_TYPE")}}function Rd(i,p){if(1&i&&(e.j41(0,"div"),e.DNE(1,Ad,2,3,"div"),e.k0s()),2&i){const t=p.$implicit;e.R7$(),e.vxM("SHIPMENT_TYPE"===t?1:-1)}}function Td(i,p){if(1&i&&(e.j41(0,"div")(1,"div",29),e.Z7z(2,Rd,2,1,"div",null,e.fX1),e.k0s()()),2&i){const t=e.XpG();e.R7$(),e.Y8G("formGroupName","addons"),e.R7$(),e.Dyx(t.productAddonsCategories.getCategories())}}function Id(i,p){if(1&i&&e.nrm(0,"ardn-product-addon-additional-info",38),2&i){const t=e.XpG().$implicit;e.Y8G("content",t.additionalInfo)("price",t.price)("currency",t.currency)("ardnDataTestId","ardn-order-shipment-options-step-form-"+(null==t?null:t.id)+"-product-addon-additional-info")}}function Dd(i,p){if(1&i&&e.nrm(0,"ardn-product-addon-additional-info",39),2&i){const t=e.XpG().$implicit;e.Y8G("options",e.eq3(3,Sd,t.description))("currency",t.currency)("ardnDataTestId","ardn-order-shipment-options-step-form-"+(null==t?null:t.id)+"-product-addon-additional-info")}}function Md(i,p){if(1&i&&(e.j41(0,"span",41),e.EFF(1,"i"),e.k0s()),2&i){const t=e.XpG().$implicit;e.Y8G("ardnTooltipster",t.description)}}function Fd(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",35)(1,"div",36)(2,"label")(3,"input",37),e.bIt("change",function(r){const o=e.eBV(t).$implicit,u=e.XpG(3);return e.Njj(u.toggleCourierWithLabelAddon(r.target,o))}),e.k0s(),e.j41(4,"span"),e.EFF(5),e.k0s()(),e.DNE(6,Id,1,4,"ardn-product-addon-additional-info",38)(7,Dd,1,5,"ardn-product-addon-additional-info",39),e.j41(8,"div",40),e.DNE(9,Md,2,1,"span",41),e.nrm(10,"ardn-product-addon-price",42),e.k0s()()()}if(2&i){const t=p.$implicit,n=e.XpG(3);e.R7$(3),e.Y8G("checked",t.checked)("disabled",n.courierWithLabelAddonsDisableSubject.value)("ardnDataTestId","ardn-order-shipment-options-step-form-"+(null==t?null:t.id)+"-input"),e.R7$(2),e.JRh(t.addonName),e.R7$(),e.vxM(t.additionalInfo?6:-1),e.R7$(),e.vxM(n.courierWithLabelAddonsDisableSubject.value?7:-1),e.R7$(2),e.vxM(t.description?9:-1),e.R7$(),e.Y8G("addonPrice",t.price)("addonInPrice",t.inPrice)("currency",t.currency)("ardnDataTestId","ardn-order-shipment-options-step-form-"+(null==t?null:t.id)+"-product-addon-price")}}function $d(i,p){if(1&i&&(e.j41(0,"div",32)(1,"fieldset",25)(2,"legend",8),e.nrm(3,"span",33),e.k0s(),e.j41(4,"div",34),e.Z7z(5,Fd,11,11,"div",35,e.fX1),e.k0s()()()),2&i){const t=e.XpG(2);e.R7$(5),e.Dyx(t.courierWithLabelAddons)}}function Nd(i,p){if(1&i&&(e.j41(0,"div",16),e.nrm(1,"ardn-pickup-date",31)(2,"ardn-field-validator",15),e.DNE(3,$d,7,0,"div",32),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("borderLess",!!t.courierWithLabelAddons.length)("ardnDataTestId","ardn-pickup-date"),e.R7$(),e.Y8G("clientSideValidation",t.shipmentOptionsForm.get("pickUpDate"))("clientErrorMessage","COMMON.ERRORS.DATE")("serverSideValidation",t.validationErrors.fields["pickup[date]"])("ardnDataTestId","ardn-order-shipment-options-step-form-pickUpDate-field-validator"),e.R7$(),e.vxM(t.courierWithLabelAddons.length?3:-1)}}function kd(i,p){if(1&i&&(e.j41(0,"span",41),e.EFF(1,"i"),e.k0s()),2&i){const t=e.XpG().$implicit;e.Y8G("ardnTooltipster",t.description)}}function Vd(i,p){if(1&i&&(e.j41(0,"div",46)(1,"label",47),e.nrm(2,"input",48),e.j41(3,"span"),e.EFF(4),e.k0s()(),e.j41(5,"div",40),e.DNE(6,kd,2,1,"span",41),e.nrm(7,"ardn-product-addon-price",42),e.k0s()()),2&i){const t=p.$implicit,n=e.XpG(3);e.R7$(),e.Mz_("for","collection-type-",t.category,""),e.Y8G("ardnDataTestId","ardn-order-shipment-options-step-form-"+(null==t?null:t.id)+"-collectionType-"+(null==t?null:t.category)+"-label"),e.R7$(),e.Mz_("id","collection-type-",t.category,""),e.FS9("value","PAID_PICKUP"!==t.category?t.category:"PICKUP"),e.Y8G("ardnDataTestId","ardn-order-shipment-options-step-form-"+(null==t?null:t.id)+"-collectionType-"+(null==t?null:t.category)+"-input"),e.R7$(2),e.JRh(t.addonName),e.R7$(2),e.vxM(n.isAddonCustom(t.id)?6:-1),e.R7$(),e.Y8G("addonPrice",t.price)("addonInPrice",t.inPrice)("currency",t.currency)("ardnDataTestId","ardn-order-shipment-options-step-form-"+(null==t?null:t.id)+"-collectionType-"+(null==t?null:t.category)+"-product-addon-price")}}function xd(i,p){if(1&i&&e.Z7z(0,Vd,8,13,"div",46,e.Vm6),2&i){const t=e.XpG(2);e.Dyx(t.pickupAddons)}}function Ud(i,p){1&i&&(e.j41(0,"div",43)(1,"label",49),e.nrm(2,"input",50)(3,"span",51),e.k0s()()),2&i&&(e.R7$(3),e.Y8G("defaultLabel","ORDER_PAGE.IN_TERMINAL"))}function Gd(i,p){if(1&i&&e.nrm(0,"ardn-product-addon-price",54),2&i){const t=e.XpG(3);e.Y8G("addonPrice",null==t.paidPickupAddon?null:t.paidPickupAddon.price)("addonInPrice",null==t.paidPickupAddon?null:t.paidPickupAddon.inPrice)("currency",null==t.paidPickupAddon?null:t.paidPickupAddon.currency)}}function Ld(i,p){1&i&&(e.j41(0,"span",55),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,1,"ORDER_PAGE.INCLUDED")))}
1function jd(i,p){if(1&i&&(e.j41(0,"div",44)(1,"label",52),e.nrm(2,"input",53),e.j41(3,"span"),e.EFF(4),e.nI1(5,"translate"),e.k0s()(),e.j41(6,"div",40),e.DNE(7,Gd,1,3,"ardn-product-addon-price",54)(8,Ld,3,3,"span",55),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(4),e.JRh(e.bMT(5,2,"ORDER_PAGE.CARRIER_COLLECTION_TYPE")),e.R7$(3),e.vxM(t.paidPickupAddon?7:8)}}function wd(i,p){if(1&i&&(e.j41(0,"div",45)(1,"label",56),e.nrm(2,"input",57)(3,"span",51),e.k0s(),e.j41(4,"div",40)(5,"a",58)(6,"span",41),e.nI1(7,"translate"),e.EFF(8,"i"),e.k0s()(),e.j41(9,"span",55),e.EFF(10),e.nI1(11,"translate"),e.k0s()()()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ardnDataTestId","ardn-order-shipment-options-step-form-collectionType-label"),e.R7$(),e.Y8G("ardnDataTestId","ardn-order-shipment-options-step-form-collectionType-input"),e.R7$(),e.Y8G("defaultLabel",t.carrierTypePaczkomat?"ORDER_PAGE.POINT_COLLECTION_PARCEL_LOCKER":"ORDER_PAGE.POINT_COLLECTION_TYPE"),e.R7$(3),e.Y8G("ardnTooltipster",e.bMT(7,5,"ORDER_PAGE.TERMINAL_ADDRESSES")),e.R7$(4),e.JRh(e.bMT(11,7,"ORDER_PAGE.INCLUDED"))}}function Bd(i,p){if(1&i&&(e.j41(0,"div",20),e.DNE(1,xd,2,0)(2,Ud,4,1,"div",43)(3,jd,9,4,"div",44)(4,wd,12,9,"div",45),e.k0s()),2&i){const t=e.XpG();e.Y8G("formGroup",t.shipmentOptionsForm),e.R7$(),e.vxM(t.pickupAddons&&!t.hasCollectionTypesInFilter?1:-1),e.R7$(),e.vxM(t.isCollectionTypeAvailableInProduct("CROSSBORDER")&&(t.hasCollectionTypesInFilter&&"CROSSBORDER"===t.filterCollectionType||!t.hasCollectionTypesInFilter)?2:-1),e.R7$(),e.vxM(t.hasCollectionTypesInFilter&&"PICKUP"===t.filterCollectionType||t.isCollectionTypeAvailableInProduct("PICKUP")&&t.isAddonCategoryAvailableInProduct("PAID_PICKUP")&&!t.hasCollectionTypesInFilter?3:-1),e.R7$(),e.vxM(t.isCollectionTypeAvailableInProduct("POINT")&&t.isAddonCategoryAvailableInProduct("PAID_SENDING_FROM_POINT")&&(t.hasCollectionTypesInFilter&&"POINT"===t.filterCollectionType||!t.hasCollectionTypesInFilter)?4:-1)}}function Xd(i,p){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"div",59)(2,"ardn-product-addon-declared-value-category",60),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG().$implicit,u=e.XpG(2);return e.Njj(u.extendedAddonValidityChanged(o,r))})("inputValueChanged",function(r){e.eBV(t);const o=e.XpG(3);return e.Njj(o.getInsuranceAndCODOrDeclaredValue(r,"DECLARED_VALUE"))}),e.k0s()()()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.R7$(),e.Y8G("formGroupName","addons"),e.R7$(),e.Y8G("formControlName",t)("addonsCategory",n.productAddonsCategories.getAddons(t))("serverValidationErrors",n.validationErrors)("ardnDataTestId","ardn-order-shipment-options-step-form-DECLARED_VALUE-ardn-product-addon-declaredValue-category")}}function Yd(i,p){1&i&&e.DNE(0,Xd,3,5,"div"),2&i&&e.vxM("DECLARED_VALUE"===p.$implicit?0:-1)}function Wd(i,p){if(1&i&&e.Z7z(0,Yd,1,1,null,null,e.fX1),2&i){const t=e.XpG();e.Dyx(t.productAddonsCategories.getCategories())}}function Hd(i,p){if(1&i&&(e.j41(0,"div")(1,"div",8)(2,"label",61)(3,"span",62)(4,"span",10),e.EFF(5),e.nI1(6,"translate"),e.nrm(7,"br"),e.j41(8,"span",63),e.EFF(9),e.nI1(10,"translate"),e.k0s()()()()(),e.j41(11,"div",13),e.nrm(12,"ardn-purpose-chooser",64)(13,"ardn-field-validator",15),e.k0s()()),2&i){const t=e.XpG();e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-shipment-options-step-form-purpose-label"),e.R7$(3),e.JRh(e.bMT(6,9,"ORDER_PAGE.PURPOSE")),e.R7$(4),e.JRh(e.bMT(10,11,"COMMON.REQUIRED")),e.R7$(3),e.Y8G("isCompany",t.isCompanyUser)("formControl",t.shipmentOptionsForm.controls.purpose),e.R7$(),e.Y8G("clientSideValidation",t.shipmentOptionsForm.get("purpose"))("clientErrorMessage","COMMON.ERRORS.REQUIRED")("serverSideValidation",t.validationErrors.fields.purpose)("ardnDataTestId","ardn-order-shipment-options-step-form-purpose-field-validator")}}function zd(i,p){1&i&&e.nrm(0,"div")}function Kd(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-cod-category",69),e.nI1(1,"async"),e.bIt("inputValueChanged",function(r){e.eBV(t);const o=e.XpG(4);return e.Njj(o.getInsuranceAndCODOrDeclaredValue(r,"COD"))})("validityChanged",function(r){e.eBV(t);const o=e.XpG(4);return e.Njj(o.extendedAddonValidityChanged("COD",r))})("cashOnDeliveryChanged",function(r){e.eBV(t);const o=e.XpG(4);return e.Njj(o.cashOnDeliveryChanged(r))}),e.k0s()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(2);e.Y8G("formControlName",t)("addonsCategory",n.productAddonsCategories.getAddons(t))("addonsServerValidationErrors",n.validationErrors.fields.addons)("codValues",e.bMT(1,5,n.codValues))("ardnDataTestId","ardn-order-shipment-options-step-form-CASH_ON_DELIVERY-ardn-product-addon-cod-category")}}function Qd(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-incoterms",30),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(4);return e.Njj(o.extendedAddonValidityChanged("DUTY",r))}),e.k0s()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(2);e.Y8G("formControlName",t)("addonsCategory",n.productAddonsCategories.getAddons(t))("ardnDataTestId","ardn-order-shipment-options-step-form-DUTY-ardn-product-addon-incoterms")}}function Jd(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-category",71,0),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(5);return e.Njj(o.extendedAddonValidityChanged(null==r?null:r.addonName,null==r?null:r.
1isValid))})("insuranceRequiredChanged",function(r){e.eBV(t);const o=e.XpG(3).$implicit,u=e.XpG(2);return e.Njj(u.productAddonCategoryInsuranceRequiredChanged(o,r))}),e.k0s()}if(2&i){const t=e.XpG(3).$implicit,n=e.XpG(2);e.Y8G("formControlName",t)("categoryTitle",t)("addonsCategory",n.productAddonsCategories.getAddons(t))("addonsServerValidationErrors",null==n.validationErrors.fields?null:n.validationErrors.fields.addons)("product",n.product)("ardnDataTestId","ardn-order-shipment-options-step-form-OTHER-ardn-product-addon-category")}}function Zd(i,p){if(1&i&&e.DNE(0,Jd,2,6,"ardn-product-addon-category",70),2&i){const t=e.XpG(2).$implicit,n=e.XpG(2);e.vxM(n.isCourierWithLabelOnlyAddonOption(t)?-1:0)}}function qd(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-category",72,1),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(4);return e.Njj(o.extendedAddonValidityChanged(null==r?null:r.addonName,null==r?null:r.isValid))})("insuranceRequiredChanged",function(r){e.eBV(t);const o=e.XpG(2).$implicit,u=e.XpG(2);return e.Njj(u.productAddonCategoryInsuranceRequiredChanged(o,r))}),e.k0s()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(2);e.Y8G("formControlName",t)("categoryTitle",t)("product",n.product)("addonsCategory",n.productAddonsCategories.getAddons(t))("addonsServerValidationErrors",null==n.validationErrors.fields?null:n.validationErrors.fields.addons)("ardnDataTestId","ardn-order-shipment-options-step-form-"+t+"-ardn-product-addon-category")}}function el(i,p){if(1&i&&e.DNE(0,Kd,2,7,"ardn-product-addon-cod-category",66)(1,Qd,1,3,"ardn-product-addon-incoterms",67)(2,Zd,1,1)(3,qd,2,6,"ardn-product-addon-category",68),2&i){let t;const n=e.XpG().$implicit;e.vxM("CASH_ON_DELIVERY"===(t=n)?0:"DUTY"===t?1:"OTHER"===t?2:3)}}function tl(i,p){if(1&i&&e.DNE(0,zd,1,0,"div")(1,el,4,1),2&i){const t=p.$implicit;e.vxM(e.lJ4(1,bd).includes(t)?0:1)}}function nl(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-product-addon-insurance-category",73),e.nI1(1,"additionalCategoryAddons"),e.nI1(2,"async"),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.extendedAddonValidityChanged("INSURANCE",r))})("inputValueChanged",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.getInsuranceAndCODOrDeclaredValue(r,"INSURANCE"))}),e.k0s()}if(2&i){const t=e.XpG(2);e.Y8G("formControlName","INSURANCE")("addonsCategory",t.productAddonsCategories.getAddons("INSURANCE"))("addonsAdditionalCategories",e.i5U(1,8,t.productAddonsCategories.productAddonsCategories,"INSURANCE"))("addonsServerValidationErrors",t.validationErrors.fields.addons)("defaultCashOnDelivery",t.defaultCashOnDelivery)("insuranceRequiredByAddon",t.isInsuranceRequiredByAddon)("isFreightForward",e.bMT(2,11,t.isFreightForwardObservable))("ardnDataTestId","ardn-order-shipment-options-step-form-INSURANCE-ardn-product-addon-insurance-category")}}function rl(i,p){if(1&i&&(e.j41(0,"div",22),e.Z7z(1,tl,2,2,null,null,e.fX1),e.DNE(3,nl,3,13,"ardn-product-addon-insurance-category",65),e.k0s()),2&i){let t;const n=e.XpG();e.Y8G("formGroupName","addons"),e.R7$(),e.Dyx(n.productAddonsCategories.getCategories()),e.R7$(2),e.vxM(null!=(t=n.productAddonsCategories.getCategories())&&t.includes("INSURANCE")||null!=(t=n.productAddonsCategories.getCategories())&&t.includes("INSURANCE_CARGO")?3:-1)}}function il(i,p){if(1&i&&(e.j41(0,"p",79),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i){const t=e.XpG(3);e.R7$(),e.SpI(" ",e.i5U(2,1,"POINT.SUGGESTED_POINT_UNAVAILABLE",e.eq3(4,_o,t.unavailableSuggestedSenderPointName))," ")}}function ol(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"POINT.DISPLAYING_DEDICATED_POINTS_INFO_PART")," "))}function sl(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"POINT.POINT_SELECTED")," "))}function al(i,p){if(1&i){const t=e.RV6();e.j41(0,"p",80),e.DNE(1,ol,3,3,"span")(2,sl,3,3,"span"),e.j41(3,"span",82),e.bIt("click",function(){e.eBV(t);const r=e.XpG(3);return e.Njj(r.showMapModal("SENDER"))}),e.EFF(4),e.nI1(5,"translate"),e.nI1(6,"translate"),e.k0s()()}if(2&i){const t=e.XpG(3);e.R7$(),e.vxM(t.isSelectedPoint("SENDER")?-1:1),e.R7$(),e.vxM(t.isSelectedPoint("SENDER")?2:-1),e.R7$(2),e.Lme(" ",e.bMT(5,4,"POINT.DISPLAYING_DEDICATED_POINTS_CHANGE_PART")," ",e.bMT(6,6,"ORDER_PAGE.SHOW_MODAL_MAP_LINK")," ")}}function dl(i,p){if(1&i){const t=e.RV6();e.j41(0,"p",83),e.bIt("click",function(){e.eBV(t);const r=e.XpG(3);return e.Njj(r.showMapModal("SENDER"))}),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"span",84),e.EFF(4),e.nI1(5,"translate"),e.nI1(6,"translate"),e.k0s()()}2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,3,"POINT.DISPLAYING_NO_POINTS_INFO")," "),e.R7$(3),e.Lme(" ",e.bMT(5,5,"POINT.DISPLAYING_CLICK")," ",e.bMT(6,7,"ORDER_PAGE.SHOW_MODAL_MAP_LINK")," "))}function ll(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-point-selector",77,2),e.bIt("noPoints",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.noPointsEvent(r,"SENDER"))})("suggestedPointUnavailable",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.suggestedPointUnavailableEvent(r,"SENDER"))}),e.k0s(),e.nrm(2,"ardn-field-validator",78),e.DNE(3,il,3,6,"p",79)(4,al,7,8,"p",80)(5,dl,7,9,"p",81)}if(2&i){const t=e.XpG(2);e.Y8G("shipmentSide","SENDER")("isCrossborder",t.isCrossborder)("carrierTypePaczkomat",t.carrierTypePaczkomat)("ardnDataTestId","ardn-order-shipment-options-step-SENDER-ardn-point-selector"),e.R7$(2),e.Y8G("clientSideValidation",t.shipmentOptionsForm.get("senderPoint"))("clientErrorMessage","COMMON.ERRORS.REQUIRED")("ardnDataTestId","ardn-order-shipment-options-step-form-senderPoint-field-validator"),e.R7$(),e.vxM(t.unavailableSuggestedSenderPointName&&!t.isSelectedPoint("SENDER")?3:-1),e.R7$(),e.vxM(!t.isNoPointsSender||t.isSelectedPoint("SENDER")?4:-1),e.R7$(),e.vxM(t.isNoPointsSender&&!t.isSelectedPoint("SENDER")?5:-1)}}function cl(i,p){1&i&&(e.j41(0,"div",76)(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&i&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"ORDER_PAGE.OPTIONS_STEP.SENDER_POINT_NOT_NEEDED")," "))}function ul(i,p){if(1&i&&(e.j41(0,"p",79),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i){const t=e.XpG(3);e.R7$(),e.SpI(" ",e.i5U(2,1,"POINT.SUGGESTED_POINT_UNAVAILABLE",e.eq3(4,_o,t.unavailableSuggestedReceiverPointName))," ")}}function pl(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"POINT.DISPLAYING_DEDICATED_POINTS_INFO_PART")," "))}function hl(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"POINT.POINT_SELECTED")," "))}function ml(i,p){if(1&i){const t=e.RV6();e.j41(0,"p",80),e.DNE(1,pl,3,3,"span")(2,hl,3,3,"span"),e.j41(3,"span",82),e.bIt("click",function(){e.eBV(t);const r=e.XpG(3);return e.Njj(r.showMapModal("RECEIVER"))}),e.EFF(4),e.nI1(5,"translate"),e.nI1(6,"translate"),e.k0s()()}if(2&i){const t=e.XpG(3);e.R7$(),e.vxM(t.isSelectedPoint("RECEIVER")?-1:1),e.R7$(),e.vxM(t.isSelectedPoint("RECEIVER")?2:-1),e.R7$(2),e.Lme(" ",e.bMT(5,4,"POINT.DISPLAYING_DEDICATED_POINTS_CHANGE_PART")," ",e.bMT(6,6,"ORDER_PAGE.SHOW_MODAL_MAP_LINK")," ")}}function gl(i,p){if(1&i){const t=e.RV6();e.j41(0,"p",83),e.bIt("click",function(){e.eBV(t);const r=e.XpG(3);return e.Njj(r.showMapModal("RECEIVER"))}),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"span",84),e.EFF(4),e.nI1(5,"translate"),e.nI1(6,"translate"),e.k0s()()}2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,3,"POINT.DISPLAYING_NO_POINTS_INFO")," "),e.R7$(3),e.Lme(" ",e.bMT(5,5,"POINT.DISPLAYING_CLICK")," ",e.bMT(6,7,"ORDER_PAGE.SHOW_MODAL_MAP_LINK")," "))}function fl(i,p){if(1&i){const t=e.RV6();
1e.j41(0,"div",8),e.EFF(1," \xa0 "),e.k0s(),e.j41(2,"div",13)(3,"ardn-point-selector",85,3),e.bIt("noPoints",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.noPointsEvent(r,"RECEIVER"))})("suggestedPointUnavailable",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.suggestedPointUnavailableEvent(r,"RECEIVER"))}),e.k0s(),e.nrm(5,"ardn-field-validator",78),e.DNE(6,ul,3,6,"p",79)(7,ml,7,8,"p",80)(8,gl,7,9,"p",81),e.k0s()}if(2&i){const t=e.XpG(2);e.R7$(3),e.Y8G("shipmentSide","RECEIVER")("carrierTypePaczkomat",t.carrierTypePaczkomat),e.R7$(2),e.Y8G("clientSideValidation",t.shipmentOptionsForm.get("receiverPoint"))("clientErrorMessage",t.getAppropriateErrorMessage())("ardnDataTestId","ardn-order-shipment-options-step-form-receiverPoint-field-validator"),e.R7$(),e.vxM(t.unavailableSuggestedReceiverPointName&&!t.isSelectedPoint("RECEIVER")?6:-1),e.R7$(),e.vxM(!t.isNoPointsReceiver||t.isSelectedPoint("RECEIVER")?7:-1),e.R7$(),e.vxM(t.isNoPointsReceiver&&!t.isSelectedPoint("RECEIVER")?8:-1)}}function Cl(i,p){if(1&i&&(e.j41(0,"fieldset",23)(1,"div",8)(2,"div",74)(3,"label",33)(4,"span",10),e.EFF(5),e.nI1(6,"translate"),e.j41(7,"span",12),e.EFF(8,"*"),e.k0s()(),e.j41(9,"span",75),e.nI1(10,"translate"),e.EFF(11,"i"),e.k0s()()()(),e.j41(12,"div",13),e.DNE(13,ll,6,10)(14,cl,4,3,"div",76),e.k0s(),e.DNE(15,fl,9,8),e.nI1(16,"async"),e.k0s()),2&i){const t=e.XpG();e.R7$(5),e.SpI(" ",e.bMT(6,4,"Crossborder"===(null==t.product||null==t.product.transport?null:t.product.transport.code)?"ORDER_PAGE.OPTIONS_STEP.TERMINAL":"ORDER_PAGE.OPTIONS_STEP.SENDER_RECEIVER_POINT")," "),e.R7$(4),e.Y8G("ardnTooltipster",e.bMT(10,6,"Crossborder"===(null==t.product||null==t.product.transport?null:t.product.transport.code)?"ORDER_PAGE.OPTIONS_STEP.CAN_SENT_TO_TERMINAL":"TOOLTIP.PARCEL_DELIVERY_POINT")),e.R7$(4),e.vxM(t.senderPointDisabled?13:14),e.R7$(2),e.vxM(e.bMT(16,8,t.isFieldRequired("receiverAddressPointId"))&&t.receiverPointDisabled?15:-1)}}function _l(i,p){if(1&i&&(e.j41(0,"div",90)(1,"div",91),e.nrm(2,"input",92)(3,"ardn-field-validator",15),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-shipment-options-step-form-referenceNumber-input"),e.R7$(),e.Y8G("clientSideValidation",t.shipmentOptionsForm.get("referenceNumber"))("clientErrorMessage","COMMON.ERRORS.INVALID")("serverSideValidation",t.validationErrors.fields.referenceNumber)("ardnDataTestId","ardn-order-shipment-options-step-form-referenceNumber-field-validator")}}function Ol(i,p){if(1&i&&(e.j41(0,"fieldset",24)(1,"legend",8)(2,"span",18),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"div",86)(6,"div",87)(7,"label",88),e.nrm(8,"input",89),e.j41(9,"span"),e.EFF(10),e.nI1(11,"translate"),e.k0s()(),e.j41(12,"span",75),e.nI1(13,"translate"),e.EFF(14,"i"),e.k0s()(),e.DNE(15,_l,4,5,"div",90),e.k0s()()),2&i){const t=e.XpG();e.R7$(3),e.JRh(e.bMT(4,6,"ORDER_PAGE.REFERENCE_NUMBER")),e.R7$(4),e.Y8G("ardnDataTestId","ardn-order-shipment-options-step-form-hasReferenceNumber-label"),e.R7$(),e.Y8G("ardnDataTestId","ardn-order-shipment-options-step-form-hasReferenceNumber-input"),e.R7$(2),e.JRh(e.bMT(11,8,"ORDER_PAGE.I_WANT_ADD_REFERENCE_NUMBER")),e.R7$(2),e.Y8G("ardnTooltipster",e.bMT(13,10,"TOOLTIP.MPK")),e.R7$(3),e.vxM(t.shipmentOptionsForm.value.hasReferenceNumber?15:-1)}}function yl(i,p){if(1&i&&(e.j41(0,"div",16)(1,"div",98),e.nrm(2,"ardn-number-input",99),e.k0s(),e.nrm(3,"ardn-field-validator",15),e.k0s()),2&i){const t=e.XpG(2);e.R7$(2),e.Y8G("maxFractionDigits",t.salesMarginPrecision)("min",0)("showArrow",!1)("ardnDataTestId","ardn-order-shipment-options-step-form-salesMargin-ardn-number-input"),e.R7$(),e.Y8G("clientSideValidation",t.shipmentOptionsForm.get("salesMargin"))("clientErrorMessage","COMMON.ERRORS.INVALID")("serverSideValidation",t.validationErrors.fields.salesMargin)("ardnDataTestId","ardn-order-shipment-options-step-form-salesMargin-field-validator")}}function vl(i,p){if(1&i&&(e.j41(0,"fieldset",25)(1,"legend",8)(2,"span",18),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"div",34)(6,"div",93)(7,"label",94),e.nrm(8,"input",95),e.j41(9,"span"),e.EFF(10),e.nI1(11,"translate"),e.k0s()()(),e.j41(12,"div",93)(13,"label",96),e.nrm(14,"input",97),e.j41(15,"span"),e.EFF(16),e.nI1(17,"translate"),e.k0s()()(),e.nrm(18,"ardn-field-validator",21),e.DNE(19,yl,4,8,"div",16),e.k0s()()),2&i){let t;const n=e.XpG();e.R7$(3),e.JRh(e.bMT(4,11,"ORDER_PAGE.PARCEL_POINT")),e.R7$(4),e.Y8G("ardnDataTestId","ardn-order-shipment-options-step-form-parcelMarginType-suggested-label"),e.R7$(),e.Y8G("ardnDataTestId","ardn-order-shipment-options-step-form-parcelMarginType-suggested-input"),e.BMQ("disabled",n.isSuggestedPrice?null:""),e.R7$(2),e.JRh(e.bMT(11,13,"ORDER_PAGE.PARCEL_POINT_SUGGESTED_MARGIN")),e.R7$(3),e.Y8G("ardnDataTestId","ardn-order-shipment-options-step-form-parcelMarginType-individual-label"),e.R7$(),e.Y8G("ardnDataTestId","ardn-order-shipment-options-step-form-parcelMarginType-individual-input"),e.R7$(2),e.JRh(e.bMT(17,15,"ORDER_PAGE.PARCEL_POINT_INDYVIDUAL_MARGIN")),e.R7$(2),e.Y8G("serverSideValidation",n.validationErrors.fields.parcelMarginType)("ardnDataTestId","ardn-order-shipment-options-step-form-parcelMarginType-field-validator"),e.R7$(),e.vxM("INDYVIDUAL"===(null==(t=n.shipmentOptionsForm.get("parcelMarginType"))?null:t.value)?19:-1)}}function El(i,p){if(1&i){const t=e.RV6();
1e.j41(0,"div")(1,"ardn-product-addon-trade-documents-category",100),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG().$implicit,u=e.XpG(2);return e.Njj(u.extendedAddonValidityChanged(o,r))}),e.k0s()()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.R7$(),e.Y8G("formControlName",t)("categoryTitle",t)("addonsCategory",n.productAddonsCategories.getAddons(t))("product",n.product)("ardnDataTestId","ardn-order-shipment-options-step-form-TRADE_DOCUMENTS-ardn-product-addon-category")}}function Sl(i,p){if(1&i&&(e.j41(0,"div"),e.DNE(1,El,2,5,"div"),e.k0s()),2&i){const t=p.$implicit;e.R7$(),e.vxM("TRADE_DOCUMENTS"===t?1:-1)}}function bl(i,p){if(1&i&&(e.j41(0,"div")(1,"div",59),e.Z7z(2,Sl,2,1,"div",null,e.fX1),e.k0s()()),2&i){const t=e.XpG();e.R7$(),e.Y8G("formGroupName","addons"),e.R7$(),e.Dyx(t.productAddonsCategories.getCategories())}}function Pl(i,p){if(1&i){const t=e.RV6();e.j41(0,"fieldset")(1,"legend",8)(2,"label",33),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"div",13)(6,"ardn-order-customs",102),e.bIt("isFormValid",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.orderCustomsValidityChanged(r))}),e.k0s()()()}if(2&i){const t=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,7,"ORDER_PAGE.ORDER_CUSTOMS.ORDER_DECLARATION")," "),e.R7$(3),e.Y8G("order",t.order)("orderFormType","ADD")("carrierName",t.carrierName)("validationErrors",t.validationErrors)("orderCustomsData",t.orderCustoms)("translations",e.lJ4(9,Pd))}}function Al(i,p){if(1&i&&(e.j41(0,"fieldset")(1,"label",101),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.DNE(4,Pl,7,10,"fieldset"),e.k0s()),2&i){const t=e.XpG();e.R7$(2),e.JRh(e.bMT(3,2,"DASHBOARD_PAGE.INVOICE_GENERATOR_PAGE.MODAL.ORDER_CUSTOMS_TITLE")),e.R7$(2),e.vxM(t.order?4:-1)}}function Rl(i,p){1&i&&(e.j41(0,"span",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.SENDER_RECEIVER_POINT")," "))}let Oo=(()=>{class i{constructor(t,n,r,o,u,g,A,N,w,te,ne,de,Fe,Le,it,we,$e){this.config=t,this.platformId=n,this.store=r,this.formBuilder=o,this.changeDetector=u,this.modalManagerService=g,this.pointsService=A,this.scrollService=N,this.countryService=w,this.orderService=te,this.pointSearchService=ne,this.translateService=de,this.orderCustomsService=Fe,this.codService=Le,this.userService=it,this.orderContentService=we,this.currencyPrecisionService=$e,this.validityChanged=(0,e.CGW)(),this.isPackageInMotion=(0,e.hFB)(),this.defaultCashOnDelivery=null,this.isInsuranceRequiredByAddon=!1,this.validationErrors={fields:{},general:[]},this.isNoPointsSender=!1,this.isNoPointsReceiver=!1,this.isSuggestedPrice=!1,this.addonsLoadingCompletionObservable=new re.B,this.courierWithLabelAddons=[],this.courierWithLabelAddonsDisableSubject=new Et.t(!1),this.carrierTypePaczkomat=!1,this.carrierName=null,this.senderPointDisabled=!1,this.receiverPointDisabled=!1,this.unavailableSuggestedSenderPointName=null,this.unavailableSuggestedReceiverPointName=null,this.isReceiverAndSenderPointEqual=this.store?.select(T._x),this.emptyOrderCustomsDeclarations=!1,this.isListInvoicesFiltered=!1,this.order=null,this.orderCustoms=null,this.hasCollectionTypesInFilter=!1,this.filterCollectionType=null,this.co
1dValues=null,this.orderLastState=null,this.extendedAddonValidity={},this.insuranceRequiredByAddonCategory={},this.customRequiredFieldsObservable=(0,ve.of)(ft.P.getEmptyCustomRequiredFields()),this.isSetValueFromDraft=!1,this.orderPriceDependencies=null,this.loadedAllPointsSides=new Set,this.receiverPointCodError=!1,this.updateAddonsParams=null,this.addonsFormValueChangesSubscribed=!1,this.timeoutHandle=null,this.areExtendedAddonValid=new Et.t(!0),this.isOrderCustomsValid=new Et.t(!0),this.destroyRef=(0,e.WQX)(e.abz),this.orderCurrency=(0,z.ot)(this.store.select(T.ig),{initialValue:null}),this.orderCustomsConfigSignal=(0,z.ot)(this.orderCustomsService.orderCustomsConfig$,{initialValue:null}),this.isOrderCustomsConfig=(0,e.EWP)(()=>!!this.orderCustomsConfigSignal()),(0,e.QZP)(()=>{this.currencyPrecisionService.currencies(),this.changeDetector.markForCheck()})}get salesMarginPrecision(){return this.currencyPrecisionService.getPrecision(this.orderCurrency())}ngAfterViewInit(){this.memorizedShipment?(this.setMemorizedPurpose(this.memorizedShipment.purpose),this.setMemorizedCollectionType(this.memorizedShipment.realCollectionType),this.setMemorizedReferenceNumber(this.memorizedShipment.referenceNumber),this.setMemorizedSalesMargin(),this.shipmentOptionsForm.updateValueAndValidity()):this.orderLastState&&(this.cachedAddonsToAdd=!0,this.productAddonsCategories&&this.orderLastState.shipment?.addons?.length&&this.setMemorizedAddons(this.orderLastState.shipment.addons)),!this.memorizedShipment&&this.addonsFromDraft&&this.setAddonsFromIntegrationDraft()}setAddonsFromIntegrationDraft(){let t=[];this.addonsLoadingCompletionObservable.pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(()=>{t=Object.keys(this.shipmentOptionsForm.get("addons").value),ws()(t,this.getCategoriesFromDraftAddons()).forEach(r=>{const o=this.addonsFromDraft.find(u=>u.category===r);switch(r){case"CASH_ON_DELIVERY":this.setCODAddonFromDraft(o);break;case"INSURANCE":this.setInsuranceValueFromDraft(o);break;case"DECLARED_VALUE":this.setDeclaredValueFromDraft(o)}})})}setDeclaredValueFromDraft(t){setTimeout(()=>{t&&(this.declaredValueAddonComponent.isSelectedCheckboxDeclaredValue=!0,this.declaredValueAddonComponent.declaredValueCategoryForm.get("declaredValue").patchValue(t.value))})}setInsuranceValueFromDraft(t){setTimeout(()=>{t&&(this.insuranceAddonComponent.isSelectedCheckboxInsurance=!0,this.insuranceAddonComponent.insuranceCategoryForm.get("insuranceValue").patchValue(t.value))})}setCODAddonFromDraft(t){setTimeout(()=>{const n=this.addonsFromDraft.find(r=>"INSURANCE"===r.category);t&&(this.codAddonComponent.isSelectedCashOnDelivery=!0,this.codAddonComponent.cashOnDeliveryValue=t.value,this.codAddonComponent.numberInputComponent.setValue(t.value)),n&&t.value<n.value&&setTimeout(()=>{this.setInsuranceValueFromDraft(n)},750),this.changeDetector.markForCheck()},500)}ngOnInit(){this.shipment=null,this.isCompanyUser="COMPANY"===this.userService.userData$.value?.address.type,this.store.select(T.PE).pipe((0,U.p)(n=>!!n),(0,z.pQ)(this.destroyRef)).subscribe(n=>{this.order=n}),this.store.select(ct.J).pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(n=>{this.orderLastState=n.order,this.orderService.cachedAddons.next(n.order.shipment.addons),this.memorizedShipment=n?.order?.shipmentTemp,this.carrierName=n?.order?.selectedProduct?.carrierName,this.carrierTypePaczkomat=n?.order?.selectedProduct?.carrierName?.toLowerCase()?.includes("inpost-paczkomaty"),n?.order?.shipment?.content&&this.getOrderCustomsConfig(n?.order)}),this.initForm(),this.getUserCodValues(),(0,q.z)([this.shipmentOptionsForm.valueChanges.pipe((0,X.T)(n=>Pi()(n))),this.areExtendedAddonValid,this.isOrderCustomsValid,this.store.select(T.k$)]).pipe((0,j.F)(E()),(0,ce.B)(100),(0,z.pQ)(this.destroyRef)).subscribe(([,n,r])=>{this.validityChanged.emit(this.shipmentOptionsForm.valid&&n&&r)}),(0,q.z)([this.store.select(T.PE),this.store.select(mt.pO),this.store.select(T.Bb)]).pipe((0,j.F)(E()),(0,z.pQ)(this.destroyRef)).subscribe(([n,r])=>{if(n?.orderDraftId&&!this.isSetValueFromDraft&&r){const o=r.filter(u=>u.draft.orderDraftId===n.orderDraftId)[0];o&&(this.setValuesFromDraft(o),this.isSetValueFromDraft=!0)}}),this.customRequiredFieldsObservable=this.store.select(T.ev),this.isLoggedInObservable=this.store.select(J.Ep),this.isFreightForwardObservable=this.store.select(T.Ed),(0,q.z)([this.store.select(T.Bb),this.store.select(T.PE),this.store.select(T.Ak),this.customRequiredFieldsObservable.pipe((0,j.F)(E()))]).pipe((0,j.F)(E()),(0,z.pQ)(this.destroyRef)).subscribe(([n,r,o,u])=>{this.timeoutHandle&&clearTimeout(this.timeoutHandle),r&&o&&this.initAddons(r,n,u)}),this.store.select(T.Ak).pipe((0,j.F)(),(0,U.p)(n=>!0===n),(0,pn.i)(1),(0,De.n)(()=>(0,q.z)([this.store.select(T.Bb),this.customRequiredFieldsObservable.pipe((0,j.F)(E()))]).pipe((0,M.s)(1))),(0,z.pQ)(this.destroyRef)).subscribe(([n,r])=>{this.productAddonsCategories&&(this.productAddonsCategories=vt.create(this.mergeCustomFieldsIntoAddons(n,r)),this.setAddons(this.productAddonsCategories),this.insuranceRequiredByAddonCategory={},this.isInsuranceRequiredByAddon=!1,this.changeDetector.markForCheck())}),this.customRequiredFieldsObservable.pipe((0,z.pQ)(this.destroyRef)).subscribe(n=>{n.purpose&&this.shipmentOptionsForm.get("purpose").setValidators(m.k0.required),n.senderAddressPointId&&(this.shipmentOptionsForm.get("senderPoint").setValue(null),this.shipmentOptionsForm.get("senderPoint").markAsUntouched(),this.shipmentOptionsForm.get("senderPoint").markAsPristine(),this.shipmentOptionsForm.get("senderPoint").setValidators(m.k0.required)),n.receiverAddressPointId&&(this.shipmentOptionsForm.get("receiverPoint").setValue(null),this.shipmentOptionsForm.get("receiverPoint").markAsUntouched(),this.shipmentOptionsForm.get("receiverPoint").markAsPristine(),this.shipmentOptionsForm.get("receiverPoint").setValidators(m.k0.required)),this.shipmentOptionsForm?.get("pickUpDate").updateV
1alueAndValidity(),this.changeDetector.markForCheck()}),this.shipmentOptionsForm?.get("collectionType")?.valueChanges.pipe((0,j.F)(E()),(0,z.pQ)(this.destroyRef)).subscribe(n=>{switch(this.setPickupAddon(this.shipmentOptionsForm.get("addons").value,n),n){case"PICKUP":this.shipmentOptionsForm.get("pickUpDate").setValidators(m.k0.required),this.shipmentOptionsForm.get("senderPoint").clearValidators(),this.shipmentOptionsForm.get("senderPoint").patchValue("");break;case"ORDERED_COURIER":this.shipmentOptionsForm.get("senderPoint").clearValidators(),this.shipmentOptionsForm.get("senderPoint").patchValue("");break;default:this.shipmentOptionsForm.get("pickUpDate").clearValidators()}return this.shipmentOptionsForm.get("pickUpDate").updateValueAndValidity(),this.shipmentOptionsForm.get("senderPoint").updateValueAndValidity(),this.isCrossborder="CROSSBORDER"===n,this.store.dispatch(F.M.createSetShipmentOptionsAction({collectionType:n}))}),this.store.select(T.Ff).pipe((0,z.pQ)(this.destroyRef)).subscribe(n=>{n&&(this.validationErrors={fields:this.moveDeclaredValueErrorsToCustoms(Ie()(n.fields,(r,o)=>o.match(/^(sender|receiver|user)Address/))),general:[]},this.changeDetector.markForCheck())}),this.store.select(T.pG).pipe((0,j.F)(E()),(0,U.p)(n=>!!n?.shipment?.productId),(0,z.pQ)(this.destroyRef)).subscribe(n=>{this.orderPriceDependencies=n});let t=!0;this.shipmentOptionsForm.get("content").valueChanges.pipe((0,$t.Z)(this.shipmentOptionsForm.get("content").value),(0,j.F)(),(0,z.pQ)(this.destroyRef)).subscribe(n=>{this.getOrderCustomsConfig({...this.order,shipment:{...this.order.shipment,content:n}}),t||this.refetchAddonsOnContentChange(n),t=!1}),this.shipmentOptionsForm.get("purpose")?.valueChanges.pipe((0,j.F)(),(0,z.pQ)(this.destroyRef)).subscribe(n=>{n!==this.order?.shipment?.purpose&&this.refetchAddonsOnContentChange(this.shipmentOptionsForm.get("content").value)}),this.store.select(J.tB).pipe((0,U.p)(n=>!!n),(0,z.pQ)(this.destroyRef)).subscribe(n=>{this.user=n,this.user.salesMargin&&(this.shipmentOptionsForm.get("parcelMarginType").valueChanges.pipe((0,z.pQ)(this.destroyRef)).subscribe(r=>{"INDYVIDUAL"===r?this.shipmentOptionsForm.get("salesMargin").setValidators(m.k0.required):this.shipmentOptionsForm.get("salesMargin").clearValidators(),this.shipmentOptionsForm.get("salesMargin").updateValueAndValidity()}),this.shipmentOptionsForm.get("salesMargin").valueChanges.subscribe(r=>{"INDYVIDUAL"===this.shipmentOptionsForm.get("parcelMarginType").value?this.store.dispatch(F.M.setSaleMarginAction(r)):this.store.dispatch(F.M.setSaleMarginAction(0))}))}),this.store.select(T.cd).pipe((0,U.p)(n=>!n.loading),(0,z.pQ)(this.destroyRef)).subscribe(n=>{if(!this.productAddonsCategories||!n.components?.addons?.length)return;const r=this.productAddonsCategories.productAddonsCategories;for(const o of r)for(const u of o.addonsGroup)for(const g of u.addons){const A=n.components.addons.find(N=>N.id===g.id);A&&(g.price=A.price,g.priceGross=A.priceGross)}this.changeDetector.detectChanges()}),this.store.select(T.xq).pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(n=>{this.addonsFromDraft=n}),this.statusCodHasChanged(),this.shipmentOptionsForm.get("pickUpDate")?.valueChanges.pipe((0,z.pQ)(this.destroyRef)).subscribe(n=>{if(n){const r=n instanceof Date?n:n.pickUpDate;if(!(r&&r instanceof Date))return;const o=new Date;r.setHours(0,0,0,0),o.setHours(0,0,0,0),r.getTime()===o.getTime()?this.courierWithLabelAddonsDisableSubject.next(!0):this.courierWithLabelAddonsDisableSubject.next(!1)}}),this.store.select(T.Q7).pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(()=>{this.setSubscriberForCourierWithLabelAddonsRepopulation()}),this.checkIfCountriesNotEqualAndOutsideUE(),this.orderCustomsDeclarationsSource=this.orderCustomsService.createOrderCustomsDataSource(),this.store.select(T.$I).pipe((0,z.pQ)(this.destroyRef)).subscribe(n=>{this.senderPointDisabled="POINT"===n?.collectionType||"CROSSBORDER"===n?.collectionType,this.receiverPointDisabled="POINT"===n?.deliveryType||"CROSSBORDER"===n?.deliveryType}),this.store.select(T.pu).pipe((0,z.pQ)(this.destroyRef)).subscribe(n=>{n&&(this.orderCustoms={id:"",orderNumber:"",fields:n})})}verifyDataLength(t){this.emptyOrderCustomsDeclarations=0===t}isFilteredData(t){t&&(this.isListInvoicesFiltered=!0)}selectOrderCustoms(t){this.orderCustoms=t}initAddons(t,n,r){if(t.selectedProduct&&n&&Oe()(this.shipmentOptionsForm.value.addons)){const o=this.setOrder(t.selectedProduct.addons);if(this.productAddonsCategories=vt.create(this.mergeCustomFieldsIntoAddons(o,r)),this.productAddonsCategories.addCategory("SHIPMENT_TYPE"),this.setAddons(this.productAddonsCategories),this.pickupAddons=this.getPickupAddons(),this.cachedAddonsToAdd){const g=this.orderLastState.shipment.addons?.length?Xs()(this.orderLastState.shipment.addons,this.pickupAddons,"id")[0]:null,A="PAID_PICKUP"===g?.category?"PICKUP":g?.category;this.setMemorizedPurpose(this.orderLastState.shipment.purpose),this.setMemorizedContent(this.orderLastState.shipment.content),this.setMemorizedCollectionType(A||this.orderLastState.shipment.collectionType),this.setMemorizedReferenceNumber(this.orderLastState.shipment.referenceNumber),this.setMemorizedAddons(this.orderLastState.shipment.addons),this.setMemorizedPoint("RECEIVER",this.orderLastState.shipment.receiverPoint),this.setMemorizedPoint("SENDER",this.orderLastState.shipment.senderPoint),this.orderLastState.shipment.pickUpDate&&this.setPickup({pickUpDate:this.orderLastState.shipment.pickUpDate,pickUpTimeFrom:this.orderLastState.shipment.pickUpTimeFrom,pickUpTimeTo:this.orderLastState.shipment.pickUpTimeTo}),this.isOrderCustomsValid.next(!this.orderCustomsComponent||this.orderCustomsComponent.validate())}this.courierWithLabelAddons=this.getCourierWithLabelAddons(),this.changeDetector.markForCheck(),this.addonsLoadingCompletionObservable.next();const u=t.shipment;u&&"object"==typeof u&&(this.shipment=u)}}getCourierWithLabelAddons(){const t=Object.assign({},this.productAddonsCategories.getAddons("OTHER")),n=[];if(t?.addonsGroup)for(const r of t.addonsGroup){const o=Array.isArray(r.addons)?r.addons[0]:r.addons;"COURIER_WITH_LABEL"===o.category&&n.push(Object.assign({},o))}return n}isCollectionTypeAvailableInProduct(t){return this.product?.collectionTypes?.includes(t)}isAddonCategoryAvailableInProduct(t){return this.pickupAddons?.every(n=>n?.category!==t)}get paidPickupAddon(){return this.pickupAddons?.find(t=>"PAID_PICKUP"===t?.category)}noPointsEvent(t,n){n===je.SENDER?this.isNoPointsSender=t:this.isNoPointsReceiver=t,this.changeDetector.markForCheck()}suggestedPointUnavailableEvent(t,n){const r=t?t.point?.name||t.pointId:null;n===je.SENDER?this.unavailableSuggestedSenderPointName=r:this.unavailableSuggestedReceiverPointName=r,this.changeDetector.markForCheck()}cashOnDeliveryChanged(t){this.defaultCashOnDelivery=t,this.orderPriceDependencies.cashOnDeliveryValue=t?.number,this.store.dispatch(F.M.createGetOrderPriceAction(this.orderPriceDependencies)),this.updateAddons(t?.number)}productAddonCategoryInsuranceRequiredChanged(t,n){this.insuranceRequiredByAddonCategory[t]=n,this.isInsuranceRequiredByAddon=Object.values(this.insuranceRequiredByAddonCategory).some(Boolean)}refetchAddonsOnContentChange(t){this.order&&this.getParams(this.updateAddonsParams??0,t).pi
1pe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(n=>{this.store.dispatch(F.M.createGetProductAddonsAction(n))})}updateAddons(t){"number"==typeof t&&this.getParams(t).pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(n=>{this.store.dispatch(F.M.createGetProductAddonsAction(n)),this.updateAddonsParams=t})}getParams(t,n){return this.store.select((0,T.YD)(t,n??this.shipmentOptionsForm.value.content)).pipe((0,M.s)(1))}setOrder(t){if(t?.length){let n=-1,r=-1,o=null,u=null;const g=[];for(let A=0;A<t?.length;A++)"CASH_ON_DELIVERY"===t[A].categoryName&&n<0&&(n=A,o=t[A]);n>=0&&(g.push(o),t.splice(n,1));for(let A=0;A<t?.length;A++)"INSURANCE"===t[A].categoryName&&r<0&&(r=A,u=t[A]);return r>=0&&(g.push(u),t.splice(r,1)),[...g,...t]}return t}initForm(){this.store.select(ue.b8).pipe((0,U.p)(t=>!!t)).pipe((0,z.pQ)(this.destroyRef)).subscribe(t=>{let n,r=this.carrierTypePaczkomat?"POINT":"PICKUP";this.hasCollectionTypesInFilter=(t?.collectionTypes??[]).some(o=>o&&"object"==typeof o&&"collectionTypes"===o.property&&"ALL"!==o.value),(0,l.UE)(this.platformId)&&(n=this.readStoredContent()),this.hasCollectionTypesInFilter&&(this.filterCollectionType=t?.collectionTypes?.[0].value,r=this.filterCollectionType),this.shipmentOptionsForm=this.formBuilder.group({content:[n,m.k0.required],pickUpDate:[null],collectionType:[r],hasInstructions:[!1],instructions:[],hasReferenceNumber:[!1],referenceNumber:[null,m.k0.compose([m.k0.maxLength(15),oe.RT])],purpose:"",senderPoint:null,receiverPoint:null,addons:{},hasPostingCashOnDelivery:[!1],parcelMarginType:["SUGGESTED"],salesMargin:[null]})}),this.store.select(T.C4).pipe((0,M.s)(1),(0,z.pQ)(this.destroyRef)).subscribe(t=>{this.product=t,this.product?.collectionTypes?.length&&!(this.product.collectionTypes.length>1)&&(this.shipmentOptionsForm.patchValue(this.hasCollectionTypesInFilter?{collectionType:this.filterCollectionType}:{collectionType:this.product.collectionTypes[0]}),this.dispatchData())})}get addons(){return this.shipmentOptionsForm.get("addons")}extendedAddonValidityChanged(t,n){this.extendedAddonValidity[t]=n,this.areExtendedAddonValid.next(-1===Object.values(this.extendedAddonValidity).indexOf(!1)),this.shipmentOptionsForm.updateValueAndValidity()}getInsuranceAndCODOrDeclaredValue(t,n){const r=this.shipmentOptionsForm.value?.addons?.CASH_ON_DELIVERY?.find(o=>!!o.options.value);"COD"===n?this.orderPriceDependencies.cashOnDeliveryValue=t:"INSURANCE"===n?(this.orderPriceDependencies.insuranceValue=t,r&&(this.orderPriceDependencies.cashOnDeliveryValue=r.options.value)):"DECLARED_VALUE"===n&&(this.orderPriceDependencies.declaredValue=t),this.store.dispatch(F.M.createGetOrderPriceAction(this.orderPriceDependencies))}setPickupAddon(t,n){if("POINT"!==n){if(this.pickupAddons?.length>0)for(const r in t)if("PICKUP"===r){const o="PICKUP"===n?"PAID_PICKUP":"ORDERED_COURIER",u=this.pickupAddons.find(A=>A.category===o),g=[];u&&g.push(u),t[r]=g;break}}else for(const r in t)if("PICKUP"===r){t[r]=[];break}}setAddons(t){t.getCategories()?.includes("INSURANCE_CARGO")&&!t.getCategories()?.includes("INSURANCE")&&t.addCategory("INSURANCE");const n=t.getCategories(),r=this.shipmentOptionsForm.get("addons");if(r instanceof m.gE){const o=Object.keys(r.controls);o.filter(u=>!n.includes(u)).forEach(u=>r.removeControl(u)),n.filter(u=>!o.includes(u)).forEach(u=>r.addControl(u,new m.MJ([])))}else{const o={};for(const u of n)o[u]=new m.MJ([]);this.shipmentOptionsForm.setControl("addons",this.formBuilder.group(o))}this.addonsFormValueChangesSubscribed||(this.addonsFormValueChangesSubscribed=!0,this.shipmentOptionsForm.get("addons").valueChanges.pipe((0,z.pQ)(this.destroyRef)).subscribe(o=>{this.setPickupAddon(o,this.shipmentOptionsForm.get("collectionType").value);const u=[].concat(...Object.values(o));E()(u,this.order.shipment.addons)||this.store.dispatch(F.M.createSetSelectedAddonsAction(u))})),this.subscribeToIncotermChangesForCustomsConfig()}subscribeToIncotermChangesForCustomsConfig(){const t=this.shipmentOptionsForm.get("addons")?.get("DUTY");t&&(this.incotermChangesSubscription?.unsubscribe(),this.incotermChangesSubscription=t.valueChanges.pipe((0,X.T)(n=>n?.[0]?.category),(0,j.F)(),(0,$t.Z)(null),(0,lr.J)(),(0,U.p)(([n,r])=>"DUTY_DDP_MARKETPLACE"===n||"DUTY_DDP_MARKETPLACE"===r),(0,X.T)(([,n])=>n),(0,z.pQ)(this.destroyRef)).subscribe(n=>{const r="DUTY_DDP_MARKETPLACE"===n?"DUTY_DDP_MARKETPLACE":void 0;this.store.dispatch(F.M.resetSetOrderCustoms()),this.orderCustomsService.clearOrderCustomConfig(),this.orderCustomsService.getOrderCustomsConfig({senderCountry:this.order?.senderAddress?.countryId,receiverCountry:this.order?.receiverAddress?.countryId,content:this.order?.shipment?.content,name:this.carrierName,...r?{incoterm:r}:{}}).subscribe(()=>{this.isOrderCustomsValid.next(!this.isOrderCustomsConfig())})}))}isFieldRequired(t){return this.customRequiredFieldsObservable.pipe((0,X.T)(n=>!!n&&n[t]))}getPickupAddons(){const t=Object.assign({},this.productAddonsCategories.getAddons("PICKUP")),n=[];if(t&&t.addonsGroup)for(const r of t.addonsGroup){const o=Array.isArray(r.addons)?r.addons[0]:r.addons;"PAID_PICKUP"===o?.category&&o?.price>0&&(o.options.value=o.price),n.push(Object.assign({},o))}return n}dispatchData(){const t=this.shipmentOptionsForm.value.addons,n=this.shipmentOptionsForm.getRawValue().collectionType;let r=[].concat(...Object.values(t));r?.length&&(r=r.map(u=>"CASH_ON_DELIVERY"===u.category&&u?.options?this.updateBankAccountNumber(u):u),("ORDERED_COURIER"===n||"PICKUP"===n&&this.product&&this.config.customCollectionTypeCarriersToProductAddon.productsIds.some(u=>u===this.product?.id))&&(r=r.filter(u=>!this.config.customCollectionTypeCarriersToProductAddon.addonsIds.includes(u.id))));const o={content:this.shipmentOptionsForm.value.content,pickUpDate:this.shipmentOptionsForm.value.pickUpDate?new Date(this.shipmentOptionsForm.value.pickUpDate.pickUpDate):null,pickUpTimeFrom:this.shipmentOptionsForm.value.pickUpDate?this.shipmentOptionsForm.value.pickUpDate.pickUpTimeFrom:"",pickUpTimeTo:this.shipmentOptionsForm.value.pickUpDate?this.shipmentOptionsForm.value.pickUpDate.pickUpTimeTo:"",collectionType:"ORDERED_COURIER"===n?"PICKUP":n,realCollectionType:n,instructions:this.shipmentOptionsForm.value.hasInstructions?this.shipmentOptionsForm.value.instructions:null,referenceNumber:this.shipmentOptionsForm.value.hasReferenceNumber?this.shipmentOptionsForm.value.referenceNumber:null,purpose:this.shipmentOptionsForm.value.purpose??null,senderPoint:this.shipmentOptionsForm.value.senderPoint??null,receiverPoint:this.shipmentOptionsForm.value.receiverPoint?this.canPointBeDispatched(this.shipmentOptionsForm.value.receiverPoint):null,addons:r};this.store.dispatch(F.M.createSetShipmentOptionsAction(o)),this.changeDetector.markForCheck()}canPointBeDispatched(t){return this.shipmentOptionsForm.get("addons").get("CASH_ON_DELIVERY")?t.cashOnDeliveryAvailable||Oe()(this.shipmentOptionsForm.get("addons").get("CASH_ON_DELIVERY").value)?(this.receiverPointCodError=!1,t):(this.earlierReceiverPoint=t,this.shipmentOptionsForm.get("receiverPoint").patchValue(""),this.receiverPointCodError=!0,this.shipmentOptionsForm.value.senderPoint&&(this.earlierSenderPoint=this.shipmentOptionsForm.value.senderPoint),null):t}getAppropriateErrorMessage(){return this.receiverPointCodError?"COMMON.ERRORS.POINTS_COD_MISMATCH":"COMMON.ERRORS.REQUIRED"}statusCodHasChanged(){this.store.select(T.PV).subscribe(n=>{!n&&this.earlierReceiverPoint&&this.shipmentOptionsForm&&!this.shipmentOptionsForm.value.receiverPoint&&(this.store.dispatch(F.M.setMapModalShipmentParametersAction({selectedPoint:this.earlierReceiverPoint})),this.receiverPointSelector.pointListComponent.addAndSelectPoint(this.earlierReceiverPoint),this.earlierSenderPoint&&setTimeout(()=>{this.senderPointSelector.pointListComponent.addAndSelectPoint(this.earlierSenderPoint)},150))})}updateBankAccountNumber(t){if(!t.options.bankAccountNumber)return t;let n=t.options.bankAccountNumber;n=n.replace(/\s/g,"");const r=n?.match(/^[a-zA-Z]{2}/g);return r&&r.some(o=>"PL"!==o)?t.options.bankAccountNumber=n:-1===n.indexOf("PL")&&(n=n.replace(/\D/g,""),n="PL"+n),t.options.bankAccountNumber=n,t}validate(){this.store.dispatch(F.M.createResetSelectedPaymentOptionAction()),this.store.dispatch(F.M.createResetSelectedPaymentMethodOptionAction());const t=[];this.changeDetector.markForCheck(),Object.keys(this.shipmentOptionsForm.controls).forEac
1h(r=>{const o=this.shipmentOptionsForm.get(r);t.push(r),o.markAsTouched({onlySelf:!0})});let n=!this.pastCategoryComponent?.isDisabledSelectAndValidOnLoad&&this.pastCategoryComponent?.shipmentTypeCategoryChanges?this.scrollService?.scrollToFieldId("shipmentType-fourth-step"):this.scrollService?.findInvalidFieldAndScroll(t,this.shipmentOptionsForm,"-fourth-step");this.pastCategoryComponent&&this.pastCategoryComponent.validate(),this.insuranceAddonComponent&&(n=this.insuranceAddonComponent.validate(n)),this.codAddonComponent&&this.codAddonComponent.validate(n),this.declaredValueAddonComponent&&(n=this.declaredValueAddonComponent.validate(n)),this.orderCustomsComponent&&this.isOrderCustomsValid.next(this.orderCustomsComponent.validate()),this.otherCategoryComponent&&this.otherCategoryComponent.validate(n),this.defaultCategoryComponent&&this.defaultCategoryComponent.validate(n)}ngOnDestroy(){this.pointSearchService.searchTextSubject.next("")}getUserCodValues(){this.codValues=this.codService.getCods().pipe((0,X.T)(t=>t?t.map(n=>({...n})):null))}setValuesFromDraft(t){if(this.productAddonsCategories)for(const n of this.productAddonsCategories.getCategories()){const o=this.productAddonsCategories.getAddons(n).addonsGroup.map(u=>u.addons).reduce((u,g)=>u.concat(g)).filter(u=>t.draft?.addons.map(g=>g.id).includes(u.id));this.addons.get(n).patchValue(o)}t.draft.referenceNumber&&(this.shipmentOptionsForm.get("hasReferenceNumber").patchValue(!0),this.shipmentOptionsForm.get("referenceNumber").patchValue(t.draft.referenceNumber))}clearValidationErrors(){this.validationErrors={fields:{},general:[]}}checkCorrectionsData(){let t=null,n=null;return this.validate(),!(this.pastCategoryComponent&&!this.pastCategoryComponent.validate()||!this.shipmentOptionsForm.valid||(this.codAddonComponent&&(t=this.codAddonComponent.checkCorrectionsData()),this.insuranceAddonComponent&&(n=this.insuranceAddonComponent.checkCorrectionsData()),!1===t||!1===n))&&(!(!t||!n)||!(this.orderCustomsComponent&&!this.orderCustomsComponent.validate())&&void 0)}showMapModal(t){this.loadedAllPointsSides.has(t)||(this.loadedAllPointsSides.add(t),this.getAllShipmentPointsFromApi(t)),this.store.dispatch(F.M.setMapModalShipmentPointTypeAction(t)),this.modalManagerService.open("modal-order-map")}isSelectedPoint(t){return!!(t===je.SENDER?this.shipmentOptionsForm.value.senderPoint:this.shipmentOptionsForm.value.receiverPoint)}getAllShipmentPointsFromApi(t){const n=this.shipment.productId,r=this.shipment?.senderCountryId,o=this.shipment?.receiverCountryId,u=this.shipment?.mapModalShipmentPoint?.allPoints;this.store.dispatch(F.M.resetMapModalShipmentParametersAction()),(t===je.SENDER?"POINT"===this.shipment?.collectionType?this.pointsService.getPoints({productId:n,isCashOnDeliveryAddonSelected:!1,addressType:this.isCrossborder?ze.CROSSBORDER:ze.SENDER,countryId:r}):(0,ve.of)([]):"POINT"===this.shipment?.deliveryType?this.pointsService.getPoints({productId:n,isCashOnDeliveryAddonSelected:!1,addressType:ze.RECEIVER,countryId:o}):(0,ve.of)([])).pipe((0,z.pQ)(this.destroyRef)).subscribe(A=>{this.store.dispatch(F.M.setMapModalShipmentParametersAction({isLoading:!1,allPoints:{sender:t===je.SENDER?A:u?.sender??null,receiver:t===je.RECEIVER?A:u?.receiver??null}}))})}hasSuggestedPrice(t){return this.isSuggestedPrice=t,this.isSuggestedPrice||(this.shipmentOptionsForm.get("parcelMarginType").setValue("INDYVIDUAL"),this.shipmentOptionsForm.get("parcelMarginType").updateValueAndValidity()),t}updateForm(){this.shipmentOptionsForm?.updateValueAndValidity(),this.select2OptionalInputComponent?.changeDetector?.markForCheck(),this.dispatchData()}setPickup(t){this.shipmentOptionsForm.get("pickUpDate").setValue(t)}setMemorizedPoint(t,n){if(n)switch(t){case"SENDER":this.shipmentOptionsForm.get("senderPoint")&&this.shipmentOptionsForm.get("senderPoint").setValue(n);break;case"RECEIVER":this.shipmentOptionsForm.get("receiverPoint")&&this.shipmentOptionsForm.get("receiverPoint").setValue(n)}}setMemorizedPurpose(t){if(t){const n=this.purposeChooserComponent.purposeList.filter(r=>r.key===t)[0];this.purposeChooserComponent.initPurpose=n,this.purposeChooserComponent.writeAndPropagateValue(n)}}readStoredContent(){const t=localStorage?.getItem(K.B);if(!t)return"";const n=JSON.parse(t);return n?.canonical??(n?.text||n?.label)??""}setMemorizedContent(t){t&&(0,q.z)([this.countryService.getCountryByCountryId(this.shipment?.senderCountryId),this.countryService.getCountryByCountryId(this.shipment?.receiverCountryId)]).pipe((0,M.s)(1),(0,U.p)(([n,r])=>!!n?.isoCode&&!!r?.isoCode),(0,De.n)(([n,r])=>this.orderContentService.getOrderContents({productId:this.product?.id,senderCountry:n?.isoCode,receiverCountry:r?.isoCode})),(0,z.pQ)(this.destroyRef)).subscribe(n=>{const r=(0,ta.k)(n.contentDefinitions,t);if(r)return(0,l.UE)(this.platformId)&&localStorage?.setItem(K.B,JSON.stringify({label:r.label,canonical:r.canonical,text:""})),void this.shipmentOptionsForm.get("content").patchValue(r.canonical);if(n.allowOtherContent){const o=this.translateService.instant("ORDER.CONTENT_OTHER_LABEL");(0,l.UE)(this.platformId)&&localStorage?.setItem(K.B,JSON.stringify({label:o,canonical:null,text:t})),this.shipmentOptionsForm.get("content").patchValue(t)}})}setMemorizedCollectionType(t){this.shipmentOptionsForm.get("collectionType").patchValue(t)}setMemorizedReferenceNumber(t){t?this.shipmentOptionsForm.get("hasReferenceNumber").patchValue(!0):this.shipmentOptionsForm.get("hasReferenceNumber").patchValue(!1),this.shipmentOptionsForm.get("referenceNumber").patchValue(t)}setMemorizedAddons(t){t&&this.productAddonsCategories?(this.orderService.isApplyingRestoredAddons=!0,this.productAddonsCategories.getCategories().forEac
1h(r=>{if("INSURANCE_CARGO"===r)return;const o=this.productAddonsCategories.getAddons(r).addonsGroup,u=[];t.forEach(g=>{"INSURANCE"===r?g.category.includes(r)&&u.push(g):o.find(N=>N.addons.find(w=>w.id===g.id))&&u.push(g)}),this.shipmentOptionsForm.get("addons").get(r).setValue(u)}),this.orderService.isApplyingRestoredAddons=!1,this.cachedAddonsToAdd=!1):this.cachedAddonsToAdd=!1}setMemorizedSalesMargin(){let t,n;this.store.select(ct.J).pipe((0,M.s)(1)).subscribe(o=>{t=o.order.salesMarginTemp,n=o.order.salesMargin}),t!==n&&(t?this.shipmentOptionsForm.get("parcelMarginType").patchValue("INDYVIDUAL"):this.shipmentOptionsForm.get("parcelMarginType").patchValue("SUGGESTED"),this.shipmentOptionsForm.get("salesMargin").patchValue(t))}isAddonCustom(t){return this.config.customCollectionTypeAddonsIds.includes(t)}getCategoriesFromDraftAddons(){const t=[];return this.addonsFromDraft.forEach(n=>{n.category&&!t.includes(n.category)&&t.push(n.category)}),t}toggleCourierWithLabelAddon(t,n){const r=t.checked,o=this.otherCategoryComponent?.addonCategoryForm?.value;let g;(o?Object.keys(o):[]).forEach(N=>{o[N].id===n.id&&(g=N)});const A=this.courierWithLabelAddons.indexOf(n);if(r)return this.courierWithLabelAddons[A].checked=!0,void this.otherCategoryComponent.addonCategoryForm.get(g).patchValue(this.courierWithLabelAddons[A]);this.courierWithLabelAddons[A].checked=!1,this.otherCategoryComponent.addonCategoryForm.get(g).patchValue(this.courierWithLabelAddons[A])}isCourierWithLabelOnlyAddonOption(t){if("OTHER"===t){const n=this.productAddonsCategories.getAddons(t)?.addonsGroup;return!!n?.find(r=>r?.addons?.find(o=>"COURIER_WITH_LABEL"===o?.category))&&1===n?.length}return!1}setSubscriberForCourierWithLabelAddonsRepopulation(){this.courierWithLabelAddons?.length&&this.courierWithLabelAddonsDisableSubject.pipe((0,j.F)(),(0,z.pQ)(this.destroyRef)).subscribe(t=>{const n=this.courierWithLabelAddons.filter(A=>A.checked),r=this.otherCategoryComponent?.addonCategoryForm?.value,o=r?Object.keys(r):[],u=[];let g=!1;o.forEach(A=>{n.some(N=>N.id===r[A].id)&&u.push(A)}),t||(g=!0),u.forEach(A=>{this.otherCategoryComponent.addonCategoryForm.get(A).get("checked").patchValue(g)})})}checkIfCountriesNotEqualAndOutsideUE(){(0,q.z)([this.store.select(T.aT),this.store.select(T.Ui)]).pipe((0,z.pQ)(this.destroyRef)).subscribe(([t,n])=>{t?.countryId!==n?.countryId&&(0,q.z)([this.countryService.getCountryByCountryId(t?.countryId),this.countryService.getCountryByCountryId(n?.countryId)]).pipe((0,z.pQ)(this.destroyRef)).subscribe(()=>{})})}orderCustomsValidityChanged(t){t&&this.clearValidationErrors(),this.isOrderCustomsValid.next(t)}moveDeclaredValueErrorsToCustoms(t){const n=t?.addons;if(!this.isOrderCustomsConfig()||!ht()(n))return t;const r=(this.productAddonsCategories?.getAddons("DECLARED_VALUE")?.addonsGroup??[]).reduce((N,w)=>N.concat((w?.addons??[]).map(te=>te.id)),[]);if(!r.length)return t;const o=N=>Ne()(r,N?.addonId),u=n.filter(o);if(!u.length)return t;const g=n.filter(N=>!o(N)),A={...t,"customs[declaredValue]":u.map(N=>N.message).join(" ")};return g.length?A.addons=g:delete A.addons,A}getOrderCustomsConfig(t){this.orderCustomsService.getOrderCustomsConfig({senderCountry:t.senderAddress?.countryId,receiverCountry:t.receiverAddress?.countryId,content:t.shipment.content,name:this.carrierName}).pipe((0,cr.j)(()=>{!this.isOrderCustomsConfig()&&this.order.customs?this.store.dispatch(F.M.resetSetOrderCustoms()):this.orderCustoms?.fields&&this.store.dispatch(F.M.createSetOrderCustoms(this.orderCustoms.fields)),this.isOrderCustomsValid.next(!this.isOrderCustomsConfig()||!!this.orderCustomsComponent?.validate())})).subscribe({error:()=>{this.orderCustomsService.clearOrderCustomConfig(),this.orderCustomsValidityChanged(!0)}})}mergeCustomFieldsIntoAddons(t,n){return n?.addonCategoryFields?.length?t.map(r=>{switch(r.categoryName){case"OTHER":case"NOTIFICATIONS":case"DELIVERY":return{...r,addonsGroup:r.addonsGroup?.map(u=>{const g=n.addonCategoryFields.find(A=>A.category===u.addons[0]?.category);return g?{...u,fields:g.fields}:u})};case"DUTY":return{...r,addonsGroup:r.addonsGroup?.map(u=>{const g={};return u.addons?.forEach(A=>{const N=n.addonCategoryFields.find(w=>w.category===A.category);N&&(g[A.category]=N.fields)}),Object.keys(g).length?{...u,addonFieldsSchemas:g}:u})};default:const o=n.addonCategoryFields.find(u=>u.category===r.categoryName);return o?{...r,fields:o.fields}:r}}):t}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Ae.vQ),e.rXU(e.Agw),e.rXU(v.il),e.rXU(m.ok),e.rXU(e.gRc),e.rXU(Ni.q),e.rXU(xn.D),e.rXU(nt.b),e.rXU(be.o),e.rXU(K.Q),e.rXU(ki.U),e.rXU(f.c$),e.rXU(Pt.I),e.rXU(Oa.o),e.rXU(Vi.D),e.rXU(ya.z),e.rXU(Xt.x))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-shipment-options-step"]],viewQuery:function(n,r){if(1&n&&(e.GBs(Ai,5),e.GBs($i,5),e.GBs(Di,5),e.GBs(Mi,5),e.GBs(io.e,7),e.GBs(gt,5),e.GBs(Od,5),e.GBs(yd,5),e.GBs(vd,5),e.GBs(Ed,5),e.GBs(Fi.Y,5)),2&n){let o;e.mGM(o=e.lsd())&&(r.insuranceAddonComponent=o.first),e.mGM(o=e.lsd())&&(r.declaredValueAddonComponent=o.first),e.mGM(o=e.lsd())&&(r.codAddonComponent=o.first),e.mGM(o=e.lsd())&&(r.pastCategoryComponent=o.first),e.mGM(o=e.lsd())&&(r.select2OptionalInputComponent=o.first),e.mGM(o=e.lsd())&&(r.purposeChooserComponent=o.first),e.mGM(o=e.lsd())&&(r.receiverPointSelector=o.first),e.mGM(o=e.lsd())&&(r.senderPointSelector=o.first),e.mGM(o=e.lsd())&&(r.otherCategoryComponent=o.first),e.mGM(o=e.lsd())&&(r.defaultCategoryComponent=o.first),e.mGM(o=e.lsd())&&(r.orderCustomsComponent=o.first)}},inputs:{isPackageInMotion:[1,"isPackageInMotion"]},outputs:{validityChanged:"validityChanged"},decls:45,vars:41,consts:[["otherCategoryComponent",""],["defaultCategoryComponent",""],["senderPoint",""],["receiverPoint",""],["novalidate","",1,"form","slim-control
1s","shipment-options",3,"formGroup"],[1,"order-setup"],[1,"order-setup__form"],[1,"contents"],[1,"order-setup__label"],["for","content-fourth-step",1,"label"],[1,"v-align__content"],[1,"tooltipster-shipment"],[1,"label--required"],[1,"order-setup__input","field"],["id","content-fourth-step","formControlName","content",3,"ardnDataTestId"],[3,"clientSideValidation","clientErrorMessage","serverSideValidation","ardnDataTestId"],[1,"posting-time"],[1,"order-setup__field","collectionType"],["for","o4-package-content",1,"label"],["id","collection-fourth-step",1,"order-setup__input"],[3,"formGroup"],[3,"serverSideValidation","ardnDataTestId"],[1,"addons",3,"formGroupName"],[1,"order-setup__field","postal-point"],[1,"order-setup__field","reference-number"],[1,"order-setup__field"],[1,"order-setup__summary",3,"suggestedPrice","parcelMarginType","ardnDataTestId"],[1,"required-info"],[1,"required-alert"],["id","shipmentType-fourth-step",3,"formGroupName"],[3,"validityChanged","formControlName","addonsCategory","ardnDataTestId"],["formControlName","pickUpDate","id","pickUpDate-fourth-step",3,"borderLess","ardnDataTestId"],[1,"courier-with-label__section"],[1,"label"],[1,"order-setup__input"],[1,"courier-with-label__addon"],[1,"checkbox"],["type","checkbox",3,"change","checked","disabled","ardnDataTestId"],[3,"content","price","currency","ardnDataTestId"],[3,"options","currency","ardnDataTestId"],[1,"order-setup__info"],[1,"info-icon","tooltip","tooltipstered",3,"ardnTooltipster"],[3,"addonPrice","addonInPrice","currency","ardnDataTestId"],["data-addon","CROSSBORDER",1,"radio"],["data-addon","PICKUP, PAID_PICKUP",1,"radio"],["data-addon","POINT, PAID_SENDING_FROM_POINT",1,"radio"],["data-id","API",1,"radio"],[3,"for","ardnDataTestId"],["type","radio","formControlName","collectionType",3,"id","value","ardnDataTestId"],["for","collection-type-crossborder"],["id","collection-type-crossborder","type","radio","value","CROSSBORDER","formControlName","collectionType"],["ardn-service-code-custom-label","",3,"defaultLabel"],["for","collection-type-carrier"],["id","collection-type-carrier","type","radio","value","PICKUP","formControlName","collectionType"],[3,"addonPrice","addonInPrice","currency"],[1,"color-primary"],["for","collection-type-point",3,"ardnDataTestId"],["id","collection-type-point","type","radio","value","POINT","formControlName","collectionType",3,"ardnDataTestId"],["href","https://www.globkurier.pl/punkty-oraz-oddzialy-nadania-i-odbioru-przesylek","target","_blank",1,"tooltip-margin"],[3,"formGroupName"],["id","declaredValue-fourth-step",3,"validityChanged","inputValueChanged","formControlName","addonsCategory","serverValidationErrors","ardnDataTestId"],[1,"label",3,"ardnDataTestId"],[1,"v-align"],[1,"order-setup__label-info"],[3,"isCompany","formControl"],[3,"formControlName","addonsCategory","addonsAdditionalCategories","addonsServerValidationErrors","defaultCashOnDelivery","insuranceRequiredByAddon","isFreightForward","ardnDataTestId"],[3,"formControlName","addonsCategory","addonsServerValidationErrors","codValues","ardnDataTestId"],[3,"formControlName","addonsCategory","ardnDataTestId"],[1,"addon-category",3,"formControlName","categoryTitle","product","addonsCategory","addonsServerValidationErrors","ardnDataTestId"],[3,"inputValueChanged","validityChanged","cashOnDeliveryChanged","formControlName","addonsCategory","addonsServerValidationErrors","codValues","ardnDataTestId"],[1,"addon-category",3,"formControlName","categoryTitle","addonsCategory","addonsServerValidationErrors","product","ardnDataTestId"],[1,"addon-category",3,"validityChanged","insuranceRequiredChanged","formControlName","categoryTitle","addonsCategory","addonsServerValidationErrors","product","ardnDataTestId"],[1,"addon-category",3,"validityChanged","insuranceRequiredChanged","formControlName","categoryTitle","product","addonsCategory","addonsServerValidationErrors","ardnDataTestId"],[3,"validityChanged","inputValueChanged","formControlName","addonsCategory","addonsAdditionalCategories","addonsServerValidationErrors","defaultCashOnDelivery","insuranceRequiredByAddon","isFreightForward","ardnDataTestId"],[1,"sender-receiver-point-label"],[1,"info-icon","tooltip",3,"ardnTooltipster"],[1,"mb-4"],["id","senderPoint-fourth-step","formControlName","senderPoint",3,"noPoints","suggestedPointUnavailable","shipmentSide","isCrossborder","carrierTypePaczkomat","ardnDataTestId"],[3,"clientSideValidation","clientErrorMessage","ardnDataTestId"],[1,"order-setup--suggested-point-unavailable"],[1,"toggle-point-selector-mode"],[1,"toggle-point-selector-mode","order-setup--no-points"],[1,"shipment-options--show-map-link",3,"click"],[1,"toggle-point-selector-mode","order-setup--no-points",3,"click"],[1,"info","info-map"],["id","receiverPoint-fourth-step","formControlName","receiverPoint",3,"noPoints","suggestedPointUnavailable","shipmentSide","carrierTypePaczkomat"],[1,"order-setup__input","js-show-textarea-checkbox"],[1,"checkbox","mpk"],["for","hasReferenceNumber-fourth-step",1,"mpk-label",3,"ardnDataTestId"],["id","hasReferenceNumber-fourth-step","type","checkbox","formControlName","hasReferenceNumber",3,"ardnDataTestId"],[1,"field"],[1,"number-input"],["id","referenceNumber-fourth-step","formControlName","referenceNumber",1,"input",3,"ardnDataTestId"],[1,"radio"],["for","parcel-margin-type-suggested",3,"ardnDataTestId"],["id","parcel-margin-type-suggested","type","radio","value","SUGGESTED","formControlName","parcelMarginType",3,"ardnDataTestId"],["for","parcel-margin-type-individual",3,"ardnDataTestId"],["id","parcel-margin-type-individual","type","radio","value","INDYVIDUAL","formControlName","parcelMarginType",3,"ardnDataTestId"],[1,"number-input-options"],["idName","sales-margin-value","formControlName","salesMargin",3,"maxFractionDigits","min","showArrow","ardnDataTestId"],[1,"addon-category",3,"validityChanged","formControlName","categoryTitle","addonsCategory","product","ardnDataTestId"],[1,"order-setup__label--customs"],[3,"isFormValid","order","orderFormType","carrierName","validationErrors","orderCustomsData","translations"]],template:function(n,r){if(1&n&&(e.j41(0,"form",4)(1,"div",5)(2,"div",6),e.DNE(3,Td,4,1,"div"),e.j41(4,"div",7)(5,"div",8)(6,"label",9)(7,"span",10),e.EFF(8),e.nI1(9,"translate"),e.nrm(10,"ardn-order-shipment-type-tooltipster",11),e.j41(11,"span",12),e.EFF(12,"*"),e.k0s(),e.nrm(13,"br"),e.k0s()()(),e.j41(14,"div",13),e.nrm(15,"ardn-content-chooser",14)(16,"ardn-field-validator",15),e.k0s()(),e.DNE(17,Nd,4,7,"div",16),e.j41(18,"fieldset",17)(19,"legend",8)(20,"span",18),e.EFF(21),e.nI1(22,"translate"),e.k0s()(),e.j41(23,"div",19),e.DNE(24,Bd,5,5,"div",20),e.nrm(25,"ardn-field-validator",21),e.k0s()(),e.DNE(26,Wd,2,0)(27,Hd,14,13,"div"),e.nI1(28,"async"),e.DNE(29,rl,4,2,"div",22)(30,Cl,17,10,"fieldset",23),e.nI1(31,"async"),e.nI1(32,"async"),e.DNE(33,Ol,16,12,"fieldset",24),e.nI1(34,"async"),e.DNE(35,vl,20,17,"fieldset",25)(36,bl,4,1,"div")(37,Al,5,4,"fieldset"),e.k0s(),e.j41(38,"ardn-order-price-summary",26),e.bIt("suggestedPrice",function(u){return r.hasSuggestedPrice(u)}),e.k0s()(),e.j41(39,"div",27)(40,"span",27),e.EFF(41),e.nI1(42,"translate"),e.k0s(),e.DNE(43,Rl,3,3,"span",28),e.nI1(44,"async"),e.k0s()()),2&n){let o,u;e.Y8G("formGroup",r.shipmentOptionsForm),e.R7$(3),e.vxM(r.productAddonsCategories?3:-1),e.R7$(5),e.SpI(" ",e.bMT(9,25,"ORDER_PAGE.CONTENT")," "),e.R7$(7),e.Y8G("ardnDataTestId","ardn-select2-optional-input"),e.R7$(),e.Y8G("clientSideValidation",r.shipmentOptionsForm.get("content"))("clientErrorMessage","COMMON.ERRORS.REQUIRED")("serverSideValidation",r.validationErrors.fields.content)("ardnDataTestId","ardn-order-shipment-options-step-form-content-field-validator"),e.R7$(),e.vxM("PICKUP"===(null==(o=r.shipmentOptionsForm.get("collectionType"))?null:o.value)?17:-1),e.R7$(4),e.JRh(e.bMT(22,27,"ORDER_PAGE.COLLECTION_TYPE")),e.R7$(3),e.vxM(r.productAddonsCategories?24:-1),e.R7$(),e.Y8G("serverSideValidation",r.validationErrors.fields.collectionType)("ardnDataTestId","ardn-order-shipment-options-step-form-collectionType-field-validator"),e.R7$(),e.vxM(r.productAddonsCategories?26:-1),e.R7$(),e.vxM(e.bMT(28,29,r.isFieldRequired("purpose"))?27:-1),e.R7$(2),e.vxM(r.productAddonsCategories?29:-1),e.R7$(),e.vxM(e.bMT(31,31,r.isFieldRequired("senderAddressPointId"))||e.bMT(32,33,r.isFieldRequired("receiverAddressPointId"))?3
10:-1),e.R7$(3),e.vxM(e.bMT(34,35,r.isLoggedInObservable)?33:-1),e.R7$(2),e.vxM(r.user&&r.user.salesMargin?35:-1),e.R7$(),e.vxM(r.productAddonsCategories?36:-1),e.R7$(),e.vxM(r.isOrderCustomsConfig()?37:-1),e.R7$(),e.Y8G("parcelMarginType",null==(u=r.shipmentOptionsForm.get("parcelMarginType"))?null:u.value)("ardnDataTestId","ardn-order-shipment-options-step-form-parcelMarginType-ardn-number-ardn-order-price-summary"),e.R7$(3),e.SpI(" ",e.bMT(42,37,"COMMON.REQUIRED_FIELD")," "),e.R7$(2),e.vxM(e.bMT(44,39,r.isReceiverAndSenderPointEqual)?43:-1)}},dependencies:[m.qT,m.me,m.Zm,m.Fm,m.BC,m.cb,m.l_,m.j4,m.JD,m.$R,ye.Q,ge.d,oo.y,ot.N,Z.Z,va,Fi.Y,ao,Mi,kn,at,dt,lo,gt,co,mo,go,Ai,$i,Di,Cd,l.Jj,f.D9,_d],styles:[".toggle-point-selector-mode[_ngcontent-%COMP%]{margin:5px 0 10px}.toggle-point-selector-mode-button[_ngcontent-%COMP%]{cursor:pointer;color:#96c21f}ardn-point-selector[_ngcontent-%COMP%] + .input-validation[_ngcontent-%COMP%]     p{margin-bottom:8px}ardn-point-selector[_ngcontent-%COMP%]     .select2-selection__placeholder{color:#9b9b9b!important}.order-setup--no-points[_ngcontent-%COMP%]{cursor:pointer;color:#f72323}.order-setup--suggested-point-unavailable[_ngcontent-%COMP%]{margin-top:4px;color:#f72323}.order-setup--no-points[_ngcontent-%COMP%]   .info[_ngcontent-%COMP%]{color:#000}.order-setup--no-points[_ngcontent-%COMP%]   .info-map[_ngcontent-%COMP%]{color:#96c21f}.addon-category[_ngcontent-%COMP%]     .radio{margin-bottom:5px}.slim-controls[_ngcontent-%COMP%]   .order-setup[_ngcontent-%COMP%]   .radio[_ngcontent-%COMP%]{line-height:2.3rem;margin-bottom:5px}.slim-controls[_ngcontent-%COMP%]   .order-setup__field[_ngcontent-%COMP%]{padding-bottom:0}.slim-controls[_ngcontent-%COMP%]   .order-setup__input[_ngcontent-%COMP%]   .form-error[_ngcontent-%COMP%]{margin:5px 0}.slim-controls[_ngcontent-%COMP%]   .order-setup__input[_ngcontent-%COMP%]   .tooltip-margin[_ngcontent-%COMP%]{margin-right:1rem}.slim-controls[_ngcontent-%COMP%]   .contents[_ngcontent-%COMP%]   .field[_ngcontent-%COMP%]{margin-bottom:5px}.slim-controls[_ngcontent-%COMP%]   .contents[_ngcontent-%COMP%]     .optional-input{margin-bottom:5px}.slim-controls[_ngcontent-%COMP%]   .contents[_ngcontent-%COMP%]   .tooltipster-shipment[_ngcontent-%COMP%]     span{margin-left:5px}.slim-controls[_ngcontent-%COMP%]   .mb-5p[_ngcontent-%COMP%]{margin-bottom:5px}.slim-controls[_ngcontent-%COMP%]   .posting-time[_ngcontent-%COMP%]   .field[_ngcontent-%COMP%]{margin-bottom:0}.slim-controls[_ngcontent-%COMP%]   .posting-time[_ngcontent-%COMP%]     .order-setup__field{margin-bottom:5px;padding-bottom:0}.slim-controls[_ngcontent-%COMP%]   .addons[_ngcontent-%COMP%]   .field[_ngcontent-%COMP%]{margin-bottom:0}.slim-controls[_ngcontent-%COMP%]   .addons[_ngcontent-%COMP%]     .order-setup__field{margin-bottom:5px;padding-bottom:10px}.slim-controls[_ngcontent-%COMP%]   .addons[_ngcontent-%COMP%]     .form-error{margin:5px 0 10px}.slim-controls[_ngcontent-%COMP%]   .reference-number.order-setup__field[_ngcontent-%COMP%]{padding-bottom:5px}.slim-controls[_ngcontent-%COMP%]   .postal-point[_ngcontent-%COMP%]{padding-top:5px}.slim-controls[_ngcontent-%COMP%]   .postal-point[_ngcontent-%COMP%]   .order-setup__posting-point-message[_ngcontent-%COMP%]{margin-bottom:10px}.slim-controls[_ngcontent-%COMP%]   .postal-point[_ngcontent-%COMP%]   .field[_ngcontent-%COMP%]{margin-bottom:0}.slim-controls[_ngcontent-%COMP%]   .postal-point[_ngcontent-%COMP%]   .tooltip[_ngcontent-%COMP%]{position:absolute;margin-left:5px}.shipment-options--show-map-link[_ngcontent-%COMP%]{cursor:pointer;color:#96c21f}.shipment-options[_ngcontent-%COMP%]   ardn-custom-clearance[_ngcontent-%COMP%]     .invoice-generator-details__container fieldset{border:none;padding:0}.shipment-options[_ngcontent-%COMP%]   ardn-custom-clearance[_ngcontent-%COMP%]     .invoice-generator-details__container fieldset legend{display:none}.collectionType[_ngcontent-%COMP%]{min-width:100%}.mpk[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.mpk-label[_ngcontent-%COMP%]{padding-right:unset!important}.sender-receiver-point-label[_ngcontent-%COMP%]{padding-right:25px}.required-info[_ngcontent-%COMP%]{display:grid}.required-info[_ngcontent-%COMP%]   .required-alert[_ngcontent-%COMP%]{color:#f72323}"],changeDetection:0})}}return i})();var Ge=s(30848),ke=s(49969),yo=s(59141);let vo=(()=>{class i{constructor(t){this.store=t}setStepsPositions(t){this.stepsComponents=t}getStepsPosition(){return this.store.select(pe.PX).pipe((0,M.s)(1),(0,v.Lt)(t=>({index:this.getNextNotDisabledStep(t)?.index-1,stepsComponents:this.stepsComponents})))}getNextNotDisabledStep(t){const n=t.filter(o=>"ACTIVE"===o.state?o.index:null);if(!n?.length)return this.getLastCompletedStep(t);const r=Math.min(...n.map(o=>o.index));return t.filter(o=>o.index===r)[0]}getLastCompletedStep(t){return t.sort(n=>n?.index)?.filter(n=>"COMPLETED"===n?.state)?.pop()}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(v.il))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const Tl=["*"],Il=(i,p,t)=>({"dimension-label":i,"label-padding":p,"dimension-step":t});function Dl(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",0),e.nI1(1,"async"),e.bIt("@expandable.start",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.moveToNextStep())}),e.SdG(2),e.k0s()}if(2&i){let t;const n=e.XpG();e.Y8G("@expandable",void 0)("ngClass",e.sMw(4,Il,n.isCurrentLocation("pl"),n.isCurrentLocation("fr"),0===(null==(t=e.bMT(1,2,n.getActualPosition()))?null:t.index)))}}let Eo=(()=>{class i{constructor(t,n){this.locationService=t,this.stepManagerService=n,this.isExpanded=!1}isCurrentLocation(t){return this.locationService.getLocationId()===t}getActualPosition(){return this.stepManagerService.getStepsPosition()}moveToNextStep(){this.isExpanded||this.stepManagerService.getStepsPosition().subscribe(t=>{const n=t?.stepsComponents.find((r,o)=>o===t.index-1)?.nativeElement;this.moveTo(n)})}moveTo(t){t?.scrollIntoView({behavior:"smooth",block:"start"})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(yo.N),e.rXU(vo))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-step-body"]],standalone:!0,features:[e.aNF],ngContentSelectors:Tl,decls:1,vars:1,consts:[[1,"order-step__body","accordion__content",3,"ngClass"]],template:function(n,r){1&n&&(e.NAR(),e.DNE(0,Dl,3,8,"div",0)),2&n&&e.vxM(r.isExpanded?0:-1)},dependencies:[l.YU,l.Jj],styles:[".label-padding .pb-0{padding-left:12px}
1  .order-grid__last{padding-left:20px}"],data:{animation:[(0,ke.hZ)("expandable",[(0,ke.kY)(":leave",[(0,ke.iF)({height:"*"}),(0,ke.i0)(250,(0,ke.iF)({height:0}))]),(0,ke.kY)(":enter",[(0,ke.iF)({height:0}),(0,ke.i0)(250,(0,ke.iF)({height:"*"}))])])]}})}}return i})();const Ml=["*"],Fl=(i,p,t,n,r)=>({"order-step--completed":i,"order-step--active":p,"order-step--disabled":t,"accordion--rolled":n,"accordion--expanded":r});let So=(()=>{class i{constructor(){this.state=(0,e.hFB)("ACTIVE")}set isExpanded(t){this._isExpanded=t,this.orderStepBody&&(this.orderStepBody.isExpanded=this._isExpanded)}get isExpanded(){return this._isExpanded}ngOnInit(){this.orderStepBody&&(this.orderStepBody.isExpanded=this.isExpanded)}isCompleted(){return"COMPLETED"===this.state()}isActive(){return"ACTIVE"===this.state()}isDisabled(){return"DISABLED"===this.state()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-step"]],contentQueries:function(n,r,o){if(1&n&&e.wni(o,Eo,7),2&n){let u;e.mGM(u=e.lsd())&&(r.orderStepBody=u.first)}},inputs:{state:[1,"state"],isExpanded:"isExpanded"},standalone:!0,features:[e.aNF],ngContentSelectors:Ml,decls:2,vars:7,consts:[[1,"order-step","accordion",3,"ngClass"]],template:function(n,r){1&n&&(e.NAR(),e.j41(0,"section",0),e.SdG(1),e.k0s()),2&n&&e.Y8G("ngClass",e.s1E(1,Fl,r.isCompleted(),r.isActive(),r.isDisabled(),!r.isExpanded,r.isExpanded))},dependencies:[l.YU],encapsulation:2})}}return i})();var Gi=s(57786),$l=s(1807),Nl=s(23386),kl=s(45713),Vl=s(25689),bo=s.n(Vl),Li=s(61486),xl=s(35335),ji=s(90195);let Po=(()=>{class i{transform(t){return t?t?.toString()?.replace(/^00/,"+"):""}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=e.EJ8({name:"ardnPhone",type:i,pure:!0,standalone:!0})}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ao=s(45170);const Ul=()=>["/register"];function Gl(i,p){if(1&i&&(e.j41(0,"p",30),e.EFF(1),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.SpI(" ",t.validationErrors.general," ")}}let Ll=(()=>{class i{constructor(t,n,r,o,u,g){this.config=t,this.windowService=n,this.formBuilder=r,this.store=o,this.route=u,this.destroyRef=g,this.redirectUrl=(0,e.geq)(null),this.loginSuccess=(0,e.CGW)(),this.allegroCredentialsForm=new m.gE({}),this.googleCredentialsForm=new m.gE({}),this.showPassword=!1,this.unsubscribeObservable=new re.B,this.initCredentials(),this.validationErrors=this.getInitValidationErrors(),this.store.select(J.ng).pipe((0,U.p)(A=>!!A),(0,z.pQ)(this.destroyRef)).subscribe(A=>{this.validationErrors=A.authorization?A.authorization.validationErrors:this.getInitValidationErrors()})}ngOnInit(){this.route.snapshot.queryParams.returnUrl&&this.redirectUrl.set(this.route.snapshot.queryParams.returnUrl)}initCredentials(){this.credentialsForm=this.formBuilder.group({email:["",m.k0.compose([m.k0.required,m.k0.pattern(oe.gM)])],password:["",m.k0.compose([m.k0.required,m.k0.minLength(6)])]})}togglePasswordVisibility(){this.showPassword=!this.showPassword}clearValidationErrors(){this.validationErrors&&(this.validationErrors=this.getInitValidationErrors())}getInitValidationErrors(){return{fields:{email:"",password:""},general:[]}}onSubmit(){this.store.dispatch(Li.v.createLoginAction(this.credentialsForm.value.email,this.credentialsForm.value.password,this.redirectUrl())),this.store.dispatch(me.U.createResetProductFiltersAction()),this.store.select(J.ng).pipe((0,U.p)(t=>!!t),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{t&&t?.authorization?.isLoggedIn&&(this.loginSuccess.emit(),this.unsubscribeObservable.next(),this.unsubscribeObservable.complete())})}ngOnDestroy(){this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Ae.vQ),e.rXU(Ao.s),e.rXU(m.ok),e.rXU(v.il),e.rXU(b.nX),e.rXU(e.abz))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-login-panel"]],inputs:{redirectUrl:[1,"redirectUrl"]},outputs:{redirectUrl:"redirectUrlChange",loginSuccess:"loginSuccess"},standalone:!0,features:[e.aNF],decls:66,vars:73,consts:[["googleForm",""],["allegroForm",""],[1,"login-panel",3,"ardnDataTestId"],[1,"h3","login-panel__title"],[1,"login-panel__subtitle"],[1,"login-panel__socials"],[1,"login-panel__social"],["method","post",3,"formGroup","action"],["type","hidden","name","token"],["type","hidden","name","lang","value","pl"],["type","hidden","name","successReturnLink",3,"value"],["type","hidden","name","failedReturnLink",3,"value"],["id","order-login-via-google-button","type","button",1,"btn__register",3,"click","ardnDataTestId"],[1,"login-icon"],["src","assets/img/logos/google-icon.png"],[1,"login-text"],["id","order-login-via-allegro-button","type","button",1,"btn__register",3,"click","ardnDataTestId"],["src","assets/img/logos/allegro-icon.png"],[1,"divi
1der"],["novalidate","",1,"form","align-left",3,"ngSubmit","formGroup"],[1,"input-container"],[1,"field","input-wrapper"],["for","order-login-email",1,"label",3,"ardnDataTestId"],["formControlName","email","id","order-login-email","type","email",1,"input","input-field",3,"keyup","placeholder","ardnDataTestId"],[3,"clientSideValidation","serverSideValidation","clientErrorMessage","ardnDataTestId"],[1,"field","input-wrapper","password-field"],["for","order-login-password",1,"label",3,"ardnDataTestId"],[1,"input-with-icon"],["formControlName","password","id","order-login-password",1,"input","input-field",3,"keyup","type","placeholder","ardnDataTestId"],["type","button",3,"click","ardnDataTestId"],[1,"form-error"],[1,"field","align-center"],["id","order-login-button","type","submit",1,"btn","btn--block","btn--primary",3,"ardnDataTestId"],[1,"field","align-center","font-size-small","login-panel__register"],[3,"routerLink","ardnDataTestId"]],template:function(n,r){if(1&n){const o=e.RV6();e.j41(0,"div",2)(1,"h3",3),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p",4),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"div",5)(8,"div",6)(9,"form",7,0),e.nrm(11,"input",8)(12,"input",9)(13,"input",10)(14,"input",11),e.k0s(),e.j41(15,"button",12),e.bIt("click",function(){e.eBV(o);const g=e.sdS(10);return e.Njj(g.submit())}),e.j41(16,"div",13),e.nrm(17,"img",14),e.k0s(),e.j41(18,"div",15),e.EFF(19),e.nI1(20,"translate"),e.k0s()()(),e.j41(21,"div",6)(22,"form",7,1),e.nrm(24,"input",8)(25,"input",9)(26,"input",10)(27,"input",11),e.k0s(),e.j41(28,"button",16),e.bIt("click",function(){e.eBV(o);const g=e.sdS(23);return e.Njj(g.submit())}),e.j41(29,"div",13),e.nrm(30,"img",17),e.k0s(),e.j41(31,"div",15),e.EFF(32),e.nI1(33,"translate"),e.k0s()()()(),e.j41(34,"div",18),e.EFF(35),e.nI1(36,"translate"),e.k0s(),e.j41(37,"form",19),e.bIt("ngSubmit",function(){return e.eBV(o),e.Njj(r.onSubmit())}),e.j41(38,"div",20)(39,"div",21)(40,"label",22),e.EFF(41),e.nI1(42,"translate"),e.k0s(),e.j41(43,"input",23),e.nI1(44,"translate"),e.bIt("keyup",function(){return e.eBV(o),e.Njj(r.clearValidationErrors())}),e.k0s(),e.nrm(45,"ardn-field-validator",24),e.k0s(),e.j41(46,"div",25)(47,"label",26),e.EFF(48),e.nI1(49,"translate"),e.k0s(),e.j41(50,"div",27)(51,"input",28),e.nI1(52,"translate"),e.bIt("keyup",function(){return e.eBV(o),e.Njj(r.clearValidationErrors())}),e.k0s(),e.j41(53,"button",29),e.bIt("click",function(){return e.eBV(o),e.Njj(r.togglePasswordVisibility())}),e.k0s()(),e.nrm(54,"ardn-field-validator",24),e.k0s(),e.DNE(55,Gl,2,1,"p",30),e.k0s(),e.j41(56,"div",31)(57,"button",32),e.EFF(58),e.nI1(59,"translate"),e.k0s()()(),e.j41(60,"div",33),e.EFF(61),e.nI1(62,"translate"),e.j41(63,"a",34),e.EFF(64),e.nI1(65,"translate"),e.k0s()()()}2&n&&(e.Y8G("ardnDataTestId","ardn-order-login-panel"),e.R7$(2),e.JRh(e.bMT(3,48,"ORDER_PAGE.USER_DATA_STEP.LOGIN_PANEL_TITLE")),e.R7$(3),e.JRh(e.bMT(6,50,"ORDER_PAGE.USER_DATA_STEP.LOGIN_PANEL_SUBTITLE")),e.R7$(4),e.Y8G("formGroup",r.googleCredentialsForm)("action",r.config.apiURL+"auth/login/google",e.B4B),e.R7$(4),e.Mz_("value","",r.windowService.nativeWindow.location.origin,"/dashboard-new"),e.R7$(),e.Mz_("value","",r.windowService.nativeWindow.location.origin,"/google/"),e.R7$(),e.Y8G("ardnDataTestId","ardn-order-login-panel-google-button"),e.R7$(4),e.SpI(" ",e.bMT(20,52,"COMMON.GOOGLE")," "),e.R7$(3),e.Y8G("formGroup",r.allegroCredentialsForm)("action",r.config.apiURL+"auth/login/allegro",e.B4B),e.R7$(4),e.Mz_("value","",r.windowService.nativeWindow.location.origin,"/dashboard-new"),e.R7$(),e.Mz_("value","",r.windowService.nativeWindow.location.origin,"/"),e.R7$(),e.Y8G("ardnDataTestId","ardn-order-login-panel-allegro-button"),e.R7$(4),e.SpI(" ",e.bMT(33,54,"COMMON.ALLEGRO")," "),e.R7$(3),e.JRh(e.bMT(36,56,"COMMON.OR")),e.R7$(2),e.Y8G("formGroup",r.credentialsForm),e.R7$(3),e.Y8G("ardnDataTestId","ardn-order-login-panel-email-label"),e.R7$(),e.JRh(e.bMT(42,58,"COMMON.USERNAME")),e.R7$(2),e.Y8G("placeholder",e.bMT(44,60,"ORDER_PAGE.USER_DATA_STEP.LOGIN_USERNAME_PLACEHOLDER"))("ardnDataTestId","ardn-order-login-panel-email-input"),e.R7$(2),e.Y8G("clientSideValidation",r.credentialsForm.get("email"))("serverSideValidation",null==r.validationErrors||null==r.validationErrors.fields?null:r.validationErrors.fields.email)("clientErrorMessage","COMMON.ERRORS.EMAIL_CONTENT")("ardnDataTestId","ardn-order-login-panel-email-field-validator"),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-login-panel-password-label"),e.R7$(),e.SpI(" ",e.bMT(49,62,"COMMON.PASSWORD")," "),e.R7$(3),e.Y8G("type",r.showPassword?"text":"password")("placeholder",e.bMT(52,64,"ORDER_PAGE.USER_DATA_STEP.LOGIN_PASSWORD_PLACEHOLDER"))("ardnDataTestId","ardn-order-login-panel-password-input"),e.R7$(2),e.HbH(r.showPassword?"password-icon password-shown":"password-icon password-hidden"),e.Y8G("ardnDataTestId","ardn-order-login-panel-password-toggle-button"),e.R7$(),e.Y8G("clientSideValidation",r.credentialsForm.get("password"))("serverSideValidation",null==r.validationErrors||null==r.validationErrors.fields?null:r.validationErrors.fields.password)("clientErrorMessage","COMMON.ERRORS.TOO_SHORT")("ardnDataTestId","ardn-order-login-panel-password-field-validator"),e.R7$(),e.vxM(null!=r.validationErrors&&r.validationErrors.general?55:-1),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-login-panel-submit-button"),e.R7$(),e.SpI(" ",e.bMT(59,66,"COMMON.LOGIN")," "),e.R7$(3),e.SpI(" ",e.bMT(62,68,"COMMON.REGISTER_NEED")," "),e.R7$(2),e.Y8G("routerLink",e.lJ4(72,Ul))("ardnDataTestId","ardn-order-login-panel-register-link"),e.R7$(),e.JRh(e.bMT(65,70,"COMMON.REGISTER")))},dependencies:[m.YN,m.qT,m.me,m.BC,m.cb,m.X1,m.j4,m.JD,ye.Q,f.h,f.D9,Z.Z,b.Wk],styles:['[_nghost-%COMP%]{display:block;box-sizing:border-box;padding:10px 0;max-width:480px;margin:0 auto}.login-panel__title[_ngcontent-%COMP%]{margin-top:0;margin-bottom:.25em;font-weight:800;font-size:24px;letter-spacing:.04em}.login-panel__subtitle[_ngcontent-%COMP%]{margin-top:0;margin-bottom:1.5em;color:#5b5b5b;font-size:17px;font-weight:400}.login-panel__socials[_ngcontent-%COMP%]{display:flex;gap:15px}@media only screen and (max-width: 40em){.login-panel__socials[_ngcontent-%COMP%]{flex-direction:column}}.login-panel__social[_ngcontent-%COMP%]{flex:1}.login-panel__register[_ngcontent-%COMP%]{margin-top:10px}.login-panel[_ngcontent-%COMP%]   .field[_ngcontent-%COMP%]{margin-bottom:18px}.login-panel[_ngcontent-%COMP%]   .form-error[_ngcontent-%COMP%]{margin-bottom:0}.btn__register[_ngcontent-%COMP%]{background-color:#fff;border:solid 1px #1f3041;color:#1f3041;display:flex;width:100%;flex-direction:row;align-items:center;justify-content:center;font-weight:500;text-decoration:none;transition:all .2s;appearance:none;border-radius:5px;cursor:pointer;padding:.6em 1.2em;text-align:center;box-sizing:border-box;line-height:1.4667}.btn__register[_ngcontent-%COMP%]:hover{text-decoration:none}.btn__register[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%]{margin-right:10px;padding-right:10px;display:flex;place-content:center center;scale:80%;padding-left:10px}.btn__register[_ngcontent-%COMP%]   .login-text[_ngcontent-%COMP%]{padding-right:10px}.divider[_ngcontent-%COMP%]{margin:25px 0;display:flex;align-items:center;text-align:center;color:#5b5b5b}.divider[_ngcontent-%COMP%]:before, .divider[_ngcontent-%COMP%]:after{content:"";flex:1;border-bottom:1px solid #9c9c9c}.divider[_ngcontent-%COMP%]:not(:empty):before{margin-right:1em}.divider[_ngcontent-%COMP%]:not(:empty):after{margin-left:1em}.input-container[_ngcontent-%COMP%]   .input-wrapper[_ngcontent-%COMP%]{margin-bottom:30px}[_nghost-%COMP%]   .form[_ngcontent-%COMP%]   .is-valid[_ngcontent-%COMP%]:before, [_nghost-%COMP%]   .form[_ngcontent-%COMP%]   .has-error[_ngcontent-%COMP%]:before{content:none}.input-with-icon[_ngcontent-%COMP%]{position:relative;width:100%}.input-with-icon[_ngcontent-%COMP%]   .password-icon[_ngcontent-%COMP%]{background-repeat:no-repeat;width:25px;height:18px;position:absolute;right:18px;top:50%;transform:translateY(-50%);content:"";z-index:1;border:none;background-color:transparent;cursor:pointer}.input-with-icon[_ngcontent-%COMP%]   .password-hidden[_ngcontent-%COMP%]{background-image:url(/assets/img/icons/password-hidden.svg)}.input-with-icon[_ngcontent-%COMP%]   .password-shown[_ngcontent-%COMP%]{background-image:url(/assets/img/icons/password-shown.svg)}#order-login-button[_ngcontent-%COMP%]{font-weight:600;font-size:16px;letter-spacing:.05em}',".form-error[_ngcontent-%COMP%]{margin:5px 0 10px!important}.form__privileges-part[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{margin-bottom:0}.btn__google[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]{background-color:#fff;border-color:#c8c7c7;border-width:2px;color:#000;display:flex;align-items:center;justify-content:center;padding:0}@media only screen and (min-width: 340px) and (max-width: 1190px){.btn__google[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]{line-height:1.1;text-align:center;padding:2px}}
1.btn__google[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%]{margin-right:10px;padding-right:10px;display:flex;place-content:center center;scale:80%;padding-left:10px}@media only screen and (min-width: 1025px) and (max-width: 1110px){.btn__google[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%]{padding-right:0;padding-left:15px}}@media only screen and (min-width: 1111px) and (max-width: 1156px){.btn__google[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]   .login-icon[_ngcontent-%COMP%]{padding-right:15px;padding-left:25px}}.btn__google[_ngcontent-%COMP%]   .login-text[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]   .login-text[_ngcontent-%COMP%]{padding-right:10px}@media only screen and (min-width: 1111px) and (max-width: 1156px){.btn__google[_ngcontent-%COMP%]   .login-text[_ngcontent-%COMP%], .btn__allegro[_ngcontent-%COMP%]   .login-text[_ngcontent-%COMP%]{padding-right:25px}}.return-arrow[_ngcontent-%COMP%]{color:#96c21f}.return-btn[_ngcontent-%COMP%]{border:none;color:#000;cursor:pointer;display:inline-block}@media (max-width: 640px){.return-mobile[_ngcontent-%COMP%]{width:88px}}",".label[_ngcontent-%COMP%]{font-size:15px;font-weight:500}.label[_ngcontent-%COMP%]   .info-icon[_ngcontent-%COMP%]{float:right;font-size:13px;margin-left:5px}.label[_ngcontent-%COMP%]   .info-icon.float-none[_ngcontent-%COMP%]{float:none;margin-left:5px}.label--optional[_ngcontent-%COMP%]{color:#9b9b9b;font-size:13px}.label--required[_ngcontent-%COMP%]{color:#9b9b9b}.input[_ngcontent-%COMP%], .textarea[_ngcontent-%COMP%], .range[_ngcontent-%COMP%], .select2-container--default[_ngcontent-%COMP%]   .select2-search--dropdown[_ngcontent-%COMP%]   .select2-search__field[_ngcontent-%COMP%]{margin:0;padding:0 20px;height:54px;background:#fff;border-radius:5px;color:#5b5b5b;border:solid 1px #bcbcbc;box-sizing:border-box}@media only screen and (max-width: 40em){.input[_ngcontent-%COMP%], .textarea[_ngcontent-%COMP%], .range[_ngcontent-%COMP%], .select2-container--default[_ngcontent-%COMP%]   .select2-search--dropdown[_ngcontent-%COMP%]   .select2-search__field[_ngcontent-%COMP%]{padding:0 10px;font-size:14px}}.input[_ngcontent-%COMP%]::placeholder, .textarea[_ngcontent-%COMP%]::placeholder, .range[_ngcontent-%COMP%]::placeholder, .select2-container--default[_ngcontent-%COMP%]   .select2-search--dropdown[_ngcontent-%COMP%]   .select2-search__field[_ngcontent-%COMP%]::placeholder{color:#0006;font-weight:400;font-size:16px;letter-spacing:0%}.input[_ngcontent-%COMP%]:focus, .textarea[_ngcontent-%COMP%]:focus, .range[_ngcontent-%COMP%]:focus, .select2-container--default[_ngcontent-%COMP%]   .select2-search--dropdown[_ngcontent-%COMP%]   .select2-search__field[_ngcontent-%COMP%]:focus{border-color:#96c21f}.input.is-error[_ngcontent-%COMP%], .textarea.is-error[_ngcontent-%COMP%], .range.is-error[_ngcontent-%COMP%], .select2-container--default[_ngcontent-%COMP%]   .select2-search--dropdown[_ngcontent-%COMP%]   .select2-search__field.is-error[_ngcontent-%COMP%]{border-color:#f72323}.input.is-success[_ngcontent-%COMP%], .textarea.is-success[_ngcontent-%COMP%], .range.is-success[_ngcontent-%COMP%], .select2-container--default[_ngcontent-%COMP%]   .select2-search--dropdown[_ngcontent-%COMP%]   .select2-search__field.is-success[_ngcontent-%COMP%]{border-color:#3484fb}.input.disabled[_ngcontent-%COMP%], .input[disabled][_ngcontent-%COMP%], .input[readonly][_ngcontent-%COMP%], .textarea.disabled[_ngcontent-%COMP%], .textarea[disabled][_ngcontent-%COMP%], .textarea[readonly][_ngcontent-%COMP%], .range.disabled[_ngcontent-%COMP%], .range[disabled][_ngcontent-%COMP%], .range[readonly][_ngcontent-%COMP%], .select2-container--default[_ngcontent-%COMP%]   .select2-search--dropdown[_ngcontent-%COMP%]   .select2-search__field.disabled[_ngcontent-%COMP%], .select2-container--default[_ngcontent-%COMP%]   .select2-search--dropdown[_ngcontent-%COMP%]   .select2-search__field[disabled][_ngcontent-%COMP%], .select2-container--default[_ngcontent-%COMP%]   .select2-search--dropdown[_ngcontent-%COMP%]   .select2-search__field[readonly][_ngcontent-%COMP%]{color:#cbcfd4;background-color:#fafafa;border-color:#cbcfd4}.field-error[_ngcontent-%COMP%]{font-size:12px;color:#f72323;font-weight:500}.field[_ngcontent-%COMP%]{margin:0 0 40px}.field[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{display:block;color:#393939;margin-bottom:9px}.field--inline[_ngcontent-%COMP%]{display:flex;align-items:center}@media only screen and (max-width: 40em){.field--inline[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}}.field--inline[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{flex-grow:1;flex-shrink:0;margin:0 20px 0 0}@media only screen and (max-width: 40em){.field--inline[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{margin-bottom:9px}}.field[_ngcontent-%COMP%]   .input[_ngcontent-%COMP%], .field[_ngcontent-%COMP%]   .select2-container[_ngcontent-%COMP%], .field[_ngcontent-%COMP%]   .textarea[_ngcontent-%COMP%]{display:block;width:100%}.field[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{height:46px;line-height:44px;padding-top:0;padding-bottom:0}@media only screen and (max-width: 40em){.field[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{display:block;width:100%;padding-left:10px;padding-right:10px}}.field[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%] + .btn[_ngcontent-%COMP%], .field[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%] + .link[_ngcontent-%COMP%]{margin-left:25px}@media only screen and (max-width: 40em){.field[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%] + .btn[_ngcontent-%COMP%], .field[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%] + .link[_ngcontent-%COMP%]{display:block;text-align:center;margin-left:0;margin-top:15px}}.none-pointer-events[_ngcontent-%COMP%]{pointer-events:none}.input-field[_ngcontent-%COMP%]{padding:14px 60px 14px 20px;border-radius:5px;font-size:16px}.input-field[_ngcontent-%COMP%]:focus{border-color:#1f3041;outline:none}.input-container[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;align-items:stretch;width:100%;padding-bottom:20px}.input-container[_ngcontent-%COMP%]   .input-wrapper[_ngcontent-%COMP%]{position:relative;margin-bottom:40px;
1display:flex;align-items:center}.input-container[_ngcontent-%COMP%]   .input-wrapper.has-error[_ngcontent-%COMP%]{flex-direction:column}.input-container[_ngcontent-%COMP%]   .input-wrapper[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{position:absolute;top:-12px;left:20px;background:#fff;padding:0 5px;font-size:11px;color:#1f3041;z-index:2}.input-container[_ngcontent-%COMP%]   .input-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus{border:2px solid #1f3041}.input-container[_ngcontent-%COMP%]   .input-wrapper[_ngcontent-%COMP%]   .error-message[_ngcontent-%COMP%]{position:absolute;bottom:-18px;left:0;color:#f72323;font-size:12px}.info[_ngcontent-%COMP%]{position:relative}.info[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{font-size:12px;color:#393939;display:block;margin-bottom:.5rem}.info[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;font-weight:800;font-size:20px;line-height:30px;letter-spacing:4%}.info[_ngcontent-%COMP%]   .name--package-summary[_ngcontent-%COMP%]{justify-content:space-between;margin:30px 0}@media only screen and (max-width: 40em){.info[_ngcontent-%COMP%]   .name--package-summary[_ngcontent-%COMP%]{flex-wrap:wrap}}.info[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{height:auto}",'.form .select2-wrapper{font-size:16px;position:relative;display:inline-block}  .form .select2-wrapper .select2-container--closed{display:none}  .form .select2-wrapper .select2-results{position:relative}  .form .select2-wrapper .select2-results .highlight{background:#96c21f;color:#fff;font-weight:700}  .form .select2-container .select2-selection--single{border-color:#bcbcbc;height:54px;border-radius:5px}  .form .select2-container--default.select2-container--open.select2-container--below .select2-selection--single{border-color:#96c21f}  .form .select2-container .select2-selection--single .select2-selection__rendered{text-align:left;padding:0 30px 0 20px}@media only screen and (max-width: 40em){  .form .select2-container .select2-selection--single .select2-selection__rendered{padding:0 25px 0 10px}}  .form .select2-container--default .select2-selection--single .select2-selection__rendered{text-align:left;line-height:54px;color:#5b5b5b}  .form .select2-container--default .select2-selection--single .select2-selection__arrow{width:13px;height:7px;position:absolute;top:50%;margin:-3px 0 0;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2213%22%20height%3D%227%22%20viewBox%3D%220%200%2013%207%22%3E%3Cpath%20d%3D%22M1515.13%2C926.276l6.07%2C5.6a0.4%2C0.4%2C0%2C0%2C0%2C.29.121%2C0.4%2C0.4%2C0%2C0%2C0%2C.3-0.121l6.07-5.6a0.359%2C0.359%2C0%2C0%2C0%2C0-.553l-0.65-.6a0.435%2C0.435%2C0%2C0%2C0-.6%2C0l-5.12%2C4.725-5.11-4.725a0.435%2C0.435%2C0%2C0%2C0-.6%2C0l-0.65.6A0.359%2C0.359%2C0%2C0%2C0%2C1515.13%2C926.276Z%22%20transform%3D%22translate(-1515%20-925)%22%2F%3E%3C%2Fsvg%3E");right:17px;opacity:.5}@media only screen and (max-width: 40em){  .form .select2-container--default .select2-selection--single .select2-selection__arrow{right:10px}}  .form .select2-container--default .select2-selection--single .select2-selection__arrow b{display:none}  .form .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow{transform:rotate(180deg)}  .form .select2-container--default .select2-results__option--highlighted[aria-selected]{color:#96c21f;background-color:transparent}  .form .select2-container--default .select2-results__option[aria-selected=true]{background-color:#fafafa}  .form .select2-search--dropdown .select2-search__field{padding:8px 20px}  .form .checkbox{position:relative;display:block;min-height:17px;margin-bottom:12px}  .form .checkbox.has-error input~span:before{background-color:#fff1f1;border-color:#f72323}  .form .checkbox label{display:inline-block;position:relative;padding:0 0 0 25px;margin-bottom:0;vertical-align:top;cursor:pointer}@media only screen and (min-width: 60.0625em){  .form .checkbox--inline{display:inline-block;vertical-align:top}  .form .checkbox--inline+.checkbox{margin-left:30px}}  .form .checkbox input[type=checkbox]{position:absolute;inset:0;opacity:0}
1  .form .checkbox input[type=checkbox]~span{font-size:15px;color:#5b5b5b;font-weight:400}  .form .checkbox input[type=checkbox]~span:before{content:"";position:absolute;left:0;top:0;display:block;width:17px;height:17px;border:1px solid #bcbcbc;background-color:#fff;border-radius:3px}  .form .checkbox input[type=checkbox]~span:after{content:"";position:absolute;left:4px;top:4px;display:block;width:10px;height:10px}  .form .checkbox input[type=checkbox]:checked~span:before{border-color:#1f3041;background-color:#1f3041}  .form .checkbox input[type=checkbox]:checked~span:after{background-image:url(check-white.09710a0dfb725d16.svg);background-repeat:no-repeat}  .form .checkbox input[type=checkbox]:disabled~span{color:#cbcfd4}  .form .checkbox input[type=checkbox]:disabled~span:before{background-color:#f2f2f2;border-color:#cbcfd4}  .form .checkbox input[type=checkbox]:disabled~span:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3C%21--%20Generator%3A%20Adobe%20Illustrator%2019.2.0%2C%20SVG%20Export%20Plug-In%20.%20SVG%20Version%3A%206.00%20Build%200%29%20%20--%3E%0A%3Csvg%20version%3D%221.1%22%20id%3D%22ok-alt-color2%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20x%3D%220px%22%0A%09%20y%3D%220px%22%20viewBox%3D%220%200%2018.9%2015.7%22%20style%3D%22enable-background%3Anew%200%200%2018.9%2015.7%3B%22%20xml%3Aspace%3D%22preserve%22%3E%0A%3Cpath%20style%3D%22fill%3A%23cbcfd4%3B%22%20d%3D%22M6.6%2C11.7L2.7%2C7.6L1.5%2C8.9l5.1%2C5.4L17.5%2C2.7l-1.3-1.4L6.6%2C11.7z%22/%3E%0A%3Cpath%20style%3D%22fill%3A%23FFFFFF%3B%22%20d%3D%22M16.2%2C1.4l1.3%2C1.4L6.6%2C14.4L1.5%2C8.9l1.3-1.4l3.8%2C4.1L16.2%2C1.4%20M14.7%2C0L6.6%2C8.7L4.2%2C6.2l-2.9%2C0L0%2C7.6%0A%09l0%2C2.7l5.1%2C5.4H8L18.9%2C4.1l0-2.7L17.6%2C0L14.7%2C0L14.7%2C0z%22/%3E%0A%3C/svg%3E%0A)}  .form .checkbox input[type=checkbox][readonly]~span:before{background-color:#f2f2f2;border-color:#cbcfd4}  .form .radio input[type=radio]:checked~span{font-weight:700}  .form .form-error{margin:5px 0 20px;text-align:center;font-weight:500;font-size:12px;line-height:100%;letter-spacing:0%;color:#f72323}  .form .form-error span>a{color:#f72323;text-decoration:underline}  .form .is-valid:has(input.ng-touched):before{background-image:url(radio-checked.759b13fd9ad1f278.svg);background-repeat:no-repeat;width:23px;height:23px;position:absolute;right:25px;top:20px;content:"";z-index:1}  .form .has-error:before{background-image:url(error.87c27211cced4ff3.svg);background-repeat:no-repeat;width:23px;height:23px;position:absolute;right:25px;top:20px;content:"";z-index:1}  .form .has-error .input,   .form .has-error .textarea{background-color:#fff1f1;color:#f72323;border-color:#f72323!important;border-width:2px}  .form .has-error .select2-container .select2-selection--single{background-color:#fff1f1;border-color:#f72323}  .form .has-error .select2-container .select2-selection--single .select2-selection__rendered{color:#f72323}',".tooltipster-sidetip[_ngcontent-%COMP%]   .tooltipster-box[_ngcontent-%COMP%]{background:#1c274c;border:1px solid #1C274C;border-radius:10px}.tooltipster-sidetip.tooltipster-bottom[_ngcontent-%COMP%]   .tooltipster-box[_ngcontent-%COMP%]{margin-top:8px}.tooltipster-sidetip.tooltipster-left[_ngcontent-%COMP%]   .tooltipster-box[_ngcontent-%COMP%]{margin-right:8px}.tooltipster-sidetip.tooltipster-right[_ngcontent-%COMP%]   .tooltipster-box[_ngcontent-%COMP%]{margin-left:8px}.tooltipster-sidetip.tooltipster-top[_ngcontent-%COMP%]   .tooltipster-box[_ngcontent-%COMP%]{margin-bottom:8px}.tooltipster-sidetip[_ngcontent-%COMP%]   .tooltipster-content[_ngcontent-%COMP%]{font-size:12px;color:#fff;line-height:18px;padding:6px 14px;letter-spacing:.1rem}.tooltipster-sidetip[_ngcontent-%COMP%]   .tooltipster-arrow-background[_ngcontent-%COMP%]{border:10px solid transparent}.tooltipster-sidetip.tooltipster-bottom[_ngcontent-%COMP%]   .tooltipster-arrow-background[_ngcontent-%COMP%]{border-bottom-color:#1c274c;left:0;top:1px}.tooltipster-sidetip.tooltipster-left[_ngcontent-%COMP%]   .tooltipster-arrow-background[_ngcontent-%COMP%]{border-left-color:#1c274c;left:-1px;top:0}.tooltipster-sidetip.tooltipster-right[_ngcontent-%COMP%]   .tooltipster-arrow-background[_ngcontent-%COMP%]{border-right-color:#1c274c;left:1px;top:0}.tooltipster-sidetip.tooltipster-top[_ngcontent-%COMP%]   .tooltipster-arrow-background[_ngcontent-%COMP%]{border-top-color:#1c274c;left:0;top:-1px}.tooltipster-sidetip[_ngcontent-%COMP%]   .tooltipster-arrow-border[_ngcontent-%COMP%]{border:10px solid transparent;left:0;top:1px}.tooltipster-sidetip.tooltipster-bottom[_ngcontent-%COMP%]   .tooltipster-arrow-border[_ngcontent-%COMP%]{border-bottom-color:#1c274c}.tooltipster-sidetip.tooltipster-left[_ngcontent-%COMP%]   .tooltipster-arrow-border[_ngcontent-%COMP%]{border-left-color:#1c274c}.tooltipster-sidetip.tooltipster-right[_ngcontent-%COMP%]   .tooltipster-arrow-border[_ngcontent-%COMP%]{border-right-color:#1c274c}.tooltipster-sidetip.tooltipster-top[_ngcontent-%COMP%]   .tooltipster-arrow-border[_ngcontent-%COMP%]{border-top-color:#1c274c}"]})}}return i})();const jl=()=>["/register"],wl=()=>["PROMO_BENEFIT_1","PROMO_BENEFIT_2","PROMO_BENEFIT_3"];function Bl(i,p){if(1&i&&(e.j41(0,"li",8),e.nrm(1,"img",11),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&i){const t=p.$implicit;e.R7$(3),e.JRh(e.bMT(4,1,"ORDER_PAGE.USER_DATA_STEP."+t))}}
1let Xl=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-register-promo"]],standalone:!0,features:[e.aNF],decls:33,vars:32,consts:[[1,"promo",3,"ardnDataTestId"],[1,"promo__label"],[1,"promo__title"],[1,"promo__highlight"],[1,"promo__discount"],[1,"promo__discount-amount"],[1,"btn__register","promo__cta",3,"routerLink","ardnDataTestId"],[1,"promo__benefits"],[1,"promo__benefit"],[1,"promo__hashtag"],[1,"promo__hash"],["src","assets/img/icons/check-circle.svg","alt","",1,"promo__check"]],template:function(n,r){1&n&&(e.j41(0,"div",0)(1,"div",1),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"h3",2),e.EFF(5),e.nI1(6,"translate"),e.nrm(7,"br"),e.j41(8,"span",3),e.EFF(9),e.nI1(10,"translate"),e.k0s()(),e.j41(11,"p",4),e.EFF(12),e.nI1(13,"translate"),e.j41(14,"span",5),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.EFF(17),e.nI1(18,"translate"),e.k0s(),e.j41(19,"a",6),e.EFF(20),e.nI1(21,"translate"),e.k0s(),e.j41(22,"ul",7),e.Z7z(23,Bl,5,3,"li",8,e.fX1),e.k0s(),e.j41(25,"p",9)(26,"span",10),e.EFF(27,"#"),e.k0s(),e.EFF(28),e.nI1(29,"translate"),e.nrm(30,"br"),e.EFF(31),e.nI1(32,"translate"),e.k0s()()),2&n&&(e.Y8G("ardnDataTestId","ardn-order-register-promo"),e.R7$(2),e.JRh(e.bMT(3,12,"ORDER_PAGE.USER_DATA_STEP.PROMO_OFFER_LABEL")),e.R7$(3),e.SpI(" ",e.bMT(6,14,"ORDER_PAGE.USER_DATA_STEP.PROMO_TITLE")," "),e.R7$(4),e.JRh(e.bMT(10,16,"ORDER_PAGE.USER_DATA_STEP.PROMO_TITLE_HIGHLIGHT")),e.R7$(3),e.SpI(" ",e.bMT(13,18,"ORDER_PAGE.USER_DATA_STEP.PROMO_DISCOUNT_PREFIX")," "),e.R7$(3),e.JRh(e.bMT(16,20,"ORDER_PAGE.USER_DATA_STEP.PROMO_DISCOUNT_AMOUNT")),e.R7$(2),e.SpI(" ",e.bMT(18,22,"ORDER_PAGE.USER_DATA_STEP.PROMO_DISCOUNT_SUFFIX")," "),e.R7$(2),e.Y8G("routerLink",e.lJ4(30,jl))("ardnDataTestId","ardn-order-register-promo-cta"),e.R7$(),e.SpI(" ",e.bMT(21,24,"ORDER_PAGE.USER_DATA_STEP.REGISTER_LINK")," "),e.R7$(3),e.Dyx(e.lJ4(31,wl)),e.R7$(5),e.SpI("",e.bMT(29,26,"ORDER_PAGE.USER_DATA_STEP.PROMO_HASHTAG_LINE_1")," "),e.R7$(3),e.SpI(" ",e.bMT(32,28,"ORDER_PAGE.USER_DATA_STEP.PROMO_HASHTAG_LINE_2")," "))},dependencies:[f.h,f.D9,Z.Z,b.Wk],styles:['[_nghost-%COMP%]{display:block;box-sizing:border-box;padding:30px;max-width:480px;margin:40px auto 0}.promo[_ngcontent-%COMP%]{text-align:center}.promo__label[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:70%;color:#5b5b5b;font-size:14px;margin:0 auto 10px;font-weight:500}.promo__label[_ngcontent-%COMP%]:before, .promo__label[_ngcontent-%COMP%]:after{content:"";flex:1;border-bottom:1px solid #9c9c9c}.promo__label[_ngcontent-%COMP%]:not(:empty):before{margin-right:1em}.promo__label[_ngcontent-%COMP%]:not(:empty):after{margin-left:1em}.promo__title[_ngcontent-%COMP%]{font-size:24px;font-weight:700;color:#1f3041;margin:0 0 15px;line-height:1.4}.promo__discount[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#1f3041;margin:0 0 20px}.promo__highlight[_ngcontent-%COMP%]{background-color:#96c21f;color:#1f3041;padding:0 6px;border-radius:5px;-webkit-box-decoration-break:clone;box-decoration-break:clone}.promo__discount-amount[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:48px;font-weight:600;font-size:17px;letter-spacing:.04em;vertical-align:middle;color:#5bbd2c;background-color:#7bc24426;border-radius:7px}.promo__cta[_ngcontent-%COMP%]{display:block;width:fit-content;margin:0 auto 25px;letter-spacing:.05em}.promo__benefits[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0 auto 25px;width:fit-content;text-align:left}.promo__benefit[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:12px;color:#393939;font-size:14px;font-weight:600}.promo__check[_ngcontent-%COMP%]{width:20px;height:20px;min-width:20px;margin-right:12px}.promo__hashtag[_ngcontent-%COMP%]{color:#1f3041;font-weight:700;font-size:16px;margin:0}.promo__hash[_ngcontent-%COMP%]{color:#96c21f}.btn__register[_ngcontent-%COMP%]{background-color:#fff;border:solid 1px #1f3041;color:#1f3041;font-weight:500;text-decoration:none;transition:all .2s;border-radius:5px;cursor:pointer;padding:.6em 2.4em;text-align:center;line-height:1.4667}.btn__register[_ngcontent-%COMP%]:hover{text-decoration:none;background-color:#1f3041;color:#fff;box-shadow:0 6px 16px #1f304140}'],changeDetection:0})}}return i})();var wi=s(7266);let Gn=(()=>{class i{constructor(t){this.apiClientService=t}validate(t){return this.apiClientService.post("order/validate",!0,t).pipe((0,Se.W)(n=>(0,H.$)(()=>n.error)))}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(ie.f))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const Yl=()=>["countryId"];function Wl(i,p){if(1&i&&(e.j41(0,"div",0)(1,"div",4)(2,"h3",5),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"table",6)(6,"tbody")(7,"tr")(8,"th"),e.EFF(9),e.nI1(10,"translate"),e.k0s(),e.j41(11,"td"),e.EFF(12),e.k0s()(),e.j41(13,"tr")(14,"th"),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.j41(17,"td"),e.EFF(18),e.nI1(19,"ardnAddressFirstLine"),e.nrm(20,"br"),e.EFF(21),e.k0s()(),e.j41(22,"tr")(23,"th"),e.EFF(24),e.nI1(25,"translate"),e.k0s(),e.j41(26,"td"),e.EFF(27),e.k0s()(),e.j41(28,"tr")(29,"th"),e.EFF(30),e.nI1(31,"translate"),e.k0s(),e.j41(32,"td"),e.EFF(33),e.nI1(34,"ardnPhone"),e.k0s()()()()(),e.nrm(35,"ardn-blocked-account-message",1),e.k0s()),2&i){const t=e.XpG();e.Y8G("ardnDataTestId","ardn-order-user-data-step-is-logged-as-full-registered-user"),e.R7$(3),e.JRh(e.bMT(4,14,"ORDER_PAGE.USER_DATA_STEP.CONFIRM_LOGGED_USER_DATA")),e.R7$(6),e.SpI("",e.bMT(10,16,"COMMON.ADDRESS.NAME_AND_SURNAME"),":"),e.R7$(3),e.Lme("",null==t.userData?null:t.userData.address.name," ",null==t.userData?null:t.userData.address.surname,""),e.R7$(3),e.SpI("",e.bMT(16,18,"COMMON.ADDRESS.ADDRESS"),":"),e.R7$(3),e.SpI("",e.bMT(19,20,null==t.userData?null:t.userData.address)," "),e.R7$(3),e.Lme(" ",null==t.userData?null:t.userData.address.postCode," ",null==t.userData?null:t.userData.address.city," "),e.R7$(3),e.SpI("",e.bMT(25,22,"COMMON.EMAIL"),":"),e.R7$(3),e.JRh(null==t.userData?null:t.userData.address.email),e.R7$(3),e.SpI("",e.bMT(31,24,"COMMON.ADDRESS.CONTACT_PHONE"),":"),e.R7$(3),e.JRh(e.bMT(34,26,null==t.userData?null:t.userData.address.phone)),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-user-data-step-ardn-blocked-account-message")}}function Hl(i,p){if(1&i){const t=e.RV6();
1e.j41(0,"div",1)(1,"div",7)(2,"div",4)(3,"h3",8),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"ardn-user-address-form",9),e.mxI("ngModelChange",function(r){e.eBV(t);const o=e.XpG();return e.DH7(o.userAddressData,r)||(o.userAddressData=r),e.Njj(r)}),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.handleValidityOfUserAddressForm(r))})("onVerificationCodeSet",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.updateVerificationCode(r))}),e.k0s()()()()}if(2&i){const t=e.XpG();e.Y8G("ardnDataTestId","ardn-order-user-data-step-is-logged-as--not-full-registered-user"),e.R7$(4),e.JRh(e.bMT(5,8,"ORDER_PAGE.USER_DATA_STEP.TYPE_USER_DATA")),e.R7$(2),e.R50("ngModel",t.userAddressData),e.Y8G("loggedIn",!0)("saveEventDetector",t.saveEventDetector$)("readonlyFields",e.lJ4(10,Yl))("serverSideValidationErrors",t.userRegistrationValidationErrors)("ardnDataTestId","ardn-user-address-form")}}function zl(i,p){1&i&&(e.j41(0,"div",2)(1,"div",10),e.EFF(2,"Loading..."),e.k0s()())}function Kl(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",3),e.nrm(1,"div",11),e.j41(2,"div",11)(3,"button",12),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.storeUserData())}),e.EFF(4),e.nI1(5,"translate"),e.k0s()()()}if(2&i){const t=e.XpG();e.Y8G("ardnDataTestId","ardn-order-user-data-step-is-logged-in"),e.R7$(3),e.Y8G("disabled",!(t.addressFormValid&&2===t.currentStep()))("ardnDataTestId","ardn-order-user-data-step-is-logged-in-store-user-data-button"),e.R7$(),e.SpI(" ",e.bMT(5,4,"COMMON.CONTINUE")," ")}}function Ql(i,p){if(1&i){const t=e.RV6();e.j41(0,"button",43),e.bIt("click",function(){e.eBV(t);const r=e.XpG(3);return e.Njj(r.storeUserData())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&i&&(e.Y8G("ardnDataTestId","ardn-order-user-data-step-submit-button"),e.R7$(),e.SpI(" ",e.bMT(2,2,"COMMON.CONTINUE")," "))}function Jl(i,p){if(1&i){const t=e.RV6();e.j41(0,"button",44),e.bIt("click",function(){e.eBV(t);const r=e.XpG(3);return e.Njj(r.validate())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&i&&(e.Y8G("ardnDataTestId","ardn-order-user-data-step-validate-button"),e.R7$(),e.SpI(" ",e.bMT(2,2,"COMMON.CONTINUE")," "))}function Zl(i,p){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"div",7)(2,"div",4)(3,"h3",5),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"ardn-user-address-form",14),e.mxI("ngModelChange",function(r){e.eBV(t);const o=e.XpG(2);return e.DH7(o.userAddressData,r)||(o.userAddressData=r),e.Njj(r)}),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.handleValidityOfUserAddressForm(r))}),e.k0s()()(),e.j41(7,"div",15)(8,"label",16)(9,"input",17),e.mxI("ngModelChange",function(r){e.eBV(t);const o=e.XpG(2);return e.DH7(o.allSelected,r)||(o.allSelected=r),e.Njj(r)}),e.bIt("change",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.toggleSelectAll())}),e.k0s(),e.j41(10,"span"),e.EFF(11),e.nI1(12,"translate"),e.k0s()()(),e.j41(13,"form",18)(14,"div",15)(15,"label",1),e.nrm(16,"input",19),e.j41(17,"span",20)(18,"span",21),e.EFF(19),e.k0s(),e.EFF(20),e.nI1(21,"translate"),e.k0s(),e.j41(22,"a",22),e.EFF(23),e.nI1(24,"translate"),e.k0s(),e.j41(25,"a",23),e.EFF(26),e.nI1(27,"translate"),e.k0s(),e.j41(28,"span",20),e.EFF(29),e.nI1(30,"translate"),e.k0s(),e.j41(31,"a",24),e.EFF(32),e.nI1(33,"translate"),e.k0s()(),e.nrm(34,"ardn-field-validator",25),e.k0s(),e.j41(35,"div",15)(36,"label",26)(37,"input",27),e.bIt("change",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.checkAllSelected())}),e.k0s(),e.j41(38,"span")(39,"span",28),e.EFF(40,"*"),e.k0s(),e.EFF(41),e.nI1(42,"translate"),e.k0s()(),e.nrm(43,"ardn-field-validator",25),e.k0s(),e.j41(44,"div",15)(45,"label",29)(46,"input",30),e.bIt("change",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.checkAllSelected())}),e.k0s(),e.j41(47,"span",31)(48,"span",21),e.EFF(49),e.k0s(),e.j41(50,"a",32),e.EFF(51),e.nI1(52,"translate"),e.k0s(),e.EFF(53),e.nI1(54,"translate"),e.k0s()(),e.nrm(55,"ardn-field-validator",25),e.k0s(),e.j41(56,"div",15)(57,"label",33)(58,"input",34),e.bIt("change",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.checkAllSelected())}),e.k0s(),e.j41(59,"span",31),e.EFF(60),e.nI1(61,"translate"),e.k0s()()(),e.j41(62,"span",35),e.EFF(63),e.nI1(64,"translate"),e.k0s()(),e.j41(65,"div",36)(66,"div",37)(67,"a",38),e.bIt("click",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.backToMainView())}),e.qSk(),e.j41(68,"svg",39),e.nrm(69,"use",40),e.k0s(),e.joV(),e.j41(70,"span"),e.EFF(71),e.nI1(72,"translate"),e.k0s()()(),e.j41(73,"div",11),e.DNE(74,Ql,3,4,"button",41)(75,Jl,3,4,"button",42),e.k0s()()()}if(2&i){const t=e.XpG(2);e.R7$(4),e.JRh(e.bMT(5,43,"ORDER_PAGE.USER_DATA_STEP.TYPE_USER_DATA")),e.R7$(2),e.R50("ngModel",t.userAddressData),e.Y8G("loggedIn",!1)("serverSideValidationErrors",t.notLoggedInUserValidationErrors)("ardnDataTestId","ardn-user-address-form"),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-user-data-step-form-check-all-label"),e.R7$(),e.R50("ngModel",t.allSelected),e.Y8G("ardnDataTestId","ardn-order-user-data-step-form-check-all-input"),e.R7$(2),e.JRh(e.bMT(12,45,"COMMON.CHECK_ALL")),e.R7$(2),e.Y8G("formGroup",t.userAgreementsForm),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-user-data-step-form-confirmRegulations-label"),e.R7$(),e.Y8G("ardnDataTestId","ardn-order-user-data-step-form-confirmRegulations-input"),e.R7$(3),e.SpI(" ","*"," "),e.R7$(),e.SpI(" ",e.bMT(21,47,"COMMON.AGREEMENTS.CONFIRM_REGULATIONS")," "),e.R7$(3),e.SpI(" ",e.bMT(24,49,"COMMON.AGREEMENTS.CONFIRM_REGULATIONS_1")," "),e.R7$(3),e.SpI(" ",e.bMT(27,51,"COMMON.AGREEMENTS.CONFIRM_REGULATIONS_2")," "),e.R7$(3),e.SpI(" ",e.bMT(30,53,"COMMON.AGREEMENTS.CONFIRM_REGULATIONS_3")," "),e.R7$(3),e.SpI(" ",e.bMT(33,55,"COMMON.AGREEMENTS.CONFIRM_REGULATIONS_4")," "),e.R7$(2),e.Y8G("clientSideValidation",t.userAgreementsForm.get("confirmRegulations"))("clientErrorMessage","COMMON.ERRORS.REQUIRED")("ardnDataTestId","ardn-order-user-data-step-form-confirmRegulations-field-validator"),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-user-data-step-form-receive-electronic-bills-agreement-label"),e.R7$(),e.Y8G("formControlName","receiveElectronicBills")("ardnDataTestId","ardn-order-user-data-step-form-receive-electronic-bills-agreement-input"),e.R7$(4),e.SpI(" ",e.bMT(42,57,"COMMON.AGREEMENTS.RECEIVE_ELECTRONIC_BILLS_FOR_UNREGISTERED_USER")," "),e.R7$(2),e.Y8G("clientSideValidation",t.userAgreementsForm.get("receiveElectronicBills"))("clientErrorMessage","COMMON.ERRORS.REQUIRED")("ardnDataTestId","ardn-order-user-data-step-form-receive-electronic-bills-agreement-field-validator"),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-user-data-step-form-processing-personal-data-agreement-label"),e.R7$(),e.Y8G("ardnDataTestId","ardn-order-user-data-step-form-processing-personal-data-agreement-input"),e.R7$(3),e.SpI(" ","*"," "),e.R7$(2),e.SpI(" ",e.bMT(52,59,"COMMON.AGREEMENTS.PROCESSING_PERSONAL_DATA")," "),e.R7$(2),e.SpI(" ",e.bMT(54,61,"COMMON.AGREEMENTS.PROCESSING_PERSONAL_DATA_1")," "),e.R7$(2),e.Y8G("clientSideValidation",t.userAgreementsForm.get("processingPersonalData"))("clientErrorMessage","COMMON.ERRORS.REQUIRED")("ardnDataTestId","ardn-order-user-data-step-form-processing-personal-data-agreement-field-validator"),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-user-data-step-form-receive-commercial-info-agreement-label"),e.R7$(),e.Y8G("ardnDataTestId","ardn-order-user-data-step-form-receive-commercial-info-agreement-input"),e.R7$(2),e.SpI(" ",e.bMT(61,63,"COMMON.AGREEMENTS.RECEIVE_COMMERCIAL_INFO")," "),e.R7$(3),e.SpI(" ",e.bMT(64,65,"COMMON.REQUIRED_FIELD")," "),e.R7$(8),e.JRh(e.bMT(72,67,"COMMON.BACK")),e.R7$(3),e.vxM(t.addressFormValid&&t.agreementFormValid&&2===t.currentStep()?74:-1),e.R7$(),e.vxM(t.addressFormValid&&t.agreementFormValid&&2===t.currentStep()?-1:75)}}function ql(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",13)(1,"ardn-order-login-panel",45),e.bIt("loginSuccess",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onLoginSuccess())}),e.k0s(),e.nrm(2,"ardn-order-register-promo"),e.k0s()}}function ec(i,p){if(1&i&&(e.j41(0,"div",1),e.DNE(1,Zl,76,69,"div"),e.nI1(2,"async"),e.DNE(3,ql,3,0,"div",13),e.nI1(4,"async"),e.k0s()),2&i){const t=e.XpG();e.Y8G("ardnDataTestId","ardn-order-user-data-step-is-not-logged-in"),e.R7$(),e.vxM(e.bMT(2,3,t.orderWithoutRegistrationSelectedObservable)?1:-1),e.R7$(2),e.vxM(!0!==e.bMT(4,5,t.orderWithoutRegistrationSelectedObservable)?3:-1)}}let Bi=(()=>{class i{constructor(t,n,r,o,u,g,A,N,w,te,ne){this.config=t,this.platformId=n,this.store=r,this.formBuilder=o,this.changeDetector=u,this.userService=g,this.countryService=A,this.translateService=N,this.orderRestorationService=w,this.orderValidationService=te,this.scrollService=ne,this.currentStep=(0,e.hFB
1)(),this.continue=(0,e.CGW)(),this.validityChanged=(0,e.CGW)(),this.defaultUserAddressData={houseNumber:"",apartmentNumber:"",street:"",email:"",countryId:null,city:"",name:"",surname:"",nip:null,companyName:null,type:"PERSON",postCode:"",phone:""},this.addressFormValid=!1,this.agreementFormValid=!1,this.userRegistrationValidationErrors={fields:{},general:[]},this.notLoggedInUserValidationErrors={fields:{},general:[]},this.userAddressData=this.defaultUserAddressData,this.saveEventDetector$=new re.B,this.loggedIn=null,this.unsubscribeObservable=new re.B,this.nip="",this.timeoutHandle=null,this.firstRunForNotLoggedIn=!1,this.allSelected=!1}ngOnInit(){this.readonlyFieldsForNotFullyRegisteredUser=this.config.readonlyFieldsForNotFullyRegisteredUser,this.translateNipWrongValue=this.translateService.instant("ORDER_PAGE.USER_DATA_STEP.WRONG_VALUE"),this.countryId=null,this.isDisableCompanyName=!1,this.isCorrectNip=!1,this.initAgreementsForm(),this.store.select(J.ng).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(r=>{this.onChangeAuthorization(r),this.changeDetector.markForCheck()}),this.store.select(T.Ff).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(r=>{this.onChangeValidationErrors(r),this.changeDetector.markForCheck()}),this.userAgreementsForm.statusChanges.pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(r=>{this.agreementFormValid="VALID"===r,this.changeDetector.markForCheck()}),this.orderWithoutRegistrationSelectedObservable=this.store.select(pe.jX),this.store.select((0,pe.D7)(1)).pipe((0,U.p)(r=>"ACTIVE"===r?.state),(0,U.p)(()=>this.isLoggedAsFullRegisteredUser()),(0,xl.c)(500),(0,B.Q)(this.unsubscribeObservable)).subscribe(()=>{2===this.currentStep()&&(this.store.dispatch(F.M.createSetUserAddressAction(this.userAddressData)),this.continue.emit(!0))});const t=this.store.select(T.qE),n=this.userAgreementsForm.valueChanges.pipe((0,$t.Z)(this.userAgreementsForm.value));(0,q.z)([t,n]).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(([r,o])=>{this.setPendingOrderCookie(r,o)}),this.setUserAddressDuringOrderReturn()}onLoginSuccess(){this.store.select(T.ro).pipe((0,M.s)(1)).subscribe(t=>{(0,l.UE)(this.platformId)&&this.store.dispatch(me.U.createReloadProductsAction(t))})}onChangeAuthorization(t){this.userData=t.user?t.user.profile:null,this.loggedIn=!!t.authorization&&t.authorization.isLoggedIn,this.isLoggedAsFullRegisteredUser()&&(this.addressFormValid=!0),this.isLoggedIn()||(this.firstRunForNotLoggedIn=!0),t?.user?.validationErrors&&(this.resetValidation(),this.userRegistrationValidationErrors=t.user.validationErrors,this.scrollToInvalidUserAddressField(this.userRegistrationValidationErrors)),this.userData&&(this.setUserNumberToPendingOrderCookie(this.userData.userNumber),this.setClientTypeInUserAddressData(this.userData?.address),this.updateEmptyValuesOfUserAddressData(this.userData.address),this.validityChanged.emit(!0))}resetValidation(){this.userRegistrationValidationErrors={general:[],fields:{}},this.changeDetector.detectChanges()}updateEmptyValuesOfUserAddressData(t){this.userAddressData=Object.assign({},bo()(this.userAddressData,t,(n,r)=>n||r)),setTimeout(()=>{this.userAddressFormComponent&&(this.userAddressFormComponent.initialPhoneNumber=t.phone)},100),this.isCorrectNip=!0}setClientTypeInUserAddressData(t){t&&(this.userAddressData.type=t.type)}onChangeValidationErrors(t){if(!t)return;const n=L()(t.fields,(r,o)=>o.match(/^userAddress/));this.notLoggedInUserValidationErrors={fields:ae()(n,(r,o)=>o.replace("userAddress","address")),general:[]}}initAgreementsForm(){this.userAgreementsForm=this.formBuilder.group({receiveElectronicBills:[!1,[m.k0.requiredTrue]],confirmRegulations:[!1,[m.k0.requiredTrue]],processingPersonalData:[!1,[m.k0.requiredTrue]],receiveCommercialInfo:[!1]}),this.isUEMember=!0,this.disableEnableCompanyName(this.userAddressData)}toggleSelectAll(){this.toggleFormValue(),this.changeDetector.markForCheck()}checkAllSelected(){this.allSelected=this.allCheckboxesSelected(),this.changeDetector.markForCheck()}toggleFormValue(){Object.keys(this.userAgreementsForm.controls).forEach(t=>{this.userAgreementsForm.controls[t].setValue(this.allSelected)})}allCheckboxesSelected(){let t=!0;
1return Object.keys(this.userAgreementsForm.controls).forEach(n=>{this.userAgreementsForm.controls[n].value||(t=!1)}),t}ngOnDestroy(){this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}isLoggedIn(){return!0===this.loggedIn}isLoggedAsFullRegisteredUser(){return!0===this.loggedIn&&this.hasFullRegisteredUserData()}isLoggedAsNotFullRegisteredUser(){return!0===this.loggedIn&&!!this.userData&&!this.hasFullRegisteredUserData()}isLoadingUserData(){return!0===this.loggedIn&&!this.userData}refreshUserAddressDataFromProfile(){this.userData?.address&&(this.userAddressData={...this.userAddressData,...this.userData.address},this.setClientTypeInUserAddressData(this.userData.address),this.store.dispatch(F.M.createSetUserAddressAction(this.userAddressData)),this.changeDetector.markForCheck())}hasFullRegisteredUserData(){return!!this.userData?.address?.city}selectOrderWithoutRegistration(){this.store.dispatch(Ge.G.createUserDataStepChangeRegistrationFormSelectAction(!0))}backToMainView(){this.store.dispatch(Ge.G.createUserDataStepChangeRegistrationFormSelectAction(!1))}dispatchSecondStepValidationErrors(t){this.store.dispatch(F.M.createValidateOrderFailedAction(t)),this.addressFormValid=!1}storeUserData(){if(this.isLoggedAsNotFullRegisteredUser()){const t=this.getNotFullyRegisteredUserData();this.store.dispatch(Li.v.createPutUserDataAction(t)),this.store.select(J.dG).pipe((0,U.p)(n=>null===n),(0,M.s)(1)).subscribe(()=>{this.emitContinue()})}else this.isLoggedIn()?(this.store.dispatch(F.M.createSetUserAddressAction(this.userAddressData)),this.emitContinue()):this.orderValidationService.validate({userAddress:this.userAddressData}).pipe((0,M.s)(1)).subscribe({next:()=>{this.store.dispatch(F.M.createSetAgreementsForUnregisteredUserAction(this.userAgreementsForm?.value)),this.emitContinue(),this.verificationCode=null,this.saveEventDetector$.next()},error:t=>{this.scrollToInvalidUserAddressField(t),this.dispatchSecondStepValidationErrors(t)}})}scrollToInvalidUserAddressField(t){for(const n in this.userAddressFormComponent?.addressDataForm?.controls)if(Object.keys(t?.fields)?.find(([r])=>r)?.includes(n))return void this.scrollService.scrollToFieldId(`${n}-${this.userAddressFormComponent.serverSideErrorFormFieldName()}`)}getNotFullyRegisteredUserData(){const t=Y()(this.userData.address,this.readonlyFieldsForNotFullyRegisteredUser),n={...this.userAddressData,...t},{agreements:r,...o}=this.userData;return{...o,address:n}}setPendingOrderCookie(t,n){const r=this.orderRestorationService.getStoredStateFromCookie();r&&this.orderRestorationService.setOrderStateCookie({...r,userAddress:t,userAgreements:n,step:2,loggedIn:this.orderRestorationService.checkLoggedInState()})}setUserNumberToPendingOrderCookie(t){const n=this.orderRestorationService.getStoredStateFromCookie();n&&this.orderRestorationService.setOrderStateCookie({...n,userNumber:t})}handleValidityOfUserAddressForm(t){if(this.userAddressFormComponent?.isCompany()){const r=(this.userAddressFormComponent?this.userAddressFormComponent.getCompanyName():"")||"";this.userAddressData.companyName=r?.toString().trim(),this.disableEnableCompanyName(this.userAddressData),this.nipFilteringFormData(this.userAddressData),this.addressFormValid=t&&this.isCorrectNip}else this.userAddressData.companyName=null,this.userAddressData.nip=null,this.disableEnableCompanyName(this.userAddressData),this.nipFilteringFormData(this.userAddressData),this.addressFormValid=t;this.firstRunForNotLoggedIn?this.firstRunForNotLoggedIn=!1:this.store.dispatch(F.M.createSetUserAddressAction(this.userAddressData)),this.validityChanged.emit(t)}setUserAddressDuringOrderReturn(){this.store.select(ct.J).pipe((0,U.p)(t=>!0===t?.order?.orderReturnStatus?.loaded&&t?.ui?.pages?.order?.steps[1]?.isExpanded&&"ACTIVE"===t?.ui?.pages?.order?.steps[1]?.state),(0,v.Lt)(t=>t?.order?.userAddress),(0,M.s)(1)).subscribe(t=>{this.userAddressData=t,this.validate()})}validate(){this.userAddressFormComponent&&this.userAddressFormComponent.validateForm(),this.validateUserAgreementsForm()}validateUserAgreementsForm(){Object.keys(this.userAgreementsForm.controls).forEac
1h(t=>{this.userAgreementsForm.get(t).markAsTouched({onlySelf:!0})})}updateVerificationCode(t){this.verificationCode=t}nipFilteringFormData(t){const n=t.nip||"";this.nip!==n&&(this.nip=n,"COMPANY"===t.type&&this.changedNip(n,t.countryId))}changedNip(t,n){this.timeoutHandle&&clearTimeout(this.timeoutHandle),this.timeoutHandle=setTimeout(()=>{this.updateCompanyNameByNip(t,n)},800)}updateCompanyNameByNip(t,n){if(!t||t&&t.length<=3)return;this.clearUserValidationErrors(),this.isDisableCompanyName?(this.updateCompanyName(""),this.changeDetector.markForCheck()):(this.isDisableCompanyName=!0,this.userAddressFormComponent.disableCompanyName(),this.updateCompanyName(""),this.changeDetector.markForCheck(),this.isDisableCompanyName=!1,this.userAddressFormComponent.enableCompanyName());const r={countryId:n,tin:t};this.isCorrectNip=!1,(0,Un.s)(this.userService.getUserCompany(r)).then(o=>{this.isCorrectNip=!0,0===o.companyName.length?(this.userAddressFormComponent.enableCompanyName(),this.isDisableCompanyName=!1,this.updateCompanyName(o.companyName)):(this.isDisableCompanyName=!0,this.userAddressFormComponent.disableCompanyName(),this.updateCompanyName(o.companyName)),this.changeDetector.markForCheck()}).catch(o=>{this.updateCompanyName(""),this.isUEMember?(this.notLoggedInUserValidationErrors=this.createNipUserValidationErrors(o),this.isDisableCompanyName=!0,this.userAddressFormComponent.disableCompanyName()):(this.isDisableCompanyName=!1,this.userAddressFormComponent.enableCompanyName(),this.isCorrectNip=!0),this.changeDetector.markForCheck()})}createNipUserValidationErrors(t){return null===t?{fields:{"address[nip]":this.translateNipWrongValue},general:[]}:{fields:ae()(t.fields,(n,r)=>r.replace("tin","address[nip]")),general:[]}}clearUserValidationErrors(){this.notLoggedInUserValidationErrors={fields:{},general:[]}}updateCompanyName(t){const n={...this.userAddressData,companyName:t||null};this.userAddressData=n,this.changeDetector.markForCheck()}disableEnableCompanyName(t){const n=t.countryId||0;this.countryId!==n&&"COMPANY"===t.type&&(this.countryId=n,this.checkIfCountryInUE(n))}checkIfCountryInUE(t){this.updateCompanyName(""),(0,Un.s)(this.countryService.getCountryCached(t)).then(n=>{n.isUEMember?(this.isUEMember=!0,this.isDisableCompanyName=!0,this.userAddressFormComponent.disableCompanyName(),this.changeDetector.markForCheck()):(this.isUEMember=!1,this.isDisableCompanyName=!1,this.userAddressFormComponent.enableCompanyName(),this.changeDetector.markForCheck());const r=this.userAddressFormComponent.getNip();this.updateCompanyNameByNip(r,t)}).catch(()=>{this.isUEMember=!1,this.isDisableCompanyName=!1,this.userAddressFormComponent.enableCompanyName(),this.clearUserValidationErrors(),this.changeDetector.markForCheck()})}emitContinue(){setTimeout(()=>{this.continue.emit(!0)},50)}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Ae.vQ),e.rXU(e.Agw),e.rXU(v.il),e.rXU(m.ok),e.rXU(e.gRc),e.rXU(Vi.D),e.rXU(be.o),e.rXU(f.c$),e.rXU(wi.A),e.rXU(Gn),e.rXU(nt.b))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-user-data-step"]],viewQuery:function(n,r){if(1&n&&e.GBs(ji.z,5),2&n){let o;e.mGM(o=e.lsd())&&(r.userAddressFormComponent=o.first)}},inputs:{currentStep:[1,"currentStep"]},outputs:{continue:"continue",validityChanged:"validityChanged"},standalone:!0,features:[e.aNF],decls:5,vars:5,consts:[[1,"row","row--huge-gutter","row-portable--normal-gutter",3,"ardnDataTestId"],[3,"ardnDataTestId"],[1,"align-center"],[1,"row","row-flex","row--small-gutter","space","align-center-mobile",3,"ardnDataTestId"],[1,"col","col-6","col-mobile-12"],[1,"h3","mt-4"],[1,"table-info"],[1,"row","row--huge-gutter","row-portable--normal-gutter"],[1,"h3"],[1,"slim-controls",3,"ngModelChange","validityChanged","onVerificationCodeSet","ngModel","loggedIn","saveEventDetector","readonlyFields","serverSideValidationErrors","ardnDataTestId"],[1,"loader","loader--green","loader--big"],[1,"col","col-4","col-mobile-12"],["type","submit","data-qa","store user data button",1,"btn","btn--primary","btn--block",3,"click","disabled","ardnDataTestId"],[1,"guest-auth"],[1,"slim-control
1s",3,"ngModelChange","validityChanged","ngModel","loggedIn","serverSideValidationErrors","ardnDataTestId"],[1,"checkbox"],["for","check-all",3,"ardnDataTestId"],["id","check-all","type","checkbox",3,"ngModelChange","change","ngModel","ardnDataTestId"],[3,"formGroup"],["type","checkbox","formControlName","confirmRegulations",3,"ardnDataTestId"],[1,"agreements"],[1,"agreement-asterisk"],["href","https://www.globkurier.pl/regulamin",1,"agreements"],["href","https://www.globkurier.pl/polityka-prywatnosci",1,"agreements"],["href","https://www.globkurier.pl/faq/regulamin-przewoznikow",1,"agreements"],[1,"agreement-validation",3,"clientSideValidation","clientErrorMessage","ardnDataTestId"],["for","receive-electronic-bills-agreement",3,"ardnDataTestId"],["id","receive-electronic-bills-agreement","type","checkbox",3,"change","formControlName","ardnDataTestId"],[1,"label--required"],["for","processing-personal-data-agreement",3,"ardnDataTestId"],["id","processing-personal-data-agreement","type","checkbox","formControlName","processingPersonalData",3,"change","ardnDataTestId"],[1,"agreement"],["href","https://www.globkurier.pl/zgoda-na-przetwarzanie-danych-osobowych"],["for","receive-commercial-info-agreement",3,"ardnDataTestId"],["id","receive-commercial-info-agreement","type","checkbox","formControlName","receiveCommercialInfo",3,"change","ardnDataTestId"],[1,"required-info"],[1,"row","row-flex","row--small-gutter","space","align-center-mobile"],[1,"col","col-4","col-mobile-12","align-self-center"],["id","backToMainView",1,"link","link--gray","link--smaller","link--no-anim","link--pointer",3,"click"],[1,"icon","icon-back"],["href","assets/img/sprites.svg#icon-back"],["type","submit","data-qa","store user data button",1,"btn","btn--primary","btn--block",3,"ardnDataTestId"],["data-qa","store user data button","type","submit",1,"btn","btn--block","btn--disabled",3,"ardnDataTestId"],["type","submit","data-qa","store user data button",1,"btn","btn--primary","btn--block",3,"click","ardnDataTestId"],["data-qa","store user data button","type","submit",1,"btn","btn--block","btn--disabled",3,"click","ardnDataTestId"],[3,"loginSuccess"]],template:function(n,r){1&n&&e.DNE(0,Wl,36,28,"div",0)(1,Hl,7,11,"div",1)(2,zl,3,0,"div",2)(3,Kl,6,6,"div",3)(4,ec,5,7,"div",1),2&n&&(e.vxM(r.isLoggedAsFullRegisteredUser()?0:-1),e.R7$(),e.vxM(r.isLoggedAsNotFullRegisteredUser()?1:-1),e.R7$(),e.vxM(r.isLoadingUserData()?2:-1),e.R7$(),e.vxM(r.isLoggedIn()?3:-1),e.R7$(),e.vxM(r.isLoggedIn()?-1:4))},dependencies:[Z.Z,f.h,f.D9,Dt,Po,ji.z,l.Jj,m.X1,m.qT,m.Zm,m.BC,m.cb,m.j4,m.JD,ye.Q,Ll,Xl,m.YN,m.vS],styles:["ardn-field-validator[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0;text-align:justify}.agreement-validation[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{padding-left:2.5em}@media only screen and (min-width: 60.0625em){ardn-login-form[_ngcontent-%COMP%]   .form__privileges-part[_ngcontent-%COMP%]{height:150px}.subheader[_ngcontent-%COMP%]{padding-top:19px;height:129px}}ardn-login-form[_ngcontent-%COMP%]   .form-error[_ngcontent-%COMP%]{margin-bottom:0}ardn-login-form[_ngcontent-%COMP%]   .field[_ngcontent-%COMP%]{margin-bottom:5px}.agreement-asterisk[_ngcontent-%COMP%]{color:#9b9b9b}.processing-personal-data-more-agreement[_ngcontent-%COMP%]{display:inline-block;padding-left:33px;font-size:15px}.processing-personal-data-more-agreement[_ngcontent-%COMP%]   .color-primary[_ngcontent-%COMP%]{margin-left:-33px}.price-without-registration[_ngcontent-%COMP%]{font-size:17px;display:block;margin-top:1rem}.h3[_ngcontent-%COMP%]{font-size:16px}.checkbox[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:1em}.guest-auth[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:5px;align-items:start;padding:1em 0}@media only screen and (min-width: 40.0625em){.guest-auth[_ngcontent-%COMP%]{gap:5px}}@media only screen and (max-width: 40em){.guest-auth[_ngcontent-%COMP%]{grid-template-columns:1fr;gap:5px}}"],data:{animation:[kl.P]},changeDetection:0})}}return i})();var Me=s(39083);const oc=(0,s(1522).A)(function(i,p){return null==i?{}:function tc(i,p){return Nn(i,p,function(t,n){return wt(i,n)})}(i,p)}),ac=function sc(i){return null===i};var dc=s(91654),lc=s(69655);let Ro=(()=>{class i{constructor(t){this.apiClientService=t}validate(t){return t=Ie()(t,n=>!n),this.apiClientService.get("order/price",!0,t).pipe((0,Se.W)(n=>{const r={};return n.error.fields.senderPostCode&&(r["senderAddress[postCode]"]="COMMON.ERRORS.UNSUPPORTED_POSTCODE"),n.error.fields.receiverPostCode&&(r["receiverAddress[postCode]"]="COMMON.ERRORS.UNSUPPORTED_POSTCODE"),Object.keys(r)?(0,H.$)(()=>({fields:r,general:[]})):null}))}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(ie.f))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var To=s(68935),cc=s(3257),Xi=s(51218),Yi=s(27755),Wi=s(39096),uc=s(84226),pc=s(45230),hc=s(71343),mc=s(15930),gc=s(45233),fc=s(44538);function Cc(i,p){if(1&i&&(e.j41(0,"div",0)(1,"span",1)(2,"span",2)(3,"ardn-flag",3),e.EFF(4),e.k0s()()()()),2&i){const t=e.XpG();e.R7$(3),e.Y8G("isoCode",null==t.country?null:t.country.isoCode),e.R7$(),e.SpI(" ",null==t.country?null:t.country.name," ")}}let _c=(()=>{class i{constructor(t){this.countryService=t,this.countryId=(0,e.hFB
1)()}ngOnChanges(){this.countryService.getCountryCached(this.countryId()).pipe((0,U.p)(t=>!!t)).subscribe(t=>{this.country=t})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(be.o))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-preview-country"]],inputs:{countryId:[1,"countryId"]},standalone:!0,features:[e.OA$,e.aNF],decls:1,vars:1,consts:[[1,"input","input--number"],[1,"select2-selection","select2-selection--single"],[1,"select2-selection__rendered"],[3,"isoCode"]],template:function(n,r){1&n&&e.DNE(0,Cc,5,2,"div",0),2&n&&e.vxM(r.country?0:-1)},dependencies:[Xe.q],styles:[".select2-selection--single[_ngcontent-%COMP%]{display:block;height:100%}.select2-selection--single[_ngcontent-%COMP%]   .select2-selection__rendered[_ngcontent-%COMP%]{text-align:left;line-height:46px}.select2-selection--single[_ngcontent-%COMP%]   .select2-selection__rendered[_ngcontent-%COMP%]     .flag{vertical-align:middle;margin-top:-4px;margin-right:4px}"]})}}return i})(),Io=(()=>{class i{constructor(t){this.store=t,this.unsubscribeObservable=new re.B}ngOnInit(){this.store.select(T.ro).pipe((0,U.p)(t=>!!t),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.searchParams=t})}ngOnDestroy(){this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(v.il))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-preview-search-product"]],standalone:!0,features:[e.aNF],decls:56,vars:38,consts:[[1,"box"],[1,"box__body"],[1,"row","order-grid"],[1,"col","order-grid__from-to"],[1,"row"],[1,"col","col-6","pb-0"],[1,"field"],[1,"label"],[1,"country-chooser-right"],[3,"countryId"],[1,"col","order-grid__dimensions"],[1,"col","col-3","pb-0"],["for","length",1,"label"],[1,"number-input-right"],[3,"value","isDisabled","showArrow"],["for","width",1,"label"],["for","height",1,"label"],["for","weight",1,"label"],[1,"col","order-grid__last","pb-4"],["for","quantity",1,"label"]],template:function(n,r){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6)(7,"label",7),e.EFF(8),e.nI1(9,"translate"),e.k0s(),e.j41(10,"div",8),e.nrm(11,"ardn-preview-country",9),e.k0s()()(),e.j41(12,"div",5)(13,"div",6)(14,"label",7),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.j41(17,"div",8),e.nrm(18,"ardn-preview-country",9),e.k0s()()()()(),e.j41(19,"div",10)(20,"div",4)(21,"div",11)(22,"div",6)(23,"label",12),e.EFF(24),e.nI1(25,"translate"),e.k0s(),e.j41(26,"div",13),e.nrm(27,"ardn-number-input",14),e.k0s()()(),e.j41(28,"div",11)(29,"div",6)(30,"label",15),e.EFF(31),e.nI1(32,"translate"),e.k0s(),e.j41(33,"div",13),e.nrm(34,"ardn-number-input",14),e.k0s()()(),e.j41(35,"div",11)(36,"div",6)(37,"label",16),e.EFF(38),e.nI1(39,"translate"),e.k0s(),e.j41(40,"div",13),e.nrm(41,"ardn-number-input",14),e.k0s()()(),e.j41(42,"div",11)(43,"div",6)(44,"label",17),e.EFF(45),e.nI1(46,"translate"),e.k0s(),e.j41(47,"div",13),e.nrm(48,"ardn-number-input",14),e.k0s()()()()(),e.j41(49,"div",18)(50,"div",6)(51,"label",19),e.EFF(52),e.nI1(53,"translate"),e.k0s(),e.j41(54,"div",13),e.nrm(55,"ardn-number-input",14),e.k0s()()()()()()),2&n&&(e.R7$(8),e.JRh(e.bMT(9,24,"SEARCH_PRODUCT.FORM.FROM")),e.R7$(3),e.Y8G("countryId",null==r.searchParams?null:r.searchParams.senderCountryId),e.R7$(4),e.SpI(" ",e.bMT(16,26,"SEARCH_PRODUCT.FORM.TO"),""),e.R7$(3),e.Y8G("countryId",null==r.searchParams?null:r.searchParams.receiverCountryId),e.R7$(6),e.SpI(" ",e.bMT(25,28,"SEARCH_PRODUCT.FORM.LENGTH"),""),e.R7$(3),e.Y8G("value",null==r.searchParams?null:r.searchParams.length)("isDisabled",!0)("showArrow",!1),e.R7$(4),e.SpI(" ",e.bMT(32,30,"SEARCH_PRODUCT.FORM.WIDTH"),""),e.R7$(3),e.Y8G("value",null==r.searchParams?null:r.searchParams.width)("isDisabled",!0)("showArrow",!1),e.R7$(4),e.SpI(" ",e.bMT(39,32,"SEARCH_PRODUCT.FORM.HEIGHT"),""),e.R7$(3),e.Y8G("value",null==r.searchParams?null:r.searchParams.height)("isDisabled",!0)("showArrow",!1),e.R7$(4),e.SpI(" ",e.bMT(46,34,"SEARCH_PRODUCT.FORM.WEIGHT"),""),e.R7$(3),e.Y8G("value",null==r.searchParams?null:r.searchParams.weight)("isDisabled",!0)("showArrow",!1),e.R7$(4),e.JRh(e.bMT(53,36,"SEARCH_PRODUCT.FORM.QUANTITY")),e.R7$(3),e.Y8G("value",null==r.searchParams?null:r.searchParams.quantity)("isDisabled",!0)("showArrow",!1))},dependencies:[ot.N,f.h,f.D9,_c],styles:[".box[_ngcontent-%COMP%]{zoom:.8;margin-top:20px}@media only screen and (max-width: 1100px){.box[_ngcontent-%COMP%]{display:none}}@media screen and (max-width: 1210px){.box[_ngcontent-%COMP%]   .pb-4[_ngcontent-%COMP%]{padding-left:30px}}
1.box[_ngcontent-%COMP%]   .order-grid[_ngcontent-%COMP%]     .number-input .input:disabled, .box[_ngcontent-%COMP%]   .order-grid[_ngcontent-%COMP%]     ardn-preview-country .input{color:#9b9b9b;background-color:#ffffffe0}@media screen and (min-width: 1210px){.box[_ngcontent-%COMP%]{margin-top:30px}.box[_ngcontent-%COMP%]   .order-grid__from-to[_ngcontent-%COMP%]{padding:0 10px}.box[_ngcontent-%COMP%]   .order-grid__dimensions[_ngcontent-%COMP%], .box[_ngcontent-%COMP%]   .order-grid__dimensions[_ngcontent-%COMP%]   .col[_ngcontent-%COMP%]{padding-left:10px}}",'@media only screen and (max-width: 40em){.search-product-button[_ngcontent-%COMP%]{margin-top:25px}}@media only screen and (max-width: 40em){.search-product-button-maritime[_ngcontent-%COMP%]{margin-top:25px}}.country-post-code-container[_ngcontent-%COMP%]{display:flex}@media only screen and (min-width: 60.0625em),only screen and (min-width: 40.0625em),only screen and (max-width: 40em){.country-post-code-container[_ngcontent-%COMP%]   .col.post-code-right[_ngcontent-%COMP%]{padding-left:0}}@media only screen and (min-width: 60.0625em),only screen and (min-width: 40.0625em),only screen and (max-width: 40em){.country-post-code-container[_ngcontent-%COMP%]   .col.post-code-right[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0;border-left:1px solid #bcbcbc}}@media only screen and (min-width: 60.0625em),only screen and (min-width: 40.0625em),only screen and (max-width: 40em){.country-post-code-container[_ngcontent-%COMP%]   .col.post-code-left[_ngcontent-%COMP%]{padding-right:0}}@media only screen and (min-width: 60.0625em),only screen and (min-width: 40.0625em),only screen and (max-width: 40em){.country-post-code-container[_ngcontent-%COMP%]   .col.post-code-left[_ngcontent-%COMP%]     .select2-container .select2-selection--single{border-top-right-radius:0;border-bottom-right-radius:0}}.country-post-code-container[_ngcontent-%COMP%]   .col[_ngcontent-%COMP%]     .select2-wrapper .img-flag-wrap{text-overflow:unset;overflow:unset}.col[_ngcontent-%COMP%]{vertical-align:top}@media only screen and (max-width: 40em){.field[_ngcontent-%COMP%]{margin-top:10px}}.field[_ngcontent-%COMP%]   .has-error[_ngcontent-%COMP%]     .form-error{margin-top:5px}.field[_ngcontent-%COMP%]     .label{font-weight:400}.field[_ngcontent-%COMP%]     .label .slider-reset{display:inline-block;font-size:14px;margin:0 0 0 10px;vertical-align:middle;cursor:pointer}.field[_ngcontent-%COMP%]   .label[for=weight][_ngcontent-%COMP%]   .tooltip[_ngcontent-%COMP%]{margin-bottom:4px;position:sticky}.tooltip-marine[_ngcontent-%COMP%]{color:#f3f3f3;border-color:#f3f3f3}@media only screen and (max-width: 40em){.tooltip-marine[_ngcontent-%COMP%]{display:none}}.product-option-selector[_ngcontent-%COMP%]{display:grid;column-gap:5px;grid-template:"regular maritime" 1fr/1fr 1fr 1fr 1fr;width:100%}.regular[_ngcontent-%COMP%]{grid-area:regular;background-color:#1e3042;border:1px solid #1e3042;width:100%;height:100%;font-size:large;margin:auto 10px 0 0}.regular[_ngcontent-%COMP%]:hover{background-color:#182635}@media only screen and (max-width: 40em){.regular[_ngcontent-%COMP%]{font-size:15px}}.maritime[_ngcontent-%COMP%]{grid-area:maritime;background-color:#3b6ba5;width:100%;height:100%;font-size:large}.maritime[_ngcontent-%COMP%]:hover{background-color:#325a8b}@media only screen and (max-width: 40em){.maritime[_ngcontent-%COMP%]{font-size:15px}}.maritime_form[_ngcontent-%COMP%]{background-color:#3b6ba5}.maritime_form[_ngcontent-%COMP%]   .search-product-button[_ngcontent-%COMP%]{background-color:#96c21f;border:1px solid #96c21f}.maritime_form[_ngcontent-%COMP%]   .search-product-button[_ngcontent-%COMP%]:hover{background-color:#79a600;border:1px solid #79a600}.search-form[_ngcontent-%COMP%]     .has-error .input, .search-form[_ngcontent-%COMP%]     .has-error .textarea, .search-form[_ngcontent-%COMP%]     .has-error .select2-container .select2-selection--single{border-color:#f66868;border-width:2px}.search-form[_ngcontent-%COMP%]     .form-error{color:#f66868;font-weight:500}.sharp__bottom[_ngcontent-%COMP%]{border-bottom-left-radius:0;border-bottom-right-radius:0}.sharp__upper_left[_ngcontent-%COMP%]{border-top-left-radius:0}.gram-error[_ngcontent-%COMP%]{margin-top:-5px}.show-hide-advanced-search-options[_ngcontent-%COMP%]{text-align:center}.show-hide-advanced-search-options[_ngcontent-%COMP%]   .ardn-button[_ngcontent-%COMP%]{margin:0 auto 12px;box-shadow:none;--button-primary-shadow: 255, 255, 255 !important}.show-hide-advanced-search-options[_ngcontent-%COMP%]   .ardn-button[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{margin:-1.5px 0 -1.5px 12px}@media only screen and (max-width: 40em){.number-input-right[_ngcontent-%COMP%], .country-chooser-right[_ngcontent-%COMP%]{float:right;margin-top:-40px;padding-bottom:10px}.country-chooser-right[_ngcontent-%COMP%]{width:190px}.number-input-right[_ngcontent-%COMP%]{width:120px}}.time-options[_ngcontent-%COMP%]{white-space:nowrap}@media only screen and (max-width: 75.625em){.time-options[_ngcontent-%COMP%]{white-space:normal}}.get-offers-button[_ngcontent-%COMP%]{font-size:16px;font-weight:600}']})}}return i})();var Do=s(64605),Mo=s(27050),Ln=s(84381),Hi=s(47173),Fo=s(53236),Oc=s(44051);const yc=["searchInput"],vc=i=>
1({"item-active":i});function Ec(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,1,"ORDER_PAGE.MAP_MODAL.TITLE")))}function Sc(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,1,"ORDER_PAGE.MAP_MODAL.TITLE_2")))}function bc(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,1,"ORDER_PAGE.MAP_MODAL.NEAREST_POINTS")))}function Pc(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.JRh(e.bMT(2,1,"ORDER_PAGE.MAP_MODAL.ALL_POINTS")))}function Ac(i,p){1&i&&(e.j41(0,"div",17)(1,"div",22),e.EFF(2,"Loading..."),e.k0s()())}function Rc(i,p){1&i&&(e.j41(0,"div",18)(1,"p"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&i&&(e.R7$(2),e.JRh(e.bMT(3,1,"ORDER_PAGE.MAP_MODAL.NO_RESULTS")))}function Tc(i,p){if(1&i){const t=e.RV6();e.j41(0,"li",23)(1,"span",24),e.bIt("click",function(){const r=e.eBV(t).$implicit,o=e.XpG(3);return e.Njj(o.onClickSelectPoint(r))}),e.EFF(2),e.k0s()()}if(2&i){const t=p.$implicit,n=e.XpG(3);e.R7$(),e.Y8G("ngClass",e.eq3(6,vc,!!n.activeShipmentPoint&&n.activeShipmentPoint.id===t.id))("ardnDataTestId","ardn-order-map-modal-form-item-"+(null==t?null:t.id)),e.R7$(),e.LHq(" ",t.id," ",t.city," ",t.postCode,", ",t.address," ")}}function Ic(i,p){if(1&i&&(e.j41(0,"ul",19),e.Z7z(1,Tc,3,8,"li",23,e.fX1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Dyx(t.filteredShipmentPoints)}}function Dc(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-modal-body",7)(1,"div",8)(2,"div",9)(3,"div",10)(4,"div",11)(5,"div",12),e.nrm(6,"input",13,0),e.nI1(8,"translate"),e.j41(9,"button",14),e.bIt("click",function(){e.eBV(t);const r=e.sdS(7),o=e.XpG();return e.Njj(o.searchPoints(r.value))}),e.EFF(10),e.nI1(11,"translate"),e.k0s()()(),e.j41(12,"div",11)(13,"button",15),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.onClickNearestPoints())}),e.DNE(14,bc,3,3,"span")(15,Pc,3,3,"span"),e.k0s()()(),e.j41(16,"div",16),e.DNE(17,Ac,3,0,"div",17)(18,Rc,4,3,"div",18)(19,Ic,3,0,"ul",19),e.k0s()(),e.j41(20,"div",20),e.nrm(21,"div",21),e.nI1(22,"translate"),e.nI1(23,"translate"),e.nI1(24,"translate"),e.nI1(25,"translate"),e.k0s()()()}if(2&i){const t=e.XpG();e.R7$(2),e.Y8G("formGroup",t.optionsForm),e.R7$(4),e.Y8G("placeholder",e.bMT(8,14,"ORDER_PAGE.MAP_MODAL.SEARCH_PLACEHOLDER"))("ardnDataTestId","ardn-order-map-modal-form-search-input"),e.R7$(4),e.SpI(" ",e.bMT(11,16,"COMMON.SEARCH")," "),e.R7$(3),e.Y8G("ardnDataTestId","ardn-order-map-modal-form-search-button"),e.R7$(),e.vxM(t.showAll?14:-1),e.R7$(),e.vxM(t.showAll?-1:15),e.R7$(2),e.vxM(t.isLoading?17:-1),e.R7$(),e.vxM(t.isNoResults?18:-1),e.R7$(),e.vxM(t.isShowResults()&&t.inSearchMode&&t.showSearchResults?19:-1),e.R7$(2),e.BMQ("data-city",e.bMT(22,18,"ORDER_PAGE.MAP_MODAL.CITY"))("data-address",e.bMT(23,20,"ORDER_PAGE.MAP_MODAL.ADDRESS"))("data-hours",e.bMT(24,22,"ORDER_PAGE.MAP_MODAL.HOURS"))("data-choose",e.bMT(25,24,"ORDER_PAGE.MAP_MODAL.CHOOSE"))}}let $o=(()=>{class i{constructor(t,n,r,o,u,g,A){this.formBuilder=t,this.store=n,this.pointsService=r,this.osmService=o,this.platformId=u,this.appConfig=g,this.changeDetector=A,this.modalId=(0,e.hFB)(),this.isOpen=!1,this.scrollModal=null,this.inSearchMode=!1,this.showSearchResults=!1,this.unsubscribeObservable=new re.B,this.allShipmentPoints=[],this.nearestShipmentPoints=[],this.nearestShipmentPointsBySide={},this.zoomType="Initial",this.middleOfPolandCoords={latitude:52.069461876553135,longitude:19.480354113802694},this.zoomTypeValues={INITIAL:6,CITY:11,NEAREST:13,DETAILED:17},this.isPlatformBrowser=(0,l.UE)(this.platformId),this.plZipCodeLength=this.appConfig.initialCountries.find(N=>N.isoCode.toLowerCase()===this.appConfig.defaultLocationId).postCodeFormat.length}ngAfterViewInit(){this.optionsForm.get("search").valueChanges.pipe((0,ce.B)(1e3),(0,j.F)()).subscribe(t=>{t.length>2?this.searchPoints(t):this.inSearchMode=!1})}searchPoints(t){const n=this.allShipmentPoints?.find(r=>r.id.toLowerCase()===t.toLowerCase());n&&(this.zoomType=this.appConfig.mapZoomTypes.Detailed,this.setPointWithUser
1KnownId(n)),!n&&t&&this.onChangeSearch(t)}setPointWithUserKnownId(t){this.desiredCityCoords={latitude:t.latitude,longitude:t.longitude},this.filteredShipmentPoints=[t],this.isNoResults=!1,this.placeMarkersAndZoom(!0)}ngOnInit(){this.order=null,this.shipment=null,this.buildForm()}ngOnDestroy(){this.osmDestroy()}getSideAddressFromStoreObservable(t){return this.store.select((0,T.BM)(`${t.toLowerCase()}Address`)).pipe((0,U.p)(n=>!!n),(0,B.Q)(this.unsubscribeObservable))}setInitialMapView(t){this.gatherRequiredDataAndSetView(t),this.changeDetector.markForCheck()}gatherRequiredDataAndSetView(t){this.getSideAddressFromStoreObservable(t).subscribe(n=>{this.getInitialCoords(n.city,n.postCode),this.setMapView()})}setMapView(){!this.initialCoords||this.nearestPointsViewCoords?this.nearestPointsViewCoords?this.moveToPointWithProperZoomValue(this.nearestPointsViewCoords):this.initialCoords||this.nearestPointsViewCoords||this.moveToPointWithProperZoomValue(this.middleOfPolandCoords):this.moveToPointWithProperZoomValue(this.initialCoords)}getInitialCoords(t,n){if(this.allShipmentPoints.length){let r=this.allShipmentPoints?.find(o=>o.postCode===n);r||(r=this.allShipmentPoints?.find(o=>o.city===t)),r||this.getNeighbourPostCodes(n)?.forEach(u=>{r||(r=this.allShipmentPoints?.find(g=>g.postCode===u))}),r&&(this.initialCoords={latitude:r.latitude,longitude:r.longitude},this.zoomType=this.appConfig.mapZoomTypes.City)}}getNeighbourPostCodes(t){if(!t)return null;const n=[],r=t?.split("-")[1],o=r?.charAt(r?.length-1);if(o&&"0"!==o&&"9"!==o){const u=parseInt(o,10),g=t.substring(0,t.length-1);n.push(g.concat((u-1).toString())),n.push(g.concat((u+1).toString()))}if(o&&"0"===o){const u=parseInt(o,10),g=t.substring(0,t.length-1);n.push(g.concat((u+1).toString())),n.push(g.concat((u+2).toString()))}if(o&&"9"===o){const u=parseInt(o,10),g=t.substring(0,t.length-1);n.push(g.concat((u-1).toString())),n.push(g.concat((u-2).toString()))}return n}onClickNearestPoints(){this.showAll=!this.showAll,this.inSearchMode=!this.showAll,this.showSearchResults=!this.showAll,this.zoomType=this.showAll?this.appConfig.mapZoomTypes.Initial:this.appConfig.mapZoomTypes.Nearest,this.inSearchMode||(this.nearestPointsViewCoords=null),this.searchTextPoint="",this.optionsForm.get("search").patchValue(this.searchTextPoint),this.fillShipmentPoints()}onChangeSearch(t){this.desiredCityCoords=null;let n=this.showAll;this.showAll=!0,this.getFilteredResults(t),n||(n=this.showAll)}onClickSelectPoint(t){this.activeShipmentPoint=t,this.osmMoveTo(t),setTimeout(()=>{this.osmOpenMarkerPopup(t.id)},300)}onClickChoosePoint(t){let n;switch(!0){case this.showAll&&!this.inSearchMode:n=this.allShipmentPoints;break;case this.showAll&&this.inSearchMode:n=this.filteredShipmentPoints;break;case!this.showAll:n=this.nearestShipmentPoints}const r=n.find(o=>o.id===t);r&&"object"==typeof r&&(this.store.dispatch(F.M.setMapModalShipmentParametersAction({selectedPoint:r})),this.modal.close(),this.closeModal(),setTimeout(()=>{this.changeDetector.markForCheck()}))}open(){this.modal.open()}onScroll(t){this.scrollModal=t.top}isOpenChangeModal(t){this.isOpen=t,t?this.openModal():this.closeModal()}openModal(){this.showSearchResults=!1,this.showAll=!1,this.shipment=null,this.searchTextPoint="",this.allShipmentPoints=[],this.nearestShipmentPoints=[],this.isLoading=!0,this.optionsForm.get("search").patchValue(""),this.unsubscribeObservable=new re.B,this.store.select(T.PE).pipe((0,j.F)(E()),(0,M.s)(1),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.order=t;const n=t.shipment;n&&"object"==typeof n&&(this.shipment=n,setTimeout(()=>{this.isOpen&&(this.fillShipmentPoints(),this.osmInitialize(),setTimeout(()=>{this.isLoading=!1},1e3))},100))})}getPointAddressType(t,n){switch(t){case"RECEIVER":return ze.RECEIVER;case"SENDER":return n?ze.CROSSBORDER:ze.SENDER}}isCODAddonSelected(t){return!!t&&void 0!==t.find(n=>"CASH_ON_DELIVERY"===n.category)}closeModal(){this.resetCoordsStates(),this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}resetCoordsStates(){this.desiredCityCoords=null,this.initialCoords=null,this.nearestPointsViewCoords=null,this.zoomType=this.appConfig.mapZo
1omTypes.Initial,this.showSearchResults=!1}buildForm(){this.optionsForm=this.formBuilder.group({search:[""]})}fillShipmentPoints(){if(this.shipment&&"object"==typeof this.shipment){if(this.shipment?.mapModalShipmentPoint?.isLoading)return void(this.isLoading=!0);if(this.showAll?this.allShipmentPoints.length&&!this.shipment.mapModalShipmentPoint.isLoading&&(this.filteredShipmentPoints=this.getFilteredPoints(),this.isNoResults=this.filteredShipmentPoints?.length>0):this.nearestShipmentPoints.length&&(this.filteredShipmentPoints=this.nearestShipmentPoints,this.isNoResults=this.filteredShipmentPoints?.length>0,this.setCurrentFilteredShipmentPoints()),this.activeShipmentPoint=null,this.isNoResults=!1,this.showAll)this.allShipmentPoints=this.isSender()?this.shipment.mapModalShipmentPoint.allPoints?.sender:this.shipment.mapModalShipmentPoint.allPoints?.receiver??[],this.setFocusOnSearchInputElement(),this.allShipmentPoints.length&&0===this.allShipmentPoints.length?this.setNoResults():this.filteredShipmentPoints=this.getFilteredPoints(),this.setCurrentFilteredShipmentPoints(),this.filteredShipmentPoints?.length>0&&(this.nearestPointsViewCoords={latitude:this.filteredShipmentPoints[0].latitude,longitude:this.filteredShipmentPoints[0].longitude});else{const t=this.isSender()?"SENDER":"RECEIVER",n=this.getShipmentPointApiParameters(),r=this.nearestShipmentPointsBySide[t];r&&E()(r.params,n)?this.applyNearestShipmentPoints(r.points):(this.isLoading=!0,(0,Un.s)(this.pointsService.getPoints(n)).then(o=>{this.nearestShipmentPointsBySide[t]={params:n,points:o},this.applyNearestShipmentPoints(o)}).catch(()=>{this.setNoResults(),this.setCurrentFilteredShipmentPoints()}).finally(()=>{this.isLoading=!1}))}setTimeout(()=>{this.isSender()?this.setInitialMapView("SENDER"):this.setInitialMapView("RECEIVER")},1e3)}}applyNearestShipmentPoints(t){0===t.length?this.setNoResults():(this.nearestShipmentPoints=t,this.filteredShipmentPoints=this.nearestShipmentPoints,this.nearestPointsViewCoords={latitude:this.filteredShipmentPoints[0].latitude,longitude:this.filteredShipmentPoints[0].longitude},this.zoomType=this.appConfig.mapZoomTypes.Nearest,this.moveToPointWithProperZoomValue(this.nearestPointsViewCoords)),this.setCurrentFilteredShipmentPoints(),this.setFocusOnSearchInputElement()}setFocusOnSearchInputElement(){setTimeout(()=>{this.searchInput&&this.searchInput.nativeElement.focus()},300)}setCurrentFilteredShipmentPoints(){setTimeout(()=>{this.clearAndAddMarkers()},300)}setNoResults(){this.isNoResults=!0,this.filteredShipmentPoints=[]}getFilteredPoints(){const t=this.isCODAddonSelected(this.shipment.addons),n=this.pointsService.isWeeklyDeliveryAddonChecked(this.shipment.addons);return t&&!n?this.allShipmentPoints?.filter(r=>r.cashOnDeliveryAvailable):!t&&n?this.allShipmentPoints?.filter(r=>"APM"===r.type):t&&n?this.allShipmentPoints?.filter(r=>"APM"===r.type&&r.cashOnDeliveryAvailable):this.allShipmentPoints}getShipmentPointApiParameters(){const t="SENDER"===this.shipment.mapModalShipmentPoint.shipmentPointType?this.order.senderAddress.city:this.order.receiverAddress.city,n="SENDER"===this.shipment.mapModalShipmentPoint.shipmentPointType?this.order.senderAddress.postCode:this.order.receiverAddress.postCode,r="SENDER"===this.shipment.mapModalShipmentPoint.shipmentPointType?this.order.senderAddress.countryId:this.order.receiverAddress.countryId;return{productId:this.shipment.productId,isCashOnDeliveryAddonSelected:this.isCODAddonSelected(this.shipment.addons),city:t,postCode:n,addressType:this.getPointAddressType(this.shipment.mapModalShipmentPoint.shipmentPointType,"CROSSBORDER"===this.shipment.collectionType),countryId:r,type:this.pointsService.isWeeklyDeliveryAddonChecked(this.shipment.addons)?"APM":null}}getFilteredResults(t){const n=this.getShipmentPointApiParameters();n.filter=t,this.pointsService.getPoints(n).pipe((0,M.s)(1)).subscribe({next:r=>{r.length?(this.filteredShipmentPoints=r,this.isNoResults=!1,this.inSearchMode=!0):this.setNoResults();const o=this.checkIfInputMatchesPostCodeRegex(t),u=this.filteredShipmentPoints.filter(g=>t.toLowerCase().includes(g.city.toLowerCase()));if(u.length&&(this.desiredCityCoords={latitude:u[0].latitude,longitude:u[0].longitude}),!u.length&&o){const g=this.filteredShipmentPoints.filter(A=>A.postCode===t)[0];g&&(this.desiredCityCoords={latitude:g.latitude,longitude:g.longitude})}this.placeMarkersAndZoom()},error:()=>{this.setNoResults(),this.placeMarkersAndZoom(),this.changeDetector.markForCheck()}}),this.showSearchResults=!0}checkIfInputMatchesPostCodeRegex(t){const n=new RegExp("[0-9]{2}-[0-9]{3}");return!(t.length!==this.plZipCodeLength||!t.match(n))}placeMarkersAndZoom(t){this.clearAndAddMarkers();const n=this.optionsForm.get("search").value;
1t?(this.zoomType=this.appConfig.mapZoomTypes.Detailed,this.moveToPointWithProperZoomValue(this.desiredCityCoords),this.inSearchMode=!0,this.showSearchResults=!0):t||(n?(this.zoomType=this.desiredCityCoords?this.appConfig.mapZoomTypes.City:this.appConfig.mapZoomTypes.Initial,this.moveToPointWithProperZoomValue(this.desiredCityCoords?this.desiredCityCoords:this.middleOfPolandCoords)):(this.zoomType=this.appConfig.mapZoomTypes.Initial,this.moveToPointWithProperZoomValue(this.middleOfPolandCoords))),this.changeDetector.markForCheck()}isShowResults(){return this.showAll?this.allShipmentPoints?.length>0&&!this.isLoading:this.nearestShipmentPoints?.length>0&&!this.isLoading}isSender(){return"SENDER"===this.shipment?.mapModalShipmentPoint?.shipmentPointType}osmInitialize(){this.osmService.init(),this.osmService.registerOnChoosePoint(t=>{this.onClickChoosePoint(t)})}osmMoveTo(t){const n={longitude:t.longitude,latitude:t.latitude};this.zoomType=this.appConfig.mapZoomTypes.Detailed,this.moveToPointWithProperZoomValue(n)}osmAddMarkers(){if(this.filteredShipmentPoints&&this.filteredShipmentPoints.length)for(const t of this.filteredShipmentPoints)this.osmAddMarker(t)}osmAddMarker(t){this.osmService.addMarker({coordinates:{longitude:t.longitude,latitude:t.latitude},id:t.id,name:t.address,city:t.city,address:t.address,openingHours:t?.openingHours})}clearAndAddMarkers(){this.osmClearMarkers(),this.osmAddMarkers()}osmClearMarkers(){this.osmService.clearMarkers(),this.osmService.closePopup()}osmOpenMarkerPopup(t){this.osmService.openMarkerPopup(t)}osmDestroy(){this.osmService.destroy()}moveToPointWithProperZoomValue(t){switch(this.nearestShipmentPoints===this.filteredShipmentPoints&&!this.activeShipmentPoint&&(this.zoomType=this.appConfig.mapZoomTypes.Nearest,this.inSearchMode=!0),this.isNoResults&&(this.zoomType=this.appConfig.mapZoomTypes.Initial),this.zoomType){case this.appConfig.mapZoomTypes.Initial:this.osmService.moveTo(t,this.zoomTypeValues.INITIAL);break;case this.appConfig.mapZoomTypes.City:this.osmService.moveTo(t,this.zoomTypeValues.CITY);break;case this.appConfig.mapZoomTypes.Detailed:this.osmService.moveTo(t,this.zoomTypeValues.DETAILED);break;case this.appConfig.mapZoomTypes.Nearest:this.osmService.moveTo(t,this.zoomTypeValues.NEAREST)}}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(m.ok),e.rXU(v.il),e.rXU(xn.D),e.rXU(Oc.z),e.rXU(e.Agw),e.rXU(Ae.vQ),e.rXU(e.gRc))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-map-modal"]],viewQuery:function(n,r){if(1&n&&(e.GBs(yc,5),e.GBs(Ln.z,7)),2&n){let o;e.mGM(o=e.lsd())&&(r.searchInput=o.first),e.mGM(o=e.lsd())&&(r.modal=o.first)}},inputs:{modalId:[1,"modalId"]},standalone:!0,features:[e.aNF],decls:10,vars:5,consts:[["searchInput",""],[1,"order-modal","order-map-modal",3,"isOpenChange","isScroll","mode","id"],[1,"order-modal__header"],[1,"order-modal__icon"],[1,"icon","order-modal__icon--width"],["href","assets/img/sprites.svg#icon-package"],[1,"modal-title","h1","order-modal__title"],[1,"order-modal__body"],[1,"row","order-map-modal__main-row"],[1,"col","col-4","col-portable-12","col-mobile-12","order-map-modal__search",3,"formGroup"],[1,"row","row--micro-gutter","order-map-modal__search--row"],[1,"col","col-12"],[1,"field"],["id","search-input","type","text","formControlName","search",1,"input","order-map-modal__search--input",3,"placeholder","ardnDataTestId"],[1,"btn","btn--primary","order-map-modal__search--button","btn-search",3,"click"],[1,"btn","btn--primary","order-map-modal__search--button",3,"click","ardnDataTestId"],[1,"order-map-modal__search-results"],[1,"loader-fix-size-wrap","order-map-modal__loader"],[1,"order-map-modal__no-results"],[1,"order-map-modal__search-results--list"],[1,"col","col-8","col-portable-12","col-mobile-12","order-map-modal__map"],["id","open-street-map","tabindex","0",1,"map","order-map-modal__map--content"],[1,"loader","loader--gray"],[1,"order-map-modal__search-results--item"],[1,"padding",3,"click","ngClass","ardnDataTestId"]],template:function(n,r){1&n&&(e.j41(0,"ardn-modal",1),e.bIt("isOpenChange",function(u){return r.isOpenChangeModal(u)}
1)("isScroll",function(u){return r.onScroll(u)}),e.j41(1,"ardn-modal-header")(2,"div",2)(3,"div",3),e.qSk(),e.j41(4,"svg",4),e.nrm(5,"use",5),e.k0s()(),e.joV(),e.j41(6,"h4",6),e.DNE(7,Ec,3,3,"span")(8,Sc,3,3,"span"),e.k0s()()(),e.DNE(9,Dc,26,26,"ardn-modal-body",7),e.k0s()),2&n&&(e.Y8G("mode","EXTRA-BIG")("id",r.modalId()),e.R7$(7),e.vxM(r.isSender()?7:-1),e.R7$(),e.vxM(r.isSender()?-1:8),e.R7$(),e.vxM(r.isOpen?9:-1))},dependencies:[Hi.e,Fo.J,Ln.z,m.X1,m.me,m.BC,m.cb,m.j4,m.JD,f.h,f.D9,Z.Z,l.YU],styles:[".order-map-modal[_ngcontent-%COMP%]   .order-modal__header[_ngcontent-%COMP%]{margin:-40px 0 0}.order-map-modal[_ngcontent-%COMP%]   .order-modal__title[_ngcontent-%COMP%]{font-size:25px}@media only screen and (max-width: 40em){.order-map-modal[_ngcontent-%COMP%]   .order-modal__title[_ngcontent-%COMP%]{font-size:20px!important}}.order-map-modal[_ngcontent-%COMP%]   .order-modal__body[_ngcontent-%COMP%]{height:100%}.order-map-modal[_ngcontent-%COMP%]     .modal-body{padding:0!important;height:100%}.order-map-modal[_ngcontent-%COMP%]     .modal-header{padding:4rem 0 0}.order-map-modal[_ngcontent-%COMP%]     .modal-header .close{z-index:99998}.order-map-modal__main-row[_ngcontent-%COMP%]{margin:0 0 -20px -20px;display:flex;height:100%;flex-direction:row}@media only screen and (max-width: 60em){.order-map-modal__main-row[_ngcontent-%COMP%]{flex-direction:column}}.order-map-modal__search[_ngcontent-%COMP%]{border-right:1px solid #e3e3e3;padding:0 0 0 20px}.order-map-modal__search--row[_ngcontent-%COMP%]{margin:0;border-bottom:1px solid #e3e3e3;padding:15px 20px 5px 10px}.order-map-modal__search--row[_ngcontent-%COMP%]   .col[_ngcontent-%COMP%]{vertical-align:bottom}.order-map-modal__search--row[_ngcontent-%COMP%]   .field[_ngcontent-%COMP%]{margin:0;display:flex}.order-map-modal__search--input[_ngcontent-%COMP%]{width:69%;margin-right:1%}.order-map-modal__search--button[_ngcontent-%COMP%]{line-height:.5rem!important}.order-map-modal__search[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{width:100%;line-height:1.85rem;padding:.6em}.order-map-modal__search[_ngcontent-%COMP%]   .btn-search[_ngcontent-%COMP%]{align-self:flex-end;width:30%;height:40px;font-size:14px;padding:.6em}.order-map-modal__search[_ngcontent-%COMP%]   .input[_ngcontent-%COMP%]{height:40px;font-size:14px}.order-map-modal__search-results[_ngcontent-%COMP%]{max-height:560px;overflow:auto}@media only screen and (max-width: 60em){.order-map-modal__search-results[_ngcontent-%COMP%]{max-height:200px}}.order-map-modal__search-results--item[_ngcontent-%COMP%]{border-bottom:1px solid #e3e3e3;padding:0 20px}.order-map-modal__search-results--item[_ngcontent-%COMP%]   .padding[_ngcontent-%COMP%]{padding:12px 0;width:100%;display:block}@media only screen and (max-width: 40em){.order-map-modal__search-results--item[_ngcontent-%COMP%]   .padding[_ngcontent-%COMP%]{padding:7px 0}}.order-map-modal__search-results--item[_ngcontent-%COMP%]   .padding[_ngcontent-%COMP%]:hover{color:#96c21f;cursor:pointer}.order-map-modal__search-results--item[_ngcontent-%COMP%]   .item-active[_ngcontent-%COMP%]{color:#96c21f}.order-map-modal__loader[_ngcontent-%COMP%]{width:100%;text-align:center;margin-top:3rem}.order-map-modal__no-results[_ngcontent-%COMP%]{width:100%;text-align:center;margin-top:3rem;color:#f72323}.order-map-modal__map[_ngcontent-%COMP%]{padding:15px}@media only screen and (max-width: 60em){.order-map-modal__map[_ngcontent-%COMP%]{height:100%;padding-right:0;padding-top:10px}}.order-map-modal__map--content[_ngcontent-%COMP%]{width:100%;height:100%}.order-map-modal__map--content[_ngcontent-%COMP%]:focus{outline:#96c21f solid 1px}"],data:{animation:[(0,ke.hZ)("enterOpacity",[(0,ke.kY)(":enter",[(0,ke.iF)({opacity:0}),(0,ke.i0)(250,(0,ke.iF)({opacity:"*"}))])])]}})}}return i})();var Mc=s(48211);let No=(()=>{class i{constructor(t,n,r){this.store=t,this.changeDetector=n,this.platformId=r,this.foundTemplates=(0,e.CGW)(),this.unsubscribeObservable=new re.B}ngOnInit(){(0,q.z)([this.store.select(ue.rh),this.store.select(ue.sc),this.store.select(ue.ro)]).pipe((0,U.p)(([t])=>!!t&&"INIT"===t.loading),(0,U.p)(([,t])=>!!t),(0,U.p)(([,,t])=>!!t),(0,j.F)(E())).subscribe(([,,t])=>{(0,l.UE)(this.platformId)&&this.store.dispatch(me.U.createGetProductsAction(t))}),(0,q.z)([this.store.select(ue.rh),this.store.select(ue.sc)]).pipe((0,U.p)(([t])=>!!t&&"LOADED"===t.loading),(0,U.p)(([t])=>!!t.results&&t.results.length>0),(0,U.p)(([,t])=>!!t),(0,j.F)(E())).subscribe(([t,n])=>{const r=t.results.find(u=>u.id===n.productId);if(!r)return this.productNotFoundAlert.open(),void this.changeDetector.detectChanges();n.senderAddress&&(n.senderAddress.mail&&(n.senderAddress.email=n.senderAddress.mail,delete n.senderAddress.mail),this.store.dispatch(F.M.createUpdateSenderAddressAction(n.senderAddress))),n.receiverAddress?(n.receiverAddress.mail&&(n.receiverAddress.email=n.receiverAddress.mail,delete n.receiverAddress.mail),this.store.dispatch(F.M.createUpdateReceiverAddressAction(n.receiverAddress))):this.store.dispatch(F.M.createUpdateReceiverAddressAction(null));const o={...r,deliveryTimeType:r?.deliveryTimeType??"STANDARD",customRequiredFields:ft.P.getEmptyCustomRequiredFields()};this.store.dispatch(me.U.createSetProductAction(o))})}
1ngOnDestroy(){this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(v.il),e.rXU(e.gRc),e.rXU(e.Agw))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-template-applier"]],viewQuery:function(n,r){if(1&n&&e.GBs(Ln.z,7),2&n){let o;e.mGM(o=e.lsd())&&(r.productNotFoundAlert=o.first)}},outputs:{foundTemplates:"foundTemplates"},standalone:!0,features:[e.aNF],decls:15,vars:9,consts:[["alert",""],[1,"modal-title","h1"],[1,"align-center"],[1,"btn","btn--primary",3,"click"]],template:function(n,r){if(1&n){const o=e.RV6();e.j41(0,"ardn-modal",null,0)(2,"ardn-modal-header")(3,"h4",1),e.EFF(4),e.nI1(5,"translate"),e.k0s()(),e.j41(6,"ardn-modal-body")(7,"p"),e.EFF(8),e.nI1(9,"translate"),e.k0s()(),e.j41(10,"ardn-modal-footer")(11,"div",2)(12,"button",3),e.bIt("click",function(){e.eBV(o);const g=e.sdS(1);return e.Njj(g.close())}),e.EFF(13),e.nI1(14,"translate"),e.k0s()()()()}2&n&&(e.R7$(4),e.JRh(e.bMT(5,3,"ORDER.TEMPLATE.PRODUCT_FROM_TEMPLATE_NOT_FOUND_HEADER")),e.R7$(4),e.SpI(" ",e.bMT(9,5,"ORDER.TEMPLATE.PRODUCT_FROM_TEMPLATE_NOT_FOUND_CONTENT")," "),e.R7$(5),e.JRh(e.bMT(14,7,"COMMON.OK")))},dependencies:[Ln.z,Hi.e,Mc.s,f.h,f.D9,Fo.J],encapsulation:2,changeDetection:0})}}return i})();const Fc=["*"],$c=i=>({accordion__heading:i});let Nc=(()=>{class i{constructor(){this.step=(0,e.hFB)(),this.steps=(0,e.hFB)(),this.isToggleable=(0,e.hFB)(!0)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-step-header"]],inputs:{step:[1,"step"],steps:[1,"steps"],isToggleable:[1,"isToggleable"]},standalone:!0,features:[e.aNF],ngContentSelectors:Fc,decls:6,vars:6,consts:[[1,"order-step__header",3,"ngClass","tabindex"],[1,"order-step__number-wrap"],[1,"order-step__number"],[1,"order-step__title","h2"]],template:function(n,r){1&n&&(e.NAR(),e.j41(0,"div",0)(1,"div",1)(2,"span",2),e.EFF(3),e.k0s()(),e.j41(4,"h2",3),e.SdG(5),e.k0s()()),2&n&&(e.Y8G("ngClass",e.eq3(4,$c,r.isToggleable()))("tabindex",r.step()),e.R7$(3),e.Lme("",r.step(),"/",r.steps(),""))},dependencies:[l.YU],encapsulation:2})}}return i})();var kc=s(21493),Vc=s(97647),ko=s(34117),xc=s(69507),Vo=s(98245),zi=s(69554),Uc=s(16583),Gc=s(77411),xo=s(46402);function Lc(i,p){1&i&&(e.j41(0,"div",4),e.nrm(1,"div",12),e.k0s())}function jc(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",8)(1,"ardn-payment-option-info",13),e.bIt("clickInfoLink",function(r){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onClickInfoLink(r))}),e.k0s()()}if(2&i){const t=e.XpG().$implicit;e.R7$(),e.Y8G("paymentOption",t)("ardnDataTestId","ardn-payment-option-info"+(null==t?null:t.id))}}function wc(i,p){if(1&i&&e.DNE(0,jc,2,2,"div",8),2&i){const t=p.$implicit,n=e.XpG();e.vxM(t.id===n.selectedOptionId&&t.info?0:-1)}}function Bc(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",14),e.bIt("click",function(){const r=e.eBV(t).$implicit,o=e.XpG();return e.Njj(o.setSelectedPayment(r))}),e.j41(1,"ardn-payment-option",15),e.bIt("reloadPayments",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.onReloadPayments())}),e.k0s()()}if(2&i){const t=p.$implicit,n=e.XpG();e.R7$(),e.Y8G("paymentOption",t)("selected",t.id===n.selectedOptionId)("disabled",n.isPaymentDisabled(t))("methodIcon",n.getOnlineMethodImagePath())("paymentOnlineMethods",n.onlinePaymentMethods)("ardnDataTestId","ardn-payment-option"+(null==t?null:t.id))}}let Uo=(()=>{class i{constructor(){this.paymentOptionsObservable=(0,e.hFB)(),this.paymentSelected=(0,e.CGW)(),this.clickOptionInfoLink=(0,e.CGW)(),this.showNotification=!0,this.paymentOptions=[{nameTranslationKey:"COMMON.INSTANT",value:"INSTANT"},{nameTranslationKey:"COMMON.DEFERRED",value:"DEFERRED"}],this.paymentTypeSelectedFilter="INSTANT",this.isReloading=(0,e.vPA)(!1),this.onlinePaymentMethods=[],this.isFreightForward=!1,this.pOptions=null,this.sOption=null,this.onlyOnce=!0,this.selectedOnlineMethod=null,this.isUserLoggedIn=!1,this.destroyRef=(0,e.WQX)(e.abz),this.config=(0,e.WQX)(Ae.vQ),this.store=(0,e.WQX)(v.il),this.changeDetector=(0,e.WQX)(e.gRc),this.userPayments=(0,e.WQX)(xc.Y),this.onlinePaymentMethodsService=(0,e.WQX)(Vo.B),this.orderPaymentsService=(0,e.WQX)(zi.h),this.userStats=(0,e.WQX)(xo.c)}handleOnOffSwitchCompletion(){this.memorizedPayment&&setTimeout(()=>{this.setMemorizedPaymentMethod(this.memorizedPayment)},50)}ngAfterContentChecked(){this.changeDetector.detectChanges()}ngOnInit(){this.store.select(J.Ep).pipe((0,M.s)(1)).subscribe(t=>this.isUserLoggedIn=t),this.store.select(T.eI).pipe((0,M.s)(1)).subscribe(t=>this.memorizedPayment=t),(0,q.z)([this.store.select(T.X$),this.paymentOptionsObservable(),this.store.select(T.Z).pipe((0,U.p)(t=>null===t))]).pipe((0,j.F)(E()),(0,z.pQ)(this.destroyRef)).subscribe(([t,n,r])=>
1{if(this.isFreightForward=t,this.sOption=r,this.pOptions===n&&this.sOption===r)return;let o=null;this.onlyOnce&&(o=n.find(u=>u.isDefault&&u.enabled),o&&o.id===Me.O.ONLINE&&!this.memorizedPayment&&this.isUserLoggedIn&&this.getUserDefaultPaymentType(),o&&!this.memorizedPayment&&this.setNotificationVisibility(),this.onlyOnce=!1),t&&n&&n.length&&(o=n.find(u=>u.id===Me.O.CASH)),r&&(o=r),o&&o.id!==Me.O.ONLINE&&(this.selectedOptionId=o.id),o&&(this.paymentTypeSelectedFilter=o.paymentType,this.store.dispatch(F.M.createSetSelectedPaymentOptionAction(o)))}),this.store.select(T.Zu).pipe((0,j.F)(E()),(0,z.pQ)(this.destroyRef)).subscribe(t=>{this.selectedOnlineMethod=t?.selectedOnlineMethod?t?.selectedOnlineMethod:null,this.store.dispatch(F.M.createSetPaymentTempAction())}),this.onlinePaymentMethodsService.getOnlinePaymentMethods().subscribe(t=>{this.onlinePaymentMethods=t})}getUserDefaultPaymentType(){this.userPayments.getDefaultUserPaymentMethod().pipe((0,z.pQ)(this.destroyRef)).subscribe({next:t=>{this.getDefaultOnlinePaymentMethod(Number(t?.onlinePaymentId)),this.selectedOptionId=Me.O.ONLINE,this.setNotificationVisibility()},error:()=>{this.selectedOptionId=null,this.setNotificationVisibility()}})}setMemorizedPaymentMethod(t){t?.selectedOption?.id!==this.selectedOptionId?(this.setOnOffSwitchWithMemorizedValue(),this.selectedOptionId=t?.selectedOption?.id,this.selectedOnlineMethod=t?.selectedOnlineMethod,this.store.dispatch(F.M.createSetSelectedPaymentOptionAction(t?.selectedOption)),this.store.dispatch(F.M.createSetOrderOnlinePaymentMethodAction(t?.selectedOnlineMethod)),this.showNotification=!1):this.showNotification=!1}setOnOffSwitchWithMemorizedValue(){this.onOffSwitch.writeValue(this.memorizedPayment?.selectedOption?.paymentType),this.onOffSwitch.registerOnTouched()}getDefaultOnlinePaymentMethod(t){this.onlinePaymentMethodsService.getOnlinePaymentMethods().subscribe(n=>{const r=n.find(o=>o.id===t);r&&this.store.dispatch(F.M.createSetOrderOnlinePaymentMethodAction(r))})}setSelectedPayment(t){if(this.isPaymentDisabled(t))return void this.paymentEventEmit(null);this.selectedOptionId=t.id,this.store.dispatch(F.M.createSetSelectedPaymentOptionAction(t)),this.store.dispatch(F.M.createSetOrderOnlinePaymentMethodAction(null));let n=[];t&&t.custom&&(n=this.onlinePaymentMethods.filter(r=>t?.filterValue?t.filterField?r[t.filterField]===t?.filterValue:[]:t.filterField?r[t.filterField]:[])),1===n.length&&this.store.dispatch(F.M.createSetOrderOnlinePaymentMethodAction(n[0])),this.paymentEventEmit({paymentId:t.id,paymentCustom:{isCustom:t.custom,isMultiple:n.length>1}})}paymentEventEmit(t){setTimeout(()=>{this.paymentSelected.emit(t),this.setNotificationVisibility()})}setNotificationVisibility(){this.store.select(T.Zu).subscribe(n=>{if("DEFERRED"===n?.selectedOption?.paymentType)return n?.selectedOption?.custom&&n?.selectedOption?.id===Me.O.DEFERRED_ONLINE_PAYMENT&&!n?.selectedOnlineMethod?void(this.showNotification=!0):void(this.showNotification=!1);this.showNotification=!(n?.selectedOption&&n?.selectedOption?.id!==Me.O.ONLINE||n?.selectedOption&&n?.selectedOnlineMethod)})}isPaymentDisabled(t){return!t.enabled||this.isFreightForward!==(t.id===Me.O.CASH)}setPaymentFilter(){this.isFreightForward||(this.store.dispatch(F.M.createResetSelectedPaymentOptionAction()),this.store.dispatch(F.M.createResetSelectedPaymentMethodOptionAction()),this.paymentEventEmit(null)),this.changeDetector.markForCheck()}getFilteredPaymentOptionsObservable(){const t=n=>n.paymentType===this.paymentTypeSelectedFilter;return this.paymentOptionsObservable().pipe((0,X.T)(n=>n?n.filter(t):null))}getOnlineMethodImagePath(){return this.selectedOnlineMethod?this.config.onlinePaymentMethods.find(t=>t.paymentId===this.selectedOnlineMethod?.id)?.paymentImg:null}onClickInfoLink(t){this.clickOptionInfoLink.emit(t)}onReloadPayments(){this.isReloading.set(!0),this.orderPaymentsService.clearCache(),this.store.select(T.Ll).pipe((0,M.s)(1)).subscribe(t=>{t?(this.store.dispatch(F.M.createGetOrderPaymentsAction(t)),this.paymentOptionsObservable().pipe((0,pn.i)(1),(0,M.s)(1)).subscribe(()=>{this.isReloading.set(!1)})):this.isReloading.set(!1)})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-payment-list"]],viewQuery:function(n,r){if(1&n&&e.GBs(ko.o,5),2&n){let o;e.mGM(o=e.lsd())&&(r.onOffSwitch=o.first)}},inputs:{paymentOptionsObservable:[1,"paymentOptionsObservable"]},outputs:{paymentSelected:"paymentSelected",clickOptionInfoLink:"clickOptionInfoLink"},standalone:!0,features:[e.Jv_([Vo.B]),e.aNF],decls:21,vars:16,consts:[[1,"h3-order"],[1,"icon","icon-payments"],["href","assets/img/sprites.svg#icon-payments"],[1,"order-payments"],[1,"order-payments__loader-overlay"],[1,"order-payments-filter"],[3,"ngModelChange","change","offOnSwitchCompleted","ngModel","firstOption","secondOption","ardnDataTestId"],[1,"order-payments-info"],[1,"row"],[1,"col"],[1,"form-error",3,"hidden"],[1,"error"],[1,"loader","loader--green","loader--big"],[3,"clickInfoLink","paymentOption","ardnDataTestId"],[1,"col",3,"click"],[3,"reloadPayments","paymentOption","selected","disabled","methodIcon","paymentOnlineMethods","ardnDataTestId"]],template:function(n,r){1&n&&(e.j41(0,"h3",0),e.qSk(),e.j41(1,"svg",1),e.nrm(2,"use",2),e.k0s(),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.joV(),e.j41(5,"div",3),e.DNE(6,Lc,2,0,"div",4),e.j41(7,"div",5)(8,"ardn-on-off-switch",6),e.mxI("ngModelChange",function(u){return e.DH7(r.paymentTypeSelectedFilter,u)||(r.paymentTypeSelectedFilter=u),u}),e.bIt("change",function(){return r.setPaymentFilter()})("offOnSwitchCompleted",function(){return r.handleOnOffSwitchCompletion()}),e.k0s()(),e.j41(9,"div",7),e.Z7z(10,wc,1,1,null,null,e.fX1),e.nI1(12,"async"),e.k0s(),e.j41(13,"div",8),e.Z7z(14,Bc,2,6,"div",9,e.fX1),e.nI1(16,"async"),e.k0s(),e.j41(17,"div",10)(18,"div",11),e.EFF(19),e.nI1(20,"translate"),e.k0s()()()),2&n&&(e.R7$(3),e.SpI(" ",e.bMT(4,8,"ORDER_PAGE.CHOOSE_PAYMENT_TYPE"),"\n"),e.R7$(3),e.vxM(r.isReloading()?6:-1),e.R7$(2),e.R50("ngModel",r.paymentTypeSelectedFilter),e.Y8G("firstOption",r.paymentOptions[0])("secondOption",r.paymentOptions[1])("ardnDataTestId","ardn-on-off-switch"),e.R7$(2),e.Dyx(e.bMT(12,10,r.getFilteredPaymentOptionsObservable())),e.R7$(4),e.Dyx(e.bMT(16,12,r.getFilteredPaymentOptionsObservable())),e.R7$(3),e.Y8G("hidden",!r.showNotification),e.R7$(2),e.SpI(" ",e.bMT(20,14,"ORDER_PAGE.PLEASE_CHOOSE_PAYMENT_TYPE")," "))},dependencies:[f.h,f.D9,ko.o,Uc.Z,Gc.T,Z.Z,l.Jj,m.YN,m.BC,m.vS],styles:[".h3-order[_ngcontent-%COMP%]{max-width:300px;margin-top:0}.order-payments[_ngcontent-%COMP%]{margin-bottom:20px;position:relative}.order-payments-filter[_ngcontent-%COMP%]{text-align:center;margin-bottom:10px}.order-payments-info[_ngcontent-%COMP%]{margin-bottom:35px}.order-payments-info[_ngcontent-%COMP%]     .col{padding-top:5px}.order-payments__loader-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;background-color:#fffc;display:flex;align-items:center;justify-content:center;z-index:10}.form-error[_ngcontent-%COMP%]{margin:unset;margin-top:5px}.form-error[_ngcontent-%COMP%]   .error[_ngcontent-%COMP%]{border:1px solid #f72323;padding:5px;border-radius:5px;font-size:16px}"]})}}return i})();var Go=s(90502);function Xc(i,p){1&i&&(e.j41(0,"div",0),e.nrm(1,"div",2),e.k0s())}function Yc(i,p){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"ardn-payment-list",3),e.bIt("paymentSelected",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.paymentSelected(r))})("clickOptionInfoLink",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.clickOptionInfoLink(r))}),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(),e.Y8G("paymentOptionsObservable",t.paymentOptionsObservable)("ardnDataTestId","ardn-payment-list")}}function Wc(i,p){if(1&i&&e.nrm(0,"ardn-order-payment-modal",1),2&i){const t=e.XpG();e.Y8G("paymentTypeId",t.paymentTypeId)("selectedOption",t.selectedOption)("ardnDataTestId","ardn-order-payment-modal")}}let Lo=(()=>{class i{constructor(t,n,r,o,u,g,A){this.platformId=t,this.config=n,this.store=r,this.modalManagerService=o,this.translateService=u,this.eCommerceConverterService=g,this.googleAnalyticsService=A,this.isLoading=!0,this.subscriptionCollection=new kc.g,this.unsubscribeOb
1servable=new re.B,this.validityChangedEvent=new e.bkB,this.validityChanged=(0,z.p)(this.validityChangedEvent.pipe((0,j.F)((N,w)=>N===w)))}ngOnInit(){this.isPlatformBrowser=(0,l.UE)(this.platformId),this.paymentTypeId=null,this.selectedOption=null,this.store.select(T.oH).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(n=>{if(n){const r=[];this.config.orderExtraPaymentOptions.map(o=>{r.push({id:o.id,iconName:"icon-online-payment",paymentType:o.paymentType,tooltipKey:"ONLINE",label:"ONLINE",name:this.translateService.instant(`PAYMENT.CUSTOM.${o.name}`),subname:o.subname,enabled:!0,isDefault:!1,filterField:o?.filterField,filterValue:o?.filterValue,paymentImg:o?.paymentImg,custom:!0,originPaymentId:o.originPaymentId})}),this.store.dispatch(F.M.createAddCustomOrderPaymentsAction(r))}});const t=this.store.select(T.Zu);this.subscriptionCollection.add(t.subscribe(n=>{this.validityChangedEvent.emit(!!(n?.selectedOption?.id!==Me.O.ONLINE||"DEFERRED"===n?.selectedOption?.paymentType||n?.selectedOption&&n?.selectedOnlineMethod))})),this.paymentOptionsObservable=this.store.select(T.xI),this.paymentOptionsObservable.pipe((0,Vc.u)(),(0,U.p)(n=>!!n),(0,B.Q)(this.unsubscribeObservable)).subscribe(()=>{this.isLoading=!1}),this.store.select(T.Z).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(n=>{this.paymentTypeId=n?.id,this.selectedOption=n}),this.store.select(T.C4).pipe((0,M.s)(1),(0,B.Q)(this.unsubscribeObservable)).subscribe(n=>{if(_e.c.production){const r=this.eCommerceConverterService.convertProductToECommerceProduct(n);this.googleAnalyticsService.sendBeginCheckoutEvent(r),this.googleAnalyticsService.pushECommerceCheckout(n)}})}ngOnDestroy(){this.subscriptionCollection.unsubscribeAll(),this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}paymentSelected(t){(this.isOnlinePayment(t?.paymentId)||this.isCustomPayment(t?.paymentCustom.isCustom)&&t?.paymentCustom.isMultiple)&&this.openModal()}clickOptionInfoLink(t){this.isOnlinePayment(t?.paymentId)&&(this.store.dispatch(F.M.createSetOrderOnlinePaymentMethodAction(null)),this.openModal()),(this.isBankTransferPayment(t?.paymentId)||this.isCustomPayment(t?.paymentCustom.isCustom)&&t?.paymentCustom.isMultiple)&&this.openModal()}isOnlinePayment(t){return t===Me.O.ONLINE}isCustomPayment(t){return!0===t}isBankTransferPayment(t){return t===Me.O.BANK_TRANSFER}openModal(){setTimeout(()=>{this.modalManagerService.open("modal-order-payment")})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(e.Agw),e.rXU(Ae.vQ),e.rXU(v.il),e.rXU(Ni.q),e.rXU(f.c$),e.rXU(Xi.C),e.rXU(Yi.p))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-payment-step"]],outputs:{validityChanged:"validityChanged"},standalone:!0,features:[e.aNF],decls:3,vars:2,consts:[[1,"align-center"],["modalId","modal-order-payment",3,"paymentTypeId","selectedOption","ardnDataTestId"],[1,"loader","loader--big","loader--gray"],[3,"paymentSelected","clickOptionInfoLink","paymentOptionsObservable","ardnDataTestId"]],template:function(n,r){1&n&&e.DNE(0,Xc,2,0,"div",0)(1,Yc,2,2,"div")(2,Wc,1,3,"ardn-order-payment-modal",1),2&n&&(e.vxM(r.isLoading?0:1),e.R7$(2),e.vxM(r.isPlatformBrowser?2:-1))},dependencies:[Uo,Z.Z,Go.L],encapsulation:2})}}return i})();var Hc=s(39127);function zc(i,p){1&i&&(e.j41(0,"span",11),e.EFF(1),e.k0s()),2&i&&(e.R7$(),e.JRh("*"))}function Kc(i,p){if(1&i&&e.nrm(0,"ardn-field-validator",13),2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.Y8G("clientSideValidation",null==n.agreementsForm?null:n.agreementsForm.get(null==t?null:t.code))("serverSideValidation",null==n.validationErrors?null:n.validationErrors.fields["agreements["+(null==t?null:t.code)+"]"])("clientErrorMessage","COMMON.ERRORS.REQUIRED")}
1}function Qc(i,p){if(1&i&&(e.j41(0,"div",6)(1,"div",7)(2,"div",8)(3,"label"),e.nrm(4,"input",9),e.j41(5,"span",10),e.DNE(6,zc,2,1,"span",11),e.nrm(7,"span",12),e.k0s()(),e.DNE(8,Kc,1,3,"ardn-field-validator",13),e.k0s()()()),2&i){const t=p.$implicit;e.R7$(4),e.Y8G("id",null==t?null:t.code)("formControlName",null==t?null:t.code),e.BMQ("data-code",null==t?null:t.code),e.R7$(2),e.vxM(null!=t&&t.onlyTrue?6:-1),e.R7$(),e.Y8G("innerHTML",null==t?null:t.content,e.npT),e.R7$(),e.vxM(null!=t&&t.onlyTrue?8:-1)}}function Jc(i,p){if(1&i&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h2",4),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"form",5),e.Z7z(8,Qc,9,6,"div",6,e.Vm6),e.k0s()()()()()),2&i){const t=e.XpG();e.R7$(5),e.SpI(" ",e.bMT(6,2,"ORDER.AGREEMENTS")," "),e.R7$(2),e.Y8G("formGroup",t.agreementsForm),e.R7$(),e.Dyx(t.getAgreementsControls())}}let jo=(()=>{class i{constructor(t,n,r,o){this.platformId=t,this.formBuilder=n,this.agreementsService=r,this.store=o,this.serverAgreements=[],this.validationErrors=null,this.validityChangedEvent=new e.bkB,this.unsubscribeObservable=new re.B,this.userProfile=null,this.validityChanged=(0,z.p)(this.validityChangedEvent.pipe((0,j.F)((u,g)=>u===g)))}ngOnInit(){(0,l.Vy)(this.platformId)||(this.store.select(J.tB).pipe((0,U.p)(t=>!!t),(0,M.s)(1)).subscribe(t=>{this.userProfile=t}),this.agreementsForm=this.formBuilder.group({agreements:this.formBuilder.group({})}),this.agreementsService.getAgreements("order",!0).pipe((0,X.T)(t=>t?.results)).subscribe(t=>{this.serverAgreements=t,t?.length&&(this.agreementsService.extendAgreementsFormGroup(this.agreementsForm.get("agreements"),t),this.userProfile?.defaultAgreements?.order&&this.agreementsForm.get("agreements").patchValue(this.userProfile?.defaultAgreements?.order))}),this.agreementsForm?.valueChanges.pipe((0,ce.B)(100)).subscribe(()=>{this.store.dispatch(F.M.createUpdateOrderAgreementsAction(this.agreementsForm.value?.agreements)),this.validation()}))}ngOnDestroy(){this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}getAgreementsControls(){const t=this.agreementsForm.get("agreements");return Object.keys(t.controls).map(n=>({code:n,control:t.get(n),...this.serverAgreements?.find(r=>r?.code===n)||null}))}validation(){this.validityChangedEvent.emit(this.agreementsForm?.valid)}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(e.Agw),e.rXU(m.ok),e.rXU(Hc.L),e.rXU(v.il))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-agreements-step"]],outputs:{validityChanged:"validityChanged"},standalone:!0,features:[e.aNF],decls:1,vars:1,consts:[[1,"order-summary","order-agreements"],[1,"order-summary__body"],[1,"row"],[1,"col","col-12"],[1,"h2","mt-8"],[3,"formGroup"],["formGroupName","agreements",1,"field","form__agreements"],[1,"form__container-agreements"],[1,"checkbox"],["type","checkbox",3,"id","formControlName"],[1,"d-flex"],[1,"mr-1"],[1,"agreements",3,"innerHTML"],[1,"agreement-validation",3,"clientSideValidation","serverSideValidation","clientErrorMessage"]],template:function(n,r){if(1&n&&e.DNE(0,Jc,10,4,"div",0),2&n){let o;e.vxM(null!=(o=r.getAgreementsControls())&&o.length?0:-1)}},dependencies:[m.X1,m.qT,m.Zm,m.BC,m.cb,m.j4,m.JD,m.$R,ye.Q,f.h,f.D9],encapsulation:2})}}return i})();var Zc=s(22937);const qc=i=>({"return-shipment-address":i});function eu(i,p){if(1&i&&(e.j41(0,"dt"),e.EFF(1),e.k0s()),2&i){let t;const n=e.XpG();e.R7$(),e.JRh(null==(t=n.userAddress())?null:t.companyName)}}function tu(i,p){if(1&i&&(e.j41(0,"span")(1,"dt"),e.EFF(2),e.nI1(3,"ardnAddressFirstLine"),e.nrm(4,"br"),e.EFF(5),e.nrm(6,"br"),e.EFF(7),e.nI1(8,"async"),e.k0s(),e.nrm(9,"dt",8),e.j41(10,"dt"),e.EFF(11),e.k0s(),e.j41(12,"dt"),e.EFF(13),e.nI1(14,"ardnPhone"),e.k0s()()),2&i){let t,n,r,o;const u=e.XpG();e.R7$(2),e.JRh(e.bMT(3,6,u.senderAddress())),e.R7$(3),e.Lme("",null==(t=u.senderAddress())?null:t.postCode," ",null==(t=u.senderAddress())?null:t.city,""),e.R7$(2),e.JRh(e.bMT(8,8,u.getCountryName(null==(n=u.senderAddress())?null:n.countryId))),e.R7$(4),e.JRh(null==(r=u.senderAddress())?null:r.email),e.R7$(2),e.JRh(e.bMT(14,10,null==(o=u.senderAddress())?null:o.phone))}}function nu(i,p){1&i&&(e.j41(0,"div",12),e.qSk(),e.j41(1,"svg",16),e.nrm(2,"use",17),e.k0s(),e.EFF(3),e.nI1(4,"translate"),e.k0s()),2&i&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"ORDER_PAGE.SUMMARY_STEP.SENDER_IS_CUSTOMER")," "))}function ru(i,p){if(1&i&&(e.j41(0,"span")(1,"dt"),e.EFF(2),e.nI1(3,"ardnAddressFirstLine"),e.nrm(4,"br"),e.EFF(5),e.nrm(6,"br"),e.EFF(7),e.nI1(8,"async"),e.k0s(),e.nrm(9,"dt",8),e.j41(10,"dt"),e.EFF(11),e.k0s(),e.j41(12,"dt"),e.EFF(13),e.nI1(14,"ardnPhone"),e.k0s()()),2&i){let t,n,r,o;const u=e.XpG();e.R7$(2),e.JRh(e.bMT(3,6,u.receiverAddress())),e.R7$(3),e.Lme("",null==(t=u.receiverAddress())?null:t.postCode," ",null==(t=u.receiverAddress())?null:t.city,""),e.R7$(2),e.JRh(e.bMT(8,8,u.getCountryName(null==(n=u.receiverAddress())?null:n.countryId))),e.R7$(4),e.JRh(null==(r=u.receiverAddress())?null:r.email),e.R7$(2),e.JRh(e.bMT(14,10,null==(o=u.receiverAddress())?null:o.phone))}}function iu(i,p){if(1&i&&(e.j41(0,"dt"),e.EFF(1),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.JRh(t.receiverAddress().nip)}}function ou(i,p){1&i&&(e.j41(0,"div",12),e.qSk(),e.j41(1,"svg",16),e.nrm(2,"use",17),e.k0s(),e.EFF(3),e.nI1(4,"translate"),e.k0s()),2&i&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"ORDER_PAGE.SUMMARY_STEP.RECEIVER_IS_CUSTOMER")," "))}function su(i,p){if(1&i&&e.EFF(0),2&i){const t=e.XpG(2);e.SpI(" / ",null==t.returnShipmentAddress?null:t.returnShipmentAddress.ap
1artmentNumber," ")}}function au(i,p){1&i&&(e.j41(0,"div",12),e.qSk(),e.j41(1,"svg",16),e.nrm(2,"use",17),e.k0s(),e.EFF(3),e.nI1(4,"translate"),e.k0s()),2&i&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"ORDER_PAGE.SUMMARY_STEP.RECEIVER_IS_CUSTOMER")," "))}function du(i,p){if(1&i&&(e.j41(0,"div",1)(1,"div",2)(2,"h3",3),e.qSk(),e.j41(3,"svg",13),e.nrm(4,"use",14),e.k0s(),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.joV(),e.j41(7,"div",18)(8,"dl",7)(9,"dt"),e.EFF(10),e.k0s(),e.j41(11,"dt"),e.EFF(12),e.DNE(13,su,1,1),e.nrm(14,"br"),e.EFF(15),e.nrm(16,"br"),e.EFF(17),e.nI1(18,"async"),e.k0s(),e.nrm(19,"dt",8),e.j41(20,"dt"),e.EFF(21),e.k0s(),e.j41(22,"dt"),e.EFF(23),e.nI1(24,"ardnPhone"),e.k0s()(),e.DNE(25,au,5,3,"div",12),e.k0s()()()),2&i){const t=e.XpG();e.R7$(5),e.SpI(" ",e.bMT(6,11,"COMMON.ADDRESS.RETURN_SHIPMENT_ADDRESS")," "),e.R7$(5),e.JRh(null==t.returnShipmentAddress?null:t.returnShipmentAddress.name),e.R7$(2),e.Lme("",null==t.returnShipmentAddress?null:t.returnShipmentAddress.street," ",null==t.returnShipmentAddress?null:t.returnShipmentAddress.houseNumber," "),e.R7$(),e.vxM(null!=t.returnShipmentAddress&&t.returnShipmentAddress.apartmentNumber?13:-1),e.R7$(2),e.Lme("",null==t.returnShipmentAddress?null:t.returnShipmentAddress.postCode," ",null==t.returnShipmentAddress?null:t.returnShipmentAddress.city,""),e.R7$(2),e.JRh(e.bMT(18,13,t.getCountryName(null==t.returnShipmentAddress?null:t.returnShipmentAddress.countryId))),e.R7$(4),e.JRh(null==t.returnShipmentAddress?null:t.returnShipmentAddress.email),e.R7$(2),e.JRh(e.bMT(24,15,null==t.returnShipmentAddress?null:t.returnShipmentAddress.phone)),e.R7$(2),e.vxM(t.isEqualToUserAddress(t.receiverAddress())?25:-1)}}let wo=(()=>{class i{constructor(t,n){this.countryService=t,this.store=n,this.userAddress=(0,e.hFB)(),this.senderAddress=(0,e.hFB)(),this.receiverAddress=(0,e.hFB)()}ngOnInit(){this.setAddonReturnShipmentAddress()}isEqualToUserAddress(t){if(!this.userAddress()||!t)return!1;const n={...this.userAddress(),name:this.userAddress().name+" "+this.userAddress().surname},r=["name","street","houseNumber","apartmentNumber","city","postCode","phone","email"];return E()(Y()(n,r),Y()(t,r))}shouldDisplayAddressDetails(t){return!this.isEqualToUserAddress(t)}getCountryName(t){return this.countryService.getCountriesCached().pipe((0,X.T)(n=>{const r=n.find(o=>o.id===t);return r?r.name:null}))}setAddonReturnShipmentAddress(){(0,q.z)([this.store.select(T.Np),this.store.select(T.k$)]).subscribe(([t,n])=>{this.returnShipmentAddress=n?.find(r=>"RETURN_SHIPMENT_ADDRESS"===r.category)?t:null})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(be.o),e.rXU(v.il))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-addresses-summary"]],inputs:{userAddress:[1,"userAddress"],senderAddress:[1,"senderAddress"],receiverAddress:[1,"receiverAddress"]},standalone:!0,features:[e.aNF],decls:58,vars:35,consts:[[1,"summary-box-grid","row",3,"ngClass"],[1,"col"],[1,"summary-box"],[1,"summary-box__top"],[1,"icon","icon-sender"],["href","assets/img/sprites.svg#icon-principal"],["data-qa","user address",1,"summary-box__body"],[1,"summary-box__dl"],[1,"separator__small"],[1,"icon","icon-recipient"],["href","assets/img/sprites.svg#icon-sender"],["data-qa","sender address",1,"summary-box__body"],[1,"alert-icon"],[1,"icon","icon-principal"],["href","assets/img/sprites.svg#icon-recipient"],["data-qa","receiver address",1,"summary-box__body"],[1,"icon","icon-info"],["href","assets/img/sprites.svg#icon-info"],["data-qa","return shipment address",1,"summary-box__body"]],template:function(n,r){if(1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),e.qSk(),e.j41(4,"svg",4),e.nrm(5,"use",5),e.k0s(),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.joV(),e.j41(8,"div",6)(9,"dl",7),e.DNE(10,eu,2,1,"dt"),e.j41(11,"dt"),e.EFF(12),e.k0s(),e.j41(13,"dt"),e.EFF(14),e.nI1(15,"ardnAddressFirstLine"),e.nrm(16,"br"),e.EFF(17),e.nrm(18,"br"),e.EFF(19),e.nI1(20,"async"),e.k0s(),e.nrm(21,"dt",8),e.j41(22,"dt"),e.EFF(23),e.k0s(),e.j41(24,"dt"),e.EFF(25),e.k0s()()()()(),e.j41(26,"div",1)(27,"div",2)(28,"h3",3),e.qSk(),e.j41(29,"svg",9),e.nrm(30,"use",10),e.k0s(),e.EFF(31),e.nI1(32,"translate"),e.k0s(),e.joV(),e.j41(33,"div",11)(34,"dl",7)(35,"dt"),e.EFF(36),e.k0s(),e.DNE(37,tu,15,12,"span"),e.j41(38,"dt"),e.EFF(39),e.k0s()(),e.DNE(40,nu,5,3,"div",12),e.k0s()()(),e.j41(41,"div",1)(42,"div",2)(43,"h3",3),e.qSk(),e.j41(44,"svg",13),e.nrm(45,"use",14),e.k0s(),e.EFF(46),e.nI1(47,"translate"),e.k0s(),e.joV(),e.j41(48,"div",15)(49,"dl",7)(50,"dt"),e.EFF(51),e.k0s(),e.DNE(52,ru,15,12,"span"),e.j41(53,"dt"),e.EFF(54),e.k0s(),e.DNE(55,iu,2,1,"dt"),e.k0s(),e.DNE(56,ou,5,3,"div",12),e.k0s()()(),e.DNE(57,du,26,17,"div",1),e.k0s()),2&n){let o,u,g,A,N,w,te,ne,de,Fe,Le;e.Y8G("ngClass",e.eq3(33,qc,r.returnShipmentAddress)),e.R7$(6),e.SpI(" ",e.bMT(7,23,"ORDER.CUSTOMER")," "),e.R7$(4),e.vxM(null!=(o=r.userAddress())&&o.companyName?10:-1),e.R7$(2),e.Lme("",null==(u=r.userAddress())?null:u.name," ",null==(u=r.userAddress())?null:u.surname,""),e.R7$(2),e.JRh(e.bMT(15,25,r.userAddress())),e.R7$(3),e.Lme(" ",null==(g=r.userAddress())?null:g.postCode," ",null==(g=r.userAddress())?null:g.city,""),e.R7$(2),e.JRh(e.bMT(20,27,r.getCountryName(null==(A=r.userAddress())?null:A.countryId))),e.R7$(4),e.JRh(null==(N=r.userAddress())?null:N.email),e.R7$(2),e.JRh(null==(w=r.userAddress())?null:w.phone),e.R7$(6),e.SpI(" ",e.bMT(32,29,"ORDER.SENDER")," "),e.R7$(5),e.JRh(null==(te=r.senderAddress())?null:te.name),e.R7$(),e.vxM(r.isEqualToUserAddress(r.senderAddress())?-1:37),e.R7$(2),e.JRh(null==(ne=r.senderAddress())?null:ne.contactPerson),e.R7$(),e.vxM(r.isEqualToUserAddress(r.senderAddress())?40:-1),e.R7$(6),e.SpI(" ",e.bMT(47,31,"ORDER.RECEIVER")," "),e.R7$(5),e.JRh(null==(de=r.receiverAddress())?null:de.name),e.R7$(),e.vxM(r.shouldDisplayAddressDetail
1s(r.receiverAddress())?52:-1),e.R7$(2),e.JRh(null==(Fe=r.receiverAddress())?null:Fe.contactPerson),e.R7$(),e.vxM(null!=(Le=r.receiverAddress())&&Le.nip?55:-1),e.R7$(),e.vxM(r.isEqualToUserAddress(r.receiverAddress())?56:-1),e.R7$(),e.vxM(r.returnShipmentAddress?57:-1)}},dependencies:[f.h,f.D9,Dt,Po,l.Jj,l.YU],styles:[".summary-box__dl dt{color:#5b5b5b}  .save-temp-btn-wrapper{padding:8px;margin-left:auto}  .btn.save-temp-btn{display:flex;flex-flow:column;margin:0 10px 0 auto}  .btn.save-temp-btn .icon{margin:6px auto;transform:scale(1.6);font-size:1.6em}.separator__small[_ngcontent-%COMP%]{padding:3px 0}.separator__normal[_ngcontent-%COMP%]{padding:5px 0}.return-shipment-address[_ngcontent-%COMP%]   .col[_ngcontent-%COMP%]{width:50%}@media only screen and (max-width: 75.625em){.return-shipment-address[_ngcontent-%COMP%]   .col[_ngcontent-%COMP%]{width:50%}.return-shipment-address[_ngcontent-%COMP%]   .col[_ngcontent-%COMP%]:last-child{width:50%}}@media only screen and (max-width: 40em){.return-shipment-address[_ngcontent-%COMP%]   .col[_ngcontent-%COMP%]{width:100%}.return-shipment-address[_ngcontent-%COMP%]   .col[_ngcontent-%COMP%]:last-child{width:100%}}"]})}}return i})();var lu=s(61594),cu=s(78147),Yt=s(83197);function uu(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.SpI("(x",t.units(),")")}}function pu(i,p){if(1&i&&(e.j41(0,"li"),e.EFF(1),e.nI1(2,"translate"),e.nrm(3,"br"),e.j41(4,"strong"),e.EFF(5),e.nrm(6,"br"),e.EFF(7),e.k0s()()),2&i){let t,n;const r=e.XpG();e.R7$(),e.SpI("",e.bMT(2,5,"ORDER_PAGE.SUMMARY_STEP.SENDER_POINT"),": "),e.R7$(4),e.E5c("",null==(t=r.shipment())?null:t.senderPoint.id," ",null==(t=r.shipment())?null:t.senderPoint.city," ",null==(t=r.shipment())?null:t.senderPoint.postCode,","),e.R7$(2),e.SpI(" ",null==(n=r.shipment())?null:n.senderPoint.address,"")}}function hu(i,p){if(1&i&&(e.j41(0,"li"),e.EFF(1),e.nI1(2,"translate"),e.nrm(3,"br"),e.j41(4,"strong"),e.EFF(5),e.nrm(6,"br"),e.EFF(7),e.k0s()()),2&i){let t,n;const r=e.XpG();e.R7$(),e.SpI("",e.bMT(2,5,"ORDER_PAGE.SUMMARY_STEP.RECEIVER_POINT"),": "),e.R7$(4),e.E5c("",null==(t=r.shipment())?null:t.receiverPoint.id," ",null==(t=r.shipment())?null:t.receiverPoint.city," ",null==(t=r.shipment())?null:t.receiverPoint.postCode,","),e.R7$(2),e.SpI(" ",null==(n=r.shipment())?null:n.receiverPoint.address,"")}}function mu(i,p){if(1&i&&(e.j41(0,"li",19),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"strong"),e.EFF(4),e.nI1(5,"ardnLocaleDate"),e.k0s()()),2&i){let t;const n=e.XpG();e.R7$(),e.SpI("",e.bMT(2,2,"ORDER_PAGE.SUMMARY_STEP.PICKUP_DATE")," "),e.R7$(3),e.JRh(e.bMT(5,4,null==(t=n.shipment())?null:t.pickUpDate))}}function gu(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"strong"),e.EFF(4),e.nI1(5,"ardnCurrency"),e.k0s()()),2&i){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ",e.bMT(2,2,"ORDER_PAGE.SUMMARY_STEP.FOR_AMOUNT_OF")," "),e.R7$(3),e.SpI(" ",e.i5U(5,4,null==t?null:t.options.value,null==t?null:t.valueCurrency),"")}}function fu(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"strong"),e.EFF(4),e.nI1(5,"ardnCurrency"),e.k0s()()),2&i){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ",e.bMT(2,2,"ORDER_PAGE.SUMMARY_STEP.FOR_AMOUNT_OF")," "),e.R7$(3),e.SpI(" ",e.i5U(5,4,t.declaredValueFromCustoms.value,t.declaredValueFromCustoms.currency),"")}}function Cu(i,p){if(1&i&&(e.j41(0,"strong"),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.Lme("",t.fields.timeFrom," - ",t.fields.timeTo,"")}}function _u(i,p){if(1&i&&(e.j41(0,"li",20),e.EFF(1),e.nrm(2,"br"),e.DNE(3,gu,6,7,"span")(4,fu,6,7,"span")(5,Cu,2,2,"strong"),e.k0s()),2&i){const t=p.$implicit,n=e.XpG();e.R7$(),e.SpI("",null==t?null:t.addonName," "),e.R7$(2),e.vxM(void 0!==(null==t?null:t.options)&&null!=t&&t.options.value&&-1===n.addonsWithoutValue.indexOf(t.category)&&"PAID_PICKUP"!==t.category?3:null!=t&&t.declaredValueFromCustoms?4:-1),e.R7$(2),e.vxM(null!=t&&null!=t.fields&&t.fields.timeFrom&&null!=t&&null!=t.fields&&t.fields.timeTo?5:-1)}}function Ou(i,p){if(1&i&&(e.j41(0,"li",22),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"strong"),e.EFF(4),e.k0s()()),2&i){let t;const n=e.XpG();e.R7$(),e.SpI("",e.bMT(2,2,"ORDER_PAGE.SUMMARY_STEP.INSTRUCTION"),": "),e.R7$(3),e.JRh(null==(t=n.shipment())?null:t.instructions)}}function yu(i,p){1&i&&(e.j41(0,"li",22),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"ORDER_PAGE.SUMMARY_STEP.CLEARANCE_ETD")," "))}function vu(i,p){1&i&&(e.j41(0,"li",22),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"ORDER_PAGE.SUMMARY_STEP.CLEARANCE_PAPER")," "))}function Eu(i,p){if(1&i&&e.DNE(0,yu,3,3,"li",22)(1,vu,3,3,"li",22),2&i){const t=e.XpG().$implicit;e.vxM("ELECTRONIC_TRADE_DOCUMENTS"===t.category?0:-1),e.R7$(),e.vxM("PAPER_TRADE_DOCUMENTS"===t.category?1:-1)}}function Su(i,p){if(1&i&&e.DNE(0,Eu,2,2),2&i){const t=p.$implicit,n=e.XpG();e.vxM(void 0===(null==t?null:t.options)||-1!==n.addonsWithoutValue.indexOf(t.category)||"ELECTRONIC_TRADE_DOCUMENTS"!==t.category&&"PAPER_TRADE_DOCUMENTS"!==t.category?-1:0)}}function bu(i,p){1&i&&(e.j41(0,"li",22),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"ORDER_PAGE.SUMMARY_STEP.CLEARANCE_ETD")," "))}function Pu(i,p){1&i&&(e.j41(0,"li",22),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"ORDER_PAGE.SUMMARY_STEP.CLEARANCE_PAPER")," "))}function Au(i,p){if(1&i&&e.DNE(0,bu,3,3,"li",22)(1,Pu,3,3,"li",22),2&i){let t,n;const r=e.XpG();e.vxM("ETD"!==(null==(t=r.selectedProduct())?null:t.customDocumentType)||r.isAddonsPresent("ELECTRONIC_TRADE_DOCUMENTS")||r.isAddonsPresent("PAPER_TRADE_DOCUMENTS")?-1:0),e.R7$(),e.vxM("PAPER"!==(null==(n=r.selectedProduct())?null:n.customDocumentType)||r.isAddonsPresent("ELECTRONIC_TRADE_DOCUMENTS")||r.isAddonsPresent("PAPER_TRADE_DOCUMENTS")?-1:1)}}function Ru(i,p){if(1&i&&(e.j41(0,"strong"),e.EFF(1),e.nI1(2,"ardnCurrency"),e.k0s()),2&i){let t;const n=e.XpG();e.R7$(),e.SpI(" ",e.i5U(2,1,null==(t=n.orderPriceState().components)?null:t.productNetPrice,null==(t=n.orderPriceState().components)?null:t.currency)," ")}}function Tu(i,p){1&i&&(e.j41(0,"div",28),e.EFF(1,"Loading..."),e.k0s())}function Iu(i,p){if(1&i&&(e.j41(0,"strong"),e.EFF(1),e.nI1(2,"ardnCurrency"),e.k0s()),2&i){let t;const n=e.XpG();e.R7$(),e.SpI(" ",e.i5U(2,1,null==(t=n.orderPriceState().components)?null:t.addonsNetPrice,null==(t=n.orderPriceState().components)?null:t.currency)," ")}}function Du(i,p){1&i&&(e.j41(0,"div",28),e.EFF(1,"Loading..."),e.k0s())}function Mu(i,p){if(1&i&&(e.j41(0,"strong"),e.EFF(1),e.nI1(2,"ardnCurrency"),e.k0s()),2&i){let t;const n=e.XpG(2);e.R7$(),e.SpI(" -",e.i5U(2,1,null==(t=n.orderPriceState().components)?null:t.discountNetPrice,null==(t=n.orderPriceState().components)?null:t.currency)," ")}}function Fu(i,p){1&i&&(e.j41(0,"div",28),e.EFF(1,"Loading..."),e.k0s())}function $u(i,p){if(1&i&&(e.j41(0,"div",25)(1,"div",26),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"div",31),e.DNE(5,Mu,3,4,"strong")(6,Fu,2,0,"div",28),e.k0s()()),2&i){const t=e.XpG();e.R7$(2),e.SpI("",e.bMT(3,3,"ORDER_PAGE.SUMMARY_STEP.DISCOUNT"),":"),e.R7$(3),e.vxM(t.orderPriceState().loading?-1:5),e.R7$(),e.vxM(t.orderPriceState().loading?6:-1)}}function Nu(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ",null==t?null:t.description,": ")}}function ku(i,p){1&i&&(e.EFF(0),e.nI1(1,"translate")),2&i&&e.SpI(" ",e.bMT(1,1,"ORDER_PAGE.SUMMARY_STEP.FEE"),": ")}function Vu(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.SpI(" (",null==t?null:t.note,") ")}}function xu(i,p){if(1&i&&(e.j41(0,"div",26),e.DNE(1,Nu,2,1,"span")(2,ku,2,3),e.k0s(),e.j41(3,"div",27)(4,"strong"),e.EFF(5),e.nI1(6,"ardnCurrency"),e.nI1(7,"ardnCurrency"),e.nI1(8,"translate"),e.nI1(9,"number"),e.k0s(),e.DNE(10,Vu,2,1,"span"),e.k0s()),2&i){const t=p.$implicit;e.R7$(),e.vxM(null!=t&&t.description?1:2),e.R7$(4),e.LHq(" ",e.i5U(6,6,null==t?null:t.amount,null==t?null:t.currency)," (",e.i5U(7,9,null==t?null:t.originAmount,null==t?null:t.originCurrency),", ",e.bMT(8,12,"ORDER_PAGE.SUMMARY_STEP.RATE"),": ",e.bMT(9,14,null==t?null:t.rate),") "),e.R7$(5),e.vxM(null!=t&&t.note?10:-1)}}function Uu(i,p){if(1&i&&(e.j41(0,"li")(1,"div",25)(2,"div"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.Z7z(5,xu,11,16,null,null,e.fX1),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,1,"ORDER_PAGE.SUMMARY_STEP.FEES"),": "),e.R7$(2),e.Dyx(t.calculationResult.fees)}}function Gu(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ",null==t?null:t.description,": ")}}function Lu(i,p){1&i&&(e.EFF(0),e.nI1(1,"translate")),2&i&&e.SpI(" ",e.bMT(1,1,"ORDER_PAGE.SUMMARY_STEP.DUTY"),": ")}function ju(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.SpI(" (",null==t?null:t.note,") ")}}function wu(i,p){if(1&i&&(e.j41(0,"div",26),e.DNE(1,Gu,2,1,"span")(2,Lu,2,3),e.k0s(),e.j41(3,"div",27)(4,"strong"),e.EFF(5),e.nI1(6,"ardnCurrency"),e.nI1(7,"ardnCurrency"),e.nI1(8,"translate"),e.nI1(9,"number"),e.k0s(),e.DNE(10,ju,2,1,"span"),e.k0s()),2&i){const t=p.$implicit;e.R7$(),e.vxM(null!=t&&t.description?1:2),e.R7$(4),e.LHq(" ",e.i5U(6,6,null==t?null:t.amount,null==t?null:t.currency)," (",e.i5U(7,9,null==t?null:t.originAmount,null==t?null:t.originCurrency),", ",e.bMT(8,12,"ORDER_PAGE.SUMMARY_STEP.RATE"),": ",e.bMT(9,14,null==t?null:t.rate),") "),e.R7$(5),e.vxM(null!=t&&t.note?10:-1)}}function Bu(i,p){if(1&i&&(e.j41(0,"li")(1,"div",25)(2,"div"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.Z7z(5,wu,11,16,null,null,e.fX1),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,1,"ORDER_PAGE.SUMMARY_STEP.DUTIES"),": "),e.R7$(2),e.Dyx(t.calculationResult.duties)}}function Xu(i,p){if(1&i&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"ul",35),e.DNE(4,Uu,7,3,"li")(5,Bu,7,3,"li"),e.k0s()()),2&i){const t=e.XpG();e.R7$(),e.SpI(" ",e.bMT(2,3,"ORDER_PAGE.SUMMARY_STEP.INCLUDED_FEES"),": "),e.R7$(3),e.vxM(null!=t.calculationResult&&t.calculationResult.fees.length?4:-1),e.R7$(),e.vxM(null!=t.calculationResult&&t.calculationResult.duties.length?5:-1)}}function Yu(i,p){if(1&i&&(e.j41(0,"div")(1,"strong"),e.EFF(2),e.nI1(3,"ardnCurrency"),e.k0s(),e.j41(4,"span"),e.EFF(5),e.nI1(6,"ardnCurrency"),e.nI1(7,"translate"),e.k0s()()),2&i){let t,n;const r=e.XpG();e.R7$(2),e.SpI(" ",e.i5U(3,3,null==(t=r.orderPriceState().components)?null:t.totalGrossPrice,null==(t=r.orderPriceState().components)?null:t.currency)," "),e.R7$(3),e.Lme(" (",e.i5U(6,6,null==(n=r.orderPriceState().components)?null:n.totalNetPrice,null==(n=r.orderPriceState().components)?null:n.currency)," ",e.bMT(7,9,"COMMON.NET"),") ")}}function Wu(i,p){1&i&&(e.j41(0,"div",34),e.EFF(1,"Loading..."),e.k0s())}function Hu(i,p){if(1&i&&(e.j41(0,"div",25),e.nrm(1,"div",42),e.nI1(2,"translate"),e.j41(3,"div",43)(4,"strong"),e.EFF(5),e.nI1(6,"ardnCurrency"),e.k0s()()()),2&i){const t=e.XpG();e.R7$(),e.Y8G("innerHTML",e.bMT(2,2,"ORDER_PAGE.SUMMARY_STEP.PREPAID_TOTAL")+":",e.npT),e.R7$(4),e.SpI(" ",e.i5U(6,4,t.getPrepaidTotal(),t.getPrepaidCurrency())," ")}}function zu(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ",null==t?null:t.description,": ")}}function Ku(i,p){1&i&&(e.EFF(0),e.nI1(1,"translate")),2&i&&e.SpI(" ",e.bMT(1,1,"ORDER_PAGE.SUMMARY_STEP.TAX"),": ")}function Qu(i,p){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.SpI(" (",null==t?null:t.note,") ")}}function Ju(i,p){if(1&i&&(e.j41(0,"div",26),e.DNE(1,zu,2,1,"span")(2,Ku,2,3),e.k0s(),e.j41(3,"div",27)(4,"strong"),e.EFF(5),e.nI1(6,"ardnCurrency"),e.nI1(7,"ardnCurrency"),e.nI1(8,"translate"),e.nI1(9,"number"),e.k0s(),e.DNE(10,Qu,2,1,"span"),e.k0s()),2&i){const t=p.$implicit;e.R7$(),e.vxM(null!=t&&t.description?1:2),e.R7$(4),e.LHq(" ",e.i5U(6,6,null==t?null:t.amount,null==t?null:t.currency)," (",e.i5U(7,9,null==t?null:t.originAmount,null==t?null:t.originCurrency),", ",e.bMT(8,12,"ORDER_PAGE.SUMMARY_STEP.RATE"),": ",e.bMT(9,14,null==t?null:t.rate),") "),e.R7$(5),e.vxM(null!=t&&t.note?10:-1)}}function Zu(i,p){if(1&i&&(e.j41(0,"li")(1,"div"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.Z7z(4,Ju,11,16,null,null,e.fX1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(2),e.SpI(" ",e.bMT(3,1,"ORDER_PAGE.SUMMARY_STEP.TAXES"),": "),e.R7$(2),e.Dyx(t.calculationResult.taxes)}}function qu(i,p){if(1&i&&(e.j41(0,"ul",35)(1,"div",25),e.DNE(2,Zu,6,3,"li"),e.k0s()()),2&i){const t=e.XpG();e.R7$(2),e.vxM(null!=t.calculationResult&&t.calculationResult.taxes.length?2:-1)}}function ep(i,p){1&i&&(e.j41(0,"span",40),e.nI1(1,"translate"),e.EFF(2,"?"),e.k0s()),2&i&&e.Y8G("ardnTooltipster",e.bMT(1,1,"TOOLTIP.NOT_ALLOWED_DISCOUNT_CODE"))}function tp(i,p){if(1&i&&(e.j41(0,"div",14)(1,"div",44),e.nrm(2,"input",45)(3,"ardn-field-validator",46),e.k0s(),e.j41(4,"div",47)(5,"button",48),e.EFF(6),e.nI1(7,"translate"),e.k0s()()()),2&i){const t=e.XpG();e.R7$(3),e.Y8G("clientSideValidation",t.additionalOptionsForm.get("discountCode"))("clientErrorMessage","COMMON.ERRORS.INVALID")("serverSideValidation",t.discountCodeValidationError),e.R7$(2),e.Y8G("disabled",!t.additionalOptionsForm.valid),e.R7$(),e.SpI(" ",e.bMT(7,5,"ORDER_PAGE.SUMMARY_STEP.CONFIRM_DISCOUNT_CODE")," ")}}function np(i,p){if(1&i&&(e.j41(0,"p",41),e.EFF(1),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.SpI(" ",t.validationErrors.general," ")}}let Bo=(()=>{class i{constructor(t,n,r,o,u,g){this.config=t,this.router=n,this.formBuilder=r,this.store=o,this.orderCustomsService=u,this.countryService=g,this.shipment=(0,e.hFB
1)(),this.units=(0,e.hFB)(),this.selectedProduct=(0,e.geq)(),this.orderPriceState=(0,e.hFB)(),this.addToCart=(0,e.CGW)(),this.order=(0,e.vPA)(null),this.orderCustoms=null,this.addonsWithoutValue=["RECEIVER_TYPE_COMPANY","RECEIVER_TYPE_PRIVATE_PERSON","NOT_STANDARD"],this.unsubscribeObservable=new re.B}ngOnInit(){this.initForm(),this.additionalOptionsForm.get("hasDiscountCode").valueChanges.subscribe(t=>{t||this.detachDiscountCodeFromOrder()}),this.store.select(ue.rh).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{if(!t.results||0===t.results.length||"LOADED"!==t.loading)return;let n;if(t.results&&(n=t.results.find(o=>o.id===this.selectedProduct()?.id)),!n)return void window.location.assign("/");const r=Object.assign({},this.selectedProduct());for(const o in this.selectedProduct())this.selectedProduct()?.hasOwnProperty(o)&&n.hasOwnProperty(o)&&(r[o]=n[o]);this.store.dispatch(me.U.createSetProductAction(r))}),this.store.select(T.C4).pipe((0,U.p)(t=>!!t),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.selectedProduct.set(t),t?.discountCodeAllowed?this.additionalOptionsForm.get("hasDiscountCode").enable():this.additionalOptionsForm.get("hasDiscountCode").disable()}),this.orderCustoms=this.orderCustomsService.orderCustomsConfig$.value,this.getDiscountCode(),this.store.select(T.PE).pipe((0,U.p)(t=>!!t?.priceComponents?.components),(0,lu.$)()).subscribe(t=>{this.order.set(t),this.checkIfShipmentInsideUE(t);const n=t?.shipment?.addons?.some(r=>"DUTY_DDP_PREMIUM"===r?.category||"DUTY_DAP_PREMIUM"===r?.category)??!1;if(t?.customs&&n){const r={receiverAddress:{name:t?.receiverAddress?.name,city:t?.receiverAddress?.city,street:t?.receiverAddress?.street,houseNumber:t?.receiverAddress?.houseNumber,postCode:t?.receiverAddress?.postCode,countryId:t?.receiverAddress?.countryId},senderAddress:{name:t?.senderAddress?.name,city:t?.senderAddress?.city,street:t?.senderAddress?.street,houseNumber:t?.senderAddress?.houseNumber,postCode:t?.senderAddress?.postCode,countryId:t?.senderAddress?.countryId},purpose:t?.shipment?.purpose,orderHash:t.hash,force:!0,customs:t?.customs,productId:t?.shipment?.productId,postalChargesCurrency:t?.priceComponents?.components?.currency,postalCharges:t?.priceComponents?.components?.productsGrossPrice+t?.priceComponents?.components?.fuelSurchargeGrossPrice,addonIds:t?.shipment?.addons?.map(o=>o.id)??[]};t?.receiverAddress?.stateId&&(r.receiverAddress.stateId=t?.receiverAddress?.stateId),t?.senderAddress?.stateId&&(r.senderAddress.stateId=t?.senderAddress?.stateId),this.orderCustomsService.getCalculateCustoms(r).subscribe({next:o=>{this.calculationResult=o},error:o=>{this.validationErrors=o}})}})}ngOnChanges(t){t.orderPriceState&&t?.orderPriceState?.currentValue?.validationErrors?.fields?.discountCode&&(this.discountCodeValidationError=t.orderPriceState.currentValue.validationErrors?.fields.discountCode)}ngOnDestroy(){this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}setDiscountToOrder(){this.discountCodeValidationError=null,this.store.dispatch(F.M.createSetOrderDiscountAction(this.additionalOptionsForm.get("discountCode").value))}areCountriesOutsideEU(){let t,n;return this.store.select(ue.fn).subscribe(o=>{t=o.isSenderCountryEU,n=o.isReceiverCountryEU}),!(t&&n)}getPrepaidTotal(){if(!this.calculationResult)return null;const t=n=>(n??[]).reduce((r,o)=>r+(o?.amount??0),0);return t(this.calculationResult?.duties)+t(this.calculationResult?.fees)+t(this.calculationResult?.taxes)}getPrepaidCurrency(){return this.calculationResult?.taxes?.[0]?.currency??this.calculationResult?.duties?.[0]?.currency??this.calculationResult?.fees?.[0]?.currency??this.orderPriceState()?.components?.currency}isAddonsPresent(t){return this.shipment()?.addons?.some(n=>n?.category===t)??!1}saveTemplate(){this.saveTemplateModal.open({height:this.shipment().height,length:this.shipment().length,weight:this.shipment().weight,width:this.shipment().width,quantity:this.shipment().quantity,receiverCountryId:this.shipment().receiverCountryId,senderCountryId:this.shipment().senderCountryId},this.shipment().productId,this.order(),!0)}detachDiscountCodeFromOrder(){this.store.dispatch(F.M.createSetOrderDiscountAction(null))}getDiscountCode(){this.store.select(T.Bc).pipe((0,U.p)(t=>
1!!t),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{t?.fields?.discountCode&&(this.discountCodeValidationError=t.fields.discountCode),t?.general&&t?.general[0]&&(this.discountCodeValidationError="Wybrany rabatowy nie przysluguje uzytkownikowi objetemu juz indywidualna oferta cenowa."===t.general[0]?"Wybrany kod rabatowy nie przysluguje uzytkownikowi objetemu juz indywidualna oferta cenowa.":t.general[0])})}checkIfShipmentInsideUE(t){this.countryService.getCountriesCached().subscribe(n=>{const r=n.find(u=>u.id===t?.senderAddress?.countryId),o=n.find(u=>u.id===t?.receiverAddress?.countryId);this.isShipmentInsideEU=r?.isUEMember&&o?.isUEMember})}initForm(){this.additionalOptionsForm=this.formBuilder.group({hasDiscountCode:new m.MJ({value:!1,disabled:!0}),discountCode:["",m.k0.compose([m.k0.required,m.k0.minLength(6)])]})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Ae.vQ),e.rXU(b.Ix),e.rXU(m.ok),e.rXU(v.il),e.rXU(Pt.I),e.rXU(be.o))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-summary-of-order-components"]],viewQuery:function(n,r){if(1&n&&e.GBs(Yt.A,7),2&n){let o;e.mGM(o=e.lsd())&&(r.saveTemplateModal=o.first)}},inputs:{shipment:[1,"shipment"],units:[1,"units"],selectedProduct:[1,"selectedProduct"],orderPriceState:[1,"orderPriceState"]},outputs:{selectedProduct:"selectedProductChange",addToCart:"addToCart"},standalone:!0,features:[e.OA$,e.aNF],decls:93,vars:57,consts:[["saveTemplateModal",""],[1,"order-summary"],[1,"order-summary__top"],[1,"order-summary__logo"],[1,"v-align"],[1,"v-align__content"],["data-qa","product logo","alt","carrier logo",3,"src"],[1,"order-summary__name"],["data-qa","product name",1,"v-align__content"],[1,"save-temp-btn-wrapper"],["type","button",1,"btn","btn--primary","save-temp-btn",3,"click"],["aria-hidden","true",1,"fas","fa-cart-shopping"],["aria-hidden","true",1,"fas","fa-download"],[1,"order-summary__body"],[1,"row"],[1,"col","col-7-16","col-portable-12"],[1,"list","list--check"],["data-qa","delivery type"],[3,"innerText"],["data-qa","pickup date"],["data-qa","addons"],["data-qa","content"],["data-qa","instructions"],[1,"list","list--warning"],[1,"col","col-9-16","col-portable-12"],[1,"order-summary__price"],[1,"order-summary__price-label"],["data-qa","basic price",1,"order-summary__price-value"],[1,"loader","loader--gray"],[1,"order-summary__price","mb-16"],[1,"order-summary__price-subLabel"],["data-qa","addons price",1,"order-summary__price-value"],[1,"order-summary__price","order-summary__price--total"],["data-qa","total price",1,"order-summary__price-value"],[1,"loader","loader--green"],[1,"additional-fees"],[3,"submit","formGroup"],[1,"checkbox"],["for","has-discount-code"],["id","has-discount-code","type","checkbox","formControlName","hasDiscountCode"],[1,"label__info-icon","info-icon",3,"ardnTooltipster"],[1,"form-error"],[1,"order-summary__price-label",3,"innerHTML"],["data-qa","prepaid total",1,"order-summary__price-value"],[1,"field","col","col-7"],["data-qa","discount code","formControlName","discountCode",1,"input"],[3,"clientSideValidation","clientErrorMessage","serverSideValidation"],[1,"field","col","col-5"],["data-qa","submit button","type","submit",1,"btn","btn--block","btn--primary",3,"disabled"]],template:function(n,r){if(1&n){const o=e.RV6();e.j41(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5),e.nrm(5,"img",6),e.k0s()()(),e.j41(6,"div",7)(7,"div",4)(8,"div",8),e.EFF(9),e.DNE(10,uu,2,1,"span"),e.k0s()()(),e.j41(11,"div",9)(12,"button",10),e.bIt("click",function(){return e.eBV(o),e.Njj(r.addToCart.emit())}),e.nrm(13,"i",11),e.EFF(14),e.nI1(15,"translate"),e.k0s(),e.j41(16,"button",10),e.bIt("click",function(){return e.eBV(o),e.Njj(r.saveTemplate())}),e.nrm(17,"i",12),e.EFF(18),e.nI1(19,"translate"),e.k0s()()(),e.j41(20,"div",13)(21,"div",14)(22,"div",15)(23,"ul",16)(24,"li",17),e.EFF(25),e.nI1(26,"translate"),e.nrm(27,"strong",18),e.k0s(),e.DNE(28,pu,8,7,"li")(29,hu,8,7,"li")(30,mu,6,6,"li",19),e.j41(31,"li",17),e.EFF(32),e.nI1(33,"translate"),e.j41(34,"strong"),e.EFF(35),e.nI1(36,"translate"),e.k0s()(),e.Z7z(37,_u,6,3,"li",20,e.fX1),e.j41(39,"li",21),e.EFF(40),e.nI1(41,"translate"),e.j41(42,"strong"),e.EFF(43),e.k0s()(),e.DNE(44,Ou,5,4,"li",22),e.k0s(),e.j41(45,"ul",23),e.Z7z(46,Su,1,1,null,null,e.fX1),e.DNE(48,Au,2,2),e.k0s()(),e.j41(49,"div",24)(50,"div",25)(51,"div",26),e.EFF(52),e.nI1(53,"translate"),e.k0s(),e.j41(54,"div",27),e.DNE(55,Ru,3,4,"strong")(56,Tu,2,0,"div",28),e.k0s()(),e.j41(57,"div",29)(58,"div",26),e.EFF(59),e.nI1(60,"translate"),e.j41(61,"span",30),e.EFF(62),e.nI1(63,"translate"),e.k0s()(),e.j41(64,"div",31),e.DNE(65,Iu,3,4,"strong")(66,Du,2,0,"div",28),e.k0s()(),e.DNE(67,$u,7,5,"div",25)(68,Xu,6,5,"div"),e.j41(69,"div",32)(70,"div",26),e.EFF(71),e.nI1(72,"translate"),e.k0s(),e.j41(73,"div",33),e.DNE(74,Yu,8,11,"div"),e.j41(75,"strong"),e.DNE(76,Wu,2,0,"div",34),e.k0s()()(),e.DNE(77,Hu,7,7,"div",25)(78,qu,3,1,"ul",35),e.j41(79,"div",25)(80,"form",36),e.bIt("submit",function(){return e.eBV(o),e.Njj(r.setDiscountToOrder())}),e.j41(81,"div",37)(82,"label",38),e.nrm(83,"input",39),e.j41(84,"span"),e.EFF(85),e.nI1(86,"translate"),e.k0s()(),e.EFF(87,"\xa0"),e.DNE(88,ep,3,3,"span",40),e.k0s(),e.DNE(89,tp,8,7,"div",14),e.k0s()(),e.DNE(90,np,2,1,"p",41),e.k0s()()()(),e.nrm(91,"ardn-save-template-modal",null,0)}if(2&n){let o,u,g,A,N,w,te,ne,de,Fe,Le,it,we;e.R7$(5),e.Y8G("src",null==(o=r.selectedProduct())?null:o.carrierLogoLink,e.B4B),e.R7$(4),e.SpI("",null==(u=r.selectedProduct())?null:u.name," "),e.R7$(),e.vxM(r.units()>1?10:-1),e.R7$(4),e.SpI(" ",e.bMT(15,35,"MENU.CART.ADD_TO_CART")," "),e.R7$(4),e.SpI(" ",e.bMT(19,37,"ORDER_SUCCESS_PAGE.SAVE_AS_TEMPLATE")," "),e.R7$(7),e.SpI("",e.bMT(26,39,"ORDER_PAGE.SUMMARY_STEP.SHIPMENT_DIMENSIONS")," "),e.R7$(2),e.Y8G("innerText",(null==(g=r.shipment())?null:g.length)+"cm x "+(null==(g=r.shipment())?null:g.width)+"cm x "+(null==(g=r.shipment())?null:g.height)+"cm, "+(null==(g=r.shipment())?null:g.weight)+"kg"),e.R7$(),e.vxM(null!=(A=r.shipment())&&A.senderPoint?28:-1),e.R7$(),e.vxM(null!=(N=r.shipment())&&N.receiverPoint?29:-1),e.R7$(),e.vxM(null!=(w=r.shipment())&&w.pickUpDate&&"POINT"!==(null==(w=r.shipment())?null:w.realCollectionType)?30:-1),e.R7$(2),e.SpI("",e.bMT(33,41,"ORDER_PAGE.SUMMARY_STEP.DELIVERY")," "),e.R7$(3),e.JRh(e.bMT(36,43,"PRODUCT.DELIVERY_TIME."+(null==(te=r.selectedProduct())?null:te.deliveryTimeType))),e.R7$(2),e.Dyx(null==(ne=r.shipment())?null:ne.addons),e.R7$(3),e.SpI("",e.bMT(41,45,"ORDER_PAGE.SUMMARY_STEP.CONTENT"),": "),e.R7$(3),e.JRh(null==(de=r.shipment())?null:de.content),e.R7$(),e.vxM(null!=(Fe=r.shipment())&&Fe.instructions?44:-1),e.R7$(2),e.Dyx(null==(Le=r.shipment())?null:Le.addons),e.R7$(2),e.vxM(r.orderCustoms||r.isShipmentInsideEU?48:-1),e.R7$(4),e.SpI("",e.bMT(53,47,"ORDER_PAGE.SUMMARY_STEP.BASIC_PRICE"),":"),e.R7$(3),e.vxM(r.orderPriceState().loading?-1:55),e.R7$(),e.vxM(r.orderPriceState().loading?56:-1),e.R7$(3),e.SpI("",e.bMT(60,49,"ORDER_PAGE.SUMMARY_STEP.ADDONS"),": "),e.R7$(3),e.SpI(" (",e.bMT(63,51,"ORDER_PAGE.SUMMARY_STEP.WITHOUT_FUEL_SURCHARGE"),") "),e.R7$(3),e.vxM(r.orderPriceState().loading?-1:65),e.R7$(),e.vxM(r.orderPriceState().loading?66:-1),e.R7$(),e.vxM(0!==(null==(it=r.orderPriceState().components)?null:it.discountNetPrice)?67:-1),e.R7$(),e.vxM(r.calculationResult?68:-1),e.R7$(3),e.SpI("",e.bMT(72,53,"ORDER_PAGE.SUMMARY_STEP.TOTAL_COST_WITH_FUEL_FEE"),":"),e.R7$(3),e.vxM(r.orderPriceState().loading?-1:74),e.R7$(2),e.vxM(r.orderPriceState().loading?76:-1),e.R7$(),e.vxM(r.calculationResult?77:-1),e.R7$(),e.vxM(r.calculationResult?78:-1),e.R7$(2),e.Y8G("formGroup",r.additionalOptionsForm),e.R7$(5),e.JRh(e.bMT(86,55,"ORDER_PAGE.SUMMARY_STEP.HAVE_DISCOUNT_CODE")),e.R7$(3),e.vxM(null!=(we=r.additionalOptionsForm.get("hasDiscountCode"))&&we.disabled?88:-1),e.R7$(),e.vxM(r.additionalOptionsForm.value.hasDiscountCode?89:-1),e.R7$(),e.vxM(null!=r.validationErrors&&r.validationErrors.general?90:-1)}},dependencies:[cu.c,f.h,f.D9,st.W,m.X1,m.qT,m.me,m.Zm,m.BC,m.cb,m.j4,m.JD,ge.d,ye.Q,l.QX,Yt.A],styles:[".save-temp-btn-wrapper[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;padding:15px}.save-temp-btn[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}.save-temp-btn[_ngcontent-%COMP%]   i.fas[_ngcontent-%COMP%]{font-size:20px;line-height:1}.order-summary__price-label[_ngcontent-%COMP%]{width:250px}.order-summary__price-value[_ngcontent-%COMP%]{margin-left:340px}@media only screen and (max-width: 40em){.order-summary__price-value[_ngcontent-%COMP%]{margin-left:90px}}.order-summary__price-subLabel[_ngcontent-%COMP%]{float:left;font-size:14px}ul.additional-fees[_ngcontent-%COMP%]{font-size:14px;margin-top:5px}ul.additional-fees[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{padding-left:15px;font-size:14px}ul.additional-fees[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .order-summary__price-label[_ngcontent-%COMP%]{width:270px;font-size:12px;padding-left:15px}ul.additional-fees[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .order-summary__price-value[_ngcontent-%COMP%]{margin-left:300px}ul.additional-fees[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .order-summary__price-value[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{font-size:12px}ul.additional-fees[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .order-summary__price-value[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:12px;display:block;margin-left:0}@media only screen and (max-width: 40em){ul.additional-fees[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .order-summary__price-label[_ngcontent-%COMP%]{width:300px}ul.additional-fees[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .order-summary__price-value[_ngcontent-%COMP%]{margin-left:30px}}"]})}}return i})();var rp=s(22614);function ip(i,p){if(1&i&&(e.j41(0,"li"),e.EFF(1),e.k0s()),2&i){const t=p.$implicit;e.R7$(),e.SpI(" ",t," ")}}function op(i,p){if(1&i&&(e.j41(0,"div",5)(1,"ul",6),e.Z7z(2,ip,2,1,"li",null,e.fX1),e.nI1(4,"async"),e.k0s()()),2&i){const t=e.XpG();e.R7$(2),e.Dyx(e.bMT(4,0,t.generalOrderValidationErrorsObservable))}}function sp(i,p){1&i&&(e.j41(0,"div",5)(1,"ul",6)(2,"li"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()()),2&i&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"COMMON.ERRORS.API_ERROR")," "))}function ap(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",11),e.bIt("click",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.errorDebugOpened.set(!0))}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.ERRORS.HELP")," "))}function dp(i,p){if(1&i&&(e.j41(0,"li"),e.EFF(1),e.k0s()),2&i){const t=p.$implicit;
1e.R7$(),e.Lme("",t.key," - ",t.value,"")}}function lp(i,p){1&i&&e.nrm(0,"ardn-icon",14)}function cp(i,p){1&i&&e.nrm(0,"i",15)}function up(i,p){1&i&&e.nrm(0,"ardn-icon",14)}function pp(i,p){1&i&&e.nrm(0,"i",15)}function hp(i,p){if(1&i){const t=e.RV6();e.j41(0,"section",10)(1,"p"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"h3"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"div",12)(8,"button",13),e.bIt("click",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.copyCurl(r.debugService.lastError().curl,"curl"))}),e.DNE(9,lp,1,0,"ardn-icon",14)(10,cp,1,0,"i",15),e.k0s(),e.j41(11,"pre",16),e.EFF(12,"            "),e.j41(13,"code"),e.EFF(14),e.k0s(),e.EFF(15,"\n          "),e.k0s()(),e.j41(16,"h3"),e.EFF(17),e.nI1(18,"translate"),e.k0s(),e.j41(19,"div",12)(20,"button",13),e.bIt("click",function(){let r;e.eBV(t);const o=e.XpG(2);return e.Njj(o.copyCurl(o.JSON.stringify(null==(r=o.debugService.lastError())?null:r.error),"error"))}),e.DNE(21,up,1,0,"ardn-icon",14)(22,pp,1,0,"i",15),e.k0s(),e.j41(23,"pre",16),e.EFF(24,"            "),e.j41(25,"code"),e.EFF(26),e.k0s(),e.EFF(27,"\n          "),e.k0s()()()}if(2&i){const t=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,7,"COMMON.ERRORS.DEBUG_HELP_INFO")),e.R7$(3),e.SpI("",e.bMT(6,9,"COMMON.ERRORS.CURL"),":"),e.R7$(4),e.vxM(t.curlCopied()?9:10),e.R7$(5),e.JRh(t.debugService.lastError().curl),e.R7$(3),e.SpI("",e.bMT(18,11,"COMMON.ERRORS.ERROR"),":"),e.R7$(4),e.vxM(t.rawErrorCopied()?21:22),e.R7$(5),e.JRh(t.JSON.stringify(t.debugService.lastError().error))}}function mp(i,p){if(1&i&&(e.j41(0,"div",5)(1,"ul",6)(2,"li"),e.EFF(3),e.nI1(4,"translate"),e.DNE(5,ap,3,3,"div",7),e.k0s()(),e.j41(6,"div",8)(7,"h3"),e.EFF(8),e.nI1(9,"translate"),e.k0s(),e.j41(10,"ul",9),e.Z7z(11,dp,2,2,"li",null,e.fX1),e.k0s()(),e.DNE(13,hp,28,13,"section",10),e.k0s()),2&i){const t=e.XpG();e.R7$(3),e.SpI(" ",e.bMT(4,4,"COMMON.ERRORS.FIELDS")," "),e.R7$(2),e.vxM(t.errorDebugOpened()?-1:5),e.R7$(3),e.SpI("",e.bMT(9,6,"COMMON.ERRORS.ERROR_LIST"),":"),e.R7$(3),e.Dyx(t.fieldValidationErrors()),e.R7$(2),e.vxM(t.debugService.lastError()&&t.errorDebugOpened()?13:-1)}}let gp=(()=>{class i{constructor(t,n,r,o){this.platformId=t,this.store=n,this.translateService=r,this.debugService=o,this.JSON=JSON,this.errorDebugOpened=(0,e.vPA)(!1),this.curlCopied=(0,e.vPA)(!1),this.rawErrorCopied=(0,e.vPA)(!1),this.fieldValidationErrors=(0,e.vPA)([]),this.addToCart=(0,e.CGW)(),this.store.select(T.PE).pipe((0,z.pQ)()).subscribe(u=>this.order=u)}ngOnInit(){this.generalOrderValidationErrorsObservable=this.store.select(T.zq),this.otherOrderErrorsArePresentObservable=this.store.select(T.Xx),this.store.select(T.wn).pipe((0,U.p)(t=>t&&Object.values(t).length>0),(0,M.s)(1)).subscribe(t=>{let n=Object.entries(t).map(([u,g])=>({key:u,value:g}));const r=n.filter(u=>u.key.startsWith("customs")&&"customs"!==u.key);n=n.filter(u=>!u.key.includes("customs")||"customs"===u.key),r.length&&n.push({key:"customs",value:r.length.toString()});const o=n.find(u=>"addons"===u.key);n=n.filter(u=>"addons"!==u.key),n.forEach(u=>{switch(!0){case u.key.startsWith("receiverAddress"):case u.key.startsWith("senderAddress"):const g=u.key.replace(/\[(\w+)\]/g,".$1").split(".");switch(!0){case"countryId"===g[1]:g[1]="country";break;case"stateId"===g[1]:g[1]="state"}const A=g[0].replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase(),N=g[1].replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase();u.key=`${this.translateService.instant("ORDER_PAGE.ENTER_"+A)}: ${this.translateService.instant(fp+N)}`;break;case"customs"===u.key:u.key=this.translateService.instant("DASHBOARD_PAGE.ORDER_DOCUMENTS.TITLE_DHL_EXPRESS_DCL"),isNaN(Number.parseInt(u.value,10))||(u.value=`${this.translateService.instant("COMMON.ERRORS.CUSTOMS_ERRORS_AMOUNT")}: ${u.value}`);break;default:const w=this.findEnumMatch(u.key);u.key=this.translateService.instant(`${w.enumName}.${w.key}`)}}),o&&n.push(...this.mapAddonErrors(o)),this.fieldValidationErrors.set(n)})}errorsAreEmpty(t){return!t||0===t.length}copyCurl(t,n){if((0,l.UE)(this.platformId)){if(!t)return;switch(navigator.clipboard.writeText(t),n){case"curl":this.curlCopied.set(!0);break;
1case"error":this.rawErrorCopied.set(!0)}setTimeout(()=>{switch(n){case"curl":this.curlCopied.set(!1);break;case"error":this.rawErrorCopied.set(!1)}},1e3)}}findEnumMatch(t){for(const[n,r]of Object.entries(Cp))for(const[o,u]of Object.entries(r))if(u===t)return{enumName:n,key:o};return null}mapAddonErrors(t){if("string"==typeof t.value)return[t];const n=[];return t.value.forEach(r=>{const o=this.order.shipment.addons.find(u=>u.id===r.addonId);n.push({key:o.addonName,value:r.message})}),n}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(e.Agw),e.rXU(v.il),e.rXU(f.c$),e.rXU(Zc.V))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-summary-step"]],outputs:{addToCart:"addToCart"},decls:13,vars:17,consts:[[1,"h3-order"],[1,"icon","icon-list"],[0,"xmlns","xlink","http://www.w3.org/1999/xlink","href","assets/img/sprites.svg#icon-list"],[3,"userAddress","receiverAddress","senderAddress"],[3,"addToCart","shipment","units","selectedProduct","orderPriceState"],[1,"general-order-validation-errors"],[1,"list","list--error"],[1,"pseudo-link"],[1,"error-list-wrapper"],[1,"error-list"],[1,"debug"],[1,"pseudo-link",3,"click"],[1,"code-wrapper"],[1,"copy-btn",3,"click"],["size","16px","path","assets/img/icons/check-white.svg"],[1,"fa","fa-copy"],[1,"code-block"]],template:function(n,r){1&n&&(e.j41(0,"h3",0),e.qSk(),e.j41(1,"svg",1),e.nrm(2,"use",2),e.k0s(),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.joV(),e.qex(5),e.nrm(6,"ardn-order-addresses-summary",3),e.j41(7,"ardn-order-summary-of-order-components",4),e.bIt("addToCart",function(){return r.addToCart.emit()}),e.k0s(),e.bVm(),e.DNE(8,op,5,2,"div",5),e.nI1(9,"async"),e.DNE(10,sp,5,3,"div",5),e.nI1(11,"async"),e.DNE(12,mp,14,8,"div",5)),2&n&&(e.R7$(3),e.SpI(" ",e.bMT(4,11,"ORDER_PAGE.SUMMARY_STEP.YOUR_ORDER"),"\n"),e.R7$(3),e.Y8G("userAddress",null==r.order?null:r.order.userAddress)("receiverAddress",null==r.order?null:r.order.receiverAddress)("senderAddress",null==r.order?null:r.order.senderAddress),e.R7$(),e.Y8G("shipment",null==r.order?null:r.order.shipment)("units",null==r.order||null==r.order.selectedProduct?null:r.order.selectedProduct.units)("selectedProduct",null==r.order?null:r.order.selectedProduct)("orderPriceState",null==r.order?null:r.order.priceComponents),e.R7$(),e.vxM(r.errorsAreEmpty(e.bMT(9,13,r.generalOrderValidationErrorsObservable))?-1:8),e.R7$(2),e.vxM(e.bMT(11,15,r.otherOrderErrorsArePresentObservable)?10:-1),e.R7$(2),e.vxM(r.fieldValidationErrors().length?12:-1))},dependencies:[wo,Bo,rp.R,l.Jj,f.D9],styles:[".general-order-validation-errors[_ngcontent-%COMP%]{margin-top:30px;padding-left:30px;border:solid 1px #f72323;border-radius:8px}section.debug[_ngcontent-%COMP%]{border:solid 1px #9c9c9c;border-radius:8px;padding:10px 0 10px 20px;margin:20px 20px 20px 0}.code-wrapper[_ngcontent-%COMP%]{position:relative;width:calc(100% - 30px)}.code-block[_ngcontent-%COMP%]{background:#1f3041;color:#fafafa;border-radius:6px;overflow:auto;
1font-family:Fira Code,monospace;font-size:13px;line-height:1.4;width:100%;overflow-x:hidden}.code-block[_ngcontent-%COMP%]   code[_ngcontent-%COMP%]{padding:16px;display:block;white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere}.copy-btn[_ngcontent-%COMP%]{position:absolute;top:8px;right:8px;background:#1f3041;color:#fafafa;border:1px solid #fafafa;font-size:16px;border-radius:100%;cursor:pointer;transition:all .2s ease;height:41px;width:41px;display:flex;align-items:center;justify-content:center}.copy-btn[_ngcontent-%COMP%]:hover{background:#0003}.copy-btn[_ngcontent-%COMP%]:active{background:#fff3}.pseudo-link[_ngcontent-%COMP%]{font-size:12px;color:#96c21f;cursor:pointer;position:absolute;top:0;right:16px}.pseudo-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.error-list-wrapper[_ngcontent-%COMP%]{margin-left:36px}.error-list[_ngcontent-%COMP%]{margin:10px 20px}.error-list[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{list-style:disc}h3[_ngcontent-%COMP%]{font-weight:500}p[_ngcontent-%COMP%]{margin:1em 0}"]})}}return i})();var Xo=function(i){return i.DECLARED_VALUE="declaredValue",i.PURPOSE="purpose",i.CONTENT="content",i.CHOICE_OF_CARRIER="shipment[productId]",i.PREFERRED_PICKUP_DATE="pickup[date],pickup",i}(Xo||{}),Yo=function(i){return i.ONLINE="paymentId",i.QUANTITY="shipment[quantity]",i}(Yo||{}),Wo=function(i){return i.WIDTH="shipment[width]",i.HEIGHT="shipment[height]",i.WEIGHT="shipment[weight]",i.LENGTH="shipment[length]",i}(Wo||{}),Ho=function(i){return i.COLLECTION_TYPE="collectionType",i}(Ho||{}),zo=function(i){return i.AGREEMENTS="agreements[processingPersonalData],agreements[receiveElectronicBills]",i}(zo||{});const fp="COMMON.ADDRESS.",Cp={ORDER_PAGE:Xo,TOOLTIP:Yo,ZOHO_FORM:Wo,ORDER:zo,SEARCH_FILTER:H
1o},_p=i=>({"dark-mode":i}),Op=i=>({"full-width":i}),yp=i=>({"postcode-validation":i});function vp(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",5)(1,"div",30)(2,"div",31)(3,"div",32)(4,"span",33),e.EFF(5),e.k0s(),e.j41(6,"span",34),e.nrm(7,"img",35),e.k0s(),e.j41(8,"span",36)(9,"span",37),e.EFF(10),e.nI1(11,"ardnCurrency"),e.k0s(),e.j41(12,"span",38),e.EFF(13),e.nI1(14,"ardnCurrency"),e.nI1(15,"translate"),e.k0s()(),e.j41(16,"span",39)(17,"a",40),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.changeProduct())}),e.qSk(),e.j41(18,"svg",41),e.nrm(19,"use",42),e.k0s(),e.joV(),e.j41(20,"span"),e.EFF(21),e.nI1(22,"translate"),e.k0s()()()()()()()}if(2&i){const t=e.XpG();e.R7$(5),e.SpI(" ",null==t.selectedProduct?null:t.selectedProduct.name," "),e.R7$(2),e.FS9("alt",null==t.selectedProduct?null:t.selectedProduct.carrierName),e.Y8G("src",null==t.selectedProduct?null:t.selectedProduct.carrierLogoLink,e.B4B)("ardnDataTestId","ardn-order-step-"+t.getStep(1).index+"-image"),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-step-"+t.getStep(1).index+"-price-big"),e.R7$(),e.JRh(e.i5U(11,11,null==t.selectedProduct?null:t.selectedProduct.netPrice,null==t.selectedProduct?null:t.selectedProduct.currency)),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-step-"+t.getStep(1).index+"-price-small"),e.R7$(),e.Lme("(",e.i5U(14,14,null==t.selectedProduct?null:t.selectedProduct.grossPrice,null==t.selectedProduct?null:t.selectedProduct.currency)," ",e.bMT(15,17,"COMMON.GROSS"),")"),e.R7$(4),e.Y8G("ardnDataTestId","ardn-order-step-"+t.getStep(1).index+"-change-product"),e.R7$(4),e.JRh(e.bMT(22,19,"ORDER_PAGE.CHANGE_CARRIER"))}}function Ep(i,p){1&i&&e.nrm(0,"ardn-preview-search-product")}function Sp(i,p){1&i&&e.nrm(0,"ardn-search-list-filters")}function bp(i,p){if(1&i){const t=e.RV6();e.j41(0,"div"),e.nrm(1,"ardn-search-product",43),e.DNE(2,Sp,1,0,"ardn-search-list-filters"),e.j41(3,"ardn-search-list",44),e.bIt("productSelected",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.productSelected())}),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(),e.Y8G("displayMore",!0)("ardnDataTestId","ardn-search-product"),e.R7$(),e.vxM(t.isProductsLoaded?2:-1),e.R7$(),e.Y8G("displayHeaderOnEmptyResult",!0)("currency",t.selectedCurrency)("ardnDataTestId","ardn-search-list")}}function Pp(i,p){if(1&i){const t=e.RV6();e.j41(0,"a",45),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.openEditAccountDialog())}),e.qSk(),e.j41(1,"svg",46),e.nrm(2,"use",42),e.k0s(),e.EFF(3),e.nI1(4,"translate"),e.k0s()}2&i&&(e.R7$(3),e.SpI("",e.bMT(4,1,"ORDER_PAGE.CHANGE_SENDER_DATA")," "))}function Ap(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.CONTINUE")," "))}function Rp(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"div",48),e.EFF(4,"Verification..."),e.k0s()()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.ADDRESS_DATA_VERIFICATION")," "))}function Tp(i,p){if(1&i){const t=e.RV6();e.j41(0,"button",47),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.continueToFourthStep())}),e.DNE(1,Ap,3,3,"span")(2,Rp,5,3,"span"),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("ardnDataTestId","ardn-order-step-"+t.getStep(3).index+"-continue-to-fourth-step-button"),e.R7$(),e.vxM(t.orderAddressVerificationLoading?-1:1),e.R7$(),e.vxM(t.orderAddressVerificationLoading?2:-1)}}function Ip(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.CONTINUE")," "))}function Dp(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"div",48),e.EFF(4,"Verification..."),e.k0s()()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.ADDRESS_DATA_VERIFICATION")," "))}function Mp(i,p){if(1&i){const t=e.RV6();e.j41(0,"button",49),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.validateThirdStep())}),e.DNE(1,Ip,3,3,"span")(2,Dp,5,3,"span"),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("ardnDataTestId","ardn-order-step-"+t.getStep(3).index+"-validate-third-step-button"),e.R7$(),e.vxM(t.orderAddressVerificationLoading?-1:1),e.R7$(),e.vxM(t.orderAddressVerificationLoading?2:-1)}}function Fp(i,p){if(1&i&&(e.j41(0,"button",17),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i){const t=e.XpG();e.Y8G("ardnDataTestId","ardn-order-step-"+t.getStep(3).index+"-disabled-third-step-button"),e.R7$(),e.SpI(" ",e.bMT(2,2,"COMMON.CONTINUE")," ")}}function $p(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-order-shipment-options-step",50),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.handleOrderOptionsValidity(r))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("isPackageInMotion",t.isPackageInMotion())("ardnDataTestId","ardn-order-shipment-options-step")}}function Np(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"div",48),e.
1EFF(4,"Verification..."),e.k0s()()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.SHIPMENT_DATA_VERIFICATION")," "))}function kp(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.CONTINUE")," "))}function Vp(i,p){if(1&i){const t=e.RV6();e.j41(0,"button",51),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.continueToFifthStep())}),e.DNE(1,Np,5,3,"span")(2,kp,3,3,"span"),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("disabled",!t.isOrderOptionsValid)("ardnDataTestId","ardn-order-step-"+t.getStep(4).index+"-continue-to-fifth-step-button"),e.R7$(),e.vxM(t.shipmentStepVerificationLoading?1:-1),e.R7$(),e.vxM(t.shipmentStepVerificationLoading?-1:2)}}function xp(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"div",48),e.EFF(4,"Verification..."),e.k0s()()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.SHIPMENT_DATA_VERIFICATION")," "))}function Up(i,p){1&i&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.CONTINUE")," "))}function Gp(i,p){if(1&i){const t=e.RV6();e.j41(0,"button",52),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.validateFourthStep())}),e.DNE(1,xp,5,3,"span")(2,Up,3,3,"span"),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("ardnDataTestId","ardn-order-step-"+t.getStep(4).index+"-validate-fourth-step-button"),e.R7$(),e.vxM(t.shipmentStepVerificationLoading?1:-1),e.R7$(),e.vxM(t.shipmentStepVerificationLoading?-1:2)}}function Lp(i,p){if(1&i&&(e.j41(0,"button",23),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i){const t=e.XpG();e.Y8G("ardnDataTestId","ardn-order-step-"+t.getStep(4).index+"-disabled-fourth-step-button"),e.R7$(),e.SpI(" ",e.bMT(2,2,"COMMON.CONTINUE")," ")}}function jp(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-order-payment-step",13),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.handleOrderPaymentValidity(r))}),e.k0s()}2&i&&e.Y8G("ardnDataTestId","ardn-order-payment-step")}function wp(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-order-summary-step",53),e.bIt("addToCart",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.addOrderToCart())}),e.k0s()}2&i&&e.Y8G("ardnDataTestId","ardn-order-summary-step")}function Bp(i,p){if(1&i){const t=e.RV6();e.j41(0,"ardn-order-agreements-step",54),e.bIt("validityChanged",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.handleOrderAgreementsValidity(r))}),e.k0s()}}function Xp(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",55),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.scrollToPaymentTiles())}),e.k0s()}}function Yp(i,p){1&i&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"div",56),e.EFF(4,"Loading..."),e.k0s()()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"ORDER_PAGE.SUMMARY_STEP.POST_ORDER_LOADING"),""))}function Wp(i,p){1&i&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"ORDER_PAGE.SUMMARY_STEP.CONFIRM_AND_CREATE_ORDER")," "))}function Hp(i,p){1&i&&e.nrm(0,"ardn-order-map-modal",29),2&i&&e.Y8G("ardnDataTestId","ardn-order-map-modal")}let zp=(()=>{class i{constructor(t,n,r,o,u,g,A,N,w,te,ne,de,Fe,Le,it,we,$e,Wt,Qi,Ji,Zi,qh,em,tm,nm,rm,im,om,sm,am,dm,lm){this.platformId=t,this.config=n,this.store=r,this.route=o,this.stepManagerService=u,this.router=g,this.formBuilder=A,this.postcodeAvailabilityValidatorService=N,this.changeDetector=w,this.addressBookService=te,this.partnerProgramService=ne,this.orderValidationService=de,this.modalManagerService=Fe,this.scrollService=Le,this.memorizeService=it,this.orderRestorationService=we,this.eCommerceConverterService=$e,this.googleAnalyticsService=Wt,this.orderReturnService=Qi,this.currencyService=Ji,this.orderOutDtoMapperService=Zi,this.customRequiredFieldsService=qh,this.productFilterService=em,this.orderCustomsService=tm,this.cartService=nm,this.orderService=rm,this.snackbarService=im,this.translateService=om,this.incompleteUserDataService=sm,this.dialogService=am,this.userService=dm,this.editAccountDialogService=lm,this.isPostOrderLoading=!1,this.currentStep=1,this.isProductsLoaded=!1,this.unsubscribeObservable=new re.B,this.orderOptionsValidityChange$=new re.B,this.cancelProductRestore$=new re.B,this.wasTemplatePrompted=!1,this.cartOrderId=null,this.templateRestoreStorageKey=S.y,this.isPlatformBrowser=(0,l.UE)(this.platformId)}ngOnInit(){this.incompleteUserDataService.showOnShipmentStart(this.unsubscribeOb
1servable),this.restoreTemplateFromNuxt(),this.cartService.pendingRestore$.pipe((0,U.p)(t=>!!t),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{const n=this.cartService.getOrderById(t);if(this.cartService.clearPendingRestoreId(),!n)return;const{order:r}=n;this.cancelProductRestore$.next(),this.store.dispatch(F.M.createResetOrderStateAction()),this.store.dispatch(Ge.G.createResetUIOrderStepsAction()),this.store.dispatch(me.U.createResetSearchParamsAction()),this.cartService.clearLoadedOrderId(),this.cartService.isOrderInProgress$.next(!1),(0,$l.O)(0).pipe((0,De.n)(()=>this.store.select(ue.vD).pipe((0,U.p)(o=>!o?.length),(0,M.s)(1))),(0,B.Q)(this.unsubscribeObservable)).subscribe(()=>{this.cartOrderId=t,this.cartService.setLoadedOrderId(t),this.cartService.isOrderInProgress$.next(!0),this.store.dispatch(F.M.createSetOrderRestoration(!0)),this.restorePendingOrder({step:5,searchParams:{width:r.shipment.width,height:r.shipment.height,length:r.shipment.length,weight:r.shipment.weight,quantity:r.shipment.quantity,senderCountryId:r.shipment.senderCountryId,receiverCountryId:r.shipment.receiverCountryId,senderPostCode:r.senderAddress?.postCode,receiverPostCode:r.receiverAddress?.postCode},selectedProductId:r.selectedProduct?.id,userAddress:r.userAddress,senderAddress:r.senderAddress,receiverAddress:r.receiverAddress,orderState:r})})}),this.currencyService.getCurrencyObservable().subscribe(t=>{this.selectedCurrency=t}),this.store.select(ue.Cr).pipe((0,U.p)(t=>!!t),(0,j.F)(E()),(0,U.p)(t=>!!t?.params&&!!t?.selectedProduct)).subscribe(t=>{this.store.dispatch(F.M.createInitOrderAction(t)),this.cartService.isOrderInProgress$.next(!0)}),this.store.select(T.PE).pipe((0,U.p)(t=>!!t),(0,M.s)(1)).subscribe(t=>{if(t.inOrderRestoration&&this.orderRestorationService.hasStoredCookie){const n=this.orderRestorationService.getStoredStateFromCookie();n&&this.restorePendingOrder(n)}}),this.store.select(J.tB).pipe((0,U.p)(t=>!!t),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{t?.salesMargin&&this.store.dispatch(F.M.setSaleMarginAction(0))}),this.store.select(T.PE).pipe((0,U.p)(t=>!!t?.shipment),(0,j.F)(E()),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.selectedProduct=t.selectedProduct,this.orderState=t,this.paramsForAddons={productId:t.shipment.productId,width:t.shipment.width,height:t.shipment.height,length:t.shipment.length,weight:t.shipment.weight,quantity:t.shipment.quantity,senderCountryId:t.shipment.senderCountryId,receiverCountryId:t.shipment?.receiverCountryId,senderCity:t?.senderAddress?.city,receiverCity:t?.receiverAddress?.city,senderPostCode:t.senderAddress.postCode,receiverPostCode:t.receiverAddress.postCode,content:t.shipment.content,orderHash:t?.hash},this.changeDetector.markForCheck()}),this.store.select(T.C4).pipe((0,U.p)(t=>!!t),(0,j.F)((t,n)=>t.id===n.id),(0,B.Q)(this.unsubscribeObservable)).subscribe(()=>{this.isProductSet()&&setTimeout(()=>{this.dispatchNextStepAction(1)},0),this.changeDetector.markForCheck()}),this.store.select(T.cu).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{Object.values(t).filter(n=>!n).length||(("PAID_PICKUP"===t.collectionType||"ORDERED_COURIER"===t.collectionType)&&(t.collectionType="PICKUP"),this.store.dispatch(F.M.createGetCustomRequiredFieldsAction(t)))}),this.store.select(pe.PX).pipe((0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{this.stepsState=t,this.changeDetector.markForCheck()}),this.store.select(mt.br).pipe((0,j.F)(E()),(0,B.Q)(this.unsubscribeObservable)).subscribe(t=>{"Ariadna"===this.orderState?.originId&&t?.receiverAddress&&(this.draftReceiverAddressState=t.receiverAddress)}),this.partnerProgramService.getPartnerProgramNumber()&&this.store.dispatch(F.M.createSetPartnerProgramNumberAction(this.partnerProgramService.getPartnerProgramNumber())),this.store.select(ue.rh).pipe((0,U.p)(t=>"LOADED"===t.loading&&!!t.results),(0,j.F)(E()),(0,B.Q)(this.unsubscribeObservable)).subscribe(()=>{this.isProductsLoaded=!0,this.scrollToProductList()}),this.continueDuringOrderReturn()}restoreTemplateFromNuxt(){if(!this.isPlatformBrowser||"1"!==this.route.snapshot.queryParamMap.get("restoreTemplate"))return;const t=this.getTemplateRestoreFromStorage();if(t)return this.applyTemplateRestore(t),void this.clearTemplateRestoreQueryParam();this.orderRestorationService.hasStoredCookie&&this.store.dispatch(F.M.createSetOrderRestoration(!0)),this.clearTemplateRestoreQueryParam()}getTemplateRestoreFromStorage(){const t=window.localStorage.getItem(this.templateRestoreStorageKey);if(!t)return null;window.localStorage.removeItem(this.templateRestoreStorageKey);try{return this.normalizeTemplateRestore(JSON.parse(t))}catch{return null}}normalizeTemplateRestore(t){if(!t||"object"!=typeof t)return null;const n=t,r=this.normalizeTemplateNumber(n.id),o=this.normalizeTemplateNumber(n.productId),u=this.normalizeTemplateNumber(n.length),g=this.normalizeTemplateNumber(n.width),A=this.normalizeTemplateNumber(n.height),N=this.normalizeTemplateNumber(n.weight),w=this.normalizeTemplateNumber(n.quantity),te=this.normalizeTemplateNumber(n.senderCountryId),ne=this.normalizeTemplateNumber(n.receiverCountryId);return null===r||null===o||null===u||null===g||null===A||null===N||null===w||null===te||null===ne?null:{...n,content:String(n.content??""),created:this.normalizeTemplateDate(n.created),height:A,id:r,length:u,name:String(n.name??""),productId:o,productName:String(n.productName??""),carrierName:n.carrierName??null,isActive:n.isActive??!0,outdatedReason:n.outdatedReason??null,isHidden:n.isHidden??!1,quantity:w,receiverAddress:this.normalizeTemplateAddress(n.receiverAddress,ne),receiverCountryId:ne,senderAddress:this.normalizeTemplateAddress(n.senderAddress,te),senderCountryId:te,weight:N,width:g}}normalizeTemplateNumber(t){const n="number"==typeof t?t:Number.parseFloat(String(t??""));return Number.isFinite(n)?n:null}normalizeTemplateDate(t){const n=t?new Date(t):null;return n&&!Number.isNaN(n.getTime())?n:new Date}normalizeTemplateAddress(t,n){if(!t||"object"!=typeof t)return null;const r={...t,countryId:t.countryId??n};return r.mail&&!r.email&&(r.email=r.mail),delete r.mail,r}applyTemplateRestore(t){const n={height:t.height,length:t.length,quantity:t.quantity,receiverCountryId:t.receiverCountryId,senderCountryId:t.senderCountryId,weight:t.weight,width:t.width};this.store.dispatch(me.U.createResetLoadedProductsAction()),this.store.dispatch(me.U.createSetSearchParamsAction(n)),this.store.dispatch(F.M.createUpdateReceiverAddressAction(t.receiverAddress??null)),this.store.dispatch(me.U.createSetTemplateAction(t))}clearTemplateRestoreQueryParam(){this.router.navigate([],{queryParams:{restoreTemplate:null},queryParamsHandling:"merge",relativeTo:this.route,replaceUrl:!0})}restorePendingOrder(t){switch(t?.step){case 1:this.restoreSearchParamsAndSelectedProduct(t);break;case 2:this.restoreSearchParamsAndSelectedProduct(t),this.restoreUserAddressAndAgreements(t.userAddress,t.userAgreements);break;case 3:this.restoreSearchParamsAndSelectedProduct(t),this.orderRestorationService.checkLoggedInState()||this.restoreUserAddressAndAgreements(t.userAddress,t.userAgreements),this.restoreOrderAddresses(t.senderAddress,t.receiverAddress);break;case 5:this.restoreSearchParamsAndSelectedProduct(t),this.orderRestorationService.checkLoggedInState()||this.restoreUserAddressAndAgreements(t.userAddress,t.userAgreements),this.restoreOrderAddresses(t.senderAddress,t.receiverAddress),this.restoreShipmentOptions(t.orderState);break;default:throw this.orderRestorationService.removeOrderStateCookie(),this.router.navigateByUrl("/"),Error("Order restoration prompted but restoration cookie invalid. Order restoration aborted.")}}restoreSearchParamsAndSelectedProduct(t){this.restoreSearchParams(t.searchParams),this.restoreSelectedProduct(t.selectedProductId,t.searchParams)}restoreUserAddressAndAgreements(t,n){this.store.select(T.qE).pipe((0,U.p)(r=>!!r),(0,M.s)(1),(0,ce.B)(100)).subscribe(r=>{r&&(this.secondStepComponent?.userAddressFormComponent?.addressDataForm.patchValue(t),this.secondStepComponent?.userAgreementsForm.patchValue(n))})}restoreSelectedProduct(t,n){(0,q.z)([this.store.select(ue.vD).pipe((0,U.p)(r=>r?.length>0)),this.store.select(T.AE)]).pipe((0,U.p)(([,r])=>r),(0,M.s)(1),(0,B.Q)((0,Gi.h)(this.cancelProductRestore$,this.unsubscribeOb
1servable))).subscribe(([r])=>{const o=r.find(u=>u.id===t);this.store.dispatch(me.U.createSetProductAction(o)),this.orderCustomsService.setOrderCustomConfig({senderCountry:n?.senderCountryId,receiverCountry:n?.receiverCountryId,name:o?.carrierName}),this.customRequiredFieldsService.getCustomRequiredFields({productId:o?.id,senderCountryId:n?.senderCountryId,receiverCountryId:n?.receiverCountryId,collectionType:o?.collectionTypes[0]}).pipe((0,M.s)(1)).subscribe({next:u=>{this.store.dispatch(me.U.createSetProductAction(this.productFilterService.convertProductToProductModelInterface(o,u)))},error:()=>{this.store.dispatch(me.U.createSetProductAction(this.productFilterService.convertProductToProductModelInterface(o)))}}),this.store.dispatch(F.M.resetSetOrderRestoration())})}restoreSearchParams(t){this.store.dispatch(me.U.createSetSearchParamsAction(t)),t.productId&&delete t.productId,(0,l.UE)(this.platformId)&&this.store.dispatch(me.U.createGetProductsAction(t))}restoreOrderAddresses(t,n){this.store.select(pe.PX).pipe((0,U.p)(r=>"ACTIVE"===r[2]?.state&&r[2]?.isExpanded),(0,ce.B)(300),(0,M.s)(1),(0,B.Q)(this.unsubscribeObservable)).subscribe(()=>{this.thirdStepComponent.receiverAddressComponent.addressDataForm.patchValue(n),this.thirdStepComponent.senderAddressComponent.addressDataForm.patchValue(t)})}getMemorizedContent(){if(!this.isPlatformBrowser)return"";const t=localStorage?.getItem(K.B);if(!t)return"";const n=JSON.parse(t);return n?.canonical??(n?.text||n?.label)??""}restoreShipmentOptions(t){this.store.select(pe.PX).pipe((0,U.p)(n=>"ACTIVE"===n[1]?.state),(0,M.s)(1),(0,B.Q)(this.unsubscribeObservable)).subscribe(()=>{this.store.dispatch(F.M.createSetOrderCustoms(t.customs)),this.store.dispatch(F.M.createSetOrderIsImporter(t.isImporter??null)),this.store.dispatch(F.M.createSetShipmentOptionsAction({collectionType:t.shipment.collectionType,content:t.shipment.content,purpose:t.shipment.purpose,instructions:t.shipment.instructions,referenceNumber:t.shipment.referenceNumber,pickUpDate:t.shipment.pickUpDate?new Date(t.shipment.pickUpDate):null,pickUpTimeFrom:t.shipment.pickUpTimeFrom,pickUpTimeTo:t.shipment.pickUpTimeTo,addons:t.shipment.addons,senderPoint:t.shipment.senderPoint,receiverPoint:t.shipment.receiverPoint})),this.store.select(pe.PX).pipe((0,U.p)(n=>"ACTIVE"===n[2]?.state),(0,ce.B)(500),(0,M.s)(1),(0,B.Q)(this.unsubscribeObservable)).subscribe(()=>{this.store.dispatch(F.M.createResetShipmentTempAction());const n=t.shipment.addons?.find(r=>"NOT_STANDARD"===r.category);this.orderService.cachedShipmentType.next(n?n.id:-1),this.store.dispatch(F.M.createGetProductAddonsAction({productId:t.shipment.productId,width:t.shipment.width,height:t.shipment.height,length:t.shipment.length,weight:t.shipment.weight,quantity:t.shipment.quantity,senderCountryId:t.shipment.senderCountryId,receiverCountryId:t.shipment.receiverCountryId,senderCity:t.senderAddress?.city,receiverCity:t.receiverAddress?.city,senderPostCode:t.senderAddress?.postCode,receiverPostCode:t.receiverAddress?.postCode,content:t.shipment.content,orderHash:t.hash})),this.dispatchNextStepAction(3),this.store.select(T.Ak).pipe((0,U.p)(r=>!!r),(0,M.s)(1),(0,De.n)(()=>this.isOrderOptionsValid?(0,ve.of)(!0):this.orderOptionsValidityChange$.pipe((0,U.p)(r=>r),(0,M.s)(1))),(0,B.Q)(this.unsubscribeObservable)).subscribe(()=>{this.dispatchNextStepAction(4)})})})}productSelected(){this.dispatchNextStepAction(1)}ngAfterViewInit(){this.shipmentForm=this.formBuilder.group({pickUpDate:[null,m.k0.required]}),this.stepManagerService.setStepsPositions(this.stepsComponents)}getStep(t){const n={index:t,isExpanded:!1,isToggleable:!1,state:"DISABLED"};return this.stepsState?this.stepsState.find(r=>t===r.index):n}isProductSet(){return!!this.selectedProduct}isPackageInMotion(){return["Orlen Paczka","Poczta Polska"].some(n=>n===this.selectedProduct?.carrierName)?[!0,this.selectedProduct?.carrierName]:[!1,""]}toggleStep(t){const n=this.getStep(t);n?.isToggleable&&"DISABLED"!==n?.state&&this.store.dispatch(Ge.G.createToggleExpansionOrderStepAction(t))}changeProduct(){if(_e.c.production){const t=this.getSelectedProductECommerceModel();this.googleAnalyticsService.sendRemoveFromCartEvent(t),this.googleAnalyticsService.pushECommerceChangeProduct()}this.store.dispatch(F.M.resetMapModalShipmentParametersAction()),this.store.dispatch(F.M.createResetStateIdAction()),this.store.dispatch(F.M.createResetOrderWithoutSearchAndAddressesAction()),this.wasTemplatePrompted=this.checkIfCurrentOrderWasPromptedFromTemplate(),this.wasTemplatePrompted||this.store.dispatch(me.U.createSetTemplateAction(null)),this.store.dispatch(me.U.createSetProductAction(null)),this.store.dispatch(me.U.createSetSearchParamsAction({productId:null})),this.store.dispatch(F.M.createResetProductAction()),this.store.dispatch(Ge.G.createResetUIOrderStepsAction()),this.orderCustomsService.clearOrderCustomConfig(),this.changeDetector.markForCheck()}getSelectedProductECommerceModel(){let t;return this.store.select(T.C4).pipe((0,M.s)(1)).subscribe(n=>{t=this.eCommerceConverterService.convertProductToECommerceProduct(n)}),t}checkIfCurrentOrderWasPromptedFromTemplate(){let t;return this.store.select(ue.KN).pipe((0,M.s)(1)).subscribe(n=>{t=n}),t}handleValidityOfUserAddressForm(t){this.changeStepToggleOnChange(this.isOrderAddressValid,t,2)}handleOrderAddressesValidity(t){this.thirdStepComponent.dispatchData(),this.changeStepToggleOnChange(this.isOrderAddressValid,t,3),this.isOrderAddressValid=t,this.changeDetector.markForCheck()}handleOrderOptionsValidity(t){this.fourthStepComponent?.dispatchData(),this.changeStepToggleOnChange(this.isOrderOptionsValid,t,4),this.isOrderOptionsValid=t,this.orderOptionsValidityChange$.next(t),this.changeDetector.markForCheck()}handleOrderPaymentValidity(t){(0,q.z)([this.store.select(T.Z),this.store.select(T.DO)]).subscribe(([n,r])=>{n&&this.store.dispatch(t?Ge.G.createCompleteOrderStepAction(5):Ge.G.createActivateOrderStepAction(5)),t=!!n,(n?.id===Me.O.ONLINE||n?.id===Me.O.DEFERRED_ONLINE_PAYMENT)&&(t=!!r),this.changeStepToggleOnChange(this.isOrderOptionsValid,t,5),this.isOrderPaymentValid=t,this.changeDetector.detectChanges()})}handleOrderAgreementsValidity(t){this.isAgreementsValid=t,this.changeDetector.detectChanges()}validateThirdStep(){this.thirdStepComponent.validate(),this.isOrderAddressValid&&this.validateThirdStepApi(()=>{})}continueToThirdStep(){this.dispatchNextStepAction(2),"Ariadna"===this.orderState?.originId&&this.draftReceiverAddressState&&this.thirdStepComponent.selectOrderReceiverAddress(this.draftReceiverAddressState),this.store.dispatch(F.M.createResetShipmentTempAction()),this.store.dispatch(F.M.createResetTemporaryAddressesAction())}continueToFourthStep(){this.validateThirdStepApi(()=>{this.validateThirdStepOnFront()}),this.checkIfThereAreMemorizedAddressesInStore()||(this.store.dispatch(F.M.createSetSenderAddressTempAction()),this.store.dispatch(F.M.createSetReceiverAddressTempAction()))}checkIfThereAreMemorizedAddressesInStore(){let t=!1;return this.store.select(T.PE).pipe((0,M.s)(1)).subscribe(n=>{t=!!n.receiverAddressTemp&&!!n.senderAddressTemp}),t}
1validateThirdStepApi(t=null){this.thirdStepComponent.dispatchData(),this.store.select(T.VK).pipe((0,M.s)(1)).subscribe(n=>{const r={shipment:n?this.orderOutDtoMapperService.mapShipment(n):null,senderAddress:this.prepareAddress(this.orderState.senderAddress),receiverAddress:this.prepareAddress(this.orderState.receiverAddress)};this.orderAddressVerificationLoading=!0,this.thirdStepComponent.clearValidationErrors(),this.orderValidationService.validate({...r}).pipe((0,M.s)(1)).subscribe({next:()=>{this.orderAddressVerificationLoading=!1,this.changeDetector.markForCheck(),"function"==typeof t&&t()},error:o=>{const u=L()(o.fields,(A,N)=>N.match(/^senderAddress/)),g=L()(o.fields,(A,N)=>N.match(/^receiverAddress/));Object.entries(u).length>0?this.scrollToInvalidField(u,"sender"):Object.entries(g).length>0&&this.scrollToInvalidField(g,"receiver"),this.orderAddressVerificationLoading=!1,this.changeDetector.markForCheck(),this.dispatchThirdStepValidationErrors(o)}})})}scrollToInvalidField(t,n){Object.entries(t).forEach(([r])=>{const o=this.thirdStepComponent.getFormGroupFields().find(u=>r.includes(u));o&&this.scrollService.scrollToFieldId(o+"-third-step-"+n)})}prepareAddress(t){if(t)return{apartmentNumber:t.apartmentNumber?t.apartmentNumber:void 0,city:t.city?t.city:void 0,contactPerson:t.contactPerson?t.contactPerson:void 0,contactPhone:t.contactPhone?t.contactPhone:void 0,email:t.email?t.email:void 0,houseNumber:t.houseNumber?t.houseNumber:void 0,name:t.name?t.name:void 0,nip:t.nip?t.nip:void 0,phone:t.phone?t.phone:void 0,postCode:t.postCode?t.postCode:void 0,street:t.street?t.street:void 0,stateId:t.stateId?t.stateId:void 0,countryId:t.countryId?t.countryId:void 0}}validateThirdStepOnFront(){const t=this.postcodeAvailabilityValidatorService.validate(this.paramsForAddons),n=this.addressBookService.saveContacts(this.mapAddressDataFromThirdStep()),r=this.thirdStepComponent.isContactToAdd()?(0,Gi.h)(t,
1n):t;this.updateAddressBooks(),this.orderAddressVerificationLoading=!0,this.thirdStepComponent.clearValidationErrors(),r.pipe((0,M.s)(1)).subscribe({next:()=>{this.dispatchThirdStepSuccess(),this.savePendingOrderState()},error:o=>{this.dispatchThirdStepValidationErrors(o),this.isOrderAddressValid||this.thirdStepComponent.validate()}})}savePendingOrderState(){const t=this.store.select(T.PE).pipe((0,U.p)(r=>!!r),(0,M.s)(1)),n=this.orderRestorationService.getStoredStateFromCookie();t.subscribe(r=>{const o=this.mapOrderStateValuesToPendingOrderModel(r);this.orderRestorationService.setOrderStateCookie({...n,...o})})}mapOrderStateValuesToPendingOrderModel(t){return{userAddress:t.userAddress,receiverAddress:t.receiverAddress,senderAddress:t.senderAddress,selectedProductId:t.selectedProduct.id,loggedIn:this.orderRestorationService.checkLoggedInState(),step:3}}mapAddressDataFromThirdStep(){const t=[];if(this.thirdStepComponent.saveSender){const n=this.thirdStepComponent.adjustPhoneNumber(this.thirdStepComponent.senderAddress);t.push({name:n.name,email:n.email,street:n.street,houseNumber:n.houseNumber,apartmentNumber:n.apartmentNumber,postCode:n.postCode,city:n.city,contactPerson:n.contactPerson,phone:n.phone,countryId:n.countryId,type:"SENDER"})}if(this.thirdStepComponent.saveReceiver){const n=this.thirdStepComponent.adjustPhoneNumber(this.thirdStepComponent.receiverAddress);t.push({name:n.name,email:n.email,street:n.street,houseNumber:n.houseNumber,apartmentNumber:n.apartmentNumber,postCode:n.postCode,city:n.city,contactPerson:n.contactPerson,phone:n.phone,countryId:n.countryId,type:"RECEIVER"})}return t}dispatchThirdStepSuccess(){this.thirdStepComponent.dispatchData(),this.store.dispatch(F.M.createGetProductAddonsAction({...this.paramsForAddons,content:this.paramsForAddons.content||this.getMemorizedContent()})),this.dispatchNextStepAction(3),this.store.dispatch(F.M.createValidateOrderFailedAction(null)),this.orderAddressVerificationLoading=!1,this.store.dispatch(F.M.resetMapModalShipmentParametersAction()),this.memorizeService.allowSetMemorizedData(!0)}dispatchThirdStepValidationErrors(t){this.store.dispatch(F.M.createValidateOrderFailedAction(t)),this.isOrderAddressValid=!1,this.orderAddressVerificationLoading=!1}validateFourthStepApi(t=null){if(this.fourthStepComponent?.dispatchData(),!1===this.fourthStepComponent.checkCorrectionsData())return void this.scroll("header-shipment-options-step");const n=this.orderState.shipment,r={content:n.content,pickup:this.preparePickup(n),collectionType:n.collectionType,referenceNumber:n.referenceNumber?n.referenceNumber:void 0,addons:this.prepareAddons(n.addons)},o=this.orderCustomsService.buildCustomsPayload(this.orderState?.customs,this.orderState?.selectedProduct?.addons);o&&(r.customs=o),this.shipmentStepVerificationLoading=!0,this.fourthStepComponent.clearValidationErrors(),this.orderValidationService.validate({...r}).pipe((0,M.s)(1)).subscribe({next:()=>{this.shipmentStepVerificationLoading=!1,this.changeDetector.markForCheck(),"function"==typeof t&&t()},error:u=>{this.scroll("header-shipment-options-step");const g=this.orderState.shipment.addons,A=ne=>!!ne.match(/^addons\[(\d+)]/),N=L()(u.fields,(ne,de)=>A(de));let w=Ie()(u.fields,(ne,de)=>A(de));w=this.replaceKey(w,"pickup[timeFrom]","pickup[date]"),w=this.replaceKey(w,"pickup[timeTo]","pickup[date]");const te={fields:{...w,addons:this.mapAddonsErrors(this.replaceKey(N,"id","value"),g)}};this.fourthStepComponent.checkCorrectionsData(),this.dispatchFourthStepValidationErrors(te)}})}validateFourthStep(){this.fourthStepComponent.validate(),this.isOrderOptionsValid&&this.validateFourthStepApi(()=>{})}continueToFifthStep(){this.store.dispatch(F.M.resetMapModalShipmentParametersAction()),this.validateFourthStepApi(()=>{this.store.dispatch(F.M.createValidateOrderFailedAction({})),this.shipmentStepVerificationLoading=!1,this.store.dispatch(F.M.createSetShipmentTempAction()),this.dispatchNextStepAction(4),this.memorizeService.allowSetMemorizedData(!1)})}addOrderToCart(){this.store.select(T.PE).pipe((0,M.s)(1)).subscribe(t=>{this.cartOrderId||(this.cartOrderId=crypto.randomUUID());const n=this.cartService.upsertOrder(this.cartOrderId,t);n&&(this.cartService.setLoadedOrderId(this.cartOrderId),this.snackbarService.open(this.translateService.instant(n===lc.E.UPDATED?"MENU.CART.UPDATED":"MENU.CART.ADDED"),{duration:4e3}))})}preparePickup(t){if(t&&"PICKUP"===t.collectionType)return{date:t.pickUpDate?t.pickUpDate.toISOString()?.split("T")[0]:void 0,timeFrom:t.pickUpTimeFrom?t.pickUpTimeFrom:void 0,timeTo:t.pickUpTimeTo?t.pickUpTimeTo:void 0}}prepareAddons(t){if(t&&0!==t.length)return t.map(n=>{let r={...n};if(r){for(const o in r)o&&(r[o]||(r[o]=void 0),"description"===o&&(r[o]=void 0),"options"===o&&r[o]&&(r={...r,...this.prepareAddonOptions(r[o],"CASH_ON_DELIVERY"===r.category),options:void 0}));"CASH_ON_DELIVERY"!==r.category&&"INSURANCE"!==r.category&&!r.category.startsWith("INSURANCE_")&&delete r?.value,r?.fields&&(r.fields=Ie()(n.fields,o=>null===o))}return r})}replaceKey(t,n,r){if(t&&n&&r)return ae()(t,(o,u)=>u.replace(n,r))}prepareAddonOptions(t,n=!1){return n?{value:t.value?t.value:"",bankAccountNumber:t.bankAccountNumber?t.bankAccountNumber:"",swiftCode:t.swiftCode?t.swiftCode:"",name:t.name?t.name:"",addressLine1:t.addressLine1?t.addressLine1:"",addressLine2:t.addressLine2?t.addressLine2:void 0}:t}
1mapAddonsErrors(t,n){return Object.entries(t).map(([r,o])=>({...this.getErrorDetails(r,n),message:o}))}getErrorDetails(t,n){const r=t.match(/^addons\[(\d+)]\[(.+)]/),o=r?.[1];return{addonId:n?.[o]?.id,fieldName:r?.[2]}}dispatchFourthStepValidationErrors(t){this.store.dispatch(F.M.createValidateOrderFailedAction(t)),this.isOrderOptionsValid=!1,this.shipmentStepVerificationLoading=!1}changeStepToggleOnChange(t,n,r){this.currentStep>r&&(this.currentStep=r,this.store.dispatch(Ge.G.createDisableNextStepsActions(r))),t!==n&&"DISABLED"!==this.stepsState.find(o=>o.index===r).state&&this.store.dispatch(n?Ge.G.createCompleteOrderStepAction(r):Ge.G.createActivateOrderStepAction(r))}dispatchNextStepAction(t){this.currentStep=t+1,this.store.dispatch(Ge.G.createGoToNextOrderStepAction({currentStep:t}))}continueDuringOrderReturn(){this.store.select(ct.J).pipe((0,U.p)(t=>t?.ui?.pages?.order?.steps[2]?.isExpanded&&"ACTIVE"===t?.ui?.pages?.order?.steps[2]?.state&&!0===t?.order?.orderReturnStatus?.loaded),(0,ce.B)(300),(0,M.s)(1),(0,B.Q)(this.unsubscribeObservable)).subscribe({next:()=>{this.isOrderAddressValid&&3===this.currentStep?this.continueToFourthStep():this.validateThirdStep()},error:()=>{this.orderReturnService.stopGeneratingOrderReturn()}})}saveOrder(){this.isPostOrderLoading=!0,this.store.select(T.PE).pipe((0,M.s)(1),(0,Nl.c)(500)).subscribe(t=>{t?.payment?.selectedOption?.custom&&(t.payment.selectedOption.id=t.payment.selectedOption.originPaymentId),this.store.dispatch(F.M.createPostOrderAction(t))}),this.store.select(T.PE).pipe((0,U.p)(t=>!!t?.createdOrder&&!!t?.userAddress),(0,v.Lt)(t=>t.userAddress),(0,M.s)(1)).subscribe(t=>{this.isPostOrderLoading=!1,this.cartService.removeOrder(this.cartOrderId);const n=t,r="/order/success"+(n?"-"+n?.type?.toLowerCase():"");this.router.navigateByUrl(r)}),(0,Gi.h)(this.store.select(T.zq),this.store.select(T.wn),this.store.select(T.Xx)).pipe((0,U.p)(t=>!0===t||"boolean"!=typeof t&&null!==t&&Object.values(t).length>0),(0,M.s)(1)).subscribe(t=>{this.isPostOrderLoading=!1,t&&t?.addons&&this.scrollToStepFourId("insuranceValue"),t&&t.declaredValue&&this.scrollToStepFourId("declaredValue-fourth-step")}),this.store.dispatch(F.M.createResetShipmentTempAction())}scrollToStepFourId(t){this.store.dispatch(Ge.G.createToggleExpansionOrderStepAction(4)),setTimeout(()=>{this.scroll(t)},400)}scroll(t){document.getElementById(t)?.scrollIntoView({behavior:"smooth",block:"center"})}showPaymentModal(){this.modalManagerService.open("modal-order-map")}ngOnDestroy(){this.store.dispatch(Ge.G.createResetUIOrderStepsAction()),this.wasTemplatePrompted&&this.store.dispatch(F.M.createResetOrderStateAction()),this.cartService.clearLoadedOrderId(),this.cartService.isOrderInProgress$.next(!1),this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}goToThirdStep(){this.secondStepComponent.isLoggedAsNotFullRegisteredUser()?this.secondStepComponent.addressFormValid&&2===this.secondStepComponent.currentStep()&&this.secondStepComponent.storeUserData():this.secondStepComponent.isLoggedIn()?this.secondStepComponent.isLoggedAsFullRegisteredUser()&&2===this.currentStep&&this.continueToThirdStep():this.secondStepComponent.addressFormValid&&this.secondStepComponent.agreementFormValid&&2===this.currentStep?(this.secondStepComponent.storeUserData(),this.continueToThirdStep()):this.secondStepComponent.validate()}isShowChangeSenderData(){return this.currentStep>=2&&this.secondStepComponent.isLoggedAsFullRegisteredUser()}openEditAccountDialog(){this.store.select(J.tB).pipe((0,U.p)(t=>!!t),(0,M.s)(1)).subscribe(t=>{this.editAccountDialogService.open({width:"60%",minWidth:"720px",data:t}).afterClosed$.pipe((0,M.s)(1),(0,U.p)(n=>!0===n),(0,De.n)(()=>this.userService.getProfile())).subscribe(n=>{this.store.dispatch(Li.v.createSetUserDataAction(n)),this.secondStepComponent?.refreshUserAddressDataFromProfile()})})}scrollToPaymentTiles(){this.scrollService.scrollToFieldId("payment-options-fifth-step","start")}scrollToProductList(){setTimeout(()=>{this.scrollService.scrollToFieldId("all-offers","nearest")})}updateAddressBooks(){this.updateAddressBook(this.thirdStepComponent?.selectedSenderAddressBook,this.thirdStepComponent.adjustPhoneNumber(this.thirdStepComponent.senderAddress),"SENDER").subscribe(()=>{this.thirdStepComponent.selectedSenderAddressBook=null}),this.updateAddressBook(this.thirdStepComponent?.selectedReceiverAddressBook,this.thirdStepComponent.adjustPhoneNumber(this.thirdStepComponent.receiverAddress),"RECEIVER").subscribe(()=>{this.thirdStepComponent.selectedReceiverAddressBook=null})}updateAddressBook(t,n,r){if(t&&this.isOnlyCityChanged(oc(t,(0,En.A)(n)),n)){let o=n;return o=Ie()(o,ac),o=(0,dc.A)(o,["stateId","readonlyPostCode","contactPhone","isFreightForward","nip"]),this.addressBookService.updateContacts([{...o,id:t.id}],r)}return(0,ve.of)([])}isOnlyCityChanged(t,n){const r=Object.keys(t).filter(o=>t[o]!==n[o]);return 1===r.length&&"city"===r[0]}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(e.Agw),e.rXU(Ae.vQ),e.rXU(v.il),e.rXU(b.nX),e.rXU(vo),e.rXU(b.Ix),e.rXU(m.ok),e.rXU(Ro),e.rXU(e.gRc),e.rXU(To.h),e.rXU(cc.G),e.rXU(Gn),e.rXU(Ni.q),e.rXU(nt.b),e.rXU(xi),e.rXU(wi.A),e.rXU(Xi.C),e.rXU(Yi.p),e.rXU(Ui.M),e.rXU(Vn.P),e.rXU(Wi.o),e.rXU(ft.P),e.rXU(uc.$),e.rXU(Pt.I),e.rXU(pc.m),e.rXU(K.Q),e.rXU(fo.z),e.rXU(f.c$),e.rXU(hc.X),e.rXU(mc.o),e.rXU(Vi.D),e.rXU(gc.h))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-page"]],viewQuery:function(n,r){if(1&n&&(e.GBs(ln,7),e.GBs(Oo,5),e.GBs(Bi,5),e.GBs(So,5,e.aKT)),2&n){let o;e.mGM(o=e.lsd())&&(r.thirdStepComponent=o.first),e.mGM(o=e.lsd())&&(r.fourthStepComponent=o.first),e.mGM(o=e.lsd())&&(r.secondStepComponent=o.first),e.mGM(o=e.lsd())&&(r.stepsComponents=o)}},decls:60,vars:90,consts:[[1,"section","section--light","section--border"],[1,"wrap","section__wrap"],[3,"state","isExpanded","ardnDataTestId"],[1,"header-first-step",3,"ngClass","step","steps","isToggleable"],[1,"order-step__title","h2"],[1,"order-step__info"],[3,"id","state","isExpanded","ardnDataTestId"],[3,"click","
1step","steps","isToggleable"],[1,"link","link--gray","link--no-anim","change-data"],[1,"description",3,"ngClass"],[3,"validityChanged","continue","currentStep","ardnDataTestId"],[3,"click","state","isExpanded","ardnDataTestId"],["id","header-order-step",3,"click","step","steps","isToggleable"],[3,"validityChanged","ardnDataTestId"],[1,"row","row--center","row--small-gutter","space","align-center-mobile","relative"],[1,"col","col-4","col-mobile-12",3,"ngClass"],["id","continueToFourthStep",1,"btn","btn--block","btn--primary",3,"ardnDataTestId"],[1,"btn","btn--disabled","btn--block",3,"ardnDataTestId"],["id","header-shipment-options-step",3,"click","step","steps","isToggleable"],[3,"isPackageInMotion","ardnDataTestId"],[1,"row","row--center","row--small-gutter","space","align-center-mobile"],[1,"col","col-4","col-mobile-12"],[1,"btn","btn--block","btn--primary",3,"disabled","ardnDataTestId"],[1,"btn","btn--block","btn--disabled",3,"ardnDataTestId"],["id","payment-options-fifth-step"],[3,"ardnDataTestId"],[1,"btn","btn--block","order-step__save-order",3,"click","disabled","ardnDataTestId"],[1,"invalid-payment-scroll"],[1,"summary-info",3,"innerHTML"],["modalId","modal-order-map",3,"ardnDataTestId"],[1,"offer__image"],[1,"v-align"],[1,"v-align__content"],[1,"product-name"],[1,"order-img"],[1,"order-step__img",3,"src","alt","ardnDataTestId"],[1,"order-step__price"],[1,"offer__price-big",3,"ardnDataTestId"],[1,"offer__price-small",3,"ardnDataTestId"],[1,"order-step__open"],[1,"link","link--gray","link--smaller","link--no-anim",3,"click","ardnDataTestId"],[1,"icon","icon-edit"],["href","assets/img/sprites.svg#icon-edit"],[3,"displayMore","ardnDataTestId"],[3,"productSelected","displayHeaderOnEmptyResult","currency","ardnDataTestId"],[1,"link","link--gray","link--no-anim","change-data",3,"click"],[1,"icon","icon-edit","change-data--icon"],["id","continueToFourthStep",1,"btn","btn--block","btn--primary",3,"click","ardnDataTestId"],[1,"loader"],[1,"btn","btn--disabled","btn--block",3,"click","ardnDataTestId"],[3,"validityChanged","isPackageInMotion","ardnDataTestId"],[1,"btn","btn--block","btn--primary",3,"click","disabled","ardnDataTestId"],[1,"btn","btn--block","btn--disabled",3,"click","ardnDataTestId"],[3,"addToCart","ardnDataTestId"],[3,"validityChanged"],[1,"invalid-payment-scroll",3,"click"],[1,"loader","loader--green"]],template:function(n,r){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"ardn-order-step",2)(3,"ardn-order-step-header",3)(4,"h2",4),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.DNE(7,vp,23,21,"div",5)(8,Ep,1,0,"ardn-preview-search-product"),e.k0s(),e.j41(9,"ardn-order-step-body"),e.DNE(10,bp,4,6,"div"),e.k0s()(),e.j41(11,"ardn-order-step",6)(12,"ardn-order-step-header",7),e.bIt("click",function(){return r.toggleStep(2)}),e.EFF(13),e.nI1(14,"translate"),e.DNE(15,Pp,5,3,"a",8),e.j41(16,"p",9),e.EFF(17),e.nI1(18,"translate"),e.k0s()(),e.j41(19,"ardn-order-step-body")(20,"ardn-order-user-data-step",10),e.bIt("validityChanged",function(u){return r.handleValidityOfUserAddressForm(u)})("continue",function(){return r.continueToThirdStep()}),e.k0s()()(),e.j41(21,"ardn-order-step",11),e.bIt("click",function(){return r.goToThirdStep()}),e.j41(22,"ardn-order-step-header",12),e.bIt("click",function(){return r.toggleStep(3)}),e.EFF(23),e.nI1(24,"translate"),e.k0s(),e.j41(25,"ardn-order-step-body")(26,"ardn-order-addresses-step",13),e.bIt("validityChanged",function(u){return r.handleOrderAddressesValidity(u)}),e.k0s(),e.j41(27,"div",14)(28,"div",15),e.DNE(29,Tp,3,3,"button",16)(30,Mp,3,3,"button",17)(31,Fp,3,4,"button",17),e.k0s()()()(),e.j41(32,"ardn-order-step",11),e.bIt("click",function(){return r.isOrderAddressValid&&3===r.currentStep?r.continueToFourthStep():r.isOrderAddressValid||3!==r.currentStep?null:r.validateThirdStep()}),e.j41(33,"ardn-order-step-header",18),e.bIt("click",function(){return r.toggleStep(4)}),e.EFF(34),e.nI1(35,"translate"),e.k0s(),e.j41(36,"ardn-order-step-body"),e.DNE(37,$p,1,2,"ardn-order-shipment-options-step",19),e.j41(38,"div",20)(39,"div",21),e.DNE(40,Vp,3,4,"button",22)(41,Gp,3,3,"button",23)(42,Lp,3,4,"button",23),e.k0s()()()(),e.j41(43,"ardn-order-step",11),e.bIt("click",function(){return r.isOrderOptionsValid&&r.isAgreementsValid&&4===r.currentStep?r.continueToFifthStep():!r.isOrderOptionsValid&&r.isAgreementsValid&&4===r.currentStep?r.validateFourthStep():null}),e.j41(44,"ardn-order-step-header",7),e.bIt("click",function(){return r.toggleStep(5)}),e.EFF(45),e.nI1(46,"translate"),e.k0s(),e.j41(47,"ardn-order-step-body"),e.nrm(48,"div",24),e.DNE(49,jp,1,1,"ardn-order-payment-step",25)(50,wp,1,1,"ardn-order-summary-step",25)(51,Bp,1,0,"ardn-order-agreements-step"),e.j41(52,"button",26),e.bIt("click",function(){return r.s
1aveOrder()}),e.DNE(53,Xp,1,0,"div",27)(54,Yp,5,3,"div")(55,Wp,3,3,"div"),e.k0s(),e.nrm(56,"p",28),e.nI1(57,"translate"),e.k0s()()()(),e.nrm(58,"ardn-order-template-applier",25),e.DNE(59,Hp,1,1,"ardn-order-map-modal",29)),2&n&&(e.R7$(2),e.Y8G("state",r.getStep(1).state)("isExpanded",r.getStep(1).isExpanded)("ardnDataTestId","ardn-order-step-"+r.getStep(1).index),e.R7$(),e.Y8G("ngClass",e.eq3(84,_p,r.isProductSet()))("step",r.getStep(1).index)("steps",null==r.stepsState?null:r.stepsState.length)("isToggleable",r.getStep(1).isToggleable),e.R7$(2),e.JRh(e.bMT(6,70,"ORDER_PAGE.CHOICE_OF_CARRIER")),e.R7$(2),e.vxM(r.isProductSet()?7:-1),e.R7$(),e.vxM(r.isProductSet()?8:-1),e.R7$(),e.AVh("hide",r.isProductSet()),e.R7$(),e.vxM(r.isProductSet()?-1:10),e.R7$(),e.Mz_("id","order-step-",r.getStep(2).index,""),e.Y8G("state",r.getStep(2).state)("isExpanded",r.getStep(2).isExpanded)("ardnDataTestId","ardn-order-step-"+r.getStep(2).index),e.R7$(),e.Y8G("step",r.getStep(2).index)("steps",null==r.stepsState?null:r.stepsState.length)("isToggleable",r.getStep(2).isToggleable),e.R7$(),e.SpI(" ",e.bMT(14,72,"ORDER_PAGE.YOUR_DATA")," "),e.R7$(2),e.vxM(r.isShowChangeSenderData()?15:-1),e.R7$(),e.Y8G("ngClass",e.eq3(86,Op,r.isShowChangeSenderData())),e.R7$(),e.SpI(" ",e.bMT(18,74,"ORDER_PAGE.YOUR_DATA_INFO")," "),e.R7$(3),e.Y8G("currentStep",r.currentStep)("ardnDataTestId","ardn-order-user-data-step"),e.R7$(),e.Y8G("state",r.getStep(3).state)("isExpanded",r.getStep(3).isExpanded)("ardnDataTestId","ardn-order-step-"+r.getStep(3).index),e.R7$(),e.Y8G("step",r.getStep(3).index)("steps",null==r.stepsState?null:r.stepsState.length)("isToggleable",r.getStep(3).isToggleable),e.R7$(),e.SpI(" ",e.bMT(24,76,"ORDER_PAGE.SENDER_AND_RECEIVER_DATA")," "),e.R7$(3),e.Y8G("ardnDataTestId","ardn-order-addresses-step"),e.R7$(2),e.Y8G("ngClass",e.eq3(88,yp,r.orderAddressVerificationLoading)),e.R7$(),e.vxM(r.isOrderAddressValid&&3===r.currentStep?29:-1),e.R7$(),e.vxM(r.isOrderAddressValid||3!==r.currentStep?-1:30),e.R7$(),e.vxM(3!==r.currentStep?31:-1),e.R7$(),e.Y8G("state",r.getStep(4).state)("isExpanded",r.getStep(4).isExpanded)("ardnDataTestId","ardn-order-step-"+r.getStep(4).index),e.R7$(),e.Y8G("step",r.getStep(4).index)("steps",null==r.stepsState?null:r.stepsState.length)("isToggleable",r.getStep(4).isToggleable),e.R7$(),e.SpI(" ",e.bMT(35,78,"ORDER_PAGE.ORDER_SETTINGS")," "),e.R7$(3),e.vxM("DISABLED"!==r.getStep(4).state?37:-1),e.R7$(3),e.vxM(r.isOrderOptionsValid&&4===r.currentStep?40:-1),e.R7$(),e.vxM(r.isOrderOptionsValid||4!==r.currentStep?-1:41),e.R7$(),e.vxM(4!==r.currentStep?42:-1),e.R7$(),e.Y8G("state",r.getStep(5).state)("isExpanded",r.getStep(5).isExpanded)("ardnDataTestId","ardn-order-step-"+r.getStep(5).index),e.R7$(),e.Y8G("step",r.getStep(5).index)("steps",null==r.stepsState?null:r.stepsState.length)("isToggleable",r.getStep(5).isToggleable),e.R7$(),e.SpI(" ",e.bMT(46,80,"ORDER_PAGE.SUMMARY_AND_PAYMENT")," "),e.R7$(4),e.vxM("DISABLED"!==r.getStep(5).state?49:-1),e.R7$(),e.vxM(r.isProductSet()&&"DISABLED"!==r.getStep(5).state?50:-1),e.R7$(),e.vxM("DISABLED"!==r.getStep(5).state?51:-1),e.R7$(),e.AVh("btn--primary",r.isOrderPaymentValid&&r.isAgreementsValid&&5===r.currentStep||!r.isPostOrderLoading),e.Y8G("disabled",!(r.isOrderPaymentValid&&r.isAgreementsValid&&5===r.currentStep)||r.isPostOrderLoading)("ardnDataTestId","ardn-order-step-"+r.getStep(5).index+"-save-order-button"),e.R7$(),e.vxM(r.isOrderPaymentValid?-1:53),e.R7$(),e.vxM(r.isPostOrderLoading&&5===r.currentStep?54:-1),e.R7$(),e.vxM(r.isPostOrderLoading&&5===r.currentStep?-1:55),e.R7$(),e.Y8G("innerHTML",e.bMT(57,82,"ORDER_PAGE.SUMMARY_STEP.SUMMARY_INFORMATION"),e.npT),e.R7$(2),e.Y8G("ardnDataTestId","ardn-order-template-applier"),e.R7$(),e.vxM(r.isPlatformBrowser?59:-1))},dependencies:[l.YU,fc.D,Z.Z,Io,Do.b,Mo.k,$o,No,Nc,Lo,Eo,So,Bi,jo,gp,ln,Oo,f.D9,st.W],styles:[".offers-form{margin-bottom:0;margin-top:0}.order-step__oper[_ngcontent-%COMP%]:hover{cursor:pointer}.order-step__save-order[_ngcontent-%COMP%]{position:relative;margin-top:10px}
1.order-step__save-order[_ngcontent-%COMP%]   .invalid-payment-scroll[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;background:transparent}.order-step__save-order[disabled][_ngcontent-%COMP%]:hover   .loader[_ngcontent-%COMP%]{border-color:#cbcfd433!important;border-left-color:#cbcfd4!important}.postcode-validation[_ngcontent-%COMP%]{width:400px}@media only screen and (max-width: 40em){.postcode-validation[_ngcontent-%COMP%]{width:100%}}@media only screen and (max-width: 60em){  ardn-search-list .section__wrap{margin-left:-20px;margin-right:-20px}}.change-data[_ngcontent-%COMP%]{font-size:1.5rem;position:absolute;right:0;margin-right:10rem;margin-top:2px}.change-data--icon[_ngcontent-%COMP%]{margin-right:1rem}@media only screen and (max-width: 60em){.change-data[_ngcontent-%COMP%]{margin-right:6rem}}@media only screen and (max-width: 40em){.change-data[_ngcontent-%COMP%]{display:block;margin-right:2rem}}.offer__name[_ngcontent-%COMP%]{padding:unset}@media only screen and (min-width: 40.0625em){.offer__image[_ngcontent-%COMP%]{width:unset}.offer__name[_ngcontent-%COMP%]{padding:unset;width:unset}}.order-step__info[_ngcontent-%COMP%]{top:10px}img[_ngcontent-%COMP%]{max-width:80px;max-height:55px}.header-first-step[_ngcontent-%COMP%]     .order-step__header{padding-right:30px}@media only screen and (min-width: 64.0625em){.dark-mode[_ngcontent-%COMP%]     .order-step__header{background-color:#1e3042}.dark-mode[_ngcontent-%COMP%]     .order-step__header .order-step__number-wrap{border-right:0}.dark-mode[_ngcontent-%COMP%]     .order-step__header .order-step__title{color:#fff}.dark-mode[_ngcontent-%COMP%]   .offer__price-big[_ngcontent-%COMP%]{color:#fff}.dark-mode[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{border:7px solid #fff;border-radius:10px;background-color:#fff}}.product-name[_ngcontent-%COMP%]{font-size:16px;margin:0 20px}@media only screen and (max-width: 1100px){.product-name[_ngcontent-%COMP%]{display:none}}.summary-info[_ngcontent-%COMP%]{text-align:center;margin-top:10px}#order-step-2[_ngcontent-%COMP%]   .description[_ngcontent-%COMP%]{font-size:14px;margin:10px 0 0}@media only screen and (max-width: 40em){#order-step-2[_ngcontent-%COMP%]   .full-width[_ngcontent-%COMP%]{width:50%}}.section[_ngcontent-%COMP%]{overflow:visible}"],changeDetection:0})}}return i})();var Ko=s(10402),Kp=s(79812),Qp=s(84470),Qo=s(68686),Jp=s(30439);let Zp=(()=>{class i{constructor(t){this.apiClientService=t}getOrderConfirmation(t){return this.apiClientService.get("report/salesMargin/confirmation?hash="+t,!0,{},!1,"blob")}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(ie.f))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var qp=s(99952),eh=s(46968);let th=(()=>{class i{constructor(t){this.apiClientService=t}getOrderPopup(t){return this.apiClientService.get("order/popup",!0,{hash:t}).pipe((0,Se.W)(n=>(0,H.$)(()=>n.error)))}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(ie.f))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const nh=["changePaymentModal"],jn=i=>({orderDetailsLink:i}),rh=i=>({gkNumber:i});function ih(i,p){if(1&i){const t=e.RV6();e.j41(0,"p")(1,"button",15),e.bIt("click",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.downloadConfirmation())}),e.EFF(2),e.nI1(3,"translate"),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(),e.Y8G("disabled",!t.order.createdOrder),e.R7$(),e.SpI(" ",e.bMT(3,2,"ORDER_SUCCESS_PAGE.GET_CONFIRMATION"),"")}}function oh(i,p){if(1&i&&(e.j41(0,"div",7),e.DNE(1,ih,4,4,"p"),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.vxM(null!=t.userProfile&&t.userProfile.salesMargin?1:-1)}}function sh(i,p){if(1&i&&(e.nrm(0,"p",16),e.nI1(1,"translate")),2&i){const t=e.XpG(3);e.Y8G("innerHTML",e.i5U(1,1,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_DESCRIPTION_ETD",e.eq3(4,jn,t.getOrderDetailsLink())),e.npT)}}function ah(i,p){if(1&i&&(e.nrm(0,"p",16),e.nI1(1,"translate")),2&i){const t=e.XpG(3);e.Y8G("innerHTML",e.i5U(1,1,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_DESCRIPTION_PAPER",e.eq3(4,jn,t.getOrderDetailsLink())),e.npT)}}function dh(i,p){if(1&i&&e.DNE(0,sh,2,6,"p",16)(1,ah,2,6,"p",16),2&i){const t=e.XpG().$implicit;e.vxM("ELECTRONIC_TRADE_DOCUMENTS"===(null==t?null:t.category)?0:-1),e.R7$(),e.vxM("PAPER_TRADE_DOCUMENTS"===(null==t?null:t.category)?1:-1)}}function lh(i,p){if(1&i&&e.DNE(0,dh,2,2),2&i){const t=p.$implicit,n=e.XpG();e.vxM(void 0===(null==t?null:t.options)||-1!==n.addonsWithoutValue.indexOf(t.category)||"ELECTRONIC_TRADE_DOCUMENTS"!==t.category&&"PAPER_TRADE_DOCUMENTS"!==t.category?-1:0)}}function ch(i,p){if(1&i&&(e.nrm(0,"p",16),e.nI1(1,"translate")),2&i){const t=e.XpG(2);e.Y8G("innerHTML",e.i5U(1,1,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_DESCRIPTION_ETD",e.eq3(4,jn,t.getOrderDetailsLink())),e.npT)}}function uh(i,p){if(1&i&&(e.nrm(0,"p",16),e.nI1(1,"translate")),2&i){const t=e.XpG(2);e.Y8G("innerHTML",e.i5U(1,1,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_DESCRIPTION_PAPER",e.eq3(4,jn,t.getOrderDetailsLink())),e.npT)}}function ph(i,p){if(1&i&&e.DNE(0,ch,2,6,"p",16)(1,uh,2,6,"p",16),2&i){const t=e.XpG();e.vxM("ETD"!==(null==t.product?null:t.product.customDocumentType)||t.isAddonsPresent("ELECTRONIC_TRADE_DOCUMENTS")||t.isAddonsPresent("PAPER_TRADE_DOCUMENTS")?-1:0),e.R7$(),e.vxM("PAPER"!==(null==t.product?null:t.product.customDocumentType)||t.isAddonsPresent("ELECTRONIC_TRADE_DOCUMENTS")||t.isAddonsPresent("PAPER_TRADE_DOCUMENTS")?-1:1)}}function hh(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",9),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"h2",17),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"button",18),e.bIt("click",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.openOnlinePaymentModal())}),e.EFF(7),e.nI1(8,"translate"),e.k0s()()}2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,3,"ORDER_SUCCESS_PAGE.ORDER_STATUS"),": "),e.R7$(3),e.SpI(" ",e.bMT(5,5,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_INFO_PART_3")," "),e.R7$(3),e.SpI(" ",e.bMT(8,7,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_INFO_PART_8")," "))}function mh(i,p){if(1&i){const t=e.RV6();e.j41(0,"div",9)(1,"h2",17),e.nrm(2,"div",19)(3,"br"),e.j41(4,"span",20)(5,"span"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()(),e.nrm(8,"br"),e.j41(9,"button",18),e.bIt("click",function(){e.eBV(t);const r=e.XpG();
1return e.Njj(r.submitOnlinePaymentForm())}),e.EFF(10),e.nI1(11,"translate"),e.k0s()()}2&i&&(e.R7$(6),e.SpI(" ",e.bMT(7,2,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_INFO_PART_10")," "),e.R7$(4),e.SpI(" ",e.bMT(11,4,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_INFO_PART_11")," "))}function gh(i,p){1&i&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"h2",21),e.EFF(4),e.nI1(5,"translate"),e.k0s()()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,2,"ORDER_SUCCESS_PAGE.ORDER_STATUS"),": "),e.R7$(3),e.SpI(" ",e.bMT(5,4,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_INFO_PART_4")," "))}function fh(i,p){if(1&i&&(e.j41(0,"div",8),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"strong"),e.EFF(4),e.nI1(5,"translate"),e.nI1(6,"lowercase"),e.k0s(),e.EFF(7),e.nI1(8,"translate"),e.nrm(9,"br")(10,"p",22),e.nI1(11,"translate"),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.SpI(" ",e.bMT(2,4,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_INFO_PART_5")," "),e.R7$(3),e.SpI(" ",e.bMT(6,8,e.bMT(5,6,"COMMON.EMAIL"))," "),e.R7$(3),e.SpI(" ",e.bMT(8,10,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_INFO_PART_6")," "),e.R7$(3),e.Y8G("innerHTML",e.i5U(11,12,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_INFO_PART_9",e.eq3(15,rh,t.getOrderDetailsLink())),e.npT)}}function Ch(i,p){if(1&i){const t=e.RV6();e.j41(0,"button",13),e.bIt("click",function(){e.eBV(t);const r=e.XpG(2);return e.Njj(r.saveTemplate())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"ORDER_SUCCESS_PAGE.SAVE_AS_TEMPLATE")," "))}function _h(i,p){if(1&i&&(e.j41(0,"button",24),e.nI1(1,"translate"),e.EFF(2),e.nI1(3,"translate"),e.k0s()),2&i){const t=e.XpG(2);e.Y8G("ardnTooltipster",e.bMT(1,2,t.getReasonOfDisableSaveAsTemplate())),e.R7$(2),e.SpI(" ",e.bMT(3,4,"ORDER_SUCCESS_PAGE.SAVE_AS_TEMPLATE")," ")}}function Oh(i,p){if(1&i&&(e.j41(0,"div",12),e.DNE(1,Ch,3,3,"button",23)(2,_h,4,6,"button",24),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.vxM(t.isPossibleToUseProductAsTemplate()?1:2)}}function yh(i,p){if(1&i&&e.nrm(0,"img",25)(1,"iframe",26),2&i){const t=e.XpG();e.FRS("src","https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=10226&amount=",null==t.order.createdOrder.price?null:t.order.createdOrder.price.totalGrossPrice,"&ch=aw&cr=PLN&parts=SALE:",null==t.order.createdOrder.price?null:t.order.createdOrder.price.totalGrossPrice,"&ref=",null==t.order||null==t.order.createdOrder?null:t.order.createdOrder.number,"&vc=",t.order.createdOrder.discountCode?t.order.createdOrder.discountCode:"","&cks=na",e.B4B),e.R7$(),e.Y8G("src",t.alerabatUrl(),e.f$h)}}let wn=(()=>{class i{constructor(t,n,r,o,u,g,A,N,w,te,ne,de,Fe,Le,it,we,$e,Wt,Qi,Ji,Zi){this.config=t,this.platformId=n,this.router=r,this.store=o,this.windowService=u,this.onlinePaymentFormService=g,this.changeDetector=A,this.domSanitizer=N,this.googleAnalyticService=w,this.orderSuccessService=te,this.orderCustomsService=ne,this.orderRestorationService=de,this.eCommerceConverterService=Fe,this.cookieService=Le,this.orderFailureService=it,this.countryService=we,this.orderPopupService=$e,this.userStatsService=Wt,this.renderer=Qi,this.elementRef=Ji,this.orderService=Zi,this.isLoggedIn=!1,this.orderPopup=null,this.orderCustoms=null,this.isRestoredOrder=!1,this.addonsWithoutValue=["RECEIVER_TYPE_COMPANY","RECEIVER_TYPE_PRIVATE_PERSON","NOT_STANDARD"],this.cookiePartnerParameter=this.config.cookiePartnerParameter}ngOnInit(){const t=this.store.select(J.tB);this.clearOrderRestorationCookie(),this.clearPartnerParameterInCookies(),this.isLoggedInObservable=this.store.select(J.Ep),this.isLoggedInObservable.subscribe(n=>{this.isLoggedIn=n}),this.store.select(ue.fn).pipe((0,U.p)(n=>!!n)).subscribe(n=>{this.params={...n.params},this.product={...n.selectedProduct}}).unsubscribe(),this.store.select(T.PE).pipe((0,U.p)(n=>!!n),(0,M.s)(1)).subscribe(n=>{this.order={...n},this.order?.createdOrder?.number?this.onOrderReady(!0):this.restoreOrderFromStoredHash()}),this.orderCustoms=this.orderCustomsService.orderCustomsConfig$.value,t.subscribe(n=>{this.userProfile=n})}restoreOrderFromStoredHash(){const t=this.orderFailureService.getOrderHash();!t?.hash||this.orderFailureService.isHashDateExpired(t)||this.orderService.getOrderByHash(t.hash).subscribe(n=>{this.order={...this.order,createdOrder:{number:n.number,hash:n.hash,paymentId:n.paymentId,discountCode:n.discountCode,price:{currency:n.pricing?.currency,totalNetPrice:0,netPriceWithoutFuelSurcharge:0,totalGrossPrice:n.pricing?.priceGross,productNetPrice:0,addonsNetPrice:0,vatPercent:n.pricing?.vatPercent,discountNetPrice:0,fuelSurcharge:0,productsGrossPrice:0,fuelSurchargeGrossPrice:0,addons:[]}}},this.orderFailureService.removeOrderHash(),this.isRestoredOrder=!0,this.onOrderReady(!1)})}onOrderReady(t){this.checkIfShipmentInsideUE(this.order),[Me.O.PREPAID,Me.O.PREPAID_COLLECTIVE_INVOICE,Me.O.DEFERRED_ONLINE_PAYMENT].includes(this.order.payment?.selectedOption?.id)&&this.userStatsService.updateData(),t&&_e.c.production&&(this.setWindowsService(),this.pushAdtractionOrder());const n=this.order?.createdOrder?.price?.totalGrossPrice?this.order.createdOrder.price.totalGrossPrice?.toString():null;t&&_e.c.production&&n&&(this.googleAnalyticService.eventEmitter("conversion","AW-951415051/ukovCMfJ2sgBEIvi1cUD",n,this.order.createdOrder.number),this.order&&this.pushEcommerceToDataLayer(this.order)),this.order?.createdOrder?.hash&&"INSTANT"===this.order?.payment?.selectedOption?.paymentType&&this.orderFailureService.putOrderHash(this.order?.createdOrder?.hash),this.order?.createdOrder?.hash&&this.orderPopupService?.getOrderPopup(this.order?.createdOrder?.hash).subscribe(r=>{this.orderPopup=r,this.orderPopup&&this.loadEkomiWidget()})}checkIfShipmentInsideUE(t){this.countryService.getCountriesCached().subscribe(n=>{const r=n.find(u=>u.id===t?.senderAddress?.countryId),o=n.find(u=>u.id===t?.receiverAddress?.countryId);this.isShipmentInsideEU=r?.isUEMember&&o?.isUEMember})}ngAfterViewInit(){var t=this;return(0,po.A)(function*(){t.order?.payment?.selectedOption?.id===Me.O.ONLINE&&t.order.createdOrder.hash&&t.submitOnlinePaymentForm(
1)})()}submitOnlinePaymentForm(){this.onlinePaymentFormService.getOnlinePaymentForm({onlinePaymentMethodId:this.order?.payment?.selectedOnlineMethod?.id,orderHash:this.order.createdOrder.hash},this.userProfile).subscribe(n=>{this.onlinePaymentFormAction=n?.url,this.onlinePaymentMethodAction=n?.method,this.onlinePaymentFormFields=n?.fields,this.changeDetector.markForCheck()})}downloadConfirmation(){const n=this.order.createdOrder.number;this.orderSuccessService.getOrderConfirmation(this.order.createdOrder.hash).subscribe(r=>{const o=window.URL.createObjectURL(r),u=document.createElement("a");u.href=o,u.download=n+"-confirmation.pdf",u.click()})}redirectToHomePage(){this.router.navigateByUrl("/")}saveTemplate(){this.saveTemplateModal.open(this.params,this.product.id,this.order)}isPossibleToUseProductAsTemplate(){return this.isLoggedIn&&!!this.product}getReasonOfDisableSaveAsTemplate(){return this.isLoggedIn?this.product&&"STANDARD"===this.product?.deliveryTimeType?null:"SEARCH_PRODUCT.TEMPLATE.TEMPLATES_NEEDS_STANDARD_PRODUCT":"SEARCH_PRODUCT.TEMPLATE.TEMPLATES_NEEDS_AUTHORIZATION"}openOnlinePaymentModal(){this.changePaymentModal.order.set({number:this.order.createdOrder.number,hash:this.order.createdOrder.hash,payment:{amount:this.order.createdOrder.price.totalGrossPrice,currency:this.order.createdOrder.price.currency}}),this.changePaymentModal.open()}isAddonsPresent(t){return this.order?.shipment?.addons?.some(n=>n?.category===t)??!1}setWindowsService(){this.order?.createdOrder?.price&&typeof this.windowService.nativeWindow.AWIN<"u"&&typeof this.windowService.nativeWindow.AWIN.Tracking<"u"&&(this.windowService.nativeWindow.AWIN.Tracking.Sale={},this.windowService.nativeWindow.AWIN.Tracking.Sale.amount=this.order.createdOrder.price.totalGrossPrice?.toString(),this.windowService.nativeWindow.AWIN.Tracking.Sale.channel="na",this.windowService.nativeWindow.AWIN.Tracking.Sale.orderRef=this.order.createdOrder.number,this.windowService.nativeWindow.AWIN.Tracking.Sale.parts=`SALE:${this.order.createdOrder.price.totalGrossPrice}`,this.windowService.nativeWindow.AWIN.Tracking.Sale.currency="PLN",this.windowService.nativeWindow.AWIN.Tracking.Sale.voucher=this.order.discountCode?this.order.discountCode:"",this.windowService.nativeWindow.AWIN.Tracking.Sale.test="0",this.windowService.nativeWindow.AWIN.Tracking.run())}ngOnDestroy(){this.store.dispatch(F.M.resetMapModalShipmentParametersAction()),this.store.dispatch(F.M.createResetOrderStateAction()),this.store.dispatch(me.U.createResetSearchParamsAction()),this.store.dispatch(Qp.i.createUpdateSimilarDraftAction(null))}alerabatUrl(){return this.domSanitizer.bypassSecurityTrustResourceUrl(`https://alerabat.go2cloud.org/aff_l?offer_id=70&adv_sub=${this.order.createdOrder.number}&amount=${this.order.createdOrder.price.totalGrossPrice}`)}getOrderDetailsLink(){return`/orders/${this.order?.createdOrder?.number}`}clearOrderRestorationCookie(){this.orderRestorationService.hasStoredCookie&&this.orderRestorationService.removeOrderStateCookie()}pushEcommerceToDataLayer(t){const n=this.eCommerceConverterService.convertProductToECommerceProduct(t?.selectedProduct);(0,q.z)([this.countryService.getCountryByCountryId(t?.senderAddress?.countryId),this.countryService.getCountryByCountryId(t?.receiverAddress?.countryId)]).pipe().subscribe(([r,o])=>{this.googleAnalyticService.sendPurchaseEvent(n,t,r.name,o.name),this.googleAnalyticService.pushECommerceOrder(t)})}clearPartnerParameterInCookies(){(0,l.UE)(this.platformId)&&this.cookieService?.get(this.cookiePartnerParameter)&&this.cookieService.remove(this.cookiePartnerParameter)}pushAdtractionOrder(){this.order?.senderAddress?.email&&this.googleAnalyticService.pushAdtractionOrder(this.order?.createdOrder?.number,this.order?.createdOrder?.price?.totalGrossPrice?.toString(),this.order?.discountCode,Kp(this.order?.senderAddress?.email?.toLowerCase().trim().normalize()))}loadEkomiWidget(){const t=this.renderer.createElement("div"),n=this.renderer.createElement("script");this.renderer.setAttribute(t,"id","sff_127__widget-container"),this.renderer.appendChild(this.elementRef.nativeElement,t),n.type="text/javascript",n.text=`\n      (function(w) {\n        w['_ekomiServerUrl'] = '${this.orderPopup?.serverUrl}';\n        w['_ekomiShopId'] = '${this.orderPopup?.shopId}';\n        w['_ekomiFormId'] = '${this.orderPopup?.formId}';\n        w['_ekomiTransactionId'] = '${this.orderPopup?.transactionId}';\n        w['_ekomiProductIds'] = '';\n        w['_ekomiWidgetWidth'] = '1020px';
1\n        w['_ekomiWidgetHeight'] = '1290px';\n        w['_ekomiEmbedWidget'] = '0';\n        w['_ekomiDisableAutoClose'] = '0';\n        w['_ekomiEmail'] = '${this.orderPopup?.email}';\n        var s = document.createElement('script');\n        s.src = w['_ekomiServerUrl'] + '/script/widget.js?v=' + new Date().getTime();\n        s.async = true;\n        var e = document.getElementsByTagName('script')[0];\n        e.parentNode.insertBefore(s, e);\n      })(window);\n    `,this.renderer.appendChild(this.elementRef.nativeElement,n)}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Ae.vQ),e.rXU(e.Agw),e.rXU(b.Ix),e.rXU(v.il),e.rXU(Ao.s),e.rXU(Jp.h),e.rXU(e.gRc),e.rXU(Bt.up),e.rXU(Yi.p),e.rXU(Zp),e.rXU(Pt.I),e.rXU(wi.A),e.rXU(Xi.C),e.rXU(qp.O1),e.rXU(eh.S),e.rXU(be.o),e.rXU(th),e.rXU(xo.c),e.rXU(e.sFG),e.rXU(e.aKT),e.rXU(K.Q))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-order-success"]],viewQuery:function(n,r){if(1&n&&(e.GBs(Yt.A,7),e.GBs(nh,7)),2&n){let o;e.mGM(o=e.lsd())&&(r.saveTemplateModal=o.first),e.mGM(o=e.lsd())&&(r.changePaymentModal=o.first)}},standalone:!0,features:[e.aNF],decls:35,vars:30,consts:[["saveTemplateModal",""],["changePaymentModal",""],[3,"formAction","formMethod","formFields","selectedPaymentId"],[1,"section","section--border","align-center"],[1,"wrap","section__wrap"],[1,"section__heading","section__heading--h1"],[1,"section__subheading"],[1,"section__body","confirmation"],[1,"section__body"],[1,"color-darker"],[1,"section__body","
1small-padding"],[1,"row","row--center","row--middle"],[1,"col","col-mobile-12","pull-left"],[1,"btn","btn--block",3,"click"],[1,"col","col-mobile-12","pull-right"],[1,"btn","btn--primary",3,"click","disabled"],[1,"section__subheading",3,"innerHTML"],[1,"section__heading","section__heading--h2"],[1,"btn","btn--primary",3,"click"],[1,"loader","loader--green"],[1,"select2-selection__rendered"],[1,"section__heading","section__heading--h2","status--progress"],[3,"innerHTML"],[1,"btn","btn--block"],[1,"btn","btn--block","btn--disabled-alternative",3,"ardnTooltipster"],["border","0","height","0","width","0",2,"display","none",3,"src"],["scrolling","no","frameborder","0","width","1","height","1",3,"src"]],template:function(n,r){if(1&n){const o=e.RV6();e.nrm(0,"ardn-online-payment-form",2),e.j41(1,"section",3)(2,"div",4)(3,"h1",5),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"p",6),e.EFF(7),e.nI1(8,"translate"),e.nI1(9,"translate"),e.k0s(),e.DNE(10,oh,2,1,"div",7),e.Z7z(11,lh,1,1,null,null,e.fX1),e.DNE(13,ph,2,2),e.j41(14,"div",8),e.DNE(15,hh,9,9,"div",9)(16,mh,12,6,"div",9)(17,gh,6,6,"div"),e.k0s(),e.DNE(18,fh,12,17,"div",8),e.j41(19,"div",10)(20,"div",11),e.DNE(21,Oh,3,1,"div",12),e.j41(22,"div",12)(23,"a",13),e.bIt("click",function(){return e.eBV(o),e.Njj(r.redirectToHomePage())}),e.EFF(24),e.nI1(25,"translate"),e.k0s()(),e.j41(26,"div",14)(27,"a",13),e.bIt("click",function(){return e.eBV(o),e.Njj(r.redirectToHomePage())}),e.EFF(28),e.nI1(29,"translate"),e.k0s()()()()()(),e.nrm(30,"ardn-save-template-modal",null,0)(32,"ardn-change-payment-method-modal",null,1),e.DNE(34,yh,2,6)}2&n&&(e.Y8G("formAction",r.onlinePaymentFormAction,e.B4B)("formMethod",r.onlinePaymentMethodAction)("formFields",r.onlinePaymentFormFields)("selectedPaymentId",null==r.order||null==r.order.payment||null==r.order.payment.selectedOnlineMethod?null:r.order.payment.selectedOnlineMethod.id),e.R7$(),e.BMQ("data-user-email",r.isLoggedIn&&r.userProfile?null==r.userProfile||null==r.userProfile.address?null:r.userProfile.address.email:null)("data-subuser-email",r.isLoggedIn&&null!=r.userProfile&&r.userProfile.subUserAddress?null==r.userProfile.subUserAddress?null:r.userProfile.subUserAddress.email:null)("data-order-number",r.order?null==r.order||null==r.order.createdOrder?null:r.order.createdOrder.number:null),e.R7$(3),e.SpI(" ",e.bMT(5,20,"ORDER_SUCCESS_PAGE.THANK_YOU")," "),e.R7$(3),e.Lme(" ",e.bMT(8,22,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_INFO_PART_1")," ",e.bMT(9,24,"ORDER_SUCCESS_PAGE.TRANSACTION_STATUS_INFO_PART_2")," "),e.R7$(3),e.vxM(r.isLoggedIn?10:-1),e.R7$(),e.Dyx(null==r.order||null==r.order.shipment?null:r.order.shipment.addons),e.R7$(2),e.vxM(r.orderCustoms||r.isShipmentInsideEU?13:-1),e.R7$(2),e.vxM(1===(null==r.order||null==r.order.createdOrder?null:r.order.createdOrder.paymentId)?15:-1),e.R7$(),e.vxM(2===(null==r.order||null==r.order.createdOrder?null:r.order.createdOrder.paymentId)&&null!=r.order&&r.order.payment?16:-1),e.R7$(),e.vxM(1!==(null==r.order||null==r.order.createdOrder?null:r.order.createdOrder.paymentId)&&2!==(null==r.order||null==r.order.createdOrder?null:r.order.createdOrder.paymentId)||null==r.order||!r.order.payment?17:-1),e.R7$(),e.vxM(null==r.order||!r.order.payment||2!==(null==r.order||null==r.order.createdOrder?null:r.order.createdOrder.paymentId)&&null!=r.order&&r.order.payment?18:-1),e.R7$(3),e.vxM(null!=r.order&&null!=r.order.createdOrder&&r.order.createdOrder.price?21:-1),e.R7$(3),e.SpI(" ",e.bMT(25,26,"ORDER_SUCCESS_PAGE.CREATE_NEXT_ORDER")," "),e.R7$(4),e.SpI(" ",e.bMT(29,28,"COMMON.REDIRECT_TO_MAIN_PAGE")," "),e.R7$(6),e.vxM(null!=r.order&&null!=r.order.createdOrder&&r.order.createdOrder.price&&!r.isRestoredOrder?34:-1))},dependencies:[Yt.A,Ko.k,f.h,f.D9,ge.d,l.GH,Qo.p],styles:[".link[_ngcontent-%COMP%]:hover{cursor:pointer}.loader[_ngcontent-%COMP%]{margin-bottom:15px}.confirmation[_ngcontent-%COMP%]{margin-top:10px}.section__subheading[_ngcontent-%COMP%]{margin:0 5%}"]})}}return i})();var Jo=s(2568);let vh=(()=>{class i{constructor(t){this.router=t}canActivate(t){if("dashboard"===t.parent.routeConfig.path&&this.router.navigate(["dashboard/panel"]),"order"===t.parent.routeConfig.path)return!0;throw new Error("Order module has been run from not expected url context")}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(b.Ix))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const Eh=[{path:"",pathMatch:"full",component:zp,data:{seoTitle:"SEO.PAGE_TITLE.ORDER_PAGE"},canActivate:[i=>(0,e.WQX)(vh).canActivate(i)]},{path:"success",component:wn,data:{seoTitle:"SEO.PAGE_TITLE.ORDER_SUCCESS_PAGE"}},{path:"success-person",component:wn,data:{seoTitle:"SEO.PAGE_TITLE.ORDER_SUCCESS_PAGE"}},{path:"success-company",component:wn,data:{seoTitle:"SEO.PAGE_TITLE.ORDER_SUCCESS_PAGE"}},{path:"failure",loadComponent:()=>s.e("src_order_pages_order-failure-page_order-failure-page_component_ts").then(s.bind(s,30372)).then(i=>i.OrderFailurePageComponent),data:{seoTitle:"SEO.PAGE_TITLE.ORDER_FAILURE_PAGE"}},{path:"failure-person",loadComponent:()=>s.e("src_order_pages_order-failure-page_order-failure-page_component_ts").then(s.bind(s,30372)).then(i=>i.OrderFailurePageComponent),data:{seoTitle:"SEO.PAGE_TITLE.ORDER_FAILURE_PAGE"}},{path:"failure-company",loadComponent:()=>s.e("src_order_pages_order-failure-page_order-failure-page_component_ts").then(s.bind(s,30372)).then(i=>i.OrderFailurePageComponent),data:{seoTitle:"SEO.PAGE_TITLE.ORDER_FAILURE_PAGE"}},{path:"pending",loadComponent:()=>s.e("src_order_pages_order-pending-page_order-pending-page_component_ts").then(s.bind(s,28158)).then(i=>i.OrderPendingPageComponent),data:{seoTitle:"SEO.PAGE_TITLE.ORDER_PENDING_PAGE"}},{path:"pending-person",loadComponent:()=>s.e("src_order_pages_order-pending-page_order-pending-page_component_ts").then(s.bind(s,28158)).then(i=>i.OrderPendingPageComponent),data:{seoTitle:"SEO.PAGE_TITLE.ORDER_PENDING_PAGE"}},{path:"pending-company",loadComponent:()=>s.e("src_order_pages_order-pending-page_order-pending-page_component_ts").then(s.bind(s,28158)).then(i=>i.OrderPendingPageComponent),data:{seoTitle:"SEO.PAGE_TITLE.ORDER_PENDING_PAGE"}},{path:"thank-you-page",loadComponent:()=>Promise.resolve().then(s.bind(s,96466)).then(i=>i.ThankYouPageComponent),data:{seoTitle:"SEO.PAGE_TITLE.ORDER_THANK_YOU_PAGE"}},{canActivate:[Jo.M$],path:"number/:gkNumber",loadComponent:()=>Promise.resolve().then(s.bind(s,43179)).then(i=>i.OrderCopyByOrderGkComponent),data:{seoTitle:"SEO.PAGE_TITLE.ORDER_COPY_BY_GK"}},{canActivate:[Jo.M$],path:"draft/:draftId",loadComponent:()=>s.e("src_order_pages_order-page_order-draft-loader_order-draft-loader_component_ts").then(s.bind(s,60307)).then(i=>i.OrderDraftLoaderComponent)},{path:"return/:gkNumber/:phoneNumber",loadComponent:()=>Promise.resolve().then(s.bind(s,3245)).then(i=>i.OrderReturnComponent),data:{seoTitle:"SEO.PAGE_TITLE.ORDER_RETURN"}},{path:"shipment-number-return/:shipmentNumber",loadComponent:()=>Promise.resolve().then(s.bind(s,11379)).then(i=>i.OrderShipmentNumberReturnComponent),data:{seoTitle:"SEO.PAGE_TITLE.ORDER_SHIPMENT_RETURN"}},{path:"import/:base64",loadComponent:()=>s.e("src_order_pages_order-import-base_order-import-base_component_ts").then(s.bind(s,49432)).then(i=>i.OrderImportBaseComponent),data:{seoTitle:"ORDER_IMPORT_BASE64.BREADCRUMB"}}];var Ot=s(28221),Ki=s(13690);let Zo=(()=>{class i{constructor(t){this.apiClientService=t}getProductAddons(t){return t=Ie()(t,n=>!n),this.apiClientService.get("product/addons",!0,t).pipe((0,X.T)(n=>
1this.filterUnsupportedYetProductAddons(n)))}filterUnsupportedYetProductAddons(t){const n=[];return Object.entries(t.addons).forEach(([r,o])=>{n[Number(r)]=o}),{addons:n.filter(r=>!this.isCategoryUnsupported(r.category)),requiredAlternativeAddonsGroups:t.requiredAlternativeAddonsGroups}}isCategoryUnsupported(t){return["ADR","CUSTOM_TIME_DELIVERY"].indexOf(t)>=0}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(ie.f))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Sh=s(27916),qo=s.n(Sh),bh=s(9152),Ph=s.n(bh);let es=(()=>{class i{constructor(t){this.config=t}getAddonCategory(t){return this.config.productAddonsCategories[t.category]||"OTHER"}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(Ae.vQ))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),ts=(()=>{class i{constructor(t){this.categoryMapper=t}getGroupedAddons(t,n){const r=this.mapToProductAddonModel(t),o=r.filter(g=>-1===un()(n).indexOf(g.id)),u=vt.createCheckboxAddons(o,this.categoryMapper);if(!Oe()(n)){const g=vt.createRadioAddons(r,this.categoryMapper,n);return u.isEmpty()?this.joinAddons(u,g):g.productAddonsCategories}return u.productAddonsCategories}mapToProductAddonModel(t){return t.map(n=>({...n,priceGross:n.priceGross??0,checked:n.isRequired||!!n.isSelectedByDefault,options:{}}))}joinAddons(t,n){const r=qo()(t.productAddonsCategories,n.productAddonsCategories,this.hasTheSameCategoryName),o=qo()(n.productAddonsCategories,t.productAddonsCategories,this.hasTheSameCategoryName),u=bo()(r,o,this.concatOnTheSameCategoryName),g=Ph()(t.productAddonsCategories,n.productAddonsCategories,(A,N)=>A.categoryName===N.categoryName);return u.concat(g)}hasTheSameCategoryName(t,n){return t.categoryName===n.categoryName}concatOnTheSameCategoryName(t,n){return t.categoryName===n.categoryName?{categoryName:t.categoryName,addonsGroup:t.addonsGroup.concat(n.addonsGroup)}:null}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(es))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ah=s(34827),Rh=s.n(Ah);let ns=(()=>{class i{constructor(t,n,r,o){this.config=t,this.apiClientService=n,this.currencyService=r,this.orderCustomsService=o,this.lastCurrency=null}getOrderPrice(t){const n=this.makeOrderPricingParams(t),r=this.currencyService.getLocalStorageCurrency();return E()(n,this.lastParams)&&E()(r,this.lastCurrency)?(0,ve.of)(this.orderPriceForLastParams):this.apiClientService.get("order/price",!0,n).pipe((0,X.T)(o=>(this.orderPriceForLastParams=o,this.lastParams=n,this.orderPriceForLastParams)),(0,Se.W)(o=>(0,H.$)(()=>o.error)))}makeOrderPricingParams(t){let n=t.paymentOption?t.paymentOption.id:this.config.defaultPaymentIdForPriceEstimation;t.paymentOption&&t.paymentOption.custom&&(n=t.paymentOption.originPaymentId);const r={productId:t.shipment.productId,width:t.shipment.width,height:t.shipment.height,length:t.shipment.length,weight:t.shipment.weight,quantity:t.shipment.quantity,paymentId:n,senderCountryId:t.senderCountryId,receiverCountryId:t.receiverCountryId,addonIds:[]};if(t.shipment.purpose&&(r.purpose=t.shipment.purpose),t.senderPostCode&&(r.senderPostCode=t.senderPostCode),t.receiverPostCode&&(r.receiverPostCode=t.receiverPostCode),t.insuranceValue&&(r.insuranceValue=t.insuranceValue),t.declaredValue&&(r.declaredValue=t.declaredValue),t.cashOnDeliveryValue&&(r.cashOnDeliveryValue=t.cashOnDeliveryValue),t.discountCode&&(r.discountCode=t.discountCode),t?.senderCity&&(r.senderCity=t?.senderCity),t?.receiverCity&&(r.receiverCity=t?.receiverCity),t.shipment.addons){r.addonIds=t.shipment.addons.map(N=>N.id);const u=t.shipment.addons.filter(N=>"INSURANCE"===N.category),g=t.shipment.addons.filter(N=>
1"CASH_ON_DELIVERY"===N.category),A=t.shipment.addons.filter(N=>"DECLARED_VALUE"===N.category);u[0]&&u[0].options&&u[0].options.value&&(r.insuranceValue=u[0].options.value),g[0]&&g[0].options&&g[0].options.value&&(r.cashOnDeliveryValue=g[0].options.value),A[0]&&A[0].options&&A[0].options.value&&(r.declaredValue=A[0].options.value),t.shipment.addons.forEach(N=>{if(N.category?.startsWith("INSURANCE_")){const w=Rh()(N.category.toLowerCase()+"Value");r[w]=N.value}})}return this.orderCustomsService.getDeclaredValueFromCustoms(t.customs,t.productAddons)&&(delete r.declaredValue,Object.assign(r,this.orderCustomsService.toQueryParams(this.orderCustomsService.buildCustomsPayload(t.customs,t.productAddons)))),t.orderHash&&(r.orderHash=t?.orderHash),r}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(Ae.vQ),e.KVO(ie.f),e.KVO(Vn.P),e.KVO(Pt.I))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),rs=(()=>{class i{constructor(t){this.config=t}mapToOrderPaymentsModel(t){return t.map(n=>this.makeOrderPaymentsModel(n))}makeOrderPaymentsModel(t){const n=this.config.orderPayments.filter(r=>r.id===t.id)[0];return n.id===Me.O.COUPON?t.enabled=!1:t.enabled||(n.tooltipKey="OPTION_IS_NOT_AVAILABLE_FOR_YOU"),{...n,name:t.name,enabled:t.enabled,isDefault:t.default}}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(Ae.vQ))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Th=(()=>{class i{constructor(t,n,r,o,u,g,A,N,w,te){this.actions=t,this.productAddonsService=n,this.productAddonsMapperService=r,this.orderPriceService=o,this.orderPaymentsService=u,this.orderPaymentsMapperService=g,this.customRequiredFieldsService=A,this.orderValidationService=N,this.orderService=w,this.orderOutDtoMapperService=te,this.getProductAddons=(0,C.EH)(()=>this.actions.pipe((0,C.gp)(Ot.I6),(0,De.n)(ne=>this.productAddonsService.getProductAddons(ne.payload).pipe((0,X.T)(de=>{const Fe=this.productAddonsMapperService.getGroupedAddons(de.addons,de.requiredAlternativeAddonsGroups);return F.M.createGetProductAddonsSuccessAction(Fe)}),(0,Se.W)(de=>(0,ve.of)(Ki.s.createUnexpectedApiErrorAction(de))))))),this.getOrderPrice=(0,C.EH)(()=>this.actions.pipe((0,C.gp)(Ot.L7),(0,ce.B)(100),(0,De.n)(ne=>this.orderPriceService.getOrderPrice(ne.payload).pipe((0,X.T)(de=>F.M.createGetOrderPriceSuccessAction(de)),(0,Se.W)(de=>(0,ve.of)(F.M.createGetOrderPriceFailedAction(de))))))),this.getCustomRequiredFields=(0,C.EH)(()=>this.actions.pipe((0,C.gp)(Ot.cc),(0,De.n)(ne=>this.customRequiredFieldsService.getCustomRequiredFields(ne.payload).pipe((0,X.T)(de=>F.M.createGetCustomRequiredFieldsSuccessAction(de)),(0,Se.W)(de=>(0,ve.of)(Ki.s.createUnexpectedApiErrorAction(de))))))),this.getOrderPayments=(0,C.EH)(()=>this.actions.pipe((0,C.gp)(Ot.Pp),(0,ce.B)(100),(0,De.n)(ne=>this.orderPaymentsService.getOrderPayments(ne.payload).pipe((0,X.T)(de=>{const Fe=this.orderPaymentsMapperService.mapToOrderPaymentsModel(de);return F.M.createGetOrderPaymentsSuccessAction(Fe)}),(0,Se.W)(de=>(0,ve.of)(Ki.s.createUnexpectedApiErrorAction(de))))))),this.validateOrder=(0,C.EH)(()=>this.actions.pipe((0,C.gp)(Ot.zi),(0,De.n)(ne=>this.orderValidationService.validate(this.orderOutDtoMapperService.map(ne.payload)).pipe((0,X.T)(()=>F.M.createValidateOrderSuccessAction()),(0,Se.W)(de=>(0,ve.of)(F.M.createValidateOrderFailedAction(de))))))),this.postOrder=(0,C.EH)(()=>this.actions.pipe((0,C.gp)(Ot.t7),(0,De.n)(ne=>this.orderService.create(this.orderOutDtoMapperService.map(ne.payload)).pipe((0,X.T)(de=>F.M.createPostOrderSuccessAction({...de,paymentId:ne.payload.payment.selectedOption.id,discountCode:ne.payload.discountCode,senderAddress:ne.payload.senderAddress,receiverAddress:ne.payload.receiverAddress,senderPoint:ne.payload.shipment.senderPoint,receiverPoint:ne.payload.shipment.receiverPoint})),(0,Se.W)(de=>(0,ve.of)(F.M.createValidateOrderFailedAction(de)))))))}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(C.En),e.KVO(Zo),e.KVO(ts),e.KVO(ns),e.KVO(zi.h),e.KVO(rs),e.KVO(ft.P),e.KVO(Gn),e.KVO(K.Q),e.KVO(Wi.o))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ih=s(64413);let Dh=(()=>{class i{constructor(t){this.config=t}getRequiredAddon(t,n){const r=L()(this.config.productAddonsCategoriesRequiringOtherCategories,o=>
1Ne()(o,n));return t.filter(o=>Ne()(Object.keys(r),o.category))}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(Ae.vQ))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Mh=s(46049),Fh=s(96466),$h=s(43179),Nh=s(62095),kh=s(3245),Vh=s(38033),xh=s(2909),Uh=s(54528),Gh=s(39121),Lh=s(11379),jh=s(78246);const wh=["*"];function Bh(i,p){1&i&&(e.j41(0,"span"),e.SdG(1),e.k0s())}function Xh(i,p){if(1&i){const t=e.RV6();e.j41(0,"span",1),e.bIt("click",function(r){e.eBV(t);const o=e.XpG();return e.Njj(o.toggle(r))}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.MORE"),"... "))}let Yh=(()=>{class i{constructor(){this.expanded=(0,e.geq)(!1)}toggle(t){t.preventDefault(),this.expanded.set(!this.expanded())}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["ardn-show-more"]],inputs:{expanded:[1,"expanded"]},outputs:{expanded:"expandedChange"},standalone:!0,features:[e.aNF],ngContentSelectors:wh,decls:2,vars:1,consts:[[1,"color-primary",2,"cursor","pointer"],[1,"color-primary",2,"cursor","pointer",3,"click"]],template:function(n,r){1&n&&(e.NAR(),e.DNE(0,Bh,2,0,"span")(1,Xh,3,3,"span",0)),2&n&&e.vxM(r.expanded()?0:1)},dependencies:[f.h,f.D9],encapsulation:2})}}return i})();var Wh=s(61716),Hh=s(60225),zh=s(42903),Kh=s(94369),Qh=s(76379),Jh=s(8980);let Zh=(()=>{class i{constructor(t,n,r){this.translateService=t,this.store=n,this.locationService=r,n.select(pe.G6).pipe().subscribe(o=>{r.changeLocationForChildrenModule(o)}),this.store.dispatch(jh.B.createGetCurrenciesAction())}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(f.c$),e.KVO(v.il),e.KVO(yo.N))}}static{this.\u0275mod=e.$C({type:i})}static{this.\u0275inj=e.G2t({providers:[To.h,Zo,ts,es,ft.P,ns,zi.h,rs,Gn,K.Q,Wi.o,Ih.S,Ro,Dh,ho,Be,ro.B,Nh.b,Ui.M,xi],imports:[l.MD,m.YN,m.X1,b.iI.forChild(Eh),f.h.forChild({loader:{provide:f.Wr,useFactory:Mh.rr,deps:[R.Qq,e.pJN]},compiler:{provide:f.kJ,useClass:_.sc},parser:{provide:f.Sd,useClass:P.TranslateICUParser},isolate:!0}),v.md.forFeature("order",Ot.nb),v.md.forFeature("search",Qh.JT),v.md.forFeature("dashboard",Gh.NH),C.Vm.forFeature([Kh.n,Th]),Hh.V,zh.z,ye.Q,Hi.e,ji.z,ee.v,Yh,xh.M,io.e,oo.y,Yt.A,ot.N,Wh.t,Uh.J,bt.R,Io,Uo,Go.L,Ko.k,Qo.p,Fi.Y,uo.I,Vh.r,xe.g,Do.b,Ht,Mo.k,$o,ao,zt,xe.g,nn,Lh.OrderShipmentNumberReturnComponent,kh.OrderReturnComponent,$h.OrderCopyByOrderGkComponent,No,Mi,rt,kn,at,dt,lo,gt,Fh.ThankYouPageComponent,wo,Bo,co,mo,Lo,Ii,go,Ai,$i,Bi,Di,Tt.j,Pe.W,wn,jo,Jh.r]})}}return i})()},43179:(G,k,s)=>{"use strict";s.r(k),s.d(k,{OrderCopyByOrderGkComponent:()=>E});var e=s(21413),l=s(84572),v=s(96697),C=s(56977),b=s(96458),f=s(31775),R=s(38033),_=s(54438),P=s(59640),S=s(62095),y=s(51188);let E=(()=>{class I{constructor(x,L,$){this.store=x,this.orderCopyService=L,this.route=$,this.unsubscribeObservable=new e.B}ngOnInit(){this.startCopyOrder()}ngOnDestroy(){this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}getUserNumber(){this.store.select(b.PJ).pipe((0,v.s)(1),(0,C.Q)(this.unsubscribeObservable)).subscribe({next:x=>{x?.profile?.userNumber&&(this.userNumber=x?.profile?.userNumber)},error:()=>{},complete:()=>{this.getOrderCopyStatus(),this.sendSimilarShipment()}})}getOrderNumber(){this.route?.params.subscribe(x=>{this.orderNumber=x?.gkNumber})}sendSimilarShipment(){this.userNumber&&this.orderNumber?this.orderCopyService.sendSimilarShipment(this.userNumber,this.orderNumber):window.location.assign("/")}getOrderCopyStatus(){this.store.select(f._X).pipe((0,C.Q)(this.unsubscribeObservable)).subscribe(x=>{this.error=x?.error?x?.error:null})}startCopyOrder(){(0,l.z)([this.store.select(b.Ep),this.store.select(b.PJ)]).pipe((0,C.Q)(this.unsubscribeObservable)).subscribe(([x,L])=>{x&&L?.profile?.userNumber&&(this.getOrderNumber(),this.getUserNumber())})}static{this.\u0275fac=function(L){return new(L||I)(_.rXU(P.il),_.rXU(S.b),_.rXU(y.nX))}}static{this.\u0275cmp=_.VBU({type:I,selectors:[["ardn-order-copy-by-order-gk"]],standalone:!0,features:[_.aNF],decls:1,vars:1,consts:[[3,"error"]],template:function(L,$){1&L&&_.nrm(0,"ardn-order-template-loader",0),2&L&&_.Y8G("error",$.error)},dependencies:[R.r],encapsulation:2})}}return I})()},90502:(G,k,s)=>{"use strict";s.d(k,{L:()=>q});var e=s(54438),l=s(49969),v=s(84381),C=s(39083),b=s(47173),f=s(53236),R=s(73955),_=s(89417),P=s(21413),S=s(96697),y=s(56977),E=s(81098),I=s(2798),D=s(23971),x=s(59640);function L(j,B){if(1&j){const M=e.RV6();e.j41(0,"div",2),e.nrm(1,"div",3),e.j41(2,"div",4)(3,"button",5),e.bIt("click",function(){e.eBV(M);const J=e.XpG();return e.Njj(J.onClickSelectButton())}),e.EFF(4),e.nI1(5,"translate"),e.k0s()()()}if(2&j){const M=e.XpG();e.R7$(3),e.Y8G("disabled",!M.isSelectedPaymentMethod()),e.R7$(),e.SpI(" ",e.bMT(5,2,"ORDER_PAGE.CHOOSE")," ")}}let $=(()=>{class j{constructor(M,X){this.formBuilder=M,this.store=X,this.order=null,this.unsubscribeOb
1servable=new P.B,this.selectButton=(0,e.hFB)(!1),this.selectedOption=(0,e.hFB)(null),this.changePayment=(0,e.CGW)()}ngOnInit(){this.isDataLoaded=!1,this.selectedOnlinePaymentMethod=null,this.orderOnlinePaymentMethodForm=this.formBuilder.group({onlinePaymentMethod:["",_.k0.required]}),this.paymentMethodsFormSubscription=this.orderOnlinePaymentMethodForm.get("onlinePaymentMethod").valueChanges.subscribe(M=>{this.selectedOnlinePaymentMethod=M,this.selectButton()||this.setOrderOnlinePayment(M)}),this.store.select(D.PE).pipe((0,S.s)(1),(0,y.Q)(this.unsubscribeObservable)).subscribe(M=>{this.order=M})}setOrderOnlinePayment(M){this.store.dispatch(E.M.createSetOrderOnlinePaymentMethodAction(M)),"object"==typeof M&&this.changePayment.emit(M)}isSelectedPaymentMethod(){return!!this.selectedOnlinePaymentMethod}onClickSelectButton(){this.setOrderOnlinePayment(this.selectedOnlinePaymentMethod)}dataLoaded(M){this.isDataLoaded=M}ngOnDestroy(){this.paymentMethodsFormSubscription.unsubscribe(),this.unsubscribeObservable.next(),this.unsubscribeObservable.complete()}static{this.\u0275fac=function(X){return new(X||j)(e.rXU(_.ok),e.rXU(x.il))}}static{this.\u0275cmp=e.VBU({type:j,selectors:[["ardn-order-online-payment-methods"]],inputs:{selectButton:[1,"selectButton"],selectedOption:[1,"selectedOption"]},outputs:{changePayment:"changePayment"},standalone:!0,features:[e.aNF],decls:3,vars:4,consts:[[3,"formGroup"],["id","online","formControlName","onlinePaymentMethod","showHeader","false",3,"dataLoaded","selectedOption","value"],[1,"row","mt-8","pb-4"],[1,"col","col-5"],[1,"col","col-2","align-center"],[1,"btn","btn--primary",3,"click","disabled"]],template:function(X,J){if(1&X&&(e.j41(0,"form",0)(1,"ardn-online-payment-methods",1),e.bIt("dataLoaded",function(T){return J.dataLoaded(T)}),e.k0s()(),e.DNE(2,L,6,4,"div",2)),2&X){let F;e.Y8G("formGroup",J.orderOnlinePaymentMethodForm),e.R7$(),e.Y8G("selectedOption",J.selectedOption())("value",null!==(F=null==J.order||null==J.order.payment?null:J.order.payment.amount)&&void 0!==F?F:null==J.order||null==J.order.priceComponents||null==J.order.priceComponents.components?null:J.order.priceComponents.components.totalGrossPrice),e.R7$(),e.vxM(J.selectButton()&&J.isDataLoaded?2:-1)}},dependencies:[R.h,R.D9,I.d,_.X1,_.qT,_.BC,_.cb,_.j4,_.JD],encapsulation:2})}}return j})();var Y=s(43773),Q=s(48453);function ae(j,B){if(1&j){const M=e.RV6();e.j41(0,"div",7)(1,"ardn-order-online-payment-methods",9),e.bIt("changePayment",function(){e.eBV(M);const J=e.XpG(2);return e.Njj(J.onChangePayment())}),e.k0s()()}if(2&j){const M=e.XpG(2);e.R7$(),e.Y8G("selectButton",M.selectButton())("selectedOption",M.selectedOption())}}function re(j,B){if(1&j&&(e.j41(0,"div",8)(1,"ardn-bank-transfer-payment-method",10)(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()()),2&j){const M=e.XpG(2);e.R7$(),e.Y8G("currency",M.currency),e.R7$(2),e.JRh(e.bMT(4,2,"ORDER_PAGE.BANK_TRANSFER_INFO_ABOUT_TITLE"))}}function U(j,B){if(1&j&&(e.j41(0,"ardn-modal-body",6),e.DNE(1,ae,2,2,"div",7)(2,re,5,4,"div",8),e.k0s()),2&j){const M=e.XpG();e.R7$(),e.vxM(M.isOnlinePayment()||M.isPaymentCustom()?1:-1),e.R7$(),e.vxM(M.isBankTransferPayment()?2:-1)}}let q=(()=>{class j{constructor(M){this.currencyService=M,this.modalId=(0,e.hFB)(),this.paymentTypeId=(0,e.hFB)(null),this.selectButton=(0,e.hFB)(!1),this.selectedOption=(0,e.hFB)(null),this.isOpen=!1,this.scrollModal=null}ngOnInit(){this.setUserSelectedCurrency()}onScroll(M){this.scrollModal=M.top}openModal(){this.modal.open()}closeModal(){this.modal.close()}isOpenChangeModal(M){this.paymentTypeId(),this.isOpen=M}onChangePayment(){this.closeModal()}isOnlinePayment(){return this.paymentTypeId()===C.O.ONLINE}isPaymentCustom(){return!(!this.selectedOption()||!this.selectedOption().custom)&&this.selectedOption().custom}isBankTransferPayment(){return this.paymentTypeId()===C.O.BANK_TRANSFER}setUserSelectedCurrency(){this.currencyService.getCurrencyObservable().subscribe(M=>{this.currency=M})}static{this.\u0275fac=function(X){return new(X||j)(e.rXU(Q.P))}}static{this.\u0275cmp=e.VBU({type:j,selectors:[["ardn-order-payment-modal"]],viewQuery:function(X,J){if(1&X&&e.GBs(v.z,7),2&X){let F;e.mGM(F=e.lsd())&&(J.modal=F.first)}},inputs:{modalId:[1,"modalId"],paymentTypeId:[1,"paymentTypeId"],selectButton:[1,"selectButton"],selectedOption:[1,"selectedOption"]},standalone:!0,features:[e.aNF],decls:10,vars:6,consts:[[1,"order-modal","order-payment-modal",3,"isOpenChange","isScroll","mode","id"],[1,"order-modal__header"],[1,"order-modal__icon"],[1,"icon","order-modal__icon--width"],["href","assets/img/sprites.svg#icon-payments"],[1,"modal-title","h1","order-modal__title"],[1,"order-modal__body"],[1,"order-payment-modal__online-payment"],[1,"order-payment-modal__bank-transfer"],[3,"changePayment","selectButton","selectedOption"],[3,"currency"]],template:function(X,J){1&X&&(e.j41(0,"ardn-modal",0),e.bIt("isOpenChange",function(T){return J.isOpenChangeModal(T)}
1)("isScroll",function(T){return J.onScroll(T)}),e.j41(1,"ardn-modal-header")(2,"div",1)(3,"div",2),e.qSk(),e.j41(4,"svg",3),e.nrm(5,"use",4),e.k0s()(),e.joV(),e.j41(6,"h4",5),e.EFF(7),e.nI1(8,"translate"),e.k0s()()(),e.DNE(9,U,3,2,"ardn-modal-body",6),e.k0s()),2&X&&(e.Y8G("mode","EXTRA-BIG-MH")("id",J.modalId()),e.R7$(7),e.SpI(" ",e.bMT(8,4,"ORDER_PAGE.CHOOSE_YOUR_BANK")," "),e.R7$(2),e.vxM(J.isOpen?9:-1))},dependencies:[b.e,v.z,f.J,R.h,R.D9,$,Y.O],styles:[".order-payment-modal[_ngcontent-%COMP%]   .order-modal__header[_ngcontent-%COMP%]{margin:-40px 0 0}.order-payment-modal[_ngcontent-%COMP%]   .order-modal__title[_ngcontent-%COMP%]{font-size:25px}@media only screen and (max-width: 40em){.order-payment-modal[_ngcontent-%COMP%]   .order-modal__title[_ngcontent-%COMP%]{font-size:20px!important}}.order-payment-modal[_ngcontent-%COMP%]   .order-modal__body[_ngcontent-%COMP%]{height:100%;min-height:530px}.order-payment-modal[_ngcontent-%COMP%]     .modal-body{padding:0!important;height:100%}.order-payment-modal[_ngcontent-%COMP%]     .modal-header{padding:4rem 0 0}.order-payment-modal[_ngcontent-%COMP%]     .modal-header .close{z-index:99998}.order-payment-modal__online-payment[_ngcontent-%COMP%]{padding:15px}.order-payment-modal__bank-transfer[_ngcontent-%COMP%]{padding:1rem 5.5rem}  .modal--extra-big-mh{top:50%}"],data:{animation:[(0,l.hZ)("enterOpacity",[(0,l.kY)(":enter",[(0,l.iF)({opacity:0}),(0,l.i0)(250,(0,l.iF)({opacity:"*"}))])])]}})}}return j})()},3245:(G,k,s)=>{"use strict";s.r(k),s.d(k,{OrderReturnComponent:()=>b});var e=s(38033),l=s(54438),v=s(51188),C=s(97156);let b=(()=>{class f{constructor(_,P){this.route=_,this.orderReturnService=P,this.orderReturnService.updateOrderStatus({loaded:!0}),this.getOrderNumber()}ngOnInit(){this.getOrderData()}getOrderData(){this.orderReturnService.getOrderReturnData(this.orderNumber,this.phoneNumber).subscribe({next:_=>{this.orderReturnService.createOrderReturn(_)},error:_=>{this.error=String(_?.fields?.number),this.orderReturnService.setError(_)}})}getOrderNumber(){this.route?.params.subscribe(_=>{this.orderNumber=_?.gkNumber,this.phoneNumber=_?.phoneNumber})}static{this.\u0275fac=function(P){return new(P||f)(l.rXU(v.nX),l.rXU(C.M))}}static{this.\u0275cmp=l.VBU({type:f,selectors:[["ardn-order-return"]],standalone:!0,features:[l.aNF],decls:1,vars:1,consts:[[3,"error"]],template:function(P,S){1&P&&l.nrm(0,"ardn-order-template-loader",0),2&P&&l.Y8G("error",S.error)},dependencies:[e.r],encapsulation:2})}}return f})()},11379:(G,k,s)=>{"use strict";s.r(k),s.d(k,{OrderShipmentNumberReturnComponent:()=>I});var e=s(60177),l=s(54438),v=s(73955),C=s(51188),b=s(97156),f=s(83072),R=s(345);function _(D,x){1&D&&(l.j41(0,"span"),l.EFF(1),l.nI1(2,"translate"),l.j41(3,"div",12),l.EFF(4,"Loading..."),l.k0s()()),2&D&&(l.R7$(),l.SpI("",l.bMT(2,1,"ORDER_SHIPMENT_RETURN.BUTTON_GENERATING")," "))}function P(D,x){1&D&&(l.j41(0,"span"),l.EFF(1),l.nI1(2,"translate"),l.k0s()),2&D&&(l.R7$(),l.JRh(l.bMT(2,1,"ORDER_SHIPMENT_RETURN.BUTTON_GENERATE")))}function S(D,x){1&D&&(l.j41(0,"div",11),l.EFF(1),l.nI1(2,"translate"),l.k0s()),2&D&&(l.R7$(),l.JRh(l.bMT(2,1,"ORDER_SHIPMENT_RETURN.ERROR_MESSAGE")))}function y(D,x){if(1&D&&(l.j41(0,"div",13)(1,"span"),l.EFF(2),l.nI1(3,"translate"),l.k0s(),l.j41(4,"a",14),l.EFF(5),l.nI1(6,"translate"),l.k0s()()),2&D){const L=l.XpG(2);l.R7$(2),l.JRh(l.bMT(3,3,"ORDER_SHIPMENT_RETURN.DOWNLOAD_INFO")),l.R7$(2),l.Y8G("href",L.downloadLink,l.B4B),l.R7$(),l.JRh(l.bMT(6,5,"ORDER_SHIPMENT_RETURN.DOWNLOAD"))}}function E(D,x){if(1&D&&l.DNE(0,y,7,7,"div",13),2&D){const L=l.XpG();l.vxM(L.downloadLink?0:-1)}}let I=(()=>{class D{constructor(L,$,Y,Q,ae){this.platformId=L,this.route=$,this.orderReturnService=Y,this.windowsService=Q,this.sanitizer=ae,this.loading=!1,this.downloadLink="",this.getOrderShipmentNumber()}generateReturnOrder(){this.setOrderShipmentNumberData()}setOrderShipmentNumberData(){this.loading=!0,this.error=null,this.downloadLink="",this.orderReturnService.getOrderShipmentNumberReturnData(this.orderShipmentNumber).subscribe({next:L=>{if((0,e.UE)(this.platformId)){const $=this.windowsService.nativeWindow,Y=($.URL||$.webkitURL).createObjectURL(L),Q=document.createElement("a");this.downloadLink=this.sanitizer.bypassSecurityTrustUrl(Y),Q.download=`${this.orderShipmentNumber}.pdf`,Q.href=Y,Q.click()}this.loading=!1},error:L=>{this.error=L,this.loading=!1}})}getOrderShipmentNumber(){this.route?.params.subscribe(L=>{this.orderShipmentNumber=L?.shipmentNumber})}static{this.\u0275fac=function($){return new($||D)(l.rXU(l.Agw),l.rXU(C.nX),l.rXU(b.M),l.rXU(f.s7),l.rXU(R.up))}}static{this.\u0275cmp=l.VBU({type:D,selectors:[["ardn-order-shipment-number-return"]],standalone:!0,features:[l.aNF],decls:21,vars:13,consts:[[1,"section","section--primary","clearfix"],[1,"section__container"],[1,"section__heading","section__heading--h1"],[1,"wrap","section__wrap","offers-top-wrap"],[1,"box"],[1,"box__header"],[1,"box__body","align-center"],[1,"description"],[1,"sub-description"],[1,"box__footer"],["type","button",1,"btn","btn--primary",3,"click","disabled"],[1,"error"],[1,"loader","loader--green"],[1,"download"],["target","_blank",1,"link",3,"href"]],template:function($,Y){1&$&&(l.j41(0,"section",0)(1,"div",1)(2,"h1",2),l.EFF(3),l.nI1(4,"translate"),l.k0s()(),l.j41(5,"div",3)(6,"div",4),l.nrm(7,"div",5),l.j41(8,"div",6)(9,"div",7),l.EFF(10),l.nI1(11,"translate"),l.k0s(),l.j41(12,"div",8),l.EFF(13),l.nI1(14,"translate"),l.k0s()(),l.j41(15,"div",9)(16,"button",10),l.bIt("click",function(){return Y.generateReturnOrder()}),l.DNE(17,_,5,3,"span")(18,P,3,3,"span"),l.k0s(),l.DNE(19,S,3,3,"div",11)(20,E,1,1),l.k0s()()()()),2&$&&(l.R7$(3),l.JRh(l.bMT(4,7,"ORDER_SHIPMENT_RETURN.TITLE")),l.R7$(7),l.JRh(l.bMT(11,9,"ORDER_SHIPMENT_RETURN.DESCRIPTION")),l.R7$(3),l.JRh(l.bMT(14,11,"ORDER_SHIPMENT_RETURN.SUB_DESCRIPTION")),l.R7$(3),l.Y8G("disabled",Y.loading),l.R7$(),l.vxM(Y.loading?17:-1),l.R7$(),l.vxM(Y.loading?-1:18),l.R7$(),l.vxM(Y.error?19:20))},dependencies:[v.h,v.D9],styles:[".section__container[_ngcontent-%COMP%]{padding:20px 0}.section__wrap[_ngcontent-%COMP%]{margin:0 auto 30px}.section__wrap[_ngcontent-%COMP%]   .sub-description[_ngcontent-%COMP%]{font-size:14px;color:#f72323}.section__wrap[_ngcontent-%COMP%]   .download[_ngcontent-%COMP%]{margin-top:10px}.section__wrap[_ngcontent-%COMP%]   .error[_ngcontent-%COMP%]{margin-top:10px;color:#f72323;border:1px solid #f72323;border-radius:5px}"]})}}return D})()},56347:(G,k,s)=>{"use strict";s.d(k,{g:()=>l});var e=s(54438);let l=(()=>{class v{static{this.\u0275fac=function(f){return new(f||v)}}static{this.\u0275dir=e.FsC({type:v})}}return v})()},38033:(G,k,s)=>{"use strict";s.d(k,{r:()=>R});var e=s(54438),l=s(73955),v=s(60225);function C(_,P){1&_&&(e.j41(0,"div",8)(1,"a",9),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&_&&(e.R7$(),e.Y8G("href","/",e.B4B),e.R7$(),e.SpI(" ",e.bMT(3,2,"COMMON.REDIRECT_TO_MAIN_PAGE")," "))}function b(_,P){if(1&_&&(e.j41(0,"div",6)(1,"ul",7)(2,"li"),e.EFF(3),e.k0s()()(),e.DNE(4,C,4,4,"div",8)),2&_){const S=e.XpG();e.R7$(3),e.SpI(" ",S.error()," "),e.R7$(),e.vxM(S.backToMainPage()?4:-1)}}function f(_,P){1&_&&(e.j41(0,"button")(1,"h2",10),e.nrm(2,"ardn-loader",11),e.k0s()()),2&_&&(e.R7$(2),e.Y8G("showLoaderWithoutDefaultText",!0))}let R=(()=>
1{class _{constructor(){this.error=(0,e.hFB)(),this.backToMainPage=(0,e.hFB)(!1)}static{this.\u0275fac=function(y){return new(y||_)}}static{this.\u0275cmp=e.VBU({type:_,selectors:[["ardn-order-template-loader"]],inputs:{error:[1,"error"],backToMainPage:[1,"backToMainPage"]},standalone:!0,features:[e.aNF],decls:8,vars:1,consts:[[1,"body"],[1,"section","section--primary","clearfix"],[1,"wrap","section__wrap","offers-top-wrap"],[1,"box","tracking-form-wrap"],[1,"row"],[1,"col-12"],[1,"section-error"],[1,"list","list--error"],[1,"col","pull-right"],[1,"btn",3,"href"],[1,"h2"],[3,"showLoaderWithoutDefaultText"]],template:function(y,E){1&y&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),e.DNE(6,b,5,2)(7,f,3,1,"button"),e.k0s()()()()()()),2&y&&(e.R7$(6),e.vxM(E.error()?6:7))},dependencies:[v.V,l.h,l.D9],styles:[".body[_ngcontent-%COMP%]{margin-bottom:100px}.body[_ngcontent-%COMP%]   .offers-top-wrap[_ngcontent-%COMP%]{height:300px;margin-bottom:-140px}@media only screen and (max-width: 40em){.body[_ngcontent-%COMP%]   .section__wrap[_ngcontent-%COMP%]{padding-top:20px}}.body[_ngcontent-%COMP%]   .tracking-form-wrap[_ngcontent-%COMP%]{position:relative;height:200px;margin-bottom:-140px}@media only screen and (max-width: 60em){.body[_ngcontent-%COMP%]   .tracking-form-wrap[_ngcontent-%COMP%]{margin-bottom:0}.body[_ngcontent-%COMP%]   .tracking-form-wrap[_ngcontent-%COMP%]   .section__wrap[_ngcontent-%COMP%]{padding-top:20px}}.body[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]{position:relative;top:50%;transform:translateY(-50%)}.body[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .section-error[_ngcontent-%COMP%]{margin:auto;display:table;font-size:20px}.body[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{border:0}.body[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]:hover{background-color:unset}"]})}}return _})()},96466:(G,k,s)=>{"use strict";s.r(k),s.d(k,{ThankYouPageComponent:()=>C});var e=s(73955),l=s(54438),v=s(51188);let C=(()=>{class b{constructor(R){this.router=R}redirectToHomePage(){this.router.navigateByUrl("/").then()}static{this.\u0275fac=function(_){return new(_||b)(l.rXU(v.Ix))}}static{this.\u0275cmp=l.VBU({type:b,selectors:[["ardn-thank-you-page"]],standalone:!0,features:[l.aNF],decls:17,vars:12,consts:[[1,"section","section--border","align-center"],[1,"wrap","section__wrap"],[1,"section__heading","section__heading--h1"],[1,"section__subheading"],[1,"section__body","
1small-padding"],[1,"row","row--center","row--middle"],[1,"col","col-mobile-12"],[1,"btn","btn--block",3,"click"]],template:function(_,P){1&_&&(l.j41(0,"section",0)(1,"div",1)(2,"h1",2),l.EFF(3),l.nI1(4,"translate"),l.k0s(),l.j41(5,"p",3),l.EFF(6),l.nI1(7,"translate"),l.nrm(8,"br"),l.EFF(9),l.nI1(10,"translate"),l.k0s(),l.j41(11,"div",4)(12,"div",5)(13,"div",6)(14,"a",7),l.bIt("click",function(){return P.redirectToHomePage()}),l.EFF(15),l.nI1(16,"translate"),l.k0s()()()()()()),2&_&&(l.R7$(3),l.SpI(" ",l.bMT(4,4,"ORDER_THANK_YOU_PAGE.THANK_YOU")," "),l.R7$(3),l.SpI(" ",l.bMT(7,6,"ORDER_THANK_YOU_PAGE.SUB_TITLE_1")," "),l.R7$(3),l.SpI(" ",l.bMT(10,8,"ORDER_THANK_YOU_PAGE.SUB_TITLE_2")," "),l.R7$(6),l.SpI(" ",l.bMT(16,10,"COMMON.REDIRECT_TO_MAIN_PAGE")," "))},dependencies:[e.h,e.D9],encapsulation:2})}}return b})()},62095:(G,k,s)=>{"use strict";s.d(k,{b:()=>y});var e=s(81098),l=s(84320),v=s(84470),C=s(54085),b=s(54438),f=s(18286),R=s(51188),_=s(76674),P=s(90202),S=s(59640);let y=(()=>{class E{constructor(D,x,L,$,Y){this.apiClientService=D,this.router=x,this.draftToStoreSenderService=L,this.orderCustomsService=$,this.store=Y}sendSimilarShipment(D,x){this.userNumber=D,this.updateOrderCopyStoreStatus({loaded:!0,orderNumber:x}),this.apiClientService.post("user/order/draft/copy",!0,{number:x}).subscribe({next:L=>{L?.id&&this.getDraft(L.id,x)},error:L=>{this.setError(L,x)}})}clearStoreBeforeNewOrder(){this.store.dispatch(e.M.resetMapModalShipmentParametersAction()),this.store.dispatch(e.M.createResetOrderStateAction()),this.store.dispatch(l.U.createResetSearchParamsAction()),this.store.dispatch(l.U.createSetTemplateAction(null)),this.store.dispatch(l.U.createSetProductAction(null)),this.store.dispatch(e.M.createResetProductAction()),this.orderCustomsService.clearOrderCustomConfig()}getDraft(D,x){this.apiClientService.get("user/order/drafts",!0,{"filters[id]":D}).subscribe({next:L=>{L?.results?.length&&this.setSimilarAsOrder(D,L.results[0])},error:L=>{this.setError(L,x)}})}setSimilarAsOrder(D,x){const L=this.createDraft(D,x);this.clearStoreBeforeNewOrder(),this.draftToStoreSenderService.sendToState(L,"Ariadna"),this.store.dispatch(v.i.createUpdateSimilarDraftAction(L)),this.finishOrderCopy(),this.router.navigate(["/order"])}createDraft(D,x){const L=x?.draft?.receiverAddress;return{draft:{createDate:new Date(x?.draft?.createDate),draftOriginId:Number(x?.draft?.draftOriginId),draftOriginName:x?.draft?.draftOriginName?.toUpperCase(),isActive:1,orderDraftId:D,receiverAddress:{...L,contactPerson:L?.contactPerson??"",nip:L?.nip??""},senderAddress:x?.draft?.senderAddress,senderPoint:(0,C.u)(x?.draft?.senderPoint),receiverPoint:(0,C.u)(x?.draft?.receiverPoint),shipment:x?.draft?.shipment,userId:this.userNumber,content:x?.draft?.content,collectionType:x?.draft?.collectionType,paymentId:x?.draft?.paymentId}}}setError(D,x){this.finishOrderCopy(),D?.error?.fields&&this.updateOrderCopyStoreStatus({loaded:!1,error:D.error.fields?.number,orderNumber:x})}updateOrderCopyStoreStatus(D){this.store.dispatch(v.i.createUpdateOrderCopy(D))}finishOrderCopy(){this.updateOrderCopyStoreStatus({loaded:!1})}static{this.\u0275fac=function(x){return new(x||E)(b.KVO(f.f),b.KVO(R.Ix),b.KVO(_.A),b.KVO(P.I),b.KVO(S.il))}}static{this.\u0275prov=b.jDH({token:E,factory:E.\u0275fac,providedIn:"root"})}}return E})()},46968:(G,k,s)=>{"use strict";s.d(k,{S:()=>l});var e=s(54438);let l=(()=>{class v{constructor(){this.cookieKey="gk-order-hash"}getOrderHash(){const b=localStorage.getItem(this.cookieKey);return b?JSON.parse(b):{hash:null,expires:null}}putOrderHash(b){localStorage.setItem(this.cookieKey,JSON.stringify({hash:b,expires:new Date((new Date).getTime()+6e5)}))}removeOrderHash(){localStorage.removeItem(this.cookieKey)}isHashDateExpired(b){if(b.hash){const f=new Date,R=new Date(b?.expires??f);return f?.getTime()>R?.getTime()}return!1}static{this.\u0275fac=function(f){return new(f||v)}}static{this.\u0275prov=e.jDH({token:v,factory:v.\u0275fac,providedIn:"root"})}}return v})()},97156:(G,k,s)=>{"use strict";s.d(k,{M:()=>D});var e=s(99437),l=s(18810),v=s(5964),C=s(96697),b=s(81098),f=s(84320),R=s(28217),_=s(99913),P=s(54438),S=s(18286),y=s(59640),E=s(51188),I=s(62095);let D=(()=>{class x{constructor($,Y,Q,ae){this.apiClientService=$,this.store=Y,this.router=Q,this.orderCopyService=ae}getOrderShipmentNumberReturnData($){return this.apiClientService.post("order/return",!0,{shipmentNumber:$},null,!1,"blob").pipe((0,e.W)(Y=>(0,l.$)(()=>({fields:{shipmentNumber:Y.statusText}}))))}getOrderReturnData($,Y){return this.apiClientService.post("order/draft/return",!0,{number:$,phoneNumber:Y}).pipe((0,e.W)(Q=>(0,l.$)(()=>Q.error)))}setError($){this.updateOrderStatus({loaded:!1}),$?.fields?.number&&this.updateOrderStatus({loaded:!1,error:String($.fields?.number)})}createOrderReturn($){this.orderCopyService.clearStoreBeforeNewOrder(),this.updateOrderStatus({loaded:!0}),this.dispatchSearchParams($),this.setProduct($?.shipment?.productId,this.getUserData($.senderAddress)),$?.receiverAddress&&this.store.dispatch(b.M.createUpdateReceiverAddressAction($.receiverAddress)),$?.senderAddress&&this.store.dispatch(b.M.createUpdateSenderAddressAction($.senderAddress)),this.router.navigate(["/order"])}updateOrderStatus($){this.store.dispatch(b.M.createUpdateOrderReturn($))}stopGeneratingOrderReturn(){this.updateOrderStatus({loaded:!1})}getUserData($){return{nip:$?.nip,name:$?.name,surname:$?.surname,city:$?.city,postCode:$?.postCode,countryId:$?.countryId,phone:$?.phone,email:$?.email,companyName:$?.name,type:$?.nip?"COMPANY":"PERSON",street:$?.street,apartmentNumber:$?.apartmentNumber,houseNumber:$?.houseNumber}}setUnregisteredUserAddressData($){this.store.dispatch(b.M.createSetUserAddressAction($))}setProduct($,Y){this.store.select(_.vD).pipe((0,v.p)(Q=>Q?.length>0),(0,C.s)(1)).subscribe(Q=>{const ae=Q.find(re=>re.id===$);ae&&"STANDARD"===ae.deliveryTimeType&&this.store.dispatch(f.U.createSetProductAction(ae)),this.setUnregisteredUserAddressData(Y)})}dispatchSearchParams($){const Y=this.getSearchParams($);this.setOrderFirstStep(Y)}setOrderFirstStep($){this.store.dispatch(f.U.createSetProductAction(null)),this.store.dispatch(f.U.createSetSearchParamsAction($)),this.store.dispatch(b.M.createInitOrderAction({params:$,readonlyReceiverPostCodes:!1,readonlySenderPostCodes:!1,selectedProduct:null,selectedTemplate:null,products:(0,R.w)(),productFilters:{}}))}getSearchParams($){return{width:$?.shipment?.width,length:$?.shipment?.length,height:$?.shipment?.height,weight:$?.shipment?.weight,quantity:$?.shipment?.quantity,receiverCountryId:$?.receiverAddress?.countryId,senderCountryId:$?.senderAddress?.countryId,productId:$?.shipment?.productId}}static{this.\u0275fac=function(Y){return new(Y||x)(P.KVO(S.f),P.KVO(y.il),P.KVO(E.Ix),P.KVO(I.b))}}static{this.\u0275prov=P.jDH({token:x,factory:x.\u0275fac,providedIn:"root"})}}return x})()},56331:(G,k,s)=>{"use strict";s.d(k,{B:()=>f});var e=s(21626),l=s(96354),v=s(79808),C=s(54438),b=s(345);let f=(()=>{class R{constructor(P,S,y){this.config=P,this.httpClient=S,this.sanitizer=y}getWithSeparatorHr(P,S="page"){return this.httpClient.get(`${this.config.wordpressApiURL}wp-json/wp/v2/${this.getURLTypePart(S)}/${P}`).pipe((0,l.T)(y=>this.convertWordpressResource(y)))}getURLTypePart(P){return P+"s"}convertWordpressResource(P){const S=P.content.rendered?P.content.rendered?.split("<hr>"):[];return{title:P.title.rendered,content:P.content.rendered,short:S.length?S[0].trim():void 0,expanded:S.length>1?S[1].trim():void 0,separated:S}}getMktRawContent(P){const S=(new e.Nl).append("url",P);return this.httpClient.get(`${this.config.mktWordpressApiURL}wp-json/wp-custom-content/v1/page-html`,{params:S}).pipe((0,l.T)(y=>this.sanitizer.bypassSecurityTrustHtml(y)))}static{this.\u0275fac=function(S){return new(S||R)(C.KVO(v.vQ),C.KVO(e.Qq),C.KVO(b.up))}}static{this.\u0275prov=C.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}}return R})()},50919:(G,k,s)=>{"use strict";s.d(k,{P:()=>f});var e=s(54438);function l(R,_){if(1&R&&(e.j41(0,"span",2),e.nrm(1,"div",3),e.k0s()),2&R){const P=e.XpG();e.AVh("carrier-logo-box--sm","sm"===P.size())}}function v(R,_){1&R&&e.nrm(0,"div",3)}function C(R,_){if(1&R){const P=e.RV6();e.j41(0,"span",2),e.DNE(1,v,1,0,"div",3),e.j41(2,"img",4),e.bIt("load",function(){e.eBV(P);const y=e.XpG();return e.Njj(y.onImageSettled())})("error",function(){e.eBV(P);const y=e.XpG();return e.Njj(y.onImageSettled())}),e.k0s()()}if(2&R){const P=e.XpG();e.AVh("carrier-logo-box--sm","sm"===P.size()),e.R7$(),e.vxM(P.imageLoaded()?-1:1),e.R7$(),e.AVh("carrier-logo-img--hidden",!P.imageLoaded()),e.Y8G("src",P.resolvedLogo(),e.B4B)("alt",P.carrierName())}}function b(R,_){if(1&R&&(e.j41(0,"span",1),e.EFF(1),e.k0s()),2&R){const P=e.XpG();e.R7$(),e.JRh(P.carrierName())}}let f=(()=>
1{class R{constructor(){this.logo=(0,e.hFB)(),this.logosMap=(0,e.hFB)(),this.carrierName=(0,e.hFB)(""),this.size=(0,e.hFB)("md"),this.resolvedLogo=(0,e.EWP)(()=>{if(void 0!==this.logo())return this.logo();const P=this.logosMap();return P?P.get(this.carrierName())??null:void 0}),this.state=(0,e.EWP)(()=>{const P=this.resolvedLogo();return void 0===P?"loading":P?"image":"text"}),this.imageLoaded=(0,e.vPA)(!1)}onImageSettled(){this.imageLoaded.set(!0)}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=e.VBU({type:R,selectors:[["ardn-carrier-logo"]],inputs:{logo:[1,"logo"],logosMap:[1,"logosMap"],carrierName:[1,"carrierName"],size:[1,"size"]},standalone:!0,features:[e.aNF],decls:3,vars:1,consts:[[1,"carrier-logo-box",3,"carrier-logo-box--sm"],[1,"carrier-logo-text"],[1,"carrier-logo-box"],[1,"carrier-logo-skeleton"],[1,"carrier-logo-img",3,"load","error","src","alt"]],template:function(S,y){if(1&S&&e.DNE(0,l,2,2,"span",0)(1,C,3,7,"span",0)(2,b,2,1,"span",1),2&S){let E;e.vxM("loading"===(E=y.state())?0:"image"===E?1:"text"===E?2:-1)}},styles:["[_nghost-%COMP%]{display:contents}.carrier-logo-box[_ngcontent-%COMP%]{height:28px;min-width:80px;flex-shrink:0;border-radius:4px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#fff;padding:2px;position:relative}.carrier-logo-box--sm[_ngcontent-%COMP%]{height:22px}.carrier-logo-skeleton[_ngcontent-%COMP%]{position:absolute;inset:0;min-width:80px;border-radius:4px;background:linear-gradient(90deg,#ececec 25%,#f5f5f5,#ececec 75%);background-size:200% 100%;animation:_ngcontent-%COMP%_carrier-logo-shimmer 1.4s infinite}.carrier-logo-img[_ngcontent-%COMP%]{display:block;height:100%;object-fit:contain;border-radius:4px}.carrier-logo-img--hidden[_ngcontent-%COMP%]{visibility:hidden;position:absolute}.carrier-logo-text[_ngcontent-%COMP%]{flex-shrink:0;color:#9b9b9b}@keyframes _ngcontent-%COMP%_carrier-logo-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}"],changeDetection:0})}}return R})()},48211:(G,k,s)=>{"use strict";s.d(k,{s:()=>v});var e=s(54438);const l=["*"];let v=(()=>{class C{static{this.\u0275fac=function(R){return new(R||C)}}static{this.\u0275cmp=e.VBU({type:C,selectors:[["ardn-modal-footer"]],standalone:!0,features:[e.aNF],ngContentSelectors:l,decls:2,vars:0,consts:[[1,"modal-footer"]],template:function(R,_){1&R&&(e.NAR(),e.j41(0,"div",0),e.SdG(1),e.k0s())},encapsulation:2})}}return C})()},34117:(G,k,s)=>{"use strict";s.d(k,{o:()=>C});var e=s(54438),l=s(89417),v=s(73955);let C=(()=>{class b{constructor(R){this.formBuilder=R,this.firstOption=(0,e.hFB)(),this.secondOption=(0,e.hFB)(),this.offOnSwitchCompleted=(0,e.CGW)(),this.propagateChange=()=>{}}ngOnInit(){this.switchForm=this.formBuilder.group({radioOption:this.firstOption().value}),this.switchForm.valueChanges.subscribe(R=>{this.propagateChange(R.radioOption),this.offOnSwitchCompleted.emit(R)})}registerOnChange(R){this.propagateChange=R}writeValue(R){this.switchForm.get("radioOption").setValue(R)}registerOnTouched(){}static{this.\u0275fac=function(_){return new(_||b)(e.rXU(l.ok))}}static{this.\u0275cmp=e.VBU({type:b,selectors:[["ardn-on-off-switch"]],inputs:{firstOption:[1,"firstOption"],secondOption:[1,"secondOption"]},outputs:{offOnSwitchCompleted:"offOnSwitchCompleted"},standalone:!0,features:[e.Jv_([{provide:l.kq,useExisting:(0,e.Rfq)(()=>b),multi:!0}]),e.aNF],decls:9,vars:13,consts:[[1,"switch",3,"formGroup"],["type","radio","formControlName","radioOption",3,"id","value"],[1,"switch__label",3,"for"],[3,"for"]],template:function(_,P){1&_&&(e.j41(0,"div",0),e.nrm(1,"input",1),e.j41(2,"label",2),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.nrm(5,"input",1),e.j41(6,"label",3),e.EFF(7),e.nI1(8,"translate"),e.k0s()()),2&_&&(e.Y8G("formGroup",P.switchForm),e.R7$(),e.Y8G("id",P.firstOption().nameTranslationKey)("value",P.firstOption().value),e.R7$(),e.Y8G("for",P.firstOption().nameTranslationKey),e.R7$(),e.SpI(" ",e.bMT(4,9,P.firstOption().nameTranslationKey)," "),e.R7$(2),e.Y8G("id",P.secondOption().nameTranslationKey)("value",P.secondOption().value),e.R7$(),e.Y8G("for",P.secondOption().nameTranslationKey),e.R7$(),e.SpI(" ",e.bMT(8,11,P.secondOption().nameTranslationKey)," "))},dependencies:[l.X1,l.me,l.Fm,l.BC,l.cb,l.j4,l.JD,v.h,v.D9],styles:["@media screen and (max-width: 370px){.switch[_ngcontent-%COMP%]{zoom:.85}}"]})}}return b})()},15231:(G,k,s)=>{"use strict";s.d(k,{e:()=>b});var e=s(56347),l=s(39122),v=s(54438),C=s(73955);let b=(()=>{class f extends e.g{constructor(_){super(),this.translate=_}renderHtmlContent(){return'\n      <div class="package-info-content">\n        '+this.translate.instant("TOOLTIP.SWIFT")+'\n        <a\n          href="https://www.iban.pl/iban-checker"\n          target="_blank"\n          class="standard-package-info-content-read-more"\n        >www.iban.pl</a>\n      </div>\n    '}static{this.\u0275fac=function(P){return new(P||f)(v.rXU(C.c$))}}static{this.\u0275cmp=v.VBU({type:f,selectors:[["ardn-swift-info-tip"]],standalone:!0,features:[v.Vt3,v.aNF],decls:2,vars:2,consts:[[1,"info-icon","tooltip","tooltipstered",3,"isHTML","ardnTooltipster"]],template:function(P,S){1&P&&(v.j41(0,"span",0),v.EFF(1," i\n"),v.k0s()),2&P&&v.Y8G("isHTML",!0)("ardnTooltipster",S.renderHtmlContent())},dependencies:[l.d],styles:[".tooltipster-content[_ngcontent-%COMP%]{padding-right:5px}.tooltipster-base[_ngcontent-%COMP%]{pointer-events:all}"]})}}return f})()},55464:(G,k,s)=>{"use strict";s.d(k,{K:()=>C});var e=s(60177),l=s(54438),v=s(59141);let C=(()=>{class b{constructor(R){this.locationService=R}transform(R,_="1.2-2"){return new e.QX(this.locationService.getLocationId()).transform(R,_)}static{this.\u0275fac=function(_){return new(_||b)(l.rXU(v.N,16))}}static{this.\u0275pipe=l.EJ8({name:"ardnLocaleNumber",type:b,pure:!0,standalone:!0})}static{this.\u0275prov=l.jDH({token:b,factory:b.\u0275fac,providedIn:"root"})}}return b})()},29188:(G,k,s)=>{"use strict";s.d(k,{o:()=>b});var e=s(18810),l=s(54438),v=s(18286),C=s(99437);let b=(()=>{class f{constructor(){this.apiClientService=(0,l.WQX)(v.f)}addCod(_){return this.apiClientService.post("user/cod",!0,_).pipe((0,C.W)(P=>(0,e.$)(()=>P.error)))}updateCod(_){return this.apiClientService.put("user/cod",!0,_).pipe((0,C.W)(P=>(0,e.$)(()=>P.error)))}getCods(_){return this.apiClientService.get("user/cods",!0,_?{subUserId:_}:{}).pipe((0,C.W)(P=>(0,e.$)(()=>P.error)))}getCod(_,P){return this.apiClientService.get("user/cod",!0,P?{codId:_,subUserId:P}:{codId:_}).pipe((0,C.W)(S=>(0,e.$)(()=>S.error)))}deleteCod(_,P){return this.apiClientService.delete("user/cod",!0,P?{codId:_,subUserId:P}:{codId:_}).pipe((0,C.W)(S=>(0,e.$)(()=>S.error)))}static{this.\u0275fac=function(P){return new(P||f)}}static{this.\u0275prov=l.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}}return f})()},77468:G=>{var k={utf8:{stringToBytes:function(s){return k.bin.stringToBytes(unescape(encodeURIComponent(s)))},bytesToString:function(s){return decodeURIComponent(escape(k.bin.bytesToString(s)))}},bin:{stringToBytes:function(s){for(var e=[],l=0;l<s.length;
1l++)e.push(255&s.charCodeAt(l));return e},bytesToString:function(s){for(var e=[],l=0;l<s.length;l++)e.push(String.fromCharCode(s[l]));return e.join("")}}};G.exports=k},59928:G=>{var k,s;k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",G.exports=s={rotl:function(e,l){return e<<l|e>>>32-l},rotr:function(e,l){return e<<32-l|e>>>l},endian:function(e){if(e.constructor==Number)return 16711935&s.rotl(e,8)|4278255360&s.rotl(e,24);for(var l=0;l<e.length;l++)e[l]=s.endian(e[l]);return e},randomBytes:function(e){for(var l=[];e>0;e--)l.push(Math.floor(256*Math.random()));return l},bytesToWords:function(e){for(var l=[],v=0,C=0;v<e.length;v++,C+=8)l[C>>>5]|=e[v]<<24-C%32;return l},wordsToBytes:function(e){for(var l=[],v=0;v<32*e.length;v+=8)l.push(e[v>>>5]>>>24-v%32&255);return l},bytesToHex:function(e){for(var l=[],v=0;v<e.length;v++)l.push((e[v]>>>4).toString(16)),l.push((15&e[v]).toString(16));return l.join("")},hexToBytes:function(e){for(var l=[],v=0;v<e.length;v+=2)l.push(parseInt(e.substr(v,2),16));return l},bytesToBase64:function(e){for(var l=[],v=0;v<e.length;v+=3)for(var C=e[v]<<16|e[v+1]<<8|e[v+2],b=0;b<4;b++)l.push(8*v+6*b<=8*e.length?k.charAt(C>>>6*(3-b)&63):"=");return l.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var l=[],v=0,C=0;v<e.length;C=++v%4)0!=C&&l.push((k.indexOf(e.charAt(v-1))&Math.pow(2,-2*C+8)-1)<<2*C|k.indexOf(e.charAt(v))>>>6-2*C);return l}}},58749:G=>{function k(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}G.exports=function(e){return null!=e&&(k(e)||function s(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&k(e.slice(0,0))}(e)||!!e._isBuffer)}},17325:G=>{G.exports=function k(s,e,l,v){var C=-1,b=null==s?0:s.length;for(v&&b&&(l=s[++C]);++C<b;)l=e(l,s[C],C,s);return l}},23167:G=>{G.exports=function k(s){return s.split("")}},82192:G=>{var k=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;G.exports=function s(e){return e.match(k)||[]}},10732:(G,k,s)=>{var e=s(64399),l=s(12651);G.exports=function v(C,b,f){(void 0!==f&&!l(C[b],f)||void 0===f&&!(b in C))&&e(C,b,f)}},6362:(G,k,s)=>{var e=s(50342),l=s(75306),v=s(35878),C=s(12757),b=s(42502),f=s(31890);G.exports=function _(P,S,y,E){var I=-1,D=l,x=!0,L=P.length,$=[],Y=S.length;if(!L)return $;y&&(S=C(S,b(y))),E?(D=v,x=!1):S.length>=200&&(D=f,x=!1,S=new e(S));e:for(;++I<L;){var Q=P[I],ae=null==y?Q:y(Q);if(Q=E||0!==Q?Q:0,x&&ae==ae){for(var re=Y;re--;)if(S[re]===ae)continue e;$.push(Q)}else D(S,ae,E)||$.push(Q)}return $}},16324:(G,k,s)=>{var e=s(50342),l=s(75306),v=s(35878),C=s(12757),b=s(42502),f=s(31890),R=Math.min;G.exports=function _(P,S,y){for(var E=y?v:l,I=P[0].length,D=P.length,x=D,L=Array(D),$=1/0,Y=[];x--;){var Q=P[x];x&&S&&(Q=C(Q,b(S))),$=R(Q.length,$),L[x]=!y&&(S||I>=120&&Q.length>=120)?new e(x&&Q):void 0}Q=P[0];var ae=-1,re=L[0];e:for(;++ae<I&&Y.length<$;){var U=Q[ae],q=S?S(U):U;if(U=y||0!==U?U:0,!(re?f(re,q):E(Y,q,y))){for(x=D;--x;){var j=L[x];if(!(j?f(j,q):E(P[x],q,y)))continue e}re&&re.push(q),Y.push(U)}}return Y}},85765:(G,k,s)=>{var e=s(6898),l=s(10732),v=s(32898),C=s(91239),b=s(83278),f=s(47674),R=s(3609);G.exports=function _(P,S,y,E,I){P!==S&&v(S,function(D,x){if(I||(I=new e),b(D))C(P,S,x,y,_,E,I);else{var L=E?E(R(P,x),D,x+"",P,S,I):void 0;void 0===L&&(L=D),l(P,x,L)}},f)}},91239:(G,k,s)=>{var e=s(10732),l=s(7697),v=s(11334),C=s(25820),b=s(92870),f=s(56265),R=s(9812),_=s(25152),P=s(63151),S=s(58653),y=s(83278),E=s(49970),I=s(31028),D=s(3609),x=s(6729);G.exports=function L($,Y,Q,ae,re,U,q){var j=D($,Q),B=D(Y,Q),M=q.get(B);if(M)e($,Q,M);else{var X=U?U(j,B,Q+"",$,Y,q):void 0,J=void 0===X;if(J){var F=R(B),T=!F&&P(B),ue=!F&&!T&&I(B);X=B,F||T||ue?R(j)?X=j:_(j)?X=C(j):T?(J=!1,X=l(B,!0)):ue?(J=!1,X=v(B,!0)):X=[]:E(B)||f(B)?(X=j,f(j)?X=x(j):(!y(j)||S(j))&&(X=b(B))):J=!1}J&&(q.set(B,X),re(X,B,ae,U,q),q.delete(B)),e($,Q,X)}}},68591:(G,k,s)=>{var e=s(39631),l=s(28452),v=s(11230);G.exports=function C(b,f){return v(l(b,f,e),b+"")}},45432:(G,k,s)=>{var e=s(6362),l=s(13091),v=s(73136);G.exports=function C(b,f,R){var _=b.length;if(_<2)return _?v(b[0]):[];for(var P=-1,S=Array(_);++P<_;)for(var y=b[P],E=-1;++E<_;)E!=P&&(S[P]=e(S[P]||y,b[E],f,R));return v(l(S,1),f,R)}},86638:(G,k,s)=>
1{var e=s(25152);G.exports=function l(v){return e(v)?v:[]}},18989:(G,k,s)=>{var e=s(85695);G.exports=function l(v,C,b){var f=v.length;return b=void 0===b?f:b,!C&&b>=f?v:e(v,C,b)}},87530:(G,k,s)=>{var e=s(68591),l=s(12721);G.exports=function v(C){return e(function(b,f){var R=-1,_=f.length,P=_>1?f[_-1]:void 0,S=_>2?f[2]:void 0;for(P=C.length>3&&"function"==typeof P?(_--,P):void 0,S&&l(f[0],f[1],S)&&(P=_<3?void 0:P,_=1),b=Object(b);++R<_;){var y=f[R];y&&C(b,y,R,P)}return b})}},45020:(G,k,s)=>{var e=s(18989),l=s(89191),v=s(23195),C=s(54717);G.exports=function b(f){return function(R){R=C(R);var _=l(R)?v(R):void 0,P=_?_[0]:R.charAt(0),S=_?e(_,1).join(""):R.slice(1);return P[f]()+S}}},87666:(G,k,s)=>{var e=s(17325),l=s(45403),v=s(75788),b=RegExp("['\u2019]","g");G.exports=function f(R){return function(_){return e(v(l(_).replace(b,"")),R,"")}}},89191:G=>{var f=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");G.exports=function R(_){return f.test(_)}},95823:G=>{var k=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;G.exports=function s(e){return k.test(e)}},12721:(G,k,s)=>{var e=s(12651),l=s(47291),v=s(98426),C=s(83278);G.exports=function b(f,R,_){if(!C(_))return!1;var P=typeof R;return!!("number"==P?l(_)&&v(R,_.length):"string"==P&&R in _)&&e(_[R],f)}},3609:G=>{G.exports=function k(s,e){if(("constructor"!==e||"function"!=typeof s[e])&&"__proto__"!=e)return s[e]}},23195:(G,k,s)=>{var e=s(23167),l=s(89191),v=s(33163);G.exports=function C(b){return l(b)?v(b):e(b)}},33163:G=>{var k="\\ud800-\\udfff",b="["+k+"]",f="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",R="\\ud83c[\\udffb-\\udfff]",P="[^"+k+"]",S="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",I="(?:"+f+"|"+R+")?",D="[\\ufe0e\\ufe0f]?",L=D+I+"(?:\\u200d(?:"+[P,S,y].join("|")+")"+D+I+")*",$="(?:"+[P+f+"?",f,S,y,b].join("|")+")",Y=RegExp(R+"(?="+R+")|"+$+L,"g");G.exports=function Q(ae){return ae.match(Y)||[]}},57172:G=>{var k="\\ud800-\\udfff",C="\\u2700-\\u27bf",b="a-z\\xdf-\\xf6\\xf8-\\xff",S="A-Z\\xc0-\\xd6\\xd8-\\xde",E="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",D="["+E+"]",L="\\d+",$="["+C+"]",Y="["+b+"]",Q="[^"+k+E+L+C+b+S+"]",q="(?:\\ud83c[\\udde6-\\uddff]){2}",j="[\\ud800-\\udbff][\\udc00-\\udfff]",B="["+S+"]",X="(?:"+Y+"|"+Q+")",J="(?:"+B+"|"+Q+")",F="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",T="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",ue="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Ve="[\\ufe0e\\ufe0f]?",be=Ve+ue+"(?:\\u200d(?:"+["[^"+k+"]",q,j].join("|")+")"+Ve+ue+")*",Qe="(?:"+[$,q,j].join("|")+")"+be,Je=RegExp([B+"?"+Y+"+"+F+"(?="+[D,B,"$"].join("|")+")",J+"+"+T+"(?="+[D,B+X,"$"].join("|")+")",B+"?"+X+"+"+F,B+"+"+T,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",L,Qe].join("|"),"g");G.exports=function Ze(m){return m.match(Je)||[]}},34827:(G,k,s)=>{var e=s(98027),v=s(87666)(function(C,b,f){return b=b.toLowerCase(),C+(f?e(b):b)});G.exports=v},98027:(G,k,s)=>{var e=s(54717),l=s(8339);G.exports=function v(C){return l(e(C).toLowerCase())}},21517:(G,k,s)=>{var e=s(13091),l=1/0;G.exports=function v(C){return null!=C&&C.length?e(C,l):[]}},54084:(G,k,s)=>{var e=s(12757),l=s(16324),v=s(68591),C=s(86638),b=v(function(f){var R=e(f,C);return R.length&&R[0]===f[0]?l(R):[]});G.exports=b},33813:(G,k,s)=>{var e=s(12757),l=s(16324),v=s(12344),C=s(68591),b=s(86638),f=s(95649),R=C(function(_){var P=f(_),S=e(_,b);return P===f(S)?P=void 0:S.pop(),S.length&&S[0]===_[0]?l(S,v(P,2)):[]});G.exports=R},27916:(G,k,s)=>{var e=s(12757),l=s(16324),v=s(68591),C=s(86638),b=s(95649),f=v(function(R){var _=b(R),P=e(R,C);return(_="function"==typeof _?_:void 0)&&P.pop(),P.length&&P[0]===R[0]?l(P,void 0,_):[]});G.exports=f},25152:(G,k,s)=>{var e=s(47291),l=s(57433);G.exports=function v(C){return l(C)&&e(C)}},17295:(G,k,s)=>{var e=s(64399),l=s(73432),v=s(12344);G.exports=function C(b,f){var R={};return f=v(f,3),l(b,function(_,P,S){e(R,f(_,P,S),_)}),R}},25689:(G,k,s)=>{var e=s(85765),v=s(87530)(function(C,b,f,R){e(C,b,f,R)});G.exports=v},6729:(G,k,s)=>{var e=s(43190),l=s(47674);G.exports=function v(C){return e(C,l(C))}},89488:(G,k,s)=>{var e=s(73136);G.exports=function l(v){return v&&v.length?e(v):[]}},8339:(G,k,s)=>{var l=s(45020)("toUpperCase");G.exports=l},75788:(G,k,s)=>{var e=s(82192),l=s(95823),v=s(54717),C=s(57172);G.exports=function b(f,R,_){return f=v(f),void 0===(R=_?void 0:R)?l(f)?C(f):e(f):f.match(R)||[]}},9152:(G,k,s)=>{var e=s(32873),l=s(68591),v=s(45432),C=s(25152),b=s(95649),f=l(function(R){var _=b(R);return _="function"==typeof _?_:void 0,v(e(R,C),void 0,_)});G.exports=f},79812:(G,k,s)=>{var e,l,v,C,b;e=s(59928),l=s(77468).utf8,v=s(58749),C=s(77468).bin,(b=function(f,R){f.constructor==String?f=R&&"binary"===R.encoding?C.stringToBytes(f):l.stringToBytes(f):v(f)?f=Array.prototype.slice.call(f,0):!Array.isArray(f)&&f.constructor!==Uint8Array&&(f=f.toString());for(var _=e.bytesToWords(f),P=8*f.length,S=1732584193,y=-271733879,E=-1732584194,I=271733878,D=0;D<_.length;D++)_[D]=16711935&(_[D]<<8|_[D]>>>24)|4278255360&(_[D]<<24|_[D]>>>8);_[P>>>5]|=128<<P%32,_[14+(P+64>>>9<<4)]=P;var x=b._ff,L=b._gg,$=b._hh,Y=b._ii;for(D=0;D<_.length;D+=16){var Q=S,ae=y,re=E,U=I;
vendor: 2,780 bytes, line 1
1S=x(S,y,E,I,_[D+0],7,-680876936),I=x(I,S,y,E,_[D+1],12,-389564586),E=x(E,I,S,y,_[D+2],17,606105819),y=x(y,E,I,S,_[D+3],22,-1044525330),S=x(S,y,E,I,_[D+4],7,-176418897),I=x(I,S,y,E,_[D+5],12,1200080426),E=x(E,I,S,y,_[D+6],17,-1473231341),y=x(y,E,I,S,_[D+7],22,-45705983),S=x(S,y,E,I,_[D+8],7,1770035416),I=x(I,S,y,E,_[D+9],12,-1958414417),E=x(E,I,S,y,_[D+10],17,-42063),y=x(y,E,I,S,_[D+11],22,-1990404162),S=x(S,y,E,I,_[D+12],7,1804603682),I=x(I,S,y,E,_[D+13],12,-40341101),E=x(E,I,S,y,_[D+14],17,-1502002290),S=L(S,y=x(y,E,I,S,_[D+15],22,1236535329),E,I,_[D+1],5,-165796510),I=L(I,S,y,E,_[D+6],9,-1069501632),E=L(E,I,S,y,_[D+11],14,643717713),y=L(y,E,I,S,_[D+0],20,-373897302),S=L(S,y,E,I,_[D+5],5,-701558691),I=L(I,S,y,E,_[D+10],9,38016083),E=L(E,I,S,y,_[D+15],14,-660478335),y=L(y,E,I,S,_[D+4],20,-405537848),S=L(S,y,E,I,_[D+9],5,568446438),I=L(I,S,y,E,_[D+14],9,-1019803690),E=L(E,I,S,y,_[D+3],14,-187363961),y=L(y,E,I,S,_[D+8],20,1163531501),S=L(S,y,E,I,_[D+13],5,-1444681467),I=L(I,S,y,E,_[D+2],9,-51403784),E=L(E,I,S,y,_[D+7],14,1735328473),S=$(S,y=L(y,E,I,S,_[D+12],20,-1926607734),E,I,_[D+5],4,-378558),I=$(I,S,y,E,_[D+8],11,-2022574463),E=$(E,I,S,y,_[D+11],16,1839030562),y=$(y,E,I,S,_[D+14],23,-35309556),S=$(S,y,E,I,_[D+1],4,-1530992060),I=$(I,S,y,E,_[D+4],11,1272893353),E=$(E,I,S,y,_[D+7],16,-155497632),y=$(y,E,I,S,_[D+10],23,-1094730640),S=$(S,y,E,I,_[D+13],4,681279174),I=$(I,S,y,E,_[D+0],11,-358537222),E=$(E,I,S,y,_[D+3],16,-722521979),y=$(y,E,I,S,_[D+6],23,76029189),S=$(S,y,E,I,_[D+9],4,-640364487),I=$(I,S,y,E,_[D+12],11,-421815835),E=$(E,I,S,y,_[D+15],16,530742520),S=Y(S,y=$(y,E,I,S,_[D+2],23,-995338651),E,I,_[D+0],6,-198630844),I=Y(I,S,y,E,_[D+7],10,1126891415),E=Y(E,I,S,y,_[D+14],15,-1416354905),y=Y(y,E,I,S,_[D+5],21,-57434055),S=Y(S,y,E,I,_[D+12],6,1700485571),I=Y(I,S,y,E,_[D+3],10,-1894986606),E=Y(E,I,S,y,_[D+10],15,-1051523),y=Y(y,E,I,S,_[D+1],21,-2054922799),S=Y(S,y,E,I,_[D+8],6,1873313359),I=Y(I,S,y,E,_[D+15],10,-30611744),E=Y(E,I,S,y,_[D+6],15,-1560198380),y=Y(y,E,I,S,_[D+13],21,1309151649),S=Y(S,y,E,I,_[D+4],6,-145523070),I=Y(I,S,y,E,_[D+11],10,-1120210379),E=Y(E,I,S,y,_[D+2],15,718787259),y=Y(y,E,I,S,_[D+9],21,-343485551),S=S+Q>>>0,y=y+ae>>>0,E=E+re>>>0,I=I+U>>>0}return e.endian([S,y,E,I])})._ff=function(f,R,_,P,S,y,E){var I=f+(R&_|~R&P)+(S>>>0)+E;return(I<<y|I>>>32-y)+R},b._gg=function(f,R,_,P,S,y,E){var I=f+(R&P|_&~P)+(S>>>0)+E;return(I<<y|I>>>32-y)+R},b._hh=function(f,R,_,P,S,y,E){var I=f+(R^_^P)+(S>>>0)+E;return(I<<y|I>>>32-y)+R},b._ii=function(f,R,_,P,S,y,E){var I=f+(_^(R|~P))+(S>>>0)+E;return(I<<y|I>>>32-y)+R},b._blocksize=16,b._digestsize=16,G.exports=function(f,R){if(null==f)throw new Error("Illegal argument "+f);var _=e.wordsToBytes(b(f,R));return R&&R.asBytes?_:R&&R.asString?C.bytesToString(_):e.bytesToHex(_)}}}]);

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.