@flaxia/node 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/ai-inference.js +20 -12
- package/dist/client/SignalingClient.d.ts.map +1 -1
- package/dist/client/light-preloader.d.ts +13 -4
- package/dist/client/light-preloader.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +212 -192
- package/dist/worker.js +2 -2
- package/dist/workloads/__tests__/ai-model-registry.test.d.ts +2 -0
- package/dist/workloads/__tests__/ai-model-registry.test.d.ts.map +1 -0
- package/dist/workloads/ai-inference.d.ts +9 -0
- package/dist/workloads/ai-inference.d.ts.map +1 -1
- package/dist/workloads/ai-model-registry.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -17,6 +17,11 @@ var o = 512 * 1024 * 1024, s = 4 * 1024 ** 3, c = new Map(Object.entries({
|
|
|
17
17
|
repo: "Xenova/m2m100_418M",
|
|
18
18
|
revision: "main",
|
|
19
19
|
maxBytes: o
|
|
20
|
+
},
|
|
21
|
+
"TeamFlaxia/plamo-3-translate-0.8b-onnx": {
|
|
22
|
+
repo: "TeamFlaxia/plamo-3-translate-0.8b-onnx",
|
|
23
|
+
revision: "1c8417ee1a72442440ad515b02f99186c81fd08a",
|
|
24
|
+
maxBytes: 2 * 1024 ** 3
|
|
20
25
|
}
|
|
21
26
|
}).map(([e, t]) => [e, { ...t }])), l = [
|
|
22
27
|
"wasm",
|
|
@@ -245,6 +250,9 @@ function x(e) {
|
|
|
245
250
|
//#region src/workloads/ai-inference.ts
|
|
246
251
|
var S = /* @__PURE__ */ e({
|
|
247
252
|
DEFAULT_AI_MODEL_MAX_BYTES: () => o,
|
|
253
|
+
LIGHT_INFERENCE_PLAMO_TRANSLATE_DTYPE: () => M,
|
|
254
|
+
LIGHT_INFERENCE_PLAMO_TRANSLATE_MODEL: () => A,
|
|
255
|
+
LIGHT_INFERENCE_PLAMO_TRANSLATE_TASK: () => j,
|
|
248
256
|
LIGHT_INFERENCE_TRANSLATE_DTYPE: () => k,
|
|
249
257
|
LIGHT_INFERENCE_TRANSLATE_MODEL: () => D,
|
|
250
258
|
LIGHT_INFERENCE_TRANSLATE_TASK: () => O,
|
|
@@ -252,11 +260,11 @@ var S = /* @__PURE__ */ e({
|
|
|
252
260
|
MAX_AI_INPUT_ITEMS: () => 64,
|
|
253
261
|
MAX_PENDING_TOKEN_CALLBACKS: () => 64,
|
|
254
262
|
MAX_PENDING_TOKEN_CHARS: () => T,
|
|
255
|
-
getModelCacheSnapshot: () =>
|
|
256
|
-
handleAiInference: () =>
|
|
263
|
+
getModelCacheSnapshot: () => P,
|
|
264
|
+
handleAiInference: () => L,
|
|
257
265
|
isAiModelPreloaded: () => E,
|
|
258
|
-
preloadAiModel: () =>
|
|
259
|
-
releaseCache: () =>
|
|
266
|
+
preloadAiModel: () => R,
|
|
267
|
+
releaseCache: () => N
|
|
260
268
|
}), C = [
|
|
261
269
|
"text-classification",
|
|
262
270
|
"token-classification",
|
|
@@ -283,9 +291,9 @@ var S = /* @__PURE__ */ e({
|
|
|
283
291
|
"depth-estimation",
|
|
284
292
|
"feature-extraction",
|
|
285
293
|
"image-feature-extraction"
|
|
286
|
-
], w = new b(), T = 256 * 1024, E = (e) =>
|
|
294
|
+
], w = new b(), T = 256 * 1024, E = (e) => P().entries.some((t) => t.modelId === e && t.state === "ready"), D = "Xenova/m2m100_418M", O = "translation", k = "q4f16", A = "TeamFlaxia/plamo-3-translate-0.8b-onnx", j = "text-generation", M = "q4f16", N = () => {
|
|
287
295
|
w.releaseAll();
|
|
288
|
-
},
|
|
296
|
+
}, P = () => w.getSnapshot(), F = (e, t) => {
|
|
289
297
|
let n = "", r = null, i = Promise.resolve(), a = 0, o = 0, s, c = !1, l = !1, u = (t) => {
|
|
290
298
|
if (a >= 64 || o + t.length > 262144) throw c = !0, s = /* @__PURE__ */ Error("ai-inference token consumer is too slow; generation stopped at the bounded stream buffer"), s;
|
|
291
299
|
a++, o += t.length, i = i.then(() => {
|
|
@@ -324,7 +332,7 @@ var S = /* @__PURE__ */ e({
|
|
|
324
332
|
cancel: () => p(!1)
|
|
325
333
|
};
|
|
326
334
|
};
|
|
327
|
-
function
|
|
335
|
+
function I() {
|
|
328
336
|
let e = globalThis.fetch.bind(globalThis);
|
|
329
337
|
r.fetch = async (t, n) => {
|
|
330
338
|
let r = new URL(String(t));
|
|
@@ -334,8 +342,8 @@ function N() {
|
|
|
334
342
|
return i;
|
|
335
343
|
};
|
|
336
344
|
}
|
|
337
|
-
|
|
338
|
-
var
|
|
345
|
+
I(), r.backends?.onnx?.wasm && (r.backends.onnx.wasm.numThreads = 1, r.backends.onnx.wasm.proxy = !1);
|
|
346
|
+
var L = async (e, n) => {
|
|
339
347
|
let { task: r, model: o, input: s, options: c = {} } = e;
|
|
340
348
|
if (!C.includes(r)) throw Error(`Invalid or unsupported task: ${r}. Supported tasks are: ${C.join(", ")}`);
|
|
341
349
|
let l = m(o), u = h(c.device), d = g(c.dtype), f = _(c.ondeviceOnly), p = v(s), b = {};
|
|
@@ -376,7 +384,7 @@ var P = async (e, n) => {
|
|
|
376
384
|
do_sample: b.do_sample ?? !1
|
|
377
385
|
};
|
|
378
386
|
for (let [t, n] of Object.entries(b)) t === "max_new_tokens" || t === "do_sample" || (e[t] = n);
|
|
379
|
-
let t = n && A.tokenizer ?
|
|
387
|
+
let t = n && A.tokenizer ? F(n, c) : null;
|
|
380
388
|
t && (e.streamer = new a(A.tokenizer, {
|
|
381
389
|
skip_prompt: !0,
|
|
382
390
|
skip_special_tokens: !0,
|
|
@@ -392,7 +400,7 @@ var P = async (e, n) => {
|
|
|
392
400
|
} finally {
|
|
393
401
|
await k.release();
|
|
394
402
|
}
|
|
395
|
-
},
|
|
403
|
+
}, R = async (e) => {
|
|
396
404
|
let { task: t, model: n } = e, r = m(n), a = h(e.device), o = g(e.dtype) ?? "q4f16", s = a ?? "wasm", c = x({
|
|
397
405
|
task: t,
|
|
398
406
|
modelId: n,
|
|
@@ -415,4 +423,4 @@ var P = async (e, n) => {
|
|
|
415
423
|
}), (e) => e.dispose?.())).release();
|
|
416
424
|
};
|
|
417
425
|
//#endregion
|
|
418
|
-
export {
|
|
426
|
+
export { D as a, E as c, k as i, R as l, A as n, O as o, j as r, S as s, M as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignalingClient.d.ts","sourceRoot":"","sources":["../../src/client/SignalingClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignalingClient.d.ts","sourceRoot":"","sources":["../../src/client/SignalingClient.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAgB,oBAAoB,EAAE,UAAU,EAAyB,YAAY,EAAE,MAAM,aAAa,CAAC;AAqBvH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA88BD,eAAO,MAAM,cAAc,GAAI,QAAQ,UAAU,KAAG,oBAwDnD,CAAC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
export interface LightPreloaderTarget {
|
|
2
|
+
model: string;
|
|
3
|
+
task: string;
|
|
4
|
+
dtype: string;
|
|
5
|
+
}
|
|
1
6
|
export interface LightPreloaderOptions {
|
|
2
7
|
/** Model id to keep warm. Defaults to the M2M100 translate model. */
|
|
3
8
|
model?: string;
|
|
4
9
|
task?: string;
|
|
5
10
|
dtype?: string;
|
|
11
|
+
/** Full list of models to keep warm; wins over `model`/`task`/`dtype`. */
|
|
12
|
+
targets?: LightPreloaderTarget[];
|
|
6
13
|
onPreloaded?: () => void;
|
|
7
14
|
}
|
|
8
15
|
export type PreloadFn = (request: {
|
|
@@ -15,10 +22,14 @@ export type IsPreloadedFn = (model: string) => boolean;
|
|
|
15
22
|
export declare const LIGHT_INFERENCE_TRANSLATE_MODEL = "Xenova/m2m100_418M";
|
|
16
23
|
export declare const LIGHT_INFERENCE_TRANSLATE_TASK = "translation";
|
|
17
24
|
export declare const LIGHT_INFERENCE_TRANSLATE_DTYPE = "q4f16";
|
|
25
|
+
/** Flaxia's default translate model, mirroring `LIGHT_INFERENCE_PLAMO_*`. */
|
|
26
|
+
export declare const LIGHT_INFERENCE_PLAMO_TRANSLATE_MODEL = "TeamFlaxia/plamo-3-translate-0.8b-onnx";
|
|
27
|
+
export declare const LIGHT_INFERENCE_PLAMO_TRANSLATE_TASK = "text-generation";
|
|
28
|
+
export declare const LIGHT_INFERENCE_PLAMO_TRANSLATE_DTYPE = "q4f16";
|
|
18
29
|
/**
|
|
19
30
|
* Light Inference idle preloader.
|
|
20
31
|
*
|
|
21
|
-
* Keeps
|
|
32
|
+
* Keeps the translate `ai-inference` models resident so a later `ondeviceOnly`
|
|
22
33
|
* task can serve instantly from this device. Runs only while the device is
|
|
23
34
|
* online and unconstrained (no low battery / Save-Data / slow-2g). Consent
|
|
24
35
|
* is Crowd's consent: when consent is anything other than `granted` the
|
|
@@ -33,9 +44,7 @@ export declare class LightPreloader {
|
|
|
33
44
|
private idleHandle;
|
|
34
45
|
private preloading;
|
|
35
46
|
private stopped;
|
|
36
|
-
private readonly
|
|
37
|
-
private readonly task;
|
|
38
|
-
private readonly dtype;
|
|
47
|
+
private readonly targets;
|
|
39
48
|
constructor(getConsentState: () => string, options?: LightPreloaderOptions, isPreloaded?: IsPreloadedFn, preload?: PreloadFn);
|
|
40
49
|
/** Schedule a preload at the next idle moment (no-op when already ready). */
|
|
41
50
|
start(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"light-preloader.d.ts","sourceRoot":"","sources":["../../src/client/light-preloader.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IACpC,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AACnG,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;AAEvD,0EAA0E;AAC1E,eAAO,MAAM,+BAA+B,uBAAuB,CAAC;AACpE,eAAO,MAAM,8BAA8B,gBAAgB,CAAC;AAC5D,eAAO,MAAM,+BAA+B,UAAU,CAAC;AAEvD;;;;;;;;GAQG;AACH,qBAAa,cAAc;
|
|
1
|
+
{"version":3,"file":"light-preloader.d.ts","sourceRoot":"","sources":["../../src/client/light-preloader.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AACnG,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;AAEvD,0EAA0E;AAC1E,eAAO,MAAM,+BAA+B,uBAAuB,CAAC;AACpE,eAAO,MAAM,8BAA8B,gBAAgB,CAAC;AAC5D,eAAO,MAAM,+BAA+B,UAAU,CAAC;AAEvD,6EAA6E;AAC7E,eAAO,MAAM,qCAAqC,2CAA2C,CAAC;AAC9F,eAAO,MAAM,oCAAoC,oBAAoB,CAAC;AACtE,eAAO,MAAM,qCAAqC,UAAU,CAAC;AAE7D;;;;;;;;GAQG;AACH,qBAAa,cAAc;IAQvB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAV1B,OAAO,CAAC,KAAK,CAA8C;IAC3D,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAG9B,eAAe,EAAE,MAAM,MAAM,EAC7B,OAAO,GAAE,qBAA0B,EACnC,WAAW,GAAE,aAA2B,EACxC,OAAO,GAAE,SAA0B;IAWtD,6EAA6E;IAC7E,KAAK,IAAI,IAAI;IAkBb,uEAAuE;IACvE,IAAI,IAAI,IAAI;IAUZ,OAAO,CAAC,eAAe;YAqBT,UAAU;CAqBzB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { getConsentState as getFlaxiaNodeConsentState } from './consent/storage'
|
|
|
3
3
|
export { initConsentIntegrity as initFlaxiaNodeConsent } from './consent/storage';
|
|
4
4
|
export { setHostManagedConsentAllowed as setFlaxiaNodeHostManagedConsent } from './consent/storage';
|
|
5
5
|
export { initFlaxiaNode };
|
|
6
|
-
export { LIGHT_INFERENCE_TRANSLATE_MODEL, } from './client/light-preloader';
|
|
7
|
-
export { isAiModelPreloaded, preloadAiModel, LIGHT_INFERENCE_TRANSLATE_MODEL as LIGHT_INFERENCE_TRANSLATE_MODEL_ID, LIGHT_INFERENCE_TRANSLATE_TASK, LIGHT_INFERENCE_TRANSLATE_DTYPE, } from './workloads/ai-inference';
|
|
6
|
+
export { LIGHT_INFERENCE_TRANSLATE_MODEL, LIGHT_INFERENCE_PLAMO_TRANSLATE_MODEL, LIGHT_INFERENCE_PLAMO_TRANSLATE_TASK, LIGHT_INFERENCE_PLAMO_TRANSLATE_DTYPE, } from './client/light-preloader';
|
|
7
|
+
export { isAiModelPreloaded, preloadAiModel, LIGHT_INFERENCE_TRANSLATE_MODEL as LIGHT_INFERENCE_TRANSLATE_MODEL_ID, LIGHT_INFERENCE_TRANSLATE_TASK, LIGHT_INFERENCE_TRANSLATE_DTYPE, LIGHT_INFERENCE_PLAMO_TRANSLATE_MODEL as LIGHT_INFERENCE_PLAMO_TRANSLATE_MODEL_ID, LIGHT_INFERENCE_PLAMO_TRANSLATE_TASK as LIGHT_INFERENCE_PLAMO_TRANSLATE_TASK_ID, LIGHT_INFERENCE_PLAMO_TRANSLATE_DTYPE as LIGHT_INFERENCE_PLAMO_TRANSLATE_DTYPE_ID, } from './workloads/ai-inference';
|
|
8
8
|
export type { ConsentControls, ConsentState, FlaxiaNodeController } from '@flaxia/sdk';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAO1D,OAAO,EAAE,eAAe,IAAI,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAGjF,OAAO,EAAE,oBAAoB,IAAI,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAIlF,OAAO,EAAE,4BAA4B,IAAI,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,OAAO,EACL,+BAA+B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAO1D,OAAO,EAAE,eAAe,IAAI,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAGjF,OAAO,EAAE,oBAAoB,IAAI,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAIlF,OAAO,EAAE,4BAA4B,IAAI,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,OAAO,EACL,+BAA+B,EAC/B,qCAAqC,EACrC,oCAAoC,EACpC,qCAAqC,GACtC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,+BAA+B,IAAI,kCAAkC,EACrE,8BAA8B,EAC9B,+BAA+B,EAC/B,qCAAqC,IAAI,wCAAwC,EACjF,oCAAoC,IAAI,uCAAuC,EAC/E,qCAAqC,IAAI,wCAAwC,GAClF,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as e, C as t, D as n, E as r, M as i, N as a, S as o, T as s, c, f as l, g as u, i as d, j as f, n as p, o as m, r as h, u as g, v as _, w as v } from "./assets/webgpuProbe.js";
|
|
2
2
|
import { t as ee } from "./assets/egress-guard.js";
|
|
3
|
-
import { a as y,
|
|
3
|
+
import { a as y, c as te, i as b, l as ne, n as re, o as ie, r as ae, t as oe } from "./assets/ai-inference.js";
|
|
4
4
|
//#region src/consent/notice.ts
|
|
5
5
|
var x = {
|
|
6
6
|
summary: "同意すると、このブラウザは第三者から依頼された処理をバックグラウンドで実行します。",
|
|
@@ -13,29 +13,29 @@ var x = {
|
|
|
13
13
|
acceptGateHint: "開示内容を確認できるよう、「同意して開始」はしばらくの間押せません。",
|
|
14
14
|
acceptLabel: "同意して開始",
|
|
15
15
|
rejectLabel: "拒否"
|
|
16
|
-
},
|
|
17
|
-
function
|
|
16
|
+
}, se = 4320 * 60 * 60 * 1e3, S = "flaxia_consent_record", ce = "flaxia_consent_granted", le = "flaxia_consent_expiry", C = "flaxia_consent_denied", ue = 1, de = 1e4, fe = 2e3, pe = "flaxia-consent-integrity", me = 1, w = "keys", he = "consent-hmac-sha256-v1", ge = (...e) => console.warn("[flaxia-node]", ...e), _e = /* @__PURE__ */ new Map();
|
|
17
|
+
function ve(e) {
|
|
18
18
|
try {
|
|
19
19
|
return localStorage.getItem(e);
|
|
20
20
|
} catch {
|
|
21
|
-
return
|
|
21
|
+
return _e.get(e) ?? null;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function ye(e, t) {
|
|
25
25
|
try {
|
|
26
26
|
localStorage.setItem(e, t);
|
|
27
27
|
} catch {
|
|
28
|
-
|
|
28
|
+
_e.set(e, t);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
function T(e) {
|
|
32
32
|
try {
|
|
33
33
|
localStorage.removeItem(e);
|
|
34
34
|
} catch {
|
|
35
|
-
|
|
35
|
+
_e.delete(e);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function be(e) {
|
|
39
39
|
return new Promise((t, n) => {
|
|
40
40
|
e.onsuccess = () => t(e.result), e.onerror = () => n(e.error ?? /* @__PURE__ */ Error("IndexedDB request failed"));
|
|
41
41
|
});
|
|
@@ -54,7 +54,7 @@ function E() {
|
|
|
54
54
|
}
|
|
55
55
|
let r;
|
|
56
56
|
try {
|
|
57
|
-
r = n.open(
|
|
57
|
+
r = n.open(pe, me);
|
|
58
58
|
} catch (e) {
|
|
59
59
|
t(e);
|
|
60
60
|
return;
|
|
@@ -65,17 +65,17 @@ function E() {
|
|
|
65
65
|
}, r.onsuccess = () => e(r.result), r.onerror = () => t(r.error ?? /* @__PURE__ */ Error("IndexedDB open failed")), r.onblocked = () => t(/* @__PURE__ */ Error("IndexedDB open blocked"));
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function xe(e) {
|
|
69
69
|
if (!e || typeof e != "object") return !1;
|
|
70
70
|
let t = e;
|
|
71
71
|
return t.type === "secret" && t.algorithm?.name === "HMAC";
|
|
72
72
|
}
|
|
73
|
-
var
|
|
73
|
+
var Se = {
|
|
74
74
|
async load() {
|
|
75
75
|
let e = await E();
|
|
76
76
|
try {
|
|
77
|
-
let t = await
|
|
78
|
-
return
|
|
77
|
+
let t = await be(e.transaction(w, "readonly").objectStore(w).get(he));
|
|
78
|
+
return xe(t) ? t : null;
|
|
79
79
|
} finally {
|
|
80
80
|
e.close();
|
|
81
81
|
}
|
|
@@ -84,7 +84,7 @@ var ye = {
|
|
|
84
84
|
let t = await E();
|
|
85
85
|
try {
|
|
86
86
|
let n = t.transaction(w, "readwrite");
|
|
87
|
-
n.objectStore(w).put(e,
|
|
87
|
+
n.objectStore(w).put(e, he), await new Promise((e, t) => {
|
|
88
88
|
n.oncomplete = () => e(), n.onerror = () => t(n.error ?? /* @__PURE__ */ Error("IndexedDB write failed")), n.onabort = () => t(n.error ?? /* @__PURE__ */ Error("IndexedDB write aborted"));
|
|
89
89
|
});
|
|
90
90
|
} finally {
|
|
@@ -95,7 +95,7 @@ var ye = {
|
|
|
95
95
|
let e = await E();
|
|
96
96
|
try {
|
|
97
97
|
let t = e.transaction(w, "readwrite");
|
|
98
|
-
t.objectStore(w).delete(
|
|
98
|
+
t.objectStore(w).delete(he), await new Promise((e, n) => {
|
|
99
99
|
t.oncomplete = () => e(), t.onerror = () => n(t.error ?? /* @__PURE__ */ Error("IndexedDB delete failed")), t.onabort = () => n(t.error ?? /* @__PURE__ */ Error("IndexedDB delete aborted"));
|
|
100
100
|
});
|
|
101
101
|
} finally {
|
|
@@ -103,7 +103,7 @@ var ye = {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
|
-
function
|
|
106
|
+
function Ce(e, t, n) {
|
|
107
107
|
return new Promise((r) => {
|
|
108
108
|
let i = !1, a, o = (e) => {
|
|
109
109
|
i || (i = !0, a !== void 0 && clearTimeout(a), r(e));
|
|
@@ -111,15 +111,15 @@ function be(e, t, n) {
|
|
|
111
111
|
a = setTimeout(() => o(t), n), e.then((e) => o(e), () => o(t));
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
var
|
|
115
|
-
function
|
|
114
|
+
var we = Se, D = null, O = null, k = !1, A = !1, j = null, M = 0, N = 0, P = null, Te = !1;
|
|
115
|
+
function Ee() {
|
|
116
116
|
try {
|
|
117
117
|
let e = globalThis.location?.origin;
|
|
118
118
|
if (typeof e == "string" && e.length > 0) return e;
|
|
119
119
|
} catch {}
|
|
120
120
|
return "unknown";
|
|
121
121
|
}
|
|
122
|
-
var
|
|
122
|
+
var De = Ee, Oe = () => De(), ke = {
|
|
123
123
|
name: "HMAC",
|
|
124
124
|
hash: "SHA-256"
|
|
125
125
|
};
|
|
@@ -130,7 +130,7 @@ function F() {
|
|
|
130
130
|
} catch {}
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Ae(e) {
|
|
134
134
|
let t = new TextEncoder().encode(JSON.stringify([
|
|
135
135
|
e.v,
|
|
136
136
|
e.noticeVersion,
|
|
@@ -140,12 +140,12 @@ function De(e) {
|
|
|
140
140
|
])), n = new Uint8Array(t.byteLength);
|
|
141
141
|
return n.set(t), n;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function je(e) {
|
|
144
144
|
let t = "";
|
|
145
145
|
for (let n of e) t += String.fromCharCode(n);
|
|
146
146
|
return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function Me(e) {
|
|
149
149
|
try {
|
|
150
150
|
let t = e.replace(/-/g, "+").replace(/_/g, "/"), n = t + "=".repeat((4 - t.length % 4) % 4), r = atob(n), i = new Uint8Array(r.length);
|
|
151
151
|
for (let e = 0; e < r.length; e += 1) i[e] = r.charCodeAt(e);
|
|
@@ -154,40 +154,40 @@ function ke(e) {
|
|
|
154
154
|
return null;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
async function
|
|
158
|
-
let e = await
|
|
157
|
+
async function Ne() {
|
|
158
|
+
let e = await Ce(we.load(), null, fe);
|
|
159
159
|
if (e) return e;
|
|
160
160
|
let t = F();
|
|
161
161
|
if (!t) return null;
|
|
162
162
|
try {
|
|
163
|
-
let e = await t.generateKey(
|
|
164
|
-
return await
|
|
163
|
+
let e = await t.generateKey(ke, !1, ["sign", "verify"]);
|
|
164
|
+
return await Ce(we.save(e), void 0, fe), e;
|
|
165
165
|
} catch {
|
|
166
166
|
return null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
async function
|
|
169
|
+
async function Pe(e) {
|
|
170
170
|
let t = F();
|
|
171
171
|
if (!t || !D) return null;
|
|
172
172
|
try {
|
|
173
|
-
let n = await t.sign("HMAC", D,
|
|
174
|
-
return
|
|
173
|
+
let n = await t.sign("HMAC", D, Ae(e));
|
|
174
|
+
return je(new Uint8Array(n));
|
|
175
175
|
} catch {
|
|
176
176
|
return null;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
async function
|
|
179
|
+
async function Fe(e) {
|
|
180
180
|
let t = F();
|
|
181
181
|
if (!t || !D || !e.mac) return !1;
|
|
182
|
-
let n =
|
|
182
|
+
let n = Me(e.mac);
|
|
183
183
|
if (!n) return !1;
|
|
184
184
|
try {
|
|
185
|
-
return await t.verify("HMAC", D, n,
|
|
185
|
+
return await t.verify("HMAC", D, n, Ae(e));
|
|
186
186
|
} catch {
|
|
187
187
|
return !1;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function Ie(e) {
|
|
191
191
|
if (!e) return null;
|
|
192
192
|
try {
|
|
193
193
|
let t = JSON.parse(e);
|
|
@@ -205,73 +205,73 @@ function Ne(e) {
|
|
|
205
205
|
return null;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function Le(e, t) {
|
|
209
209
|
return !(!Number.isFinite(e.grantedAt) || !Number.isFinite(e.expiry) || e.expiry <= t || e.grantedAt > e.expiry || e.expiry - e.grantedAt > 15552e6);
|
|
210
210
|
}
|
|
211
211
|
function I(e) {
|
|
212
|
-
return e.v ===
|
|
212
|
+
return e.v === ue && e.noticeVersion === 2 && e.origin === Oe();
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
return
|
|
214
|
+
function Re() {
|
|
215
|
+
return Ie(ve(S));
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
217
|
+
function ze(e) {
|
|
218
|
+
ye(S, JSON.stringify(e));
|
|
219
219
|
}
|
|
220
220
|
function L() {
|
|
221
221
|
T(S);
|
|
222
222
|
}
|
|
223
223
|
function R() {
|
|
224
|
-
T(
|
|
224
|
+
T(ce), T(le);
|
|
225
225
|
}
|
|
226
|
-
var
|
|
226
|
+
var Be = () => {
|
|
227
227
|
let e = O;
|
|
228
|
-
return !e || !k ? !1 :
|
|
229
|
-
},
|
|
230
|
-
async function
|
|
228
|
+
return !e || !k ? !1 : Le(e, Date.now()) && I(e);
|
|
229
|
+
}, Ve = () => ve(C) === "true", z = () => Be() ? "granted" : Ve() ? "denied" : "unset", B = () => (j ||= He(), j);
|
|
230
|
+
async function He() {
|
|
231
231
|
let e = ++M, t = N, n = null;
|
|
232
232
|
try {
|
|
233
|
-
n = await
|
|
233
|
+
n = await Ne();
|
|
234
234
|
} catch {
|
|
235
235
|
n = null;
|
|
236
236
|
}
|
|
237
237
|
if (e !== M) return z();
|
|
238
238
|
D = n, R();
|
|
239
|
-
let r =
|
|
240
|
-
return r !== null && await
|
|
239
|
+
let r = Re();
|
|
240
|
+
return r !== null && await Fe(r) && Le(r, Date.now()) && I(r) && r ? t === N && e === M && (O = r, k = !0) : r && !A && (L(), t === N && e === M && (O = null, k = !1)), z();
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function Ue() {
|
|
243
243
|
let e = P;
|
|
244
|
-
return P = null, e && Date.now() - e.at <=
|
|
244
|
+
return P = null, e && Date.now() - e.at <= de ? {
|
|
245
245
|
noticeVersion: e.noticeVersion,
|
|
246
246
|
source: "user-gesture"
|
|
247
|
-
} :
|
|
247
|
+
} : Te ? {
|
|
248
248
|
noticeVersion: 2,
|
|
249
249
|
source: "host-managed"
|
|
250
250
|
} : null;
|
|
251
251
|
}
|
|
252
|
-
function
|
|
253
|
-
return typeof e != "number" || !Number.isFinite(e) || e <= 0 ?
|
|
252
|
+
function We(e) {
|
|
253
|
+
return typeof e != "number" || !Number.isFinite(e) || e <= 0 ? se : Math.min(Math.floor(e), se);
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function Ge(e, t) {
|
|
256
256
|
let n = Date.now();
|
|
257
257
|
return {
|
|
258
|
-
v:
|
|
258
|
+
v: ue,
|
|
259
259
|
noticeVersion: e,
|
|
260
|
-
origin:
|
|
260
|
+
origin: Oe(),
|
|
261
261
|
grantedAt: n,
|
|
262
|
-
expiry: n +
|
|
262
|
+
expiry: n + We(t),
|
|
263
263
|
mac: ""
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function Ke(e, t) {
|
|
267
267
|
T(C), R();
|
|
268
|
-
let n =
|
|
269
|
-
return O = n, k = !0, A = !0, N += 1,
|
|
268
|
+
let n = Ge(e.noticeVersion, t);
|
|
269
|
+
return O = n, k = !0, A = !0, N += 1, ze(n), n;
|
|
270
270
|
}
|
|
271
|
-
async function
|
|
271
|
+
async function qe(e) {
|
|
272
272
|
try {
|
|
273
273
|
if (await B(), O !== e) return;
|
|
274
|
-
let t = await
|
|
274
|
+
let t = await Pe(e);
|
|
275
275
|
if (O !== e) return;
|
|
276
276
|
if (!t) {
|
|
277
277
|
L(), A = !1;
|
|
@@ -281,32 +281,32 @@ async function We(e) {
|
|
|
281
281
|
...e,
|
|
282
282
|
mac: t
|
|
283
283
|
};
|
|
284
|
-
O = n, k = !0,
|
|
284
|
+
O = n, k = !0, ze(n), A = !1;
|
|
285
285
|
} catch {
|
|
286
286
|
O === e && (L(), A = !1);
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
var
|
|
290
|
-
let e =
|
|
289
|
+
var Je = () => {
|
|
290
|
+
let e = Ue();
|
|
291
291
|
if (!e) {
|
|
292
|
-
|
|
292
|
+
ge("refusing programmatic consent grant: consent requires the built-in banner to be rendered and accepted by the visitor (see setHostManagedConsentAllowed for host-managed UIs)");
|
|
293
293
|
return;
|
|
294
294
|
}
|
|
295
|
-
|
|
296
|
-
},
|
|
295
|
+
qe(Ke(e));
|
|
296
|
+
}, Ye = (e = 2) => {
|
|
297
297
|
P = {
|
|
298
298
|
noticeVersion: e,
|
|
299
299
|
at: Date.now()
|
|
300
300
|
};
|
|
301
|
-
},
|
|
302
|
-
|
|
303
|
-
},
|
|
304
|
-
L(), R(), O = null, k = !1, A = !1, N += 1,
|
|
305
|
-
},
|
|
306
|
-
L(), R(), T(C), O = null, k = !1, A = !1, P = null, D = null, M += 1, N += 1, j = null,
|
|
307
|
-
},
|
|
308
|
-
async function
|
|
309
|
-
let e = N, t =
|
|
301
|
+
}, Xe = (e) => {
|
|
302
|
+
Te = e === !0;
|
|
303
|
+
}, Ze = () => {
|
|
304
|
+
L(), R(), O = null, k = !1, A = !1, N += 1, ye(C, "true");
|
|
305
|
+
}, Qe = () => {
|
|
306
|
+
L(), R(), T(C), O = null, k = !1, A = !1, P = null, D = null, M += 1, N += 1, j = null, Ce(we.clear(), void 0, fe);
|
|
307
|
+
}, $e = ve, et = ye, V = T;
|
|
308
|
+
async function tt() {
|
|
309
|
+
let e = N, t = Re();
|
|
310
310
|
if (!t) {
|
|
311
311
|
O = null, k = !1;
|
|
312
312
|
return;
|
|
@@ -316,17 +316,17 @@ async function Qe() {
|
|
|
316
316
|
j = null, await B();
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
let n = await
|
|
319
|
+
let n = await Fe(t), r = Re();
|
|
320
320
|
if (e !== N || !r || JSON.stringify(r) !== JSON.stringify(t)) return;
|
|
321
|
-
let i = n &&
|
|
321
|
+
let i = n && Le(t, Date.now()) && I(t);
|
|
322
322
|
O = i ? t : null, k = i;
|
|
323
323
|
}
|
|
324
324
|
try {
|
|
325
325
|
typeof globalThis.addEventListener == "function" && globalThis.addEventListener("storage", (e) => {
|
|
326
|
-
e.key !== null && e.key !== S && e.key !== C || (N += 1,
|
|
326
|
+
e.key !== null && e.key !== S && e.key !== C || (N += 1, tt());
|
|
327
327
|
});
|
|
328
328
|
} catch {}
|
|
329
|
-
var
|
|
329
|
+
var nt = () => {
|
|
330
330
|
try {
|
|
331
331
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function") return crypto.randomUUID();
|
|
332
332
|
} catch {}
|
|
@@ -338,35 +338,35 @@ var $e = () => {
|
|
|
338
338
|
B();
|
|
339
339
|
//#endregion
|
|
340
340
|
//#region src/consent/ConsentUI.ts
|
|
341
|
-
var H = "#6366f1",
|
|
341
|
+
var H = "#6366f1", rt = 1500, it = 1500, at = 6e4, ot = 80, st = 40, ct = [
|
|
342
342
|
"bottom-right",
|
|
343
343
|
"bottom-left",
|
|
344
344
|
"top-right",
|
|
345
345
|
"top-left"
|
|
346
|
-
],
|
|
347
|
-
function
|
|
346
|
+
], lt = /^#[0-9a-f]{3}$/i, ut = /^#[0-9a-f]{6}$/i, dt = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i, ft = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i, pt = new Map((/* @__PURE__ */ "black.white.red.green.blue.indigo.violet.purple.teal.cyan.orange.pink.brown.gray.grey.slate.navy.maroon.olive.gold.crimson.tomato.salmon.coral.seagreen.steelblue.royalblue.dodgerblue.mediumseagreen.mediumpurple.rebeccapurple".split(".")).map((e) => [e, e]));
|
|
347
|
+
function mt(e) {
|
|
348
348
|
if (typeof e != "string") return H;
|
|
349
349
|
let t = e.trim();
|
|
350
350
|
if (t.length === 0 || t.length > 64) return H;
|
|
351
|
-
if (
|
|
352
|
-
let n =
|
|
351
|
+
if (lt.test(t) || ut.test(t)) return t.toLowerCase();
|
|
352
|
+
let n = dt.exec(t);
|
|
353
353
|
if (n) {
|
|
354
354
|
let [e, t, r] = n.slice(1).map(Number);
|
|
355
355
|
return e <= 255 && t <= 255 && r <= 255 ? `rgb(${e}, ${t}, ${r})` : H;
|
|
356
356
|
}
|
|
357
|
-
let r =
|
|
357
|
+
let r = ft.exec(t);
|
|
358
358
|
if (r) {
|
|
359
359
|
let [e, t, n] = r.slice(1, 4).map(Number), i = Number(r[4]);
|
|
360
360
|
return e <= 255 && t <= 255 && n <= 255 && i >= 0 && i <= 1 ? `rgba(${e}, ${t}, ${n}, ${i})` : H;
|
|
361
361
|
}
|
|
362
|
-
return
|
|
362
|
+
return pt.get(t.toLowerCase()) ?? H;
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function ht(e, t, n) {
|
|
365
365
|
if (typeof e != "string") return t;
|
|
366
366
|
let r = e.replace(/[\u0000-\u001f\u007f-\u009f\u200b-\u200f\u202a-\u202e\u2066-\u2069]/g, "").replace(/\s+/g, " ").trim();
|
|
367
367
|
return r.length === 0 ? t : r.length > n ? `${r.slice(0, n)}…` : r;
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function gt(e) {
|
|
370
370
|
if (typeof e != "string" || e.trim().length === 0) return null;
|
|
371
371
|
try {
|
|
372
372
|
let t = new URL(e.trim());
|
|
@@ -375,33 +375,33 @@ function pt(e) {
|
|
|
375
375
|
return null;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function _t(e) {
|
|
379
379
|
return {
|
|
380
|
-
brandName:
|
|
381
|
-
position:
|
|
382
|
-
accentColor:
|
|
383
|
-
acceptLabel:
|
|
384
|
-
rejectLabel:
|
|
385
|
-
privacyPolicyUrl:
|
|
386
|
-
minVisibleMs:
|
|
380
|
+
brandName: ht(e?.brandName, "Flaxia Crowd", ot),
|
|
381
|
+
position: ct.includes(e?.position) ? e.position : "bottom-right",
|
|
382
|
+
accentColor: mt(e?.accentColor),
|
|
383
|
+
acceptLabel: ht(e?.acceptLabel, x.acceptLabel, st),
|
|
384
|
+
rejectLabel: ht(e?.rejectLabel, x.rejectLabel, st),
|
|
385
|
+
privacyPolicyUrl: gt(e?.privacyPolicyUrl),
|
|
386
|
+
minVisibleMs: vt(e?.minVisibleMs)
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
return typeof e != "number" || !Number.isFinite(e) ?
|
|
389
|
+
function vt(e) {
|
|
390
|
+
return typeof e != "number" || !Number.isFinite(e) ? rt : Math.min(Math.max(Math.floor(e), it), at);
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
return typeof t.minVisibleMs == "number" && Number.isFinite(t.minVisibleMs) ? Math.min(Math.max(Math.floor(t.minVisibleMs), 0),
|
|
392
|
+
function yt(e, t) {
|
|
393
|
+
return typeof t.minVisibleMs == "number" && Number.isFinite(t.minVisibleMs) ? Math.min(Math.max(Math.floor(t.minVisibleMs), 0), at) : e;
|
|
394
394
|
}
|
|
395
|
-
var
|
|
395
|
+
var bt = "\n .overlay {\n position: fixed;\n __flaxia_position__;\n padding: 20px;\n background: #fff;\n color: #1f2937;\n border: 1px solid #ccc;\n box-shadow: 0 4px 6px rgba(0,0,0,0.1);\n z-index: 9999;\n border-radius: 8px;\n max-width: 300px;\n font-family: sans-serif;\n }\n .overlay h3 {\n margin: 0 0 8px;\n color: #111827;\n font-size: 16px;\n }\n .overlay p {\n margin: 0 0 12px;\n color: #4b5563;\n font-size: 14px;\n line-height: 1.4;\n }\n .overlay ul {\n margin: 0 0 12px;\n padding-left: 18px;\n color: #4b5563;\n font-size: 13px;\n line-height: 1.45;\n }\n .overlay li {\n margin-bottom: 6px;\n }\n .overlay .hint {\n margin: 0 0 8px;\n color: #6b7280;\n font-size: 12px;\n }\n .overlay .privacy {\n margin: 0 0 8px;\n font-size: 12px;\n }\n .overlay .privacy a {\n color: __flaxia_accent__;\n }\n button {\n background: __flaxia_accent__;\n color: white;\n border: none;\n padding: 10px 15px;\n border-radius: 4px;\n cursor: pointer;\n margin-top: 10px;\n width: 100%;\n font-size: 14px;\n }\n button:disabled {\n opacity: 0.6;\n cursor: default;\n }\n button.reject {\n background: transparent;\n color: #4b5563;\n border: 1px solid #ccc;\n }\n @media (prefers-color-scheme: dark) {\n .overlay {\n background: #1f2937;\n color: #f9fafb;\n border-color: #374151;\n box-shadow: 0 4px 6px rgba(0,0,0,0.4);\n }\n .overlay h3 {\n color: #f9fafb;\n }\n .overlay p,\n .overlay ul {\n color: #d1d5db;\n }\n .overlay .hint {\n color: #9ca3af;\n }\n button.reject {\n color: #d1d5db;\n border-color: #4b5563;\n }\n }\n", xt = class {
|
|
396
396
|
constructor(e, t, n, r, i) {
|
|
397
|
-
this.config =
|
|
397
|
+
this.config = _t(t), this.options = i ?? {}, this.root = e.attachShadow({ mode: "closed" }), this.render(n, r);
|
|
398
398
|
}
|
|
399
399
|
shadowRootForTesting() {
|
|
400
400
|
return this.root;
|
|
401
401
|
}
|
|
402
402
|
render(e, t) {
|
|
403
403
|
let { brandName: n, position: r, accentColor: i, acceptLabel: a, rejectLabel: o, privacyPolicyUrl: s } = this.config, [c, l] = r.split("-"), u = document.createElement("style");
|
|
404
|
-
u.textContent =
|
|
404
|
+
u.textContent = bt.replace(/__flaxia_accent__/g, i).replace("__flaxia_position__", `${c}: 20px; ${l}: 20px`);
|
|
405
405
|
let d = document.createElement("div");
|
|
406
406
|
d.className = "overlay", d.setAttribute("role", "dialog"), d.setAttribute("aria-labelledby", "flaxia-consent-title");
|
|
407
407
|
let f = document.createElement("h3");
|
|
@@ -425,7 +425,7 @@ var _t = "\n .overlay {\n position: fixed;\n __flaxia_position__;\n pa
|
|
|
425
425
|
g.id = "consent-btn", g.type = "button", g.textContent = a;
|
|
426
426
|
let _ = document.createElement("button");
|
|
427
427
|
_.id = "reject-btn", _.type = "button", _.className = "reject", _.textContent = o;
|
|
428
|
-
let v = this.options.now ?? (() => Date.now()), ee = this.options.schedule ?? ((e, t) => void setTimeout(e, t)), y =
|
|
428
|
+
let v = this.options.now ?? (() => Date.now()), ee = this.options.schedule ?? ((e, t) => void setTimeout(e, t)), y = yt(this.config.minVisibleMs, this.options), te = v() + y, b = y <= 0, ne = !1;
|
|
429
429
|
b || (g.disabled = !0, g.setAttribute("aria-disabled", "true"), ee(() => {
|
|
430
430
|
b = !0, g.disabled = !1, g.removeAttribute("aria-disabled"), h.remove();
|
|
431
431
|
}, y));
|
|
@@ -433,12 +433,12 @@ var _t = "\n .overlay {\n position: fixed;\n __flaxia_position__;\n pa
|
|
|
433
433
|
ne || (ne = !0, d.remove(), e?.());
|
|
434
434
|
};
|
|
435
435
|
g.addEventListener("click", () => {
|
|
436
|
-
!b || v() < te || (
|
|
436
|
+
!b || v() < te || (Ye(2), re(e));
|
|
437
437
|
}), _.addEventListener("click", () => {
|
|
438
438
|
re(t);
|
|
439
439
|
}), b || d.appendChild(h), d.append(g, _), this.root.append(u, d);
|
|
440
440
|
}
|
|
441
|
-
}, U = (...e) => console.log("[flaxia-node]", ...e),
|
|
441
|
+
}, U = (...e) => console.log("[flaxia-node]", ...e), St = class e {
|
|
442
442
|
static {
|
|
443
443
|
this.MAX_PENDING_CONTROLS = 64;
|
|
444
444
|
}
|
|
@@ -620,7 +620,7 @@ var _t = "\n .overlay {\n position: fixed;\n __flaxia_position__;\n pa
|
|
|
620
620
|
let e = this._modelCacheSnapshot;
|
|
621
621
|
return !e || e.expiresAt <= Date.now() ? null : e;
|
|
622
622
|
}
|
|
623
|
-
}, W = null,
|
|
623
|
+
}, W = null, Ct = null;
|
|
624
624
|
function G(e, t, n, r, i, a) {
|
|
625
625
|
return {
|
|
626
626
|
value: e,
|
|
@@ -634,13 +634,13 @@ function G(e, t, n, r, i, a) {
|
|
|
634
634
|
function K(e, t, n) {
|
|
635
635
|
return G(null, e, "unknown", t, t + n, 0);
|
|
636
636
|
}
|
|
637
|
-
async function
|
|
638
|
-
return e ? ((!W || W.expiresAt <= t) && (
|
|
639
|
-
|
|
640
|
-
}), W = await
|
|
637
|
+
async function wt(e, t) {
|
|
638
|
+
return e ? ((!W || W.expiresAt <= t) && (Ct ||= p().then((e) => (W = e, e)).finally(() => {
|
|
639
|
+
Ct = null;
|
|
640
|
+
}), W = await Ct), W) : null;
|
|
641
641
|
}
|
|
642
|
-
async function
|
|
643
|
-
let t = e.now ?? Date.now(), n = t + _, r = d(), i = r.bytes !== null && r.sampledAt !== null && t - r.sampledAt <= 864e5, a = Number.isFinite(e.deviceMemory) && e.deviceMemory > 0 && e.deviceMemory <= 1024, o = await
|
|
642
|
+
async function Tt(e) {
|
|
643
|
+
let t = e.now ?? Date.now(), n = t + _, r = d(), i = r.bytes !== null && r.sampledAt !== null && t - r.sampledAt <= 864e5, a = Number.isFinite(e.deviceMemory) && e.deviceMemory > 0 && e.deviceMemory <= 1024, o = await wt(e.probeGpu === !0, t), s = o?.sampledAt ?? t, c = o?.expiresAt ?? t + 6e5;
|
|
644
644
|
return {
|
|
645
645
|
version: 1,
|
|
646
646
|
sampledAt: t,
|
|
@@ -661,8 +661,8 @@ async function St(e) {
|
|
|
661
661
|
}
|
|
662
662
|
//#endregion
|
|
663
663
|
//#region src/swarm/peer-quality.ts
|
|
664
|
-
var
|
|
665
|
-
function
|
|
664
|
+
var Et = 15e3;
|
|
665
|
+
function Dt(e) {
|
|
666
666
|
let t = e.filter((e) => Number.isFinite(e) && e >= 0).slice(-5);
|
|
667
667
|
if (!t.length) return [];
|
|
668
668
|
let n = [...t].sort((e, t) => e - t), r = n[Math.floor(n.length / 2)], i = r + Math.max(20, r * 4);
|
|
@@ -671,8 +671,8 @@ function wt(e) {
|
|
|
671
671
|
function q(e, t) {
|
|
672
672
|
return !Number.isFinite(e) || e < 0 || !Number.isFinite(t) || t <= 0 ? null : e * 8 / t / 1e3;
|
|
673
673
|
}
|
|
674
|
-
function
|
|
675
|
-
let n =
|
|
674
|
+
function Ot(e, t) {
|
|
675
|
+
let n = Dt(e);
|
|
676
676
|
if (!n.length) return {
|
|
677
677
|
value: null,
|
|
678
678
|
sampledAt: t,
|
|
@@ -685,11 +685,11 @@ function Tt(e, t) {
|
|
|
685
685
|
sampleCount: n.length
|
|
686
686
|
};
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function kt(e, t, n, r, i) {
|
|
689
689
|
let o = (e, n) => {
|
|
690
690
|
let r = (r) => {
|
|
691
691
|
let i = n?.[r] ?? t;
|
|
692
|
-
return t - i >= 6e4 ?
|
|
692
|
+
return t - i >= 6e4 ? Ot([], t) : Ot(e[r] ?? [], i);
|
|
693
693
|
};
|
|
694
694
|
return {
|
|
695
695
|
rttMs: r("rttMs"),
|
|
@@ -709,8 +709,8 @@ function Et(e, t, n, r, i) {
|
|
|
709
709
|
}
|
|
710
710
|
//#endregion
|
|
711
711
|
//#region src/swarm/peer-transport.ts
|
|
712
|
-
var
|
|
713
|
-
function
|
|
712
|
+
var At = 5e3, J = 16 * 1024, jt = g, Mt = 256 * 1024, Nt = 1129860166, Y = 16, Pt = 2, Ft = 64, It = "flaxia-swarm-v1", Lt = "flaxia-peer-quality-v1", Rt = 128, zt = [{ urls: "stun:stun.cloudflare.com:3478" }];
|
|
713
|
+
function Bt() {
|
|
714
714
|
return {
|
|
715
715
|
rttMs: [],
|
|
716
716
|
jitterMs: [],
|
|
@@ -718,12 +718,12 @@ function Lt() {
|
|
|
718
718
|
receiveMbps: []
|
|
719
719
|
};
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function Vt(e) {
|
|
722
722
|
if (e.byteLength < Y || e.byteLength > 16400) return null;
|
|
723
723
|
let t = new DataView(e);
|
|
724
|
-
if (t.getUint32(0, !0) !==
|
|
724
|
+
if (t.getUint32(0, !0) !== Nt) return null;
|
|
725
725
|
let n = t.getUint32(4, !0), r = t.getUint16(8, !0), i = t.getUint16(10, !0), a = t.getUint32(12, !0);
|
|
726
|
-
if (a < 1 || a >
|
|
726
|
+
if (a < 1 || a > jt || i < 1 || i !== Math.ceil(a / 16384) || r >= i) return null;
|
|
727
727
|
let o = Math.min(J, a - r * J);
|
|
728
728
|
return e.byteLength - Y === o ? {
|
|
729
729
|
messageId: n,
|
|
@@ -733,26 +733,26 @@ function Rt(e) {
|
|
|
733
733
|
payload: new Uint8Array(e, Y)
|
|
734
734
|
} : null;
|
|
735
735
|
}
|
|
736
|
-
function
|
|
737
|
-
if (e.byteLength < 1 || e.byteLength >
|
|
736
|
+
function Ht(e, t) {
|
|
737
|
+
if (e.byteLength < 1 || e.byteLength > jt) throw Error(`swarm peer frame size is outside 1..${jt} bytes`);
|
|
738
738
|
let n = Math.ceil(e.byteLength / J), r = [];
|
|
739
739
|
for (let i = 0; i < n; i++) {
|
|
740
740
|
let a = i * J, o = Math.min(a + J, e.byteLength), s = new Uint8Array(e, a, o - a), c = new ArrayBuffer(Y + s.byteLength), l = new DataView(c);
|
|
741
|
-
l.setUint32(0,
|
|
741
|
+
l.setUint32(0, Nt, !0), l.setUint32(4, t >>> 0, !0), l.setUint16(8, i, !0), l.setUint16(10, n, !0), l.setUint32(12, e.byteLength, !0), new Uint8Array(c, Y).set(s), r.push(c);
|
|
742
742
|
}
|
|
743
743
|
return r;
|
|
744
744
|
}
|
|
745
|
-
var
|
|
745
|
+
var Ut = class {
|
|
746
746
|
constructor() {
|
|
747
747
|
this.assemblies = /* @__PURE__ */ new Map();
|
|
748
748
|
}
|
|
749
749
|
accept(e, t = Date.now()) {
|
|
750
750
|
this.expire(t);
|
|
751
|
-
let n =
|
|
751
|
+
let n = Vt(e);
|
|
752
752
|
if (!n) return null;
|
|
753
753
|
let r = this.assemblies.get(n.messageId);
|
|
754
754
|
if (!r) {
|
|
755
|
-
if (this.assemblies.size >=
|
|
755
|
+
if (this.assemblies.size >= Pt) return null;
|
|
756
756
|
r = {
|
|
757
757
|
count: n.count,
|
|
758
758
|
totalBytes: n.totalBytes,
|
|
@@ -782,9 +782,9 @@ var Bt = class {
|
|
|
782
782
|
expire(e) {
|
|
783
783
|
for (let [t, n] of this.assemblies) e - n.createdAt > 5e3 * 2 && this.assemblies.delete(t);
|
|
784
784
|
}
|
|
785
|
-
},
|
|
785
|
+
}, Wt = class {
|
|
786
786
|
constructor(e) {
|
|
787
|
-
this.options = e, this.peers = /* @__PURE__ */ new Map(), this.reassembler = new
|
|
787
|
+
this.options = e, this.peers = /* @__PURE__ */ new Map(), this.reassembler = new Ut(), this.nextMessageId = 1, this.mode = "undecided", this.closed = !1, this.failed = !1, this.readyPromise = null, this.readyResolve = null, this.readyTimer = null, this.qualityTimer = null, this.samplingQuality = !1;
|
|
788
788
|
}
|
|
789
789
|
get selectedMode() {
|
|
790
790
|
return this.mode;
|
|
@@ -798,15 +798,15 @@ var Bt = class {
|
|
|
798
798
|
let e = [...new Set([this.options.previousNodeId, this.options.nextNodeId])].filter((e) => !!e && e !== this.options.nodeId);
|
|
799
799
|
try {
|
|
800
800
|
for (let t of e) {
|
|
801
|
-
let e = (this.options.createPeerConnection ?? ((e) => new RTCPeerConnection(e)))({ iceServers:
|
|
801
|
+
let e = (this.options.createPeerConnection ?? ((e) => new RTCPeerConnection(e)))({ iceServers: zt }), n = {
|
|
802
802
|
nodeId: t,
|
|
803
803
|
connection: e,
|
|
804
804
|
channel: null,
|
|
805
805
|
remoteDescriptionSet: !1,
|
|
806
806
|
pendingCandidates: [],
|
|
807
807
|
quality: {
|
|
808
|
-
webRtc:
|
|
809
|
-
application:
|
|
808
|
+
webRtc: Bt(),
|
|
809
|
+
application: Bt()
|
|
810
810
|
},
|
|
811
811
|
qualitySampledAt: {
|
|
812
812
|
webRtc: {},
|
|
@@ -836,7 +836,7 @@ var Bt = class {
|
|
|
836
836
|
for (let e of this.peers.values()) {
|
|
837
837
|
let { nodeId: t, connection: n } = e;
|
|
838
838
|
if (this.options.nodeId.localeCompare(t) < 0) {
|
|
839
|
-
this.bindChannel(e, n.createDataChannel(
|
|
839
|
+
this.bindChannel(e, n.createDataChannel(It, { ordered: !0 }));
|
|
840
840
|
let r = await n.createOffer();
|
|
841
841
|
if (this.closed || this.failed) return;
|
|
842
842
|
await n.setLocalDescription(r);
|
|
@@ -878,7 +878,7 @@ var Bt = class {
|
|
|
878
878
|
}
|
|
879
879
|
} else if (t.candidate !== null) if (n.remoteDescriptionSet) await n.connection.addIceCandidate(t.candidate);
|
|
880
880
|
else {
|
|
881
|
-
if (n.pendingCandidates.length >=
|
|
881
|
+
if (n.pendingCandidates.length >= Ft) throw Error("too many ICE candidates before remote description");
|
|
882
882
|
n.pendingCandidates.push(t.candidate);
|
|
883
883
|
}
|
|
884
884
|
} catch (e) {
|
|
@@ -908,7 +908,7 @@ var Bt = class {
|
|
|
908
908
|
}
|
|
909
909
|
let r = this.nextMessageId++ >>> 0;
|
|
910
910
|
try {
|
|
911
|
-
for (let t of
|
|
911
|
+
for (let t of Ht(e, r)) {
|
|
912
912
|
if (await this.waitForBuffer(n), n.readyState !== "open") throw Error("swarm peer data channel closed while sending");
|
|
913
913
|
n.send(t);
|
|
914
914
|
}
|
|
@@ -929,7 +929,7 @@ var Bt = class {
|
|
|
929
929
|
} catch {}
|
|
930
930
|
return;
|
|
931
931
|
}
|
|
932
|
-
e.channel = t, t.binaryType = "arraybuffer", t.bufferedAmountLowThreshold =
|
|
932
|
+
e.channel = t, t.binaryType = "arraybuffer", t.bufferedAmountLowThreshold = Mt / 2, t.onopen = () => this.resolveReadyIfOpen(), t.onmessage = (t) => {
|
|
933
933
|
if (typeof t.data == "string") {
|
|
934
934
|
this.handleQualityProbe(e, t.data);
|
|
935
935
|
return;
|
|
@@ -955,7 +955,7 @@ var Bt = class {
|
|
|
955
955
|
}
|
|
956
956
|
async waitForBuffer(e) {
|
|
957
957
|
e.bufferedAmount <= 262144 || await new Promise((t, n) => {
|
|
958
|
-
let r = setTimeout(() => i(/* @__PURE__ */ Error("swarm peer send buffer stalled")),
|
|
958
|
+
let r = setTimeout(() => i(/* @__PURE__ */ Error("swarm peer send buffer stalled")), At), i = (i) => {
|
|
959
959
|
clearTimeout(r), e.removeEventListener("bufferedamountlow", a), e.removeEventListener("close", o), i ? n(i) : t();
|
|
960
960
|
}, a = () => i(), o = () => i(/* @__PURE__ */ Error("swarm peer data channel closed while backpressured"));
|
|
961
961
|
e.addEventListener("bufferedamountlow", a, { once: !0 }), e.addEventListener("close", o, { once: !0 });
|
|
@@ -967,7 +967,7 @@ var Bt = class {
|
|
|
967
967
|
this.peers.clear();
|
|
968
968
|
}
|
|
969
969
|
startQualitySampling() {
|
|
970
|
-
this.qualityTimer || !this.options.onQuality || (this.samplePeerQuality(), this.qualityTimer = setInterval(() => void this.samplePeerQuality(),
|
|
970
|
+
this.qualityTimer || !this.options.onQuality || (this.samplePeerQuality(), this.qualityTimer = setInterval(() => void this.samplePeerQuality(), Et));
|
|
971
971
|
}
|
|
972
972
|
stopQualitySampling() {
|
|
973
973
|
this.qualityTimer && clearInterval(this.qualityTimer), this.qualityTimer = null;
|
|
@@ -994,7 +994,7 @@ var Bt = class {
|
|
|
994
994
|
};
|
|
995
995
|
try {
|
|
996
996
|
t.send(JSON.stringify({
|
|
997
|
-
type:
|
|
997
|
+
type: Lt,
|
|
998
998
|
kind: "ping",
|
|
999
999
|
id: n
|
|
1000
1000
|
}));
|
|
@@ -1003,7 +1003,7 @@ var Bt = class {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|
|
1005
1005
|
handleQualityProbe(e, t) {
|
|
1006
|
-
if (t.length >
|
|
1006
|
+
if (t.length > Rt) return;
|
|
1007
1007
|
let n;
|
|
1008
1008
|
try {
|
|
1009
1009
|
let e = JSON.parse(t);
|
|
@@ -1012,12 +1012,12 @@ var Bt = class {
|
|
|
1012
1012
|
} catch {
|
|
1013
1013
|
return;
|
|
1014
1014
|
}
|
|
1015
|
-
if (n.type !==
|
|
1015
|
+
if (n.type !== Lt || !Number.isSafeInteger(n.id) || n.id < 1) return;
|
|
1016
1016
|
if (n.kind === "ping") {
|
|
1017
1017
|
if (e.channel?.readyState !== "open" || e.channel.bufferedAmount > 262144) return;
|
|
1018
1018
|
try {
|
|
1019
1019
|
e.channel.send(JSON.stringify({
|
|
1020
|
-
type:
|
|
1020
|
+
type: Lt,
|
|
1021
1021
|
kind: "pong",
|
|
1022
1022
|
id: n.id
|
|
1023
1023
|
}));
|
|
@@ -1043,7 +1043,7 @@ var Bt = class {
|
|
|
1043
1043
|
let e = r - n.lastApplicationSampleAt, t = q(n.applicationBytesSent - n.lastApplicationBytesSent, e), i = q(n.applicationBytesReceived - n.lastApplicationBytesReceived, e);
|
|
1044
1044
|
t !== null && this.recordQuality(n, "application", "sendMbps", t), i !== null && this.recordQuality(n, "application", "receiveMbps", i);
|
|
1045
1045
|
}
|
|
1046
|
-
n.lastApplicationSampleAt = r, n.lastApplicationBytesSent = n.applicationBytesSent, n.lastApplicationBytesReceived = n.applicationBytesReceived, t.push(
|
|
1046
|
+
n.lastApplicationSampleAt = r, n.lastApplicationBytesSent = n.applicationBytesSent, n.lastApplicationBytesReceived = n.applicationBytesReceived, t.push(kt(n.nodeId, e, n.quality.webRtc, n.quality.application, n.qualitySampledAt));
|
|
1047
1047
|
}
|
|
1048
1048
|
t.length && this.options.onQuality(t.slice(0, 2));
|
|
1049
1049
|
} finally {
|
|
@@ -1080,30 +1080,34 @@ var Bt = class {
|
|
|
1080
1080
|
} catch {}
|
|
1081
1081
|
}
|
|
1082
1082
|
};
|
|
1083
|
-
function
|
|
1083
|
+
function Gt(e, t) {
|
|
1084
1084
|
if (!n(e)) return !1;
|
|
1085
1085
|
let r = e;
|
|
1086
1086
|
return r.type === "swarm-peer-signal" && r.taskId === t.taskId && r.sessionId === t.sessionId && r.attemptId === t.attemptId && r.toNodeId === t.nodeId && typeof r.fromNodeId == "string" && t.peers.includes(r.fromNodeId) && typeof r.signal == "object" && r.signal !== null;
|
|
1087
1087
|
}
|
|
1088
1088
|
//#endregion
|
|
1089
1089
|
//#region src/client/mobile-lifecycle.ts
|
|
1090
|
-
var
|
|
1091
|
-
function
|
|
1092
|
-
let n = e.batteryCharging === !1, r = n && typeof e.batteryLevel == "number" && e.batteryLevel <=
|
|
1090
|
+
var Kt = .25, qt = .08, Jt = .45;
|
|
1091
|
+
function Yt(e, t) {
|
|
1092
|
+
let n = e.batteryCharging === !1, r = n && typeof e.batteryLevel == "number" && e.batteryLevel <= Kt, i = n && typeof e.batteryLevel == "number" && e.batteryLevel <= qt, a = e.effectiveType === "slow-2g" || e.effectiveType === "2g", o = r || a || e.saveData === !0;
|
|
1093
1093
|
return {
|
|
1094
1094
|
suspend: e.hidden || e.pageHidden || !e.online || i,
|
|
1095
1095
|
constrained: o,
|
|
1096
|
-
maxCpuLoad: o ? Math.min(t ??
|
|
1096
|
+
maxCpuLoad: o ? Math.min(t ?? Jt, Jt) : t
|
|
1097
1097
|
};
|
|
1098
1098
|
}
|
|
1099
1099
|
//#endregion
|
|
1100
1100
|
//#region src/client/light-preloader.ts
|
|
1101
|
-
var
|
|
1101
|
+
var Xt = "Xenova/m2m100_418M", Zt = "translation", Qt = "q4f16", $t = "TeamFlaxia/plamo-3-translate-0.8b-onnx", en = "text-generation", tn = "q4f16", nn = class {
|
|
1102
1102
|
constructor(e, t = {}, n = () => !1, r = async () => {}) {
|
|
1103
|
-
this.getConsentState = e, this.options = t, this.isPreloaded = n, this.preload = r, this.timer = null, this.idleHandle = null, this.preloading = !1, this.stopped = !1, this.
|
|
1103
|
+
this.getConsentState = e, this.options = t, this.isPreloaded = n, this.preload = r, this.timer = null, this.idleHandle = null, this.preloading = !1, this.stopped = !1, this.targets = t.targets ?? [{
|
|
1104
|
+
model: t.model ?? "Xenova/m2m100_418M",
|
|
1105
|
+
task: t.task ?? "translation",
|
|
1106
|
+
dtype: t.dtype ?? "q4f16"
|
|
1107
|
+
}];
|
|
1104
1108
|
}
|
|
1105
1109
|
start() {
|
|
1106
|
-
if (this.stopped || this.getConsentState() !== "granted" || this.isUnconstrained() === !1 || this.
|
|
1110
|
+
if (this.stopped || this.getConsentState() !== "granted" || this.isUnconstrained() === !1 || !this.targets.some((e) => !this.isPreloaded(e.model)) || this.preloading) return;
|
|
1107
1111
|
let e = () => {
|
|
1108
1112
|
this.idleHandle = null, this.preloadNow();
|
|
1109
1113
|
};
|
|
@@ -1114,7 +1118,7 @@ var qt = "Xenova/m2m100_418M", Jt = class {
|
|
|
1114
1118
|
}
|
|
1115
1119
|
isUnconstrained() {
|
|
1116
1120
|
try {
|
|
1117
|
-
let e = navigator, t =
|
|
1121
|
+
let e = navigator, t = Yt({
|
|
1118
1122
|
hidden: document.hidden,
|
|
1119
1123
|
pageHidden: document.hidden,
|
|
1120
1124
|
online: navigator.onLine !== !1,
|
|
@@ -1127,15 +1131,20 @@ var qt = "Xenova/m2m100_418M", Jt = class {
|
|
|
1127
1131
|
}
|
|
1128
1132
|
}
|
|
1129
1133
|
async preloadNow() {
|
|
1130
|
-
if (!(this.stopped || this.preloading) && this.getConsentState() === "granted" && this.isUnconstrained() !== !1
|
|
1134
|
+
if (!(this.stopped || this.preloading) && this.getConsentState() === "granted" && this.isUnconstrained() !== !1) {
|
|
1131
1135
|
this.preloading = !0;
|
|
1132
1136
|
try {
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1137
|
+
for (let e of this.targets) {
|
|
1138
|
+
if (this.stopped || this.getConsentState() !== "granted") return;
|
|
1139
|
+
if (!this.isPreloaded(e.model)) try {
|
|
1140
|
+
await this.preload({
|
|
1141
|
+
task: e.task,
|
|
1142
|
+
model: e.model,
|
|
1143
|
+
dtype: e.dtype
|
|
1144
|
+
}), this.options.onPreloaded?.();
|
|
1145
|
+
} catch {}
|
|
1146
|
+
}
|
|
1147
|
+
} finally {
|
|
1139
1148
|
this.preloading = !1;
|
|
1140
1149
|
}
|
|
1141
1150
|
}
|
|
@@ -1150,7 +1159,7 @@ function Q(e) {
|
|
|
1150
1159
|
} catch {}
|
|
1151
1160
|
return [...t];
|
|
1152
1161
|
}
|
|
1153
|
-
var
|
|
1162
|
+
var rn = "flaxia_node_id", an = "flaxia_node_token", on = class {
|
|
1154
1163
|
receiveSwarmEnvelope(e) {
|
|
1155
1164
|
let t = f(e);
|
|
1156
1165
|
!t || ![...this.swarmSessions.values()].includes(t.sessionId) || (this.swarmInboundChain = this.swarmInboundChain.then(async () => {
|
|
@@ -1174,7 +1183,7 @@ var Yt = "flaxia_node_id", Xt = "flaxia_node_token", Zt = class {
|
|
|
1174
1183
|
attemptId: r,
|
|
1175
1184
|
peers: o
|
|
1176
1185
|
});
|
|
1177
|
-
let s = new
|
|
1186
|
+
let s = new Wt({
|
|
1178
1187
|
sessionId: t,
|
|
1179
1188
|
taskId: n,
|
|
1180
1189
|
attemptId: r,
|
|
@@ -1211,7 +1220,7 @@ var Yt = "flaxia_node_id", Xt = "flaxia_node_token", Zt = class {
|
|
|
1211
1220
|
}
|
|
1212
1221
|
handleSwarmPeerSignal(e) {
|
|
1213
1222
|
let t = typeof e.sessionId == "string" ? e.sessionId : "", n = this.swarmPeerMetadata.get(t), r = this.swarmPeerTransports.get(t);
|
|
1214
|
-
!n || !r || !
|
|
1223
|
+
!n || !r || !Gt(e, {
|
|
1215
1224
|
...n,
|
|
1216
1225
|
sessionId: t,
|
|
1217
1226
|
nodeId: this.nodeId
|
|
@@ -1353,7 +1362,7 @@ var Yt = "flaxia_node_id", Xt = "flaxia_node_token", Zt = class {
|
|
|
1353
1362
|
}
|
|
1354
1363
|
async sendHeartbeat(e) {
|
|
1355
1364
|
if (this.ws !== e || e.readyState !== WebSocket.OPEN || z() !== "granted") return;
|
|
1356
|
-
let t = (this.config.capabilities ?? ["ai-inference", "image-process"]).includes("swarm-inference") && this.config.allowModelDownload === !0, n = navigator.deviceMemory, r = await
|
|
1365
|
+
let t = (this.config.capabilities ?? ["ai-inference", "image-process"]).includes("swarm-inference") && this.config.allowModelDownload === !0, n = navigator.deviceMemory, r = await Tt({
|
|
1357
1366
|
cpuLoad: this.workerPool.hasCpuLoadSample ? this.workerPool.lastCpuLoad : null,
|
|
1358
1367
|
deviceMemory: n,
|
|
1359
1368
|
probeGpu: t
|
|
@@ -1380,7 +1389,7 @@ var Yt = "flaxia_node_id", Xt = "flaxia_node_token", Zt = class {
|
|
|
1380
1389
|
for (let e of this.swarmPeerTransports.values()) e.close();
|
|
1381
1390
|
this.swarmPeerTransports.clear(), this.swarmPeerMetadata.clear();
|
|
1382
1391
|
try {
|
|
1383
|
-
delete window[
|
|
1392
|
+
delete window[sn];
|
|
1384
1393
|
} catch {}
|
|
1385
1394
|
try {
|
|
1386
1395
|
this.workerPool.terminate();
|
|
@@ -1411,7 +1420,7 @@ var Yt = "flaxia_node_id", Xt = "flaxia_node_token", Zt = class {
|
|
|
1411
1420
|
Q(this.config.containerImageOrigins).length === 0 && (i = i.filter((e) => e !== "container"));
|
|
1412
1421
|
let a;
|
|
1413
1422
|
if (n && r.includes("swarm-inference") && this.config.allowModelDownload === !0) {
|
|
1414
|
-
let t = await
|
|
1423
|
+
let t = await Tt({
|
|
1415
1424
|
cpuLoad: this.workerPool.hasCpuLoadSample ? this.workerPool.lastCpuLoad : null,
|
|
1416
1425
|
deviceMemory: navigator.deviceMemory,
|
|
1417
1426
|
probeGpu: !0
|
|
@@ -1574,7 +1583,18 @@ var Yt = "flaxia_node_id", Xt = "flaxia_node_token", Zt = class {
|
|
|
1574
1583
|
await this.workerPool.run(t, "ai-preload", e, 3e5, void 0, { maxCpuLoad: this.effectiveMaxCpuLoad() });
|
|
1575
1584
|
}
|
|
1576
1585
|
startLightPreloader() {
|
|
1577
|
-
this.lightPreloader && this.lightPreloader.stop(), this.lightPreloader = new
|
|
1586
|
+
this.lightPreloader && this.lightPreloader.stop(), this.lightPreloader = new nn(() => z(), {
|
|
1587
|
+
targets: [{
|
|
1588
|
+
model: Xt,
|
|
1589
|
+
task: Zt,
|
|
1590
|
+
dtype: Qt
|
|
1591
|
+
}, {
|
|
1592
|
+
model: $t,
|
|
1593
|
+
task: en,
|
|
1594
|
+
dtype: tn
|
|
1595
|
+
}],
|
|
1596
|
+
onPreloaded: () => {}
|
|
1597
|
+
}, (e) => this.isAiModelPreloaded(e), (e) => this.preloadAiModel(e)), this.lightPreloader.start();
|
|
1578
1598
|
}
|
|
1579
1599
|
stopLightPreloader() {
|
|
1580
1600
|
this.lightPreloader && this.lightPreloader.stop(), this.lightPreloader = null;
|
|
@@ -1613,7 +1633,7 @@ var Yt = "flaxia_node_id", Xt = "flaxia_node_token", Zt = class {
|
|
|
1613
1633
|
this.batteryState = null, this.networkState = null;
|
|
1614
1634
|
}
|
|
1615
1635
|
mobileLifecycleDecision() {
|
|
1616
|
-
return
|
|
1636
|
+
return Yt({
|
|
1617
1637
|
hidden: document.hidden,
|
|
1618
1638
|
pageHidden: this.lifecyclePageHidden,
|
|
1619
1639
|
online: !this.lifecycleOffline && navigator.onLine !== !1,
|
|
@@ -1629,27 +1649,27 @@ var Yt = "flaxia_node_id", Xt = "flaxia_node_token", Zt = class {
|
|
|
1629
1649
|
refreshMobileLifecycle() {
|
|
1630
1650
|
this.mobileLifecycleDecision().suspend ? this.suspend() : this.suspended && this.resume();
|
|
1631
1651
|
}
|
|
1632
|
-
}, $ = "__flaxia_node_signal_client",
|
|
1652
|
+
}, $ = "__flaxia_node_signal_client", sn = "__flaxia_node_init_started", cn = "__flaxia_node_controller", ln = (e) => {
|
|
1633
1653
|
if (z() !== "granted") {
|
|
1634
1654
|
Z("refusing to start the node without a granted consent record");
|
|
1635
1655
|
return;
|
|
1636
1656
|
}
|
|
1637
1657
|
let t = window[$];
|
|
1638
|
-
t && t.disconnect(), V(
|
|
1639
|
-
let n = new URL("./worker.js", "" + import.meta.url).href, r = new
|
|
1640
|
-
i || (i =
|
|
1641
|
-
let a = new
|
|
1658
|
+
t && t.disconnect(), V(an);
|
|
1659
|
+
let n = new URL("./worker.js", "" + import.meta.url).href, r = new St(n), i = $e(rn);
|
|
1660
|
+
i || (i = nt(), et(rn, i));
|
|
1661
|
+
let a = new on(e, r, i);
|
|
1642
1662
|
window[$] = a, a.connect();
|
|
1643
|
-
},
|
|
1663
|
+
}, un = class {
|
|
1644
1664
|
constructor(e) {
|
|
1645
1665
|
this.config = e;
|
|
1646
1666
|
}
|
|
1647
1667
|
start() {
|
|
1648
|
-
this.isRunning() || !
|
|
1668
|
+
this.isRunning() || !Be() || ln(this.config);
|
|
1649
1669
|
}
|
|
1650
1670
|
stop() {
|
|
1651
1671
|
let e = window[$];
|
|
1652
|
-
e && e.disconnect(), delete window[$], delete window[
|
|
1672
|
+
e && e.disconnect(), delete window[$], delete window[sn];
|
|
1653
1673
|
}
|
|
1654
1674
|
isRunning() {
|
|
1655
1675
|
return !!window[$];
|
|
@@ -1658,13 +1678,13 @@ var Yt = "flaxia_node_id", Xt = "flaxia_node_token", Zt = class {
|
|
|
1658
1678
|
return z();
|
|
1659
1679
|
}
|
|
1660
1680
|
grant() {
|
|
1661
|
-
|
|
1681
|
+
Je();
|
|
1662
1682
|
}
|
|
1663
1683
|
deny() {
|
|
1664
|
-
|
|
1684
|
+
Ze(), this.stop(), V(an);
|
|
1665
1685
|
}
|
|
1666
1686
|
clearConsent() {
|
|
1667
|
-
|
|
1687
|
+
Qe(), this.stop(), V(an);
|
|
1668
1688
|
}
|
|
1669
1689
|
async runLocalAiInference(e, t) {
|
|
1670
1690
|
let n = window[$];
|
|
@@ -1680,29 +1700,29 @@ var Yt = "flaxia_node_id", Xt = "flaxia_node_token", Zt = class {
|
|
|
1680
1700
|
if (!t) throw new r("No running Crowd node on this device", "node_not_running");
|
|
1681
1701
|
await t.preloadAiModel(e);
|
|
1682
1702
|
}
|
|
1683
|
-
},
|
|
1684
|
-
let t = window[
|
|
1703
|
+
}, dn = (e) => {
|
|
1704
|
+
let t = window[cn];
|
|
1685
1705
|
if (t) return t;
|
|
1686
|
-
let n = new
|
|
1687
|
-
window[
|
|
1706
|
+
let n = new un(e);
|
|
1707
|
+
window[cn] = n, window[sn] = !0;
|
|
1688
1708
|
let r = z();
|
|
1689
1709
|
if (r === "granted") return n.start(), n;
|
|
1690
1710
|
if (r === "denied") return n;
|
|
1691
1711
|
if (e.consent.onConsentRequired) return e.consent.onConsentRequired({
|
|
1692
1712
|
state: r,
|
|
1693
1713
|
accept: () => {
|
|
1694
|
-
|
|
1714
|
+
Je(), n.start();
|
|
1695
1715
|
},
|
|
1696
1716
|
reject: () => {
|
|
1697
|
-
|
|
1717
|
+
Ze();
|
|
1698
1718
|
}
|
|
1699
1719
|
}), n;
|
|
1700
1720
|
let i = document.createElement("div");
|
|
1701
|
-
return i.id = "flaxia-consent-container", document.body.appendChild(i), new
|
|
1702
|
-
|
|
1721
|
+
return i.id = "flaxia-consent-container", document.body.appendChild(i), new xt(i, e.consent, () => {
|
|
1722
|
+
Je(), i.remove(), n.start();
|
|
1703
1723
|
}, () => {
|
|
1704
|
-
|
|
1724
|
+
Ze(), i.remove();
|
|
1705
1725
|
}), n;
|
|
1706
1726
|
};
|
|
1707
1727
|
//#endregion
|
|
1708
|
-
export { re as LIGHT_INFERENCE_TRANSLATE_DTYPE,
|
|
1728
|
+
export { tn as LIGHT_INFERENCE_PLAMO_TRANSLATE_DTYPE, oe as LIGHT_INFERENCE_PLAMO_TRANSLATE_DTYPE_ID, $t as LIGHT_INFERENCE_PLAMO_TRANSLATE_MODEL, re as LIGHT_INFERENCE_PLAMO_TRANSLATE_MODEL_ID, en as LIGHT_INFERENCE_PLAMO_TRANSLATE_TASK, ae as LIGHT_INFERENCE_PLAMO_TRANSLATE_TASK_ID, b as LIGHT_INFERENCE_TRANSLATE_DTYPE, Xt as LIGHT_INFERENCE_TRANSLATE_MODEL, y as LIGHT_INFERENCE_TRANSLATE_MODEL_ID, ie as LIGHT_INFERENCE_TRANSLATE_TASK, z as getFlaxiaNodeConsentState, dn as initFlaxiaNode, B as initFlaxiaNodeConsent, te as isAiModelPreloaded, ne as preloadAiModel, Xe as setFlaxiaNodeHostManagedConsent };
|
package/dist/worker.js
CHANGED
|
@@ -707,10 +707,10 @@ function Te() {
|
|
|
707
707
|
async function Ee(e, t, n, r) {
|
|
708
708
|
switch (e) {
|
|
709
709
|
case "ai-inference":
|
|
710
|
-
let i = await import("./assets/ai-inference.js").then((e) => e.
|
|
710
|
+
let i = await import("./assets/ai-inference.js").then((e) => e.s);
|
|
711
711
|
return X.set(e, i.releaseCache), Z.set(e, i.getModelCacheSnapshot), await i.handleAiInference(t, n);
|
|
712
712
|
case "ai-preload": {
|
|
713
|
-
let e = await import("./assets/ai-inference.js").then((e) => e.
|
|
713
|
+
let e = await import("./assets/ai-inference.js").then((e) => e.s);
|
|
714
714
|
X.set("ai-inference", e.releaseCache), Z.set("ai-inference", e.getModelCacheSnapshot);
|
|
715
715
|
let n = t;
|
|
716
716
|
return await e.preloadAiModel(n), { preloaded: !0 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-model-registry.test.d.ts","sourceRoot":"","sources":["../../../src/workloads/__tests__/ai-model-registry.test.ts"],"names":[],"mappings":""}
|
|
@@ -14,6 +14,15 @@ export declare const isAiModelPreloaded: (model: string) => boolean;
|
|
|
14
14
|
export declare const LIGHT_INFERENCE_TRANSLATE_MODEL = "Xenova/m2m100_418M";
|
|
15
15
|
export declare const LIGHT_INFERENCE_TRANSLATE_TASK = "translation";
|
|
16
16
|
export declare const LIGHT_INFERENCE_TRANSLATE_DTYPE = "q4f16";
|
|
17
|
+
/**
|
|
18
|
+
* Flaxia's default translate model. PLaMO 3 Translate 0.8B is a decoder-only
|
|
19
|
+
* text-generation model, so its Light Inference task is `text-generation`,
|
|
20
|
+
* not `translation`. Kept warm alongside M2M100 so the default en↔ja pairs
|
|
21
|
+
* serve instantly on device instead of answering ONDEVICE_UNAVAILABLE.
|
|
22
|
+
*/
|
|
23
|
+
export declare const LIGHT_INFERENCE_PLAMO_TRANSLATE_MODEL = "TeamFlaxia/plamo-3-translate-0.8b-onnx";
|
|
24
|
+
export declare const LIGHT_INFERENCE_PLAMO_TRANSLATE_TASK = "text-generation";
|
|
25
|
+
export declare const LIGHT_INFERENCE_PLAMO_TRANSLATE_DTYPE = "q4f16";
|
|
17
26
|
/**
|
|
18
27
|
* Drops all cached model pipelines so the (potentially hundreds of MB of)
|
|
19
28
|
* transformers/onnxruntime memory can be garbage-collected. Called by the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-inference.d.ts","sourceRoot":"","sources":["../../src/workloads/ai-inference.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAsB,MAAM,aAAa,CAAC;AAC7F,OAAO,KAAK,EAAqB,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAgB7E,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAa7B,wEAAwE;AACxE,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,uBAAuB,QAAa,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,OAKlD,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,+BAA+B,uBAAuB,CAAC;AACpE,eAAO,MAAM,8BAA8B,gBAAgB,CAAC;AAC5D,eAAO,MAAM,+BAA+B,UAAU,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,YAAY,QAAO,IAE/B,CAAC;AAEF,4GAA4G;AAC5G,eAAO,MAAM,qBAAqB,QAAO,sBAAqD,CAAC;AAkH/F,eAAO,MAAM,iBAAiB,GAC5B,SAAS,kBAAkB,EAC3B,UAAU,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAChD,OAAO,CAAC,iBAAiB,CAwH3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAU,SAAS;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,KAAG,OAAO,CAAC,IAAI,CA6Bf,CAAC"}
|
|
1
|
+
{"version":3,"file":"ai-inference.d.ts","sourceRoot":"","sources":["../../src/workloads/ai-inference.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAsB,MAAM,aAAa,CAAC;AAC7F,OAAO,KAAK,EAAqB,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAgB7E,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAa7B,wEAAwE;AACxE,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,uBAAuB,QAAa,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,OAKlD,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,+BAA+B,uBAAuB,CAAC;AACpE,eAAO,MAAM,8BAA8B,gBAAgB,CAAC;AAC5D,eAAO,MAAM,+BAA+B,UAAU,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC,2CAA2C,CAAC;AAC9F,eAAO,MAAM,oCAAoC,oBAAoB,CAAC;AACtE,eAAO,MAAM,qCAAqC,UAAU,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,YAAY,QAAO,IAE/B,CAAC;AAEF,4GAA4G;AAC5G,eAAO,MAAM,qBAAqB,QAAO,sBAAqD,CAAC;AAkH/F,eAAO,MAAM,iBAAiB,GAC5B,SAAS,kBAAkB,EAC3B,UAAU,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAChD,OAAO,CAAC,iBAAiB,CAwH3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAU,SAAS;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,KAAG,OAAO,CAAC,IAAI,CA6Bf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-model-registry.d.ts","sourceRoot":"","sources":["../../src/workloads/ai-model-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,iBAAiB;IAChC,0FAA0F;IAC1F,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,QAAoB,CAAC;AAC5D,kDAAkD;AAClD,eAAO,MAAM,sBAAsB,QAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ai-model-registry.d.ts","sourceRoot":"","sources":["../../src/workloads/ai-model-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,iBAAiB;IAChC,0FAA0F;IAC1F,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,QAAoB,CAAC;AAC5D,kDAAkD;AAClD,eAAO,MAAM,sBAAsB,QAAgB,CAAC;AA0CpD,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,oCAAqC,CAAC;AACrE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,iDAAkD,CAAC;AACjF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAWhE,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,SAAU,CAAC;AAC1C,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,IAAI,CAkBrF;AAED,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAElD;AAED,sEAAsE;AACtE,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,CAWhE;AAED,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CAQ5E;AAED,6DAA6D;AAC7D,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS,CAQzE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAM3D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,CAsB/D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI,CAyBN"}
|