{"version":3,"sources":["assets/images/cancan-logo.png","views/SignIn.tsx","components/LoadingIndicator.tsx","components/SignUp.tsx","components/FlagButton.tsx","assets/images/icon-report.png","components/SuperLikeButton.tsx","assets/images/icon-superlike.png","assets/images/icon-tip-active.png","components/TippingButton.tsx","components/ProfilePic.tsx","components/LottieAnimation.tsx","components/SuperLikeEffect.tsx","assets/images/icon-like.png","components/Video.tsx","assets/images/icon-comment.png","assets/images/icon-share.png","views/Feed.tsx","views/Discover.tsx","components/Upload.tsx","assets/images/rewards-view.png","views/Rewards.tsx","components/FollowButton.tsx","components/FollowUserRow.tsx","assets/images/icon-back.png","views/Profile.tsx","views/Shared.tsx","assets/images/icon-rewards.png","components/DropDayNotification.tsx","assets/images/icon-tokens.png","assets/images/icon-close.png","components/RewardShowerNotification.tsx","components/MainNav.tsx","assets/images/icon-home.png","assets/images/icon-discover.png","assets/images/icon-upload.png","assets/images/icon-profile.png","components/PrivateRoutes.tsx","AppRouter.tsx","index.tsx","utils/canister.ts","../.dfx/ic/canisters/CanCan/CanCan.did.js","../.dfx/ic/canisters/CanCan/CanCan.js","utils/canister/actor.ts","components/SearchVideoItem.tsx","utils/video.ts","utils/authClient.ts","utils/auth.tsx","utils/updateHead.ts","utils/index.ts"],"names":["SignIn","props","children","auth","useAuth","history","useHistory","useEffect","user","identity","getPrincipal","isAnonymous","replace","id","alt","src","logo","style","width","onClick","async","logIn","push","className","LoadingIndicator","loadingMessage","completedMessage","isLoading","showCompletedMessage","timeout","CSSTransition","in","classNames","unmountOnExit","SignUp","error","setError","useState","isCheckingICForUser","setIsCheckingICForUser","isSigningIn","setIsSigningIn","usernameInputRef","useRef","isAuthReady","isAuthenticated","undefined","getUserNameByPrincipal","then","username","getUserFromCanister","setUser","onSubmit","evt","preventDefault","stopPropagation","current","value","checkUsername","createUser","htmlFor","ref","type","name","placeholder","hidden","FlagButton","currentUserId","videoInfo","localFlags","setLocalFlags","Number","abuseFlagCount","isActive","setActive","viewerHasFlagged","isDisabled","putAbuseFlagVideo","videoId","pointerEvents","cursor","SuperLikeButton","handleSuperLike","isSuperLiked","disabled","data-test-id","TippingButton","senderId","currentRewardPoints","recipientId","onRefreshUser","setDisabled","activeAnimations","setActiveAnimations","animationId","setAnimationId","localRewardPoints","setRewardPoints","tippingPoints","setTippingPoints","saveTippingDebounced","debounce","putRewardTransfer","BigInt","localTippingPoints","ev","prevId","currentId","prev","setTimeout","filter","opacity","tipIcon","length","map","left","top","ProfilePic","profilePic","profileColor","textToColor","backgroundColor","title","LottieAnimation","animation","height","animationData","play","SuperLikeEffect","mainAnimActive","setMainAnimActive","secondAnimActive","setSecondAnimActive","timeoutMain","timeoutSecondary","clearTimeout","animationPosition","x","y","window","innerHeight","iconPositionInAnimation","animationStyling","transform","SuperLikeAnim","SuperLikeAnimIcon","Video","isPreview","userId","userRewardPoints","videoHash","onClose","VideoBase","setPlay","fileType","setFileType","videoSourceURL","setVideoSourceURL","userPic","setUserPic","userLikes","setUserLikes","likes","includes","setIsSuperLiked","superLikes","videoIsFlagged","videoRef","getVideoChunks","blobURL","console","log","mimeType","mime","lookup","fileType_t","split","URL","revokeObjectURL","pause","isCurrentUser","videoBlurStyle","aria-label","loop","muted","autoPlay","position","to","caption","superLike","like","state","display","comments","some","comment","shares","Feed","profileInfo","feed","setFeed","setIsLoading","userName","getFeedVideos","videos","catch","e","v","rewards","toString","Discover","setVideos","searchTerm","setSearchTerm","videoPreview","setVideoPreview","setLoading","getSearchVideos","searchedVideos","searchRef","debouncedChangeHandler","val","handleClick","clickedVideo","onChange","SearchVideoItem","video","Upload","onUpload","videoFile","setVideoFile","videoPreviewURL","setVideoPreviewURL","uploading","setUploading","uploadingClean","setUploadingClean","inputRef","textAreaRef","videoUploadController","useUploadVideo","click","arrayBuffer","buffer","videoBlob","Blob","vidURL","createObjectURL","completedVideo","accept","files","target","item","file","rows","setFile","setCaption","setReady","Rewards","rewardsView","FollowButton","isFollowing","handleFollow","FollowUserRow","following","disableFollow","setIsFollowing","event","Profile","currentUser","onLogOut","useParams","activeSubView","setActiveSubView","goBack","userProfile","setUserProfile","setProfilePic","currentUserFollows","initialIsFollowed","indexOf","isFollowed","setIsFollowed","isCurrentUserProfile","fetchUserProfile","profileData","fetchProfilePic","picData","getProfilePic","imgSrc","fileToImgSrc","info","userToFollow","willFollow","follow","Promise","all","uploadedVideos","followers","backIcon","fontSize","label","count","index","ProfileNavLink","uploadedVideo","pic","role","follower","formatBigNumber","Shared","getSharedVideos","DROP_DAY_LS_KEY","DropDayNotification","isVisible","setIsVisible","closeAlert","localStorage","setItem","pollIsDropDay","isDropDay","result","getItem","err","interval","setInterval","REWARDS_CHECK_INTERVAL","clearInterval","giftIcon","chevron","KEY_LOCALSTORAGE_READ_MESSAGES_TIME","rewardPointsReducer","acc","message","reward","uploadReward","superlikerReward","transferReward","unreadMessagesFilter","lastReadTime","time","RewardShowerNotification","currentRewards","setRewards","isDismissed","setDismissed","checkForNewMessages","getMessages","messages","unreadMessages","rewardPoints","reduce","clearMessages","Date","now","RewardPointAnim","getPathRoot","path","MainNav","paths","setDestination","destination","findIndex","currentIndex","location","pathname","destinationIndex","document","getElementById","innerHTML","rewardsIcon","wrapPrivateRouteWithSlide","render","match","PrivateRoutes","logOut","refreshProfileInfo","privateRoutes","params","privatePaths","wrapRouteWithFade","Component","AppRouter","exact","TransitionGroup","CanCanApp","updateHead","ReactDOM","CanCan","actorController","getUserFromStorage","storage","key","lsUser","JSON","parse","k","principal","unwrap","actor","Error","profile","createProfile","stringify","Boolean","icUser","getProfilePlus","terms","limit","resolve","canisterActor","canisterResponse","getVideoInfo","createVideo","videoInit","putProfileFollow","willLike","putProfileVideoLike","willSuperLike","putSuperLike","chunkCount","chunkBuffers","chunksAsPromises","i","getVideoChunk","nestedBytes","forEach","bytes","bytesAsBuffer","Buffer","from","Uint8Array","concat","putVideoChunk","chunkNum","chunkData","putVideoPic","getVideoPic","icResponse","checkUsernameAvailable","sender","recipient","amount","reporter","shouldFlag","idlFactory","IDL","List","Rec","List_10","List_11","List_2","List_3","List_4","List_5","List_6","List_7","List_8","List_9","Trie","Trie_10","Trie_11","Trie_2","Trie_3","Trie_4","Trie_5","Trie_6","Trie_7","Trie_8","Trie_9","UserId_2","Text","UserId","ProfilePic_2","Vec","Nat8","VideoPic_2","Timestamp","Int","UploadOrigin","Record","GeoData","Person","People","VideoId_2","VideoInfo_2","Opt","Nat","Bool","AllowanceBalance","Variant","Null","UserAllowances","ProfileInfo_2","ProfileInfoPlus","VideoId","VideoInit_2","VideoInit","VideoId_3","UserId_3","VideosPred","TimeMode","Command","Tuple","Result","TraceCommand","Trace","UserAction","ActionTarget","Check","Principal","Event_3","VideoResult_2","VideoResults","LikeVideo","AbuseFlag","SuperLikeVideoFail","SuperLikeVideo","RewardPointTransfer","CreateVideo","ShareVideo","CreateProfile","ViralVideoSuperLiker","ViralVideo","Signal","EventKind","Event_2","Event","Message","AlbumInfo","ProfileInfo","Branch","Hash","Nat32","Key","Branch_2","Key_2","fill","AssocList_3","Leaf_2","AssocList","Leaf","Trie2D","RelShared","Branch_4","Branch_5","AssocList_9","Leaf_5","AssocList_7","Leaf_4","Trie2D_2","RelShared_3","Branch_6","Branch_7","Key_4","AssocList_13","Leaf_7","AssocList_11","Leaf_6","Trie2D_3","RelShared_5","Branch_10","Key_5","AssocList_19","Leaf_10","MapShared_4","Branch_9","AssocList_17","Leaf_9","MapShared_3","Branch_3","ChunkId","Key_3","ChunkData","AssocList_5","Leaf_3","MapShared","Branch_11","AssocList_21","Leaf_11","MapShared_5","Branch_8","AssocList_15","Leaf_8","MapShared_2","StateShared","VideoResult","VideoInfo","VideoPic","Service","Func","isLocalEnv","process","DFX_NETWORK","host","dfxConfig","networks","local","bind","constructor","_actor","_isAuthenticated","this","initBaseActor","agent","HttpAgent","Actor","createActor","CanCan_idl","canisterId","fetchRootKey","unauthenticateActor","setPic","picAsNum","bufferBlob","picBlob","processAndUploadChunk","videoBuffer","byteStart","videoSize","chunk","videoSlice","slice","Math","min","MAX_CHUNK_SIZE","sliceToNat","encodeArrayBuffer","uploadVideo","ArrayBuffer","ceil","size","createdAt","tags","hashtagRegExp","getVideoInit","thumb","videoElement","createElement","thumbnailCanvas","canvasContext","getContext","videoUrl","addEventListener","videoWidth","videoHeight","reject","drawImage","toBlob","canvasBlob","currentTime","generateThumbnail","uploadVideoPic","putChunkPromises","resultFromCanCan","checkVidFromIC","setCompletedVideo","ready","fileToUpload","timeEnd","handleUpload","IDENTITY_URL","URLSearchParams","search","get","REACT_APP_INTERNET_IDENTITY_URL","authClient","AuthClient","create","login","identityProvider","onSuccess","getIdentity","logout","returnTo","authContext","createContext","ProvideAuth","isAuthenticatedLocal","setIsAuthenticatedLocal","_identity","_setIdentity","isAuthClientReady","setAuthClientReady","urlWithSearch","globalThis","setUserFromLocalStorage","KEY_LOCALSTORAGE_USER","user_","removeItem","testUserParam","authenticateActor","hasCanCanAccount","useProvideAuth","authenticationClient","Provider","useContext","APP_TITLE","updates","el","attrs","content","update","Object","entries","attr","head","appendChild","Array","number","toFixed","imgType","byteArray","text","numStringFromString","char","charCodeAt","join","hexFromNumString","parseInt","trimAmount","abs","startIndex","hexArray"],"mappings":"qQAAe,MAA0B,wC,OCSlC,SAASA,EAAOC,GACrB,MAAM,SAAEC,EAAW,aAAgBD,EAC7BE,EAAOC,cACPC,EAAUC,cAKhBC,qBAAU,KAAO,IAAD,EACVJ,EAAKK,QAAQ,UAACL,EAAKM,gBAAN,aAAC,EAAeC,eAAeC,gBAC9CN,EAAQO,QAAQ,WAEjB,CAACT,EAAKM,SAAUN,EAAKK,KAAMH,IAS9B,OACE,sBAAKQ,GAAG,iBAAR,UACE,qBAAKC,IAAI,cAAcC,IAAKC,EAAMC,MAAO,CAAEC,MAAO,aAClD,wBAAQC,QARQC,gBACZjB,EAAKkB,QACXhB,EAAQiB,KAAK,aAMmBT,GAAG,UAAUU,UAAU,iBAArD,SACGrB,O,MCxBF,SAASsB,GAAiB,eAC/BC,EAAiB,aADc,iBAE/BC,EAF+B,U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lX,KAAK,CAACmd,GAAY,CAAE1oB,KAAO,SAAQyoB,MAEvD,OADethB,IAAIsE,gBAAgBgX,GAK9B,SAAS/e,EAAYilB,GAC1B,MAAMC,EAAsBD,EACzBzhB,MAAM,IACN9D,KAAKylB,GAASA,EAAKC,WAAW,KAC9BC,KAAK,IACR,IAAIC,EAAmBC,SAASL,EAAqB,IAAIzf,SAAS,IAClE,MACM+f,EADYF,EAAiB7lB,OACJ,EAE/B,GAAI+lB,EAAa,EACf,IAAK,IAAIzS,EAAI,EAAGA,EAAIwM,KAAKkG,IAAID,GAAazS,IACxCuS,GAAoB,IAGxB,GAAIE,EAAa,EAAG,CAClB,MAAME,EAAanG,KAAKO,KAAK0F,EAAa,GACpCG,EAAWL,EAAiB9hB,MAAM,IAGxC8hB,EAFqBK,EAASrG,MAAMoG,EAAYA,EAAa,GAE7BL,KAAK,IAGvC,MAAQ,IAAGC,M","file":"static/js/main.60d6e422.chunk.js","sourcesContent":["export default __webpack_public_path__ + \"static/media/cancan-logo.38c28168.png\";","import React, { PropsWithChildren, useEffect } from \"react\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport logo from \"../assets/images/cancan-logo.png\";\r\nimport { useAuth } from \"../utils\";\r\n\r\n/*\r\n * The sign-in process for when a user has not yet authenticated with the\r\n * Internet Identity Service.\r\n */\r\nexport function SignIn(props: PropsWithChildren<{}>) {\r\n const { children = \"Authorize\" } = props;\r\n const auth = useAuth();\r\n const history = useHistory();\r\n\r\n // If the auth provider has a user (which could be from local storage) and\r\n // the user is properly authenticated with the identity provider service then\r\n // send the user to their feed, as they are correctly signed in.\r\n useEffect(() => {\r\n if (auth.user && !auth.identity?.getPrincipal().isAnonymous()) {\r\n history.replace(\"/feed\");\r\n }\r\n }, [auth.identity, auth.user, history]);\r\n\r\n // Initiates the login flow with the identity provider service, sending the\r\n // user to a new tab\r\n const handleLogin = async () => {\r\n await auth.logIn();\r\n history.push(\"/sign-up\");\r\n };\r\n\r\n return (\r\n
\r\n \"cancan\r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { CSSTransition } from \"react-transition-group\";\r\nimport \"./LoadingIndicator.scss\";\r\n\r\ninterface LoadingIndicatorProps {\r\n loadingMessage?: string;\r\n completedMessage?: string;\r\n isLoading?: boolean;\r\n}\r\n\r\nexport function LoadingIndicator({\r\n loadingMessage = \"Loading...\",\r\n completedMessage,\r\n isLoading = true,\r\n}: LoadingIndicatorProps) {\r\n // Adding the `.completed-message` class will delay the fade-out for 1s to\r\n // allow the user to see the updated message before it disappears.\r\n const showCompletedMessage = completedMessage ? \"completed-message \" : \"\";\r\n const timeout = completedMessage ? 2000 : 1000;\r\n\r\n return (\r\n \r\n
\r\n
\r\n

\r\n {isLoading ? loadingMessage : completedMessage ?? loadingMessage}\r\n

\r\n
\r\n
\r\n \r\n );\r\n}\r\n","import React, { FormEvent, useEffect, useRef, useState } from \"react\";\r\nimport {\r\n checkUsername,\r\n createUser,\r\n getUserFromCanister,\r\n getUserNameByPrincipal,\r\n useAuth,\r\n} from \"../utils\";\r\nimport logo from \"../assets/images/cancan-logo.png\";\r\nimport { LoadingIndicator } from \"./LoadingIndicator\";\r\nimport { useHistory } from \"react-router\";\r\nimport \"./SignUp.scss\";\r\n\r\n/*\r\n * This component receives the authentication information and queries to see if\r\n * the principal returned from Identity Service matches an existing userId. If\r\n * it does, we set the match as the currentUser and redirect to the /feed route.\r\n * If the principal does not match an existing userId, the user creates one with\r\n * the provided form and submits, receiving an error if the name is already\r\n * taken, and being redirected to the /feed route on success.\r\n */\r\n\r\nexport function SignUp() {\r\n const [error, setError] = useState(\"\");\r\n const [isCheckingICForUser, setIsCheckingICForUser] = useState(false);\r\n const [isSigningIn, setIsSigningIn] = useState(false);\r\n const usernameInputRef = useRef(null);\r\n const auth = useAuth();\r\n const history = useHistory();\r\n\r\n // Get a user name from the user's principal and then fetch the user object\r\n // with all the user's data. Show a loading message between these async\r\n // backend calls happening.\r\n useEffect(() => {\r\n if (!auth.isAuthReady) return;\r\n if (auth.isAuthenticated && auth.identity !== undefined) {\r\n setIsCheckingICForUser(true);\r\n getUserNameByPrincipal(auth.identity.getPrincipal()).then((username) => {\r\n if (username) {\r\n // User exists! Set user and redirect to /feed.\r\n getUserFromCanister(username).then((user) => {\r\n setIsCheckingICForUser(false);\r\n auth.setUser(user!);\r\n history.replace(\"/feed\");\r\n });\r\n setIsCheckingICForUser(false);\r\n } else {\r\n // Do nothing. Allow the user to create a userId\r\n setIsCheckingICForUser(false);\r\n }\r\n });\r\n }\r\n }, [auth.isAuthReady, auth.isAuthenticated, auth.identity]);\r\n\r\n // Submit the form to signup with a new username, the backend ensures that\r\n // the username is available.\r\n async function submit(evt: FormEvent) {\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n setError(\"\");\r\n\r\n // Get the username entered from the form.\r\n const username = usernameInputRef?.current?.value!;\r\n setIsSigningIn(true);\r\n // Check to make sure this username has not been taken. If this user already\r\n // has a username, it should have signed them in already.\r\n const isAvailable = await checkUsername(username);\r\n\r\n if (isAvailable) {\r\n // Create a user on the backend and assign that user to frontend data.\r\n const user = await createUser(username, auth.identity?.getPrincipal());\r\n auth.setUser(user);\r\n setIsSigningIn(false);\r\n history.push(\"/feed\");\r\n } else {\r\n setError(`Username '${username}' is taken`);\r\n setIsSigningIn(false);\r\n }\r\n }\r\n\r\n return (\r\n
\r\n \r\n \r\n\r\n
\r\n \"cancan\r\n\r\n
\r\n \r\n \r\n {error !== \"\" && (\r\n \r\n )}\r\n
\r\n \r\n
\r\n
\r\n );\r\n}\r\n","import React, { useState } from \"react\";\r\n\r\nimport { putAbuseFlagVideo } from \"../utils\";\r\nimport reportIcon from \"../assets/images/icon-report.png\";\r\n\r\n/*\r\n * A component to handle flagging videos for abusive content. Takes care of\r\n * calling the backend canister to flag, and keeps state.\r\n */\r\nexport default function FlagButton({ currentUserId, videoInfo }) {\r\n // Keep local track of whether video is flagged so we can update the state\r\n // immediately rather than wait for backend call.\r\n const [localFlags, setLocalFlags] = useState(\r\n Number(videoInfo.abuseFlagCount)\r\n );\r\n // Keeps track of whether user has already flagged this video.\r\n const [isActive, setActive] = useState(videoInfo.viewerHasFlagged);\r\n const handleClick = async () => {\r\n if (!isActive) {\r\n setActive(true);\r\n setLocalFlags(localFlags + 1);\r\n return putAbuseFlagVideo(currentUserId, videoInfo.videoId, true);\r\n }\r\n };\r\n\r\n const isDisabled = localFlags < 1 || isActive;\r\n\r\n return (\r\n \r\n \r\n {Number(localFlags)}/10\r\n \r\n );\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAAuCAYAAAC1ZTBOAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGuSURBVHgB7ZjxTcJAFMYfhf9twwJ1A3SC4gTGBVAWME6gTqATYNmACaQ4gGEDuwEsQPV79pEQ0mivfXdAcr/ky1HaS3957V3u2iGwWq0SNI9IjGTIcxRFOVkG9+UmREbIAEnkOJRL3uAx7ojgfK9/jlzggjXZk0uoLEzyx6VzOFwFRVHcVpyMN5vNNVmQQyLcM6WyMEmdfj1yhFRviEyCIIhN+gbkABF8Qt6pfO+NsFpJkTtHJlTz0VZhrZIieI98UgtBRr2SkAtl0G2ntNaoSLIYmgFGLcuNut1uSIoYSUKGJ9yBHJ7J71jaEKOWbGBayRdq+X41wckU1BYvqYWX1MJLauEltTgJSWcrcwN4X5VziwXLB/9xDJIsNUMWSFa1Sz2kZIZV0wzVmv63Kz2E5BcyhlhWt4NrSd7G3pju511KvkLugRrgYgriHdldU0HGtmSKXEIwpRbYeNw8v00xclPILUkBDcnfyRdiC55S8HvZ7/dVP3QZSaIyQ9m+bresa1tf3nYxrqRIWRfbxa+CtPCSWnhJLbykFl5SCy+pRQ/Lqwzt9/4JfJzP6Uj4AQ2rfIRPbkwuAAAAAElFTkSuQmCC\"","import React from \"react\";\r\nimport iconSuperLike from \"../assets/images/icon-superlike.png\";\r\n\r\nexport default function SuperLikeButton({\r\n handleSuperLike,\r\n isSuperLiked,\r\n disabled,\r\n}) {\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAwCAYAAABwrHhvAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAI2SURBVHgBvZjhVcIwFIVfi/xFmMCwCWzgBsgEuoFlAnECygSOABvoBsb/cKwDAN5Ao6U0TV4a+p3TU0ti3817uQmBKBCbzeb++8Qb5/8iCgCCCtxWuNSdBoOB83tjCsNCBwcfxKCxAIz+GbeRfj4cDl/EoJGAPPVJ8TMIaCcDCN6nU93P6Ha778TAW8B+v5/Tf93/2O12P8TASwAs9xDH8cTQzCoB24Z53VWa+xXNGSw4IAY+GVgZgitYo2cLyC0nTO1wAKv+LAEIPqKS5SoEXCcDed0Xtn5cCzoLgOUSqkm9BhZkrYKKG1sHjP4Rtwm5IYlJZAkuyGy5MmwLKmwlqLNcGfYErBVgs1wZHwsaBbhYrkJAmAy4Wu7iRXF8Rx5cTMLtdpvWbDQ21oy+Ga7lmYDccnNqjywqBBe4fVK7pEUBKrig9pC4xjd5cJblQtDpdJJerycjdaDAA+swEYA1Fs2x+iNG8BdqFzX7p/pBrQOuS20oXjF6qR8iNfux3T7B+7fu7zgeRATxkQg+LH7gfTaE8BUVTkSODIujVzQ5GWXM/rNy8KYCOHNHpT6pamhLwNjU0IaAytSHECAc+kiybG6hfqAwMcXos+AC8p3TRorga1sn3wwIS7vENSMHrOcCH/RO59LXKwM4AYma5hTBl+SIl4AoikwWlOSYeo1vCSoFcFKvCTkJWalvJKBi61ZeZ6W+kQC6LEHtcnttAer7nfdZIsQcmFIDvATgK5yabMe6+6Ze8wtslMICjlbF3AAAAABJRU5ErkJggg==\"","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAwCAYAAAB5R9gVAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGJSURBVHgB7ZhBTgIxFIb/dsZolMXcgJoYE1eMJ3BuIDfQI7Aj0YW4cOVGj8AN8AZ4AsaViS4oN2CBaERaXw0kZIQ8TAiyeF8yycx02n7t67ykVS/m0mOD0NgwRIhDhDhEiEOEOESIQ4Q4RIhDhDhEiEOEOESIQ9Om7NrDW/w//eCipk/P5uI8hj4luSrWSxtQrTcMmsf2rq+KpR1TS3ZRykBiVFihVylWSIiGgmqP4R8/MGwFidlyRVvpLi2kxoG9ac5rIAjuYC+NoCoObj+CLlOjCV2GGk7ok6RQhabe00hVuGy4p25yCkdviEG7KDDl1dQzj/hKzeztLX6m7/P+0N7mWANdUzdfiM48VA2TgakFhw02yHm4B4ft/Mg2LFZAxzSSEt7TMaKqhjrBnOWgljz9CNOcO/gnDd31GPc0HIXG9begf4VgBEchjSmkPnHQKa3FcuicQmi4jmIsR5jOjEaVhWWpKH35SQobLagw/Vv+mugkU3OIEIcIcYgQhwhxiBCHCHGIEMc3gOd6wqFIQH4AAAAASUVORK5CYII=\"","import React, { useEffect, useState, useRef } from \"react\";\r\nimport debounce from \"lodash.debounce\";\r\n\r\nimport { putRewardTransfer } from \"../utils\";\r\nimport tipIcon from \"../assets/images/icon-tip-active.png\";\r\nimport \"./TippingButton.scss\";\r\n\r\nconst DEFAULT_TIPPING_AMOUNT = 1;\r\n\r\nexport default function TippingButton({\r\n senderId,\r\n currentRewardPoints,\r\n recipientId,\r\n onRefreshUser,\r\n}) {\r\n const [isDisabled, setDisabled] = useState(false);\r\n const [activeAnimations, setActiveAnimations] = useState([]);\r\n const [animationId, setAnimationId] = useState(0);\r\n const [localRewardPoints, setRewardPoints] = useState(currentRewardPoints);\r\n const [tippingPoints, setTippingPoints] = useState(1);\r\n\r\n // The save tipping function gets debounced so it collects tips from the last\r\n // 5 seconds and applies them all at once. If the amount of tips is over a\r\n // certain threshold, show the user a confirmation.\r\n const saveTipping = async (localTippingPoints) => {\r\n setTippingPoints(1);\r\n await putRewardTransfer(senderId, recipientId, BigInt(localTippingPoints));\r\n onRefreshUser();\r\n };\r\n const saveTippingDebounced = useRef(debounce(saveTipping, 3000));\r\n\r\n // On click store the accumulated tipping points for multiple clicks and call\r\n // the debounced tip saving function to save on the backend\r\n const handleClick = async (ev) => {\r\n ev.preventDefault();\r\n if (isDisabled) return;\r\n setRewardPoints(localRewardPoints - DEFAULT_TIPPING_AMOUNT);\r\n setTippingPoints(tippingPoints + DEFAULT_TIPPING_AMOUNT);\r\n saveTippingDebounced.current(tippingPoints);\r\n setAnimationId((prevId) => prevId + 1);\r\n const currentId = animationId;\r\n setActiveAnimations((prev) => [...prev, currentId]);\r\n setTimeout(() => {\r\n setActiveAnimations((prev) => prev.filter((id) => id !== currentId));\r\n }, 4000);\r\n };\r\n\r\n useEffect(() => {\r\n setRewardPoints(currentRewardPoints);\r\n if (currentRewardPoints < DEFAULT_TIPPING_AMOUNT) {\r\n setDisabled(true);\r\n }\r\n }, [currentRewardPoints]);\r\n\r\n useEffect(() => {\r\n if (senderId === recipientId) setDisabled(true);\r\n }, []);\r\n\r\n return (\r\n \r\n 0 ? \"active\" : \"default\"}\r\n alt=\"icon: video reward points\"\r\n />\r\n {localRewardPoints}\r\n
\r\n {activeAnimations.map((id) => (\r\n \r\n \"tips\"\r\n
\r\n ))}\r\n \r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport { textToColor } from \"../utils\";\r\n\r\nexport function ProfilePic({ name, profilePic }) {\r\n const profileColor = textToColor(name);\r\n\r\n return (\r\n
\r\n {profilePic ? (\r\n {name}\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","import React from \"react\";\r\nimport Lottie from \"react-lottie-player\";\r\n\r\ninterface LottieAnimationProps {\r\n animation: any;\r\n height?: number;\r\n}\r\n\r\n/*\r\n * Wrapper for animations exported from AfterEffects.\r\n */\r\nexport default function LottieAnimation({\r\n animation,\r\n height,\r\n}: LottieAnimationProps) {\r\n return ;\r\n}\r\n","import React, { useEffect, useState } from \"react\";\r\nimport LottieAnimation from \"./LottieAnimation\";\r\nimport SuperLikeAnim from \"../assets/animations/Superlike-single.json\";\r\nimport SuperLikeAnimIcon from \"../assets/animations/Superlike-icon.json\";\r\nimport \"./SuperLikeEffect.scss\";\r\n\r\n/*\r\n * This uses the wrapped Lottie animation component to display the effect\r\n */\r\nexport function SuperLikeEffect({ isActive = false }) {\r\n const [mainAnimActive, setMainAnimActive] = useState(isActive);\r\n const [secondAnimActive, setSecondAnimActive] = useState(false);\r\n\r\n useEffect(() => {\r\n const timeoutMain = setTimeout(() => {\r\n setMainAnimActive(false);\r\n if (isActive) {\r\n setSecondAnimActive(true);\r\n }\r\n }, 1000);\r\n const timeoutSecondary = setTimeout(() => {\r\n setSecondAnimActive(false);\r\n }, 1500);\r\n\r\n if (isActive) {\r\n setMainAnimActive(true);\r\n }\r\n\r\n return () => {\r\n clearTimeout(timeoutMain);\r\n clearTimeout(timeoutSecondary);\r\n };\r\n }, [isActive]);\r\n\r\n const iconPositionInAnimation = 766;\r\n let animationPosition = {\r\n x: -175,\r\n y: window.innerHeight / 2 - iconPositionInAnimation / 2,\r\n };\r\n if (secondAnimActive) {\r\n animationPosition = {\r\n x: 0,\r\n y: window.innerHeight - iconPositionInAnimation,\r\n };\r\n }\r\n\r\n const animationStyling = {\r\n transform: `translate(${animationPosition.x}px, ${animationPosition.y}px)`,\r\n };\r\n\r\n return (\r\n
\r\n {mainAnimActive && (\r\n \r\n )}\r\n
\r\n {secondAnimActive && (\r\n \r\n )}\r\n
\r\n
\r\n );\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAqCAYAAADI3bkcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJ6SURBVHgB1ZnRkdowEIZ/ieE5ZmjAVJDrIFBBchUAFeSo4K4EroKQCphUcHRwdBDnHQa/M0B2HckRPtsnWzJnfzMag21WP+tdaSULWHA4HAI6jKkF6lRMbTsYDCLUwMWeKLu42+1mvV5vqoznsaG2oo5+wk7omA6PLvZEgeGQDj9KDGdZUVtQR3GBvUDZ+wY7ImqTPI+LHON3dHjB/8dly1Z1EuOtWLZ3h2rEyt7WPCkzxkPUEwslaJ09eT6fl6guFkrDi3JgSirY8EQdsZox2ZnqL5wDUsop6sNa1kpbgulhToYQ7jzpD5Swj3AnpKf0oL8kMaxC4Tf8MTmdTgEJXsMPHM8jzo/Ew/QPZvDLVAhhOyLYEGgvJ4Ipzr7CL2Oy+Rke0RpFA+HQJANJsVZnyPkQKCe+SIq1EB3heDyOOIZdxt1bE7LgEB2BEu+TRMdgwRE6Ao3Ff+TlconQEfr9/qtQhcUB3WAkVf26QftJllC6lviFlkOTBtfVabXGYcHTc1vH5Ii8O+IPiYc5LMjLz2gv6aI0XdMpL7+ifRNJ6l0mnThU8s3RPq40Xc10JHrTstB4Zk3mibxlft1luW+uQkHzppZQoXGPj52yI2qTvAuFW1UOGyqu5G6gaAqrNfWDBW7PokgsU7oZyJCnZ/i3L3YL5iR2VXbDu4KZG4l+VyxjJZhpWLSVWMZaMNNAIpYmWB6VBDPGDmcINyIU7AGXUXlNpzrgMdLaKznoveQIFansYZP9fr+klex3VIOn2wfUxGnVPBwOuWMeq2OL25PiykUs4+RhjUVccwjc133r1Bgk/InaJdOW8IgXD5sY3mbm2fKwtZjvJXzyFzRi91VMwTQuAAAAAElFTkSuQmCC\"","import React, { useEffect, useRef, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\n\r\nimport FlagButton from \"./FlagButton\";\r\nimport SuperLikeButton from \"./SuperLikeButton\";\r\nimport TippingButton from \"./TippingButton\";\r\nimport { ProfilePic } from \"./ProfilePic\";\r\nimport { SuperLikeEffect } from \"./SuperLikeEffect\";\r\nimport { getVideoChunks, getProfilePic, like, superLike } from \"../utils\";\r\nimport likeIcon from \"../assets/images/icon-like.png\";\r\nimport commentIcon from \"../assets/images/icon-comment.png\";\r\nimport shareIcon from \"../assets/images/icon-share.png\";\r\nimport \"./Video.scss\";\r\nimport mime from 'mime-types';\r\n\r\n// The amount of flags a video needs before we blur it out on frontend\r\nconst VIDEO_BLUR_MIN = 1;\r\n\r\ninterface VideoProps {\r\n videoInfo: any;\r\n userId: string;\r\n userRewardPoints: number;\r\n onRefreshUser?: any;\r\n isPreview?: boolean;\r\n onClose?: () => void;\r\n videoHash?: string|null;\r\n}\r\n\r\n// Wrapper to allow us to use the same video component for single previews from\r\n// Profile and Discover, and for all videos in the Feed\r\nexport function Video(props: VideoProps) {\r\n const {\r\n isPreview = false,\r\n userId,\r\n userRewardPoints,\r\n onRefreshUser,\r\n videoInfo,\r\n videoHash,\r\n onClose = () => {},\r\n } = props;\r\n return isPreview ? (\r\n
\r\n \r\n
\r\n ) : (\r\n \r\n );\r\n}\r\n\r\nfunction VideoBase(props: VideoProps) {\r\n const {\r\n videoInfo,\r\n userId,\r\n userRewardPoints = 0,\r\n isPreview = false,\r\n onRefreshUser = () => {},\r\n onClose = () => {},\r\n videoHash = null,\r\n } = props;\r\n const [play, setPlay] = useState(false);\r\n const [fileType, setFileType] = useState();\r\n const [videoSourceURL, setVideoSourceURL] = useState();\r\n const [userPic, setUserPic] = useState();\r\n const [userLikes, setUserLikes] = useState(videoInfo.likes.includes(userId));\r\n const [isSuperLiked, setIsSuperLiked] = useState(\r\n videoInfo.superLikes.includes(userId)\r\n );\r\n\r\n const videoIsFlagged = videoInfo.abuseFlagCount >= VIDEO_BLUR_MIN;\r\n\r\n const videoRef = useRef(null);\r\n\r\n const handlePlayClick = function () {\r\n if(fileType==='video'){\r\n setPlay(!play);\r\n }\r\n };\r\n\r\n // Load video and uploader profilePic on first mount.\r\n useEffect(() => {\r\n if (!videoInfo) {\r\n return;\r\n }\r\n getVideoChunks(videoInfo, videoHash?[videoHash]:[]).then((blobURL) => {\r\n console.log(blobURL);\r\n let mimeType = mime.lookup(videoInfo?.name);\r\n if(mimeType){\r\n const fileType_t = mimeType.split('/')[0];\r\n if(fileType_t){\r\n setFileType(fileType_t);\r\n }\r\n }\r\n setVideoSourceURL(blobURL);\r\n //setPlay(true);\r\n });\r\n\r\n return () => {\r\n //videoRef.current?.pause();\r\n }\r\n }, [videoInfo?.videoId]);\r\n\r\n useEffect(()=>{\r\n return () => {\r\n if(videoSourceURL){\r\n URL.revokeObjectURL(videoSourceURL);\r\n }\r\n }\r\n }, [videoSourceURL])\r\n\r\n // Only play video if it has not been flagged/reported\r\n useEffect(() => {\r\n if (!videoIsFlagged) {\r\n play ? videoRef.current?.play() : videoRef.current?.pause();\r\n }\r\n }, [play]);\r\n\r\n function handleLike() {\r\n like(userId, videoInfo.videoId, !userLikes);\r\n setUserLikes((state) => !state);\r\n }\r\n\r\n function handleSuperLike() {\r\n if (!isSuperLiked) {\r\n setIsSuperLiked(true);\r\n superLike(userId, videoInfo.videoId, true);\r\n }\r\n }\r\n\r\n const isCurrentUser = userId === videoInfo.userId;\r\n const videoBlurStyle = videoIsFlagged ? { filter: \"blur(20px)\" } : {};\r\n\r\n return (\r\n
\r\n \r\n {isPreview && (\r\n \r\n )}\r\n {(fileType==='video') ? (\r\n \r\n ) : (\r\n \r\n )\r\n }\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n @{videoInfo.userId}\r\n \r\n \r\n

{videoInfo.caption}

\r\n
\r\n
\r\n
\r\n\r\n {/* Side controls for user interaction with the video. */}\r\n
\r\n
\r\n \r\n \r\n {/*currentUser?.remainingSuperlikes ||*/ 0}/\r\n {/*currentUser?.totalSuperlikes ||*/ 10}\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n {videoInfo.likes.length +\r\n // if they are toggling on and off, only subtract if they are\r\n // already a liker it and only add if they are not already a liker\r\n (userLikes\r\n ? videoInfo.likes.includes(userId)\r\n ? 0\r\n : 1\r\n : videoInfo.likes.includes(userId)\r\n ? -1\r\n : 0)}\r\n \r\n
\r\n
\r\n comment.userId === userId)\r\n ? \"active\"\r\n : \"\"\r\n }\r\n alt=\"icon: comment on current video\"\r\n />\r\n {videoInfo.comments?.length ?? 0}\r\n
\r\n
\r\n \r\n {videoInfo.shares?.length ?? 0}\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n );\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAF1SURBVHgB7ZjhTYNAGIa/A36jhAVwAtsJpBMYJ7AbSDfQDXCDdgJHsBvICGyA/gfq+ykYQpB89kDuxz3Jl0u5S/v07r2QO0UNRVFconlAbVERLUPW1FMQBDk/UPQtt0LzsqBYnxx1B8lMQS7Ch1cyR64lR62duq4fyTw5JoJb4oBrMhS43fMSn8hgHDIcK6iLFdTFCupiBXWxgrpYQV2soC5WUBcWfCeDYcGMzOXIggcyFNd19w4Ox3sc70yUTH3fP3xtkjAMt5B8puU5NZVi4nb8QHV7+ZYBZ9Hbsiyv0F4MfEFM8kN+e88iEsMEfXiel/NqQu5n4yr6A/gDb2hWgqEcmaT7Q+ciFmxuvwrB0B3EUpoITzqwqqoYu2psCM8W30gdaULEbxKlVDzSzVlbTy3HiAWxaW5+6eK8bdoLx6kRZXAkf5PmbQhRBgfyN0vehhAtcS9/s+VtCJFgJ3+z5u0sOH98yYlKaAEkGeQ3x+a/lrTPJ8JMcLF1VdmaAAAAAElFTkSuQmCC\"","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAkCAYAAADPRbkKAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIgSURBVHgB1ZjtUcJAEIZfA78ZGRo4K5ASQgViBUIFQgVgBWAFYAXSAbEC6MD4HwYKYNBdcsFAvj/IXZ6ZnQlJuLzv3t1uJoBidrvdiOIeGTGgHpNimdWEDgaYNhwTAinRxQCTyYROBhiBlCZ0M8AIpDChowFGIKEJXQ0wgmJFJtpRN9WhAFkyBZyNG1U++RrPRKfZbK6DbrjDjZEZbB+Px7ZhGI+IFx3EnqJPJhbXFwo3INftE0UX2cSGUqvVeo1G48N7rhADckm8wBFt4obQTA5brdbU/Z3LgBT+SjFAgZlOwJiW0xsfZDKgULiXk4nUBjabTZfW4gzqhHsZp+oDlPkJif+EHuKZu0QzICsLZ92EPnBZnccakOKXcBqPLpzE80GkAQ3F+xpaqIGU4nngBdXoH+q2Nh2v5TkX4R5wNz4cDg+yKwskTw6P53uliDKwgtNJw7AovijmNKiNjNBzOElmzG2B4pl6yKATBIvngd6RU3RKbDji7aCLPgNU53twGtQ1Fpz1Z6M8bESIZ3wGqM6PAu4b0iBTlIuNGPHMhQGZfeE5xUvmmQaxUC42EohnLjrxVfZVieeN2km6VM8zQBvXxH/2Q3f9jXHF75P+wTsD3uz3FYi3kFL8GW5aFL8yxigR7gMUc+Rhu91OpfgZSoae2UNeZBa+s3ybVI5n+QxQRbj2y/eeSmJQ7edPIENUFdrA1Vw6EnotN8qu94XyB8pr8BdIgJLiAAAAAElFTkSuQmCC\"","import React, { useEffect, useState } from \"react\";\r\nimport { getFeedVideos } from \"../utils\";\r\nimport { Video } from \"../components/Video\";\r\nimport { LoadingIndicator } from \"../components/LoadingIndicator\";\r\nimport { ProfileInfoPlus, VideoInfo } from \"../utils/canister/typings\";\r\n\r\n/*\r\n * Nothing fancy here, either!\r\n */\r\nexport function Feed({\r\n profileInfo,\r\n onRefreshUser,\r\n}: {\r\n profileInfo?: ProfileInfoPlus;\r\n onRefreshUser: any;\r\n}) {\r\n const [feed, setFeed] = useState([]);\r\n const [isLoading, setIsLoading] = useState(false);\r\n\r\n useEffect(() => {\r\n if (profileInfo && profileInfo.userName) {\r\n setIsLoading(true);\r\n getFeedVideos(profileInfo.userName)\r\n .then((videos) => {\r\n setFeed(videos);\r\n setIsLoading(false);\r\n })\r\n .catch((e) => {\r\n console.error(e);\r\n setIsLoading(false);\r\n });\r\n }\r\n }, [profileInfo?.userName]);\r\n\r\n return (\r\n
\r\n \r\n
\r\n {profileInfo &&\r\n feed.map((v) => (\r\n \r\n ))}\r\n
\r\n
\r\n );\r\n}\r\n","import React, { PropsWithRef, useEffect, useRef, useState } from \"react\";\r\nimport debounce from \"lodash.debounce\";\r\nimport { ProfileInfoPlus, VideoInfo } from \"../utils/canister/typings\";\r\nimport { SearchVideoItem } from \"../components/SearchVideoItem\";\r\nimport { Video } from \"../components/Video\";\r\nimport { getSearchVideos } from \"../utils\";\r\nimport { LoadingIndicator } from \"../components/LoadingIndicator\";\r\nimport \"./Discover.scss\";\r\n\r\ninterface DiscoverProps {\r\n profileInfo?: ProfileInfoPlus;\r\n}\r\n\r\n/*\r\n * Allows searching for and viewing videos. Nothing especially fancy here, just\r\n * the typical debounced input fetching data on change.\r\n */\r\nexport function Discover(props: PropsWithRef) {\r\n const { profileInfo } = props;\r\n\r\n const [videos, setVideos] = useState([]);\r\n const [searchTerm, setSearchTerm] = useState(\"\");\r\n const [videoPreview, setVideoPreview] = useState();\r\n const [isLoading, setLoading] = useState(false);\r\n\r\n function handleChange(val: string) {\r\n setSearchTerm(val);\r\n }\r\n\r\n useEffect(() => {\r\n if (profileInfo) {\r\n setLoading(true);\r\n getSearchVideos(profileInfo.userName, searchTerm.split(/\\W+/), [10]).then(\r\n (searchedVideos) => {\r\n setVideos(searchedVideos);\r\n setLoading(false);\r\n }\r\n );\r\n }\r\n }, [searchTerm, profileInfo]);\r\n\r\n const searchRef = useRef(null);\r\n const debouncedChangeHandler = debounce(function () {\r\n handleChange(searchRef?.current?.value || \"\");\r\n }, 300);\r\n\r\n function handleClick(clickedVideo: VideoInfo) {\r\n setVideoPreview(clickedVideo);\r\n }\r\n\r\n return (\r\n
\r\n \r\n {videoPreview && profileInfo !== undefined && (\r\n setVideoPreview(undefined)}\r\n key={videoPreview.videoId}\r\n />\r\n )}\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n {searchTerm ? (\r\n
\r\n {videos.length > 0 &&\r\n videos.map((v) => (\r\n \r\n ))}\r\n
\r\n ) : (\r\n <>\r\n
\r\n New for you\r\n
\r\n {videos.length > 0 &&\r\n videos.map((v) => (\r\n \r\n ))}\r\n
\r\n
\r\n
\r\n Trending\r\n
\r\n {videos.length > 0 &&\r\n videos.map((v) => (\r\n \r\n ))}\r\n
\r\n
\r\n \r\n )}\r\n
\r\n
\r\n );\r\n}\r\n","import React, { ChangeEvent, useEffect, useRef, useState } from \"react\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { ProfileInfoPlus } from \"../utils/canister/typings\";\r\nimport { useUploadVideo } from \"../utils\";\r\nimport { LoadingIndicator } from \"./LoadingIndicator\";\r\nimport \"./Upload.scss\";\r\n\r\n/*\r\n * Allows selection of a file followed by the option to add a caption before\r\n * uploading to the canister. Utility functions assist in the data translation.\r\n */\r\nexport function Upload({\r\n user,\r\n onUpload,\r\n}: {\r\n user?: ProfileInfoPlus;\r\n onUpload: () => void;\r\n}) {\r\n const history = useHistory();\r\n const [videoFile, setVideoFile] = useState();\r\n const [videoPreviewURL, setVideoPreviewURL] = useState(\"\");\r\n const [uploading, setUploading] = useState(false);\r\n const [uploadingClean, setUploadingClean] = useState(true);\r\n const inputRef = useRef(null);\r\n const textAreaRef = useRef(null);\r\n const videoUploadController = useUploadVideo({\r\n userId: user?.userName || \"\",\r\n });\r\n\r\n useEffect(() => {\r\n inputRef.current?.click();\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (uploading && uploadingClean) {\r\n setUploadingClean(false);\r\n }\r\n }, [uploading]);\r\n\r\n useEffect(() => {\r\n if (videoFile) {\r\n // Create video preview so the user can see what they've selected\r\n videoFile.arrayBuffer().then((buffer) => {\r\n const videoBlob = new Blob([buffer], {\r\n type: \"video/mp4\",\r\n });\r\n const vidURL = URL.createObjectURL(videoBlob);\r\n setVideoPreviewURL(vidURL);\r\n });\r\n }\r\n }, [videoFile]);\r\n\r\n function onChange(evt: ChangeEvent) {\r\n const { files } = evt.target;\r\n if (files && files.length === 1 && files.item(0)) {\r\n const file = files[0];\r\n setVideoFile(file);\r\n }\r\n }\r\n\r\n // Wraps and triggers several functions in the videoUploadController to\r\n // generate a videoId and begin uploading.\r\n function upload() {\r\n const caption = textAreaRef.current?.value;\r\n if (!videoFile || !caption) {\r\n return;\r\n }\r\n videoUploadController.setFile(videoFile);\r\n videoUploadController.setCaption(caption);\r\n videoUploadController.setReady(true);\r\n setUploading(true);\r\n }\r\n\r\n // On upload success, wait 2 seconds and then redirect to /feed\r\n useEffect(() => {\r\n if (videoUploadController.completedVideo !== undefined) {\r\n setUploading(false);\r\n onUpload();\r\n setTimeout(() => {\r\n history.push(\"/feed\");\r\n }, 2000);\r\n }\r\n }, [videoUploadController.completedVideo]);\r\n\r\n return (\r\n \r\n \r\n \r\n {videoFile && (\r\n
\r\n
\r\n )}\r\n \r\n );\r\n}\r\n","export default __webpack_public_path__ + \"static/media/rewards-view.caffbbcc.png\";","import React from \"react\";\r\nimport rewardsView from \"../assets/images/rewards-view.png\";\r\n\r\n/*\r\n * Stand-in for eventual Rewards View\r\n */\r\nexport function Rewards() {\r\n return (\r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport \"./FollowButton.scss\";\r\n\r\nexport function FollowButton({ isFollowing, handleFollow }) {\r\n return (\r\n \r\n {isFollowing ? \"Unfollow\" : \"Follow\"}\r\n \r\n );\r\n}\r\n","import React, { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { ProfilePic } from \"./ProfilePic\";\r\nimport { FollowButton } from \"./FollowButton\";\r\nimport \"./FollowUserRow.scss\";\r\n\r\n/*\r\n * A single instance of a row in the Followers/Following Profile views. Displays\r\n * the user's profile picture and username as a link to their profile, along\r\n * with a button to follow/unfollow that user.\r\n */\r\nexport function FollowUserRow({\r\n userName,\r\n handleFollow = () => {},\r\n following = false,\r\n disableFollow = false,\r\n}: {\r\n userName: string;\r\n handleFollow?: (userName: string, willFollow: boolean) => void;\r\n following?: boolean;\r\n disableFollow?: boolean;\r\n}) {\r\n const [isFollowing, setIsFollowing] = useState(following);\r\n\r\n // Instead of waiting for the return from the canister update call, we\r\n // optimistically update the UI\r\n function handleFollowClick(event) {\r\n event.preventDefault();\r\n setIsFollowing((state) => !state);\r\n handleFollow(userName, !isFollowing);\r\n }\r\n\r\n return (\r\n \r\n
\r\n \r\n {userName}\r\n {disableFollow ? (\r\n
\r\n ) : (\r\n \r\n )}\r\n
\r\n \r\n );\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADOSURBVHgB7dvBDcIwEETREY3jDkIHcYWkhMW75AbElhASWf8nuYD5SU5WJADA/zOzazvbfhbNpA1e7VXRDD6Md5uyOxifP0BnvLspq4HxVVkxnvGMZzzjGc/4qqwYz3jGM57xjGd8VVaMZ/yc45dpxzt73taccvxFv2fKrj3l0vkEVmXnrzoRiECEQAQRIRBBRAhEEBECEUSEQAQRIRBBRAhEEBECEUSEMBKhHaU2EKEou06E/P8LuIMIcwRw9v7ecbr/hvz+8b6fIgDA9x59me4RNVbpiAAAAABJRU5ErkJggg==\"","import React, { useEffect, useState } from \"react\";\r\nimport { Link, useParams, useHistory } from \"react-router-dom\";\r\nimport * as H from \"history\";\r\nimport { FollowUserRow } from \"../components/FollowUserRow\";\r\nimport { ProfilePic } from \"../components/ProfilePic\";\r\nimport { Video } from \"../components/Video\";\r\nimport { LoadingIndicator } from \"../components/LoadingIndicator\";\r\nimport { FollowButton } from \"../components/FollowButton\";\r\nimport {\r\n fileToImgSrc,\r\n follow,\r\n getProfilePic,\r\n getUserFromCanister,\r\n formatBigNumber,\r\n} from \"../utils\";\r\nimport backIcon from \"../assets/images/icon-back.png\";\r\nimport \"./Profile.scss\";\r\nimport { ProfileInfoPlus, VideoInfo } from \"../utils/canister/typings\";\r\n\r\ntype ProfileByIdParams = {\r\n userId: string;\r\n};\r\n\r\n/*\r\n * Nothing specific to the IC going on here, just fetching data as per usual.\r\n * This file does a lot of view juggling based on a lot of currentUser data.\r\n * There are 2 primary views: viewing another user or viewing yourself.\r\n * There are 4 secondary views: a list of uploaded videos, list of followers,\r\n * list of users the user follows, and a video preview of any uploaded videos.\r\n */\r\nexport function Profile({\r\n currentUser,\r\n onLogOut,\r\n}: {\r\n currentUser?: ProfileInfoPlus;\r\n onLogOut?: (history: H.History) => any;\r\n}) {\r\n const { userId = currentUser?.userName } = useParams();\r\n const [activeSubView, setActiveSubView] = useState(0);\r\n const history = useHistory();\r\n const { goBack } = useHistory();\r\n\r\n const [userProfile, setUserProfile] = useState();\r\n const [profilePic, setProfilePic] = useState(\"\");\r\n const [videoPreview, setVideoPreview] = useState();\r\n const [isLoading, setLoading] = useState(false);\r\n\r\n const currentUserFollows =\r\n currentUser?.following.map(({ userName }) => userName) || [];\r\n const initialIsFollowed = currentUserFollows.indexOf(userId || \"\") !== -1;\r\n const [isFollowed, setIsFollowed] = useState(initialIsFollowed);\r\n\r\n const isCurrentUserProfile = !userId || userId === currentUser?.userName;\r\n\r\n function handleShowVideoPreview(clickedVideo: VideoInfo) {\r\n setVideoPreview(clickedVideo);\r\n }\r\n\r\n async function fetchUserProfile() {\r\n if (isCurrentUserProfile) {\r\n setUserProfile(currentUser);\r\n return;\r\n }\r\n try {\r\n setLoading(true);\r\n const profileData = await getUserFromCanister(userId || \"\");\r\n setUserProfile(profileData!);\r\n } catch (error) {\r\n console.error(`Failed to retrieve profile for user ${userId}`, error);\r\n } finally {\r\n setLoading(false);\r\n }\r\n }\r\n\r\n async function fetchProfilePic() {\r\n try {\r\n const picData = await getProfilePic(userId || \"\");\r\n if (picData !== null) {\r\n const imgSrc = fileToImgSrc([picData]);\r\n setProfilePic(imgSrc);\r\n } else {\r\n console.info(`No profile pic set for user ${userId}`);\r\n }\r\n } catch (error) {\r\n console.error(\"Failed to retrieve profilePic.\", error);\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n Promise.all([fetchUserProfile(), fetchProfilePic()]);\r\n }, []);\r\n\r\n function handleFollow(userToFollow: string, willFollow: boolean) {\r\n follow(userToFollow, currentUser?.userName || \"\", willFollow);\r\n }\r\n\r\n function handleFollowCurrent() {\r\n setIsFollowed((state) => !state);\r\n handleFollow(userName, !isFollowed);\r\n }\r\n\r\n // @ts-ignore\r\n const { userName = \"\", uploadedVideos = [], followers = [], following = [] } =\r\n userProfile ?? {};\r\n\r\n return (\r\n <>\r\n {!isCurrentUserProfile && (\r\n
\r\n \r\n

{userName}

\r\n \r\n
\r\n )}\r\n
\r\n \r\n {videoPreview && (\r\n setVideoPreview(undefined)}\r\n key={videoPreview.videoId}\r\n />\r\n )}\r\n
\r\n \r\n

\r\n {isCurrentUserProfile ? (\r\n <>\r\n {userId}\r\n
\r\n onLogOut && onLogOut(history)}\r\n >\r\n Log out\r\n \r\n \r\n ) : (\r\n \r\n )}\r\n

\r\n
\r\n {[\r\n [\"Videos\", uploadedVideos.length],\r\n [\"Followers\", followers.length],\r\n [\"Following\", following.length],\r\n ].map(([label, count], index) => (\r\n setActiveSubView(index)}\r\n isActive={index === activeSubView}\r\n label={label}\r\n count={count}\r\n />\r\n ))}\r\n
\r\n
\r\n {activeSubView === 0 && (\r\n
\r\n {uploadedVideos.length > 0 ? (\r\n uploadedVideos.map((uploadedVideo) => (\r\n handleShowVideoPreview(uploadedVideo)}\r\n />\r\n ))\r\n ) : (\r\n
\r\n No videos yet\r\n {isCurrentUserProfile && (\r\n \r\n \r\n \r\n )}\r\n
\r\n )}\r\n
\r\n )}\r\n {activeSubView === 1 && (\r\n
\r\n {followers.length > 0 ? (\r\n followers.map((follower) => (\r\n \r\n ))\r\n ) : (\r\n
No followers yet!
\r\n )}\r\n
\r\n )}\r\n {activeSubView === 2 && (\r\n
\r\n {following.length > 0 ? (\r\n following.map((following) => (\r\n \r\n ))\r\n ) : (\r\n
Not following anyone yet!
\r\n )}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n}\r\n\r\nfunction ProfileNavLink({ isActive, onClick, label, count }) {\r\n return (\r\n \r\n
{formatBigNumber(count)}
\r\n {label}\r\n \r\n );\r\n}\r\n","import React, { useEffect, useState } from \"react\";\r\nimport { Link, useParams, useHistory } from \"react-router-dom\";\r\nimport { getSharedVideos } from \"../utils\";\r\nimport { Video } from \"../components/Video\";\r\nimport { LoadingIndicator } from \"../components/LoadingIndicator\";\r\nimport { ProfileInfoPlus, VideoInfo } from \"../utils/canister/typings\";\r\n\r\ntype SharedByHashParams = {\r\n videoHash: string;\r\n};\r\n/*\r\n * Nothing fancy here, either!\r\n */\r\nexport function Shared({\r\n currentUser,\r\n}: {\r\n currentUser?: ProfileInfoPlus;\r\n}) {\r\n const [feed, setFeed] = useState([]);\r\n const [isLoading, setIsLoading] = useState(false);\r\n const { videoHash } = useParams();\r\n\r\n useEffect(() => {\r\n if (videoHash) {\r\n setIsLoading(true);\r\n getSharedVideos(videoHash)\r\n .then((videos) => {\r\n setFeed(videos);\r\n setIsLoading(false);\r\n })\r\n .catch((e) => {\r\n console.error(e);\r\n setIsLoading(false);\r\n });\r\n }\r\n }, [videoHash]);\r\n\r\n return (\r\n
\r\n \r\n
\r\n {\r\n feed.map((v) => (\r\n \r\n ))}\r\n
\r\n
\r\n );\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAISSURBVHgB7ZnRbcIwEIYvUJ5bNnAnKHSC0EVgg8IEDRO0TEA6QcUEsAFsUPcdBH1GkP7XnFsrBCnBiPDgTzrFic/OH9vnOE5AJViv13c4PMNCmJLLC9io2WzObN/lctmr1+td8WU4P4bfO5UgKOoIcQqHqSUsS4SbD8X3hc+P+GlYB76aziVQWm4u4jawEaUtQvv9vler1bqSHiB9a4mLYRMug+sPyO9LHRrWhsgNnQPuLohM1imKDh8gknzbohw/JXUkq9WqX+TetSJOQRCEktR5XYNrEUmLWn5Rjh+XXciponMJtCvNa0EG3TcxaQRHlOeDsi2SoGk0GnMqwI1VWNF/xB2Dx+InfGNKRX9bebcmsd1u7+HTs/PwAPeUzgC/7Ha7IONj4HG5MD0ViLgxDnnOVfIGkQN+ilecmAGrqTyqgM9GrFSdaPUhWVEVkQOoI7QiOCQHWIuZNThIeFxRkiSargRLy13RKK4ML9CVqxfI0wyvUEKYRliXWgplUGbRAGLU9UUnIvUo2CyQ188HFXw3XhCeN9vmTaIoFdmSjAVVA9+fpz1N2TUjJsdYJscpVQTfWzSMzTUfxa54ga54ga54ga54ga54ga54ga54ga5cvcAbugBYIdOp2AK1HFuueysZiu6D87eI4gT2F2cHhTP70FUyx8fSozn5G4Oyod2Rb+NzbG4nJY3HAf8leLIr+QEY/xngEDD+GQAAAABJRU5ErkJggg==\"","import React, { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { CSSTransition } from \"react-transition-group\";\r\nimport { isDropDay, REWARDS_CHECK_INTERVAL } from \"../utils\";\r\nimport giftIcon from \"../assets/images/icon-rewards.png\";\r\nimport tokenIcon from \"../assets/images/icon-tokens.png\";\r\nimport chevron from \"../assets/images/icon-back.png\";\r\nimport close from \"../assets/images/icon-close.png\";\r\n\r\nimport \"./DropDayNotification.scss\";\r\n\r\n// We track this in localStorage so as not to repeatedly alert the user\r\nconst DROP_DAY_LS_KEY = \"ic-can-can-dropday-alerted\";\r\n\r\nfunction getAlerted(): boolean {\r\n return localStorage.getItem(DROP_DAY_LS_KEY) === \"true\";\r\n}\r\nfunction setAlerted() {\r\n localStorage.setItem(DROP_DAY_LS_KEY, \"true\");\r\n}\r\n\r\n/*\r\n * This functions as an alert to let the user know they can convert their earned\r\n * rewards into tokens or merchandise, and direct them to the /rewards route.\r\n */\r\nexport function DropDayNotification() {\r\n const [isVisible, setIsVisible] = useState(false);\r\n\r\n function closeAlert() {\r\n setAlerted();\r\n setIsVisible(false);\r\n }\r\n\r\n // We poll the canister periodically to determine if `isDropDay` has changed\r\n function pollIsDropDay() {\r\n isDropDay()\r\n .then((result) => {\r\n if (result && !getAlerted()) {\r\n setIsVisible(result);\r\n }\r\n })\r\n .catch((err) => {\r\n // nothing to do here\r\n console.error(err);\r\n });\r\n }\r\n const interval = setInterval(pollIsDropDay, REWARDS_CHECK_INTERVAL);\r\n\r\n useEffect(() => {\r\n pollIsDropDay();\r\n return () => clearInterval(interval);\r\n }, []);\r\n\r\n return (\r\n \r\n
\r\n
\r\n \"Rewards\"\r\n \r\n \"Tokens\"\r\n
\r\n
\r\n
Today is Drop Day!
\r\n
\r\n Exchange your Reward Points for tokens or prizes.\r\n \r\n View now.\r\n \r\n
\r\n
\r\n \r\n
\r\n \r\n );\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAmCAYAAACCjRgBAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJ6SURBVHgB7VjRcdswDKW6QJ0NlA08gtMF2g3sTJB0AnmDbFB2g7QLlNmgnSDsBE0mKALEYEIjgERJtpUPvTtccqYIvEeC0vE5dwAAwMINxJi5o0HFMRqMBwyPUYvxFUbkWCtjgccad2pg0SsmLkFCvjA5ichj342xtTs2slUtIUUCtxzREHul5CsW8qH0QSYe8F+KGuMR42tVVef4948xjZ6JNB3D6vWfnOMS4y/npsX4TTXdWGCSpWiHtKoL2D8DCbfKqiYEY7cajJrzbUU+D+JslRKvlUJtxENaMXg9oBIRuD04f2gZk7V9kRCwV7Xm8Q3sr25oIZ5261qZY+XrEtKoQqD/qkZR6FYhvhA7uhVkfIeQz1275UasamqlG4WU+XGCjvaAnruVkurKdmNBEhfC80JLVwhFyKZlt7yY+yJEClgqhYIsoAj44QYCdq/LrvxeGSORIL8Dj24YHtxwDK35jOIP2XvFLGBqzAKmxixgaswCpsYsYGrMAqbGoQSc1F3ja8BZ/kPJhYbQQHYfFRcaDz3cA3jrdmyyMXm99Yk4RoVxKS80g+6jMMA9YHKlbsd/jF8slohfCC73Mrl2N65bRBa7B6CbBt7In4ivDOL/QFxvcxEHdw+gn9txz3OI+Dnsux02cUPIodyDEuIv5DDOYN/toB35BkOseEVIBLbDwd6tNnd6DcaqMvHcWkytVLuxAN2VbjsDALYzl4sl4hU/I4mvungVfwfQQb4zXGQyl+gMfFSmkeMAPGZt/wUGvU1u+DnK9wlrUdy5YwHsPvfKbiUE2LWX51XOQa107U4JeLXDIyjOXCYyynbgtvPQ581yLIwpPpb4E152X9ALYK8ZAAAAAElFTkSuQmCC\"","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEiSURBVHgB7dbRzYIwFAXgWyf6R2CD3w1kBEdwA0egIziBbqBu4CYeS9QEDeC97Wl56UkaHyiHLxXSitTULBs3dQFAE376cXXOHSRDop8RbuzwmU7IiX5GmLjGeGjIEdw7zffc1cj9fxO9LQP56mgnLjeiKGgwn2jkzMq9868t8mykAuctfVQkHcdEZsMxkNlxKchiuBhkcZwFiaVwBuRyuESkl5IxIr0sESXSS0JWkhaQ5vCD31/rMPTzJBNXFhmJK4NU4DwyHNVouMHcskhEbF/FkEjYW6Hbu53EBoSNPxsSxFOJEinqhMl7Fs6A3FnKLkycEnmzFJ3YuEF3N9F9tpRsc+BmkPcwNtaSFs+/+gbL+6Hv3/WrFsaxXxCpqamJywNAqMekVgOW7gAAAABJRU5ErkJggg==\"","import React, { useEffect, useState } from \"react\";\r\n\r\nimport { ProfileInfoPlus, Message } from \"../utils/canister/typings\";\r\nimport { getMessages, REWARDS_CHECK_INTERVAL } from \"../utils\";\r\nimport LottieAnimation from \"./LottieAnimation\";\r\nimport RewardPointAnim from \"../assets/animations/RewardPointShower.json\";\r\nimport \"./RewardShowerNotification.scss\";\r\n\r\nconst KEY_LOCALSTORAGE_READ_MESSAGES_TIME = \"ic-can-can-read_messages\";\r\n\r\ninterface RewardShowerProps {\r\n currentUser: ProfileInfoPlus;\r\n}\r\n\r\n// Count up all the reward points from a message\r\nfunction rewardPointsReducer(acc: number, message: Message) {\r\n const { event } = message;\r\n let reward = 0;\r\n\r\n if (!event) return acc;\r\n // @ts-ignore\r\n if (event.uploadReward) reward = Number(event.uploadReward.rewards);\r\n // @ts-ignore\r\n if (event.superlikerReward) reward = Number(event.superlikerReward.rewards);\r\n // @ts-ignore\r\n if (event.transferReward) reward = Number(event.transferReward.rewards);\r\n return acc + reward;\r\n}\r\n\r\n// Filter messages based on the last date they were read, stored in localStorage\r\nfunction unreadMessagesFilter(message: Message) {\r\n const lastReadTime = localStorage.getItem(\r\n KEY_LOCALSTORAGE_READ_MESSAGES_TIME\r\n );\r\n if (!lastReadTime) return true;\r\n return message.time > BigInt(lastReadTime);\r\n}\r\n\r\nexport function RewardShowerNotification(props: RewardShowerProps) {\r\n const [currentRewards, setRewards] = useState(0);\r\n const [isDismissed, setDismissed] = useState(false);\r\n\r\n // Checks the user's events and pulls out any reward points for unread messages\r\n function checkForNewMessages() {\r\n if(props.currentUser){\r\n getMessages(props.currentUser.userName).then((messages) => {\r\n const unreadMessages = messages.filter(unreadMessagesFilter);\r\n if (unreadMessages.length === 0) return;\r\n const rewardPoints = unreadMessages.reduce(rewardPointsReducer, 0);\r\n if (rewardPoints > 0) {\r\n setRewards(rewardPoints);\r\n // Clear the animation after 5 seconds, the duration of the animation\r\n setTimeout(clearMessages, 5000);\r\n }\r\n if (unreadMessages) {\r\n setDismissed(false);\r\n localStorage.setItem(\r\n KEY_LOCALSTORAGE_READ_MESSAGES_TIME,\r\n (Date.now() * 1000 * 1000).toString()\r\n );\r\n }\r\n });\r\n }\r\n }\r\n\r\n // Clear the reward point shower notification\r\n function clearMessages() {\r\n setDismissed(true);\r\n setRewards(0);\r\n }\r\n\r\n // Check the user messages for reward messages, every minute.\r\n useEffect(() => {\r\n checkForNewMessages();\r\n const interval = setInterval(checkForNewMessages, REWARDS_CHECK_INTERVAL);\r\n return () => clearInterval(interval);\r\n }, []);\r\n\r\n return (\r\n
\r\n {currentRewards > 0 && !isDismissed && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { Link, NavLink } from \"react-router-dom\";\r\nimport homeIcon from \"../assets/images/icon-home.png\";\r\nimport discoverIcon from \"../assets/images/icon-discover.png\";\r\nimport uploadIcon from \"../assets/images/icon-upload.png\";\r\nimport rewardsIcon from \"../assets/images/icon-rewards.png\";\r\nimport profileIcon from \"../assets/images/icon-profile.png\";\r\n\r\nimport \"./MainNav.scss\";\r\n\r\nfunction getPathRoot(path) {\r\n return path.split(\"/\")[1];\r\n}\r\n\r\nexport function MainNav({ paths }) {\r\n function setDestination(destination) {\r\n const index = paths.findIndex(\r\n (path) => getPathRoot(path) === getPathRoot(destination)\r\n );\r\n const currentIndex = paths.findIndex(\r\n (path) => getPathRoot(path) === getPathRoot(window.location.pathname)\r\n );\r\n\r\n function onClick() {\r\n const destinationIndex = index < 0 ? paths.length : index;\r\n const value = currentIndex > destinationIndex ? -100 : 100;\r\n document.getElementById(\r\n \"slide-direction\"\r\n )!.innerHTML = `.page-slide { --inDirection: ${value}%; }`;\r\n }\r\n\r\n return { to: destination, onClick };\r\n }\r\n\r\n return (\r\n