{"version":3,"sources":["images/logo.png","models/calls/types.ts","stores/base/BaseReducer.ts","stores/calls/actions/getCall.ts","models/error/types.ts","stores/calls/actions/disconnectCall.ts","models/auth/types.ts","stores/calls/actions/joinCall.ts","stores/calls/actions/startStream.ts","stores/calls/actions/stopStream.ts","stores/calls/actions/getActiveCalls.ts","stores/calls/actions/startInjectionStream.ts","stores/calls/actions/muteBot.ts","stores/calls/actions/unmuteBot.ts","stores/calls/actions/refreshStreamKey.ts","stores/calls/actions/updateStreamPhoto.ts","stores/calls/reducer.ts","stores/calls/actions/newStreamDrawer.ts","stores/calls/actions/newInjectionStreamDrawer.ts","stores/calls/actions/updateDefaults.ts","stores/config/reducer.ts","stores/config/actions.ts","stores/auth/actions.ts","stores/auth/reducer.ts","stores/error/reducer.ts","stores/error/actions.ts","stores/requesting/reducer.ts","stores/toast/actions.ts","stores/toast/reducer.ts","middlewares/errorToastMiddleware.ts","stores/service/actions.ts","stores/service/reducer.ts","services/store/index.ts","services/auth/index.ts","stores/auth/asyncActions.ts","views/call-details/components/CallSelector.tsx","stores/calls/selectors.ts","services/api/index.ts","models/error/helpers.ts","stores/config/loader.ts","views/call-details/components/CallInfo.tsx","stores/calls/asyncActions.ts","views/call-details/components/NewStreamDrawer.tsx","views/call-details/components/StreamCard.tsx","views/call-details/components/InjectionCard.tsx","views/call-details/components/CallStreams.tsx","views/call-details/components/NewInjectionStreamDrawer.tsx","views/call-details/CallDetails.tsx","views/components/Footer.tsx","views/components/NavBar.tsx","views/components/Header.tsx","views/components/NotFound.tsx","views/components/PrivateRoute.tsx","views/home/components/ActiveCallCard.tsx","stores/requesting/selectors.ts","views/home/Home.tsx","models/service/types.ts","views/join-call/JoinCall.tsx","services/helpers.ts","views/login/LoginPage.tsx","views/service/BotServiceStatusCard.tsx","stores/service/asyncActions.ts","hooks/useInterval.tsx","views/service/BotServiceStatus.tsx","views/unauthorized/Unauthorized.tsx","App.tsx","index.tsx","stores/config/asyncActions.ts"],"names":["module","exports","StreamProtocol","CallState","CallType","StreamState","StreamType","ActiveStatuses","Ready","Receiving","NotReceiving","Stopping","InactiveStatuses","Disconnected","Starting","StreamMode","RtmpMode","KeyLength","SpecialStreamTypes","VbSS","PrimarySpeaker","LargeGallery","LiveEvent","TogetherMode","baseReducer","initialState","methods","state","action","method","type","error","RequestCallType","DefaultError","message","raw","id","uuidv4","this","ApiError","status","errors","url","requestDisconnectCallFinished","payload","meta","AuthStatus","UserRoles","requestPollingCallFinished","requestJoinCall","callUrl","requestJoinCallFinished","requestStartStreamFinished","requestStopStreamFinished","requestActiveCallsFinished","requestStartInjectionStreamFinished","requestMuteBotFinished","requestUnmuteBotFinished","requestRefreshStreamKeyFinished","updateStreamPhoto","streamId","photo","callId","callsReducer","newStream","newInjectionStream","newCall","activeCalls","activeCallsLoading","activeCallsError","calls","map","call","fillDefaults","defaultCallValues","Establishing","callWitDefaults","concat","existingCall","find","o","requestCallType","NewCall","ExistingCall","resource","activeCall","updatedStream","streams","stream","participantId","streamType","participantName","advancedSettings","latency","defaultLatency","key","defaultPassphrase","unmixedAudio","keyLength","defaultKeyLength","enableSsl","c","injectionStream","defaults","updated","defaultProtocol","protocol","passphrase","privateContext","streamKey","updatedCall","filter","None","SRT","audioSharing","configReducer","initialized","app","userAuthenticating","authStatus","Authenticating","userAuthenticated","userProfile","Authenticated","userUnauthorized","Unauthorized","userAuthenticationError","rawError","authReducer","Unauthenticated","username","role","Producer","errorReducer","Object","entries","reduce","newState","value","isDefaultError","Boolean","isFinishedRequestType","includes","isStartRequestType","stateWithoutFinishedType","isError","requestingReducer","isRequestType","requestName","replace","toastReducer","items","toastId","model","errorToastMiddleware","store","next","errorAction","notification","description","requestStartServiceFinished","requestStopServiceFinished","requestBotServiceFinished","serviceReducer","botServices","loading","botService","history","createBrowserHistory","configureStore","createStore","combineReducers","router","connectRouter","config","auth","toast","requesting","botServiceStatus","composeWithDevTools","applyMiddleware","routerMiddleware","thunkMiddleware","AuthService","appConfig","msalConfig","authority","clientId","spaClientId","redirectUri","redirectUrl","cache","cacheLocation","storeAuthStateInCookie","msalClient","PublicClientApplication","apiClientId","loginRequest","scopes","loginPopup","request","account","getAccountByUsername","undefined","logout","getAllAccounts","acquireTokenSilent","authResult","userRole","getUserRole","accessToken","localAccountId","jwtToken","groupId","decodedToken","jwtDecode","groups","Attendee","signOut","dispatch","a","console","userIsProducer","Option","Select","withRouter","connect","appState","ownProps","name","displayName","selectedCallId","match","params","isNew","path","props","useState","redirectId","setRedirectId","to","push","selectedId","defaultValue","className","onChange","m","selectNewCall","createSelector","selectActiveCalls","selectCallStreams","callState","callEnabled","mainStreams","participantStreams","activeStreams","primarySpeakerEnabled","stageEnabled","callProtocol","Established","Participant","isSharingVideo","isSharingAudio","audioMuted","length","isSharingScreen","selectNewInjectionStreamDrawerProps","selectNewStreamDrawerProps","selectCallInfoProps","CALL_INITIALIZING_PLACEHOLDER","RequestMethod","botFqdn","botIp","connectionPool","available","used","createdAt","Date","errorMessage","joinUrl","meetingType","Default","fillApiErrorWithDefaults","requestUrl","errorResponse","loader","Promise","resolve","reject","Axios","get","then","data","catch","err","getConfig","CallStateBadge","ApiClient","isSecured","shouldOverrideUrl","shouldOverrideBaseUrl","baseRequest","Post","Put","Get","Delete","apiBaseUrl","featureFlags","disableAuthFlag","isActive","refreshAccessToken","token","headers","Authorization","requestConfig","all","delay","response","success","join","responseURL","prototype","hasOwnProperty","title","detail","concatErrorMessages","serverError","statusText","unknownError","defaultError","accounts","getAccounts","requestSilentToken","errorsArray","values","forEach","element","Array","isArray","JSON","stringify","duration","setTimeout","refreshStreamKeyAsync","getState","post","refreshStreamKeyResponse","Text","Typography","Item","Form","Terminating","Terminated","ViewMode","renderStatusBadge","color","CallInfo","useDispatch","useParams","callInfoProps","useSelector","React","setPassphrase","editingDefaults","setEditingDefaults","editingProtocol","setEditingProtocol","editingKeyLength","setEditingKeyLength","toggleEditMode","formRef","createRef","useEffect","current","setFieldsValue","creationDate","moment","formattedCreationDate","format","connected","participantsLength","protocols","keys","i","isNaN","parseInt","baseRules","required","rules","RTMP","hasActiveStreams","onFinish","newDefaults","ref","placement","onConfirm","delete","disonnectCallResponse","disconnectCallAsync","disabled","danger","copyable","text","label","labelAlign","hasFeedback","Group","e","target","p","index","Button","min","max","placeholder","Password","k","shape","icon","size","onClick","htmlType","getConnectionClass","isHealthy","Error","StartingError","StoppingError","getConnectionStatus","StreamCard","callStreams","expanded","setExpanded","photoUrl","responseType","imageUrl","window","URL","webkitURL","createObjectURL","isStreamDisconnected","initials","split","s","toUpperCase","hasStream","operationEnabled","classes","avatarIcon","src","style","width","height","onError","isRtmp","streamUrl","details","getStreamUrl","justify","align","gutter","span","resourceType","participantGraphId","stopStreamResponse","stopStreamAsync","NewStreamDrawer","drawerProps","visible","rtmpPushStreamKey","useReducer","viewMode","Simple","setState","handleChange","handleClose","handleAudioFormatChange","audioFormat","handleTimeOverlayChange","checked","timeOverlay","getStreamConfiguration","mode","Push","renderCommonSettings","destroyOnClose","afterVisibleChange","Pull","Listener","bodyStyle","onClose","footer","startStreamResponse","startStreamAsync","Advanced","Caller","toString","contentEditable","ReloadOutlined","marginLeft","getInjectionUrl","injectionUrl","InjectionCard","setAudioMuted","IconButton","muteBotResponse","unmuteBotAsync","muteBotAsync","startInjectionResponse","stopInjectionAsync","protocolText","streamMode","streamModeText","renderStreams","CallStreams","hasMainStreams","hasParticipants","NewInjectionStreamDrawer","rtmpPushStreamUrl","port","ingest","domain","getRtmpPushStreamUrl","form","startInjectionAsync","layout","initialValues","whitespace","CallDetails","Footer","versionString","buildNumber","navBarLinks","links","selected","location","pathname","Header","userName","Logo","alt","UserOutlined","href","NotFound","textAlign","PrivateRoute","Component","component","rest","isAuthenticated","render","ActiveCallCard","formattedCreation","CallTypeStrings","fontSize","Event","selectRequesting","actionTypes","requestingState","some","actionType","BotServiceInfrastructureState","ProvisioningStateValues","TeamsColors","TeamsMargins","BotServiceStates","Home","isRequesting","activeCallsResponse","hasCalls","MEETING_URL_PATTERN","JoinCall","connectingCall","handlePaste","html","getData","indexOf","meetingLink","rawHTML","doc","document","createElement","innerHTML","getElementsByTagName","urls","getAttribute","extractLinks","test","callUrlRules","pattern","MeetingUrl","joinCallResponse","onPasteCapture","clipboardData","LoginPage","Meta","Card","display","justifyContent","alignItems","bordered","LoginOutlined","signIn","getUserProfile","useStyles","makeStyles","createStyles","rotateIcon","animation","avatarColor","backgroundColor","BotServiceStatusCard","onStart","onStop","serviceState","infrastructure","provisioningDetails","provisioningStateValue","provisioningStateDisplayName","hasTransitioningState","Provisioning","Deprovisioning","stateDisplayName","Provisioned","CardHeader","avatar","Avatar","aria-label","CardContent","List","ListItem","ListItemAvatar","Available","Busy","provisionedIcon","Deprovisioned","ListItemText","primary","secondary","ListItemSecondaryAction","DEFAULT_SERVICE_ID","getBotServiceAsync","getBotServiceResponse","useInterval","callback","savedCallback","useRef","setInterval","currentCallback","clearInterval","ServicePage","isPollingEnabled","setIsPollingEnabled","useCallback","hasBotServices","startServiceResponse","stopBotServiceResponse","isUnauthorized","App","authInitialized","configInitialized","configure","exact","BotServiceStatus","tip","storeDispatch","poll","startsWith","pop","requestCallResponse","ReactDOM","getElementById"],"mappings":"6FAAAA,EAAOC,QAAU,k/R,sYCsBLC,EAKAC,EAOAC,EA0FAC,E,+HAtGAH,O,aAAAA,I,gBAAAA,M,cAKAC,O,+BAAAA,I,6BAAAA,I,6BAAAA,I,4BAAAA,M,cAOAC,O,qBAAAA,I,kBAAAA,M,cA0FAC,O,+BAAAA,I,uBAAAA,I,iBAAAA,I,yBAAAA,I,+BAAAA,I,uBAAAA,I,iCAAAA,I,iCAAAA,I,kBAAAA,M,KAYL,IAIKC,EAJCC,EAAiB,CAACF,EAAYG,MAAOH,EAAYI,UAAWJ,EAAYK,aAAcL,EAAYM,UAElGC,EAAmB,CAACP,EAAYQ,aAAcR,EAAYS,W,SAE3DR,O,eAAAA,I,mCAAAA,I,6BAAAA,I,+BAAAA,I,+BAAAA,I,0BAAAA,M,KASL,IAQKS,EAKA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ohsGmZ+M7FN8qD7H9/bk+x7HIbnTc12gMWhmRwMuaWpfYKgIVNahyGKsqxCs+QDtoBzKSZZEnEEZLXJqD+V0GZ/Lun5xox4EQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAs4Sy11J8At1xKGAmvXDwAAAAASUVORK5CYII=\"","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nexport interface Call {\r\n id: string;\r\n joinUrl: string;\r\n displayName: string; // Call/Room name\r\n state: CallState; // Initializing, Established, Terminating, Terminated\r\n errorMessage: string | null; // Error message (if any)\r\n createdAt: Date;\r\n meetingType: CallType; // Unknown, Normal, Event\r\n botFqdn: string | null;\r\n botIp: string | null;\r\n connectionPool: ConnectionPool;\r\n defaultProtocol: StreamProtocol;\r\n defaultPassphrase: string;\r\n defaultKeyLength: KeyLength;\r\n defaultLatency: number;\r\n streams: Stream[];\r\n injectionStream: InjectionStream | null;\r\n privateContext: PrivateContext | null;\r\n}\r\n\r\nexport enum StreamProtocol {\r\n SRT = 0,\r\n RTMP = 1,\r\n}\r\n\r\nexport enum CallState {\r\n Establishing,\r\n Established,\r\n Terminating,\r\n Terminated,\r\n}\r\n\r\nexport enum CallType {\r\n Default,\r\n Event,\r\n}\r\n\r\nexport interface ConnectionPool {\r\n used: number;\r\n available: number;\r\n}\r\n\r\nexport interface Stream {\r\n id: string; //internal id\r\n callId: string;\r\n participantGraphId: string; //id form teams meeting\r\n displayName: string; // User name or Stream name\r\n photoUrl: string | null;\r\n photo: string | undefined;\r\n type: StreamType; // VbSS, DominantSpeaker, Participant\r\n state: StreamState; // Disconnected, Initializing, Established, Disconnecting, Error\r\n isHealthy: boolean;\r\n healthMessage: string;\r\n isSharingScreen: boolean;\r\n isSharingVideo: boolean;\r\n isSharingAudio: boolean;\r\n audioMuted: boolean;\r\n details: StreamDetails | null;\r\n enableSsl: boolean;\r\n}\r\n\r\nexport interface StartStreamRequest {\r\n participantId?: string;\r\n participantGraphId?: string;\r\n type: StreamType;\r\n callId: string;\r\n protocol: StreamProtocol;\r\n config: StreamConfiguration;\r\n}\r\n\r\nexport interface StopStreamRequest {\r\n callId: string;\r\n type: StreamType;\r\n participantId?: string;\r\n participantGraphId?: string;\r\n participantName?: string;\r\n}\r\n\r\nexport interface NewInjectionStream {\r\n callId: string;\r\n streamUrl?: string;\r\n streamKey?: string;\r\n protocol?: StreamProtocol;\r\n mode?: StreamMode;\r\n latency?: number;\r\n enableSsl?: boolean;\r\n keyLength?: KeyLength;\r\n}\r\n\r\nexport interface StopInjectionRequest {\r\n callId: string;\r\n streamId: string;\r\n}\r\n\r\nexport type StreamConfiguration = {\r\n streamUrl: string;\r\n streamKey?: string;\r\n unmixedAudio: boolean;\r\n audioFormat: number;\r\n timeOverlay: boolean;\r\n enableSsl: boolean;\r\n};\r\n\r\nexport interface StreamSrtConfiguration extends StreamConfiguration {\r\n mode: StreamMode;\r\n latency: number;\r\n keyLength: KeyLength;\r\n}\r\n\r\nexport interface NewCall {\r\n callUrl: string;\r\n status: CallState;\r\n errorMessage?: string;\r\n}\r\n\r\nexport interface CallDefaults {\r\n protocol: StreamProtocol;\r\n latency: number;\r\n passphrase: string;\r\n keyLength: KeyLength;\r\n}\r\n\r\nexport enum StreamState {\r\n Disconnected,\r\n Starting,\r\n Ready,\r\n Receiving,\r\n NotReceiving,\r\n Stopping,\r\n StartingError,\r\n StoppingError,\r\n Error,\r\n}\r\n\r\nexport const ActiveStatuses = [StreamState.Ready, StreamState.Receiving, StreamState.NotReceiving, StreamState.Stopping];\r\n\r\nexport const InactiveStatuses = [StreamState.Disconnected, StreamState.Starting];\r\n\r\nexport enum StreamType {\r\n VbSS = 0,\r\n PrimarySpeaker = 1,\r\n Participant = 2,\r\n TogetherMode = 3,\r\n LargeGallery = 4,\r\n LiveEvent = 5,\r\n}\r\n\r\nexport const SpecialStreamTypes = [\r\n StreamType.VbSS,\r\n StreamType.PrimarySpeaker,\r\n StreamType.LargeGallery,\r\n StreamType.LiveEvent,\r\n StreamType.TogetherMode,\r\n];\r\n\r\nexport enum StreamMode {\r\n Caller = 1,\r\n Listener = 2,\r\n}\r\n\r\nexport enum RtmpMode {\r\n Pull = 1,\r\n Push = 2,\r\n}\r\n\r\nexport enum KeyLength {\r\n None = 0,\r\n SixteenBytes = 16,\r\n TwentyFourBytes = 24,\r\n ThirtyTwoBytes = 32,\r\n}\r\n\r\nexport interface NewStream {\r\n callId: string;\r\n participantId?: string;\r\n participantName?: string;\r\n streamType: StreamType;\r\n mode?: StreamMode;\r\n advancedSettings: {\r\n url?: string;\r\n latency?: number;\r\n key?: string;\r\n unmixedAudio: boolean;\r\n keyLength?: KeyLength;\r\n enableSsl: boolean;\r\n };\r\n}\r\n\r\nexport interface StreamDetails {\r\n streamUrl: string;\r\n passphrase: string;\r\n latency: number;\r\n previewUrl: string;\r\n audioDemuxed: boolean;\r\n}\r\n\r\nexport interface InjectionStream {\r\n id: string;\r\n callId: string;\r\n injectionUrl?: string;\r\n protocol: StreamProtocol;\r\n streamMode: StreamMode;\r\n state?: StreamState;\r\n startingAt: string;\r\n startedAt: string;\r\n endingAt: string;\r\n endedAt: string;\r\n latency: number;\r\n passphrase: string;\r\n audioMuted: boolean;\r\n keylength: KeyLength;\r\n}\r\n\r\nexport interface NewStreamDrawerOpenParameters {\r\n callId: string;\r\n streamType: StreamType;\r\n participantId?: string;\r\n participantName?: string;\r\n}\r\n\r\nexport interface NewInjectionStreamDrawerOpenParameters {\r\n callId: string;\r\n}\r\n\r\nexport interface PrivateContext {\r\n streamKey: string;\r\n}\r\n\r\nexport interface CallStreamKey {\r\n callId: string;\r\n streamKey: string;\r\n}\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { Reducer } from 'redux';\r\nimport BaseAction from './BaseAction';\r\n\r\ntype ReducerMethod = (state: T, action: BaseAction) => T;\r\ntype ReducerMethods = { [actionType: string]: ReducerMethod };\r\n\r\n/*\r\n The API related reducers have to implement this baseReducer. If an action of type\r\n REQUEST_SOMETHING_FINISHED is flagged with error, it doesn't have to be processed.\r\n*/\r\nexport default function baseReducer(initialState: T, methods: ReducerMethods): Reducer {\r\n return (state: T = initialState, action: BaseAction): T => {\r\n const method: ReducerMethod | undefined = methods[action.type];\r\n\r\n // if the action doesn't have a method or it has been flagged as error\r\n // we return the current state and do not mutate the state\r\n if (!method || action.error) {\r\n return state;\r\n }\r\n\r\n return method(state, action);\r\n };\r\n}\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { Call } from '../../../models/calls/types';\r\nimport { ApiError } from '../../../models/error/types';\r\nimport { RequestResponse } from '../../../services/api';\r\nimport BaseAction, { RequestFinishedActionParameters } from '../../base/BaseAction';\r\n\r\nexport enum RequestCallType {\r\n NewCall = 'NewCall',\r\n ExistingCall = 'ExistingCall',\r\n}\r\n\r\nexport const REQUEST_CALL = 'REQUEST_CALL';\r\nexport const REQUEST_CALL_FINISHED = 'REQUEST_CALL_FINISHED';\r\n\r\nexport interface RequestCall extends BaseAction {}\r\nexport interface RequestCallFinished extends BaseAction> {}\r\n\r\nexport const requestCall = (): BaseAction => ({\r\n type: REQUEST_CALL,\r\n});\r\n\r\nexport const requestCallFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters): BaseAction> => ({\r\n type: REQUEST_CALL_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});\r\n\r\nexport const REQUEST_POLLING_CALL = 'REQUEST_POLLING_CALL';\r\nexport const REQUEST_POLLING_CALL_FINISHED = 'REQUEST_POLLING_CALL_FINISHED';\r\n\r\nexport interface RequestPollingCall extends BaseAction {}\r\nexport interface RequestPollingCallFinished extends BaseAction> {}\r\n\r\nexport const requestPollingCall = (): BaseAction => ({\r\n type: REQUEST_POLLING_CALL,\r\n});\r\n\r\nexport const requestPollingCallFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters): BaseAction> => ({\r\n type: REQUEST_POLLING_CALL_FINISHED,\r\n payload: payload,\r\n meta: meta,\r\n error: payload instanceof ApiError,\r\n});\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\nexport type ApplicationError = ApiError | DefaultError;\r\n\r\nexport interface ErrorDefaults {\r\n id: string;\r\n message: string;\r\n}\r\n\r\nexport class DefaultError implements ErrorDefaults {\r\n id: string = uuidv4();\r\n message: string = '';\r\n raw: any = null;\r\n\r\n constructor(message: string, raw?: any) {\r\n this.message = message;\r\n if (raw) {\r\n this.raw = raw;\r\n }\r\n }\r\n}\r\n\r\nexport class ApiError implements ErrorDefaults {\r\n id: string = uuidv4();\r\n message: string = '';\r\n status: number = 0;\r\n errors: string[] = [];\r\n url: string = '';\r\n raw: any = null;\r\n}\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { Call } from \"../../../models/calls/types\";\r\nimport { ApiError } from \"../../../models/error/types\";\r\nimport { RequestResponse, Resource } from \"../../../services/api\";\r\nimport BaseAction, { RequestFinishedActionParameters } from \"../../base/BaseAction\";\r\n\r\nexport const REQUEST_DISCONNECT_CALL = 'REQUEST_DISCONNECT_CALL';\r\nexport const REQUEST_DISCONNECT_CALL_FINISHED = 'REQUEST_DISCONNECT_CALL_FINISHED';\r\n\r\nexport interface RequestDisconnectCall extends BaseAction {}\r\nexport interface RequestDisconnectCallFinished extends BaseAction>> {}\r\n\r\nexport const requestDisconnectCall = (): RequestDisconnectCall => ({\r\n type: REQUEST_DISCONNECT_CALL,\r\n});\r\n\r\nexport const requestDisconnectCallFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters>): RequestDisconnectCallFinished => ({\r\n type: REQUEST_DISCONNECT_CALL_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nexport enum AuthStatus {\r\n Unauthenticated,\r\n Unauthorized,\r\n Authenticating,\r\n Authenticated,\r\n}\r\n\r\nexport interface UserProfile {\r\n id: string;\r\n username: string;\r\n role: UserRoles\r\n}\r\n\r\nexport enum UserRoles {\r\n Producer = \"Producer\",\r\n Attendee = \"Attendee\",\r\n}\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { Call } from '../../../models/calls/types';\r\nimport { ApiError } from '../../../models/error/types';\r\nimport { RequestResponse } from '../../../services/api';\r\nimport BaseAction, { RequestFinishedActionParameters } from '../../base/BaseAction';\r\n\r\nexport const REQUEST_JOIN_CALL = 'REQUEST_JOIN_CALL';\r\nexport const REQUEST_JOIN_CALL_FINISHED = 'REQUEST_JOIN_CALL_FINISHED';\r\n\r\nexport interface RequestJoinCall extends BaseAction<{ callUrl: string }> {}\r\nexport interface RequestJoinCallFinished extends BaseAction> {}\r\n\r\nexport const requestJoinCall = (callUrl: string): BaseAction<{ callUrl: string }> => ({\r\n type: REQUEST_JOIN_CALL,\r\n payload: {\r\n callUrl,\r\n },\r\n});\r\n\r\nexport const requestJoinCallFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters): BaseAction> => ({\r\n type: REQUEST_JOIN_CALL_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { Stream } from '../../../models/calls/types';\r\nimport { ApiError } from '../../../models/error/types';\r\nimport { RequestResponse, Resource } from '../../../services/api';\r\nimport BaseAction, { RequestFinishedActionParameters } from '../../base/BaseAction';\r\n\r\nexport const REQUEST_START_STREAM = 'REQUEST_START_STREAM';\r\nexport const REQUEST_START_STREAM_FINISHED = 'REQUEST_START_STREAM_FINISHED';\r\n\r\nexport interface RequestStartStream extends BaseAction {}\r\nexport interface RequestStartStreamFinished extends BaseAction>> {}\r\n\r\nexport const requestStartStream = (): RequestStartStream => ({\r\n type: REQUEST_START_STREAM,\r\n});\r\n\r\nexport const requestStartStreamFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters>): RequestStartStreamFinished => ({\r\n type: REQUEST_START_STREAM_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { Stream } from '../../../models/calls/types';\r\nimport { ApiError } from '../../../models/error/types';\r\nimport { RequestResponse, Resource } from '../../../services/api';\r\nimport BaseAction, { RequestFinishedActionParameters } from '../../base/BaseAction';\r\n\r\nexport const REQUEST_STOP_STREAM = 'REQUEST_STOP_STREAM';\r\nexport const REQUEST_STOP_STREAM_FINISHED = 'REQUEST_STOP_STREAM_FINISHED';\r\n\r\nexport interface RequestStopStream extends BaseAction {}\r\nexport interface RequestStopStreamFinished extends BaseAction>> {}\r\n\r\nexport const requestStopStream = (): RequestStopStream => ({\r\n type: REQUEST_STOP_STREAM,\r\n});\r\n\r\nexport const requestStopStreamFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters>): RequestStopStreamFinished => ({\r\n type: REQUEST_STOP_STREAM_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { Call } from '../../../models/calls/types';\r\nimport { ApiError } from '../../../models/error/types';\r\nimport { RequestResponse } from '../../../services/api';\r\nimport BaseAction, { RequestFinishedActionParameters } from '../../base/BaseAction';\r\n\r\nexport const REQUEST_ACTIVE_CALLS = 'REQUEST_ACTIVE_CALLS';\r\nexport const REQUEST_ACTIVE_CALLS_FINISHED = 'REQUEST_ACTIVE_CALLS_FINISHED';\r\n\r\nexport interface RequestActiveCalls extends BaseAction {}\r\nexport interface RequestActiveCallsFinished extends BaseAction> {}\r\n\r\nexport const requestActiveCalls = (): RequestActiveCalls => ({\r\n type: REQUEST_ACTIVE_CALLS,\r\n});\r\n\r\nexport const requestActiveCallsFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters): RequestActiveCallsFinished => ({\r\n type: REQUEST_ACTIVE_CALLS_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { InjectionStream } from '../../../models/calls/types';\r\nimport { ApiError } from '../../../models/error/types';\r\nimport { RequestResponse } from '../../../services/api';\r\nimport BaseAction, { RequestFinishedActionParameters } from '../../base/BaseAction';\r\n\r\nexport const REQUEST_START_INJECTION_STREAM = 'REQUEST_START_INJECTION_STREAM';\r\nexport const REQUEST_START_INJECTION_STREAM_FINISHED = 'REQUEST_START_INJECTION_STREAM_FINISHED';\r\n\r\nexport interface RequestStartInjectionStream extends BaseAction {}\r\nexport interface RequestStartInjectionStreamFinished extends BaseAction> {}\r\n\r\nexport const requestStartInjectionStream = (): RequestStartInjectionStream => ({\r\n type: REQUEST_START_INJECTION_STREAM,\r\n});\r\n\r\nexport const requestStartInjectionStreamFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters): RequestStartInjectionStreamFinished => ({\r\n type: REQUEST_START_INJECTION_STREAM_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { InjectionStream } from '../../../models/calls/types';\r\nimport { RequestResponse } from '../../../services/api';\r\nimport BaseAction, { RequestFinishedActionParameters } from '../../base/BaseAction';\r\nimport { ApiError } from '../../../models/error/types';\r\n\r\nexport const REQUEST_MUTE_BOT = 'REQUEST_MUTE_BOT';\r\nexport const REQUEST_MUTE_BOT_FINISHED = 'REQUEST_MUTE_BOT_FINISHED';\r\n\r\nexport interface RequestMuteBot extends BaseAction {}\r\nexport interface RequestMuteBotFinished extends BaseAction> {}\r\n\r\nexport const requestMuteBot = (): RequestMuteBot => ({\r\n type: REQUEST_MUTE_BOT,\r\n});\r\n\r\nexport const requestMuteBotFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters): RequestMuteBotFinished => ({\r\n type: REQUEST_MUTE_BOT_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { InjectionStream } from \"../../../models/calls/types\";\r\nimport { ApiError } from \"../../../models/error/types\";\r\nimport { RequestResponse } from \"../../../services/api\";\r\nimport BaseAction, { RequestFinishedActionParameters } from \"../../base/BaseAction\";\r\n\r\nexport const REQUEST_UNMUTE_BOT = 'REQUEST_UNMUTE_BOT';\r\nexport const REQUEST_UNMUTE_BOT_FINISHED = 'REQUEST_UNMUTE_BOT_FINISHED';\r\n\r\nexport interface RequestUnmuteBot extends BaseAction {}\r\nexport interface RequestUnmuteBotFinished extends BaseAction> {}\r\n\r\nexport const requestUnmuteBot = (): RequestUnmuteBot => ({\r\n type: REQUEST_UNMUTE_BOT,\r\n});\r\n\r\nexport const requestUnmuteBotFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters): RequestUnmuteBotFinished => ({\r\n type: REQUEST_UNMUTE_BOT_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { CallStreamKey } from '../../../models/calls/types';\r\nimport { ApiError } from '../../../models/error/types';\r\nimport { RequestResponse } from '../../../services/api';\r\nimport BaseAction, { RequestFinishedActionParameters } from '../../base/BaseAction';\r\n\r\nexport const REQUEST_REFRESH_STREAM_KEY = 'REQUEST_REFRESH_STREAM_KEY';\r\nexport const REQUEST_REFRESH_STREAM_KEY_FINISHED = 'REQUEST_REFRESH_STREAM_KEY_FINISHED';\r\n\r\nexport interface RequestRefreshStreamKey extends BaseAction {}\r\nexport interface RequestRefreshStreamKeyFinished extends BaseAction> {}\r\n\r\nexport const requestRefreshStreamKey = (): RequestRefreshStreamKey => ({\r\n type: REQUEST_REFRESH_STREAM_KEY,\r\n});\r\n\r\nexport const requestRefreshStreamKeyFinished = ({\r\n payload,\r\n meta\r\n}: RequestFinishedActionParameters): RequestRefreshStreamKeyFinished => ({\r\n type: REQUEST_REFRESH_STREAM_KEY_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport BaseAction from '../../base/BaseAction';\r\n\r\nexport const UPDATE_STREAM_PHOTO = 'UPDATE_STREAM_PHOTO';\r\n\r\nexport interface UpdateStreamPhoto extends BaseAction<{streamId: string, photo: string, callId: string}> {}\r\n\r\nexport const updateStreamPhoto = (streamId: string, photo: string, callId: string): UpdateStreamPhoto => ({\r\n type: UPDATE_STREAM_PHOTO,\r\n payload: {streamId, photo, callId},\r\n});","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { Reducer } from 'redux';\r\nimport {\r\n Call,\r\n CallState,\r\n CallStreamKey,\r\n InjectionStream,\r\n KeyLength,\r\n NewCall,\r\n NewInjectionStream,\r\n NewStream,\r\n Stream,\r\n StreamProtocol,\r\n StreamType,\r\n} from '../../models/calls/types';\r\nimport { Resource } from '../../services/api';\r\nimport baseReducer from '../base/BaseReducer';\r\nimport * as CallsActions from './actions';\r\nimport { RequestCallType } from './actions';\r\n\r\nexport interface ICallsState {\r\n activeCalls: Call[];\r\n newCall: null | NewCall;\r\n newStream: null | NewStream;\r\n newInjectionStream: null | NewInjectionStream;\r\n activeCallsLoading: boolean;\r\n activeCallsError: null | string;\r\n}\r\n\r\nexport const INITIAL_STATE: ICallsState = {\r\n newStream: null,\r\n newInjectionStream: null,\r\n newCall: null,\r\n activeCalls: [],\r\n activeCallsLoading: false,\r\n activeCallsError: null,\r\n};\r\n\r\n/*\r\n NOTE: There are some REQUEST_*_FINISHED actions we don't add to the reducer\r\n because the call polling already updates the state of the call (with its streams)\r\n*/\r\n\r\nexport const callsReducer: Reducer = baseReducer(INITIAL_STATE, {\r\n [CallsActions.REQUEST_ACTIVE_CALLS_FINISHED](\r\n state: ICallsState,\r\n action: CallsActions.RequestActiveCallsFinished\r\n ): ICallsState {\r\n const calls = action.payload! as Call[];\r\n return {\r\n ...state,\r\n activeCalls: calls.map((call) => fillDefaults(call, defaultCallValues)),\r\n };\r\n },\r\n [CallsActions.REQUEST_JOIN_CALL](state: ICallsState, action: CallsActions.RequestJoinCall): ICallsState {\r\n return {\r\n ...state,\r\n newCall: {\r\n callUrl: action.payload!.callUrl,\r\n status: CallState.Establishing,\r\n },\r\n };\r\n },\r\n [CallsActions.REQUEST_JOIN_CALL_FINISHED](\r\n state: ICallsState,\r\n action: CallsActions.RequestJoinCallFinished\r\n ): ICallsState {\r\n /*\r\n NOTE: If the action is exceuted, is because it is not flagged as error,\r\n so we can infer the payload type\r\n */\r\n // add new call to active calls\r\n const call = action.payload! as Call;\r\n\r\n const callWitDefaults = fillDefaults(call, defaultCallValues);\r\n\r\n return {\r\n ...state,\r\n newCall: null,\r\n activeCalls: state.activeCalls.concat(callWitDefaults),\r\n };\r\n },\r\n [CallsActions.REQUEST_CALL_FINISHED](state: ICallsState, action: CallsActions.RequestCallFinished): ICallsState {\r\n /*\r\n NOTE: If the action is exceuted, is because it is not flagged as error,\r\n so we can infer the payload type\r\n */\r\n const call = action.payload! as Call;\r\n // Update the call in question\r\n const existingCall = state.activeCalls.find((o) => o.id === call.id);\r\n const callWitDefaults = fillDefaults(call, existingCall ?? defaultCallValues);\r\n\r\n return {\r\n ...state,\r\n activeCalls: state.activeCalls.map((o) => (o.id !== callWitDefaults.id ? o : callWitDefaults)),\r\n };\r\n },\r\n [CallsActions.REQUEST_POLLING_CALL_FINISHED](\r\n state: ICallsState,\r\n action: CallsActions.RequestPollingCallFinished\r\n ): ICallsState {\r\n /*\r\n NOTE: If the action is exceuted, is because it is not flagged as error,\r\n so we can infer the payload type\r\n */\r\n const requestCallType = action.meta! as RequestCallType;\r\n\r\n const call = action.payload! as Call;\r\n if (requestCallType === RequestCallType.NewCall) {\r\n const callWitDefaults = fillDefaults(call, defaultCallValues);\r\n\r\n return {\r\n ...state,\r\n newCall: null,\r\n activeCalls: state.activeCalls.concat(callWitDefaults),\r\n };\r\n }\r\n\r\n if (requestCallType === RequestCallType.ExistingCall) {\r\n const existingCall = state.activeCalls.find((o) => o.id === call.id);\r\n const callWitDefaults = fillDefaults(call, existingCall ?? defaultCallValues);\r\n\r\n return {\r\n ...state,\r\n activeCalls: state.activeCalls.map((o) => (o.id !== callWitDefaults.id ? o : callWitDefaults)),\r\n };\r\n }\r\n\r\n return {\r\n ...state,\r\n };\r\n },\r\n [CallsActions.REQUEST_DISCONNECT_CALL_FINISHED](\r\n state: ICallsState,\r\n action: CallsActions.RequestDisconnectCallFinished\r\n ): ICallsState {\r\n /*\r\n NOTE: If the action is exceuted, is because it is not flagged as error,\r\n so we can infer the payload type\r\n\r\n TODO: Review\r\n We should analyze why we use the call updated action in our previous reducer/async action \r\n to handle the call disconnection.\r\n */\r\n const call = action.payload! as Resource;\r\n // Update the call in question\r\n const existingCall = state.activeCalls.find((o) => o.id === call.id);\r\n const callWitDefaults = fillDefaults(call.resource, existingCall ?? defaultCallValues);\r\n\r\n return {\r\n ...state,\r\n activeCalls: state.activeCalls.map((o) => (o.id !== callWitDefaults.id ? o : callWitDefaults)),\r\n };\r\n },\r\n [CallsActions.REQUEST_START_STREAM_FINISHED](\r\n state: ICallsState,\r\n action: CallsActions.RequestStartStreamFinished\r\n ): ICallsState {\r\n /*\r\n NOTE: If the action is exceuted, is because it is not flagged as error,\r\n so we can infer the payload type\r\n */\r\n\r\n const resource = action.payload! as Resource;\r\n const activeCall = state.activeCalls.find((call: Call) => call.id === resource.resource.callId);\r\n\r\n const updatedStream: Stream = {\r\n ...resource.resource,\r\n photo: activeCall?.streams.find((stream: Stream) => stream.id === resource.resource.id)?.photo,\r\n };\r\n\r\n return {\r\n ...state,\r\n activeCalls: state.activeCalls.map((call) =>\r\n call.id === updatedStream.callId\r\n ? {\r\n // call in question\r\n ...call,\r\n streams: call.streams.map((stream) => (stream.id === updatedStream.id ? updatedStream : stream)),\r\n } // other call\r\n : call\r\n ),\r\n };\r\n },\r\n [CallsActions.REQUEST_STOP_STREAM_FINISHED](\r\n state: ICallsState,\r\n action: CallsActions.RequestStopStreamFinished\r\n ): ICallsState {\r\n /*\r\n NOTE: If the action is exceuted, is because it is not flagged as error,\r\n so we can infer the payload type\r\n */\r\n\r\n const resource = action.payload! as Resource;\r\n const activeCall = state.activeCalls.find((call: Call) => call.id === resource.resource.callId);\r\n\r\n const updatedStream: Stream = {\r\n ...resource.resource,\r\n photo: activeCall?.streams.find((stream: Stream) => stream.id === resource.resource.id)?.photo,\r\n };\r\n\r\n return {\r\n ...state,\r\n activeCalls: state.activeCalls.map((call) =>\r\n call.id === updatedStream.callId\r\n ? {\r\n // call in question\r\n ...call,\r\n streams: call.streams.map((stream) => (stream.id === updatedStream.id ? updatedStream : stream)),\r\n } // other call\r\n : call\r\n ),\r\n };\r\n },\r\n [CallsActions.OPEN_NEW_STREAM_DRAWER](state: ICallsState, action: CallsActions.OpenNewStreamDrawer): ICallsState {\r\n const payload = action.payload!;\r\n const call = state.activeCalls.find((o) => o.id === payload.callId);\r\n if (!call) {\r\n return state;\r\n }\r\n\r\n return {\r\n ...state,\r\n newStream: {\r\n callId: payload.callId,\r\n participantId: payload.participantId,\r\n streamType: payload.streamType,\r\n participantName: payload.participantName,\r\n advancedSettings: {\r\n latency: call.defaultLatency,\r\n key: call.defaultPassphrase,\r\n unmixedAudio: false,\r\n keyLength: call.defaultKeyLength,\r\n enableSsl: false\r\n },\r\n },\r\n };\r\n },\r\n [CallsActions.CLOSE_NEW_STREAM_DRAWER](state: ICallsState, action: CallsActions.CloseNewStreamDrawer): ICallsState {\r\n return {\r\n ...state,\r\n newStream: null,\r\n };\r\n },\r\n [CallsActions.OPEN_NEW_INJECTION_STREAM_DRAWER](\r\n state: ICallsState,\r\n action: CallsActions.OpenNewInjectionStreamDrawer\r\n ): ICallsState {\r\n const payload = action.payload!;\r\n const call = state.activeCalls.find((o) => o.id === payload.callId);\r\n if (!call) {\r\n return state;\r\n }\r\n\r\n return {\r\n ...state,\r\n newInjectionStream: {\r\n callId: call.id,\r\n },\r\n };\r\n },\r\n [CallsActions.CLOSE_NEW_INJECTION_STREAM_DRAWER](\r\n state: ICallsState,\r\n action: CallsActions.CloseNewInjectionStreamDrawer\r\n ): ICallsState {\r\n return {\r\n ...state,\r\n newInjectionStream: null,\r\n };\r\n },\r\n [CallsActions.REQUEST_START_INJECTION_STREAM_FINISHED](\r\n state: ICallsState,\r\n action: CallsActions.RequestStartInjectionStreamFinished\r\n ): ICallsState {\r\n const stream = action.payload! as InjectionStream;\r\n\r\n const callId = stream.callId;\r\n const call = state.activeCalls.find((c) => c.id === callId);\r\n\r\n if (!call) {\r\n return state;\r\n }\r\n\r\n return {\r\n ...state,\r\n activeCalls: state.activeCalls.map((call) =>\r\n call.id === stream.callId\r\n ? {\r\n ...call,\r\n injectionStream: stream,\r\n }\r\n : call\r\n ),\r\n };\r\n },\r\n [CallsActions.UPDATE_CALL_DEFAULTS](state: ICallsState, action: CallsActions.UpdateCallDefaults): ICallsState {\r\n const payload = action.payload!;\r\n const defaults = payload.defaults;\r\n const call = state.activeCalls.find((o) => o.id === payload.callId);\r\n if (!call) {\r\n return state;\r\n }\r\n\r\n const updated: Call = {\r\n ...call,\r\n defaultProtocol: defaults.protocol,\r\n defaultLatency: defaults.latency ?? call.defaultLatency,\r\n defaultPassphrase: defaults.passphrase ?? call.defaultPassphrase,\r\n defaultKeyLength: defaults.keyLength ?? call.defaultKeyLength,\r\n };\r\n\r\n return {\r\n ...state,\r\n activeCalls: state.activeCalls.map((o) => (o.id !== call.id ? o : updated)),\r\n };\r\n },\r\n [CallsActions.REQUEST_REFRESH_STREAM_KEY_FINISHED](\r\n state: ICallsState,\r\n action: CallsActions.RequestRefreshStreamKeyFinished\r\n ): ICallsState {\r\n /*\r\n NOTE: If the action is executed, is because it is not flagged as error,\r\n so we can infer the payload type\r\n */\r\n const payload = action.payload! as CallStreamKey;\r\n const call = state.activeCalls.find((o) => o.id === payload.callId);\r\n\r\n if (!call) {\r\n return state;\r\n }\r\n\r\n const updated: Call = {\r\n ...call,\r\n privateContext: {\r\n streamKey: payload.streamKey,\r\n },\r\n };\r\n\r\n return {\r\n ...state,\r\n activeCalls: state.activeCalls.map((o) => (o.id !== call.id ? o : updated)),\r\n };\r\n },\r\n [CallsActions.UPDATE_STREAM_PHOTO](state: ICallsState, action: CallsActions.UpdateStreamPhoto): ICallsState {\r\n const streamId = action.payload!.streamId;\r\n const callId = action.payload!.callId;\r\n const photo = action.payload!.photo;\r\n\r\n const call = state.activeCalls.find((o) => o.id === callId);\r\n\r\n if (!call) {\r\n return state;\r\n }\r\n\r\n const updatedStream = {\r\n ...call.streams.find((stream: Stream) => stream.id === streamId),\r\n photo: photo,\r\n } as Stream;\r\n\r\n const updatedCall: Call = {\r\n ...call,\r\n streams: [...call.streams.filter((stream: Stream) => stream.id !== streamId), ...[updatedStream]],\r\n };\r\n\r\n return {\r\n ...state,\r\n activeCalls: state.activeCalls.map((o) => (o.id !== call.id ? o : updatedCall)),\r\n };\r\n },\r\n});\r\n\r\nconst defaultCallValues = {\r\n defaultLatency: 750,\r\n defaultPassphrase: '',\r\n defaultKeyLength: KeyLength.None,\r\n};\r\n\r\nconst fillDefaults = (call: Call, defaults: Partial): Call => ({\r\n ...call,\r\n defaultLatency: defaults.defaultLatency ?? defaultCallValues.defaultLatency,\r\n defaultPassphrase: defaults.defaultPassphrase ?? defaultCallValues.defaultPassphrase,\r\n defaultKeyLength: defaults.defaultKeyLength ?? defaultCallValues.defaultKeyLength,\r\n defaultProtocol: defaults.defaultProtocol ?? StreamProtocol.SRT,\r\n streams: call.streams\r\n ? call.streams.map((o) => ({\r\n ...o,\r\n audioSharing: o.type !== StreamType.VbSS,\r\n photo: defaults.streams?.find((stream: Stream) => stream.id === o.id)?.photo,\r\n }))\r\n : [],\r\n});\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { NewStreamDrawerOpenParameters } from \"../../../models/calls/types\";\r\nimport BaseAction from \"../../base/BaseAction\";\r\n\r\nexport const OPEN_NEW_STREAM_DRAWER = 'OPEN_NEW_STREAM_DRAWER';\r\nexport const CLOSE_NEW_STREAM_DRAWER = 'CLOSE_NEW_STREAM_DRAWER';\r\n\r\nexport interface OpenNewStreamDrawer extends BaseAction {}\r\nexport interface CloseNewStreamDrawer extends BaseAction {}\r\n\r\nexport const openNewStreamDrawer = ({\r\n callId,\r\n streamType,\r\n participantId,\r\n participantName,\r\n}: NewStreamDrawerOpenParameters): OpenNewStreamDrawer => ({\r\n type: OPEN_NEW_STREAM_DRAWER,\r\n payload: {\r\n callId,\r\n streamType,\r\n participantId,\r\n participantName,\r\n },\r\n});\r\n\r\nexport const closeNewStreamDrawer = (): CloseNewStreamDrawer =>({\r\n type: CLOSE_NEW_STREAM_DRAWER,\r\n})","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { NewInjectionStreamDrawerOpenParameters } from \"../../../models/calls/types\";\r\nimport BaseAction from \"../../base/BaseAction\";\r\n\r\nexport const OPEN_NEW_INJECTION_STREAM_DRAWER = 'OPEN_NEW_INJECTION_STREAM_DRAWER';\r\nexport const CLOSE_NEW_INJECTION_STREAM_DRAWER = 'CLOSE_NEW_INJECTION_STREAM_DRAWER';\r\n\r\nexport interface OpenNewInjectionStreamDrawer extends BaseAction {}\r\nexport interface CloseNewInjectionStreamDrawer extends BaseAction {}\r\n\r\nexport const openNewInjectionStreamDrawer = ({\r\n callId,\r\n}: NewInjectionStreamDrawerOpenParameters): OpenNewInjectionStreamDrawer => ({\r\n type: OPEN_NEW_INJECTION_STREAM_DRAWER,\r\n payload: {\r\n callId,\r\n },\r\n});\r\n\r\nexport const closeNewInjectionStreamDrawer = (): CloseNewInjectionStreamDrawer =>({\r\n type: CLOSE_NEW_INJECTION_STREAM_DRAWER,\r\n})","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { CallDefaults } from '../../../models/calls/types';\r\nimport BaseAction from '../../base/BaseAction';\r\n\r\nexport const UPDATE_CALL_DEFAULTS = 'UPDATE_CALL_DEFAULTS';\r\nexport interface UpdateCallDefaults\r\n extends BaseAction<{\r\n callId: string;\r\n defaults: CallDefaults;\r\n }> {}\r\n\r\nexport const updateCallDefaults = ({\r\n callId,\r\n defaults,\r\n}: {\r\n callId: string;\r\n defaults: CallDefaults;\r\n}): UpdateCallDefaults => ({\r\n type: UPDATE_CALL_DEFAULTS,\r\n payload: {\r\n callId,\r\n defaults,\r\n },\r\n});\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport baseReducer from \"../base/BaseReducer\";\r\nimport { AppConfig } from \"./types\";\r\nimport * as ConfigActions from \"./actions\";\r\nexport interface ConfigState {\r\n initialized: boolean;\r\n app: AppConfig | null;\r\n}\r\n\r\nexport const INITIAL_STATE: ConfigState = {\r\n initialized: false,\r\n app: null,\r\n}\r\n\r\nexport const configReducer = baseReducer(INITIAL_STATE, {\r\n [ConfigActions.LOAD_CONFIG](state: ConfigState, action: ConfigActions.LoadConfig): ConfigState{\r\n return {\r\n initialized: true,\r\n app: action.payload!\r\n }\r\n }\r\n})\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { ApiError } from '../../models/error/types';\r\nimport BaseAction from '../base/BaseAction';\r\nimport { AppConfig } from './types';\r\n\r\nexport const LOAD_CONFIG = 'LOAD_CONFIG';\r\nexport const LOAD_CONFIG_ERROR = 'LOAD_CONFIG_ERROR';\r\n\r\nexport interface LoadConfig extends BaseAction {}\r\nexport interface LoadConfigError extends BaseAction {}\r\n\r\nexport const loadConfig = (payload: AppConfig): LoadConfig => ({\r\n type: LOAD_CONFIG,\r\n payload: payload,\r\n});\r\n\r\nexport const loadConfigError = (error: ApiError): LoadConfigError => ({\r\n type: LOAD_CONFIG_ERROR,\r\n payload: error,\r\n error: true,\r\n});\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { UserProfile } from '../../models/auth/types';\r\nimport { DefaultError } from '../../models/error/types';\r\nimport { AuthStatus } from '../../models/auth/types';\r\nimport BaseAction from '../base/BaseAction';\r\n\r\nexport type AuthActions =\r\n | AuthStateInitialized\r\n | UserAuthenticating\r\n | UserAuthenticated\r\n | UserUnauthorized\r\n | UserAuthenticationError;\r\n\r\nexport const AUTH_STATE_INITIALIZED = 'AUTH_STATE_INITIALIZED';\r\nexport interface AuthStateInitialized extends BaseAction<{ initialized: boolean }> {}\r\n\r\nexport const authStateInitialized = (): AuthStateInitialized => ({\r\n type: AUTH_STATE_INITIALIZED,\r\n payload: {\r\n initialized: true,\r\n },\r\n});\r\n\r\nexport const USER_AUTHENTICATING = 'USER_AUTHENTICATING';\r\nexport interface UserAuthenticating extends BaseAction<{ authStatus: AuthStatus }> {}\r\n\r\nexport const userAuthenticating = (): UserAuthenticating => ({\r\n type: USER_AUTHENTICATING,\r\n payload: {\r\n authStatus: AuthStatus.Authenticating,\r\n },\r\n});\r\n\r\nexport const USER_AUTHENTICATED = 'USER_AUTHENTICATED';\r\nexport interface UserAuthenticated extends BaseAction<{ userProfile: UserProfile; authStatus: AuthStatus }> {}\r\n\r\nexport const userAuthenticated = (userProfile: UserProfile): UserAuthenticated => ({\r\n type: USER_AUTHENTICATED,\r\n payload: {\r\n userProfile,\r\n authStatus: AuthStatus.Authenticated,\r\n },\r\n});\r\n\r\nexport const USER_UNAUTHENTICATED = 'USER_UNAUTHENTICATED';\r\nexport interface UserUnauthenticated extends BaseAction<{ authStatus: AuthStatus }> {}\r\n\r\nexport const userUnauthenticated = (): UserUnauthenticated => ({\r\n type: USER_UNAUTHENTICATED,\r\n payload: {\r\n authStatus: AuthStatus.Unauthenticated,\r\n },\r\n});\r\n\r\nexport const USER_UNAUTHORIZED = 'USER_UNAUTHORIZED';\r\nexport interface UserUnauthorized extends BaseAction<{ userProfile: UserProfile; authStatus: AuthStatus }> {}\r\n\r\nexport const userUnauthorized = (userProfile: UserProfile): UserUnauthorized => ({\r\n type: USER_UNAUTHORIZED,\r\n payload: {\r\n userProfile,\r\n authStatus: AuthStatus.Unauthorized,\r\n },\r\n});\r\n\r\nexport const USER_AUTHENTICATION_ERROR = 'USER_AUTHENTICATION_ERROR';\r\nexport interface UserAuthenticationError extends BaseAction {}\r\n\r\nexport const userAuthenticationError = (message: string, rawError: any): UserAuthenticationError => ({\r\n type: USER_AUTHENTICATION_ERROR,\r\n payload: new DefaultError(message, rawError),\r\n error: true,\r\n});\r\n\r\nexport const SET_AUTHENTICATION_DISABLED = \"SET_AUTHENTICATION_DISABLED\";\r\nexport interface SetAuthenticationDisabled extends BaseAction {};\r\n\r\nexport const setAuthenticationDisabled = (): SetAuthenticationDisabled => ({\r\n type: SET_AUTHENTICATION_DISABLED,\r\n})","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { AuthStatus, UserProfile, UserRoles } from '../../models/auth/types';\r\nimport * as AuthActions from './actions';\r\nimport baseReducer from '../base/BaseReducer';\r\n\r\nexport interface AuthState {\r\n status: AuthStatus;\r\n userProfile: UserProfile | null;\r\n initialized: boolean;\r\n}\r\n\r\nexport const INITIAL_STATE: AuthState = {\r\n status: AuthStatus.Unauthenticated,\r\n userProfile: null,\r\n initialized: false,\r\n};\r\n\r\nexport const authReducer = baseReducer(INITIAL_STATE, {\r\n [AuthActions.USER_AUTHENTICATED](state: AuthState, action: AuthActions.UserAuthenticated): AuthState {\r\n return {\r\n ...state,\r\n status: action.payload!.authStatus,\r\n userProfile: action.payload!.userProfile,\r\n }\r\n },\r\n [AuthActions.USER_UNAUTHENTICATED](state: AuthState, action: AuthActions.UserUnauthenticated): AuthState {\r\n return {\r\n ...state,\r\n status: action.payload!.authStatus,\r\n }\r\n },\r\n [AuthActions.USER_AUTHENTICATING](state: AuthState, action: AuthActions.UserAuthenticating): AuthState {\r\n return {\r\n ...state,\r\n status: action.payload!.authStatus,\r\n }\r\n },\r\n [AuthActions.USER_UNAUTHORIZED](state: AuthState, action: AuthActions.UserUnauthorized): AuthState {\r\n return {\r\n ...state,\r\n status: action.payload!.authStatus,\r\n userProfile: action.payload!.userProfile,\r\n }\r\n },\r\n [AuthActions.AUTH_STATE_INITIALIZED](state: AuthState, action: AuthActions.AuthStateInitialized): AuthState {\r\n return {\r\n ...state,\r\n initialized: action.payload!.initialized,\r\n }\r\n },\r\n [AuthActions.SET_AUTHENTICATION_DISABLED](state: AuthState, action: AuthActions.SetAuthenticationDisabled): AuthState {\r\n return {\r\n ...state,\r\n status: AuthStatus.Authenticated,\r\n userProfile: {\r\n id: '',\r\n username: 'Local User',\r\n role: UserRoles.Producer,\r\n },\r\n initialized: true,\r\n }\r\n },\r\n})","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\n/*\r\n * Note: This reducer breaks convention on how reducers should be setup.\r\n */\r\n\r\nimport { ApplicationError, DefaultError } from '../../models/error/types';\r\nimport BaseAction from '../base/BaseAction';\r\nimport * as ErrorAction from './actions';\r\n\r\nexport interface ErrorState {\r\n [key: string]: ApplicationError;\r\n}\r\n\r\nexport const initialState: ErrorState = {};\r\n\r\nexport default function errorReducer(state: ErrorState = initialState, action: BaseAction): ErrorState {\r\n const { type, error, payload } = action;\r\n\r\n /*\r\n * Removes an ErrorRseponse by it's id that is in the action payload.\r\n */\r\n\r\n if (type === ErrorAction.REMOVE_ERROR) {\r\n // Create a new state without the error that has the same id as the payload.\r\n return Object.entries(state).reduce((newState: ErrorState, [key, value]: [string, ApplicationError]) => {\r\n if (value.id !== payload) {\r\n newState[key] = value;\r\n }\r\n\r\n return newState;\r\n }, {});\r\n }\r\n\r\n /*\r\n * Removes all errors by returning the initial state which is an empty object.\r\n */\r\n if (type === ErrorAction.CLEAR_ALL_ERROR) {\r\n return initialState;\r\n }\r\n\r\n /*\r\n * Checking if is a default error\r\n */\r\n\r\n const isDefaultError = payload instanceof DefaultError && Boolean(error);\r\n if (isDefaultError) {\r\n //Adds the default error\r\n return {\r\n ...state,\r\n [type]: payload,\r\n };\r\n }\r\n\r\n /*\r\n * APi Errors logic\r\n */\r\n\r\n /*\r\n * True if the action type has the key word '_FINISHED' then the action is finished.\r\n */\r\n const isFinishedRequestType = type.includes('_FINISHED');\r\n /*\r\n * True if the action type has the key word 'REQUEST_' and not '_FINISHED'.\r\n */\r\n const isStartRequestType = type.includes('REQUEST_') && !isFinishedRequestType;\r\n\r\n /*\r\n * If an action is started we want to remove any old errors because there is a new action has been re-dispatched.\r\n */\r\n if (isStartRequestType) {\r\n // Using ES7 Object Rest Spread operator to omit properties from an object.\r\n const { [`${type}_FINISHED`]: value, ...stateWithoutFinishedType } = state;\r\n\r\n return stateWithoutFinishedType;\r\n }\r\n\r\n /*\r\n * True if the action is finished and the error property is true.\r\n */\r\n const isError: boolean = isFinishedRequestType && Boolean(error);\r\n\r\n /*\r\n * For any start and finished actions that don't have errors we return the current state.\r\n */\r\n if (isError === false) {\r\n return state;\r\n }\r\n\r\n /*\r\n * At this point the \"type\" will be a finished action type (e.g. \"SomeAction.REQUEST_*_FINISHED\").\r\n * The payload will be a ErrorRseponse.\r\n */\r\n return {\r\n ...state,\r\n [type]: payload,\r\n };\r\n}\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport BaseAction from '../base/BaseAction';\r\n\r\nexport const REMOVE_ERROR: string = 'REMOVE_ERROR';\r\nexport const CLEAR_ALL_ERROR: string = 'CLEAR_ALL_ERROR';\r\n\r\nexport function removeById(id: string): BaseAction {\r\n return {\r\n type: REMOVE_ERROR,\r\n payload: id,\r\n };\r\n}\r\n\r\nexport function clearAll(): BaseAction {\r\n return {\r\n type: CLEAR_ALL_ERROR,\r\n };\r\n}\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\n/*\r\n * Note: This reducer breaks convention on how reducers should be setup.\r\n */\r\n\r\nimport BaseAction from \"../base/BaseAction\";\r\n\r\nexport interface RequestingState {\r\n readonly [key: string]: boolean;\r\n}\r\n\r\nexport const initialState: RequestingState = {};\r\n\r\nexport default function requestingReducer(state: RequestingState = initialState, action: BaseAction): RequestingState {\r\n // We only take actions that include 'REQUEST_' in the type.\r\n const isRequestType: boolean = action.type.includes('REQUEST_');\r\n\r\n if (isRequestType === false) {\r\n return state;\r\n }\r\n\r\n // Remove the string '_FINISHED' from the action type so we can use the first part as the key on the state.\r\n const requestName: string = action.type.replace('_FINISHED', '');\r\n // If the action type includes '_FINISHED'. The boolean value will be false. Otherwise we\r\n // assume it is a starting request and will be set to true.\r\n const isFinishedRequestType: boolean = action.type.includes('_FINISHED');\r\n\r\n return {\r\n ...state,\r\n [requestName]: isFinishedRequestType === false,\r\n };\r\n}\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { v4 as uuid4 } from 'uuid';\r\nimport BaseAction from '../base/BaseAction';\r\nimport { IToastItem } from './reducer';\r\n\r\nexport const ADD_TOAST = 'ADD_TOAST';\r\nexport const REMOVE_TOAST = 'REMOVE_TOAST';\r\n\r\nexport interface AddToastMessage extends BaseAction { }\r\nexport interface RemoveToastMessage extends BaseAction { }\r\n\r\nexport const addToast = (message: string, type: string): AddToastMessage => ({\r\n type: ADD_TOAST,\r\n payload: { id: uuid4(), message, type }\r\n});\r\n\r\nexport const removeToastById = (toastId: string): RemoveToastMessage => ({\r\n type: REMOVE_TOAST,\r\n payload: toastId\r\n});\r\n\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { Reducer } from 'redux';\r\nimport * as ToastsAction from './actions';\r\nimport baseReducer from '../base/BaseReducer';\r\n\r\nexport interface IToastItem {\r\n id?: string;\r\n type: string;\r\n message: string;\r\n}\r\n\r\nexport interface IToastState{\r\n items: IToastItem[];\r\n}\r\n\r\nconst INITIAL_STATE: IToastState = {\r\n items: [],\r\n};\r\n\r\nexport const toastReducer: Reducer = baseReducer(INITIAL_STATE, {\r\n [ToastsAction.ADD_TOAST](state: IToastState, action: ToastsAction.AddToastMessage): IToastState {\r\n return {\r\n ...state,\r\n items: [...state.items, action.payload!],\r\n };\r\n },\r\n [ToastsAction.REMOVE_TOAST](state: IToastState, action: ToastsAction.RemoveToastMessage) {\r\n const toastId = action.payload;\r\n\r\n return {\r\n ...state,\r\n items: state.items.filter((model) => model.id !== toastId),\r\n };\r\n }\r\n});\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { Middleware } from 'redux';\r\nimport IAppState from '../services/store/IAppState';\r\nimport { notification } from 'antd';\r\n\r\nconst errorToastMiddleware: Middleware<{}, IAppState> = (store) => (next) => (action) => {\r\n if (action.error) {\r\n const errorAction = action;\r\n\r\n errorAction.payload.status === 401\r\n ? notification.error({ description: 'Unauthorized: Please, Sing in again.', message: `Error` })\r\n : notification.error({ description: errorAction.payload.message, message: `Error` });\r\n }\r\n\r\n next(action);\r\n};\r\n\r\nexport default errorToastMiddleware;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { ApiError } from \"../../models/error/types\";\r\nimport { BotService } from \"../../models/service/types\";\r\nimport { RequestResponse, Resource } from \"../../services/api\";\r\nimport BaseAction, { RequestFinishedActionParameters } from \"../base/BaseAction\";\r\n\r\nexport const REQUEST_START_SERVICE = \"REQUEST_START_SERVICE\";\r\nexport const REQUEST_START_SERVICE_FINISHED = \"REQUEST_START_SERVICE_FINISHED\";\r\n\r\nexport interface RequestStartService extends BaseAction {}\r\nexport interface RequestStartServiceFinished extends BaseAction>> {}\r\n\r\nexport const requestStartService = (): RequestStartService => ({\r\n type: REQUEST_START_SERVICE,\r\n});\r\n\r\nexport const requestStartServiceFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters>): RequestStartServiceFinished => ({\r\n type: REQUEST_START_SERVICE_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});\r\n\r\nexport const REQUEST_STOP_SERVICE = \"REQUEST_STOP_SERVICE\";\r\nexport const REQUEST_STOP_SERVICE_FINISHED = \"REQUEST_STOP_SERVICE_FINISHED\";\r\n\r\nexport interface RequestStopService extends BaseAction {}\r\nexport interface RequestStopServiceFinished extends BaseAction>> {}\r\n\r\nexport const requestStopService = (): RequestStopService => ({\r\n type: REQUEST_STOP_SERVICE,\r\n});\r\n\r\nexport const requestStopServiceFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters>): RequestStopServiceFinished => ({\r\n type: REQUEST_STOP_SERVICE_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});\r\n\r\nexport const REQUEST_BOT_SERVICE = \"REQUEST_BOT_SERVICE\";\r\nexport const REQUEST_BOT_SERVICE_FINISHED = \"REQUEST_BOT_SERVICE_FINISHED\";\r\n\r\nexport interface RequestBotService extends BaseAction {}\r\nexport interface RequestBotServiceFinished extends BaseAction>> {}\r\n\r\nexport const requestBotService = (): RequestBotService => ({\r\n type: REQUEST_BOT_SERVICE,\r\n});\r\n\r\nexport const requestBotServiceFinished = ({\r\n payload,\r\n meta,\r\n}: RequestFinishedActionParameters>): RequestBotServiceFinished => ({\r\n type: REQUEST_BOT_SERVICE_FINISHED,\r\n payload: payload,\r\n error: payload instanceof ApiError,\r\n});\r\n\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { BotService } from \"../../models/service/types\";\r\nimport { Resource } from \"../../services/api\";\r\nimport baseReducer from \"../base/BaseReducer\";\r\nimport * as BotServiceActions from \"./actions\";\r\n\r\nexport interface BotServiceAppState {\r\n botServices: BotService[];\r\n loading: boolean;\r\n}\r\n\r\nexport const INITIAL_STATE: BotServiceAppState = {\r\n botServices: [],\r\n loading: true,\r\n};\r\n\r\nexport const serviceReducer = baseReducer(INITIAL_STATE, {\r\n [BotServiceActions.REQUEST_BOT_SERVICE_FINISHED](state: BotServiceAppState, action: BotServiceActions.RequestBotServiceFinished){\r\n const botService = action.payload! as Resource;\r\n return {\r\n ...state,\r\n botServices: [botService.resource],\r\n };\r\n },\r\n [BotServiceActions.REQUEST_START_SERVICE_FINISHED](state: BotServiceAppState, action: BotServiceActions.RequestStartService){\r\n const botService = action.payload! as Resource;\r\n return {\r\n ...state,\r\n botServices: [botService.resource],\r\n };\r\n },\r\n [BotServiceActions.REQUEST_STOP_SERVICE_FINISHED](state: BotServiceAppState, action: BotServiceActions.RequestStopServiceFinished){\r\n const botService = action.payload! as Resource;\r\n return {\r\n ...state,\r\n botServices: [botService.resource],\r\n };\r\n }\r\n})","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { applyMiddleware, combineReducers, createStore, AnyAction, CombinedState, Store } from 'redux';\r\nimport { connectRouter, routerMiddleware } from 'connected-react-router';\r\nimport { History } from 'history';\r\nimport { composeWithDevTools } from 'redux-devtools-extension';\r\nimport thunkMiddleware, { ThunkMiddleware, ThunkDispatch } from 'redux-thunk';\r\nimport { createBrowserHistory } from 'history';\r\n\r\nimport IAppState from './IAppState';\r\nimport { callsReducer } from '../../stores/calls/reducer';\r\nimport { configReducer } from '../../stores/config/reducer';\r\nimport { authReducer } from '../../stores/auth/reducer';\r\nimport errorReducer from '../../stores/error/reducer';\r\nimport requestingReducer from '../../stores/requesting/reducer';\r\nimport { toastReducer } from '../../stores/toast/reducer';\r\nimport errorToastMiddleware from '../../middlewares/errorToastMiddleware';\r\nimport { serviceReducer } from '../../stores/service/reducer';\r\n\r\nconst createRootReducer = (history: History) =>\r\n combineReducers({\r\n router: connectRouter(history),\r\n config: configReducer,\r\n auth: authReducer,\r\n calls: callsReducer,\r\n errors: errorReducer,\r\n toast: toastReducer,\r\n requesting: requestingReducer,\r\n botServiceStatus: serviceReducer,\r\n });\r\n\r\nconst configureStore = (): Store, AnyAction> =>\r\n createStore(\r\n createRootReducer(history),\r\n composeWithDevTools(\r\n applyMiddleware(\r\n routerMiddleware(history),\r\n errorToastMiddleware,\r\n thunkMiddleware as ThunkMiddleware\r\n )\r\n )\r\n );\r\n\r\nexport const history = createBrowserHistory();\r\n\r\nexport default configureStore;\r\n\r\nexport type DispatchExts = ThunkDispatch;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport {\r\n AccountInfo,\r\n AuthenticationResult,\r\n Configuration,\r\n EndSessionRequest,\r\n PublicClientApplication,\r\n SilentRequest,\r\n} from '@azure/msal-browser';\r\nimport jwtDecode from 'jwt-decode';\r\nimport { UserProfile, UserRoles } from '../../models/auth/types';\r\nimport { MsalConfig } from '../../stores/config/types';\r\n\r\ninterface DecodedToken {\r\n groups: string[];\r\n}\r\n\r\nexport default class AuthService {\r\n private static msalClient: PublicClientApplication;\r\n private static appConfig: MsalConfig;\r\n public static configure(config: MsalConfig): void {\r\n \r\n AuthService.appConfig = config;\r\n const msalConfig: Configuration = {\r\n auth: {\r\n authority: config?.authority,\r\n clientId: config?.spaClientId || '',\r\n redirectUri: config?.redirectUrl,\r\n },\r\n cache: {\r\n cacheLocation: 'localStorage',\r\n storeAuthStateInCookie: false,\r\n },\r\n };\r\n\r\n AuthService.msalClient = new PublicClientApplication(msalConfig);\r\n }\r\n\r\n public static async signIn(apiClientId: string | undefined): Promise {\r\n const loginRequest = {\r\n scopes: ['openid', 'profile', 'offline_access', `api://${apiClientId}/.default`],\r\n };\r\n return await AuthService.msalClient.loginPopup(loginRequest);\r\n }\r\n\r\n public static async signOut(username: string): Promise {\r\n const request: EndSessionRequest = {\r\n account: AuthService.msalClient.getAccountByUsername(username) || undefined,\r\n };\r\n\r\n await AuthService.msalClient.logout(request);\r\n }\r\n\r\n public static getAccounts(): AccountInfo[] {\r\n return AuthService.msalClient.getAllAccounts();\r\n }\r\n\r\n public static async requestSilentToken(account: AccountInfo, apiClientId: string): Promise {\r\n const request: SilentRequest = {\r\n account,\r\n scopes: ['openid', 'profile', 'offline_access', `api://${apiClientId}/.default`],\r\n };\r\n\r\n return await AuthService.msalClient.acquireTokenSilent(request);\r\n }\r\n\r\n public static getUserProfile(authResult: AuthenticationResult): UserProfile {\r\n const userRole = AuthService.getUserRole(authResult.accessToken);\r\n const userProfile: UserProfile = {\r\n id: authResult.account?.localAccountId || '',\r\n username: authResult.account?.username || '',\r\n role: userRole,\r\n };\r\n\r\n return userProfile;\r\n }\r\n\r\n private static getUserRole(jwtToken: string): UserRoles {\r\n const groupId = AuthService.appConfig.groupId;\r\n\r\n if(!groupId){\r\n return UserRoles.Producer;\r\n }\r\n\r\n const decodedToken = jwtDecode(jwtToken) as DecodedToken;\r\n // If users are in the RBAC group then they have the Producer/Broadcast role\r\n const role = decodedToken.groups && decodedToken.groups.includes(groupId) ? UserRoles.Producer: UserRoles.Attendee;\r\n\r\n return role;\r\n }\r\n}\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { push } from 'connected-react-router';\r\nimport { AnyAction } from 'redux';\r\nimport { ThunkAction } from 'redux-thunk';\r\nimport { UserProfile, UserRoles } from '../../models/auth/types';\r\nimport AuthService from '../../services/auth';\r\nimport IAppState from '../../services/store/IAppState';\r\nimport { MsalConfig } from '../config/types';\r\nimport { authStateInitialized, userAuthenticated, userAuthenticating, userAuthenticationError, userUnauthenticated, userUnauthorized } from './actions';\r\n\r\nconst UNAUTHORIZE_ENDPOINT = \"/login/unauthorized\";\r\n\r\nexport const initilizeAuthentication =\r\n (config: MsalConfig): ThunkAction =>\r\n async (dispatch, getState) => {\r\n AuthService.configure(config);\r\n\r\n // Check for accounts in browser\r\n const accounts = AuthService.getAccounts();\r\n\r\n if (accounts && accounts.length > 0) {\r\n try {\r\n dispatch(userAuthenticating());\r\n const authResult = await AuthService.requestSilentToken(accounts[0], config.apiClientId);\r\n const userProfile = AuthService.getUserProfile(authResult);\r\n\r\n if (userIsProducer(userProfile)) {\r\n dispatch(userAuthenticated(userProfile));\r\n } else {\r\n dispatch(userUnauthorized(userProfile));\r\n dispatch(push(UNAUTHORIZE_ENDPOINT));\r\n }\r\n } catch (error) {\r\n dispatch(userAuthenticationError(\"Error has ocurred while trying to initilize authentication\", error));\r\n }\r\n }\r\n // Dispatch MSAL config loaded\r\n dispatch(authStateInitialized());\r\n };\r\n\r\nexport const signIn = (): ThunkAction => async (dispatch, getState) => {\r\n const msalConfig = getState().config.app?.msalConfig;\r\n dispatch(userAuthenticating());\r\n\r\n try {\r\n const authResult = await AuthService.signIn(msalConfig?.apiClientId);\r\n const userProfile = AuthService.getUserProfile(authResult);\r\n \r\n if (userIsProducer(userProfile)) {\r\n dispatch(userAuthenticated(userProfile));\r\n } else {\r\n dispatch(userUnauthorized(userProfile));\r\n dispatch(push(UNAUTHORIZE_ENDPOINT));\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n dispatch(userAuthenticationError(\"Error has ocurred while trying to sign in\", error));\r\n }\r\n}\r\n\r\nexport const signOut = (\r\n username: string\r\n): ThunkAction => async (dispatch) => {\r\n try {\r\n await AuthService.signOut(username);\r\n // Dispatch sign-out action\r\n dispatch(userUnauthenticated());\r\n } catch (error) {\r\n console.error(error);\r\n\r\n // Dispatch error action\r\n dispatch(userAuthenticationError(\"Error has ocurred while trying to sign out\", error));\r\n }\r\n};\r\n\r\nconst userIsProducer = (userProfile: UserProfile): boolean => {\r\n return userProfile.role === UserRoles.Producer;\r\n}","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React, { useState } from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps, withRouter, Redirect } from 'react-router';\r\nimport { Select } from 'antd'\r\n\r\nimport IAppState from '../../../services/store/IAppState';\r\n\r\nconst { Option } = Select;\r\n\r\ninterface ICallSelectorDataProps extends RouteComponentProps<{ id: string }> {\r\n selectedCallId?: string;\r\n isNew: boolean;\r\n calls: {\r\n id: string,\r\n name: string\r\n }[]\r\n}\r\n\r\ntype ICallSelectorProps = ICallSelectorDataProps;\r\n\r\nconst PLACEHOLDER_ID = '_';\r\nconst NEW_PLACEHOLDER_ID = '*';\r\nconst JOIN_CALL_ROUTE = '/call/join';\r\n\r\nconst CallSelector: React.FC = (props) => {\r\n // Handle redirect using \r\n const [redirectId, setRedirectId] = useState('');\r\n if (redirectId && redirectId !== props.selectedCallId) {\r\n if (redirectId === NEW_PLACEHOLDER_ID) {\r\n return \r\n } else {\r\n return \r\n }\r\n }\r\n\r\n // When changing the \r\n \r\n {props.calls.map(m => ())}\r\n \r\n \r\n )\r\n}\r\n\r\nconst mapStateToPros = (appState: IAppState, ownProps: RouteComponentProps<{ id: string }>): ICallSelectorDataProps => ({\r\n ...ownProps,\r\n calls: appState.calls.activeCalls.map(o => ({\r\n id: o.id,\r\n name: o.displayName\r\n })),\r\n selectedCallId: ownProps.match.params.id,\r\n isNew: ownProps.match.path === JOIN_CALL_ROUTE\r\n})\r\n\r\nexport default withRouter(connect(mapStateToPros)(CallSelector));\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { createSelector} from 'reselect';\r\nimport { ActiveStatuses, Call, CallState, CallType, InactiveStatuses, KeyLength, SpecialStreamTypes, StreamProtocol, StreamType } from '../../models/calls/types';\r\nimport IAppState from '../../services/store/IAppState';\r\nimport { CallInfoProps, CallStreamsProps, NewInjectionStreamDrawerProps, NewStreamDrawerProps } from '../../views/call-details/types';\r\nimport { ICallsState } from './reducer';\r\n\r\nexport const selectNewCall = createSelector(\r\n (state: IAppState) => state.calls,\r\n (state: ICallsState) => state.newCall\r\n);\r\n\r\nexport const selectActiveCalls = createSelector(\r\n (state: IAppState) => state.calls,\r\n (state: ICallsState) => state.activeCalls\r\n);\r\n\r\nexport const selectCallStreams = createSelector(\r\n (state: IAppState) => state.calls,\r\n (state: IAppState, callId: string) => callId,\r\n _selectCallStreams\r\n)\r\n\r\nexport const selectNewInjectionStreamDrawerProps = createSelector(\r\n (state: IAppState) => state.calls,\r\n (state: IAppState, callId: string) => callId,\r\n _selectNewInjectionStreamDrawerProps\r\n)\r\n\r\nexport const selectNewStreamDrawerProps = createSelector(\r\n (state: IAppState) => state.calls,\r\n (state: IAppState, callId: string) => callId,\r\n _selectNewStreamDrawerProps\r\n)\r\n\r\nexport const selectCallInfoProps = createSelector(\r\n (state: IAppState) => state.calls,\r\n (state: IAppState, callId: string) => callId,\r\n _selectCallInfoProps\r\n)\r\n\r\n\r\nfunction _selectCallStreams(callState: ICallsState, callId: string): CallStreamsProps {\r\n const call = callState.activeCalls.find(call => call.id === callId);\r\n\r\n if(!call){\r\n return {\r\n callId, \r\n callEnabled: false,\r\n mainStreams: [],\r\n participantStreams: [],\r\n activeStreams: [],\r\n primarySpeakerEnabled: false,\r\n stageEnabled: false,\r\n injectionStream: null,\r\n callProtocol: 0,\r\n }\r\n }\r\n\r\n return {\r\n callId,\r\n callEnabled: call.state === CallState.Established,\r\n mainStreams: call.streams.filter((o) => SpecialStreamTypes.includes(o.type) && InactiveStatuses.includes(o.state)),\r\n participantStreams: call.streams.filter(\r\n (o) => o.type === StreamType.Participant && InactiveStatuses.includes(o.state)\r\n ),\r\n activeStreams: call.streams.filter((o) => ActiveStatuses.includes(o.state)),\r\n primarySpeakerEnabled:\r\n call.streams.filter(\r\n (o) => o.type === StreamType.Participant && o.isSharingVideo && o.isSharingAudio && !o.audioMuted\r\n ).length > 0,\r\n stageEnabled: call.streams.filter((o) => o.type === StreamType.Participant && o.isSharingScreen).length > 0,\r\n injectionStream: call.injectionStream,\r\n callProtocol: call.defaultProtocol,\r\n }\r\n}\r\n\r\nfunction _selectNewInjectionStreamDrawerProps(callState: ICallsState, callId: string): NewInjectionStreamDrawerProps {\r\n const call = callState.activeCalls.find((o) => o.id === callId);\r\n const newInjectionStream = callState.newInjectionStream;\r\n if (!call) {\r\n return {\r\n call: null,\r\n newInjectionStream,\r\n };\r\n }\r\n\r\n return {\r\n call,\r\n newInjectionStream,\r\n };\r\n}\r\n\r\nfunction _selectNewStreamDrawerProps(callState: ICallsState, callId: string): NewStreamDrawerProps {\r\n const call = callState.activeCalls.find((o) => o.id === callId);\r\n const newStream = callState.newStream;\r\n if (!call) {\r\n return {\r\n call: null,\r\n newStream,\r\n };\r\n }\r\n\r\n return {\r\n call,\r\n newStream,\r\n };\r\n}\r\n\r\nfunction _selectCallInfoProps(callState: ICallsState, callId: string): CallInfoProps {\r\n const call = callState.activeCalls.find((o) => o.id === callId);\r\n\r\n if (!call) {\r\n return {\r\n call: {\r\n ...CALL_INITIALIZING_PLACEHOLDER,\r\n },\r\n streams: [],\r\n };\r\n }\r\n\r\n return {\r\n call,\r\n streams: call.streams,\r\n };\r\n}\r\n\r\nconst CALL_INITIALIZING_PLACEHOLDER: Call = {\r\n id: '0',\r\n displayName: 'Loading Call',\r\n botFqdn: '',\r\n botIp: '',\r\n connectionPool: {\r\n available: 0,\r\n used: 0,\r\n },\r\n createdAt: new Date(),\r\n defaultProtocol: StreamProtocol.SRT,\r\n defaultLatency: 0,\r\n defaultPassphrase: '',\r\n defaultKeyLength: KeyLength.None,\r\n errorMessage: null,\r\n joinUrl: '',\r\n state: CallState.Establishing,\r\n meetingType: CallType.Default,\r\n streams: [],\r\n injectionStream: null,\r\n privateContext: null,\r\n};\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport Axios, { Method, AxiosRequestConfig } from 'axios';\r\n\r\nimport { fillApiErrorWithDefaults } from '../../models/error/helpers';\r\nimport { ApiError } from '../../models/error/types';\r\nimport AuthService from '../../services/auth';\r\nimport { FEATUREFLAG_DISABLE_AUTHENTICATION } from '../../stores/config/constants';\r\nimport { getConfig } from '../../stores/config/loader';\r\n\r\nexport enum RequestMethod {\r\n Get = 'GET',\r\n Post = 'POST',\r\n Put = 'PUT',\r\n Delete = 'DELETE',\r\n Options = 'OPTIONS',\r\n Head = 'HEAD',\r\n Patch = 'PATCH',\r\n}\r\n\r\nexport interface RequestParameters {\r\n url: string;\r\n isSecured: boolean;\r\n shouldOverrideBaseUrl?: boolean;\r\n payload?: unknown;\r\n method?: RequestMethod;\r\n config?: AxiosRequestConfig;\r\n}\r\n\r\nexport class ApiClient {\r\n public static async post({\r\n url,\r\n isSecured,\r\n shouldOverrideBaseUrl: shouldOverrideUrl,\r\n payload,\r\n config,\r\n }: RequestParameters): Promise> {\r\n return baseRequest({ url, isSecured, shouldOverrideBaseUrl: shouldOverrideUrl, payload, method: RequestMethod.Post, config });\r\n }\r\n\r\n public static async put({\r\n url,\r\n isSecured,\r\n shouldOverrideBaseUrl: shouldOverrideUrl,\r\n payload,\r\n config,\r\n }: RequestParameters): Promise> {\r\n return baseRequest({ url, isSecured, shouldOverrideBaseUrl: shouldOverrideUrl, payload, method: RequestMethod.Put, config });\r\n }\r\n\r\n public static async get({\r\n url,\r\n isSecured,\r\n shouldOverrideBaseUrl: shouldOverrideUrl,\r\n payload,\r\n config,\r\n }: RequestParameters): Promise> {\r\n return baseRequest({ url, isSecured, shouldOverrideBaseUrl: shouldOverrideUrl, payload, method: RequestMethod.Get, config });\r\n }\r\n\r\n public static async delete({\r\n url,\r\n isSecured,\r\n shouldOverrideBaseUrl: shouldOverrideUrl,\r\n payload,\r\n config,\r\n }: RequestParameters): Promise> {\r\n return baseRequest({ url, isSecured, shouldOverrideBaseUrl: shouldOverrideUrl, payload, method: RequestMethod.Delete, config });\r\n }\r\n}\r\n\r\nconst baseRequest = async ({\r\n url,\r\n isSecured,\r\n shouldOverrideBaseUrl: shouldOverrideUrl,\r\n payload,\r\n method,\r\n config,\r\n}: RequestParameters): Promise> => {\r\n try {\r\n const {\r\n apiBaseUrl,\r\n msalConfig: { apiClientId },\r\n featureFlags,\r\n } = await getConfig();\r\n\r\n const disableAuthFlag = featureFlags && featureFlags[FEATUREFLAG_DISABLE_AUTHENTICATION];\r\n\r\n let headers: any;\r\n if (isSecured && !disableAuthFlag?.isActive) {\r\n const token = await refreshAccessToken(apiClientId);\r\n headers = {\r\n Authorization: `Bearer ${token}`,\r\n };\r\n }\r\n\r\n const requestConfig: AxiosRequestConfig = {\r\n url: shouldOverrideUrl ? url : `${apiBaseUrl}${url}`,\r\n method: method as Method,\r\n data: payload,\r\n headers: {\r\n 'x-client': 'Management Portal',\r\n ...headers,\r\n },\r\n ...config,\r\n };\r\n\r\n const [response] = await Promise.all([Axios(requestConfig), delay()]);\r\n\r\n const { status, data, request } = response;\r\n\r\n if (data.success === false) {\r\n const errorResponse = fillApiErrorWithDefaults(\r\n {\r\n status,\r\n message: data.errors.join(' - '),\r\n errors: data.errors,\r\n url: request ? request.responseURL : url,\r\n raw: response,\r\n },\r\n url\r\n );\r\n\r\n return errorResponse;\r\n }\r\n\r\n return data as T;\r\n } catch (error) {\r\n //The request was made and the server responded with an status code different of 2xx\r\n if (error.response) {\r\n const { value } = error.response.data;\r\n\r\n //TODO: Modify how we parse de error. Acording to our exception responses, we should look the property value\r\n\r\n const errors: string[] =\r\n value && Object.prototype.hasOwnProperty.call(value, 'errors')\r\n ? [value?.title, value?.detail, concatErrorMessages(value?.errors)]\r\n : [value?.title, value?.detail];\r\n\r\n const serverError = fillApiErrorWithDefaults(\r\n {\r\n status: error.response.status,\r\n message: errors.filter(Boolean).join(' - '),\r\n errors,\r\n url: error.request.responseURL,\r\n raw: error.response,\r\n },\r\n url\r\n );\r\n\r\n return serverError;\r\n }\r\n\r\n //The request was made but no response was received\r\n if (error.request) {\r\n const { status, statusText, responseURL } = error.request;\r\n\r\n const unknownError = fillApiErrorWithDefaults(\r\n {\r\n status,\r\n message: `${error.message} ${statusText}`,\r\n errors: [statusText],\r\n url: responseURL,\r\n raw: error.request,\r\n },\r\n url\r\n );\r\n\r\n return unknownError;\r\n }\r\n\r\n //Something happened during the setup\r\n const defaultError = fillApiErrorWithDefaults(\r\n {\r\n status: 0,\r\n message: error.message,\r\n errors: [error.message],\r\n url: url,\r\n raw: error,\r\n },\r\n url\r\n );\r\n\r\n return defaultError;\r\n }\r\n};\r\n\r\nexport const refreshAccessToken = async (apiClientId: string): Promise => {\r\n const accounts = AuthService.getAccounts();\r\n\r\n if (accounts && accounts.length > 0) {\r\n try {\r\n const authResult = await AuthService.requestSilentToken(accounts[0], apiClientId);\r\n\r\n return authResult.accessToken;\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }\r\n};\r\n\r\nconst concatErrorMessages = (errors: Record): string[] => {\r\n const errorsArray: string[] = [];\r\n\r\n Object.values(errors).forEach((element) => {\r\n Array.isArray(element) ? errorsArray.push(element.join(' - ')) : errorsArray.push(JSON.stringify(element));\r\n });\r\n\r\n return errorsArray;\r\n};\r\n\r\nconst delay = (duration: number = 250): Promise => {\r\n return new Promise((resolve) => setTimeout(resolve, duration));\r\n};\r\n\r\nexport type RequestResponse = T | ApiError;\r\n\r\nexport interface Resource {\r\n id: string;\r\n resource: T;\r\n}\r\n\r\n//TODO: Remove after migrating async actions\r\nexport const api = async (url: string, method: Method, json?: unknown): Promise => {\r\n try {\r\n const {\r\n apiBaseUrl,\r\n msalConfig: { apiClientId },\r\n featureFlags,\r\n } = await getConfig();\r\n\r\n const disableAuthFlag = featureFlags && featureFlags[FEATUREFLAG_DISABLE_AUTHENTICATION];\r\n const token = !disableAuthFlag?.isActive ? await refreshAccessToken(apiClientId) : '';\r\n const headersConfig = !disableAuthFlag?.isActive ? { Authorization: `Bearer ${token}` } : {};\r\n\r\n // Request Auth\r\n const request: AxiosRequestConfig = {\r\n url: `${apiBaseUrl}${url}`,\r\n method: method,\r\n data: json,\r\n headers: {\r\n ...headersConfig,\r\n 'X-Client': 'Management Portal',\r\n },\r\n };\r\n\r\n // TODO: Handle proper return codes\r\n\r\n const response = await Axios(request);\r\n return response.data as T;\r\n } catch (err) {\r\n // Handle HTTP errors\r\n const errorMessage = !err.response?.data?.error_description ? err.toString() : err.response.data.error_description;\r\n\r\n throw new Error(errorMessage);\r\n }\r\n};\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { ApiError } from \"./types\";\r\n\r\nexport const fillApiErrorWithDefaults = (error: Partial, requestUrl: string): ApiError => {\r\n const errorResponse = new ApiError();\r\n\r\n errorResponse.status = error.status || 0;\r\n errorResponse.message = error.message || 'An error ocurred'; //TODO: Change this message\r\n errorResponse.errors = error.errors!.length ? error.errors! : ['An error ocurred'];\r\n errorResponse.url = error.url || requestUrl;\r\n\r\n return errorResponse;\r\n};","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { AppConfig } from './types';\r\nimport Axios from 'axios';\r\nimport { DefaultError } from '../../models/error/types';\r\nconst configUrl = '/config.json';\r\n\r\nconst loader = new Promise((resolve, reject) => {\r\n Axios.get(configUrl)\r\n .then((o) => resolve(o.data as AppConfig))\r\n .catch((err) => {\r\n console.error('Error loading config:', err);\r\n const errorResponse = new DefaultError('Error loading config', err);\r\n\r\n reject(errorResponse);\r\n });\r\n});\r\n\r\nexport const getConfig = (): Promise => loader;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React, { useEffect, useState, createRef } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useParams } from 'react-router';\r\nimport moment from 'moment';\r\nimport { Radio, Button, Badge, Typography, Form, Input, InputNumber, Popconfirm, Select } from 'antd';\r\nimport { Rule, FormInstance } from 'antd/lib/form';\r\nimport EditIcon from '@material-ui/icons/Edit';\r\nimport SaveIcon from '@material-ui/icons/Save';\r\nimport CloseIcon from '@material-ui/icons/Close';\r\n\r\nimport IAppState from '../../../services/store/IAppState';\r\n\r\nimport CallSelector from './CallSelector';\r\n\r\nimport './CallInfo.css';\r\nimport { selectCallInfoProps } from '../../../stores/calls/selectors';\r\nimport { disconnectCallAsync } from '../../../stores/calls/asyncActions';\r\nimport {\r\n CallDefaults,\r\n CallState,\r\n CallType,\r\n StreamProtocol,\r\n StreamState,\r\n StreamType,\r\n KeyLength,\r\n} from '../../../models/calls/types';\r\nimport { updateCallDefaults } from '../../../stores/calls/actions';\r\nimport { CallInfoProps } from '../types';\r\n\r\nconst { Text } = Typography;\r\nconst { Item } = Form;\r\n\r\nconst CallInfo: React.FC = () => {\r\n const dispatch = useDispatch();\r\n const { id: callId } = useParams<{ id: string }>();\r\n const callInfoProps: CallInfoProps = useSelector((state: IAppState) => selectCallInfoProps(state, callId));\r\n const [passphrase, setPassphrase] = React.useState('');\r\n // edit state\r\n const [editingDefaults, setEditingDefaults] = useState(false);\r\n const [editingProtocol, setEditingProtocol] = useState(callInfoProps.call?.defaultProtocol ?? StreamProtocol.SRT);\r\n const [editingKeyLength, setEditingKeyLength] = useState(\r\n callInfoProps.call?.defaultKeyLength ?? KeyLength.None\r\n );\r\n\r\n const toggleEditMode = () => setEditingDefaults(!editingDefaults);\r\n\r\n const disconnect = () => {\r\n dispatch(disconnectCallAsync(callId));\r\n };\r\n\r\n const getKeyLengthValues = () => {\r\n return Object.keys(KeyLength).filter((k) => typeof KeyLength[k as any] !== 'number');\r\n };\r\n\r\n const onChangePassphrase = (value: any) => setPassphrase(value.target.value);\r\n const onchangeKeyLength = (e: number) => setEditingKeyLength(e);\r\n\r\n // update settings\r\n const onDefaultsUpdated = (newDefaults: unknown) => {\r\n // invoke an asyncAction that will update on API\r\n\r\n dispatch(\r\n updateCallDefaults({\r\n callId,\r\n defaults: newDefaults as CallDefaults,\r\n })\r\n );\r\n\r\n toggleEditMode();\r\n };\r\n\r\n const formRef = createRef();\r\n useEffect(() => {\r\n if (callInfoProps.call)\r\n formRef.current?.setFieldsValue({\r\n protocol: callInfoProps.call.defaultProtocol,\r\n latency: callInfoProps.call.defaultLatency,\r\n passphrase: callInfoProps.call.defaultPassphrase,\r\n keyLength: callInfoProps.call.defaultKeyLength,\r\n });\r\n }, [callInfoProps.call?.id, editingDefaults]);\r\n\r\n // no call, nothing to see\r\n if (!callInfoProps.call) {\r\n return null;\r\n }\r\n\r\n // time formating\r\n const creationDate = moment(callInfoProps.call.createdAt);\r\n const datePart = creationDate.format('L'); // 07/03/2020\r\n const timePart = creationDate.format('LTS'); // 5:29:19 PM\r\n const formattedCreationDate = datePart + ' ' + timePart;\r\n\r\n const connected = callInfoProps.call.state === CallState.Established;\r\n const participantsLength = callInfoProps.call.streams.filter(\r\n (stream) => stream.type === StreamType.Participant\r\n ).length;\r\n const activeStreams = callInfoProps.call.streams.filter((stream) =>\r\n [StreamState.Stopping, StreamState.Starting, StreamState.Ready, StreamState.Receiving, StreamState.NotReceiving].includes(stream.state)\r\n ).length;\r\n\r\n const protocols = Object.keys(StreamProtocol).filter((i) => !isNaN(parseInt(i)));\r\n\r\n const baseRules = {\r\n protocol: [{ type: 'string', required: true } as Rule],\r\n latency: [],\r\n passphrase: [],\r\n };\r\n\r\n const rules =\r\n editingProtocol === StreamProtocol.RTMP\r\n ? baseRules\r\n : {\r\n ...baseRules,\r\n latency: [{ type: 'integer', required: true } as Rule],\r\n passphrase: [{ type: 'string' } as Rule],\r\n keyLength: [{ type: 'integer', required: true } as Rule],\r\n };\r\n\r\n const hasActiveStreams = activeStreams > 0;\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 Status:\r\n \r\n {renderStatusBadge(callInfoProps.call.state)}\r\n {CallState[callInfoProps.call.state]}\r\n \r\n \r\n {connected && (\r\n <>\r\n \r\n \r\n {activeStreams} active stream{activeStreams > 1 ? 's' : null}\r\n \r\n \r\n\r\n \r\n
\r\n
\r\n \r\n Invite Link\r\n \r\n \r\n Call type: \r\n \r\n {CallType[callInfoProps.call.meetingType]} - ({participantsLength} participant\r\n {participantsLength !== 1 ? 's' : null})\r\n \r\n \r\n \r\n Created: {formattedCreationDate}\r\n \r\n\r\n {/* Defaults - READ Mode */}\r\n {connected && !editingDefaults && (\r\n
\r\n \r\n Default protocol: \r\n \r\n {StreamProtocol[callInfoProps.call.defaultProtocol]}\r\n \r\n \r\n\r\n {/* TODO: Switch options based on protocol */}\r\n {callInfoProps.call.defaultProtocol === StreamProtocol.SRT && (\r\n <>\r\n \r\n Default latency: \r\n \r\n {callInfoProps.call.defaultLatency}ms\r\n \r\n \r\n {callInfoProps.call.defaultPassphrase && (\r\n <>\r\n \r\n Default passphrase\r\n \r\n \r\n Default Key Length: \r\n \r\n \r\n {callInfoProps.call.defaultKeyLength\r\n ? `${callInfoProps.call.defaultKeyLength} bytes`\r\n : 'no-key'}\r\n \r\n \r\n \r\n \r\n )}\r\n \r\n )}\r\n {callInfoProps.call.botFqdn && (\r\n \r\n Bot FQDN: \r\n \r\n {callInfoProps.call.botFqdn}\r\n \r\n \r\n )}\r\n {callInfoProps.call.botIp && (\r\n \r\n Bot IP: \r\n \r\n {callInfoProps.call.botIp}\r\n \r\n \r\n )}\r\n
\r\n )}\r\n\r\n {/* Defaults - EDIT Mode */}\r\n {connected && editingDefaults && (\r\n
\r\n Defaults\r\n\r\n \r\n setEditingProtocol(e.target.value)}>\r\n {protocols.map((p, index) => (\r\n \r\n {StreamProtocol[index]}\r\n \r\n ))}\r\n \r\n \r\n\r\n {/* Based on selected Protocol */}\r\n {\r\n {\r\n [StreamProtocol.SRT]: (\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 [StreamProtocol.RTMP]:
,\r\n }[editingProtocol]\r\n }\r\n
\r\n )}\r\n \r\n )}\r\n
\r\n\r\n
\r\n {connected && !editingDefaults && (\r\n }\r\n size=\"large\"\r\n onClick={toggleEditMode}\r\n disabled={hasActiveStreams}\r\n />\r\n )}\r\n {connected && editingDefaults && (\r\n <>\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport enum CallStateBadge {\r\n yellow = CallState.Establishing,\r\n green = CallState.Established,\r\n orange = CallState.Terminating,\r\n gray = CallState.Terminated,\r\n}\r\n\r\nconst renderStatusBadge = (status: CallState): React.ReactElement => (\r\n \r\n);\r\n\r\nexport default CallInfo;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport {push} from 'connected-react-router';\r\nimport {AnyAction} from 'redux';\r\nimport {ThunkAction} from 'redux-thunk';\r\nimport {\r\n Call,\r\n CallState,\r\n CallStreamKey,\r\n InjectionStream,\r\n NewInjectionStream,\r\n StartStreamRequest,\r\n StopStreamRequest,\r\n Stream,\r\n StreamSrtConfiguration\r\n} from '../../models/calls/types';\r\nimport { ApiError } from '../../models/error/types';\r\nimport {ApiClient, Resource} from '../../services/api';\r\nimport IAppState from '../../services/store/IAppState';\r\nimport {\r\n closeNewInjectionStreamDrawer,\r\n closeNewStreamDrawer,\r\n requestActiveCalls,\r\n requestActiveCallsFinished,\r\n requestCall,\r\n requestCallFinished,\r\n RequestCallType,\r\n requestDisconnectCall,\r\n requestDisconnectCallFinished,\r\n requestJoinCall,\r\n requestJoinCallFinished,\r\n requestMuteBot,\r\n requestMuteBotFinished,\r\n requestPollingCall,\r\n requestPollingCallFinished,\r\n requestRefreshStreamKey,\r\n requestRefreshStreamKeyFinished,\r\n requestStartInjectionStream,\r\n requestStartInjectionStreamFinished,\r\n requestStartStream,\r\n requestStartStreamFinished,\r\n requestStopStream,\r\n requestStopStreamFinished,\r\n requestUnmuteBot,\r\n requestUnmuteBotFinished\r\n} from './actions';\r\n\r\nconst POLL_INTERVAL = 1000;\r\nconst CALL_DETAILS_PATH = '/call/details/';\r\n\r\nexport const joinCallAsync = (callUrl : string) : ThunkAction < void,\r\n IAppState,\r\n undefined,\r\n AnyAction > => async (dispatch, getState) => {\r\n dispatch(requestJoinCall(callUrl));\r\n\r\n const joinCallResponse = await ApiClient.post({\r\n url: '/call/initialize-call',\r\n payload: {\r\n MeetingUrl: callUrl\r\n },\r\n isSecured: true\r\n });\r\n\r\n /*\r\n NOTE: Before this change, we didn't update the call state until it was \r\n with Established State. Now we dispatch the action to update the status of the API call\r\n in the application state, and also add the call to the state.\r\n */\r\n\r\n dispatch(requestJoinCallFinished({payload: joinCallResponse}));\r\n\r\n const isError: boolean = joinCallResponse instanceof ApiError;\r\n\r\n\r\n if (! isError) {\r\n const call = joinCallResponse as Call;\r\n dispatch(push(`/call/details/${\r\n call.id\r\n }`));\r\n }\r\n };\r\n\r\nexport const oldjoinCallAsync = (callUrl : string) : ThunkAction < void,\r\n IAppState,\r\n undefined,\r\n AnyAction > => async (dispatch, getState) => {\r\n dispatch(requestJoinCall(callUrl));\r\n\r\n const joinCallResponse = await ApiClient.post({\r\n url: '/call/initialize-call',\r\n payload: {\r\n MeetingUrl: callUrl\r\n },\r\n isSecured: true\r\n });\r\n\r\n /*\r\n NOTE: Before this change, we didn't update the call state until it was \r\n with Established State. Now we dispatch the action to update the status of the API call\r\n in the application state, and also add the call to the state.\r\n */\r\n\r\n dispatch(requestJoinCallFinished({payload: joinCallResponse}));\r\n\r\n const joinCallReponseIsError: boolean = joinCallResponse instanceof ApiError;\r\n\r\n const callId = joinCallReponseIsError ? undefined : (joinCallResponse as Call).id;\r\n /*\r\n TODO: Suggestion:\r\n Analyze where we should do the polling.\r\n Try to remove it from the async action.\r\n */\r\n const pollCall = async () => {\r\n dispatch(requestCall());\r\n const callResponse = await ApiClient.get({url: `/call/${callId}`, isSecured: true});\r\n\r\n dispatch(requestCallFinished({payload: callResponse}));\r\n\r\n const isError: boolean = callResponse instanceof ApiError;\r\n\r\n if (isError) { /*\r\n TODO: Question:\r\n if we have an error when the app starts polling, \r\n should we keep polling or just return?\r\n */\r\n\r\n return;\r\n }\r\n\r\n const call = callResponse as Call;\r\n\r\n /* \r\n NOTE: Now we update the state of the call after getting the response\r\n independently of its state\r\n */\r\n switch (call.state) {\r\n case CallState.Establishing:\r\n // keep polling\r\n return setTimeout(pollCall, POLL_INTERVAL);\r\n\r\n case CallState.Established:\r\n dispatch(push(`/call/details/${\r\n call.id\r\n }`));\r\n return;\r\n case CallState.Terminated:\r\n /* \r\n TODO: Question\r\n Before, we were dispatching a error we weren't using.\r\n Should we do something? Might we add a toast?\r\n */\r\n return;\r\n default:\r\n return;\r\n }\r\n };\r\n\r\n if (! joinCallReponseIsError) {\r\n await pollCall();\r\n }\r\n };\r\n\r\nexport const disconnectCallAsync = (callId : string) : ThunkAction < void,\r\n IAppState,\r\n undefined,\r\n AnyAction > => async (dispatch, getState) => {\r\n const call = getState().calls.activeCalls.find((call) => call.id === callId);\r\n\r\n if (call) {\r\n dispatch(requestDisconnectCall());\r\n\r\n const disonnectCallResponse = await ApiClient.delete>({url: `/call/${callId}`, isSecured: true});\r\n\r\n /* \r\n TODO: Review\r\n At the moment, when we disconnect a call, we just update the call in the state.\r\n Should we remove it from the state?\r\n */\r\n dispatch(requestDisconnectCallFinished({payload: disonnectCallResponse}));\r\n }\r\n };\r\n\r\n/*\r\n TODO: Suggestion/Review:\r\n\r\n We should change the way we poll for the current call and do\r\n something similar to what we do in the Meeting Extension.\r\n*/\r\nexport const pollCurrentCallAsync = () : ThunkAction < void,\r\n IAppState,\r\n undefined,\r\n AnyAction > => async (dispatch, getState) => {\r\n const poll = async () => {\r\n\r\n const path = getState().router.location.pathname;\r\n\r\n if (! path.startsWith(CALL_DETAILS_PATH)) {\r\n return setTimeout(poll, POLL_INTERVAL);\r\n }\r\n\r\n // User is on the CallDetails view\r\n // Check if the call is already in state, if not, push a 'Loading' call placeholder for this one\r\n const callId = path.split(CALL_DETAILS_PATH).pop();\r\n if (! callId) {\r\n return setTimeout(poll, POLL_INTERVAL);\r\n }\r\n\r\n // poll data\r\n const existingCall = getState().calls.activeCalls.find((call) => call.id === callId);\r\n // Do not refresh if call already terminated\r\n if (! existingCall || existingCall.state !== CallState.Terminated) {\r\n dispatch(requestPollingCall());\r\n\r\n const requestCallResponse = await ApiClient.get({url: `/call/${callId}`, isSecured: true});\r\n\r\n dispatch(requestPollingCallFinished({\r\n payload: requestCallResponse,\r\n meta: existingCall ? RequestCallType.ExistingCall : RequestCallType.NewCall\r\n }));\r\n\r\n\r\n const isError: boolean = requestCallResponse instanceof ApiError;\r\n if (isError) {\r\n /*\r\n TODO: Question:\r\n if we have an error when the app starts polling, \r\n should we keep polling or just return?\r\n */\r\n\r\n // Simulate room disconnection and redirect home\r\n dispatch(push('/'));\r\n\r\n // Enqueue\r\n return setTimeout(poll, POLL_INTERVAL);\r\n }\r\n }\r\n\r\n return setTimeout(poll, POLL_INTERVAL);\r\n };\r\n\r\n // trigger polling\r\n return setTimeout(poll, POLL_INTERVAL);\r\n };\r\n\r\nexport const startStreamAsync = ({callId, participantId, protocol, config} : StartStreamRequest) : ThunkAction < void,\r\n IAppState,\r\n undefined,\r\n AnyAction > => async (dispatch, getState) => {\r\n const state = getState();\r\n\r\n const call = state.calls.activeCalls.find((call) => call.id === callId);\r\n if (! call) {\r\n return;\r\n }\r\n\r\n const stream = call.streams.find((stream) => stream.id === participantId);\r\n if (! stream) {\r\n return;\r\n }\r\n\r\n dispatch(requestStartStream());\r\n\r\n const startStreamResponse = await ApiClient.post>({\r\n url: `/call/${\r\n call.id\r\n }/stream/start-extraction`,\r\n payload: {\r\n callId: call.id,\r\n resourceType: stream.type,\r\n participantId: stream.id,\r\n participantGraphId: stream.participantGraphId,\r\n protocol: protocol,\r\n latency: (config as StreamSrtConfiguration).latency,\r\n mode: (config as StreamSrtConfiguration).mode,\r\n streamUrl: config.streamUrl || null,\r\n streamKey: config.streamKey || null,\r\n timeOverlay: config.timeOverlay,\r\n audioFormat: config.audioFormat,\r\n keyLength: (config as StreamSrtConfiguration).keyLength,\r\n enableSsl: config.enableSsl\r\n },\r\n isSecured: true\r\n });\r\n\r\n dispatch(requestStartStreamFinished({payload: startStreamResponse}));\r\n\r\n /*\r\n TODO: Review\r\n We should analyze how to handle UI state in the application state, to improve the semantic\r\n of the code, and make it more readable or understandable.\r\n */\r\n dispatch(closeNewStreamDrawer());\r\n };\r\n\r\nexport const stopStreamAsync = ({callId, type, participantId, participantName} : StopStreamRequest) : ThunkAction < void,\r\n IAppState,\r\n undefined,\r\n AnyAction > => async (dispatch, getState) => {\r\n const state = getState();\r\n const call = state.calls.activeCalls.find((o) => o.id === callId);\r\n if (! call) {\r\n return;\r\n }\r\n\r\n const stream = call.streams.find((o) => o.id === participantId);\r\n if (! stream) {\r\n return;\r\n }\r\n\r\n dispatch(requestStopStream());\r\n\r\n // call api\r\n const stopStreamResponse = await ApiClient.post>({\r\n url: `/call/${\r\n call.id\r\n }/stream/stop-extraction`,\r\n isSecured: true,\r\n payload: {\r\n callId: call.id,\r\n resourceType: stream.type,\r\n participantId: stream.id,\r\n participantGraphId: stream.participantGraphId\r\n }\r\n });\r\n\r\n dispatch(requestStopStreamFinished({payload: stopStreamResponse}));\r\n };\r\n\r\nexport const getActiveCallsAsync = () : ThunkAction < void,\r\n IAppState,\r\n undefined,\r\n AnyAction > => async (dispatch, getState) => {\r\n dispatch(requestActiveCalls());\r\n\r\n const activeCallsResponse = await ApiClient.get({url: '/call/active', isSecured: true});\r\n\r\n dispatch(requestActiveCallsFinished({payload: activeCallsResponse}));\r\n };\r\n\r\nexport const refreshStreamKeyAsync = (callId: string) : ThunkAction<\r\n void,\r\n IAppState,\r\n undefined,\r\n AnyAction> => async (dispatch, getState) => {\r\n dispatch(requestRefreshStreamKey());\r\n\r\n const refreshStreamKeyResponse = await ApiClient.post({\r\n url: `/call/${callId}/generate-stream-key`,\r\n isSecured: true,\r\n });\r\n\r\n dispatch(requestRefreshStreamKeyFinished({payload: refreshStreamKeyResponse}));\r\n};\r\n\r\nexport const startInjectionAsync = ({\r\n callId,\r\n streamUrl,\r\n streamKey,\r\n protocol,\r\n mode,\r\n latency,\r\n enableSsl,\r\n keyLength\r\n } : NewInjectionStream) : ThunkAction < void,\r\n IAppState,\r\n undefined,\r\n AnyAction > => async (dispatch, getState) => { // TODO: Review this action dispatch(injectionRequestCancelled());\r\n\r\n dispatch(requestStartInjectionStream());\r\n // Call API\r\n const startInjectionResponse = await ApiClient.post({\r\n url: `/call/${callId}/stream/start-injection`,\r\n isSecured: true,\r\n payload: {\r\n callId,\r\n streamUrl,\r\n streamKey,\r\n protocol,\r\n mode,\r\n latency,\r\n enableSsl,\r\n keyLength\r\n }\r\n });\r\n\r\n dispatch(requestStartInjectionStreamFinished({payload: startInjectionResponse}));\r\n\r\n dispatch(closeNewInjectionStreamDrawer());\r\n };\r\n\r\nexport const stopInjectionAsync = (callId : string, streamId : string) : ThunkAction < void,\r\n IAppState,\r\n undefined,\r\n AnyAction > => async (dispatch, getState) => {\r\n dispatch(requestStartInjectionStream());\r\n\r\n const startInjectionResponse = await ApiClient.post({url: `/call/${callId}/stream/${streamId}/stop-injection`, isSecured: true});\r\n\r\n dispatch(requestStartInjectionStreamFinished({payload: startInjectionResponse}));\r\n };\r\n\r\nexport const muteBotAsync = (callId : string) : ThunkAction < void,\r\n IAppState,\r\n undefined,\r\n AnyAction > => async (dispatch, getState) => {\r\n dispatch(requestMuteBot());\r\n\r\n const muteBotResponse = await ApiClient.post({url: `/call/${callId}/mute`, isSecured: true});\r\n\r\n dispatch(requestMuteBotFinished({payload: muteBotResponse}));\r\n };\r\n\r\nexport const unmuteBotAsync = (callId : string) : ThunkAction < void,\r\n IAppState,\r\n undefined,\r\n AnyAction > => async (dispatch, getState) => {\r\n dispatch(requestUnmuteBot());\r\n\r\n const muteBotResponse = await ApiClient.post({url: `/call/${callId}/unmute`, isSecured: true});\r\n\r\n dispatch(requestUnmuteBotFinished({payload: muteBotResponse}));\r\n };\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React, { ReactText, useReducer } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Drawer, Button, Input, Radio, InputNumber, Switch, Select, Tooltip } from 'antd';\r\nimport { ReloadOutlined } from '@ant-design/icons';\r\nimport IAppState from '../../../services/store/IAppState';\r\nimport './NewStreamDrawer.css';\r\nimport { selectNewStreamDrawerProps } from '../../../stores/calls/selectors';\r\nimport { useParams } from 'react-router-dom';\r\nimport {\r\n StartStreamRequest,\r\n StreamConfiguration,\r\n StreamMode,\r\n StreamProtocol,\r\n StreamSrtConfiguration,\r\n StreamType,\r\n KeyLength,\r\n RtmpMode,\r\n} from '../../../models/calls/types';\r\nimport { closeNewStreamDrawer } from '../../../stores/calls/actions';\r\nimport { refreshStreamKeyAsync, startStreamAsync } from '../../../stores/calls/asyncActions';\r\n\r\nenum ViewMode {\r\n Simple,\r\n Advanced,\r\n}\r\n\r\ninterface DrawerState {\r\n protocol?: StreamProtocol;\r\n flow?: StreamType;\r\n url?: string;\r\n mode?: StreamMode | RtmpMode;\r\n port?: string;\r\n passphrase?: string;\r\n latency?: number;\r\n followSpeakerAudio?: boolean;\r\n showAdvanced?: boolean;\r\n viewMode?: ViewMode;\r\n unmixedAudio?: boolean;\r\n audioFormat?: number;\r\n timeOverlay?: boolean;\r\n keyLength?: KeyLength;\r\n enableSsl?: boolean;\r\n}\r\n\r\nconst NewStreamDrawer: React.FC = () => {\r\n const dispatch = useDispatch();\r\n const { id: callId } = useParams<{ id: string }>();\r\n const drawerProps = useSelector((state: IAppState) => selectNewStreamDrawerProps(state, callId));\r\n\r\n const visible = !!drawerProps.newStream;\r\n\r\n const rtmpPushStreamKey = drawerProps.call?.privateContext?.streamKey ?? '';\r\n\r\n //Warning! It wasn't tested with nested objects\r\n const [state, setState] = useReducer(\r\n (state: DrawerState, newState: Partial) => ({ ...state, ...newState }),\r\n { viewMode: ViewMode.Simple }\r\n );\r\n\r\n const loadDefaultSettings = () => {\r\n const protocol = drawerProps.call?.defaultProtocol || StreamProtocol.SRT;\r\n const passphrase = protocol === StreamProtocol.SRT ? drawerProps.newStream?.advancedSettings.key : '';\r\n const latency = drawerProps.newStream?.advancedSettings.latency;\r\n const url = '';\r\n const mode = protocol === StreamProtocol.RTMP ? RtmpMode.Pull : StreamMode.Listener;\r\n const unmixedAudio = drawerProps.newStream?.advancedSettings.unmixedAudio;\r\n const audioFormat = 0;\r\n const timeOverlay = true;\r\n const keyLength = drawerProps.newStream?.advancedSettings.keyLength || KeyLength.None;\r\n const enableSsl = drawerProps.newStream?.advancedSettings.enableSsl;\r\n\r\n setState({\r\n protocol,\r\n passphrase,\r\n latency,\r\n url,\r\n mode,\r\n unmixedAudio,\r\n audioFormat,\r\n timeOverlay,\r\n keyLength,\r\n enableSsl,\r\n });\r\n };\r\n\r\n const handleChange = (e: any) => {\r\n setState({ [e.target.name]: e.target.value });\r\n };\r\n\r\n const handleLatencyChange = (value?: ReactText) => {\r\n const latency = parseInt(value?.toString() ?? '0', 10);\r\n setState({ latency: latency });\r\n };\r\n\r\n const handleSwitchSsl = (checked: boolean) => {\r\n setState({ enableSsl: checked });\r\n };\r\n\r\n const handleClose = () => {\r\n dispatch(closeNewStreamDrawer());\r\n };\r\n\r\n const handleSave = () => {\r\n if (!drawerProps.newStream) {\r\n return;\r\n }\r\n\r\n const config = getStreamConfiguration(state) as StreamConfiguration;\r\n\r\n const newStream: StartStreamRequest = {\r\n callId: drawerProps.newStream.callId,\r\n type: drawerProps.newStream.streamType,\r\n participantId: drawerProps.newStream.participantId,\r\n protocol: state.protocol || StreamProtocol.SRT,\r\n config,\r\n };\r\n\r\n dispatch(startStreamAsync(newStream));\r\n };\r\n\r\n const handleAudioFormatChange = (value: any) => {\r\n setState({ audioFormat: value });\r\n };\r\n\r\n const handleTimeOverlayChange = (checked: boolean) => {\r\n setState({ timeOverlay: checked });\r\n };\r\n\r\n const handleKeyLengthSelect = (keyLength: number) => {\r\n setState({ keyLength });\r\n };\r\n\r\n const handleRefreshStreamKey = () => {\r\n dispatch(refreshStreamKeyAsync(callId));\r\n };\r\n\r\n const getKeyLengthValues = () => {\r\n return Object.keys(KeyLength).filter((k) => typeof KeyLength[k as any] !== 'number');\r\n };\r\n\r\n const getStreamConfiguration = (state: DrawerState) => {\r\n switch (state.protocol) {\r\n case StreamProtocol.SRT:\r\n return {\r\n mode: state.mode,\r\n latency: state.latency,\r\n streamKey: state.passphrase,\r\n streamUrl: state.url,\r\n unmixedAudio: state.unmixedAudio,\r\n audioFormat: state.audioFormat,\r\n timeOverlay: state.timeOverlay,\r\n keyLength: state.passphrase ? state.keyLength : KeyLength.None,\r\n } as StreamSrtConfiguration;\r\n case StreamProtocol.RTMP:\r\n return {\r\n mode: state.mode,\r\n unmixedAudio: state.unmixedAudio,\r\n streamUrl: state.mode === RtmpMode.Push ? state.url : null,\r\n streamKey: state.mode === RtmpMode.Push ? state.passphrase : null,\r\n audioFormat: state.audioFormat,\r\n timeOverlay: state.timeOverlay,\r\n enableSsl: state.enableSsl,\r\n } as StreamConfiguration;\r\n default:\r\n return {};\r\n }\r\n };\r\n\r\n const renderCommonSettings = () => {\r\n return (\r\n <>\r\n
\r\n
\r\n Audio format\r\n \r\n
\r\n
\r\n
\r\n Video settings\r\n
\r\n Add time overlay in the video:\r\n \r\n
\r\n
\r\n \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 Selected flow:\r\n

{`Following ${drawerProps.newStream?.participantName}`}

\r\n
\r\n\r\n {state.protocol === StreamProtocol.SRT && (\r\n <>\r\n
\r\n
\r\n \r\n Default settings\r\n Advanced settings\r\n \r\n
\r\n
\r\n\r\n {state.viewMode === ViewMode.Advanced ? (\r\n
\r\n
\r\n Mode\r\n
\r\n \r\n Listener\r\n Caller\r\n \r\n
\r\n
\r\n\r\n {state.mode === StreamMode.Caller ? (\r\n
\r\n Insert your SRT URL\r\n
\r\n \r\n
\r\n
\r\n ) : null}\r\n\r\n
\r\n Latency\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n Passphrase\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n Key Length\r\n \r\n {getKeyLengthValues().map((value) => (\r\n \r\n {parseInt(value) ? `${value} bytes` : 'no-key'}\r\n \r\n ))}\r\n \r\n
\r\n\r\n {renderCommonSettings()}\r\n
\r\n ) : (\r\n
\r\n
\r\n \r\n By pressing "Start" a new stream will be created with the default settings set for this\r\n call. To edit them, switch to advanced.\r\n \r\n
\r\n
\r\n )}\r\n \r\n )}\r\n\r\n {state.protocol === StreamProtocol.RTMP && (\r\n <>\r\n
\r\n Mode\r\n
\r\n \r\n Pull\r\n Push\r\n \r\n
\r\n
\r\n {state.mode === RtmpMode.Push && (\r\n
\r\n Stream Url\r\n
\r\n \r\n
\r\n
\r\n )}\r\n {state.mode === RtmpMode.Pull && (\r\n
\r\n Enable Ssl\r\n \r\n
\r\n )}\r\n
\r\n Stream Key\r\n
\r\n \r\n {state.mode === RtmpMode.Pull && (\r\n \r\n }\r\n style={{ marginLeft: 10 }}\r\n onClick={handleRefreshStreamKey}\r\n >\r\n \r\n )}\r\n
\r\n
\r\n\r\n {renderCommonSettings()}\r\n \r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default NewStreamDrawer;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React, { useEffect, useState } from 'react';\r\nimport { useDispatch } from 'react-redux';\r\nimport { Avatar, Row, Col, Button, Typography } from 'antd';\r\nimport Videocam from '@material-ui/icons/Videocam';\r\nimport VideocamOff from '@material-ui/icons/VideocamOff';\r\nimport Mic from '@material-ui/icons/Mic';\r\nimport MicOff from '@material-ui/icons/MicOff';\r\nimport ScreenShare from '@material-ui/icons/ScreenShare';\r\nimport StopScreenShare from '@material-ui/icons/StopScreenShare';\r\nimport './StreamCard.css';\r\nimport { Stream, StreamProtocol, StreamState, StreamType } from '../../../models/calls/types';\r\nimport { openNewStreamDrawer, updateStreamPhoto } from '../../../stores/calls/actions';\r\nimport { stopStreamAsync } from '../../../stores/calls/asyncActions';\r\nimport { CallStreamsProps } from '../types';\r\nimport { ApiClient } from '../../../services/api';\r\nimport { ApiError } from '../../../models/error/types';\r\n\r\ninterface StreamCardProps {\r\n callProtocol: StreamProtocol;\r\n stream: Stream;\r\n callStreams: CallStreamsProps;\r\n}\r\n\r\nconst OBFUSCATION_PATTERN = '********';\r\n\r\nconst StreamCard: React.FC = (props) => {\r\n const dispatch = useDispatch();\r\n\r\n const { callProtocol: protocol, stream, callStreams } = props;\r\n const [expanded, setExpanded] = useState(false);\r\n const toggleExpand = () => setExpanded(!expanded);\r\n\r\n useEffect(() => {\r\n if (stream.photoUrl && stream.photo === undefined) {\r\n ApiClient.get({\r\n url: stream.photoUrl,\r\n isSecured: true,\r\n shouldOverrideBaseUrl: true,\r\n config: {\r\n responseType: 'blob',\r\n },\r\n }).then((response) => {\r\n const isError = response instanceof ApiError;\r\n if (isError) {\r\n const error = response as ApiError;\r\n console.error(error.raw);\r\n dispatch(updateStreamPhoto(stream.id, '', callStreams.callId));\r\n return;\r\n }\r\n\r\n const urlCreator = window.URL || window.webkitURL;\r\n const imageUrl = urlCreator.createObjectURL(response);\r\n dispatch(updateStreamPhoto(stream.id, imageUrl, callStreams.callId));\r\n });\r\n }\r\n }, []);\r\n\r\n // collapse disabled streams\r\n if (expanded && !callStreams.callEnabled) {\r\n setExpanded(false);\r\n }\r\n\r\n const isStreamDisconnected = stream.state === StreamState.Disconnected;\r\n const toggleStreamOperation = () => {\r\n if (!isStreamDisconnected && expanded) {\r\n // active & expanded, collapse\r\n setExpanded(false);\r\n }\r\n\r\n if (isStreamDisconnected) {\r\n dispatch(\r\n openNewStreamDrawer({\r\n callId: callStreams.callId,\r\n streamType: stream.type,\r\n participantId: stream.id,\r\n participantName: stream.displayName,\r\n })\r\n );\r\n }\r\n\r\n if (!isStreamDisconnected) {\r\n dispatch(\r\n stopStreamAsync({\r\n callId: callStreams.callId,\r\n type: stream.type,\r\n participantId: stream.id,\r\n participantName: stream.displayName,\r\n })\r\n );\r\n }\r\n };\r\n\r\n const getStreamUrl = (): string => {\r\n if (stream.details?.streamUrl) {\r\n const rtmpUrl = stream.details.streamUrl.replace(stream.details.passphrase, OBFUSCATION_PATTERN);\r\n\r\n return rtmpUrl;\r\n }\r\n\r\n return stream.details?.streamUrl ?? '';\r\n };\r\n\r\n const initials = stream.displayName\r\n .split(' ')\r\n .map((s) => s[0].toUpperCase())\r\n .join('');\r\n const hasStream = callStreams.callEnabled && stream.state !== StreamState.Disconnected;\r\n const status = getConnectionStatus(stream);\r\n\r\n const operationEnabled =\r\n callStreams.callEnabled &&\r\n ((stream.state === StreamState.Ready || stream.state === StreamState.Receiving || stream.state === StreamState.NotReceiving) ||\r\n (stream.state === StreamState.Disconnected &&\r\n ((stream.type === StreamType.VbSS && callStreams.stageEnabled) ||\r\n (stream.type === StreamType.PrimarySpeaker && callStreams.primarySpeakerEnabled) ||\r\n ([StreamType.Participant, StreamType.LargeGallery, StreamType.LiveEvent, StreamType.TogetherMode].includes(\r\n stream.type\r\n ) &&\r\n stream.isSharingVideo))));\r\n\r\n const classes = ['streamCard', getConnectionClass(stream), expanded ? 'expanded' : ''];\r\n const avatarSize = 112;\r\n const avatarIcon = stream.photo ? (\r\n dispatch(updateStreamPhoto(stream.id, '', callStreams.callId))}\r\n />\r\n ) : (\r\n <>{initials}\r\n );\r\n\r\n const isRtmp = protocol === StreamProtocol.RTMP;\r\n const streamUrl = getStreamUrl();\r\n\r\n return (\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n

{props.stream.displayName}

\r\n {status}\r\n \r\n {(stream.type === StreamType.Participant && (\r\n \r\n {stream.isSharingVideo && }\r\n {!stream.isSharingVideo && }\r\n {stream.isSharingAudio && !stream.audioMuted && }\r\n {stream.isSharingAudio && stream.audioMuted && }\r\n {stream.isSharingScreen && }\r\n {!stream.isSharingScreen && }\r\n \r\n )) || }\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n {stream.details && (\r\n <>\r\n
\r\n Stream URL:{' '}\r\n \r\n {streamUrl}\r\n \r\n
\r\n\r\n
\r\n {isRtmp ? 'StreamKey: ' : 'Passphrase: '}\r\n \r\n \r\n {stream.details.passphrase ? '********' : 'None'}\r\n \r\n \r\n
\r\n\r\n {!isRtmp && (\r\n
\r\n Latency: {stream.details.latency}ms\r\n
\r\n )}\r\n \r\n )}\r\n \r\n
\r\n
\r\n {hasStream && (\r\n
\r\n {expanded ? '- less info' : '+ more info'}\r\n
\r\n )}\r\n
\r\n );\r\n};\r\n\r\nconst getConnectionClass = (stream: Stream): string => {\r\n switch (stream.state) {\r\n case StreamState.Stopping:\r\n return 'disconnected';\r\n case StreamState.Disconnected:\r\n return 'disconnected';\r\n case StreamState.Starting:\r\n return 'initializing';\r\n case StreamState.Ready:\r\n case StreamState.Receiving:\r\n case StreamState.NotReceiving:\r\n return stream.isHealthy ? 'established' : 'error';\r\n case StreamState.Error:\r\n case StreamState.StartingError:\r\n case StreamState.StoppingError:\r\n return 'error';\r\n }\r\n};\r\n\r\nconst getConnectionStatus = (stream: Stream): string => {\r\n switch (stream.state) {\r\n case StreamState.Disconnected:\r\n return 'Available Stream';\r\n case StreamState.Stopping:\r\n return 'Stopping';\r\n case StreamState.Starting:\r\n return 'Starting';\r\n case StreamState.Error:\r\n case StreamState.StartingError:\r\n case StreamState.StoppingError:\r\n return 'Unhealthy Stream';\r\n case StreamState.Ready:\r\n case StreamState.Receiving:\r\n case StreamState.NotReceiving:\r\n return stream.isHealthy ? 'Active Stream' : 'Unhealthy Stream';\r\n }\r\n};\r\n\r\nexport default StreamCard;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { IconButton } from '@material-ui/core';\r\nimport { Mic, MicOff } from '@material-ui/icons';\r\nimport { Avatar, Button, Col, Row, Typography } from 'antd';\r\nimport React, { useState } from 'react';\r\nimport { useDispatch } from 'react-redux';\r\nimport { InjectionStream, StreamMode, StreamProtocol, StreamState } from '../../../models/calls/types';\r\nimport { openNewInjectionStreamDrawer } from '../../../stores/calls/actions';\r\nimport { muteBotAsync, stopInjectionAsync, unmuteBotAsync } from '../../../stores/calls/asyncActions';\r\nimport { CallStreamsProps } from '../types';\r\nimport './InjectionCard.css';\r\n\r\ninterface InjectionCardProps {\r\n callStreams: CallStreamsProps;\r\n}\r\n\r\nconst avatarSize = 112;\r\nconst OBFUSCATION_PATTERN = '********';\r\n\r\nconst InjectionCard: React.FC = (props) => {\r\n const dispatch = useDispatch();\r\n const { callStreams } = props;\r\n const callId = callStreams.callId;\r\n const stream = callStreams.injectionStream;\r\n const streamId = stream?.id;\r\n const hasStream = callStreams.injectionStream && stream?.state !== StreamState.Disconnected;\r\n\r\n const startInjection = () => {\r\n if (callId) {\r\n dispatch(\r\n openNewInjectionStreamDrawer({\r\n callId,\r\n })\r\n );\r\n }\r\n };\r\n\r\n const stopInjection = () => {\r\n if (callId && streamId) {\r\n dispatch(stopInjectionAsync(callId, streamId));\r\n }\r\n };\r\n const [audioMuted, setAudioMuted] = useState(false);\r\n const [expanded, setExpanded] = useState(false);\r\n const toggleExpand = () => setExpanded(!expanded);\r\n\r\n // collapse disabled streams\r\n if (expanded && !stream) {\r\n setExpanded(false);\r\n }\r\n\r\n const classes = ['injectionCard', getConnectionClass(stream), expanded ? 'expanded' : ''];\r\n const status = getConnectionStatus(stream);\r\n const injectionUrl = stream ? getInjectionUrl(stream) : '';\r\n\r\n const protocolText = () => {\r\n switch (stream?.protocol) {\r\n case StreamProtocol.RTMP:\r\n return 'RTMP';\r\n case StreamProtocol.SRT:\r\n return 'SRT';\r\n default:\r\n return '';\r\n }\r\n };\r\n\r\n const streamModeText = () => {\r\n switch (stream?.streamMode) {\r\n case StreamMode.Caller:\r\n return stream?.protocol === StreamProtocol.RTMP ? 'Pull' : 'Caller';\r\n case StreamMode.Listener:\r\n return stream?.protocol === StreamProtocol.RTMP ? 'Push' : 'Listener';\r\n default:\r\n return '';\r\n }\r\n };\r\n\r\n const toggleBotAudio = () => {\r\n if (callId) {\r\n if (!audioMuted) {\r\n dispatch(muteBotAsync(callId));\r\n setAudioMuted(true);\r\n } else {\r\n dispatch(unmuteBotAsync(callId));\r\n setAudioMuted(false);\r\n }\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

Injection Stream

\r\n {status}\r\n \r\n \r\n {audioMuted ? : }\r\n \r\n \r\n \r\n {stream == null ? 'START' : 'STOP'}\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n {stream && (\r\n <>\r\n
\r\n Injection URL:\r\n \r\n {'' + injectionUrl}\r\n \r\n
\r\n {stream.protocol === StreamProtocol.SRT && (\r\n <>\r\n
\r\n Passphrase:{' '}\r\n \r\n \r\n {stream.passphrase ? '********' : 'None'}\r\n \r\n \r\n
\r\n
\r\n Latency: {stream.latency}ms\r\n
\r\n \r\n )}\r\n
\r\n Protocol: {protocolText()}\r\n
\r\n
\r\n Stream Mode: {streamModeText()}\r\n
\r\n \r\n )}\r\n \r\n
\r\n
\r\n {hasStream && (\r\n
\r\n {expanded ? '- less info' : '+ more info'}\r\n
\r\n )}\r\n
\r\n );\r\n};\r\n\r\nconst getConnectionClass = (stream: InjectionStream | null): string => {\r\n switch (stream?.state) {\r\n case StreamState.Stopping:\r\n case StreamState.Disconnected:\r\n return 'disconnected';\r\n case StreamState.Starting:\r\n return 'initializing';\r\n case StreamState.Ready:\r\n case StreamState.Receiving:\r\n case StreamState.NotReceiving:\r\n return 'established';\r\n case StreamState.Error:\r\n case StreamState.StartingError:\r\n case StreamState.StoppingError:\r\n return 'error';\r\n default:\r\n return '';\r\n }\r\n};\r\n\r\nconst getConnectionStatus = (stream: InjectionStream | null): string => {\r\n switch (stream?.state) {\r\n case StreamState.Disconnected:\r\n return 'Available Stream';\r\n case StreamState.Stopping:\r\n return 'Stopping';\r\n case StreamState.Starting:\r\n return 'Starting';\r\n case StreamState.Error:\r\n case StreamState.StartingError:\r\n case StreamState.StoppingError:\r\n return 'Unhealthy Stream';\r\n case StreamState.Ready:\r\n return 'Ready';\r\n case StreamState.Receiving:\r\n return 'Receiving';\r\n case StreamState.NotReceiving:\r\n return 'Not Receiving';\r\n default:\r\n return 'Available Stream';\r\n }\r\n};\r\n\r\nconst getInjectionUrl = (stream: InjectionStream): string => {\r\n if (stream.protocol === StreamProtocol.RTMP && stream.injectionUrl) {\r\n const rtmpUrl = stream.injectionUrl.replace(stream.passphrase, OBFUSCATION_PATTERN);\r\n\r\n return rtmpUrl;\r\n }\r\n\r\n return stream.injectionUrl ?? '';\r\n};\r\n\r\nexport default InjectionCard;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React from 'react';\r\nimport {useSelector } from 'react-redux';\r\nimport IAppState from '../../../services/store/IAppState';\r\nimport StreamCard from './StreamCard';\r\nimport './CallStreams.css';\r\nimport NewStreamPopUpDrawer from './NewStreamDrawer';\r\nimport InjectionCard from './InjectionCard';\r\nimport { useParams } from 'react-router-dom';\r\nimport { selectCallStreams } from '../../../stores/calls/selectors';\r\nimport { Stream } from '../../../models/calls/types';\r\nimport { CallStreamsProps } from '../types';\r\n\r\n\r\nconst CallStreams: React.FC = () => {\r\n const { id: callId } = useParams<{id: string}>();\r\n const callStreams = useSelector((state: IAppState) => selectCallStreams(state, callId));\r\n\r\n if (!callStreams.mainStreams.length && !callStreams.participantStreams.length && !callStreams.activeStreams.length) {\r\n // Empty Call?\r\n return null;\r\n }\r\n\r\n const hasMainStreams = callStreams.mainStreams.length > 0;\r\n const hasParticipants = callStreams.participantStreams.length > 0;\r\n const hasActiveStreams = callStreams.activeStreams.length > 0;\r\n\r\n return (\r\n
\r\n \r\n\r\n

Injection Stream

\r\n \r\n

Active Streams

\r\n {(hasActiveStreams && renderStreams(callStreams.activeStreams, callStreams)) || (\r\n

\r\n Start a stream from below\r\n

\r\n )}\r\n\r\n {hasMainStreams && (\r\n <>\r\n

Main Streams

\r\n {renderStreams(callStreams.mainStreams, callStreams)}\r\n \r\n )}\r\n\r\n {hasParticipants && (\r\n <>\r\n

Participants

\r\n {renderStreams(callStreams.participantStreams, callStreams)}\r\n \r\n )}\r\n\r\n
\r\n
\r\n );\r\n};\r\n\r\nconst renderStreams = (streams: Stream[], callStreams: CallStreamsProps): React.ReactElement[] =>\r\n streams.map((stream) => (\r\n \r\n ));\r\n\r\nexport default CallStreams;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React, { ReactText, useReducer } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useParams } from 'react-router';\r\nimport { Drawer, Button, Input, Radio, InputNumber, Tooltip, Typography, Select } from 'antd';\r\nimport { ReloadOutlined } from '@ant-design/icons';\r\nimport IAppState from '../../../services/store/IAppState';\r\nimport './NewInjectionStreamDrawer.css';\r\nimport Form from 'antd/lib/form';\r\nimport { Switch } from 'antd';\r\nimport { Call, NewInjectionStream, StreamMode, StreamProtocol, KeyLength } from '../../../models/calls/types';\r\nimport { selectNewInjectionStreamDrawerProps } from '../../../stores/calls/selectors';\r\nimport { closeNewInjectionStreamDrawer } from '../../../stores/calls/actions';\r\nimport { startInjectionAsync, refreshStreamKeyAsync } from '../../../stores/calls/asyncActions';\r\n\r\ninterface DrawerState {\r\n protocol?: StreamProtocol;\r\n injectionUrl?: string;\r\n streamMode?: StreamMode;\r\n latency?: number;\r\n passphrase?: string;\r\n enableSsl?: boolean;\r\n keyLength?: KeyLength;\r\n}\r\n\r\nconst DEFAULT_LATENCY = 750;\r\nconst OBFUSCATION_PATTERN = '********';\r\n\r\nconst NewInjectionStreamDrawer: React.FC = () => {\r\n const dispatch = useDispatch();\r\n const { id: callId } = useParams<{ id: string }>();\r\n const drawerProps = useSelector((state: IAppState) => selectNewInjectionStreamDrawerProps(state, callId));\r\n\r\n const visible = !!drawerProps.newInjectionStream;\r\n\r\n //Drawer's state\r\n const initialState: DrawerState = {\r\n protocol: drawerProps.newInjectionStream?.protocol || StreamProtocol.SRT,\r\n streamMode: drawerProps.newInjectionStream?.mode || StreamMode.Caller,\r\n injectionUrl: drawerProps.newInjectionStream?.streamUrl,\r\n latency: drawerProps.newInjectionStream?.latency || DEFAULT_LATENCY,\r\n passphrase: drawerProps.newInjectionStream?.streamKey,\r\n enableSsl: drawerProps.newInjectionStream?.enableSsl,\r\n keyLength: drawerProps.newInjectionStream?.keyLength || KeyLength.None,\r\n };\r\n\r\n //Warning! It wasn't tested with nested objects\r\n const [state, setState] = useReducer(\r\n (state: DrawerState, newState: Partial) => ({ ...state, ...newState }),\r\n {}\r\n );\r\n\r\n const loadDefaultSettings = () => {\r\n const protocol = drawerProps.newInjectionStream?.protocol || StreamProtocol.SRT;\r\n const streamMode = drawerProps.newInjectionStream?.mode || StreamMode.Caller;\r\n const injectionUrl = drawerProps.newInjectionStream?.streamUrl;\r\n const latency = drawerProps.newInjectionStream?.latency || DEFAULT_LATENCY;\r\n const passphrase = drawerProps.newInjectionStream?.streamKey;\r\n const enableSsl = drawerProps.newInjectionStream?.enableSsl;\r\n const keyLength = drawerProps.newInjectionStream?.keyLength || KeyLength.None;\r\n\r\n setState({ protocol, streamMode, injectionUrl, latency, passphrase, enableSsl, keyLength });\r\n };\r\n\r\n const handleChange = (e: any) => {\r\n setState({ [e.target.name]: e.target.value });\r\n };\r\n\r\n const handleSwitchChange = (checked: boolean) => {\r\n setState({ enableSsl: checked });\r\n };\r\n\r\n const handleLatencyChange = (value?: ReactText) => {\r\n const latency = parseInt(value?.toString() ?? '0', 10);\r\n setState({ latency });\r\n };\r\n\r\n const handleKeyLengthSelect = (keyLength: number) => {\r\n setState({ keyLength });\r\n };\r\n\r\n const handleRefreshStremKey = () => {\r\n dispatch(refreshStreamKeyAsync(callId));\r\n };\r\n\r\n const handleClose = () => {\r\n dispatch(closeNewInjectionStreamDrawer());\r\n };\r\n\r\n const handleSave = () => {\r\n if (!drawerProps.newInjectionStream) {\r\n return;\r\n }\r\n\r\n const newInjectionStream: NewInjectionStream = {\r\n callId: drawerProps.newInjectionStream.callId,\r\n protocol: state.protocol || StreamProtocol.SRT,\r\n mode: state.streamMode || StreamMode.Caller,\r\n streamUrl: state.injectionUrl,\r\n latency: state.protocol === StreamProtocol.SRT ? state.latency : undefined,\r\n streamKey: state.protocol === StreamProtocol.SRT ? state.passphrase : undefined,\r\n enableSsl: state.protocol === StreamProtocol.RTMP ? state.enableSsl : undefined,\r\n keyLength: (state.protocol === StreamProtocol.SRT && state.passphrase) ? state.keyLength : undefined,\r\n };\r\n\r\n dispatch(startInjectionAsync(newInjectionStream));\r\n };\r\n\r\n const getKeyLengthValues = () => {\r\n return Object.keys(KeyLength).filter((k) => typeof KeyLength[k as any] !== 'number');\r\n };\r\n\r\n const getRtmpPushStreamUrl = (call: Call | null, enableSsl: boolean): string => {\r\n const protocol = enableSsl ? 'rtmps' : 'rtmp';\r\n const port = enableSsl ? 2936 : 1936;\r\n const ingest = enableSsl ? 'secure-ingest' : 'ingest';\r\n\r\n if (call) {\r\n const domain = call.botFqdn?.split(':')[0];\r\n return `${protocol}://${domain}:${port}/${ingest}/${OBFUSCATION_PATTERN}?callId=${call?.id}`;\r\n }\r\n\r\n return '';\r\n };\r\n\r\n const rtmpPushStreamKey = drawerProps.call?.privateContext?.streamKey ?? '';\r\n const rtmpPushStreamUrl = getRtmpPushStreamUrl(drawerProps.call, !!state.enableSsl);\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 Start injection\r\n
\r\n\r\n \r\n \r\n SRT\r\n RTMP\r\n \r\n \r\n\r\n \r\n \r\n \r\n {state.protocol === StreamProtocol.SRT ? 'Caller' : 'Pull'}\r\n \r\n \r\n {state.protocol === StreamProtocol.SRT ? 'Listener' : 'Push'}\r\n \r\n \r\n \r\n\r\n {state.streamMode === StreamMode.Caller && (\r\n \r\n \r\n \r\n )}\r\n\r\n {state.protocol === StreamProtocol.SRT && (\r\n <>\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n {getKeyLengthValues().map((value) => (\r\n \r\n {parseInt(value) ? `${value} bytes` : 'no-key'}\r\n \r\n ))}\r\n \r\n \r\n \r\n )}\r\n\r\n {state.protocol === StreamProtocol.RTMP && state.streamMode === StreamMode.Listener && (\r\n <>\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n }\r\n style={{ marginLeft: 10 }}\r\n onClick={handleRefreshStremKey}\r\n >\r\n \r\n \r\n\r\n \r\n \r\n {rtmpPushStreamUrl}\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n );\r\n};\r\n\r\nexport default NewInjectionStreamDrawer;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React, { Fragment } from 'react';\r\nimport CallInfo from './components/CallInfo';\r\nimport CallStreams from './components/CallStreams';\r\nimport NewInjectionStreamDrawer from './components/NewInjectionStreamDrawer';\r\nimport NewStreamDrawer from './components/NewStreamDrawer';\r\n\r\nconst CallDetails: React.FC<{}> = () => {\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\nexport default CallDetails;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport IAppState from '../../services/store/IAppState';\r\n\r\nconst Footer: React.FC = () => {\r\n const { initialized, app } = useSelector((state: IAppState) => state.config);\r\n\r\n const versionString = initialized ? app?.buildNumber ?? '' : '';\r\n return
Broadcast Development Kit {versionString}
;\r\n};\r\n\r\nexport default Footer;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React from 'react';\r\nimport { Link, withRouter, RouteComponentProps } from 'react-router-dom';\r\n\r\nimport './NavBar.css';\r\n\r\ninterface INavBarDataProps extends RouteComponentProps {\r\n links: Array<{label:string, to: string}>\r\n}\r\n\r\nconst NavBar: React.FC = (props) => {\r\n\r\n const navBarLinks = props.links.map(o => ({\r\n ...o,\r\n selected: props.location.pathname === o.to\r\n }));\r\n\r\n return (\r\n
\r\n
    \r\n {navBarLinks.map(o => (\r\n
  • {o.label}
  • \r\n ))}\r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default withRouter(NavBar);\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Link } from 'react-router-dom';\r\nimport { Row, Col, Avatar } from 'antd';\r\nimport { UserOutlined } from '@ant-design/icons';\r\nimport NavBar from './NavBar';\r\nimport './Header.css';\r\nimport Logo from '../../images/logo.png';\r\nimport IAppState from '../../services/store/IAppState';\r\nimport { AuthStatus } from '../../models/auth/types';\r\nimport { signOut } from '../../stores/auth/asyncActions';\r\nimport { FEATUREFLAG_DISABLE_AUTHENTICATION } from '../../stores/config/constants';\r\n\r\nconst links = [\r\n {\r\n label: 'Join a Call',\r\n to: '/call/join',\r\n },\r\n {\r\n label: 'Calls',\r\n to: '/',\r\n },\r\n {\r\n label: 'Bot Service Status',\r\n to: '/botservice',\r\n },\r\n];\r\n\r\nconst Header: React.FC = () => {\r\n const dispatch = useDispatch();\r\n const { status: authStatus, userProfile } = useSelector((state: IAppState) => state.auth);\r\n const { app: appConfig } = useSelector((state: IAppState) => state.config);\r\n const userName = userProfile?.username || '';\r\n const role = authStatus === AuthStatus.Authenticated ? 'Producer' : 'None';\r\n const disableAuthFlag = appConfig?.featureFlags && appConfig.featureFlags[FEATUREFLAG_DISABLE_AUTHENTICATION];\r\n\r\n const onClickSignOut = () => {\r\n dispatch(signOut(userName));\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 {userName}\r\n
\r\n {role}\r\n {!disableAuthFlag?.isActive && (\r\n <>\r\n {' '}\r\n |\r\n {' '}\r\n \r\n Logout\r\n \r\n \r\n )}\r\n
\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Header;\r\n","import React from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\n\r\nconst NotFound: React.FC = () => {\r\n return (\r\n
\r\n

404 - Not Found

\r\n

Sorry we can’t find that page.

\r\n

Maybe the page you are looking for has been removed, or you typed in the wrong URL.

\r\n Go Home\r\n
\r\n );\r\n};\r\n\r\nexport default NotFound;","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { Route, Redirect } from \"react-router-dom\";\r\nimport { AuthStatus } from \"../../models/auth/types\";\r\nimport IAppState from \"../../services/store/IAppState\";\r\n\r\ninterface PrivateRouteProps {\r\n component: React.ComponentType;\r\n path: string;\r\n exact?: boolean;\r\n}\r\n\r\nconst PrivateRoute: React.FC = ({\r\n component: Component,\r\n ...rest\r\n}) => {\r\n const authStatus = useSelector((state: IAppState) => state.auth.status);\r\n const isAuthenticated = authStatus === AuthStatus.Authenticated;\r\n \r\n return (\r\n \r\n isAuthenticated ? : \r\n }\r\n />\r\n );\r\n};\r\n\r\nexport default PrivateRoute;","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React from 'react';\r\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\r\nimport { Link } from 'react-router-dom';\r\nimport moment from 'moment'\r\nimport './ActiveCallCard.css';\r\nimport { Call, CallState, CallType } from '../../../models/calls/types';\r\n\r\ninterface ICallCardDataProps {\r\n call: Call;\r\n}\r\n\r\ntype ICallCardProps = ICallCardDataProps;\r\n\r\nconst ActiveCallCard: React.FC = ({ call }) => {\r\n\r\n const status = getConnectionStatus(call);\r\n const classes = ['activeCallCard', getConnectionClass(call)];\r\n\r\n // creation formatting\r\n const creationDate = moment(call.createdAt);\r\n const datePart = creationDate.format('L'); // 07/03/2020\r\n const timePart = creationDate.format('LTS'); // 5:29:19 PM\r\n // const minutesPassed = creationDate.startOf('hour').fromNow(); // 14 minutes ago\r\n const formattedCreation = datePart + \" \" + timePart; // + \" (\" + minutesPassed + \")\";\r\n\r\n\r\n return (\r\n
\r\n
\r\n

{call.displayName}

\r\n

Status: {status}

\r\n

{CallTypeStrings[call.meetingType]} | Created : {formattedCreation}

\r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default ActiveCallCard;\r\n\r\nconst getConnectionStatus = (call: Call): string => {\r\n switch (call.state) {\r\n case CallState.Establishing: return 'Connecting';\r\n case CallState.Established: return 'Connected';\r\n case CallState.Terminating: return 'Disconnecting';\r\n case CallState.Terminated: return 'Disconnected';\r\n }\r\n}\r\n\r\nconst getConnectionClass = (call: Call): string => {\r\n switch (call.state) {\r\n case CallState.Establishing: return 'initializing';\r\n case CallState.Established: return 'healthy';\r\n case CallState.Terminating: return 'disconnecting';\r\n case CallState.Terminated: return 'disconnected';\r\n }\r\n}\r\n\r\nconst CallTypeStrings = {\r\n [CallType.Default]: 'Normal call',\r\n [CallType.Event]: 'Event call'\r\n};\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { createSelector, ParametricSelector } from \"reselect\";\r\nimport IAppState from \"../../services/store/IAppState\";\r\nimport { RequestingState } from \"./reducer\";\r\n\r\nexport const selectRequesting: ParametricSelector = createSelector(\r\n (state: IAppState) => state.requesting,\r\n (state: IAppState, actionTypes: string[]) => actionTypes,\r\n _selectRequesting\r\n);\r\n\r\nfunction _selectRequesting(requestingState: RequestingState, actionTypes: string[]): boolean {\r\n return actionTypes.some((actionType: string) => requestingState[actionType]);\r\n}","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React, { useEffect } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Link } from 'react-router-dom';\r\nimport { Button, Spin } from 'antd';\r\n\r\nimport './Home.css';\r\nimport ActiveCallCard from './components/ActiveCallCard';\r\nimport { getActiveCallsAsync } from '../../stores/calls/asyncActions';\r\nimport * as CallsActions from '../../stores/calls/actions';\r\nimport { selectRequesting } from '../../stores/requesting/selectors';\r\nimport IAppState from '../../services/store/IAppState';\r\nimport { selectActiveCalls } from '../../stores/calls/selectors';\r\n\r\nconst Home: React.FC = () => {\r\n\r\n const dispatch = useDispatch();\r\n const isRequesting = useSelector((state: IAppState) => selectRequesting(state, [CallsActions.REQUEST_ACTIVE_CALLS]));\r\n const activeCalls = useSelector((state: IAppState) => selectActiveCalls(state));\r\n\r\n useEffect(() => {\r\n dispatch(getActiveCallsAsync());\r\n }, []);\r\n\r\n const hasCalls = activeCalls.length > 0;\r\n return (\r\n
\r\n

Active Calls

\r\n\r\n {!hasCalls && (\r\n <>\r\n {isRequesting && (\r\n
\r\n )}\r\n {!isRequesting && (\r\n <>\r\n

There are no active calls.

\r\n

\r\n Please join the bot to an active call to start.\r\n

\r\n \r\n )}\r\n \r\n )}\r\n\r\n {hasCalls && (\r\n <>\r\n {activeCalls.map(o => )}\r\n
\r\n \r\n
\r\n \r\n )}\r\n
\r\n )\r\n}\r\n\r\nexport default Home;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nexport enum BotServiceInfrastructureState {\r\n Running = \"PowerState/running\",\r\n Deallocating = \"PowerState/deallocating\",\r\n Deallocated = \"PowerState/deallocated\",\r\n Starting = \"PowerState/starting\",\r\n Stopped = \"PowerState/stopped\",\r\n Stopping = \"PowerState/stopping\",\r\n Unknown = \"PowerState/unknown\",\r\n}\r\n\r\nexport interface BotService {\r\n id: string;\r\n name: string;\r\n callId: string;\r\n state: BotServiceStates;\r\n infrastructure: Infrastructure;\r\n}\r\n\r\nexport interface Infrastructure {\r\n virtualMachineName: string;\r\n resourceGroup: string;\r\n subscriptionId: string;\r\n powerState: BotServiceInfrastructureState;\r\n provisioningDetails: ProvisioningDetails;\r\n}\r\n\r\nexport interface ProvisioningDetails {\r\n state: ProvisioningState;\r\n message: string;\r\n}\r\n\r\nexport interface ProvisioningState {\r\n id: ProvisioningStateValues;\r\n name: string;\r\n}\r\n\r\nexport enum ProvisioningStateValues {\r\n Provisioning = 0,\r\n Provisioned = 1,\r\n Deprovisioning = 2,\r\n Deprovisioned = 3,\r\n Error = 4,\r\n Unknown = 5\r\n}\r\n\r\nexport enum TeamsColors {\r\n Red = \"#D74654\",\r\n Purple = \"#6264A7\",\r\n Black = \"#11100F\",\r\n Green = \"#7FBA00\",\r\n Grey = \"#BEBBB8\",\r\n MiddleGrey = \"#3B3A39\",\r\n DarkGrey = \"#201F1E\",\r\n White = \"white\",\r\n}\r\n\r\nexport enum TeamsMargins {\r\n micro = \"4px\",\r\n small = \"8px\",\r\n medium = \"20px\",\r\n large = \"40px\",\r\n}\r\n\r\nexport enum BotServiceStates {\r\n Unavailable = 0,\r\n Available = 1,\r\n Busy = 2,\r\n}","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React, { createRef } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { Input, Button, Form, Row, Col } from \"antd\";\r\nimport { Store } from \"antd/lib/form/interface\";\r\nimport { Rule, FormInstance } from \"antd/lib/form\";\r\nimport HourglassEmpty from \"@material-ui/icons/HourglassEmpty\";\r\n\r\nimport \"./JoinCall.css\";\r\nimport { selectNewCall } from \"../../stores/calls/selectors\";\r\nimport IAppState from \"../../services/store/IAppState\";\r\nimport { selectRequesting } from \"../../stores/requesting/selectors\";\r\nimport { extractLinks } from \"../../services/helpers\";\r\nimport * as CallsActions from '../../stores/calls/actions';\r\nimport { joinCallAsync } from \"../../stores/calls/asyncActions\";\r\n\r\nconst { Item } = Form;\r\n\r\nconst MEETING_URL_PATTERN = /https:\\/\\/teams\\.microsoft\\.com\\/l\\/meetup-join\\/(.*)/;\r\n\r\nconst JoinCall: React.FC = (props) => {\r\n\r\n const dispatch = useDispatch();\r\n const connectingCall = useSelector((state: IAppState) => selectNewCall(state));\r\n const isRequesting: boolean = useSelector((state: IAppState) => selectRequesting(state, [CallsActions.REQUEST_JOIN_CALL]));\r\n\r\n\r\n const formRef = createRef();\r\n const handlePaste = (data: DataTransfer) => {\r\n const html = data.getData(\"text/html\");\r\n if (html && html.indexOf('href=\"https://teams.microsoft.com/l/meetup-join\"') > -1) {\r\n // extract links\r\n const links = extractLinks(html);\r\n const meetingLink = links.find((o) => MEETING_URL_PATTERN.test(o));\r\n if (meetingLink) {\r\n setTimeout(() => formRef.current?.setFieldsValue({ callUrl: meetingLink }), 1);\r\n }\r\n }\r\n };\r\n\r\n // When form is completed correctly\r\n const onFinish = (form: Store) => {\r\n // Trigger JoinCall AsyncAction\r\n dispatch(joinCallAsync(form.callUrl));\r\n };\r\n\r\n // Validation\r\n const callUrlRules: Rule[] = [\r\n {\r\n required: true,\r\n whitespace: false,\r\n message: \"Please add your Teams Invite URL.\",\r\n pattern: MEETING_URL_PATTERN,\r\n },\r\n ];\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n
\r\n

Connect to a new call

\r\n
\r\n \r\n handlePaste(e.clipboardData)}\r\n />\r\n \r\n
\r\n
\r\n
\r\n\r\n \r\n\r\n
\r\n
\r\n\r\n {isRequesting && (\r\n \r\n \r\n \r\n \r\n \r\n

\r\n Joining {connectingCall?.callUrl}\r\n

\r\n

Please wait while the bot joins...

\r\n \r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default JoinCall\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nexport const extractLinks = (rawHTML: string): string[] => {\r\n\r\n const doc = document.createElement('html');\r\n doc.innerHTML = rawHTML;\r\n const links = doc.getElementsByTagName('a')\r\n const urls = [];\r\n\r\n for (let i = 0; i < links.length; i++) {\r\n urls.push(links[i].getAttribute('href'));\r\n }\r\n\r\n return urls.filter(Boolean) as string[];\r\n};\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { Button, Card } from \"antd\";\r\nimport { LoginOutlined } from \"@ant-design/icons\";\r\nimport { Redirect } from \"react-router-dom\";\r\nimport { signIn } from \"../../stores/auth/asyncActions\";\r\nimport IAppState from \"../../services/store/IAppState\";\r\nimport { AuthStatus } from \"../../models/auth/types\";\r\n\r\nconst LoginPage: React.FC = () => {\r\n const dispatch = useDispatch();\r\n const authStatus = useSelector((state: IAppState) => state.auth.status);\r\n const isAuthenticated = authStatus === AuthStatus.Authenticated;\r\n\r\n const { Meta } = Card;\r\n const onClickSignIn = () => {\r\n dispatch(signIn());\r\n }\r\n return isAuthenticated ? (\r\n \r\n ) : (\r\n \r\n \r\n \r\n
\r\n }\r\n shape=\"round\"\r\n onClick={onClickSignIn}\r\n >\r\n Login with your account\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default LoginPage;","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React from 'react';\r\nimport PowerOffIcon from '@material-ui/icons/PowerOff';\r\nimport CloseIcon from '@material-ui/icons/Close';\r\nimport './BotServiceStatusCard.css';\r\nimport Card from '@material-ui/core/Card';\r\nimport CardHeader from '@material-ui/core/CardHeader';\r\nimport CardContent from '@material-ui/core/CardContent';\r\nimport StorageIcon from '@material-ui/icons/Storage';\r\nimport Avatar from '@material-ui/core/Avatar';\r\nimport IconButton from '@material-ui/core/IconButton';\r\nimport { makeStyles, createStyles } from '@material-ui/core/styles';\r\nimport StopRoundedIcon from '@material-ui/icons/StopRounded';\r\nimport PlayArrowRoundedIcon from '@material-ui/icons/PlayArrowRounded';\r\nimport HourglassEmptyIcon from '@material-ui/icons/HourglassEmpty';\r\nimport RecordVoiceOverIcon from '@material-ui/icons/RecordVoiceOver';\r\nimport PersonIcon from '@material-ui/icons/Person';\r\nimport List from '@material-ui/core/List';\r\nimport ListItem from '@material-ui/core/ListItem';\r\nimport ListItemText from '@material-ui/core/ListItemText';\r\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\r\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\r\nimport { BotService, BotServiceStates, ProvisioningStateValues } from '../../models/service/types';\r\n\r\ninterface BotServiceStatusDataProps {\r\n name: string;\r\n botService: BotService;\r\n onStart: () => void;\r\n onStop: () => void;\r\n}\r\n\r\nconst useStyles = makeStyles(() =>\r\n createStyles({\r\n rotateIcon: {\r\n animation: 'infiniteRotate 2s linear infinite',\r\n },\r\n avatarColor: {\r\n backgroundColor: 'lightgrey',\r\n }\r\n })\r\n);\r\n\r\nconst BotServiceStatusCard: React.FC = (props) => {\r\n const classes = useStyles();\r\n\r\n const { botService, name, onStart, onStop } = props;\r\n\r\n const serviceState = BotServiceStates[botService.state];\r\n const { id: provisioningStateValue, name: provisioningStateDisplayName } =\r\n botService.infrastructure.provisioningDetails.state;\r\n const hasTransitioningState: boolean =\r\n provisioningStateValue === ProvisioningStateValues.Provisioning ||\r\n provisioningStateValue === ProvisioningStateValues.Deprovisioning;\r\n const stateDisplayName =\r\n provisioningStateValue === ProvisioningStateValues.Provisioned ? serviceState : provisioningStateDisplayName;\r\n\r\n const provisionedIcon = () => {\r\n switch(botService.state) {\r\n case BotServiceStates.Available: \r\n return ;\r\n case BotServiceStates.Busy:\r\n return ;\r\n default:\r\n return ;\r\n }\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n }\r\n title={{name} || ' [Bot Service] '}\r\n // subheader=\"teamstx-demo_group\" // resourceGroup\r\n >\r\n \r\n \r\n \r\n \r\n \r\n {provisioningStateValue === ProvisioningStateValues.Provisioned && (\r\n provisionedIcon()\r\n )}\r\n {provisioningStateValue === ProvisioningStateValues.Deprovisioned && (\r\n \r\n )}\r\n {hasTransitioningState && }\r\n \r\n \r\n \r\n \r\n \r\n {![ProvisioningStateValues.Provisioning, ProvisioningStateValues.Provisioned].includes(\r\n provisioningStateValue\r\n ) && (\r\n \r\n \r\n \r\n )}\r\n {[ProvisioningStateValues.Provisioning, ProvisioningStateValues.Provisioned].includes(\r\n provisioningStateValue\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\nexport default BotServiceStatusCard;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { AnyAction } from 'redux';\r\nimport { ThunkAction } from 'redux-thunk';\r\nimport { BotService } from '../../models/service/types';\r\nimport { ApiClient, Resource } from '../../services/api';\r\nimport IAppState from '../../services/store/IAppState';\r\nimport {\r\n requestBotService,\r\n requestBotServiceFinished,\r\n requestStartService,\r\n requestStartServiceFinished,\r\n requestStopService,\r\n requestStopServiceFinished,\r\n} from './actions';\r\n\r\n/*\r\n TODO: Warning\r\n The default service id is temporary\r\n*/\r\n\r\nconst DEFAULT_SERVICE_ID = '00000000-0000-0000-0000-000000000000';\r\n\r\nexport const startBotServiceAsync = (): ThunkAction => async (dispatch) => {\r\n dispatch(requestStartService());\r\n\r\n const startServiceResponse = await ApiClient.post>({\r\n url: `/service/${DEFAULT_SERVICE_ID}/start`,\r\n isSecured: true,\r\n });\r\n\r\n dispatch(requestStartServiceFinished({ payload: startServiceResponse }));\r\n};\r\n\r\nexport const stopBotServiceAsync = (): ThunkAction => async (dispatch) => {\r\n dispatch(requestStopService());\r\n\r\n const stopBotServiceResponse = await ApiClient.post>({\r\n url: `/service/${DEFAULT_SERVICE_ID}/stop`,\r\n isSecured: true,\r\n });\r\n\r\n dispatch(requestStopServiceFinished({ payload: stopBotServiceResponse }));\r\n};\r\n\r\nexport const getBotServiceAsync = (): ThunkAction => async (dispatch) => {\r\n dispatch(requestBotService());\r\n\r\n const getBotServiceResponse = await ApiClient.get>({\r\n url: `/service/${DEFAULT_SERVICE_ID}/state`,\r\n isSecured: true,\r\n });\r\n\r\n dispatch(requestBotServiceFinished({ payload: getBotServiceResponse }));\r\n};\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { useEffect, useRef } from \"react\";\r\n\r\nfunction useInterval(callback: () => any, delay: number | null) {\r\n const savedCallback = useRef(null);\r\n\r\n // Remember the latest callback.\r\n useEffect(() => {\r\n savedCallback.current = callback;\r\n }, [callback]);\r\n\r\n // Set up the interval.\r\n useEffect(() => {\r\n function tick() {\r\n const currentCallback = savedCallback.current;\r\n if (currentCallback) {\r\n currentCallback();\r\n }\r\n }\r\n if (delay !== null) {\r\n const id = setInterval(tick, delay);\r\n return () => clearInterval(id);\r\n }\r\n }, [delay]);\r\n}\r\n\r\nexport default useInterval;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React, { useCallback, useEffect, useState } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Spin } from 'antd';\r\nimport './BotServiceStatus.css';\r\nimport BotServiceStatusCard from './BotServiceStatusCard';\r\nimport * as BotServiceActions from '../../stores/service/actions';\r\nimport { selectRequesting } from '../../stores/requesting/selectors';\r\nimport IAppState from '../../services/store/IAppState';\r\nimport { getBotServiceAsync, startBotServiceAsync, stopBotServiceAsync } from '../../stores/service/asyncActions';\r\nimport useInterval from '../../hooks/useInterval';\r\n\r\nconst ServicePage: React.FC = () => {\r\n const dispatch = useDispatch();\r\n const { botServices } = useSelector((state: IAppState) => state.botServiceStatus);\r\n const [isPollingEnabled, setIsPollingEnabled] = useState(false)\r\n const isRequesting: boolean = useSelector((state: IAppState) =>\r\n selectRequesting(state, [BotServiceActions.REQUEST_BOT_SERVICE])\r\n );\r\n \r\n useInterval(useCallback(() => dispatch(getBotServiceAsync()), [dispatch, getBotServiceAsync]), isPollingEnabled ? 3000 : null);\r\n\r\n useEffect(()=>{\r\n setIsPollingEnabled(true)\r\n },[])\r\n\r\n const hasBotServices = botServices.length > 0;\r\n return (\r\n
\r\n

Bot Services

\r\n {!hasBotServices && (\r\n <>\r\n {isRequesting && (\r\n
\r\n \r\n
\r\n )}\r\n {isRequesting && (\r\n <>\r\n

There are no Bot Services.

\r\n \r\n )}\r\n \r\n )}\r\n {hasBotServices && (\r\n <>\r\n {botServices.map((botService, i) => (\r\n dispatch(startBotServiceAsync())}\r\n onStop={() => dispatch(stopBotServiceAsync())}\r\n />\r\n ))}\r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default ServicePage;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Redirect } from 'react-router-dom';\r\nimport { Button, Card } from 'antd';\r\nimport { LoginOutlined } from '@ant-design/icons';\r\nimport { AuthStatus } from '../../models/auth/types';\r\nimport IAppState from '../../services/store/IAppState';\r\nimport { signOut } from '../../stores/auth/asyncActions';\r\n\r\nconst Unauthorized: React.FC = () => {\r\n const dispatch = useDispatch();\r\n const { status: authStatus, userProfile } = useSelector((state: IAppState) => state.auth);\r\n const isUnauthorized = authStatus === AuthStatus.Unauthorized;\r\n\r\n const onClickSignOut = () => {\r\n const userName = userProfile?.username || '';\r\n dispatch(signOut(userName));\r\n };\r\n\r\n const { Meta } = Card;\r\n\r\n return isUnauthorized ? (\r\n \r\n \r\n \r\n
\r\n }\r\n shape=\"round\"\r\n onClick={onClickSignOut}\r\n >\r\n Log out\r\n \r\n
\r\n \r\n ) : (\r\n \r\n );\r\n};\r\n\r\nexport default Unauthorized;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { Spin } from \"antd\";\r\nimport React, { Fragment, useEffect } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { Route, Switch } from \"react-router-dom\";\r\nimport { AuthStatus } from \"./models/auth/types\";\r\nimport IAppState from \"./services/store/IAppState\";\r\nimport { setAuthenticationDisabled } from \"./stores/auth/actions\";\r\nimport { initilizeAuthentication } from \"./stores/auth/asyncActions\";\r\nimport { FEATUREFLAG_DISABLE_AUTHENTICATION } from \"./stores/config/constants\";\r\nimport CallDetails from \"./views/call-details/CallDetails\";\r\nimport Footer from \"./views/components/Footer\";\r\nimport Header from \"./views/components/Header\";\r\nimport NotFound from \"./views/components/NotFound\";\r\nimport PrivateRoute from \"./views/components/PrivateRoute\";\r\nimport Home from \"./views/home/Home\";\r\nimport JoinCall from \"./views/join-call/JoinCall\";\r\nimport LoginPage from \"./views/login/LoginPage\";\r\nimport BotServiceStatus from \"./views/service/BotServiceStatus\";\r\nimport Unauthorized from \"./views/unauthorized/Unauthorized\";\r\n\r\nconst App: React.FC = () => {\r\n const dispatch = useDispatch();\r\n const { initialized: authInitialized, status: authStatus } = useSelector((state: IAppState) => state.auth);\r\n const { app: appConfig, initialized: configInitialized } = useSelector((state: IAppState) => state.config);\r\n const disableAuthFlag = appConfig?.featureFlags && appConfig.featureFlags[FEATUREFLAG_DISABLE_AUTHENTICATION];\r\n const isAuthenticated = authStatus === AuthStatus.Authenticated;\r\n\r\n useEffect(() => {\r\n if (appConfig) {\r\n disableAuthFlag?.isActive\r\n ? dispatch(setAuthenticationDisabled())\r\n : dispatch(initilizeAuthentication(appConfig.msalConfig));\r\n }\r\n }, [configInitialized]);\r\n\r\n if (!authInitialized) {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n } else {\r\n return (\r\n
\r\n {isAuthenticated &&
}\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\nexport default App;\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { Provider as ReduxProvider } from \"react-redux\";\r\nimport { ConnectedRouter } from \"connected-react-router\";\r\nimport configureStore, { DispatchExts, history } from \"./services/store\";\r\n\r\nimport 'antd/dist/antd.css';\r\nimport './index.css';\r\nimport App from './App';\r\nimport { loadConfig } from './stores/config/asyncActions';\r\nimport { pollCurrentCallAsync } from './stores/calls/asyncActions';\r\n\r\nconst store = configureStore();\r\nconst storeDispatch = store.dispatch as DispatchExts;\r\n\r\n// triger config loading\r\nstoreDispatch(loadConfig())\r\n\r\n// trigger automatic polling of selected call\r\nstoreDispatch(pollCurrentCallAsync());\r\n\r\nReactDOM.render(<>\r\n \r\n \r\n \r\n \r\n \r\n\r\n, document.getElementById('root'));\r\n","// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\nimport { AnyAction } from 'redux';\r\nimport { ThunkAction } from 'redux-thunk';\r\nimport IAppState from '../../services/store/IAppState';\r\nimport { getConfig } from './loader';\r\nimport { loadConfig as loadConfigAction, loadConfigError } from './actions';\r\n\r\nexport const loadConfig = (): ThunkAction => async (dispatch, getState) => {\r\n try {\r\n const config = await getConfig();\r\n dispatch(loadConfigAction(config));\r\n } catch (error) {\r\n dispatch(loadConfigError(error));\r\n }\r\n};\r\n"],"sourceRoot":""}