Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cae411eae7
commit
1c411e402e
19809 changed files with 1962608 additions and 97 deletions
38
frontend/node_modules/es-toolkit/dist/compat/function/debounce.mjs
generated
vendored
Normal file
38
frontend/node_modules/es-toolkit/dist/compat/function/debounce.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { debounce as debounce$1 } from "../../function/debounce.mjs";
|
||||
//#region src/compat/function/debounce.ts
|
||||
function debounce(func, debounceMs = 0, options = {}) {
|
||||
if (typeof options !== "object") options = {};
|
||||
const { leading = false, trailing = true, maxWait } = options;
|
||||
const edges = Array(2);
|
||||
if (leading) edges[0] = "leading";
|
||||
if (trailing) edges[1] = "trailing";
|
||||
let result = void 0;
|
||||
let pendingAt = null;
|
||||
const _debounced = debounce$1(function(...args) {
|
||||
result = func.apply(this, args);
|
||||
pendingAt = null;
|
||||
}, debounceMs, { edges });
|
||||
const debounced = function(...args) {
|
||||
if (maxWait != null) {
|
||||
if (pendingAt === null) pendingAt = Date.now();
|
||||
if (Date.now() - pendingAt >= maxWait) {
|
||||
result = func.apply(this, args);
|
||||
pendingAt = Date.now();
|
||||
_debounced.cancel();
|
||||
_debounced.schedule();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
_debounced.apply(this, args);
|
||||
return result;
|
||||
};
|
||||
const flush = () => {
|
||||
_debounced.flush();
|
||||
return result;
|
||||
};
|
||||
debounced.cancel = _debounced.cancel;
|
||||
debounced.flush = flush;
|
||||
return debounced;
|
||||
}
|
||||
//#endregion
|
||||
export { debounce };
|
||||
Loading…
Add table
Add a link
Reference in a new issue