document-model 1.0.22 → 1.0.23

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.
Files changed (73) hide show
  1. package/dist/browser/document-model.cjs +1 -1
  2. package/dist/browser/document-model.js +2 -2
  3. package/dist/browser/document.cjs +1 -1
  4. package/dist/browser/document.js +4 -4
  5. package/dist/browser/index.cjs +1 -1
  6. package/dist/browser/index.js +3 -3
  7. package/dist/browser/internal/{index-k0_xGFJa.js → index-8aac3662.js} +400 -398
  8. package/dist/browser/internal/index-8fceb2dc.js +1 -0
  9. package/dist/browser/internal/index-cd28e4ab.js +22 -0
  10. package/dist/browser/internal/index-e127ba7e.js +36 -0
  11. package/dist/browser/internal/{object-wtPuW7QY.js → object-67d1240b.js} +409 -359
  12. package/dist/browser/internal/object-ba4e810d.js +6 -0
  13. package/dist/browser/src/document/actions/creators.d.ts +3 -2
  14. package/dist/browser/src/document/actions/types.d.ts +1 -1
  15. package/dist/browser/src/document/object.d.ts +58 -2
  16. package/dist/browser/src/document/reducer.d.ts +2 -2
  17. package/dist/browser/src/document/schema/types.d.ts +9 -3
  18. package/dist/browser/src/document/signal.d.ts +7 -1
  19. package/dist/browser/src/document/types.d.ts +12 -1
  20. package/dist/browser/src/document/utils/base.d.ts +15 -2
  21. package/dist/browser/src/document-model/gen/header/object.d.ts +7 -6
  22. package/dist/browser/src/document-model/gen/module/object.d.ts +6 -5
  23. package/dist/browser/src/document-model/gen/operation/object.d.ts +11 -10
  24. package/dist/browser/src/document-model/gen/operation-error/object.d.ts +8 -7
  25. package/dist/browser/src/document-model/gen/operation-example/object.d.ts +5 -4
  26. package/dist/browser/src/document-model/gen/reducer.d.ts +2 -0
  27. package/dist/browser/src/document-model/gen/state/object.d.ts +7 -6
  28. package/dist/browser/src/document-model/gen/versioning/object.d.ts +6 -5
  29. package/dist/browser/src/document-model/index.d.ts +2 -1
  30. package/dist/browser/test/document/skip-operations.test.d.ts +1 -0
  31. package/dist/browser/test/document-model/skip-operations.test.d.ts +1 -0
  32. package/dist/browser/test/helpers.d.ts +5 -2
  33. package/dist/node/document-model.cjs +1 -1
  34. package/dist/node/document-model.js +2 -2
  35. package/dist/node/document.cjs +1 -1
  36. package/dist/node/document.js +4 -4
  37. package/dist/node/index.cjs +1 -1
  38. package/dist/node/index.js +3 -3
  39. package/dist/node/internal/index-ac24dd92.js +36 -0
  40. package/dist/node/internal/index-c75a9c7a.js +1 -0
  41. package/dist/node/internal/{index-vqhz-N10.js → index-e9f12d45.js} +400 -398
  42. package/dist/node/internal/index-f04f94a6.js +22 -0
  43. package/dist/node/internal/object-10b89c54.js +1 -0
  44. package/dist/node/internal/{object-yzJ3jRpE.js → object-cb276649.js} +317 -267
  45. package/dist/node/src/document/actions/creators.d.ts +3 -2
  46. package/dist/node/src/document/actions/types.d.ts +1 -1
  47. package/dist/node/src/document/object.d.ts +58 -2
  48. package/dist/node/src/document/reducer.d.ts +2 -2
  49. package/dist/node/src/document/schema/types.d.ts +9 -3
  50. package/dist/node/src/document/signal.d.ts +7 -1
  51. package/dist/node/src/document/types.d.ts +12 -1
  52. package/dist/node/src/document/utils/base.d.ts +15 -2
  53. package/dist/node/src/document-model/gen/header/object.d.ts +7 -6
  54. package/dist/node/src/document-model/gen/module/object.d.ts +6 -5
  55. package/dist/node/src/document-model/gen/operation/object.d.ts +11 -10
  56. package/dist/node/src/document-model/gen/operation-error/object.d.ts +8 -7
  57. package/dist/node/src/document-model/gen/operation-example/object.d.ts +5 -4
  58. package/dist/node/src/document-model/gen/reducer.d.ts +2 -0
  59. package/dist/node/src/document-model/gen/state/object.d.ts +7 -6
  60. package/dist/node/src/document-model/gen/versioning/object.d.ts +6 -5
  61. package/dist/node/src/document-model/index.d.ts +2 -1
  62. package/dist/node/test/document/skip-operations.test.d.ts +1 -0
  63. package/dist/node/test/document-model/skip-operations.test.d.ts +1 -0
  64. package/dist/node/test/helpers.d.ts +5 -2
  65. package/package.json +1 -1
  66. package/dist/browser/internal/index-BGvdUwMj.js +0 -1
  67. package/dist/browser/internal/index-ZaSXpgfR.js +0 -22
  68. package/dist/browser/internal/index-vHDbgY8i.js +0 -34
  69. package/dist/browser/internal/object-fIfH8K9b.js +0 -6
  70. package/dist/node/internal/index-3_D7m254.js +0 -34
  71. package/dist/node/internal/index-ffEJwj4v.js +0 -22
  72. package/dist/node/internal/index-frYzO4l6.js +0 -1
  73. package/dist/node/internal/object-Vf10stKL.js +0 -1
@@ -1,30 +1,30 @@
1
- var br = Object.defineProperty;
2
- var _r = (i, a, p) => a in i ? br(i, a, { enumerable: !0, configurable: !0, writable: !0, value: p }) : i[a] = p;
3
- var P = (i, a, p) => (_r(i, typeof a != "symbol" ? a + "" : a, p), p);
4
- import Fr from "json-stringify-deterministic";
5
- import { produce as _t, castDraft as Ar, castImmutable as Sr, freeze as Br } from "immer";
1
+ var _r = Object.defineProperty;
2
+ var Fr = (i, a, p) => a in i ? _r(i, a, { enumerable: !0, configurable: !0, writable: !0, value: p }) : i[a] = p;
3
+ var W = (i, a, p) => (Fr(i, typeof a != "symbol" ? a + "" : a, p), p);
4
+ import Ar from "json-stringify-deterministic";
5
+ import { produce as _t, castDraft as Sr, castImmutable as Br, freeze as jr } from "immer";
6
6
  import { z as d } from "zod";
7
7
  import St from "jszip";
8
- const Bt = (i) => i != null, jr = d.any().refine((i) => Bt(i)), jt = d.enum(["LOAD_STATE"]), It = d.enum(["PRUNE"]), Ut = d.enum(["REDO"]), kt = d.enum(["SET_NAME"]), Tt = d.enum(["UNDO"]);
9
- function Ir() {
8
+ const Bt = (i) => i != null, Ir = d.any().refine((i) => Bt(i)), jt = d.enum(["LOAD_STATE"]), It = d.enum(["PRUNE"]), Ut = d.enum(["REDO"]), kt = d.enum(["SET_NAME"]), Tt = d.enum(["UNDO"]);
9
+ function Ur() {
10
10
  return d.object({
11
11
  __typename: d.literal("Action").optional(),
12
12
  type: d.string()
13
13
  });
14
14
  }
15
- function M() {
15
+ function C() {
16
16
  return d.literal("global").or(d.literal("local"));
17
17
  }
18
- function Dt() {
18
+ function Ot() {
19
19
  return d.union([
20
- Ot(),
20
+ Dt(),
21
21
  Mt(),
22
22
  Rt(),
23
23
  Ct(),
24
24
  Lt()
25
25
  ]);
26
26
  }
27
- function Ur() {
27
+ function kr() {
28
28
  return d.object({
29
29
  __typename: d.literal("DocumentFile").optional(),
30
30
  data: d.string(),
@@ -33,11 +33,11 @@ function Ur() {
33
33
  mimeType: d.string()
34
34
  });
35
35
  }
36
- function Ot() {
36
+ function Dt() {
37
37
  return d.object({
38
38
  input: d.lazy(() => nt()),
39
39
  type: jt,
40
- scope: M()
40
+ scope: C()
41
41
  });
42
42
  }
43
43
  function nt() {
@@ -52,7 +52,7 @@ function Nt() {
52
52
  name: d.string()
53
53
  });
54
54
  }
55
- function kr() {
55
+ function Tr() {
56
56
  return d.object({
57
57
  __typename: d.literal("Operation").optional(),
58
58
  hash: d.string(),
@@ -65,7 +65,7 @@ function Mt() {
65
65
  return d.object({
66
66
  input: d.lazy(() => at()),
67
67
  type: It,
68
- scope: M()
68
+ scope: C()
69
69
  });
70
70
  }
71
71
  function at() {
@@ -79,7 +79,7 @@ function Rt() {
79
79
  return d.object({
80
80
  input: ot(),
81
81
  type: Ut,
82
- scope: M()
82
+ scope: C()
83
83
  });
84
84
  }
85
85
  const pt = d.string;
@@ -90,7 +90,7 @@ function Ct() {
90
90
  scope: d.literal("global")
91
91
  });
92
92
  }
93
- function Tr() {
93
+ function Or() {
94
94
  return d.object({
95
95
  __typename: d.literal("SetNameOperation").optional(),
96
96
  hash: d.string(),
@@ -105,20 +105,20 @@ function Lt() {
105
105
  return d.object({
106
106
  input: st(),
107
107
  type: Tt,
108
- scope: M()
108
+ scope: C()
109
109
  });
110
110
  }
111
- const Ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
111
+ const Te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
112
112
  __proto__: null,
113
- ActionSchema: Ir,
114
- BaseActionSchema: Dt,
115
- DocumentFileSchema: Ur,
113
+ ActionSchema: Ur,
114
+ BaseActionSchema: Ot,
115
+ DocumentFileSchema: kr,
116
116
  LoadStateActionInputSchema: nt,
117
- LoadStateActionSchema: Ot,
117
+ LoadStateActionSchema: Dt,
118
118
  LoadStateActionStateInputSchema: Nt,
119
119
  Load_StateSchema: jt,
120
- OperationSchema: kr,
121
- OperationScopeSchema: M,
120
+ OperationSchema: Tr,
121
+ OperationScopeSchema: C,
122
122
  PruneActionInputSchema: at,
123
123
  PruneActionSchema: Mt,
124
124
  PruneSchema: It,
@@ -127,24 +127,24 @@ const Ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
127
127
  RedoSchema: Ut,
128
128
  SetNameActionInputSchema: pt,
129
129
  SetNameActionSchema: Ct,
130
- SetNameOperationSchema: Tr,
130
+ SetNameOperationSchema: Or,
131
131
  Set_NameSchema: kt,
132
132
  UndoActionInputSchema: st,
133
133
  UndoActionSchema: Lt,
134
134
  UndoSchema: Tt,
135
- definedNonNullAnySchema: jr,
135
+ definedNonNullAnySchema: Ir,
136
136
  isDefinedNonNullAny: Bt
137
137
  }, Symbol.toStringTag, { value: "Module" }));
138
138
  function Dr(i, a) {
139
139
  return { ...i, name: a };
140
140
  }
141
- function Or(i, a, p) {
141
+ function Nr(i, a, p) {
142
142
  const { scope: c, input: u } = a, f = i.revision[a.scope], l = Math.min(u, f), o = i.operations[c].slice(
143
143
  0,
144
144
  f - l
145
145
  );
146
146
  return {
147
- ...H(
147
+ ...Z(
148
148
  i.initialState,
149
149
  {
150
150
  ...i.operations,
@@ -159,7 +159,7 @@ function Or(i, a, p) {
159
159
  }
160
160
  };
161
161
  }
162
- function Nr(i, a, p) {
162
+ function Mr(i, a, p) {
163
163
  const { scope: c, input: u } = a, f = i.operations[c].length - i.revision[c];
164
164
  if (!f)
165
165
  throw new Error("There is no UNDO operation to REDO");
@@ -168,7 +168,7 @@ function Nr(i, a, p) {
168
168
  i.revision[c] + l
169
169
  );
170
170
  return {
171
- ...H(
171
+ ...Z(
172
172
  i.initialState,
173
173
  {
174
174
  ...i.operations,
@@ -183,21 +183,21 @@ function Nr(i, a, p) {
183
183
  }
184
184
  };
185
185
  }
186
- function Mr(i, a, p) {
186
+ function Rr(i, a, p) {
187
187
  const { scope: c } = a, u = i.operations[c];
188
188
  let {
189
189
  input: { start: f, end: l }
190
190
  } = a;
191
191
  f = f || 0, l = l || u.length;
192
- const o = u.slice(f, l), x = u.slice(0, f), g = u.slice(l), v = H(
192
+ const o = u.slice(f, l), x = u.slice(0, f), g = u.slice(l), w = Z(
193
193
  i.initialState,
194
194
  {
195
195
  ...i.operations,
196
196
  [c]: x.concat(o)
197
197
  },
198
198
  p
199
- ), { name: w, state: j } = v, F = x.length, D = x.length ? x[x.length - 1].timestamp : g.length ? g[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
200
- return H(
199
+ ), { name: v, state: E } = w, A = x.length, U = x.length ? x[x.length - 1].timestamp : g.length ? g[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
200
+ return Z(
201
201
  i.initialState,
202
202
  {
203
203
  ...i.operations,
@@ -205,40 +205,40 @@ function Mr(i, a, p) {
205
205
  ...x,
206
206
  {
207
207
  ...ut(
208
- { name: w, state: j },
208
+ { name: v, state: E },
209
209
  o.length
210
210
  ),
211
- timestamp: D,
212
- index: F,
213
- hash: Vt({ state: j }, "global")
211
+ timestamp: U,
212
+ index: A,
213
+ hash: Vt({ state: E }, "global")
214
214
  },
215
- ...g.map((U, G) => ({
216
- ...U,
217
- index: F + G + 1
215
+ ...g.map((O, N) => ({
216
+ ...O,
217
+ index: A + N + 1
218
218
  }))
219
219
  ]
220
220
  },
221
221
  p
222
222
  );
223
223
  }
224
- function Rr(i, a) {
224
+ function Cr(i, a) {
225
225
  return {
226
226
  ...i,
227
227
  name: a.name,
228
228
  state: a.state ?? { global: {}, local: {} }
229
229
  };
230
230
  }
231
- const zt = "SET_NAME", R = "UNDO", C = "REDO", L = "PRUNE", qt = "LOAD_STATE";
231
+ const zt = "SET_NAME", L = "UNDO", z = "REDO", q = "PRUNE", qt = "LOAD_STATE";
232
232
  function $t(i) {
233
233
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
234
234
  }
235
- function Z() {
235
+ function Y() {
236
236
  this._types = /* @__PURE__ */ Object.create(null), this._extensions = /* @__PURE__ */ Object.create(null);
237
237
  for (let i = 0; i < arguments.length; i++)
238
238
  this.define(arguments[i]);
239
239
  this.define = this.define.bind(this), this.getType = this.getType.bind(this), this.getExtension = this.getExtension.bind(this);
240
240
  }
241
- Z.prototype.define = function(i, a) {
241
+ Y.prototype.define = function(i, a) {
242
242
  for (let p in i) {
243
243
  let c = i[p].map(function(u) {
244
244
  return u.toLowerCase();
@@ -260,18 +260,18 @@ Z.prototype.define = function(i, a) {
260
260
  }
261
261
  }
262
262
  };
263
- Z.prototype.getType = function(i) {
263
+ Y.prototype.getType = function(i) {
264
264
  i = String(i);
265
265
  let a = i.replace(/^.*[/\\]/, "").toLowerCase(), p = a.replace(/^.*\./, "").toLowerCase(), c = a.length < i.length;
266
266
  return (p.length < a.length - 1 || !c) && this._types[p] || null;
267
267
  };
268
- Z.prototype.getExtension = function(i) {
268
+ Y.prototype.getExtension = function(i) {
269
269
  return i = /^\s*([^;\s]*)/.test(i) && RegExp.$1, i && this._extensions[i.toLowerCase()] || null;
270
270
  };
271
- var Cr = Z, Lr = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
272
- let zr = Cr;
273
- var qr = new zr(Lr);
274
- const $r = /* @__PURE__ */ $t(qr);
271
+ var Lr = Y, zr = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
272
+ let qr = Lr;
273
+ var $r = new qr(zr);
274
+ const Pr = /* @__PURE__ */ $t($r);
275
275
  var et = { exports: {} };
276
276
  typeof Object.create == "function" ? et.exports = function(a, p) {
277
277
  p && (a.super_ = p, a.prototype = Object.create(p.prototype, {
@@ -290,16 +290,16 @@ typeof Object.create == "function" ? et.exports = function(a, p) {
290
290
  c.prototype = p.prototype, a.prototype = new c(), a.prototype.constructor = a;
291
291
  }
292
292
  };
293
- var Jr = et.exports, it = { exports: {} }, Jt = {}, Y = {};
294
- Y.byteLength = Hr;
295
- Y.toByteArray = Yr;
296
- Y.fromByteArray = Gr;
297
- var T = [], I = [], Pr = typeof Uint8Array < "u" ? Uint8Array : Array, rt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
298
- for (var N = 0, Wr = rt.length; N < Wr; ++N)
299
- T[N] = rt[N], I[rt.charCodeAt(N)] = N;
300
- I[45] = 62;
301
- I[95] = 63;
302
- function Pt(i) {
293
+ var Jr = et.exports, it = { exports: {} }, Pt = {}, K = {};
294
+ K.byteLength = Zr;
295
+ K.toByteArray = Kr;
296
+ K.fromByteArray = Vr;
297
+ var T = [], I = [], Wr = typeof Uint8Array < "u" ? Uint8Array : Array, rt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
298
+ for (var M = 0, Hr = rt.length; M < Hr; ++M)
299
+ T[M] = rt[M], I[rt.charCodeAt(M)] = M;
300
+ I["-".charCodeAt(0)] = 62;
301
+ I["_".charCodeAt(0)] = 63;
302
+ function Jt(i) {
303
303
  var a = i.length;
304
304
  if (a % 4 > 0)
305
305
  throw new Error("Invalid string. Length must be a multiple of 4");
@@ -308,30 +308,30 @@ function Pt(i) {
308
308
  var c = p === a ? 0 : 4 - p % 4;
309
309
  return [p, c];
310
310
  }
311
- function Hr(i) {
312
- var a = Pt(i), p = a[0], c = a[1];
311
+ function Zr(i) {
312
+ var a = Jt(i), p = a[0], c = a[1];
313
313
  return (p + c) * 3 / 4 - c;
314
314
  }
315
- function Zr(i, a, p) {
315
+ function Yr(i, a, p) {
316
316
  return (a + p) * 3 / 4 - p;
317
317
  }
318
- function Yr(i) {
319
- var a, p = Pt(i), c = p[0], u = p[1], f = new Pr(Zr(i, c, u)), l = 0, o = u > 0 ? c - 4 : c, x;
318
+ function Kr(i) {
319
+ var a, p = Jt(i), c = p[0], u = p[1], f = new Wr(Yr(i, c, u)), l = 0, o = u > 0 ? c - 4 : c, x;
320
320
  for (x = 0; x < o; x += 4)
321
321
  a = I[i.charCodeAt(x)] << 18 | I[i.charCodeAt(x + 1)] << 12 | I[i.charCodeAt(x + 2)] << 6 | I[i.charCodeAt(x + 3)], f[l++] = a >> 16 & 255, f[l++] = a >> 8 & 255, f[l++] = a & 255;
322
322
  return u === 2 && (a = I[i.charCodeAt(x)] << 2 | I[i.charCodeAt(x + 1)] >> 4, f[l++] = a & 255), u === 1 && (a = I[i.charCodeAt(x)] << 10 | I[i.charCodeAt(x + 1)] << 4 | I[i.charCodeAt(x + 2)] >> 2, f[l++] = a >> 8 & 255, f[l++] = a & 255), f;
323
323
  }
324
- function Kr(i) {
324
+ function Xr(i) {
325
325
  return T[i >> 18 & 63] + T[i >> 12 & 63] + T[i >> 6 & 63] + T[i & 63];
326
326
  }
327
- function Xr(i, a, p) {
327
+ function Gr(i, a, p) {
328
328
  for (var c, u = [], f = a; f < p; f += 3)
329
- c = (i[f] << 16 & 16711680) + (i[f + 1] << 8 & 65280) + (i[f + 2] & 255), u.push(Kr(c));
329
+ c = (i[f] << 16 & 16711680) + (i[f + 1] << 8 & 65280) + (i[f + 2] & 255), u.push(Xr(c));
330
330
  return u.join("");
331
331
  }
332
- function Gr(i) {
332
+ function Vr(i) {
333
333
  for (var a, p = i.length, c = p % 3, u = [], f = 16383, l = 0, o = p - c; l < o; l += f)
334
- u.push(Xr(i, l, l + f > o ? o : l + f));
334
+ u.push(Gr(i, l, l + f > o ? o : l + f));
335
335
  return c === 1 ? (a = i[p - 1], u.push(
336
336
  T[a >> 2] + T[a << 4 & 63] + "=="
337
337
  )) : c === 2 && (a = (i[p - 2] << 8) + i[p - 1], u.push(
@@ -341,27 +341,27 @@ function Gr(i) {
341
341
  var ct = {};
342
342
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
343
343
  ct.read = function(i, a, p, c, u) {
344
- var f, l, o = u * 8 - c - 1, x = (1 << o) - 1, g = x >> 1, v = -7, w = p ? u - 1 : 0, j = p ? -1 : 1, F = i[a + w];
345
- for (w += j, f = F & (1 << -v) - 1, F >>= -v, v += o; v > 0; f = f * 256 + i[a + w], w += j, v -= 8)
344
+ var f, l, o = u * 8 - c - 1, x = (1 << o) - 1, g = x >> 1, w = -7, v = p ? u - 1 : 0, E = p ? -1 : 1, A = i[a + v];
345
+ for (v += E, f = A & (1 << -w) - 1, A >>= -w, w += o; w > 0; f = f * 256 + i[a + v], v += E, w -= 8)
346
346
  ;
347
- for (l = f & (1 << -v) - 1, f >>= -v, v += c; v > 0; l = l * 256 + i[a + w], w += j, v -= 8)
347
+ for (l = f & (1 << -w) - 1, f >>= -w, w += c; w > 0; l = l * 256 + i[a + v], v += E, w -= 8)
348
348
  ;
349
349
  if (f === 0)
350
350
  f = 1 - g;
351
351
  else {
352
352
  if (f === x)
353
- return l ? NaN : (F ? -1 : 1) * (1 / 0);
353
+ return l ? NaN : (A ? -1 : 1) * (1 / 0);
354
354
  l = l + Math.pow(2, c), f = f - g;
355
355
  }
356
- return (F ? -1 : 1) * l * Math.pow(2, f - c);
356
+ return (A ? -1 : 1) * l * Math.pow(2, f - c);
357
357
  };
358
358
  ct.write = function(i, a, p, c, u, f) {
359
- var l, o, x, g = f * 8 - u - 1, v = (1 << g) - 1, w = v >> 1, j = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = c ? 0 : f - 1, D = c ? 1 : -1, U = a < 0 || a === 0 && 1 / a < 0 ? 1 : 0;
360
- for (a = Math.abs(a), isNaN(a) || a === 1 / 0 ? (o = isNaN(a) ? 1 : 0, l = v) : (l = Math.floor(Math.log(a) / Math.LN2), a * (x = Math.pow(2, -l)) < 1 && (l--, x *= 2), l + w >= 1 ? a += j / x : a += j * Math.pow(2, 1 - w), a * x >= 2 && (l++, x /= 2), l + w >= v ? (o = 0, l = v) : l + w >= 1 ? (o = (a * x - 1) * Math.pow(2, u), l = l + w) : (o = a * Math.pow(2, w - 1) * Math.pow(2, u), l = 0)); u >= 8; i[p + F] = o & 255, F += D, o /= 256, u -= 8)
359
+ var l, o, x, g = f * 8 - u - 1, w = (1 << g) - 1, v = w >> 1, E = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, A = c ? 0 : f - 1, U = c ? 1 : -1, O = a < 0 || a === 0 && 1 / a < 0 ? 1 : 0;
360
+ for (a = Math.abs(a), isNaN(a) || a === 1 / 0 ? (o = isNaN(a) ? 1 : 0, l = w) : (l = Math.floor(Math.log(a) / Math.LN2), a * (x = Math.pow(2, -l)) < 1 && (l--, x *= 2), l + v >= 1 ? a += E / x : a += E * Math.pow(2, 1 - v), a * x >= 2 && (l++, x /= 2), l + v >= w ? (o = 0, l = w) : l + v >= 1 ? (o = (a * x - 1) * Math.pow(2, u), l = l + v) : (o = a * Math.pow(2, v - 1) * Math.pow(2, u), l = 0)); u >= 8; i[p + A] = o & 255, A += U, o /= 256, u -= 8)
361
361
  ;
362
- for (l = l << u | o, g += u; g > 0; i[p + F] = l & 255, F += D, l /= 256, g -= 8)
362
+ for (l = l << u | o, g += u; g > 0; i[p + A] = l & 255, A += U, l /= 256, g -= 8)
363
363
  ;
364
- i[p + F - D] |= U * 128;
364
+ i[p + A - U] |= O * 128;
365
365
  };
366
366
  /*!
367
367
  * The buffer module from node.js, for the browser.
@@ -370,8 +370,8 @@ ct.write = function(i, a, p, c, u, f) {
370
370
  * @license MIT
371
371
  */
372
372
  (function(i) {
373
- var a = Y, p = ct, c = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
374
- i.Buffer = o, i.SlowBuffer = nr, i.INSPECT_MAX_BYTES = 50;
373
+ var a = K, p = ct, c = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
374
+ i.Buffer = o, i.SlowBuffer = ar, i.INSPECT_MAX_BYTES = 50;
375
375
  var u = 2147483647;
376
376
  i.kMaxLength = u, o.TYPED_ARRAY_SUPPORT = f(), !o.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
377
377
  "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
@@ -411,22 +411,22 @@ ct.write = function(i, a, p, c, u, f) {
411
411
  throw new TypeError(
412
412
  'The "string" argument must be of type string. Received type number'
413
413
  );
414
- return w(e);
414
+ return v(e);
415
415
  }
416
416
  return x(e, t, r);
417
417
  }
418
418
  o.poolSize = 8192;
419
419
  function x(e, t, r) {
420
420
  if (typeof e == "string")
421
- return j(e, t);
421
+ return E(e, t);
422
422
  if (ArrayBuffer.isView(e))
423
- return D(e);
423
+ return U(e);
424
424
  if (e == null)
425
425
  throw new TypeError(
426
426
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e
427
427
  );
428
428
  if (k(e, ArrayBuffer) || e && k(e.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (k(e, SharedArrayBuffer) || e && k(e.buffer, SharedArrayBuffer)))
429
- return U(e, t, r);
429
+ return O(e, t, r);
430
430
  if (typeof e == "number")
431
431
  throw new TypeError(
432
432
  'The "value" argument must not be of type number. Received type number'
@@ -434,7 +434,7 @@ ct.write = function(i, a, p, c, u, f) {
434
434
  var n = e.valueOf && e.valueOf();
435
435
  if (n != null && n !== e)
436
436
  return o.from(n, t, r);
437
- var s = G(e);
437
+ var s = N(e);
438
438
  if (s)
439
439
  return s;
440
440
  if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof e[Symbol.toPrimitive] == "function")
@@ -456,39 +456,39 @@ ct.write = function(i, a, p, c, u, f) {
456
456
  if (e < 0)
457
457
  throw new RangeError('The value "' + e + '" is invalid for option "size"');
458
458
  }
459
- function v(e, t, r) {
459
+ function w(e, t, r) {
460
460
  return g(e), e <= 0 ? l(e) : t !== void 0 ? typeof r == "string" ? l(e).fill(t, r) : l(e).fill(t) : l(e);
461
461
  }
462
462
  o.alloc = function(e, t, r) {
463
- return v(e, t, r);
463
+ return w(e, t, r);
464
464
  };
465
- function w(e) {
465
+ function v(e) {
466
466
  return g(e), l(e < 0 ? 0 : V(e) | 0);
467
467
  }
468
468
  o.allocUnsafe = function(e) {
469
- return w(e);
469
+ return v(e);
470
470
  }, o.allocUnsafeSlow = function(e) {
471
- return w(e);
471
+ return v(e);
472
472
  };
473
- function j(e, t) {
473
+ function E(e, t) {
474
474
  if ((typeof t != "string" || t === "") && (t = "utf8"), !o.isEncoding(t))
475
475
  throw new TypeError("Unknown encoding: " + t);
476
476
  var r = ft(e, t) | 0, n = l(r), s = n.write(e, t);
477
477
  return s !== r && (n = n.slice(0, s)), n;
478
478
  }
479
- function F(e) {
479
+ function A(e) {
480
480
  for (var t = e.length < 0 ? 0 : V(e.length) | 0, r = l(t), n = 0; n < t; n += 1)
481
481
  r[n] = e[n] & 255;
482
482
  return r;
483
483
  }
484
- function D(e) {
484
+ function U(e) {
485
485
  if (k(e, Uint8Array)) {
486
486
  var t = new Uint8Array(e);
487
- return U(t.buffer, t.byteOffset, t.byteLength);
487
+ return O(t.buffer, t.byteOffset, t.byteLength);
488
488
  }
489
- return F(e);
489
+ return A(e);
490
490
  }
491
- function U(e, t, r) {
491
+ function O(e, t, r) {
492
492
  if (t < 0 || e.byteLength < t)
493
493
  throw new RangeError('"offset" is outside of buffer bounds');
494
494
  if (e.byteLength < t + (r || 0))
@@ -496,22 +496,22 @@ ct.write = function(i, a, p, c, u, f) {
496
496
  var n;
497
497
  return t === void 0 && r === void 0 ? n = new Uint8Array(e) : r === void 0 ? n = new Uint8Array(e, t) : n = new Uint8Array(e, t, r), Object.setPrototypeOf(n, o.prototype), n;
498
498
  }
499
- function G(e) {
499
+ function N(e) {
500
500
  if (o.isBuffer(e)) {
501
501
  var t = V(e.length) | 0, r = l(t);
502
502
  return r.length === 0 || e.copy(r, 0, 0, t), r;
503
503
  }
504
504
  if (e.length !== void 0)
505
- return typeof e.length != "number" || tt(e.length) ? l(0) : F(e);
505
+ return typeof e.length != "number" || tt(e.length) ? l(0) : A(e);
506
506
  if (e.type === "Buffer" && Array.isArray(e.data))
507
- return F(e.data);
507
+ return A(e.data);
508
508
  }
509
509
  function V(e) {
510
510
  if (e >= u)
511
511
  throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + u.toString(16) + " bytes");
512
512
  return e | 0;
513
513
  }
514
- function nr(e) {
514
+ function ar(e) {
515
515
  return +e != e && (e = 0), o.alloc(+e);
516
516
  }
517
517
  o.isBuffer = function(t) {
@@ -609,29 +609,29 @@ ct.write = function(i, a, p, c, u, f) {
609
609
  }
610
610
  }
611
611
  o.byteLength = ft;
612
- function ar(e, t, r) {
612
+ function or(e, t, r) {
613
613
  var n = !1;
614
614
  if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((r === void 0 || r > this.length) && (r = this.length), r <= 0) || (r >>>= 0, t >>>= 0, r <= t))
615
615
  return "";
616
616
  for (e || (e = "utf8"); ; )
617
617
  switch (e) {
618
618
  case "hex":
619
- return xr(this, t, r);
619
+ return dr(this, t, r);
620
620
  case "utf8":
621
621
  case "utf-8":
622
622
  return xt(this, t, r);
623
623
  case "ascii":
624
- return hr(this, t, r);
624
+ return mr(this, t, r);
625
625
  case "latin1":
626
626
  case "binary":
627
- return mr(this, t, r);
627
+ return xr(this, t, r);
628
628
  case "base64":
629
- return ur(this, t, r);
629
+ return fr(this, t, r);
630
630
  case "ucs2":
631
631
  case "ucs-2":
632
632
  case "utf16le":
633
633
  case "utf-16le":
634
- return dr(this, t, r);
634
+ return gr(this, t, r);
635
635
  default:
636
636
  if (n)
637
637
  throw new TypeError("Unknown encoding: " + e);
@@ -639,7 +639,7 @@ ct.write = function(i, a, p, c, u, f) {
639
639
  }
640
640
  }
641
641
  o.prototype._isBuffer = !0;
642
- function O(e, t, r) {
642
+ function D(e, t, r) {
643
643
  var n = e[t];
644
644
  e[t] = e[r], e[r] = n;
645
645
  }
@@ -648,25 +648,25 @@ ct.write = function(i, a, p, c, u, f) {
648
648
  if (t % 2 !== 0)
649
649
  throw new RangeError("Buffer size must be a multiple of 16-bits");
650
650
  for (var r = 0; r < t; r += 2)
651
- O(this, r, r + 1);
651
+ D(this, r, r + 1);
652
652
  return this;
653
653
  }, o.prototype.swap32 = function() {
654
654
  var t = this.length;
655
655
  if (t % 4 !== 0)
656
656
  throw new RangeError("Buffer size must be a multiple of 32-bits");
657
657
  for (var r = 0; r < t; r += 4)
658
- O(this, r, r + 3), O(this, r + 1, r + 2);
658
+ D(this, r, r + 3), D(this, r + 1, r + 2);
659
659
  return this;
660
660
  }, o.prototype.swap64 = function() {
661
661
  var t = this.length;
662
662
  if (t % 8 !== 0)
663
663
  throw new RangeError("Buffer size must be a multiple of 64-bits");
664
664
  for (var r = 0; r < t; r += 8)
665
- O(this, r, r + 7), O(this, r + 1, r + 6), O(this, r + 2, r + 5), O(this, r + 3, r + 4);
665
+ D(this, r, r + 7), D(this, r + 1, r + 6), D(this, r + 2, r + 5), D(this, r + 3, r + 4);
666
666
  return this;
667
667
  }, o.prototype.toString = function() {
668
668
  var t = this.length;
669
- return t === 0 ? "" : arguments.length === 0 ? xt(this, 0, t) : ar.apply(this, arguments);
669
+ return t === 0 ? "" : arguments.length === 0 ? xt(this, 0, t) : or.apply(this, arguments);
670
670
  }, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function(t) {
671
671
  if (!o.isBuffer(t))
672
672
  throw new TypeError("Argument must be a Buffer");
@@ -689,9 +689,9 @@ ct.write = function(i, a, p, c, u, f) {
689
689
  return 1;
690
690
  if (r >>>= 0, n >>>= 0, s >>>= 0, h >>>= 0, this === t)
691
691
  return 0;
692
- for (var m = h - s, y = n - r, E = Math.min(m, y), b = this.slice(s, h), S = t.slice(r, n), _ = 0; _ < E; ++_)
693
- if (b[_] !== S[_]) {
694
- m = b[_], y = S[_];
692
+ for (var m = h - s, y = n - r, b = Math.min(m, y), _ = this.slice(s, h), B = t.slice(r, n), F = 0; F < b; ++F)
693
+ if (_[F] !== B[F]) {
694
+ m = _[F], y = B[F];
695
695
  break;
696
696
  }
697
697
  return m < y ? -1 : y < m ? 1 : 0;
@@ -721,27 +721,27 @@ ct.write = function(i, a, p, c, u, f) {
721
721
  return -1;
722
722
  h = 2, m /= 2, y /= 2, r /= 2;
723
723
  }
724
- function E(Et, bt) {
724
+ function b(Et, bt) {
725
725
  return h === 1 ? Et[bt] : Et.readUInt16BE(bt * h);
726
726
  }
727
- var b;
727
+ var _;
728
728
  if (s) {
729
- var S = -1;
730
- for (b = r; b < m; b++)
731
- if (E(e, b) === E(t, S === -1 ? 0 : b - S)) {
732
- if (S === -1 && (S = b), b - S + 1 === y)
733
- return S * h;
729
+ var B = -1;
730
+ for (_ = r; _ < m; _++)
731
+ if (b(e, _) === b(t, B === -1 ? 0 : _ - B)) {
732
+ if (B === -1 && (B = _), _ - B + 1 === y)
733
+ return B * h;
734
734
  } else
735
- S !== -1 && (b -= b - S), S = -1;
735
+ B !== -1 && (_ -= _ - B), B = -1;
736
736
  } else
737
- for (r + y > m && (r = m - y), b = r; b >= 0; b--) {
738
- for (var _ = !0, J = 0; J < y; J++)
739
- if (E(e, b + J) !== E(t, J)) {
740
- _ = !1;
737
+ for (r + y > m && (r = m - y), _ = r; _ >= 0; _--) {
738
+ for (var F = !0, J = 0; J < y; J++)
739
+ if (b(e, _ + J) !== b(t, J)) {
740
+ F = !1;
741
741
  break;
742
742
  }
743
- if (_)
744
- return b;
743
+ if (F)
744
+ return _;
745
745
  }
746
746
  return -1;
747
747
  }
@@ -752,7 +752,7 @@ ct.write = function(i, a, p, c, u, f) {
752
752
  }, o.prototype.lastIndexOf = function(t, r, n) {
753
753
  return ht(this, t, r, n, !1);
754
754
  };
755
- function or(e, t, r, n) {
755
+ function pr(e, t, r, n) {
756
756
  r = Number(r) || 0;
757
757
  var s = e.length - r;
758
758
  n ? (n = Number(n), n > s && (n = s)) : n = s;
@@ -766,17 +766,17 @@ ct.write = function(i, a, p, c, u, f) {
766
766
  }
767
767
  return m;
768
768
  }
769
- function pr(e, t, r, n) {
770
- return $(Q(t, e.length - r), e, r, n);
771
- }
772
769
  function sr(e, t, r, n) {
773
- return $(yr(t), e, r, n);
770
+ return P(Q(t, e.length - r), e, r, n);
774
771
  }
775
772
  function cr(e, t, r, n) {
776
- return $(vt(t), e, r, n);
773
+ return P(vr(t), e, r, n);
777
774
  }
778
775
  function lr(e, t, r, n) {
779
- return $(vr(t, e.length - r), e, r, n);
776
+ return P(vt(t), e, r, n);
777
+ }
778
+ function ur(e, t, r, n) {
779
+ return P(Er(t, e.length - r), e, r, n);
780
780
  }
781
781
  o.prototype.write = function(t, r, n, s) {
782
782
  if (r === void 0)
@@ -796,21 +796,21 @@ ct.write = function(i, a, p, c, u, f) {
796
796
  for (var m = !1; ; )
797
797
  switch (s) {
798
798
  case "hex":
799
- return or(this, t, r, n);
799
+ return pr(this, t, r, n);
800
800
  case "utf8":
801
801
  case "utf-8":
802
- return pr(this, t, r, n);
802
+ return sr(this, t, r, n);
803
803
  case "ascii":
804
804
  case "latin1":
805
805
  case "binary":
806
- return sr(this, t, r, n);
807
- case "base64":
808
806
  return cr(this, t, r, n);
807
+ case "base64":
808
+ return lr(this, t, r, n);
809
809
  case "ucs2":
810
810
  case "ucs-2":
811
811
  case "utf16le":
812
812
  case "utf-16le":
813
- return lr(this, t, r, n);
813
+ return ur(this, t, r, n);
814
814
  default:
815
815
  if (m)
816
816
  throw new TypeError("Unknown encoding: " + s);
@@ -822,7 +822,7 @@ ct.write = function(i, a, p, c, u, f) {
822
822
  data: Array.prototype.slice.call(this._arr || this, 0)
823
823
  };
824
824
  };
825
- function ur(e, t, r) {
825
+ function fr(e, t, r) {
826
826
  return t === 0 && r === e.length ? a.fromByteArray(e) : a.fromByteArray(e.slice(t, r));
827
827
  }
828
828
  function xt(e, t, r) {
@@ -830,27 +830,27 @@ ct.write = function(i, a, p, c, u, f) {
830
830
  for (var n = [], s = t; s < r; ) {
831
831
  var h = e[s], m = null, y = h > 239 ? 4 : h > 223 ? 3 : h > 191 ? 2 : 1;
832
832
  if (s + y <= r) {
833
- var E, b, S, _;
833
+ var b, _, B, F;
834
834
  switch (y) {
835
835
  case 1:
836
836
  h < 128 && (m = h);
837
837
  break;
838
838
  case 2:
839
- E = e[s + 1], (E & 192) === 128 && (_ = (h & 31) << 6 | E & 63, _ > 127 && (m = _));
839
+ b = e[s + 1], (b & 192) === 128 && (F = (h & 31) << 6 | b & 63, F > 127 && (m = F));
840
840
  break;
841
841
  case 3:
842
- E = e[s + 1], b = e[s + 2], (E & 192) === 128 && (b & 192) === 128 && (_ = (h & 15) << 12 | (E & 63) << 6 | b & 63, _ > 2047 && (_ < 55296 || _ > 57343) && (m = _));
842
+ b = e[s + 1], _ = e[s + 2], (b & 192) === 128 && (_ & 192) === 128 && (F = (h & 15) << 12 | (b & 63) << 6 | _ & 63, F > 2047 && (F < 55296 || F > 57343) && (m = F));
843
843
  break;
844
844
  case 4:
845
- E = e[s + 1], b = e[s + 2], S = e[s + 3], (E & 192) === 128 && (b & 192) === 128 && (S & 192) === 128 && (_ = (h & 15) << 18 | (E & 63) << 12 | (b & 63) << 6 | S & 63, _ > 65535 && _ < 1114112 && (m = _));
845
+ b = e[s + 1], _ = e[s + 2], B = e[s + 3], (b & 192) === 128 && (_ & 192) === 128 && (B & 192) === 128 && (F = (h & 15) << 18 | (b & 63) << 12 | (_ & 63) << 6 | B & 63, F > 65535 && F < 1114112 && (m = F));
846
846
  }
847
847
  }
848
848
  m === null ? (m = 65533, y = 1) : m > 65535 && (m -= 65536, n.push(m >>> 10 & 1023 | 55296), m = 56320 | m & 1023), n.push(m), s += y;
849
849
  }
850
- return fr(n);
850
+ return hr(n);
851
851
  }
852
852
  var dt = 4096;
853
- function fr(e) {
853
+ function hr(e) {
854
854
  var t = e.length;
855
855
  if (t <= dt)
856
856
  return String.fromCharCode.apply(String, e);
@@ -861,28 +861,28 @@ ct.write = function(i, a, p, c, u, f) {
861
861
  );
862
862
  return r;
863
863
  }
864
- function hr(e, t, r) {
864
+ function mr(e, t, r) {
865
865
  var n = "";
866
866
  r = Math.min(e.length, r);
867
867
  for (var s = t; s < r; ++s)
868
868
  n += String.fromCharCode(e[s] & 127);
869
869
  return n;
870
870
  }
871
- function mr(e, t, r) {
871
+ function xr(e, t, r) {
872
872
  var n = "";
873
873
  r = Math.min(e.length, r);
874
874
  for (var s = t; s < r; ++s)
875
875
  n += String.fromCharCode(e[s]);
876
876
  return n;
877
877
  }
878
- function xr(e, t, r) {
878
+ function dr(e, t, r) {
879
879
  var n = e.length;
880
880
  (!t || t < 0) && (t = 0), (!r || r < 0 || r > n) && (r = n);
881
881
  for (var s = "", h = t; h < r; ++h)
882
- s += Er[e[h]];
882
+ s += br[e[h]];
883
883
  return s;
884
884
  }
885
- function dr(e, t, r) {
885
+ function gr(e, t, r) {
886
886
  for (var n = e.slice(t, r), s = "", h = 0; h < n.length - 1; h += 2)
887
887
  s += String.fromCharCode(n[h] + n[h + 1] * 256);
888
888
  return s;
@@ -893,66 +893,66 @@ ct.write = function(i, a, p, c, u, f) {
893
893
  var s = this.subarray(t, r);
894
894
  return Object.setPrototypeOf(s, o.prototype), s;
895
895
  };
896
- function A(e, t, r) {
896
+ function S(e, t, r) {
897
897
  if (e % 1 !== 0 || e < 0)
898
898
  throw new RangeError("offset is not uint");
899
899
  if (e + t > r)
900
900
  throw new RangeError("Trying to access beyond buffer length");
901
901
  }
902
902
  o.prototype.readUintLE = o.prototype.readUIntLE = function(t, r, n) {
903
- t = t >>> 0, r = r >>> 0, n || A(t, r, this.length);
903
+ t = t >>> 0, r = r >>> 0, n || S(t, r, this.length);
904
904
  for (var s = this[t], h = 1, m = 0; ++m < r && (h *= 256); )
905
905
  s += this[t + m] * h;
906
906
  return s;
907
907
  }, o.prototype.readUintBE = o.prototype.readUIntBE = function(t, r, n) {
908
- t = t >>> 0, r = r >>> 0, n || A(t, r, this.length);
908
+ t = t >>> 0, r = r >>> 0, n || S(t, r, this.length);
909
909
  for (var s = this[t + --r], h = 1; r > 0 && (h *= 256); )
910
910
  s += this[t + --r] * h;
911
911
  return s;
912
912
  }, o.prototype.readUint8 = o.prototype.readUInt8 = function(t, r) {
913
- return t = t >>> 0, r || A(t, 1, this.length), this[t];
913
+ return t = t >>> 0, r || S(t, 1, this.length), this[t];
914
914
  }, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(t, r) {
915
- return t = t >>> 0, r || A(t, 2, this.length), this[t] | this[t + 1] << 8;
915
+ return t = t >>> 0, r || S(t, 2, this.length), this[t] | this[t + 1] << 8;
916
916
  }, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(t, r) {
917
- return t = t >>> 0, r || A(t, 2, this.length), this[t] << 8 | this[t + 1];
917
+ return t = t >>> 0, r || S(t, 2, this.length), this[t] << 8 | this[t + 1];
918
918
  }, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(t, r) {
919
- return t = t >>> 0, r || A(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
919
+ return t = t >>> 0, r || S(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
920
920
  }, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(t, r) {
921
- return t = t >>> 0, r || A(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
921
+ return t = t >>> 0, r || S(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
922
922
  }, o.prototype.readIntLE = function(t, r, n) {
923
- t = t >>> 0, r = r >>> 0, n || A(t, r, this.length);
923
+ t = t >>> 0, r = r >>> 0, n || S(t, r, this.length);
924
924
  for (var s = this[t], h = 1, m = 0; ++m < r && (h *= 256); )
925
925
  s += this[t + m] * h;
926
926
  return h *= 128, s >= h && (s -= Math.pow(2, 8 * r)), s;
927
927
  }, o.prototype.readIntBE = function(t, r, n) {
928
- t = t >>> 0, r = r >>> 0, n || A(t, r, this.length);
928
+ t = t >>> 0, r = r >>> 0, n || S(t, r, this.length);
929
929
  for (var s = r, h = 1, m = this[t + --s]; s > 0 && (h *= 256); )
930
930
  m += this[t + --s] * h;
931
931
  return h *= 128, m >= h && (m -= Math.pow(2, 8 * r)), m;
932
932
  }, o.prototype.readInt8 = function(t, r) {
933
- return t = t >>> 0, r || A(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
933
+ return t = t >>> 0, r || S(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
934
934
  }, o.prototype.readInt16LE = function(t, r) {
935
- t = t >>> 0, r || A(t, 2, this.length);
935
+ t = t >>> 0, r || S(t, 2, this.length);
936
936
  var n = this[t] | this[t + 1] << 8;
937
937
  return n & 32768 ? n | 4294901760 : n;
938
938
  }, o.prototype.readInt16BE = function(t, r) {
939
- t = t >>> 0, r || A(t, 2, this.length);
939
+ t = t >>> 0, r || S(t, 2, this.length);
940
940
  var n = this[t + 1] | this[t] << 8;
941
941
  return n & 32768 ? n | 4294901760 : n;
942
942
  }, o.prototype.readInt32LE = function(t, r) {
943
- return t = t >>> 0, r || A(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
943
+ return t = t >>> 0, r || S(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
944
944
  }, o.prototype.readInt32BE = function(t, r) {
945
- return t = t >>> 0, r || A(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
945
+ return t = t >>> 0, r || S(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
946
946
  }, o.prototype.readFloatLE = function(t, r) {
947
- return t = t >>> 0, r || A(t, 4, this.length), p.read(this, t, !0, 23, 4);
947
+ return t = t >>> 0, r || S(t, 4, this.length), p.read(this, t, !0, 23, 4);
948
948
  }, o.prototype.readFloatBE = function(t, r) {
949
- return t = t >>> 0, r || A(t, 4, this.length), p.read(this, t, !1, 23, 4);
949
+ return t = t >>> 0, r || S(t, 4, this.length), p.read(this, t, !1, 23, 4);
950
950
  }, o.prototype.readDoubleLE = function(t, r) {
951
- return t = t >>> 0, r || A(t, 8, this.length), p.read(this, t, !0, 52, 8);
951
+ return t = t >>> 0, r || S(t, 8, this.length), p.read(this, t, !0, 52, 8);
952
952
  }, o.prototype.readDoubleBE = function(t, r) {
953
- return t = t >>> 0, r || A(t, 8, this.length), p.read(this, t, !1, 52, 8);
953
+ return t = t >>> 0, r || S(t, 8, this.length), p.read(this, t, !1, 52, 8);
954
954
  };
955
- function B(e, t, r, n, s, h) {
955
+ function j(e, t, r, n, s, h) {
956
956
  if (!o.isBuffer(e))
957
957
  throw new TypeError('"buffer" argument must be a Buffer instance');
958
958
  if (t > s || t < h)
@@ -963,7 +963,7 @@ ct.write = function(i, a, p, c, u, f) {
963
963
  o.prototype.writeUintLE = o.prototype.writeUIntLE = function(t, r, n, s) {
964
964
  if (t = +t, r = r >>> 0, n = n >>> 0, !s) {
965
965
  var h = Math.pow(2, 8 * n) - 1;
966
- B(this, t, r, n, h, 0);
966
+ j(this, t, r, n, h, 0);
967
967
  }
968
968
  var m = 1, y = 0;
969
969
  for (this[r] = t & 255; ++y < n && (m *= 256); )
@@ -972,50 +972,50 @@ ct.write = function(i, a, p, c, u, f) {
972
972
  }, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(t, r, n, s) {
973
973
  if (t = +t, r = r >>> 0, n = n >>> 0, !s) {
974
974
  var h = Math.pow(2, 8 * n) - 1;
975
- B(this, t, r, n, h, 0);
975
+ j(this, t, r, n, h, 0);
976
976
  }
977
977
  var m = n - 1, y = 1;
978
978
  for (this[r + m] = t & 255; --m >= 0 && (y *= 256); )
979
979
  this[r + m] = t / y & 255;
980
980
  return r + n;
981
981
  }, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(t, r, n) {
982
- return t = +t, r = r >>> 0, n || B(this, t, r, 1, 255, 0), this[r] = t & 255, r + 1;
982
+ return t = +t, r = r >>> 0, n || j(this, t, r, 1, 255, 0), this[r] = t & 255, r + 1;
983
983
  }, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(t, r, n) {
984
- return t = +t, r = r >>> 0, n || B(this, t, r, 2, 65535, 0), this[r] = t & 255, this[r + 1] = t >>> 8, r + 2;
984
+ return t = +t, r = r >>> 0, n || j(this, t, r, 2, 65535, 0), this[r] = t & 255, this[r + 1] = t >>> 8, r + 2;
985
985
  }, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(t, r, n) {
986
- return t = +t, r = r >>> 0, n || B(this, t, r, 2, 65535, 0), this[r] = t >>> 8, this[r + 1] = t & 255, r + 2;
986
+ return t = +t, r = r >>> 0, n || j(this, t, r, 2, 65535, 0), this[r] = t >>> 8, this[r + 1] = t & 255, r + 2;
987
987
  }, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(t, r, n) {
988
- return t = +t, r = r >>> 0, n || B(this, t, r, 4, 4294967295, 0), this[r + 3] = t >>> 24, this[r + 2] = t >>> 16, this[r + 1] = t >>> 8, this[r] = t & 255, r + 4;
988
+ return t = +t, r = r >>> 0, n || j(this, t, r, 4, 4294967295, 0), this[r + 3] = t >>> 24, this[r + 2] = t >>> 16, this[r + 1] = t >>> 8, this[r] = t & 255, r + 4;
989
989
  }, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(t, r, n) {
990
- return t = +t, r = r >>> 0, n || B(this, t, r, 4, 4294967295, 0), this[r] = t >>> 24, this[r + 1] = t >>> 16, this[r + 2] = t >>> 8, this[r + 3] = t & 255, r + 4;
990
+ return t = +t, r = r >>> 0, n || j(this, t, r, 4, 4294967295, 0), this[r] = t >>> 24, this[r + 1] = t >>> 16, this[r + 2] = t >>> 8, this[r + 3] = t & 255, r + 4;
991
991
  }, o.prototype.writeIntLE = function(t, r, n, s) {
992
992
  if (t = +t, r = r >>> 0, !s) {
993
993
  var h = Math.pow(2, 8 * n - 1);
994
- B(this, t, r, n, h - 1, -h);
994
+ j(this, t, r, n, h - 1, -h);
995
995
  }
996
- var m = 0, y = 1, E = 0;
996
+ var m = 0, y = 1, b = 0;
997
997
  for (this[r] = t & 255; ++m < n && (y *= 256); )
998
- t < 0 && E === 0 && this[r + m - 1] !== 0 && (E = 1), this[r + m] = (t / y >> 0) - E & 255;
998
+ t < 0 && b === 0 && this[r + m - 1] !== 0 && (b = 1), this[r + m] = (t / y >> 0) - b & 255;
999
999
  return r + n;
1000
1000
  }, o.prototype.writeIntBE = function(t, r, n, s) {
1001
1001
  if (t = +t, r = r >>> 0, !s) {
1002
1002
  var h = Math.pow(2, 8 * n - 1);
1003
- B(this, t, r, n, h - 1, -h);
1003
+ j(this, t, r, n, h - 1, -h);
1004
1004
  }
1005
- var m = n - 1, y = 1, E = 0;
1005
+ var m = n - 1, y = 1, b = 0;
1006
1006
  for (this[r + m] = t & 255; --m >= 0 && (y *= 256); )
1007
- t < 0 && E === 0 && this[r + m + 1] !== 0 && (E = 1), this[r + m] = (t / y >> 0) - E & 255;
1007
+ t < 0 && b === 0 && this[r + m + 1] !== 0 && (b = 1), this[r + m] = (t / y >> 0) - b & 255;
1008
1008
  return r + n;
1009
1009
  }, o.prototype.writeInt8 = function(t, r, n) {
1010
- return t = +t, r = r >>> 0, n || B(this, t, r, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[r] = t & 255, r + 1;
1010
+ return t = +t, r = r >>> 0, n || j(this, t, r, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[r] = t & 255, r + 1;
1011
1011
  }, o.prototype.writeInt16LE = function(t, r, n) {
1012
- return t = +t, r = r >>> 0, n || B(this, t, r, 2, 32767, -32768), this[r] = t & 255, this[r + 1] = t >>> 8, r + 2;
1012
+ return t = +t, r = r >>> 0, n || j(this, t, r, 2, 32767, -32768), this[r] = t & 255, this[r + 1] = t >>> 8, r + 2;
1013
1013
  }, o.prototype.writeInt16BE = function(t, r, n) {
1014
- return t = +t, r = r >>> 0, n || B(this, t, r, 2, 32767, -32768), this[r] = t >>> 8, this[r + 1] = t & 255, r + 2;
1014
+ return t = +t, r = r >>> 0, n || j(this, t, r, 2, 32767, -32768), this[r] = t >>> 8, this[r + 1] = t & 255, r + 2;
1015
1015
  }, o.prototype.writeInt32LE = function(t, r, n) {
1016
- return t = +t, r = r >>> 0, n || B(this, t, r, 4, 2147483647, -2147483648), this[r] = t & 255, this[r + 1] = t >>> 8, this[r + 2] = t >>> 16, this[r + 3] = t >>> 24, r + 4;
1016
+ return t = +t, r = r >>> 0, n || j(this, t, r, 4, 2147483647, -2147483648), this[r] = t & 255, this[r + 1] = t >>> 8, this[r + 2] = t >>> 16, this[r + 3] = t >>> 24, r + 4;
1017
1017
  }, o.prototype.writeInt32BE = function(t, r, n) {
1018
- return t = +t, r = r >>> 0, n || B(this, t, r, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[r] = t >>> 24, this[r + 1] = t >>> 16, this[r + 2] = t >>> 8, this[r + 3] = t & 255, r + 4;
1018
+ return t = +t, r = r >>> 0, n || j(this, t, r, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[r] = t >>> 24, this[r + 1] = t >>> 16, this[r + 2] = t >>> 8, this[r + 3] = t & 255, r + 4;
1019
1019
  };
1020
1020
  function gt(e, t, r, n, s, h) {
1021
1021
  if (r + n > e.length)
@@ -1078,17 +1078,17 @@ ct.write = function(i, a, p, c, u, f) {
1078
1078
  for (m = r; m < n; ++m)
1079
1079
  this[m] = t;
1080
1080
  else {
1081
- var y = o.isBuffer(t) ? t : o.from(t, s), E = y.length;
1082
- if (E === 0)
1081
+ var y = o.isBuffer(t) ? t : o.from(t, s), b = y.length;
1082
+ if (b === 0)
1083
1083
  throw new TypeError('The value "' + t + '" is invalid for argument "value"');
1084
1084
  for (m = 0; m < n - r; ++m)
1085
- this[m + r] = y[m % E];
1085
+ this[m + r] = y[m % b];
1086
1086
  }
1087
1087
  return this;
1088
1088
  };
1089
- var gr = /[^+/0-9A-Za-z-_]/g;
1090
- function wr(e) {
1091
- if (e = e.split("=")[0], e = e.trim().replace(gr, ""), e.length < 2)
1089
+ var wr = /[^+/0-9A-Za-z-_]/g;
1090
+ function yr(e) {
1091
+ if (e = e.split("=")[0], e = e.trim().replace(wr, ""), e.length < 2)
1092
1092
  return "";
1093
1093
  for (; e.length % 4 !== 0; )
1094
1094
  e = e + "=";
@@ -1149,20 +1149,20 @@ ct.write = function(i, a, p, c, u, f) {
1149
1149
  }
1150
1150
  return h;
1151
1151
  }
1152
- function yr(e) {
1152
+ function vr(e) {
1153
1153
  for (var t = [], r = 0; r < e.length; ++r)
1154
1154
  t.push(e.charCodeAt(r) & 255);
1155
1155
  return t;
1156
1156
  }
1157
- function vr(e, t) {
1157
+ function Er(e, t) {
1158
1158
  for (var r, n, s, h = [], m = 0; m < e.length && !((t -= 2) < 0); ++m)
1159
1159
  r = e.charCodeAt(m), n = r >> 8, s = r % 256, h.push(s), h.push(n);
1160
1160
  return h;
1161
1161
  }
1162
1162
  function vt(e) {
1163
- return a.toByteArray(wr(e));
1163
+ return a.toByteArray(yr(e));
1164
1164
  }
1165
- function $(e, t, r, n) {
1165
+ function P(e, t, r, n) {
1166
1166
  for (var s = 0; s < n && !(s + r >= t.length || s >= e.length); ++s)
1167
1167
  t[s + r] = e[s];
1168
1168
  return s;
@@ -1173,16 +1173,16 @@ ct.write = function(i, a, p, c, u, f) {
1173
1173
  function tt(e) {
1174
1174
  return e !== e;
1175
1175
  }
1176
- var Er = function() {
1176
+ var br = function() {
1177
1177
  for (var e = "0123456789abcdef", t = new Array(256), r = 0; r < 16; ++r)
1178
1178
  for (var n = r * 16, s = 0; s < 16; ++s)
1179
1179
  t[n + s] = e[r] + e[s];
1180
1180
  return t;
1181
1181
  }();
1182
- })(Jt);
1182
+ })(Pt);
1183
1183
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
1184
1184
  (function(i, a) {
1185
- var p = Jt, c = p.Buffer;
1185
+ var p = Pt, c = p.Buffer;
1186
1186
  function u(l, o) {
1187
1187
  for (var x in l)
1188
1188
  o[x] = l[x];
@@ -1211,10 +1211,10 @@ ct.write = function(i, a, p, c, u, f) {
1211
1211
  };
1212
1212
  })(it, it.exports);
1213
1213
  var Wt = it.exports, Ht = Wt.Buffer;
1214
- function K(i, a) {
1214
+ function X(i, a) {
1215
1215
  this._block = Ht.alloc(i), this._finalSize = a, this._blockSize = i, this._len = 0;
1216
1216
  }
1217
- K.prototype.update = function(i, a) {
1217
+ X.prototype.update = function(i, a) {
1218
1218
  typeof i == "string" && (a = a || "utf8", i = Ht.from(i, a));
1219
1219
  for (var p = this._block, c = this._blockSize, u = i.length, f = this._len, l = 0; l < u; ) {
1220
1220
  for (var o = f % c, x = Math.min(u - l, c - o), g = 0; g < x; g++)
@@ -1223,7 +1223,7 @@ K.prototype.update = function(i, a) {
1223
1223
  }
1224
1224
  return this._len += u, this;
1225
1225
  };
1226
- K.prototype.digest = function(i) {
1226
+ X.prototype.digest = function(i) {
1227
1227
  var a = this._len % this._blockSize;
1228
1228
  this._block[a] = 128, this._block.fill(0, a + 1), a >= this._finalSize && (this._update(this._block), this._block.fill(0));
1229
1229
  var p = this._len * 8;
@@ -1237,72 +1237,72 @@ K.prototype.digest = function(i) {
1237
1237
  var f = this._hash();
1238
1238
  return i ? f.toString(i) : f;
1239
1239
  };
1240
- K.prototype._update = function() {
1240
+ X.prototype._update = function() {
1241
1241
  throw new Error("_update must be implemented by subclass");
1242
1242
  };
1243
- var Vr = K, Qr = Jr, Zt = Vr, te = Wt.Buffer, re = [
1243
+ var Qr = X, te = Jr, Zt = Qr, re = Wt.Buffer, ee = [
1244
1244
  1518500249,
1245
1245
  1859775393,
1246
1246
  -1894007588,
1247
1247
  -899497514
1248
- ], ee = new Array(80);
1249
- function z() {
1250
- this.init(), this._w = ee, Zt.call(this, 64, 56);
1248
+ ], ie = new Array(80);
1249
+ function $() {
1250
+ this.init(), this._w = ie, Zt.call(this, 64, 56);
1251
1251
  }
1252
- Qr(z, Zt);
1253
- z.prototype.init = function() {
1252
+ te($, Zt);
1253
+ $.prototype.init = function() {
1254
1254
  return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
1255
1255
  };
1256
- function ie(i) {
1256
+ function ne(i) {
1257
1257
  return i << 1 | i >>> 31;
1258
1258
  }
1259
- function ne(i) {
1259
+ function ae(i) {
1260
1260
  return i << 5 | i >>> 27;
1261
1261
  }
1262
- function ae(i) {
1262
+ function oe(i) {
1263
1263
  return i << 30 | i >>> 2;
1264
1264
  }
1265
- function oe(i, a, p, c) {
1265
+ function pe(i, a, p, c) {
1266
1266
  return i === 0 ? a & p | ~a & c : i === 2 ? a & p | a & c | p & c : a ^ p ^ c;
1267
1267
  }
1268
- z.prototype._update = function(i) {
1268
+ $.prototype._update = function(i) {
1269
1269
  for (var a = this._w, p = this._a | 0, c = this._b | 0, u = this._c | 0, f = this._d | 0, l = this._e | 0, o = 0; o < 16; ++o)
1270
1270
  a[o] = i.readInt32BE(o * 4);
1271
1271
  for (; o < 80; ++o)
1272
- a[o] = ie(a[o - 3] ^ a[o - 8] ^ a[o - 14] ^ a[o - 16]);
1272
+ a[o] = ne(a[o - 3] ^ a[o - 8] ^ a[o - 14] ^ a[o - 16]);
1273
1273
  for (var x = 0; x < 80; ++x) {
1274
- var g = ~~(x / 20), v = ne(p) + oe(g, c, u, f) + l + a[x] + re[g] | 0;
1275
- l = f, f = u, u = ae(c), c = p, p = v;
1274
+ var g = ~~(x / 20), w = ae(p) + pe(g, c, u, f) + l + a[x] + ee[g] | 0;
1275
+ l = f, f = u, u = oe(c), c = p, p = w;
1276
1276
  }
1277
1277
  this._a = p + this._a | 0, this._b = c + this._b | 0, this._c = u + this._c | 0, this._d = f + this._d | 0, this._e = l + this._e | 0;
1278
1278
  };
1279
- z.prototype._hash = function() {
1280
- var i = te.allocUnsafe(20);
1279
+ $.prototype._hash = function() {
1280
+ var i = re.allocUnsafe(20);
1281
1281
  return i.writeInt32BE(this._a | 0, 0), i.writeInt32BE(this._b | 0, 4), i.writeInt32BE(this._c | 0, 8), i.writeInt32BE(this._d | 0, 12), i.writeInt32BE(this._e | 0, 16), i;
1282
1282
  };
1283
- var pe = z;
1284
- const se = /* @__PURE__ */ $t(pe), lt = new Error("File system not available.");
1285
- function ce(i, a, p) {
1283
+ var se = $;
1284
+ const ce = /* @__PURE__ */ $t(se), lt = new Error("File system not available.");
1285
+ function le(i, a, p) {
1286
1286
  throw lt;
1287
1287
  }
1288
1288
  function Yt(i) {
1289
1289
  throw lt;
1290
1290
  }
1291
- function le(i) {
1291
+ function ue(i) {
1292
1292
  throw lt;
1293
1293
  }
1294
- const ue = async (i) => Yt();
1295
- function fe(i) {
1294
+ const fe = async (i) => Yt();
1295
+ function he(i) {
1296
1296
  let a = "";
1297
1297
  for (let p = 0; p < i.length; p += 2)
1298
1298
  a += String.fromCharCode(parseInt(i.substr(p, 2), 16));
1299
1299
  return btoa(a);
1300
1300
  }
1301
- const X = (i, a = "sha1") => {
1301
+ const G = (i, a = "sha1") => {
1302
1302
  if (a !== "sha1")
1303
1303
  throw new Error("Only sha1 algorithm is available.");
1304
- const p = new se();
1305
- return fe(p.update(i).digest("hex"));
1304
+ const p = new ce();
1305
+ return he(p.update(i).digest("hex"));
1306
1306
  }, Kt = async (i) => {
1307
1307
  const a = new St(), { name: p, revision: c, documentType: u, created: f, lastModified: l } = i, o = {
1308
1308
  name: p,
@@ -1315,34 +1315,34 @@ const X = (i, a = "sha1") => {
1315
1315
  "state.json",
1316
1316
  JSON.stringify(i.initialState || {}, null, 2)
1317
1317
  ), a.file("operations.json", JSON.stringify(i.operations, null, 2)), Object.keys(i.attachments).forEach((g) => {
1318
- const { data: v, ...w } = i.attachments[g];
1319
- a.file(g, v, {
1318
+ const { data: w, ...v } = i.attachments[g];
1319
+ a.file(g, w, {
1320
1320
  base64: !0,
1321
1321
  createFolders: !0,
1322
- comment: JSON.stringify(w)
1322
+ comment: JSON.stringify(v)
1323
1323
  });
1324
1324
  }), a;
1325
- }, he = async (i, a, p, c) => {
1325
+ }, me = async (i, a, p, c) => {
1326
1326
  await (await Kt(i)).generateAsync({
1327
1327
  type: "uint8array",
1328
1328
  streamFiles: !0
1329
1329
  });
1330
1330
  const f = c ?? i.name, l = `.${p}.zip`;
1331
- return ce(
1331
+ return le(
1332
1332
  a,
1333
1333
  f.endsWith(l) ? f : `${f}${l}`
1334
1334
  );
1335
- }, ke = async (i, a) => {
1335
+ }, Oe = async (i, a) => {
1336
1336
  const c = await (await Kt(i)).generateAsync({ type: "blob" }), u = await a.createWritable();
1337
1337
  await u.write(c), await u.close();
1338
1338
  }, Ft = async (i, a) => {
1339
1339
  const p = Yt();
1340
- return me(p, a);
1341
- }, me = async (i, a) => {
1340
+ return xe(p, a);
1341
+ }, xe = async (i, a) => {
1342
1342
  const p = new St();
1343
- return await p.loadAsync(i), xe(p, a);
1343
+ return await p.loadAsync(i), de(p, a);
1344
1344
  };
1345
- async function xe(i, a) {
1345
+ async function de(i, a) {
1346
1346
  const p = i.file("state.json");
1347
1347
  if (!p)
1348
1348
  throw new Error("Initial state not found");
@@ -1371,96 +1371,100 @@ function Xt(i) {
1371
1371
  const a = i.replace(/^.*\./, "") || void 0, p = i.replace(/^.*[/\\]/, "") || void 0;
1372
1372
  return { extension: a, fileName: p };
1373
1373
  }
1374
- async function Te(i) {
1375
- const { buffer: a, mimeType: p = "application/octet-stream" } = await le(), c = Xt(i), u = a.toString("base64");
1374
+ async function De(i) {
1375
+ const { buffer: a, mimeType: p = "application/octet-stream" } = await ue(), c = Xt(i), u = a.toString("base64");
1376
1376
  return {
1377
1377
  data: u,
1378
- hash: X(u),
1378
+ hash: G(u),
1379
1379
  mimeType: p,
1380
1380
  ...c
1381
1381
  };
1382
1382
  }
1383
- async function De(i) {
1384
- const a = await ue(), p = $r.getType(i) || "application/octet-stream", c = Xt(i), u = a.toString("base64");
1385
- return { data: u, hash: X(u), mimeType: p, ...c };
1383
+ async function Ne(i) {
1384
+ const a = await fe(), p = Pr.getType(i) || "application/octet-stream", c = Xt(i), u = a.toString("base64");
1385
+ return { data: u, hash: G(u), mimeType: p, ...c };
1386
1386
  }
1387
- function de(i, a) {
1387
+ function ge(i, a) {
1388
1388
  const p = i.revision[a.scope];
1389
- return [R, C, L].includes(a.type) ? p : p + 1;
1389
+ return [L, z, q].includes(a.type) ? p : p + 1;
1390
1390
  }
1391
- function ge(i, a) {
1391
+ function we(i, a) {
1392
1392
  return {
1393
1393
  ...i,
1394
1394
  revision: {
1395
1395
  ...i.revision,
1396
- [a.scope]: de(i, a)
1396
+ [a.scope]: ge(i, a)
1397
1397
  },
1398
1398
  lastModified: (/* @__PURE__ */ new Date()).toISOString()
1399
1399
  };
1400
1400
  }
1401
- function we(i, a) {
1402
- if ([R, C, L].includes(a.type))
1401
+ function ye(i, a, p = 0) {
1402
+ if ([L, z, q].includes(a.type))
1403
1403
  return i;
1404
- const { scope: p } = a, c = i.operations[p].slice(
1404
+ const { scope: c } = a, u = i.operations[c].slice(
1405
1405
  0,
1406
- i.revision[p]
1406
+ i.revision[c]
1407
1407
  );
1408
- return c.push({
1408
+ return u.push({
1409
1409
  ...a,
1410
- index: c.length,
1410
+ index: u.length,
1411
1411
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1412
1412
  hash: "",
1413
- scope: p
1413
+ scope: c,
1414
+ skip: p
1414
1415
  }), {
1415
1416
  ...i,
1416
- operations: { ...i.operations, [p]: c }
1417
+ operations: { ...i.operations, [c]: u }
1417
1418
  };
1418
1419
  }
1419
- function ye(i, a) {
1420
- let p = we(i, a);
1421
- return p = ge(p, a), p;
1420
+ function ve(i, a, p = 0) {
1421
+ let c = ye(i, a, p);
1422
+ return c = we(c, a), c;
1422
1423
  }
1423
- function ve(i, a, p) {
1424
- switch (Dt().parse(a), a.type) {
1424
+ function Ee(i, a, p) {
1425
+ switch (Ot().parse(a), a.type) {
1425
1426
  case zt:
1426
1427
  return Dr(i, a.input);
1427
- case R:
1428
- return Or(i, a, p);
1429
- case C:
1430
- return Nr(i, a, p);
1431
1428
  case L:
1429
+ return Nr(i, a, p);
1430
+ case z:
1432
1431
  return Mr(i, a, p);
1432
+ case q:
1433
+ return Rr(i, a, p);
1433
1434
  case qt:
1434
- return Rr(i, a.input.state);
1435
+ return Cr(i, a.input.state);
1435
1436
  default:
1436
1437
  return i;
1437
1438
  }
1438
1439
  }
1439
- function Gt(i, a, p, c) {
1440
- let u = i;
1441
- return At(a) && (u = ve(u, a, p)), u = ye(u, a), u = _t(u, (f) => {
1442
- const l = p(f.state, a, c);
1443
- if (l)
1444
- return Ar({
1445
- ...u,
1446
- state: l
1440
+ function Gt(i, a, p, c, u = {}) {
1441
+ const {
1442
+ skip: f = 0
1443
+ } = u;
1444
+ let l = i;
1445
+ return At(a) && (l = Ee(l, a, p)), l = ve(l, a, f), l = _t(l, (o) => {
1446
+ const x = p(o.state, a, c);
1447
+ if (x)
1448
+ return Sr({
1449
+ ...l,
1450
+ state: x
1447
1451
  });
1448
- }), _t(u, (f) => {
1449
- if ([R, C, L].includes(a.type))
1450
- return f;
1451
- const l = a.scope || "global";
1452
- f.operations[l][f.operations[l].length - 1].hash = Vt(f, l), !At(a) && a.attachments && a.attachments.forEach((o) => {
1453
- const { hash: x, ...g } = o;
1454
- f.attachments[x] = {
1455
- ...g
1452
+ }), _t(l, (o) => {
1453
+ if ([L, z, q].includes(a.type))
1454
+ return o;
1455
+ const x = a.scope || "global";
1456
+ o.operations[x][o.operations[x].length - 1].hash = Vt(o, x), !At(a) && a.attachments && a.attachments.forEach((g) => {
1457
+ const { hash: w, ...v } = g;
1458
+ o.attachments[w] = {
1459
+ ...v
1456
1460
  };
1457
1461
  });
1458
1462
  });
1459
1463
  }
1460
1464
  function At(i) {
1461
- return [zt, R, C, L, qt].includes(i.type);
1465
+ return [zt, L, z, q, qt].includes(i.type);
1462
1466
  }
1463
- function q(i, a, p, c, u = "global") {
1467
+ function R(i, a, p, c, u = "global") {
1464
1468
  if (!i)
1465
1469
  throw new Error("Empty action type");
1466
1470
  if (typeof i != "string")
@@ -1474,10 +1478,10 @@ function q(i, a, p, c, u = "global") {
1474
1478
  }
1475
1479
  return f;
1476
1480
  }
1477
- function Ee(i, a = Gt) {
1478
- return (p, c, u) => a(p, c, i, u);
1481
+ function be(i, a = Gt) {
1482
+ return (p, c, u, f) => a(p, c, i, u, f);
1479
1483
  }
1480
- const be = (i, a) => ({
1484
+ const _e = (i, a) => ({
1481
1485
  name: "",
1482
1486
  documentType: "",
1483
1487
  revision: {
@@ -1489,8 +1493,8 @@ const be = (i, a) => ({
1489
1493
  attachments: {},
1490
1494
  ...i,
1491
1495
  state: (a == null ? void 0 : a(i == null ? void 0 : i.state)) ?? (i == null ? void 0 : i.state) ?? { global: {}, local: {} }
1492
- }), _e = (i, a) => {
1493
- const p = be(
1496
+ }), Fe = (i, a) => {
1497
+ const p = _e(
1494
1498
  i,
1495
1499
  a
1496
1500
  );
@@ -1499,20 +1503,44 @@ const be = (i, a) => ({
1499
1503
  initialState: p,
1500
1504
  operations: { global: [], local: [] }
1501
1505
  };
1502
- }, Vt = (i, a = "global") => X(Fr(i.state[a])), Oe = (i, a = 1e3) => {
1506
+ }, Vt = (i, a = "global") => G(Ar(i.state[a])), Me = (i, a = 1e3) => {
1503
1507
  const p = Math.random() * a;
1504
- return X(`${(i ?? /* @__PURE__ */ new Date()).toISOString()}${p}`);
1508
+ return G(`${(i ?? /* @__PURE__ */ new Date()).toISOString()}${p}`);
1505
1509
  };
1506
- function W(i) {
1507
- return Sr(Br(i, !0));
1510
+ function H(i) {
1511
+ return Br(jr(i, !0));
1512
+ }
1513
+ function Ae(i) {
1514
+ const a = [...i];
1515
+ let p = 0, c = a.length > 0 ? a[a.length - 1].index : 0;
1516
+ const u = [];
1517
+ for (const f of a.reverse()) {
1518
+ if (p > 0) {
1519
+ const o = c - f.index;
1520
+ p -= o;
1521
+ }
1522
+ if (p < 0)
1523
+ throw new Error("Invalid operation index, missing operations");
1524
+ const l = {
1525
+ ignore: p > 0,
1526
+ operation: f
1527
+ };
1528
+ f.skip > 0 && (p = p + (f.skip + 1)), c = f.index, u.push(l);
1529
+ }
1530
+ return u.reverse();
1508
1531
  }
1509
- function Fe(i) {
1532
+ function Re(i) {
1510
1533
  return Object.values(i).flatMap((a) => a).sort(
1511
1534
  (a, p) => new Date(a.timestamp).getTime() - new Date(p.timestamp).getTime()
1512
1535
  );
1513
1536
  }
1514
- function H(i, a, p, c, u, f = Gt) {
1515
- const l = Ee(p, f);
1537
+ function Se(i) {
1538
+ return Object.values(i).flatMap((a) => a).sort(
1539
+ (a, p) => new Date(a.operation.timestamp).getTime() - new Date(p.operation.timestamp).getTime()
1540
+ );
1541
+ }
1542
+ function Z(i, a, p, c, u, f = Gt) {
1543
+ const l = be(p, f);
1516
1544
  return Qt(
1517
1545
  i,
1518
1546
  a,
@@ -1522,84 +1550,103 @@ function H(i, a, p, c, u, f = Gt) {
1522
1550
  );
1523
1551
  }
1524
1552
  function Qt(i, a, p, c, u) {
1525
- const f = _e(i), l = Object.keys(a).reduce((g, v) => {
1526
- const w = v;
1553
+ const f = Fe(i), l = Object.keys(a).reduce((w, v) => {
1554
+ const E = v;
1555
+ return {
1556
+ ...w,
1557
+ [E]: a[E].slice(0, u == null ? void 0 : u.revision[E])
1558
+ };
1559
+ }, {}), o = Object.keys(l).reduce((w, v) => {
1560
+ const E = v;
1527
1561
  return {
1528
- ...g,
1529
- [w]: a[w].slice(0, u == null ? void 0 : u.revision[w])
1562
+ ...w,
1563
+ [E]: Ae(l[E])
1530
1564
  };
1531
- }, {}), o = Fe(l).reduce(
1532
- (g, v) => p(g, v, c),
1565
+ }, {}), x = Se(o).reduce(
1566
+ (w, { ignore: v, operation: E }) => v ? p(
1567
+ w,
1568
+ nr(E.scope),
1569
+ c,
1570
+ { skip: E.skip }
1571
+ ) : p(w, E, c),
1533
1572
  f
1534
- ), x = Object.keys(
1535
- o.operations
1573
+ ), g = Object.keys(
1574
+ x.operations
1536
1575
  ).reduce(
1537
- (g, v) => {
1538
- const w = v, j = u && u.revision[w] < a[w].length ? a[w].slice(u.revision[w]) : [];
1576
+ (w, v) => {
1577
+ const E = v, A = u && u.revision[E] < a[E].length ? a[E].slice(u.revision[E]) : [];
1539
1578
  return {
1540
- ...g,
1541
- [w]: [
1542
- ...o.operations[w].map((F, D) => {
1543
- var U;
1579
+ ...w,
1580
+ [E]: [
1581
+ ...x.operations[E].map((U, O) => {
1582
+ var N;
1544
1583
  return {
1545
- ...F,
1546
- timestamp: ((U = a[w][D]) == null ? void 0 : U.timestamp) ?? F.timestamp
1584
+ ...U,
1585
+ timestamp: ((N = a[E][O]) == null ? void 0 : N.timestamp) ?? U.timestamp
1547
1586
  };
1548
1587
  }),
1549
- ...j
1588
+ ...A
1550
1589
  ]
1551
1590
  };
1552
1591
  },
1553
1592
  { global: [], local: [] }
1554
1593
  );
1555
- return { ...o, operations: x };
1594
+ return { ...x, operations: g };
1556
1595
  }
1557
- const tr = (i) => q(
1596
+ const tr = (i) => R(
1558
1597
  "SET_NAME",
1559
1598
  i,
1560
1599
  void 0,
1561
- pt
1562
- ), rr = (i = 1, a = "global") => q(
1600
+ pt,
1601
+ void 0
1602
+ ), rr = (i = 1, a = "global") => R(
1563
1603
  "UNDO",
1564
1604
  i,
1565
1605
  void 0,
1566
1606
  st,
1567
1607
  a
1568
- ), er = (i = 1, a = "global") => q(
1608
+ ), er = (i = 1, a = "global") => R(
1569
1609
  "REDO",
1570
1610
  i,
1571
1611
  void 0,
1572
1612
  ot,
1573
1613
  a
1574
- ), ir = (i, a, p = "global") => q(
1614
+ ), ir = (i, a, p = "global") => R(
1575
1615
  "PRUNE",
1576
1616
  { start: i, end: a },
1577
1617
  void 0,
1578
1618
  at,
1579
1619
  p
1580
- ), ut = (i, a) => q(
1620
+ ), ut = (i, a) => R(
1581
1621
  "LOAD_STATE",
1582
1622
  { state: i, operations: a },
1583
1623
  void 0,
1584
1624
  nt
1585
- ), Ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1625
+ ), nr = (i = "global") => R(
1626
+ "NOOP",
1627
+ {},
1628
+ void 0,
1629
+ void 0,
1630
+ i
1631
+ ), Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1586
1632
  __proto__: null,
1587
1633
  loadState: ut,
1634
+ noop: nr,
1588
1635
  prune: ir,
1589
1636
  redo: er,
1590
1637
  setName: tr,
1591
1638
  undo: rr
1592
1639
  }, Symbol.toStringTag, { value: "Module" }));
1593
- class Me {
1640
+ class Le {
1594
1641
  /**
1595
1642
  * Constructs a BaseDocument instance with an initial state.
1596
1643
  * @param reducer - The reducer function that updates the state.
1597
1644
  * @param document - The initial state of the document.
1598
1645
  */
1599
1646
  constructor(a, p, c) {
1600
- P(this, "_document");
1601
- P(this, "_reducer");
1602
- P(this, "_signalDispatch");
1647
+ W(this, "_document");
1648
+ W(this, "_reducer");
1649
+ W(this, "_signalDispatch");
1603
1650
  this._reducer = a, this._document = p, this._signalDispatch = c;
1604
1651
  }
1605
1652
  /**
@@ -1607,11 +1654,12 @@ class Me {
1607
1654
  * @param action - The action to dispatch.
1608
1655
  * @returns The Document instance.
1609
1656
  */
1610
- dispatch(a) {
1657
+ dispatch(a, p) {
1611
1658
  return this._document = this._reducer(
1612
1659
  this._document,
1613
1660
  a,
1614
- this._signalDispatch
1661
+ this._signalDispatch,
1662
+ p
1615
1663
  ), this;
1616
1664
  }
1617
1665
  /**
@@ -1621,7 +1669,7 @@ class Me {
1621
1669
  * @returns The file path where the state was saved.
1622
1670
  */
1623
1671
  saveToFile(a, p, c) {
1624
- return he(this._document, a, p, c);
1672
+ return me(this._document, a, p, c);
1625
1673
  }
1626
1674
  /**
1627
1675
  * Loads the state of the document from a file.
@@ -1643,13 +1691,13 @@ class Me {
1643
1691
  * Gets the current state of the document.
1644
1692
  */
1645
1693
  get state() {
1646
- return W(this._document.state);
1694
+ return H(this._document.state);
1647
1695
  }
1648
1696
  /**
1649
1697
  * Gets the list of operations performed on the document.
1650
1698
  */
1651
1699
  get operations() {
1652
- return W(this._document.operations);
1700
+ return H(this._document.operations);
1653
1701
  }
1654
1702
  /**
1655
1703
  * Gets the name of the document.
@@ -1688,13 +1736,13 @@ class Me {
1688
1736
  * Gets the initial state of the document.
1689
1737
  */
1690
1738
  get initialState() {
1691
- return W(this._document.initialState);
1739
+ return H(this._document.initialState);
1692
1740
  }
1693
1741
  /**
1694
1742
  * Returns the current document as an object
1695
1743
  */
1696
1744
  toDocument() {
1697
- return W(this._document);
1745
+ return H(this._document);
1698
1746
  }
1699
1747
  /**
1700
1748
  * Gets the attachment associated with the given key.
@@ -1741,7 +1789,7 @@ class Me {
1741
1789
  return this.dispatch(ut(a, p)), this;
1742
1790
  }
1743
1791
  }
1744
- function Re(i, a) {
1792
+ function ze(i, a) {
1745
1793
  a.forEach((p) => {
1746
1794
  Object.getOwnPropertyNames(p.prototype).forEach((c) => {
1747
1795
  Object.defineProperty(
@@ -1755,27 +1803,29 @@ function Re(i, a) {
1755
1803
  });
1756
1804
  }
1757
1805
  export {
1758
- Me as B,
1759
- be as a,
1760
- _e as b,
1761
- Ee as c,
1762
- ke as d,
1763
- me as e,
1764
- q as f,
1765
- Re as g,
1766
- Ne as h,
1806
+ Le as B,
1807
+ _e as a,
1808
+ Fe as b,
1809
+ be as c,
1810
+ Oe as d,
1811
+ xe as e,
1812
+ R as f,
1813
+ ze as g,
1814
+ Ce as h,
1767
1815
  At as i,
1768
1816
  Kt as j,
1769
- De as k,
1817
+ Ne as k,
1770
1818
  Ft as l,
1771
- Te as m,
1819
+ De as m,
1772
1820
  Vt as n,
1773
- Oe as o,
1774
- Qt as p,
1775
- H as q,
1776
- W as r,
1777
- he as s,
1778
- Fe as t,
1779
- Gt as u,
1780
- Ue as z
1821
+ Me as o,
1822
+ Ae as p,
1823
+ Qt as q,
1824
+ H as r,
1825
+ me as s,
1826
+ Z as t,
1827
+ Se as u,
1828
+ Re as v,
1829
+ Gt as w,
1830
+ Te as z
1781
1831
  };