1import{a as F}from"./chunk-QW7W6KB3.js";import{$ as _,Ad as ue,Bc as te,Cc as ie,Cd as ce,D as b,Ea as T,Ec as oe,F as B,G as N,Gd as ge,Gf as Pe,H as U,Ic as ne,Ih as Ae,J as m,Ja as p,Jc as le,Jd as fe,K as u,La as A,Lc as ae,Mc as re,Md as _e,Mg as Me,Nc as se,Ng as Ie,Pa as w,Qa as y,Qe as x,Ra as C,Re as E,Tc as de,Td as he,W as r,Xa as S,Yd as ve,Zg as De,_d as we,_h as Ve,a as O,ah as ke,b as j,ba as G,bc as K,bh as Te,ca as H,dc as X,ge as ye,hc as Z,ia as L,ie as Ce,ja as M,jd as pe,je as D,ka as Q,lb as J,ma as Y,na as z,ne as Se,oa as c,pa as o,pd as me,qa as a,ra as I,rc as $,va as P,wc as ee,wf as be,xa as h,xc as V,xg as Le,ya as v}from"./chunk-N2ASVLBJ.js";var W=()=>({multi:!0,grow:!0,gap:!0}),q=()=>({grow:!0});function Re(s,n){if(s&1){let f=P();o(0,"button",25),h("click",function(){m(f);let i=v(3);return u(i.poll.answerList.pop())}),o(1,"mat-icon"),p(2,"remove"),a()()}}function Oe(s,n){if(s&1){let f=P();L(0,Re,3,0,"button",23),o(1,"button",24),h("click",function(){m(f);let i=v().$index,e=v();return u(e.poll.answerList.push({key:i+2,value:""}))}),o(2,"mat-icon"),p(3,"add"),a()()}if(s&2){let f=v(2);M(f.poll.answerList.length>2?0:-1)}}function je(s,n){if(s&1){let f=P();o(0,"div",4)(1,"div",5)(2,"mat-form-field")(3,"input",22),C("ngModelChange",function(i){let e=m(f).$index,d=v();return y(d.poll.answerList[e].value,i)||(d.poll.answerList[e].value=i),u(i)}),a(),o(4,"mat-label"),p(5),a()(),L(6,Oe,4,1),a()()}if(s&2){let f=n.$index,t=n.$index,i=n.$count,e=v();r(),c("filterPanelCellOptions",S(4,W)),r(2),w("ngModel",e.poll.answerList[f].value),r(2),A("Answer ",f+1),r(),M(t===i-1?6:-1)}}function Be(s,n){s&1&&(o(0,"aside",21),I(1,"side-ad")(2,"side-column-toggle"),a())}var R=(()=>{let n=class n{constructor(t,i,e,d,g,l,Fe,qe){this.device=t,this.router=i,this.route=e,this.dataService=d,this.dialog=g,this.paramService=l,this.toast=Fe,this.changeDetector=qe,this.poll={displayTypeId:"1",answerList:[{key:1,value:""},{key:2,value:""}],endDate:V.now().plus({days:10})},this.subs=[]}ngOnInit(){this.paramMap=this.paramService.getEmpty(),this.subs.push(this.route.data.pipe(b(({leagueId:t})=>this.setLeagueId(t)),b(()=>this.paramService.setParams(this.route.snapshot,this.paramMap)),b(({fantasyInfo:t})=>t&&this.setFantasyInfo(t)),b(({data:t})=>t&&this.setData(t)),Ce()).subscribe(),this.device.deviceType$.subscribe(t=>{this.isDesktop=t===he.Desktop,this.changeDetector.markForCheck()}))}ngOnDestroy(){this.subs.forEach(t=>t.unsubscribe&&t.unsubscribe())}setLeagueId(t){this.leagueId&&this.leagueId!==t?(this.leagueId=t,this.backToPollList()):this.leagueId=t}setFantasyInfo({fantasySettings:t}){this.fantasySettings=t}setData({getLeaguePolls:t}){let i=t.leaguePolls,e=i&&i[0];e?(this.poll={displayTypeId:e.displayTypeId,question:e.question,multiAnswer:e.multiAnswer,answerList:e.answerList,pollId:e.id,voteRequired:e.voteRequired,anonymous:e.anonymous,endDate:V.fromMillis(e.endDate)},this.originalPoll=e,this.changeDetector.markForCheck()):(this.toast.warn("Poll not found","This poll has been deleted."),this.backToPollList())}savePoll(t){this.isSubmitted=!0;let i=j(O({},this.poll),{endDate:this.poll.endDate.toUTC().toISO(),hidePoll:!t});this.subs.push(this.dataService.createRequest("setLeaguePoll",i,{leagueId:this.leagueId}).subscribe(({pollId:e})=>{e&&this.router.navigate(["/fantasy/league",this.leagueId,"poll","all"])}))}backToPollList(){this.router.navigate(we.LEAGUE_POLLS(this.leagueId))}updateTime(t){this.poll.endDate=this.poll.endDate.set({hour:t.hoursNum,minute:t.minutesNum})}confirmUnsavedChanges(){let t=this.poll.question,i=this.poll.answerList[0].value,e=this.poll.answerList[1].value;return!this.isSubmitted&&(t||i||e)&&(!this.originalPoll||this.originalPoll.question!==t||this.originalPoll.answers[1]!==i||this.originalPoll.answers[2]!==e)?this.dialog.open(Le,{id:"navigation-dialog",width:"36rem",disableClose:!0,data:{text:"Your poll is not saved. Are you sure you want to leave this page and discard this poll?"}}).afterClosed():!0}};n.\u0275fac=function(i){return new(i||n)(_(ve),_(fe),_(ge),_(D),_(pe),_(Pe),_(ye),_(J))},n.\u0275cmp=G({type:n,selectors:[["app-league-poll-add"]],hostAttrs:[1,"content","content--mobile-bottom-sp
1acing","content--hidable-ad-column","league-poll-add"],standalone:!1,decls:58,vars:27,consts:[["datepicker2",""],[3,"title","fantasySettings"],["tabindex","-1",1,"content__main"],[1,"fx-layout__pane","filter-panel"],["filter-panel-row",""],["filter-panel-cell","",3,"filterPanelCellOptions"],[3,"ngModelChange","ngModel"],["value","1"],["value","2"],["value","3"],["matInput","",3,"focus","ngModelChange","matDatepicker","ngModel"],["matSuffix","",3,"for"],[3,"change","showSeconds","time"],[1,"form-group__field"],[1,"form-group__field__label"],[1,"form-group__field__label__details"],[1,"form-group__cell--right",3,"ngModelChange","ngModel"],["placeholder","Poll question...",1,"fx-layout__pane--bare",3,"change","leagueId","standalone","html"],[1,"button-group"],["mat-flat-button","","color","sport--shadow","loadButton","setLeaguePoll",1,"button--xl",3,"click"],["mat-flat-button","","color","sport-fill--shadow","loadButton","setLeaguePoll",1,"button--xl",3,"click","disabled"],[1,"content__column","content__column--sticky"],["matInput","","name","subject","maxlength","500",3,"ngModelChange","ngModel"],["mat-icon-button","","color","red--fill",1,"button--lg"],["mat-icon-button","","color","sport--fill",1,"button--lg",3,"click"],["mat-icon-button","","color","red--fill",1,"button--lg",3,"click"]],template:function(i,e){if(i&1){let d=P();I(0,"headline",1),o(1,"section",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"mat-form-field")(6,"mat-label"),p(7,"Show poll results"),a(),o(8,"mat-select",6),C("ngModelChange",function(l){return m(d),y(e.poll.displayTypeId,l)||(e.poll.displayTypeId=l),u(l)}),o(9,"mat-option",7),p(10,"Always"),a(),o(11,"mat-option",8),p(12,"After answering"),a(),o(13,"mat-option",9),p(14,"After all have answered"),a()()()(),o(15,"div",5)(16,"mat-form-field")(17,"mat-label"),p(18,"Deadline"),a(),o(19,"input",10),h("focus",function(){m(d);let l=T(22);return u(l.open())}),C("ngModelChange",function(l){return m(d),y(e.poll.endDate,l)||(e.poll.endDate=l),u(l)}),a(),I(20,"mat-datepicker-toggle",11)(21,"mat-datepicker",null,0),a(),o(23,"simple-timepicker",12),h("change",function(l){return m(d),u(e.updateTime(l))}),a()()(),o(24,"div",4)(25,"div",5)(26,"div",13)(27,"div",14),p(28," Multiple answers "),o(29,"div",15),p(30," Allow more than one answer to be selected "),a()(),o(31,"mat-slide-toggle",16),C("ngModelChange",function(l){return m(d),y(e.poll.multiAnswer,l)||(e.poll.multiAnswer=l),u(l)}),a()()(),o(32,"div",5)(33,"div",13)(34,"div",14),p(35," Hide detailed results "),o(36,"div",15),p(37," Only you will be able to see the answers "),a()(),o(38,"mat-slide-toggle",16),C("ngModelChange",function(l){return m(d),y(e.poll.anonymous,l)||(e.poll.anonymous=l),u(l)}),a()()(),o(39,"div",5)(40,"div",13)(41,"div",14),p(42," Mandatory "),o(43,"div",15),p(44," Block transactions for owners until they answer "),a()(),o(45,"mat-slide-toggle",16),C("ngModelChange",function(l){return m(d),y(e.poll.voteRequired,l)||(e.poll.voteRequired=l),u(l)}),a()()()()(),o(46,"quill",17),h("change",function(l){return m(d),u(e.poll.question=l)}),a(),o(47,"div",3),Y(48,je,7,5,"div",4,Q),a(),o(50,"div",18)(51,"button",19),h("click",function(){return m(d),u(e.savePoll(!1))}),p(52," Save draft "),a(),o(53,"button",20),h("click",function(){return m(d),u(e.savePoll(!0))}),p(54),o(55,"mat-icon"),p(56,"publish"),a()()()(),L(57,Be,3,0,"aside",21)}if(i&2){let d=T(22);c("title",e.paramMap.display.pollId?"Edit Poll":"New Poll")("fantasySettings",e.fantasySettings),r(4),c("filterPanelCellOptions",S(22,W)),r(4),w("ngModel",e.poll.displayTypeId),r(7),c("filterPanelCellOptions",S(23,W)),r(4),c("matDatepicker",d),w("ngModel",e.poll.endDate),r(),c("for",d),r(3),c("showSeconds",!1)("time",e.poll.endDate),r(2),c("filterPanelCellOptions",S(24,q)),r(6),w("ngModel",e.poll.multiAnswer),r(),c("filterPanelCellOptions",S(25,q)),r(6),w("ngModel",e.poll.anonymous),r(),c("filterPanelCellOptions",S(26,q)),r(6),w("ngModel",e.poll.voteRequired),r(),c("leagueId",e.leagueId)("standalone",!0)("html",e.poll.question),r(2),z(e.poll.answerList),r(5),c("disabled",!e.poll.question||!e.poll.answerList[0].value||!e.poll.answerList[1].value),r(),A(" ",e.originalPoll&&!e.originalPoll.hidePoll?"Update poll":"Publish poll"," "),r(3),M(e.isDesktop?57:-1)}},dependencies:[K,X,$,Z,ie,te,ae,re,se,de,me,le,oe,ne,ue,ee,ce,Te,ke,be,Me,Se,De,Ie,Ae],encapsulation:2,changeDetection:0});let s=n;return s})();var k=(()=>{let n=class n{constructor(t){this.dataService=t}resolve({params:{leagueId:t,pollId:i}}){return i?this.dataService.createBatchedRequest({getLeaguePolls:{pollId:i}},{leagueId:t}):!0}};n.\u0275fac=function(i){return new(i||n)(U(D))},n.\u0275prov=B({token:n,factory:n.\u0275fac});let s=n;return s})();var Ne=[{path:"",component:R,canDeactivate:[F],resolve:{leagueId:E,fantasyInfo:x}},{path:":pollId",component:R,canDeactivate:[F],resolve:{leagueId:E,fantasyInfo:x,data:k}}],Ee=_e.forChild(Ne);var Tt=(()=>{let n=class n{};n.\u0275fac=function(i){return new(i||n)},n.\u0275mod=H({type:n}),n.\u0275inj=N({providers:[k],imports:[Ve,Ee]});let s=n;return s})();export{Tt as LeaguePollAddModule};
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.