text: (window.webpackJsonp=window.webpackJsonp||[]).push([[23],{"1NkQ":function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var i=n("+KbT"),o=n("Iab2"),a=n("fXoL");let c=(()=>{class t{constructor(){}saveFile(t,e,n){const i={};n&&(i.type=n);const a=new Blob([t],i);Object(o.saveAs)(a,e,{autoBOM:!0})}validateFileName(t){return new RegExp(/^[^\\\/\?%\*:\|\"\<\>]*[^\.]+$/i).test(t)}convertTo8859_15(t){const e=new Uint8Array(new ArrayBuffer(t.length));for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=a.Pb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var s=n("sYmb");function r(t){return void 0!==t.property}function l(t){return void 0!==t.map&&void 0!==t.label}let b=(()=>{class t{constructor(t,e,n){this.exporter=t,this.translate=e,this.config=n}export(t,e,n,{lineSeparator:i="\r\n",columnSeparator:o=this.config.instant("general_csv_separator"),encoding:a=this.config.instant("general_csv_encoding")}={}){let c=[];if(i===o)throw new Error("lineseparator and columnseparator must differ from each other");const s=e.map(t=>{let e;return r(t)?e=t.label?t.label:t.property:l(t)&&(e=t.label),e=this.capitalizeTranslate(e),e});c.push(s),c=c.concat(t.map(t=>e.map(e=>{let n;if(r(e)){const i=t[e.property];n="number"==typeof i?i.toString(10):i?!0===i?"1":!1===i?"0":i.toString():""}else l(e)&&(n=e.map(t));return this.checkCsvTextSafety(n)})));const b=c.map(t=>t.join(o)).join(i),u="text/csv;charset="+a;this.exporter.saveFile("iso-8859-15"===a?this.exporter.convertTo8859_15(b):b,n,u)}checkCsvTextSafety(t){return t?'"'+t.replace(/"/g,'""').replace(/(\r\n\t|\n|\r\t)/gm,"")+'"':""}capitalizeTranslate(t){const e=t.charAt(0).toUpperCase()+t.slice(1);return this.translate.instant(e)}dummyCSVExport(t,e,n){const i=this.config.instant("general_csv_separator"),o=[t.map(t=>this.translate.instant(t)).join(i)],a=e.map(t=>t.map(t=>{let e="";return t||(e=""),e="number"==typeof t?t.toString(10):"boolean"==typeof t?t?"1":"0":t,this.checkCsvTextSafety(e)}).join(i)),c=o.concat(a).join("\r\n"),s=this.config.instant("general_csv_encoding");this.exporter.saveFile("iso-8859-15"===s?this.exporter.convertTo8859_15(c):c,n,"text/csv")}}return t.\u0275fac=function(e){return new(e||t)(a.dc(c),a.dc(s.k),a.dc(i.a))},t.\u0275prov=a.Pb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},ePZ9:function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var i=n("pSLD"),o=n("+B0n"),a=n("dOok"),c=n("+KbT"),s=n("1NkQ"),r=n("a9XT"),l=n("rHPv"),b=n("jDC6"),u=n("3Y4h"),d=n("fXoL"),h=n("sYmb");let g=(()=>{class t{constructor(t,e,n,i,o,a,c){this.csvExport=t,this.translate=e,this.configService=n,this.linenumberingService=i,this.changeRecoRepo=o,this.motionRepo=a,this.commentRepo=c}createText(t,e){const n=this.configService.instant("motions_line_length"),i=Object.assign([],this.changeRecoRepo.getChangeRecoOfMotion(t.id)),o=this.motionRepo.getAmendmentsInstantly(t.id);if(o)for(const c of o){const t=this.changeRecoRepo.getChangeRecoOfMotion(c.id).filter(t=>t.showInFinalView()),e=this.motionRepo.getAmendmentAmendedParagraphs(c,n,t);for(const n of e)i.push(n)}i.sort((t,e)=>t.getLineFrom()-e.getLineFrom());const a=this.motionRepo.formatMotion(t.id,e,i,n);return this.linenumberingService.stripLineNumbers(a)}exportMotionList(t,e,n,i){i||(i=this.configService.instant("motions_recommendation_text_mode"));const o=Object(u.j)(["identifier","title"].concat(e)).map(t=>"recommendation"===t?{label:"recommendation",map:t=>this.motionRepo.getExtendedRecommendationLabel(t)}:"state"===t?{label:"state",map:t=>this.motionRepo.getExtendedStateLabel(t)}:"text"===t?{label:"Text",map:t=>this.createText(t,i)}:"motion_block"===t?{label:"Motion block",map:t=>t.motion_block?t.motion_block.getTitle():""}:{property:t});o.push(...n.map(t=>({label:this.commentRepo.getViewModel(t).getTitle(),map:e=>{const n=this.commentRepo.getViewModel(t),i=e.getCommentForSection(n);return i&&i.comment?Object(l.a)(Object(b.a)(i.comment)):""}}))),this.csvExport.export(t,o,this.translate.instant("Motions")+".csv")}exportCallList(t){this.csvExport.export(t,[{label:"Called",map:t=>t.sort_parent_id?"":t.identifierOrTitle},{label:"Called with",map:t=>t.sort_parent_id?t.identifierOrTitle:""},{label:"submitters",map:t=>t.submittersAsUsers.map(t=>t.short_name).join(",")},{property:"title"},{label:"recommendation",map:t=>t.recommendation?this.motionRepo.getExtendedRecommendationLabel(t):""},{property:"motion_block",label:"Motion block"}],this.translate.instant("Call list")+".csv")}exportDummyMotion(){this.csvExport.dummyCSVExport(["Identifier","Submitters","Title","Text","Reason","Category","Tags","Motion block","Origin"],[["A1","Submitter A","Title 1","Text 1","Reason 1","Category A","Tag 1, Tag 2","Block A","Last Year Conference A"],["B1","Submitter B","Title 2","Text 2","Reason 2","Category B",null,"Block A","Origin B"],["C2",null,"Title 3","Text 3",null,null,null,null,null]],this.translate.instant("motions-example")+".csv")}}return t.\u0275fac=function(e){return new(e||t)(d.dc(s.a),d.dc(h.k),d.dc(c.a),d.dc(r.a),d.dc(i.a),d.dc(a.a),d.dc(o.a))},t.\u0275prov=d.Pb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},mksl:function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var i=n("fXoL"),o=n("VR2Q"),a=n("7dBR"),c=n("gsQk"),s=n("KL36"),r=n("tyNb"),l=n("/t3+"),b=n("ofXK"),u=n("bTqV"),d=n("NFeN"),h=n("Qu3c"),g=n("sYmb");function p(t,e){if(1&t){const t=i.ac();i.Zb(0,"button",12),i.hc("click",(function(){return i.Ic(t),i.lc().clickHamburgerMenu()})),i.Zb(1,"mat-icon"),i.Sc(2,"menu"),i.Yb(),i.Yb()}}function m(t,e){if(1&t){const t=i.ac();i.Zb(0,"button",12),i.hc("click",(function(){return i.Ic(t),i.lc().onBackButton()})),i.Zb(1,"mat-icon"),i.Sc(2,"arrow_back"),i.Yb(),i.Yb()}}function f(t,e){if(1&t){const t=i.ac();i.Zb(0,"button",12),i.hc("click",(function(){i.Ic(t);const e=i.lc();return e.isCancelEditUsed?e.sendCancelEditEvent():e.sendMainEvent()})),i.Zb(1,"mat-icon"),i.Sc(2,"close"),i.Yb(),i.Yb()}}function v(t,e){1&t&&(i.Zb(0,"div",13),i.rc(1,1),i.Yb())}function x(t,e){1&t&&i.Ub(0,"div",6)}function C(t,e){1&t&&(i.Zb(0,"div",14),i.rc(1,2),i.Yb())}function M(t,e){if(1&t){const t=i.ac();i.Zb(0,"button",12),i.hc("click",(function(){return i.Ic(t),i.lc().openSearch()})),i.Zb(1,"mat-icon"),i.Sc(2,"search"),i.Yb(),i.Yb()}}function S(t,e){if(1&t){const t=i.ac();i.Zb(0,"button",15),i.hc("click",(function(){return i.Ic(t),i.lc().sendMainEvent()})),i.mc(1,"translate"),i.Zb(2,"mat-icon"),i.Sc(3),i.Yb(),i.Yb()}if(2&t){const t=i.lc();i.uc("matTooltip",i.nc(1,3,t.mainActionTooltip)),i.tc("disabled",!t.isMainButtonEnabled),i.Gb(3),i.Tc(t.mainButtonIcon)}}function T(t,e){if(1&t){const t=i.ac();i.Zb(0,"button",16),i.hc("click",(function(){return i.Ic(t),i.lc().save()})),i.Zb(1,"strong",17),i.Sc(2),i.mc(3,"translate"),i.Yb(),i.Yb()}if(2&t){const t=i.lc();i.tc("disabled",!t.isSaveButtonEnabled),i.Gb(2),i.Tc(i.nc(3,2,t.saveText))}}function y(t,e){1&t&&i.rc(0,3,["*ngIf","!editMode"])}function O(t,e){1&t&&(i.Zb(0,"mat-icon"),i.Sc(1," add "),i.Yb())}function k(t,e){if(1&t&&(i.Zb(0,"mat-icon"),i.Sc(1),i.Yb()),2&t){const t=i.lc(2);i.Gb(1),i.Uc(" ",t.mainButtonIcon," ")}}function F(t,e){if(1&t){const t=i.ac();i.Zb(0,"button",18),i.hc("click",(function(){return i.Ic(t),i.lc().sendMainEvent()})),i.mc(1,"translate"),i.Qc(2,O,2,0,"mat-icon",10),i.Qc(3,k,2,1,"mat-icon",10),i.Yb()}if(2&t){const t=i.lc();i.uc("matTooltip",i.nc(1,4,t.mainActionTooltip)),i.tc("disabled",!t.isMainButtonEnabled),i.Gb(2),i.tc("ngIf","add_circle"===t.mainButtonIcon),i.Gb(1),i.tc("ngIf","add_circle"!==t.mainButtonIcon)}}const Y=[[["",8,"extra-controls-slot"]],[["",8,"title-slot"]],[["",8,"central-info-slot"]],[["",8,"menu-slot"]]],Z=[".extra-controls-slot",".title-slot",".central-info-slot",".menu-slot"];let E=(()=>{class t{constructor(t,e,n,o,a,c){this.vp=t,this.menu=e,this.router=n,this.route=o,this.routingState=a,this.overlayService=c,this.nav=!0,this.mainButtonIcon="add_circle",this.saveText="Save",this.editMode=!1,this.isSearchEnabled=!0,this.isSaveButtonEnabled=!0,this.multiSelectMode=!1,this.hasMainButton=!1,this.isMainButtonEnabled=!0,this.goBack=!1,this.prevUrl="../",this.mainEvent=new i.p,this.cancelEditEvent=new i.p,this.isCancelEditUsed=!1,this.saveEvent=new i.p}get showBackButton(){return!this.nav&&!this.multiSelectMode&&(this.routingState.isSafePrevUrl||!this.goBack)}ngOnInit(){this.isCancelEditUsed=this.cancelEditEvent.observers.length>0}sendMainEvent(){this.mainEvent.next()}sendCancelEditEvent(){this.cancelEditEvent.next()}clickHamburgerMenu(){this.menu.toggleMenu()}save(){this.saveEvent.next(!0)}openSearch(){this.overlayService.showSearch()}onBackButton(){this.goBack?this.routingState.goBack():this.router.navigate(this.routingState.customOrigin&&this.routingState.customOrigin!==this.router.url?[this.routingState.customOrigin]:[this.prevUrl],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(i.Tb(s.a),i.Tb(o.a),i.Tb(r.f),i.Tb(r.a),i.Tb(c.a),i.Tb(a.a))},t.\u0275cmp=i.Nb({type:t,selectors:[["os-head-bar"]],inputs:{nav:"nav",mainButtonIcon:"mainButtonIcon",saveText:"saveText",editMode:"editMode",isSearchEnabled:"isSearchEnabled",isSaveButtonEnabled:"isSaveButtonEnabled",multiSelectMode:"multiSelectMode",hasMainButton:"hasMainButton",isMainButtonEnabled:"isMainButtonEnabled",goBack:"goBack",prevUrl:"prevUrl",mainActionTooltip:"mainActionTooltip"},outputs:{mainEvent:"mainEvent",cancelEditEvent:"cancelEditEvent",saveEvent:"saveEvent"},ngContentSelectors:Z,decls:16,vars:12,consts:[["color","primary",1,"sticky-toolbar",3,"ngClass"],[1,"toolbar-left"],["mat-icon-button","",3,"click",4,"ngIf"],["class","toolbar-left-text",4,"ngIf"],["class","spacer",4,"ngIf"],["class","toolbar-centered",4,"ngIf"],[1,"spacer"],[1,"toolbar-right"],["mat-icon-button","",3,"disabled","matTooltip","click",4,"ngIf"],["mat-button","",3,"disabled","click",4,"ngIf"],[4,"ngIf"],["mat-fab","","class","head-button",3,"disabled","matTooltip","click",4,"ngIf"],["mat-icon-button","",3,"click"],[1,"toolbar-left-text"],[1,"toolbar-centered"],["mat-icon-button","",3,"disabled","matTooltip","click"],["mat-button","",3,"disabled","click"],[1,"upper"],["mat-fab","",1,"head-button",3,"disabled","matTooltip","click"]],template:function(t,e){1&t&&(i.sc(Y),i.Zb(0,"mat-toolbar",0),i.Zb(1,"div",1),i.Qc(2,p,3,0,"button",2),i.Qc(3,m,3,0,"button",2),i.Qc(4,f,3,0,"button",2),i.Qc(5,v,2,0,"div",3),i.Yb(),i.Qc(6,x,1,0,"div",4),i.Qc(7,C,2,0,"div",5),i.Ub(8,"div",6),i.Qc(9,M,3,0,"button",2),i.Zb(10,"div",7),i.rc(11),i.Qc(12,S,4,5,"button",8),i.Qc(13,T,4,4,"button",9),i.Qc(14,y,1,0,void 0,10),i.Yb(),i.Yb(),i.Qc(15,F,4,6,"button",11)),2&t&&(i.tc("ngClass",e.multiSelectMode?"multi-select":""),i.Gb(2),i.tc("ngIf",e.vp.isMobile&&!e.showBackButton&&!e.editMode),i.Gb(1),i.tc("ngIf",e.showBackButton&&!e.editMode),i.Gb(1),i.tc("ngIf",e.editMode),i.Gb(1),i.tc("ngIf",!e.multiSelectMode),i.Gb(1),i.tc("ngIf",!e.multiSelectMode),i.Gb(1),i.tc("ngIf",e.multiSelectMode),i.Gb(2),i.tc("ngIf",!e.editMode&&e.isSearchEnabled),i.Gb(3),i.tc("ngIf",e.hasMainButton&&!e.editMode&&!e.vp.isMobile&&!e.multiSelectMode),i.Gb(1),i.tc("ngIf",e.editMode),i.Gb(1),i.tc("ngIf",!e.editMode),i.Gb(1),i.tc("ngIf",e.hasMainButton&&!e.editMode&&e.vp.isMobile&&!e.multiSelectMode))},directives:[l.a,b.q,b.t,u.b,d.a,h.c],pipes:[g.j],styles:[".head-button{position:fixed;z-index:10;right:20px;bottom:55px}.sticky-toolbar{top:0;z-index:5;position:-webkit-sticky;position:sticky;height:64px!important}.sticky-toolbar .toolbar-left{display:-ms-flexbox;display:flex;max-width:calc(100% - 100px)}.sticky-toolbar .toolbar-left button{margin:12px 0}.sticky-toolbar .toolbar-left .toolbar-left-text{margin-left:10px;width:100%;overflow:hidden}.sticky-toolbar .toolbar-left .toolbar-left-text .title-slot{margin:16px 0;display:block}.sticky-toolbar .toolbar-left .toolbar-left-text .title-slot h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sticky-toolbar .toolbar-centered{margin:auto;vertical-align:baseline}.sticky-toolbar .toolbar-right,.sticky-toolbar .toolbar-right .extra-controls-slot{display:-ms-flexbox;display:flex}mat-toolbar.multi-select{background-color:#757575!important}"],encapsulation:2}),t})()},rHPv:function(t,e,n){"use strict";function i(t){return t.replace(/&auml;|&#228;/g,"\xe4").replace(/&Auml;|&#196;/g,"\xc4").replace(/&ouml;|&#246;/g,"\xf6").replace(/&Ouml;|&#214;/g,"\xd6").replace(/&uuml;/g,"\xfc").replace(/&Uuml;/g,"\xdc").replace(/&aring;|&#229;/g,"\xe5").replace(/&Aring;|&#197;/g,"\xc5").replace(/&szlig;|&#223;/g,"\xdf")}n.d(e,"a",(function(){return i}))},ssNq:function(t,e,n){"use strict";n.r(e),n.d(e,"CallListModule",(function(){return j}));var i=n("ofXK"),o=n("PCNd"),a=n("tyNb"),c=n("+QJK"),s=n("mrSG"),r=n("2Vo4"),l=n("iTQr"),b=n("dOok"),u=n("lv9T"),d=n("F48D"),h=n("Qy/R"),g=n("ePZ9"),p=n("y50V"),m=n("fXoL"),f=n("jhN1"),v=n("sYmb"),x=n("dNgK"),C=n("mksl"),M=n("bTqV"),S=n("STbY"),T=n("NFeN"),y=n("Wp6s"),O=n("/tkw"),k=n("f0Cb"),F=n("TU8p");function Y(t,e){if(1&t){const t=m.ac();m.Zb(0,"div",17),m.Zb(1,"div"),m.Zb(2,"span"),m.Sc(3),m.mc(4,"translate"),m.Yb(),m.Sc(5,":\xa0 "),m.Yb(),m.Zb(6,"div"),m.Zb(7,"button",18),m.hc("click",(function(){return m.Ic(t),m.lc().resetFilters()})),m.Zb(8,"mat-icon",19),m.Sc(9,"cancel"),m.Yb(),m.Zb(10,"span"),m.Sc(11),m.mc(12,"translate"),m.Yb(),m.Yb(),m.Yb(),m.Yb()}2&t&&(m.Gb(3),m.Tc(m.nc(4,2,"Active filters")),m.Gb(8),m.Tc(m.nc(12,4,"Clear all")))}function Z(t,e){if(1&t&&(m.Zb(0,"div"),m.Zb(1,"button",20),m.Zb(2,"span",21),m.Sc(3),m.mc(4,"translate"),m.Yb(),m.Yb(),m.Yb()),2&t){const t=m.lc(),e=m.Ec(23);m.Gb(1),m.tc("matMenuTriggerFor",e),m.Gb(1),m.tc("matBadge",t.activeCatFilterCount>0?t.activeCatFilterCount:null)("matBadgeOverlap",!1),m.Gb(1),m.Uc(" ",m.nc(4,4,"Categories")," ")}}function E(t,e){if(1&t&&(m.Zb(0,"div"),m.Zb(1,"button",20),m.Zb(2,"span",21),m.Sc(3),m.mc(4,"translate"),m.Yb(),m.Yb(),m.Yb()),2&t){const t=m.lc(),e=m.Ec(26);m.Gb(1),m.tc("matMenuTriggerFor",e),m.Gb(1),m.tc("matBadge",t.activeTagFilterCount>0?t.activeTagFilterCount:null)("matBadgeOverlap",!1),m.Gb(1),m.Uc(" ",m.nc(4,4,"Tags")," ")}}function _(t,e){1&t&&(m.Zb(0,"mat-icon"),m.Sc(1,"checked"),m.Yb())}function w(t,e){if(1&t){const t=m.ac();m.Zb(0,"div"),m.Zb(1,"button",16),m.hc("click",(function(){m.Ic(t);const n=e.$implicit;return m.lc().onFilterChange("category",n.id)})),m.Qc(2,_,2,0,"mat-icon",8),m.Zb(3,"span"),m.Sc(4),m.Yb(),m.Yb(),m.Yb()}if(2&t){const t=e.$implicit;m.Gb(2),m.tc("ngIf",t.state),m.Gb(2),m.Tc(t.label)}}function B(t,e){1&t&&(m.Zb(0,"mat-icon"),m.Sc(1,"checked"),m.Yb())}function I(t,e){if(1&t){const t=m.ac();m.Zb(0,"div"),m.Zb(1,"button",16),m.hc("click",(function(){m.Ic(t);const n=e.$implicit;return m.lc().onFilterChange("tag",n.id)})),m.Qc(2,B,2,0,"mat-icon",8),m.Zb(3,"span"),m.Sc(4),m.Yb(),m.Yb(),m.Yb()}if(2&t){const t=e.$implicit;m.Gb(2),m.tc("ngIf",t.state),m.Gb(2),m.Tc(t.label)}}function G(t,e){if(1&t&&(m.Zb(0,"span"),m.Zb(1,"mat-icon",19),m.Sc(2,"local_offer"),m.Yb(),m.Sc(3),m.Yb()),2&t){const t=e.$implicit;m.Gb(3),m.Uc(" ",t.getTitle()," ")}}function P(t,e){if(1&t&&(m.Zb(0,"div",22),m.Zb(1,"div",23),m.Sc(2),m.Yb(),m.Zb(3,"div",24),m.Qc(4,G,4,1,"span",10),m.Yb(),m.Yb()),2&t){const t=e.item,n=m.lc();m.Gb(2),m.Uc(" ",t.getTitle()," "),m.Gb(2),m.tc("ngForOf",n.getTags(t))}}const R=[{path:"",component:(()=>{class t extends h.a{constructor(t,e,n,i,o,a,c,s,l){super(t,e,n,l),this.translate=e,this.motionRepo=i,this.motionCsvExport=o,this.motionPdfExport=a,this.tagRepo=c,this.categoryRepo=s,this.motions=[],this.hasChanged=!1,this.tagFilterOptions=[],this.activeTagFilterCount=0,this.categoryFilterOptions=[],this.activeCatFilterCount=0,this.activeTagFilters=new r.a([]),this.activeCatFilters=new r.a([]),this.motionsObservable=this.motionRepo.getViewModelListObservable(),this.motionsObservable.subscribe(t=>{this.motions=t.map(t=>t).sort((t,e)=>t.weight-e.weight)})}ngOnInit(){this.subscriptions.push(this.activeTagFilters.subscribe(t=>this.onSubscribedFilterChange("tag",t))),this.subscriptions.push(this.activeCatFilters.subscribe(t=>this.onSubscribedFilterChange("category",t))),this.subscriptions.push(this.tagRepo.getViewModelListBehaviorSubject().subscribe(t=>{t&&t.length?(this.tagFilterOptions=t.map(t=>({label:t.name,id:t.id,state:this.tagFilterOptions&&this.tagFilterOptions.some(e=>e.id===t.id&&!0===e.state)})),this.tagFilterOptions.push({label:this.translate.instant("No tags"),id:0,state:this.tagFilterOptions&&this.tagFilterOptions.some(t=>0===t.id&&!0===t.state)})):this.tagFilterOptions=[]})),this.subscriptions.push(this.categoryRepo.getViewModelListBehaviorSubject().subscribe(t=>{t&&t.length?(this.categoryFilterOptions=t.map(t=>({label:t.prefixedName,id:t.id,state:this.categoryFilterOptions&&this.categoryFilterOptions.some(e=>e.id===t.id&&!0===e.state)})),this.categoryFilterOptions.push({label:this.translate.instant("No category"),id:0,state:this.categoryFilterOptions&&this.categoryFilterOptions.some(t=>0===t.id&&!0===t.state)})):this.categoryFilterOptions=[]}))}onSave(){return Object(s.a)(this,void 0,void 0,(function*(){yield this.motionRepo.sortMotions(this.osSortTree.getTreeData()).then(()=>this.osSortTree.setSubscription(),this.raiseError)}))}onCancel(){return Object(s.a)(this,void 0,void 0,(function*(){(yield this.canDeactivate())&&this.osSortTree.setSubscription()}))}receiveChanges(t){this.hasChanged=t}csvExportCallList(){this.motionCsvExport.exportCallList(this.motions)}pdfExportCallList(){this.motionPdfExport.exportPdfCallList(this.motions)}getTags(t){const e=this.motionRepo.getViewModel(t.id);return e?e.tags:[]}onFilterChange(t,e){const n="tag"===t?this.activeTagFilters.value:this.activeCatFilters.value;n.includes(e)?n.splice(n.indexOf(e),1):n.push(e),"tag"===t?this.activeTagFilters.next(n):this.activeCatFilters.next(n)}resetFilters(){this.activeTagFilters.next([]),this.activeCatFilters.next([])}sortMotionsByIdentifier(){return Object(s.a)(this,void 0,void 0,(function*(){const t=this.translate.instant("Do you really want to go ahead?"),e=this.translate.instant("This will reset all made changes and sort the call list.");(yield this.promptService.open(t,e))&&this.forceSort.emit("identifier")}))}onSubscribedFilterChange(t,e){"tag"===t?(this.activeTagFilterCount=e.length,this.tagFilterOptions.forEach(t=>{t.state=e&&e.some(e=>e===t.id)})):(this.activeCatFilterCount=e.length,this.categoryFilterOptions.forEach(t=>{t.state=e&&e.some(e=>e===t.id)})),this.hasActiveFilter=this.activeCatFilterCount>0||this.activeTagFilterCount>0;const n=this.tagFilterOptions.filter(t=>!0===t.state),i=this.categoryFilterOptions.filter(t=>!0===t.state);this.changeFilter.emit(t=>{if(n.length)if(t.tags&&t.tags.length){if(!t.tags.some(t=>n.some(e=>e.id===t.id)))return!0}else if(!n.some(t=>0===t.id))return!0;if(i.length){const e=t.category_id||0;return!i.some(t=>t.id===e)}return!1})}}return t.\u0275fac=function(e){return new(e||t)(m.Tb(f.d),m.Tb(v.k),m.Tb(x.a),m.Tb(b.a),m.Tb(g.a),m.Tb(p.a),m.Tb(u.a),m.Tb(l.a),m.Tb(d.a))},t.\u0275cmp=m.Nb({type:t,selectors:[["os-call-list"]],features:[m.Db],decls:54,vars:28,consts:[["prevUrl","../..",3,"nav","editMode","mainEvent","saveEvent"],[1,"title-slot"],[1,"menu-slot"],["type","button","mat-icon-button","",3,"matMenuTriggerFor"],[1,"custom-table-header","flex-spaced"],[1,"filter-count"],["class","current-filters",4,"ngIf"],[1,"flex-spaced","margin-right-5"],[4,"ngIf"],["catFilterMenu","matMenu"],[4,"ngFor","ngForOf"],["tagFilterMenu","matMenu"],["parentKey","sort_parent_id","weightKey","weight",3,"model","filterChange","sortingDefinition","visibleNodes","hasChanged"],["osSortedTree",""],["innerNode",""],["mainMenu","matMenu"],["mat-menu-item","",3,"click"],[1,"current-filters"],["mat-button","",3,"click"],["inline",""],["mat-button","",3,"matMenuTriggerFor"],["matBadgeColor","accent",1,"upper",3,"matBadge","matBadgeOverlap"],[1,"line"],[1,"left"],[1,"right"]],template:function(t,e){if(1&t&&(m.Zb(0,"os-head-bar",0),m.hc("mainEvent",(function(){return e.onCancel()}))("saveEvent",(function(){return e.onSave()})),m.Zb(1,"div",1),m.Zb(2,"h2"),m.Sc(3),m.mc(4,"translate"),m.Yb(),m.Yb(),m.Zb(5,"div",2),m.Zb(6,"button",3),m.Zb(7,"mat-icon"),m.Sc(8,"more_vert"),m.Yb(),m.Yb(),m.Yb(),m.Yb(),m.Zb(9,"div",4),m.Zb(10,"div",5),m.Zb(11,"span"),m.Sc(12),m.Yb(),m.Zb(13,"span"),m.Sc(14),m.mc(15,"translate"),m.Yb(),m.Zb(16,"span"),m.Sc(17),m.Yb(),m.Yb(),m.Qc(18,Y,13,6,"div",6),m.Zb(19,"div",7),m.Qc(20,Z,5,6,"div",8),m.Qc(21,E,5,6,"div",8),m.Yb(),m.Yb(),m.Zb(22,"mat-menu",null,9),m.Qc(24,w,5,2,"div",10),m.Yb(),m.Zb(25,"mat-menu",null,11),m.Qc(27,I,5,2,"div",10),m.Yb(),m.Zb(28,"mat-card"),m.Zb(29,"os-sorting-tree",12,13),m.hc("visibleNodes",(function(t){return e.onChangeAmountOfItems(t)}))("hasChanged",(function(t){return e.receiveChanges(t)})),m.Qc(31,P,5,2,"ng-template",null,14,m.Rc),m.Yb(),m.Yb(),m.Zb(33,"mat-menu",null,15),m.Zb(35,"button",16),m.hc("click",(function(){return e.sortMotionsByIdentifier()})),m.Zb(36,"mat-icon"),m.Sc(37,"sort"),m.Yb(),m.Zb(38,"span"),m.Sc(39),m.mc(40,"translate"),m.Yb(),m.Yb(),m.Ub(41,"mat-divider"),m.Zb(42,"button",16),m.hc("click",(function(){return e.pdfExportCallList()})),m.Zb(43,"mat-icon"),m.Sc(44,"picture_as_pdf"),m.Yb(),m.Zb(45,"span"),m.Sc(46),m.mc(47,"translate"),m.Yb(),m.Yb(),m.Zb(48,"button",16),m.hc("click",(function(){return e.csvExportCallList()})),m.Zb(49,"mat-icon"),m.Sc(50,"archive"),m.Yb(),m.Zb(51,"span"),m.Sc(52),m.mc(53,"translate"),m.Yb(),m.Yb(),m.Yb()),2&t){const t=m.Ec(34);m.tc("nav",!1)("editMode",e.hasChanged),m.Gb(3),m.Tc(m.nc(4,18,"Call list")),m.Gb(3),m.tc("matMenuTriggerFor",t),m.Gb(6),m.Uc(" ",e.seenNodes[0],"\xa0"),m.Gb(2),m.Tc(m.nc(15,20,"of")),m.Gb(3),m.Uc("\xa0",e.seenNodes[1],""),m.Gb(1),m.tc("ngIf",e.hasActiveFilter),m.Gb(2),m.tc("ngIf",e.categoryFilterOptions.length),m.Gb(1),m.tc("ngIf",e.tagFilterOptions.length),m.Gb(3),m.tc("ngForOf",e.categoryFilterOptions),m.Gb(3),m.tc("ngForOf",e.tagFilterOptions),m.Gb(2),m.tc("model",e.motionsObservable)("filterChange",e.changeFilter)("sortingDefinition",e.forceSort),m.Gb(10),m.Tc(m.nc(40,22,"Sort by identifier")),m.Gb(7),m.Tc(m.nc(47,24,"Export as PDF")),m.Gb(6),m.Tc(m.nc(53,26,"Export as CSV"))}},directives:[C.a,M.b,S.e,T.a,i.t,S.f,i.s,y.a,O.a,S.c,k.a,F.a],pipes:[v.j],styles:[".line[_ngcontent-%COMP%]{display:table;width:100%;font-size:14px;min-height:50px;margin-bottom:5px}.line[_ngcontent-%COMP%]   .left[_ngcontent-%COMP%]{max-width:100%}.line[_ngcontent-%COMP%]   .left[_ngcontent-%COMP%], .line[_ngcontent-%COMP%]   .right[_ngcontent-%COMP%]{display:table-cell;vertical-align:middle}.line[_ngcontent-%COMP%]   .right[_ngcontent-%COMP%]{padding-right:10px;width:auto;white-space:nowrap}.margin-right-5[_ngcontent-%COMP%]{margin-right:5px!important}",".filter-menu-head[_ngcontent-%COMP%]{padding-left:5px}.filter-menu-head[_ngcontent-%COMP%]   .mat-button[_ngcontent-%COMP%]{margin:0 auto}.filter-menu-head[_ngcontent-%COMP%]:hover{cursor:pointer}.action-buttons[_ngcontent-%COMP%]{display:-ms-flexbox;display:flex}.action-buttons[_ngcontent-%COMP%]   os-rounded-input[_ngcontent-%COMP%]{margin:0 10px}@media (max-width:500px){.action-buttons[_ngcontent-%COMP%]   os-rounded-input[_ngcontent-%COMP%]{display:none}}.active-filter[_ngcontent-%COMP%]{white-space:pre}span.right-with-margin[_ngcontent-%COMP%]{margin-right:25px}.filter-count[_ngcontent-%COMP%]{font-style:italic;margin-left:24px;margin-right:5px}.current-filters[_ngcontent-%COMP%]{width:100%;display:-ms-flexbox;display:flex}.current-filters[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:inherit}.current-filters[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{padding:5px;margin:auto 5px;font-size:75%}.current-filters[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{font-size:12px;height:12px;width:12px}"]}),t})(),pathMatch:"full",canDeactivate:[c.a]}];let Q=(()=>{class t{}return t.\u0275mod=m.Rb({type:t}),t.\u0275inj=m.Qb({factory:function(e){return new(e||t)},imports:[[a.j.forChild(R)],a.j]}),t})(),j=(()=>{class t{}return t.\u0275mod=m.Rb({type:t}),t.\u0275inj=m.Qb({factory:function(e){return new(e||t)},imports:[[i.c,Q,o.a]]}),t})()}}]);