import { getChanged as o } from "../lib/array"
export const computeUploadsDerived = (e, n) => {
const { uploads: r, rooms: t } = e,
p = {},
s = {},
d = Object.keys(t)
for (let e = 0; e < d.length; e += 1) {
const i = d[e],
a = t[i],
c = [],
m = []
for (let o = 0; o < a.length; o += 1) {
const e = a[o],
n = r[e]
!n || n.isSending || n.hideInInput || (c.push(e), n.isMetaPrepared && m.push(e))
}
const l = n.pendingByRoom[i]
p[i] = o(l, c) || l || c
const u = n.preparedByRoom[i]
s[i] = o(u, m) || u || m
}
return { ...e, pendingByRoom: p, preparedByRoom: s }
}