@metapages/metapage 1.8.15 → 1.8.17

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.js CHANGED
@@ -1,19 +1,19 @@
1
- const Ct = ["0.3", "0.4", "0.5", "0.6", "1", "2"], $t = ["0.2", "0.3", "1", "2"], We = "2", Le = "2", Mi = "metaframe.json", Ii = "metapage/definition", Ci = "metapage/state", Wt = $t[$t.length - 1], En = Ct[Ct.length - 1], Mn = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, xt = (t) => {
1
+ const It = ["0.3", "0.4", "0.5", "0.6", "1", "2"], Ct = ["0.2", "0.3", "1", "2"], We = "2", Le = "2", Mi = "metaframe.json", Ii = "metapage/definition", Ci = "metapage/state", Jt = Ct[Ct.length - 1], En = It[It.length - 1], Mn = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, $t = (t) => {
2
2
  if (typeof t != "string")
3
3
  throw new TypeError("Invalid argument expected string");
4
4
  const e = t.match(Mn);
5
5
  if (!e)
6
6
  throw new Error(`Invalid argument not valid semver ('${t}' received)`);
7
7
  return e.shift(), e;
8
- }, Lt = (t) => t === "*" || t === "x" || t === "X", Tt = (t) => {
8
+ }, xt = (t) => t === "*" || t === "x" || t === "X", Lt = (t) => {
9
9
  const e = parseInt(t, 10);
10
10
  return isNaN(e) ? t : e;
11
11
  }, In = (t, e) => typeof t != typeof e ? [String(t), String(e)] : [t, e], Cn = (t, e) => {
12
- if (Lt(t) || Lt(e))
12
+ if (xt(t) || xt(e))
13
13
  return 0;
14
- const [n, s] = In(Tt(t), Tt(e));
14
+ const [n, s] = In(Lt(t), Lt(e));
15
15
  return n > s ? 1 : n < s ? -1 : 0;
16
- }, Pt = (t, e) => {
16
+ }, Tt = (t, e) => {
17
17
  for (let n = 0; n < Math.max(t.length, e.length); n++) {
18
18
  const s = Cn(t[n] || "0", e[n] || "0");
19
19
  if (s !== 0)
@@ -21,14 +21,14 @@ const Ct = ["0.3", "0.4", "0.5", "0.6", "1", "2"], $t = ["0.2", "0.3", "1", "2"]
21
21
  }
22
22
  return 0;
23
23
  }, j = (t, e) => {
24
- const n = xt(t), s = xt(e), i = n.pop(), o = s.pop(), r = Pt(n, s);
25
- return r !== 0 ? r : i && o ? Pt(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
24
+ const n = $t(t), s = $t(e), i = n.pop(), o = s.pop(), r = Tt(n, s);
25
+ return r !== 0 ? r : i && o ? Tt(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
26
26
  };
27
27
  var $n = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
28
- function yt(t) {
28
+ function mt(t) {
29
29
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
30
30
  }
31
- var Kt = { exports: {} };
31
+ var Wt = { exports: {} };
32
32
  (function(t, e) {
33
33
  (function(n, s) {
34
34
  t.exports = s();
@@ -115,20 +115,20 @@ var Kt = { exports: {} };
115
115
  }
116
116
  return n;
117
117
  });
118
- })(Kt);
119
- var xn = Kt.exports;
120
- const gt = /* @__PURE__ */ yt(xn), G = {
118
+ })(Wt);
119
+ var xn = Wt.exports;
120
+ const yt = /* @__PURE__ */ mt(xn), G = {
121
121
  Remove: "remove",
122
122
  Replace: "replace",
123
123
  Add: "add"
124
- }, Xt = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Ln = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), Be = Symbol.iterator, Z = {
124
+ }, Kt = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Ln = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), Be = Symbol.iterator, Z = {
125
125
  mutable: "mutable",
126
126
  immutable: "immutable"
127
- }, _t = {};
127
+ }, gt = {};
128
128
  function Ie(t, e) {
129
129
  return t instanceof Map ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
130
130
  }
131
- function Dt(t, e) {
131
+ function Pt(t, e) {
132
132
  if (e in t) {
133
133
  let n = Reflect.getPrototypeOf(t);
134
134
  for (; n; ) {
@@ -147,9 +147,9 @@ function be(t) {
147
147
  return !!P(t);
148
148
  }
149
149
  function P(t) {
150
- return typeof t != "object" ? null : t == null ? void 0 : t[Xt];
150
+ return typeof t != "object" ? null : t == null ? void 0 : t[Kt];
151
151
  }
152
- function bt(t) {
152
+ function _t(t) {
153
153
  var e;
154
154
  const n = P(t);
155
155
  return n ? (e = n.copy) !== null && e !== void 0 ? e : n.original : t;
@@ -160,9 +160,9 @@ function se(t, e) {
160
160
  let n;
161
161
  return Object.getPrototypeOf(t) === Object.prototype || Array.isArray(t) || t instanceof Map || t instanceof Set || !!(e != null && e.mark) && ((n = e.mark(t, Z)) === Z.immutable || typeof n == "function");
162
162
  }
163
- function qt(t, e = []) {
163
+ function Xt(t, e = []) {
164
164
  if (Object.hasOwnProperty.call(t, "key")) {
165
- const n = t.parent.copy, s = P(he(n, t.key));
165
+ const n = t.parent.copy, s = P(pe(n, t.key));
166
166
  if (s !== null && (s == null ? void 0 : s.original) !== t.original)
167
167
  return null;
168
168
  const i = t.parent.type === 3, o = i ? Array.from(t.parent.setMap.keys()).indexOf(t.key) : t.key;
@@ -171,7 +171,7 @@ function qt(t, e = []) {
171
171
  e.push(o);
172
172
  }
173
173
  if (t.parent)
174
- return qt(t.parent, e);
174
+ return Xt(t.parent, e);
175
175
  e.reverse();
176
176
  try {
177
177
  Tn(t.copy, e);
@@ -183,7 +183,7 @@ function qt(t, e = []) {
183
183
  function we(t) {
184
184
  return Array.isArray(t) ? 1 : t instanceof Map ? 2 : t instanceof Set ? 3 : 0;
185
185
  }
186
- function he(t, e) {
186
+ function pe(t, e) {
187
187
  return we(t) === 2 ? t.get(e) : t[e];
188
188
  }
189
189
  function Te(t, e, n) {
@@ -193,7 +193,7 @@ function et(t, e) {
193
193
  const n = P(t);
194
194
  return (n ? Y(n) : t)[e];
195
195
  }
196
- function pe(t, e) {
196
+ function fe(t, e) {
197
197
  return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
198
198
  }
199
199
  function ot(t) {
@@ -210,7 +210,7 @@ function _e(t, e) {
210
210
  function Tn(t, e) {
211
211
  for (let n = 0; n < e.length - 1; n += 1) {
212
212
  const s = e[n];
213
- if (t = he(we(t) === 3 ? Array.from(t) : t, s), typeof t != "object")
213
+ if (t = pe(we(t) === 3 ? Array.from(t) : t, s), typeof t != "object")
214
214
  throw new Error(`Cannot resolve patch at '${e.join("/")}'.`);
215
215
  }
216
216
  return t;
@@ -232,7 +232,7 @@ function Pn(t) {
232
232
  }), e;
233
233
  }
234
234
  const Dn = Object.prototype.propertyIsEnumerable;
235
- function Qt(t, e) {
235
+ function qt(t, e) {
236
236
  let n;
237
237
  if (Array.isArray(t))
238
238
  return Array.prototype.concat.call(t);
@@ -260,11 +260,11 @@ function Qt(t, e) {
260
260
  throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
261
261
  }
262
262
  function X(t) {
263
- t.copy || (t.copy = Qt(t.original, t.options));
263
+ t.copy || (t.copy = qt(t.original, t.options));
264
264
  }
265
265
  function Ae(t) {
266
266
  if (!se(t))
267
- return bt(t);
267
+ return _t(t);
268
268
  if (Array.isArray(t))
269
269
  return t.map(Ae);
270
270
  if (t instanceof Map)
@@ -283,7 +283,7 @@ function ue(t) {
283
283
  var e;
284
284
  t.assignedMap = (e = t.assignedMap) !== null && e !== void 0 ? e : /* @__PURE__ */ new Map(), t.operated || (t.operated = !0, t.parent && ue(t.parent));
285
285
  }
286
- function kt() {
286
+ function Dt() {
287
287
  throw new Error("Cannot modify frozen object");
288
288
  }
289
289
  function Re(t, e, n, s, i) {
@@ -311,12 +311,12 @@ function Re(t, e, n, s, i) {
311
311
  case 2:
312
312
  for (const [a, u] of t)
313
313
  Re(a, a, n, s, i), Re(u, a, n, s, i);
314
- t.set = t.clear = t.delete = kt;
314
+ t.set = t.clear = t.delete = Dt;
315
315
  break;
316
316
  case 3:
317
317
  for (const a of t)
318
318
  Re(a, a, n, s, i);
319
- t.add = t.clear = t.delete = kt;
319
+ t.add = t.clear = t.delete = Dt;
320
320
  break;
321
321
  case 1:
322
322
  Object.freeze(t);
@@ -332,7 +332,7 @@ function Re(t, e, n, s, i) {
332
332
  }
333
333
  s.pop(), i.pop();
334
334
  }
335
- function wt(t, e) {
335
+ function bt(t, e) {
336
336
  const n = we(t);
337
337
  if (n === 0)
338
338
  Reflect.ownKeys(t).forEach((s) => {
@@ -345,11 +345,11 @@ function wt(t, e) {
345
345
  } else
346
346
  t.forEach((s, i) => e(i, s, t));
347
347
  }
348
- function Yt(t, e, n) {
348
+ function Qt(t, e, n) {
349
349
  if (be(t) || !se(t, n) || e.has(t) || Object.isFrozen(t))
350
350
  return;
351
351
  const s = t instanceof Set, i = s ? /* @__PURE__ */ new Map() : void 0;
352
- if (e.add(t), wt(t, (o, r) => {
352
+ if (e.add(t), bt(t, (o, r) => {
353
353
  var a;
354
354
  if (be(r)) {
355
355
  const u = P(r);
@@ -357,7 +357,7 @@ function Yt(t, e, n) {
357
357
  const l = !((a = u.assignedMap) === null || a === void 0) && a.size || u.operated ? u.copy : u.original;
358
358
  Te(s ? i : t, o, l);
359
359
  } else
360
- Yt(r, e, n);
360
+ Qt(r, e, n);
361
361
  }), i) {
362
362
  const o = t, r = Array.from(o);
363
363
  o.clear(), r.forEach((a) => {
@@ -367,34 +367,34 @@ function Yt(t, e, n) {
367
367
  }
368
368
  function kn(t, e) {
369
369
  const n = t.type === 3 ? t.setMap : t.copy;
370
- t.finalities.revoke.length > 1 && t.assignedMap.get(e) && n && Yt(he(n, e), t.finalities.handledSet, t.options);
370
+ t.finalities.revoke.length > 1 && t.assignedMap.get(e) && n && Qt(pe(n, e), t.finalities.handledSet, t.options);
371
371
  }
372
372
  function at(t) {
373
373
  t.type === 3 && t.copy && (t.copy.clear(), t.setMap.forEach((e) => {
374
- t.copy.add(bt(e));
374
+ t.copy.add(_t(e));
375
375
  }));
376
376
  }
377
377
  function ut(t, e, n, s) {
378
378
  if (t.operated && t.assignedMap && t.assignedMap.size > 0 && !t.finalized) {
379
379
  if (n && s) {
380
- const o = qt(t);
380
+ const o = Xt(t);
381
381
  o && e(t, o, n, s);
382
382
  }
383
383
  t.finalized = !0;
384
384
  }
385
385
  }
386
- function vt(t, e, n, s) {
386
+ function wt(t, e, n, s) {
387
387
  const i = P(n);
388
388
  i && (i.callbacks || (i.callbacks = []), i.callbacks.push((o, r) => {
389
389
  var a;
390
390
  const u = t.type === 3 ? t.setMap : t.copy;
391
- if (pe(he(u, e), n)) {
391
+ if (fe(pe(u, e), n)) {
392
392
  let l = i.original;
393
393
  i.copy && (l = i.copy), at(t), ut(t, s, o, r), t.options.enableAutoFreeze && (t.options.updatedValues = (a = t.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(l, i.original)), Te(u, e, l);
394
394
  }
395
395
  }), t.options.enableAutoFreeze && i.finalities !== t.finalities && (t.options.enableAutoFreeze = !1)), se(n, t.options) && t.finalities.draft.push(() => {
396
396
  const o = t.type === 3 ? t.setMap : t.copy;
397
- pe(he(o, e), n) && kn(t, e);
397
+ fe(pe(o, e), n) && kn(t, e);
398
398
  });
399
399
  }
400
400
  function Hn(t, e, n, s, i) {
@@ -445,8 +445,8 @@ function Hn(t, e, n, s, i) {
445
445
  }
446
446
  function Nn({ original: t, copy: e, assignedMap: n }, s, i, o, r) {
447
447
  n.forEach((a, u) => {
448
- const l = he(t, u), c = Fe(he(e, u)), d = a ? Ie(t, u) ? G.Replace : G.Add : G.Remove;
449
- if (pe(l, c) && d === G.Replace)
448
+ const l = pe(t, u), c = Fe(pe(e, u)), d = a ? Ie(t, u) ? G.Replace : G.Add : G.Remove;
449
+ if (fe(l, c) && d === G.Replace)
450
450
  return;
451
451
  const g = s.concat(u), v = _e(g, r);
452
452
  i.push(d === G.Remove ? { op: d, path: v } : { op: d, path: v, value: c }), o.push(d === G.Add ? { op: G.Remove, path: v } : d === G.Remove ? { op: G.Add, path: v, value: l } : { op: G.Replace, path: v, value: l });
@@ -509,7 +509,7 @@ const ze = (t, e, n = !1) => {
509
509
  },
510
510
  set(t, e) {
511
511
  const n = P(this), s = Y(n);
512
- return (!s.has(t) || !pe(s.get(t), e)) && (X(n), ue(n), n.assignedMap.set(t, !0), n.copy.set(t, e), vt(n, t, e, $e)), this;
512
+ return (!s.has(t) || !fe(s.get(t), e)) && (X(n), ue(n), n.assignedMap.set(t, !0), n.copy.set(t, e), wt(n, t, e, $e)), this;
513
513
  },
514
514
  delete(t) {
515
515
  if (!this.has(t))
@@ -537,7 +537,7 @@ const ze = (t, e, n = !1) => {
537
537
  const s = P(this), i = Y(s).get(t), o = ((n = (e = s.options).mark) === null || n === void 0 ? void 0 : n.call(e, i, Z)) === Z.mutable;
538
538
  if (s.options.strict && ze(i, s.options, o), o || s.finalized || !se(i, s.options) || i !== s.original.get(t))
539
539
  return i;
540
- const r = _t.createDraft({
540
+ const r = gt.createDraft({
541
541
  original: i,
542
542
  parentDraft: s,
543
543
  key: t,
@@ -581,7 +581,7 @@ const ze = (t, e, n = !1) => {
581
581
  [Be]() {
582
582
  return this.entries();
583
583
  }
584
- }, Bn = Reflect.ownKeys(ct), Ht = (t, e, { isValuesIterator: n }) => () => {
584
+ }, Bn = Reflect.ownKeys(ct), kt = (t, e, { isValuesIterator: n }) => () => {
585
585
  var s, i;
586
586
  const o = e.next();
587
587
  if (o.done)
@@ -590,7 +590,7 @@ const ze = (t, e, n = !1) => {
590
590
  let a = t.setMap.get(r);
591
591
  const u = P(a), l = ((i = (s = t.options).mark) === null || i === void 0 ? void 0 : i.call(s, a, Z)) === Z.mutable;
592
592
  if (t.options.strict && ze(r, t.options, l), !l && !u && se(r, t.options) && !t.finalized && t.original.has(r)) {
593
- const c = _t.createDraft({
593
+ const c = gt.createDraft({
594
594
  original: r,
595
595
  parentDraft: t,
596
596
  key: r,
@@ -618,7 +618,7 @@ const ze = (t, e, n = !1) => {
618
618
  },
619
619
  add(t) {
620
620
  const e = P(this);
621
- return this.has(t) || (X(e), ue(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), vt(e, t, t, $e)), this;
621
+ return this.has(t) || (X(e), ue(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), wt(e, t, t, $e)), this;
622
622
  },
623
623
  delete(t) {
624
624
  if (!this.has(t))
@@ -643,7 +643,7 @@ const ze = (t, e, n = !1) => {
643
643
  const e = t.setMap.keys();
644
644
  return {
645
645
  [Symbol.iterator]: () => this.values(),
646
- next: Ht(t, e, { isValuesIterator: !0 })
646
+ next: kt(t, e, { isValuesIterator: !0 })
647
647
  };
648
648
  },
649
649
  entries() {
@@ -652,7 +652,7 @@ const ze = (t, e, n = !1) => {
652
652
  const e = t.setMap.keys();
653
653
  return {
654
654
  [Symbol.iterator]: () => this.entries(),
655
- next: Ht(t, e, {
655
+ next: kt(t, e, {
656
656
  isValuesIterator: !1
657
657
  })
658
658
  };
@@ -669,13 +669,13 @@ const ze = (t, e, n = !1) => {
669
669
  for (; !s.done; )
670
670
  t.call(e, s.value, s.value, this), s = n.next();
671
671
  }
672
- }, Fn = Reflect.ownKeys(lt), Zt = /* @__PURE__ */ new WeakSet(), en = {
672
+ }, Fn = Reflect.ownKeys(lt), Yt = /* @__PURE__ */ new WeakSet(), Zt = {
673
673
  get(t, e, n) {
674
674
  var s, i;
675
675
  const o = (s = t.copy) === null || s === void 0 ? void 0 : s[e];
676
- if (o && Zt.has(o))
676
+ if (o && Yt.has(o))
677
677
  return o;
678
- if (e === Xt)
678
+ if (e === Kt)
679
679
  return t;
680
680
  let r;
681
681
  if (t.options.mark) {
@@ -699,7 +699,7 @@ const ze = (t, e, n = !1) => {
699
699
  return l.bind(t.proxy);
700
700
  }
701
701
  if (!Ie(a, e)) {
702
- const l = Dt(a, e);
702
+ const l = Pt(a, e);
703
703
  return l ? "value" in l ? l.value : (
704
704
  // !case: support for getter
705
705
  (i = l.get) === null || i === void 0 ? void 0 : i.call(t.proxy)
@@ -709,7 +709,7 @@ const ze = (t, e, n = !1) => {
709
709
  if (t.options.strict && ze(u, t.options), t.finalized || !se(u, t.options))
710
710
  return u;
711
711
  if (u === et(t.original, e)) {
712
- if (X(t), t.copy[e] = Rt({
712
+ if (X(t), t.copy[e] = vt({
713
713
  original: t.original[e],
714
714
  parentDraft: t,
715
715
  key: t.type === 1 ? Number(e) : e,
@@ -730,11 +730,11 @@ const ze = (t, e, n = !1) => {
730
730
  let i;
731
731
  if (t.type === 1 && e !== "length" && !(Number.isInteger(i = Number(e)) && i >= 0 && (e === 0 || i === 0 || String(i) === String(e))))
732
732
  throw new Error("Only supports setting array indices and the 'length' property.");
733
- const o = Dt(Y(t), e);
733
+ const o = Pt(Y(t), e);
734
734
  if (o != null && o.set)
735
735
  return o.set.call(t.proxy, n), !0;
736
736
  const r = et(Y(t), e), a = P(r);
737
- return a && pe(a.original, n) ? (t.copy[e] = n, t.assignedMap = (s = t.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (pe(n, r) && (n !== void 0 || Ie(t.original, e)) || (X(t), ue(t), Ie(t.original, e) && pe(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, vt(t, e, n, $e)), !0);
737
+ return a && fe(a.original, n) ? (t.copy[e] = n, t.assignedMap = (s = t.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (fe(n, r) && (n !== void 0 || Ie(t.original, e)) || (X(t), ue(t), Ie(t.original, e) && fe(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, wt(t, e, n, $e)), !0);
738
738
  },
739
739
  has(t, e) {
740
740
  return e in Y(t);
@@ -762,10 +762,10 @@ const ze = (t, e, n = !1) => {
762
762
  },
763
763
  deleteProperty(t, e) {
764
764
  var n;
765
- return t.type === 1 ? en.set.call(this, t, e, void 0, t.proxy) : (et(t.original, e) !== void 0 || e in t.original ? (X(t), ue(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
765
+ return t.type === 1 ? Zt.set.call(this, t, e, void 0, t.proxy) : (et(t.original, e) !== void 0 || e in t.original ? (X(t), ue(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
766
766
  }
767
767
  };
768
- function Rt(t) {
768
+ function vt(t) {
769
769
  const { original: e, parentDraft: n, key: s, finalities: i, options: o } = t, r = we(e), a = {
770
770
  type: r,
771
771
  finalized: !1,
@@ -779,17 +779,17 @@ function Rt(t) {
779
779
  setMap: r === 3 ? new Map(e.entries()) : void 0
780
780
  };
781
781
  (s || "key" in t) && (a.key = s);
782
- const { proxy: u, revoke: l } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, en);
783
- if (i.revoke.push(l), Zt.add(u), a.proxy = u, n) {
782
+ const { proxy: u, revoke: l } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, Zt);
783
+ if (i.revoke.push(l), Yt.add(u), a.proxy = u, n) {
784
784
  const c = n;
785
785
  c.finalities.draft.push((d, g) => {
786
786
  var v, y;
787
787
  const R = P(u);
788
788
  let w = c.type === 3 ? c.setMap : c.copy;
789
- const $ = he(w, s), b = P($);
789
+ const $ = pe(w, s), b = P($);
790
790
  if (b) {
791
791
  let A = b.original;
792
- b.operated && (A = bt($)), at(b), ut(b, $e, d, g), c.options.enableAutoFreeze && (c.options.updatedValues = (v = c.options.updatedValues) !== null && v !== void 0 ? v : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(A, b.original)), Te(w, s, A);
792
+ b.operated && (A = _t($)), at(b), ut(b, $e, d, g), c.options.enableAutoFreeze && (c.options.updatedValues = (v = c.options.updatedValues) !== null && v !== void 0 ? v : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(A, b.original)), Te(w, s, A);
793
793
  }
794
794
  (y = R.callbacks) === null || y === void 0 || y.forEach((A) => {
795
795
  A(d, g);
@@ -803,7 +803,7 @@ function Rt(t) {
803
803
  }
804
804
  return u;
805
805
  }
806
- _t.createDraft = Rt;
806
+ gt.createDraft = vt;
807
807
  function zn(t, e, n, s, i) {
808
808
  var o;
809
809
  const r = P(t), a = (o = r == null ? void 0 : r.original) !== null && o !== void 0 ? o : t, u = !!e.length;
@@ -826,7 +826,7 @@ function Gn(t, e) {
826
826
  };
827
827
  let i, o;
828
828
  e.enablePatches && (i = [], o = []);
829
- const a = ((n = e.mark) === null || n === void 0 ? void 0 : n.call(e, t, Z)) === Z.mutable || !se(t, e) ? t : Rt({
829
+ const a = ((n = e.mark) === null || n === void 0 ? void 0 : n.call(e, t, Z)) === Z.mutable || !se(t, e) ? t : vt({
830
830
  original: t,
831
831
  parentDraft: null,
832
832
  finalities: s,
@@ -842,7 +842,7 @@ function Gn(t, e) {
842
842
  }
843
843
  function ft(t) {
844
844
  const { rootDraft: e, value: n, useRawReturn: s = !1, isRoot: i = !0 } = t;
845
- wt(n, (o, r, a) => {
845
+ bt(n, (o, r, a) => {
846
846
  const u = P(r);
847
847
  if (u && e && u.finalities === e.finalities) {
848
848
  t.isContainDraft = !0;
@@ -856,7 +856,7 @@ function ft(t) {
856
856
  typeof r == "object" && r !== null && (t.value = r, t.isRoot = !1, ft(t));
857
857
  }), i && (t.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), s && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
858
858
  }
859
- function tn(t) {
859
+ function en(t) {
860
860
  const e = P(t);
861
861
  if (!se(t, e == null ? void 0 : e.options))
862
862
  return t;
@@ -865,7 +865,7 @@ function tn(t) {
865
865
  return e.original;
866
866
  let s;
867
867
  function i() {
868
- s = n === 2 ? new Map(t) : n === 3 ? Array.from(e.setMap.values()) : Qt(t, e == null ? void 0 : e.options);
868
+ s = n === 2 ? new Map(t) : n === 3 ? Array.from(e.setMap.values()) : qt(t, e == null ? void 0 : e.options);
869
869
  }
870
870
  if (e) {
871
871
  e.finalized = !0;
@@ -876,17 +876,17 @@ function tn(t) {
876
876
  }
877
877
  } else
878
878
  s = t;
879
- return wt(s, (o, r) => {
880
- if (e && pe(he(e.original, o), r))
879
+ return bt(s, (o, r) => {
880
+ if (e && fe(pe(e.original, o), r))
881
881
  return;
882
- const a = tn(r);
882
+ const a = en(r);
883
883
  a !== r && (s === t && i(), Te(s, o, a));
884
884
  }), n === 3 ? new Set(s) : s;
885
885
  }
886
- function Nt(t) {
886
+ function Ht(t) {
887
887
  if (!be(t))
888
888
  throw new Error(`current() is only used for Draft, parameter: ${t}`);
889
- return tn(t);
889
+ return en(t);
890
890
  }
891
891
  const Vn = (t) => {
892
892
  if (t !== void 0 && Object.prototype.toString.call(t) !== "[object Object]")
@@ -902,7 +902,7 @@ const Vn = (t) => {
902
902
  if (typeof s != "function" && (c = s), c !== void 0 && Object.prototype.toString.call(c) !== "[object Object]")
903
903
  throw new Error(`Invalid options: ${c}, 'options' should be an object.`);
904
904
  c = Object.assign(Object.assign({}, t), c);
905
- const d = be(u) ? Nt(u) : u, g = Array.isArray(c.mark) ? (O, H) => {
905
+ const d = be(u) ? Ht(u) : u, g = Array.isArray(c.mark) ? (O, H) => {
906
906
  for (const S of c.mark) {
907
907
  if (typeof S != "function")
908
908
  throw new Error(`Invalid mark: ${S}, 'mark' should be a function.`);
@@ -933,7 +933,7 @@ const Vn = (t) => {
933
933
  const E = (O) => {
934
934
  const H = P($);
935
935
  if (!be(O)) {
936
- if (O !== void 0 && !pe(O, $) && (H != null && H.operated))
936
+ if (O !== void 0 && !fe(O, $) && (H != null && H.operated))
937
937
  throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
938
938
  const L = O == null ? void 0 : O[Ln];
939
939
  if (L) {
@@ -953,7 +953,7 @@ const Vn = (t) => {
953
953
  if (w === S.options) {
954
954
  if (S.operated)
955
955
  throw new Error("Cannot return a modified child draft.");
956
- return b([Nt(O)]);
956
+ return b([Ht(O)]);
957
957
  }
958
958
  return b([O]);
959
959
  };
@@ -963,7 +963,7 @@ const Vn = (t) => {
963
963
  };
964
964
  }, C = Vn();
965
965
  Object.prototype.constructor.toString();
966
- const Jn = gt(fetch), nn = async (t, e) => {
966
+ const Jn = yt(fetch), tn = async (t, e) => {
967
967
  if (!t)
968
968
  throw "Metapage definition null";
969
969
  if (t.version || (t = C(t, (s) => {
@@ -986,12 +986,12 @@ const Jn = gt(fetch), nn = async (t, e) => {
986
986
  throw `Error converting metapage definition to version ${e}: ${s}`;
987
987
  }
988
988
  return Kn(t, e);
989
- }, Wn = async (t) => nn(t, Le), Kn = (t, e) => {
989
+ }, Wn = async (t) => tn(t, Le), Kn = (t, e) => {
990
990
  if (!t)
991
991
  throw "Metapage definition null";
992
992
  if (!t.version)
993
993
  throw `Missing "version" key in metapage definition: ${JSON.stringify(t)}`;
994
- let n = de(t.version);
994
+ let n = he(t.version);
995
995
  if (n === e)
996
996
  return t;
997
997
  let s = t;
@@ -999,23 +999,23 @@ const Jn = gt(fetch), nn = async (t, e) => {
999
999
  switch (n) {
1000
1000
  case "0.2": {
1001
1001
  if (j(e, n) > 0)
1002
- s = Xn(s), n = de(s.version);
1002
+ s = Xn(s), n = he(s.version);
1003
1003
  else
1004
1004
  throw `Cannot convert from version ${n} to ${e}`;
1005
1005
  break;
1006
1006
  }
1007
1007
  case "0.3": {
1008
- j(e, n) > 0 ? (s = Qn(s), n = de(s.version)) : (s = qn(s), n = de(s.version));
1008
+ j(e, n) > 0 ? (s = Qn(s), n = he(s.version)) : (s = qn(s), n = he(s.version));
1009
1009
  break;
1010
1010
  }
1011
1011
  case "1": {
1012
- j(e, n) > 0 ? (s = es(s), n = de(s.version)) : (s = Yn(s), n = de(s.version));
1012
+ j(e, n) > 0 ? (s = es(s), n = he(s.version)) : (s = Yn(s), n = he(s.version));
1013
1013
  break;
1014
1014
  }
1015
1015
  case "2": {
1016
1016
  if (j(e, n) > 0)
1017
1017
  throw `Cannot convert from version ${n} to ${e}, 1 is the latest version`;
1018
- s = Zn(s), n = de(s.version);
1018
+ s = Zn(s), n = he(s.version);
1019
1019
  break;
1020
1020
  }
1021
1021
  default:
@@ -1035,7 +1035,7 @@ const Jn = gt(fetch), nn = async (t, e) => {
1035
1035
  }), es = (t) => C(t, (e) => {
1036
1036
  var n, s;
1037
1037
  return e.version = "2", (n = e == null ? void 0 : e.meta) != null && n.keywords && (e.meta.tags = e.meta.keywords, delete e.meta.keywords), (s = e == null ? void 0 : e.meta) != null && s.author && (e.meta.authors = [e.meta.author], delete e.meta.author), e;
1038
- }), de = (t) => {
1038
+ }), he = (t) => {
1039
1039
  if (t === "latest")
1040
1040
  return Le;
1041
1041
  if (j(t, "0.2") < 0)
@@ -1049,7 +1049,7 @@ const Jn = gt(fetch), nn = async (t, e) => {
1049
1049
  if (t === "2")
1050
1050
  return "2";
1051
1051
  throw `Unknown version: ${t}`;
1052
- }, ts = gt(fetch), sn = async (t, e) => {
1052
+ }, ts = yt(fetch), nn = async (t, e) => {
1053
1053
  if (!t)
1054
1054
  throw "Metaframe definition null";
1055
1055
  if (!t.version)
@@ -1072,7 +1072,7 @@ const Jn = gt(fetch), nn = async (t, e) => {
1072
1072
  throw `Error converting metapage definition to version ${e}: ${s}`;
1073
1073
  }
1074
1074
  return ss(t, e);
1075
- }, ns = async (t) => sn(t, We), ss = (t, e) => {
1075
+ }, ns = async (t) => nn(t, We), ss = (t, e) => {
1076
1076
  if (!t)
1077
1077
  throw "Metaframe definition null";
1078
1078
  t.version || (t = C(t, (i) => {
@@ -1189,7 +1189,7 @@ var Ue = function(t) {
1189
1189
  for (n = 0; n < s; n += 3)
1190
1190
  i += Oe[e[n] >> 2], i += Oe[(e[n] & 3) << 4 | e[n + 1] >> 4], i += Oe[(e[n + 1] & 15) << 2 | e[n + 2] >> 6], i += Oe[e[n + 2] & 63];
1191
1191
  return s % 3 === 2 ? i = i.substring(0, i.length - 1) + "=" : s % 3 === 1 && (i = i.substring(0, i.length - 2) + "=="), i;
1192
- }, me = function(t) {
1192
+ }, de = function(t) {
1193
1193
  var e = t.length * 0.75, n = t.length, s, i = 0, o, r, a, u;
1194
1194
  t[t.length - 1] === "=" && (e--, t[t.length - 2] === "=" && e--);
1195
1195
  var l = new ArrayBuffer(e), c = new Uint8Array(l);
@@ -1204,11 +1204,11 @@ const Ke = async (t) => C(t, async (e) => {
1204
1204
  }
1205
1205
  }), Ce = async (t) => C(t, async (e) => {
1206
1206
  for (const n of Object.keys(t)) {
1207
- const s = await rn(t[n]);
1207
+ const s = await sn(t[n]);
1208
1208
  return e[n] = s, e;
1209
1209
  }
1210
1210
  }), $i = async (t, e, n) => {
1211
- if (t = rn(t), n = n || {}, n.type || (n.type = "application/octet-stream"), t instanceof ArrayBuffer)
1211
+ if (t = sn(t), n = n || {}, n.type || (n.type = "application/octet-stream"), t instanceof ArrayBuffer)
1212
1212
  return new File([t], e, n);
1213
1213
  if (t instanceof File || t instanceof Blob) {
1214
1214
  const i = await t.arrayBuffer();
@@ -1271,24 +1271,24 @@ const Ke = async (t) => C(t, async (e) => {
1271
1271
  return Promise.resolve(n);
1272
1272
  }
1273
1273
  return Promise.resolve(t);
1274
- }, rn = (t) => {
1274
+ }, sn = (t) => {
1275
1275
  if (!(t && typeof t == "object" && t._s === !0))
1276
1276
  return t;
1277
1277
  const e = t, n = e._c;
1278
1278
  if (n === Blob.name) {
1279
1279
  const r = t;
1280
- return new Blob([me(e.value)], {
1280
+ return new Blob([de(e.value)], {
1281
1281
  type: r.fileType
1282
1282
  });
1283
1283
  } else if (n === File.name) {
1284
1284
  const r = t;
1285
- return new File([me(e.value)], r.name, {
1285
+ return new File([de(e.value)], r.name, {
1286
1286
  type: r.fileType,
1287
1287
  lastModified: r.lastModified
1288
1288
  });
1289
1289
  } else if (n === ArrayBuffer.name)
1290
- return me(e.value);
1291
- const s = t, i = me(s.value), o = s._c;
1290
+ return de(e.value);
1291
+ const s = t, i = de(s.value), o = s._c;
1292
1292
  try {
1293
1293
  return new globalThis[o](i);
1294
1294
  } catch {
@@ -1299,7 +1299,7 @@ const Ke = async (t) => C(t, async (e) => {
1299
1299
  return;
1300
1300
  const e = t, n = e._c;
1301
1301
  if (n === Blob.name) {
1302
- const r = t, a = new Blob([me(e.value)], {
1302
+ const r = t, a = new Blob([de(e.value)], {
1303
1303
  type: r.fileType
1304
1304
  });
1305
1305
  return new File([a], "file", {
@@ -1307,17 +1307,17 @@ const Ke = async (t) => C(t, async (e) => {
1307
1307
  });
1308
1308
  } else if (n === File.name) {
1309
1309
  const r = t;
1310
- return new File([me(e.value)], r.name, {
1310
+ return new File([de(e.value)], r.name, {
1311
1311
  type: r.fileType,
1312
1312
  lastModified: r.lastModified
1313
1313
  });
1314
1314
  } else if (n === ArrayBuffer.name) {
1315
- const r = me(e.value);
1315
+ const r = de(e.value);
1316
1316
  return new File([r], "file", {
1317
1317
  type: "application/octet-stream"
1318
1318
  });
1319
1319
  }
1320
- const s = t, i = me(s.value), o = s._c;
1320
+ const s = t, i = de(s.value), o = s._c;
1321
1321
  try {
1322
1322
  const r = new globalThis[o](i);
1323
1323
  return new File([r], "file", {
@@ -1334,10 +1334,10 @@ var q;
1334
1334
  (function(t) {
1335
1335
  t.InputsUpdate = "InputsUpdate", t.OutputsUpdate = "OutputsUpdate", t.SetupIframeClientRequest = "SetupIframeClientRequest", t.SetupIframeServerResponseAck = "SetupIframeServerResponseAck", t.HashParamsUpdate = "HashParamsUpdate";
1336
1336
  })(q || (q = {}));
1337
- var fe;
1337
+ var me;
1338
1338
  (function(t) {
1339
1339
  t.InputsUpdate = "InputsUpdate", t.MessageAck = "MessageAck", t.SetupIframeServerResponse = "SetupIframeServerResponse";
1340
- })(fe || (fe = {}));
1340
+ })(me || (me = {}));
1341
1341
  const Li = -32700, Ti = -32600, Pi = -32601, Di = -32602, ki = -32603;
1342
1342
  function Hi(t) {
1343
1343
  switch (typeof t) {
@@ -1351,7 +1351,7 @@ function Hi(t) {
1351
1351
  return !1;
1352
1352
  }
1353
1353
  }
1354
- var on = { exports: {} };
1354
+ var rn = { exports: {} };
1355
1355
  (function(t) {
1356
1356
  var e = Object.prototype.hasOwnProperty, n = "~";
1357
1357
  function s() {
@@ -1461,8 +1461,8 @@ var on = { exports: {} };
1461
1461
  var c;
1462
1462
  return l ? (c = n ? n + l : l, this._events[c] && r(this, c)) : (this._events = new s(), this._eventsCount = 0), this;
1463
1463
  }, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = n, a.EventEmitter = a, t.exports = a;
1464
- })(on);
1465
- var Ot = on.exports;
1464
+ })(rn);
1465
+ var Rt = rn.exports;
1466
1466
  function ms(t) {
1467
1467
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1468
1468
  }
@@ -1504,22 +1504,18 @@ var ys = function(t, e) {
1504
1504
  }
1505
1505
  }(t);
1506
1506
  };
1507
- const gs = /* @__PURE__ */ ms(ys), _s = (t) => an(gs(t)), bs = (t) => {
1507
+ const gs = /* @__PURE__ */ ms(ys), _s = (t) => on(gs(t)), bs = (t) => {
1508
1508
  if (t && t.length > 0)
1509
1509
  try {
1510
- return JSON.parse(ht(t));
1511
- } catch (e) {
1512
- try {
1513
- return JSON.parse(decodeURIComponent(ht(t)));
1514
- } catch {
1515
- throw e;
1516
- }
1510
+ return JSON.parse(an(t));
1511
+ } catch {
1512
+ return JSON.parse(decodeURIComponent(atob(decodeURIComponent(t))));
1517
1513
  }
1518
- }, an = (t) => btoa(t), ht = (t) => {
1514
+ }, on = (t) => btoa(encodeURIComponent(t)), an = (t) => {
1519
1515
  try {
1520
- return atob(t);
1516
+ return decodeURIComponent(atob(t));
1521
1517
  } catch {
1522
- return atob(decodeURIComponent(t));
1518
+ return decodeURIComponent(atob(decodeURIComponent(t)));
1523
1519
  }
1524
1520
  }, un = (t) => {
1525
1521
  const e = t instanceof URL ? t : new URL(t);
@@ -1563,14 +1559,14 @@ const gs = /* @__PURE__ */ ms(ys), _s = (t) => an(gs(t)), bs = (t) => {
1563
1559
  return /^[A-Za-z0-9+/]+={0,2}$/.test(c) && c.length % 4, `${u}=${c}`;
1564
1560
  }).join("&");
1565
1561
  return !s && !a ? "" : `${s || ""}${a ? "?" + a : ""}`;
1566
- }, St = (t, e) => {
1562
+ }, Ot = (t, e) => {
1567
1563
  const n = Pe(t, e);
1568
1564
  if (n && n !== "")
1569
1565
  return bs(n);
1570
1566
  }, Os = (t, e, n) => {
1571
1567
  const s = e ? _s(e) : void 0;
1572
1568
  Se(t, s, n);
1573
- }, Ss = (t) => St(window.location.href, t), As = (t, e) => {
1569
+ }, Ss = (t) => Ot(window.location.href, t), As = (t, e) => {
1574
1570
  const n = Pe(t, e);
1575
1571
  return n ? parseFloat(n) : void 0;
1576
1572
  }, ln = (t, e, n) => {
@@ -1584,9 +1580,9 @@ const gs = /* @__PURE__ */ ms(ys), _s = (t) => an(gs(t)), bs = (t) => {
1584
1580
  Se(t, e ? "true" : void 0, n);
1585
1581
  }, Ls = (t) => $s(window.location.href, t), Ts = (t, e) => {
1586
1582
  const n = Pe(t, e);
1587
- return n && n !== "" ? ht(n) : void 0;
1583
+ return n && n !== "" ? an(n) : void 0;
1588
1584
  }, Ps = (t, e, n) => {
1589
- const s = e == null ? void 0 : an(e);
1585
+ const s = e == null ? void 0 : on(e);
1590
1586
  Se(t, s, n);
1591
1587
  }, Ds = (t) => Ts(window.location.href, t);
1592
1588
  var ks = function(t, e) {
@@ -1627,7 +1623,7 @@ var ks = function(t, e) {
1627
1623
  }
1628
1624
  }(t);
1629
1625
  };
1630
- const fn = /* @__PURE__ */ yt(ks);
1626
+ const fn = /* @__PURE__ */ mt(ks);
1631
1627
  var xe;
1632
1628
  (function(t) {
1633
1629
  t.mp_debug = "mp_debug";
@@ -1642,7 +1638,7 @@ const Hs = () => {
1642
1638
  version: Le,
1643
1639
  metaframes: {}
1644
1640
  };
1645
- class Ns extends Ot.EventEmitter {
1641
+ class Ns extends Rt.EventEmitter {
1646
1642
  constructor() {
1647
1643
  super(), this._definition = pn, this.getDefinition = this.getDefinition.bind(this);
1648
1644
  }
@@ -1657,14 +1653,14 @@ const Ge = (t, e) => e ? C(t, (n) => {
1657
1653
  Object.keys(e).forEach((s) => {
1658
1654
  e[s] === void 0 ? delete n[s] : n[s] = e[s];
1659
1655
  });
1660
- }) : t, Ni = (t) => window.location.search ? new URLSearchParams(window.location.search).get(t) : null, ji = () => new URLSearchParams(window.location.search).has(xe.mp_debug), dt = () => {
1656
+ }) : t, Ni = (t) => window.location.search ? new URLSearchParams(window.location.search).get(t) : null, ji = () => new URLSearchParams(window.location.search).has(xe.mp_debug), ht = () => {
1661
1657
  const t = new URLSearchParams(window.location.search).get(xe.mp_debug);
1662
1658
  return t === "true" || t === "1";
1663
- }, Ui = (t = 8) => At(t), js = (t = 8) => At(t), Bi = (t = 8) => At(t), jt = "abcdefghijklmnopqrstuvwxyz0123456789", At = (t = 8) => {
1664
- for (var e = "", n = jt.length, s = 0; s < t; s++)
1665
- e += jt.charAt(Math.floor(Math.random() * n));
1659
+ }, Ui = (t = 8) => St(t), js = (t = 8) => St(t), Bi = (t = 8) => St(t), Nt = "abcdefghijklmnopqrstuvwxyz0123456789", St = (t = 8) => {
1660
+ for (var e = "", n = Nt.length, s = 0; s < t; s++)
1661
+ e += Nt.charAt(Math.floor(Math.random() * n));
1666
1662
  return e;
1667
- }, Et = (t, e, n) => {
1663
+ }, At = (t, e, n) => {
1668
1664
  e = e || "000", e && e.trim() == "" && (e = void 0);
1669
1665
  let s;
1670
1666
  if (typeof t == "string" ? s = t : typeof t == "number" ? s = t + "" : s = JSON.stringify(t, null, " "), e && e.trim() != "") {
@@ -1713,9 +1709,9 @@ var z;
1713
1709
  (function(t) {
1714
1710
  t.Connected = "connected", t.Error = "error", t.Input = "input", t.Inputs = "inputs", t.Message = "message";
1715
1711
  })(z || (z = {}));
1716
- class ie extends Ot.EventEmitter {
1712
+ class ie extends Rt.EventEmitter {
1717
1713
  constructor(e) {
1718
- if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = ae.WaitingForPageLoad, this._messageSendCount = 0, this.debug = dt(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = dt(), this._isIframe = Hs(), this.addListener = this.addListener.bind(this), this.dispose = this.dispose.bind(this), this.error = this.error.bind(this), this.getInput = this.getInput.bind(this), this.getInputs = this.getInputs.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.onInput = this.onInput.bind(this), this.onInputs = this.onInputs.bind(this), this.onMessage = this.onMessage.bind(this), this.sendRpc = this.sendRpc.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInternalInputsAndNotify = this.setInternalInputsAndNotify.bind(this), this.setOutput = this.setOutput.bind(this), this.setOutputs = this.setOutputs.bind(this), this.warn = this.warn.bind(this), this._resolveSetupIframeServerResponse = this._resolveSetupIframeServerResponse.bind(this), this.addListenerReturnDisposer = this.addListenerReturnDisposer.bind(this), this.connected = this.connected.bind(this), this.isConnected = this.isConnected.bind(this), this.disableNotifyOnHashUrlChange = this.disableNotifyOnHashUrlChange.bind(this), this._onHashUrlChange = this._onHashUrlChange.bind(this), this.setParameter = this.setParameter.bind(this), this.setParameterBoolean = this.setParameterBoolean.bind(this), this.setParameterJson = this.setParameterJson.bind(this), this.setParameterBase64 = this.setParameterBase64.bind(this), this.setParameterFloat = this.setParameterFloat.bind(this), this.setParameterInt = this.setParameterInt.bind(this), this.getParameter = this.getParameter.bind(this), this.getParameterBoolean = this.getParameterBoolean.bind(this), this.getParameterJson = this.getParameterJson.bind(this), this.getParameterBase64 = this.getParameterBase64.bind(this), this.getParameterFloat = this.getParameterFloat.bind(this), this.getParameterInt = this.getParameterInt.bind(this), this.deleteParameter = this.deleteParameter.bind(this), !this._isIframe) {
1714
+ if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = ae.WaitingForPageLoad, this._messageSendCount = 0, this.debug = ht(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = ht(), this._isIframe = Hs(), this.addListener = this.addListener.bind(this), this.dispose = this.dispose.bind(this), this.error = this.error.bind(this), this.getInput = this.getInput.bind(this), this.getInputs = this.getInputs.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.onInput = this.onInput.bind(this), this.onInputs = this.onInputs.bind(this), this.onMessage = this.onMessage.bind(this), this.sendRpc = this.sendRpc.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInternalInputsAndNotify = this.setInternalInputsAndNotify.bind(this), this.setOutput = this.setOutput.bind(this), this.setOutputs = this.setOutputs.bind(this), this.warn = this.warn.bind(this), this._resolveSetupIframeServerResponse = this._resolveSetupIframeServerResponse.bind(this), this.addListenerReturnDisposer = this.addListenerReturnDisposer.bind(this), this.connected = this.connected.bind(this), this.isConnected = this.isConnected.bind(this), this.disableNotifyOnHashUrlChange = this.disableNotifyOnHashUrlChange.bind(this), this._onHashUrlChange = this._onHashUrlChange.bind(this), this.setParameter = this.setParameter.bind(this), this.setParameterBoolean = this.setParameterBoolean.bind(this), this.setParameterJson = this.setParameterJson.bind(this), this.setParameterBase64 = this.setParameterBase64.bind(this), this.setParameterFloat = this.setParameterFloat.bind(this), this.setParameterInt = this.setParameterInt.bind(this), this.getParameter = this.getParameter.bind(this), this.getParameterBoolean = this.getParameterBoolean.bind(this), this.getParameterJson = this.getParameterJson.bind(this), this.getParameterBase64 = this.getParameterBase64.bind(this), this.getParameterFloat = this.getParameterFloat.bind(this), this.getParameterInt = this.getParameterInt.bind(this), this.deleteParameter = this.deleteParameter.bind(this), !this._isIframe) {
1719
1715
  this.log("Not an iframe, metaframe code disabled");
1720
1716
  return;
1721
1717
  }
@@ -1764,7 +1760,7 @@ class ie extends Ot.EventEmitter {
1764
1760
  }
1765
1761
  logInternal(e, n, s) {
1766
1762
  let i;
1767
- typeof e == "string" ? i = e : typeof e == "number" ? i = e + "" : i = JSON.stringify(e), n = n && n + "", i = (this.id ? `Metaframe[${this.id}] ` : "") + `${i}`, Et(i, n, s);
1763
+ typeof e == "string" ? i = e : typeof e == "number" ? i = e + "" : i = JSON.stringify(e), n = n && n + "", i = (this.id ? `Metaframe[${this.id}] ` : "") + `${i}`, At(i, n, s);
1768
1764
  }
1769
1765
  dispose() {
1770
1766
  super.removeAllListeners(), window.removeEventListener("message", this.onMessage), this.disableNotifyOnHashUrlChange(), this._inputPipeValues = void 0, this._outputPipeValues = void 0;
@@ -1852,20 +1848,20 @@ class ie extends Ot.EventEmitter {
1852
1848
  let s = e.data;
1853
1849
  if (s.jsonrpc === "2.0") {
1854
1850
  var n = s.method;
1855
- if (!(n == fe.SetupIframeServerResponse || s.parentId == this._parentId && s.iframeId == this.id)) {
1856
- this.log(`window.message: received message but jsonrpc.parentId=${s.parentId} _parentId=${this._parentId} jsonrpc.iframeId=${s.iframeId} id=${this.id}`);
1851
+ if (!(n == "SetupIframeServerResponse" || s.parentId == this._parentId && s.iframeId == this.id)) {
1852
+ this.log(`window.message: received message (method=${n}) but jsonrpc.parentId=${s.parentId} _parentId=${this._parentId} jsonrpc.iframeId=${s.iframeId} id=${this.id}`);
1857
1853
  return;
1858
1854
  }
1859
1855
  switch (n) {
1860
- case fe.SetupIframeServerResponse:
1856
+ case me.SetupIframeServerResponse:
1861
1857
  this._resolveSetupIframeServerResponse(s.params);
1862
1858
  break;
1863
- case fe.InputsUpdate:
1859
+ case me.InputsUpdate:
1864
1860
  if (this._state !== ae.Ready)
1865
1861
  throw "Got InputsUpdate but metaframe is not MetaframeLoadingState.Ready";
1866
1862
  this.setInternalInputsAndNotify(s.params.inputs);
1867
1863
  break;
1868
- case fe.MessageAck:
1864
+ case me.MessageAck:
1869
1865
  this.debug && this.log(`ACK: ${JSON.stringify(s)}`);
1870
1866
  break;
1871
1867
  default:
@@ -1925,15 +1921,15 @@ ie.MESSAGE = z.Message;
1925
1921
  ie.deserializeInputs = Ce;
1926
1922
  ie.serializeInputs = Ke;
1927
1923
  var qe = {};
1928
- const oe = "\\\\/", Ut = `[^${oe}]`, le = "\\.", Fs = "\\+", zs = "\\?", Qe = "\\/", Gs = "(?=.)", mn = "[^/]", Mt = `(?:${Qe}|$)`, yn = `(?:^|${Qe})`, It = `${le}{1,2}${Mt}`, Vs = `(?!${le})`, Js = `(?!${yn}${It})`, Ws = `(?!${le}{0,1}${Mt})`, Ks = `(?!${It})`, Xs = `[^.${Qe}]`, qs = `${mn}*?`, Qs = "/", gn = {
1924
+ const oe = "\\\\/", jt = `[^${oe}]`, le = "\\.", Fs = "\\+", zs = "\\?", Qe = "\\/", Gs = "(?=.)", mn = "[^/]", Et = `(?:${Qe}|$)`, yn = `(?:^|${Qe})`, Mt = `${le}{1,2}${Et}`, Vs = `(?!${le})`, Js = `(?!${yn}${Mt})`, Ws = `(?!${le}{0,1}${Et})`, Ks = `(?!${Mt})`, Xs = `[^.${Qe}]`, qs = `${mn}*?`, Qs = "/", gn = {
1929
1925
  DOT_LITERAL: le,
1930
1926
  PLUS_LITERAL: Fs,
1931
1927
  QMARK_LITERAL: zs,
1932
1928
  SLASH_LITERAL: Qe,
1933
1929
  ONE_CHAR: Gs,
1934
1930
  QMARK: mn,
1935
- END_ANCHOR: Mt,
1936
- DOTS_SLASH: It,
1931
+ END_ANCHOR: Et,
1932
+ DOTS_SLASH: Mt,
1937
1933
  NO_DOT: Vs,
1938
1934
  NO_DOTS: Js,
1939
1935
  NO_DOT_SLASH: Ws,
@@ -1945,8 +1941,8 @@ const oe = "\\\\/", Ut = `[^${oe}]`, le = "\\.", Fs = "\\+", zs = "\\?", Qe = "\
1945
1941
  }, Ys = {
1946
1942
  ...gn,
1947
1943
  SLASH_LITERAL: `[${oe}]`,
1948
- QMARK: Ut,
1949
- STAR: `${Ut}*?`,
1944
+ QMARK: jt,
1945
+ STAR: `${jt}*?`,
1950
1946
  DOTS_SLASH: `${le}{1,2}(?:[${oe}]|$)`,
1951
1947
  NO_DOT: `(?!${le})`,
1952
1948
  NO_DOTS: `(?!(?:^|[${oe}])${le}{1,2}(?:[${oe}]|$))`,
@@ -2118,7 +2114,7 @@ var Ye = {
2118
2114
  return r.negated === !0 && (c = `(?:^(?!${c}).*$)`), c;
2119
2115
  }, t.basename = (o, { windows: r } = {}) => r ? o.replace(/[\\/]$/, "").replace(/.*[\\/]/, "") : o.replace(/\/$/, "").replace(/.*\//, "");
2120
2116
  })(qe);
2121
- const Bt = qe, {
2117
+ const Ut = qe, {
2122
2118
  CHAR_ASTERISK: nt,
2123
2119
  /* * */
2124
2120
  CHAR_AT: ei,
@@ -2129,7 +2125,7 @@ const Bt = qe, {
2129
2125
  /* , */
2130
2126
  CHAR_DOT: st,
2131
2127
  /* . */
2132
- CHAR_EXCLAMATION_MARK: Ft,
2128
+ CHAR_EXCLAMATION_MARK: Bt,
2133
2129
  /* ! */
2134
2130
  CHAR_FORWARD_SLASH: _n,
2135
2131
  /* / */
@@ -2141,15 +2137,15 @@ const Bt = qe, {
2141
2137
  /* [ */
2142
2138
  CHAR_PLUS: si,
2143
2139
  /* + */
2144
- CHAR_QUESTION_MARK: zt,
2140
+ CHAR_QUESTION_MARK: Ft,
2145
2141
  /* ? */
2146
2142
  CHAR_RIGHT_CURLY_BRACE: ii,
2147
2143
  /* } */
2148
- CHAR_RIGHT_PARENTHESES: Gt,
2144
+ CHAR_RIGHT_PARENTHESES: zt,
2149
2145
  /* ) */
2150
2146
  CHAR_RIGHT_SQUARE_BRACKET: ri
2151
2147
  /* ] */
2152
- } = Ye, Vt = (t) => t === _n || t === Me, Jt = (t) => {
2148
+ } = Ye, Gt = (t) => t === _n || t === Me, Vt = (t) => {
2153
2149
  t.isPrefix !== !0 && (t.depth = t.isGlobstar ? 1 / 0 : 1);
2154
2150
  }, oi = (t, e) => {
2155
2151
  const n = e || {}, s = t.length - 1, i = n.parts === !0 || n.scanToEnd === !0, o = [], r = [], a = [];
@@ -2201,14 +2197,14 @@ const Bt = qe, {
2201
2197
  d = l + 1;
2202
2198
  continue;
2203
2199
  }
2204
- if (n.noext !== !0 && (S === si || S === ei || S === nt || S === zt || S === Ft) === !0 && f() === rt) {
2200
+ if (n.noext !== !0 && (S === si || S === ei || S === nt || S === Ft || S === Bt) === !0 && f() === rt) {
2205
2201
  if (y = L.isGlob = !0, R = L.isExtglob = !0, E = !0, i === !0) {
2206
2202
  for (; U() !== !0 && (S = M()); ) {
2207
2203
  if (S === Me) {
2208
2204
  b = L.backslashes = !0, S = M();
2209
2205
  continue;
2210
2206
  }
2211
- if (S === Gt) {
2207
+ if (S === zt) {
2212
2208
  y = L.isGlob = !0, E = !0;
2213
2209
  break;
2214
2210
  }
@@ -2222,7 +2218,7 @@ const Bt = qe, {
2222
2218
  continue;
2223
2219
  break;
2224
2220
  }
2225
- if (S === zt) {
2221
+ if (S === Ft) {
2226
2222
  if (y = L.isGlob = !0, E = !0, i === !0)
2227
2223
  continue;
2228
2224
  break;
@@ -2239,7 +2235,7 @@ const Bt = qe, {
2239
2235
  break;
2240
2236
  }
2241
2237
  }
2242
- if (n.nonegate !== !0 && S === Ft && l === c) {
2238
+ if (n.nonegate !== !0 && S === Bt && l === c) {
2243
2239
  A = L.negated = !0, c++;
2244
2240
  continue;
2245
2241
  }
@@ -2250,7 +2246,7 @@ const Bt = qe, {
2250
2246
  b = L.backslashes = !0, S = M();
2251
2247
  continue;
2252
2248
  }
2253
- if (S === Gt) {
2249
+ if (S === zt) {
2254
2250
  E = !0;
2255
2251
  break;
2256
2252
  }
@@ -2267,7 +2263,7 @@ const Bt = qe, {
2267
2263
  }
2268
2264
  n.noext === !0 && (R = !1, y = !1);
2269
2265
  let I = u, B = "", h = "";
2270
- c > 0 && (B = u.slice(0, c), u = u.slice(c), d -= c), I && y === !0 && d > 0 ? (I = u.slice(0, d), h = u.slice(d)) : y === !0 ? (I = "", h = u) : I = u, I && I !== "" && I !== "/" && I !== u && Vt(I.charCodeAt(I.length - 1)) && (I = I.slice(0, -1)), n.unescape === !0 && (h && (h = Bt.removeBackslashes(h)), I && b === !0 && (I = Bt.removeBackslashes(I)));
2266
+ c > 0 && (B = u.slice(0, c), u = u.slice(c), d -= c), I && y === !0 && d > 0 ? (I = u.slice(0, d), h = u.slice(d)) : y === !0 ? (I = "", h = u) : I = u, I && I !== "" && I !== "/" && I !== u && Gt(I.charCodeAt(I.length - 1)) && (I = I.slice(0, -1)), n.unescape === !0 && (h && (h = Ut.removeBackslashes(h)), I && b === !0 && (I = Ut.removeBackslashes(I)));
2271
2267
  const p = {
2272
2268
  prefix: B,
2273
2269
  input: t,
@@ -2281,15 +2277,15 @@ const Bt = qe, {
2281
2277
  isGlobstar: w,
2282
2278
  negated: A
2283
2279
  };
2284
- if (n.tokens === !0 && (p.maxDepth = 0, Vt(S) || r.push(L), p.tokens = r), n.parts === !0 || n.tokens === !0) {
2280
+ if (n.tokens === !0 && (p.maxDepth = 0, Gt(S) || r.push(L), p.tokens = r), n.parts === !0 || n.tokens === !0) {
2285
2281
  let W;
2286
2282
  for (let k = 0; k < o.length; k++) {
2287
2283
  const re = W ? W + 1 : c, ce = o[k], Q = t.slice(re, ce);
2288
- n.tokens && (k === 0 && c !== 0 ? (r[k].isPrefix = !0, r[k].value = B) : r[k].value = Q, Jt(r[k]), p.maxDepth += r[k].depth), (k !== 0 || Q !== "") && a.push(Q), W = ce;
2284
+ n.tokens && (k === 0 && c !== 0 ? (r[k].isPrefix = !0, r[k].value = B) : r[k].value = Q, Vt(r[k]), p.maxDepth += r[k].depth), (k !== 0 || Q !== "") && a.push(Q), W = ce;
2289
2285
  }
2290
2286
  if (W && W + 1 < t.length) {
2291
2287
  const k = t.slice(W + 1);
2292
- a.push(k), n.tokens && (r[r.length - 1].value = k, Jt(r[r.length - 1]), p.maxDepth += r[r.length - 1].depth);
2288
+ a.push(k), n.tokens && (r[r.length - 1].value = k, Vt(r[r.length - 1]), p.maxDepth += r[r.length - 1].depth);
2293
2289
  }
2294
2290
  p.slashes = o, p.parts = a;
2295
2291
  }
@@ -2743,7 +2739,7 @@ wn.fastpaths = (t, e) => {
2743
2739
  return H && n.strictSlashes !== !0 && (H += `${r}?`), H;
2744
2740
  };
2745
2741
  var pi = wn;
2746
- const hi = ai, mt = pi, vn = qe, di = Ye, mi = (t) => t && typeof t == "object" && !Array.isArray(t), V = (t, e, n = !1) => {
2742
+ const hi = ai, dt = pi, vn = qe, di = Ye, mi = (t) => t && typeof t == "object" && !Array.isArray(t), V = (t, e, n = !1) => {
2747
2743
  if (Array.isArray(t)) {
2748
2744
  const c = t.map((g) => V(g, e, n));
2749
2745
  return (g) => {
@@ -2782,7 +2778,7 @@ V.test = (t, e, n, { glob: s, posix: i } = {}) => {
2782
2778
  };
2783
2779
  V.matchBase = (t, e, n) => (e instanceof RegExp ? e : V.makeRe(e, n)).test(vn.basename(t));
2784
2780
  V.isMatch = (t, e, n) => V(e, n)(t);
2785
- V.parse = (t, e) => Array.isArray(t) ? t.map((n) => V.parse(n, e)) : mt(t, { ...e, fastpaths: !1 });
2781
+ V.parse = (t, e) => Array.isArray(t) ? t.map((n) => V.parse(n, e)) : dt(t, { ...e, fastpaths: !1 });
2786
2782
  V.scan = (t, e) => hi(t, e);
2787
2783
  V.compileRe = (t, e, n = !1, s = !1) => {
2788
2784
  if (n === !0)
@@ -2798,7 +2794,7 @@ V.makeRe = (t, e, n = !1, s = !1) => {
2798
2794
  throw new TypeError("Expected a non-empty string");
2799
2795
  const i = e || {};
2800
2796
  let o = { negated: !1, fastpaths: !0 }, r = "", a;
2801
- return t.startsWith("./") && (t = t.slice(2), r = o.prefix = "./"), i.fastpaths !== !1 && (t[0] === "." || t[0] === "*") && (a = mt.fastpaths(t, e)), a === void 0 ? (o = mt(t, e), o.prefix = r + (o.prefix || "")) : o.output = a, V.compileRe(o, e, n, s);
2797
+ return t.startsWith("./") && (t = t.slice(2), r = o.prefix = "./"), i.fastpaths !== !1 && (t[0] === "." || t[0] === "*") && (a = dt.fastpaths(t, e)), a === void 0 ? (o = dt(t, e), o.prefix = r + (o.prefix || "")) : o.output = a, V.compileRe(o, e, n, s);
2802
2798
  };
2803
2799
  V.toRegex = (t, e) => {
2804
2800
  try {
@@ -2812,7 +2808,7 @@ V.toRegex = (t, e) => {
2812
2808
  };
2813
2809
  V.constants = di;
2814
2810
  var yi = V, gi = yi;
2815
- const _i = /* @__PURE__ */ yt(gi), Rn = gt(fetch), bi = async (t, e) => {
2811
+ const _i = /* @__PURE__ */ mt(gi), Rn = yt(fetch), bi = async (t, e) => {
2816
2812
  const n = new URL(t);
2817
2813
  n.pathname = n.pathname + (n.pathname.endsWith("/") ? "metapage.json" : "/metapage.json");
2818
2814
  const i = await (await Rn(n.href, {
@@ -2820,14 +2816,14 @@ const _i = /* @__PURE__ */ yt(gi), Rn = gt(fetch), bi = async (t, e) => {
2820
2816
  retries: 3,
2821
2817
  retryDelay: 1e3
2822
2818
  })).json();
2823
- return await nn(i, e || Le);
2819
+ return await tn(i, e || Le);
2824
2820
  }, wi = async (t, e) => {
2825
2821
  if (t.startsWith("data:") || t.startsWith("https://docs.google.com"))
2826
2822
  return;
2827
2823
  const n = new URL(t);
2828
2824
  if (n.origin.endsWith(".notion.site"))
2829
2825
  return;
2830
- let s = St(t, "definition");
2826
+ let s = Ot(t, "definition");
2831
2827
  if (s != null && s.version)
2832
2828
  return pt(s);
2833
2829
  n.pathname.endsWith("metaframe.json") || (n.pathname = n.pathname + (n.pathname.endsWith("/") ? "metaframe.json" : "/metaframe.json"));
@@ -2840,13 +2836,13 @@ const _i = /* @__PURE__ */ yt(gi), Rn = gt(fetch), bi = async (t, e) => {
2840
2836
  if (i.status !== 200)
2841
2837
  return;
2842
2838
  const o = await i.json();
2843
- return await sn(o, e || We);
2839
+ return await nn(o, e || We);
2844
2840
  } catch (i) {
2845
2841
  console.error(`Error fetching metaframe definition from ${n.href}: ${i}`);
2846
2842
  return;
2847
2843
  }
2848
2844
  }, Gi = (t) => t ? !(t != null && t.inputs && Object.keys(t.inputs).length > 0 || t != null && t.outputs && Object.keys(t.outputs).length > 0 || t != null && t.allow || t != null && t.metadata && Object.keys(t.metadata).length > 0) : !0;
2849
- class vi extends Ot.EventEmitter {
2845
+ class vi extends Rt.EventEmitter {
2850
2846
  constructor(e, n, s, i, o, r = !1) {
2851
2847
  if (super(), this.inputs = {}, this.outputs = {}, this._disposables = [], this._rpcListeners = [], this._loaded = !1, this._onLoaded = [], this._sendInputsAfterRegistration = !1, this._cachedEventInputsUpdate = {
2852
2848
  iframeId: void 0,
@@ -2872,7 +2868,7 @@ class vi extends Ot.EventEmitter {
2872
2868
  if ((v = (g = (d = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : d.metaframes) == null ? void 0 : g[this.id]) != null && v.allow)
2873
2869
  u._iframe.allow = this._metapage._definition.metaframes[this.id].allow, this._debug && this.log(`mf allow=${u._iframe.allow} from this._metapage?._definition`);
2874
2870
  else {
2875
- let y = St(this.url, "definition");
2871
+ let y = Ot(this.url, "definition");
2876
2872
  if (y = y && (y != null && y.version) ? await pt(y) : void 0, !u._iframe)
2877
2873
  return;
2878
2874
  if (y != null && y.allow)
@@ -2979,9 +2975,9 @@ Error: ${n != null && n.message ? n == null ? void 0 : n.message : n == null ? v
2979
2975
  state: {
2980
2976
  inputs: this.inputs
2981
2977
  },
2982
- version: Wt
2978
+ version: Jt
2983
2979
  };
2984
- this.sendRpcInternal(fe.SetupIframeServerResponse, e);
2980
+ this.sendRpcInternal(me.SetupIframeServerResponse, e);
2985
2981
  }
2986
2982
  registered(e) {
2987
2983
  if (this.log({ m: "MetapageIFrameRpcClient.registered", inputs: this.inputs }), !this._loaded) {
@@ -2993,7 +2989,7 @@ Error: ${n != null && n.message ? n == null ? void 0 : n.message : n == null ? v
2993
2989
  }
2994
2990
  }
2995
2991
  async sendInputs(e) {
2996
- e && (e = await Ke(e), !this.isDisposed() && this.sendRpc(fe.InputsUpdate, {
2992
+ e && (e = await Ke(e), !this.isDisposed() && this.sendRpc(me.InputsUpdate, {
2997
2993
  inputs: e,
2998
2994
  parentId: this._parentId
2999
2995
  }));
@@ -3016,7 +3012,7 @@ Error: ${n != null && n.message ? n == null ? void 0 : n.message : n == null ? v
3016
3012
  var n = {
3017
3013
  message: e
3018
3014
  };
3019
- this.sendRpc(fe.MessageAck, n);
3015
+ this.sendRpc(me.MessageAck, n);
3020
3016
  }
3021
3017
  }
3022
3018
  log(e) {
@@ -3024,7 +3020,7 @@ Error: ${n != null && n.message ? n == null ? void 0 : n.message : n == null ? v
3024
3020
  }
3025
3021
  logInternal(e) {
3026
3022
  let n;
3027
- typeof e == "string" ? n = e : typeof e == "string" ? n = e + "" : n = JSON.stringify(e), Et(`Metapage[${this._parentId}] Metaframe[${this.id}] ${n}`, this._color, this._consoleBackgroundColor);
3023
+ typeof e == "string" ? n = e : typeof e == "string" ? n = e + "" : n = JSON.stringify(e), At(`Metapage[${this._parentId}] Metaframe[${this.id}] ${n}`, this._color, this._consoleBackgroundColor);
3028
3024
  }
3029
3025
  sendRpcInternal(e, n) {
3030
3026
  const s = {
@@ -3056,7 +3052,7 @@ const ge = C({
3056
3052
  inputs: {},
3057
3053
  outputs: {}
3058
3054
  }
3059
- }, (t) => t), Vi = (t) => de(t), Ri = (t, e) => !!(!e || e === "**" || t === e || _i.isMatch(t, e)), Oi = "bcbcbc";
3055
+ }, (t) => t), Vi = (t) => he(t), Ri = (t, e) => !!(!e || e === "**" || t === e || _i.isMatch(t, e)), Oi = "bcbcbc";
3060
3056
  class ee extends Ns {
3061
3057
  static async from(e, n) {
3062
3058
  if (e == null)
@@ -3071,7 +3067,7 @@ class ee extends Ns {
3071
3067
  return s.setDefinition(e);
3072
3068
  }
3073
3069
  constructor(e) {
3074
- super(), this._state = ge, this._metaframes = C({}, (n) => n), this.debug = dt(), this._internalReceivedMessageCounter = 0, this._cachedInputLookupMap = C({}, (n) => n), this._inputMap = {}, this._id = e && e.id ? e.id : js(), this._consoleBackgroundColor = e && e.color ? e.color : Oi, this.addPipe = this.addPipe.bind(this), this.dispose = this.dispose.bind(this), this.addMetaframe = this.addMetaframe.bind(this), this.getInputsFromOutput = this.getInputsFromOutput.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframeIds = this.getMetaframeIds.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframes = this.getMetaframes.bind(this), this.getState = this.getState.bind(this), this.getStateMetaframes = this.getStateMetaframes.bind(this), this.isValidJSONRpcMessage = this.isValidJSONRpcMessage.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.metaframeIds = this.metaframeIds.bind(this), this.metaframes = this.metaframes.bind(this), this.onMessage = this.onMessage.bind(this), this.removeAll = this.removeAll.bind(this), this.removeMetaframe = this.removeMetaframe.bind(this), this.setDebugFromUrlParams = this.setDebugFromUrlParams.bind(this), this.setDefinition = this.setDefinition.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInputStateOnlyMetaframeInputValue = this.setInputStateOnlyMetaframeInputValue.bind(this), this.setInputStateOnlyMetaframeInputMap = this.setInputStateOnlyMetaframeInputMap.bind(this), this.setInputStateOnlyMetapageInstanceInputs = this.setInputStateOnlyMetapageInstanceInputs.bind(this), this.setOutputStateOnlyMetaframeInputValue = this.setOutputStateOnlyMetaframeInputValue.bind(this), this.setOutputStateOnlyMetaframeInputMap = this.setOutputStateOnlyMetaframeInputMap.bind(this), this.setOutputStateOnlyMetapageInstanceInputs = this.setOutputStateOnlyMetapageInstanceInputs.bind(this), this.setMetadata = this.setMetadata.bind(this), this.setMetaframeClientInputAndSentClientEvent = this.setMetaframeClientInputAndSentClientEvent.bind(this), this.setState = this.setState.bind(this), this.isDisposed = this.isDisposed.bind(this), this._emitDefinitionEvent = this._emitDefinitionEvent.bind(this), Xe().then(() => {
3070
+ super(), this._state = ge, this._metaframes = C({}, (n) => n), this.debug = ht(), this._internalReceivedMessageCounter = 0, this._cachedInputLookupMap = C({}, (n) => n), this._inputMap = {}, this._id = e && e.id ? e.id : js(), this._consoleBackgroundColor = e && e.color ? e.color : Oi, this.addPipe = this.addPipe.bind(this), this.dispose = this.dispose.bind(this), this.addMetaframe = this.addMetaframe.bind(this), this.getInputsFromOutput = this.getInputsFromOutput.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframeIds = this.getMetaframeIds.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframes = this.getMetaframes.bind(this), this.getState = this.getState.bind(this), this.getStateMetaframes = this.getStateMetaframes.bind(this), this.isValidJSONRpcMessage = this.isValidJSONRpcMessage.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.metaframeIds = this.metaframeIds.bind(this), this.metaframes = this.metaframes.bind(this), this.onMessage = this.onMessage.bind(this), this.removeAll = this.removeAll.bind(this), this.removeMetaframe = this.removeMetaframe.bind(this), this.setDebugFromUrlParams = this.setDebugFromUrlParams.bind(this), this.setDefinition = this.setDefinition.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInputStateOnlyMetaframeInputValue = this.setInputStateOnlyMetaframeInputValue.bind(this), this.setInputStateOnlyMetaframeInputMap = this.setInputStateOnlyMetaframeInputMap.bind(this), this.setInputStateOnlyMetapageInstanceInputs = this.setInputStateOnlyMetapageInstanceInputs.bind(this), this.setOutputStateOnlyMetaframeInputValue = this.setOutputStateOnlyMetaframeInputValue.bind(this), this.setOutputStateOnlyMetaframeInputMap = this.setOutputStateOnlyMetaframeInputMap.bind(this), this.setOutputStateOnlyMetapageInstanceInputs = this.setOutputStateOnlyMetapageInstanceInputs.bind(this), this.setMetadata = this.setMetadata.bind(this), this.setMetaframeClientInputAndSentClientEvent = this.setMetaframeClientInputAndSentClientEvent.bind(this), this.setState = this.setState.bind(this), this.isDisposed = this.isDisposed.bind(this), this._emitDefinitionEvent = this._emitDefinitionEvent.bind(this), Xe().then(() => {
3075
3071
  this.isDisposed() || (window.addEventListener("message", this.onMessage), this.log("Initialized"));
3076
3072
  });
3077
3073
  }
@@ -3324,13 +3320,11 @@ class ee extends Ns {
3324
3320
  return;
3325
3321
  var n = r.method;
3326
3322
  const a = r.iframeId;
3327
- if (!a)
3323
+ if (!a || n !== "SetupIframeClientRequest" && r.parentId !== this._id)
3328
3324
  return;
3329
3325
  const u = this.getMetaframe(a);
3330
- if (!u) {
3331
- this.error(`💥 onMessage no metaframe id=${a}`);
3326
+ if (!u)
3332
3327
  return;
3333
- }
3334
3328
  switch (r._messageCount = ++this._internalReceivedMessageCounter, this.debug && this.log(`processing ${JSON.stringify(r, null, " ").substring(0, 500)}`), n) {
3335
3329
  case q.SetupIframeClientRequest:
3336
3330
  u.register();
@@ -3385,10 +3379,10 @@ class ee extends Ns {
3385
3379
  logInternal(e, n, s) {
3386
3380
  s = s || this._consoleBackgroundColor;
3387
3381
  let i;
3388
- typeof e == "string" ? i = e : typeof e == "number" ? i = e + "" : i = JSON.stringify(e), i = this._id ? `Metapage[${this._id}] ${i}` : i, Et(i, n, s);
3382
+ typeof e == "string" ? i = e : typeof e == "number" ? i = e + "" : i = JSON.stringify(e), i = this._id ? `Metapage[${this._id}] ${i}` : i, At(i, n, s);
3389
3383
  }
3390
3384
  }
3391
- ee.version = Wt;
3385
+ ee.version = Jt;
3392
3386
  ee.DEFINITION = x.Definition;
3393
3387
  ee.ERROR = x.Error;
3394
3388
  ee.INPUTS = x.Inputs;
@@ -3575,7 +3569,7 @@ export {
3575
3569
  Di as INVALID_PARAMS,
3576
3570
  Ti as INVALID_REQUEST,
3577
3571
  q as JsonRpcMethodsFromChild,
3578
- fe as JsonRpcMethodsFromParent,
3572
+ me as JsonRpcMethodsFromParent,
3579
3573
  Mi as METAFRAME_JSON_FILE,
3580
3574
  Ii as METAPAGE_KEY_DEFINITION,
3581
3575
  Ci as METAPAGE_KEY_STATE,
@@ -3584,49 +3578,49 @@ export {
3584
3578
  z as MetaframeEvents,
3585
3579
  ae as MetaframeLoadingState,
3586
3580
  We as MetaframeVersionCurrent,
3587
- Ct as MetaframeVersionsAll,
3581
+ It as MetaframeVersionsAll,
3588
3582
  ee as Metapage,
3589
3583
  x as MetapageEvents,
3590
3584
  xe as MetapageHashParams,
3591
3585
  vi as MetapageIFrameRpcClient,
3592
3586
  Ns as MetapageShared,
3593
3587
  Le as MetapageVersionCurrent,
3594
- $t as MetapageVersionsAll,
3588
+ Ct as MetapageVersionsAll,
3595
3589
  Li as PARSE_ERROR,
3596
3590
  En as VERSION_METAFRAME,
3597
- Wt as VERSION_METAPAGE,
3591
+ Jt as VERSION_METAPAGE,
3598
3592
  ns as convertMetaframeDefinitionToCurrentVersion,
3599
- sn as convertMetaframeDefinitionToVersion,
3593
+ nn as convertMetaframeDefinitionToVersion,
3600
3594
  pt as convertMetaframeJsonToCurrentVersion,
3601
3595
  Wn as convertMetapageDefinitionToCurrentVersion,
3602
- nn as convertMetapageDefinitionToVersion,
3596
+ tn as convertMetapageDefinitionToVersion,
3603
3597
  Ce as deserializeInputs,
3604
- At as generateId,
3598
+ St as generateId,
3605
3599
  Ui as generateMetaframeId,
3606
3600
  js as generateMetapageId,
3607
3601
  Bi as generateNonce,
3608
3602
  Vi as getLibraryVersionMatching,
3609
3603
  te as getMatchingMetaframeVersion,
3610
- de as getMatchingMetapageVersion,
3604
+ he as getMatchingMetapageVersion,
3611
3605
  wi as getMetaframeDefinitionFromUrl,
3612
3606
  bi as getMetapageDefinitionFromUrl,
3613
3607
  Ni as getUrlParam,
3614
3608
  ji as getUrlParamDebug,
3615
3609
  Us as hashCode,
3616
3610
  Bs as intToRGB,
3617
- dt as isDebugFromUrlsParams,
3611
+ ht as isDebugFromUrlsParams,
3618
3612
  Gi as isEmptyMetaframeDefinition,
3619
3613
  Hs as isIframe,
3620
3614
  Hi as isJsonRpcId,
3621
3615
  tt as isPageLoaded,
3622
- Et as log,
3616
+ At as log,
3623
3617
  Ri as matchPipe,
3624
3618
  Ge as merge,
3625
3619
  Fi as metapageAllSha256Hash,
3626
3620
  zi as metapageOnlyEssentailSha256Hash,
3627
3621
  Xe as pageLoaded,
3628
3622
  xi as possiblyDeserializeDatarefToFile,
3629
- rn as possiblyDeserializeDatarefToValue,
3623
+ sn as possiblyDeserializeDatarefToValue,
3630
3624
  ds as possiblySerializeValueToDataref,
3631
3625
  Ji as renderMetapage,
3632
3626
  Ke as serializeInputs,