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C,IAAMzG,GAAcC,EAAAA,EAAAA,kBACdmJ,GAA0BpI,EAAAA,EAAAA,cAC/B,SAACkI,GACA,OAAOhI,IAAAA,IACD,GAAD,OAAIC,uDAAY,yBAAiB+H,EAAUG,aAAeH,GAC7D9H,MAAK,SAACC,GAAG,OAAKC,QAAQC,QAAQF,EAAIG,KAAK,GAC1C,GACA,CACCC,UAAW,WACVzB,EAAY0B,kBAAkB,CAACC,EAAAA,EAAAA,YAChC,IAGF,MAAO,CACN2H,gBAAiBF,EAAwBvH,YACzC4E,UAAW2C,EAAwB3C,UAErC,E,y2BCAA,OAlBA,WACC,IAAMzG,GAAcC,EAAAA,EAAAA,kBACdsJ,GAA2BvI,EAAAA,EAAAA,cAChC,SAACkI,GACA,OAAOhI,IAAAA,OAAa,GAAD,OAAIC,uDAAY,yBAAiB+H,EAAUG,aAC/D,GACA,CACC5H,UAAW,WACVzB,EAAY0B,kBAAkB,CAACC,EAAAA,EAAAA,aAC/B3B,EAAY0B,kBAAkB,CAACC,EAAAA,EAAAA,SAChC,IAGF,O,kWAAO,EACN6H,iBAAkBD,EAAyB1H,aACxC0H,EAEL,C","sources":["webpack://rpthreadtrackerv3.frontend/./src/infrastructure/constants/queryKeys.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/useIsMutating.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/user/useUpdateUserSettingsMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/user/useLoginMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/user/useLogoutMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/user/useForgotPasswordMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/user/useResetPasswordMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/user/useRegisterMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/user/useChangePasswordMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/user/useDeleteAccountMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/user/useUpdateAccountInfoMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/threads/useCreateThreadMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/threads/useGenerateExportedThreadsDocumentMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/threads/useUpdateThreadMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/threads/useUntrackThreadMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/threads/useThreadsStatusMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/threads/useUpdateTagMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/threads/useDeleteTagMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/characters/useCreateCharacterMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/characters/useUpdateCharacterMutation.js","webpack://rpthreadtrackerv3.frontend/./src/infrastructure/hooks/mutations/characters/useUntrackCharacterMutation.js"],"sourcesContent":["export default {\n\tCHARACTERS: 'characters',\n\tUSER_PROFILE: 'user-profile',\n\tUSER_SETTINGS: 'user-settings',\n\tTHREADS: 'threads',\n\tTHREADS_STATUS: 'threads-status',\n\tPUBLIC_VIEWS: 'public-views',\n\tPUBLIC_VIEW_THREADS: 'public-view-threads',\n\tNEWS: 'news',\n\tEXPORT: 'export'\n};\n","import React, { useEffect } from 'react';\nimport { useQueryClient } from 'react-query';\n\nexport default function useIsMutating() {\n\tconst queryClient = useQueryClient();\n\tconst [pendingMutations, setPendingMutations] = React.useState(0);\n\n\tuseEffect(\n\t\t() =>\n\t\t\tqueryClient.getMutationCache().subscribe(() => {\n\t\t\t\tconst muts = queryClient\n\t\t\t\t\t.getMutationCache()\n\t\t\t\t\t.getAll()\n\t\t\t\t\t.filter((mutation) => mutation.state.status === 'loading').length;\n\t\t\t\tsetPendingMutations(muts);\n\t\t\t}),\n\t\t[queryClient]\n\t);\n\n\treturn pendingMutations;\n}\n","import { useMutation, useQueryClient } from 'react-query';\nimport axios from 'axios';\nimport queryKeys from '~/infrastructure/constants/queryKeys';\n\nfunction useUpdateUserSettingsMutation() {\n\tconst queryClient = useQueryClient();\n\tconst updateUserSettingsMutation = useMutation(\n\t\t(request) => {\n\t\t\treturn axios\n\t\t\t\t.put(`${API_BASE_URL}api/profilesettings`, request)\n\t\t\t\t.then((res) => Promise.resolve(res.data));\n\t\t},\n\t\t{\n\t\t\tonSuccess: () => {\n\t\t\t\tqueryClient.invalidateQueries([queryKeys.USER_SETTINGS]);\n\t\t\t}\n\t\t}\n\t);\n\treturn {\n\t\tupdateUserSettings: updateUserSettingsMutation.mutateAsync,\n\t\t...updateUserSettingsMutation\n\t};\n}\nexport default useUpdateUserSettingsMutation;\n","import { useMutation, useQueryClient } from 'react-query';\nimport axios from 'axios';\nimport cache from '~/infrastructure/cache';\nimport cacheKeys from '~/infrastructure/constants/cacheKeys';\n\nfunction useLoginMutation() {\n\tconst queryClient = useQueryClient();\n\tconst loginMutation = useMutation(\n\t\t(request) => {\n\t\t\treturn axios.post(`${API_BASE_URL}api/auth/token`, request).then((res) => {\n\t\t\t\treturn Promise.resolve(res.data);\n\t\t\t});\n\t\t},\n\t\t{\n\t\t\tonSuccess: (data) => {\n\t\t\t\tqueryClient.cancelQueries();\n\t\t\t\tqueryClient.invalidateQueries();\n\t\t\t\tcache.set(cacheKeys.ACCESS_TOKEN, data.token.token);\n\t\t\t\tcache.set(cacheKeys.REFRESH_TOKEN, data.refreshToken.token);\n\t\t\t}\n\t\t}\n\t);\n\treturn {\n\t\tsubmitLogin: loginMutation.mutate,\n\t\t...loginMutation\n\t};\n}\nexport default useLoginMutation;\n","import { useMutation } from 'react-query';\nimport axios from 'axios';\n\nfunction useLogoutMutation() {\n\tconst logoutMutation = useMutation((refreshToken) => {\n\t\treturn axios.post(`${API_BASE_URL}api/auth/revoke`, {\n\t\t\trefreshToken\n\t\t});\n\t});\n\treturn {\n\t\tsubmitLogout: logoutMutation.mutateAsync,\n\t\t...logoutMutation\n\t};\n}\nexport default useLogoutMutation;\n","import { useMutation } from 'react-query';\nimport axios from 'axios';\n\nfunction useForgotPasswordMutation() {\n\tconst forgotPasswordMutation = useMutation((request) => {\n\t\treturn axios\n\t\t\t.post(`${API_BASE_URL}api/auth/forgotpassword`, request)\n\t\t\t.then((res) => Promise.resolve(res.data))\n\t\t\t.catch((res) => {\n\t\t\t\tthrow new Error(res.response.data);\n\t\t\t});\n\t});\n\treturn {\n\t\trequestPasswordReset: forgotPasswordMutation.mutateAsync,\n\t\t...forgotPasswordMutation\n\t};\n}\nexport default useForgotPasswordMutation;\n","import { useMutation } from 'react-query';\nimport axios from 'axios';\n\nfunction useResetPasswordMutation() {\n\tconst resetPasswordMutation = useMutation((request) => {\n\t\treturn axios\n\t\t\t.post(`${API_BASE_URL}api/auth/resetpassword`, request)\n\t\t\t.then((res) => Promise.resolve(res.data))\n\t\t\t.catch((res) => {\n\t\t\t\tthrow new Error(res.response.data);\n\t\t\t});\n\t});\n\treturn {\n\t\tresetPassword: resetPasswordMutation.mutateAsync,\n\t\t...resetPasswordMutation\n\t};\n}\nexport default useResetPasswordMutation;\n","import { useMutation } from 'react-query';\nimport axios from 'axios';\n\nfunction useRegisterMutation() {\n\tconst registerMutation = useMutation((request) => {\n\t\treturn axios\n\t\t\t.post(`${API_BASE_URL}api/auth/register`, request)\n\t\t\t.then((res) => Promise.resolve(res.data));\n\t});\n\treturn {\n\t\tsubmitUserRegistration: registerMutation.mutateAsync,\n\t\t...registerMutation\n\t};\n}\nexport default useRegisterMutation;\n","import { useMutation } from 'react-query';\nimport axios from 'axios';\n\nfunction useChangePasswordMutation() {\n\tconst changePasswordMutation = useMutation((request) => {\n\t\treturn axios\n\t\t\t.put(`${API_BASE_URL}api/user/password`, request)\n\t\t\t.then((res) => Promise.resolve(res.data));\n\t});\n\treturn {\n\t\tchangePassword: changePasswordMutation.mutateAsync,\n\t\t...changePasswordMutation\n\t};\n}\nexport default useChangePasswordMutation;\n","import { useMutation } from 'react-query';\nimport axios from 'axios';\n\nfunction useDeleteAccountMutation() {\n\tconst deleteAccountMutation = useMutation((request) => {\n\t\treturn axios\n\t\t\t.delete(`${API_BASE_URL}api/user`, request)\n\t\t\t.then((res) => Promise.resolve(res.data));\n\t});\n\treturn {\n\t\tdeleteAccount: deleteAccountMutation.mutateAsync,\n\t\t...deleteAccountMutation\n\t};\n}\nexport default useDeleteAccountMutation;\n","import { useMutation } from 'react-query';\nimport axios from 'axios';\n\nfunction useUpdateAccountInfoMutation() {\n\tconst updateAccountInfoMutation = useMutation((request) => {\n\t\treturn axios\n\t\t\t.put(`${API_BASE_URL}api/user/accountinfo`, request)\n\t\t\t.then((res) => Promise.resolve(res.data));\n\t});\n\treturn {\n\t\tupdateAccountInfo: updateAccountInfoMutation.mutateAsync,\n\t\t...updateAccountInfoMutation\n\t};\n}\nexport default useUpdateAccountInfoMutation;\n","import { useMutation, useQueryClient } from 'react-query';\nimport axios from 'axios';\nimport queryKeys from '~/infrastructure/constants/queryKeys';\n\nfunction useCreateThreadMutation() {\n\tconst queryClient = useQueryClient();\n\tconst createThreadMutation = useMutation(\n\t\t(thread) => {\n\t\t\treturn axios\n\t\t\t\t.post(`${API_BASE_URL}api/thread`, thread)\n\t\t\t\t.then((res) => Promise.resolve(res.data));\n\t\t},\n\t\t{\n\t\t\tonSuccess: () => {\n\t\t\t\tqueryClient.invalidateQueries([queryKeys.THREADS, { isArchived: false }]);\n\t\t\t}\n\t\t}\n\t);\n\treturn {\n\t\tcreateThread: createThreadMutation.mutateAsync,\n\t\t...createThreadMutation\n\t};\n}\nexport default useCreateThreadMutation;\n","import { useMutation } from 'react-query';\nimport axios from 'axios';\n\nfunction saveAsBlob(response, filename, contentType) {\n\ttry {\n\t\tconst blob = new Blob([response.data], {\n\t\t\ttype: contentType\n\t\t});\n\t\tconst saveBlob =\n\t\t\tnavigator.msSaveBlob ||\n\t\t\tnavigator.webkitSaveBlob ||\n\t\t\tnavigator.mozSaveBlob ||\n\t\t\tnavigator.saveBlob;\n\t\tif (saveBlob === undefined) {\n\t\t\tthrow new Error('Not supported');\n\t\t}\n\t\tsaveBlob(blob, filename);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n}\n\nfunction saveWithSimClick(response, contentType, urlCreator, filename) {\n\tconst link = document.createElement('a');\n\tif (!('download' in link)) {\n\t\treturn false;\n\t}\n\ttry {\n\t\tconst blob = new Blob([response.data], {\n\t\t\ttype: contentType\n\t\t});\n\t\tconst url = urlCreator.createObjectURL(blob);\n\t\tlink.setAttribute('href', url);\n\t\tlink.setAttribute('download', filename);\n\t\tconst event = document.createEvent('MouseEvents');\n\t\tevent.initMouseEvent(\n\t\t\t'click',\n\t\t\ttrue,\n\t\t\ttrue,\n\t\t\twindow,\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t0,\n\t\t\tnull\n\t\t);\n\t\tlink.dispatchEvent(event);\n\t\treturn true;\n\t} catch (ex) {\n\t\treturn false;\n\t}\n}\n\nfunction saveWithWindowOpen(response, octetStreamMime, urlCreator) {\n\tconst blob = new Blob([response.data], {\n\t\ttype: octetStreamMime\n\t});\n\tconst url = urlCreator.createObjectURL(blob);\n\twindow.location.assign(url);\n}\n\nfunction attemptFileSave(response) {\n\tconst octetStreamMime = 'application/octet-stream';\n\tconst { headers } = response;\n\t// istanbul ignore next\n\tconst filename = headers['x-filename'] || `${Date.now()}.xlsx`;\n\t// istanbul ignore next\n\tconst contentType = headers['content-type'] || octetStreamMime;\n\tconst saveAsBlobSuccess = saveAsBlob(response, filename, contentType);\n\tif (saveAsBlobSuccess) {\n\t\treturn;\n\t}\n\tconst urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;\n\tif (!urlCreator) {\n\t\tthrow new Error('Could not export threads');\n\t}\n\tconst saveWithSimClickSuccess = saveWithSimClick(response, contentType, urlCreator, filename);\n\tif (saveWithSimClickSuccess) {\n\t\treturn;\n\t}\n\tsaveWithWindowOpen(response, octetStreamMime, urlCreator);\n}\n\nfunction useGenerateExportedThreadsDocumentMutation() {\n\tconst generateDocumentMutation = useMutation(({ includeHiatused, includeArchive }) => {\n\t\treturn axios\n\t\t\t.get(`${API_BASE_URL}api/thread/export`, {\n\t\t\t\tresponseType: 'arraybuffer',\n\t\t\t\tparams: { includeHiatused, includeArchive }\n\t\t\t})\n\t\t\t.then((res) => {\n\t\t\t\tattemptFileSave(res);\n\t\t\t\treturn Promise.resolve();\n\t\t\t});\n\t});\n\treturn {\n\t\tgenerateDocument: generateDocumentMutation.mutateAsync,\n\t\tisLoading: generateDocumentMutation.isLoading\n\t};\n}\nexport default useGenerateExportedThreadsDocumentMutation;\n","import { useMutation, useQueryClient } from 'react-query';\nimport axios from 'axios';\nimport queryKeys from '~/infrastructure/constants/queryKeys';\n\nfunction useUpdateThreadMutation() {\n\tconst queryClient = useQueryClient();\n\tconst updateThreadMutation = useMutation(\n\t\t(thread) => {\n\t\t\treturn axios\n\t\t\t\t.put(`${API_BASE_URL}api/thread/${thread.threadId}`, thread)\n\t\t\t\t.then((res) => Promise.resolve(res.data));\n\t\t},\n\t\t{\n\t\t\tonSuccess: () => {\n\t\t\t\tqueryClient.invalidateQueries([queryKeys.THREADS]);\n\t\t\t}\n\t\t}\n\t);\n\tconst bulkUpdateThreadsMutation = useMutation(\n\t\t(threads) => {\n\t\t\treturn Promise.allSettled(\n\t\t\t\tthreads.map((t) => axios.put(`${API_BASE_URL}api/thread/${t.threadId}`, t))\n\t\t\t);\n\t\t},\n\t\t{\n\t\t\tonSettled: () => {\n\t\t\t\tqueryClient.invalidateQueries([queryKeys.THREADS]);\n\t\t\t}\n\t\t}\n\t);\n\treturn {\n\t\tupdateThread: updateThreadMutation.mutateAsync,\n\t\tbulkUpdateThreads: bulkUpdateThreadsMutation.mutateAsync,\n\t\t...updateThreadMutation\n\t};\n}\nexport default useUpdateThreadMutation;\n","import { useMutation, useQueryClient } from 'react-query';\nimport axios from 'axios';\nimport { useState } from 'react';\nimport queryKeys from '~/infrastructure/constants/queryKeys';\n\nfunction useUntrackThreadMutation() {\n\tconst [isArchived, setIsArchived] = useState(false);\n\tconst queryClient = useQueryClient();\n\tconst untrackThreadMutation = useMutation(\n\t\t(thread) => {\n\t\t\tsetIsArchived(thread.isArchived);\n\t\t\treturn axios.delete(`${API_BASE_URL}api/thread/${thread.threadId}`);\n\t\t},\n\t\t{\n\t\t\tonSuccess: () => {\n\t\t\t\tqueryClient.invalidateQueries([queryKeys.THREADS, { isArchived }]);\n\t\t\t}\n\t\t}\n\t);\n\tconst bulkUntrackThreadMutation = useMutation(\n\t\t(threads) => {\n\t\t\treturn Promise.allSettled(\n\t\t\t\tthreads.map((t) => axios.delete(`${API_BASE_URL}api/thread/${t.threadId}`))\n\t\t\t);\n\t\t},\n\t\t{\n\t\t\tonSettled: (_, __, variables) => {\n\t\t\t\tif (variables.some((t) => t.isArchived)) {\n\t\t\t\t\tqueryClient.invalidateQueries([queryKeys.THREADS, { isArchived: true }]);\n\t\t\t\t}\n\t\t\t\tif (variables.some((t) => !t.isArchived)) {\n\t\t\t\t\tqueryClient.invalidateQueries([queryKeys.THREADS, { isArchived: false }]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\treturn {\n\t\tuntrackThread: untrackThreadMutation.mutateAsync,\n\t\tbulkUntrackThreads: bulkUntrackThreadMutation.mutateAsync,\n\t\t...untrackThreadMutation\n\t};\n}\nexport default useUntrackThreadMutation;\n","import { useCallback, useReducer } from 'react';\nimport { useMutation } from 'react-query';\nimport axios from 'axios';\n\nconst threadsStatusReducer = (state, action) => {\n\tif (!action) {\n\t\treturn state;\n\t}\n\tif (action.type === 'reset') {\n\t\treturn [];\n\t}\n\tlet newState = [...state];\n\tnewState = newState.concat(action.data);\n\treturn newState;\n};\n\nfunction useThreadsStatusMutation(isArchived = false) {\n\tconst [threadsStatus, dispatch] = useReducer(threadsStatusReducer, []);\n\tconst threadsStatusMutation = useMutation(\n\t\t(chunk) => {\n\t\t\treturn axios\n\t\t\t\t.post(`${TUMBLR_CLIENT_BASE_URL}api/thread`, chunk)\n\t\t\t\t.then((res) => Promise.resolve({ isArchived, data: res.data }));\n\t\t},\n\t\t{\n\t\t\tonSuccess: (res) => {\n\t\t\t\tdispatch(res);\n\t\t\t}\n\t\t}\n\t);\n\tconst clearData = useCallback(() => {\n\t\tdispatch({\n\t\t\ttype: 'reset'\n\t\t});\n\t}, []);\n\treturn {\n\t\tthreadsStatus,\n\t\tfetchThreadsStatusChunk: threadsStatusMutation.mutateAsync,\n\t\tclearData,\n\t\t...threadsStatusMutation\n\t};\n}\nexport default useThreadsStatusMutation;\n","import { useMutation, useQueryClient } from 'react-query';\nimport axios from 'axios';\nimport queryKeys from '~/infrastructure/constants/queryKeys';\n\nfunction useUpdateTagMutation() {\n\tconst queryClient = useQueryClient();\n\tconst updateTagMutation = useMutation(\n\t\t({ currentTag, replacementTag }) => {\n\t\t\treturn axios\n\t\t\t\t.put(\n\t\t\t\t\t`${API_BASE_URL}api/thread/tags?currentTag=${currentTag}&replacementTag=${replacementTag}`,\n\t\t\t\t\t{}\n\t\t\t\t)\n\t\t\t\t.then((res) => Promise.resolve(res.data));\n\t\t},\n\t\t{\n\t\t\tonSuccess: () => {\n\t\t\t\tqueryClient.invalidateQueries([queryKeys.THREADS]);\n\t\t\t}\n\t\t}\n\t);\n\treturn {\n\t\tbulkUpdateTag: updateTagMutation.mutateAsync,\n\t\t...updateTagMutation\n\t};\n}\nexport default useUpdateTagMutation;\n","import { useMutation, useQueryClient } from 'react-query';\nimport axios from 'axios';\nimport queryKeys from '~/infrastructure/constants/queryKeys';\n\nfunction useDeleteTagMutation() {\n\tconst queryClient = useQueryClient();\n\tconst updateTagMutation = useMutation(\n\t\t({ tag }) => {\n\t\t\treturn axios\n\t\t\t\t.delete(`${API_BASE_URL}api/thread/tags/${tag}`)\n\t\t\t\t.then((res) => Promise.resolve(res.data));\n\t\t},\n\t\t{\n\t\t\tonSuccess: () => {\n\t\t\t\tqueryClient.invalidateQueries([queryKeys.THREADS]);\n\t\t\t}\n\t\t}\n\t);\n\treturn {\n\t\tbulkDeleteTag: updateTagMutation.mutateAsync,\n\t\t...updateTagMutation\n\t};\n}\nexport default useDeleteTagMutation;\n","import { useMutation, useQueryClient } from 'react-query';\nimport axios from 'axios';\nimport queryKeys from '~/infrastructure/constants/queryKeys';\n\nfunction useCreateCharacterMutation() {\n\tconst queryClient = useQueryClient();\n\tconst createCharacterMutation = useMutation(\n\t\t(character) => {\n\t\t\treturn axios\n\t\t\t\t.post(`${API_BASE_URL}api/character`, character)\n\t\t\t\t.then((res) => Promise.resolve(res.data));\n\t\t},\n\t\t{\n\t\t\tonSuccess: () => {\n\t\t\t\tqueryClient.invalidateQueries([queryKeys.CHARACTERS]);\n\t\t\t}\n\t\t}\n\t);\n\treturn {\n\t\tcreateCharacter: createCharacterMutation.mutateAsync,\n\t\tisLoading: createCharacterMutation.isLoading\n\t};\n}\nexport default useCreateCharacterMutation;\n","import { useMutation, useQueryClient } from 'react-query';\nimport axios from 'axios';\nimport queryKeys from '~/infrastructure/constants/queryKeys';\n\nfunction useUpdateCharacterMutation() {\n\tconst queryClient = useQueryClient();\n\tconst updateCharacterMutation = useMutation(\n\t\t(character) => {\n\t\t\treturn axios\n\t\t\t\t.put(`${API_BASE_URL}api/character/${character.characterId}`, character)\n\t\t\t\t.then((res) => Promise.resolve(res.data));\n\t\t},\n\t\t{\n\t\t\tonSuccess: () => {\n\t\t\t\tqueryClient.invalidateQueries([queryKeys.CHARACTERS]);\n\t\t\t}\n\t\t}\n\t);\n\treturn {\n\t\tupdateCharacter: updateCharacterMutation.mutateAsync,\n\t\tisLoading: updateCharacterMutation.isLoading\n\t};\n}\nexport default useUpdateCharacterMutation;\n","import { useMutation, useQueryClient } from 'react-query';\nimport axios from 'axios';\nimport queryKeys from '~/infrastructure/constants/queryKeys';\n\nfunction useUntrackCharacterMutation() {\n\tconst queryClient = useQueryClient();\n\tconst untrackCharacterMutation = useMutation(\n\t\t(character) => {\n\t\t\treturn axios.delete(`${API_BASE_URL}api/character/${character.characterId}`);\n\t\t},\n\t\t{\n\t\t\tonSuccess: () => {\n\t\t\t\tqueryClient.invalidateQueries([queryKeys.CHARACTERS]);\n\t\t\t\tqueryClient.invalidateQueries([queryKeys.THREADS]);\n\t\t\t}\n\t\t}\n\t);\n\treturn {\n\t\tuntrackCharacter: untrackCharacterMutation.mutateAsync,\n\t\t...untrackCharacterMutation\n\t};\n}\nexport default useUntrackCharacterMutation;\n"],"names":["CHARACTERS","USER_PROFILE","USER_SETTINGS","THREADS","THREADS_STATUS","PUBLIC_VIEWS","PUBLIC_VIEW_THREADS","NEWS","EXPORT","useIsMutating","queryClient","useQueryClient","React","pendingMutations","setPendingMutations","useEffect","getMutationCache","subscribe","muts","getAll","filter","mutation","state","status","length","updateUserSettingsMutation","useMutation","request","axios","API_BASE_URL","then","res","Promise","resolve","data","onSuccess","invalidateQueries","queryKeys","updateUserSettings","mutateAsync","loginMutation","cancelQueries","cache","cacheKeys","token","refreshToken","submitLogin","mutate","logoutMutation","submitLogout","forgotPasswordMutation","catch","Error","response","requestPasswordReset","resetPasswordMutation","resetPassword","registerMutation","submitUserRegistration","changePasswordMutation","changePassword","deleteAccountMutation","deleteAccount","updateAccountInfoMutation","updateAccountInfo","createThreadMutation","thread","isArchived","createThread","generateDocumentMutation","includeHiatused","includeArchive","responseType","params","octetStreamMime","headers","filename","Date","now","contentType","blob","Blob","type","saveBlob","navigator","msSaveBlob","webkitSaveBlob","mozSaveBlob","undefined","e","saveAsBlob","urlCreator","window","URL","webkitURL","mozURL","msURL","saveWithSimClickSuccess","link","document","createElement","url","createObjectURL","setAttribute","event","createEvent","initMouseEvent","dispatchEvent","ex","saveWithSimClick","location","assign","saveWithWindowOpen","attemptFileSave","generateDocument","isLoading","updateThreadMutation","threadId","bulkUpdateThreadsMutation","threads","allSettled","map","t","onSettled","updateThread","bulkUpdateThreads","useState","setIsArchived","untrackThreadMutation","bulkUntrackThreadMutation","_","__","variables","some","untrackThread","bulkUntrackThreads","threadsStatusReducer","action","newState","concat","useReducer","threadsStatus","dispatch","threadsStatusMutation","chunk","TUMBLR_CLIENT_BASE_URL","clearData","useCallback","fetchThreadsStatusChunk","updateTagMutation","currentTag","replacementTag","bulkUpdateTag","tag","bulkDeleteTag","createCharacterMutation","character","createCharacter","updateCharacterMutation","characterId","updateCharacter","untrackCharacterMutation","untrackCharacter"],"sourceRoot":""}