1import{a as k}from"./chunk-Y56P754F.js";import{$ as X,Ba as we,E as ye,G as Le,H as Ve,Hb as je,I as Oe,J as Ue,K as Ne,M as D,Oa as He,P as V,V as b,W as Me,Z as De,_ as ke,b as x,c as R,d as j,da as qe,e as _e,f as y,j as Ie,l as Q,n as Ee,o as Te,r as Pe,v as xe,y as Re}from"./chunk-EKVWPU6B.js";import{$ as I,$b as H,Ba as T,Ca as me,Cb as ge,Fc as K,G as O,Ga as u,Hc as ve,Jb as S,Kb as U,L as z,Lb as M,Ma as ie,Na as ne,Nc as Se,Q as ce,R as pe,Sa as o,T as le,Ta as a,Ua as s,Va as h,Yc as be,Za as de,Zc as L,_a as he,_c as Ae,aa as E,ab as A,bb as v,cc as P,db as m,j as f,la as N,lc as Ce,pb as ue,qb as d,ra as c,rb as re,s as se,sb as fe,y as g,za as r}from"./chunk-OIBK4FWQ.js";import"./chunk-UDPOFCFO.js";var Je=()=>["mon-compte"];function Ke(t,l){if(t&1&&h(0,"app-customer-identity",5),t&2){let e=m();o("customer-id",e.subscriber.id)("customer-firstname",e.subscriber.firstname)("customer-lastname",e.subscriber.lastname)("customer-usename",e.subscriber.useName)}}function Qe(t,l){t&1&&h(0,"div",6)}function Xe(t,l){t&1&&(a(0,"div",18),d(1,"COMMON.ERRORS.INTERNALSERVERERROR"),s())}function $e(t,l){t&1&&(a(0,"div")(1,"span",19)(2,"span",2),d(3,"VEHICLES.UPDATE.LICENCEPLATE.ERROR"),s()()())}function et(t,l){if(t&1&&(a(0,"h2",12),d(1),s()),t&2){let e=m(3);c(),re(e.step.title)}}function tt(t,l){if(t&1&&(a(0,"h3",12),d(1),s()),t&2){let e=m(3);c(),re(e.step.shortText)}}function it(t,l){if(t&1&&(a(0,"div"),d(1),s()),t&2){let e=m(3);c(),fe(" ",e.step.longText," ")}}function nt(t,l){if(t&1&&(de(0),a(1,"div",11),u(2,et,2,1,"h2",20)(3,tt,2,1,"h3",20)(4,it,2,1,"div",15),s(),a(5,"div",21),h(6,"app-file-input",22),s(),he()),t&2){let e=m(2);c(2),o("ngIf",e.step.title),c(),o("ngIf",e.step.shortText),c(),o("ngIf",e.step.longText),c(2),o("form",e.form)("config",e.step)}}function rt(t,l){t&1&&h(0,"div",6)}function ot(t,l){if(t&1&&(a(0,"button",23)(1,"span",2),d(2,"VEHICLES.UPDATE.LICENCEPLATE.SAVE"),s()()),t&2){let e=m(2);o("disabled",e.form.invalid)}}function at(t,l){if(t&1){let e=A();a(0,"form",7),v("submit",function(){I(e);let i=m();return E(i.send())}),a(1,"div")(2,"h1",8)(3,"span",2),d(4,"VEHICLES.UPDATE.LICENCEPLATE.TITLE"),s()()(),u(5,Xe,2,0,"div",9),a(6,"div",10)(7,"div",11)(8,"h2",12)(9,"label",13),d(10,"VEHICLES.UPDATE.LICENCEPLATE.REGISTRATION"),s()()(),h(11,"input",14),S(12,"translate"),u(13,$e,4,0,"div",15)(14,nt,7,5,"ng-container",15),s(),a(15,"div",16),u(16,rt,1,0,"div",3)(17,ot,3,1,"button",17),s()()}if(t&2){let e=m();o("formGroup",e.form),c(5),o("ngIf",e.error),c(6),o("disabled",e.isLoading)("placeholder",U(12,8,"VEHICLES.UPDATE.LICENCEPLATE.LICENCEPLATEPLACEHOLDERREQUIRED")),c(2),o("ngIf",e.form.get("vehicleLicencePlate").hasError("maxlength")&&e.form.get("vehicleLicencePlate").touched),c(),o("ngIf",e.vehicle.isCertified),c(2),o("ngIf",e.isLoading),c(),o("ngIf",!e.isLoading)}}var Be=(()=>{class t{constructor(e,n,i,p,C,_){this.formBuilder=e,this.mainRequestService=n,this.shoppingCartService=i,this.langService=p,this.notificationService=C,this.translateService=_,this.isLoading=!1,this.docType=Ue.CarRegistration,this.error=!1}ngOnInit(){this.vehicle=this.shoppingCartService.getVehicle(),this.subscriber=this.shoppingCartService.shoppingCart?.customer,this.customerId=this.shoppingCartService.shoppingCart.customerId,this.form=this.formBuilder.group({vehicleLicencePlate:[this.vehicle?.licencePlate??null,[Q.required,Q.maxLength(10)]],type:[this.docType,Q.required]}),this.form.get("vehicleLicencePlate").valueChanges.subscribe(e=>{typeof e=="string"&&this.form.get("vehicleLicencePlate").setValue(e.toUpperCase(),{emitEvent:!1})}),this.isLoading=!0,this.mainRequestService.createMainRequest({customerId:this.customerId,identity:null,profileTypes:[],products:[]}).pipe(g(e=>this.handleCreateMainRequestError(e)),z(e=>this.handleMainRequestCreated(e))).subscribe({next:e=>this.step=e,complete:()=>this.isLoading=!1})}handleCreateMainRequestError(e){return this.isLoading=!1,e.status===409?e.error?.Entity==="Customer"||e.error?.Entity==="CustomerPersonal"?this.notificationService.innerHTMLError(this.translateService.instant("ACCOUNT.SUBSCRIBER.SUBSCRIPTIONS.BUY.IDENTITY.DUPLICATECUSTOMER")):this.notificationService.error(this.translateService.instant("ACCOUNT.SUBSCRIBER.SUBSCRIPTIONS.BUY.IDENTITY.ALREADYPENDINGERROR")):this.notificationService.error(this.translateService.instant("COMMON.ERRORS.INTERNALSERVERERROR")),f()}handleMainRequestCreated(e){return this.mainRequestId=e.id,this.shoppingCartService.setMainRequestId(e.id),this.addVehicleRequest(e.id)}addVehicleRequest(e){return this.mainRequestService.addVehicleUpdateRequest(e,{vehicleId:this.vehicle.id,vehicleLicencePlate:this.vehicle.licencePlate,name:this.vehicle.name,mustBeCertified:this.vehicle.isCertified,productId:-1}).pipe(g(()=>(this.isLoading=!1,this.error=!0,f())),z(n=>(this.shoppingCartService.setVehicleRequestId(n),this.getLicencePlateDocumentation(e))))}getLicencePlateDocumentation(e){return this.mainRequestService.getLicencePlateDocumentation(e,this.langService.currentLang,this.shoppingCartService.getVehicleId()).pipe(g(()=>(this.error=!0,f())),O(()=>this.isLoading=!1))}send(){this.isLoading=!0;var e=this.form?.getRawValue()?.files;let n=new FormData;if(this.vehicle.isCertified){if(n.set("type",this.form?.getRawValue()?.type),this.form?.getRawValue()?.files[0])for(let i=0;i<this.form?.getRawValue()?.files?.length;i++)n.append("files[]",this.form?.getRawValue()?.files[i]);if(!e&&this.vehicle.isCertified)return}
1this.form.invalid||this.mainRequestService.updateLicencePlate(this.mainRequestId,this.vehicle.id,this.form.get("vehicleLicencePlate")?.value,n).pipe(g((i,p)=>(this.isLoading=!1,this.error=!0,f())),O(()=>{this.isLoading=!1})).subscribe(()=>{this.langService.navigateWithLangPrefix(["vehicules","modification-plaque-immatriculation-terminee"])})}static{this.\u0275fac=function(n){return new(n||t)(r(Le),r(b),r(V),r(L),r(y),r(x))}}static{this.\u0275cmp=T({type:t,selectors:[["app-vehicle-update-licence-plate"]],standalone:!1,decls:7,vars:5,consts:[[3,"customer-id","customer-firstname","customer-lastname","customer-usename",4,"ngIf"],["color","primary",3,"routerLinkWithLangPrefix"],["translate",""],["class","spinner",4,"ngIf"],[3,"formGroup","submit",4,"ngIf"],[3,"customer-id","customer-firstname","customer-lastname","customer-usename"],[1,"spinner"],[3,"submit","formGroup"],[1,"title"],["class","error","translate","",4,"ngIf"],[1,"form-field"],[1,"step-title"],[1,"sub-title"],["for","licencePlate","translate",""],["id","licencePlate","name","licencePlate","autocomplete","off","type","text","maxlength","10","formControlName","vehicleLicencePlate",3,"disabled","placeholder"],[4,"ngIf"],[1,"btn-group"],["color","primary","class","btn-save","type","submit",3,"disabled",4,"ngIf"],["translate","",1,"error"],[1,"error-message"],["class","sub-title",4,"ngIf"],[1,"document-input"],[3,"form","config"],["color","primary","type","submit",1,"btn-save",3,"disabled"]],template:function(n,i){n&1&&(u(0,Ke,1,4,"app-customer-identity",0),a(1,"button",1)(2,"span",2),d(3,"VEHICLES.UPDATE.LICENCEPLATE.BACK"),s()(),a(4,"div"),u(5,Qe,1,0,"div",3)(6,at,18,10,"form",4),s()),n&2&&(o("ngIf",i.subscriber),c(),o("routerLinkWithLangPrefix",ge(4,Je)),c(4),o("ngIf",i.isLoading),c(),o("ngIf",!i.isLoading&&i.step))},dependencies:[P,Me,D,qe,Pe,Ie,Ee,Te,ye,R,xe,Re,j],styles:["[_nghost-%COMP%]{max-width:1200px;margin:auto;padding:1em calc(3% + .2em) 1.5em;height:100%;flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch center;align-items:stretch;gap:15px}[_nghost-%COMP%] > div[_ngcontent-%COMP%]{flex:1 1 auto}[_nghost-%COMP%] .title[_ngcontent-%COMP%]{margin:.25em 0 .5em}button[_ngcontent-%COMP%]{width:fit-content}[_nghost-%COMP%] form button{font-size:14px;height:50px;width:100%}@media (max-width: 652px){[_nghost-%COMP%] form button{font-size:12px}}.step-title[_ngcontent-%COMP%]{margin:1.8em 0 .5em}.step-title[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin:0 0 .2em;text-align:center;width:100%}.form-field[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}form[_ngcontent-%COMP%]{max-width:700px;margin:0 auto 1em}.btn-save[_ngcontent-%COMP%]{margin-top:5px}.document-input[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column}"]})}}return t})();function ct(t,l){if(t&1&&h(0,"app-customer-identity",7),t&2){let e=m();o("customer-id",e.customer.id)("customer-firstname",e.customer.firstname)("customer-lastname",e.customer.lastname)("customer-usename",e.customer.useName)}}function pt(t,l){t&1&&(h(0,"p",4),S(1,"translate"),S(2,"safe")),t&2&&o("innerHtml",M(2,3,U(1,1,"VEHICLES.UPDATE.LICENCEPLATE.END.MESSAGEVALIDATION"),"html"),N)}function lt(t,l){t&1&&(h(0,"p",4),S(1,"translate"),S(2,"safe")),t&2&&o("innerHtml",M(2,3,U(1,1,"VEHICLES.UPDATE.LICENCEPLATE.END.MESSAGENOVALIDATION"),"html"),N)}var Fe=(()=>{class t{constructor(e,n,i,p,C){this.shoppingCartService=e,this.mainRequestsService=n,this.notificationService=i,this.translateService=p,this.langService=C,this.isLoading=!1,this.needValidation=!1}ngOnInit(){this.customer=this.shoppingCartService.shoppingCart?.customer;let e=this.shoppingCartService.shoppingCart?.mainRequestId;if(this.isLoading=!0,!e){this.langService.navigateWithLangPrefix(["mon-compte"]).then(()=>this.notificationService.warning(this.translateService.instant("COMMON.ERRORS.NOSHOPPINGCART")));return}se({validation:this.mainRequestsService.needValidation(e)}).pipe(O(()=>this.isLoading=!1),g((n,i)=>(this.notificationService.error(this.translateService.instant("ACCOUNT.SUBSCRIBER.SUBSCRIPTIONS.BUY.END.FETCHERROR")),f()))).subscribe(n=>{this.needValidation=n.validation,this.shoppingCartService.stopShoppingSession()})}goToAccount(){this.langService.navigateWithLangPrefix(["mon-compte"])}static{this.\u0275fac=function(n){return new(n||t)(r(V),r(b),r(y),r(x),r(L))}}static{this.\u0275cmp=T({type:t,selectors:[["app-vehicle-update-licence-plate-end"]],standalone:!1,decls:12,vars:9,consts:[[3,"customer-id","customer-firstname","customer-lastname","customer-usen
1ame",4,"ngIf"],["translate","",1,"title"],[1,"validation-message"],[3,"innerHtml",4,"ngIf"],[3,"innerHtml"],["color","primary",3,"click"],["translate",""],[3,"customer-id","customer-firstname","customer-lastname","customer-usename"]],template:function(n,i){n&1&&(u(0,ct,1,4,"app-customer-identity",0),a(1,"h1",1),d(2,"VEHICLES.UPDATE.LICENCEPLATE.END.TITLE"),s(),a(3,"div",2),u(4,pt,3,6,"p",3)(5,lt,3,6,"p",3),h(6,"p",4),S(7,"translate"),S(8,"safe"),s(),a(9,"button",5),v("click",function(){return i.goToAccount()}),a(10,"span",6),d(11,"VEHICLES.UPDATE.LICENCEPLATE.END.CLOSE"),s()()),n&2&&(o("ngIf",i.customer),c(4),o("ngIf",i.needValidation),c(),o("ngIf",!i.needValidation),c(),o("innerHtml",M(8,6,U(7,4,"VEHICLES.UPDATE.LICENCEPLATE.END.THANKS"),"html"),N))},dependencies:[P,D,R,X,j],styles:["[_nghost-%COMP%]{max-width:1200px;margin:auto;padding:1em calc(3% + .2em) 1.5em;height:100%;display:flex;flex-direction:column}[_nghost-%COMP%] .validation-message[_ngcontent-%COMP%]{flex:1 0 auto;display:flex;flex-direction:column}[_nghost-%COMP%] button[_ngcontent-%COMP%]{margin-left:auto}.mticket-logo-picture[_ngcontent-%COMP%]{cursor:pointer;margin:1em 0 0;position:relative;align-items:center;display:flex;justify-content:center;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mticket-logo-picture[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:50px;filter:brightness(0) saturate(100%) invert(10%) sepia(99%) saturate(2310%) hue-rotate(194deg) brightness(94%) contrast(101%)}.mticket-logo-picture[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{margin-left:5px}@media (min-width: 600px){.validation-message[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{padding-bottom:10vh}}"]})}}return t})();var q=(()=>{class t{constructor(e){this.localStorage=e,this.loadUpdateSector()}loadUpdateSector(){this._cart=this.localStorage.get("update-sector")||null}initUpdateSectorCart(){this._cart={id:null,needRequest:!1,onStreetParkingProfileTypeId:-1,vehicle:null,vehicleProfileTypeId:-1}
1,this.saveCart()}stopUpdateSectorSession(){this._cart=null,this.saveCart()}setVehicle(e){this._cart&&(this._cart.vehicle=e,this.saveCart())}getVehicle(){return this._cart.vehicle}setOnStreetParkingProfileTypeId(e){this._cart&&(this._cart.onStreetParkingProfileTypeId=e,this.saveCart())}getOnStreetParkingProfileTypeId(){return this._cart.onStreetParkingProfileTypeId}setVehicleProfileTypeId(e){this._cart&&(this._cart.vehicleProfileTypeId=e,this.saveCart())}getVehicleProfileTypeId(){return this._cart.vehicleProfileTypeId}setNeedRequest(e){this._cart&&(this._cart.needRequest=e,this.saveCart())}getNeedRequest(){return this._cart.needRequest}saveCart(){this.localStorage.set("update-sector",this._cart)}static{this.\u0275fac=function(n){return new(n||t)(le(be))}}static{this.\u0275prov=ce({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function mt(t,l){t&1&&h(0,"div",3)}function dt(t,l){t&1&&(a(0,"div",2),d(1,"ACCOUNT.SUBSCRIBER.SUBSCRIPTIONS.BUY.SECTOR.COORDINATEERROR"),s())}function ht(t,l){t&1&&(a(0,"div",4),d(1,"ACCOUNT.SUBSCRIBER.SUBSCRIPTIONS.BUY.SECTOR.ADDRESSNOTINPAIDPARKINGZONE"),s())}function ut(t,l){t&1&&h(0,"span",8)}function ft(t,l){if(t&1){let e=A();a(0,"app-parking-zone-selection",5),v("zonesSelected",function(i){I(e);let p=m(2);return E(p.selectParkingZones(i))}),s(),a(1,"button",6),v("click",function(){I(e);let i=m(2);return E(i.confirm())}),d(2," VEHICLES.UPDATE.CONTRACT.SECTOR.CONFIRM "),u(3,ut,1,0,"span",7),s()}if(t&2){let e=m(2);o("noHomeSector",!e.homeSectorId)("centerCoordinates",e.centerCoordinates)("geoJson",e.geoJson)("maxParkingZones",e.maxParkingZones),c(),o("disabled",!e.homeSectorId||e.maxParkingZones-e.selectParkingZone.length!=0||e.isSaving),c(2),o("ngIf",e.isSaving)}}function gt(t,l){if(t&1&&ie(0,dt,2,0,"div",2)(1,ht,2,0,"div",4)(2,ft,4,6),t&2){let e=m();ne(e.noCoordinate?0:e.noParkFound?1:2)}}var ze=(()=>{class t{constructor(e,n,i,p,C,_,B,F){this.parkingService=e,this.langService=n,this.updateSectorService=i,this.location=p,this.translateService=C,this.notificationService=_,this.mainRequestService=B,this.shoppingCartService=F,this.isLoading=!1,this.isSaving=!1,this.selectParkingZone=[],this.noCoordinate=!1,this.noParkFound=!1,this.maxParkingZones=-1,this.error=!1}ngOnInit(){this.isLoading=!0;var e=this.shoppingCartService.shoppingCart.customerCoordinates;if(e.latitude==null||e.longitude==null){this.noCoordinate=!0,this.isLoading=!1;return}this.centerCoordinates=[e.longitude,e.latitude];let n=this.updateSectorService.getOnStreetParkingProfileTypeId();this.parkingService.getParkingForCustomer(e,n).pipe(O(()=>{this.isLoading=!1}),g(i=>(i.status==404&&(this.noParkFound=!0),f()))).subscribe(i=>{this.geoJson=i,this.geoJson==null&&this.confirm(),this.homeSectorId=i.features.find(_=>_.properties.homesector==!0)?.properties?.sectorID;var p=this.parkingService.getMaxParkingZones(this.homeSectorId),C=this.geoJson?.features?.filter(_=>_?.properties?.authorized)?.length??0;this.maxParkingZones=Math.min(p,C),this.isLoading=!1})}back(){this.location.back()}selectParkingZones(e){this.selectParkingZone=e}confirm(){(!this.homeSectorId||this.maxParkingZones-this.selectParkingZone.length!=0)&&this.geoJson!=null||(this.isSaving=!0,this.mainRequestService.addVehicleProfileRequest(this.shoppingCartService.shoppingCart.mainRequestId,{vehicleProfileTypeId:this.updateSectorService.getVehicleProfileTypeId(),sectorIds:this.selectParkingZone,vehicleId:this.updateSectorService.getVehicle().id,vehicleRequestId:null,productIds:[],isSectorUpdateRequest:!0}).pipe(g(()=>(this.isSaving=!1,this.error=!0,f()))).subscribe(()=>{this.updateSectorService.getNeedRequest()?this.langService.navigateWithLangPrefix(["vehicules",this.updateSectorService.getVehicle().id,"profils"]):this.mainRequestService.terminateMainRequest(this.shoppingCartService.shoppingCart?.mainRequestId).pipe(O(()=>{this.isLoading=!1,this.isSaving=!1}),g((e,n)=>(this.error=!0,this.isLoading=!1,this.notificationService.error(this.translateService.instant("VEHICLES.UPDATE.CONTRACT.SAVEATTACHEMENTERROR")),f()))).subscribe(()=>{this.langService.navigateWithLangPrefix(["vehicules","modification-secteurs-terminee"])})}))}static{this.\u0275fac=function(n){return new(n||t)(r(we),r(L),r(q),r(H),r(x),r(y),r(b),r(V))}}static{this.\u0275cmp=T({type:t,selectors:[["app-vehicle-update-contract-sector"]],standalone:!1,decls:7,vars:1,consts:[["translate","",1,"title"],["color","primary",1,"go-back",3,"click"],["translate",""],[1,"spinner"],["translate","",1,"error"],[3,"zonesSelected","noHomeSector","centerCoordinates","geoJson","maxParkingZones"],["color","primary","translate","",1,"confirm",3,"click","disabled"],["class","inline-spinner",4,"ngIf"],[1,"inline-spinner"]],template:function(n,i){n&1&&(a(0,"h1",0),d(1,"VEHICLES.UPDATE.CONTRACT.SECTOR.TITLE"),s(),a(2,"button",1),v("click",function(){return i.back()}),a(3,"span",2),d(4,"VEHICLES.UPDATE.CONTRACT.BACK"),s()(),ie(5,mt,1,0,"div",3)(6,gt,3,1)),n&2&&(c(5),ne(i.isLoading?5:6))},dependencies:[P,He,R],styles:["[_nghost-%COMP%]{max-width:1200px;margin:auto;padding:1em calc(3% + .2em) 1.5em;height:100%}.go-back[_ngcontent-%COMP%]{margin-bottom:1em}.confirm[_ngcontent-%COMP%]{margin-left:auto}"]})}}return t})();function vt(t,l){if(t&1){let e=A();a(0,"button",2),v("click",function(){I(e);let i=m();return E(i.goBack())}),a(1,"span",3),d(2,"VEHICLES.UPDATE.CONTRACT.BACK"),s()()}}function St(t,l){t&1&&h(0,"div",7)}function _t(t,l){if(t&1){let e=A();a(0,"div")(1,"h1",4),d(2,"VEHICLES.UPDATE.CONTRACT.CONFIRMIDENTITY"),s(),u(3,St,1,0,"div",5),a(4,"app-identity-form",6),v("form-submitted",function(i){I(e);let p=m();return E(p.sendForm(i))})("form-canceled",function(){I(e);let i=m();return E(i.goBack())}),s()()}if(t&2){let e=m();c(3),o("ngIf",e.isLoading),c(),ue(e.isLoading?"hide":""),o("customer-id",e.customerId)("identity-readonly",e.identityReadonly)}}var Ze=(()=>{class t{constructor(e,n,i,p,C,_,B,F,te,Ye){this.router=e,this.langService=n,this.location=i,this.mainRequestService=p,this.updateSectorService=C,this.accountService=_,this.route=B,this.shoppingCartService=F,this.notificationService=te,this.translateService=Ye,this.isLoading=!1,this.identityReadonly=!0,this.error=!1,this.updateSectorService.initUpdateSectorCart(),this.shoppingCartService.startShoppingSessionWithoutCustomerIdentity(this.customerId),this.setInformation()}ngOnInit(){if(this.isLoading=!0,this.customerId=Number(this.route.
1snapshot.paramMap.get("customerId")),!this.customerId){this.langService.navigateWithLangPrefix(["mon-compte"]).then(()=>this.notificationService.warning(this.translateService.instant("COMMON.ERRORS.MISSINGSUBSCRIBERID")));return}this.isLoading=!1}setInformation(){let e=this.router.currentNavigation()?.extras.state?.contract;(e!=null||e!=null)&&(this.updateSectorService.setOnStreetParkingProfileTypeId(e.onStreetParkingProfileTypeId),this.updateSectorService.setVehicleProfileTypeId(e.vehicleProfileTypeId));let n=this.router.currentNavigation()?.extras.state?.vehicle;(n!=null||n!=null)&&this.updateSectorService.setVehicle(n)}sendForm(e){this.isLoading=!0,this.originalCoordinate=this.shoppingCartService.shoppingCart.customerCoordinates;let n=e.coordinate.longitude!=this.originalCoordinate.longitude&&e.coordinate.latitude!=this.originalCoordinate.latitude;this.mainRequestService.createMainRequest({customerId:this.customerId,identity:n?e:null,profileTypes:[],products:[]}).pipe(z(i=>(e&&(this.shoppingCartService.setCustomerCoordinates(e.coordinate),this.updateSectorService.setNeedRequest(n)),this.shoppingCartService.setMainRequestId(i.id),this.customerId=i.customerId,this.accountService.getSubscriber(i.customerId))),g((i,p)=>(this.isLoading=!1,i.status===409?i.error?.Entity==="Customer"||i.error?.Entity==="CustomerPersonal"?this.notificationService.innerHTMLError(this.translateService.instant("VEHICLES.UPDATE.CONTRACT.DUPLICATECUSTOMER")):this.notificationService.error(this.translateService.instant("VEHICLES.UPDATE.CONTRACT.ALREADYPENDINGERROR")):this.notificationService.error(this.translateService.instant("COMMON.ERRORS.INTERNALSERVERERROR")),f()))).subscribe(i=>{this.shoppingCartService.setCustomer(i),this.next()})}goBack(){this.location.back()}next(){if(!(!this.customerId||!this.shoppingCartService.shoppingCart?.mainRequestId)){if(this.shoppingCartService.shoppingCart.returnUrl){this.langService.navigateWithLangPrefix(this.shoppingCartService.shoppingCart.returnUrl);return}this.langService.navigateWithLangPrefix(["vehicules",this.updateSectorService.getVehicle().id,"secteurs"])}}static{this.\u0275fac=function(n){return new(n||t)(r(ve),r(L),r(H),r(b),r(q),r(Ne),r(K),r(V),r(y),r(x))}}static{this.\u0275cmp=T({type:t,selectors:[["app-vehicle-update-contract-sector-identity"]],standalone:!1,decls:2,vars:2,consts:[["color","primary","type","button",3,"click",4,"ngIf"],[4,"ngIf"],["color","primary","type","button",3,"click"],["translate",""],["translate","",1,"title"],["class","spinner",4,"ngIf"],[3,"form-submitted","form-canceled","customer-id","identity-readonly"],[1,"spinner"]],template:function(n,i){n&1&&u(0,vt,3,0,"button",0)(1,_t,5,5,"div",1),n&2&&(o("ngIf",i.error),c(),o("ngIf",!i.error))},dependencies:[P,ke,R],styles:["[_nghost-%COMP%]{max-width:1200px;margin:auto;padding:1em calc(3% + .2em) 1.5em;height:100%}[_nghost-%COMP%] > div[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center}.hide[_ngcontent-%COMP%]{display:none}"]})}}return t})();function It(t,l){if(t&1&&h(0,"app-customer-identity",7),t&2){let e=m();o("customer-id",e.customer.id)("customer-firstname",e.customer.firstname)("customer-lastname",e.customer.lastname)("customer-usename",e.customer.useName)}}function Et(t,l){t&1&&(h(0,"p",4),S(1,"translate"),S(2,"safe")),t&2&&o("innerHtml",M(2,3,U(1,1,"VEHICLES.UPDATE.CONTRACT.END.MESSAGEVALIDATION"),"html"),N)}function Tt(t,l){t&1&&(h(0,"p",4),S(1,"translate"),S(2,"safe")),t&2&&o("innerHtml",M(2,3,U(1,1,"VEHICLES.UPDATE.CONTRACT.END.MESSAGENOVALIDATION"),"html"),N)}var Ge=(()=>{class t{constructor(e,n,i,p,C){this.langService=e,this.updateSectorService=n,this.shoppingCartService=i,this.notificationService=p,this.translateService=C,this.isLoading=!1,this.identityReadonly=!0,this.error=!1,this.needValidation=!1}ngOnInit(){this.customer=this.shoppingCartService.shoppingCart?.customer;let e=this.shoppingCartService.shoppingCart?.mainRequestId;if(this.isLoading=!0,!e){this.langService.navigateWithLangPrefix(["mon-compte"]).then(()=>this.notificationService.warning(this.translateService.instant("COMMON.ERRORS.NOSHOPPINGCART")));return}this.needValidation=this.updateSectorService.getNeedRequest(),this.updateSectorService.stopUpdateSectorSession(),this.shoppingCartService.stopShoppingSession(),this.isLoading=!1}goToAccount(){this.langService.navigateWithLangPrefix(["mon-compte"])}static{this.\u0275fac=function(n){return new(n||t)(r(L),r(q),r(V),r(y),r(x))}}static{this.\u0275cmp=T({type:t,selectors:[["app-vehicle-update-contract-sector-end"]],standalone:!1,decls:12,vars:9,consts:[[3,"customer-id","customer-firstname","customer-lastname","customer-usen
1ame",4,"ngIf"],["translate","",1,"title"],[1,"validation-message"],[3,"innerHtml",4,"ngIf"],[3,"innerHtml"],["color","primary",3,"click"],["translate",""],[3,"customer-id","customer-firstname","customer-lastname","customer-usename"]],template:function(n,i){n&1&&(u(0,It,1,4,"app-customer-identity",0),a(1,"h1",1),d(2,"VEHICLES.UPDATE.CONTRACT.END.TITLE"),s(),a(3,"div",2),u(4,Et,3,6,"p",3)(5,Tt,3,6,"p",3),h(6,"p",4),S(7,"translate"),S(8,"safe"),s(),a(9,"button",5),v("click",function(){return i.goToAccount()}),a(10,"span",6),d(11,"VEHICLES.UPDATE.CONTRACT.END.CLOSE"),s()()),n&2&&(o("ngIf",i.customer),c(4),o("ngIf",i.needValidation),c(),o("ngIf",!i.needValidation),c(),o("innerHtml",M(8,6,U(7,4,"VEHICLES.UPDATE.CONTRACT.END.THANKS"),"html"),N))},dependencies:[P,D,R,X,j],styles:["[_nghost-%COMP%]{max-width:1200px;margin:auto;padding:1em calc(3% + .2em) 1.5em;height:100%}"]})}}return t})();function Pt(t,l){if(t&1&&h(0,"app-customer-identity",6),t&2){let e=m();o("customer-id",e.subscriber.id)("customer-firstname",e.subscriber.firstname)("customer-lastname",e.subscriber.lastname)("customer-usename",e.subscriber.useName)}}function xt(t,l){t&1&&h(0,"div",7)}function Rt(t,l){if(t&1){let e=A();a(0,"app-dynamic-form",8),v("form-submitted",function(i){I(e);let p=m();return E(p.send(i))})("form-ignored",function(i){I(e);let p=m();return E(p.send(i,!0))}),s()}if(t&2){let e=m();o("steps-configs",e.steps)}}var ae=(()=>{class t{constructor(e,n,i,p,C,_,B,F,te){this.route=e,this.shoppingCartService=n,this.updateSectorService=i,this.langService=p,this.translateService=C,this.mainRequestsService=_,this.location=B,this.notificationService=F,this.authService=te,this.isLoading=!1,this.isMobile=!1}ngOnInit(){this.subscriber=this.shoppingCartService.shoppingCart?.customer,this.isMobile=this.authService.isAuthenticatedFromMTicket(),this.loadStepConfiguration()}send(e,n=!1){if(!e?.type||!this.shoppingCartService.shoppingCart?.mainRequestId)return;let i=new FormData;i.set("type",e.type);let p;n||e.files.map(C=>i.append("files[]",C)),p=this.mainRequestsService.addFileAttachement(this.shoppingCartService.shoppingCart?.mainRequestId,i),p&&(this.isLoading=!0,p.pipe(g((C,_)=>(this.isLoading=!1,this.notificationService.error(this.translateService.instant("VEHICLES.UPDATE.CONTRACT.SAVEATTACHEMENTERROR")),f()))).subscribe(()=>{this.isLoading=!1,this.steps&&this.steps.length===+this.step?this.terminateMainRequest():this.langService.navigateWithLangPrefix(["vehicules",this.updateSectorService.getVehicle().id,"profils","etapes",+this.step+1])}))}back(){this.location.back()}loadStepConfiguration(){let e=this.shoppingCartService.shoppingCart?.mainRequestId;if(!e){this.langService.navigateWithLangPrefix(["mon-compte"]);return}this.isLoading=!0,this.mainRequestsService.getFormStepsConfiguration(e,this.shoppingCartService.shoppingCart?.items.map(n=>n.productId)||[],this.langService.currentLang,this.updateSectorService.getVehicle().id).pipe(O(()=>this.isLoading=!1),g((n,i)=>(this.notificationService.error(this.translateService.instant("VEHICLES.UPDATE.CONTRACT.FETCHERROR")),f()))).subscribe(n=>{n!==null&&(this.steps=[],n.forEach(i=>{this.steps.some(p=>p.docType===i.docType)||(i.order=this.steps.length+1,this.steps.push(i))}),this.route.params.subscribe(i=>{this.step=i.step||1,this.steps.length<this.step&&this.terminateMainRequest()}))})}terminateMainRequest(){this.isLoading=!0,this.mainRequestsService.terminateMainRequest(this.shoppingCartService.shoppingCart?.mainRequestId).pipe(O(()=>this.isLoading=!1),g((e,n)=>(this.notificationService.error(this.translateService.instant("VEHICLES.UPDATE.CONTRACT.SAVEATTACHEMENTERROR")),f()))).subscribe(()=>{this.langService.navigateWithLangPrefix(["vehicules","modification-secteurs-terminee"])})}static{this.\u0275fac=function(n){return new(n||t)(r(K),r(V),r(q),r(L),r(x),r(b),r(H),r(y),r(Ae))}}static{this.\u0275cmp=T({type:t,selectors:[["app-vehicle-update-contract-profiles"]],standalone:!1,decls:8,vars:3,consts:[[3,"customer-id","customer-firstname","customer-lastname","customer-usename",4,"ngIf"],[1,"back-button-container"],["type","button","color","primary",3,"click"],["translate",""],["class","spinner",4,"ngIf"],[3,"steps-configs","form-submitted","form-ignored",4,"ngIf"],[3,"customer-id","customer-firstname","customer-lastname","customer-usen
1ame"],[1,"spinner"],[3,"form-submitted","form-ignored","steps-configs"]],template:function(n,i){n&1&&(a(0,"div"),u(1,Pt,1,4,"app-customer-identity",0),a(2,"div",1)(3,"button",2),v("click",function(){return i.back()}),a(4,"span",3),d(5,"VEHICLES.UPDATE.CONTRACT.BACK"),s()()(),u(6,xt,1,0,"div",4)(7,Rt,1,1,"app-dynamic-form",5),s()),n&2&&(c(),o("ngIf",i.subscriber),c(5),o("ngIf",i.isLoading),c(),o("ngIf",!i.isLoading&&i.steps))},dependencies:[P,De,D,R],styles:["[_nghost-%COMP%]{max-width:1200px;margin:auto;padding:1em calc(3% + .2em) 1.5em;height:100%;position:relative}[_nghost-%COMP%] > div[_ngcontent-%COMP%]{display:flex;flex-direction:column}.back-button-container[_ngcontent-%COMP%], app-customer-identity[_ngcontent-%COMP%]{max-width:1200px;margin:auto;width:100%;padding:0 1em}app-customer-identity[_ngcontent-%COMP%]{margin-top:.5em}"]})}}return t})();var We=[{path:":id/plaque-immatriculation",component:Be,pathMatch:"full",canActivate:[k]},{path:":id/secteurs",component:ze,pathMatch:"full",canActivate:[k]},{path:":id/identite/:customerId",component:Ze,pathMatch:"full",canActivate:[k]},{path:"modification-plaque-immatriculation-terminee",component:Fe,pathMatch:"full",canActivate:[k]},{path:"modification-secteurs-terminee",component:Ge,pathMatch:"full",canActivate:[k]},{path:":id/profils",component:ae,pathMatch:"full",canActivate:[k]},{path:":id/profils/etapes/:step",component:ae,pathMatch:"full",canActivate:[k]}];var Ei=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275mod=me({type:t})}static{this.\u0275inj=pe({imports:[Ce,je,Ve,[Se.forChild(We)],_e.forChild({extend:!0}),Oe]})}}return t})();export{Ei as VehiclesModule};
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.