PageSourceSearch

https://empower.health/288.ee005b615a8b5959.js

js empower.health collected 2026-10-08 03:49:48 UTC 17,350 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkng_portal=self.webpackChunkng_portal||[]).push([[288],{30288(ct,T,l){l.d(T,{EhsPlatformEventSurveysModule:()=>_t});var v=l(49769),C=l(61676),b=l(41838),x=l(21518),p=l(93049),E=l(88834),k=l(9454),y=l(9403),F=l(82765),d=l(89417),R=l(40100),M=l(99609),j=l(71997),s=l(85802),$=l(17705),N=l(95416),S=l(37702),m=l(2505),G=l(76513),L=l(84412),V=l(96354),A=l(96697),t=l(35547),P=l(5722),f=l(62302),X=l(43740),g=l(44095),h=l(79296),I=l(9183);const O=(e,_)=>["/ehs/admin/company",e,"service",_,"event"];function w(e,_){1&e&&(t.j41(0,"div",4),t.nrm(1,"mat-spinner",5),t.k0s())}function B(e,_){1&e&&(t.j41(0,"mat-error"),t.EFF(1," Required "),t.k0s())}function D(e,_){1&e&&(t.j41(0,"mat-error"),t.EFF(1," Min 0 "),t.k0s())}function Q(e,_){1&e&&(t.j41(0,"mat-error"),t.EFF(1," Max 10000 "),t.k0s())}function Y(e,_){1&e&&(t.j41(0,"mat-error"),t.EFF(1," Required "),t.k0s())}function J(e,_){1&e&&(t.j41(0,"mat-error"),t.EFF(1," Min 0 "),t.k0s())}function W(e,_){1&e&&(t.j41(0,"mat-error"),t.EFF(1," Max 10000 "),t.k0s())}function Z(e,_){if(1&e){const n=t.RV6();t.j41(0,"div",23)(1,"mat-form-field",17)(2,"mat-label"),t.EFF(3),t.k0s(),t.j41(4,"input",24,2),t.mxI("ngModelChange",function(o){const r=s.eBV(n).$implicit,a=t.XpG().$implicit,c=t.XpG(3);return t.DH7(c.ratingResponses[a][r],o)||(c.ratingResponses[a][r]=o),s.Njj(o)}),t.bIt("wheel",function(o){return o.preventDefault()})("blur",function(){const o=s.eBV(n).$implicit,r=t.sdS(5),a=t.XpG().$implicit;t.XpG();const c=t.sdS(26),u=t.XpG(2);return s.Njj(u.onFieldChange({form:c,type:u.surveyResponseTypes.RATING,question:a,response:o,count:r.value}))}),t.k0s(),t.nVh(6,Y,2,0,"mat-error"),t.nVh(7,J,2,0,"mat-error"),t.nVh(8,W,2,0,"mat-error"),t.k0s()()}if(2&e){const n=_.$implicit,i=t.sdS(5),o=t.XpG().$implicit,r=t.XpG
1(3);t.R7$(3),t.JRh(n),t.R7$(),t.Y8G("name",t.mNQ(o+"_"+n)),t.R50("ngModel",r.ratingResponses[o][n]),t.R7$(2),t.vxM(i.hasError("required")?6:-1),t.R7$(),t.vxM(i.hasError("min")?7:-1),t.R7$(),t.vxM(i.hasError("max")?8:-1)}}function z(e,_){if(1&e&&(t.j41(0,"div",19)(1,"div"),t.EFF(2),t.k0s(),t.j41(3,"div",22),t.Z7z(4,Z,9,7,"div",23,t.BUC().trackByFn,!0),t.k0s()()),2&e){const n=_.$implicit,i=t.XpG(3);t.R7$(2),t.JRh(i.ratingQuestions[n]),t.R7$(2),t.Dyx(i.surveyRatings)}}function H(e,_){1&e&&(t.j41(0,"mat-error"),t.EFF(1," This field is required "),t.k0s())}function U(e,_){1&e&&(t.j41(0,"mat-error"),t.EFF(1," Min 0 "),t.k0s())}function K(e,_){1&e&&(t.j41(0,"mat-error"),t.EFF(1," Max 10000 "),t.k0s())}function q(e,_){if(1&e){const n=t.RV6();t.j41(0,"div",23)(1,"mat-form-field",19)(2,"mat-label"),t.EFF(3),t.k0s(),t.j41(4,"input",26,2),t.bIt("wheel",function(o){return o.preventDefault()}),t.mxI("ngModelChange",function(o){const r=s.eBV(n).$implicit,a=t.XpG().$implicit,c=t.XpG(3);return t.DH7(c.motivationResponses[a][r],o)||(c.motivationResponses[a][r]=o),s.Njj(o)}),t.bIt("blur",function(){const o=s.eBV(n).$implicit,r=t.sdS(5),a=t.XpG().$implicit;t.XpG();const c=t.sdS(26),u=t.XpG(2);return s.Njj(u.onFieldChange({form:c,type:u.surveyResponseTypes.MOTIVATION,question:a,response:o,count:r.value}))}),t.k0s(),t.nVh(6,H,2,0,"mat-error"),t.nVh(7,U,2,0,"mat-error"),t.nVh(8,K,2,0,"mat-error"),t.k0s()()}if(2&e){const n=_.$implicit,i=t.sdS(5),o=t.XpG().$implicit,r=t.XpG
1(3);t.R7$(3),t.JRh(n),t.R7$(),t.Y8G("name",t.mNQ(o+"_"+n)),t.R50("ngModel",r.motivationResponses[o][n]),t.R7$(2),t.vxM(i.hasError("required")?6:-1),t.R7$(),t.vxM(i.hasError("min")?7:-1),t.R7$(),t.vxM(i.hasError("max")?8:-1)}}function tt(e,_){if(1&e&&(t.j41(0,"div",19)(1,"div"),t.EFF(2),t.k0s(),t.j41(3,"div",25),t.Z7z(4,q,9,7,"div",23,t.fX1),t.k0s()()),2&e){const n=_.$implicit,i=t.XpG(3);t.R7$(2),t.JRh(i.motivationQuestions[n]),t.R7$(2),t.Dyx(i.surveyMotivations)}}function nt(e,_){if(1&e){const n=t.RV6();t.j41(0,"button",33),t.bIt("click",function(){s.eBV(n);const o=t.XpG(6);return s.Njj(o.addComment())}),t.j41(1,"mat-icon"),t.EFF(2,"add"),t.k0s(),t.EFF(3,"Add Another Comment"),t.k0s()}}function ot(e,_){if(1&e){const n=t.RV6();t.j41(0,"mat-form-field",27)(1,"textarea",28,3),t.mxI("ngModelChange",function(o){s.eBV(n);const r=t.XpG().$implicit;return t.DH7(r.comment,o)||(r.comment=o),s.Njj(o)}),t.bIt("blur",function(){s.eBV(n);const o=t.XpG(),r=o.$implicit,a=o.$index,c=t.XpG(4);return s.Njj(c.onCommentChange({index:a,comment:r.comment,isNegative:!1}))}),t.k0s()(),t.j41(3,"div",29)(4,"button",30),t.bIt("click",function(){s.eBV(n);const o=t.XpG().$index,r=t.XpG(4);return s.Njj(r.removeComment({index:o}))}),t.j41(5,"mat-icon"),t.EFF(6,"delete"),t.k0s(),t.EFF(7," Remove"),t.k0s(),t.nVh(8,nt,4,0,"button",31),t.j41(9,"mat-checkbox",32),t.mxI("ngModelChange",function(o){s.eBV(n);const r=t.XpG().$implicit;return t.DH7(r.isNegative,o)||(r.isNegative=o),s.Njj(o)}),t.bIt("change",function(){s.eBV(n);const o=t.XpG(),r=o.$implicit,a=o.$index,c=t.XpG(),u=t.XpG(3);return s.Njj(u.onCommentChange({index:a,comment:r.comment,isNegative:c[a].isNegative}))}),t.EFF(10," Mark for Review? "),t.k0s()()}if(2&e){const n=t.XpG(),i=n.$implicit,o=n.$index,r=t.XpG();t.R7$(),t.Y8G("name",t.VkB("comment_",o)),t.R50("ngModel",i.comment),t.Y8G("value",i.comment),t.R7$(7),t.vxM(o===r.length-1?8:-1),t.R7$(),t.Y8G("name",t.VkB("isNegative_",o)),t.R50("ngModel",i.isNegative)}}function et(e,_){if(1&e&&(t.j41(0,"div"),t.nVh(1,ot,11,8),t.k0s()),2&e){const n=_.$implicit;t.R7$(),t.vxM(null!=n.comment&&n.comment.length||""===n.comment?1:-1)}}function it(e,_){1&e&&(t.j41(0,"div",19),t.Z7z(1,et,2,1,"div",null,t.BUC().trackByFn,!0),t.k0s()),2&e&&(t.R7$(),t.Dyx(_))}function rt(e,_){if(1&e){const n=t.RV6();t.j41(0,"div",6)(1,"ehs-card",7),t.qex(2,8),t.j41(3,"div",9)(4,"a",10)(5,"mat-icon"),t.EFF(6," arrow_back "),t.k0s(),t.EFF(7," Back "),t.k0s()(),t.bVm(),t.j41(8,"div",11)(9,"div",12)(10,"div"),t.EFF(11,"Event Name"),t.k0s(),t.j41(12,"div",13),t.EFF(13),t.k0s()(),t.j41(14,"div",12)(15,"div"),t.EFF(16,"Event Date"),t.k0s(),t.j41(17,"div",13),t.EFF(18),t.nI1(19,"date"),t.k0s()(),t.j41(20,"div",12)(21,"div"),t.EFF(22,"Site Code"),t.k0s(),t.j41(23,"div",13),t.EFF(24),t.k0s()()(),t.j41(25,"form",14,0),t.bIt("submit",function(){s.eBV(n);const o=t.sdS(26),r=t.XpG(2);return s.Njj(r.onSubmit(o))}),t.j41(27,"div",15)(28,"div",16)(29,"div"),t.EFF(30,"Total Responses Received:"),t.k0s(),t.j41(31,"mat-form-field",17)(32,"mat-label"),t.EFF(33,"Total"),t.k0s(),t.j41(34,"input",18,1),t.bIt("wheel",function(o){return o.preventDefault()}),t.mxI("ngModelChange",function(o){s.eBV(n);const r=t.XpG(2);return t.DH7(r.totalResponses,o)||(r.totalResponses=o),s.Njj(o)}),t.bIt("blur",function(){s.eBV(n);const o=t.sdS(26),r=t.sdS(35),a=t.XpG(2);return s.Njj(a.onTotalResponsesChange({form:o,count:r.value}))}),t.k0s(),t.nVh(36,B,2,0,"mat-error"),t.nVh(37,D,2,0,"mat-error"),t.nVh(38,Q,2,0,"mat-error"),t.k0s()(),t.Z7z(39,z,6,1,"div",19,t.fX1),t.k0s(),t.j41(41,"div",15),t.Z7z(42,tt,6,1,"div",19,t.fX1),t.nVh(44,it,3,0,"div",19),t.nI1(45,"async"),t.j41(46,"div",20)(47,"button",21),t.EFF(48," Submit "),t.k0s()()()(),t.nrm(49,"div",15),t.k0s()()}if(2&e){let n;const i=_,o=t.sdS(35),r=t.XpG(2);t.R7$(4),t.Y8G("routerLink",t.l_i(15,O,r.companyId,r.eventServiceId)),t.R7$(9),t.JRh(i.locationCompanyName),t.R7$(5),t.JRh(t.i5U(19,10,i.eventDate,"mediumDate")),t.R7$(6),t.JRh(i.siteCode),t.R7$(10),t.Y8G("defaultValue",0),t.R50("ngModel",r.totalResponses),t.R7$(2),t.vxM(o.hasError("required")?36:-1),t.R7$(),t.vxM(o.hasError("min")?37:-1),t.R7$(),t.vxM(o.hasError("max")?38:-1),t.R7$(),t.Dyx(r.ratingQuestionTypes),t.R7$(3),t.Dyx(r.motivationQuestionTypes),t.R7$(2),t.vxM((n=t.bMT(45,13,r.comments.asObservable()))?44:-1,n)}}function at(e,_){if(1&e&&(t.nVh(0,rt,50,18,"div",6),t.nI1(1,"async")),2&e){let n;const i=t.XpG();t.vxM((n=t.bMT(1,1,i.eventLocation$))?0:-1,n)}}const st=[{path:"",component:(()=>{class e{router=(0,s.WQX)(S.Ix);route=(0,s.WQX)(S.nX);adminFacade=(0,s.WQX)(y.Uj);eventLocationNgrx=(0,s.WQX)(G.dr);snackbar=(0,s.WQX)(N.UG);cdr=(0,s.WQX)($.gRc);loading$=this.adminFacade.loading$;surveyResponseTypes=m.d00;ratingQuestionTypes=Object.values(m.LSs);motivationQuestionTypes=Object.values(m._Em);surveyRatings=Object.values(m.jTc);surveyMotivations=Object.values(m.Lrn);ratingQuestions=m.n35;motivationQuestions=m.MG8;comments=new L.t([{comment:"",isNegative:!1}]);totalResponses=0;ratingResponses={[m.LSs.EXAMINER_RATING]:{poor:0,fair:0,neutral:0,good:0,excellent:0},[m.LSs.SKILLS_RATING]:{poor:0,fair:0,neutral:0,good:0,excellent:0},[m.LSs.SATISFACTION_RATING]:{poor:0,fair:0,neutral:0,good:0,excellent:0},[m.LSs.WAIT_TIME_RATING]:{poor:0,fair:0,neutral:0,good:0,excellent:0}};motivationResponses={[m._Em.PRIMARY_MOTIVATION]:{convenience_at_workplace:0,preventative_checkup:0,low_no_cost:0,encouraged_by_employer:0,no_answer:0}};companyId=this.route?.snapshot?.params?.companyId;eventServiceId=this.route?.snapshot?.params?.eventServiceId;eventLocationId=this.route?.snapshot?.params?.eventLocationId;loadingEventData$=this.eventLocationNgrx.loading$;eventLocation$=this.eventLocationNgrx.get$(this.eventLocationId,{waitForLoad:!0});eventSurveyResponses$=this.eventLocation$.pipe((0,V.T)(n=>n?.feedbackResponses));constructor(){this.adminFacade.list()}ngOnInit(){this.eventLocationNgrx.get(this.eventLocationId),this.eventLocationNgrx.getRegTimes({eventLocation:this.eventLocationId}),this.eventSurveyResponses$.pipe((0,A.s)(1)).subscribe(n=>{const i=(0,m.Go6)(n);this.loadExistingSurveyResponses(i)})}
1loadExistingSurveyResponses(n){n&&(this.ratingResponses={[m.LSs.EXAMINER_RATING]:{poor:n.examiner_rating?.poor,fair:n.examiner_rating?.fair,neutral:n.examiner_rating?.neutral,good:n.examiner_rating?.good,excellent:n.examiner_rating?.excellent},[m.LSs.SKILLS_RATING]:{poor:n.skills_rating?.poor,fair:n.skills_rating?.fair,neutral:n.skills_rating?.neutral,good:n.skills_rating?.good,excellent:n.skills_rating?.excellent},[m.LSs.SATISFACTION_RATING]:{poor:n.satisfaction_rating?.poor,fair:n.satisfaction_rating?.fair,neutral:n.satisfaction_rating?.neutral,good:n.satisfaction_rating?.good,excellent:n.satisfaction_rating?.excellent},[m.LSs.WAIT_TIME_RATING]:{poor:n.wait_time_rating?.poor,fair:n.wait_time_rating?.fair,neutral:n.wait_time_rating?.neutral,good:n.wait_time_rating?.good,excellent:n.wait_time_rating?.excellent}},this.motivationResponses={[m._Em.PRIMARY_MOTIVATION]:{convenience_at_workplace:n.primary_motivation?.convenience_at_workplace,preventative_checkup:n.primary_motivation?.preventative_checkup,low_no_cost:n.primary_motivation?.low_no_cost,encouraged_by_employer:n.primary_motivation?.encouraged_by_employer,no_answer:n.primary_motivation?.no_answer}},n.comments?.length&&this.comments.next(n.comments||[]),this.totalResponses=n.total_responses||0)}onTotalResponsesChange(n){const{form:i,count:o}=n;"number"!=typeof o||o<0?i.controls.total_responses.setErrors({required:!0}):(this.totalResponses=o||0,this.cdr.detectChanges())}onFieldChange(n){const{form:i,type:o,question:r,response:a,count:c}=n;if(r&&a){if(!i||!o)return void i.controls[`${r}_${a}`].setErrors({required:!0});if(o!==m.d00.COMMENT&&o!==m.d00.TOTAL&&this.ratingResponses&&this.motivationResponses){if(o===m.d00.RATING)switch(r){case m.LSs.SKILLS_RATING:return void(this.ratingResponses.skills_rating={...this.ratingResponses.skills_rating,[a]:c||0});case m.LSs.EXAMINER_RATING:return void(this.ratingResponses.examiner_rating={...this.ratingResponses.examiner_rating,[a]:c||0});case m.LSs.WAIT_TIME_RATING:return void(this.ratingResponses.wait_time_rating={...this.ratingResponses.wait_time_rating,[a]:c||0});case m.LSs.SATISFACTION_RATING:return void(this.ratingResponses.satisfaction_rating={...this.ratingResponses.satisfaction_rating,[a]:c||0});default:return}if(o===m.d00.MOTIVATION)return r===m._Em.PRIMARY_MOTIVATION?void(this.motivationResponses.primary_motivation={...this.motivationResponses.primary_motivation,[a]:c||0}):void 0}}}toJson(n){return JSON.stringify(n)}onCommentChange(n){const{index:i,comment:o,isNegative:r}=n;if("number"!=typeof i||"string"!=typeof o||!o?.length)return;const a=this.comments.getValue();if(!a||!a.length)return this.comments.next([{comment:o,isNegative:r||!1}]),void this.cdr.detectChanges();a[i]={comment:o,isNegative:r||!1},this.comments.next(a),this.cdr.detectChanges()}
1removeComment(n){const{index:i}=n,o=this.comments.getValue();if(!o||!o.length||"number"!=typeof i)return;const r=o.filter((a,c)=>c!==i);this.comments.next(r),this.cdr.detectChanges()}trackByFn(n){return n}onSubmit(n){try{if(Object.values(m.LSs).forEach(o=>{const r=this.ratingResponses[o];r&&Object.values(m.jTc).forEach(a=>{"number"==typeof r[a]||n.controls[`${o}_${a}`]?.setErrors({required:!0})})}),Object.values(m._Em).forEach(o=>{const r=this.motivationResponses[o];r&&Object.values(m.Lrn).forEach(a=>{"number"==typeof r[a]||n.controls[`${o}_${a}`]?.setErrors({required:!0})})}),!n?.valid)return n.control.markAllAsTouched(),n.control.updateValueAndValidity(),void this.snackbar.open("Please fill out all required fields.","Ok");const i={examiner_rating:this.ratingResponses.examiner_rating,skills_rating:this.ratingResponses.skills_rating,satisfaction_rating:this.ratingResponses.satisfaction_rating,wait_time_rating:this.ratingResponses.wait_time_rating,primary_motivation:this.motivationResponses.primary_motivation,comments:this.comments.getValue().filter(o=>o?.comment?.length>0).map(o=>({_id:o._id,comment:o.comment.trim(),isNegative:o.isNegative||!1})),total_responses:this.totalResponses||0};this.eventLocationNgrx.updateEventSurveyResponses({eventLocation:this.eventLocationId,surveyResponses:i}),this.snackbar.open("Feedback responses submitted!","Ok",{duration:3e3}),this.router.navigate([`/ehs/admin/company/${this.companyId}/service/${this.eventServiceId}/event`])}catch{this.snackbar.open("Oops. Something went wrong.","Ok")}}addComment(){this.comments.next([...this.comments.getValue(),{comment:"",isNegative:!1}]),this.cdr.detectChanges()}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=t.VBU({type:e,selectors:[["ehs-platform-event-surveys"]],standalone:!1,decls:3,vars:3,consts:[["form","ngForm"],["countInput","ngModel"],["fieldInput","ngModel"],["commentInput","ngModel"],[1,"center-spinner","margin"],["diameter","50",1,"circle-center"],["ngStyle.gt-sm","padding: 16px;","gdGap","8px","gdGap.gt-sm","16px"],["title","Feedback Forms","titleIcon","assignment"],["optionalAction",""],["fxLayout","row","fxLayoutAlign","end","fxFlex",""],["mat-flat-button","","queryParamsHandling","preserve",3,"routerLink"],["gdColumns","1fr 1fr 1fr",2,"text-align","center"],["gdColumn","1fr"],[2,"font-weight","bold"],["novalidate","",3,"submit"],[2,"margin","16px"],["fxLayout","column","fxLayoutAlign","start start"],["fxLayout","column",1,"form-field"],["matInput","","type","number","name","total_responses","inputmode","numeric","type","number","min","0","max","10000","required","",1,"feedback-input",3,"wheel","ngModelChange","blur","defaultValue","ngModel"],["fxLayout","column"],["fxLayout","row","fxLayoutAlign","end"],["mat-flat-button","","type","submit","color","primary",1,"highlight-button"],["gdColumns.gt-xs","1fr 1fr 1fr 1fr 1fr","gdColumns.xs","1fr 1fr 1fr",2,"max-width","fit-content"],["gdColumn","1fr",2,"margin","8px"],["matInput","","inputmode","numeric","type","number","min","0","max","10000","required","",1,"feedback-input",3,"ngModelChange","wheel","blur","ngModel","name"],["gdColumns.gt-md","1fr 1fr 1fr 1fr 1fr","gdColumns.md","1fr 1fr 1fr","gdColumns.lt-md","1fr 1fr",2,"max-width","fit-content"],["matInput","","type","number","min","0","max","10000","inputmode","numeric","required","",1,"feedback-input",3,"wheel","ngModelChange","blur","name","ngModel"],[1,"no-label","full-width"],["title","comment","matInput","",3,"ngModelChange","blur","name","ngModel","value"],["fxLayout","row","fxLayoutGap","8px",2,"margin-bottom","8px"],["type","button","mat-flat-button","","color","primary","title","Remove Comment",1,"highlight-button",3,"click"],["type","button","mat-flat-button","","color","primary","title","Add Another Comment",1,"highlight-button"],["title","Mark for Review?",3,"ngModelChange","change","name","ngModel"],["type","button","mat-flat-button","","color","primary","title","Add Another Comment",1,"highlight-button",3,"click"]],template:function(i,o){1&i&&(t.nVh(0,w,2,0,"div",4),t.nI1(1,"async"),t.vZN(2,at,2,3)),2&i&&t.vxM(t.bMT(1,1,o.loadingEventData$)?0:2)},dependencies:[p.Wk,P.W,f.DJ,f.BO,f.sA,f.UI,X.eI,g.ZS,g.EK,g.BV,d.qT,d.me,d.Q0,d.BC,d.cb,d.YS,d.VZ,d.zX,d.vS,d.cV,E.$z,x.An,h.rl,h.nJ,h.TL,R.fg,F.So,I.LG,v.Jj,v.vh],styles:[".form-field[_ngcontent-%COMP%]{max-width:100px!important}.highlight-button[_ngcontent-%COMP%]:focus{fill:#f0f8ff!important;background-color:#e0e4e7!important;color:#0940d8!important;border-color:#022771!important;border-style:solid!important;border-width:1px!important;outline:0!important}input[_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;margin:0;scroll-behavior:unset}"],changeDetection:0})}return e})()}];let lt=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=t.$C({type:e});static \u0275inj=s.G2t({imports:[p.iI.forChild(st),p.iI]})}return e})();var mt=l(53719);let _t=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=t.$C({type:e});static \u0275inj=s.G2t({imports:[y.ws,M.m5,lt,C.FDO,C.FQE,p.iI,v.MD,b.YF,d.YN,E.Hl,x.m_,mt.RG,R.fS,j.w,k.MY,F.g7,I.D6,d.YN]})}return e})()}}]);

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.