@milaboratories/pl-tree 1.3.17 → 1.3.19

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/index.mjs CHANGED
@@ -1,36 +1,36 @@
1
- var P = Object.defineProperty;
2
- var N = (a, e, t) => e in a ? P(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
- var u = (a, e, t) => N(a, typeof e != "symbol" ? e + "" : e, t);
4
- import { resourceIdToString as m, resourceTypeToString as F, resourceTypesEqual as S, isNotNullResourceId as g, NullResourceId as R, isNullResourceId as A, stringifyWithResourceId as L, isTimeoutOrCancelError as W } from "@milaboratories/pl-client";
5
- import { ChangeSource as y, PollingComputableHooks as U } from "@milaboratories/computable";
6
- import { notEmpty as p } from "@milaboratories/ts-helpers";
7
- import K from "denque";
8
- import * as J from "node:timers/promises";
9
- function X(a, e) {
10
- if (a !== void 0)
11
- return x(a, e);
1
+ var J = Object.defineProperty;
2
+ var q = (n, e, t) => e in n ? J(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var d = (n, e, t) => q(n, typeof e != "symbol" ? e + "" : e, t);
4
+ import { resourceIdToString as C, resourceTypeToString as I, resourceTypesEqual as A, isNotNullResourceId as g, NullResourceId as S, isNullResourceId as V, stringifyWithResourceId as L, isTimeoutOrCancelError as M } from "@milaboratories/pl-client";
5
+ import { ChangeSource as m, PollingComputableHooks as z } from "@milaboratories/computable";
6
+ import { notEmpty as y, msToHumanReadable as B } from "@milaboratories/ts-helpers";
7
+ import H from "denque";
8
+ import * as j from "node:timers/promises";
9
+ function se(n, e) {
10
+ if (n !== void 0)
11
+ return P(n, e);
12
12
  }
13
- function x(a, e) {
13
+ function P(n, e) {
14
14
  const t = {};
15
- return a.value !== void 0 && (t.value = e(a.value)), a.error !== void 0 && (t.error = e(a.error)), t;
15
+ return n.value !== void 0 && (t.value = e(n.value)), n.error !== void 0 && (t.error = e(n.error)), t;
16
16
  }
17
- class O extends Error {
17
+ class N extends Error {
18
18
  constructor(e) {
19
19
  super(e);
20
20
  }
21
21
  }
22
- function Z(a) {
23
- return typeof a == "object" && a !== null && a.__pl_tree_type_marker__ === "PlTreeEntry";
22
+ function ne(n) {
23
+ return typeof n == "object" && n !== null && n.__pl_tree_type_marker__ === "PlTreeEntry";
24
24
  }
25
- function ee(a) {
26
- return typeof a == "object" && a !== null && a.__pl_tree_type_marker__ === "PlTreeEntryAccessor";
25
+ function oe(n) {
26
+ return typeof n == "object" && n !== null && n.__pl_tree_type_marker__ === "PlTreeEntryAccessor";
27
27
  }
28
- function te(a) {
29
- return typeof a == "object" && a !== null && a.__pl_tree_type_marker__ === "PlTreeNodeAccessor";
28
+ function ae(n) {
29
+ return typeof n == "object" && n !== null && n.__pl_tree_type_marker__ === "PlTreeNodeAccessor";
30
30
  }
31
- class k {
31
+ class R {
32
32
  constructor(e, t) {
33
- u(this, "__pl_tree_type_marker__", "PlTreeEntry");
33
+ d(this, "__pl_tree_type_marker__", "PlTreeEntry");
34
34
  this.accessorData = e, this.rid = t;
35
35
  }
36
36
  createAccessor(e, t) {
@@ -43,45 +43,45 @@ class k {
43
43
  return this.toString();
44
44
  }
45
45
  toString() {
46
- return `[ENTRY:${m(this.rid)}]`;
46
+ return `[ENTRY:${C(this.rid)}]`;
47
47
  }
48
48
  }
49
- function $(a, e, t, r, s) {
50
- const c = new M(
51
- a,
49
+ function W(n, e, t, r, s) {
50
+ const a = new Y(
51
+ n,
52
52
  e,
53
53
  e.get(t.ctx.watcher, r),
54
54
  t
55
55
  );
56
56
  if (!s.ignoreError) {
57
- const n = c.getError();
58
- if (n !== void 0)
59
- throw new O(
60
- `error encountered on resource ${m(c.id)} (${F(c.resourceType)}): ${n.getDataAsString()}`
57
+ const o = a.getError();
58
+ if (o !== void 0)
59
+ throw new N(
60
+ `error encountered on resource ${C(a.id)} (${I(a.resourceType)}): ${o.getDataAsString()}`
61
61
  );
62
62
  }
63
- if (s.assertResourceType !== void 0 && (Array.isArray(s.assertResourceType) ? s.assertResourceType.findIndex((n) => S(n, c.resourceType)) === -1 : !S(s.assertResourceType, c.resourceType)))
63
+ if (s.assertResourceType !== void 0 && (Array.isArray(s.assertResourceType) ? s.assertResourceType.findIndex((o) => A(o, a.resourceType)) === -1 : !A(s.assertResourceType, a.resourceType)))
64
64
  throw new Error(
65
- `wrong resource type ${F(c.resourceType)} but expected ${s.assertResourceType}`
65
+ `wrong resource type ${I(a.resourceType)} but expected ${s.assertResourceType}`
66
66
  );
67
- return c;
67
+ return a;
68
68
  }
69
69
  class E {
70
70
  constructor(e, t, r, s) {
71
- u(this, "__pl_tree_type_marker__", "PlTreeEntryAccessor");
71
+ d(this, "__pl_tree_type_marker__", "PlTreeEntryAccessor");
72
72
  this.accessorData = e, this.tree = t, this.rid = r, this.instanceData = s;
73
73
  }
74
74
  node(e = {}) {
75
- return this.instanceData.guard(), this.accessorData.hooks !== void 0 && this.instanceData.ctx.attacheHooks(this.accessorData.hooks), $(this.accessorData, this.tree, this.instanceData, this.rid, e);
75
+ return this.instanceData.guard(), this.accessorData.hooks !== void 0 && this.instanceData.ctx.attacheHooks(this.accessorData.hooks), W(this.accessorData, this.tree, this.instanceData, this.rid, e);
76
76
  }
77
77
  }
78
- function re(a, e) {
79
- return a instanceof k ? e.accessor(a).node().resourceInfo : a;
78
+ function ue(n, e) {
79
+ return n instanceof R ? e.accessor(n).node().resourceInfo : n;
80
80
  }
81
- class M {
81
+ class Y {
82
82
  constructor(e, t, r, s) {
83
- u(this, "__pl_tree_type_marker__", "PlTreeNodeAccessor");
84
- u(this, "onUnstableLambda", (e) => {
83
+ d(this, "__pl_tree_type_marker__", "PlTreeNodeAccessor");
84
+ d(this, "onUnstableLambda", (e) => {
85
85
  this.instanceData.ctx.markUnstable(e);
86
86
  });
87
87
  this.accessorData = e, this.tree = t, this.resource = r, this.instanceData = s;
@@ -99,7 +99,7 @@ class M {
99
99
  return { id: this.id, type: this.resourceType };
100
100
  }
101
101
  getResourceFromTree(e, t) {
102
- return $(this.accessorData, this.tree, this.instanceData, e, t);
102
+ return W(this.accessorData, this.tree, this.instanceData, e, t);
103
103
  }
104
104
  traverse(...e) {
105
105
  return this.traverseWithCommon({}, ...e);
@@ -110,34 +110,34 @@ class M {
110
110
  traverseWithCommon(e, ...t) {
111
111
  const r = this.traverseOrErrorWithCommon(e, ...t);
112
112
  if (r !== void 0) {
113
- if (!r.ok) throw new O(r.error);
113
+ if (!r.ok) throw new N(r.error);
114
114
  return r.value;
115
115
  }
116
116
  }
117
117
  traverseOrErrorWithCommon(e, ...t) {
118
118
  let r = this;
119
119
  for (const s of t) {
120
- const c = typeof s == "string" ? {
120
+ const a = typeof s == "string" ? {
121
121
  ...e,
122
122
  field: s
123
- } : { ...e, ...s }, n = r.getField(s);
124
- if (n === void 0 || c.pureFieldErrorToUndefined && n.value === void 0 && n.error !== void 0)
123
+ } : { ...e, ...s }, o = r.getField(s);
124
+ if (o === void 0 || a.pureFieldErrorToUndefined && o.value === void 0 && o.error !== void 0)
125
125
  return;
126
- if ((!c.ignoreError || n.value === void 0) && n.error !== void 0)
126
+ if ((!a.ignoreError || o.value === void 0) && o.error !== void 0)
127
127
  return {
128
128
  ok: !1,
129
- error: `error in field ${c.field} of ${m(r.id)}: ${n.error.getDataAsString()}`
129
+ error: `error in field ${a.field} of ${C(r.id)}: ${o.error.getDataAsString()}`
130
130
  };
131
- if (n.value === void 0) {
132
- if (c.errorIfFieldNotSet)
131
+ if (o.value === void 0) {
132
+ if (a.errorIfFieldNotSet)
133
133
  return {
134
134
  ok: !1,
135
- error: `field have no assigned value ${c.field} of ${m(r.id)}`
135
+ error: `field have no assigned value ${a.field} of ${C(r.id)}`
136
136
  };
137
- this.onUnstableLambda("unpopulated_field:" + c.field);
137
+ this.onUnstableLambda("unpopulated_field:" + a.field);
138
138
  return;
139
139
  }
140
- r = n.value;
140
+ r = o.value;
141
141
  }
142
142
  return { ok: !0, value: r };
143
143
  }
@@ -145,7 +145,7 @@ class M {
145
145
  this.instanceData.guard();
146
146
  const t = typeof e == "string" ? { field: e } : e, r = this.resource.getField(this.instanceData.ctx.watcher, t, this.onUnstableLambda);
147
147
  if (r !== void 0)
148
- return x(r, (s) => this.getResourceFromTree(s, { ignoreError: !0 }));
148
+ return P(r, (s) => this.getResourceFromTree(s, { ignoreError: !0 }));
149
149
  }
150
150
  getInputsLocked() {
151
151
  this.instanceData.guard();
@@ -220,55 +220,55 @@ class M {
220
220
  }
221
221
  /** Can be passed to nested computable. */
222
222
  persist() {
223
- return new k(this.accessorData, this.resource.id);
223
+ return new R(this.accessorData, this.resource.id);
224
224
  }
225
225
  }
226
- class w extends Error {
226
+ class D extends Error {
227
227
  constructor(e) {
228
228
  super(e);
229
229
  }
230
230
  }
231
- class T {
231
+ class $ {
232
232
  constructor(e, t, r, s) {
233
- u(this, "change", new y());
233
+ d(this, "change", new m());
234
234
  this.type = e, this.value = t, this.error = r, this.resourceVersion = s;
235
235
  }
236
236
  }
237
- const D = 0, _ = new TextDecoder();
238
- class z {
237
+ const F = 0, x = new TextDecoder();
238
+ class G {
239
239
  constructor(e, t) {
240
240
  /** Tracks number of other resources referencing this resource. Used to perform garbage collection in tree patching procedure */
241
- u(this, "refCount", 0);
241
+ d(this, "refCount", 0);
242
242
  /** Increments each time resource is checked for difference with new state */
243
- u(this, "version", D);
243
+ d(this, "version", F);
244
244
  /** Set to resource version when resource state, or it's fields have changed */
245
- u(this, "dataVersion", D);
246
- u(this, "fields", /* @__PURE__ */ new Map());
247
- u(this, "kv", /* @__PURE__ */ new Map());
248
- u(this, "resourceRemoved", new y());
245
+ d(this, "dataVersion", F);
246
+ d(this, "fields", /* @__PURE__ */ new Map());
247
+ d(this, "kv", /* @__PURE__ */ new Map());
248
+ d(this, "resourceRemoved", new m());
249
249
  // following change source are removed when resource is marked as final
250
- u(this, "finalChanged", new y());
251
- u(this, "resourceStateChange", new y());
252
- u(this, "lockedChange", new y());
253
- u(this, "inputAndServiceFieldListChanged", new y());
254
- u(this, "outputFieldListChanged", new y());
255
- u(this, "dynamicFieldListChanged", new y());
256
- u(this, "kvChanged", new y());
257
- u(this, "id");
258
- u(this, "originalResourceId");
259
- u(this, "kind");
260
- u(this, "type");
261
- u(this, "data");
262
- u(this, "dataAsString");
263
- u(this, "dataAsJson");
264
- u(this, "error");
265
- u(this, "inputsLocked");
266
- u(this, "outputsLocked");
267
- u(this, "resourceReady");
268
- u(this, "finalFlag");
250
+ d(this, "finalChanged", new m());
251
+ d(this, "resourceStateChange", new m());
252
+ d(this, "lockedChange", new m());
253
+ d(this, "inputAndServiceFieldListChanged", new m());
254
+ d(this, "outputFieldListChanged", new m());
255
+ d(this, "dynamicFieldListChanged", new m());
256
+ d(this, "kvChanged", new m());
257
+ d(this, "id");
258
+ d(this, "originalResourceId");
259
+ d(this, "kind");
260
+ d(this, "type");
261
+ d(this, "data");
262
+ d(this, "dataAsString");
263
+ d(this, "dataAsJson");
264
+ d(this, "error");
265
+ d(this, "inputsLocked");
266
+ d(this, "outputsLocked");
267
+ d(this, "resourceReady");
268
+ d(this, "finalFlag");
269
269
  /** Set externally by the tree, using {@link FinalPredicate} */
270
- u(this, "_final", !1);
271
- u(this, "logger");
270
+ d(this, "_final", !1);
271
+ d(this, "logger");
272
272
  this.id = e.id, this.originalResourceId = e.originalResourceId, this.kind = e.kind, this.type = e.type, this.data = e.data, this.error = e.error, this.inputsLocked = e.inputsLocked, this.outputsLocked = e.outputsLocked, this.resourceReady = e.resourceReady, this.finalFlag = e.final, this.logger = t;
273
273
  }
274
274
  // TODO add logging
@@ -283,14 +283,14 @@ class z {
283
283
  }
284
284
  getField(e, t, r = () => {
285
285
  }) {
286
- var n, i, f;
287
- const s = typeof t == "string" ? { field: t } : t, c = this.fields.get(s.field);
288
- if (c === void 0) {
286
+ var o, i, l;
287
+ const s = typeof t == "string" ? { field: t } : t, a = this.fields.get(s.field);
288
+ if (a === void 0) {
289
289
  if (s.errorIfFieldNotFound || s.errorIfFieldNotSet)
290
290
  throw new Error(
291
- `Field "${s.field}" not found in resource ${m(this.id)}`
291
+ `Field "${s.field}" not found in resource ${C(this.id)}`
292
292
  );
293
- if (!this.inputsLocked) (n = this.inputAndServiceFieldListChanged) == null || n.attachWatcher(e);
293
+ if (!this.inputsLocked) (o = this.inputAndServiceFieldListChanged) == null || o.attachWatcher(e);
294
294
  else if (s.assertFieldType === "Service" || s.assertFieldType === "Input") {
295
295
  if (s.allowPermanentAbsence)
296
296
  return;
@@ -302,15 +302,15 @@ class z {
302
302
  return;
303
303
  throw new Error(`Output field not found ${s.field}.`);
304
304
  }
305
- (f = this.dynamicFieldListChanged) == null || f.attachWatcher(e), !this._final && !s.stableIfNotFound && r("field_not_found:" + s.field);
305
+ (l = this.dynamicFieldListChanged) == null || l.attachWatcher(e), !this._final && !s.stableIfNotFound && r("field_not_found:" + s.field);
306
306
  return;
307
307
  } else {
308
- if (s.assertFieldType !== void 0 && c.type !== s.assertFieldType)
308
+ if (s.assertFieldType !== void 0 && a.type !== s.assertFieldType)
309
309
  throw new Error(
310
- `Unexpected field type: expected ${s.assertFieldType} but got ${c.type} for the field name ${s.field}`
310
+ `Unexpected field type: expected ${s.assertFieldType} but got ${a.type} for the field name ${s.field}`
311
311
  );
312
- const d = {};
313
- return g(c.value) && (d.value = c.value), g(c.error) && (d.error = c.error), d.value === void 0 && d.error === void 0 && r("field_not_resolved:" + s.field), c.change.attachWatcher(e), d;
312
+ const c = {};
313
+ return g(a.value) && (c.value = a.value), g(a.error) && (c.error = a.error), c.value === void 0 && c.error === void 0 && r("field_not_resolved:" + s.field), a.change.attachWatcher(e), c;
314
314
  }
315
315
  }
316
316
  getInputsLocked(e) {
@@ -322,7 +322,7 @@ class z {
322
322
  return this.outputsLocked || (t = this.resourceStateChange) == null || t.attachWatcher(e), this.outputsLocked;
323
323
  }
324
324
  get isReadyOrError() {
325
- return this.error !== R || this.resourceReady || this.originalResourceId !== R;
325
+ return this.error !== S || this.resourceReady || this.originalResourceId !== S;
326
326
  }
327
327
  getIsFinal(e) {
328
328
  var t;
@@ -334,7 +334,7 @@ class z {
334
334
  }
335
335
  getError(e) {
336
336
  var t;
337
- if (A(this.error)) {
337
+ if (V(this.error)) {
338
338
  (t = this.resourceStateChange) == null || t.attachWatcher(e);
339
339
  return;
340
340
  } else
@@ -343,22 +343,22 @@ class z {
343
343
  listInputFields(e) {
344
344
  var r;
345
345
  const t = [];
346
- return this.fields.forEach((s, c) => {
347
- (s.type === "Input" || s.type === "Service") && t.push(c);
346
+ return this.fields.forEach((s, a) => {
347
+ (s.type === "Input" || s.type === "Service") && t.push(a);
348
348
  }), this.inputsLocked || (r = this.inputAndServiceFieldListChanged) == null || r.attachWatcher(e), t;
349
349
  }
350
350
  listOutputFields(e) {
351
351
  var r;
352
352
  const t = [];
353
- return this.fields.forEach((s, c) => {
354
- s.type === "Output" && t.push(c);
353
+ return this.fields.forEach((s, a) => {
354
+ s.type === "Output" && t.push(a);
355
355
  }), this.outputsLocked || (r = this.outputFieldListChanged) == null || r.attachWatcher(e), t;
356
356
  }
357
357
  listDynamicFields(e) {
358
358
  var r;
359
359
  const t = [];
360
- return this.fields.forEach((s, c) => {
361
- s.type !== "Input" && s.type !== "Output" && t.push(c);
360
+ return this.fields.forEach((s, a) => {
361
+ s.type !== "Input" && s.type !== "Output" && t.push(a);
362
362
  }), (r = this.dynamicFieldListChanged) == null || r.attachWatcher(e), t;
363
363
  }
364
364
  getKeyValue(e, t) {
@@ -368,11 +368,11 @@ class z {
368
368
  getKeyValueString(e, t) {
369
369
  const r = this.getKeyValue(e, t);
370
370
  if (r !== void 0)
371
- return _.decode(r);
371
+ return x.decode(r);
372
372
  }
373
373
  getDataAsString() {
374
374
  if (this.data !== void 0)
375
- return this.dataAsString === void 0 && (this.dataAsString = _.decode(this.data)), this.dataAsString;
375
+ return this.dataAsString === void 0 && (this.dataAsString = x.decode(this.data)), this.dataAsString;
376
376
  }
377
377
  getDataAsJson() {
378
378
  if (this.data !== void 0)
@@ -397,23 +397,23 @@ class z {
397
397
  };
398
398
  }
399
399
  markFinal() {
400
- this._final || (this._final = !0, p(this.finalChanged).markChanged(), this.finalChanged = void 0, this.resourceStateChange = void 0, this.dynamicFieldListChanged = void 0, this.inputAndServiceFieldListChanged = void 0, this.outputFieldListChanged = void 0, this.lockedChange = void 0);
400
+ this._final || (this._final = !0, y(this.finalChanged).markChanged(), this.finalChanged = void 0, this.resourceStateChange = void 0, this.dynamicFieldListChanged = void 0, this.inputAndServiceFieldListChanged = void 0, this.outputFieldListChanged = void 0, this.lockedChange = void 0);
401
401
  }
402
402
  /** Used for invalidation */
403
403
  markAllChanged() {
404
- var e, t, r, s, c, n, i;
405
- this.fields.forEach((f) => f.change.markChanged()), (e = this.finalChanged) == null || e.markChanged(), (t = this.resourceStateChange) == null || t.markChanged(), (r = this.lockedChange) == null || r.markChanged(), (s = this.inputAndServiceFieldListChanged) == null || s.markChanged(), (c = this.outputFieldListChanged) == null || c.markChanged(), (n = this.dynamicFieldListChanged) == null || n.markChanged(), (i = this.kvChanged) == null || i.markChanged(), this.resourceRemoved.markChanged();
404
+ var e, t, r, s, a, o, i;
405
+ this.fields.forEach((l) => l.change.markChanged()), (e = this.finalChanged) == null || e.markChanged(), (t = this.resourceStateChange) == null || t.markChanged(), (r = this.lockedChange) == null || r.markChanged(), (s = this.inputAndServiceFieldListChanged) == null || s.markChanged(), (a = this.outputFieldListChanged) == null || a.markChanged(), (o = this.dynamicFieldListChanged) == null || o.markChanged(), (i = this.kvChanged) == null || i.markChanged(), this.resourceRemoved.markChanged();
406
406
  }
407
407
  }
408
- class I {
408
+ class O {
409
409
  constructor(e, t = (r) => !1) {
410
410
  /** resource heap */
411
- u(this, "resources", /* @__PURE__ */ new Map());
412
- u(this, "resourcesAdded", new y());
411
+ d(this, "resources", /* @__PURE__ */ new Map());
412
+ d(this, "resourcesAdded", new m());
413
413
  /** Resets to false if any invalid state transitions are registered,
414
414
  * after that tree will produce errors for any read or write operations */
415
- u(this, "_isValid", !0);
416
- u(this, "invalidationMessage");
415
+ d(this, "_isValid", !0);
416
+ d(this, "invalidationMessage");
417
417
  this.root = e, this.isFinalPredicate = t;
418
418
  }
419
419
  forEachResource(e) {
@@ -426,91 +426,91 @@ class I {
426
426
  this.checkValid();
427
427
  const r = this.resources.get(t);
428
428
  if (r === void 0)
429
- throw this.resourcesAdded.attachWatcher(e), new Error(`resource ${m(t)} not found in the tree`);
429
+ throw this.resourcesAdded.attachWatcher(e), new Error(`resource ${C(t)} not found in the tree`);
430
430
  return r.resourceRemoved.attachWatcher(e), r;
431
431
  }
432
432
  updateFromResourceData(e, t = !1) {
433
433
  this.checkValid();
434
434
  const r = [], s = [];
435
- for (const n of e) {
436
- let i = this.resources.get(n.id);
437
- const f = i == null ? void 0 : i.state, d = (h) => {
438
- const { fields: v, ...o } = n;
439
- throw this.invalidateTree(), new w(
440
- `Unexpected resource state transition (${h}): ${L(
441
- o
442
- )} -> ${L(f)}`
435
+ for (const o of e) {
436
+ let i = this.resources.get(o.id);
437
+ const l = i == null ? void 0 : i.state, c = (f) => {
438
+ const { fields: k, ...u } = o;
439
+ throw this.invalidateTree(), new D(
440
+ `Unexpected resource state transition (${f}): ${L(
441
+ u
442
+ )} -> ${L(l)}`
443
443
  );
444
444
  };
445
445
  if (i !== void 0) {
446
- i.final && d("resource state can be updated after it is marked as final");
447
- let h = !1;
448
- i.version += 1, i.originalResourceId !== n.originalResourceId && (i.originalResourceId !== R && d("originalResourceId can't change after it is set"), i.originalResourceId = n.originalResourceId, p(i.resourceStateChange).markChanged(), h = !0), i.error !== n.error && (g(i.error) && d("resource can't change attached error after it is set"), i.error = n.error, r.push(i.error), p(i.resourceStateChange).markChanged(), h = !0);
449
- for (const o of n.fields) {
450
- let l = i.fields.get(o.name);
451
- l ? (l.type !== o.type && (l.type !== "Dynamic" && d(`field changed type ${l.type} -> ${o.type}`), p(i.dynamicFieldListChanged).markChanged(), (l.type === "Input" || l.type === "Service") && (i.inputsLocked && d(
452
- `adding input field "${o.name}", while corresponding list is locked`
453
- ), p(i.inputAndServiceFieldListChanged).markChanged()), l.type === "Output" && (i.outputsLocked && d(
454
- `adding output field "${o.name}", while corresponding list is locked`
455
- ), p(i.outputFieldListChanged).markChanged()), l.type = o.type, l.change.markChanged(), h = !0), l.value !== o.value && (g(l.value) && s.push(l.value), l.value = o.value, g(o.value) && r.push(o.value), l.change.markChanged(), h = !0), l.error !== o.error && (g(l.error) && s.push(l.error), l.error = o.error, g(o.error) && r.push(o.error), l.change.markChanged(), h = !0), l.resourceVersion = i.version) : (l = new T(o.type, o.value, o.error, i.version), g(o.value) && r.push(o.value), g(o.error) && r.push(o.error), o.type === "Input" || o.type === "Service" ? (i.inputsLocked && d(
456
- `adding ${o.type} (${o.name}) field while inputs locked`
457
- ), p(i.inputAndServiceFieldListChanged).markChanged()) : o.type === "Output" ? (i.outputsLocked && d(
458
- `adding ${o.type} (${o.name}) field while outputs locked`
459
- ), p(i.outputFieldListChanged).markChanged()) : p(i.dynamicFieldListChanged).markChanged(), i.fields.set(o.name, l), h = !0);
446
+ i.final && c("resource state can be updated after it is marked as final");
447
+ let f = !1;
448
+ i.version += 1, i.originalResourceId !== o.originalResourceId && (i.originalResourceId !== S && c("originalResourceId can't change after it is set"), i.originalResourceId = o.originalResourceId, y(i.resourceStateChange).markChanged(), f = !0), i.error !== o.error && (g(i.error) && c("resource can't change attached error after it is set"), i.error = o.error, r.push(i.error), y(i.resourceStateChange).markChanged(), f = !0);
449
+ for (const u of o.fields) {
450
+ let h = i.fields.get(u.name);
451
+ h ? (h.type !== u.type && (h.type !== "Dynamic" && c(`field changed type ${h.type} -> ${u.type}`), y(i.dynamicFieldListChanged).markChanged(), (h.type === "Input" || h.type === "Service") && (i.inputsLocked && c(
452
+ `adding input field "${u.name}", while corresponding list is locked`
453
+ ), y(i.inputAndServiceFieldListChanged).markChanged()), h.type === "Output" && (i.outputsLocked && c(
454
+ `adding output field "${u.name}", while corresponding list is locked`
455
+ ), y(i.outputFieldListChanged).markChanged()), h.type = u.type, h.change.markChanged(), f = !0), h.value !== u.value && (g(h.value) && s.push(h.value), h.value = u.value, g(u.value) && r.push(u.value), h.change.markChanged(), f = !0), h.error !== u.error && (g(h.error) && s.push(h.error), h.error = u.error, g(u.error) && r.push(u.error), h.change.markChanged(), f = !0), h.resourceVersion = i.version) : (h = new $(u.type, u.value, u.error, i.version), g(u.value) && r.push(u.value), g(u.error) && r.push(u.error), u.type === "Input" || u.type === "Service" ? (i.inputsLocked && c(
456
+ `adding ${u.type} (${u.name}) field while inputs locked`
457
+ ), y(i.inputAndServiceFieldListChanged).markChanged()) : u.type === "Output" ? (i.outputsLocked && c(
458
+ `adding ${u.type} (${u.name}) field while outputs locked`
459
+ ), y(i.outputFieldListChanged).markChanged()) : y(i.dynamicFieldListChanged).markChanged(), i.fields.set(u.name, h), f = !0);
460
460
  }
461
- if (i.fields.forEach((o, l, C) => {
462
- o.resourceVersion !== i.version && ((o.type === "Input" || o.type === "Service" || o.type === "Output") && d(`removal of ${o.type} field ${l}`), o.change.markChanged(), C.delete(l), g(o.value) && s.push(o.value), g(o.error) && s.push(o.error), p(i.dynamicFieldListChanged).markChanged());
463
- }), i.inputsLocked !== n.inputsLocked && (i.inputsLocked && d("inputs unlocking is not permitted"), i.inputsLocked = n.inputsLocked, p(i.lockedChange).markChanged(), h = !0), i.outputsLocked !== n.outputsLocked && (i.outputsLocked && d("outputs unlocking is not permitted"), i.outputsLocked = n.outputsLocked, p(i.lockedChange).markChanged(), h = !0), i.resourceReady !== n.resourceReady) {
464
- const o = i.resourceReady;
465
- i.resourceReady = n.resourceReady, i.verifyReadyState(), i.isReadyOrError || d(
466
- `resource can't lose it's ready or error state (ready state before ${o})`
467
- ), p(i.resourceStateChange).markChanged(), h = !0;
461
+ if (i.fields.forEach((u, h, p) => {
462
+ u.resourceVersion !== i.version && ((u.type === "Input" || u.type === "Service" || u.type === "Output") && c(`removal of ${u.type} field ${h}`), u.change.markChanged(), p.delete(h), g(u.value) && s.push(u.value), g(u.error) && s.push(u.error), y(i.dynamicFieldListChanged).markChanged());
463
+ }), i.inputsLocked !== o.inputsLocked && (i.inputsLocked && c("inputs unlocking is not permitted"), i.inputsLocked = o.inputsLocked, y(i.lockedChange).markChanged(), f = !0), i.outputsLocked !== o.outputsLocked && (i.outputsLocked && c("outputs unlocking is not permitted"), i.outputsLocked = o.outputsLocked, y(i.lockedChange).markChanged(), f = !0), i.resourceReady !== o.resourceReady) {
464
+ const u = i.resourceReady;
465
+ i.resourceReady = o.resourceReady, i.verifyReadyState(), i.isReadyOrError || c(
466
+ `resource can't lose it's ready or error state (ready state before ${u})`
467
+ ), y(i.resourceStateChange).markChanged(), f = !0;
468
468
  }
469
- let v = !1;
470
- for (const o of n.kv) {
471
- const l = i.kv.get(o.key);
472
- (l === void 0 || Buffer.compare(l, o.value) !== 0) && (i.kv.set(o.key, o.value), v = !0);
469
+ let k = !1;
470
+ for (const u of o.kv) {
471
+ const h = i.kv.get(u.key);
472
+ (h === void 0 || Buffer.compare(h, u.value) !== 0) && (i.kv.set(u.key, u.value), k = !0);
473
473
  }
474
- if (i.kv.size > n.kv.length) {
475
- const o = new Set(n.kv.map((l) => l.key));
476
- i.kv.forEach((l, C, V) => {
477
- o.has(C) || V.delete(C);
478
- }), v = !0;
474
+ if (i.kv.size > o.kv.length) {
475
+ const u = new Set(o.kv.map((h) => h.key));
476
+ i.kv.forEach((h, p, v) => {
477
+ u.has(p) || v.delete(p);
478
+ }), k = !0;
479
479
  }
480
- v && p(i.kvChanged).markChanged(), h && (i.dataVersion = i.version, this.isFinalPredicate(i) && i.markFinal());
480
+ k && y(i.kvChanged).markChanged(), f && (i.dataVersion = i.version, this.isFinalPredicate(i) && i.markFinal());
481
481
  } else {
482
- i = new z(n), i.verifyReadyState(), g(i.error) && r.push(i.error);
483
- for (const h of n.fields) {
484
- const v = new T(h.type, h.value, h.error, D);
485
- g(h.value) && r.push(h.value), g(h.error) && r.push(h.error), i.fields.set(h.name, v);
482
+ i = new G(o), i.verifyReadyState(), g(i.error) && r.push(i.error);
483
+ for (const f of o.fields) {
484
+ const k = new $(f.type, f.value, f.error, F);
485
+ g(f.value) && r.push(f.value), g(f.error) && r.push(f.error), i.fields.set(f.name, k);
486
486
  }
487
- for (const h of n.kv) i.kv.set(h.key, h.value);
487
+ for (const f of o.kv) i.kv.set(f.key, f.value);
488
488
  this.resources.set(i.id, i), this.resourcesAdded.markChanged();
489
489
  }
490
490
  }
491
- for (const n of r) {
492
- const i = this.resources.get(n);
491
+ for (const o of r) {
492
+ const i = this.resources.get(o);
493
493
  if (!i)
494
- throw this.invalidateTree(), new w(`orphan resource ${n}`);
494
+ throw this.invalidateTree(), new D(`orphan resource ${o}`);
495
495
  i.refCount++;
496
496
  }
497
- let c = s;
498
- for (; c.length > 0; ) {
499
- const n = [];
500
- for (const i of c) {
501
- const f = this.resources.get(i);
502
- if (!f)
503
- throw this.invalidateTree(), new w(`orphan resource ${i}`);
504
- f.refCount--, f.refCount === 0 && f.id !== this.root && (f.fields.forEach((d) => {
505
- g(d.value) && n.push(d.value), g(d.error) && n.push(d.error), d.change.markChanged();
506
- }), g(f.error) && n.push(f.error), f.resourceRemoved.markChanged(), this.resources.delete(i));
497
+ let a = s;
498
+ for (; a.length > 0; ) {
499
+ const o = [];
500
+ for (const i of a) {
501
+ const l = this.resources.get(i);
502
+ if (!l)
503
+ throw this.invalidateTree(), new D(`orphan resource ${i}`);
504
+ l.refCount--, l.refCount === 0 && l.id !== this.root && (l.fields.forEach((c) => {
505
+ g(c.value) && o.push(c.value), g(c.error) && o.push(c.error), c.change.markChanged();
506
+ }), g(l.error) && o.push(l.error), l.resourceRemoved.markChanged(), this.resources.delete(i));
507
507
  }
508
- c = n;
508
+ a = o;
509
509
  }
510
510
  if (!t) {
511
- for (const n of e)
512
- if (!this.resources.has(n.id))
513
- throw this.invalidateTree(), new w(`orphan input resource ${n.id}`);
511
+ for (const o of e)
512
+ if (!this.resources.has(o.id))
513
+ throw this.invalidateTree(), new D(`orphan input resource ${o.id}`);
514
514
  }
515
515
  }
516
516
  /** @deprecated use "entry" instead */
@@ -518,7 +518,7 @@ class I {
518
518
  return this.checkValid(), this.entry(e);
519
519
  }
520
520
  entry(e = this.root) {
521
- return this.checkValid(), new k({ treeProvider: () => this }, e);
521
+ return this.checkValid(), new R({ treeProvider: () => this }, e);
522
522
  }
523
523
  invalidateTree(e) {
524
524
  this._isValid = !1, this.invalidationMessage = e, this.resources.forEach((t) => {
@@ -526,118 +526,157 @@ class I {
526
526
  });
527
527
  }
528
528
  }
529
- function q(a, e) {
529
+ function Q(n, e) {
530
530
  const t = [], r = /* @__PURE__ */ new Set();
531
- return a.forEachResource((s) => {
531
+ return n.forEachResource((s) => {
532
532
  s.final ? r.add(s.id) : t.push(s.id);
533
- }), t.length === 0 && r.size === 0 && t.push(a.root), { seedResources: t, finalResources: r, pruningFunction: e };
533
+ }), t.length === 0 && r.size === 0 && t.push(n.root), { seedResources: t, finalResources: r, pruningFunction: e };
534
+ }
535
+ function b() {
536
+ return {
537
+ requests: 0,
538
+ roundtrips: 0,
539
+ retrievedResources: 0,
540
+ retrievedFields: 0,
541
+ retrievedKeyValues: 0,
542
+ retrievedResourceDataBytes: 0,
543
+ prunnedFields: 0,
544
+ finalResourcesSkipped: 0,
545
+ millisSpent: 0
546
+ };
547
+ }
548
+ function de(n) {
549
+ let e = `Requests: ${n.requests}
550
+ `;
551
+ return e += `Total time: ${B(n.millisSpent)}
552
+ `, e += `Roundtrips: ${n.roundtrips}
553
+ `, e += `Resources: ${n.retrievedResources}
554
+ `, e += `Fields: ${n.retrievedFields}
555
+ `, e += `KV: ${n.retrievedKeyValues}
556
+ `, e += `Data Bytes: ${n.retrievedResourceDataBytes}
557
+ `, e += `Pruned fields: ${n.prunnedFields}
558
+ `, e += `Final resources skipped: ${n.finalResourcesSkipped}`, e;
534
559
  }
535
- async function B(a, e) {
536
- const { seedResources: t, finalResources: r, pruningFunction: s } = e, c = new K(), n = /* @__PURE__ */ new Set(), i = (d) => {
537
- if (A(d) || n.has(d) || r.has(d)) return;
538
- n.add(d);
539
- const h = a.getResourceDataIfExists(d, !0), v = a.listKeyValuesIfResourceExists(d);
540
- c.push(
560
+ async function X(n, e, t) {
561
+ var h;
562
+ const r = Date.now();
563
+ t && t.requests++;
564
+ const { seedResources: s, finalResources: a, pruningFunction: o } = e, i = new H();
565
+ let l = !0, c = 0;
566
+ const f = /* @__PURE__ */ new Set(), k = (p) => {
567
+ if (V(p) || f.has(p)) return;
568
+ if (a.has(p)) {
569
+ t && t.finalResourcesSkipped++;
570
+ return;
571
+ }
572
+ f.add(p);
573
+ const v = n.getResourceDataIfExists(p, !0), w = n.listKeyValuesIfResourceExists(p), U = l;
574
+ l && (l = !1), i.push(
541
575
  (async () => {
542
- const o = await h, l = await v;
543
- if (o !== void 0) {
544
- if (l === void 0) throw new Error("Inconsistent replies");
545
- return { ...o, kv: l };
576
+ const [T, _] = await Promise.all([v, w]);
577
+ if (U && (c++, l = !0), T !== void 0) {
578
+ if (_ === void 0) throw new Error("Inconsistent replies");
579
+ return { ...T, kv: _ };
546
580
  }
547
581
  })()
548
582
  );
549
583
  };
550
- t.forEach((d) => i(d));
551
- const f = [];
584
+ s.forEach((p) => k(p));
585
+ const u = [];
552
586
  for (; ; ) {
553
- const d = c.shift();
554
- if (d === void 0)
587
+ const p = i.shift();
588
+ if (p === void 0)
555
589
  break;
556
- let h = await d;
557
- if (h !== void 0) {
558
- s !== void 0 && (h = { ...h, fields: s(h) }), i(h.error);
559
- for (const v of h.fields)
560
- i(v.value), i(v.error);
561
- f.push(h);
590
+ let v = await p;
591
+ if (v !== void 0) {
592
+ if (o !== void 0) {
593
+ const w = o(v);
594
+ t && (t.prunnedFields += v.fields.length - w.length), v = { ...v, fields: w };
595
+ }
596
+ k(v.error);
597
+ for (const w of v.fields)
598
+ k(w.value), k(w.error);
599
+ t && (t.retrievedResources++, t.retrievedFields += v.fields.length, t.retrievedKeyValues += v.kv.length, t.retrievedResourceDataBytes += ((h = v.data) == null ? void 0 : h.length) ?? 0), u.push(v);
562
600
  }
563
601
  }
564
- return f;
602
+ return t && (t.millisSpent += Date.now() - r, t.roundtrips += c), u;
565
603
  }
566
- function ie(a) {
567
- return a;
604
+ function ce(n) {
605
+ return n;
568
606
  }
569
- function se(a, e, t) {
570
- var n;
571
- const r = a instanceof k ? p(t).accessor(a).node() : a instanceof E ? a.node() : a, c = { ...r.resourceInfo };
572
- if (e.data !== void 0 && (e.data === "raw" ? c.data = r.getData() : c.data = e.data.parse(r.getDataAsJson())), e.fields !== void 0) {
607
+ function he(n, e, t) {
608
+ var o;
609
+ const r = n instanceof R ? y(t).accessor(n).node() : n instanceof E ? n.node() : n, a = { ...r.resourceInfo };
610
+ if (e.data !== void 0 && (e.data === "raw" ? a.data = r.getData() : a.data = e.data.parse(r.getDataAsJson())), e.fields !== void 0) {
573
611
  const i = {};
574
- for (const [f, d] of Object.entries(e.fields))
575
- i[f] = (n = r.traverse({
576
- field: f,
577
- errorIfFieldNotSet: d,
578
- stableIfNotFound: !d
579
- })) == null ? void 0 : n.id;
580
- c.fields = i;
612
+ for (const [l, c] of Object.entries(e.fields))
613
+ i[l] = (o = r.traverse({
614
+ field: l,
615
+ errorIfFieldNotSet: c,
616
+ stableIfNotFound: !c
617
+ })) == null ? void 0 : o.id;
618
+ a.fields = i;
581
619
  }
582
620
  if (e.kv !== void 0) {
583
621
  const i = {};
584
- for (const [f, d] of Object.entries(e.kv)) {
585
- const h = r.getKeyValue(f);
586
- if (h === void 0)
587
- throw new Error(`Key not found ${f}`);
588
- d === "raw" ? i[f] = h : i[f] = d.parse(JSON.parse(Buffer.from(h).toString("utf-8")));
622
+ for (const [l, c] of Object.entries(e.kv)) {
623
+ const f = r.getKeyValue(l);
624
+ if (f === void 0)
625
+ throw new Error(`Key not found ${l}`);
626
+ c === "raw" ? i[l] = f : i[l] = c.parse(JSON.parse(Buffer.from(f).toString("utf-8")));
589
627
  }
590
- c.kv = i;
628
+ a.kv = i;
591
629
  }
592
- return c;
630
+ return a;
593
631
  }
594
- function ne(a, e, t) {
595
- if (a instanceof k) {
596
- const r = t.accessor(a).node(), s = r.resourceInfo, c = e.map((n) => {
597
- var i, f;
632
+ function le(n, e, t) {
633
+ if (n instanceof R) {
634
+ const r = t.accessor(n).node(), s = r.resourceInfo, a = e.map((o) => {
635
+ var i, l;
598
636
  return [
599
- n,
600
- (f = (i = r.getField(n)) == null ? void 0 : i.value) == null ? void 0 : f.id
637
+ o,
638
+ (l = (i = r.getField(o)) == null ? void 0 : i.value) == null ? void 0 : l.id
601
639
  ];
602
640
  });
603
641
  return {
604
642
  ...s,
605
- fields: new Map(c),
643
+ fields: new Map(a),
606
644
  data: r.getData() ?? new Uint8Array()
607
645
  };
608
646
  }
609
- return a;
647
+ return n;
610
648
  }
611
- function ae(a, e, t) {
612
- if (!(a instanceof k)) return a;
613
- const r = t.accessor(a).node(), s = r.resourceInfo, c = e.map((n) => [n, r.getKeyValue(n)]);
649
+ function fe(n, e, t) {
650
+ if (!(n instanceof R)) return n;
651
+ const r = t.accessor(n).node(), s = r.resourceInfo, a = e.map((o) => [o, r.getKeyValue(o)]);
614
652
  return {
615
653
  ...s,
616
- metadata: Object.fromEntries(c)
654
+ metadata: Object.fromEntries(a)
617
655
  };
618
656
  }
619
- class b {
657
+ class K {
620
658
  constructor(e, t, r, s) {
621
- u(this, "finalPredicate");
622
- u(this, "state");
623
- u(this, "pollingInterval");
624
- u(this, "pruning");
625
- u(this, "hooks");
626
- u(this, "abortController", new AbortController());
627
- u(this, "scheduledOnNextState", []);
659
+ d(this, "finalPredicate");
660
+ d(this, "state");
661
+ d(this, "pollingInterval");
662
+ d(this, "pruning");
663
+ d(this, "logStat");
664
+ d(this, "hooks");
665
+ d(this, "abortController", new AbortController());
666
+ d(this, "scheduledOnNextState", []);
628
667
  /** If true, main loop will continue polling pl state. */
629
- u(this, "keepRunning", !1);
668
+ d(this, "keepRunning", !1);
630
669
  /** Actual state of main loop. */
631
- u(this, "currentLoop");
670
+ d(this, "currentLoop");
632
671
  /** If true this tree state is permanently terminaed. */
633
- u(this, "terminated", !1);
672
+ d(this, "terminated", !1);
634
673
  this.pl = e, this.root = t, this.logger = s;
635
- const { finalPredicate: c, pruning: n, pollingInterval: i, stopPollingDelay: f } = r;
636
- this.pruning = n, this.pollingInterval = i, this.finalPredicate = c, this.state = new I(t, c), this.hooks = new U(
674
+ const { finalPredicate: a, pruning: o, pollingInterval: i, stopPollingDelay: l, logStat: c } = r;
675
+ this.pruning = o, this.pollingInterval = i, this.finalPredicate = a, this.logStat = c, this.state = new O(t, a), this.hooks = new z(
637
676
  () => this.startUpdating(),
638
677
  () => this.stopUpdating(),
639
- { stopDebounce: f },
640
- (d, h) => this.scheduleOnNextState(d, h)
678
+ { stopDebounce: l },
679
+ (f, k) => this.scheduleOnNextState(f, k)
641
680
  );
642
681
  }
643
682
  /** @deprecated use "entry" instead */
@@ -647,7 +686,7 @@ class b {
647
686
  }
648
687
  entry(e = this.root) {
649
688
  if (this.terminated) throw new Error("tree synchronization is terminated");
650
- return new k({ treeProvider: () => this.state, hooks: this.hooks }, e);
689
+ return new R({ treeProvider: () => this.state, hooks: this.hooks }, e);
651
690
  }
652
691
  /** Can be used to externally kick off the synchronization polling loop, and
653
692
  * await for the first synchronization to happen. */
@@ -667,30 +706,31 @@ class b {
667
706
  this.keepRunning = !1;
668
707
  }
669
708
  /** Executed from the main loop, and initialization procedure. */
670
- async refresh() {
709
+ async refresh(e) {
671
710
  if (this.terminated) throw new Error("tree synchronization is terminated");
672
- const e = q(this.state, this.pruning), t = await this.pl.withReadTx("ReadingTree", async (r) => await B(r, e));
673
- this.state.updateFromResourceData(t, !0);
711
+ const t = Q(this.state, this.pruning), r = await this.pl.withReadTx("ReadingTree", async (s) => await X(s, t, e));
712
+ this.state.updateFromResourceData(r, !0);
674
713
  }
675
714
  async mainLoop() {
676
- var e, t;
715
+ var t, r;
716
+ let e = this.logStat ? b() : void 0;
677
717
  for (; this.keepRunning; ) {
678
- let r;
679
- this.scheduledOnNextState.length > 0 && (r = this.scheduledOnNextState, this.scheduledOnNextState = []);
718
+ let s;
719
+ this.scheduledOnNextState.length > 0 && (s = this.scheduledOnNextState, this.scheduledOnNextState = []);
680
720
  try {
681
- if (await this.refresh(), r !== void 0) for (const s of r) s.resolve();
682
- } catch (s) {
683
- if (r !== void 0) for (const c of r) c.reject(s);
684
- if (s instanceof w) {
685
- (e = this.logger) == null || e.error(s), this.state.invalidateTree("stat update error"), this.state = new I(this.root, this.finalPredicate);
721
+ if (this.logStat === "per-request" && (e = b()), await this.refresh(e), e && this.logger && this.logger.info(`Tree stat (success): ${JSON.stringify(e)}`), s !== void 0) for (const a of s) a.resolve();
722
+ } catch (a) {
723
+ if (e && this.logger && this.logger.info(`Tree stat (error): ${JSON.stringify(e)}`), s !== void 0) for (const o of s) o.reject(a);
724
+ if (a instanceof D) {
725
+ (t = this.logger) == null || t.error(a), this.state.invalidateTree("stat update error"), this.state = new O(this.root, this.finalPredicate);
686
726
  continue;
687
- } else (t = this.logger) == null || t.warn(s);
727
+ } else (r = this.logger) == null || r.warn(a);
688
728
  }
689
729
  if (!this.keepRunning || this.terminated) break;
690
730
  try {
691
- await J.setTimeout(this.pollingInterval, this.abortController.signal);
692
- } catch (s) {
693
- if (!W(s)) throw new Error("Unexpected error", { cause: s });
731
+ await j.setTimeout(this.pollingInterval, this.abortController.signal);
732
+ } catch (a) {
733
+ if (!M(a)) throw new Error("Unexpected error", { cause: a });
694
734
  break;
695
735
  }
696
736
  }
@@ -707,31 +747,33 @@ class b {
707
747
  async awaitSyncLoopTermination() {
708
748
  this.currentLoop !== void 0 && await this.currentLoop;
709
749
  }
710
- static async init(e, t, r) {
711
- const s = new b(e, t, r);
712
- return await s.refresh(), s;
750
+ static async init(e, t, r, s) {
751
+ const a = new K(e, t, r, s);
752
+ return await a.refresh(), a;
713
753
  }
714
754
  }
715
755
  export {
716
- O as PlError,
717
- k as PlTreeEntry,
756
+ N as PlError,
757
+ R as PlTreeEntry,
718
758
  E as PlTreeEntryAccessor,
719
- M as PlTreeNodeAccessor,
720
- z as PlTreeResource,
721
- I as PlTreeState,
722
- b as SynchronizedTreeState,
723
- w as TreeStateUpdateError,
724
- q as constructTreeLoadingRequest,
725
- Z as isPlTreeEntry,
726
- ee as isPlTreeEntryAccessor,
727
- te as isPlTreeNodeAccessor,
728
- B as loadTreeState,
729
- se as makeResourceSnapshot,
730
- x as mapValueAndError,
731
- X as mapValueAndErrorIfDefined,
732
- ie as rsSchema,
733
- re as treeEntryToResourceInfo,
734
- ne as treeEntryToResourceWithData,
735
- ae as treeEntryToResourceWithMetadata
759
+ Y as PlTreeNodeAccessor,
760
+ G as PlTreeResource,
761
+ O as PlTreeState,
762
+ K as SynchronizedTreeState,
763
+ D as TreeStateUpdateError,
764
+ Q as constructTreeLoadingRequest,
765
+ de as formatTreeLoadingStat,
766
+ b as initialTreeLoadingStat,
767
+ ne as isPlTreeEntry,
768
+ oe as isPlTreeEntryAccessor,
769
+ ae as isPlTreeNodeAccessor,
770
+ X as loadTreeState,
771
+ he as makeResourceSnapshot,
772
+ P as mapValueAndError,
773
+ se as mapValueAndErrorIfDefined,
774
+ ce as rsSchema,
775
+ ue as treeEntryToResourceInfo,
776
+ le as treeEntryToResourceWithData,
777
+ fe as treeEntryToResourceWithMetadata
736
778
  };
737
779
  //# sourceMappingURL=index.mjs.map