Files
kapp/7426.598b82812c7ebbc1.js
2026-05-21 11:19:10 -03:00

1 line
14 KiB
JavaScript

(self.webpackChunkapp=self.webpackChunkapp||[]).push([[7426],{37426:(C,h,r)=>{r.r(h),r.d(h,{EventNamePageModule:()=>O});var E=r(61380),e=r(45449),g=r(24006),c=r(47898),f=r(37763),p=r(90944),v=r(90603),m=r(36290),a=r(99826);function _(t,s){1&t&&(e.\u0275\u0275elementStart(0,"div",13),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"PG_CREATE_LG_NAME_STEP_TEXT_ENTRY")," "))}function T(t,s){1&t&&(e.\u0275\u0275elementStart(0,"div",13),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"PG_CREATE_LG_NAME_STEP_TEXT_EXIT")," "))}function S(t,s){if(1&t&&(e.\u0275\u0275elementStart(0,"div",16),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&t){const i=s.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(i.message)}}function N(t,s){if(1&t&&(e.\u0275\u0275elementStart(0,"div",14),e.\u0275\u0275template(1,S,2,1,"div",15),e.\u0275\u0275elementEnd()),2&t){const i=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",i.eventTitleFormErrors)}}function P(t,s){if(1&t){const i=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ion-row")(1,"ion-col",4)(2,"div",9)(3,"button",17),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(i);const l=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(l.goToCreateEventFromExit())}),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd()()()()}2&t&&(e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(5,1,"PG_CREATE_LG_NAME_STEP_BTN_CREATE_FROM_EXIT")," "))}function I(t,s){if(1&t){const i=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ion-row")(1,"ion-col",4)(2,"div",9)(3,"button",17),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(i);const l=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(l.goToCreateEventFromEntry())}),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd()()()()}2&t&&(e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(5,1,"PG_CREATE_LG_NAME_STEP_BTN_CREATE_FROM_ENTRY")," "))}let L=(()=>{class t{constructor(i,n,l,R,M,A,w,F,B,D){this.formBuilder=i,this.notificatorService=n,this.navigationService=l,this.createLogisticEventService=R,this.commonService=M,this.activatedRoute=A,this.router=w,this.resumeCreateEventInterruptedService=F,this.translateConfigService=B,this.focusService=D,this.approveEventReview="",this.action=null,this.navigateToPendingLiberations=()=>{this.navigationService.forward(["/push-notifications"])},this.navigateToQRCode=()=>{this.navigationService.forward(["/home"])},this.goToLogisticEventResume=()=>{const u={state:{event:{id:this.createLogisticEventService.getId(),title:this.createLogisticEventService.getTitle(),startAt:this.createLogisticEventService.getStartDate(),endAt:this.createLogisticEventService.getEndDate(),driver:this.createLogisticEventService.getDriver(),assistants:this.createLogisticEventService.getAssistants(),licensePlateOne:this.createLogisticEventService.getLicensePlateOne(),licensePlateTwo:this.createLogisticEventService.getLicensePlateTwo(),hasCart:this.createLogisticEventService.getHasCart(),onFoot:this.createLogisticEventService.getOnFoot(),needAuthorization:this.createLogisticEventService.getNeedAuthorization(),notes:this.createLogisticEventService.getNotes(),locator:this.createLogisticEventService.getLocator(),useOwnLocator:this.createLogisticEventService.getUseOwnLocator(),useLocatorPreAuthorized:this.createLogisticEventService.getUseLocatorPreAuthorized(),locatorPreAuthorized:this.createLogisticEventService.getLocatorPreAuthorized()}}};this.navigationService.forward(["/logistic-events/create/event-resume"],u)},this.onSubmit=()=>{this.cleanValidationErrors();const o=this.commonService.clearString(this.eventTitleForm.controls.title.value),d=this.validateInput({title:o});if(d.length){this.setValidationErrors(d);const b={title:this.translateConfigService.translate("TOAST_INVALID_DATA_TITLE"),message:this.translateConfigService.translate("TOAST_INVALID_DATA_NESSAGE"),type:"error"};this.notificatorService.notify(b)}else this.createLogisticEventService.setTitle(o),this.navigationService.forward(["/logistic-events/create/event-date-time"]),this.setResumeCreationInterrupte()},this.validateInput=o=>{const u=[],d=this.validateTitleInput(o);return d&&u.push(d),u},this.validateTitleInput=o=>!o.title||o.title.length<1?{message:this.translateConfigService.translate("PG_CREATE_LG_NAME_STEP_ERROR_INPUT_TITLE"),field:"title"}:null,this.goToCreateEventFromEntry=()=>{this.navigationService.forward(["/logistic-events/entrance"],{state:{context:"VIEWING_TO_CREATE_FROM"}})},this.goToCreateEventFromExit=()=>{this.navigationService.forward(["/logistic-events/exit"],{state:{context:"VIEWING_TO_CREATE_FROM"}})},this.goOneStepBack=()=>{this.cleanValidationErrors(),this.createLogisticEventService.clearCreateEventData(),this.createLogisticEventService.getIsNew()?this.navigationService.forward(["/home"]):this.navigationService.forward(["/logistic-events"])},this.setValidationErrors=o=>{console.log("setValidationErrors:",o),this.eventTitleFormErrors=o},this.cleanValidationErrors=()=>{this.eventTitleFormErrors=[]},this.showCloneEventFromEntryMessage=()=>"EXIT"===this.eventType&&("create"===this.action||"edit"===this.action),this.showCloneEventFromExitMessage=()=>"ENTRY"===this.eventType&&("create"===this.action||"edit"===this.action),this.eventTitleForm=this.formBuilder.group({title:[""]}),this.getParansNavigation()}ionViewDidEnter(){this.loadData(this.event)}ionViewWillEnter(){this.focusService.applyFocusQuerySelector("create_event_name",3500)}ionViewDidLeave(){}loadData(i){console.log(i),i&&this.createLogisticEventService.setEventToEdit(i);let n=null;"create"===this.action&&!this.resumeEventInterrupted&&!this.onBack&&!i&&this.createLogisticEventService.clearCreateEventData(),("edit"===this.action||this.resumeEventInterrupted||this.onBack||this.event?.title)&&(n=this.event?.title||this.createLogisticEventService.getTitle()),this.createLogisticEventService.setAction(this.action),this.createLogisticEventService.setType(this.eventType),this.createLogisticEventService.setApproveEventReview(this.approveEventReview),this.eventTitleForm.patchValue({title:n}),this.eventTitleFormErrors=[],"approve-event-review"===this.createLogisticEventService.getAction()&&this.goToLogisticEventResume()}getParansNavigation(){this.activatedRoute.queryParams.subscribe(()=>{this.router.getCurrentNavigation()?.extras?.state&&(this.event=this.router.getCurrentNavigation()?.extras?.state?.event,this.eventType=this.router.getCurrentNavigation()?.extras?.state?.eventType?this.router.getCurrentNavigation()?.extras?.state?.eventType:this.createLogisticEventService.getType(),this.tittleHeader=this.translateConfigService.translate("ENTRY"===this.eventType||"CLONE_EXIT"===this.eventType?"PG_CREATE_LG_NAME_STEP_HEADER_TITLE_ENTRY":"PG_CREATE_LG_NAME_STEP_HEADER_TITLE_EXIT"),this.action=this.router.getCurrentNavigation().extras.state.action?this.router.getCurrentNavigation().extras.state.action:null,this.approveEventReview=this.router.getCurrentNavigation().extras.state.approveEventReview?this.router.getCurrentNavigation().extras.state.approveEventReview:"",this.resumeEventInterrupted=!!this.router.getCurrentNavigation().extras.state.resumeEventInterrupted&&this.router.getCurrentNavigation().extras.state.resumeEventInterrupted,this.onBack=!!this.router.getCurrentNavigation().extras.state.onBack&&this.router.getCurrentNavigation().extras.state.onBack)})}setResumeCreationInterrupte(){const{action:i,event:n}=this.resumeCreateEventInterruptedService.getResumeCreationInterrupted();this.resumeCreateEventInterruptedService.setResumeCreationInterrupte({logistic:{eventType:this.eventType},vo:!1,action:i||this.action,event:{id:n?.id?n.id:this.event?.id?this.event?.id:"",instanceName:n?.instanceName?n?.instanceName:this.event?.company?.instanceName?this.event?.company?.instanceName:""}})}}return t.\u0275fac=function(i){return new(i||t)(e.\u0275\u0275directiveInject(g.UntypedFormBuilder),e.\u0275\u0275directiveInject(c.V6),e.\u0275\u0275directiveInject(c.f5),e.\u0275\u0275directiveInject(c.V),e.\u0275\u0275directiveInject(c.v_),e.\u0275\u0275directiveInject(E.ActivatedRoute),e.\u0275\u0275directiveInject(E.Router),e.\u0275\u0275directiveInject(c.NL),e.\u0275\u0275directiveInject(c.wK),e.\u0275\u0275directiveInject(f.i))},t.\u0275cmp=e.\u0275\u0275defineComponent({type:t,selectors:[["app-event-name"]],decls:22,vars:20,consts:[[3,"defaultHref","title","showBadge","refresh","menuToggle"],[1,"centralized-content"],["id","create_event_name",1,"page-title"],["class","sub-title",4,"ngIf"],[1,"ion-margin-vertical"],[3,"formGroup","ngSubmit"],[1,"input-holder"],["type","text","formControlName","title",3,"placeholder"],["class","errors",4,"ngIf"],[1,"button-holder"],["type","button",1,"back",3,"click"],["type","submit",3,"click"],[4,"ngIf"],[1,"sub-title"],[1,"errors"],["class","error",4,"ngFor","ngForOf"],[1,"error"],["type","button",3,"click"]],template:function(i,n){1&i&&(e.\u0275\u0275element(0,"app-header",0),e.\u0275\u0275elementStart(1,"ion-content")(2,"div",1)(3,"div",2),e.\u0275\u0275template(4,_,3,3,"div",3),e.\u0275\u0275template(5,T,3,3,"div",3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"ion-row")(7,"ion-col",4)(8,"form",5),e.\u0275\u0275listener("ngSubmit",function(){return n.onSubmit()}),e.\u0275\u0275elementStart(9,"div",6),e.\u0275\u0275element(10,"input",7),e.\u0275\u0275pipe(11,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(12,N,2,1,"div",8),e.\u0275\u0275elementStart(13,"div",9)(14,"button",10),e.\u0275\u0275listener("click",function(){return n.goOneStepBack()}),e.\u0275\u0275text(15),e.\u0275\u0275pipe(16,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"button",11),e.\u0275\u0275listener("click",function(){return n.onSubmit()}),e.\u0275\u0275text(18),e.\u0275\u0275pipe(19,"translate"),e.\u0275\u0275elementEnd()()()()(),e.\u0275\u0275template(20,P,6,3,"ion-row",12),e.\u0275\u0275template(21,I,6,3,"ion-row",12),e.\u0275\u0275elementEnd()()),2&i&&(e.\u0275\u0275property("defaultHref","ENTRY"===n.eventType||"CLONE_EXIT"===n.eventType?"/logistic-events/entrance":"/logistic-events/exit")("title",n.tittleHeader)("showBadge",!0)("refresh",!1)("menuToggle",!1),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf","ENTRY"===n.eventType||"CLONE_EXIT"===n.eventType),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","EXIT"===n.eventType||"CLONE_ENTRY"===n.eventType),e.\u0275\u0275advance(3),e.\u0275\u0275property("formGroup",n.eventTitleForm),e.\u0275\u0275advance(2),e.\u0275\u0275property("placeholder",e.\u0275\u0275pipeBind1(11,14,"PG_CREATE_LG_NAME_STEP_TEXT_INPUT")),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.eventTitleFormErrors),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(16,16,"BTN_BACK")," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(19,18,"BTN_NEXT")),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.showCloneEventFromExitMessage()),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.showCloneEventFromEntryMessage()))},dependencies:[p.NgForOf,p.NgIf,v.IonCol,v.IonContent,v.IonRow,g.\u0275NgNoValidate,g.DefaultValueAccessor,g.NgControlStatus,g.NgControlStatusGroup,g.FormGroupDirective,g.FormControlName,m.G,a.X$],styles:["ion-content[_ngcontent-%COMP%]{--background: #f1f1f1}ion-toolbar[_ngcontent-%COMP%]{font-family:Nunito,sans-serif}ion-toolbar[_ngcontent-%COMP%] ion-img[_ngcontent-%COMP%]{height:25px;width:25px}ion-toolbar[_ngcontent-%COMP%] ion-title[_ngcontent-%COMP%]{letter-spacing:1px}ion-toolbar[_ngcontent-%COMP%] ion-button[_ngcontent-%COMP%] fa-icon[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:24px;padding:0;width:24px;margin:0;font-size:19px;color:#656768}ion-toolbar[_ngcontent-%COMP%] ion-button.hover[_ngcontent-%COMP%]{background:#fff}.centralized-content[_ngcontent-%COMP%]{height:calc(100vh - 56px);display:flex;justify-content:flex-start;flex-direction:column}.centralized-content[_ngcontent-%COMP%] .errors[_ngcontent-%COMP%]{width:80%;margin:12px 10% 0;color:#f0181b;text-align:center}.centralized-content[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%]{margin-top:30px}.centralized-content[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:700;text-align:center}.centralized-content[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%] .sub-title[_ngcontent-%COMP%]{text-align:center;color:#656768;font-size:.9em;margin-top:4px}.pulsate-fwd[_ngcontent-%COMP%]{animation:pulsate-fwd .5s ease-in-out infinite both;outline:none}@keyframes pulsate-fwd{0%{transform:scale(1)}50%{transform:scale(1.5)}to{transform:scale(1)}}"]}),t})();var y=r(69270);const x=[{path:"",component:L}];let O=(()=>{class t{}return t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=e.\u0275\u0275defineNgModule({type:t}),t.\u0275inj=e.\u0275\u0275defineInjector({imports:[y.I,E.RouterModule.forChild(x)]}),t})()},37763:(C,h,r)=>{r.d(h,{i:()=>p});var E=r(61380),g=r(92198),c=r(45449);let p=(()=>{class v{constructor(a){this.router=a}focusInRouterNavigate(){this.router.events.pipe((0,g.h)(a=>a instanceof E.NavigationEnd)).subscribe(()=>{const a=document.querySelector("#focusHeader");a&&a?.focus()})}applyFocusQuerySelector(a,_){setTimeout(()=>{document.querySelector(`#${a}`)?.focus()},_)}}return v.\u0275fac=function(a){return new(a||v)(c.\u0275\u0275inject(E.Router))},v.\u0275prov=c.\u0275\u0275defineInjectable({token:v,factory:v.\u0275fac,providedIn:"root"}),v})()}}]);