1"use strict";(self.webpackChunkDCP_Web=self.webpackChunkDCP_Web||[]).push([["default-libs_mmp-product_src_lib_components_landing_mmp-landing_component_ts"],{4880:(L,M,e)=>{e.d(M,{e:()=>y});var i=e(23214),E=e(98434),n=e(92947),g=e(68018),D=e(29040),h=e(89079),p=e(12183),T=e(19824),t=e(22976),s=e(84541),d=e(2847),m=e(35957),I=e(74400),P=e(9845),A=e(36078),S=e(13854),f=e(38109),R=e(99514);let y=(()=>{class C{router=(0,i.WQX)(n.Ix);mmpQuoteService=(0,i.WQX)(m.E);mmpService=(0,i.WQX)(I.a);languageService=(0,i.WQX)(D.g);authService=(0,i.WQX)(d.uR);storage=(0,i.WQX)(s.sE);destroyRef=(0,i.WQX)(i.abz);quoteSubmissionService=(0,i.WQX)(s.W$);localizeRouterService=(0,i.WQX)(R.QG);isLoading=(0,i.vPA)(!1);serverErrMsg=(0,i.vPA)("");get currentLang(){return this.languageService.currentLang()||"en"}constructor(){this.mmpService.deleteUserInfo().pipe((0,h.pQ)(this.destroyRef)).subscribe()}onSubmit({values:r}){this.isLoading.set(!0),this.serverErrMsg.set(""),this.mmpQuoteService.updateFormData({nationalId:r.nationalId,dateOfBirth:r.dateOfBirth,mobileNumber:r.phoneNumber,email:r.email}),this.quoteSubmissionService.submitQuote({formValues:r,buildPayload:o=>this.buildValidationPayload(o),validateCustomer:o=>this.mmpService.validateCustomerDetails(o),onSuccess:(o,l)=>{this.getCustomerDetails(r,l)},onError:o=>{this.serverErrMsg.set(o),this.isLoading.set(!1)},destroyRef:this.destroyRef})}getCustomerDetails(r,o){this.mmpService.getCustomerDetails(o).pipe((0,h.pQ)(this.destroyRef)).subscribe({next:l=>{this.isLoading.set(!1);const v=l,u=this.mmpService.getFullName(v,this.currentLang);localStorage.setItem("user-quote",JSON.stringify({firstName:v?.customer_details?.first_name_en,lastName:v?.customer_details?.last_name_en,dob:v?.customer_details?.dob,mobile:r.phoneNumber,idValue:o?.id_no})),this.storage.Setvalue(this.mmpService.STORAGE_KEY,{redirectUrl:`${this.currentLang}${S.IN.STEPPER}`,paylaod:o,customerFullDetails:l,Fullname:u,policyMarketingConsentFlag:r.policyMarketingConsentFlag,transactionType:A.TransactionTypes.CYBER_INSURANCE}),this.mmpQuoteService.setValidationResponse(l),this.navigateToNextStep()},error:l=>{this.isLoading.set(!1),this.serverErrMsg.set(this.mmpService.setError(l))}})}navigateToNextStep(){this.mmpService.getUserInfo().pipe((0,h.pQ)(this.destroyRef)).subscribe({next:r=>{r?.data?.["first-otp-verified"]?this.router.navigate([this.localizeRouterService.translateRoute(S.IN.STEPPER)]):(this.storage.Setvalue(f.RM.IS_QUOTATION,!0),localStorage.setItem(f.Hh.ALLOW_OTP_MMP,"true"),this.router.navigate([this.localizeRouterService.translateRoute(P.ji.otp)]))},error:r=>{this.storage.Setvalue(f.RM.IS_QUOTATION,!0),localStorage.setItem(f.Hh.ALLOW_OTP_MMP,"true"),this.router.navigate([this.localizeRouterService.translateRoute(P.ji.otp)])}})}buildValidationPayload(r){const o=r.nationalId.charAt(0),l=this.formatDateOfBirth(r.dateOfBirth);return{phone_no:r.phoneNumber,id_no:r.nationalId,dob:l,email_id:r.email,dob_type:"G",id_type:o}}formatDateOfBirth(r){if(!r)return"";if(/^\d{2}-\d{4}$/.test(r))return r;if(/^\d{4}-\d{2}$/.test(r)){const[o,l]=r.split("-");return`${l}-${o}`}if(/^\d{4}-\d{2}-\d{2}$/.test(r)){const[o,l]=r.split("-");return`${l}-${o}`}return r}static \u0275fac=function(o){return new(o||C)};static \u0275cmp=i.VBU({type:C,selectors:[["art-mmp-get-quote-form"]],decls:3,vars:3,consts:[[1,"px-3","px-lg-10"],[3,"getQuotationFormSubmit","artLoadingHide","serverErrMsg"],["height","100px","name","spinner",3,"artLoadingHide"]],template:function(o,l){1&o&&(i.j41(0,"section",0)(1,"art-get-quote-form",1),i.bIt("getQuotationFormSubmit",function(u){return l.onSubmit(u)}),i.k0s()(),i.nrm(2,"art-animation",2)),2&o&&(i.R7$(),i.Y8G("artLoadingHide",l.isLoading())("serverErrMsg",l.serverErrMsg()),i.R7$(),i.Y8G("artLoadingHide",!l.isLoading()))},dependencies:[E.MD,g.h,p.S,T.C,t.c],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}return C})()},6916:(L,M,e)=>{e.r(M),e.d(M,{MmpLandingComponent:()=>v});var i=e(59361),E=e(69377),n=e(23214),g=e(98434),D=e(92947),h=e(47624),p=e(68018),T=e(33391),t=e(29040),s=e(75073),d=e(9845),m=e(90650),I=e(31099),P=e(79199),A=e(55250),S=e(83880),f=e(77815),R=e(66257);let y=(()=>{class u{description="MMP.DESCRIPTION";
1benefits=[{icon:"MMP-TITLE1",title:"MMP.TITLE1",description:"MMP.FEATURES1"},{icon:"MMP-TITLE2",title:"MMP.TITLE2",description:"MMP.FEATURES2"},{icon:"MMP-TITLE3",title:"MMP.TITLE3",description:"MMP.FEATURES3"}];static \u0275fac=function(c){return new(c||u)};static \u0275cmp=n.VBU({type:u,selectors:[["art-mmp-feature-benefits"]],decls:3,vars:11,consts:[[3,"benefits","description","alertMessage","title","displayBenefitsTitle","subTitleHeadingType","cardTitleHeadingType"]],template:function(c,_){1&c&&(n.nrm(0,"art-feature-benefits",0),n.nI1(1,"translate"),n.nI1(2,"translate")),2&c&&n.Y8G("benefits",_.benefits)("description",n.bMT(1,7,_.description))("alertMessage","")("title",n.bMT(2,9,"COMMON.PRODUCT_INSURANCE_BENEFITS"))("displayBenefitsTitle",!1)("subTitleHeadingType","h3")("cardTitleHeadingType","h4")},dependencies:[g.MD,p.h,p.D9,R.S],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}return u})();var C=e(30606);let O=(()=>{class u{productServices=[{icon:"home-document-icon",title:"MMP.SERVICES.SERVICE_1_TITLE",description:"MMP.SERVICES.SERVICE_1_DESC"},{icon:"art-policy-cancellation",title:"MMP.SERVICES.SERVICE_2_TITLE",description:"MMP.SERVICES.SERVICE_2_DESC"},{icon:"art-policy-claims",title:"MMP.SERVICES.SERVICE_3_TITLE",description:"MMP.SERVICES.SERVICE_3_DESC"},{icon:"art-policy-support",title:"MMP.SERVICES.SERVICE_4_TITLE",description:"MMP.SERVICES.SERVICE_4_DESC"}];static \u0275fac=function(c){return new(c||u)};static \u0275cmp=n.VBU({type:u,selectors:[["art-mmp-services-info"]],decls:1,vars:3,consts:[[3,"hideTitle","subTitleHeadingType","productServices"]],template:function(c,_){1&c&&n.nrm(0,"art-product-services",0),2&c&&n.Y8G("hideTitle",!0)("subTitleHeadingType","h4")("productServices",_.productServices)},dependencies:[g.MD,p.h,C.L],encapsulation:2,changeDetection:0})}return u})();var r=e(4880),o=e(71465),l=e(33813);let v=(()=>{class u{router=(0,n.WQX)(D.Ix);languageService=(0,n.WQX)(t.g);modal=(0,n.WQX)(T.Bq);platformId=(0,n.WQX)(n.Agw);document=(0,n.WQX)(i.q);analytics=(0,n.WQX)(o.cu);couponModalRef=null;static MMP_COUPON_ASSET_EN="assets/images/mmp-popup-en.png";static MMP_COUPON_ASSET_AR="assets/images/mmp-popup-ar.png";productConfig=d.s1;routes=d.ji;indemnityLimits=d._i;FAQ_CATEGORY=f.S4;FAQ_PRODUCT=f.NZ;isLoading=!1;submitLink="";get currentLang(){return this.languageService.currentLang()||"en"}bannerImgUrl=(0,n.EWP)(()=>"ar"===this.languageService.currentLang()?"./assets/images/mmp-revamp/mmp-landingPage-ar.jpg":"./assets/images/mmp-revamp/mmp-landingPage-en.jpg");constructor(){}tabs=[{id:"feature-benefits",name:"COMMON.FEATURES_AND_BENEFITS",isActive:!0,onClick:a=>this.setActiveTab(a.id)},{id:"product-services",name:"COMMON.PRODUCT_SERVICES",isActive:!1,onClick:a=>this.setActiveTab(a.id)},{id:"faq",name:"COMMON.FAQ",isActive:!1,onClick:a=>this.setActiveTab(a.id)}];ngOnInit(){this.analytics.trackStapFunction(l.rh.MMPIndividual,l.pn.Step1),this.submitLink=this.languageService.translateRoute("/service-requests")}ngOnDestroy(){this.couponModalRef?.close()}openCouponPromoting(){if(!(0,E.UE)(this.platformId))return;this.couponModalRef?.close();const a=this.modal.open(s.n,{centered:!0,backdrop:!0,windowClass:"coupon-promoting-modal",modalDialogClass:"coupon-promoting-modal-dialog"});a.componentInstance.imageUrl=this.resolveAssetUrl("ar"===this.currentLang?u.MMP_COUPON_ASSET_AR:u.MMP_COUPON_ASSET_EN),this.couponModalRef=a}resolveAssetUrl(a){if(!(0,E.UE)(this.platformId))return a;const c=a.startsWith("/")?a.slice(1):a,_=this.document.querySelector("base")?.href??`${window.location.origin}/`;return new URL(c,_).href}setActiveTab(a){const c=document.getElementById(a);c&&c.scrollIntoView({behavior:"smooth"}
1),this.tabs.forEach(_=>{_.isActive=_.id===a})}onClickCheckProductDetails(){this.setActiveTab("feature-benefits")}getQuote(){this.router.navigate([this.routes.quotation])}startJourney(){this.router.navigate([this.routes.journey])}getMaxIndemnityLimit(){const a=this.indemnityLimits[this.indemnityLimits.length-1];return"ar"===this.currentLang?a.labelAr:a.label}static \u0275fac=function(c){return new(c||u)};static \u0275cmp=n.VBU({type:u,selectors:[["art-mmp-landing"]],decls:12,vars:12,consts:[[3,"category","product"],["product-overview","",3,"clickCheckProductDetails","imgUrl","title","subTitle"],["product-manage-your-policy-online-section","",3,"renewal","submitLink"],["product-insurance-side-menu","",3,"tabs"],["id","feature-benefits","product-feature-benefits",""],["id","product-services","product-services",""],["id","faq","product-FAQ",""]],template:function(c,_){1&c&&(n.j41(0,"art-product-home",0)(1,"art-insurance-overview",1),n.nI1(2,"translate"),n.bIt("clickCheckProductDetails",function(){return _.onClickCheckProductDetails()}),n.nrm(3,"art-mmp-get-quote-form"),n.k0s(),n.nrm(4,"art-manage-your-policy-online-section",2)(5,"art-product-insurance-side-menu",3),n.j41(6,"div",4),n.nrm(7,"art-mmp-feature-benefits"),n.k0s(),n.j41(8,"div",5),n.nrm(9,"art-mmp-services-info"),n.k0s(),n.j41(10,"div",6),n.nrm(11,"art-dcp-product-faq",0),n.k0s()()),2&c&&(n.Y8G("category",_.FAQ_CATEGORY.PERSONAL)("product",_.FAQ_PRODUCT.MEDICAL_MALPRACTICE),n.R7$(),n.Y8G("imgUrl",_.bannerImgUrl())("title",n.bMT(2,10,"MMP.MEDICAL_MALPRACTICE"))("subTitle",""),n.R7$(3),n.Y8G("renewal",!1)("submitLink",_.submitLink),n.R7$(),n.Y8G("tabs",_.tabs),n.R7$(6),n.Y8G("category",_.FAQ_CATEGORY.PERSONAL)("product",_.FAQ_PRODUCT.MEDICAL_MALPRACTICE))},dependencies:[g.MD,h.iI,p.h,p.D9,m.k,I.D,P.J,A.f,S.u,y,O,r.e],styles:["#feature-benefits[_ngcontent-%COMP%], #product-services[_ngcontent-%COMP%], #faq[_ngcontent-%COMP%]{scroll-margin-top:100px}[dir=rtl][_ngcontent-%COMP%] .mmp-landing[_ngcontent-%COMP%]{text-align:right}"],changeDetection:0})}return u})()},35957:(L,M,e)=>{e.d(M,{E:()=>h});var i=e(23214),E=e(88141),n=e(74400),g=e(9845),D=e(38109);let h=(()=>{class p{mmpService=(0,i.WQX)(n.a);_currentQuote=(0,i.vPA)(null);_selectedPlan=(0,i.vPA)(null);_formData=(0,i.vPA)({});_customerData=(0,i.vPA)(null);_isLoading=(0,i.vPA)(!1);_error=(0,i.vPA)(null);currentQuote=this._currentQuote.asReadonly();selectedPlan=this._selectedPlan.asReadonly();formData=this._formData.asReadonly();customerData=this._customerData.asReadonly();isLoading=this._isLoading.asReadonly();error=this._error.asReadonly();hasQuote=(0,i.EWP)(()=>null!==this._currentQuote());hasPlan=(0,i.EWP)(()=>null!==this._selectedPlan());quoteSummary=(0,i.EWP)(()=>{const t=this._currentQuote(),s=this._formData();return t?{quoteId:t.quoteId,profession:s.profession||"",duration:`${s.policyDuration||g.Ib.policyDuration} Year(s)`,limitOfIndemnity:this.formatCurrency(s.limitOfIndemnity||g.Ib.limitOfIndemnity),startDate:s.policyStartDate||"",endDate:s.policyEndDate||"",netPremium:t.netPremiumAfterDiscount,discount:t.discountAmount,vat:t.vatAmount,totalPremium:t.totalPremium,selectedPlan:this._selectedPlan()?.planName}:null});updateFormData(t){this._formData.update(s=>({...s,...t}))}setFormData(t){this._formData.set(t)}clearFormData(){this._formData.set({})}setCustomerData(t){this._customerData.set(t)}clearCustomerData(){this._customerData.set(null)}setValidationResponse(t){const s=t?.customer_details||t?.customerDetails||t,d=this.extractFullName(s),m=this._formData();this._customerData.set({payload:{phone_no:m.mobileNumber||"",id_no:m.nationalId||"",dob:m.dateOfBirth||"",email_id:m.email||"",dob_type:"G",id_type:m.nationalId?.charAt(0)||"1"},customerDetails:s,customerFullDetails:t,fullName:d,policyMarketingConsentFlag:t?.policyMarketingConsentFlag})}extractFullName(t){const s=localStorage.getItem(D.Hh.LOCALIZE_DEFAULT_LANGUAGE)||"en";if(!t)return"";const d=m=>m&&"NULL"!==m?m:"";return"ar"===s?[d(t.first_name_ar),d(t.second_name_ar),d(t.third_name_ar),d(t.last_name_ar)].filter(Boolean).join(" ").trim():[d(t.first_name_en||t.EnglishFirstName),d(t.second_name_en||t.EnglishSecondName),d(t.third_name_en||t.EnglishThirdName),d(t.last_name_en||t.EnglishLastName)].filter(
1Boolean).join(" ").trim()}generateQuote(t){t&&this.updateFormData(t);const s=this._formData(),d={profession:s.profession||"",professionCode:s.professionCode,duration:s.policyDuration||g.Ib.policyDuration,limitOfIndemnity:s.limitOfIndemnity||g.Ib.limitOfIndemnity,startDate:s.policyStartDate||"",claimHistory:s.hasClaim||!1,claimPossibility:s.hasClaimPossibility,isRenewal:s.isRenewal,nationalId:s.nationalId,agentCode:s.agentCode};return this._isLoading.set(!0),this._error.set(null),this.mmpService.getQuote(d).pipe((0,E.M)({next:m=>{if(this._currentQuote.set(m),this._isLoading.set(!1),m.plans?.length){const I=m.plans.find(P=>P.isRecommended)||m.plans[0];this._selectedPlan.set(I)}},error:m=>{this._error.set(m.message),this._isLoading.set(!1)}}))}selectPlan(t){this._selectedPlan.set(t)}loadQuote(t){return this._isLoading.set(!0),this._error.set(null),this.mmpService.getQuoteById(t).pipe((0,E.M)({next:s=>{this._currentQuote.set(s),this._isLoading.set(!1)},error:s=>{this._error.set(s.message),this._isLoading.set(!1)}}))}resetQuote(){this._currentQuote.set(null),this._selectedPlan.set(null),this._error.set(null)}resetAll(){this.resetQuote(),this.clearFormData(),this.clearCustomerData()}getPremiumBreakdown(){const t=this._currentQuote();return t?[{label:"Net Premium",value:t.netPremium},{label:"Discount",value:-t.discountAmount},{label:"Net After Discount",value:t.netPremiumAfterDiscount},{label:"VAT (15%)",value:t.vatAmount},{label:"Total Premium",value:t.totalPremium}]:[]}formatCurrency(t){return new Intl.NumberFormat("en-SA",{style:"currency",currency:"SAR",minimumFractionDigits:0,maximumFractionDigits:0}).format(t)}static \u0275fac=function(s){return new(s||p)};static \u0275prov=i.jDH({token:p,factory:p.\u0275fac,providedIn:"root"})}return p})()}}]);
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.