1"use strict";(self.webpackChunktaiga=self.webpackChunktaiga||[]).push([[972],{1580:(Y,x,r)=>{r.d(x,{E:()=>R});var d=r(1360),T=r(5850);let R=(()=>{class M{constructor(c){this.requestService=c}saveBlob(c,e){const E=new Blob([c],{type:e});if(window.navigator&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(E);else{const m=window.URL.createObjectURL(E);window.open(m,"_blank"),setTimeout(()=>{window.URL.revokeObjectURL(m)},100)}}saveBlobWithFilename(c,e){const E=e.split(".").pop(),m=this.getMimeType(E),p=new Blob([c],{type:m});if(window.navigator&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(p,e);else{const f=window.URL.createObjectURL(p),g=document.createElement("a");typeof g.download>"u"?window.open(f,"_blank"):(g.href=f,g.download=e,document.body.appendChild(g),g.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}))),setTimeout(()=>{window.URL.revokeObjectURL(f),g&&g.remove()},100)}}getMimeType(c){switch(c=c.replace(".","")){case"3g2":return"video/3gpp2";case"3gp":return"video/3gpp";case"au":return"audio/basic";case"avi":return"video/x-msvideo";case"bmp":return"image/bmp";case"doc":return"application/msword";case"docx":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"eps":case"ps":return"application/postscript";case"gif":return"image/gif";case"h264":return"video/h264";case"htm":case"html":return"text/html";case"ico":return"image/x-icon";case"jpe":case"jpeg":case"jpg":return"image/jpeg";case"m4v":return"video/x-m4v";case"mkv":return"video/x-matroska";case"mov":case"qt":return"video/quicktime";case"mp3":case"mpga":return"audio/mpeg";case"mp4":case"mpg4":return"video/mp4";case"mpe":case"mpeg":case"mpg":return"video/mpeg";case"ogg":return"application/ogg";case"pdf":return"application/pdf";case"png":return"image/png";case"ppt":return"application/vnd.ms-powerpoint";case"ra":case"ram":return"audio/x-pn-realaudio";case"rm":return"application/vnd.rn-realmedia";case"rtf":return"text/rtf";case"rtx":return"text/richtext";case"svg":return"image/svg+xml";case"swf":return"application/x-shockwave-flash";case"tif":case"tiff":return"image/tiff";case"txt":return"text/plain";case"wav":return"audio/x-wav";case"wbmp":return"image/vnd.wap.wbmp";case"wmv":return"video/x-ms-wmv";case"xhtml":return"application/xhtml+xml";case"xls":return"application/vnd.ms-excel";case"xlsx":return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";case"xml":return"application/xml";default:return""}}getValidMediaType(c){switch(c){case"application/pdf":case"image/jpeg":case"image/png":case"image/bmp":case"image/gif":return!0;default:return!1}}getValidImageMediaType(c){switch(c){case"image/jpeg":case"image/png":case"image/bmp":case"image/gif":return!0;default:return!1}}getBlobFromUrl(c){return this.requestService.getBlobFromUrl(c)}static{this.\u0275fac=function(e){return new(e||M)(d.KVO(T.B))}}static{this.\u0275prov=d.jDH({token:M,factory:M.\u0275fac,providedIn:"root"})}}return M})()},7972:(Y,x,r)=>{r.r(x),r.d(x,{ErrandModule:()=>Qe});var d=r(2881),T=r(5207),R=r(1336),M=r(7586),v=r.n(M),c=r(9437),e=r(1360),E=r(2043),m=r(2155),p=r(1715),f=r(1580),g=r(5665),V=r(1997),b=r(9213),I=r(4506),u=r(5596),S=r(3013),F=r(4317),X=r(8709),A=r(6090),j=r(44),U=r(7456),h=r(8018),L=r(5565),w=r(8834),O=r(100),C=r(2928),k=r(7403),_=r(9417),$=r(3881),H=r(1517),Q=r(5626);const J=["editInput"],K=()=>({standalone:!0}),W=i=>({invalidChars:i});function z(i,o){if(1&i&&(e.j41(0,"div",10),e.EFF(1),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.JRh(t.senderDisplayName)}}function Z(i,o){if(1&i){const t=e.RV6();e.j41(0,"div",11,0),e.bIt("click",function(){e.eBV(t);const a=e.sdS(1);return e.Njj(a.toggle())}),e.EFF(2),e.nI1(3,"translate"),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("matTooltip",t.formatDateAndTime(t.message.changed)),e.R7$(2),e.SpI(" ",e.bMT(3,2,"EDITED")," ")}}function q(i,o){if(1&i){const t=e.RV6();e.j41(0,"div",12),e.bIt("focus",function(){e.eBV(t);const a=e.XpG();return e.Njj(a._showEditButton())})("focusout",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.hideEditButton())}),e.k0s()}if(2&i){const t=e.XpG();e.AVh("chip-primary",t.message.self)("chip-secondary",!t.message.self),e.Y8G("innerText",t.message.body)}}function ee(i,o){if(1&i){const t=e.RV6();e.j41(0,"button",14),e.nI1(1,"translate"),e.bIt("focus",function(){e.eBV(t);const a=e.XpG(2);return e.Njj(a._showEditButton())})("focusout",function(){e.eBV(t);const a=e.XpG(2);return e.Njj(a.hideEditButton())})("click",function(){e.eBV(t);const a=e.XpG(2);return e.Njj(a.toggleEdit())}),e.j41(2,"mat-icon"),e.EFF(3,"edit"),e.k0s()()}if(2&i){const t=e.XpG(2);e.AVh("hide-edit-button",!t.showEditButton),e.BMQ("aria-label",e.bMT(1,5,"EDITMESSAGE")),e.R7$(2),e.AVh("hide-edit-button",!t.showEditButton)}}function te(i,o){if(1&i){const t=e.RV6();e.j41(0,"button",14),e.nI1(1,"translate"),e.bIt("focus",function(){e.eBV(t);const a=e.XpG(2);return e.Njj(a._showEditButton())})("focusout",function(){e.eBV(t);const a=e.XpG(2);return e.Njj(a.hideEditButton())})("click",function(){e.eBV(t);const a=e.XpG(2);
1return e.Njj(a.deleteClicked.emit(a.message.id))}),e.j41(2,"mat-icon"),e.EFF(3,"delete"),e.k0s()()}if(2&i){const t=e.XpG(2);e.AVh("hide-edit-button",!t.showEditButton),e.BMQ("aria-label",e.bMT(1,5,"DELETEMESSAGE")),e.R7$(2),e.AVh("hide-edit-button",!t.showEditButton)}}function ne(i,o){if(1&i&&(e.qex(0),e.DNE(1,ee,4,7,"button",13)(2,te,4,7,"button",13),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",!t.editMessage),e.R7$(),e.Y8G("ngIf",!t.editMessage)}}function ie(i,o){1&i&&(e.qex(0),e.j41(1,"button",21),e.nI1(2,"translate"),e.j41(3,"mat-icon"),e.EFF(4,"picture_as_pdf"),e.k0s()(),e.j41(5,"span"),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.bVm()),2&i&&(e.R7$(),e.BMQ("aria-label",e.bMT(2,2,"PDFDOCUMENT")),e.R7$(5),e.JRh(e.bMT(7,4,"PDFDOCUMENT")))}function ae(i,o){1&i&&(e.qex(0),e.j41(1,"button",21),e.nI1(2,"translate"),e.j41(3,"mat-icon"),e.EFF(4,"image"),e.k0s()(),e.j41(5,"span"),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.bVm()),2&i&&(e.R7$(),e.BMQ("aria-label",e.bMT(2,2,"IMAGE")),e.R7$(5),e.JRh(e.bMT(7,4,"IMAGE")))}function se(i,o){1&i&&(e.qex(0),e.j41(1,"button",21),e.nI1(2,"translate"),e.j41(3,"mat-icon"),e.EFF(4,"attachment"),e.k0s()(),e.j41(5,"span"),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.bVm()),2&i&&(e.R7$(),e.BMQ("aria-label",e.bMT(2,2,"FILE")),e.R7$(5),e.JRh(e.bMT(7,4,"FILE")))}function re(i,o){if(1&i){const t=e.RV6();e.j41(0,"div",17),e.bIt("click",function(){const a=e.eBV(t).$implicit,s=e.XpG(2);return e.Njj(s.downloadFile(a.id,a.contentType))}),e.qex(1,18),e.DNE(2,ie,8,6,"ng-container",19)(3,ae,8,6,"ng-container",19)(4,se,8,6,"ng-container",20),e.bVm(),e.k0s()}if(2&i){const t=o.$implicit;e.R7$(),e.Y8G("ngSwitch",!0),e.R7$(),e.Y8G("ngSwitchCase","application/pdf"===t.contentType),e.R7$(),e.Y8G("ngSwitchCase","image/jpeg"===t.contentType||"image/bmp"===t.contentType||"image/png"===t.contentType||"image/gif"===t.contentType)}}function oe(i,o){if(1&i&&(e.j41(0,"div",15),e.DNE(1,re,5,3,"div",16),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngForOf",t.message.attachments)}}function le(i,o){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"div")(2,"mat-form-field",22),e.nrm(3,"textarea",23,1),e.j41(6,"mat-error"),e.EFF(7),e.nI1(8,"translate"),e.k0s()()(),e.j41(9,"div",24)(10,"button",25),e.nI1(11,"translate"),e.bIt("click",function(){e.eBV(t);const a=e.XpG();return a.patchClicked.emit({id:a.message.id,body:a.editInputRef.nativeElement.value}),a.toggleEdit(),e.Njj(a.hideEditButton())}),e.j41(12,"mat-icon"),e.EFF(13,"done"),e.k0s()(),e.j41(14,"button",26),e.nI1(15,"translate"),e.nI1(16,"translate"),e.bIt("click",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.toggleEdit())}),e.j41(17,"mat-icon"),e.EFF(18,"close"),e.k0s()()()()}if(2&i){const t=e.sdS(5),n=e.XpG();e.R7$(3),e.Y8G("ngModel",n.message.body)("ngModelOptions",e.lJ4(16,K)),e.R7$(4),e.JRh(e.i5U(8,7,"INVALIDCHARACTERS",e.eq3(17,W,null==t.errors||null==t.errors.allowedCharacters?null:t.errors.allowedCharacters.invalidChars))),e.R7$(3),e.Y8G("disabled",t.hasError("allowedCharacters")),e.BMQ("aria-label",e.bMT(11,10,"SAVEEDITEDMESSAGE")),e.R7$(4),e.BMQ("aria-label",e.bMT(15,12,"DELETEMESSAGE"))("aria-label",e.bMT(16,14,"CLOSEEDITMESSAGE"))}}let ce=(()=>{class i{constructor(t,n,a){this.errandService=t,this.translate=n,this.fileService=a,this.loadMoreMessages=new e.bkB,this.deleteClicked=new e.bkB,this.patchClicked=new e.bkB}ngOnInit(){this.senderDisplayName=this.message.companyDisplayName??this.message.customerDisplayName??this.orgDisplayName}formatDate(t){const n=v()(t);return n.isSame(Date.now(),"day")?n.format("HH:mm"):n.isSame(Date.now(),"week")?n.format("dddd HH:mm"):n.format("YYYY-MM-DD HH:mm")}formatDateAndTime(t){return v()(t).format("YYYY-MM-DD HH:mm")}downloadFile(t,n){this.errandService.getErrandsGeneralItemMessageItemAttachementItemFile(t).subscribe(a=>{const s=n?.split("/").pop(),l=`${this.translate.instant("ATTACHMENT")}.${s}`;this.fileService.saveBlobWithFilename(a,l)})}toggleEdit(){this.editMessage=!this.editMessage}_showEditButton(){this.showEditButton=!0}hideEditButton(){this.showEditButton=!1}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(p.Q),e.rXU(h.c$),e.rXU(f.E))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["taiga-errand-message"]],viewQuery:function(n,a){if(1&n&&e.GBs(J,5),2&n){let s;e.mGM(s=e.lsd())&&(a.editInputRef=s.first)}},inputs:{message:"message",orgDisplayName:"orgDisplayName"},outputs:{loadMoreMessages:"loadMoreMessages",deleteClicked:"deleteClicked",patchClicked:"patchClicked"},standalone:!1,decls:12,vars:10,consts:[["tooltip","matTooltip"],["editInput","","editModel","ngModel"],[1,"message-container"],["class","username",4,"ngIf"],[1,"created-date",3,"click","matTooltip"],["class","edited",3,"matTooltip","click",4,"ngIf"],[1,"chip-container",3,"mouseenter","mouseleave"],["tabindex","0","class","chip","data-mom-test","MinaSidor_Mina\xc4renden_\xc4rende_MeddelandeChip",3,"chip-primary","chip-secondary","innerText","focus","focusout",4,"ngIf"],[4,"ngIf"],["class","download-file-container",4,"ngIf"],[1,"username"],[1,"edited",3,"click","matTooltip"],["tabindex","0","data-mom-test","MinaSidor_Mina\xc4renden_\xc4rende_MeddelandeChip",1,"chip",3,"focus","focusout","innerText"],["mat-icon-button","","color","primary","class","edit-button",3,"hide-edit-button","focus","focusout","click",4,"ngIf"],["mat-icon-button","","color","primary",1,"edit-button",3,"focus","focusout","click"],[1,"download-file-container"],["class","download-file-button-container","data-mom-test","MinaSidor_Mina\xc4renden_MeddelandeFil",3,"click",4,"ngFor","ngForOf"],["data-mom-test","MinaSidor_Mina\xc4renden_MeddelandeFil",1,"download-file-button-container",3,"click"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["mat-icon-button","","color","primary"],[1,"form-field",2,"padding-top","0"],["matInput","","cdkTextareaAutosize","","taigaAllowedCharacters","","autocomplete","off",2,"margin-top","0",3,"ngModel","ngModelOptions"],[2,"display","flex","justify-content","flex-end","margin-top","-20px"],["mat-icon-button","","color","primary",1,"edit-button",3,"click","disabled"],["mat-icon-button","","color","primary",1,"edit-button",3,"click"]],template:function(n,a){if(1&n){const s=e.RV6();e.j41(0,"div",2)(1,"div"),e.DNE(2,z,2,1,"div",3),e.j41(3,"div",4,0),e.bIt("click",function(){e.eBV(s);const y=e.sdS(4);return e.Njj(y.toggle())}),e.EFF(5),e.k0s(),e.DNE(6,Z,4,4,"div",5),e.j41(7,"div",6),e.bIt("mouseenter",function(){return e.eBV(s),e.Njj(a._showEditButton())})("mouseleave",function(){return e.eBV(s),e.Njj(a.hideEditButton())}),e.DNE(8,q,1,5,"div",7)(9,ne,3,2,"ng-container",8),e.k0s(),e.DNE(10,oe,2,1,"div",9),e.k0s()(),e.DNE(11,le,19,19,"div",8)}2&n&&(e.AVh("self-message",a.message.self),e.R7$(2),e.Y8G("ngIf",!a.message.self),e.R7$(),e.Y8G("matTooltip",a.formatDateAndTime(a.message.created)),e.R7$(2),e.SpI(" ",a.formatDate(a.message.created)," "),e.R7$(),e.Y8G("ngIf",a.message.changed),e.R7$(2),e.Y8G("ngIf",!a.editMessage),e.R7$(),e.Y8G("ngIf",a.message.self),e.R7$(),e.Y8G("ngIf",a.message.attachments&&a.message.attachments.length>0),e.R7$(),e.Y8G("ngIf",a.editMessage))},dependencies:[d.Sq,d.bT,d.ux,d.e1,d.fG,b.An,I.M,O.fg,C.j,C.b,k.xb,Q.e,_.me,_.BC,_.vS,$.S,h.D9],styles:[".message-container[_ngcontent-%COMP%]{display:flex;margin-top:20px}.chip-container[_ngcontent-%COMP%]{display:flex;align-items:center}.self-message[_ngcontent-%COMP%]{justify-content:flex-end}.self-message[_ngcontent-%COMP%] .created-date[_ngcontent-%COMP%], .self-message[_ngcontent-%COMP%] .username[_ngcontent-%COMP%], .self-message[_ngcontent-%COMP%] .edited[_ngcontent-%COMP%]{text-align:end}.self-message[_ngcontent-%COMP%] .chip-container[_ngcontent-%COMP%]{justify-content:flex-end}.form-field[_ngcontent-%COMP%]{width:100%}.create-message-container[_ngcontent-%COMP%]{margin-top:50px}.chip[_ngcontent-%COMP%]{display:inline-flex;border-radius:16px;padding:7px 12px;font-size:.875rem;line-height:1.125rem}.send-message-button[_ngcontent-%COMP%]{margin-left:15px}.download-file-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-end}.download-file-button-container[_ngcontent-%COMP%]{display:flex;align-items:center;font-weight:500;cursor:pointer}.load-more[_ngcontent-%COMP%]{display:flex;margin-top:10px;align-items:center;height:36px}.load-more-button[_ngcontent-%COMP%], .spinner[_ngcontent-%COMP%]{margin:0 auto}.send-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.edit-button[_ngcontent-%COMP%]{transition:width .3s ease}.hide-edit-button[_ngcontent-%COMP%]{width:0px!important}.hide[_ngcontent-%COMP%]{display:none}.chip-secondary[_ngcontent-%COMP%]{margin-top:7px}.edited[_ngcontent-%COMP%]{font-style:italic}"]})}}return i})();const de=()=>({standalone:!0}),me=i=>({invalidChars:i});function pe(i,o){if(1&i){const t=e.RV6();e.j41(0,"button",7),e.bIt("click",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.loadMore())}),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"mat-icon",2),e.EFF(4,"history"),e.k0s()()}2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"LOADMORE")," "))}function ge(i,o){1&i&&(e.j41(0,"div",8),e.nrm(1,"taiga-spinner",9),e.k0s()),2&i&&(e.R7$(),e.Y8G("diameter",36))}function ue(i,o){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"taiga-errand-message",10),e.bIt("deleteClicked",function(a){e.eBV(t);const s=e.XpG();
1return e.Njj(s.deleteMessage(a))})("patchClicked",function(a){e.eBV(t);const s=e.XpG();return e.Njj(s.patchMessage(a))}),e.k0s(),e.bVm()}if(2&i){const t=o.$implicit,n=e.XpG();e.R7$(),e.Y8G("message",t)("orgDisplayName",n.orgDisplayName)}}function _e(i,o){if(1&i){const t=e.RV6();e.j41(0,"form")(1,"div",11)(2,"mat-form-field",12)(3,"mat-label"),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.nrm(6,"textarea",13,0),e.j41(9,"mat-error"),e.EFF(10),e.nI1(11,"translate"),e.k0s()(),e.j41(12,"div",14)(13,"taiga-file-upload",15),e.bIt("fileLoaded",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.fileLoaded())}),e.k0s(),e.j41(14,"button",16),e.bIt("click",function(){e.eBV(t);const a=e.sdS(7),s=e.XpG();return e.Njj(s.sendMessage(a))}),e.EFF(15),e.nI1(16,"translate"),e.k0s()()()()}if(2&i){const t=e.sdS(7),n=e.sdS(8);e.R7$(4),e.JRh(e.bMT(5,5,"WRITEAMESSAGE")),e.R7$(2),e.Y8G("ngModelOptions",e.lJ4(12,de)),e.R7$(4),e.JRh(e.i5U(11,7,"INVALIDCHARACTERS",e.eq3(13,me,null==n.errors||null==n.errors.allowedCharacters?null:n.errors.allowedCharacters.invalidChars))),e.R7$(4),e.Y8G("disabled",!t.value||n.hasError("allowedCharacters")),e.R7$(),e.JRh(e.bMT(16,10,"SEND"))}}let fe=(()=>{class i{constructor(t,n,a,s,l){this.errandService=t,this.appConfigService=n,this.fileService=a,this.translate=s,this.dialog=l,this.messageSend=new e.bkB,this.loadMoreMessages=new e.bkB,this.orgDisplayName=this.appConfigService.orgDisplayName}ngOnChanges(){if(this.errandsGeneralItemMessage?.items)for(const t of this.errandsGeneralItemMessage?.items)!t.self&&t.id&&!t.read&&this.setMarkedAsRead(t.id)}formatDate(t){const n=v()(t);return n.isSame(Date.now(),"day")?n.format("HH:mm"):n.isSame(Date.now(),"week")?n.format("dddd HH:mm"):n.format("YYYY-MM-DD HH:mm")}formatDateAndTime(t){return v()(t).format("YYYY-MM-DD HH:mm")}sendMessage(t){this.canCreateMessages&&this.id&&t.value&&this.errandService.putErrandsGeneralItemMessageItem(this.id,t.value).subscribe(n=>{if(t.value=null,this.fileUpload?.anyFiles?.length>0&&n?.id)for(const a of this.fileUpload?.anyFiles)this.errandService.putErrandsGeneralItemMessagesItemAttachement(n.id,a.file.name,this.removeBase64Marker(a.src)).pipe((0,c.W)(s=>{throw 0===this.fileUpload?.anyFiles.indexOf(a)&&this.loadMoreMessages.emit({offset:0,limit:1,sent:!0}),s})).subscribe(()=>{0===this.fileUpload?.anyFiles.indexOf(a)&&(this.fileUpload.anyFiles=[],this.loadMoreMessages.emit({offset:0,limit:1,sent:!0}))});else this.loadMoreMessages.emit({offset:0,limit:1,sent:!0})})}downloadFile(t,n){this.errandService.getErrandsGeneralItemMessageItemAttachementItemFile(t).subscribe(a=>{const s=n?.split("/").pop(),l=`${this.translate.instant("ATTACHMENT")}.${s}`;this.fileService.saveBlobWithFilename(a,l)})}loadMore(){this.loadMoreMessages.emit({offset:this.errandsGeneralItemMessage.items.length,limit:4,sent:!1})}setMarkedAsRead(t){this.errandService.patchErrandsGeneralItemMessageItemRead(t).subscribe(n=>{console.log(n)})}fileLoaded(){window.scrollTo(0,document.body.scrollHeight)}removeBase64Marker(t){const a=t.indexOf(";base64,")+8;return t.substring(a)}deleteMessage(t){this.dialog.open(X.w,{data:{heading:null,text:this.translate.instant("CONFIRMDELETEMESSAGE"),dialogChoices:A.$.YesNo},scrollStrategy:new j.N,ariaLabel:this.translate.instant("CONFIRMDELETEMESSAGE")}).afterClosed().subscribe(a=>{"yes"===a&&this.errandService.deleteErrandsItemMessagesItem(t).subscribe(()=>{this.errandsGeneralItemMessage.items.splice(this.errandsGeneralItemMessage.items.indexOf(this.errandsGeneralItemMessage.items.find(s=>s.id===t)),1)})})}patchMessage(t){this.errandService.patchErrandsGeneralItemMessageItemBody(t.id,t.body).subscribe(()=>{let n=this.errandsGeneralItemMessage.items.find(a=>a.id===t.id);n.body=t.body,n.changed=new Date})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(p.Q),e.rXU(U.R),e.rXU(f.E),e.rXU(h.c$),e.rXU(L.j))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["taiga-errand-messages"]],viewQuery:function(n,a){if(1&n&&e.GBs(F.P,5),2&n){let s;e.mGM(s=e.lsd())&&(a.fileUpload=s.first)}},inputs:{errandsGeneralItemMessage:"errandsGeneralItemMessage",id:"id",showSpinner:"showSpinner",showLoadMore:"showLoadMore",canCreateMessages:"canCreateMessages"},outputs:{messageSend:"messageSend",loadMoreMessages:"loadMoreMessages"},standalone:!1,features:[e.OA$],decls:8,vars:7,consts:[["messageInput","","msgModel","ngModel"],[1,"load-more"],["color","primary"],["class","load-more-button","mat-button","","data-mom-test","MinaSidor_Mina\xc4renden_\xc4rende_LaddaFler",3,"click",4,"ngIf"],["class","spinner",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["mat-button","","data-mom-test","MinaSidor_Mina\xc4renden_\xc4rende_LaddaFler",1,"load-more-button",3,"click"],[1,"spinner"],[3,"diameter"],[3,"deleteClicked","patchClicked","message","orgDisplayName"],[1,"create-message-container"],[1,"form-field"],["matInput","","cdkTextareaAutosize","","ngModel","","taigaAllowedCharacters","","data-mom-test","MinaSidor_Mina\xc4renden_\xc4rende_SkrivMeddelande","autocomplete","off",3,"ngModelOptions"],[1,"send-container"],["accept",".pdf, .jpeg, .jpg, .png, .bmp, .gif",3,"fileLoaded"],["mat-raised-button","","color","primary","data-mom-test","MinaSidor_Mina\xc4renden_\xc4rende_SkickaMeddelande",1,"send-message-button",3,"click","disabled"]],template:function(n,a){1&n&&(e.j41(0,"div",1)(1,"mat-icon",2),e.nI1(2,"translate"),e.EFF(3,"question_answer"),e.k0s(),e.DNE(4,pe,5,3,"button",3)(5,ge,2,1,"div",4),e.k0s(),e.DNE(6,ue,2,2,"ng-container",5)(7,_e,17,15,"form",6)),2&n&&(e.R7$(),e.BMQ("aria-label",e.bMT(2,5,"CONVERSATION")),e.R7$(3),e.Y8G("ngIf",!a.showSpinner&&a.showLoadMore),e.R7$(),e.Y8G("ngIf",a.showSpinner),e.R7$(),e.Y8G("ngForOf",null==a.errandsGeneralItemMessage?null:a.errandsGeneralItemMessage.items),e.R7$(),e.Y8G("ngIf",a.canCreateMessages))},dependencies:[d.Sq,d.bT,b.An,w.$z,O.fg,C.j,C.M,C.b,k.xb,_.qT,_.me,_.BC,_.cb,_.vS,_.cV,$.S,F.P,H.t,ce,h.D9],styles:[".message-container[_ngcontent-%COMP%]{display:flex;margin-top:20px}.chip-container[_ngcontent-%COMP%]{display:flex}
1.self-message[_ngcontent-%COMP%]{justify-content:flex-end}.self-message[_ngcontent-%COMP%] .created-date[_ngcontent-%COMP%], .self-message[_ngcontent-%COMP%] .username[_ngcontent-%COMP%]{text-align:end}.self-message[_ngcontent-%COMP%] .chip-container[_ngcontent-%COMP%]{justify-content:flex-end}.form-field[_ngcontent-%COMP%]{width:100%}.create-message-container[_ngcontent-%COMP%]{margin-top:50px}.chip[_ngcontent-%COMP%]{display:inline-flex;border-radius:16px;padding:7px 12px;font-size:.875rem;line-height:1.125rem}.send-message-button[_ngcontent-%COMP%]{margin-left:15px}.download-file-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-end}.download-file-button-container[_ngcontent-%COMP%]{display:flex;align-items:center;font-weight:500;cursor:pointer}.load-more[_ngcontent-%COMP%]{display:flex;margin-top:10px;align-items:center;height:36px}.load-more-button[_ngcontent-%COMP%], .spinner[_ngcontent-%COMP%]{margin:0 auto}.send-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}"]})}}return i})();function he(i,o){if(1&i&&(e.j41(0,"div",10),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Lme("",e.bMT(2,2,"ARRIVED")," ",t.formatDate(t.errand.status.created),"")}}function Me(i,o){if(1&i&&(e.j41(0,"div")(1,"div",15),e.EFF(2),e.k0s(),e.nrm(3,"div",16),e.k0s()),2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.R7$(2),e.SpI(" ",n.getDisplayName(n.errand.type.id,t.key)," "),e.R7$(),e.Y8G("innerText",t.value)}}function ve(i,o){if(1&i){const t=e.RV6();e.j41(0,"div",17)(1,"div",18),e.bIt("click",function(){e.eBV(t);const a=e.XpG().$implicit,s=e.XpG(2);return e.Njj(s.downloadFile(s.errand.id,a.value))}),e.j41(2,"button",19)(3,"mat-icon"),e.EFF(4,"attachment"),e.k0s()(),e.j41(5,"span"),e.EFF(6),e.k0s()()()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.R7$(2),e.BMQ("aria-label",n.getDisplayName(n.errand.type.id,t.key)),e.R7$(4),e.JRh(n.getDisplayName(n.errand.type.id,t.key))}}function Ee(i,o){if(1&i&&(e.j41(0,"div",11),e.qex(1,12),e.DNE(2,Me,4,2,"div",13)(3,ve,7,2,"div",14),e.bVm(),e.k0s()),2&i){const t=o.$implicit,n=e.XpG(2);e.R7$(),e.Y8G("ngSwitch",n.getBasicFieldPresentationType(n.errand.type.id,t.key)),e.R7$(),e.Y8G("ngSwitchCase","inputText"),e.R7$(),e.Y8G("ngSwitchCase","file")}}function be(i,o){if(1&i&&(e.j41(0,"div"),e.EFF(1),e.k0s()),2&i){const t=o.$implicit;e.R7$(),e.SpI(" ",t.displayName," ")}}function Ce(i,o){if(1&i&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i){const t=e.XpG(2).$implicit;e.R7$(),e.Lme(" ",e.bMT(2,2,"ERRORDESCRIPTION"),": ",t.description.text," ")}}function ye(i,o){if(1&i&&(e.j41(0,"div"),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2).$implicit;e.R7$(),e.SpI(" ",null==t.description?null:t.description.specification," ")}}function xe(i,o){if(1&i&&(e.j41(0,"div",25)(1,"div",22),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.DNE(4,Ce,3,4,"div",1)(5,ye,2,1,"div",1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.SpI(" ",e.bMT(3,3,"DESCRIPTION")," "),e.R7$(2),e.Y8G("ngIf",null==t.description?null:t.description.text),e.R7$(),e.Y8G("ngIf",null==t.description?null:t.description.specification)}}function Te(i,o){if(1&i&&(e.j41(0,"div",21),e.nrm(1,"mat-divider"),e.j41(2,"div",22),e.EFF(3),e.k0s(),e.DNE(4,be,2,1,"div",23)(5,xe,6,5,"div",24),e.k0s()),2&i){const t=o.$implicit;e.R7$(3),e.SpI(" ",null==t||null==t.primaryObject||null==t.primaryObject.type?null:t.primaryObject.type.typeClassDisplayName," "),e.R7$(),e.Y8G("ngForOf",null==t?null:t.entityPath),e.R7$(),e.Y8G("ngIf",(null==t.description?null:t.description.text)||(null==t.description?null:t.description.specification))}}function Re(i,o){if(1&i&&(e.qex(0),e.DNE(1,Te,6,3,"div",20),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",null==t.errand?null:t.errand.rows)}}function Ie(i,o){if(1&i){const t=e.RV6();e.j41(0,"div"),e.nrm(1,"mat-divider"),e.j41(2,"taiga-errand-messages",26),e.bIt("loadMoreMessages",function(a){e.eBV(t);const s=e.XpG(2);return e.Njj(s.getMessages(a.limit,a.offset,a.sent,a.sent))}),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(2),e.Y8G("errandsGeneralItemMessage",t.errandsGeneralItemMessage)("id",t.errand.id)("showLoadMore",t.showLoadMore)("showSpinner",t.disableGetMessages)("canCreateMessages",null==t.errand||null==t.errand.messages?null:t.errand.messages.canCreate)}}function Ge(i,o){if(1&i&&(e.qex(0),e.j41(1,"mat-card",2)(2,"mat-card-title")(3,"div",3)(4,"div",4),e.EFF(5),e.k0s(),e.DNE(6,he,3,4,"div",5),e.k0s()(),e.j41(7,"mat-card-subtitle")(8,"div",6)(9,"div"),e.EFF(10),e.nI1(11,"translate"),e.k0s(),e.nrm(12,"taiga-pill-badge",7),e.k0s()(),e.j41(13,"mat-card-content",8),e.DNE(14,Ee,4,3,"div",9),e.nI1(15,"keyvalue"),e.DNE(16,Re,2,1,"ng-container",1)(17,Ie,3,5,"div",1),e.k0s()(),e.bVm()),2&i){const t=e.XpG();e.R7$(5),e.JRh(t.errand.displayName),e.R7$(),e.Y8G("ngIf",null==t.errand||null==t.errand.status?null:t.errand.status.created),e.R7$(4),e.Lme("",e.bMT(11,8,"ERRAND")," ",t.errand.number,""),e.R7$(2),e.Y8G("text",null==t.errand||null==t.errand.status?null:t.errand.status.displayName),e.R7$(2),e.Y8G("ngForOf",e.i5U(15,10,t.errand.basicFields,t.unsorted)),e.R7$(2),e.Y8G("ngIf","order"===(null==t.errand||null==t.errand.presentation?null:t.errand.presentation.presentationType)),e.R7$(),e.Y8G("ngIf",t.getCanCommunicate(null==t.errand||null==t.errand.type?null:t.errand.type.id))}}let Se=(()=>{class i{constructor(t,n,a,s,l){this.mediaQueryService=t,this.route=n,this.errandService=a,this.fileService=s,this.cdr=l}ngOnInit(){this.route.data.subscribe(t=>{this.errand=t?.data?.[0],this.errandsTypes=t?.data?.[1];
1let n=+this.route.snapshot.queryParamMap.get("messages");Number(n)||(n=4),this.getMessages(+n.toFixed(),0,!1,!1)})}formatDate(t){return v()(t).format("YYYY-MM-DD")}formatDateTime(t){return v()(t).format("YYYY-MM-DD HH:mm")}getDisplayName(t,n){return this.errandsTypes?.items?.find(a=>a.id===t)?.basicFieldTypes[n]?.displayName}unsorted(){return 0}getMessages(t,n,a,s){this.getCanCommunicate(this.errand?.type?.id)&&(this.disableGetMessages||(this.disableGetMessages=!0,this.errandService.getErrandsGeneralItemMessage(this.errand.id,n,t).pipe((0,c.W)(l=>{throw this.disableGetMessages=!1,l})).subscribe(l=>{l?.items?.reverse(),this.errandsGeneralItemMessage?this.errandsGeneralItemMessage.items=s?[...this.errandsGeneralItemMessage.items,...l.items]:[...l.items,...this.errandsGeneralItemMessage.items]:this.errandsGeneralItemMessage=l,this.showLoadMore=l?.count!==this.errandsGeneralItemMessage.items.length,a&&(this.cdr.detectChanges(),window.scrollTo(0,document.body.scrollHeight)),this.disableGetMessages=!1})))}getBasicFieldPresentationType(t,n){return this.errandsTypes?.items?.find(a=>a.id===t)?.basicFieldTypes[n]?.presentationType}downloadFile(t,n){this.errandService.getErrandsGeneralItemFile(t,n).subscribe(a=>{const l=a?.type?.split("/").pop();this.fileService.saveBlobWithFilename(a,`${n}.${l}`)})}getCanCommunicate(t){return this.errandsTypes?.items?.find(n=>n.id===t)?.canCommunicate}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(E.M),e.rXU(m.nX),e.rXU(p.Q),e.rXU(f.E),e.rXU(e.gRc))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["taiga-errand"]],standalone:!1,decls:5,vars:11,consts:[[3,"text","subText"],[4,"ngIf"],[1,"card"],[1,"title-errand"],[1,"title"],["class","title-date",4,"ngIf"],[1,"subtitle"],[1,"badge-info",3,"text"],[2,"margin-top","16px"],["class","fields-container",4,"ngFor","ngForOf"],[1,"title-date"],[1,"fields-container"],[3,"ngSwitch"],[4,"ngSwitchCase"],["class","download-file-container",4,"ngSwitchCase"],[1,"label"],[1,"value",3,"innerText"],[1,"download-file-container"],[1,"download-file-button-container",3,"click"],["mat-icon-button","","color","primary"],["class","row",4,"ngFor","ngForOf"],[1,"row"],[1,"row-title"],[4,"ngFor","ngForOf"],["class","headers-align",4,"ngIf"],[1,"headers-align"],[3,"loadMoreMessages","errandsGeneralItemMessage","id","showLoadMore","showSpinner","canCreateMessages"]],template:function(n,a){1&n&&(e.j41(0,"div"),e.nrm(1,"taiga-medium-header",0),e.nI1(2,"translate"),e.nI1(3,"translate"),e.DNE(4,Ge,18,13,"ng-container",1),e.k0s()),2&n&&(e.AVh("is-mobile",a.mediaQueryService.isMobile())("is-desktop",!a.mediaQueryService.isMobile()),e.R7$(),e.Y8G("text",e.bMT(2,7,"ERRAND"))("subText",e.bMT(3,9,"ERRANDHELP")),e.R7$(3),e.Y8G("ngIf",a.errand))},dependencies:[d.Sq,d.bT,d.ux,d.e1,g.Y,V.q,b.An,I.M,u.RN,u.m2,u.Lc,u.dh,S.o,fe,d.lG,h.D9],styles:[".is-desktop[_ngcontent-%COMP%]{padding:30px}.is-mobile[_ngcontent-%COMP%]{padding:20px}.title-errand[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;font-size:1.125rem;justify-content:space-between}.title-date[_ngcontent-%COMP%]{font-size:.875rem}.title[_ngcontent-%COMP%]{margin-right:10px}.card[_ngcontent-%COMP%]{margin-bottom:8px}.card-actions[_ngcontent-%COMP%]{margin:0;padding:0}.fields-container[_ngcontent-%COMP%]{margin-bottom:16px}.label[_ngcontent-%COMP%]{font-size:1rem}.form-field[_ngcontent-%COMP%]{width:100%}.download-file-container[_ngcontent-%COMP%]{display:flex}.download-file-button-container[_ngcontent-%COMP%]{display:flex;align-items:center;font-weight:500;cursor:pointer}.subtitle[_ngcontent-%COMP%]{display:flex;justify-content:space-between;flex-wrap:wrap;align-items:center}.row[_ngcontent-%COMP%]{margin-bottom:16px}.row-title[_ngcontent-%COMP%]{font-weight:500;margin-bottom:10px;margin-top:16px}.headers-align[_ngcontent-%COMP%] .mat-expansion-panel-header-title[_ngcontent-%COMP%], .headers-align[_ngcontent-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%]{flex-basis:0;align-items:center}.headers-align[_ngcontent-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%]{justify-content:space-between;align-items:center}.mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 4px}"]})}}return i})();var Fe=r(8056),je=r(3687),D=r(6471);function we(i,o){if(1&i&&(e.j41(0,"div",13),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.R7$(),e.Lme("",e.bMT(2,2,"ARRIVED")," ",n.formatDate(t.status.created),"")}}function Oe(i,o){if(1&i&&(e.j41(0,"span"),e.EFF(1," ("),e.j41(2,"span"),e.EFF(3),e.k0s(),e.EFF(4,") "),e.k0s()),2&i){const t=e.XpG(2).$implicit;e.R7$(3),e.JRh(null==t||null==t.messages?null:t.messages.countUnread)}}function ke(i,o){if(1&i){const t=e.RV6();e.j41(0,"div",14)(1,"button",15),e.bIt("click",function(){e.eBV(t);const a=e.XpG().$implicit,s=e.XpG(2);return e.Njj(s.gotToErrand(a.id,null==a||null==a.messages?null:a.messages.countUnread))}),e.j41(2,"mat-icon",16),e.EFF(3," question_answer "),e.k0s(),e.j41(4,"div"),e.EFF(5),e.nI1(6,"translate"),e.DNE(7,Oe,5,1,"span",0),e.k0s()()()}if(2&i){const t=e.XpG().$implicit;e.R7$(),e.Y8G("highlighted",(null==t||null==t.messages?null:t.messages.countUnread)>0),e.R7$(),e.Y8G("color",(null==t||null==t.messages?null:t.messages.countUnread)>0?"":"primary"),e.R7$(3),e.SpI(" ",e.bMT(6,4,"CONVERSATION")," "),e.R7$(2),e.Y8G("ngIf",(null==t||null==t.messages?null:t.messages.countUnread)>0)}}function $e(i,o){if(1&i&&(e.j41(0,"div")(1,"div",21),e.EFF(2),e.k0s(),e.nrm(3,"div",22),e.k0s()),2&i){const t=e.XpG().$implicit,n=e.XpG().$implicit,a=e.XpG(2);e.R7$(2),e.SpI(" ",a.getDisplayName(n.type.id,t.key)," "),e.R7$(),e.Y8G("innerText",t.value)}}function De(i,o){if(1&i){const t=e.RV6();e.j41(0,"div",23)(1,"div",24),e.bIt("click",function(){e.eBV(t);const a=e.XpG().$implicit,s=e.XpG().$implicit,l=e.XpG(2);return e.Njj(l.downloadFile(s.id,a.value))}),e.j41(2,"button",25)(3,"mat-icon"),e.EFF(4,"attachment"),e.k0s()(),e.j41(5,"span"),e.EFF(6),e.k0s()()()}if(2&i){const t=e.XpG().$implicit,n=e.XpG().$implicit,a=e.XpG(2);e.R7$(2),e.BMQ("aria-label",a.getDisplayName(n.type.id,t.key)),e.R7$(4),e.JRh(a.getDisplayName(n.type.id,t.key))}}function Ne(i,o){if(1&i&&(e.j41(0,"div",17),e.qex(1,18),e.DNE(2,$e,4,2,"div",19)(3,De,7,2,"div",20),e.bVm(),e.k0s()),2&i){const t=o.$implicit,n=e.XpG().$implicit,a=e.XpG(2);e.R7$(),e.Y8G("ngSwitch",a.getBasicFieldPresentationType(n.type.id,t.key)),e.R7$(),e.Y8G("ngSwitchCase","inputText"),e.R7$(),e.Y8G("ngSwitchCase","file")}}function Pe(i,o){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"mat-card",2)(2,"div")(3,"mat-card-title")(4,"div",3)(5,"div",4),e.EFF(6),e.k0s(),e.DNE(7,we,3,4,"div",5),e.k0s()(),e.j41(8,"mat-card-subtitle",6)(9,"div",7)(10,"div"),e.EFF(11),e.nI1(12,"translate"),e.k0s(),e.nrm(13,"taiga-pill-badge",8),e.k0s(),e.DNE(14,ke,8,6,"div",9),e.k0s(),e.j41(15,"mat-card-content"),e.DNE(16,Ne,4,3,"div",10),e.nI1(17,"keyvalue"),e.k0s(),e.j41(18,"mat-card-actions",11)(19,"button",12),e.bIt("click",function(){const a=e.eBV(t).$implicit,s=e.XpG(2);return e.Njj(s.gotToErrand(a.id,a.countUnreadMessages))}),e.EFF(20),e.nI1(21,"translate"),e.k0s()()()()()}if(2&i){const t=o.$implicit,n=e.XpG(2);e.R7$(6),e.JRh(t.displayName),e.R7$(),e.Y8G("ngIf",null==t||null==t.status?null:t.status.created),e.R7$(4),e.Lme("",e.bMT(12,8,"ERRAND")," ",t.number,""),e.R7$(2),e.Y8G("text",null==t||null==t.status?null:t.status.displayName),e.R7$(),e.Y8G("ngIf",n.getCanCommunicate(null==t||null==t.type?null:t.type.id)),e.R7$(2),e.Y8G("ngForOf",e.i5U(17,10,t.basicFields,n.unsorted)),e.R7$(4),e.JRh(e.bMT(21,13,"SHOW"))}}function Be(i,o){if(1&i&&(e.qex(0),e.DNE(1,Pe,22,15,"div",1),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngForOf",t.errands.items)}}let Ye=(()=>{class i{constructor(t,n,a){this.errandService=t,this.fileService=n,this.router=a}formatDate(t){return v()(t).format("YYYY-MM-DD")}getDisplayName(t,n){return this.errandsTypes?.items?.find(a=>a.id===t)?.basicFieldTypes[n]?.displayName}getBasicFieldPresentationType(t,n){return this.errandsTypes?.items?.find(a=>a.id===t)?.basicFieldTypes[n]?.presentationType}getCanCommunicate(t){return this.errandsTypes?.items?.find(n=>n.id===t)?.canCommunicate}downloadFile(t,n){this.errandService.getErrandsGeneralItemFile(t,n).subscribe(a=>{const l=a?.type?.split("/").pop();this.fileService.saveBlobWithFilename(a,`${n}.${l}`)})}unsorted(){return 0}gotToErrand(t,n){let a;n&&n>4&&(a={messages:n}),this.router.navigate([`errands/${t}`],{queryParams:a})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(p.Q),e.rXU(f.E),e.rXU(m.Ix))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["taiga-errands-list"]],inputs:{errands:"errands",errandsTypes:"errandsTypes"},standalone:!1,decls:1,vars:1,consts:[[4,"ngIf"],[4,"ngFor","ngForOf"],["data-mom-test","MinaSidor_Mina\xc4renden_\xc4rendeKort",1,"card"],["data-mom-test","MinaSidor_Mina\xc4renden_\xc4rendeKortRubrik",1,"title-errand"],[1,"title"],["class","title-date",4,"ngIf"],["data-mom-test","MinaSidor_Mina\xc4renden_\xc4rendeKort\xc4rendenummer"],[1,"subtitle"],[1,"badge-info",3,"text"],["class","chips-container",4,"ngIf"],["class","fields-container",4,"ngFor","ngForOf"],[1,"card-actions"],["mat-raised-button","","color","primary","data-mom-test","MinaSidor_Mina\xc4renden_\xc4rendeKortVisa",3,"click"],[1,"title-date"],[1,"chips-container"],["mat-chip","","color","warn","data-mom-test","MinaSidor_Mina\xc4renden_\xc4rendeKortKonversationOl\xe4st",1,"chip","mat-typography",3,"click","highlighted"],["matChipTrailingIcon","",2,"margin-right","5px","margin-left","0px",3,"color"],[1,"fields-container"],[3,"ngSwitch"],[4,"ngSwitchCase"],["class","download-file-container",4,"ngSwitchCase"],[1,"label"],[1,"value",3,"innerText"],[1,"download-file-container"],[1,"download-file-button-container",3,"click"],["mat-icon-button","","color","primary"]],template:function(n,a){1&n&&e.DNE(0,Be,2,1,"ng-container",0),2&n&&e.Y8G("ngIf",a.errands&&a.errands.items)},dependencies:[d.Sq,d.bT,d.ux,d.e1,g.Y,b.An,w.$z,I.M,u.RN,u.YY,u.m2,u.Lc,u.dh,D.Jl,D.O5,d.lG,h.D9],styles:[".title-errand[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;font-size:1.125rem;justify-content:space-between}.title-date[_ngcontent-%COMP%]{font-size:.875rem}.title[_ngcontent-%COMP%]{margin-right:10px}.card[_ngcontent-%COMP%]{margin-bottom:15px}.card-actions[_ngcontent-%COMP%]{margin:0;padding:0}.fields-container[_ngcontent-%COMP%]{margin-bottom:16px}.label[_ngcontent-%COMP%]{font-size:1rem}.download-file-container[_ngcontent-%COMP%]{display:flex}.download-file-button-container[_ngcontent-%COMP%]{display:flex;align-items:center;font-weight:500;cursor:pointer}.chips-container[_ngcontent-%COMP%]{margin-top:10px;margin-bottom:5px}.chip[_ngcontent-%COMP%]{cursor:pointer;border:none}.subtitle[_ngcontent-%COMP%]{display:flex;justify-content:space-between;flex-wrap:wrap;align-items:center}"]})}}return i})(),Ve=(()=>{class i{constructor(t,n,a,s,l){this.mediaQueryService=t,this.rightSheet=n,this.errandService=a,this.route=s,this.translate=l}ngOnInit(){this.route.data.subscribe(t=>{this.errandsGeneral=t?.data[0],this.errandsTypes=t?.data[1]})}openSheet(){this.errandService.getErrandsTypes().subscribe(t=>{this.rightSheet.open(Fe.o,{data:t,panelClass:"custom-rightsheet",scrollStrategy:new j.N,ariaLabel:this.translate.instant("ERRAND"),autoFocus:!1}).afterDismissed().subscribe(a=>{setTimeout(()=>{a&&"SUCCESS"===a&&this.getErrandsGeneral()},1e4)})})}getErrandsGeneral(){this.errandService.getErrandsGeneral().subscribe(t=>{this.errandsGeneral=t})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(E.M),e.rXU(je.c9),e.rXU(p.Q),e.rXU(m.nX),e.rXU(h.c$))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["taiga-errands"]],standalone:!1,decls:11,vars:15,consts:[[1,"header-container"],[3,"text","subText"],["mat-icon-button","","data-mom-test","MinaSidor_Mina\xc4renden_L\xe4ggTillKnapp",3,"click"],["color","accent",1,"icon-display"],[3,"errands","errandsTypes"]],template:function(n,a){1&n&&(e.j41(0,"div")(1,"div",0)(2,"div"),e.nrm(3,"taiga-medium-header",1),e.nI1(4,"translate"),e.nI1(5,"translate"),e.k0s(),e.j41(6,"button",2),e.nI1(7,"translate"),e.bIt("click",function(){return a.openSheet()}
1),e.j41(8,"mat-icon",3),e.EFF(9,"add_circle"),e.k0s()()(),e.nrm(10,"taiga-errands-list",4),e.k0s()),2&n&&(e.AVh("is-mobile",a.mediaQueryService.isMobile())("is-desktop",!a.mediaQueryService.isMobile()),e.R7$(3),e.Y8G("text",e.bMT(4,9,"MYERRANDS"))("subText",e.bMT(5,11,"MYERRANDSHELP")),e.R7$(3),e.BMQ("aria-label",e.bMT(7,13,"CREATEERRAND")),e.R7$(4),e.Y8G("errands",a.errandsGeneral)("errandsTypes",a.errandsTypes))},dependencies:[b.An,I.M,S.o,Ye,h.D9],styles:[".is-desktop[_ngcontent-%COMP%]{padding:30px}.is-mobile[_ngcontent-%COMP%]{padding:20px}.header-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.icon-display[_ngcontent-%COMP%]{transform:scale(1.5)}.card[_ngcontent-%COMP%]{margin-bottom:8px}"]})}}return i})();var N=r(7468),G=r(7673),P=r(7342),B=r(6380);let Xe=(()=>{class i{constructor(t,n,a,s){this.errandService=t,this.userMessageService=n,this.errorService=a,this.router=s}resolve(t){return(0,N.p)([this.errandService.getErrandsGeneralItem(t.params.id),this.errandService.getErrandsTypes()]).pipe((0,c.W)(n=>{const a=this.errorService.parseError(n);return this.userMessageService.errorWithHeader(a.message,"",a.displayErrorReportNumber?a.errorReportNumber:""),this.router.navigateByUrl("/"),(0,G.of)(null)}))}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(p.Q),e.KVO(P.z),e.KVO(B.I),e.KVO(m.Ix))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const Ue=[{path:"",component:Ve,canActivate:[R.q],resolve:{data:(()=>{class i{constructor(t,n,a,s){this.errandService=t,this.userMessageService=n,this.errorService=a,this.router=s}resolve(){return(0,N.p)([this.errandService.getErrandsGeneral().pipe((0,c.W)(t=>{const n=this.errorService.parseError(t);return this.userMessageService.errorWithHeader(n.message,"",n.displayErrorReportNumber?n.errorReportNumber:""),this.router.navigateByUrl("/"),(0,G.of)(null)})),this.errandService.getErrandsTypes().pipe((0,c.W)(t=>{const n=this.errorService.parseError(t);return this.userMessageService.errorWithHeader(n.message,"",n.displayErrorReportNumber?n.errorReportNumber:""),this.router.navigateByUrl("/"),(0,G.of)(null)}))])}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(p.Q),e.KVO(P.z),e.KVO(B.I),e.KVO(m.Ix))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()},title:"MYERRANDS"},{path:":id",component:Se,canActivate:[R.q],resolve:{data:Xe},title:"ERRAND"}];let Le=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=e.$C({type:i})}static{this.\u0275inj=e.G2t({imports:[T.iI.forChild(Ue),T.iI]})}}return i})();var He=r(5974);let Qe=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=e.$C({type:i})}static{this.\u0275inj=e.G2t({imports:[d.MD,Le,He.G]})}}return 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.