1"use strict";(self.webpackChunkabem=self.webpackChunkabem||[]).push([[3642],{53642(O,u,a){var v=this&&this.__createBinding||(Object.create?function(s,r,o,n){void 0===n&&(n=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(s,n,t)}:function(s,r,o,n){void 0===n&&(n=o),s[n]=r[o]}),p=this&&this.__setModuleDefault||(Object.create?function(s,r){Object.defineProperty(s,"default",{enumerable:!0,value:r})}:function(s,r){s.default=r}),l=this&&this.__importStar||function(){var s=function(r){return(s=Object.getOwnPropertyNames||function(o){var n=[];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[n.length]=t);return n})(r)};return function(r){if(r&&r.__esModule)return r;var o={};if(null!=r)for(var n=s(r),t=0;t<n.length;t++)"default"!==n[t]&&v(o,r,n[t]);return p(o,r),o}}();Object.defineProperty(u,"__esModule",{value:!0}),u.ProposalVotesComponent=void 0;const f=a(39050),m=a(60177),e=l(a(49849)),_=l(a(37554)),g=l(a(7901)),b=l(a(43707)),w=l(a(82797)),d=l(a(60177));function x(s,r){if(1&s&&(e.\u0275\u0275elementStart(0,"span",12),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&s){const o=r.$implicit,n=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("ngClass",n.status(o.in_favor)),e.\u0275\u0275advance(),e.\u0275\u0275textInterpolate1(" ",o.full_name," ")}}function C(s,r){if(1&s&&(e.\u0275\u0275elementStart(0,"div",10),e.\u0275\u0275template(1,x,2,2,"span",11),e.\u0275\u0275elementEnd()),2&s){const o=e.\u0275\u0275nextContext();e.\u0275\u0275advance(),e.\u0275\u0275property("ngForOf",o.users)}}u.ProposalVotesComponent=(()=>{class s{api;route;socket;service;in_favor;not_in_favor;unknown;missing;quorum;users;users_map={};event_id;sub_event_id;proposal;events;listener;colors;constructor(o,n,t,i){this.api=o,this.route=n,this.socket=t,this.service=i,this.colors={bg:"#fff",text:"#000",yes:"#0f0",no:"#f00",unknown:"#000",quorum:"#000",missing:"#afafaf"}}get bg_color(){return this.colors.bg}get text_color(){return this.colors.text}get yes_color(){return this.colors.yes}get no_color(){return this.colors.no}get unknown_color(){return this.colors.unknown}get quorum_color(){return this.colors.quorum}get missing_color(){return this.colors.missing}update_user(o,n){let t=this.users_map[o];if(!t)return this.refresh_voters();switch(t.in_favor){case!0:this.in_favor--;break;case!1:this.not_in_favor--;break;default:t.status_id?this.unknown--:(this.missing--,this.quorum++),t.status_id=10}switch(t.in_favor=n,n){case!0:this.in_favor++;break;case!1:this.not_in_favor++}}user_checkin(o){let n=this.users_map[o];if(!n)return this.refresh_voters();n.status_id||(this.missing--,this.unknown++,this.quorum++,n.status_id=10,n.in_favor=null)}ngOnDestroy(){this.socket.leave("assembleia"),this.socket.disconnect(),this.listener.unsubscribe()}ngOnInit(){this.socket.connect(),this.listener=this.socket.listen().subscribe(n=>{switch(n.event){case"update-user":return this.update_user(n.data.user_id,n.data.in_favor);case"checkin":return this.user_checkin(n.data.user_id);case"settings":return void(this.colors=n.data.colors);case"reload":return this.refresh();case"vote-closed":return this.proposal.is_open=!1,this.refresh_voters();case"connection-established":case"connection-reloaded":this.socket.join("assembleia"),this.refresh();break;case"disconnected":console.log("Connection lost"),setTimeout(()=>{this.socket.connect()},3e3)}}),this.proposal=new f.Proposals,this.users=[],this.in_favor=0,this.not_in_favor=0,this.unknown=0,this.missing=0,this.events={};const o=this.route.snapshot.params;this.event_id=o.event,this.sub_event_id=o.sub_event,this.load_config()}load_config(){this.api.recover("proposals/settings",{event_id:this.event_id,sub_event_id:this.sub_event_id}).subscribe(o=>{this.users=o.users,this.colors=o.colors;let n=0,t=0;for(let i of this.users)this.users_map[i.user_id]=i,i.status_id?(t++,i.in_favor=null):n++;this.missing=n,this.unknown=t,this.quorum=t})}refresh_voters(){this.service.update_votes(this.proposal).then(o=>{let n=0,t=0,i=0,h=0;for(let c of o)switch(this.users_map[c.user_id]=c,c.in_favor){case!0:n++;break;case!1:t++;break;default:c.status_id?(h++,c.in_favor=null):i++}this.in_favor=n,this.missing=i,this.not_in_favor=t,this.unknown=h,this.quorum=n+t+h,this.users=o})}status(o){switch(o){case!0:return"in-favor";case!1:return"not-in-favor";case null:return"unknown";case void 0:return"missing"}}refresh(){this.api.recover("proposals/:event_id/:sub_event_id/active",{event_id:this.event_id,sub_event_id:this.sub_event_id}).subscribe(o=>{this.proposal=o,this.refresh_voters()},o=>{console.error(o.error)})}static \u0275fac=function(n){return new(n||s)(e.\u0275\u0275directiveInject(_.ApiService),e.\u0275\u0275directiveInject(g.ActivatedRoute),e.\u0275\u0275directiveInject(b.SocketService),e.\u0275\u0275directiveInject(w.ProposalsService))};static \u0275cmp=e.\u0275\u0275defineComponent({type:s,selectors:[["app-proposal-votes"]],hostVars:14,hostBindings:function(n,t){2&n&&e.\u0275\u0275styleProp("--bg-color",t.bg_color)("--text-color",t.text_color)("--yes-color",t.yes_color)("--no-color",t.no_color)("--unknown-color",t.unknown_color)("--quorum-color",t.quorum_color)("--missing-color",t.missing_color)},decls:23,vars:8,consts:[[1,"host"],[1,"row"],[1,"col-md-12","text-center"],[1,"vote-counter"],[1,"quorum"],[1,"in-favor"],[1,"not-in-favor"],[1,"unknown"],[1,"missing"],["class","voters",4,"ngIf"],[1,"voters"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"]],template:function(n,t){1&n&&(e.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1"),e.\u0275\u0275text(4," Vota\xe7\xe3o "),e.\u0275\u0275elementStart(5,"strong"),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(7,"div",1)(8,"div",2)(9,"h2"),e.\u0275\u0275text(10),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(11,"div",3)(12,"span",4),e.\u0275\u0275text(13),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"span",5),e.\u0275\u0275text(15),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"span",6),e.\u0275\u0275text(17),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"span",7),e.\u0275\u0275text(19),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(20,"span",8),e.\u0275\u0275text(2
11),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(22,C,2,1,"div",9),e.\u0275\u0275elementEnd()),2&n&&(e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate(null!=t.proposal&&t.proposal.is_open?"ABERTA":"ENCERRADA"),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",null==t.proposal?null:t.proposal.proposal," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1("QU\xd3RUM: ",t.quorum),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("SIM: ",t.in_favor),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("N\xc3O: ",t.not_in_favor),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("ABSTEN\xc7\xc3O: ",t.unknown),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("AUSENTE: ",t.missing),e.\u0275\u0275advance(),e.\u0275\u0275property("ngIf",t.users))},dependencies:[m.CommonModule,d.NgClass,d.NgForOf,d.NgIf],styles:["[_nghost-%COMP%]{--padding-boxes: 10px;--width: 15%;font-size:38px;color:var(--text-color)}.host[_ngcontent-%COMP%]{background-color:var(--bg-color)}h1[_ngcontent-%COMP%], h2[_ngcontent-%COMP%]{font-size:40px}.in-favor[_ngcontent-%COMP%]{border:4px solid var(--yes-color);color:var(--yes-color);padding:var(--padding-boxes);max-width:var(--width);min-width:var(--width)}.not-in-favor[_ngcontent-%COMP%]{border:4px solid var(--no-color);color:var(--no-color);padding:var(--padding-boxes);max-width:var(--width);min-width:var(--width)}.quorum[_ngcontent-%COMP%]{border:4px solid var(--quorum-color);color:var(--quorum-color);padding:var(--padding-boxes);max-width:var(--width);min-width:var(--width)}.unknown[_ngcontent-%COMP%]{border:4px solid var(--unknown-color);color:var(--unknown-color);padding:var(--padding-boxes);max-width:var(--width);min-width:var(--width)}.missing[_ngcontent-%COMP%]{border:4px solid var(--missing-color);color:var(--missing-color);padding:var(--padding-boxes);max-width:var(--width);min-width:var(--width)}.vote-counter[_ngcontent-%COMP%]{width:100%;display:flex;-moz-column-gap:2em;column-gap:2em;justify-content:center}.voters[_ngcontent-%COMP%]{margin-top:2em;margin-bottom:2em;width:100%;display:flex;-moz-column-gap:1em;column-gap:1em;row-gap:1em;flex-wrap:wrap;flex-direction:row;max-height:90vh;overflow:scroll;max-width:100vw;justify-content:center}"]})}return s})()}}]);
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.