Initial upload to Gitea

This commit is contained in:
antonn committed 2026-11-30 16:32:37 +00:00
1 parent 78193254ad
commit 8478998cae
1485 files changed
+461025 -42348

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
(function (root) {
'use strict';
const ids = new Map();
const key = (email) => String(email || '').trim().toLowerCase();
const changed = () => new Error('Account state changed. Close this dialog, reload accounts, and select the account again.');
// adpanel:account-retry-identity - a refreshed token cannot retarget a
// pending action to a replacement row that reuses its email.
root.ADPanelAccountTargets = {
update(accounts) {
ids.clear();
for (const account of accounts || []) {
if (Number.isSafeInteger(account.id) && account.id > 0) ids.set(key(account.email), account.id);
}
},
select(email) {
const id = ids.get(key(email));
return Object.freeze({ email: key(email), id: id || 0 });
},
payload(target, body) {
if (!target || !target.id || ids.get(target.email) !== target.id) throw changed();
return { ...body, expectedTargetId: target.id };
}
};
})(window);