{"version":3,"sources":["sounds/poke-sound.mp3","enums/RolesEnum.ts","components/Login/loginSlice.ts","enums/ConnectionStateType.ts","app/signalR/connectionSlice.ts","app/authSaga.ts","enums/PlayerState.ts","app/signalR/SignalRMiddleware.ts","enums/TableState.ts","app/game/documentTitleChanger.ts","app/game/gameSlice.ts","models/User.ts","app/game/gameSaga.ts","app/settings/settingsSlice.ts","app/settings/settingsSaga.ts","app/rootReducer.ts","app/store.ts","app/signalR/pokerSignalRSaga.ts","app/rootSaga.ts","enums/VoteType.ts","app/withRoomCheckContainer.tsx","components/GameHeader/ShareRoomPopup/ShareRoomButton.tsx","components/GameHeader/GameHeader.tsx","components/Observers/Observers.tsx","models/VotesState.ts","components/Results/Results.tsx","models/RoomUpdateInfo.ts","components/Reusable/Vote.tsx","components/Table/GameTable.tsx","models/consts.ts","components/Player/Player.tsx","components/Player/PlayersRow.tsx","components/Main.tsx","components/ReconnectingIndicator/ReconnectingIndicator.tsx","components/Footer/AllRightsReserved.tsx","components/Footer/PoweredBy7pace.tsx","components/GameButtons/GameButtons.tsx","components/ControlPanel/ControlPanel.tsx","components/Settings/VoteScaleItem.tsx","components/Settings/CustomScale.tsx","components/Settings/Settings.tsx","components/Game/GameStat.tsx","App.tsx","components/Game/GameContainer.tsx","components/Login/Login.tsx","index.tsx"],"names":["RolesEnum","ConnectionStateType","loginInitialState","name","role","Player","desiredRoomId","isRoomRemoved","doLoginAction","createAction","loginSlice","createSlice","initialState","reducers","setLoginInfo","state","action","payload","trim","setDesiredRoomId","setRoomRemoved","connectionInitialState","Disconnected","isAbandoned","roomId","connectionId","oldConnectionId","error","signalRAction","args","removeRoomAction","cannotReconnectAction","connectionSlice","setConnectionState","initConnection","reconnected","setConnectionId","setError","callSignalR","setIsAbandoned","fullAuthFlowCheck","savedLoginData","userData","JSON","parse","localStorage","getItem","shallowEqual","put","actions","take","loginData","select","store","setItem","stringify","login","Connecting","connectionInfo","routerActions","push","PlayerState","IncomingEvents","SignalActions","middleware","TableState","SignalRMiddlewareProvider","dispatchFn","SignalRMiddleware","hubConnection","this","signalR","withUrl","withAutomaticReconnect","configureLogging","Debug","build","start","catch","err","console","log","window","Connected","onclose","x","onreconnecting","RetryingToConnect","onreconnected","eventChannel","emit","END","handlers","getEventHandler","signalName","message","isIncoming","key","isNaN","Object","prototype","hasOwnProperty","call","handler","on","a","off","stop","methodName","invoke","toString","Error","pokeSound","require","launchIsBeingPokedTitle","originalTitle","document","title","index","interval","setInterval","Audio","default","play","stopIsBeingPokedTitle","clearInterval","gameInitialState","players","observers","tableState","Voting","votesState","roomStat","isBeingPoked","ActivityThreshold","showVotes","startVoting","myVotingPerformed","updateActivityAction","setPlayerIdleAction","updateRoomStatAction","pokeAction","isBeingPokedAction","gameSlice","addPlayer","Observer","setMyself","arr","myIndex","findIndex","p","id","first","isMe","setPlayers","filter","deleteUser","ind","splice","doVoting","player","find","vote","status","Voted","warn","resetAllVotes","forEach","isFirstVoted","isLastVoted","pointsHistory","user","shouldIdle","Date","now","lastActivity","Idle","Thinking","getPlayerStatus","isPoked","replacePlayer","newPlayer","extraReducers","b","addCase","Opened","gameSaga","watchStartVoting","watchSetPlayers","watchPlayersStatus","watchPoke","signalRSagaGetter","undefined","messageSagas","takeEvery","StartVoting","ShowVotes","DoVoting","UpdateActivity","DoPoke","all","connection","game","me","gameState","timeDiff","f","delay","launchIsBeingPoked","settingsInitialState","settings","isVisible","saveInProgress","validationErrors","settingsVisibilityAction","setSettingsAction","validateSettingsAction","updateSettingsAction","settingsSlice","builder","settingsSaga","updateSettings","UpdateSettings","history","pokerHistory","createBrowserHistory","sagaMiddleware","createSagaMiddleware","reducer","combineReducers","router","connectRouter","configureStore","devTools","process","getDefaultMiddleware","thunk","concat","routerMiddleware","pokerSignalRSaga","watchCannotReconnect","watchReconnection","watchSignalRCalls","watchIncomingEvents","processPayload","dispatch","signalRMiddleware","connect","fork","getState","currentState","CreateRoom","JoinRoom","logoutAction","cancelled","close","UpdateUserId","keys","includes","processError","signalEvent","AddPlayer","SetPlayers","SetMyself","ReplaceUser","SetSettings","InitConnection","DeleteUser","RemoveRoom","ValidateSettings","CannotReconnect","UpdateRoomStat","rootSaga","forkAppSagas","task","cancel","VoteType","mapState","hasJoinedRoom","withRoomCheckContainer","component","Component","props","useDispatch","useParams","path","generatePath","to","ShareRoomButton","roomLink","React","useState","copied","setCopied","OverlayTrigger","trigger","placement","transition","overlay","Popover","className","Body","style","width","height","type","onFocus","event","target","readOnly","defaultValue","onClick","copyText","getElementById","setSelectionRange","execCommand","blur","setTimeout","opacity","onEntered","canvas","QRCode","toCanvas","scale","color","light","connector","logout","showSettings","location","href","connected","currentUserId","obs","useMemo","map","observer","length","HighlightType","memoRows","votes","voteType","NA","value","votesCount","percentage","Card","Table","striped","hover","UpdateActionType","getVoteText","stat","getProgressBarText","highlightedVote","highlightType","Consensus","MostVotes","Nothing","Doubts","SingleVote","getVotesStat","highlightedVoteSecond","htmlFor","ProgressBar","max","IdontKnow","ownProps","isFirst","isLast","points","userId","userName","playerStatus","doPoke","playerId","doesntKnow","showCards","pokeButtonVisible","setPokeButtonVisible","isHidingPokeButton","setIsHidingPokeButton","useEffect","disabled","coords","numberOfPlayers","divider","angle","Math","PI","i","computedAngle","findPhis","phi","cos","y","sin","round","findEllipseCoordinates","left","top","renderCards","updateActivity","lastMouseMove","watchMouseMove","diff","body","addEventListener","removeEventListener","isReconnecting","isShown","setIsShown","isHiding","setIsHiding","Alert","variant","Spinner","size","animation","AllRightsReserved","rootClose","PoweredBy7pace","canShowCards","some","show","startNew","voteScale","activeVoteScale","isIn","setIsIn","num","degrees","step","point","idk","divStyle","transform","Transition","in","timeout","VoteScaleItemView","item","Normal","CustomScale","scaleItems","setScaleItems","updateScaleItems","update","isSelected","maxLength","onChange","e","persist","cloned","newItem","VoteScaleItem","slice","CustomScaleId","saveSettings","selectedVoteScaleId","setSelectedVoteScaleId","voteScales","setVoteScales","scaleButtons","scales","updateCustomScale","Form","Check","checked","Modal","dialogClassName","onHide","Header","closeButton","Title","Footer","GameStatStopwatch","timeElapsed","setTimeElapsed","useRef","current","getTime","timestamp","minutes","floor","seconds","container","actionType","GameStarted","actorPlayer","targetPlayer","isMessageHidden","setIsMessageHidden","actionText","TableOpened","PokedAnother","mapDispatch","doLogin","LoginContol","selectedName","setSelectedName","selectedRole","setSelectedRole","shaky","setShaky","validationError","setValidationError","mounted","obj","username","validateAndLogin","onKeyPress","placeholder","controlClassName","options","label","option","rootElement","run","ReactDOM","render","exact","GameContainer"],"mappings":"4JAAA,OAAe,cAA0B,wC,wQCA7BA,E,mFAAAA,K,gBAAAA,E,qBAAAA,M,KCIL,ICJKC,EDICC,EAAoB,CAC7BC,KAAM,GACNC,KAAMJ,EAAUK,OAChBC,cAAe,GACfC,eAAe,GAKNC,EAAgBC,YAA+B,iBAE/CC,EAAaC,YAAY,CAClCR,KAAM,QACNS,aAAcV,EACdW,SAAU,CACNC,aAAc,SAACC,EAAmBC,GAC9BD,EAAMZ,KAAOa,EAAOC,QAAQd,KAAKe,OACjCH,EAAMX,KAAOY,EAAOC,QAAQb,MAEhCe,iBAAkB,SAACJ,EAAmBC,GAClCD,EAAMT,cAAgBU,EAAOC,SAEjCG,eAAgB,SAACL,EAAmBC,GAChCD,EAAMR,cAAgBS,EAAOC,Y,GAK1BP,EAAf,Q,iBChCYT,K,4BAAAA,E,wBAAAA,E,4BAAAA,E,sBAAAA,E,uCAAAA,M,KCKL,IAAMoB,EAAyB,CAClCN,MAAOd,EAAoBqB,aAC3BC,aAAa,EACbC,OAAQ,GACRC,aAAc,GACdC,gBAAiB,GACjBC,MAAO,KACPC,cAAe,CACXZ,OAAQ,KACRa,KAAM,KAWDC,EAAmBrB,YAAa,oBAChCsB,EAAwBtB,YAAa,yBAGrCuB,EAAkBrB,YAAY,CACvCR,KAAM,aACNS,aAAcS,EACdR,SAAU,CACNoB,mBAAoB,SAAClB,EAAwBC,GACzCD,EAAMA,MAAQC,EAAOC,SAEzBiB,eAAgB,SAACnB,EAAwBC,GAC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D,CAAO7O,KAAK,gBAAgBL,UAAW0N,aGHKmB,K","file":"static/js/main.057c01f7.chunk.js","sourcesContent":["export default __webpack_public_path__ + \"static/media/poke-sound.56d254f7.mp3\";","export enum RolesEnum {\r\n Player = 'Player',\r\n Observer = 'Observer'\r\n}","import { createAction, createSlice, PayloadAction } from \"@reduxjs/toolkit\"\r\nimport { RolesEnum } from \"../../enums/RolesEnum\"\r\n\r\n\r\nexport const loginInitialState = {\r\n name: \"\",\r\n role: RolesEnum.Player,\r\n desiredRoomId: \"\",\r\n isRoomRemoved: false\r\n};\r\nexport type LoginState = typeof loginInitialState;\r\nexport type LoginStateSimple = { name: string, role: RolesEnum };\r\n\r\nexport const doLoginAction = createAction(\"doLoginAction\");\r\n\r\nexport const loginSlice = createSlice({\r\n name: 'login',\r\n initialState: loginInitialState,\r\n reducers: {\r\n setLoginInfo: (state: LoginState, action: PayloadAction) => {\r\n state.name = action.payload.name.trim();\r\n state.role = action.payload.role;\r\n },\r\n setDesiredRoomId: (state: LoginState, action: PayloadAction) => {\r\n state.desiredRoomId = action.payload;\r\n },\r\n setRoomRemoved: (state: LoginState, action: PayloadAction) => {\r\n state.isRoomRemoved = action.payload;\r\n }\r\n }\r\n})\r\n\r\nexport default loginSlice.reducer;","export enum ConnectionStateType {\r\n Disconnected = \"Disconnected\",\r\n Connecting = \"Connecting\",\r\n CreatingRoom = \"CreatingRoom\",\r\n Connected = \"Connected\",\r\n RetryingToConnect = \"RetryingToConnect\",\r\n}\r\n\r\n","import { createAction, createSlice, PayloadAction } from \"@reduxjs/toolkit\";\r\nimport { ConnectionStateType } from \"../../enums/ConnectionStateType\";\r\nimport { SignalActions } from \"./SignalRMiddleware\";\r\n\r\n\r\nexport const connectionInitialState = {\r\n state: ConnectionStateType.Disconnected,\r\n isAbandoned: false,\r\n roomId: \"\",\r\n connectionId: \"\",\r\n oldConnectionId: \"\",\r\n error: null as Error,\r\n signalRAction: {\r\n action: null as SignalActions,\r\n args: [] as unknown[] | unknown\r\n }\r\n}\r\n\r\n\r\nexport type ConnectionState = typeof connectionInitialState;\r\n\r\nexport type InitConnectionAction = { roomId: string, userId: string };\r\n\r\nexport type SignalRAction = { action: SignalActions, args: unknown[] | unknown };\r\n\r\nexport const removeRoomAction = createAction(\"removeRoomAction\");\r\nexport const cannotReconnectAction = createAction(\"cannotReconnectAction\");\r\n\r\n\r\nexport const connectionSlice = createSlice({\r\n name: 'connection',\r\n initialState: connectionInitialState,\r\n reducers: {\r\n setConnectionState: (state: ConnectionState, action: PayloadAction) => {\r\n state.state = action.payload;\r\n },\r\n initConnection: (state: ConnectionState, action: PayloadAction) => {\r\n state.roomId = action.payload.roomId;\r\n },\r\n reconnected: (state: ConnectionState, action: PayloadAction) => {\r\n state.oldConnectionId = state.connectionId;\r\n state.connectionId = action.payload;\r\n },\r\n setConnectionId: (state: ConnectionState, action: PayloadAction) => {\r\n state.oldConnectionId = state.connectionId;\r\n state.connectionId = action.payload;\r\n },\r\n setError: (state: ConnectionState, error: PayloadAction) => {\r\n state.error = error.payload;\r\n },\r\n callSignalR: (state: ConnectionState, action: PayloadAction) => {\r\n state.signalRAction = action.payload;\r\n },\r\n setIsAbandoned: (state: ConnectionState, action: PayloadAction) => {\r\n state.isAbandoned = action.payload;\r\n }\r\n }\r\n})\r\n\r\nexport default connectionSlice.reducer;","import { PayloadAction } from \"@reduxjs/toolkit\";\r\nimport { routerActions } from \"connected-react-router\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { put, select, take } from 'redux-saga/effects';\r\nimport { doLoginAction, loginSlice, LoginState } from \"../components/Login/loginSlice\";\r\nimport { ConnectionStateType } from \"../enums/ConnectionStateType\";\r\nimport { RootStore } from \"./rootReducer\";\r\nimport { connectionSlice, InitConnectionAction } from \"./signalR/connectionSlice\";\r\n\r\nexport function* fullAuthFlowCheck(): Generator {\r\n const savedLoginData = \"savedLoginData\";\r\n while (true) {\r\n const userData: LoginState = JSON.parse(localStorage.getItem(savedLoginData) ?? \"{}\");\r\n //we have data stored in local storage\r\n if (!shallowEqual(userData, {})) {\r\n yield put(loginSlice.actions.setLoginInfo(userData));\r\n }\r\n\r\n const loginData = (yield take(doLoginAction)) as PayloadAction;\r\n\r\n yield put(loginSlice.actions.setLoginInfo(loginData.payload));\r\n\r\n let store = (yield select()) as RootStore;\r\n\r\n localStorage.setItem(savedLoginData, JSON.stringify(store.login));\r\n\r\n yield put(connectionSlice.actions.setConnectionState(ConnectionStateType.Connecting));\r\n\r\n yield take(connectionSlice.actions.setConnectionState);\r\n\r\n yield take(connectionSlice.actions.setConnectionId);\r\n const connectionInfo = (yield take(connectionSlice.actions.initConnection)) as PayloadAction;\r\n\r\n //we expect that all events are sent\r\n yield put(routerActions.push(\"/room/\" + connectionInfo.payload.roomId));\r\n\r\n yield put(loginSlice.actions.setRoomRemoved(false));\r\n }\r\n}\r\n\r\n\r\n","export enum PlayerState {\r\n Idle = \"Idle\",\r\n Thinking = \"Thinking\",\r\n Voted = \"Voted\"\r\n}","import * as signalR from \"@microsoft/signalr\";\r\nimport { AppDispatch, store } from \"../store\";\r\nimport { connectionSlice } from \"./connectionSlice\";\r\nimport { END, EventChannel, eventChannel } from \"redux-saga\";\r\nimport { ConnectionStateType } from \"../../enums/ConnectionStateType\";\r\nimport { AsyncPayloadAction } from \"../AsyncPayloadAction\";\r\n\r\nexport class SignalIncomingPayload {\r\n\r\n public signalName: IncomingEvents;\r\n public payload: AsyncPayloadAction;\r\n}\r\n\r\n\r\n\r\n\r\nexport enum IncomingEvents {\r\n SetSettings = \"SetSettings\",\r\n InitConnection = \"InitConnection\",\r\n SetPlayers = \"SetPlayers\",\r\n ReplaceUser = \"ReplaceUser\",\r\n SetMyself = \"SetMyself\",\r\n AddPlayer = \"AddPlayer\",\r\n DeleteUser = \"DeleteUser\",\r\n ShowVotes = \"ShowVotes\",\r\n StartVoting = \"StartVoting\",\r\n DoVoting = \"DoVoting\",\r\n UpdateActivity = \"UpdateActivity\",\r\n RemoveRoom = \"RemoveRoom\",\r\n ValidateSettings = \"ValidateSettings\",\r\n CannotReconnect = \"CannotReconnect\",\r\n UpdateRoomStat = \"UpdateRoomStat\",\r\n DoPoke = \"DoPoke\"\r\n}\r\n\r\n\r\n\r\n\r\nexport enum SignalActions {\r\n JoinRoom,\r\n CreateRoom,\r\n UpdateUserId,\r\n DoVoting,\r\n ShowVotes,\r\n StartVoting,\r\n UpdateActivity,\r\n UpdateSettings,\r\n DoPoke\r\n}\r\n\r\nexport type IncomingEventsStrings = keyof typeof IncomingEvents;\r\nlet middleware: SignalRMiddleware;\r\nexport const SignalRMiddlewareProvider = {\r\n getMiddleware: (dispatchFn: AppDispatch) => {\r\n if (middleware == null) {\r\n middleware = new SignalRMiddleware(dispatchFn);\r\n }\r\n return middleware;\r\n }\r\n}\r\n\r\nexport class SignalRMiddleware {\r\n private hubConnection: signalR.HubConnection;\r\n\r\n constructor(private dispatchFn: AppDispatch) {\r\n }\r\n\r\n public async connect(): Promise> {\r\n\r\n this.hubConnection = new signalR\r\n .HubConnectionBuilder()\r\n .withUrl(\"/gameHub\")\r\n .withAutomaticReconnect()\r\n .configureLogging(signalR.LogLevel.Debug)\r\n .build();\r\n\r\n\r\n await this.hubConnection\r\n .start()\r\n .catch((err: any) => {\r\n console.log('Error while establishing connection :(')\r\n });\r\n (window as any)[\"signalR\"] = this.hubConnection;\r\n this.dispatchFn(connectionSlice.actions.setConnectionState(ConnectionStateType.Connected));\r\n\r\n this.dispatchFn(connectionSlice.actions.setConnectionId(this.hubConnection.connectionId));\r\n\r\n\r\n this.hubConnection.onclose(x => this.dispatchFn(connectionSlice.actions.setConnectionState(ConnectionStateType.Disconnected)));\r\n this.hubConnection.onreconnecting(x => this.dispatchFn(connectionSlice.actions.setConnectionState(ConnectionStateType.RetryingToConnect)));\r\n this.hubConnection.onreconnected(connectionId => {\r\n this.dispatchFn(connectionSlice.actions.reconnected(connectionId));\r\n this.dispatchFn(connectionSlice.actions.setConnectionState(ConnectionStateType.Connected));\r\n });\r\n\r\n return eventChannel(emit => {\r\n\r\n this.hubConnection.onclose(x => emit(END));\r\n\r\n let handlers: { [key: string]: (...args: any[]) => void } = {};\r\n\r\n const getEventHandler = (signalName: IncomingEvents) => {\r\n return (message: { payload: any }) => {\r\n console.log(signalName);\r\n\r\n let payload = null;\r\n if (message != null && message.payload != null) {\r\n payload = message.payload;\r\n }\r\n\r\n emit({\r\n signalName: signalName,\r\n payload: {\r\n isIncoming: true,\r\n message: payload\r\n } as AsyncPayloadAction\r\n });\r\n }\r\n };\r\n\r\n for (const key in IncomingEvents) {\r\n if (!isNaN(key as any)) {\r\n continue;\r\n }\r\n if (Object.prototype.hasOwnProperty.call(IncomingEvents, key)) {\r\n let handler = getEventHandler(key as unknown as IncomingEvents);\r\n handlers[key] = handler;\r\n this.hubConnection.on(key, handler);\r\n }\r\n }\r\n\r\n // the subscriber must return an unsubscribe function\r\n // this will be invoked when the saga calls `channel.close` method\r\n const unsubscribe = async () => {\r\n for (const key in handlers) {\r\n if (Object.prototype.hasOwnProperty.call(handlers, key)) {\r\n this.hubConnection.off(key, handlers[key]);\r\n }\r\n }\r\n await this.hubConnection.stop();\r\n }\r\n\r\n return unsubscribe;\r\n });\r\n }\r\n\r\n public async close() {\r\n await this.hubConnection.stop();\r\n }\r\n\r\n public async invoke(methodName: SignalActions, args: any[] | any): Promise {\r\n try {\r\n return await this.hubConnection.invoke(SignalActions[methodName].toString(), ...args);\r\n } catch (e: any) {\r\n console.error(e);\r\n return new Error(e);\r\n }\r\n }\r\n}","export enum TableState {\r\n Voting,\r\n Opened\r\n}","const pokeSound = require(\"../../sounds/poke-sound.mp3\");\r\n\r\nexport const launchIsBeingPokedTitle = () => {\r\n const originalTitle = document.title;\r\n let index = 0;\r\n const interval = setInterval(() => {\r\n document.title = index % 2 === 0 ? \"Your estimation is missing!\" : originalTitle;\r\n index++;\r\n }, 1000);\r\n\r\n new Audio(pokeSound.default).play();\r\n return {\r\n interval: interval,\r\n originalTitle: originalTitle\r\n }\r\n}\r\n\r\nexport const stopIsBeingPokedTitle = (interval: NodeJS.Timeout, originalTitle: string) => {\r\n document.title = originalTitle;\r\n clearInterval(interval);\r\n}","import { createAction, createSlice, PayloadAction } from \"@reduxjs/toolkit\";\r\nimport { PlayerState } from \"../../enums/PlayerState\";\r\nimport { RolesEnum } from \"../../enums/RolesEnum\";\r\nimport { TableState } from \"../../enums/TableState\";\r\nimport { RoomUpdateInfo } from \"../../models/RoomUpdateInfo\";\r\nimport { Settings } from \"../../models/Settings\";\r\nimport { getPlayerStatus, User } from \"../../models/User\";\r\nimport { VotedPlayer, VoteScaleItem } from \"../../models/VoteScaleItem\";\r\nimport { VotesState } from \"../../models/VotesState\";\r\nimport { AsyncPayloadAction } from \"../AsyncPayloadAction\";\r\n\r\n\r\nexport const gameInitialState = {\r\n players: [] as User[],\r\n observers: [] as User[],\r\n tableState: TableState.Voting,\r\n votesState: null as VotesState,\r\n roomStat: null as RoomUpdateInfo,\r\n isBeingPoked: false\r\n}\r\n\r\nexport const ActivityThreshold = 20000;\r\n\r\nexport type GameState = typeof gameInitialState;\r\nexport type ReplaceUserAction = { oldId: string, player: User };\r\n\r\nexport const showVotes = createAction>(\"showVotes\");\r\nexport const startVoting = createAction(\"startVoting\");\r\nexport const myVotingPerformed = createAction>(\"myVotingPerformed\");\r\nexport const updateActivityAction = createAction>(\"updateActivity\");\r\nexport const setPlayerIdleAction = createAction(\"setPlayerIdleAction\");\r\nexport const updateRoomStatAction = createAction(\"updateRoomStatAction\");\r\nexport const pokeAction = createAction>(\"pokeAction\");\r\nexport const isBeingPokedAction = createAction(\"isBeingPokedAction\");\r\n\r\n\r\nexport const gameSlice = createSlice({\r\n name: 'game',\r\n initialState: gameInitialState,\r\n reducers: {\r\n addPlayer: (state: GameState, action: PayloadAction) => {\r\n if (action.payload.role === RolesEnum.Observer) {\r\n state.observers.push(action.payload);\r\n } else {\r\n state.players.push(action.payload);\r\n }\r\n },\r\n setMyself: (state: GameState, action: PayloadAction) => {\r\n\r\n let arr;\r\n if (action.payload.role === RolesEnum.Observer) {\r\n arr = state.observers;\r\n } else {\r\n arr = state.players;\r\n }\r\n const myIndex = arr.findIndex(p => p.id === action.payload.id);\r\n\r\n let first = arr[0];\r\n arr[0] = arr[myIndex];\r\n arr[0].isMe = true;\r\n arr[myIndex] = first;\r\n },\r\n setPlayers: (state: GameState, action: PayloadAction) => {\r\n const players = action.payload.filter(x => x.role === RolesEnum.Player);\r\n const observers = action.payload.filter(x => x.role === RolesEnum.Observer);\r\n\r\n state.players = players;\r\n state.observers = observers;\r\n },\r\n deleteUser: (state: GameState, action: PayloadAction) => {\r\n let arr;\r\n if (action.payload.role === RolesEnum.Observer) {\r\n arr = state.observers;\r\n } else {\r\n arr = state.players;\r\n }\r\n const ind = arr.findIndex(x => x.id === action.payload.id);\r\n if (ind > -1) {\r\n arr.splice(ind, 1);\r\n }\r\n },\r\n doVoting: (state: GameState, action: PayloadAction>) => {\r\n const player = state.players.find(x => x.id === action.payload.message.id);\r\n if (player == null) {\r\n console.warn(\"doVoting cannot find player with id: \" + action.payload.message.id);\r\n return;\r\n }\r\n player.vote = action.payload.message.vote;\r\n player.status = PlayerState.Voted;\r\n },\r\n resetAllVotes: (state: GameState) => {\r\n state.players.forEach(x => {\r\n x.isFirstVoted = x.isLastVoted = false;\r\n x.pointsHistory = [];\r\n x.vote = null;\r\n x.status = getPlayerStatus(x);\r\n x.isPoked = false;\r\n });\r\n state.votesState = null;\r\n },\r\n replacePlayer: (state: GameState, action: PayloadAction) => {\r\n\r\n const newPlayer = action.payload.player;\r\n\r\n var array = newPlayer.role === RolesEnum.Observer ? state.observers : state.players;\r\n //const player = array.find(x => x.id === action.payload.oldId);\r\n array.push(newPlayer);\r\n\r\n }\r\n },\r\n extraReducers: (b) => {\r\n b\r\n .addCase(showVotes, (state, action: PayloadAction>) => {\r\n state.tableState = TableState.Opened;\r\n\r\n if (action.payload.isIncoming) {\r\n state.votesState = action.payload.message;\r\n }\r\n })\r\n .addCase(startVoting, (state, action) => {\r\n state.tableState = TableState.Voting;\r\n })\r\n .addCase(updateActivityAction, (state, action: PayloadAction>) => {\r\n if (action.payload?.isIncoming === true) {\r\n const player = state.players.find(x => x.id === action.payload.message);\r\n if (player == null) {\r\n console.warn(\"updateActivity cannot find player with id: \" + action.payload.message);\r\n return;\r\n }\r\n player.lastActivity = Date.now();\r\n if (player.vote == null) {\r\n player.status = PlayerState.Thinking;\r\n }\r\n }\r\n })\r\n .addCase(setPlayerIdleAction, (state, action: PayloadAction) => {\r\n const player = state.players.find(x => x.id === action.payload.id);\r\n if (player == null) {\r\n console.warn(\"setPlayerIdle cannot find player with id: \" + action.payload.id);\r\n return;\r\n }\r\n player.status = PlayerState.Idle;\r\n })\r\n .addCase(updateRoomStatAction, (state, action: PayloadAction) => {\r\n state.roomStat = action.payload;\r\n })\r\n .addCase(isBeingPokedAction, (state, action: PayloadAction) => {\r\n state.isBeingPoked = action.payload;\r\n })\r\n .addCase(pokeAction, (state, action: PayloadAction>) => {\r\n const player = state.players.find(x => x.id === action.payload.message);\r\n player.isPoked = true;\r\n });\r\n }\r\n})\r\n\r\nexport default gameSlice.reducer;","import { ActivityThreshold } from \"../app/game/gameSlice\";\r\nimport { PlayerState } from \"../enums/PlayerState\";\r\nimport { RolesEnum } from \"../enums/RolesEnum\";\r\nimport { VoteScaleItem } from \"./VoteScaleItem\";\r\n\r\nexport type User = {\r\n name: string,\r\n id: string,\r\n role: RolesEnum,\r\n vote?: VoteScaleItem,\r\n isFirstVoted: boolean,\r\n isLastVoted: boolean,\r\n isMe: boolean,\r\n pointsHistory?: VoteScaleItem[],\r\n lastActivity: number,\r\n status: PlayerState,\r\n isPoked: boolean\r\n}\r\n\r\nexport function getPlayerStatus(user: User): PlayerState {\r\n if (user.vote != null) {\r\n return PlayerState.Voted;\r\n }\r\n const shouldIdle = (Date.now() - user.lastActivity) > ActivityThreshold;\r\n\r\n if (user.vote == null && shouldIdle) {\r\n return PlayerState.Idle;\r\n }\r\n return PlayerState.Thinking;\r\n}","import { all, call, delay, put, select, takeEvery } from \"@redux-saga/core/effects\";\r\nimport { PayloadAction } from \"@reduxjs/toolkit\";\r\nimport { PlayerState } from \"../../enums/PlayerState\";\r\nimport { User } from \"../../models/User\";\r\nimport { AsyncPayloadAction } from \"../AsyncPayloadAction\";\r\nimport { RootStore } from \"../rootReducer\";\r\nimport { connectionSlice, ConnectionState } from \"../signalR/connectionSlice\";\r\nimport { SignalActions } from \"../signalR/SignalRMiddleware\";\r\nimport { launchIsBeingPokedTitle as launchIsBeingPoked, stopIsBeingPokedTitle } from \"./documentTitleChanger\";\r\nimport { gameSlice, startVoting, showVotes, myVotingPerformed, updateActivityAction, GameState, ActivityThreshold, setPlayerIdleAction, pokeAction, isBeingPokedAction } from \"./gameSlice\";\r\n\r\n\r\nconst signalRSagaGetter = (signalRAction: SignalActions) => {\r\n return function* (action: PayloadAction>) {\r\n if (action.payload?.isIncoming === true) {\r\n return;\r\n }\r\n yield put(connectionSlice.actions.callSignalR({\r\n action: signalRAction,\r\n args: action.payload?.message !== undefined ? [action.payload?.message] : []\r\n }));\r\n }\r\n}\r\n\r\nconst messageSagas = [\r\n takeEvery(startVoting, signalRSagaGetter(SignalActions.StartVoting)),\r\n takeEvery(showVotes, signalRSagaGetter(SignalActions.ShowVotes)),\r\n takeEvery(myVotingPerformed, signalRSagaGetter(SignalActions.DoVoting)),\r\n takeEvery(updateActivityAction, signalRSagaGetter(SignalActions.UpdateActivity)),\r\n takeEvery(pokeAction, signalRSagaGetter(SignalActions.DoPoke)),\r\n\r\n\r\n takeEvery(startVoting, watchStartVoting),\r\n takeEvery(gameSlice.actions.setPlayers, watchSetPlayers),\r\n takeEvery(pokeAction, watchPoke)\r\n];\r\n\r\n\r\nexport function* gameSaga(): Generator {\r\n yield all(messageSagas);\r\n yield call(watchPlayersStatus);\r\n}\r\n\r\nexport function* watchStartVoting() {\r\n yield put(gameSlice.actions.resetAllVotes());\r\n}\r\n\r\nexport function* watchSetPlayers(action: PayloadAction) {\r\n const state = (yield select((state: RootStore) => {\r\n return {\r\n connection: state.connection,\r\n game: state.game\r\n };\r\n })) as {\r\n connection: ConnectionState,\r\n game: GameState\r\n };\r\n\r\n var me = action.payload.find(p => p.id === state.connection.connectionId);\r\n\r\n yield put(gameSlice.actions.setMyself(me));\r\n}\r\n\r\nfunction* watchPlayersStatus(): Generator {\r\n\r\n const gameState = (yield select((state: RootStore) => state.game)) as GameState;\r\n\r\n for (const player of gameState.players) {\r\n const timeDiff = Date.now() - player.lastActivity;\r\n\r\n if (player.status === PlayerState.Thinking && timeDiff > ActivityThreshold) {\r\n yield put(setPlayerIdleAction(player));\r\n }\r\n }\r\n\r\n yield delay(1000);\r\n yield call(watchPlayersStatus);\r\n}\r\n\r\nfunction* watchPoke(payload: PayloadAction>) {\r\n if (!payload.payload.isIncoming) {\r\n //button clicked by current user\r\n return;\r\n }\r\n const connectionState = (yield select((state: RootStore) => state.connection)) as ConnectionState;\r\n if (connectionState.connectionId !== payload.payload.message) {\r\n return;\r\n }\r\n\r\n yield put(isBeingPokedAction(true));\r\n const interval = (yield call(launchIsBeingPoked)) as { interval: NodeJS.Timeout, originalTitle: string };\r\n\r\n yield delay(4000);\r\n yield call(stopIsBeingPokedTitle, interval.interval, interval.originalTitle);\r\n\r\n yield put(isBeingPokedAction(false));\r\n}","import { createAction, createSlice } from \"@reduxjs/toolkit\";\r\nimport { type } from \"os\";\r\nimport { Settings, VoteScales } from \"../../models/Settings\";\r\n\r\nexport const settingsInitialState = {\r\n settings: {} as Settings,\r\n isVisible: false,\r\n saveInProgress: false,\r\n validationErrors: {} as { [key: string]: string },\r\n};\r\n\r\nexport type SettingsUpdatePayload = {\r\n selectedVoteScaleId?: string;\r\n activeVoteScale: VoteScales\r\n}\r\n\r\nexport const settingsVisibilityAction = createAction(\"settingsVisibility\");\r\nexport const setSettingsAction = createAction(\"setSettings\");\r\nexport const validateSettingsAction = createAction(\"validateSettings\");\r\nexport const updateSettingsAction = createAction(\"updateSettings\");\r\n\r\nexport const settingsSlice = createSlice({\r\n name: 'settings',\r\n initialState: settingsInitialState,\r\n reducers: {\r\n },\r\n extraReducers: builder => {\r\n builder.addCase(settingsVisibilityAction, (state, action) => {\r\n state.isVisible = action.payload;\r\n });\r\n builder.addCase(setSettingsAction, (state, action) => {\r\n state.settings = action.payload;\r\n state.validationErrors = {};\r\n state.isVisible = false;\r\n });\r\n builder.addCase(validateSettingsAction, (state, action) => {\r\n state.validationErrors[\"custom\"] = action.payload;\r\n });\r\n }\r\n});\r\n\r\nexport default settingsSlice.reducer;","import { put, takeEvery } from \"@redux-saga/core/effects\";\r\nimport { PayloadAction } from \"@reduxjs/toolkit\";\r\nimport { connectionSlice } from \"../signalR/connectionSlice\";\r\nimport { SignalActions } from \"../signalR/SignalRMiddleware\";\r\nimport { SettingsUpdatePayload, updateSettingsAction } from \"./settingsSlice\";\r\n\r\nexport function* settingsSaga() {\r\n yield takeEvery(updateSettingsAction, updateSettings);\r\n}\r\n\r\nfunction* updateSettings(updateSettingsAction: PayloadAction) {\r\n yield put(connectionSlice.actions.callSignalR({\r\n action: SignalActions.UpdateSettings,\r\n args: [updateSettingsAction.payload]\r\n }));\r\n}\r\n","import { CombinedState, combineReducers, Reducer } from \"@reduxjs/toolkit\";\r\nimport { connectRouter, RouterState } from \"connected-react-router\";\r\nimport { loginInitialState, loginSlice } from \"../components/Login/loginSlice\";\r\nimport { gameInitialState, gameSlice } from \"./game/gameSlice\";\r\nimport { connectionInitialState, connectionSlice } from \"./signalR/connectionSlice\";\r\nimport { LocationState, History } from 'history';\r\nimport { settingsInitialState, settingsSlice } from \"./settings/settingsSlice\";\r\nexport const initialState = {\r\n login: loginInitialState,\r\n connection: connectionInitialState,\r\n game: gameInitialState,\r\n settings: settingsInitialState,\r\n router: null as RouterState,\r\n};\r\n/*\r\n * This is the root state of the app\r\n * It contains every substate of the app\r\n */\r\nexport type RootStore = typeof initialState;\r\nexport const createRootReducer = (history: History): Reducer> => combineReducers({\r\n login: loginSlice.reducer,\r\n connection: connectionSlice.reducer,\r\n game: gameSlice.reducer,\r\n router: connectRouter(history),\r\n settings: settingsSlice.reducer,\r\n})\r\n","import { configureStore } from '@reduxjs/toolkit';\r\nimport { routerMiddleware } from 'connected-react-router';\r\nimport createSagaMiddleware from 'redux-saga';\r\nimport { createRootReducer } from './rootReducer';\r\nimport { createBrowserHistory } from 'history';\r\n\r\n\r\nconst devMode = process.env.NODE_ENV === 'development';\r\n\r\nexport const pokerHistory = createBrowserHistory();\r\n\r\n// create the saga middleware\r\nexport const sagaMiddleware = createSagaMiddleware();\r\n// create root reducer\r\nconst reducer = createRootReducer(pokerHistory);\r\n\r\nexport const store = configureStore({\r\n reducer,\r\n devTools: devMode,\r\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({ thunk: false }).concat(sagaMiddleware, routerMiddleware(pokerHistory)),\r\n});\r\n\r\nexport type AppDispatch = typeof store.dispatch;\r\n\r\n\r\n\r\n","import { cannotReconnectAction, connectionSlice, InitConnectionAction, removeRoomAction, SignalRAction } from \"./connectionSlice\";\r\nimport { PayloadAction } from \"@reduxjs/toolkit\";\r\nimport { END, EventChannel } from \"redux-saga\";\r\nimport { call, cancelled, fork, put, select, take } from \"redux-saga/effects\";\r\nimport { Settings } from \"../../models/Settings\";\r\nimport { gameSlice, startVoting, showVotes, updateActivityAction, updateRoomStatAction, pokeAction } from \"../game/gameSlice\";\r\nimport { store } from \"../store\";\r\nimport { IncomingEvents, SignalActions, SignalIncomingPayload, SignalRMiddleware, SignalRMiddlewareProvider } from \"./SignalRMiddleware\";\r\nimport { RootStore } from \"../rootReducer\";\r\nimport { ConnectionStateType } from \"../../enums/ConnectionStateType\";\r\nimport { logoutAction } from \"../rootSaga\";\r\nimport { setSettingsAction, validateSettingsAction } from \"../settings/settingsSlice\";\r\n\r\nexport function* pokerSignalRSaga(): Generator {\r\n try {\r\n do {\r\n var state = (yield take(connectionSlice.actions.setConnectionState)) as PayloadAction;\r\n } while (state.payload !== ConnectionStateType.Connecting);\r\n\r\n let signalRMiddleware = (yield call(SignalRMiddlewareProvider.getMiddleware, store.dispatch)) as SignalRMiddleware;\r\n\r\n var eventChannel = (yield call([signalRMiddleware, signalRMiddleware.connect])) as EventChannel;\r\n\r\n yield fork(watchIncomingEvents, eventChannel);\r\n yield fork(watchSignalRCalls);\r\n\r\n let currentState = (yield call(store.getState)) as RootStore;\r\n\r\n if (currentState.login.desiredRoomId === \"\") {\r\n yield put(connectionSlice.actions.callSignalR({\r\n action: SignalActions.CreateRoom,\r\n args: [currentState.login.name, currentState.login.role]\r\n }));\r\n } else {\r\n yield put(connectionSlice.actions.callSignalR({\r\n action: SignalActions.JoinRoom,\r\n args: [currentState.login.name, currentState.login.desiredRoomId, currentState.login.role]\r\n }));\r\n }\r\n yield fork(watchReconnection);\r\n yield fork(watchCannotReconnect);\r\n yield take(logoutAction);\r\n } finally {\r\n if (yield cancelled()) {\r\n eventChannel.close();\r\n }\r\n }\r\n}\r\n\r\nexport function* watchCannotReconnect() {\r\n yield take(cannotReconnectAction);\r\n yield put(connectionSlice.actions.setIsAbandoned(true));\r\n let signalRMiddleware = (yield call(SignalRMiddlewareProvider.getMiddleware, store.dispatch)) as SignalRMiddleware;\r\n yield call([signalRMiddleware, signalRMiddleware.close]);\r\n}\r\n\r\nexport function* watchReconnection() {\r\n do {\r\n yield take(connectionSlice.actions.reconnected);\r\n let currentState = (yield select()) as RootStore;\r\n yield put(connectionSlice.actions.callSignalR({\r\n action: SignalActions.UpdateUserId,\r\n args: [currentState.connection.roomId, currentState.connection.oldConnectionId]\r\n }));\r\n } while (true);\r\n}\r\n\r\nexport function* watchSignalRCalls() {\r\n while (true) {\r\n const action = (yield take(connectionSlice.actions.callSignalR)) as PayloadAction;\r\n let signalRMiddleware = (yield call(SignalRMiddlewareProvider.getMiddleware, store.dispatch)) as SignalRMiddleware;\r\n yield call([signalRMiddleware, signalRMiddleware.invoke], action.payload.action, action.payload.args);\r\n }\r\n\r\n}\r\n\r\nexport function* watchIncomingEvents(eventChannel: EventChannel): Generator {\r\n while (true) {\r\n try {\r\n // An error from socketChannel will cause the saga jump to the catch block\r\n const message = (yield take(eventChannel)) as SignalIncomingPayload | Error | END;\r\n\r\n if (message === END) {\r\n return;\r\n }\r\n\r\n if (Object.keys(message).includes(\"signalName\")) {\r\n yield fork(processPayload, message as SignalIncomingPayload);\r\n } else {\r\n yield call(processError, message as Error);\r\n }\r\n } catch (err) {\r\n console.error('socket error:', err);\r\n // yield call(processError, err);\r\n // socketChannel is still open in catch block\r\n // if we want end the socketChannel, we need close it explicitly\r\n // socketChannel.close()\r\n }\r\n }\r\n}\r\n\r\nexport function* processPayload(signalEvent: SignalIncomingPayload) {\r\n\r\n switch (signalEvent.signalName) {\r\n case IncomingEvents.AddPlayer:\r\n yield put(gameSlice.actions.addPlayer(signalEvent.payload.message));\r\n break;\r\n\r\n case IncomingEvents.SetPlayers:\r\n yield put(gameSlice.actions.setPlayers(signalEvent.payload.message));\r\n break;\r\n\r\n case IncomingEvents.SetMyself:\r\n yield put(gameSlice.actions.setMyself(signalEvent.payload.message));\r\n break;\r\n\r\n case IncomingEvents.ReplaceUser:\r\n yield put(gameSlice.actions.replacePlayer(signalEvent.payload.message));\r\n break;\r\n\r\n case IncomingEvents.SetSettings:\r\n yield put(setSettingsAction(signalEvent.payload.message as Settings));\r\n break;\r\n\r\n case IncomingEvents.InitConnection:\r\n yield put(connectionSlice.actions.initConnection(signalEvent.payload.message as InitConnectionAction));\r\n break;\r\n\r\n case IncomingEvents.DeleteUser:\r\n yield put(gameSlice.actions.deleteUser(signalEvent.payload.message));\r\n break;\r\n\r\n\r\n case IncomingEvents.ShowVotes:\r\n yield put(showVotes(signalEvent.payload));\r\n break;\r\n\r\n case IncomingEvents.StartVoting:\r\n yield put(startVoting(signalEvent.payload));\r\n break;\r\n\r\n case IncomingEvents.DoVoting:\r\n yield put(gameSlice.actions.doVoting(signalEvent.payload));\r\n break;\r\n\r\n case IncomingEvents.UpdateActivity:\r\n yield put(updateActivityAction(signalEvent.payload));\r\n break;\r\n\r\n case IncomingEvents.RemoveRoom:\r\n yield put(removeRoomAction());\r\n break;\r\n\r\n case IncomingEvents.ValidateSettings:\r\n yield put(validateSettingsAction(signalEvent.payload.message));\r\n break;\r\n\r\n case IncomingEvents.CannotReconnect:\r\n yield put(cannotReconnectAction());\r\n break;\r\n\r\n case IncomingEvents.UpdateRoomStat:\r\n yield put(updateRoomStatAction(signalEvent.payload.message));\r\n break;\r\n\r\n case IncomingEvents.DoPoke:\r\n yield put(pokeAction(signalEvent.payload));\r\n break;\r\n }\r\n}\r\n\r\nexport function processError(error: Error) {\r\n connectionSlice.actions.setError(error);\r\n}\r\n\r\n","import { Task } from \"@redux-saga/types\";\r\nimport { createAction } from \"@reduxjs/toolkit\";\r\nimport { routerActions } from \"connected-react-router\";\r\nimport { cancel, fork, put, take } from \"redux-saga/effects\";\r\nimport { loginSlice } from \"../components/Login/loginSlice\";\r\nimport { fullAuthFlowCheck } from \"./authSaga\";\r\nimport { gameSaga } from \"./game/gameSaga\";\r\nimport { settingsSaga } from \"./settings/settingsSaga\";\r\nimport { removeRoomAction } from \"./signalR/connectionSlice\";\r\nimport { pokerSignalRSaga } from \"./signalR/pokerSignalRSaga\";\r\n\r\nexport const logoutAction = createAction(\"logout\");\r\nexport default function* rootSaga(): Generator {\r\n while (true) {\r\n const task = (yield fork(forkAppSagas)) as Task;\r\n\r\n yield take(logoutAction);\r\n yield put(routerActions.push(\"/\"));\r\n\r\n yield put(loginSlice.actions.setDesiredRoomId(\"\"));\r\n yield cancel(task);\r\n }\r\n}\r\n\r\n//function to fork all tasks and return the task object\r\nfunction* forkAppSagas(): Generator {\r\n yield fork(fullAuthFlowCheck);\r\n yield fork(pokerSignalRSaga);\r\n yield fork(gameSaga);\r\n\r\n yield fork(settingsSaga);\r\n yield take(removeRoomAction);\r\n //call remove room action\r\n yield put(loginSlice.actions.setRoomRemoved(true));\r\n yield put(logoutAction());\r\n}","\r\nexport enum VoteType {\r\n Normal = \"Normal\",\r\n NA = \"NA\",\r\n Rocket = \"Rocket\"\r\n}\r\n","import React, { ComponentType, FunctionComponent } from \"react\";\r\nimport { connect, useDispatch } from \"react-redux\";\r\nimport { generatePath, Redirect, RouteComponentProps, useParams } from \"react-router-dom\";\r\nimport { loginSlice } from \"../components/Login/loginSlice\";\r\nimport { ConnectionStateType } from \"../enums/ConnectionStateType\";\r\nimport { RootStore } from \"./rootReducer\";\r\n\r\ntype RoomCheckProps = {\r\n hasJoinedRoom: boolean,\r\n joiningRoomId?: string\r\n}\r\n\r\ntype Props = RoomCheckProps & RouteComponentProps\r\n\r\nconst roomCheck =

(Component: React.FunctionComponent

| React.ComponentType

): (props: Props) => any => {\r\n\r\n return (props: Props) => {\r\n const dispatch = useDispatch();\r\n\r\n let { roomId } = useParams<{ roomId: string }>();\r\n\r\n if (!props.hasJoinedRoom) {\r\n dispatch(loginSlice.actions.setDesiredRoomId(roomId));\r\n const path = generatePath(\"/join/:roomId\", {\r\n roomId: roomId\r\n });\r\n return \r\n }\r\n return ;\r\n }\r\n}\r\n\r\n\r\nconst mapState = (store: RootStore): RoomCheckProps => ({\r\n hasJoinedRoom: store.connection.roomId !== \"\"\r\n});\r\n\r\nconst withRoomCheckContainer = (component: React.FunctionComponent | React.ComponentType) => {\r\n const connected = connect(mapState)(roomCheck(component));\r\n return connected;\r\n}\r\n\r\nexport default withRoomCheckContainer;\r\n","import React from \"react\";\r\nimport { OverlayTrigger, Popover } from \"react-bootstrap\";\r\nimport QRCode from 'qrcode';\r\nimport \"../../../icons.scss\";\r\nimport \"./ShareRoomButton.scss\";\r\n\r\ntype ShareRoomButtonPropsType = {\r\n roomLink: string\r\n}\r\n\r\nexport const ShareRoomButton: React.FC = ({ roomLink }: ShareRoomButtonPropsType) => {\r\n\r\n const [copied, setCopied] = React.useState(false);\r\n\r\n const copyLink = () => {\r\n var copyText = document.getElementById(\"link-text-input\") as any;\r\n if (copyText == null) {\r\n return;\r\n }\r\n copyText.select();\r\n copyText.setSelectionRange(0, 99999);\r\n document.execCommand(\"copy\");\r\n copyText.blur();\r\n setCopied(true);\r\n setTimeout(() => {\r\n setCopied(false);\r\n }, 4000);\r\n };\r\n\r\n const drawQRCode = () => {\r\n var canvas = document.getElementById('share-qr-code-canvas');\r\n QRCode.toCanvas(canvas, roomLink, {\r\n width: 178,\r\n scale: 1,\r\n color: {\r\n light: \"#E6EFFE\"\r\n }\r\n }, (error) => {\r\n });\r\n };\r\n\r\n return \r\n \r\n

\r\n \r\n
\r\n
\r\n

Share this room

\r\n
\r\n
\r\n
\r\n event.target.select()} readOnly={true} defaultValue={roomLink}>\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
Copied
\r\n
\r\n
\r\n {/*
Reserve unique link here
*/}\r\n
\r\n \r\n \r\n }\r\n onEntered={drawQRCode}>\r\n
Share Room
\r\n \r\n}","import React from \"react\";\r\n\r\nimport { ShareRoomButton } from \"./ShareRoomPopup/ShareRoomButton\";\r\n\r\nimport \"../../icons.scss\";\r\nimport \"./GameHeader.scss\";\r\nimport { RootStore } from \"../../app/rootReducer\";\r\nimport { connect, ConnectedProps } from \"react-redux\";\r\nimport { AppDispatch } from \"../../app/store\";\r\nimport { logoutAction } from \"../../app/rootSaga\";\r\nimport { settingsVisibilityAction } from \"../../app/settings/settingsSlice\";\r\n\r\nconst GameHeader: React.FC = (props) => {\r\n return
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n}\r\n\r\nconst mapProps = (store: RootStore) => {\r\n return {\r\n\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: AppDispatch) => {\r\n return {\r\n logout: () => dispatch(logoutAction()),\r\n showSettings: () => dispatch(settingsVisibilityAction(true))\r\n };\r\n};\r\n\r\nconst connector = connect(mapProps, mapDispatchToProps)\r\n\r\nexport type GameHeaderPropsType = ConnectedProps;\r\n\r\nexport default connector(GameHeader);","import React, { useMemo } from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RootStore } from '../../app/rootReducer';\r\nimport { RolesEnum } from '../../enums/RolesEnum';\r\nimport { User } from '../../models/User';\r\n\r\nimport './Observers.scss';\r\n\r\ntype ObsereversPropsType = {\r\n observers: User[],\r\n currentUserId: string\r\n}\r\n\r\nconst Observers: React.FC = (props) => {\r\n const obs = useMemo(() => {\r\n return props.observers.map(observer => {\r\n return {observer.name}\r\n })\r\n }, [props.observers]);\r\n\r\n return
\r\n {props.observers.length > 0 ? OBSERVERS: : <>}\r\n {obs}\r\n
\r\n\r\n}\r\n\r\nconst mapState = (state: RootStore): ObsereversPropsType => {\r\n return {\r\n currentUserId: state.connection.connectionId,\r\n observers: state.game.observers\r\n };\r\n}\r\nconst connected = connect(mapState)(Observers);\r\nexport default connected;","import { VoteScaleItem } from \"./VoteScaleItem\";\r\n\r\n\r\nexport type VotesState = {\r\n votes: SingleVoteStat[],\r\n highlightedVote?: VoteHighlight,\r\n};\r\n\r\nexport type SingleVoteStat = {\r\n vote: VoteScaleItem,\r\n votesCount: number,\r\n percentage: number\r\n}\r\n\r\nexport type VoteHighlight = {\r\n highlightType: HighlightType,\r\n highlightedVote?: SingleVoteStat,\r\n highlightedVoteSecond?: SingleVoteStat\r\n}\r\n\r\nexport enum HighlightType {\r\n\r\n SingleVote = \"SingleVote\",\r\n Consensus = \"Consensus\",\r\n MostVotes = \"MostVotes\",\r\n Doubts = \"Doubts\",\r\n Nothing = \"Nothing\"\r\n}","import React, { Component } from 'react';\r\nimport { Card, Table } from 'react-bootstrap';\r\nimport { connect } from 'react-redux';\r\nimport { RootStore } from '../../app/rootReducer';\r\nimport { VoteType } from '../../enums/VoteType';\r\nimport { VotesState } from '../../models/VotesState';\r\nimport \"./results.scss\";\r\n\r\n\r\nexport type ResultsPropsType = {\r\n votesState: VotesState\r\n}\r\n\r\n\r\nconst Results: React.FC = (props) => {\r\n\r\n //memo with rows \r\n const memoRows = React.useMemo(() => {\r\n\r\n // votesState null check \r\n if (!props.votesState) {\r\n return null;\r\n }\r\n\r\n const rows = props.votesState.votes.map((vote, index) => {\r\n return (\r\n \r\n \r\n {vote.vote.voteType !== VoteType.NA ? vote.vote.value :
}\r\n \r\n {vote.votesCount}\r\n {vote.percentage}%\r\n \r\n )\r\n })\r\n return rows;\r\n }, [props.votesState]);\r\n\r\n if (!props.votesState) {\r\n return null;\r\n }\r\n\r\n return
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {memoRows}\r\n \r\n
\r\n POINTS\r\n \r\n VOTES\r\n \r\n PERCENT\r\n
\r\n
\r\n
;\r\n}\r\n\r\nconst mapStateToProps = (store: RootStore): ResultsPropsType => {\r\n return {\r\n votesState: store.game.votesState\r\n };\r\n}\r\n\r\nexport default connect(mapStateToProps)(Results);","import { User } from \"./User\";\r\n\r\nexport type RoomUpdateInfo = {\r\n actionType: UpdateActionType,\r\n timestamp?: number,\r\n actorPlayer: User,\r\n targetPlayer: User\r\n}\r\n\r\nexport enum UpdateActionType {\r\n GameStarted = \"GameStarted\",\r\n TableOpened = \"TableOpened\",\r\n PokedAnother = \"PokedAnother\",\r\n}","import { VoteType } from \"../../enums/VoteType\";\r\nimport { VoteScaleItem } from \"../../models/VoteScaleItem\";\r\nimport React from \"react\";\r\n\r\nexport const getVoteText = (vote: VoteScaleItem) => {\r\n return (\r\n <>{vote.voteType !== VoteType.NA ? vote.value :
}\r\n );\r\n}\r\n","import React, { useMemo } from 'react';\r\nimport { TableState } from '../../enums/TableState';\r\n\r\nimport './GameTable.scss';\r\nimport \"../../icons.scss\";\r\nimport { User } from '../../models/User';\r\nimport { RootStore } from '../../app/rootReducer';\r\nimport { connect } from 'react-redux';\r\nimport { HighlightType, VotesState } from '../../models/VotesState';\r\nimport { ProgressBar } from 'react-bootstrap';\r\nimport { getVoteText } from '../Reusable/Vote';\r\n\r\nexport type TablePanelPropsType = {\r\n tableState: TableState,\r\n players: User[],\r\n stat: VotesState\r\n}\r\n\r\nconst GameTable: React.FC = (props) => {\r\n const { tableState, players, stat } = props;\r\n\r\n const getProgressBarText = useMemo(() => {\r\n const tableState = props.tableState;\r\n if (tableState === TableState.Voting)\r\n return 'Waiting for all votes ...';\r\n if (stat == null) {\r\n return null;\r\n }\r\n if (tableState === TableState.Opened) {\r\n switch (stat.highlightedVote?.highlightType) {\r\n case null:\r\n return \"NA\";\r\n case HighlightType.Consensus:\r\n return \"Consensus!\"\r\n case HighlightType.MostVotes:\r\n return \"Most votes\"\r\n case HighlightType.Nothing:\r\n case HighlightType.Doubts:\r\n return \"\";\r\n case HighlightType.SingleVote:\r\n return \"Single vote\";\r\n }\r\n }\r\n }, [props.tableState, stat]);\r\n\r\n const getVotesStat = useMemo(() => {\r\n if (stat == null) {\r\n return null;\r\n }\r\n switch (stat.highlightedVote?.highlightType) {\r\n case null:\r\n return \"NA\";\r\n case HighlightType.Consensus:\r\n case HighlightType.SingleVote:\r\n return
{getVoteText(stat.highlightedVote.highlightedVote.vote)}
\r\n case HighlightType.MostVotes:\r\n return
{getVoteText(stat.highlightedVote.highlightedVote.vote)}
\r\n case HighlightType.Doubts:\r\n return
{getVoteText(stat.highlightedVote.highlightedVote.vote)} or {getVoteText(stat.highlightedVote.highlightedVoteSecond.vote)}
\r\n case HighlightType.Nothing:\r\n return
No conclusion
\r\n }\r\n }, [stat]);\r\n\r\n\r\n const now = useMemo(() => {\r\n return props.players.filter(x => x.vote != null).length;\r\n }, [props.players]);\r\n\r\n\r\n return (
\r\n \r\n {tableState === TableState.Opened && stat?.highlightedVote && <>\r\n
{getVotesStat}
\r\n }\r\n {tableState === TableState.Voting && <> \r\n
{`${now}/${players.length}`}
}\r\n\r\n\r\n
);\r\n}\r\n\r\nconst mapStateToProps = (state: RootStore): TablePanelPropsType => {\r\n return {\r\n tableState: state.game.tableState,\r\n players: state.game.players,\r\n stat: state.game.votesState\r\n };\r\n}\r\n\r\nexport default connect(mapStateToProps)(GameTable);","export const IdontKnow = 'I don\\'t know';","import React, { useEffect, useState } from 'react';\r\nimport { OverlayTrigger, Popover, Tooltip } from 'react-bootstrap';\r\nimport { connect, ConnectedProps } from 'react-redux';\r\nimport { pokeAction } from '../../app/game/gameSlice';\r\nimport { RootStore } from '../../app/rootReducer';\r\nimport { AppDispatch } from '../../app/store';\r\nimport { PlayerState } from '../../enums/PlayerState';\r\nimport { TableState } from '../../enums/TableState';\r\nimport { VoteType } from '../../enums/VoteType';\r\nimport { IdontKnow } from '../../models/consts';\r\nimport { VoteScaleItem } from '../../models/VoteScaleItem';\r\nimport './Player.scss'\r\n\r\n// type PlayerPropsType = {\r\n// userName: string;\r\n// userId: string;\r\n// isMe: boolean;\r\n// points?: VoteScaleItem;\r\n// isFirst: boolean;\r\n// isLast: boolean;\r\n// playerStatus: PlayerState;\r\n// pointsHistory?: string[];\r\n// tableState: TableState\r\n// }\r\n\r\n\r\n\r\nconst Player: React.FC = (props: PlayerPropsType) => {\r\n\r\n const doesntKnow = props.points?.voteType === VoteType.NA;\r\n const showCards = props.tableState === TableState.Opened;\r\n\r\n const [pokeButtonVisible, setPokeButtonVisible] = useState(false);\r\n const [isHidingPokeButton, setIsHidingPokeButton] = useState(false);\r\n\r\n\r\n useEffect(() => {\r\n if (isHidingPokeButton) {\r\n setTimeout(() => {\r\n setPokeButtonVisible(!props.isPoked);\r\n }, 1000);\r\n } else {\r\n setPokeButtonVisible(!props.isPoked);\r\n }\r\n }, [props.isPoked, isHidingPokeButton]);\r\n\r\n return (\r\n
\r\n {props.isMe &&
}\r\n
\r\n
\r\n
\r\n {\r\n
\r\n
{!doesntKnow && props.points?.value}\r\n {doesntKnow &&
}
\r\n
\r\n }\r\n
\r\n {\r\n (!props.isMe && !showCards) && \r\n \r\n \r\n \r\n \r\n }\r\n
\r\n
\r\n {props.userName}\r\n {\r\n (!props.isMe && props.playerStatus === PlayerState.Idle && pokeButtonVisible)\r\n && \r\n }\r\n
\r\n
);\r\n}\r\n\r\nconst mapStateToProps = (state: RootStore, ownProps: { index: number }) => {\r\n const player = state.game.players[ownProps.index];\r\n\r\n return {\r\n isFirst: player.isFirstVoted,\r\n isLast: player.isLastVoted,\r\n isMe: player.isMe,\r\n points: player.vote,\r\n userId: player.id,\r\n userName: player.name,\r\n playerStatus: player.status,\r\n tableState: state.game.tableState,\r\n isPoked: player.isPoked\r\n };\r\n}\r\n\r\nconst mapDispatch = (dispatch: AppDispatch) => {\r\n return {\r\n doPoke: (playerId: string) => {\r\n dispatch(pokeAction({\r\n message: playerId\r\n }));\r\n }\r\n }\r\n}\r\nconst connector = connect(mapStateToProps, mapDispatch)\r\n\r\nexport type PlayerPropsType = ConnectedProps;\r\nexport default connector(Player);","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RootStore } from '../../app/rootReducer';\r\nimport { TableState } from '../../enums/TableState';\r\nimport { User } from '../../models/User';\r\nimport Player from './Player';\r\nimport \"./Player.scss\";\r\n\r\nexport type PlayersRowPropsType = {\r\n players: User[],\r\n showCards: boolean\r\n}\r\n\r\nconst PlayersRow: React.FC = (props) => {\r\n\r\n const findEllipseCoordinates = (phi: number): { x: number, y: number } => {\r\n let a = 300;\r\n let b = 200;\r\n\r\n let x = a * Math.cos(phi);\r\n let y = b * Math.sin(phi);\r\n\r\n return { x: Math.round(x), y: Math.round(y) };\r\n }\r\n\r\n const findPhis = (numberOfPlayers: number): number[] => {\r\n let divider = numberOfPlayers;\r\n\r\n\r\n let angle = 2 * Math.PI / divider;\r\n\r\n var arr = [];\r\n for (var i = 0; i < numberOfPlayers; i++) {\r\n let computedAngle = i * angle;\r\n arr.push(computedAngle);\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n const renderCards = () => {\r\n let phis = findPhis(props.players.length);\r\n let coords = phis.map(phi => findEllipseCoordinates(phi));\r\n\r\n return props.players.map((player, index) => (\r\n
\r\n {}\r\n
\r\n ));\r\n }\r\n return (
{renderCards()}
);\r\n}\r\n\r\nconst mapStateToProps = (state: RootStore): PlayersRowPropsType => {\r\n return {\r\n players: state.game.players,\r\n showCards: state.game.tableState === TableState.Opened\r\n };\r\n}\r\nexport default connect(mapStateToProps)(PlayersRow);","import React, { useEffect } from 'react';\r\nimport { connect, ConnectedProps } from 'react-redux';\r\nimport { RootStore } from '../app/rootReducer';\r\nimport GameTable from './Table/GameTable';\r\nimport PlayersRow from './Player/PlayersRow';\r\nimport { AppDispatch } from '../app/store';\r\nimport { ActivityThreshold, updateActivityAction } from '../app/game/gameSlice';\r\n\r\n\r\nconst Main: React.FC = (props) => {\r\n useEffect(() => {\r\n let lastMouseMove = Date.now();\r\n function watchMouseMove() {\r\n\r\n const diff = ActivityThreshold;\r\n const d = Date.now() - lastMouseMove;\r\n if (d > diff) {\r\n lastMouseMove = (Date.now() + diff);\r\n props.updateActivity();\r\n }\r\n }\r\n document.body.addEventListener('mousemove', watchMouseMove);\r\n return function cleanup() {\r\n window.removeEventListener('mousemove', watchMouseMove);\r\n }\r\n });\r\n\r\n return
\r\n \r\n \r\n
;\r\n\r\n}\r\n\r\nconst mapState = (store: RootStore) => {\r\n const me = store.game.players.find(x => x.isMe);\r\n return {\r\n me: me,\r\n players: store.game.players,\r\n tableState: store.game.tableState\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: AppDispatch) => {\r\n return {\r\n updateActivity: () => dispatch(updateActivityAction())\r\n };\r\n};\r\n\r\nconst connector = connect(mapState, mapDispatchToProps);\r\n\r\nexport type MainPropsType = ConnectedProps;\r\n\r\nexport default connector(Main);","import React, { useEffect, useState } from \"react\";\r\nimport { Alert, Spinner } from \"react-bootstrap\";\r\nimport { connect } from \"react-redux\";\r\nimport { RootStore } from \"../../app/rootReducer\";\r\nimport { ConnectionStateType } from \"../../enums/ConnectionStateType\";\r\nimport \"./ReconnectingIndicator.scss\";\r\n\r\ntype IndicatorPropsType = {\r\n isReconnecting: boolean,\r\n isAbandoned: boolean,\r\n}\r\n\r\nconst Indicator: React.FC = (props) => {\r\n const [isShown, setIsShown] = useState(false);\r\n const [isHiding, setIsHiding] = useState(false);\r\n\r\n useEffect(() => {\r\n if (props.isReconnecting || props.isAbandoned) {\r\n setIsShown(props.isReconnecting || props.isAbandoned);\r\n return;\r\n }\r\n setIsHiding(true);\r\n setTimeout(() => {\r\n setIsShown(false);\r\n setIsHiding(false);\r\n }, 500);\r\n }, [props]);\r\n\r\n if (!isShown) {\r\n return null;\r\n }\r\n return
\r\n
\r\n \r\n {props.isReconnecting && <> \r\n Loading...\r\n Trying to reconnect}\r\n {props.isAbandoned && Failed to reconnect. Please try to refresh page and re-join the room.}\r\n \r\n
\r\n
;\r\n}\r\n\r\nconst mapStateToProps = (state: RootStore): IndicatorPropsType => {\r\n return {\r\n isReconnecting: state.connection.state === ConnectionStateType.RetryingToConnect\r\n || state.connection.state === ConnectionStateType.Connecting\r\n || (state.connection.state === ConnectionStateType.Disconnected && !state.connection.isAbandoned),\r\n isAbandoned: state.connection.isAbandoned\r\n };\r\n}\r\n\r\nexport default connect(mapStateToProps)(Indicator);\r\n","import React from \"react\";\r\n\r\nimport \"./Footer.scss\";\r\nimport { OverlayTrigger, Popover } from \"react-bootstrap\";\r\n\r\nexport const AllRightsReserved = () => {\r\n return
\r\n Made in Germany by  \r\n \r\n \r\n
\r\n Contributors
\r\n Maxim Lutsan,\r\n Dmitrii Vavel,\r\n George Minko,\r\n Igor Kamynin,\r\n Roman Kadkalo,\r\n Eugene Kolomytsev,\r\n Maxim Shestakov and others\r\n
\r\n\r\n
\r\n \r\n }>\r\n 7pace Labs\r\n \r\n\r\n
\r\n}","import React from \"react\";\r\n\r\nimport \"./Footer.scss\";\r\n\r\nexport const PoweredBy7pace: React.FC = () => {\r\n return <>\r\n}","import React from 'react';\r\nimport { connect, ConnectedProps } from 'react-redux';\r\nimport { gameSlice } from '../../app/game/gameSlice';\r\nimport { RootStore } from '../../app/rootReducer';\r\nimport { connectionSlice } from '../../app/signalR/connectionSlice';\r\nimport { SignalActions } from '../../app/signalR/SignalRMiddleware';\r\nimport { AppDispatch } from '../../app/store';\r\nimport { TableState } from '../../enums/TableState';\r\n\r\nimport './GameButtons.scss';\r\n\r\n\r\n\r\nconst GameButtons: React.FC = (props) => {\r\n return (\r\n
\r\n
\r\n\r\n
\r\n
\r\n VOTED\r\n
\r\n\r\n
\r\n
\r\n IDLE\r\n
\r\n\r\n
\r\n
\r\n THINKING\r\n
\r\n\r\n
\r\n \r\n \r\n
\r\n
\r\n
);\r\n}\r\n\r\nconst mapStateToProps = (state: RootStore) => {\r\n return {\r\n state: state.game.tableState,\r\n roomId: state.connection.roomId,\r\n canShowCards: state.game.players.some(p => p.vote != null)\r\n }\r\n}\r\nconst mapDispatchToProps = (dispatch: AppDispatch) => {\r\n return {\r\n show: (roomId: string) => dispatch(connectionSlice.actions.callSignalR({\r\n action: SignalActions.ShowVotes,\r\n args: [roomId]\r\n })),\r\n startNew: (roomId: string) => dispatch(connectionSlice.actions.callSignalR({\r\n action: SignalActions.StartVoting,\r\n args: [roomId]\r\n })),\r\n }\r\n}\r\nconst connector = connect(mapStateToProps, mapDispatchToProps)\r\n\r\nexport type ActionButtonsPropsType = ConnectedProps;\r\nexport default connector(GameButtons);","import React, { useMemo } from 'react';\r\nimport { connect, ConnectedProps } from 'react-redux';\r\nimport { Transition } from 'react-transition-group';\r\nimport { myVotingPerformed } from '../../app/game/gameSlice';\r\nimport { RootStore } from '../../app/rootReducer';\r\nimport { AppDispatch } from '../../app/store';\r\nimport { RolesEnum } from '../../enums/RolesEnum';\r\nimport { VoteType } from '../../enums/VoteType';\r\nimport { IdontKnow } from '../../models/consts';\r\nimport { VoteScaleItem } from '../../models/VoteScaleItem';\r\nimport \"./style.scss\";\r\n\r\n\r\nconst ControlPanel: React.FC = (props) => {\r\n\r\n const [isIn, setIsIn] = React.useState(false);\r\n\r\n useMemo(() => {\r\n setTimeout(() => {\r\n setIsIn(true);\r\n }, 0);\r\n }, [props.voteScale]);\r\n\r\n useMemo(() => {\r\n setIsIn(false);\r\n }, [props.voteScale]);\r\n\r\n const points = useMemo(() => {\r\n if (props.me == null) {\r\n return \"\";\r\n }\r\n\r\n const num = props.voteScale.scale.length;\r\n let i = 0;\r\n const radius = 600;\r\n const degrees = 45 * Math.PI / 180;\r\n const step = degrees / (num - 1);\r\n\r\n const start = - degrees / 2;\r\n\r\n return props.voteScale.scale.map((point) => {\r\n const angle = start + step * i;\r\n\r\n const y = radius - radius * Math.cos(angle);\r\n const x = radius * Math.sin(angle);\r\n\r\n i++;\r\n var className = point.value === props.me.vote?.value ? \"poker-card active\" : \"poker-card\";\r\n var idk = point.voteType === VoteType.NA;\r\n className = idk ? className + \" dont-know\" : className;\r\n const divStyle = {\r\n transform: `translate( ${Math.round(y)}px, ${Math.round(x)}px)`,\r\n opacity: 1\r\n };\r\n\r\n return (\r\n \r\n {state => (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n );\r\n });\r\n }, [props, isIn]);\r\n\r\n const isPlayer = props.me?.role === RolesEnum.Player;\r\n\r\n return isPlayer &&
\r\n
\r\n {points}\r\n
\r\n
;\r\n}\r\n\r\nconst mapStateToProps = (state: RootStore) => {\r\n return {\r\n state: state.game.tableState,\r\n voteScale: state.settings.settings.activeVoteScale,\r\n me: state.game.players.find(x => x.isMe)\r\n }\r\n}\r\nconst mapDispatchToProps = (dispatch: AppDispatch) => {\r\n return {\r\n doVoting: (vote: VoteScaleItem, playerId: string) => dispatch(myVotingPerformed({\r\n message: vote\r\n }))\r\n }\r\n}\r\nconst connector = connect(mapStateToProps, mapDispatchToProps)\r\n\r\nexport type ControlPanelPropsType = ConnectedProps;\r\n\r\nexport default connector(ControlPanel);","import React from \"react\"\r\nimport { VoteType } from \"../../enums/VoteType\"\r\nimport { IdontKnow } from \"../../models/consts\"\r\nimport { VoteScaleItem } from \"../../models/VoteScaleItem\"\r\n\r\nexport type VoteScaleItemViewProps = {\r\n item: VoteScaleItem;\r\n}\r\n\r\nconst VoteScaleItemView: React.FC = (props) => {\r\n\r\n if (props.item.voteType === VoteType.Normal) {\r\n return
\r\n {props.item.value}\r\n
;\r\n }\r\n if (props.item.voteType === VoteType.NA) {\r\n return
\r\n {IdontKnow}\r\n
;\r\n }\r\n}\r\n\r\nexport default VoteScaleItemView;","import React, { useMemo } from 'react';\r\nimport { VoteType } from '../../enums/VoteType';\r\nimport { VoteScales } from '../../models/Settings';\r\nimport { VoteScaleItem } from '../../models/VoteScaleItem';\r\nimport VoteScaleItemView from './VoteScaleItem';\r\n\r\nexport type CustomScaleProps = {\r\n isSelected: boolean;\r\n scale: VoteScales;\r\n update: (scale: VoteScales) => void;\r\n}\r\n\r\nconst CustomScale: React.FC = (props) => {\r\n\r\n const [scaleItems, setScaleItems] = React.useState(props.scale.scale);\r\n\r\n const updateScaleItems = (scaleItems: VoteScaleItem[]) => {\r\n setScaleItems(scaleItems);\r\n props.update({\r\n id: props.scale.id,\r\n scale: scaleItems,\r\n });\r\n }\r\n\r\n return (\r\n
\r\n
Custom
\r\n
\r\n
\r\n {scaleItems.map((item, index) => {\r\n return (\r\n item.voteType === VoteType.Normal ?
\r\n {\r\n e.persist();\r\n const cloned = [...scaleItems];\r\n const newItem = { ...cloned[index] };\r\n newItem.value = e.target.value;\r\n cloned[index] = newItem;\r\n updateScaleItems(cloned);\r\n }} />\r\n
:
\r\n )\r\n })}\r\n
\r\n {scaleItems.length > 0 && }\r\n
\r\n
\r\n {scaleItems.length < 10 && }\r\n
\r\n
\r\n {scaleItems.length < 10 && scaleItems.filter(x => x.voteType === VoteType.NA)\r\n .length == 0 && }\r\n
\r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default CustomScale;","import React, { useMemo } from 'react';\r\nimport { Alert, Form, Modal } from 'react-bootstrap';\r\nimport { connect, ConnectedProps } from 'react-redux';\r\nimport { RootStore } from '../../app/rootReducer';\r\nimport { SettingsUpdatePayload, settingsVisibilityAction, updateSettingsAction } from '../../app/settings/settingsSlice';\r\nimport { AppDispatch } from '../../app/store';\r\nimport { VoteScales } from '../../models/Settings';\r\nimport CustomScale from './CustomScale';\r\nimport \"./settings.scss\";\r\nimport VoteScaleItemView from './VoteScaleItem';\r\n\r\nconst CustomScaleId = \"custom\";\r\n\r\nconst Settings: React.FC = (props) => {\r\n\r\n const [selectedVoteScaleId, setSelectedVoteScaleId] = React.useState(props.settings.selectedVoteScaleId);\r\n const [voteScales, setVoteScales] = React.useState(props.settings.voteScales);\r\n\r\n useMemo(() => {\r\n setVoteScales(props.settings.voteScales);\r\n setSelectedVoteScaleId(props.settings.selectedVoteScaleId);\r\n }, [props.settings]);\r\n\r\n const getSelectedScale = () => {\r\n return voteScales.find(x => x.id === selectedVoteScaleId);\r\n }\r\n\r\n const scaleButtons = (scale: VoteScales) => {\r\n return scale.scale.map((item, index) => {\r\n return (\r\n \r\n );\r\n });\r\n }\r\n\r\n const scales = useMemo(() => {\r\n const updateCustomScale = (scale: VoteScales) => {\r\n setVoteScales([...voteScales.filter(x => x.id !== CustomScaleId), scale]);\r\n }\r\n return voteScales.map((scale) => {\r\n return
\r\n setSelectedVoteScaleId(scale.id)}\r\n />\r\n {scale.id === CustomScaleId ? : scaleButtons(scale)}\r\n
\r\n })\r\n }, [voteScales, selectedVoteScaleId]);\r\n\r\n\r\n if (!props.isVisible) {\r\n return null;\r\n }\r\n\r\n return (
\r\n \r\n \r\n Settings\r\n \r\n \r\n
\r\n
\r\n
Scales
\r\n {scales}\r\n
\r\n
\r\n {props.validationErrors[\"custom\"] ? \r\n {props.validationErrors[\"custom\"]}\r\n : null}\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n}\r\n\r\nconst mapProps = (store: RootStore) => {\r\n return {\r\n isVisible: store.settings.isVisible,\r\n settings: store.settings.settings,\r\n validationErrors: store.settings.validationErrors\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: AppDispatch) => {\r\n return {\r\n cancel: () => dispatch(settingsVisibilityAction(false)),\r\n saveSettings: (payload: SettingsUpdatePayload) => dispatch(updateSettingsAction(payload))\r\n };\r\n};\r\n\r\nconst connector = connect(mapProps, mapDispatchToProps)\r\n\r\nexport type SettingsPropsType = ConnectedProps;\r\n\r\nexport default connector(Settings);","import React from 'react';\r\nimport { RootStore } from '../../app/rootReducer';\r\nimport withRoomCheckContainer from '../../app/withRoomCheckContainer';\r\nimport { connect } from 'react-redux';\r\nimport \"./GameContainer.scss\";\r\nimport { User } from '../../models/User';\r\nimport { TableState } from '../../enums/TableState';\r\nimport { RoomUpdateInfo, UpdateActionType } from '../../models/RoomUpdateInfo';\r\n\r\nexport type GameStatPropsType = {\r\n state: RoomUpdateInfo\r\n}\r\n\r\n\r\nconst GameStat: React.FC = (props: GameStatPropsType) => {\r\n\r\n const [isMessageHidden, setIsMessageHidden] = React.useState(true);\r\n\r\n let actionText = \"\";\r\n switch (props.state.actionType) {\r\n case UpdateActionType.GameStarted:\r\n actionText = \" started new round\";\r\n break;\r\n case UpdateActionType.TableOpened:\r\n actionText = \" opened cards\";\r\n break;\r\n case UpdateActionType.PokedAnother:\r\n actionText = \" poked \";\r\n break;\r\n }\r\n let timeout = React.useRef(null);\r\n\r\n React.useEffect(() => {\r\n setIsMessageHidden(false);\r\n if (timeout.current != null) {\r\n clearInterval(timeout.current);\r\n }\r\n timeout.current = setTimeout(() => {\r\n setIsMessageHidden(true);\r\n }, 10000);\r\n\r\n }, [props]);\r\n\r\n return
\r\n
\r\n \r\n {props.state.actorPlayer &&
\r\n {props.state.actorPlayer.name}\r\n {actionText}\r\n {props.state.targetPlayer && {props.state.targetPlayer.name}}\r\n
}\r\n
\r\n
;\r\n}\r\n\r\nconst GameStatStopwatch: React.FC<{ timestamp: number }> = (props) => {\r\n const [timeElapsed, setTimeElapsed] = React.useState(0);\r\n let interval = React.useRef(null);\r\n\r\n React.useEffect(() => {\r\n if (interval.current != null) {\r\n clearInterval(interval.current);\r\n const now = new Date().getTime();\r\n setTimeElapsed(now - props.timestamp);\r\n }\r\n interval.current = setInterval(() => {\r\n const now = new Date().getTime();\r\n setTimeElapsed(now - props.timestamp);\r\n }, 1000);\r\n\r\n }, [props]);\r\n\r\n const minutes = Math.floor(timeElapsed / 60000);\r\n const seconds = Math.floor((timeElapsed % 60000) / 1000);\r\n\r\n return \r\n {minutes < 10 ? \"0\" + minutes : minutes}:{seconds < 10 ? \"0\" + seconds : seconds}\r\n ;\r\n}\r\n\r\nconst mapStateToProps = (state: RootStore): GameStatPropsType => {\r\n if (state.game.roomStat == null) {\r\n return {\r\n state: {\r\n actionType: UpdateActionType.GameStarted,\r\n actorPlayer: null,\r\n targetPlayer: null,\r\n }\r\n }\r\n }\r\n return {\r\n state: state.game.roomStat\r\n };\r\n}\r\n\r\nconst container = connect(mapStateToProps)(GameStat);\r\n\r\nexport default container;\r\n","import { ConnectedRouter } from \"connected-react-router\";\r\nimport React from \"react\";\r\nimport { Provider } from \"react-redux\";\r\nimport { Route, Switch } from \"react-router-dom\";\r\nimport GameContainer from \"./components/Game/GameContainer\";\r\nimport { LoginContol } from \"./components/Login/Login\";\r\nimport { History } from 'history';\r\nimport { EnhancedStore } from \"@reduxjs/toolkit\";\r\n\r\nexport const reactPointingPokerApp = (store: EnhancedStore, pokerHistory: History) => {\r\n const app = \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ;\r\n\r\n return app;\r\n}","import React, { useEffect, useRef } from 'react';\r\nimport { RootStore } from '../../app/rootReducer';\r\nimport withRoomCheckContainer from '../../app/withRoomCheckContainer';\r\nimport GameHeader from '../GameHeader/GameHeader';\r\nimport Observers from '../Observers/Observers';\r\nimport Results from '../Results/Results';\r\nimport Main from '../Main';\r\nimport ReconnectingIndicator from '../ReconnectingIndicator/ReconnectingIndicator';\r\nimport { ConnectionStateType } from '../../enums/ConnectionStateType';\r\nimport { connect } from 'react-redux';\r\nimport \"./GameContainer.scss\";\r\nimport { AllRightsReserved } from '../Footer/AllRightsReserved';\r\nimport { PoweredBy7pace } from '../Footer/PoweredBy7pace';\r\nimport GameButtons from '../GameButtons/GameButtons';\r\nimport ControlPanel from '../ControlPanel/ControlPanel';\r\nimport Settings from '../Settings/Settings';\r\nimport GameStat from './GameStat';\r\n\r\nexport type GamePropsType = {\r\n isReconnecting: boolean,\r\n isBeingPoked: boolean\r\n}\r\n\r\nexport type StringOrNull = string | null;\r\n\r\nconst Game: React.FC = (props: GamePropsType) => {\r\n\r\n\r\n\r\n return
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n
;\r\n}\r\n\r\n\r\nconst mapStateToProps = (state: RootStore): GamePropsType => {\r\n return {\r\n isReconnecting: state.connection.state === ConnectionStateType.Disconnected\r\n || state.connection.state === ConnectionStateType.RetryingToConnect\r\n || state.connection.isAbandoned,\r\n isBeingPoked: state.game.isBeingPoked\r\n };\r\n}\r\n\r\nconst container = withRoomCheckContainer(connect(mapStateToProps)(Game))\r\n\r\nexport default container;\r\n","import React from \"react\";\r\nimport { RolesEnum } from \"../../enums/RolesEnum\";\r\nimport { AllRightsReserved } from \"../Footer/AllRightsReserved\";\r\nimport 'react-dropdown/style.css';\r\nimport \"../../icons.scss\";\r\nimport \"./Login.scss\";\r\nimport Dropdown from 'react-dropdown';\r\nimport { PoweredBy7pace } from \"../Footer/PoweredBy7pace\";\r\nimport { connect, ConnectedProps } from \"react-redux\";\r\nimport { RootStore } from \"../../app/rootReducer\";\r\nimport { doLoginAction, loginSlice } from \"./loginSlice\";\r\nimport { useParams } from \"react-router\";\r\nimport { Alert } from \"react-bootstrap\";\r\n\r\n\r\nconst Login: React.FC = (props: PropsFromRedux) => {\r\n const [selectedName, setSelectedName] = React.useState(props.name ?? \"\");\r\n const [selectedRole, setSelectedRole] = React.useState(props.role ?? RolesEnum.Player);\r\n const [shaky, setShaky] = React.useState(false);\r\n const [validationError, setValidationError] = React.useState(false);\r\n const mounted = React.useRef(false);\r\n const { roomId } = useParams<{ roomId: string }>();\r\n\r\n React.useEffect(() => {\r\n mounted.current = false;\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n var obj = { username: selectedName, role: selectedRole };\r\n localStorage.setItem('userProps', JSON.stringify(obj));\r\n if ((selectedName ?? \"\").trim() != '') {\r\n setValidationError(false);\r\n }\r\n }, [selectedName, selectedRole]);\r\n\r\n React.useEffect(() => {\r\n if (!mounted.current) {\r\n mounted.current = true;\r\n return;\r\n }\r\n setShaky(true);\r\n setTimeout(() => {\r\n setShaky(false);\r\n }, 500);\r\n }, [selectedRole]);\r\n\r\n const validateAndLogin = () => {\r\n if (!(selectedName ?? \"\").trim()) {\r\n setValidationError(true);\r\n return;\r\n }\r\n setValidationError(false);\r\n\r\n if (roomId) {\r\n props.setDesiredRoomId(roomId);\r\n }\r\n\r\n props.doLogin({ name: selectedName, role: selectedRole });\r\n }\r\n\r\n\r\n return
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n {props.isRoomRemoved && \r\n Your room was closed as it was inactive for a long time.\r\n
\r\n Just create a new one to continue estimating.\r\n
}\r\n
\r\n {!props.name &&

Enter room

}\r\n {props.name &&

Welcome back, {props.name}

}\r\n
\r\n
\r\n
\r\n \r\n {\r\n if (event.key === 'Enter') {\r\n validateAndLogin();\r\n }\r\n }} defaultValue={selectedName} placeholder=\"Name\" onChange={(event: React.ChangeEvent) => setSelectedName(event.target.value)} >\r\n {validationError && Please enter your name}\r\n
\r\n
\r\n \r\n setSelectedRole(option.value as RolesEnum)}\r\n />\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n}\r\n\r\nconst mapState = (store: RootStore) => store.login;\r\n\r\nconst mapDispatch = {\r\n doLogin: doLoginAction,\r\n setDesiredRoomId: loginSlice.actions.setDesiredRoomId\r\n}\r\n\r\nconst connector = connect(mapState, mapDispatch)\r\n\r\ntype PropsFromRedux = ConnectedProps\r\n\r\nexport const LoginContol = connector(Login);","import ReactDOM from 'react-dom';\r\nimport \"./styles.scss\";\r\nimport \"./index.scss\";\r\n\r\nimport rootSaga from './app/rootSaga';\r\n\r\nimport { reactPointingPokerApp } from './App';\r\nimport { pokerHistory, sagaMiddleware, store } from './app/store';\r\n\r\nconst rootElement = document.getElementById('root');\r\n// then run the saga\r\nsagaMiddleware.run(rootSaga);\r\nReactDOM.render(reactPointingPokerApp(store, pokerHistory), rootElement);\r\n"],"sourceRoot":""}