@raphy-js/raph 1.0.0-dev.2 → 1.0.1-dev.20
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/README.md +1096 -0
- package/dist/api/Raph.d.ts +59 -190
- package/dist/api/RaphFacadeSession.d.ts +90 -0
- package/dist/api/RaphReactivityInstance.d.ts +72 -0
- package/dist/api/errors.d.ts +9 -4
- package/dist/api/types.d.ts +162 -17
- package/dist/core-CyilRD7s.js +1055 -0
- package/dist/core-ugchZNqC.cjs +1 -0
- package/dist/debug/api/Raph.cjs +1 -1
- package/dist/debug/api/Raph.js +368 -366
- package/dist/debug/api/RaphFacadeSession.cjs +1 -0
- package/dist/debug/api/RaphFacadeSession.js +306 -0
- package/dist/debug/api/RaphReactivityInstance.cjs +1 -0
- package/dist/debug/api/RaphReactivityInstance.js +149 -0
- package/dist/debug/api/errors.cjs +1 -1
- package/dist/debug/api/errors.js +10 -7
- package/dist/debug/path/DataPath.cjs +1 -0
- package/dist/debug/path/{data-path.js → DataPath.js} +151 -180
- package/dist/debug/path/PathRouter.cjs +1 -0
- package/dist/debug/path/{path-router.js → PathRouter.js} +1 -1
- package/dist/debug/path/RaphKernel.cjs +1 -1
- package/dist/debug/path/RaphKernel.js +258 -207
- package/dist/debug/path/data-path.utils.cjs +1 -0
- package/dist/debug/path/data-path.utils.js +56 -0
- package/dist/debug/path/derived/DerivedRegistry.cjs +1 -0
- package/dist/debug/path/{DerivedRegistry.js → derived/DerivedRegistry.js} +5 -5
- package/dist/debug/path/derived/derived-collection.utils.cjs +1 -0
- package/dist/debug/path/{derived-collection.js → derived/derived-collection.utils.js} +1 -1
- package/dist/debug/path/derived/derived-strategy.types.cjs +1 -0
- package/dist/debug/path/derived/derived-strategy.types.js +1 -0
- package/dist/debug/path/{MetaController.cjs → meta/MetaController.cjs} +1 -1
- package/dist/debug/path/{MetaController.js → meta/MetaController.js} +3 -3
- package/dist/debug/path/meta/RaphMetaStore.cjs +1 -0
- package/dist/debug/path/{RaphMetaStore.js → meta/RaphMetaStore.js} +1 -1
- package/dist/debug/path/meta/meta.types.cjs +1 -0
- package/dist/debug/path/meta/meta.types.js +1 -0
- package/dist/debug/path/storage/AdapterPathStore.cjs +1 -0
- package/dist/debug/path/{AdapterPathStore.js → storage/AdapterPathStore.js} +9 -9
- package/dist/debug/path/storage/DefaultDataAdapter.cjs +1 -0
- package/dist/debug/path/{data-adapter.js → storage/DefaultDataAdapter.js} +2 -2
- package/dist/debug/path/storage/PathEventHub.cjs +1 -0
- package/dist/debug/path/{PathEventHub.js → storage/PathEventHub.js} +34 -34
- package/dist/debug/path/storage/PathStore.cjs +1 -0
- package/dist/debug/path/{PathStore.js → storage/PathStore.js} +28 -28
- package/dist/debug/path/storage/data-adapter.types.cjs +1 -0
- package/dist/debug/path/storage/data-adapter.types.js +1 -0
- package/dist/debug/reactivity/engine.cjs +1 -1
- package/dist/debug/reactivity/engine.js +478 -306
- package/dist/debug/reactivity/reactive-object.cjs +1 -0
- package/dist/debug/reactivity/reactive-object.js +280 -0
- package/dist/debug/runtime/RaphRuntime.cjs +1 -1
- package/dist/debug/runtime/RaphRuntime.js +798 -519
- package/dist/debug/runtime/diagnostics/RaphDebug.cjs +1 -0
- package/dist/debug/runtime/diagnostics/RaphDebug.js +297 -0
- package/dist/debug/runtime/errors.cjs +1 -1
- package/dist/debug/runtime/errors.js +6 -3
- package/dist/debug/runtime/ownership/RaphEffectScope.cjs +1 -0
- package/dist/debug/runtime/ownership/RaphEffectScope.js +171 -0
- package/dist/debug/runtime/ownership/RaphNode.cjs +1 -0
- package/dist/debug/runtime/ownership/RaphNode.js +206 -0
- package/dist/debug/runtime/ownership/RaphScope.cjs +1 -0
- package/dist/debug/runtime/ownership/RaphScope.js +101 -0
- package/dist/debug/runtime/ownership/parent-graph.types.cjs +1 -0
- package/dist/debug/runtime/ownership/parent-graph.types.js +1 -0
- package/dist/debug/runtime/phases/RaphPhasePipeline.cjs +1 -0
- package/dist/debug/runtime/phases/RaphPhasePipeline.js +587 -0
- package/dist/debug/runtime/phases/orderPhaseTasks.cjs +1 -0
- package/dist/debug/runtime/phases/orderPhaseTasks.js +59 -0
- package/dist/debug/runtime/reactivity/PathHandle.cjs +1 -0
- package/dist/debug/runtime/{PathHandle.js → reactivity/PathHandle.js} +75 -39
- package/dist/debug/runtime/reactivity/RaphMetaSource.cjs +1 -0
- package/dist/debug/runtime/reactivity/RaphMetaSource.js +112 -0
- package/dist/debug/runtime/reactivity/RaphWorkGraph.cjs +1 -0
- package/dist/debug/runtime/reactivity/RaphWorkGraph.js +995 -0
- package/dist/debug/runtime/reactivity/RuntimeReactivity.cjs +1 -0
- package/dist/debug/runtime/reactivity/RuntimeReactivity.js +156 -0
- package/dist/debug/runtime/reactivity/RuntimeWatch.cjs +1 -0
- package/dist/debug/runtime/reactivity/RuntimeWatch.js +88 -0
- package/dist/debug/runtime/reactivity/runtime-reactivity.types.cjs +1 -0
- package/dist/debug/runtime/reactivity/runtime-reactivity.types.js +1 -0
- package/dist/entrypoints/machine-testing.d.ts +2 -0
- package/dist/entrypoints/machine.d.ts +5 -0
- package/dist/entrypoints/path.d.ts +14 -0
- package/dist/entrypoints/reactivity.d.ts +1 -0
- package/dist/entrypoints/runtime.d.ts +17 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +46 -38
- package/dist/machine/compiler.d.ts +71 -0
- package/dist/machine/core.d.ts +50 -0
- package/dist/machine/persistence.d.ts +5 -0
- package/dist/machine/runtime.d.ts +4 -0
- package/dist/machine/testing.d.ts +43 -0
- package/dist/machine/types.d.ts +155 -0
- package/dist/machine-testing.cjs +1 -0
- package/dist/machine-testing.js +188 -0
- package/dist/machine.cjs +1 -0
- package/dist/machine.js +837 -0
- package/dist/main.d.ts +20 -0
- package/dist/path/{data-path.d.ts → DataPath.d.ts} +16 -40
- package/dist/path/{path-router.d.ts → PathRouter.d.ts} +1 -1
- package/dist/path/RaphKernel.d.ts +13 -10
- package/dist/path/data-path.types.d.ts +34 -0
- package/dist/path/data-path.utils.d.ts +9 -0
- package/dist/path/{DerivedRegistry.d.ts → derived/DerivedRegistry.d.ts} +2 -2
- package/dist/path/{RaphDerivedHandle.d.ts → derived/RaphDerivedHandle.d.ts} +3 -3
- package/dist/path/derived/derived-collection.types.d.ts +12 -0
- package/dist/path/{derived-collection.d.ts → derived/derived-collection.utils.d.ts} +3 -13
- package/dist/path/{derived-strategies.d.ts → derived/derived-strategy.types.d.ts} +0 -3
- package/dist/path/derived/derived-strategy.utils.d.ts +4 -0
- package/dist/path/{MetaController.d.ts → meta/MetaController.d.ts} +4 -4
- package/dist/path/{RaphMeta.d.ts → meta/RaphMeta.d.ts} +2 -2
- package/dist/path/{RaphMetaStore.d.ts → meta/RaphMetaStore.d.ts} +1 -1
- package/dist/path/{meta.types.d.ts → meta/meta.types.d.ts} +2 -4
- package/dist/path/path.types.d.ts +3 -2
- package/dist/path/{segment-key.d.ts → pathSegmentKey.d.ts} +1 -1
- package/dist/path/{AdapterPathStore.d.ts → storage/AdapterPathStore.d.ts} +4 -4
- package/dist/path/{data-adapter.d.ts → storage/DefaultDataAdapter.d.ts} +2 -17
- package/dist/path/{PathEventHub.d.ts → storage/PathEventHub.d.ts} +9 -9
- package/dist/path/{PathStore.d.ts → storage/PathStore.d.ts} +3 -3
- package/dist/path/storage/data-adapter.types.d.ts +17 -0
- package/dist/path.cjs +1 -1
- package/dist/path.js +16 -16
- package/dist/raph.cjs +1 -1
- package/dist/raph.js +46 -38
- package/dist/reactivity/engine.d.ts +17 -3
- package/dist/reactivity/reactive-object.d.ts +36 -0
- package/dist/reactivity/types.d.ts +25 -0
- package/dist/reactivity.cjs +1 -1
- package/dist/reactivity.js +12 -12
- package/dist/runtime/RaphRuntime.d.ts +132 -192
- package/dist/runtime/diagnostics/RaphDebug.d.ts +239 -0
- package/dist/runtime/errors.d.ts +5 -0
- package/dist/runtime/ownership/RaphEffectScope.d.ts +29 -0
- package/dist/runtime/ownership/RaphNode.d.ts +40 -0
- package/dist/runtime/ownership/RaphScope.d.ts +38 -0
- package/dist/runtime/{parent-graph.d.ts → ownership/parent-graph.types.d.ts} +0 -1
- package/dist/runtime/ownership/parentGraph.d.ts +3 -0
- package/dist/runtime/phases/RaphPhasePipeline.d.ts +79 -0
- package/dist/runtime/phases/orderPhaseTasks.d.ts +6 -0
- package/dist/runtime/phases/phase.types.d.ts +92 -0
- package/dist/runtime/{PathHandle.d.ts → reactivity/PathHandle.d.ts} +14 -6
- package/dist/runtime/reactivity/RaphMetaSource.d.ts +32 -0
- package/dist/runtime/reactivity/RaphWorkGraph.d.ts +171 -0
- package/dist/runtime/{RuntimeReactivity.d.ts → reactivity/RuntimeReactivity.d.ts} +14 -9
- package/dist/runtime/{RuntimeWatch.d.ts → reactivity/RuntimeWatch.d.ts} +9 -3
- package/dist/runtime/{runtime-reactivity.types.d.ts → reactivity/runtime-reactivity.types.d.ts} +3 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +21 -16
- package/package.json +68 -35
- package/ReadMe.md +0 -153
- package/dist/api/public.d.ts +0 -22
- package/dist/debug/api/public.cjs +0 -1
- package/dist/debug/api/public.js +0 -40
- package/dist/debug/path/AdapterPathStore.cjs +0 -1
- package/dist/debug/path/DerivedRegistry.cjs +0 -1
- package/dist/debug/path/PathEventHub.cjs +0 -1
- package/dist/debug/path/PathStore.cjs +0 -1
- package/dist/debug/path/RaphMetaStore.cjs +0 -1
- package/dist/debug/path/data-adapter.cjs +0 -1
- package/dist/debug/path/data-path.cjs +0 -1
- package/dist/debug/path/derived-collection.cjs +0 -1
- package/dist/debug/path/path-router.cjs +0 -1
- package/dist/debug/path/public.cjs +0 -1
- package/dist/debug/path/public.js +0 -18
- package/dist/debug/runtime/PathHandle.cjs +0 -1
- package/dist/debug/runtime/RaphDebug.cjs +0 -1
- package/dist/debug/runtime/RaphDebug.js +0 -15
- package/dist/debug/runtime/RaphNode.cjs +0 -1
- package/dist/debug/runtime/RaphNode.js +0 -143
- package/dist/debug/runtime/RaphPhasePipeline.cjs +0 -1
- package/dist/debug/runtime/RaphPhasePipeline.js +0 -526
- package/dist/debug/runtime/RaphScope.cjs +0 -1
- package/dist/debug/runtime/RaphScope.js +0 -64
- package/dist/debug/runtime/RuntimeReactivity.cjs +0 -1
- package/dist/debug/runtime/RuntimeReactivity.js +0 -154
- package/dist/debug/runtime/RuntimeWatch.cjs +0 -1
- package/dist/debug/runtime/RuntimeWatch.js +0 -71
- package/dist/debug/runtime/public.cjs +0 -1
- package/dist/debug/runtime/public.js +0 -18
- package/dist/path/public.d.ts +0 -14
- package/dist/runtime/RaphDebug.d.ts +0 -32
- package/dist/runtime/RaphNode.d.ts +0 -68
- package/dist/runtime/RaphPhasePipeline.d.ts +0 -133
- package/dist/runtime/RaphScope.d.ts +0 -50
- package/dist/runtime/phase.types.d.ts +0 -49
- package/dist/runtime/public.d.ts +0 -13
- /package/dist/debug/path/{meta.types.cjs → data-path.types.cjs} +0 -0
- /package/dist/debug/path/{meta.types.js → data-path.types.js} +0 -0
- /package/dist/debug/path/{RaphDerivedHandle.cjs → derived/RaphDerivedHandle.cjs} +0 -0
- /package/dist/debug/path/{RaphDerivedHandle.js → derived/RaphDerivedHandle.js} +0 -0
- /package/dist/debug/{runtime/runtime-reactivity.types.cjs → path/derived/derived-collection.types.cjs} +0 -0
- /package/dist/debug/{runtime/runtime-reactivity.types.js → path/derived/derived-collection.types.js} +0 -0
- /package/dist/debug/path/{derived-strategies.cjs → derived/derived-strategy.utils.cjs} +0 -0
- /package/dist/debug/path/{derived-strategies.js → derived/derived-strategy.utils.js} +0 -0
- /package/dist/debug/path/{RaphMeta.cjs → meta/RaphMeta.cjs} +0 -0
- /package/dist/debug/path/{RaphMeta.js → meta/RaphMeta.js} +0 -0
- /package/dist/debug/path/{segment-key.cjs → pathSegmentKey.cjs} +0 -0
- /package/dist/debug/path/{segment-key.js → pathSegmentKey.js} +0 -0
- /package/dist/debug/path/{data-draft.cjs → storage/createDataDraft.cjs} +0 -0
- /package/dist/debug/path/{data-draft.js → storage/createDataDraft.js} +0 -0
- /package/dist/debug/runtime/{parent-graph.cjs → ownership/parentGraph.cjs} +0 -0
- /package/dist/debug/runtime/{parent-graph.js → ownership/parentGraph.js} +0 -0
- /package/dist/debug/runtime/{disposal.cjs → ownership/throwDisposalErrors.cjs} +0 -0
- /package/dist/debug/runtime/{disposal.js → ownership/throwDisposalErrors.js} +0 -0
- /package/dist/debug/runtime/{RaphFrameLoop.cjs → phases/RaphFrameLoop.cjs} +0 -0
- /package/dist/debug/runtime/{RaphFrameLoop.js → phases/RaphFrameLoop.js} +0 -0
- /package/dist/debug/runtime/{phase.types.cjs → phases/phase.types.cjs} +0 -0
- /package/dist/debug/runtime/{phase.types.js → phases/phase.types.js} +0 -0
- /package/dist/path/{data-draft.d.ts → storage/createDataDraft.d.ts} +0 -0
- /package/dist/runtime/{disposal.d.ts → ownership/throwDisposalErrors.d.ts} +0 -0
- /package/dist/runtime/{RaphFrameLoop.d.ts → phases/RaphFrameLoop.d.ts} +0 -0
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
var F = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { MetaController as j } from "./MetaController.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
2
|
+
var O = (_, e, t) => e in _ ? F(_, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : _[e] = t;
|
|
3
|
+
var y = (_, e, t) => O(_, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { parseDataPath as w } from "./data-path.utils.js";
|
|
5
|
+
import { DataPath as T } from "./DataPath.js";
|
|
6
|
+
import { validateFullFilter as S, cloneMaterializedValue as C, validateFullCollection as W, collectionIndex as k, collectionError as b, indexesAreStale as z, validateIncrementalCollection as B, collectionKeys as x, keyedPath as A, filterError as P, validateIncrementalFilter as K } from "./derived/derived-collection.utils.js";
|
|
7
|
+
import { DerivedRegistry as q } from "./derived/DerivedRegistry.js";
|
|
8
|
+
import { RaphDerivedHandle as N, RaphDerivedTargetWriteError as $ } from "./derived/RaphDerivedHandle.js";
|
|
9
|
+
import { MetaController as j } from "./meta/MetaController.js";
|
|
10
|
+
import { AdapterPathStore as R } from "./storage/AdapterPathStore.js";
|
|
11
|
+
import { DefaultDataAdapter as L } from "./storage/DefaultDataAdapter.js";
|
|
12
|
+
import { PathStore as H } from "./storage/PathStore.js";
|
|
13
|
+
const M = class M {
|
|
13
14
|
/**
|
|
14
15
|
* Создаёт data/meta owner с независимым lifecycle и derived registry.
|
|
15
16
|
*/
|
|
16
17
|
constructor(e = {}) {
|
|
17
18
|
// Публикует стабильную identity data/meta owner.
|
|
18
|
-
|
|
19
|
+
y(this, "id");
|
|
19
20
|
// Лениво создают независимые data, derived, runtime и metadata controllers.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// Защищают
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
y(this, "_paths");
|
|
22
|
+
y(this, "_derivedController");
|
|
23
|
+
y(this, "_runtimes");
|
|
24
|
+
y(this, "_metaController");
|
|
25
|
+
// Защищают batch stabilization и записи в derived targets.
|
|
26
|
+
y(this, "_batchDepth", 0);
|
|
27
|
+
y(this, "_runtimeMutationDepth", 0);
|
|
28
|
+
y(this, "_stabilizing", !1);
|
|
29
|
+
y(this, "_derivedWriteDepth", 0);
|
|
30
|
+
if (this.id = e.id ?? `kernel-${M._kernelCounter++}`, e.adapter !== void 0) {
|
|
29
31
|
if (e.initial !== void 0 || e.adapterOptions !== void 0)
|
|
30
32
|
throw new TypeError("[Raph] A custom adapter cannot be combined with initial or adapterOptions.");
|
|
31
|
-
this._paths = new
|
|
33
|
+
this._paths = new R(e.adapter);
|
|
32
34
|
} else if (e.adapterOptions !== void 0)
|
|
33
|
-
this._paths = new
|
|
35
|
+
this._paths = new R(new L(
|
|
34
36
|
e.initial,
|
|
35
37
|
e.adapterOptions
|
|
36
38
|
));
|
|
37
39
|
else {
|
|
38
|
-
const t = this._paths = new
|
|
40
|
+
const t = this._paths = new H();
|
|
39
41
|
e.initial !== void 0 && t.set("", e.initial);
|
|
40
42
|
}
|
|
41
43
|
}
|
|
@@ -81,6 +83,10 @@ const x = class x {
|
|
|
81
83
|
*/
|
|
82
84
|
set(e, t, r) {
|
|
83
85
|
var s;
|
|
86
|
+
if (this._runtimeMutationDepth === 0 && this._runtimes !== void 0) {
|
|
87
|
+
this._withAttachedRuntimeBoundary(() => this.set(e, t, r));
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
84
90
|
this._assertWritablePath("set", e, t, r);
|
|
85
91
|
const i = this._store;
|
|
86
92
|
if ((((s = this._metaController) == null ? void 0 : s.size) ?? 0) === 0) {
|
|
@@ -100,6 +106,10 @@ const x = class x {
|
|
|
100
106
|
*/
|
|
101
107
|
merge(e, t, r) {
|
|
102
108
|
var s;
|
|
109
|
+
if (this._runtimeMutationDepth === 0 && this._runtimes !== void 0) {
|
|
110
|
+
this._withAttachedRuntimeBoundary(() => this.merge(e, t, r));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
103
113
|
this._assertWritablePath("merge", e, t, r);
|
|
104
114
|
const i = this._store;
|
|
105
115
|
if ((((s = this._metaController) == null ? void 0 : s.size) ?? 0) === 0) {
|
|
@@ -119,6 +129,10 @@ const x = class x {
|
|
|
119
129
|
*/
|
|
120
130
|
delete(e, t) {
|
|
121
131
|
var i;
|
|
132
|
+
if (this._runtimeMutationDepth === 0 && this._runtimes !== void 0) {
|
|
133
|
+
this._withAttachedRuntimeBoundary(() => this.delete(e, t));
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
122
136
|
this._assertWritablePath("delete", e, void 0, t);
|
|
123
137
|
const r = this._store;
|
|
124
138
|
if ((((i = this._metaController) == null ? void 0 : i.size) ?? 0) === 0) {
|
|
@@ -136,36 +150,24 @@ const x = class x {
|
|
|
136
150
|
});
|
|
137
151
|
}
|
|
138
152
|
/**
|
|
139
|
-
* Выполняет операцию в общей синхронной
|
|
153
|
+
* Выполняет операцию в общей синхронной batch boundary.
|
|
140
154
|
*/
|
|
141
|
-
|
|
142
|
-
var
|
|
155
|
+
batch(e) {
|
|
156
|
+
var o;
|
|
157
|
+
if (this._runtimeMutationDepth === 0 && this._runtimes !== void 0)
|
|
158
|
+
return this._withAttachedRuntimeBoundary(() => this.batch(e));
|
|
143
159
|
const t = this._store;
|
|
144
|
-
if (this._derivedController === void 0 && !((
|
|
145
|
-
return t.
|
|
146
|
-
|
|
147
|
-
if (r !== void 0)
|
|
148
|
-
for (const o of r)
|
|
149
|
-
(v = o._beginKernelTransaction) == null || v.call(o);
|
|
150
|
-
let i, s, a = !1;
|
|
160
|
+
if (this._derivedController === void 0 && !((o = this._metaController) != null && o.hasWatchers))
|
|
161
|
+
return t.batch(e);
|
|
162
|
+
let r, i, s = !1;
|
|
151
163
|
try {
|
|
152
|
-
|
|
153
|
-
} catch (
|
|
154
|
-
|
|
164
|
+
r = t.batch(() => this._runDerivedBatch(e));
|
|
165
|
+
} catch (h) {
|
|
166
|
+
s = !0, i = h;
|
|
155
167
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
try {
|
|
160
|
-
(_ = o._endKernelTransaction) == null || _.call(o);
|
|
161
|
-
} catch (m) {
|
|
162
|
-
d.push(m);
|
|
163
|
-
}
|
|
164
|
-
if (d.length === 1)
|
|
165
|
-
throw d[0];
|
|
166
|
-
if (d.length > 1)
|
|
167
|
-
throw new AggregateError(d, "[Raph] Kernel transaction execution failed.");
|
|
168
|
-
return i;
|
|
168
|
+
if (s)
|
|
169
|
+
throw i;
|
|
170
|
+
return r;
|
|
169
171
|
}
|
|
170
172
|
/**
|
|
171
173
|
* Подписывает callback на подходящие изменения и возвращает disposer.
|
|
@@ -191,6 +193,10 @@ const x = class x {
|
|
|
191
193
|
* Записывает metadata указанного data-owner.
|
|
192
194
|
*/
|
|
193
195
|
setMeta(e, t, r, i) {
|
|
196
|
+
if (this._runtimeMutationDepth === 0 && this._runtimes !== void 0) {
|
|
197
|
+
this._withAttachedRuntimeBoundary(() => this.setMeta(e, t, r, i));
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
194
200
|
this._assertMetaNamespace(t);
|
|
195
201
|
const s = this._exactMetaPath(e, i);
|
|
196
202
|
this._assertMetaOwner(s), this._metadata.set(s, t, r, i);
|
|
@@ -199,6 +205,10 @@ const x = class x {
|
|
|
199
205
|
* Объединяет metadata указанного data-owner.
|
|
200
206
|
*/
|
|
201
207
|
mergeMeta(e, t, r, i) {
|
|
208
|
+
if (this._runtimeMutationDepth === 0 && this._runtimes !== void 0) {
|
|
209
|
+
this._withAttachedRuntimeBoundary(() => this.mergeMeta(e, t, r, i));
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
202
212
|
this._assertMetaNamespace(t);
|
|
203
213
|
const s = this._exactMetaPath(e, i);
|
|
204
214
|
this._assertMetaOwner(s), this._metadata.merge(s, t, r, i);
|
|
@@ -208,6 +218,10 @@ const x = class x {
|
|
|
208
218
|
*/
|
|
209
219
|
deleteMeta(e, t, r) {
|
|
210
220
|
var s;
|
|
221
|
+
if (this._runtimeMutationDepth === 0 && this._runtimes !== void 0) {
|
|
222
|
+
this._withAttachedRuntimeBoundary(() => this.deleteMeta(e, t, r));
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
211
225
|
t !== void 0 && this._assertMetaNamespace(t);
|
|
212
226
|
const i = this._exactMetaPath(e, r);
|
|
213
227
|
(s = this._metaController) == null || s.delete(i, t, r);
|
|
@@ -223,26 +237,26 @@ const x = class x {
|
|
|
223
237
|
* Создаёт управляемое derived-представление source path в target path.
|
|
224
238
|
*/
|
|
225
239
|
derive(e) {
|
|
226
|
-
var
|
|
240
|
+
var d, u, m;
|
|
227
241
|
if (this._store, e.strategy !== void 0 && e.strategy.kind !== "full" && e.strategy.kind !== "collection-by-key" && e.strategy.kind !== "filter-by-key")
|
|
228
242
|
throw new Error(`[Raph] Unsupported derived strategy "${String(e.strategy.kind)}".`);
|
|
229
|
-
if (e.id !== void 0 && ((
|
|
243
|
+
if (e.id !== void 0 && ((d = this._derivedController) != null && d.has(e.id)))
|
|
230
244
|
throw new Error(`[Raph] Duplicate derived id "${e.id}".`);
|
|
231
|
-
const t =
|
|
232
|
-
if (
|
|
245
|
+
const t = w(e.from), r = w(e.to);
|
|
246
|
+
if (E(t, r))
|
|
233
247
|
throw new Error("[Raph] Derived source and target must not overlap.");
|
|
234
|
-
const i = this._derivedController ?? new
|
|
248
|
+
const i = this._derivedController ?? new q(), s = e.id ?? i.nextId(), o = {
|
|
235
249
|
...e,
|
|
236
250
|
from: t.canonical,
|
|
237
251
|
to: r.canonical
|
|
238
|
-
},
|
|
239
|
-
this._derivedController = i, i.register(
|
|
252
|
+
}, h = new N(this, s, o), l = ((u = e.strategy) == null ? void 0 : u.kind) === "collection-by-key" || ((m = e.strategy) == null ? void 0 : m.kind) === "filter-by-key" ? e.strategy : void 0;
|
|
253
|
+
this._derivedController = i, i.register(h, t, l);
|
|
240
254
|
try {
|
|
241
|
-
e.immediate !== !1 &&
|
|
242
|
-
} catch (
|
|
243
|
-
throw this._removeDerived(
|
|
255
|
+
e.immediate !== !1 && h.recompute();
|
|
256
|
+
} catch (a) {
|
|
257
|
+
throw this._removeDerived(h), h._disposeFromKernel(), a;
|
|
244
258
|
}
|
|
245
|
-
return
|
|
259
|
+
return h;
|
|
246
260
|
}
|
|
247
261
|
/**
|
|
248
262
|
* Регистрирует runtime, разделяющий этот Kernel.
|
|
@@ -309,21 +323,58 @@ const x = class x {
|
|
|
309
323
|
return this._store, this._metaController ?? (this._metaController = new j(
|
|
310
324
|
this,
|
|
311
325
|
(e) => this.has(e),
|
|
312
|
-
() => this.
|
|
326
|
+
() => this._batchDepth !== 0 || this._stabilizing
|
|
313
327
|
));
|
|
314
328
|
}
|
|
329
|
+
/** Keeps every attached Runtime quiescent until one Kernel publication completes. */
|
|
330
|
+
_withAttachedRuntimeBoundary(e) {
|
|
331
|
+
var h, l, d;
|
|
332
|
+
const t = this._runtimes === void 0 ? [] : [...this._runtimes];
|
|
333
|
+
if (t.length === 0)
|
|
334
|
+
return e();
|
|
335
|
+
const r = [], i = [];
|
|
336
|
+
let s, o = !1;
|
|
337
|
+
this._runtimeMutationDepth++;
|
|
338
|
+
try {
|
|
339
|
+
for (const u of t)
|
|
340
|
+
(h = u._beginKernelBatch) == null || h.call(u), r.push(u);
|
|
341
|
+
try {
|
|
342
|
+
s = e();
|
|
343
|
+
} catch (u) {
|
|
344
|
+
o = !0, i.push(u);
|
|
345
|
+
}
|
|
346
|
+
} catch (u) {
|
|
347
|
+
o = !0, i.push(u);
|
|
348
|
+
} finally {
|
|
349
|
+
this._runtimeMutationDepth--;
|
|
350
|
+
for (let u = r.length - 1; u >= 0; u--)
|
|
351
|
+
try {
|
|
352
|
+
(d = (l = r[u])._endKernelBatch) == null || d.call(l);
|
|
353
|
+
} catch (m) {
|
|
354
|
+
i.push(m);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (i.length === 1)
|
|
358
|
+
throw i[0];
|
|
359
|
+
if (i.length > 1)
|
|
360
|
+
throw new AggregateError(
|
|
361
|
+
i,
|
|
362
|
+
o ? "[Raph] Kernel mutation and Runtime publication failed." : "[Raph] Runtime publication failed after a Kernel mutation."
|
|
363
|
+
);
|
|
364
|
+
return s;
|
|
365
|
+
}
|
|
315
366
|
_assertWritablePath(e, t, r, i) {
|
|
316
367
|
const s = this._derivedController;
|
|
317
368
|
if (s === void 0 || this._derivedWriteDepth !== 0)
|
|
318
369
|
return;
|
|
319
|
-
const
|
|
320
|
-
for (const
|
|
321
|
-
const
|
|
322
|
-
if (!
|
|
370
|
+
const o = w(t, i);
|
|
371
|
+
for (const h of s.values()) {
|
|
372
|
+
const l = w(h.options.to);
|
|
373
|
+
if (!E(o, l))
|
|
323
374
|
continue;
|
|
324
|
-
const
|
|
325
|
-
if (!(e === "merge" &&
|
|
326
|
-
throw new
|
|
375
|
+
const d = o.segments.length < l.segments.length;
|
|
376
|
+
if (!(e === "merge" && d && !U(r, l.segments[o.segments.length])))
|
|
377
|
+
throw new $(o.canonical);
|
|
327
378
|
}
|
|
328
379
|
}
|
|
329
380
|
_writeDerivedTarget(e, t) {
|
|
@@ -335,57 +386,57 @@ const x = class x {
|
|
|
335
386
|
}
|
|
336
387
|
}
|
|
337
388
|
_mutateDerived(e, t, r, i, s) {
|
|
338
|
-
const
|
|
339
|
-
t === "delete" && !e.has(r, s) || e.
|
|
340
|
-
t === "set" ? e.set(r, i, s) : t === "merge" ? e.merge(r, i, s) : e.delete(r, s), this._queueDerived(
|
|
389
|
+
const o = w(r, s);
|
|
390
|
+
t === "delete" && !e.has(r, s) || e.batch(() => {
|
|
391
|
+
t === "set" ? e.set(r, i, s) : t === "merge" ? e.merge(r, i, s) : e.delete(r, s), this._queueDerived(o), this._batchDepth === 0 && !this._stabilizing && this._stabilizeDerived();
|
|
341
392
|
});
|
|
342
393
|
}
|
|
343
|
-
|
|
344
|
-
var
|
|
345
|
-
let t = !1, r, i = !1, s,
|
|
346
|
-
this.
|
|
394
|
+
_runDerivedBatch(e) {
|
|
395
|
+
var u;
|
|
396
|
+
let t = !1, r, i = !1, s, o = !1, h, l;
|
|
397
|
+
this._batchDepth++;
|
|
347
398
|
try {
|
|
348
|
-
|
|
349
|
-
} catch (
|
|
350
|
-
t = !0, r =
|
|
399
|
+
l = e();
|
|
400
|
+
} catch (m) {
|
|
401
|
+
t = !0, r = m;
|
|
351
402
|
} finally {
|
|
352
|
-
if (this.
|
|
403
|
+
if (this._batchDepth--, this._batchDepth === 0) {
|
|
353
404
|
if (!this._stabilizing)
|
|
354
405
|
try {
|
|
355
406
|
this._stabilizeDerived();
|
|
356
|
-
} catch (
|
|
357
|
-
i = !0, s =
|
|
407
|
+
} catch (m) {
|
|
408
|
+
i = !0, s = m;
|
|
358
409
|
}
|
|
359
410
|
try {
|
|
360
|
-
(
|
|
361
|
-
} catch (
|
|
362
|
-
|
|
411
|
+
(u = this._metaController) == null || u.publish();
|
|
412
|
+
} catch (m) {
|
|
413
|
+
o = !0, h = m;
|
|
363
414
|
}
|
|
364
415
|
}
|
|
365
416
|
}
|
|
366
|
-
const
|
|
367
|
-
if (t &&
|
|
417
|
+
const d = [];
|
|
418
|
+
if (t && d.push(r), i && d.push(s), o && d.push(h), d.length > 1)
|
|
368
419
|
throw new AggregateError(
|
|
369
|
-
|
|
370
|
-
"[Raph] Kernel
|
|
420
|
+
d,
|
|
421
|
+
"[Raph] Kernel batch publication failed."
|
|
371
422
|
);
|
|
372
|
-
if (
|
|
373
|
-
throw
|
|
374
|
-
return
|
|
423
|
+
if (d.length === 1)
|
|
424
|
+
throw d[0];
|
|
425
|
+
return l;
|
|
375
426
|
}
|
|
376
427
|
_mutateWithMetaLifecycle(e) {
|
|
377
|
-
if (this.
|
|
428
|
+
if (this._batchDepth !== 0 || this._stabilizing) {
|
|
378
429
|
e();
|
|
379
430
|
return;
|
|
380
431
|
}
|
|
381
|
-
this.
|
|
432
|
+
this.batch(e);
|
|
382
433
|
}
|
|
383
434
|
_pruneMissingMetaOwners(e, t, r) {
|
|
384
435
|
var i;
|
|
385
436
|
(i = this._metaController) == null || i.pruneMissing(this._metaPath(e, r), t);
|
|
386
437
|
}
|
|
387
438
|
_metaPath(e, t) {
|
|
388
|
-
return
|
|
439
|
+
return T.from(e, t);
|
|
389
440
|
}
|
|
390
441
|
_exactMetaPath(e, t) {
|
|
391
442
|
const r = this._metaPath(e, t);
|
|
@@ -410,7 +461,7 @@ const x = class x {
|
|
|
410
461
|
(r = this._derivedController) == null || r.queueReplacement(e, t);
|
|
411
462
|
}
|
|
412
463
|
_replaceDerivedTarget(e, t, r) {
|
|
413
|
-
const i =
|
|
464
|
+
const i = w(e);
|
|
414
465
|
this._store.set(i.canonical, t), this._queueDerivedReplacement(i, r);
|
|
415
466
|
}
|
|
416
467
|
_stabilizeDerived() {
|
|
@@ -448,61 +499,61 @@ const x = class x {
|
|
|
448
499
|
t.kind === "filter-by-key" ? this._recomputeDerivedFilter(e, t) : this._recomputeDerivedCollection(e, t);
|
|
449
500
|
}
|
|
450
501
|
_recomputeDerivedFull(e) {
|
|
451
|
-
var
|
|
452
|
-
const t = (
|
|
502
|
+
var l;
|
|
503
|
+
const t = (l = this._derivedController) == null ? void 0 : l.state(e);
|
|
453
504
|
t !== void 0 && (t.full = !0);
|
|
454
505
|
const r = this.get(e.options.from), i = e.options.compute(r);
|
|
455
|
-
let s = i,
|
|
456
|
-
t !== void 0 && (r === void 0 && (i === void 0 || Array.isArray(i) && i.length === 0) ? (
|
|
506
|
+
let s = i, o, h;
|
|
507
|
+
t !== void 0 && (r === void 0 && (i === void 0 || Array.isArray(i) && i.length === 0) ? (o = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map()) : (t.kind === "filter-by-key" ? (S(e.id, t.key, r, i), s = C(i)) : W(e.id, t.key, r, i), o = k(r, t.key, "source"), h = k(s, t.key, "output"))), this._writeDerivedTarget(e.options.to, s), t !== void 0 && (t.sourceIndex = o, t.targetIndex = h, t.initialized = !0, t.full = !1, t.keys.clear());
|
|
457
508
|
}
|
|
458
509
|
_recomputeDerivedCollection(e, t) {
|
|
459
510
|
t.full = !0;
|
|
460
511
|
const r = this.get(e.options.from), i = this.get(e.options.to);
|
|
461
512
|
if (!Array.isArray(r) || !Array.isArray(i))
|
|
462
|
-
throw
|
|
463
|
-
(t.sourceIndex === void 0 ||
|
|
513
|
+
throw b(e.id, "requires array source and target");
|
|
514
|
+
(t.sourceIndex === void 0 || z(r, t.key, t.sourceIndex, t.keys)) && (t.sourceIndex = k(r, t.key, "source"));
|
|
464
515
|
const s = t.targetIndex;
|
|
465
516
|
if (s === void 0)
|
|
466
|
-
throw
|
|
467
|
-
const
|
|
468
|
-
for (const
|
|
469
|
-
const
|
|
470
|
-
|
|
517
|
+
throw b(e.id, "has no materialized target index");
|
|
518
|
+
const o = [], h = [];
|
|
519
|
+
for (const a of t.keys) {
|
|
520
|
+
const g = t.sourceIndex.get(a);
|
|
521
|
+
g === void 0 ? h.push(a) : o.push({ key: a, index: g, item: r[g] });
|
|
471
522
|
}
|
|
472
|
-
|
|
473
|
-
const
|
|
474
|
-
|
|
523
|
+
o.sort((a, g) => a.index - g.index);
|
|
524
|
+
const l = o.map((a) => a.item), d = l.length === 0 ? [] : e.options.compute(l);
|
|
525
|
+
B(
|
|
475
526
|
e.id,
|
|
476
527
|
t.key,
|
|
477
|
-
|
|
478
|
-
|
|
528
|
+
o.map((a) => a.key),
|
|
529
|
+
d
|
|
479
530
|
);
|
|
480
|
-
const
|
|
481
|
-
if (
|
|
482
|
-
const
|
|
483
|
-
for (let
|
|
484
|
-
|
|
485
|
-
const
|
|
486
|
-
for (const [
|
|
487
|
-
|
|
488
|
-
const n =
|
|
489
|
-
|
|
490
|
-
for (let
|
|
491
|
-
const
|
|
492
|
-
if (
|
|
531
|
+
const u = d;
|
|
532
|
+
if (h.length !== 0 || o.some((a) => !s.has(a.key))) {
|
|
533
|
+
const a = /* @__PURE__ */ new Map();
|
|
534
|
+
for (let f = 0; f < o.length; f++)
|
|
535
|
+
a.set(o[f].key, u[f]);
|
|
536
|
+
const g = /* @__PURE__ */ new Map();
|
|
537
|
+
for (const [f, v] of s)
|
|
538
|
+
g.set(f, i[v]);
|
|
539
|
+
const n = x(r, t.key, "source"), c = [];
|
|
540
|
+
c.length = n.length;
|
|
541
|
+
for (let f = 0; f < n.length; f++) {
|
|
542
|
+
const v = n[f];
|
|
543
|
+
if (v === void 0)
|
|
493
544
|
continue;
|
|
494
|
-
const D =
|
|
545
|
+
const D = a.has(v) ? a.get(v) : g.get(v);
|
|
495
546
|
if (D === void 0)
|
|
496
|
-
throw
|
|
497
|
-
|
|
547
|
+
throw b(e.id, `is missing target item for key "${String(v)}"`);
|
|
548
|
+
c[f] = D;
|
|
498
549
|
}
|
|
499
|
-
const
|
|
500
|
-
this._replaceDerivedTarget(e.options.to,
|
|
550
|
+
const p = k(c, t.key, "target");
|
|
551
|
+
this._replaceDerivedTarget(e.options.to, c, t.keys), t.targetIndex = p;
|
|
501
552
|
} else
|
|
502
|
-
for (let
|
|
553
|
+
for (let a = 0; a < o.length; a++)
|
|
503
554
|
this._writeDerivedTarget(
|
|
504
|
-
A(e.options.to, t.key, a
|
|
505
|
-
|
|
555
|
+
A(e.options.to, t.key, o[a].key),
|
|
556
|
+
u[a]
|
|
506
557
|
);
|
|
507
558
|
t.keys.clear(), t.full = !1;
|
|
508
559
|
}
|
|
@@ -510,127 +561,127 @@ const x = class x {
|
|
|
510
561
|
t.full = !0;
|
|
511
562
|
const r = this.get(e.options.from), i = this.get(e.options.to);
|
|
512
563
|
if (!Array.isArray(r) || !Array.isArray(i))
|
|
513
|
-
throw
|
|
514
|
-
(t.sourceIndex === void 0 ||
|
|
564
|
+
throw P(e.id, "requires array source and target");
|
|
565
|
+
(t.sourceIndex === void 0 || z(r, t.key, t.sourceIndex, t.keys)) && (t.sourceIndex = k(r, t.key, "source"));
|
|
515
566
|
const s = t.targetIndex;
|
|
516
567
|
if (s === void 0)
|
|
517
|
-
throw
|
|
518
|
-
const
|
|
568
|
+
throw P(e.id, "has no materialized target index");
|
|
569
|
+
const o = [];
|
|
519
570
|
for (const n of t.keys) {
|
|
520
|
-
const
|
|
521
|
-
|
|
571
|
+
const c = t.sourceIndex.get(n);
|
|
572
|
+
c !== void 0 && o.push({ key: n, index: c, item: r[c] });
|
|
522
573
|
}
|
|
523
|
-
|
|
524
|
-
const
|
|
525
|
-
|
|
574
|
+
o.sort((n, c) => n.index - c.index);
|
|
575
|
+
const h = o.map((n) => n.item), l = h.length === 0 ? [] : e.options.compute(h);
|
|
576
|
+
K(
|
|
526
577
|
e.id,
|
|
527
578
|
t.key,
|
|
528
|
-
|
|
529
|
-
|
|
579
|
+
o.map((n) => n.key),
|
|
580
|
+
l
|
|
530
581
|
);
|
|
531
|
-
const
|
|
532
|
-
for (let n = 0; n <
|
|
533
|
-
const
|
|
534
|
-
|
|
582
|
+
const d = /* @__PURE__ */ new Map(), u = l, m = x(u, t.key, "output");
|
|
583
|
+
for (let n = 0; n < m.length; n++) {
|
|
584
|
+
const c = m[n];
|
|
585
|
+
c !== void 0 && d.set(c, C(u[n]));
|
|
535
586
|
}
|
|
536
|
-
const
|
|
537
|
-
let
|
|
587
|
+
const a = /* @__PURE__ */ new Set();
|
|
588
|
+
let g = !1;
|
|
538
589
|
for (const n of t.keys) {
|
|
539
|
-
const
|
|
540
|
-
!
|
|
590
|
+
const c = s.has(n), p = d.has(n);
|
|
591
|
+
!c && !p || (a.add(n), c !== p && (g = !0));
|
|
541
592
|
}
|
|
542
|
-
if (
|
|
593
|
+
if (g && t.keys.size === 1 && i.length === s.size && this._patchSingleFilterMembership(
|
|
543
594
|
e,
|
|
544
595
|
t,
|
|
545
596
|
i,
|
|
546
597
|
s,
|
|
547
|
-
|
|
548
|
-
|
|
598
|
+
d,
|
|
599
|
+
a
|
|
549
600
|
)) {
|
|
550
601
|
t.keys.clear(), t.full = !1;
|
|
551
602
|
return;
|
|
552
603
|
}
|
|
553
|
-
if (
|
|
604
|
+
if (g) {
|
|
554
605
|
const n = /* @__PURE__ */ new Map();
|
|
555
|
-
for (const [
|
|
556
|
-
n.set(
|
|
557
|
-
const
|
|
558
|
-
for (const
|
|
559
|
-
if (
|
|
560
|
-
if (t.keys.has(
|
|
561
|
-
|
|
606
|
+
for (const [f, v] of s)
|
|
607
|
+
n.set(f, i[v]);
|
|
608
|
+
const c = [];
|
|
609
|
+
for (const f of x(r, t.key, "source"))
|
|
610
|
+
if (f !== void 0) {
|
|
611
|
+
if (t.keys.has(f)) {
|
|
612
|
+
d.has(f) && c.push(d.get(f));
|
|
562
613
|
continue;
|
|
563
614
|
}
|
|
564
|
-
n.has(
|
|
615
|
+
n.has(f) && c.push(n.get(f));
|
|
565
616
|
}
|
|
566
|
-
const
|
|
567
|
-
this._replaceDerivedTarget(e.options.to,
|
|
617
|
+
const p = k(c, t.key, "target");
|
|
618
|
+
this._replaceDerivedTarget(e.options.to, c, a), t.targetIndex = p;
|
|
568
619
|
} else
|
|
569
|
-
for (const [n,
|
|
570
|
-
this._writeDerivedTarget(A(e.options.to, t.key, n),
|
|
620
|
+
for (const [n, c] of d)
|
|
621
|
+
this._writeDerivedTarget(A(e.options.to, t.key, n), c);
|
|
571
622
|
t.keys.clear(), t.full = !1;
|
|
572
623
|
}
|
|
573
|
-
_patchSingleFilterMembership(e, t, r, i, s,
|
|
574
|
-
const
|
|
575
|
-
if (
|
|
624
|
+
_patchSingleFilterMembership(e, t, r, i, s, o) {
|
|
625
|
+
const h = t.sourceIndex;
|
|
626
|
+
if (h === void 0)
|
|
576
627
|
return !1;
|
|
577
|
-
const
|
|
578
|
-
if (
|
|
628
|
+
const l = t.keys.values().next().value;
|
|
629
|
+
if (l === void 0)
|
|
579
630
|
return !1;
|
|
580
|
-
const
|
|
581
|
-
if (
|
|
631
|
+
const d = i.get(l), u = s.has(l);
|
|
632
|
+
if (d !== void 0 === u)
|
|
582
633
|
return !1;
|
|
583
|
-
const
|
|
584
|
-
let
|
|
585
|
-
if (
|
|
586
|
-
|
|
634
|
+
const m = r.slice();
|
|
635
|
+
let a;
|
|
636
|
+
if (d !== void 0)
|
|
637
|
+
a = d, m.splice(a, 1);
|
|
587
638
|
else {
|
|
588
|
-
const
|
|
589
|
-
if (
|
|
639
|
+
const g = h.get(l);
|
|
640
|
+
if (g === void 0)
|
|
590
641
|
return !1;
|
|
591
|
-
let n = 0,
|
|
592
|
-
for (; n <
|
|
593
|
-
const
|
|
594
|
-
if (typeof
|
|
642
|
+
let n = 0, c = m.length;
|
|
643
|
+
for (; n < c; ) {
|
|
644
|
+
const p = n + c >>> 1, f = m[p];
|
|
645
|
+
if (typeof f != "object" || f === null || Array.isArray(f))
|
|
595
646
|
return !1;
|
|
596
|
-
const
|
|
597
|
-
if (typeof
|
|
647
|
+
const v = f[t.key];
|
|
648
|
+
if (typeof v != "string" && typeof v != "number")
|
|
598
649
|
return !1;
|
|
599
|
-
const D =
|
|
650
|
+
const D = h.get(v);
|
|
600
651
|
if (D === void 0)
|
|
601
652
|
return !1;
|
|
602
|
-
D <
|
|
653
|
+
D < g ? n = p + 1 : c = p;
|
|
603
654
|
}
|
|
604
|
-
|
|
655
|
+
a = n, m.splice(a, 0, s.get(l));
|
|
605
656
|
}
|
|
606
|
-
if (this._replaceDerivedTarget(e.options.to,
|
|
607
|
-
i.delete(
|
|
608
|
-
for (const [
|
|
609
|
-
n >
|
|
657
|
+
if (this._replaceDerivedTarget(e.options.to, m, o), d !== void 0) {
|
|
658
|
+
i.delete(l);
|
|
659
|
+
for (const [g, n] of i)
|
|
660
|
+
n > a && i.set(g, n - 1);
|
|
610
661
|
} else {
|
|
611
|
-
for (const [
|
|
612
|
-
n >=
|
|
613
|
-
i.set(
|
|
662
|
+
for (const [g, n] of i)
|
|
663
|
+
n >= a && i.set(g, n + 1);
|
|
664
|
+
i.set(l, a);
|
|
614
665
|
}
|
|
615
666
|
return !0;
|
|
616
667
|
}
|
|
617
668
|
};
|
|
618
669
|
// Формирует локальный id для Kernel без явно заданного имени.
|
|
619
|
-
|
|
620
|
-
let
|
|
621
|
-
function
|
|
622
|
-
const t = Math.min(
|
|
670
|
+
y(M, "_kernelCounter", 0);
|
|
671
|
+
let I = M;
|
|
672
|
+
function E(_, e) {
|
|
673
|
+
const t = Math.min(_.segments.length, e.segments.length);
|
|
623
674
|
for (let r = 0; r < t; r++)
|
|
624
|
-
if (!V(
|
|
675
|
+
if (!V(_.segments[r], e.segments[r]))
|
|
625
676
|
return !1;
|
|
626
677
|
return !0;
|
|
627
678
|
}
|
|
628
|
-
function U(
|
|
629
|
-
return typeof
|
|
679
|
+
function U(_, e) {
|
|
680
|
+
return typeof _ != "object" || _ === null || Array.isArray(_) || e.kind !== "key" ? !0 : Object.hasOwn(_, e.key);
|
|
630
681
|
}
|
|
631
|
-
function V(
|
|
632
|
-
return
|
|
682
|
+
function V(_, e) {
|
|
683
|
+
return _.kind !== e.kind ? !1 : _.kind === "key" && e.kind === "key" ? _.key === e.key : _.kind === "index" && e.kind === "index" ? _.index === e.index : _.kind === "selector" && e.kind === "selector" && _.key === e.key && Object.is(_.value, e.value);
|
|
633
684
|
}
|
|
634
685
|
export {
|
|
635
|
-
|
|
686
|
+
I as RaphKernel
|
|
636
687
|
};
|