Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5030.js (118.4 MB)
134 lines
5.3 KiB
TypeScript
134 lines
5.3 KiB
TypeScript
// Module ID: 16064
|
|
// Function ID: 16065
|
|
// Name: vibegrationsUnread
|
|
// Dependencies: [19, 4860, 5027, 573, 11, 16065, 504, 16066, 2]
|
|
// Exports: ackVibegrationsProject, useAckVibegrationsProjectWhileViewing, useVibegrationsProjectUnreadStatus, useVibegrationsUnreadSummary
|
|
|
|
// Module 16064 (vibegrationsUnread)
|
|
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
|
|
import initialize from "initialize" /* 504 */;
|
|
import DispatcherDefault from "Dispatcher" /* 573 */;
|
|
import VibegrationsReadStateFlags2 from "VibegrationsReadStateFlags" /* 16065 */;
|
|
import useVibegrationsWindowFocusedDefault from "useVibegrationsWindowFocused" /* 16066 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import ReadStateStore from "ReadStateStore" /* 4860 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
require = fn;
|
|
function unreadStatus(arg0, arg1) {
|
|
if (0 === arg0) {
|
|
return null;
|
|
} else {
|
|
if (tmp == arg1) {
|
|
const FINISHED = VibegrationsReadStateFlags2.VibegrationsReadStateFlags.FINISHED;
|
|
} else {
|
|
let VibegrationsReadStateFlags = dependencyMap;
|
|
const nonTimestampBits = SnowflakeUtilsDefault.getNonTimestampBits(arg1);
|
|
const tmp4 = require;
|
|
}
|
|
VibegrationsReadStateFlags = tmp4(16065).VibegrationsReadStateFlags;
|
|
const NEEDS_INPUT = VibegrationsReadStateFlags.NEEDS_INPUT;
|
|
}
|
|
}
|
|
const ReadStateTypes = fn(5027).ReadStateTypes;
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/vibegrations/lib/vibegrationsUnread.tsx");
|
|
|
|
export const ackVibegrationsProject = function ackVibegrationsProject(projectId) {
|
|
DispatcherDefault.dispatch({ type: "VIBEGRATIONS_PROJECT_ACK", projectId });
|
|
};
|
|
export const useVibegrationsProjectUnreadStatus = function useVibegrationsProjectUnreadStatus(id) {
|
|
_require = id;
|
|
const items = [ReadStateStore];
|
|
const items1 = [id];
|
|
return require("initialize").useStateFromStores(items, () => {
|
|
let tmp3 = null;
|
|
if (null != closure_0) {
|
|
let VibegrationsReadStateFlags = ReadStateStore.getMentionCount(tmp, ReadStateTypes.CONJURING_PROJECT);
|
|
let ackMessageId = ReadStateStore.ackMessageId;
|
|
const ackMessageIdResult = ackMessageId(tmp, ReadStateTypes.CONJURING_PROJECT);
|
|
if (0 === VibegrationsReadStateFlags) {
|
|
tmp3 = null;
|
|
} else {
|
|
if (tmp2 == ackMessageIdResult) {
|
|
const FINISHED = VibegrationsReadStateFlags2.VibegrationsReadStateFlags.FINISHED;
|
|
} else {
|
|
VibegrationsReadStateFlags = dependencyMap;
|
|
ackMessageId = require;
|
|
const nonTimestampBits = SnowflakeUtilsDefault.getNonTimestampBits(ackMessageIdResult);
|
|
}
|
|
VibegrationsReadStateFlags = ackMessageId(16065).VibegrationsReadStateFlags;
|
|
const NEEDS_INPUT = VibegrationsReadStateFlags.NEEDS_INPUT;
|
|
}
|
|
}
|
|
return tmp3;
|
|
}, items1);
|
|
};
|
|
export const useVibegrationsUnreadSummary = function useVibegrationsUnreadSummary() {
|
|
const items = [ReadStateStore];
|
|
return initialize.useStateFromStoresObject(items, () => {
|
|
let hasUnread = false;
|
|
let badgeCount = 0;
|
|
const resourceIds = ReadStateStore.getResourceIds(constants.CONJURING_PROJECT);
|
|
const iter = resourceIds[Symbol.iterator]();
|
|
const nextResult = iter.next();
|
|
while (iter !== undefined) {
|
|
let mentionCount = ReadStateStore.getMentionCount(nextResult, constants.CONJURING_PROJECT);
|
|
let tmp7 = unreadStatus(mentionCount, ReadStateStore.ackMessageId(nextResult, constants.CONJURING_PROJECT));
|
|
if (null != tmp7) {
|
|
hasUnread = true;
|
|
if (tmp8 === require("VibegrationsReadStateFlags").VibegrationsReadStateFlags.NEEDS_INPUT) {
|
|
badgeCount = badgeCount + 1;
|
|
}
|
|
}
|
|
continue;
|
|
}
|
|
return { hasUnread, badgeCount };
|
|
});
|
|
};
|
|
export const useAckVibegrationsProjectWhileViewing = function useAckVibegrationsProjectWhileViewing(projectId) {
|
|
_require = projectId;
|
|
closure_129_0 = projectId;
|
|
const items = [ReadStateStore];
|
|
const items1 = [projectId];
|
|
const tmp = null != require("initialize").useStateFromStores(items, () => {
|
|
let tmp3 = null;
|
|
if (null != closure_0) {
|
|
let VibegrationsReadStateFlags = ReadStateStore.getMentionCount(tmp, ReadStateTypes.CONJURING_PROJECT);
|
|
let ackMessageId = ReadStateStore.ackMessageId;
|
|
const ackMessageIdResult = ackMessageId(tmp, ReadStateTypes.CONJURING_PROJECT);
|
|
if (0 === VibegrationsReadStateFlags) {
|
|
tmp3 = null;
|
|
} else {
|
|
if (tmp2 == ackMessageIdResult) {
|
|
const FINISHED = VibegrationsReadStateFlags2.VibegrationsReadStateFlags.FINISHED;
|
|
} else {
|
|
VibegrationsReadStateFlags = dependencyMap;
|
|
ackMessageId = require;
|
|
const nonTimestampBits = SnowflakeUtilsDefault.getNonTimestampBits(ackMessageIdResult);
|
|
}
|
|
VibegrationsReadStateFlags = ackMessageId(16065).VibegrationsReadStateFlags;
|
|
const NEEDS_INPUT = VibegrationsReadStateFlags.NEEDS_INPUT;
|
|
}
|
|
}
|
|
return tmp3;
|
|
}, items1);
|
|
importDefault = tmp;
|
|
let tmp2 = useVibegrationsWindowFocusedDefault();
|
|
dependencyMap = tmp2;
|
|
const items2 = [projectId, tmp, tmp2];
|
|
const effect = noop.useEffect(() => {
|
|
let tmp2 = null != projectId;
|
|
if (tmp2) {
|
|
tmp2 = closure_1;
|
|
}
|
|
if (tmp2) {
|
|
tmp2 = closure_2;
|
|
}
|
|
if (tmp2) {
|
|
const obj2 = { type: "VIBEGRATIONS_PROJECT_ACK", projectId };
|
|
DispatcherDefault.dispatch(obj2);
|
|
}
|
|
}, items2);
|
|
};
|