1import{f as P}from"./chunk-ZKSRIWH6.js";import"./chunk-5LG6FWRW.js";import{a as X}from"./chunk-MUUT3CMA.js";import{c as O,e as h,g as A,h as V,m as L,p as z,s as W,v as H,w as R,y as $}from"./chunk-2R4AZB5W.js";import{a as G}from"./chunk-HT2STO7B.js";import{i as j}from"./chunk-JCPUWVFC.js";import{b as k}from"./chunk-MCQML6YT.js";import"./chunk-XNXLFDZX.js";import"./chunk-KELMSLCR.js";import"./chunk-N6W3AF2G.js";import{a as q}from"./chunk-IENL4UJA.js";import{d as D,e as w}from"./chunk-JLWCQ6UT.js";import"./chunk-P4C42LQP.js";import"./chunk-RZZCZ2VH.js";import{m as N,w as U}from"./chunk-Z7IUSDSQ.js";import{Fa as _,Je as l,Kd as f,Ke as a,Le as m,Ra as E,Vf as p,Wf as v,Xf as u,ff as T,hf as g,ic as B,ig as I,kf as M,pe as o,vg as s,wg as c,zc as i}from"./chunk-SRTQBDBP.js";import"./chunk-EJD3L6HM.js";import"./chunk-T7NDVU76.js";function Z(e,d){e&1&&(l(0,"small"),p(1),s(2,"translate"),a()),e&2&&(i(),v(c(2,1,"required")))}function ee(e,d){if(e&1&&(l(0,"div",19),m(1,"img",20),f(2,Z,3,3,"small",21),a()),e&2){let t,r=g();i(2),o("ngIf",(t=r.contactUsForm.get("userFullName"))==null?null:t.hasError("required"))}}function te(e,d){e&1&&(l(0,"small"),p(1),s(2,"translate"),a()),e&2&&(i(),v(c(2,1,"Phone number must start with 05 and must be 10 characters long")))}function ie(e,d){if(e&1&&(l(0,"div",19),m(1,"img",20),f(2,te,3,3,"small",21),a()),e&2){let t,r=g();i(2),o("ngIf",(t=r.contactUsForm.get("phoneNumber"))==null?null:t.hasError("pattern"))}}function ne(e,d){e&1&&(l(0,"small"),p(1),s(2,"translate"),a()),e&2&&(i(),v(c(2,1,"required")))}function ae(e,d){if(e&1&&(l(0,"div",19),m(1,"img",20),f(2,ne,3,3,"small",21),a()),e&2){let t,r=g();i(2),o("ngIf",(t=r.contactUsForm.get("phoneNumber"))==null?null:t.hasError("required"))}}function le(e,d){e&1&&(l(0,"small"),p(1),s(2,"translate"),a()),e&2&&(i(),v(c(2,1,"required")))}function re(e,d){e&1&&(l(0,"small"),p(1),s(2,"translate"),a()),e&2&&(i(),v(c(2,1,"Invalid email format")))}function oe(e,d){if(e&1&&(l(0,"div",19),m(1,"img",20),f(2,le,3,3,"small",21)(3,re,3,3,"small",21),a()),e&2){let t,r,n=g();i(2),o("ngIf",(t=n.contactUsForm.get("email"))==null?null:t.hasError("required")),i(),o("ngIf",(r=n.contactUsForm.get("email"))==null?null:r.hasError("email"))}}function me(e,d){e&1&&(l(0,"small"),p(1),s(2,"translate"),a()),e&2&&(i(),v(c(2,1,"required")))}function se(e,d){if(e&1&&(l(0,"div",19),m(1,"img",20),f(2,me,3,3,"small",21),a()),e&2){let t,r=g();i(2),o("ngIf",(t=r.contactUsForm.get("subject"))==null?null:t.hasError("required"))}}function ce(e,d){e&1&&(l(0,"small"),p(1),s(2,"translate"),a()),e&2&&(i(),v(c(2,1,"required")))}function pe(e,d){e&1&&(l(0,"small"),p(1),s(2,"translate"),a()),e&2&&(i(),v(c(2,1,"Must be at least 3 characters long")))}function de(e,d){if(e&1&&(l(0,"div",19),m(1,"img",20),f(2,ce,3,3,"small",21)(3,pe,3,3,"small",21),a()),e&2){let t,r,n=g();i(2),o("ngIf",(t=n.contactUsForm.get("messageDetails"))==null?null:t.hasError("required")),i(),o("ngIf",(r=n.contactUsForm.get("messageDetails"))==null?null:r.hasError("minlength"))}}var J=(()=>{class e{constructor(){this.isFormSubmitted=!1,this.fb=_(R),this.userService=_(k),this.profileService=_(G),this.swalService=_(X),this.userService.getUserData().subscribe(t=>{t&&(this.userData=t,this.createForm())}),this.userData||this.createForm()}ngOnInit(){}createForm(){this.contactUsForm=this.fb.group({userFullName:[{value:this.userData?.name||"",disabled:!!this.userData?.name},h.required],phoneNumber:[{value:this.userData?.phoneNumber||"",disabled:!!this.userData?.phoneNumber},[h.required,h.pattern(/^05\d{8}$/)]],email:[{value:this.userData?.email||"",disabled:!!this.userData?.email},[h.required,h.email]],subject:["",[h.required,h.minLength(3)]],messageDetails:["",[h.required,h.minLength(3)]]})}onSubmit(){if(this.isFormSubmitted=!0,this.contactUsForm.invalid){this.contactUsForm.markAllAsTouched();return}let t=this.contactUsForm.getRawValue();if(this.contactUsForm.valid){let r={name:t.userFullName,phoneNumber:t.phoneNumber,email:t.email,messageTitle:t.subject,messageDetails:t.messageDetails};this.profileService.contactUs(r).subscribe({next:n=>{this.swalService.displaySwalSuccess(n.data),this.resetFormWithUserData(),this.isFormSubmitted=!1},error:n=>{this.swalService.displaySwalError(n.error.message)}})}}resetFormWithUserData(){this.contactUsForm.reset({firstName:{value:this.userData?.name||"",disabled:!!this.userData?.name},lastName:"",phoneNumber:{value:this.userData?.phoneNumber||"",disabled:!!this.userData?.phoneNumber},email:{value:this.userData?.email||"",disabled:!!this.userData?.email},messageDetails:""})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=E({type:e,selectors:[["app-contact-form"]],standalone:!0,features:[I],decls:41,vars:28,consts:[[1,"contactUs-form"],[1,"d-flex","flex-column"],[1,"fs-32","f-w-bold","text-center","text-white","mb-4"],[1,"row","row-cols-1","row-cols-md-2","g-4",3,"formGroup"],[1,"form-group","position-relative"],["id","userName","formControlName","userFullName","type","text","maxlength","10",1,"form-control","inputPlaceholder",3,"placeholder"],["src","assets/images/dynamic/auth/icons/company-icon.svg","alt","",1,"inputPlaceholderIcon"],["class","errorMessage",4,"ngIf"],["id","userName","formControlName","phoneNumber","type","text","maxlength","10",1,"form-control","inputPlaceholder",3,"placeholder"],["src","assets/images/dynamic/auth/icons/mobile-number-icon.svg","alt","",1,"inputPlaceholderIcon"],["id","userName","formControlName","email","type","text",1,"form-control","inputPlaceholder",3,"placeholder"],["src","assets/images/dynamic/auth/icons/email-icon.svg","alt","",1,"inputPlaceholderIcon"],["id","userName","formControlName","subject","type","text","maxlength","10",1,"form-control","inputPlaceholder",3,"placeholder"],[1,"w-100"],[1,"form-group","col","position-relative"],["id","messageDetails","formControlName","messageDetails","rows","6",1,"form-control","textareaPlaceholder",3,"placeholder"],["src","assets/images/dynamic/auth/icons/details-icon.svg","alt","",1,"textareaPlaceholderIcon"],[1,"w-100","d-flex","align-items-center","justify-content-center"],[1,"btn","submit-button","fs-18","f-w-regular",3,"click"],[1,"errorMessage"],["src","assets/images/icons/dynamic/error-info-white-icon.svg","alt",""],[4,"ngIf"]],template:function(r,n){if(r&1&&(l(0,"div",0)(1,"div",1)(2,"div",2),p(3),s(4,"translate"),a(),l(5,"form",3)(6,"div")(7,"div",4),m(8,"input",5),s(9,"translate"),m(10,"img",6),a(),f(11,ee,3,1,"div",7),a(),l(12,"div")(13,"div",4),m(14,"input",8),s(15,"translate"),m(16,"img",9),a(),f(17,ie,3,1,"div",7)(18,ae,3,1,"div",7),a(),l(19,"div")(20,"div",4),m(21,"input",10),s(22,"translate"),m(23,"img",11),a(),f(24,oe,4,2,"div",7),a(),l(25,"div")(26,"div",4),m(27,"input",12),s(28,"translate"),m(29,"img",11),a(),f(30,se,3,1,"div",7),a(),l(31,"div",13)(32,"div",14),m(33,"textarea",15),s(34,"translate"),m(35,"img",16),a(),f(36,de,4,2,"div",7),a(),l(37,"div",17)(38,"button",18),T("click",function(){return n.onSubmit()}),p(39),s(40,"translate"),a()()()()()),r&2){let C,x,b,S,F,y;i(3),u(" ",c(4,14,"contactUs")," "),i(2),o("formGroup",n.contactUsForm),i(3),o("placeholder",c(9,16,"companyName")),i(3),o("ngIf",((C=n.contactUsForm.get("userFullName"))==null?null:C.errors)&&(((C=n.contactUsForm.get("userFullName"))==null?null:C.touched)||n.isFormSubmitted)),i(3),o("placeholder",c(15,18,"mobileNumber")),i(3),o("ngIf",((x=n.contactUsForm.get("phoneNumber"))==null?null:x.errors)&&(((x=n.contactUsForm.get("phoneNumber"))==null?null:x.touched)||n.isFormSubmitted)&&((x=n.contactUsForm.get("phoneNumber"))==null?null:x.hasError("pattern"))),i(),o("ngIf",((b=n.contactUsForm.get("phoneNumber"))==null?null:b.errors)&&(((b=n.contactUsForm.get("phoneNumber"))==null?null:b.touched)||n.isFormSubmitted)&&((b=n.contactUsForm.get("phoneNumber"))==null?null:b.hasError("required"))),i(3),o("placeholder",c(22,20,"Email")),i(3),o("ngIf",((S=n.contactUsForm.get("email"))==null?null:S.errors)&&(((S=n.contactUsForm.get("email"))==null?null:S.touched)||n.isFormSubmitted)),i(3),o("placeholder",c(28,22,"subject")),i(3),o("ngIf",((F=n.contactUsForm.get("subject"))==null?null:F.errors)&&(((F=n.
1contactUsForm.get("subject"))==null?null:F.touched)||n.isFormSubmitted)),i(3),M("placeholder",c(34,24,"details")),i(3),o("ngIf",((y=n.contactUsForm.get("messageDetails"))==null?null:y.errors)&&(((y=n.contactUsForm.get("messageDetails"))==null?null:y.touched)||n.isFormSubmitted)),i(3),u(" ",c(40,26,"send")," ")}},dependencies:[U,N,w,D,$,L,O,A,V,H,z,W],styles:['.contactUs-form[_ngcontent-%COMP%]{background-image:url("./media/compines-services-bg-66DHV5XH.svg");background-position:center;background-repeat:no-repeat;background-size:cover;padding:56px 24px 64px;border-radius:16px}.contactUs-form[_ngcontent-%COMP%] #messageDetails[_ngcontent-%COMP%]{height:auto}.submit-button[_ngcontent-%COMP%]{background-color:#fff;border-radius:28px;color:#e5154f;height:48px;padding:0 50px}.errorMessage[_ngcontent-%COMP%]{background-color:red!important;color:#fff!important;border-radius:28px!important;padding:4px 16px!important;width:fit-content;margin-top:8px;display:flex;align-items:center;justify-content:center;gap:4px}']})}}return e})();function ue(e,d){if(e&1&&(l(0,"div",10),m(1,"img",11),l(2,"div",12)(3,"div",13),p(4),s(5,"translate"),a(),l(6,"a",14),p(7),a()()()),e&2){let t=g();i(4),u(" ",c(5,3,"phone_number"),": "),i(2),o("href","tel:"+(t.phoneNumber==null||t.phoneNumber.fields==null?null:t.phoneNumber.fields.value),B),i(),u(" ",t.phoneNumber==null||t.phoneNumber.fields==null?null:t.phoneNumber.fields.value," ")}}function fe(e,d){if(e&1&&(l(0,"div",10),m(1,"img",15),l(2,"div",12)(3,"div",13),p(4),s(5,"translate"),a(),l(6,"a",14),p(7),a()()()),e&2){let t=g();i(4),u(" ",c(5,3,"Email"),": "),i(2),o("href","mailto:"+(t.Email==null||t.Email.fields==null?null:t.Email.fields.value),B),i(),u(" ",t.Email==null||t.Email.fields==null?null:t.Email.fields.value," ")}}function ge(e,d){if(e&1&&(l(0,"div",10),m(1,"img",16),l(2,"div",12)(3,"div",13),p(4),s(5,"translate"),a(),l(6,"div",17),p(7),a()()()),e&2){let t=g();i(4),u(" ",c(5,2,"fax_number"),": "),i(3),u(" ",t.fax==null||t.fax.fields==null?null:t.fax.fields.value," ")}}function he(e,d){if(e&1&&(l(0,"div",18)(1,"div",10),m(2,"img",19),l(3,"div",12)(4,"div",13),p(5),s(6,"translate"),a(),l(7,"address",20),p(8),a()()(),l(9,"div"),m(10,"img",21),a()()),e&2){let t=g();i(5),u(" ",c(6,2,"location"),": "),i(3),u(" ",t.mainBranch==null||t.mainBranch.fields==null?null:t.mainBranch.fields.value," ")}}var qe=(()=>{class e{constructor(){this.dynamicStore=_(P),this.sharedService=_(j)}ngOnInit(){this.sharedService.setActiveComponent("contactUs"),this.getContent()}getContent(){this.dynamicStore.dynamicContent("GlobalSettings",`${q.contentApiUrl}/GlobalSettings?withchildren=true`).subscribe(t=>{t&&(this.GlobalSettings=t[0],this.phoneNumber=this.GlobalSettings?.children?.filter(r=>r.fields?.key=="phone")[0],this.Email=this.GlobalSettings?.children?.filter(r=>r.fields?.key=="Email")[0],this.whatsApp=this.GlobalSettings?.children?.filter(r=>r.fields?.key=="whatsApp")[0],this.fax=this.GlobalSettings?.children?.filter(r=>r.fields?.key=="fax")[0],this.mainBranch=this.GlobalSettings?.children?.filter(r=>r.fields?.key=="main-branch")[0])})}ngOnDestroy(){this.sharedService.setActiveComponent("")}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=E({type:e,selectors:[["app-contact-us"]],standalone:!0,features:[I],decls:19,vars:13,consts:[[1,"container"],[1,"row","row-cols-1","row-cols-md-2","align-items-start","justify-content-between","g-4","pt-64","pb-64"],["aria-labelledby","contact-form-heading",1,"col-12","col-md-7"],["id","contact-form-heading",1,"visually-hidden"],["aria-labelledby","contact-info-heading",1,"col-12","col-md-5"],["id","contact-info-heading",1,"fs-32","f-w-bold","text-023D59"],[1,"mt-2","fs-16","f-w-regular","text-023D59"],[1,"d-flex","flex-column","mt-4","gap-4"],["class","d-flex algin-items-start gap-12",4,"ngIf"],["class","d-flex justify-content-between align-items-center",4,"ngIf"],[1,"d-flex","algin-items-start","gap-12"],["src","assets/images/icons/dynamic/contctus/phone.svg","alt","Phone Icon"],[1,"d-flex","flex-column","gap-2"],[1,"fs-16","f-w-regular","text-023D59"],[1,"fs-20","f-w-regular","text-023D59","text-decoration-none",3,"href"],["src","assets/images/icons/dynamic/contctus/mail.svg","alt","Email Icon"],["src","assets/images/icons/dynamic/contctus/fax.svg","alt","Fax Icon"],[1,"fs-20","f-w-regular","text-023D59"],[1,"d-flex","justify-content-between","align-items-center"],["src","assets/images/icons/dynamic/contctus/fax.svg","alt","Location Icon"],[1,"fs-20","f-w-regular","text-023D59","mb-0"],["src","assets/images/icons/dynamic/contctus/map.svg","alt","Map Preview"]
1],template:function(r,n){r&1&&(l(0,"main",0)(1,"div",1)(2,"section",2)(3,"h2",3),p(4),s(5,"translate"),a(),m(6,"app-contact-form"),a(),l(7,"section",4)(8,"h1",5),p(9),s(10,"translate"),a(),l(11,"p",6),p(12),s(13,"translate"),a(),l(14,"div",7),f(15,ue,8,5,"div",8)(16,fe,8,5,"div",8)(17,ge,8,4,"div",8)(18,he,11,4,"div",9),a()()()()),r&2&&(i(4),u(" ",c(5,7,"contactUS")," "),i(5),u(" ",c(10,9,"We are pleased to communicate with you")," "),i(3),u(" ",c(13,11,"contactusSubTitle")," "),i(3),o("ngIf",n.phoneNumber==null||n.phoneNumber.fields==null?null:n.phoneNumber.fields.value),i(),o("ngIf",n.Email==null||n.Email.fields==null?null:n.Email.fields.value),i(),o("ngIf",n.fax==null||n.fax.fields==null?null:n.fax.fields.value),i(),o("ngIf",n.mainBranch==null||n.mainBranch.fields==null?null:n.mainBranch.fields.value))},dependencies:[U,N,w,D,J],styles:[".gap-12[_ngcontent-%COMP%]{gap:12px}"]})}}return e})();export{qe as ContactUsComponent};
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.