PageSourceSearch

https://www.sexpositivelosangeles.org/_next/static/chunks/pages/members/election-bb86014808eefb80.js

js sexpositivelosangeles.org collected 2026-10-04 04:49:31 UTC 11,836 bytes, 132 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="21fe6eee-e6a4-447f-9afd-ab94cc4f053c",e._sentryDebugIdIdentifier="sentry-dbid-21fe6eee-e6a4-447f-9afd-ab94cc4f053c")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7969],{33053:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>P});var s=n(37876),r=n(14232),o=n(31167),a=function(e){return e.NotOpen="notOpen",e.Open="open",e.Closed="closed",e}({}),i=n(37430),l=n(85819),d=n(49995),c=n(54587),u=n.n(c);function m(e){let{imageClass:t,widthClass:n}=e,r=e.addedClasses||"";return(0,s.jsxs)("section",{className:(0,d.A)("NarrowCard",n||"max-w-sm","mb-8 mx-4 md:mx-auto md:shadow-lg",r),"data-sentry-component":"NarrowCard","data-sentry-source-file":"NarrowCard.tsx",children:[e.img&&(0,s.jsx)(u(),{className:(0,d.A)("w-full",t),alt:e.alt||"Card image",src:e.img,width:400,height:300}),(0,s.jsxs)("div",{className:"px-6 py-4 pb-8",children:[e.title&&(0,s.jsx)("div",{className:"font-bold text-xl mb-2",children:e.title}),e.children]})]})}var p=n(25268);function h(e){let{election:t,ballot:n}=e,{candidates:r}=t;function o(t){e.onClick(t)}return(0,s.jsxs)("div",{className:"mb-2","data-sentry-component":"VoteCollector","data-sentry-source-file":"VoteOptions.tsx",children:[(0,s.jsx)("h3",{className:"h3 p-2 mb-2",children:t.title}),(0,s.jsx)("div",{className:"text-gray-darker pl-2",children:r.map(function(e,r){let{votes:a}=n,i=a.map(e=>e.candidateId).includes(e.id),l=!i&&a.length>=t.numberOfSeats,d=l?"text-gray":"";return(0,s.jsx)("div",{className:"text-black mb-8 shadow-md bg-white border-[var(--group-border-color)] border-solid border focus-within:ring-2 focus-within:ring-[var(--group-border-color)]","data-sentry-component":"choice","data-sentry-source-file":"VoteOptions.tsx",children:(0,s.jsxs)("div",{className:`flex md:items-center p-4 ${d} cursor-pointer`,onClick:()=>!l&&o(e),children:[(0,s.jsxs)("label",{className:`block flex-grow text-gray-darkest font-bold md:mb-0 pr-4 cursor-pointer ${d}`,htmlFor:`${t.slug}-${e.id}`,children:[(0,s.jsx)(p.A,{photoUrl:e.member.profile?.photo?.url,photoSize:80,"data-sentry-element":"MemberPhoto","data-sentry-source-file":"VoteOptions.tsx"}),e.member.name]}),(0,s.jsx)("div",{className:"flex justify-center items-center",children:(0,s.jsx)("input",{className:"border-2 border-gray-lighter px-4 mr-2 focus:ring-2 focus:ring-offset-2 focus:ring-[var(--group-border-color)] focus:outline-none focus:bg-white focus:border-[var(--group-border-color)] w-6 h-6",checked:i,id:`${t.slug}-${e.id}`,name:"candidateId",type:"checkbox",value:e.id,onChange:()=>o(e),disabled:l,"aria-label":`Vote for ${e.member.name}`,role:"checkbox","aria-checked":i})})]})},`${r}${t.slug}`)})})]})}var f=n(28418),x=function(e){return e.ready="ready",e.saving="saving",e.notReady="notReady",e}({});function b(e){let{status:t,onClick:n}=e;return(0,s.jsx)(f.rA,{onClick:n,disabled:"ready"!==t,"data-sentry-element":"ActionButton","data-sentry-component":"VoteButton","data-sentry-source-file":"VoteButton.tsx",children:"saving"===t?"Casting ballot...":"Cast your vote"})}var g=n(94829),y=n(54130),v=n(47952),j=n(82037),C=n(5811),E=n(89099),N=n(34146),w=n(13220),A=n(39114),I=n(33709),$=n(73382),k=n(10969);let O=(0,C.PA)(function(e){let{block:t,election:n,jwt:o}=e,d=n?{electionId:n.id,votes:[]}:void 0,[c,u]=(0,r.useState)({ballot:d,votingError:!1,saving:!1,ballotCast:!1}),p=(0,E.useRouter)(),C=(0,I.MM)(),O=(0,w.IG)(),_=O&&(0,A.hN)(O,"content"),T=(0,I.uV)(),[V]=(0,l.X)(i.pe),S=async e=>{e.preventDefault(),e.stopPropagation();let{ballot:t}=c;if(!t)throw Error("ballot is undefined");u({...c,saving:!0});try{let e=await V({variables:{id:t.electionId,input:{candidateIds:t.votes.map(e=>e.candidateId)}}},"castBallot");if(e.hasError){console.warn("error",e.errors),u({...c,saving:!1,votingError:!0});return}u({...c,ballotCast:!0,saving:!1})}catch(e){console.warn("error",e),u({...c,saving:!1,votingError:!0})}},D=()=>(0,s.jsx)("div",{className:"mt-8","data-sentry-component":"returnToHome","data-sentry-source-file":"ElectionCard.tsx",children:(0,s.jsx)(j.HI,{href:"/members/home","data-sentry-element":"BackArrow","data-sentry-source-file":"ElectionCard.tsx",children:"Member Home"})}),P=t&&T?.contentItems?.filter(e=>e.parentId===t?.id),B=(0,$.rR)(P),M=B?.photo?.url;return(0,s.jsx)("main",{className:k.Ay.mainColors,"data-sentry-component":"ElectionCard","data-sentry-source-file":"ElectionCard.tsx",children:(0,s.jsxs)(m,{alt:"Vote",img:M||"https://mp1md-pub.s3-us-west-2.amazonaws.com/content/CN_RCDv85mklxMg_regular.jpeg",addedClasse
1s:`md:rounded-3xl ${k.Ay.cardSurface}`,imageClass:"md:rounded-t-3xl",widthClass:"max-w-md","data-sentry-element":"NarrowCard","data-sentry-source-file":"ElectionCard.tsx",children:[t&&(0,s.jsx)("div",{...(0,y.m)({contentId:t?.id}),children:(0,s.jsx)(v.A,{content:t?.content||"(no content)"})}),_&&!t&&(0,s.jsx)(f.rA,{onClick:function(){C?.openNew({type:$.nz.Text,slug:"board-election-form",title:"Election Page - intro text"})},children:"Edit intro text"}),(()=>{let e,{ballotCast:t}=c;if(!o)return(0,s.jsxs)("p",{className:"p",children:["Please"," ",(0,s.jsx)(N.A,{className:"a",returnTo:p.asPath,children:"log in"})," ","to vote."]});if(t)return(0,s.jsxs)("div",{children:[(0,s.jsxs)(g.A,{children:["Your ballot has been cast. Thank you for voting!",(0,s.jsx)("br",{})]}),D()]});if(!n)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"p",children:"The election is now closed."}),D()]});if(n.selfVotedAt)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(g.A,{children:"We've received your vote. Thank you for voting!"}),D()]});let r=(e=>{let t=Date.now();return e.openedAt&&t<Date.parse(e.openedAt)?a.NotOpen:e.closedAt&&t>Date.parse(e.closedAt)?a.Closed:a.Open})(n);if(r===a.NotOpen)return(0,s.jsx)("p",{className:"p",children:"The election is not yet open for voting."});if(r===a.Closed)return(0,s.jsx)("p",{className:"p",children:"The election is now closed to voting."});let{ballot:i}=c;if(!i)throw Error("ballot is undefined");return(0,s.jsxs)("form",{className:"w-full max-w","data-sentry-component":"content","data-sentry-source-file":"ElectionCard.tsx",children:[(0,s.jsx)(h,{election:n,ballot:i,onClick:e=>(e=>{let{ballot:t}=c;if(!t)throw Error("ballot is undefined");let n=t.votes.map(e=>e.candidateId).includes(e.id),s=t.votes.filter(t=>t.candidateId!==e.id);n||(s=[...t.votes,{candidateId:e.id}]);let r={...t,votes:s};u({...c,ballot:r})})(e),"data-sentry-element":"VoteOptions","data-sentry-source-file":"ElectionCard.tsx"}),((e,t)=>{let n=e.numberOfSeats-t.votes.length;if(0===n)return null;let r=t.votes.length>0?"more":"";return(0,s.jsxs)("p",{className:"p flex justify-center","data-sentry-component":"chooseNCandidatesMessage","data-sentry-source-file":"ElectionCard.tsx",children:["You may choose up to ",n," ",r," ",n>1?"candidates":"candidate"]})})(n,i),(0,s.jsx)("div",{className:"flex justify-center",children:0===n.candidates.length?null:(e=0===i.votes.length?x.notReady:c.saving?x.saving:x.ready,(0,s.jsx)(b,{onClick:S,status:e,"data-sentry-element":"VoteButton","data-sentry-component":"voteButton","data-sentry-source-file":"ElectionCard.tsx"}))}),c.votingError?(0,s.jsx)("p",{className:"p text-spp-red","data-sentry-component":"displayVotingError","data-sentry-source-file":"ElectionCard.tsx",children:"There was a problem recording your vote. Please try again in a little while. If the problem persists, please contact the election manager mentioned above."}):null,D()]})})()]})})});var _=n(48230),T=n.n(_),V=n(22767),S=n(48014),D=n(3768);let P=(0,C.PA)(function(){let e,t=(0,w.lF)(),n=(0,I.uV)(),r=(0,$.fF)(n,"board-election-form"),a=(0,w.IG)(),l=(0,o.I)(i.Ak,{skip:!t||a?.status!=="ACTIVE",fetchPolicy:"network-only"}),d=l.data?.getOpenElection??void 0;return e=t?a?.status==="INACTIVE"?(0,s.jsxs)("section",{children:[(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("h1",{className:"h1",children:"Board Election"})}),(0,s.jsxs)("p",{className:"p",children:["Your account is not active. Please"," ",(0,s.jsx)(T(),{href:"/members/dues",className:"a",children:"pay dues"})," ","to activate your account before voting."]})]}):a?.status!=="ACTIVE"?(0,s.jsxs)("section",{children:[(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("h1",{className:"h1",children:"Board Election"})}),(0,s.jsxs)("p",{className:"p",children:["Only active members can vote. Please"," ",(0,s.jsx)(T(),{href:"/join",children:"apply to become a member"}),"."]})]}):a?l.data&&t?(0,s.jsx)(O,{election:d,jwt:t,block:r??null,"data-sentry-element":"ElectionCard","data-sentry-component":"electionCard","data-sentry-source-file":"election.tsx"}):null:(0,s.jsx)("section",{children:(0,s.jsx)(V.A,{})}):(0,s.jsxs)("section",{children:[(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("h1",{className:"h1",children:"Board Election"})}),(0,s.jsxs)("p",{className:"p",children:["Please login to vote.",(0,s.jsx)(S.A,{})]})]}),(0,s.jsx)(D.A,{title:d?.title||"Election",backButtonHref:"/members/home","data-sentry-element":"MainContent","data-sentry-component":"ElectionPage","data-sentry-source-file":"election.tsx",children:e})})},37430:(e,t,n)=>{"use strict";n.d(t,{Ak:()=>o,Ek:()=>i,Ry:()=>c,Zn:()=>d,_D:()=>u,pe:()=>a});
1var s=n(86191),r=n(55494);let o=(0,s.J1)`
2  query GetOpenElection {
3    getOpenElection {
4      id
5      title
6      slug
7      numberOfSeats
8      openedAt
9      closedAt
10      selfVotedAt
11      candidates {
12        id
13        member {
14          id
15          name
16          profile {
17            id
18            photo {
19              id
20              url
21            }
22          }
23        }
24      }
25    }
26  }
27`,a=(0,s.J1)`
28  mutation CastBallot($id: ID!, $input: CastBallotInput!) {
29    castBallot(id: $id, input: $input) {
30      result {
31        id
32        selfVotedAt
33      }
34      errors {
35        code
36        fields
37        message
38        shortMessage
39        vars
40      }
41    }
42  }
43`,i=(0,s.J1)`
44  query AdminListElections($sort: [ElectionSortInput!]) {
45    adminListElections(sort: $sort) {
46      results {
47        closedAt
48        id
49        openedAt
50        title
51        candidatesCount
52        votesCount
53        candidates(sort: [{field: VOTES_COUNT, order: DESC}, {field: INSERTED_AT, order: ASC}], limit: 2) {
54          id
55          member {
56            ${r.ts}
57          }
58          votesCount
59        }
60      }
61    }
62  }
63`,l=`
64  closedAt
65  id
66  openedAt
67  title
68  candidates {
69    id
70    member {
71      ${r.ts}
72    }
73    votesCount
74  }
75  numberOfSeats
76  votes {
77    id
78    insertedAt
79  }
80`,d=(0,s.J1)`
81  query AdminGetElection($id: ID!, $votesLimit: Int, $candidatesSort: [CandidateSortInput]) {
82    adminGetElection(id: $id) {
83      closedAt
84      id
85      openedAt
86      title
87      candidates(sort: $candidatesSort) {
88        id
89        member {
90          ${r.ts}
91        }
92        votesCount
93      }
94      numberOfSeats
95      votes(limit: $votesLimit) {
96        id
97        insertedAt
98      }
99    }
100  }
101`,c=(0,s.J1)`
102  mutation CreateElection($input: CreateElectionInput!) {
103    createElection(input: $input) {
104      result {
105        ${l}
106      }
107      errors {
108        code
109        fields
110        message
111        shortMessage
112        vars
113      }
114    }
115  }
116`,u=(0,s.J1)`
117  mutation UpdateElection($id: ID!, $input: UpdateElectionInput!) {
118    updateElection(id: $id, input: $input) {
119      result {
120        ${l}
121      }
122      errors {
123        code
124        fields
125        message
126        shortMessage
127        vars
128      }
129    }
130  }
131`},51230:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/members/election",function(){return n(33053)}])}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=51230)),_N_E=e.O()}]);
132//# sourceMappingURL=election-bb86014808eefb80.js.map

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.