| Server IP : 72.60.233.178 / Your IP : 216.73.216.91 Web Server : Apache System : Linux srv1210665.hstgr.cloud 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : armaladmin ( 1001) PHP Version : 8.3.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/armaladmin/public_html/pm/property/ |
Upload File : |
"use strict";(self.webpackChunkmaterial_dashboard_angular=self.webpackChunkmaterial_dashboard_angular||[]).push([[257],{81257:function(t,e,n){n.r(e),n.d(e,{UnitModule:function(){return Pt}});var i=n(39895),o=n(22238),r=n(99692),a=n(11494),s=n(22759),l=n(66682),c=n(54395),d=n(87519),u=n(68307),m=n(28292),g=n(1581);class p extends g.y{constructor(t){super(t)}}var h=n(37716),f=n(3679),_=n(26215),Z=n(48700),b=n(57404),x=n(65),y=n(91841);let v=(()=>{class t extends x.b{constructor(t){super(t,"units"),this.selectedUnitSource=new _.X(null),this.selectedUnitChanges$=this.selectedUnitSource.asObservable(),this.localHttpClient=t}changeSelectedUnit(t){this.selectedUnitSource.next(t)}search(t){const e=`${super.getResourceUrl()}/search`;return this.localHttpClient.post(e,{filter:t})}}return t.\u0275fac=function(e){return new(e||t)(h.LFG(y.eN))},t.\u0275prov=h.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var A=n(75973),C=n(38583),O=n(42542),T=n(76627),q=n(98295),U=n(49983),M=n(67441),P=n(51095),w=n(72458),E=n(12178);const I=["stepper"];function N(t,e){1&t&&(h.ynx(0),h.TgZ(1,"mat-icon",28),h._uU(2,"error_outline"),h.qZA(),h.BQk())}function k(t,e){if(1&t&&(h.TgZ(0,"h5",27),h._uU(1,"New Property Unit "),h.YNc(2,N,3,0,"ng-container",24),h.ALo(3,"async"),h.qZA()),2&t){const t=h.oxw();h.xp6(2),h.Q6J("ngIf",h.lcZ(3,1,t.formError$))}}function S(t,e){1&t&&(h.ynx(0),h.TgZ(1,"mat-icon",28),h._uU(2,"error_outline"),h.qZA(),h.BQk())}function Y(t,e){if(1&t&&(h.TgZ(0,"div",27),h._uU(1,"Edit Property Unit "),h.YNc(2,S,3,0,"ng-container",24),h.ALo(3,"async"),h.qZA()),2&t){const t=h.oxw();h.xp6(2),h.Q6J("ngIf",h.lcZ(3,1,t.formError$))}}function D(t,e){if(1&t&&(h.TgZ(0,"mat-error",29),h._uU(1),h.qZA()),2&t){const t=h.oxw();h.xp6(1),h.Oqu(t.formErrors.unit_name)}}function F(t,e){if(1&t&&(h.TgZ(0,"mat-error",29),h._uU(1),h.qZA()),2&t){const t=h.oxw();h.xp6(1),h.Oqu(t.formErrors.unit_floor)}}function Q(t,e){if(1&t&&(h.TgZ(0,"mat-error",29),h._uU(1),h.qZA()),2&t){const t=h.oxw();h.xp6(1),h.Oqu(t.formErrors.rent_amount)}}function J(t,e){if(1&t&&(h.TgZ(0,"mat-option",30),h._uU(1),h.qZA()),2&t){const t=e.$implicit;h.Q6J("value",t.id),h.xp6(1),h.hij(" ",t.unit_type_display_name," ")}}function $(t,e){if(1&t&&(h.TgZ(0,"mat-error",29),h._uU(1),h.qZA()),2&t){const t=h.oxw();h.xp6(1),h.Oqu(t.formErrors.unit_type_id)}}function R(t,e){if(1&t&&(h.TgZ(0,"mat-error",29),h._uU(1),h.qZA()),2&t){const t=h.oxw(2);h.xp6(1),h.Oqu(t.formErrors.bed_rooms)}}function V(t,e){if(1&t&&(h.TgZ(0,"mat-error",29),h._uU(1),h.qZA()),2&t){const t=h.oxw(2);h.xp6(1),h.Oqu(t.formErrors.bath_rooms)}}function L(t,e){if(1&t&&(h.TgZ(0,"div",9),h.TgZ(1,"div",19),h.TgZ(2,"mat-form-field",11),h.TgZ(3,"mat-label"),h._uU(4,"Bed Rooms"),h.qZA(),h._UZ(5,"input",31),h.YNc(6,R,2,1,"mat-error",13),h.qZA(),h.qZA(),h.TgZ(7,"div",19),h.TgZ(8,"mat-form-field",11),h.TgZ(9,"mat-label"),h._uU(10,"Bath Rooms"),h.qZA(),h._UZ(11,"input",32),h.YNc(12,V,2,1,"mat-error",13),h.qZA(),h.qZA(),h.qZA()),2&t){const t=h.oxw();h.xp6(6),h.Q6J("ngIf",null==t.formErrors?null:t.formErrors.bed_rooms),h.xp6(6),h.Q6J("ngIf",null==t.formErrors?null:t.formErrors.bath_rooms)}}function z(t,e){if(1&t&&(h.TgZ(0,"mat-error",29),h._uU(1),h.qZA()),2&t){const t=h.oxw();h.xp6(1),h.Oqu(t.formErrors.total_rooms)}}function B(t,e){if(1&t&&(h.TgZ(0,"mat-error",29),h._uU(1),h.qZA()),2&t){const t=h.oxw();h.xp6(1),h.Oqu(t.formErrors.square_foot)}}function j(t,e){1&t&&(h.TgZ(0,"div",33),h._UZ(1,"mat-progress-bar",34),h.qZA())}function H(t,e){if(1&t){const t=h.EpF();h.TgZ(0,"button",36),h.NdJ("click",function(){return h.CHM(t),h.oxw(2).deleting()}),h._uU(1,"Delete "),h.qZA()}if(2&t){const t=h.oxw(2);h.Q6J("disabled",t.loader)("mat-dialog-close",!0)}}function G(t,e){if(1&t&&(h.ynx(0),h.YNc(1,H,2,2,"button",35),h.BQk()),2&t){const t=h.oxw();h.xp6(1),h.Q6J("ngIf",!t.isAdd)}}let W=(()=>{class t{constructor(t,e,n,i,o,r){var a;this.fb=e,this.notification=n,this.unitService=i,this.authenticationService=o,this.dialogRef=r,this.errorInForm=new _.X(!1),this.formError$=this.errorInForm.asObservable(),this.loader=!1,this.panelOpenState=!1,this.disableAnimation=!0,this.amenities=Array(),this.optionsAmenity=Array(),this.optionsUtility=Array(),this.toggle=new h.vpe,this.isAdmin$=this.authenticationService.isAdmin(),this.unitValue=t.unit,this.utilities$=t.utilities,this.amenities$=t.amenities$,this.unitTypes$=t.unitTypes$,this.amenities=t.amenitiesData,this.optionsAmenity=t.amenityOptions,this.optionsUtility=t.utilityOptions,this.isAdd=t.isAdd,this.unitID=null===(a=null==t?void 0:t.unit)||void 0===a?void 0:a.id,this.propertyID=null==t?void 0:t.propertyID,this.billingFrequencies=Z.G}ngOnInit(){var t,e,n,i,o,r,a,s,l,c,d,u,m;this.selectedValuesAmenity=(null===(t=this.unitValue)||void 0===t?void 0:t.selected_amenities)?null===(e=this.unitValue)||void 0===e?void 0:e.selected_amenities:[],this.selectedValuesUtility=(null===(n=this.unitValue)||void 0===n?void 0:n.selected_utilities)?null===(i=this.unitValue)||void 0===i?void 0:i.selected_utilities:[],this.selectedUnitType=this.unitValue?null===(o=this.unitValue)||void 0===o?void 0:o.unit_mode:"residential",this.form=this.fb.group({unit_mode:[this.selectedUnitType],unit_type_id:[null===(r=this.unitValue)||void 0===r?void 0:r.unit_type_id,[f.kI.required,f.kI.minLength(1)]],unit_name:[null===(a=this.unitValue)||void 0===a?void 0:a.unit_name,[f.kI.required,f.kI.minLength(1)]],unit_floor:[null===(s=this.unitValue)||void 0===s?void 0:s.unit_floor],rent_amount:[null===(l=this.unitValue)||void 0===l?void 0:l.rent_amount],bed_rooms:[null===(c=this.unitValue)||void 0===c?void 0:c.bed_rooms],bath_rooms:[null===(d=this.unitValue)||void 0===d?void 0:d.bath_rooms],square_foot:[null===(u=this.unitValue)||void 0===u?void 0:u.square_foot],total_rooms:[null===(m=this.unitValue)||void 0===m?void 0:m.total_rooms],utilityFields:new f.Oe([]),amenityFields:new f.Oe([])}),this.form.valueChanges.subscribe(t=>{const e=new Array;for(let n=0;n<this.itemsAmenities.length;n++)this.itemsAmenities.get(n.toString()).value&&e.push(this.optionsAmenity[n].value);this.toggle.emit(e)}),this.form.valueChanges.subscribe(t=>{const e=new Array;for(let n=0;n<this.itemsUtilities.length;n++)this.itemsUtilities.get(n.toString()).value&&e.push(this.optionsUtility[n].value);this.toggle.emit(e)}),0===this.itemsAmenities.length&&this.optionsAmenity.forEach(t=>{this.itemsAmenities.push(new f.NI(!1))}),0===this.itemsUtilities.length&&this.optionsUtility.forEach(t=>{this.itemsUtilities.push(new f.NI(!1))}),this.selectedValuesAmenity.forEach(t=>{const e=this.optionsAmenity.findIndex(e=>e.value===t);e>=0&&this.itemsAmenities.get(e.toString()).setValue(!0)}),this.selectedValuesUtility.forEach(t=>{const e=this.optionsUtility.findIndex(e=>e.value===t);e>=0&&this.itemsUtilities.get(e.toString()).setValue(!0)})}selectedAmenities(){return this.form.value.amenityFields.map((t,e)=>t?this.optionsAmenity[e].value:null).filter(t=>null!==t)}get itemsAmenities(){return this.form.get("amenityFields")}selectedUtilities(){return this.form.value.utilityFields.map((t,e)=>t?this.optionsUtility[e].value:null).filter(t=>null!==t)}get itemsUtilities(){return this.form.get("utilityFields")}ngAfterViewInit(){setTimeout(()=>this.disableAnimation=!1)}onToggleChange(t){this.selectedUnitType=t}closeDialog(t){console.log("xxxxDATxxxx",t),t.selected_amenities=this.selectedAmenities(),t.selected_utilities=this.selectedUtilities(),console.log("Data with selected amenities",t),this.dialogRef.close({event:"close",data:t})}close(){this.dialogRef.close()}onSaveComplete(){this.loader=!1,this.form.reset(),this.dialogRef.close(this.form.value)}create(){this.errorInForm.next(!1);const t=Object.assign({},this.unit,this.form.value);t.property_id=this.propertyID,console.log("unit create",t),this.loader=!0,this.unitService.create(t).subscribe(t=>{this.onSaveComplete(),this.notification.showNotification("success","Success !! Unit created.")},t=>{var e,n;if(this.errorInForm.next(!0),this.loader=!1,0!==t.member){if(this.formErrors=t,this.formErrors)for(const t in this.formErrors)this.form&&(null===(e=this.form.controls[t])||void 0===e||e.markAsTouched(),null===(n=this.form.controls[t])||void 0===n||n.setErrors({incorrect:!0}))}else this.notification.showNotification("danger","Connection Error !! Nothing created. Check your connection and retry.")})}update(){const t=Object.assign({},this.unit,this.form.value);t.id=this.unitID,this.loader=!0,this.errorInForm.next(!1),this.unitService.update(t).subscribe(t=>{this.loader=!1,this.dialogRef.close(this.form.value),this.notification.showNotification("success","Success !! Unit has been updated.")},t=>{var e,n;if(this.loader=!1,this.errorInForm.next(!0),0!==t.utility&&(this.formErrors=null==t?void 0:t.error,this.formErrors))for(const i in this.formErrors)this.form&&(null===(e=this.form.controls[i])||void 0===e||e.markAsTouched(),null===(n=this.form.controls[i])||void 0===n||n.setErrors({incorrect:!0}))})}createOrUpdate(){this.isAdd?this.create():this.update()}deleting(){this.dialogRef.close("deleting")}}return t.\u0275fac=function(e){return new(e||t)(h.Y36(o.WI),h.Y36(f.qu),h.Y36(b.g),h.Y36(v),h.Y36(A.$),h.Y36(o.so))},t.\u0275cmp=h.Xpm({type:t,selectors:[["robi-add-unit"]],viewQuery:function(t,e){if(1&t&&h.Gf(I,7),2&t){let t;h.iGM(t=h.CRH())&&(e.stepper=t.first)}},outputs:{toggle:"toggle"},decls:70,vars:20,consts:[["mat-dialog-title","",4,"ngIf"],[3,"formGroup"],[1,"row",2,"margin-bottom","20px"],[1,"col-md-12"],["formControlName","unit_mode",3,"change"],["group","matButtonToggleGroup"],["value","residential","aria-label","Text align left"],["value","commercial","aria-label","Text align right"],[1,"mat-dialog-data"],[1,"row"],[1,"col-sm-12"],["color","primary","appearance","outline",1,"full-width"],["matInput","","formControlName","unit_name","placeholder","Unit Name"],["align","start","class","form__error",4,"ngIf"],["matInput","","type","number","formControlName","unit_floor","placeholder","Unit Floor"],["matInput","","type","number","min","0","formControlName","rent_amount","placeholder","Rent Amount"],["placeholder","Unit Type *","formControlName","unit_type_id"],[3,"value",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],[1,"col-sm-6"],["matInput","","type","number","min","0","formControlName","total_rooms","placeholder","Total Rooms"],["matInput","","type","number","min","0","formControlName","square_foot","placeholder","Square Foot"],["class","d-flex justify-content-center spinner-container",4,"ngIf"],["align","center"],[4,"ngIf"],["mat-button","","color","primary",1,"mr-2",3,"disabled","mat-dialog-close","click"],["mat-raised-button","","color","primary",3,"disabled","click"],["mat-dialog-title",""],["color","warn"],["align","start",1,"form__error"],[3,"value"],["matInput","","type","number","min","0","formControlName","bed_rooms","placeholder","Bed Rooms"],["matInput","","type","number","min","0","formControlName","bath_rooms","placeholder","Bath Rooms"],[1,"d-flex","justify-content-center","spinner-container"],["color","primary","mode","query","value","50","bufferValue","75"],["class","float-left mr-2","mat-button","","color","warn",3,"disabled","mat-dialog-close","click",4,"ngIf"],["mat-button","","color","warn",1,"float-left","mr-2",3,"disabled","mat-dialog-close","click"]],template:function(t,e){if(1&t){const t=h.EpF();h.YNc(0,k,4,3,"h5",0),h.YNc(1,Y,4,3,"div",0),h.TgZ(2,"form",1),h.TgZ(3,"div",2),h.TgZ(4,"div",3),h.TgZ(5,"mat-button-toggle-group",4,5),h.NdJ("change",function(){h.CHM(t);const n=h.MAs(6);return e.onToggleChange(n.value)}),h.TgZ(7,"mat-button-toggle",6),h.TgZ(8,"mat-icon"),h._uU(9,"home"),h.qZA(),h.TgZ(10,"span"),h._uU(11,"Residential"),h.qZA(),h.qZA(),h.TgZ(12,"mat-button-toggle",7),h.TgZ(13,"mat-icon"),h._uU(14,"business"),h.qZA(),h.TgZ(15,"span"),h._uU(16,"Commercial"),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.TgZ(17,"mat-dialog-content",8),h.TgZ(18,"div",9),h.TgZ(19,"div",10),h.TgZ(20,"mat-form-field",11),h.TgZ(21,"mat-label"),h._uU(22,"Unit Name *"),h.qZA(),h._UZ(23,"input",12),h.YNc(24,D,2,1,"mat-error",13),h.qZA(),h.qZA(),h.qZA(),h.TgZ(25,"div",9),h.TgZ(26,"div",10),h.TgZ(27,"mat-form-field",11),h.TgZ(28,"mat-label"),h._uU(29," Unit Floor"),h.qZA(),h._UZ(30,"input",14),h.YNc(31,F,2,1,"mat-error",13),h.qZA(),h.qZA(),h.qZA(),h.TgZ(32,"div",9),h.TgZ(33,"div",10),h.TgZ(34,"mat-form-field",11),h.TgZ(35,"mat-label"),h._uU(36,"Rent Amount"),h.qZA(),h._UZ(37,"input",15),h.YNc(38,Q,2,1,"mat-error",13),h.qZA(),h.qZA(),h.qZA(),h.TgZ(39,"div",9),h.TgZ(40,"div",10),h.TgZ(41,"mat-form-field",11),h.TgZ(42,"mat-label"),h._uU(43,"Unit Type *"),h.qZA(),h.TgZ(44,"mat-select",16),h.YNc(45,J,2,2,"mat-option",17),h.ALo(46,"async"),h.qZA(),h.YNc(47,$,2,1,"mat-error",13),h.qZA(),h.qZA(),h.qZA(),h.YNc(48,L,13,2,"div",18),h.TgZ(49,"div",9),h.TgZ(50,"div",19),h.TgZ(51,"mat-form-field",11),h.TgZ(52,"mat-label"),h._uU(53,"Total Rooms"),h.qZA(),h._UZ(54,"input",20),h.YNc(55,z,2,1,"mat-error",13),h.qZA(),h.qZA(),h.TgZ(56,"div",19),h.TgZ(57,"mat-form-field",11),h.TgZ(58,"mat-label"),h._uU(59,"Square Foot"),h.qZA(),h._UZ(60,"input",21),h.YNc(61,B,2,1,"mat-error",13),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.YNc(62,j,2,0,"div",22),h.TgZ(63,"mat-dialog-actions",23),h.YNc(64,G,2,1,"ng-container",24),h.ALo(65,"async"),h.TgZ(66,"button",25),h.NdJ("click",function(){return e.close()}),h._uU(67,"Cancel"),h.qZA(),h.TgZ(68,"button",26),h.NdJ("click",function(){return e.createOrUpdate()}),h._uU(69," Save Unit "),h.qZA(),h.qZA(),h.qZA()}2&t&&(h.Q6J("ngIf",e.isAdd),h.xp6(1),h.Q6J("ngIf",!e.isAdd),h.xp6(1),h.Q6J("formGroup",e.form),h.xp6(22),h.Q6J("ngIf",null==e.formErrors?null:e.formErrors.unit_name),h.xp6(7),h.Q6J("ngIf",null==e.formErrors?null:e.formErrors.unit_floor),h.xp6(7),h.Q6J("ngIf",null==e.formErrors?null:e.formErrors.rent_amount),h.xp6(7),h.Q6J("ngForOf",h.lcZ(46,16,e.unitTypes$)),h.xp6(2),h.Q6J("ngIf",null==e.formErrors?null:e.formErrors.unit_type_id),h.xp6(1),h.Q6J("ngIf","residential"==e.selectedUnitType),h.xp6(7),h.Q6J("ngIf",null==e.formErrors?null:e.formErrors.total_rooms),h.xp6(6),h.Q6J("ngIf",null==e.formErrors?null:e.formErrors.square_foot),h.xp6(1),h.Q6J("ngIf",e.loader),h.xp6(2),h.Q6J("ngIf",h.lcZ(65,18,e.isAdmin$)),h.xp6(2),h.Q6J("disabled",e.loader)("mat-dialog-close",!0),h.xp6(2),h.Q6J("disabled",!e.form.valid||e.loader))},directives:[C.O5,f._Y,f.JL,f.sg,O.A9,f.JJ,f.u,O.Yi,T.Hw,o.xY,q.KE,q.hX,U.Nt,f.Fj,f.wV,f.qQ,M.gD,C.sg,o.H8,P.lW,o.ZT,o.uh,q.TO,w.ey,E.pW],pipes:[C.Ov],styles:[".dialog-row[_ngcontent-%COMP%]{max-width:400px!important}"]}),t})();var X=n(66058),K=n(90519),tt=n(63385),et=n(99170),nt=n(88211),it=n(28508),ot=n(32789),rt=n(11436),at=n(29790);const st=["search"];function lt(t,e){if(1&t){const t=h.EpF();h.TgZ(0,"button",38),h.NdJ("click",function(){return h.CHM(t),h.oxw().clearSearch()}),h.TgZ(1,"mat-icon"),h._uU(2,"close"),h.qZA(),h.qZA()}}function ct(t,e){1&t&&(h.TgZ(0,"mat-header-cell",39),h._uU(1," Unit Name "),h.qZA())}function dt(t,e){if(1&t&&(h.TgZ(0,"mat-cell"),h._uU(1),h.qZA()),2&t){const t=e.$implicit;h.xp6(1),h.hij(" ",t.unit_name," ")}}function ut(t,e){1&t&&(h.TgZ(0,"mat-header-cell",39),h._uU(1," Unit Mode "),h.qZA())}function mt(t,e){if(1&t&&(h.TgZ(0,"mat-cell"),h._uU(1),h.qZA()),2&t){const t=e.$implicit;h.xp6(1),h.hij(" ",t.unit_mode," ")}}function gt(t,e){1&t&&(h.TgZ(0,"mat-header-cell",39),h._uU(1," Unit Type "),h.qZA())}function pt(t,e){if(1&t&&(h.TgZ(0,"mat-cell"),h._uU(1),h.qZA()),2&t){const t=e.$implicit;h.xp6(1),h.hij(" ",null==t.unit_type?null:t.unit_type.unit_type_display_name," ")}}function ht(t,e){1&t&&(h.TgZ(0,"mat-header-cell",39),h._uU(1," Total Rooms "),h.qZA())}function ft(t,e){if(1&t&&(h.TgZ(0,"mat-cell"),h._uU(1),h.qZA()),2&t){const t=e.$implicit;h.xp6(1),h.hij(" ",t.total_rooms," ")}}function _t(t,e){1&t&&(h.TgZ(0,"mat-header-cell",39),h._uU(1," Bed Rooms "),h.qZA())}function Zt(t,e){if(1&t&&(h.TgZ(0,"mat-cell"),h._uU(1),h.qZA()),2&t){const t=e.$implicit;h.xp6(1),h.hij(" ",t.bed_rooms," ")}}function bt(t,e){1&t&&(h.TgZ(0,"mat-header-cell"),h._uU(1,"Actions"),h.qZA())}function xt(t,e){if(1&t){const t=h.EpF();h.TgZ(0,"mat-cell",40),h.TgZ(1,"button",41),h.NdJ("click",function(){const e=h.CHM(t).$implicit;return h.oxw().addDialog(!1,e)}),h.TgZ(2,"i",42),h._uU(3,"edit"),h.qZA(),h.qZA(),h.qZA()}2&t&&(h.xp6(1),h.Q6J("matTooltipPosition","above"))}function yt(t,e){1&t&&h._UZ(0,"mat-header-row")}function vt(t,e){1&t&&h._UZ(0,"mat-row")}function At(t,e){1&t&&(h.TgZ(0,"span"),h._uU(1,"No Data"),h.qZA())}function Ct(t,e){1&t&&(h.TgZ(0,"div",43),h._UZ(1,"mat-progress-bar",44),h.qZA())}const Ot=i.Bz.forChild([{path:"",component:(()=>{class t{constructor(t,e,n,i,o,r,a,s,l){this.landlordService=t,this.unitsService=e,this.propertyService=n,this.notification=i,this.route=o,this.unitTypeService=r,this.amenityService=a,this.utilityService=s,this.dialog=l,this.displayedColumns=["unit_name","unit_mode","unit_type_id","total_rooms","bed_rooms","actions"],this.loader=!1,this.isLandlord=!1,this.pageIndex=0,this.pageSizeOptions=[5,10,25,50,100],this.allAmenitiesOptions=new Array,this.allUtilitiesOptions=new Array,this.isLandlord=this.landlordService.isLandlord(),this.landlordID=this.landlordService.getLoggedInLandlordID(),this.propertyID=this.route.snapshot.paramMap.get("id"),this.property$=this.propertyService.selectedPropertyChanges$}ngOnInit(){this.dataSource=new p(this.unitsService),this.dataSource.meta$.subscribe(t=>this.meta=t),this.propertyID?this.dataSource.loadNested(this.propertyService.nestedUnitsUrl(this.propertyID),"",0,0):this.dataSource.load("",0,0,"created_at","desc","property_id",this.propertyID),this.unitTypes$=this.unitTypeService.list(["unit_type_name ","unit_type_display_name "]),this.amenities$=this.amenityService.list(["amenity_name ","amenity_display_name "]),this.amenities$.subscribe(t=>{this.allAmenitiesOptions=t.map(t=>new X.o(t.id,t.amenity_display_name))}),this.utilities$=this.utilityService.list(["utility_name ","utility_display_name "]),this.utilities$.subscribe(t=>{this.allUtilitiesOptions=t.map(t=>new X.o(t.id,t.utility_display_name))})}ngAfterViewInit(){(0,s.R)(this.search.nativeElement,"keyup").pipe((0,c.b)(1e3),(0,d.x)(),(0,u.b)(()=>{this.paginator.pageIndex=0,this.loadData()})).subscribe(),this.paginator.page.pipe((0,u.b)(()=>this.loadData())).subscribe(),this.sort.sortChange.subscribe(()=>this.paginator.pageIndex=0),(0,l.T)(this.sort.sortChange,this.paginator.page).pipe((0,u.b)(()=>this.loadData())).subscribe()}clearSearch(){this.search.nativeElement.value="",this.loadData()}addDialog(t=!0,e){const n=new o.vA;n.disableClose=!0,n.autoFocus=!0,n.data={unit:e,isAdd:t,propertyID:this.propertyID,utilities:this.utilities$,amenities$:this.amenities$,unitTypes$:this.unitTypes$,amenitiesData:this.amenities,amenityOptions:this.allAmenitiesOptions,utilityOptions:this.allUtilitiesOptions},this.dialog.open(W,n).afterClosed().subscribe(t=>{t&&("deleting"===t?this.openConfirmationDialog(e):this.loadData())})}loadData(){this.dataSource.loadNested(this.propertyService.nestedUnitsUrl(this.propertyID),this.search.nativeElement.value,this.paginator.pageIndex+1,this.paginator.pageSize,this.sort.active,this.sort.direction)}openConfirmationDialog(t){this.dialogRef=this.dialog.open(m.z,{disableClose:!0}),this.dialogRef.afterClosed().subscribe(e=>{e&&this.delete(t),this.dialogRef=null})}delete(t){this.loader=!0,this.unitsService.delete(t).subscribe(t=>{this.loader=!1,this.loadData(),this.notification.showNotification("success","Success !! Unit has been deleted.")},t=>{this.loader=!1,this.notification.showNotification("danger",t.error.message?t.error.message:"Delete Error !! ")})}}return t.\u0275fac=function(e){return new(e||t)(h.Y36(K.c),h.Y36(v),h.Y36(tt.b),h.Y36(b.g),h.Y36(i.gz),h.Y36(et.L),h.Y36(nt.p),h.Y36(it.t),h.Y36(o.uw))},t.\u0275cmp=h.Xpm({type:t,selectors:[["robi-units"]],viewQuery:function(t,e){if(1&t&&(h.Gf(st,5),h.Gf(r.NW,7),h.Gf(a.YE,7)),2&t){let t;h.iGM(t=h.CRH())&&(e.search=t.first),h.iGM(t=h.CRH())&&(e.paginator=t.first),h.iGM(t=h.CRH())&&(e.sort=t.first)}},decls:60,vars:29,consts:[[1,"main-content"],[1,"container-fluid"],[1,"row"],[1,"fab-container"],["mat-fab","",1,"fab-toggler",3,"click"],[1,"col-md-12"],[1,"card"],[1,"card-header","card-header-info"],[1,"card-title"],[1,"card-category"],[1,"card-body"],[1,"row","search-form-section"],[1,"col-5"],["mat-button","","matPrefix","","mat-stroked-button","","aria-label","add new",3,"disabled","click"],[1,"col-7"],[1,"search-form-field"],["matInput","","autocomplete","off",3,"placeholder","disabled"],["search",""],["mat-button","","matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],[1,"table-responsive"],["matSort","","matSortActive","unit_name","matSortDirection","desc","matSortDisableClear","",3,"dataSource"],["table",""],["matColumnDef","unit_name"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","unit_mode"],["matColumnDef","unit_type_id"],["matColumnDef","total_rooms"],["matColumnDef","bed_rooms"],["matColumnDef","actions"],[4,"matHeaderCellDef"],["class","button-row",4,"matCellDef"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],[4,"ngIf"],["class","d-flex justify-content-center spinner-container",4,"ngIf"],["showFirstLastButtons","",3,"length","pageIndex","pageSizeOptions"],["pagination",""],["mat-button","","matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],["mat-sort-header",""],[1,"button-row"],["mat-raised-button","","type","button","matTooltip","Edit Property",1,"btn","btn-link","btn-sm","btn-just-icon",3,"matTooltipPosition","click"],[1,"material-icons"],[1,"d-flex","justify-content-center","spinner-container"],["color","green","mode","query","value","50","bufferValue","75"]],template:function(t,e){if(1&t&&(h.TgZ(0,"div",0),h.TgZ(1,"div",1),h.TgZ(2,"div",2),h.TgZ(3,"div",3),h.TgZ(4,"button",4),h.NdJ("click",function(){return e.addDialog()}),h.TgZ(5,"mat-icon"),h._uU(6,"add"),h.qZA(),h.qZA(),h.qZA(),h.TgZ(7,"div",5),h.TgZ(8,"div",6),h.TgZ(9,"div",7),h.TgZ(10,"h4",8),h._uU(11,"Property Units"),h.qZA(),h.TgZ(12,"p",9),h._uU(13),h.ALo(14,"async"),h.ALo(15,"async"),h.ALo(16,"async"),h.qZA(),h.qZA(),h.TgZ(17,"div",10),h.TgZ(18,"div",11),h.TgZ(19,"div",12),h.TgZ(20,"button",13),h.NdJ("click",function(){return e.addDialog()}),h.ALo(21,"async"),h.TgZ(22,"mat-icon"),h._uU(23,"add"),h.qZA(),h._uU(24,"Add Unit "),h.qZA(),h.qZA(),h.TgZ(25,"div",14),h.TgZ(26,"mat-form-field",15),h._UZ(27,"input",16,17),h.ALo(29,"translate"),h.YNc(30,lt,3,0,"button",18),h.qZA(),h.qZA(),h.qZA(),h.TgZ(31,"div",19),h.TgZ(32,"mat-table",20,21),h.ynx(34,22),h.YNc(35,ct,2,0,"mat-header-cell",23),h.YNc(36,dt,2,1,"mat-cell",24),h.BQk(),h.ynx(37,25),h.YNc(38,ut,2,0,"mat-header-cell",23),h.YNc(39,mt,2,1,"mat-cell",24),h.BQk(),h.ynx(40,26),h.YNc(41,gt,2,0,"mat-header-cell",23),h.YNc(42,pt,2,1,"mat-cell",24),h.BQk(),h.ynx(43,27),h.YNc(44,ht,2,0,"mat-header-cell",23),h.YNc(45,ft,2,1,"mat-cell",24),h.BQk(),h.ynx(46,28),h.YNc(47,_t,2,0,"mat-header-cell",23),h.YNc(48,Zt,2,1,"mat-cell",24),h.BQk(),h.ynx(49,29),h.YNc(50,bt,2,0,"mat-header-cell",30),h.YNc(51,xt,4,1,"mat-cell",31),h.BQk(),h.YNc(52,yt,1,0,"mat-header-row",32),h.YNc(53,vt,1,0,"mat-row",33),h.qZA(),h.YNc(54,At,2,0,"span",34),h.ALo(55,"async"),h.YNc(56,Ct,2,0,"div",35),h.ALo(57,"async"),h._UZ(58,"mat-paginator",36,37),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.qZA()),2&t){const t=h.MAs(28);let n;h.xp6(13),h.lnq("",null==(n=h.lcZ(14,15,e.property$))?null:n.property_name," (",null==(n=h.lcZ(15,17,e.property$))?null:n.property_code,") - ",null==(n=h.lcZ(16,19,e.property$))?null:n.location,""),h.xp6(7),h.Q6J("disabled",h.lcZ(21,21,null==e.dataSource?null:e.dataSource.loading$)),h.xp6(7),h.s9C("placeholder",h.lcZ(29,23,"robi.filter")),h.Q6J("disabled",0===(null==e.meta?null:e.meta.total)),h.xp6(3),h.Q6J("ngIf",t.value),h.xp6(2),h.Q6J("dataSource",e.dataSource),h.xp6(20),h.Q6J("matHeaderRowDef",e.displayedColumns),h.xp6(1),h.Q6J("matRowDefColumns",e.displayedColumns),h.xp6(1),h.Q6J("ngIf",0===h.lcZ(55,25,e.dataSource.meta$).total),h.xp6(2),h.Q6J("ngIf",h.lcZ(57,27,null==e.dataSource?null:e.dataSource.loading$)||e.loader),h.xp6(2),h.Q6J("length",null==e.meta?null:e.meta.total)("pageIndex",e.pageIndex)("pageSizeOptions",e.pageSizeOptions)}},directives:[P.lW,T.Hw,q.qo,q.KE,U.Nt,C.O5,ot.BZ,a.YE,ot.w1,ot.fO,ot.Dz,ot.as,ot.nj,r.NW,q.R9,ot.ge,a.nU,ot.ev,rt.gM,ot.XQ,ot.Gk,E.pW],pipes:[C.Ov,at.X$],styles:[".card[_ngcontent-%COMP%]{background:none repeat scroll 0 0 #FFFFFF;border-radius:4px;color:#444}.card-container[_ngcontent-%COMP%], .front[_ngcontent-%COMP%], .back[_ngcontent-%COMP%]{width:100%;height:390px;border-radius:4px}.card[_ngcontent-%COMP%] .cover[_ngcontent-%COMP%]{height:105px;overflow:hidden;border-radius:4px 4px 0 0}.card[_ngcontent-%COMP%] .cover[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%}.user[_ngcontent-%COMP%]{border-radius:50%;display:block;height:120px;margin:-55px auto 0;overflow:hidden;width:120px;box-shadow:0 16px 38px -12px rgba(0,0,0,.561),0 4px 25px rgba(0,0,0,.122),0 8px 10px -5px rgba(0,0,0,.2)}.card[_ngcontent-%COMP%] .user[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{background:none repeat scroll 0 0 #FFFFFF;border:4px solid #FFFFFF;width:100%}.card[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{background-color:rgba(0,0,0,0);box-shadow:none;padding:10px 20px 20px}.card[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .main[_ngcontent-%COMP%]{min-height:160px}.card[_ngcontent-%COMP%] .back[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .main[_ngcontent-%COMP%]{height:215px}.card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{font-size:22px;line-height:28px;margin:10px 0 0;text-align:center;text-transform:capitalize}.card[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{margin:5px 0;font-weight:400;line-height:20px}.card[_ngcontent-%COMP%] .profession[_ngcontent-%COMP%]{color:#999;text-align:center;margin-bottom:20px}.card[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{border-top:1px solid #EEEEEE;color:#999;margin:0;padding:10px 0 0;text-align:center}.card[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .social-links[_ngcontent-%COMP%]{font-size:18px}.card[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .social-links[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{margin:0 7px}.card[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .btn-simple[_ngcontent-%COMP%]{margin-top:-6px}.card[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{padding:15px 20px;height:90px}.card[_ngcontent-%COMP%] .motto[_ngcontent-%COMP%]{border-bottom:1px solid #EEEEEE;color:#999;font-size:14px;font-weight:400;padding-bottom:10px;text-align:center}.card[_ngcontent-%COMP%] .stats-container[_ngcontent-%COMP%]{width:100%;margin-top:20px;display:flex;justify-content:center}.card[_ngcontent-%COMP%] .property-stats[_ngcontent-%COMP%]{display:block;float:left;width:33.333333%;text-align:center}.card[_ngcontent-%COMP%] .property-stats[_ngcontent-%COMP%]:first-child{border-right:1px solid #EEEEEE}.card[_ngcontent-%COMP%] .property-stats[_ngcontent-%COMP%]:last-child{border-left:1px solid #EEEEEE}.card[_ngcontent-%COMP%] .property-stats[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:300;margin-bottom:5px}.card[_ngcontent-%COMP%] .property-stats[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#777}.title[_ngcontent-%COMP%]{color:#506a85;text-align:center;font-weight:300;font-size:44px;margin-bottom:90px;line-height:90%}.title[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:17px;color:#999;text-transform:uppercase;margin:0}.space-30[_ngcontent-%COMP%]{height:30px;display:block}.space-50[_ngcontent-%COMP%]{height:50px;display:block}.space-200[_ngcontent-%COMP%]{height:200px;display:block}.white-board[_ngcontent-%COMP%]{background-color:#fff;min-height:200px;padding:60px 60px 20px}.ct-heart[_ngcontent-%COMP%]{color:#f74933}pre.prettyprint[_ngcontent-%COMP%]{background-color:#fff;border:1px solid #999;margin-top:20px;padding:20px;text-align:left}.atv[_ngcontent-%COMP%], .str[_ngcontent-%COMP%]{color:#05ae0e}.tag[_ngcontent-%COMP%], .pln[_ngcontent-%COMP%], .kwd[_ngcontent-%COMP%]{color:#3472f7}.atn[_ngcontent-%COMP%]{color:#2c93ff}.pln[_ngcontent-%COMP%]{color:#333}.com[_ngcontent-%COMP%]{color:#999}.btn-simple[_ngcontent-%COMP%]{opacity:.8;color:#666;background-color:transparent}.btn-simple[_ngcontent-%COMP%]:hover, .btn-simple[_ngcontent-%COMP%]:focus{background-color:transparent;box-shadow:none;opacity:1}.btn-simple[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:16px}.navbar-brand-logo[_ngcontent-%COMP%]{padding:0}.navbar-brand-logo[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{border:1px solid #333333;border-radius:50%;float:left;overflow:hidden;width:60px}.navbar[_ngcontent-%COMP%] .navbar-brand-logo[_ngcontent-%COMP%] .brand[_ngcontent-%COMP%]{color:#fff;float:left;font-size:18px;font-weight:400;line-height:20px;margin-left:10px;margin-top:10px;width:60px}.navbar-default[_ngcontent-%COMP%] .navbar-brand-logo[_ngcontent-%COMP%] .brand[_ngcontent-%COMP%]{color:#555}.clickable[_ngcontent-%COMP%]{cursor:pointer}@media screen and (-ms-high-contrast: active),(-ms-high-contrast: none){.front[_ngcontent-%COMP%], .back[_ngcontent-%COMP%]{-webkit-backface-visibility:visible;backface-visibility:visible}.back[_ngcontent-%COMP%]{visibility:hidden;-ms-transition:all .2s cubic-bezier(.92,.01,.83,.67)}.front[_ngcontent-%COMP%]{z-index:4}.card-container[_ngcontent-%COMP%]:not(.manual-flip):hover .back[_ngcontent-%COMP%], .card-container.manual-flip.hover[_ngcontent-%COMP%] .back[_ngcontent-%COMP%]{z-index:5;visibility:visible}}"]}),t})()}]);var Tt=n(83893),qt=n(52218),Ut=n(37094),Mt=n(14735);let Pt=(()=>{class t{constructor(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=h.oAB({type:t}),t.\u0275inj=h.cJS({imports:[[Tt.m,Ot,qt.Co,Ut.a4,Mt.f]]}),t})()}}]);