1"use strict";(self.webpackChunkminostech_admin_angular=self.webpackChunkminostech_admin_angular||[]).push([[662],{37662:(q,_,l)=>{l.r(_),l.d(_,{ChatModule:()=>Z});var d=l(36895),m=l(19347),C=l(49671),f=l(4854),e=l(94650),w=l(51491),E=l(90457),x=l(81305),y=l(11481),u=l(4484),c=l(24006),v=l(23513),b=l(38328);const T=["chatScroll"];function I(i,r){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",28)(1,"div",29)(2,"h5",30),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",31)(6,"label"),e.\u0275\u0275text(7),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"input",32),e.\u0275\u0275listener("ngModelChange",function(a){e.\u0275\u0275restoreView(t);const o=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(o.offerTitle=a)}),e.\u0275\u0275pipe(10,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(11,"div",31)(12,"label"),e.\u0275\u0275text(13),e.\u0275\u0275pipe(14,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"input",33),e.\u0275\u0275listener("ngModelChange",function(a){e.\u0275\u0275restoreView(t);const o=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(o.offerQty=a)}),e.\u0275\u0275pipe(16,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(17,"div",31)(18,"label"),e.\u0275\u0275text(19),e.\u0275\u0275pipe(20,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"input",33),e.\u0275\u0275listener("ngModelChange",function(a){e.\u0275\u0275restoreView(t);const o=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(o.offerPrice=a)}),e.\u0275\u0275pipe(22,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(23,"label"),e.\u0275\u0275text(24),e.\u0275\u0275pipe(25,"translate"),e.\u0275\u0275elementStart(26,"span",34),e.\u0275\u0275text(27),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(28,"div",35)(29,"button",13),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(a.submitOffer(a.chat))}),e.\u0275\u0275text(30),e.\u0275\u0275pipe(31,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(32,"button",36),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(a.showPopup=!1)}),e.\u0275\u0275text(33),e.\u0275\u0275pipe(34,"translate"),e.\u0275\u0275elementEnd()()()()}if(2&i){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(4,14,"GENERAL.MAKE_AN_OFFER")," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(8,16,"TABLE.ITEM")),e.\u0275\u0275advance(2),e.\u0275\u0275property("placeholder",e.\u0275\u0275pipeBind1(10,18,"GENERAL.ENTER_ITEM"))("ngModel",t.offerTitle),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(14,20,"GENERAL.QTY")),e.\u0275\u0275advance(2),e.\u0275\u0275property("placeholder",e.\u0275\u0275pipeBind1(16,22,"GENERAL.ENTER_QUANTITY"))("ngModel",t.offerQty),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(20,24,"GENERAL.COST_PER_ITEM")),e.\u0275\u0275advance(2),e.\u0275\u0275property("placeholder",e.\u0275\u0275pipeBind1(22,26,"GENERAL.ENTER_COST_PER_ITEM"))("ngModel",t.offerPrice),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(25,28,"FORM_LABELS.TOTAL")),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.offerQty*t.offerPrice),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(31,30,"COMMON.SUBMIT_OFFER")," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(34,32,"BUTTONS.CANCEL")," ")}}function S(i,r){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",28)(1,"div",29)(2,"h5",30),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"p"),e.\u0275\u0275text(6),e.\u0275\u0275pipe(7,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"div",35)(9,"button",36),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();
1return e.\u0275\u0275resetView(a.confirmDelete())}),e.\u0275\u0275text(10),e.\u0275\u0275pipe(11,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"button",37),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(a.cancelDelete())}),e.\u0275\u0275text(13),e.\u0275\u0275pipe(14,"translate"),e.\u0275\u0275elementEnd()()()()}2&i&&(e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(4,4,"GENERAL.CONFIRM_DELETE")," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(7,6,"GENERAL.DELETE_MESSAGE_CONFIRMATION")),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(11,8,"BUTTONS.DELETE")," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(14,10,"BUTTONS.CANCEL")," "))}function M(i,r){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",13),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(2).$implicit,o=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(o.acceptOffer(a))}),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()}2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"COMMON.ACCEPT")," "))}function O(i,r){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",13),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(2).$implicit,o=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(o.payNow(a))}),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()}2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"COMMON.PAY_NOW")," "))}function P(i,r){if(1&i&&(e.\u0275\u0275elementStart(0,"div",40)(1,"div",41)(2,"span",42),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"span",43),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"date"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(7,"img",44),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementStart(9,"div",45),e.\u0275\u0275text(10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"div",46),e.\u0275\u0275template(12,M,3,3,"button",47),e.\u0275\u0275template(13,O,3,3,"button",47),e.\u0275\u0275elementEnd()()),2&i){const t=e.\u0275\u0275nextContext().$implicit,n=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(n.chatWith),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind2(6,7,t.createdAt,"medium")),e.\u0275\u0275advance(2),e.\u0275\u0275property("src",t.senderId==n.mspGPTAgentId?"../../assets/imgs/msp-gpt.png":"../../../assets/imgs/usericon.png",e.\u0275\u0275sanitizeUrl)("alt",e.\u0275\u0275pipeBind1(8,10,"IMAGES.USER_IMAGE")),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",null==t?null:t.content," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","offer"===t.messageType),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","offer-accepted"===t.messageType)}}function L(i,r){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",52)(1,"img",53),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit,o=e.\u0275\u0275nextContext(3);return e.\u0275\u0275resetView(o.openFile(a))}),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()()}if(2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("src",t,e.\u0275\u0275sanitizeUrl)("alt",e.\u0275\u0275pipeBind1(2,2,"IMAGES.IMAGE"))}}const g=function(i,r,t,n,a){return{"fa-file-pdf text-danger":i,"fa-file-archive text-warning":r,"fa-file-word text-primary":t,"fa-file-excel text-success":n,"fa-file text-secondary":a}};function F(i,r){if(1&i&&(e.\u0275\u0275elementStart(0,"div",54),e.\u0275\u0275element(1,"i",55),e.\u0275\u0275elementStart(2,"a",56),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()()),2&i){const t=e.\u0275\u0275nextContext().$implicit,n=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction5(3,g,t.toLowerCase().includes(".pdf"),t.toLowerCase().includes(".zip"),t.toLowerCase().includes(".doc")||t.toLowerCase().includes(".docx"),t.toLowerCase().includes(".xls")||t.toLowerCase().includes(".xlsx"),!(t.toLowerCase().includes(".pdf")||t.toLowerCase().includes(".zip")||t.toLowerCase().includes(".doc")||t.toLowerCase().includes(".docx")||t.toLowerCase().includes(".xls")||t.toLowerCase().includes(".xlsx")))),e.\u0275\u0275advance(1),e.\u0275\u0275property("href",t,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",n.extractFileName(t)," ")}}function A(i,r){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,L,3,4,"div",50),e.\u0275\u0275template(2,F,4,9,"div",51),e.\u0275\u0275elementContainerEnd()),2&i){const t=r.$implicit,n=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.isImage(t)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!n.isImage(t))}}function k(i,r){if(1&i&&(e.\u0275\u0275elementStart(0,"div",40)(1,"div",41)(2,"span",42),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"span",43),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"date"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(7,"img",48),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementStart(9,"div",49),e.\u0275\u0275template(10,A,3,2,"ng-container",17),e.\u0275\u0275elementEnd()()),2&i){const t=e.\u0275\u0275nextContext().$implicit,n=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",n.chatWith," "),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind2(6,4,t.createdAt,"medium")),e.\u0275\u0275advance(2),e.\u0275\u0275property("alt",e.\u0275\u0275pipeBind1(8,7,"IMAGES.USER_IMAGE")),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngForOf",t.files)}}function B(i,r){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",57)(1,"div",41)(2,"span",58),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",59)(6,"div",60),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit,o=e.\u0275\u0275nextContext();
1return e.\u0275\u0275resetView(o.promptDelete(a))}),e.\u0275\u0275element(7,"i",61),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"span",62),e.\u0275\u0275text(9),e.\u0275\u0275pipe(10,"date"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275element(11,"img",48),e.\u0275\u0275pipe(12,"translate"),e.\u0275\u0275elementStart(13,"div",63),e.\u0275\u0275text(14),e.\u0275\u0275elementEnd()()}if(2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(4,4,"TABLE.YOU")),e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind2(10,6,t.createdAt,"medium")),e.\u0275\u0275advance(2),e.\u0275\u0275property("alt",e.\u0275\u0275pipeBind1(12,9,"IMAGES.USER_IMAGE")),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",null==t?null:t.content," ")}}function N(i,r){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",67)(1,"img",53),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit,o=e.\u0275\u0275nextContext(3);return e.\u0275\u0275resetView(o.openFile(a))}),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()()}if(2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("src",t,e.\u0275\u0275sanitizeUrl)("alt",e.\u0275\u0275pipeBind1(2,2,"IMAGES.IMAGE"))}}function R(i,r){if(1&i&&(e.\u0275\u0275elementStart(0,"div",68),e.\u0275\u0275element(1,"i",55),e.\u0275\u0275elementStart(2,"a",56),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()()),2&i){const t=e.\u0275\u0275nextContext().$implicit,n=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction5(3,g,t.toLowerCase().includes(".pdf"),t.toLowerCase().includes(".zip"),t.toLowerCase().includes(".doc")||t.toLowerCase().includes(".docx"),t.toLowerCase().includes(".xls")||t.toLowerCase().includes(".xlsx"),!(t.toLowerCase().includes(".pdf")||t.toLowerCase().includes(".zip")||t.toLowerCase().includes(".doc")||t.toLowerCase().includes(".docx")||t.toLowerCase().includes(".xls")||t.toLowerCase().includes(".xlsx")))),e.\u0275\u0275advance(1),e.\u0275\u0275property("href",t,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",n.extractFileName(t)," ")}}function D(i,r){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,N,3,4,"div",65),e.\u0275\u0275template(2,R,4,9,"div",66),e.\u0275\u0275elementContainerEnd()),2&i){const t=r.$implicit,n=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.isImage(t)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!n.isImage(t))}}function V(i,r){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",57)(1,"div",41)(2,"span",58),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",59)(6,"div",60),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit,o=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(o.promptDelete(a))}),e.\u0275\u0275element(7,"i",61),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"span",62),e.\u0275\u0275text(9),e.\u0275\u0275pipe(10,"date"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275element(11,"img",48),e.\u0275\u0275pipe(12,"translate"),e.\u0275\u0275elementStart(13,"div",64),e.\u0275\u0275template(14,D,3,2,"ng-container",17),e.\u0275\u0275elementEnd()()}if(2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(4,4,"TABLE.YOU")),e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind2(10,6,t.createdAt,"medium")),e.\u0275\u0275advance(2),e.\u0275\u0275property("alt",e.\u0275\u0275pipeBind1(12,9,"IMAGES.USER_IMAGE")),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngForOf",t.files)}}function U(i,r){if(1&i&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275template(1,P,14,12,"div",38),e.\u0275\u0275template(2,k,11,9,"div",38),e.\u0275\u0275template(3,B,15,11,"div",39),e.\u0275\u0275template(4,V,15,11,"div",39),e.\u0275\u0275elementEnd()),2&i){const t=r.$implicit,n=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.senderId!=(null==n.adminService||null==n.adminService.admin?null:n.adminService.admin.id)&&(null==t?null:t.content)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.senderId!=(null==n.adminService||null==n.adminService.admin?null:n.adminService.admin.id)&&(null==t.files?null:t.files.length)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.senderId==(null==n.adminService||null==n.adminService.admin?null:n.adminService.admin.id)&&(null==t?null:t.content)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.senderId==(null==n.adminService||null==n.adminService.admin?null:n.adminService.admin.id)&&(null==t.files?null:t.files.length))}}function $(i,r){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",76)(1,"img",77),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit,o=e.\u0275\u0275nextContext(2);
1return e.\u0275\u0275resetView(o.openImage(a))}),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()()}if(2&i){const t=e.\u0275\u0275nextContext().$implicit,n=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("alt",e.\u0275\u0275pipeBind1(2,2,"IMAGES.PREVIEW")),e.\u0275\u0275attribute("src",n.getFileURL(t),e.\u0275\u0275sanitizeUrl)}}function z(i,r){if(1&i&&(e.\u0275\u0275elementStart(0,"div",78),e.\u0275\u0275element(1,"i",79),e.\u0275\u0275elementEnd()),2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction5(1,g,t.name.toLowerCase().includes(".pdf"),t.name.toLowerCase().includes(".zip"),t.name.toLowerCase().includes(".doc")||t.name.toLowerCase().includes(".docx"),t.name.toLowerCase().includes(".xls")||t.name.toLowerCase().includes(".xlsx"),!(t.name.toLowerCase().includes(".pdf")||t.name.toLowerCase().includes(".zip")||t.name.toLowerCase().includes(".doc")||t.name.toLowerCase().includes(".docx")||t.name.toLowerCase().includes(".xls")||t.name.toLowerCase().includes(".xlsx"))))}}function j(i,r){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",71),e.\u0275\u0275template(1,$,3,4,"div",72),e.\u0275\u0275template(2,z,2,7,"div",73),e.\u0275\u0275elementStart(3,"span",74),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"i",75),e.\u0275\u0275listener("click",function(){const o=e.\u0275\u0275restoreView(t).$implicit,s=e.\u0275\u0275nextContext(2);return e.\u0275\u0275resetView(s.onCancelFiles(o))}),e.\u0275\u0275elementEnd()()}if(2&i){const t=r.$implicit,n=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.isImage(t.name)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!n.isImage(t.name)),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function G(i,r){if(1&i&&(e.\u0275\u0275elementStart(0,"div",69),e.\u0275\u0275template(1,j,6,3,"div",70),e.\u0275\u0275elementEnd()),2&i){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.selectedFiles)}}const Q=function(i){return{label:i,link:"/contacts"}},W=function(i){return{label:i}},Y=function(i,r){return[i,r]},H=[{path:":id",component:(()=>{class i{constructor(t,n,a,o,s,p,h){this.route=t,this.api=n,this.adminService=a,this.lightbox=o,this.router=s,this.sanitizer=p,this.translate=h,this.message="",this.chats=[],this.selectedFiles=[],this.userTypeAdmin=f.FW.admin,this.mspGPTAgentId=f.ke.mspGPTAgentUid,this.relevantTypeProcurement=f.nK.procurements,this.showPopup=!1,this.offerQty=0,this.offerPrice=0,this.offerTitle="",this.showDeletePopup=!1,this.chatToDelete=null}ngOnInit(){var t=this;this.route.params.subscribe(function(){var n=(0,C.Z)(function*(a){t.id=a.id,t.getChat(t.id)});return function(a){return n.apply(this,arguments)}}())}getChat(t){this.api.get(`admins/chat?id=${t}`).then(n=>{this.chatWith=n?.chat?.chatWith,this.chats=(n?.messages||[]).map(a=>({...a,offerTitle:a.offerTitle||null,offerQty:a.offerQty?Number(a.offerQty):null,offerPrice:a.offerPrice?Number(a.offerPrice):null,files:[...a.files||[],...a.images||[]]})),this.relevantObject=n.relevantObject,setTimeout(()=>this.scrollToBottom(),100)})}scrollToBottom(){try{this.chatScrollContainer.nativeElement.scrollTop=this.chatScrollContainer.nativeElement.scrollHeight}catch{}}onSend(){const t=new FormData;t.append("id",this.id),this.message&&t.append("message",this.message),this.selectedFiles&&this.selectedFiles.length>0?(Array.from(this.selectedFiles).forEach(n=>{t.append("files",n,n.name)}),t.append("messageType","file")):t.append("messageType","text"),this.api.post("admins/chat",t,!0).then(()=>{this.selectedFiles=[],this.message="",this.getChat(this.id)})}onFileSelected(t){const n=t.target;if(n.files&&n.files.length){const o=Array.from(n.files).filter(p=>!this.selectedFiles.some(h=>h.name===p.name&&h.size===p.size)),s=[...this.selectedFiles,...o];s.length>5?(alert(this.translate.instant("CHAT.MAX_FILES_ALERT")),this.selectedFiles=s.slice(0,5)):this.selectedFiles=s}n&&(n.value="")}open(t){const n=this.chats[t].images?.map(a=>({src:a}));this.lightbox.open(n,0,{wrapAround:!0,showImageNumberLabel:!0,disableScrolling:!0,showZoom:!0})}onCancelFiles(t){URL.revokeObjectURL(this.getFileURL(t)),this.selectedFiles=this.selectedFiles.filter(n=>n!==t)}getTitle(){return this.relevantType===f.nK.procurements?`${this.relevantObject?.item?.title} | QTY ${this.relevantObject?.quantity} | Price: ${this.relevantObject?.pricePointPerUnit}/unit`:this.relevantObject?.title}submitOffer(t){if(!this.offerTitle||this.offerQty<=0||this.offerPrice<=0)return;const n=this.offerQty*this.offerPrice,a=new FormData;a.append("id",this.id),a.append("message",`Offer: ${this.offerTitle} \u2014 ${this.offerQty} units at $${this.offerPrice} each (Total: $${n})`),a.append("offerTitle",this.offerTitle),a.append("offerQty",this.offerQty.toString()),a.append("offerPrice",this.offerPrice.toString()),a.append("messageType","offer"),this.api.post("admins/chat",a,!1).then(()=>{this.showPopup=!1,this.offerTitle="",this.offerQty=0,this.offerPrice=0,this.getChat(this.id
1)})}acceptOffer(t){if(!t)return;const n=new FormData;n.append("id",this.id),n.append("acceptedOfferId",t.id),this.api.post("admins/chat",n,!1).then(()=>{const a=new FormData;a.append("id",this.id),a.append("message",`${t.content} has been accepted. You can now pay.`),a.append("messageType","offer-accepted"),a.append("offerTitle",t.offerTitle),a.append("offerQty",t.offerQty),a.append("offerPrice",t.offerPrice),this.api.post("admins/chat",a,!1).then(()=>{this.getChat(this.id)})})}payNow(t){const o=100*t.offerPrice/t.offerQty,s={contactsAndProducts:[this.translate.instant("CHAT.HARDWARE_PURCHASE")],qty:t.offerQty,price:o};this.api.post("chat/pay-now",s,!0).then(p=>{p?.invoiceURL&&window.open(p.invoiceURL,"_blank"),this.showPopup=!1,this.getChat(this.id)}).catch(p=>console.error(this.translate.instant("CHAT.PAYMENT_FAILED"),p))}isImage(t){if(!t)return!1;try{const n=t.toLowerCase().split("?")[0];return n.endsWith(".jpg")||n.endsWith(".jpeg")||n.endsWith(".png")||n.endsWith(".gif")||n.endsWith(".webp")||n.includes("image")}catch{return!1}}extractFileName(t){try{return decodeURIComponent(t.split("/").pop()?.split("?")[0]||this.translate.instant("CHAT.FILE"))}catch{return this.translate.instant("CHAT.FILE")}}openFile(t){this.isImage(t)?this.lightbox.open([{src:t,thumb:t}]):window.open(t,"_blank")}getFileURL(t){const n=URL.createObjectURL(t);return this.sanitizer.bypassSecurityTrustUrl(n)}promptDelete(t){this.chatToDelete=t,this.showDeletePopup=!0}confirmDelete(){!this.chatToDelete||this.api.post("admins/delete-chat",{id:this.chatToDelete.id}).then(()=>{this.showDeletePopup=!1,this.chatToDelete=null,this.getChat(this.id)}).catch(t=>{console.error("Delete failed:",t),this.showDeletePopup=!1,this.chatToDelete=null})}cancelDelete(){this.showDeletePopup=!1,this.chatToDelete=null}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(m.gz),e.\u0275\u0275directiveInject(w.t),e.\u0275\u0275directiveInject(E.l),e.\u0275\u0275directiveInject(x.ey),e.\u0275\u0275directiveInject(m.F0),e.\u0275\u0275directiveInject(y.DomSanitizer),e.\u0275\u0275directiveInject(u.sK))},i.\u0275cmp=e.\u0275\u0275defineComponent({type:i,selectors:[["app-chat"]],viewQuery:function(t,n){if(1&t&&e.\u0275\u0275viewQuery(T,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(n.chatScrollContainer=a.first)}},decls:39,vars:33,consts:[["bdColor","rgba(0, 0, 0, 0.8)","size","medium","color","#fff","type","ball-spin",3,"fullScreen"],[2,"color","white"],[1,"hold-transition","sidebar-mini"],[1,"wrapper"],[1,"content-wrapper","d-flex","flex-column"],[3,"title","breadcrumbs"],[1,"content","flex-grow-1","chat-section"],[1,"container-fluid","d-flex","flex-column","h-100"],[1,"row","justify-content-center","flex-grow-1","h-100"],[1,"col-lg-12","col-md-9","col-sm-12","d-flex","flex-column","h-100"],[1,"shadow-sm","d-flex","flex-column","h-100"],[1,"d-flex","justify-content-end",2,"background-color","transparent"],[1,"d-flex","position-absolute","z-index"],[1,"btn","btn-success",3,"click"],["class","overlay",4,"ngIf"],[3,"ngClass"],["chatScroll",""],[4,"ngFor","ngForOf"],[1,"card-footer"],["class","d-flex flex-wrap",4,"ngIf"],[1,"d-flex","align-items-center","gap-2","w-100"],["for","fileUpload",1,"btn","btn-primary","border","mt-2","mr-1"],[1,"fas","fa-paperclip"],["type","file","id","fileUpload","multiple","","hidden","",3,"change"],[1,"input-group","flex-grow-1"],["type","text","name","message",1,"form-control",3,"placeholder","ngModel","ngModelChange"],[1,"input-group-append"],[1,"btn","btn-primary",3,"disabled","click"],[1,"overlay"],[1,"popup-card"],[1,"popup-title"],[1,"form-group"],["type","text",1,"form-control",3,"placeholder","ngModel","ngModelChange"],["type","number",1,"form-control",3,"placeholder","ngModel","ngModelChange"],[1,"text-muted"],[1,"popup-footer"],[1,"btn","btn-danger",3,"click"],[1,"btn","btn-secondary",3,"click"],["class","direct-chat-msg pb-2",4,"ngIf"],["class","direct-chat-msg right pb-2",4,"ngIf"],[1,"direct-chat-msg","pb-2"],[1,"direct-chat-infos","clearfix","py-2"],[1,"direct-chat-name","float-left"],[1,"direct-chat-timestamp","float-right"],[1,"direct-chat-img",3,"src","alt"],[1,"direct-chat-text","chat-text-prewrap"],[1,"mt-2","offer-buttons"],["class","btn btn-success",3,"click",4,"ngIf"],["src","../../../assets/imgs/usericon.png",1,"direct-chat-img",3,"alt"],[1,"direct-chat-text"],["class","chat-image-wrapper-left",4,"ngIf"],["class","chat-file-wrapper file-view border rounded p-2 my-1 d-flex align-items-center bg-light",4,"ngIf"],[1,"chat-image-wrapper-left"],[1,"chat-image",3,"src","alt","click"],[1,"chat-file-wrapper","file-view","border","rounded","p-2","my-1","d-flex","align-items-center","bg-light"],[1,"fa","mr-2",2,"font-size","20px",3,"ngClass"],["target","_blank","download","",1,"text-truncate","text-dark",2,"max-width","200px",3,"href"],[1,"direct-chat-msg","right","pb-2"],[1,"direct-chat-name","float-right"],[1,"d-flex","align-items-center"],[1,"delete-chat",2,"cursor","pointer",3,"click"],[1,"fas","fa-tras
1h-alt"],[1,"direct-chat-timestamp","float-left","ml-2"],[1,"direct-chat-text","float-right","chat-text-prewrap"],[1,"direct-chat-text-right","float-right"],["class","chat-image-wrapper-right chat-image-right",4,"ngIf"],["class","chat-image-wrapper-right border rounded p-2 my-1 d-flex align-items-center bg-light",4,"ngIf"],[1,"chat-image-wrapper-right","chat-image-right"],[1,"chat-image-wrapper-right","border","rounded","p-2","my-1","d-flex","align-items-center","bg-light"],[1,"d-flex","flex-wrap"],["class","file-preview border rounded p-2 d-flex align-items-center mr-2 mb-2 bg-light",4,"ngFor","ngForOf"],[1,"file-preview","border","rounded","p-2","d-flex","align-items-center","mr-2","mb-2","bg-light"],["class","image-preview position-relative",4,"ngIf"],["class","file-icon-preview text-center",4,"ngIf"],[1,"text-truncate","small","pl-2",2,"max-width","120px"],[1,"fas","fa-times","text-danger","pl-2",2,"cursor","pointer",3,"click"],[1,"image-preview","position-relative"],[1,"preview-img","rounded",3,"alt","click"],[1,"file-icon-preview","text-center"],[1,"fa","fa-2x",3,"ngClass"]],template:function(t,n){1&t&&(e.\u0275\u0275elementStart(0,"ngx-spinner",0)(1,"p",1),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(4,"div",2)(5,"div",3)(6,"div",4),e.\u0275\u0275element(7,"app-header-title",5),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275pipe(9,"translate"),e.\u0275\u0275elementStart(10,"section",6)(11,"div",7)(12,"div",8)(13,"div",9)(14,"div",10)(15,"div",11)(16,"div",12)(17,"button",13),e.\u0275\u0275listener("click",function(){return n.showPopup=!0}),e.\u0275\u0275text(18),e.\u0275\u0275pipe(19,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(20,I,35,34,"div",14),e.\u0275\u0275template(21,S,15,12,"div",14),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(22,"div",15,16),e.\u0275\u0275template(24,U,5,4,"div",17),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"div",18),e.\u0275\u0275template(26,G,2,1,"div",19),e.\u0275\u0275elementStart(27,"form")(28,"div",20)(29,"label",21),e.\u0275\u0275element(30,"i",22),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(31,"input",23),e.\u0275\u0275listener("change",function(o){return n.onFileSelected(o)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(32,"div",24)(33,"input",25),e.\u0275\u0275listener("ngModelChange",function(o){return n.message=o}),e.\u0275\u0275pipe(34,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(35,"span",26)(36,"button",27),e.\u0275\u0275listener("click",function(){return n.onSend()}),e.\u0275\u0275text(37),e.\u0275\u0275pipe(38,"translate"),e.\u0275\u0275elementEnd()()()()()()()()()()()()()()),2&t&&(e.\u0275\u0275property("fullScreen",!0),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,14,"GENERAL.PROCESSING")," "),e.\u0275\u0275advance(5),e.\u0275\u0275property("title",n.chatWith)("breadcrumbs",e.\u0275\u0275pureFunction2(30,Y,e.\u0275\u0275pureFunction1(26,Q,e.\u0275\u0275pipeBind1(8,16,"SIDEMENU.CONTACTS")),e.\u0275\u0275pureFunction1(28,W,e.\u0275\u0275pipeBind1(9,18,"TABLE.CHAT")))),e.\u0275\u0275advance(11),e.\u0275\u0275textInterpolate1(" \u{1f4b0} ",e.\u0275\u0275pipeBind1(19,20,"LOT_CARD.MAKE_AN_OFFER")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.showPopup),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.showDeletePopup),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",n.selectedFiles?"card-body flex-grow-1 overflow-auto chat-body-with-images":"card-body flex-grow-1 overflow-auto chat-body-no-images"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",n.chats),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",null==n.selectedFiles?null:n.selectedFiles.length),e.\u0275\u0275advance(7),e.\u0275\u0275property("placeholder",e.\u0275\u0275pipeBind1(34,22,"GENERAL.TYPE_MESSAGE_"))("ngModel",n.message),e.\u0275\u0275advance(3),e.\u0275\u0275property("disabled",!n.message&&!n.selectedFiles),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(38,24,"COMMON.SEND")," "))},dependencies:[d.NgClass,d.NgForOf,d.NgIf,c._Y,c.Fj,c.wV,c.JJ,c.JL,c.On,c.F,v.Ro,b.d,d.DatePipe,u.X$],styles:[".content-wrapper[_ngcontent-%COMP%]{background-color:transparent}
1.z-index[_ngcontent-%COMP%]{z-index:1}.overlay[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.5);display:flex;justify-content:center;align-items:center;z-index:1000}.popup-card[_ngcontent-%COMP%]{width:400px;background:#fff;border-radius:10px;padding:25px;box-shadow:0 10px 25px #0000004d}.popup-title[_ngcontent-%COMP%]{margin-bottom:20px;font-weight:600;text-align:center}.form-group[_ngcontent-%COMP%]{margin-bottom:15px}.total-display[_ngcontent-%COMP%]{border:1px solid #ddd;padding:8px;border-radius:4px}.popup-footer[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-top:20px}.card-footer[_ngcontent-%COMP%]{flex-shrink:0;border-top:1px solid #ddd;padding:20px 10px;background-color:#fff}.chat-section[_ngcontent-%COMP%]{height:calc(100vh - 170px)}.chat-body-with-images[_ngcontent-%COMP%], .chat-body-no-images[_ngcontent-%COMP%]{flex-grow:1;overflow-y:auto;min-height:0;padding:10px}.chat-text-prewrap[_ngcontent-%COMP%]{word-wrap:break-word;overflow-wrap:break-word;white-space:pre-wrap}.direct-chat-text[_ngcontent-%COMP%]{margin-right:10px}.chat-image-wrapper[_ngcontent-%COMP%]{position:relative;background:transparent;margin-right:10px;border:none}.chat-image-wrapper-left[_ngcontent-%COMP%]{position:relative;background:transparent;margin:0}.chat-image-wrapper-right[_ngcontent-%COMP%]{position:relative;background:transparent;margin:0 10px 0 0;float:right}.chat-image[_ngcontent-%COMP%]{width:400px;height:300px;object-fit:cover;border-radius:10px}.file-view[_ngcontent-%COMP%]{width:50%}.direct-chat-text-right[_ngcontent-%COMP%]{width:50%;background-color:transparent}.chat-overlay[_ngcontent-%COMP%], .chat-overlay-right[_ngcontent-%COMP%]{bottom:0;width:75px;height:75px;border-radius:5px;overflow:hidden;display:flex;align-items:center;justify-content:center;position:absolute}.chat-overlay-right[_ngcontent-%COMP%]{right:0}.chat-overlay-bg[_ngcontent-%COMP%]{position:absolute;inset:0;background-size:cover;background-position:center;border-radius:5px}.chat-overlay-mask[_ngcontent-%COMP%]{position:absolute;inset:0;background:rgba(0,0,0,.5);border-radius:5px}.chat-overlay-text[_ngcontent-%COMP%]{position:relative;z-index:2;color:#fff;font-weight:700;font-size:16px}.image-preview[_ngcontent-%COMP%]{width:60px;height:40px;background-size:cover;background-position:center;border-radius:5px;display:flex;align-items:center;justify-content:center;font-weight:700;color:#fff;position:relative;opacity:.5;object-fit:cover}.image-preview[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%}.image-count[_ngcontent-%COMP%]{position:relative;z-index:2;font-size:14px}.chat-file-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;background:#f8f9fa;border-radius:8px;padding:8px 12px;margin-bottom:4px}.chat-file-wrapper[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none;font-size:14px;color:#333}.chat-file-wrapper[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.delete-chat[_ngcontent-%COMP%]{width:30px;height:30px;background-color:red;justify-content:center;align-items:center;display:flex;border-radius:20px}.delete-chat[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fff}"]}),i})()}];let K=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.\u0275\u0275defineNgModule({type:i}),i.\u0275inj=e.\u0275\u0275defineInjector({imports:[m.Bz.forChild(H),m.Bz]}),i})();var J=l(32641),X=l(71059);let Z=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.\u0275\u0275defineNgModule({type:i}),i.\u0275inj=e.\u0275\u0275defineInjector({imports:[d.CommonModule,c.u5,v.ef,x.QM,K,c.UX,J.D,X.O,u.aw.forChild({isolate:!1})]}),i})()}}]);
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.