react-monaco-json-merge 1.1.17 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,22 +1,22 @@
1
- import { jsx as st, Fragment as On } from "react/jsx-runtime";
2
- import { useState as _e, useRef as le, useCallback as Ee, useEffect as Se } from "react";
3
- function Wt(e, t) {
1
+ import { jsx as ht, Fragment as In } from "react/jsx-runtime";
2
+ import { useState as Pe, useRef as ae, useCallback as Te, useEffect as Se } from "react";
3
+ function Zt(e, t) {
4
4
  (t == null || t > e.length) && (t = e.length);
5
5
  for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
6
6
  return n;
7
7
  }
8
- function wn(e) {
8
+ function Ln(e) {
9
9
  if (Array.isArray(e)) return e;
10
10
  }
11
- function An(e, t, r) {
12
- return (t = kn(t)) in e ? Object.defineProperty(e, t, {
11
+ function Sn(e, t, r) {
12
+ return (t = xn(t)) in e ? Object.defineProperty(e, t, {
13
13
  value: r,
14
14
  enumerable: !0,
15
15
  configurable: !0,
16
16
  writable: !0
17
17
  }) : e[t] = r, e;
18
18
  }
19
- function Nn(e, t) {
19
+ function kn(e, t) {
20
20
  var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
21
21
  if (r != null) {
22
22
  var n, o, i, s, c = [], a = !0, u = !1;
@@ -34,11 +34,11 @@ function Nn(e, t) {
34
34
  return c;
35
35
  }
36
36
  }
37
- function En() {
37
+ function _n() {
38
38
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
39
39
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
40
40
  }
41
- function qt(e, t) {
41
+ function Kt(e, t) {
42
42
  var r = Object.keys(e);
43
43
  if (Object.getOwnPropertySymbols) {
44
44
  var n = Object.getOwnPropertySymbols(e);
@@ -48,27 +48,27 @@ function qt(e, t) {
48
48
  }
49
49
  return r;
50
50
  }
51
- function Yt(e) {
51
+ function en(e) {
52
52
  for (var t = 1; t < arguments.length; t++) {
53
53
  var r = arguments[t] != null ? arguments[t] : {};
54
- t % 2 ? qt(Object(r), !0).forEach(function(n) {
55
- An(e, n, r[n]);
56
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : qt(Object(r)).forEach(function(n) {
54
+ t % 2 ? Kt(Object(r), !0).forEach(function(n) {
55
+ Sn(e, n, r[n]);
56
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Kt(Object(r)).forEach(function(n) {
57
57
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
58
58
  });
59
59
  }
60
60
  return e;
61
61
  }
62
- function Tn(e, t) {
62
+ function Pn(e, t) {
63
63
  if (e == null) return {};
64
- var r, n, o = In(e, t);
64
+ var r, n, o = jn(e, t);
65
65
  if (Object.getOwnPropertySymbols) {
66
66
  var i = Object.getOwnPropertySymbols(e);
67
67
  for (n = 0; n < i.length; n++) r = i[n], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
68
68
  }
69
69
  return o;
70
70
  }
71
- function In(e, t) {
71
+ function jn(e, t) {
72
72
  if (e == null) return {};
73
73
  var r = {};
74
74
  for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
@@ -77,10 +77,10 @@ function In(e, t) {
77
77
  }
78
78
  return r;
79
79
  }
80
- function Ln(e, t) {
81
- return wn(e) || Nn(e, t) || _n(e, t) || En();
80
+ function Rn(e, t) {
81
+ return Ln(e) || kn(e, t) || Mn(e, t) || _n();
82
82
  }
83
- function Sn(e, t) {
83
+ function Dn(e, t) {
84
84
  if (typeof e != "object" || !e) return e;
85
85
  var r = e[Symbol.toPrimitive];
86
86
  if (r !== void 0) {
@@ -90,18 +90,18 @@ function Sn(e, t) {
90
90
  }
91
91
  return (t === "string" ? String : Number)(e);
92
92
  }
93
- function kn(e) {
94
- var t = Sn(e, "string");
93
+ function xn(e) {
94
+ var t = Dn(e, "string");
95
95
  return typeof t == "symbol" ? t : t + "";
96
96
  }
97
- function _n(e, t) {
97
+ function Mn(e, t) {
98
98
  if (e) {
99
- if (typeof e == "string") return Wt(e, t);
99
+ if (typeof e == "string") return Zt(e, t);
100
100
  var r = {}.toString.call(e).slice(8, -1);
101
- return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Wt(e, t) : void 0;
101
+ return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Zt(e, t) : void 0;
102
102
  }
103
103
  }
104
- function Pn(e, t, r) {
104
+ function $n(e, t, r) {
105
105
  return t in e ? Object.defineProperty(e, t, {
106
106
  value: r,
107
107
  enumerable: !0,
@@ -109,7 +109,7 @@ function Pn(e, t, r) {
109
109
  writable: !0
110
110
  }) : e[t] = r, e;
111
111
  }
112
- function zt(e, t) {
112
+ function tn(e, t) {
113
113
  var r = Object.keys(e);
114
114
  if (Object.getOwnPropertySymbols) {
115
115
  var n = Object.getOwnPropertySymbols(e);
@@ -119,18 +119,18 @@ function zt(e, t) {
119
119
  }
120
120
  return r;
121
121
  }
122
- function Xt(e) {
122
+ function nn(e) {
123
123
  for (var t = 1; t < arguments.length; t++) {
124
124
  var r = arguments[t] != null ? arguments[t] : {};
125
- t % 2 ? zt(Object(r), !0).forEach(function(n) {
126
- Pn(e, n, r[n]);
127
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : zt(Object(r)).forEach(function(n) {
125
+ t % 2 ? tn(Object(r), !0).forEach(function(n) {
126
+ $n(e, n, r[n]);
127
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : tn(Object(r)).forEach(function(n) {
128
128
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
129
129
  });
130
130
  }
131
131
  return e;
132
132
  }
133
- function Rn() {
133
+ function Bn() {
134
134
  for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
135
135
  t[r] = arguments[r];
136
136
  return function(n) {
@@ -139,7 +139,7 @@ function Rn() {
139
139
  }, n);
140
140
  };
141
141
  }
142
- function Ce(e) {
142
+ function ot(e) {
143
143
  return function t() {
144
144
  for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
145
145
  o[i] = arguments[i];
@@ -150,38 +150,38 @@ function Ce(e) {
150
150
  };
151
151
  };
152
152
  }
153
- function lt(e) {
153
+ function yt(e) {
154
154
  return {}.toString.call(e).includes("Object");
155
155
  }
156
- function jn(e) {
156
+ function Fn(e) {
157
157
  return !Object.keys(e).length;
158
158
  }
159
- function Ke(e) {
159
+ function it(e) {
160
160
  return typeof e == "function";
161
161
  }
162
- function Dn(e, t) {
162
+ function Un(e, t) {
163
163
  return Object.prototype.hasOwnProperty.call(e, t);
164
164
  }
165
- function Mn(e, t) {
166
- return lt(t) || Re("changeType"), Object.keys(t).some(function(r) {
167
- return !Dn(e, r);
168
- }) && Re("changeField"), t;
165
+ function Vn(e, t) {
166
+ return yt(t) || xe("changeType"), Object.keys(t).some(function(r) {
167
+ return !Un(e, r);
168
+ }) && xe("changeField"), t;
169
169
  }
170
- function xn(e) {
171
- Ke(e) || Re("selectorType");
170
+ function Jn(e) {
171
+ it(e) || xe("selectorType");
172
172
  }
173
- function $n(e) {
174
- Ke(e) || lt(e) || Re("handlerType"), lt(e) && Object.values(e).some(function(t) {
175
- return !Ke(t);
176
- }) && Re("handlersType");
173
+ function Hn(e) {
174
+ it(e) || yt(e) || xe("handlerType"), yt(e) && Object.values(e).some(function(t) {
175
+ return !it(t);
176
+ }) && xe("handlersType");
177
177
  }
178
- function Bn(e) {
179
- e || Re("initialIsRequired"), lt(e) || Re("initialType"), jn(e) && Re("initialContent");
178
+ function Gn(e) {
179
+ e || xe("initialIsRequired"), yt(e) || xe("initialType"), Fn(e) && xe("initialContent");
180
180
  }
181
- function Fn(e, t) {
181
+ function Wn(e, t) {
182
182
  throw new Error(e[t] || e.default);
183
183
  }
184
- var Un = {
184
+ var qn = {
185
185
  initialIsRequired: "initial state is required",
186
186
  initialType: "initial state should be an object",
187
187
  initialContent: "initial state shouldn't be an empty object",
@@ -191,49 +191,49 @@ var Un = {
191
191
  changeType: "provided value of changes should be an object",
192
192
  changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
193
193
  default: "an unknown error accured in `state-local` package"
194
- }, Re = Ce(Fn)(Un), it = {
195
- changes: Mn,
196
- selector: xn,
197
- handler: $n,
198
- initial: Bn
194
+ }, xe = ot(Wn)(qn), dt = {
195
+ changes: Vn,
196
+ selector: Jn,
197
+ handler: Hn,
198
+ initial: Gn
199
199
  };
200
- function Vn(e) {
200
+ function Yn(e) {
201
201
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
202
- it.initial(e), it.handler(t);
202
+ dt.initial(e), dt.handler(t);
203
203
  var r = {
204
204
  current: e
205
- }, n = Ce(Gn)(r, t), o = Ce(Hn)(r), i = Ce(it.changes)(e), s = Ce(Jn)(r);
205
+ }, n = ot(Xn)(r, t), o = ot(Cn)(r), i = ot(dt.changes)(e), s = ot(zn)(r);
206
206
  function c() {
207
207
  var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(l) {
208
208
  return l;
209
209
  };
210
- return it.selector(u), u(r.current);
210
+ return dt.selector(u), u(r.current);
211
211
  }
212
212
  function a(u) {
213
- Rn(n, o, i, s)(u);
213
+ Bn(n, o, i, s)(u);
214
214
  }
215
215
  return [c, a];
216
216
  }
217
- function Jn(e, t) {
218
- return Ke(t) ? t(e.current) : t;
217
+ function zn(e, t) {
218
+ return it(t) ? t(e.current) : t;
219
219
  }
220
- function Hn(e, t) {
221
- return e.current = Xt(Xt({}, e.current), t), t;
220
+ function Cn(e, t) {
221
+ return e.current = nn(nn({}, e.current), t), t;
222
222
  }
223
- function Gn(e, t, r) {
224
- return Ke(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
223
+ function Xn(e, t, r) {
224
+ return it(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
225
225
  var o;
226
226
  return (o = t[n]) === null || o === void 0 ? void 0 : o.call(t, e.current[n]);
227
227
  }), r;
228
228
  }
229
- var Wn = {
230
- create: Vn
231
- }, qn = {
229
+ var Qn = {
230
+ create: Yn
231
+ }, Zn = {
232
232
  paths: {
233
233
  vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"
234
234
  }
235
235
  };
236
- function Yn(e) {
236
+ function Kn(e) {
237
237
  return function t() {
238
238
  for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
239
239
  o[i] = arguments[i];
@@ -244,23 +244,23 @@ function Yn(e) {
244
244
  };
245
245
  };
246
246
  }
247
- function zn(e) {
247
+ function er(e) {
248
248
  return {}.toString.call(e).includes("Object");
249
249
  }
250
- function Xn(e) {
251
- return e || Qt("configIsRequired"), zn(e) || Qt("configType"), e.urls ? (Qn(), {
250
+ function tr(e) {
251
+ return e || rn("configIsRequired"), er(e) || rn("configType"), e.urls ? (nr(), {
252
252
  paths: {
253
253
  vs: e.urls.monacoBase
254
254
  }
255
255
  }) : e;
256
256
  }
257
- function Qn() {
258
- console.warn(on.deprecation);
257
+ function nr() {
258
+ console.warn(pn.deprecation);
259
259
  }
260
- function Zn(e, t) {
260
+ function rr(e, t) {
261
261
  throw new Error(e[t] || e.default);
262
262
  }
263
- var on = {
263
+ var pn = {
264
264
  configIsRequired: "the configuration object is required",
265
265
  configType: "the configuration object should be an object",
266
266
  default: "an unknown error accured in `@monaco-editor/loader` package",
@@ -274,9 +274,9 @@ var on = {
274
274
 
275
275
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
276
276
  `
277
- }, Qt = Yn(Zn)(on), Cn = {
278
- config: Xn
279
- }, Kn = function() {
277
+ }, rn = Kn(rr)(pn), or = {
278
+ config: tr
279
+ }, ir = function() {
280
280
  for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
281
281
  r[n] = arguments[n];
282
282
  return function(o) {
@@ -285,43 +285,43 @@ var on = {
285
285
  }, o);
286
286
  };
287
287
  };
288
- function sn(e, t) {
288
+ function dn(e, t) {
289
289
  return Object.keys(t).forEach(function(r) {
290
- t[r] instanceof Object && e[r] && Object.assign(t[r], sn(e[r], t[r]));
291
- }), Yt(Yt({}, e), t);
290
+ t[r] instanceof Object && e[r] && Object.assign(t[r], dn(e[r], t[r]));
291
+ }), en(en({}, e), t);
292
292
  }
293
- var er = {
293
+ var sr = {
294
294
  type: "cancelation",
295
295
  msg: "operation is manually canceled"
296
296
  };
297
- function vt(e) {
297
+ function It(e) {
298
298
  var t = !1, r = new Promise(function(n, o) {
299
299
  e.then(function(i) {
300
- return t ? o(er) : n(i);
300
+ return t ? o(sr) : n(i);
301
301
  }), e.catch(o);
302
302
  });
303
303
  return r.cancel = function() {
304
304
  return t = !0;
305
305
  }, r;
306
306
  }
307
- var tr = ["monaco"], nr = Wn.create({
308
- config: qn,
307
+ var cr = ["monaco"], ar = Qn.create({
308
+ config: Zn,
309
309
  isInitialized: !1,
310
310
  resolve: null,
311
311
  reject: null,
312
312
  monaco: null
313
- }), cn = Ln(nr, 2), tt = cn[0], dt = cn[1];
314
- function rr(e) {
315
- var t = Cn.config(e), r = t.monaco, n = Tn(t, tr);
316
- dt(function(o) {
313
+ }), hn = Rn(ar, 2), ct = hn[0], Ot = hn[1];
314
+ function lr(e) {
315
+ var t = or.config(e), r = t.monaco, n = Pn(t, cr);
316
+ Ot(function(o) {
317
317
  return {
318
- config: sn(o.config, n),
318
+ config: dn(o.config, n),
319
319
  monaco: r
320
320
  };
321
321
  });
322
322
  }
323
- function or() {
324
- var e = tt(function(t) {
323
+ function ur() {
324
+ var e = ct(function(t) {
325
325
  var r = t.monaco, n = t.isInitialized, o = t.resolve;
326
326
  return {
327
327
  monaco: r,
@@ -330,37 +330,37 @@ function or() {
330
330
  };
331
331
  });
332
332
  if (!e.isInitialized) {
333
- if (dt({
333
+ if (Ot({
334
334
  isInitialized: !0
335
335
  }), e.monaco)
336
- return e.resolve(e.monaco), vt(bt);
336
+ return e.resolve(e.monaco), It(Lt);
337
337
  if (window.monaco && window.monaco.editor)
338
- return an(window.monaco), e.resolve(window.monaco), vt(bt);
339
- Kn(ir, cr)(ar);
338
+ return gn(window.monaco), e.resolve(window.monaco), It(Lt);
339
+ ir(fr, dr)(hr);
340
340
  }
341
- return vt(bt);
341
+ return It(Lt);
342
342
  }
343
- function ir(e) {
343
+ function fr(e) {
344
344
  return document.body.appendChild(e);
345
345
  }
346
- function sr(e) {
346
+ function pr(e) {
347
347
  var t = document.createElement("script");
348
348
  return e && (t.src = e), t;
349
349
  }
350
- function cr(e) {
351
- var t = tt(function(n) {
350
+ function dr(e) {
351
+ var t = ct(function(n) {
352
352
  var o = n.config, i = n.reject;
353
353
  return {
354
354
  config: o,
355
355
  reject: i
356
356
  };
357
- }), r = sr("".concat(t.config.paths.vs, "/loader.js"));
357
+ }), r = pr("".concat(t.config.paths.vs, "/loader.js"));
358
358
  return r.onload = function() {
359
359
  return e();
360
360
  }, r.onerror = t.reject, r;
361
361
  }
362
- function ar() {
363
- var e = tt(function(r) {
362
+ function hr() {
363
+ var e = ct(function(r) {
364
364
  var n = r.config, o = r.resolve, i = r.reject;
365
365
  return {
366
366
  config: n,
@@ -370,36 +370,36 @@ function ar() {
370
370
  }), t = window.require;
371
371
  t.config(e.config), t(["vs/editor/editor.main"], function(r) {
372
372
  var n = r.m;
373
- an(n), e.resolve(n);
373
+ gn(n), e.resolve(n);
374
374
  }, function(r) {
375
375
  e.reject(r);
376
376
  });
377
377
  }
378
- function an(e) {
379
- tt().monaco || dt({
378
+ function gn(e) {
379
+ ct().monaco || Ot({
380
380
  monaco: e
381
381
  });
382
382
  }
383
- function lr() {
384
- return tt(function(e) {
383
+ function gr() {
384
+ return ct(function(e) {
385
385
  var t = e.monaco;
386
386
  return t;
387
387
  });
388
388
  }
389
- var bt = new Promise(function(e, t) {
390
- return dt({
389
+ var Lt = new Promise(function(e, t) {
390
+ return Ot({
391
391
  resolve: e,
392
392
  reject: t
393
393
  });
394
- }), ur = {
395
- config: rr,
396
- init: or,
397
- __getMonacoInstance: lr
398
- }, te = /* @__PURE__ */ ((e) => (e[e.excluded = 0] = "excluded", e[e.first = 1] = "first", e[e.second = 2] = "second", e))(te || {}), D = /* @__PURE__ */ ((e) => (e.SAME_CHANGE = "same_change", e.INPUT1_ONLY = "input1_only", e.INPUT2_ONLY = "input2_only", e.TRUE_CONFLICT = "true_conflict", e))(D || {});
399
- function fr(e, t = !1) {
394
+ }), mr = {
395
+ config: lr,
396
+ init: ur,
397
+ __getMonacoInstance: gr
398
+ }, ne = /* @__PURE__ */ ((e) => (e[e.excluded = 0] = "excluded", e[e.first = 1] = "first", e[e.second = 2] = "second", e))(ne || {}), x = /* @__PURE__ */ ((e) => (e.SAME_CHANGE = "same_change", e.INPUT1_ONLY = "input1_only", e.INPUT2_ONLY = "input2_only", e.TRUE_CONFLICT = "true_conflict", e))(x || {});
399
+ function yr(e, t = !1) {
400
400
  const r = e.length;
401
401
  let n = 0, o = "", i = 0, s = 16, c = 0, a = 0, u = 0, l = 0, y = 0;
402
- function p(f, E) {
402
+ function p(f, I) {
403
403
  let S = 0, g = 0;
404
404
  for (; S < f; ) {
405
405
  let b = e.charCodeAt(n);
@@ -418,43 +418,43 @@ function fr(e, t = !1) {
418
418
  function d(f) {
419
419
  n = f, o = "", i = 0, s = 16, y = 0;
420
420
  }
421
- function L() {
421
+ function _() {
422
422
  let f = n;
423
423
  if (e.charCodeAt(n) === 48)
424
424
  n++;
425
425
  else
426
- for (n++; n < e.length && Je(e.charCodeAt(n)); )
426
+ for (n++; n < e.length && qe(e.charCodeAt(n)); )
427
427
  n++;
428
428
  if (n < e.length && e.charCodeAt(n) === 46)
429
- if (n++, n < e.length && Je(e.charCodeAt(n)))
430
- for (n++; n < e.length && Je(e.charCodeAt(n)); )
429
+ if (n++, n < e.length && qe(e.charCodeAt(n)))
430
+ for (n++; n < e.length && qe(e.charCodeAt(n)); )
431
431
  n++;
432
432
  else
433
433
  return y = 3, e.substring(f, n);
434
- let E = n;
434
+ let I = n;
435
435
  if (n < e.length && (e.charCodeAt(n) === 69 || e.charCodeAt(n) === 101))
436
- if (n++, (n < e.length && e.charCodeAt(n) === 43 || e.charCodeAt(n) === 45) && n++, n < e.length && Je(e.charCodeAt(n))) {
437
- for (n++; n < e.length && Je(e.charCodeAt(n)); )
436
+ if (n++, (n < e.length && e.charCodeAt(n) === 43 || e.charCodeAt(n) === 45) && n++, n < e.length && qe(e.charCodeAt(n))) {
437
+ for (n++; n < e.length && qe(e.charCodeAt(n)); )
438
438
  n++;
439
- E = n;
439
+ I = n;
440
440
  } else
441
441
  y = 3;
442
- return e.substring(f, E);
442
+ return e.substring(f, I);
443
443
  }
444
- function N() {
445
- let f = "", E = n;
444
+ function T() {
445
+ let f = "", I = n;
446
446
  for (; ; ) {
447
447
  if (n >= r) {
448
- f += e.substring(E, n), y = 2;
448
+ f += e.substring(I, n), y = 2;
449
449
  break;
450
450
  }
451
451
  const S = e.charCodeAt(n);
452
452
  if (S === 34) {
453
- f += e.substring(E, n), n++;
453
+ f += e.substring(I, n), n++;
454
454
  break;
455
455
  }
456
456
  if (S === 92) {
457
- if (f += e.substring(E, n), n++, n >= r) {
457
+ if (f += e.substring(I, n), n++, n >= r) {
458
458
  y = 2;
459
459
  break;
460
460
  }
@@ -491,12 +491,12 @@ function fr(e, t = !1) {
491
491
  default:
492
492
  y = 5;
493
493
  }
494
- E = n;
494
+ I = n;
495
495
  continue;
496
496
  }
497
497
  if (S >= 0 && S <= 31)
498
- if (Qe(S)) {
499
- f += e.substring(E, n), y = 2;
498
+ if (nt(S)) {
499
+ f += e.substring(I, n), y = 2;
500
500
  break;
501
501
  } else
502
502
  y = 6;
@@ -508,13 +508,13 @@ function fr(e, t = !1) {
508
508
  if (o = "", y = 0, i = n, a = c, l = u, n >= r)
509
509
  return i = r, s = 17;
510
510
  let f = e.charCodeAt(n);
511
- if (Ot(f)) {
511
+ if (St(f)) {
512
512
  do
513
513
  n++, o += String.fromCharCode(f), f = e.charCodeAt(n);
514
- while (Ot(f));
514
+ while (St(f));
515
515
  return s = 15;
516
516
  }
517
- if (Qe(f))
517
+ if (nt(f))
518
518
  return n++, o += String.fromCharCode(f), f === 13 && e.charCodeAt(n) === 10 && (n++, o += `
519
519
  `), c++, u = n, s = 14;
520
520
  switch (f) {
@@ -533,14 +533,14 @@ function fr(e, t = !1) {
533
533
  return n++, s = 5;
534
534
  // strings
535
535
  case 34:
536
- return n++, o = N(), s = 10;
536
+ return n++, o = T(), s = 10;
537
537
  // comments
538
538
  case 47:
539
- const E = n - 1;
539
+ const I = n - 1;
540
540
  if (e.charCodeAt(n + 1) === 47) {
541
- for (n += 2; n < r && !Qe(e.charCodeAt(n)); )
541
+ for (n += 2; n < r && !nt(e.charCodeAt(n)); )
542
542
  n++;
543
- return o = e.substring(E, n), s = 12;
543
+ return o = e.substring(I, n), s = 12;
544
544
  }
545
545
  if (e.charCodeAt(n + 1) === 42) {
546
546
  n += 2;
@@ -552,14 +552,14 @@ function fr(e, t = !1) {
552
552
  n += 2, g = !0;
553
553
  break;
554
554
  }
555
- n++, Qe(b) && (b === 13 && e.charCodeAt(n) === 10 && n++, c++, u = n);
555
+ n++, nt(b) && (b === 13 && e.charCodeAt(n) === 10 && n++, c++, u = n);
556
556
  }
557
- return g || (n++, y = 1), o = e.substring(E, n), s = 13;
557
+ return g || (n++, y = 1), o = e.substring(I, n), s = 13;
558
558
  }
559
559
  return o += String.fromCharCode(f), n++, s = 16;
560
560
  // numbers
561
561
  case 45:
562
- if (o += String.fromCharCode(f), n++, n === r || !Je(e.charCodeAt(n)))
562
+ if (o += String.fromCharCode(f), n++, n === r || !qe(e.charCodeAt(n)))
563
563
  return s = 16;
564
564
  // found a minus, followed by a number so
565
565
  // we fall through to proceed with scanning
@@ -574,7 +574,7 @@ function fr(e, t = !1) {
574
574
  case 55:
575
575
  case 56:
576
576
  case 57:
577
- return o += L(), s = 11;
577
+ return o += _(), s = 11;
578
578
  // literals and unknown symbols
579
579
  default:
580
580
  for (; n < r && h(f); )
@@ -594,7 +594,7 @@ function fr(e, t = !1) {
594
594
  }
595
595
  }
596
596
  function h(f) {
597
- if (Ot(f) || Qe(f))
597
+ if (St(f) || nt(f))
598
598
  return !1;
599
599
  switch (f) {
600
600
  case 125:
@@ -629,33 +629,33 @@ function fr(e, t = !1) {
629
629
  getTokenError: () => y
630
630
  };
631
631
  }
632
- function Ot(e) {
632
+ function St(e) {
633
633
  return e === 32 || e === 9;
634
634
  }
635
- function Qe(e) {
635
+ function nt(e) {
636
636
  return e === 10 || e === 13;
637
637
  }
638
- function Je(e) {
638
+ function qe(e) {
639
639
  return e >= 48 && e <= 57;
640
640
  }
641
- var Zt;
641
+ var on;
642
642
  (function(e) {
643
643
  e[e.lineFeed = 10] = "lineFeed", e[e.carriageReturn = 13] = "carriageReturn", e[e.space = 32] = "space", e[e._0 = 48] = "_0", e[e._1 = 49] = "_1", e[e._2 = 50] = "_2", e[e._3 = 51] = "_3", e[e._4 = 52] = "_4", e[e._5 = 53] = "_5", e[e._6 = 54] = "_6", e[e._7 = 55] = "_7", e[e._8 = 56] = "_8", e[e._9 = 57] = "_9", e[e.a = 97] = "a", e[e.b = 98] = "b", e[e.c = 99] = "c", e[e.d = 100] = "d", e[e.e = 101] = "e", e[e.f = 102] = "f", e[e.g = 103] = "g", e[e.h = 104] = "h", e[e.i = 105] = "i", e[e.j = 106] = "j", e[e.k = 107] = "k", e[e.l = 108] = "l", e[e.m = 109] = "m", e[e.n = 110] = "n", e[e.o = 111] = "o", e[e.p = 112] = "p", e[e.q = 113] = "q", e[e.r = 114] = "r", e[e.s = 115] = "s", e[e.t = 116] = "t", e[e.u = 117] = "u", e[e.v = 118] = "v", e[e.w = 119] = "w", e[e.x = 120] = "x", e[e.y = 121] = "y", e[e.z = 122] = "z", e[e.A = 65] = "A", e[e.B = 66] = "B", e[e.C = 67] = "C", e[e.D = 68] = "D", e[e.E = 69] = "E", e[e.F = 70] = "F", e[e.G = 71] = "G", e[e.H = 72] = "H", e[e.I = 73] = "I", e[e.J = 74] = "J", e[e.K = 75] = "K", e[e.L = 76] = "L", e[e.M = 77] = "M", e[e.N = 78] = "N", e[e.O = 79] = "O", e[e.P = 80] = "P", e[e.Q = 81] = "Q", e[e.R = 82] = "R", e[e.S = 83] = "S", e[e.T = 84] = "T", e[e.U = 85] = "U", e[e.V = 86] = "V", e[e.W = 87] = "W", e[e.X = 88] = "X", e[e.Y = 89] = "Y", e[e.Z = 90] = "Z", e[e.asterisk = 42] = "asterisk", e[e.backslash = 92] = "backslash", e[e.closeBrace = 125] = "closeBrace", e[e.closeBracket = 93] = "closeBracket", e[e.colon = 58] = "colon", e[e.comma = 44] = "comma", e[e.dot = 46] = "dot", e[e.doubleQuote = 34] = "doubleQuote", e[e.minus = 45] = "minus", e[e.openBrace = 123] = "openBrace", e[e.openBracket = 91] = "openBracket", e[e.plus = 43] = "plus", e[e.slash = 47] = "slash", e[e.formFeed = 12] = "formFeed", e[e.tab = 9] = "tab";
644
- })(Zt || (Zt = {}));
644
+ })(on || (on = {}));
645
645
  new Array(20).fill(0).map((e, t) => " ".repeat(t));
646
- const He = 200;
647
- new Array(He).fill(0).map((e, t) => `
648
- ` + " ".repeat(t)), new Array(He).fill(0).map((e, t) => "\r" + " ".repeat(t)), new Array(He).fill(0).map((e, t) => `\r
649
- ` + " ".repeat(t)), new Array(He).fill(0).map((e, t) => `
650
- ` + " ".repeat(t)), new Array(He).fill(0).map((e, t) => "\r" + " ".repeat(t)), new Array(He).fill(0).map((e, t) => `\r
646
+ const Ye = 200;
647
+ new Array(Ye).fill(0).map((e, t) => `
648
+ ` + " ".repeat(t)), new Array(Ye).fill(0).map((e, t) => "\r" + " ".repeat(t)), new Array(Ye).fill(0).map((e, t) => `\r
649
+ ` + " ".repeat(t)), new Array(Ye).fill(0).map((e, t) => `
650
+ ` + " ".repeat(t)), new Array(Ye).fill(0).map((e, t) => "\r" + " ".repeat(t)), new Array(Ye).fill(0).map((e, t) => `\r
651
651
  ` + " ".repeat(t));
652
- var ut;
652
+ var vt;
653
653
  (function(e) {
654
654
  e.DEFAULT = {
655
655
  allowTrailingComma: !1
656
656
  };
657
- })(ut || (ut = {}));
658
- function pr(e, t = [], r = ut.DEFAULT) {
657
+ })(vt || (vt = {}));
658
+ function vr(e, t = [], r = vt.DEFAULT) {
659
659
  let n = { type: "array", offset: -1, length: -1, children: [], parent: void 0 };
660
660
  function o(a) {
661
661
  n.type === "property" && (n.length = a - n.offset, n = n.parent);
@@ -663,7 +663,7 @@ function pr(e, t = [], r = ut.DEFAULT) {
663
663
  function i(a) {
664
664
  return n.children.push(a), a;
665
665
  }
666
- hr(e, {
666
+ wr(e, {
667
667
  onObjectBegin: (a) => {
668
668
  n = i({ type: "object", offset: a, length: -1, parent: n, children: [] });
669
669
  },
@@ -680,7 +680,7 @@ function pr(e, t = [], r = ut.DEFAULT) {
680
680
  n.length = a + u - n.offset, n = n.parent, o(a + u);
681
681
  },
682
682
  onLiteralValue: (a, u, l) => {
683
- i({ type: gr(a), offset: u, length: l, parent: n, value: a }), o(u + l);
683
+ i({ type: Or(a), offset: u, length: l, parent: n, value: a }), o(u + l);
684
684
  },
685
685
  onSeparator: (a, u, l) => {
686
686
  n.type === "property" && (a === ":" ? n.colonOffset = u : a === "," && o(u));
@@ -692,7 +692,7 @@ function pr(e, t = [], r = ut.DEFAULT) {
692
692
  const c = n.children[0];
693
693
  return c && delete c.parent, c;
694
694
  }
695
- function dr(e, t) {
695
+ function br(e, t) {
696
696
  if (!e)
697
697
  return;
698
698
  let r = e;
@@ -716,32 +716,32 @@ function dr(e, t) {
716
716
  }
717
717
  return r;
718
718
  }
719
- function hr(e, t, r = ut.DEFAULT) {
720
- const n = fr(e, !1), o = [];
719
+ function wr(e, t, r = vt.DEFAULT) {
720
+ const n = yr(e, !1), o = [];
721
721
  let i = 0;
722
- function s(A) {
723
- return A ? () => i === 0 && A(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
722
+ function s(E) {
723
+ return E ? () => i === 0 && E(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
724
724
  }
725
- function c(A) {
726
- return A ? (w) => i === 0 && A(w, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
725
+ function c(E) {
726
+ return E ? (A) => i === 0 && E(A, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
727
727
  }
728
- function a(A) {
729
- return A ? (w) => i === 0 && A(w, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => o.slice()) : () => !0;
728
+ function a(E) {
729
+ return E ? (A) => i === 0 && E(A, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => o.slice()) : () => !0;
730
730
  }
731
- function u(A) {
732
- return A ? () => {
733
- i > 0 ? i++ : A(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => o.slice()) === !1 && (i = 1);
731
+ function u(E) {
732
+ return E ? () => {
733
+ i > 0 ? i++ : E(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => o.slice()) === !1 && (i = 1);
734
734
  } : () => !0;
735
735
  }
736
- function l(A) {
737
- return A ? () => {
738
- i > 0 && i--, i === 0 && A(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter());
736
+ function l(E) {
737
+ return E ? () => {
738
+ i > 0 && i--, i === 0 && E(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter());
739
739
  } : () => !0;
740
740
  }
741
- const y = u(t.onObjectBegin), p = a(t.onObjectProperty), d = l(t.onObjectEnd), L = u(t.onArrayBegin), N = l(t.onArrayEnd), v = a(t.onLiteralValue), h = c(t.onSeparator), m = s(t.onComment), f = c(t.onError), E = r && r.disallowComments, S = r && r.allowTrailingComma;
741
+ const y = u(t.onObjectBegin), p = a(t.onObjectProperty), d = l(t.onObjectEnd), _ = u(t.onArrayBegin), T = l(t.onArrayEnd), v = a(t.onLiteralValue), h = c(t.onSeparator), m = s(t.onComment), f = c(t.onError), I = r && r.disallowComments, S = r && r.allowTrailingComma;
742
742
  function g() {
743
743
  for (; ; ) {
744
- const A = n.scan();
744
+ const E = n.scan();
745
745
  switch (n.getTokenError()) {
746
746
  case 4:
747
747
  b(
@@ -762,7 +762,7 @@ function hr(e, t, r = ut.DEFAULT) {
762
762
  );
763
763
  break;
764
764
  case 1:
765
- E || b(
765
+ I || b(
766
766
  11
767
767
  /* ParseErrorCode.UnexpectedEndOfComment */
768
768
  );
@@ -780,10 +780,10 @@ function hr(e, t, r = ut.DEFAULT) {
780
780
  );
781
781
  break;
782
782
  }
783
- switch (A) {
783
+ switch (E) {
784
784
  case 12:
785
785
  case 13:
786
- E ? b(
786
+ I ? b(
787
787
  10
788
788
  /* ParseErrorCode.InvalidCommentToken */
789
789
  ) : m();
@@ -798,15 +798,15 @@ function hr(e, t, r = ut.DEFAULT) {
798
798
  case 14:
799
799
  break;
800
800
  default:
801
- return A;
801
+ return E;
802
802
  }
803
803
  }
804
804
  }
805
- function b(A, w = [], R = []) {
806
- if (f(A), w.length + R.length > 0) {
805
+ function b(E, A = [], R = []) {
806
+ if (f(E), A.length + R.length > 0) {
807
807
  let X = n.getToken();
808
808
  for (; X !== 17; ) {
809
- if (w.indexOf(X) !== -1) {
809
+ if (A.indexOf(X) !== -1) {
810
810
  g();
811
811
  break;
812
812
  } else if (R.indexOf(X) !== -1)
@@ -815,19 +815,19 @@ function hr(e, t, r = ut.DEFAULT) {
815
815
  }
816
816
  }
817
817
  }
818
- function j(A) {
819
- const w = n.getTokenValue();
820
- return A ? v(w) : (p(w), o.push(w)), g(), !0;
818
+ function D(E) {
819
+ const A = n.getTokenValue();
820
+ return E ? v(A) : (p(A), o.push(A)), g(), !0;
821
821
  }
822
- function T() {
822
+ function L() {
823
823
  switch (n.getToken()) {
824
824
  case 11:
825
- const A = n.getTokenValue();
826
- let w = Number(A);
827
- isNaN(w) && (b(
825
+ const E = n.getTokenValue();
826
+ let A = Number(E);
827
+ isNaN(A) && (b(
828
828
  2
829
829
  /* ParseErrorCode.InvalidNumberFormat */
830
- ), w = 0), v(w);
830
+ ), A = 0), v(A);
831
831
  break;
832
832
  case 7:
833
833
  v(null);
@@ -843,12 +843,12 @@ function hr(e, t, r = ut.DEFAULT) {
843
843
  }
844
844
  return g(), !0;
845
845
  }
846
- function F() {
846
+ function U() {
847
847
  return n.getToken() !== 10 ? (b(3, [], [
848
848
  2,
849
849
  5
850
850
  /* SyntaxKind.CommaToken */
851
- ]), !1) : (j(!1), n.getToken() === 6 ? (h(":"), g(), V() || b(4, [], [
851
+ ]), !1) : (D(!1), n.getToken() === 6 ? (h(":"), g(), V() || b(4, [], [
852
852
  2,
853
853
  5
854
854
  /* SyntaxKind.CommaToken */
@@ -860,38 +860,38 @@ function hr(e, t, r = ut.DEFAULT) {
860
860
  }
861
861
  function M() {
862
862
  y(), g();
863
- let A = !1;
863
+ let E = !1;
864
864
  for (; n.getToken() !== 2 && n.getToken() !== 17; ) {
865
865
  if (n.getToken() === 5) {
866
- if (A || b(4, [], []), h(","), g(), n.getToken() === 2 && S)
866
+ if (E || b(4, [], []), h(","), g(), n.getToken() === 2 && S)
867
867
  break;
868
- } else A && b(6, [], []);
869
- F() || b(4, [], [
868
+ } else E && b(6, [], []);
869
+ U() || b(4, [], [
870
870
  2,
871
871
  5
872
872
  /* SyntaxKind.CommaToken */
873
- ]), A = !0;
873
+ ]), E = !0;
874
874
  }
875
875
  return d(), n.getToken() !== 2 ? b(7, [
876
876
  2
877
877
  /* SyntaxKind.CloseBraceToken */
878
878
  ], []) : g(), !0;
879
879
  }
880
- function x() {
881
- L(), g();
882
- let A = !0, w = !1;
880
+ function $() {
881
+ _(), g();
882
+ let E = !0, A = !1;
883
883
  for (; n.getToken() !== 4 && n.getToken() !== 17; ) {
884
884
  if (n.getToken() === 5) {
885
- if (w || b(4, [], []), h(","), g(), n.getToken() === 4 && S)
885
+ if (A || b(4, [], []), h(","), g(), n.getToken() === 4 && S)
886
886
  break;
887
- } else w && b(6, [], []);
888
- A ? (o.push(0), A = !1) : o[o.length - 1]++, V() || b(4, [], [
887
+ } else A && b(6, [], []);
888
+ E ? (o.push(0), E = !1) : o[o.length - 1]++, V() || b(4, [], [
889
889
  4,
890
890
  5
891
891
  /* SyntaxKind.CommaToken */
892
- ]), w = !0;
892
+ ]), A = !0;
893
893
  }
894
- return N(), A || o.pop(), n.getToken() !== 4 ? b(8, [
894
+ return T(), E || o.pop(), n.getToken() !== 4 ? b(8, [
895
895
  4
896
896
  /* SyntaxKind.CloseBracketToken */
897
897
  ], []) : g(), !0;
@@ -899,18 +899,18 @@ function hr(e, t, r = ut.DEFAULT) {
899
899
  function V() {
900
900
  switch (n.getToken()) {
901
901
  case 3:
902
- return x();
902
+ return $();
903
903
  case 1:
904
904
  return M();
905
905
  case 10:
906
- return j(!0);
906
+ return D(!0);
907
907
  default:
908
- return T();
908
+ return L();
909
909
  }
910
910
  }
911
911
  return g(), n.getToken() === 17 ? r.allowEmptyContent ? !0 : (b(4, [], []), !1) : V() ? (n.getToken() !== 17 && b(9, [], []), !0) : (b(4, [], []), !1);
912
912
  }
913
- function gr(e) {
913
+ function Or(e) {
914
914
  switch (typeof e) {
915
915
  case "boolean":
916
916
  return "boolean";
@@ -929,25 +929,25 @@ function gr(e) {
929
929
  return "null";
930
930
  }
931
931
  }
932
- var Ct;
932
+ var sn;
933
933
  (function(e) {
934
934
  e[e.None = 0] = "None", e[e.UnexpectedEndOfComment = 1] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 2] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 3] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 4] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 5] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 6] = "InvalidCharacter";
935
- })(Ct || (Ct = {}));
936
- var Kt;
935
+ })(sn || (sn = {}));
936
+ var cn;
937
937
  (function(e) {
938
938
  e[e.OpenBraceToken = 1] = "OpenBraceToken", e[e.CloseBraceToken = 2] = "CloseBraceToken", e[e.OpenBracketToken = 3] = "OpenBracketToken", e[e.CloseBracketToken = 4] = "CloseBracketToken", e[e.CommaToken = 5] = "CommaToken", e[e.ColonToken = 6] = "ColonToken", e[e.NullKeyword = 7] = "NullKeyword", e[e.TrueKeyword = 8] = "TrueKeyword", e[e.FalseKeyword = 9] = "FalseKeyword", e[e.StringLiteral = 10] = "StringLiteral", e[e.NumericLiteral = 11] = "NumericLiteral", e[e.LineCommentTrivia = 12] = "LineCommentTrivia", e[e.BlockCommentTrivia = 13] = "BlockCommentTrivia", e[e.LineBreakTrivia = 14] = "LineBreakTrivia", e[e.Trivia = 15] = "Trivia", e[e.Unknown = 16] = "Unknown", e[e.EOF = 17] = "EOF";
939
- })(Kt || (Kt = {}));
940
- const ln = pr, un = dr;
941
- var en;
939
+ })(cn || (cn = {}));
940
+ const mn = vr, yn = br;
941
+ var an;
942
942
  (function(e) {
943
943
  e[e.InvalidSymbol = 1] = "InvalidSymbol", e[e.InvalidNumberFormat = 2] = "InvalidNumberFormat", e[e.PropertyNameExpected = 3] = "PropertyNameExpected", e[e.ValueExpected = 4] = "ValueExpected", e[e.ColonExpected = 5] = "ColonExpected", e[e.CommaExpected = 6] = "CommaExpected", e[e.CloseBraceExpected = 7] = "CloseBraceExpected", e[e.CloseBracketExpected = 8] = "CloseBracketExpected", e[e.EndOfFileExpected = 9] = "EndOfFileExpected", e[e.InvalidCommentToken = 10] = "InvalidCommentToken", e[e.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 14] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 16] = "InvalidCharacter";
944
- })(en || (en = {}));
945
- function mr(e) {
944
+ })(an || (an = {}));
945
+ function Ar(e) {
946
946
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
947
947
  }
948
- var wt, tn;
949
- function yr() {
950
- return tn || (tn = 1, wt = function e(t, r) {
948
+ var kt, ln;
949
+ function Nr() {
950
+ return ln || (ln = 1, kt = function e(t, r) {
951
951
  if (t === r) return !0;
952
952
  if (t && r && typeof t == "object" && typeof r == "object") {
953
953
  if (t.constructor !== r.constructor) return !1;
@@ -971,10 +971,10 @@ function yr() {
971
971
  return !0;
972
972
  }
973
973
  return t !== t && r !== r;
974
- }), wt;
974
+ }), kt;
975
975
  }
976
- var vr = yr();
977
- const de = /* @__PURE__ */ mr(vr), W = (e, t) => {
976
+ var Er = Nr();
977
+ const de = /* @__PURE__ */ Ar(Er), W = (e, t) => {
978
978
  if (!e) return;
979
979
  const r = t.replace(/^\//, "").replace(/\[/g, ".").replace(/\]/g, "").split(/[./#]/).filter(Boolean);
980
980
  let n = e;
@@ -998,7 +998,7 @@ const de = /* @__PURE__ */ mr(vr), W = (e, t) => {
998
998
  * (c) 2017-2022 Joachim Wester
999
999
  * MIT licensed
1000
1000
  */
1001
- var br = /* @__PURE__ */ (function() {
1001
+ var Tr = /* @__PURE__ */ (function() {
1002
1002
  var e = function(t, r) {
1003
1003
  return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, o) {
1004
1004
  n.__proto__ = o;
@@ -1013,11 +1013,11 @@ var br = /* @__PURE__ */ (function() {
1013
1013
  }
1014
1014
  t.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n());
1015
1015
  };
1016
- })(), Or = Object.prototype.hasOwnProperty;
1017
- function Et(e, t) {
1018
- return Or.call(e, t);
1016
+ })(), Ir = Object.prototype.hasOwnProperty;
1017
+ function jt(e, t) {
1018
+ return Ir.call(e, t);
1019
1019
  }
1020
- function Tt(e) {
1020
+ function Rt(e) {
1021
1021
  if (Array.isArray(e)) {
1022
1022
  for (var t = new Array(e.length), r = 0; r < t.length; r++)
1023
1023
  t[r] = "" + r;
@@ -1027,10 +1027,10 @@ function Tt(e) {
1027
1027
  return Object.keys(e);
1028
1028
  var n = [];
1029
1029
  for (var o in e)
1030
- Et(e, o) && n.push(o);
1030
+ jt(e, o) && n.push(o);
1031
1031
  return n;
1032
1032
  }
1033
- function we(e) {
1033
+ function Ae(e) {
1034
1034
  switch (typeof e) {
1035
1035
  case "object":
1036
1036
  return JSON.parse(JSON.stringify(e));
@@ -1042,7 +1042,7 @@ function we(e) {
1042
1042
  return e;
1043
1043
  }
1044
1044
  }
1045
- function It(e) {
1045
+ function Dt(e) {
1046
1046
  for (var t = 0, r = e.length, n; t < r; ) {
1047
1047
  if (n = e.charCodeAt(t), n >= 48 && n <= 57) {
1048
1048
  t++;
@@ -1052,29 +1052,29 @@ function It(e) {
1052
1052
  }
1053
1053
  return !0;
1054
1054
  }
1055
- function Me(e) {
1055
+ function Fe(e) {
1056
1056
  return e.indexOf("/") === -1 && e.indexOf("~") === -1 ? e : e.replace(/~/g, "~0").replace(/\//g, "~1");
1057
1057
  }
1058
- function fn(e) {
1058
+ function vn(e) {
1059
1059
  return e.replace(/~1/g, "/").replace(/~0/g, "~");
1060
1060
  }
1061
- function Lt(e) {
1061
+ function xt(e) {
1062
1062
  if (e === void 0)
1063
1063
  return !0;
1064
1064
  if (e) {
1065
1065
  if (Array.isArray(e)) {
1066
1066
  for (var t = 0, r = e.length; t < r; t++)
1067
- if (Lt(e[t]))
1067
+ if (xt(e[t]))
1068
1068
  return !0;
1069
1069
  } else if (typeof e == "object") {
1070
- for (var n = Tt(e), o = n.length, i = 0; i < o; i++)
1071
- if (Lt(e[n[i]]))
1070
+ for (var n = Rt(e), o = n.length, i = 0; i < o; i++)
1071
+ if (xt(e[n[i]]))
1072
1072
  return !0;
1073
1073
  }
1074
1074
  }
1075
1075
  return !1;
1076
1076
  }
1077
- function nn(e, t) {
1077
+ function un(e, t) {
1078
1078
  var r = [e];
1079
1079
  for (var n in t) {
1080
1080
  var o = typeof t[n] == "object" ? JSON.stringify(t[n], null, 2) : t[n];
@@ -1083,17 +1083,17 @@ function nn(e, t) {
1083
1083
  return r.join(`
1084
1084
  `);
1085
1085
  }
1086
- var pn = (
1086
+ var bn = (
1087
1087
  /** @class */
1088
1088
  (function(e) {
1089
- br(t, e);
1089
+ Tr(t, e);
1090
1090
  function t(r, n, o, i, s) {
1091
- var c = this.constructor, a = e.call(this, nn(r, { name: n, index: o, operation: i, tree: s })) || this;
1092
- return a.name = n, a.index = o, a.operation = i, a.tree = s, Object.setPrototypeOf(a, c.prototype), a.message = nn(r, { name: n, index: o, operation: i, tree: s }), a;
1091
+ var c = this.constructor, a = e.call(this, un(r, { name: n, index: o, operation: i, tree: s })) || this;
1092
+ return a.name = n, a.index = o, a.operation = i, a.tree = s, Object.setPrototypeOf(a, c.prototype), a.message = un(r, { name: n, index: o, operation: i, tree: s }), a;
1093
1093
  }
1094
1094
  return t;
1095
1095
  })(Error)
1096
- ), ce = pn, wr = we, Ge = {
1096
+ ), le = bn, Lr = Ae, ze = {
1097
1097
  add: function(e, t, r) {
1098
1098
  return e[t] = this.value, { newDocument: r };
1099
1099
  },
@@ -1106,24 +1106,24 @@ var pn = (
1106
1106
  return e[t] = this.value, { newDocument: r, removed: n };
1107
1107
  },
1108
1108
  move: function(e, t, r) {
1109
- var n = ft(r, this.path);
1110
- n && (n = we(n));
1111
- var o = xe(r, { op: "remove", path: this.from }).removed;
1112
- return xe(r, { op: "add", path: this.path, value: o }), { newDocument: r, removed: n };
1109
+ var n = bt(r, this.path);
1110
+ n && (n = Ae(n));
1111
+ var o = Ue(r, { op: "remove", path: this.from }).removed;
1112
+ return Ue(r, { op: "add", path: this.path, value: o }), { newDocument: r, removed: n };
1113
1113
  },
1114
1114
  copy: function(e, t, r) {
1115
- var n = ft(r, this.from);
1116
- return xe(r, { op: "add", path: this.path, value: we(n) }), { newDocument: r };
1115
+ var n = bt(r, this.from);
1116
+ return Ue(r, { op: "add", path: this.path, value: Ae(n) }), { newDocument: r };
1117
1117
  },
1118
1118
  test: function(e, t, r) {
1119
- return { newDocument: r, test: et(e[t], this.value) };
1119
+ return { newDocument: r, test: st(e[t], this.value) };
1120
1120
  },
1121
1121
  _get: function(e, t, r) {
1122
1122
  return this.value = e[t], { newDocument: r };
1123
1123
  }
1124
- }, Ar = {
1124
+ }, Sr = {
1125
1125
  add: function(e, t, r) {
1126
- return It(t) ? e.splice(t, 0, this.value) : e[t] = this.value, { newDocument: r, index: t };
1126
+ return Dt(t) ? e.splice(t, 0, this.value) : e[t] = this.value, { newDocument: r, index: t };
1127
1127
  },
1128
1128
  remove: function(e, t, r) {
1129
1129
  var n = e.splice(t, 1);
@@ -1133,29 +1133,29 @@ var pn = (
1133
1133
  var n = e[t];
1134
1134
  return e[t] = this.value, { newDocument: r, removed: n };
1135
1135
  },
1136
- move: Ge.move,
1137
- copy: Ge.copy,
1138
- test: Ge.test,
1139
- _get: Ge._get
1136
+ move: ze.move,
1137
+ copy: ze.copy,
1138
+ test: ze.test,
1139
+ _get: ze._get
1140
1140
  };
1141
- function ft(e, t) {
1141
+ function bt(e, t) {
1142
1142
  if (t == "")
1143
1143
  return e;
1144
1144
  var r = { op: "_get", path: t };
1145
- return xe(e, r), r.value;
1145
+ return Ue(e, r), r.value;
1146
1146
  }
1147
- function xe(e, t, r, n, o, i) {
1148
- if (r === void 0 && (r = !1), n === void 0 && (n = !0), o === void 0 && (o = !0), i === void 0 && (i = 0), r && (typeof r == "function" ? r(t, 0, e, t.path) : pt(t, 0)), t.path === "") {
1147
+ function Ue(e, t, r, n, o, i) {
1148
+ if (r === void 0 && (r = !1), n === void 0 && (n = !0), o === void 0 && (o = !0), i === void 0 && (i = 0), r && (typeof r == "function" ? r(t, 0, e, t.path) : wt(t, 0)), t.path === "") {
1149
1149
  var s = { newDocument: e };
1150
1150
  if (t.op === "add")
1151
1151
  return s.newDocument = t.value, s;
1152
1152
  if (t.op === "replace")
1153
1153
  return s.newDocument = t.value, s.removed = e, s;
1154
1154
  if (t.op === "move" || t.op === "copy")
1155
- return s.newDocument = ft(e, t.from), t.op === "move" && (s.removed = e), s;
1155
+ return s.newDocument = bt(e, t.from), t.op === "move" && (s.removed = e), s;
1156
1156
  if (t.op === "test") {
1157
- if (s.test = et(e, t.value), s.test === !1)
1158
- throw new ce("Test operation failed", "TEST_OPERATION_FAILED", i, t, e);
1157
+ if (s.test = st(e, t.value), s.test === !1)
1158
+ throw new le("Test operation failed", "TEST_OPERATION_FAILED", i, t, e);
1159
1159
  return s.newDocument = e, s;
1160
1160
  } else {
1161
1161
  if (t.op === "remove")
@@ -1163,104 +1163,104 @@ function xe(e, t, r, n, o, i) {
1163
1163
  if (t.op === "_get")
1164
1164
  return t.value = e, s;
1165
1165
  if (r)
1166
- throw new ce("Operation `op` property is not one of operations defined in RFC-6902", "OPERATION_OP_INVALID", i, t, e);
1166
+ throw new le("Operation `op` property is not one of operations defined in RFC-6902", "OPERATION_OP_INVALID", i, t, e);
1167
1167
  return s;
1168
1168
  }
1169
1169
  } else {
1170
- n || (e = we(e));
1171
- var c = t.path || "", a = c.split("/"), u = e, l = 1, y = a.length, p = void 0, d = void 0, L = void 0;
1172
- for (typeof r == "function" ? L = r : L = pt; ; ) {
1173
- if (d = a[l], d && d.indexOf("~") != -1 && (d = fn(d)), o && (d == "__proto__" || d == "prototype" && l > 0 && a[l - 1] == "constructor"))
1170
+ n || (e = Ae(e));
1171
+ var c = t.path || "", a = c.split("/"), u = e, l = 1, y = a.length, p = void 0, d = void 0, _ = void 0;
1172
+ for (typeof r == "function" ? _ = r : _ = wt; ; ) {
1173
+ if (d = a[l], d && d.indexOf("~") != -1 && (d = vn(d)), o && (d == "__proto__" || d == "prototype" && l > 0 && a[l - 1] == "constructor"))
1174
1174
  throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");
1175
- if (r && p === void 0 && (u[d] === void 0 ? p = a.slice(0, l).join("/") : l == y - 1 && (p = t.path), p !== void 0 && L(t, 0, e, p)), l++, Array.isArray(u)) {
1175
+ if (r && p === void 0 && (u[d] === void 0 ? p = a.slice(0, l).join("/") : l == y - 1 && (p = t.path), p !== void 0 && _(t, 0, e, p)), l++, Array.isArray(u)) {
1176
1176
  if (d === "-")
1177
1177
  d = u.length;
1178
1178
  else {
1179
- if (r && !It(d))
1180
- throw new ce("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index", "OPERATION_PATH_ILLEGAL_ARRAY_INDEX", i, t, e);
1181
- It(d) && (d = ~~d);
1179
+ if (r && !Dt(d))
1180
+ throw new le("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index", "OPERATION_PATH_ILLEGAL_ARRAY_INDEX", i, t, e);
1181
+ Dt(d) && (d = ~~d);
1182
1182
  }
1183
1183
  if (l >= y) {
1184
1184
  if (r && t.op === "add" && d > u.length)
1185
- throw new ce("The specified index MUST NOT be greater than the number of elements in the array", "OPERATION_VALUE_OUT_OF_BOUNDS", i, t, e);
1186
- var s = Ar[t.op].call(t, u, d, e);
1185
+ throw new le("The specified index MUST NOT be greater than the number of elements in the array", "OPERATION_VALUE_OUT_OF_BOUNDS", i, t, e);
1186
+ var s = Sr[t.op].call(t, u, d, e);
1187
1187
  if (s.test === !1)
1188
- throw new ce("Test operation failed", "TEST_OPERATION_FAILED", i, t, e);
1188
+ throw new le("Test operation failed", "TEST_OPERATION_FAILED", i, t, e);
1189
1189
  return s;
1190
1190
  }
1191
1191
  } else if (l >= y) {
1192
- var s = Ge[t.op].call(t, u, d, e);
1192
+ var s = ze[t.op].call(t, u, d, e);
1193
1193
  if (s.test === !1)
1194
- throw new ce("Test operation failed", "TEST_OPERATION_FAILED", i, t, e);
1194
+ throw new le("Test operation failed", "TEST_OPERATION_FAILED", i, t, e);
1195
1195
  return s;
1196
1196
  }
1197
1197
  if (u = u[d], r && l < y && (!u || typeof u != "object"))
1198
- throw new ce("Cannot perform operation at the desired path", "OPERATION_PATH_UNRESOLVABLE", i, t, e);
1198
+ throw new le("Cannot perform operation at the desired path", "OPERATION_PATH_UNRESOLVABLE", i, t, e);
1199
1199
  }
1200
1200
  }
1201
1201
  }
1202
- function _t(e, t, r, n, o) {
1202
+ function Bt(e, t, r, n, o) {
1203
1203
  if (n === void 0 && (n = !0), o === void 0 && (o = !0), r && !Array.isArray(t))
1204
- throw new ce("Patch sequence must be an array", "SEQUENCE_NOT_AN_ARRAY");
1205
- n || (e = we(e));
1204
+ throw new le("Patch sequence must be an array", "SEQUENCE_NOT_AN_ARRAY");
1205
+ n || (e = Ae(e));
1206
1206
  for (var i = new Array(t.length), s = 0, c = t.length; s < c; s++)
1207
- i[s] = xe(e, t[s], r, !0, o, s), e = i[s].newDocument;
1207
+ i[s] = Ue(e, t[s], r, !0, o, s), e = i[s].newDocument;
1208
1208
  return i.newDocument = e, i;
1209
1209
  }
1210
- function Nr(e, t, r) {
1211
- var n = xe(e, t);
1210
+ function kr(e, t, r) {
1211
+ var n = Ue(e, t);
1212
1212
  if (n.test === !1)
1213
- throw new ce("Test operation failed", "TEST_OPERATION_FAILED", r, t, e);
1213
+ throw new le("Test operation failed", "TEST_OPERATION_FAILED", r, t, e);
1214
1214
  return n.newDocument;
1215
1215
  }
1216
- function pt(e, t, r, n) {
1216
+ function wt(e, t, r, n) {
1217
1217
  if (typeof e != "object" || e === null || Array.isArray(e))
1218
- throw new ce("Operation is not an object", "OPERATION_NOT_AN_OBJECT", t, e, r);
1219
- if (Ge[e.op]) {
1218
+ throw new le("Operation is not an object", "OPERATION_NOT_AN_OBJECT", t, e, r);
1219
+ if (ze[e.op]) {
1220
1220
  if (typeof e.path != "string")
1221
- throw new ce("Operation `path` property is not a string", "OPERATION_PATH_INVALID", t, e, r);
1221
+ throw new le("Operation `path` property is not a string", "OPERATION_PATH_INVALID", t, e, r);
1222
1222
  if (e.path.indexOf("/") !== 0 && e.path.length > 0)
1223
- throw new ce('Operation `path` property must start with "/"', "OPERATION_PATH_INVALID", t, e, r);
1223
+ throw new le('Operation `path` property must start with "/"', "OPERATION_PATH_INVALID", t, e, r);
1224
1224
  if ((e.op === "move" || e.op === "copy") && typeof e.from != "string")
1225
- throw new ce("Operation `from` property is not present (applicable in `move` and `copy` operations)", "OPERATION_FROM_REQUIRED", t, e, r);
1225
+ throw new le("Operation `from` property is not present (applicable in `move` and `copy` operations)", "OPERATION_FROM_REQUIRED", t, e, r);
1226
1226
  if ((e.op === "add" || e.op === "replace" || e.op === "test") && e.value === void 0)
1227
- throw new ce("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)", "OPERATION_VALUE_REQUIRED", t, e, r);
1228
- if ((e.op === "add" || e.op === "replace" || e.op === "test") && Lt(e.value))
1229
- throw new ce("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)", "OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED", t, e, r);
1227
+ throw new le("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)", "OPERATION_VALUE_REQUIRED", t, e, r);
1228
+ if ((e.op === "add" || e.op === "replace" || e.op === "test") && xt(e.value))
1229
+ throw new le("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)", "OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED", t, e, r);
1230
1230
  if (r) {
1231
1231
  if (e.op == "add") {
1232
1232
  var o = e.path.split("/").length, i = n.split("/").length;
1233
1233
  if (o !== i + 1 && o !== i)
1234
- throw new ce("Cannot perform an `add` operation at the desired path", "OPERATION_PATH_CANNOT_ADD", t, e, r);
1234
+ throw new le("Cannot perform an `add` operation at the desired path", "OPERATION_PATH_CANNOT_ADD", t, e, r);
1235
1235
  } else if (e.op === "replace" || e.op === "remove" || e.op === "_get") {
1236
1236
  if (e.path !== n)
1237
- throw new ce("Cannot perform the operation at a path that does not exist", "OPERATION_PATH_UNRESOLVABLE", t, e, r);
1237
+ throw new le("Cannot perform the operation at a path that does not exist", "OPERATION_PATH_UNRESOLVABLE", t, e, r);
1238
1238
  } else if (e.op === "move" || e.op === "copy") {
1239
- var s = { op: "_get", path: e.from, value: void 0 }, c = dn([s], r);
1239
+ var s = { op: "_get", path: e.from, value: void 0 }, c = wn([s], r);
1240
1240
  if (c && c.name === "OPERATION_PATH_UNRESOLVABLE")
1241
- throw new ce("Cannot perform the operation from a path that does not exist", "OPERATION_FROM_UNRESOLVABLE", t, e, r);
1241
+ throw new le("Cannot perform the operation from a path that does not exist", "OPERATION_FROM_UNRESOLVABLE", t, e, r);
1242
1242
  }
1243
1243
  }
1244
- } else throw new ce("Operation `op` property is not one of operations defined in RFC-6902", "OPERATION_OP_INVALID", t, e, r);
1244
+ } else throw new le("Operation `op` property is not one of operations defined in RFC-6902", "OPERATION_OP_INVALID", t, e, r);
1245
1245
  }
1246
- function dn(e, t, r) {
1246
+ function wn(e, t, r) {
1247
1247
  try {
1248
1248
  if (!Array.isArray(e))
1249
- throw new ce("Patch sequence must be an array", "SEQUENCE_NOT_AN_ARRAY");
1249
+ throw new le("Patch sequence must be an array", "SEQUENCE_NOT_AN_ARRAY");
1250
1250
  if (t)
1251
- _t(we(t), we(e), r || !0);
1251
+ Bt(Ae(t), Ae(e), r || !0);
1252
1252
  else {
1253
- r = r || pt;
1253
+ r = r || wt;
1254
1254
  for (var n = 0; n < e.length; n++)
1255
1255
  r(e[n], n, t, void 0);
1256
1256
  }
1257
1257
  } catch (o) {
1258
- if (o instanceof ce)
1258
+ if (o instanceof le)
1259
1259
  return o;
1260
1260
  throw o;
1261
1261
  }
1262
1262
  }
1263
- function et(e, t) {
1263
+ function st(e, t) {
1264
1264
  if (e === t)
1265
1265
  return !0;
1266
1266
  if (e && t && typeof e == "object" && typeof t == "object") {
@@ -1269,7 +1269,7 @@ function et(e, t) {
1269
1269
  if (i = e.length, i != t.length)
1270
1270
  return !1;
1271
1271
  for (o = i; o-- !== 0; )
1272
- if (!et(e[o], t[o]))
1272
+ if (!st(e[o], t[o]))
1273
1273
  return !1;
1274
1274
  return !0;
1275
1275
  }
@@ -1282,30 +1282,30 @@ function et(e, t) {
1282
1282
  if (!t.hasOwnProperty(c[o]))
1283
1283
  return !1;
1284
1284
  for (o = i; o-- !== 0; )
1285
- if (s = c[o], !et(e[s], t[s]))
1285
+ if (s = c[o], !st(e[s], t[s]))
1286
1286
  return !1;
1287
1287
  return !0;
1288
1288
  }
1289
1289
  return e !== e && t !== t;
1290
1290
  }
1291
- const Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1291
+ const _r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1292
1292
  __proto__: null,
1293
- JsonPatchError: ce,
1294
- _areEquals: et,
1295
- applyOperation: xe,
1296
- applyPatch: _t,
1297
- applyReducer: Nr,
1298
- deepClone: wr,
1299
- getValueByPointer: ft,
1300
- validate: dn,
1301
- validator: pt
1293
+ JsonPatchError: le,
1294
+ _areEquals: st,
1295
+ applyOperation: Ue,
1296
+ applyPatch: Bt,
1297
+ applyReducer: kr,
1298
+ deepClone: Lr,
1299
+ getValueByPointer: bt,
1300
+ validate: wn,
1301
+ validator: wt
1302
1302
  }, Symbol.toStringTag, { value: "Module" }));
1303
1303
  /*!
1304
1304
  * https://github.com/Starcounter-Jack/JSON-Patch
1305
1305
  * (c) 2017-2021 Joachim Wester
1306
1306
  * MIT license
1307
1307
  */
1308
- var Pt = /* @__PURE__ */ new WeakMap(), Tr = (
1308
+ var Ft = /* @__PURE__ */ new WeakMap(), Pr = (
1309
1309
  /** @class */
1310
1310
  /* @__PURE__ */ (function() {
1311
1311
  function e(t) {
@@ -1313,7 +1313,7 @@ var Pt = /* @__PURE__ */ new WeakMap(), Tr = (
1313
1313
  }
1314
1314
  return e;
1315
1315
  })()
1316
- ), Ir = (
1316
+ ), jr = (
1317
1317
  /** @class */
1318
1318
  /* @__PURE__ */ (function() {
1319
1319
  function e(t, r) {
@@ -1322,95 +1322,95 @@ var Pt = /* @__PURE__ */ new WeakMap(), Tr = (
1322
1322
  return e;
1323
1323
  })()
1324
1324
  );
1325
- function Lr(e) {
1326
- return Pt.get(e);
1325
+ function Rr(e) {
1326
+ return Ft.get(e);
1327
1327
  }
1328
- function Sr(e, t) {
1328
+ function Dr(e, t) {
1329
1329
  return e.observers.get(t);
1330
1330
  }
1331
- function kr(e, t) {
1331
+ function xr(e, t) {
1332
1332
  e.observers.delete(t.callback);
1333
1333
  }
1334
- function _r(e, t) {
1334
+ function Mr(e, t) {
1335
1335
  t.unobserve();
1336
1336
  }
1337
- function Pr(e, t) {
1338
- var r = [], n, o = Lr(e);
1337
+ function $r(e, t) {
1338
+ var r = [], n, o = Rr(e);
1339
1339
  if (!o)
1340
- o = new Tr(e), Pt.set(e, o);
1340
+ o = new Pr(e), Ft.set(e, o);
1341
1341
  else {
1342
- var i = Sr(o, t);
1342
+ var i = Dr(o, t);
1343
1343
  n = i && i.observer;
1344
1344
  }
1345
1345
  if (n)
1346
1346
  return n;
1347
- if (n = {}, o.value = we(e), t) {
1347
+ if (n = {}, o.value = Ae(e), t) {
1348
1348
  n.callback = t, n.next = null;
1349
1349
  var s = function() {
1350
- St(n);
1350
+ Mt(n);
1351
1351
  }, c = function() {
1352
1352
  clearTimeout(n.next), n.next = setTimeout(s);
1353
1353
  };
1354
1354
  typeof window < "u" && (window.addEventListener("mouseup", c), window.addEventListener("keyup", c), window.addEventListener("mousedown", c), window.addEventListener("keydown", c), window.addEventListener("change", c));
1355
1355
  }
1356
1356
  return n.patches = r, n.object = e, n.unobserve = function() {
1357
- St(n), clearTimeout(n.next), kr(o, n), typeof window < "u" && (window.removeEventListener("mouseup", c), window.removeEventListener("keyup", c), window.removeEventListener("mousedown", c), window.removeEventListener("keydown", c), window.removeEventListener("change", c));
1358
- }, o.observers.set(t, new Ir(t, n)), n;
1357
+ Mt(n), clearTimeout(n.next), xr(o, n), typeof window < "u" && (window.removeEventListener("mouseup", c), window.removeEventListener("keyup", c), window.removeEventListener("mousedown", c), window.removeEventListener("keydown", c), window.removeEventListener("change", c));
1358
+ }, o.observers.set(t, new jr(t, n)), n;
1359
1359
  }
1360
- function St(e, t) {
1360
+ function Mt(e, t) {
1361
1361
  t === void 0 && (t = !1);
1362
- var r = Pt.get(e.object);
1363
- Rt(r.value, e.object, e.patches, "", t), e.patches.length && _t(r.value, e.patches);
1362
+ var r = Ft.get(e.object);
1363
+ Ut(r.value, e.object, e.patches, "", t), e.patches.length && Bt(r.value, e.patches);
1364
1364
  var n = e.patches;
1365
1365
  return n.length > 0 && (e.patches = [], e.callback && e.callback(n)), n;
1366
1366
  }
1367
- function Rt(e, t, r, n, o) {
1367
+ function Ut(e, t, r, n, o) {
1368
1368
  if (t !== e) {
1369
1369
  typeof t.toJSON == "function" && (t = t.toJSON());
1370
- for (var i = Tt(t), s = Tt(e), c = !1, a = s.length - 1; a >= 0; a--) {
1370
+ for (var i = Rt(t), s = Rt(e), c = !1, a = s.length - 1; a >= 0; a--) {
1371
1371
  var u = s[a], l = e[u];
1372
- if (Et(t, u) && !(t[u] === void 0 && l !== void 0 && Array.isArray(t) === !1)) {
1372
+ if (jt(t, u) && !(t[u] === void 0 && l !== void 0 && Array.isArray(t) === !1)) {
1373
1373
  var y = t[u];
1374
- typeof l == "object" && l != null && typeof y == "object" && y != null && Array.isArray(l) === Array.isArray(y) ? Rt(l, y, r, n + "/" + Me(u), o) : l !== y && (o && r.push({ op: "test", path: n + "/" + Me(u), value: we(l) }), r.push({ op: "replace", path: n + "/" + Me(u), value: we(y) }));
1375
- } else Array.isArray(e) === Array.isArray(t) ? (o && r.push({ op: "test", path: n + "/" + Me(u), value: we(l) }), r.push({ op: "remove", path: n + "/" + Me(u) }), c = !0) : (o && r.push({ op: "test", path: n, value: e }), r.push({ op: "replace", path: n, value: t }));
1374
+ typeof l == "object" && l != null && typeof y == "object" && y != null && Array.isArray(l) === Array.isArray(y) ? Ut(l, y, r, n + "/" + Fe(u), o) : l !== y && (o && r.push({ op: "test", path: n + "/" + Fe(u), value: Ae(l) }), r.push({ op: "replace", path: n + "/" + Fe(u), value: Ae(y) }));
1375
+ } else Array.isArray(e) === Array.isArray(t) ? (o && r.push({ op: "test", path: n + "/" + Fe(u), value: Ae(l) }), r.push({ op: "remove", path: n + "/" + Fe(u) }), c = !0) : (o && r.push({ op: "test", path: n, value: e }), r.push({ op: "replace", path: n, value: t }));
1376
1376
  }
1377
1377
  if (!(!c && i.length == s.length))
1378
1378
  for (var a = 0; a < i.length; a++) {
1379
1379
  var u = i[a];
1380
- !Et(e, u) && t[u] !== void 0 && r.push({ op: "add", path: n + "/" + Me(u), value: we(t[u]) });
1380
+ !jt(e, u) && t[u] !== void 0 && r.push({ op: "add", path: n + "/" + Fe(u), value: Ae(t[u]) });
1381
1381
  }
1382
1382
  }
1383
1383
  }
1384
- function We(e, t, r) {
1384
+ function Ce(e, t, r) {
1385
1385
  r === void 0 && (r = !1);
1386
1386
  var n = [];
1387
- return Rt(e, t, n, "", r), n;
1387
+ return Ut(e, t, n, "", r), n;
1388
1388
  }
1389
- const Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1389
+ const Br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1390
1390
  __proto__: null,
1391
- compare: We,
1392
- generate: St,
1393
- observe: Pr,
1394
- unobserve: _r
1391
+ compare: Ce,
1392
+ generate: Mt,
1393
+ observe: $r,
1394
+ unobserve: Mr
1395
1395
  }, Symbol.toStringTag, { value: "Module" }));
1396
- Object.assign({}, Er, Rr, {
1397
- JsonPatchError: pn,
1398
- deepClone: we,
1399
- escapePathComponent: Me,
1400
- unescapePathComponent: fn
1396
+ Object.assign({}, _r, Br, {
1397
+ JsonPatchError: bn,
1398
+ deepClone: Ae,
1399
+ escapePathComponent: Fe,
1400
+ unescapePathComponent: vn
1401
1401
  });
1402
- const ht = "oneOf", jt = "anyOf", Dt = "allOf";
1403
- function Mt(e) {
1404
- return !!(e[ht] || e[jt] || e[Dt]);
1402
+ const At = "oneOf", Vt = "anyOf", Jt = "allOf";
1403
+ function Ht(e) {
1404
+ return !!(e[At] || e[Vt] || e[Jt]);
1405
1405
  }
1406
- function hn(e) {
1407
- const t = e[ht] || e[jt] || e[Dt];
1406
+ function On(e) {
1407
+ const t = e[At] || e[Vt] || e[Jt];
1408
1408
  return Array.isArray(t) ? t : void 0;
1409
1409
  }
1410
- function ct(e) {
1411
- return e.oneOf ? ht : e.anyOf ? jt : e.allOf ? Dt : "";
1410
+ function gt(e) {
1411
+ return e.oneOf ? At : e.anyOf ? Vt : e.allOf ? Jt : "";
1412
1412
  }
1413
- function jr(e, t) {
1413
+ function Fr(e, t) {
1414
1414
  if (typeof t != "object" || t === null || Array.isArray(t))
1415
1415
  return null;
1416
1416
  const r = t, n = /* @__PURE__ */ new Set();
@@ -1425,7 +1425,7 @@ function jr(e, t) {
1425
1425
  return { field: o, value: r[o] };
1426
1426
  return null;
1427
1427
  }
1428
- function at(e, t, r = ht) {
1428
+ function mt(e, t, r = At) {
1429
1429
  var n;
1430
1430
  if (t.length === 0)
1431
1431
  throw new Error("No variants provided to chooseSubschemaSync");
@@ -1436,7 +1436,7 @@ function at(e, t, r = ht) {
1436
1436
  return { selectedIndex: o, schema: i };
1437
1437
  }
1438
1438
  if (typeof e == "object" && e !== null && !Array.isArray(e)) {
1439
- const o = e, i = jr(t, e);
1439
+ const o = e, i = Fr(t, e);
1440
1440
  if (i)
1441
1441
  for (let s = 0; s < t.length; s++) {
1442
1442
  const c = t[s], a = (n = c.properties) == null ? void 0 : n[i.field];
@@ -1478,32 +1478,32 @@ function at(e, t, r = ht) {
1478
1478
  }
1479
1479
  return { selectedIndex: 0, schema: t[0] };
1480
1480
  }
1481
- function kt(e, t, r) {
1481
+ function $t(e, t, r) {
1482
1482
  const n = !de(e, t), o = !de(e, r);
1483
- return n && o ? de(t, r) ? D.SAME_CHANGE : D.TRUE_CONFLICT : n ? D.INPUT1_ONLY : o ? D.INPUT2_ONLY : D.SAME_CHANGE;
1483
+ return n && o ? de(t, r) ? x.SAME_CHANGE : x.TRUE_CONFLICT : n ? x.INPUT1_ONLY : o ? x.INPUT2_ONLY : x.SAME_CHANGE;
1484
1484
  }
1485
- function Pe(e, t) {
1485
+ function De(e, t) {
1486
1486
  try {
1487
- const r = ln(e);
1487
+ const r = mn(e);
1488
1488
  if (!r)
1489
1489
  return { start: 1, end: 1 };
1490
1490
  const n = t.split("/").filter(Boolean).map((s) => {
1491
1491
  const c = Number.parseInt(s, 10);
1492
1492
  return !Number.isNaN(c) && String(c) === s ? c : s;
1493
- }), o = n.length === 0 ? r : un(r, n);
1493
+ }), o = n.length === 0 ? r : yn(r, n);
1494
1494
  return o ? {
1495
- start: rn(e, o.offset),
1496
- end: rn(e, o.offset + o.length)
1495
+ start: fn(e, o.offset),
1496
+ end: fn(e, o.offset + o.length)
1497
1497
  } : { start: 1, end: 1 };
1498
1498
  } catch {
1499
1499
  return { start: 1, end: 1 };
1500
1500
  }
1501
1501
  }
1502
- function rn(e, t) {
1502
+ function fn(e, t) {
1503
1503
  return e.substring(0, t).split(`
1504
1504
  `).length;
1505
1505
  }
1506
- function Dr(e, t) {
1506
+ function Ur(e, t) {
1507
1507
  const r = /* @__PURE__ */ new Map(), n = (o) => {
1508
1508
  const i = o.split("/").filter(Boolean);
1509
1509
  return i.length > 0 ? `/${i[0]}` : "/";
@@ -1522,7 +1522,7 @@ function Dr(e, t) {
1522
1522
  }
1523
1523
  return r;
1524
1524
  }
1525
- function Mr(e, t, r, n, o, i) {
1525
+ function Vr(e, t, r, n, o, i) {
1526
1526
  const s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), u = [], l = [];
1527
1527
  for (const v of e) {
1528
1528
  const h = v.path.match(/^(\/[^/]+(?:\/[^/]+)*)\/(\d+)(?:\/|$)/);
@@ -1548,79 +1548,79 @@ function Mr(e, t, r, n, o, i) {
1548
1548
  for (const v of y) {
1549
1549
  const h = W(r, v), m = W(n, v), f = W(o, v);
1550
1550
  if (!Array.isArray(h) || !Array.isArray(m) || !Array.isArray(f)) {
1551
- const T = c.get(v) || [], F = a.get(v) || [];
1552
- for (const M of T) {
1553
- const x = M.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1554
- if (x) {
1555
- const V = x[1];
1551
+ const L = c.get(v) || [], U = a.get(v) || [];
1552
+ for (const M of L) {
1553
+ const $ = M.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1554
+ if ($) {
1555
+ const V = $[1];
1556
1556
  s.has(V) || s.set(V, { patches1: [], patches2: [] });
1557
- const A = s.get(V);
1558
- A && A.patches1.push(M);
1557
+ const E = s.get(V);
1558
+ E && E.patches1.push(M);
1559
1559
  }
1560
1560
  }
1561
- for (const M of F) {
1562
- const x = M.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1563
- if (x) {
1564
- const V = x[1];
1561
+ for (const M of U) {
1562
+ const $ = M.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1563
+ if ($) {
1564
+ const V = $[1];
1565
1565
  s.has(V) || s.set(V, { patches1: [], patches2: [] });
1566
- const A = s.get(V);
1567
- A && A.patches2.push(M);
1566
+ const E = s.get(V);
1567
+ E && E.patches2.push(M);
1568
1568
  }
1569
1569
  }
1570
1570
  continue;
1571
1571
  }
1572
- const E = qe(i, v, r), S = E != null && E.items ? Array.isArray(E.items) && E.items[0] ? E.items[0] : Array.isArray(E.items) ? null : E.items : null, g = S && typeof S == "object" ? S : null;
1572
+ const I = Xe(i, v, r), S = I != null && I.items ? Array.isArray(I.items) && I.items[0] ? I.items[0] : Array.isArray(I.items) ? null : I.items : null, g = S && typeof S == "object" ? S : null;
1573
1573
  if (g) {
1574
- const T = Br(h, m, f, g);
1575
- if (T.size > 0) {
1576
- const F = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
1577
- for (const [w, R] of T.entries())
1578
- R.base !== void 0 && F.set(R.base, w), R.input1 !== void 0 && M.set(R.input1, w), R.input2 !== void 0 && x.set(R.input2, w);
1579
- const V = c.get(v) || [], A = a.get(v) || [];
1580
- for (const w of V) {
1581
- const R = w.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
1574
+ const L = Gr(h, m, f, g);
1575
+ if (L.size > 0) {
1576
+ const U = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map();
1577
+ for (const [A, R] of L.entries())
1578
+ R.base !== void 0 && U.set(R.base, A), R.input1 !== void 0 && M.set(R.input1, A), R.input2 !== void 0 && $.set(R.input2, A);
1579
+ const V = c.get(v) || [], E = a.get(v) || [];
1580
+ for (const A of V) {
1581
+ const R = A.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
1582
1582
  if (R) {
1583
- const X = Number.parseInt(R[1], 10), ne = M.get(X);
1584
- if (ne !== void 0) {
1585
- const ae = `${v}#${ne}`;
1586
- s.has(ae) || s.set(ae, { patches1: [], patches2: [] });
1587
- const me = s.get(ae);
1588
- me && me.patches1.push(w);
1583
+ const X = Number.parseInt(R[1], 10), re = M.get(X);
1584
+ if (re !== void 0) {
1585
+ const oe = `${v}#${re}`;
1586
+ s.has(oe) || s.set(oe, { patches1: [], patches2: [] });
1587
+ const ge = s.get(oe);
1588
+ ge && ge.patches1.push(A);
1589
1589
  }
1590
1590
  }
1591
1591
  }
1592
- for (const w of A) {
1593
- const R = w.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
1592
+ for (const A of E) {
1593
+ const R = A.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
1594
1594
  if (R) {
1595
- const X = Number.parseInt(R[1], 10), ne = x.get(X);
1596
- if (ne !== void 0) {
1597
- const ae = `${v}#${ne}`;
1598
- s.has(ae) || s.set(ae, { patches1: [], patches2: [] });
1599
- const me = s.get(ae);
1600
- me && me.patches2.push(w);
1595
+ const X = Number.parseInt(R[1], 10), re = $.get(X);
1596
+ if (re !== void 0) {
1597
+ const oe = `${v}#${re}`;
1598
+ s.has(oe) || s.set(oe, { patches1: [], patches2: [] });
1599
+ const ge = s.get(oe);
1600
+ ge && ge.patches2.push(A);
1601
1601
  }
1602
1602
  }
1603
1603
  }
1604
1604
  continue;
1605
1605
  }
1606
1606
  }
1607
- const b = c.get(v) || [], j = a.get(v) || [];
1608
- for (const T of b) {
1609
- const F = T.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1610
- if (F) {
1611
- const M = F[1];
1607
+ const b = c.get(v) || [], D = a.get(v) || [];
1608
+ for (const L of b) {
1609
+ const U = L.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1610
+ if (U) {
1611
+ const M = U[1];
1612
1612
  s.has(M) || s.set(M, { patches1: [], patches2: [] });
1613
- const x = s.get(M);
1614
- x && x.patches1.push(T);
1613
+ const $ = s.get(M);
1614
+ $ && $.patches1.push(L);
1615
1615
  }
1616
1616
  }
1617
- for (const T of j) {
1618
- const F = T.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1619
- if (F) {
1620
- const M = F[1];
1617
+ for (const L of D) {
1618
+ const U = L.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1619
+ if (U) {
1620
+ const M = U[1];
1621
1621
  s.has(M) || s.set(M, { patches1: [], patches2: [] });
1622
- const x = s.get(M);
1623
- x && x.patches2.push(T);
1622
+ const $ = s.get(M);
1623
+ $ && $.patches2.push(L);
1624
1624
  }
1625
1625
  }
1626
1626
  }
@@ -1628,18 +1628,18 @@ function Mr(e, t, r, n, o, i) {
1628
1628
  if (!h) return null;
1629
1629
  const m = v.split("/").filter(Boolean);
1630
1630
  if (m.length < 2) return null;
1631
- const f = `/${m[0]}`, E = qe(h, f);
1632
- return E && Mt(E) ? f : null;
1633
- }, d = [...u], L = [...l], N = /* @__PURE__ */ new Set();
1631
+ const f = `/${m[0]}`, I = Xe(h, f);
1632
+ return I && Ht(I) ? f : null;
1633
+ }, d = [...u], _ = [...l], T = /* @__PURE__ */ new Set();
1634
1634
  for (const v of d) {
1635
1635
  const h = p(v.path, i);
1636
- h && N.add(h);
1636
+ h && T.add(h);
1637
1637
  }
1638
- for (const v of L) {
1638
+ for (const v of _) {
1639
1639
  const h = p(v.path, i);
1640
- h && N.add(h);
1640
+ h && T.add(h);
1641
1641
  }
1642
- for (const v of N)
1642
+ for (const v of T)
1643
1643
  s.has(v) || s.set(v, { patches1: [], patches2: [] });
1644
1644
  for (const v of d) {
1645
1645
  const h = v.path, m = p(h, i);
@@ -1652,7 +1652,7 @@ function Mr(e, t, r, n, o, i) {
1652
1652
  f && f.patches1.push(v);
1653
1653
  }
1654
1654
  }
1655
- for (const v of L) {
1655
+ for (const v of _) {
1656
1656
  const h = v.path, m = p(h, i);
1657
1657
  if (m) {
1658
1658
  const f = s.get(m);
@@ -1665,7 +1665,7 @@ function Mr(e, t, r, n, o, i) {
1665
1665
  }
1666
1666
  return s;
1667
1667
  }
1668
- function qe(e, t, r) {
1668
+ function Xe(e, t, r) {
1669
1669
  if (!e)
1670
1670
  return null;
1671
1671
  const n = t.split("/").filter(Boolean);
@@ -1674,12 +1674,12 @@ function qe(e, t, r) {
1674
1674
  let o = e, i = "";
1675
1675
  for (let s = 0; s < n.length; s++) {
1676
1676
  const c = n[s], a = Number.parseInt(c, 10), u = !Number.isNaN(a) && String(a) === c;
1677
- if (o && Mt(o)) {
1678
- const l = hn(o), y = ct(o), p = r ? W(r, i || "/") : void 0;
1677
+ if (o && Ht(o)) {
1678
+ const l = On(o), y = gt(o), p = r ? W(r, i || "/") : void 0;
1679
1679
  if (l && l.length > 0)
1680
1680
  if (p !== void 0)
1681
1681
  try {
1682
- const { schema: d } = at(p, l, y);
1682
+ const { schema: d } = mt(p, l, y);
1683
1683
  o = d;
1684
1684
  } catch {
1685
1685
  l.length > 0 && l[0] && (o = l[0]);
@@ -1707,7 +1707,7 @@ function qe(e, t, r) {
1707
1707
  }
1708
1708
  return o;
1709
1709
  }
1710
- function gn(e) {
1710
+ function An(e) {
1711
1711
  if (!e || typeof e != "object")
1712
1712
  return [];
1713
1713
  const t = [];
@@ -1727,12 +1727,12 @@ function gn(e) {
1727
1727
  }
1728
1728
  return t;
1729
1729
  }
1730
- function xr(e) {
1731
- const t = gn(e);
1730
+ function Jr(e) {
1731
+ const t = An(e);
1732
1732
  return t.length > 0 ? t[0] : null;
1733
1733
  }
1734
- function $r(e, t, r) {
1735
- const n = /* @__PURE__ */ new Map(), o = gn(r);
1734
+ function Hr(e, t, r) {
1735
+ const n = /* @__PURE__ */ new Map(), o = An(r);
1736
1736
  if (o.length === 0)
1737
1737
  return n;
1738
1738
  const i = (c) => {
@@ -1756,8 +1756,8 @@ function $r(e, t, r) {
1756
1756
  };
1757
1757
  return s(e, "input1"), s(t, "input2"), n;
1758
1758
  }
1759
- function Br(e, t, r, n) {
1760
- const o = /* @__PURE__ */ new Map(), i = xr(n);
1759
+ function Gr(e, t, r, n) {
1760
+ const o = /* @__PURE__ */ new Map(), i = Jr(n);
1761
1761
  if (!i)
1762
1762
  return o;
1763
1763
  const s = (c, a) => {
@@ -1775,23 +1775,23 @@ function Br(e, t, r, n) {
1775
1775
  };
1776
1776
  return s(e, "base"), s(t, "input1"), s(r, "input2"), o;
1777
1777
  }
1778
- function Fr(e, t, r, n) {
1779
- const o = typeof e == "object" && e !== null || Array.isArray(e) ? e : {}, i = typeof t == "object" && t !== null || Array.isArray(t) ? t : {}, s = typeof r == "object" && r !== null || Array.isArray(r) ? r : {}, c = We(o, i), a = We(o, s);
1780
- let u = Dr(c, a);
1781
- n && (u = Mr(c, a, e, t, r, n));
1782
- const l = [], y = /* @__PURE__ */ new Set(), p = (d, L, N, v) => {
1783
- if (!n || typeof L != "object" || L === null || Array.isArray(L) || typeof N != "object" || N === null || Array.isArray(N) || typeof v != "object" || v === null || Array.isArray(v)) return !1;
1784
- const h = qe(n, d, L);
1785
- if (!h || !Mt(h)) return !1;
1786
- const m = hn(h);
1778
+ function Wr(e, t, r, n) {
1779
+ const o = typeof e == "object" && e !== null || Array.isArray(e) ? e : {}, i = typeof t == "object" && t !== null || Array.isArray(t) ? t : {}, s = typeof r == "object" && r !== null || Array.isArray(r) ? r : {}, c = Ce(o, i), a = Ce(o, s);
1780
+ let u = Ur(c, a);
1781
+ n && (u = Vr(c, a, e, t, r, n));
1782
+ const l = [], y = /* @__PURE__ */ new Set(), p = (d, _, T, v) => {
1783
+ if (!n || typeof _ != "object" || _ === null || Array.isArray(_) || typeof T != "object" || T === null || Array.isArray(T) || typeof v != "object" || v === null || Array.isArray(v)) return !1;
1784
+ const h = Xe(n, d, _);
1785
+ if (!h || !Ht(h)) return !1;
1786
+ const m = On(h);
1787
1787
  if (!m || m.length < 2) return !1;
1788
- const f = at(L, m, ct(h)), E = at(N, m, ct(h)), S = at(v, m, ct(h));
1789
- return E.selectedIndex !== S.selectedIndex && (f.selectedIndex !== E.selectedIndex || f.selectedIndex !== S.selectedIndex);
1788
+ const f = mt(_, m, gt(h)), I = mt(T, m, gt(h)), S = mt(v, m, gt(h));
1789
+ return I.selectedIndex !== S.selectedIndex && (f.selectedIndex !== I.selectedIndex || f.selectedIndex !== S.selectedIndex);
1790
1790
  };
1791
- for (const [d, { patches1: L, patches2: N }] of u) {
1791
+ for (const [d, { patches1: _, patches2: T }] of u) {
1792
1792
  y.add(d);
1793
1793
  let v = d;
1794
- L.length > 0 ? v = L[0].path : N.length > 0 ? v = N[0].path : d.includes("#") && (v = d.split("#")[0]);
1794
+ _.length > 0 ? v = _[0].path : T.length > 0 ? v = T[0].path : d.includes("#") && (v = d.split("#")[0]);
1795
1795
  let h = d;
1796
1796
  if (d.includes("#"))
1797
1797
  h = d.split("#")[0];
@@ -1799,149 +1799,149 @@ function Fr(e, t, r, n) {
1799
1799
  const M = d.split("/").filter(Boolean);
1800
1800
  M.length > 1 && (h = `/${M[0]}`);
1801
1801
  }
1802
- if ([...L, ...N].every((M) => (M.path.split("/").slice(0, 2).join("/") || `/${M.path.split("/")[1]}`) === h) && h !== v) {
1803
- const M = W(e, h), x = W(t, h), V = W(r, h);
1804
- if (p(h, M, x, V)) {
1805
- const w = M, R = x, X = V;
1806
- let ne = kt(w, R, X);
1807
- !de(w, R) && !de(w, X) && !de(R, X) && (ne = D.TRUE_CONFLICT);
1808
- const ae = [...L, ...N].filter(
1809
- (Te) => Te.path.startsWith(`${h}/`) || Te.path === h
1810
- ), me = [], je = [];
1811
- for (const Te of ae) {
1812
- const C = Te.path, re = e !== void 0 ? W(e, C) : void 0, K = W(t, C), $ = W(r, C);
1813
- let fe = !1, Ie = !1;
1814
- Te.op === "replace" ? re !== void 0 && (fe = !de(re, K), Ie = !de(re, $)) : Te.op === "add" ? (fe = re === void 0 && K !== void 0, Ie = re === void 0 && $ !== void 0) : Te.op === "remove" && (fe = re !== void 0 && K === void 0, Ie = re !== void 0 && $ === void 0), re !== void 0 && (K !== void 0 && de(re, K) && (fe = !1), $ !== void 0 && de(re, $) && (Ie = !1)), fe && me.push(Te), Ie && je.push(Te);
1802
+ if ([..._, ...T].every((M) => (M.path.split("/").slice(0, 2).join("/") || `/${M.path.split("/")[1]}`) === h) && h !== v) {
1803
+ const M = W(e, h), $ = W(t, h), V = W(r, h);
1804
+ if (p(h, M, $, V)) {
1805
+ const A = M, R = $, X = V;
1806
+ let re = $t(A, R, X);
1807
+ !de(A, R) && !de(A, X) && !de(R, X) && (re = x.TRUE_CONFLICT);
1808
+ const oe = [..._, ...T].filter(
1809
+ (be) => be.path.startsWith(`${h}/`) || be.path === h
1810
+ ), ge = [], ke = [];
1811
+ for (const be of oe) {
1812
+ const at = be.path, Ne = e !== void 0 ? W(e, at) : void 0, Q = W(t, at), pe = W(r, at);
1813
+ let ee = !1, B = !1;
1814
+ be.op === "replace" ? Ne !== void 0 && (ee = !de(Ne, Q), B = !de(Ne, pe)) : be.op === "add" ? (ee = Ne === void 0 && Q !== void 0, B = Ne === void 0 && pe !== void 0) : be.op === "remove" && (ee = Ne !== void 0 && Q === void 0, B = Ne !== void 0 && pe === void 0), Ne !== void 0 && (Q !== void 0 && de(Ne, Q) && (ee = !1), pe !== void 0 && de(Ne, pe) && (B = !1)), ee && ge.push(be), B && ke.push(be);
1815
1815
  }
1816
1816
  l.push({
1817
1817
  path: h,
1818
- baseValue: w,
1818
+ baseValue: A,
1819
1819
  input1Value: R,
1820
1820
  input2Value: X,
1821
- conflictType: ne,
1822
- patches1: me,
1823
- patches2: je
1821
+ conflictType: re,
1822
+ patches1: ge,
1823
+ patches2: ke
1824
1824
  });
1825
1825
  continue;
1826
1826
  }
1827
1827
  }
1828
- const f = W(e, v), E = W(t, v), S = W(r, v);
1829
- let g = kt(f, E, S);
1830
- const b = f != null, j = E != null, T = S != null;
1831
- !b && j && T && g !== D.SAME_CHANGE && (g = D.TRUE_CONFLICT), b && de(f, E) && de(f, S) || l.push({
1828
+ const f = W(e, v), I = W(t, v), S = W(r, v);
1829
+ let g = $t(f, I, S);
1830
+ const b = f != null, D = I != null, L = S != null;
1831
+ !b && D && L && g !== x.SAME_CHANGE && (g = x.TRUE_CONFLICT), b && de(f, I) && de(f, S) || l.push({
1832
1832
  path: v,
1833
1833
  // Use representative path for conflict (actual patch paths are in patches1/patches2)
1834
1834
  baseValue: f,
1835
- input1Value: E,
1835
+ input1Value: I,
1836
1836
  input2Value: S,
1837
1837
  conflictType: g,
1838
- patches1: L,
1838
+ patches1: _,
1839
1839
  // JSON Patch operations for base?input1 (contain actual paths with indices)
1840
- patches2: N
1840
+ patches2: T
1841
1841
  // JSON Patch operations for base?input2 (contain actual paths with indices)
1842
1842
  });
1843
1843
  }
1844
1844
  return l;
1845
1845
  }
1846
- function Ur(e, t, r) {
1847
- var y, p, d, L;
1848
- const n = typeof e == "object" && e !== null || Array.isArray(e) ? e : {}, o = typeof t == "object" && t !== null || Array.isArray(t) ? t : {}, i = We(n, o);
1846
+ function qr(e, t, r) {
1847
+ var y, p, d, _;
1848
+ const n = typeof e == "object" && e !== null || Array.isArray(e) ? e : {}, o = typeof t == "object" && t !== null || Array.isArray(t) ? t : {}, i = Ce(n, o);
1849
1849
  if (i.length === 0)
1850
1850
  return [];
1851
1851
  const s = [], c = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), u = [];
1852
- for (const N of i) {
1853
- const v = N.path.match(/^(\/[^/]+(?:\/[^/]+)*)\/(\d+)(?:\/|$)/);
1852
+ for (const T of i) {
1853
+ const v = T.path.match(/^(\/[^/]+(?:\/[^/]+)*)\/(\d+)(?:\/|$)/);
1854
1854
  if (v) {
1855
1855
  const h = v[1];
1856
1856
  a.has(h) || a.set(h, []);
1857
1857
  const m = a.get(h);
1858
- m && m.push(N);
1858
+ m && m.push(T);
1859
1859
  } else
1860
- u.push(N);
1860
+ u.push(T);
1861
1861
  }
1862
- for (const [N, v] of a) {
1863
- const h = W(e, N), m = W(t, N);
1862
+ for (const [T, v] of a) {
1863
+ const h = W(e, T), m = W(t, T);
1864
1864
  if (!Array.isArray(h) || !Array.isArray(m)) {
1865
1865
  const g = /* @__PURE__ */ new Map();
1866
1866
  for (const b of v) {
1867
- const j = b.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1868
- if (j) {
1869
- const T = j[1];
1870
- g.has(T) || g.set(T, []), (y = g.get(T)) == null || y.push(b);
1867
+ const D = b.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1868
+ if (D) {
1869
+ const L = D[1];
1870
+ g.has(L) || g.set(L, []), (y = g.get(L)) == null || y.push(b);
1871
1871
  }
1872
1872
  }
1873
- for (const [b, j] of g)
1874
- s.push(...Ze(b, j, e, t, void 0)), c.add(b);
1873
+ for (const [b, D] of g)
1874
+ s.push(...rt(b, D, e, t, void 0)), c.add(b);
1875
1875
  continue;
1876
1876
  }
1877
- const f = r ? qe(r, N, e) : null, E = f != null && f.items ? Array.isArray(f.items) && f.items[0] ? f.items[0] : Array.isArray(f.items) ? null : f.items : null, S = E && typeof E == "object" ? E : null;
1877
+ const f = r ? Xe(r, T, e) : null, I = f != null && f.items ? Array.isArray(f.items) && f.items[0] ? f.items[0] : Array.isArray(f.items) ? null : f.items : null, S = I && typeof I == "object" ? I : null;
1878
1878
  if (S) {
1879
- const g = $r(h, m, S), b = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map();
1880
- for (const [x, V] of g.entries())
1881
- V.input1 !== void 0 && b.set(V.input1, x), V.input2 !== void 0 && j.set(V.input2, x);
1882
- const T = /* @__PURE__ */ new Map(), F = [];
1883
- for (const x of v) {
1884
- const V = x.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
1879
+ const g = Hr(h, m, S), b = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map();
1880
+ for (const [$, V] of g.entries())
1881
+ V.input1 !== void 0 && b.set(V.input1, $), V.input2 !== void 0 && D.set(V.input2, $);
1882
+ const L = /* @__PURE__ */ new Map(), U = [];
1883
+ for (const $ of v) {
1884
+ const V = $.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
1885
1885
  if (V) {
1886
- const A = Number.parseInt(V[1], 10);
1887
- let w;
1888
- if (x.op === "add" ? w = j.get(A) : w = b.get(A), w) {
1889
- T.has(w) || T.set(w, []);
1890
- const R = T.get(w);
1891
- R && R.push(x);
1886
+ const E = Number.parseInt(V[1], 10);
1887
+ let A;
1888
+ if ($.op === "add" ? A = D.get(E) : A = b.get(E), A) {
1889
+ L.has(A) || L.set(A, []);
1890
+ const R = L.get(A);
1891
+ R && R.push($);
1892
1892
  } else
1893
- F.push(x);
1893
+ U.push($);
1894
1894
  }
1895
1895
  }
1896
- for (const [x, V] of T) {
1897
- const A = g.get(x);
1898
- if (!A) continue;
1899
- const w = A.input1 !== void 0 ? `${N}/${A.input1}` : `${N}/${A.input2}`;
1900
- s.push(...Ze(w, V, e, t, void 0)), c.add(w);
1896
+ for (const [$, V] of L) {
1897
+ const E = g.get($);
1898
+ if (!E) continue;
1899
+ const A = E.input1 !== void 0 ? `${T}/${E.input1}` : `${T}/${E.input2}`;
1900
+ s.push(...rt(A, V, e, t, void 0)), c.add(A);
1901
1901
  }
1902
1902
  const M = /* @__PURE__ */ new Map();
1903
- for (const x of F) {
1904
- const V = x.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1903
+ for (const $ of U) {
1904
+ const V = $.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1905
1905
  if (V) {
1906
- const A = V[1];
1907
- M.has(A) || M.set(A, []), (p = M.get(A)) == null || p.push(x);
1906
+ const E = V[1];
1907
+ M.has(E) || M.set(E, []), (p = M.get(E)) == null || p.push($);
1908
1908
  }
1909
1909
  }
1910
- for (const [x, V] of M)
1911
- c.has(x) || (s.push(...Ze(x, V, e, t, void 0)), c.add(x));
1910
+ for (const [$, V] of M)
1911
+ c.has($) || (s.push(...rt($, V, e, t, void 0)), c.add($));
1912
1912
  } else {
1913
1913
  const g = /* @__PURE__ */ new Map();
1914
1914
  for (const b of v) {
1915
- const j = b.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1916
- if (j) {
1917
- const T = j[1];
1918
- g.has(T) || g.set(T, []), (d = g.get(T)) == null || d.push(b);
1915
+ const D = b.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
1916
+ if (D) {
1917
+ const L = D[1];
1918
+ g.has(L) || g.set(L, []), (d = g.get(L)) == null || d.push(b);
1919
1919
  }
1920
1920
  }
1921
- for (const [b, j] of g)
1922
- s.push(...Ze(b, j, e, t, void 0)), c.add(b);
1921
+ for (const [b, D] of g)
1922
+ s.push(...rt(b, D, e, t, void 0)), c.add(b);
1923
1923
  }
1924
1924
  }
1925
1925
  const l = /* @__PURE__ */ new Map();
1926
- for (const N of u) {
1927
- const v = N.path.split("/").filter(Boolean), h = v.length > 0 ? `/${v[0]}` : "/";
1928
- l.has(h) || l.set(h, []), (L = l.get(h)) == null || L.push(N);
1926
+ for (const T of u) {
1927
+ const v = T.path.split("/").filter(Boolean), h = v.length > 0 ? `/${v[0]}` : "/";
1928
+ l.has(h) || l.set(h, []), (_ = l.get(h)) == null || _.push(T);
1929
1929
  }
1930
- for (const [N, v] of l)
1931
- s.push(...Ze(N, v, e, t, void 0));
1930
+ for (const [T, v] of l)
1931
+ s.push(...rt(T, v, e, t, void 0));
1932
1932
  return s;
1933
1933
  }
1934
- function Ze(e, t, r, n, o) {
1934
+ function rt(e, t, r, n, o) {
1935
1935
  const i = o !== void 0 ? W(o, e) : void 0, s = W(r, e), c = W(n, e), a = [], u = [];
1936
1936
  for (const f of t) {
1937
- const E = f.path, S = W(r, E), g = W(n, E);
1938
- let b = !1, j = !1;
1939
- f.op === "add" ? (b = !1, j = g !== void 0) : f.op === "remove" ? (b = S !== void 0, j = !1) : f.op === "replace" && (b = S !== void 0 && !de(S, g), j = g !== void 0 && !de(S, g)), E === e && (b = !0, j = !0), b && a.push(f), j && u.push(f);
1937
+ const I = f.path, S = W(r, I), g = W(n, I);
1938
+ let b = !1, D = !1;
1939
+ f.op === "add" ? (b = !1, D = g !== void 0) : f.op === "remove" ? (b = S !== void 0, D = !1) : f.op === "replace" && (b = S !== void 0 && !de(S, g), D = g !== void 0 && !de(S, g)), I === e && (b = !0, D = !0), b && a.push(f), D && u.push(f);
1940
1940
  }
1941
1941
  if (a.length === 0 && u.length === 0 && i !== void 0 && s !== void 0 && c !== void 0 && de(i, s) && de(i, c))
1942
1942
  return [];
1943
- const l = a.length > 0 ? a : t, y = u.length > 0 ? u : t, p = [...l, ...y], d = p.some((f) => f.op === "add"), L = p.some((f) => f.op === "remove"), N = p.some((f) => f.op === "replace");
1944
- if (d && !N && !L) {
1943
+ const l = a.length > 0 ? a : t, y = u.length > 0 ? u : t, p = [...l, ...y], d = p.some((f) => f.op === "add"), _ = p.some((f) => f.op === "remove"), T = p.some((f) => f.op === "replace");
1944
+ if (d && !T && !_) {
1945
1945
  if (s !== void 0 && c === void 0)
1946
1946
  return [
1947
1947
  {
@@ -1949,7 +1949,7 @@ function Ze(e, t, r, n, o) {
1949
1949
  baseValue: void 0,
1950
1950
  input1Value: s,
1951
1951
  input2Value: void 0,
1952
- conflictType: D.INPUT1_ONLY,
1952
+ conflictType: x.INPUT1_ONLY,
1953
1953
  patches1: l,
1954
1954
  // Highlight on input1 (new content) - use filtered patches1
1955
1955
  patches2: []
@@ -1963,7 +1963,7 @@ function Ze(e, t, r, n, o) {
1963
1963
  baseValue: void 0,
1964
1964
  input1Value: void 0,
1965
1965
  input2Value: c,
1966
- conflictType: D.INPUT2_ONLY,
1966
+ conflictType: x.INPUT2_ONLY,
1967
1967
  patches1: [],
1968
1968
  // No highlighting on input1 (doesn't exist there)
1969
1969
  patches2: y
@@ -1971,7 +1971,7 @@ function Ze(e, t, r, n, o) {
1971
1971
  }
1972
1972
  ];
1973
1973
  }
1974
- if (L && !d && !N) {
1974
+ if (_ && !d && !T) {
1975
1975
  if (s !== void 0 && c === void 0)
1976
1976
  return [
1977
1977
  {
@@ -1979,7 +1979,7 @@ function Ze(e, t, r, n, o) {
1979
1979
  baseValue: s,
1980
1980
  input1Value: s,
1981
1981
  input2Value: void 0,
1982
- conflictType: D.INPUT1_ONLY,
1982
+ conflictType: x.INPUT1_ONLY,
1983
1983
  patches1: l,
1984
1984
  // Highlight on input1 (removed content) - use filtered patches1
1985
1985
  patches2: []
@@ -1993,7 +1993,7 @@ function Ze(e, t, r, n, o) {
1993
1993
  baseValue: c,
1994
1994
  input1Value: void 0,
1995
1995
  input2Value: c,
1996
- conflictType: D.INPUT2_ONLY,
1996
+ conflictType: x.INPUT2_ONLY,
1997
1997
  patches1: [],
1998
1998
  // No highlighting on input1 (doesn't exist there)
1999
1999
  patches2: y
@@ -2001,19 +2001,19 @@ function Ze(e, t, r, n, o) {
2001
2001
  }
2002
2002
  ];
2003
2003
  }
2004
- const v = kt(i, s, c);
2004
+ const v = $t(i, s, c);
2005
2005
  let h = [], m = [];
2006
2006
  switch (v) {
2007
- case D.INPUT1_ONLY:
2007
+ case x.INPUT1_ONLY:
2008
2008
  h = l, m = [];
2009
2009
  break;
2010
- case D.INPUT2_ONLY:
2010
+ case x.INPUT2_ONLY:
2011
2011
  h = [], m = y;
2012
2012
  break;
2013
- case D.SAME_CHANGE:
2013
+ case x.SAME_CHANGE:
2014
2014
  h = l, m = y;
2015
2015
  break;
2016
- case D.TRUE_CONFLICT:
2016
+ case x.TRUE_CONFLICT:
2017
2017
  h = l, m = y;
2018
2018
  break;
2019
2019
  }
@@ -2029,66 +2029,66 @@ function Ze(e, t, r, n, o) {
2029
2029
  }
2030
2030
  ];
2031
2031
  }
2032
- function At(e, t) {
2032
+ function _t(e, t) {
2033
2033
  if (!t || t.length === 0)
2034
2034
  return { start: 1, end: 1 };
2035
2035
  let r = Number.MAX_SAFE_INTEGER, n = 0, o = !1;
2036
2036
  for (const i of t) {
2037
- const s = Pe(e, i.path);
2037
+ const s = De(e, i.path);
2038
2038
  s.start === 1 && s.end === 1 || (r = Math.min(r, s.start), n = Math.max(n, s.end), o = !0);
2039
2039
  }
2040
2040
  return !o || r === Number.MAX_SAFE_INTEGER || n === 0 ? { start: 1, end: 1 } : { start: r, end: n };
2041
2041
  }
2042
- function Vr(e, t, r, n) {
2042
+ function Yr(e, t, r, n) {
2043
2043
  var i, s, c, a, u, l;
2044
2044
  const o = [];
2045
2045
  for (let y = 0; y < e.length; y++) {
2046
2046
  const p = e[y];
2047
- let d, L, N;
2048
- (((i = p.patches1) == null ? void 0 : i.length) ?? 0) === 0 && (((s = p.patches2) == null ? void 0 : s.length) ?? 0) === 0 ? (d = t ? Pe(t, p.path) : { start: 1, end: 1 }, L = Pe(r, p.path), N = Pe(n, p.path)) : (d = At(t, [...p.patches1 || [], ...p.patches2 || []]), L = At(r, p.patches1 || []), N = At(n, p.patches2 || []));
2049
- const v = p.conflictType === D.TRUE_CONFLICT;
2050
- let h = te.excluded, m = te.excluded;
2047
+ let d, _, T;
2048
+ (((i = p.patches1) == null ? void 0 : i.length) ?? 0) === 0 && (((s = p.patches2) == null ? void 0 : s.length) ?? 0) === 0 ? (d = t ? De(t, p.path) : { start: 1, end: 1 }, _ = De(r, p.path), T = De(n, p.path)) : (d = _t(t, [...p.patches1 || [], ...p.patches2 || []]), _ = _t(r, p.patches1 || []), T = _t(n, p.patches2 || []));
2049
+ const v = p.conflictType === x.TRUE_CONFLICT;
2050
+ let h = ne.excluded, m = ne.excluded;
2051
2051
  switch (p.conflictType) {
2052
- case D.SAME_CHANGE:
2053
- h = te.first, m = te.first;
2052
+ case x.SAME_CHANGE:
2053
+ h = ne.first, m = ne.first;
2054
2054
  break;
2055
- case D.INPUT1_ONLY:
2056
- h = te.first;
2055
+ case x.INPUT1_ONLY:
2056
+ h = ne.first;
2057
2057
  break;
2058
- case D.INPUT2_ONLY:
2059
- m = te.first;
2058
+ case x.INPUT2_ONLY:
2059
+ m = ne.first;
2060
2060
  break;
2061
- case D.TRUE_CONFLICT:
2062
- m = te.first;
2061
+ case x.TRUE_CONFLICT:
2062
+ m = ne.first;
2063
2063
  break;
2064
2064
  }
2065
- const f = [], E = [];
2065
+ const f = [], I = [];
2066
2066
  if (p.patches1 && (p.patches1.length ?? 0) > 0)
2067
2067
  for (const g of p.patches1) {
2068
2068
  const b = !t || t.trim() === "";
2069
2069
  if (g.op === "remove" && !b)
2070
2070
  continue;
2071
- const j = Pe(r, g.path);
2072
- if (j.start !== 1 || j.end !== 1)
2073
- for (let T = j.start; T <= j.end; T++)
2074
- f.push({ line: T });
2071
+ const D = De(r, g.path);
2072
+ if (D.start !== 1 || D.end !== 1)
2073
+ for (let L = D.start; L <= D.end; L++)
2074
+ f.push({ line: L });
2075
2075
  }
2076
2076
  else if ((((c = p.patches1) == null ? void 0 : c.length) ?? 0) === 0 && (((a = p.patches2) == null ? void 0 : a.length) ?? 0) === 0) {
2077
- const g = Pe(r, p.path);
2077
+ const g = De(r, p.path);
2078
2078
  (g.start !== 1 || g.end !== 1) && f.push({ line: g.start });
2079
2079
  }
2080
2080
  if (p.patches2 && (p.patches2.length ?? 0) > 0)
2081
2081
  for (const g of p.patches2) {
2082
2082
  if (g.op === "remove")
2083
2083
  continue;
2084
- const b = Pe(n, g.path);
2084
+ const b = De(n, g.path);
2085
2085
  if (b.start !== 1 || b.end !== 1)
2086
- for (let j = b.start; j <= b.end; j++)
2087
- E.push({ line: j });
2086
+ for (let D = b.start; D <= b.end; D++)
2087
+ I.push({ line: D });
2088
2088
  }
2089
2089
  else if ((((u = p.patches1) == null ? void 0 : u.length) ?? 0) === 0 && (((l = p.patches2) == null ? void 0 : l.length) ?? 0) === 0) {
2090
- const g = Pe(n, p.path);
2091
- (g.start !== 1 || g.end !== 1) && E.push({ line: g.start });
2090
+ const g = De(n, p.path);
2091
+ (g.start !== 1 || g.end !== 1) && I.push({ line: g.start });
2092
2092
  }
2093
2093
  const S = {
2094
2094
  id: `conflict-${y}`,
@@ -2099,27 +2099,27 @@ function Vr(e, t, r, n) {
2099
2099
  endLineNumberExclusive: d.end + 1
2100
2100
  },
2101
2101
  input1Range: {
2102
- startLineNumber: L.start,
2103
- endLineNumberExclusive: L.end + 1
2102
+ startLineNumber: _.start,
2103
+ endLineNumberExclusive: _.end + 1
2104
2104
  },
2105
2105
  input2Range: {
2106
- startLineNumber: N.start,
2107
- endLineNumberExclusive: N.end + 1
2106
+ startLineNumber: T.start,
2107
+ endLineNumberExclusive: T.end + 1
2108
2108
  },
2109
2109
  input1Diffs: f,
2110
- input2Diffs: E,
2110
+ input2Diffs: I,
2111
2111
  isConflicting: v,
2112
2112
  conflictType: p.conflictType,
2113
2113
  input1State: h,
2114
2114
  input2State: m,
2115
- handled: p.conflictType === D.SAME_CHANGE,
2115
+ handled: p.conflictType === x.SAME_CHANGE,
2116
2116
  focused: !1
2117
2117
  };
2118
2118
  o.push(S);
2119
2119
  }
2120
2120
  return o;
2121
2121
  }
2122
- function Jr(e, t, r, n = {}) {
2122
+ function zr(e, t, r, n = {}) {
2123
2123
  const { comparisonMode: o = "split", schema: i } = n;
2124
2124
  if (!t || !r)
2125
2125
  throw new Error("JSON Patch diff requires non-empty input1 and input2 strings");
@@ -2127,50 +2127,50 @@ function Jr(e, t, r, n = {}) {
2127
2127
  const s = e ? JSON.parse(e) : void 0, c = JSON.parse(t), a = JSON.parse(r);
2128
2128
  let u;
2129
2129
  if (s === void 0)
2130
- u = Ur(c, a, i);
2130
+ u = qr(c, a, i);
2131
2131
  else if (o === "split")
2132
- u = Fr(s, c, a, i);
2132
+ u = Wr(s, c, a, i);
2133
2133
  else {
2134
- const l = We(s, c), y = We(c, a), p = /* @__PURE__ */ new Set();
2134
+ const l = Ce(s, c), y = Ce(c, a), p = /* @__PURE__ */ new Set();
2135
2135
  l.forEach((d) => {
2136
2136
  p.add(d.path);
2137
2137
  }), y.forEach((d) => {
2138
2138
  p.add(d.path);
2139
2139
  }), u = Array.from(p).map((d) => {
2140
- const L = W(s, d), N = W(c, d), v = W(a, d), h = !de(L, N), m = !de(N, v);
2140
+ const _ = W(s, d), T = W(c, d), v = W(a, d), h = !de(_, T), m = !de(T, v);
2141
2141
  let f;
2142
- return h && m ? f = D.TRUE_CONFLICT : h ? f = D.INPUT1_ONLY : m ? f = D.INPUT2_ONLY : f = D.SAME_CHANGE, {
2142
+ return h && m ? f = x.TRUE_CONFLICT : h ? f = x.INPUT1_ONLY : m ? f = x.INPUT2_ONLY : f = x.SAME_CHANGE, {
2143
2143
  path: d,
2144
- baseValue: L,
2145
- input1Value: N,
2144
+ baseValue: _,
2145
+ input1Value: T,
2146
2146
  input2Value: v,
2147
2147
  conflictType: f
2148
2148
  };
2149
2149
  });
2150
2150
  }
2151
- return Vr(u, e, t, r);
2151
+ return Yr(u, e, t, r);
2152
2152
  } catch (s) {
2153
2153
  const c = s instanceof Error ? s.message : String(s);
2154
2154
  throw new Error(`JSON Patch diff computation failed: ${c}`);
2155
2155
  }
2156
2156
  }
2157
- function Hr(e, t, r) {
2157
+ function Cr(e, t, r) {
2158
2158
  const n = e !== t, o = e !== r;
2159
2159
  let i;
2160
- return n && o ? t === r ? i = D.SAME_CHANGE : i = D.TRUE_CONFLICT : n ? i = D.INPUT1_ONLY : i = D.INPUT2_ONLY, { conflictType: i, input1Changed: n, input2Changed: o };
2160
+ return n && o ? t === r ? i = x.SAME_CHANGE : i = x.TRUE_CONFLICT : n ? i = x.INPUT1_ONLY : i = x.INPUT2_ONLY, { conflictType: i, input1Changed: n, input2Changed: o };
2161
2161
  }
2162
- function no(e, t, r) {
2162
+ function uo(e, t, r) {
2163
2163
  var u, l, y;
2164
2164
  const n = [], o = [];
2165
2165
  for (let p = 0; p < Math.max(e.length, t.length, r.length); p++) {
2166
- const d = e[p] !== void 0 ? e[p] : "", L = t[p] !== void 0 ? t[p] : "", N = r[p] !== void 0 ? r[p] : "", { conflictType: v, input1Changed: h, input2Changed: m } = Hr(d, L, N);
2166
+ const d = e[p] !== void 0 ? e[p] : "", _ = t[p] !== void 0 ? t[p] : "", T = r[p] !== void 0 ? r[p] : "", { conflictType: v, input1Changed: h, input2Changed: m } = Cr(d, _, T);
2167
2167
  (h || m) && o.push({
2168
2168
  line: p + 1,
2169
2169
  input1Changed: h,
2170
2170
  input2Changed: m,
2171
2171
  baseLine: d,
2172
- input1Line: L,
2173
- input2Line: N,
2172
+ input1Line: _,
2173
+ input2Line: T,
2174
2174
  conflictType: v
2175
2175
  });
2176
2176
  }
@@ -2178,9 +2178,9 @@ function no(e, t, r) {
2178
2178
  return [];
2179
2179
  let i = ((u = o[0]) == null ? void 0 : u.line) ?? 1, s = (l = o[0]) == null ? void 0 : l.conflictType, c = [], a = [];
2180
2180
  for (let p = 0; p <= o.length; p++) {
2181
- const d = o[p], L = p === o.length, N = !L && d && o[p - 1] && d.line > (((y = o[p - 1]) == null ? void 0 : y.line) ?? 0) + 1, v = !L && d && d.conflictType !== s;
2182
- if (L || N || v) {
2183
- const h = o[p - 1], m = h ? h.line + 1 : i + 1, f = c.length > 0, E = a.length > 0, S = s === D.TRUE_CONFLICT, g = {
2181
+ const d = o[p], _ = p === o.length, T = !_ && d && o[p - 1] && d.line > (((y = o[p - 1]) == null ? void 0 : y.line) ?? 0) + 1, v = !_ && d && d.conflictType !== s;
2182
+ if (_ || T || v) {
2183
+ const h = o[p - 1], m = h ? h.line + 1 : i + 1, f = c.length > 0, I = a.length > 0, S = s === x.TRUE_CONFLICT, g = {
2184
2184
  id: `conflict-${n.length}`,
2185
2185
  baseRange: {
2186
2186
  startLineNumber: i,
@@ -2199,18 +2199,18 @@ function no(e, t, r) {
2199
2199
  isConflicting: S,
2200
2200
  conflictType: s,
2201
2201
  // Default: accept input2 (ours) by default, or both if same change
2202
- input1State: s === D.SAME_CHANGE && f ? te.first : te.excluded,
2203
- input2State: E ? te.first : te.excluded,
2204
- handled: s === D.SAME_CHANGE,
2202
+ input1State: s === x.SAME_CHANGE && f ? ne.first : ne.excluded,
2203
+ input2State: I ? ne.first : ne.excluded,
2204
+ handled: s === x.SAME_CHANGE,
2205
2205
  focused: !1
2206
2206
  };
2207
- n.push(g), !L && d && (i = d.line, s = d.conflictType, c = [], a = []);
2207
+ n.push(g), !_ && d && (i = d.line, s = d.conflictType, c = [], a = []);
2208
2208
  }
2209
- !L && d && (d.input1Changed && c.push({ line: d.line }), d.input2Changed && a.push({ line: d.line }));
2209
+ !_ && d && (d.input1Changed && c.push({ line: d.line }), d.input2Changed && a.push({ line: d.line }));
2210
2210
  }
2211
2211
  return n;
2212
2212
  }
2213
- function Gr(e, t, r) {
2213
+ function Xr(e, t, r) {
2214
2214
  if (!t || t === "/") {
2215
2215
  if (typeof e == "object" && e !== null && !Array.isArray(e) && typeof r == "object" && r !== null && !Array.isArray(r)) {
2216
2216
  Object.assign(e, r);
@@ -2244,14 +2244,14 @@ function Gr(e, t, r) {
2244
2244
  o[i] = r;
2245
2245
  }
2246
2246
  }
2247
- function Wr(e, t) {
2247
+ function Qr(e, t) {
2248
2248
  try {
2249
- const r = ln(e);
2249
+ const r = mn(e);
2250
2250
  if (!r) return null;
2251
2251
  const n = t.split("/").filter((l) => l !== "").map((l) => {
2252
2252
  const y = Number.parseInt(l, 10);
2253
2253
  return !Number.isNaN(y) && String(y) === l ? y : l;
2254
- }), o = un(r, n);
2254
+ }), o = yn(r, n);
2255
2255
  if (!o) return null;
2256
2256
  const s = e.substring(0, o.offset).split(`
2257
2257
  `).length, c = o.offset + o.length, u = e.substring(0, c).split(`
@@ -2261,15 +2261,15 @@ function Wr(e, t) {
2261
2261
  return null;
2262
2262
  }
2263
2263
  }
2264
- function mn(e, t, r, n = "") {
2264
+ function Nn(e, t, r, n = "") {
2265
2265
  if (JSON.stringify(e) === JSON.stringify(t))
2266
2266
  return e;
2267
2267
  if (e !== null && t !== null && typeof e == "object" && typeof t == "object" && !Array.isArray(e) && !Array.isArray(t)) {
2268
- const o = e, i = t, s = { ...o }, c = r ? qe(r, n, e) : null, a = c != null && c.properties && typeof c.properties == "object" && !Array.isArray(c.properties) ? c.properties : void 0, u = c == null ? void 0 : c.additionalProperties;
2268
+ const o = e, i = t, s = { ...o }, c = r ? Xe(r, n, e) : null, a = c != null && c.properties && typeof c.properties == "object" && !Array.isArray(c.properties) ? c.properties : void 0, u = c == null ? void 0 : c.additionalProperties;
2269
2269
  for (const l of Object.keys(i))
2270
2270
  if (l in s) {
2271
2271
  if (JSON.stringify(s[l]) !== JSON.stringify(i[l])) {
2272
- const y = a == null ? void 0 : a[l], p = n ? `${n}/${l}` : `/${l}`, d = mn(s[l], i[l], y, p);
2272
+ const y = a == null ? void 0 : a[l], p = n ? `${n}/${l}` : `/${l}`, d = Nn(s[l], i[l], y, p);
2273
2273
  if (d !== null)
2274
2274
  s[l] = d;
2275
2275
  else
@@ -2289,7 +2289,7 @@ function mn(e, t, r, n = "") {
2289
2289
  }
2290
2290
  return null;
2291
2291
  }
2292
- function qr(e, t, r, n, o) {
2292
+ function Zr(e, t, r, n, o) {
2293
2293
  var S;
2294
2294
  const i = [], s = [], c = e.join(`
2295
2295
  `), a = t.join(`
@@ -2308,118 +2308,118 @@ function qr(e, t, r, n, o) {
2308
2308
  }
2309
2309
  let d;
2310
2310
  !l || typeof l == "object" && l !== null && Object.keys(l).length === 0 ? d = JSON.parse(JSON.stringify(p)) : d = JSON.parse(JSON.stringify(l));
2311
- const L = /* @__PURE__ */ new Set(), N = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Set(), h = (g, b, j) => null;
2311
+ const _ = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Set(), h = (g, b, D) => null;
2312
2312
  for (const g of n) {
2313
- const b = g.input1State === te.first || g.input1State === te.second, j = g.input2State === te.first || g.input2State === te.second;
2314
- let T = g.path;
2315
- if (!T && (T = h(g.baseRange.startLineNumber, g.baseRange.endLineNumberExclusive) || void 0, !T)) {
2316
- g.conflictType === D.INPUT2_ONLY && j ? d = JSON.parse(JSON.stringify(p)) : g.conflictType === D.INPUT1_ONLY && b ? d = JSON.parse(JSON.stringify(y)) : g.conflictType === D.SAME_CHANGE && (b || j) || j ? d = JSON.parse(JSON.stringify(p)) : b && (d = JSON.parse(JSON.stringify(y)));
2313
+ const b = g.input1State === ne.first || g.input1State === ne.second, D = g.input2State === ne.first || g.input2State === ne.second;
2314
+ let L = g.path;
2315
+ if (!L && (L = h(g.baseRange.startLineNumber, g.baseRange.endLineNumberExclusive) || void 0, !L)) {
2316
+ g.conflictType === x.INPUT2_ONLY && D ? d = JSON.parse(JSON.stringify(p)) : g.conflictType === x.INPUT1_ONLY && b ? d = JSON.parse(JSON.stringify(y)) : g.conflictType === x.SAME_CHANGE && (b || D) || D ? d = JSON.parse(JSON.stringify(p)) : b && (d = JSON.parse(JSON.stringify(y)));
2317
2317
  continue;
2318
2318
  }
2319
2319
  try {
2320
- let F, M = T;
2321
- const x = (S = g.path) == null ? void 0 : S.match(/^(.*\/\d+)(?:\/.*)?$/);
2322
- let V = !1, A = "";
2323
- if (x) {
2324
- const R = x[1].split("/").filter((X) => X !== "");
2320
+ let U, M = L;
2321
+ const $ = (S = g.path) == null ? void 0 : S.match(/^(.*\/\d+)(?:\/.*)?$/);
2322
+ let V = !1, E = "";
2323
+ if ($) {
2324
+ const R = $[1].split("/").filter((X) => X !== "");
2325
2325
  if (R.length >= 2) {
2326
2326
  const X = R[R.length - 1];
2327
- /^\d+$/.test(X) && (V = !0, A = `/${R.slice(0, -1).join("/")}`);
2327
+ /^\d+$/.test(X) && (V = !0, E = `/${R.slice(0, -1).join("/")}`);
2328
2328
  }
2329
2329
  }
2330
- if (b && j)
2331
- if (g.conflictType === D.SAME_CHANGE)
2332
- V ? (F = W(p, A), M = A) : F = W(p, T);
2330
+ if (b && D)
2331
+ if (g.conflictType === x.SAME_CHANGE)
2332
+ V ? (U = W(p, E), M = E) : U = W(p, L);
2333
2333
  else {
2334
- const w = V ? A : T, R = W(y, w), X = W(p, w), ne = o && l && typeof l == "object" && qe(o, w, l) || void 0, ae = mn(R, X, ne, w);
2335
- ae !== null ? (F = ae, M = w, i.push(`Smart-merged conflict at path ${w}`)) : (F = X, M = w, i.push(`Merge failed at path ${w}, using input2 value`));
2334
+ const A = V ? E : L, R = W(y, A), X = W(p, A), re = o && l && typeof l == "object" && Xe(o, A, l) || void 0, oe = Nn(R, X, re, A);
2335
+ oe !== null ? (U = oe, M = A, i.push(`Smart-merged conflict at path ${A}`)) : (U = X, M = A, i.push(`Merge failed at path ${A}, using input2 value`));
2336
2336
  }
2337
2337
  else if (b)
2338
2338
  if (V)
2339
- F = W(y, A), M = A;
2339
+ U = W(y, E), M = E;
2340
2340
  else {
2341
- const w = T.split("/").filter(Boolean);
2342
- if (w.length > 1) {
2343
- const R = `/${w.slice(0, -1).join("/")}`;
2341
+ const A = L.split("/").filter(Boolean);
2342
+ if (A.length > 1) {
2343
+ const R = `/${A.slice(0, -1).join("/")}`;
2344
2344
  if (!v.has(R)) {
2345
2345
  const X = W(y, R);
2346
2346
  if (typeof X == "object" && X !== null && !Array.isArray(X)) {
2347
- const ne = W(d, R);
2348
- if (typeof ne == "object" && ne !== null && !Array.isArray(ne)) {
2349
- for (const [ae, me] of Object.entries(X)) {
2350
- const je = `${R}/${ae}`;
2351
- N.has(je) || (ne[ae] = me);
2347
+ const re = W(d, R);
2348
+ if (typeof re == "object" && re !== null && !Array.isArray(re)) {
2349
+ for (const [oe, ge] of Object.entries(X)) {
2350
+ const ke = `${R}/${oe}`;
2351
+ T.has(ke) || (re[oe] = ge);
2352
2352
  }
2353
2353
  v.add(R);
2354
2354
  }
2355
2355
  }
2356
2356
  }
2357
- F = W(y, T);
2357
+ U = W(y, L);
2358
2358
  } else
2359
- F = W(y, T);
2359
+ U = W(y, L);
2360
2360
  }
2361
- else if (j)
2361
+ else if (D)
2362
2362
  if (V)
2363
- F = W(p, A), M = A;
2363
+ U = W(p, E), M = E;
2364
2364
  else {
2365
- const w = T.split("/").filter(Boolean);
2366
- if (w.length > 1) {
2367
- const R = `/${w.slice(0, -1).join("/")}`;
2365
+ const A = L.split("/").filter(Boolean);
2366
+ if (A.length > 1) {
2367
+ const R = `/${A.slice(0, -1).join("/")}`;
2368
2368
  if (!v.has(R)) {
2369
2369
  const X = W(p, R);
2370
2370
  if (typeof X == "object" && X !== null && !Array.isArray(X)) {
2371
- const ne = W(d, R);
2372
- if (typeof ne == "object" && ne !== null && !Array.isArray(ne)) {
2373
- for (const [ae, me] of Object.entries(X)) {
2374
- const je = `${R}/${ae}`;
2375
- N.has(je) || (ne[ae] = me);
2371
+ const re = W(d, R);
2372
+ if (typeof re == "object" && re !== null && !Array.isArray(re)) {
2373
+ for (const [oe, ge] of Object.entries(X)) {
2374
+ const ke = `${R}/${oe}`;
2375
+ T.has(ke) || (re[oe] = ge);
2376
2376
  }
2377
2377
  v.add(R);
2378
2378
  }
2379
2379
  }
2380
2380
  }
2381
- F = W(p, T);
2381
+ U = W(p, L);
2382
2382
  } else
2383
- F = W(p, T);
2383
+ U = W(p, L);
2384
2384
  }
2385
2385
  else {
2386
- const w = V ? A : T, R = W(l, w);
2386
+ const A = V ? E : L, R = W(l, A);
2387
2387
  if (R !== void 0)
2388
- F = R, M = w;
2388
+ U = R, M = A;
2389
2389
  else
2390
2390
  continue;
2391
2391
  }
2392
- F !== void 0 && (Gr(d, M, F), L.add(M), N.add(M));
2393
- } catch (F) {
2394
- i.push(`Failed to apply conflict at path ${T || g.id}: ${F instanceof Error ? F.message : String(F)}`);
2392
+ U !== void 0 && (Xr(d, M, U), _.add(M), T.add(M));
2393
+ } catch (U) {
2394
+ i.push(`Failed to apply conflict at path ${L || g.id}: ${U instanceof Error ? U.message : String(U)}`);
2395
2395
  }
2396
2396
  }
2397
2397
  const m = JSON.stringify(d, null, 2);
2398
2398
  for (const g of n) {
2399
2399
  const b = g.path;
2400
2400
  if (!b) continue;
2401
- const j = g.input1State === te.first || g.input1State === te.second, T = g.input2State === te.first || g.input2State === te.second;
2402
- if (j && T && g.conflictType === D.TRUE_CONFLICT) {
2403
- const F = Wr(m, b);
2404
- F && s.push({
2401
+ const D = g.input1State === ne.first || g.input1State === ne.second, L = g.input2State === ne.first || g.input2State === ne.second;
2402
+ if (D && L && g.conflictType === x.TRUE_CONFLICT) {
2403
+ const U = Qr(m, b);
2404
+ U && s.push({
2405
2405
  conflictId: g.id,
2406
2406
  conflictPath: b,
2407
2407
  type: "warning",
2408
2408
  message: "Both conflicting changes were accepted - please review and manually resolve",
2409
- startLine: F.startLine,
2410
- endLine: F.endLine
2409
+ startLine: U.startLine,
2410
+ endLine: U.endLine
2411
2411
  });
2412
2412
  }
2413
2413
  }
2414
- let f = !0, E;
2414
+ let f = !0, I;
2415
2415
  try {
2416
2416
  JSON.parse(m);
2417
2417
  } catch (g) {
2418
- f = !1, E = g instanceof Error ? g.message : "Invalid JSON", s.push({
2418
+ f = !1, I = g instanceof Error ? g.message : "Invalid JSON", s.push({
2419
2419
  conflictId: "validation-error",
2420
2420
  conflictPath: "/",
2421
2421
  type: "error",
2422
- message: E,
2422
+ message: I,
2423
2423
  startLine: 1,
2424
2424
  endLine: m.split(`
2425
2425
  `).length
@@ -2428,27 +2428,27 @@ function qr(e, t, r, n, o) {
2428
2428
  return {
2429
2429
  content: m,
2430
2430
  isValid: f,
2431
- validationError: E,
2431
+ validationError: I,
2432
2432
  warnings: i.length > 0 ? i : void 0,
2433
2433
  conflictIssues: s.length > 0 ? s : void 0
2434
2434
  };
2435
2435
  }
2436
- function Yr(e, t, r) {
2436
+ function Kr(e, t, r) {
2437
2437
  let n = "", o = "", i = "", s = "", c = "", a = "", u = "", l = "";
2438
2438
  switch (e.conflictType) {
2439
- case D.SAME_CHANGE: {
2439
+ case x.SAME_CHANGE: {
2440
2440
  const y = e.baseRange.startLineNumber === 1 && e.baseRange.endLineNumberExclusive === 2 && // Default "not found" range
2441
2441
  e.input1Range.startLineNumber !== 1 && e.input2Range.startLineNumber !== 1;
2442
2442
  t ? y ? (n = "merge-2way-deletion", o = "merge-same-change", s = r.baseOverviewColor, c = r.changeOverviewColor, a = "", u = "-", l = "+") : (n = "merge-2way-deletion", o = "merge-same-change", i = "merge-change-base", s = r.baseOverviewColor, c = r.changeOverviewColor, a = "", u = "-", l = "") : y ? (n = "merge-same-change", o = "merge-same-change", i = "", s = r.changeOverviewColor, c = r.changeOverviewColor, a = "", u = "+", l = "+") : (n = "merge-change-incoming", o = "merge-same-change", i = "merge-change-base", s = r.changeOverviewColor, c = r.changeOverviewColor, a = r.baseOverviewColor, u = "", l = "");
2443
2443
  break;
2444
2444
  }
2445
- case D.INPUT1_ONLY:
2445
+ case x.INPUT1_ONLY:
2446
2446
  t ? (n = "merge-2way-deletion", o = "", s = r.baseOverviewColor, c = "", u = "-", l = "") : (n = "merge-change-incoming", o = "", i = "merge-change-base", s = r.conflictOverviewColor, c = "", a = r.baseOverviewColor, u = "-", l = "");
2447
2447
  break;
2448
- case D.INPUT2_ONLY:
2448
+ case x.INPUT2_ONLY:
2449
2449
  n = "", o = "merge-change-current", i = t ? "" : "merge-change-base", s = "", c = r.changeOverviewColor, a = t ? "" : r.baseOverviewColor, u = "", l = "+";
2450
2450
  break;
2451
- case D.TRUE_CONFLICT: {
2451
+ case x.TRUE_CONFLICT: {
2452
2452
  const y = e.baseRange.startLineNumber === 1 && e.baseRange.endLineNumberExclusive === 2 && // Default "not found" range
2453
2453
  e.input1Range.startLineNumber !== 1 && e.input2Range.startLineNumber !== 1;
2454
2454
  t ? y ? (n = "merge-2way-deletion", o = "merge-change-current", s = r.baseOverviewColor, c = r.changeOverviewColor, a = "", u = "-", l = "+") : (n = "merge-2way-deletion", o = "merge-conflict-current", i = "merge-conflict-base", s = r.baseOverviewColor, c = r.conflictOverviewColor, a = r.baseOverviewColor, u = "-", l = "+") : y ? (n = "merge-change-incoming", o = "merge-change-current", i = "", s = r.changeOverviewColor, c = r.changeOverviewColor, a = "", u = "+", l = "+") : (n = "merge-conflict-incoming", o = "merge-conflict-current", i = "merge-conflict-base", s = r.conflictOverviewColor, c = r.conflictOverviewColor, a = r.baseOverviewColor, u = "", l = "");
@@ -2466,7 +2466,7 @@ function Yr(e, t, r) {
2466
2466
  input2Symbol: l
2467
2467
  };
2468
2468
  }
2469
- function yn(e) {
2469
+ function En(e) {
2470
2470
  const t = /* @__PURE__ */ new Set();
2471
2471
  for (const r of e)
2472
2472
  if (r && typeof r == "object" && "line" in r) {
@@ -2475,11 +2475,11 @@ function yn(e) {
2475
2475
  }
2476
2476
  return Array.from(t).sort((r, n) => r - n);
2477
2477
  }
2478
- function zr(e, t, r) {
2478
+ function eo(e, t, r) {
2479
2479
  const n = [];
2480
2480
  if (t.input1Class) {
2481
2481
  if (e.input1Diffs.length > 0) {
2482
- const o = yn(e.input1Diffs);
2482
+ const o = En(e.input1Diffs);
2483
2483
  for (const i of o)
2484
2484
  n.push({
2485
2485
  range: new r.Range(i, 1, i, Number.MAX_SAFE_INTEGER),
@@ -2497,7 +2497,7 @@ function zr(e, t, r) {
2497
2497
  } : void 0
2498
2498
  }
2499
2499
  });
2500
- } else if (e.conflictType === D.INPUT1_ONLY) {
2500
+ } else if (e.conflictType === x.INPUT1_ONLY) {
2501
2501
  const o = e.input1Range.startLineNumber, i = e.input1Range.endLineNumberExclusive - 1;
2502
2502
  for (let s = o; s <= i; s++)
2503
2503
  n.push({
@@ -2520,10 +2520,10 @@ function zr(e, t, r) {
2520
2520
  }
2521
2521
  return n;
2522
2522
  }
2523
- function Xr(e, t, r) {
2523
+ function to(e, t, r) {
2524
2524
  const n = [];
2525
2525
  if (e.input2Diffs.length > 0 && t.input2Class) {
2526
- const o = yn(e.input2Diffs);
2526
+ const o = En(e.input2Diffs);
2527
2527
  for (const i of o)
2528
2528
  n.push({
2529
2529
  range: new r.Range(i, 1, i, Number.MAX_SAFE_INTEGER),
@@ -2544,7 +2544,7 @@ function Xr(e, t, r) {
2544
2544
  }
2545
2545
  return n;
2546
2546
  }
2547
- function Qr(e, t, r) {
2547
+ function no(e, t, r) {
2548
2548
  const n = [], o = e.baseRange.startLineNumber === 1 && e.baseRange.endLineNumberExclusive === 2;
2549
2549
  return (e.input1Diffs.length > 0 || e.input2Diffs.length > 0) && !o && n.push({
2550
2550
  range: new r.Range(
@@ -2567,18 +2567,18 @@ function Qr(e, t, r) {
2567
2567
  }
2568
2568
  }), n;
2569
2569
  }
2570
- function Zr(e, t, r, n) {
2571
- const o = Yr(e, t, r);
2570
+ function ro(e, t, r, n) {
2571
+ const o = Kr(e, t, r);
2572
2572
  return {
2573
- input1Decorations: zr(e, o, n),
2574
- input2Decorations: Xr(e, o, n),
2575
- baseDecorations: Qr(e, o, n)
2573
+ input1Decorations: eo(e, o, n),
2574
+ input2Decorations: to(e, o, n),
2575
+ baseDecorations: no(e, o, n)
2576
2576
  };
2577
2577
  }
2578
- function Cr(e, t, r, n) {
2578
+ function oo(e, t, r, n) {
2579
2579
  const o = [], i = [], s = [];
2580
2580
  for (const c of e) {
2581
- const a = Zr(c, t, r, n);
2581
+ const a = ro(c, t, r, n);
2582
2582
  o.push(...a.input1Decorations), i.push(...a.input2Decorations), s.push(...a.baseDecorations);
2583
2583
  }
2584
2584
  return {
@@ -2587,8 +2587,8 @@ function Cr(e, t, r, n) {
2587
2587
  baseDecorations: s
2588
2588
  };
2589
2589
  }
2590
- const Kr = () => /* @__PURE__ */ st("div", { style: { padding: "20px", textAlign: "center", color: "#888" }, children: "Loading Monaco Editor..." }), Nt = "⚠";
2591
- function ro(e) {
2590
+ const io = () => /* @__PURE__ */ ht("div", { style: { padding: "20px", textAlign: "center", color: "#888" }, children: "Loading Monaco Editor..." }), Pt = "⚠";
2591
+ function fo(e) {
2592
2592
  const {
2593
2593
  original: t = "",
2594
2594
  modified: r = "",
@@ -2603,311 +2603,311 @@ function ro(e) {
2603
2603
  onMergeResolve: y,
2604
2604
  showResultColumn: p,
2605
2605
  baseIndex: d = 1,
2606
- comparisonMode: L = "split",
2607
- schema: N,
2606
+ comparisonMode: _ = "split",
2607
+ schema: T,
2608
2608
  patches: v,
2609
2609
  labels: h
2610
- } = e, m = n ? p : !1, f = !n || n === "", E = "json", [S, g] = _e(!1), [b, j] = _e(!0), [T, F] = _e([]), [M, x] = _e(null), [V, A] = _e([]), [w, R] = _e([]), [X, ne] = _e(!1), ae = le(""), me = Ee((k, O, I, B) => {
2611
- const P = document.createElement("div");
2612
- P.className = "native-checkbox-container";
2613
- const U = document.createElement("input");
2614
- return U.type = "checkbox", U.className = "native-checkbox", U.checked = k === te.first || k === te.second, U.setAttribute("aria-label", U.checked ? "Undo accept" : "Accept change"), U.addEventListener("click", (Q) => {
2615
- Q.preventDefault(), Q.stopPropagation(), requestAnimationFrame(() => {
2616
- B();
2610
+ } = e, m = n ? p : !1, f = !n || n === "", I = "json", [S, g] = Pe(!1), [b, D] = Pe(!0), [L, U] = Pe([]), [M, $] = Pe(null), [V, E] = Pe([]), [A, R] = Pe([]), [X, re] = Pe(!1), [oe, ge] = Pe(/* @__PURE__ */ new Set()), ke = ae(""), be = Te((P, w, N, O) => {
2611
+ const k = document.createElement("div");
2612
+ k.className = "native-checkbox-container";
2613
+ const F = document.createElement("input");
2614
+ return F.type = "checkbox", F.className = "native-checkbox", F.checked = P === ne.first || P === ne.second, F.setAttribute("aria-label", F.checked ? "Undo accept" : "Accept change"), F.addEventListener("click", (Z) => {
2615
+ Z.preventDefault(), Z.stopPropagation(), requestAnimationFrame(() => {
2616
+ O();
2617
2617
  });
2618
- }), P.appendChild(U), P;
2619
- }, []), [je, Te] = _e(0), C = le(null), re = le(null), K = le(null), $ = le(null), fe = le(null), Ie = le(null), De = le(!1), gt = le(!1), $e = le(null), Ye = le(null), ke = le(null), Be = le(/* @__PURE__ */ new Map()), Le = le(null), Fe = le(null), Ue = le(null), Ve = le(null);
2618
+ }), k.appendChild(F), k;
2619
+ }, []), [at, Ne] = Pe(0), Q = ae(null), pe = ae(null), ee = ae(null), B = ae(null), we = ae(null), Qe = ae(null), Me = ae(!1), Nt = ae(!1), Ve = ae(null), Ze = ae(null), je = ae(null), Je = ae(/* @__PURE__ */ new Map()), Ie = ae(null), Re = ae(/* @__PURE__ */ new Map()), He = ae(null), Ge = ae(null), We = ae(null);
2620
2620
  Se(() => {
2621
- let k = !0;
2622
- const O = ur.init();
2623
- return O.then((I) => {
2624
- k && (fe.current = I, j(!1), g(!0));
2625
- }).catch((I) => {
2626
- k && (I == null ? void 0 : I.type) !== "cancelation" && console.error("Monaco initialization: error:", I);
2621
+ let P = !0;
2622
+ const w = mr.init();
2623
+ return w.then((N) => {
2624
+ P && (we.current = N, D(!1), g(!0));
2625
+ }).catch((N) => {
2626
+ P && (N == null ? void 0 : N.type) !== "cancelation" && console.error("Monaco initialization: error:", N);
2627
2627
  }), () => {
2628
- k = !1, De.current || O.cancel();
2628
+ P = !1, Me.current || w.cancel();
2629
2629
  };
2630
2630
  }, []);
2631
- const xt = Ee(
2632
- (k, O, I) => {
2633
- if (!fe.current) return [];
2634
- const B = (k == null ? void 0 : k.getValue()) || "", P = O.getValue(), U = I.getValue();
2631
+ const Gt = Te(
2632
+ (P, w, N) => {
2633
+ if (!we.current) return [];
2634
+ const O = (P == null ? void 0 : P.getValue()) || "", k = w.getValue(), F = N.getValue();
2635
2635
  try {
2636
- const Q = performance.now(), Y = Jr(B, P, U, {
2637
- comparisonMode: L,
2638
- schema: N,
2636
+ const Z = performance.now(), z = zr(O, k, F, {
2637
+ comparisonMode: _,
2638
+ schema: T,
2639
2639
  patches: v
2640
- }), _ = performance.now() - Q;
2641
- return _ > 100 && console.warn(`JSON Patch diff took ${_.toFixed(2)}ms`), Y;
2642
- } catch (Q) {
2643
- const Y = Q instanceof Error ? Q.message : String(Q);
2644
- return console.error("JSON Patch diff error:", Y), [];
2640
+ }), j = performance.now() - Z;
2641
+ return j > 100 && console.warn(`JSON Patch diff took ${j.toFixed(2)}ms`), z;
2642
+ } catch (Z) {
2643
+ const z = Z instanceof Error ? Z.message : String(Z);
2644
+ return console.error("JSON Patch diff error:", z), [];
2645
2645
  }
2646
2646
  },
2647
- [L, N, v]
2648
- ), ze = Ee((k) => {
2647
+ [_, T, v]
2648
+ ), Ke = Te((P) => {
2649
2649
  try {
2650
- return k.getLayoutInfo().decorationsLeft || 0;
2650
+ return P.getLayoutInfo().decorationsLeft || 0;
2651
2651
  } catch {
2652
2652
  return 0;
2653
2653
  }
2654
- }, []), Xe = Ee((k) => {
2654
+ }, []), et = Te((P) => {
2655
2655
  try {
2656
- return k.getLayoutInfo().decorationsWidth || 0;
2656
+ return P.getLayoutInfo().decorationsWidth || 0;
2657
2657
  } catch {
2658
2658
  return 0;
2659
2659
  }
2660
- }, []), nt = Ee(
2661
- (k) => {
2662
- if (!m || !$.current || !ke.current)
2660
+ }, []), lt = Te(
2661
+ (P) => {
2662
+ if (!m || !B.current || !je.current)
2663
2663
  return;
2664
- const O = fe.current;
2665
- if (!O) return;
2666
- const I = o === "vs-dark" || typeof o == "string" && o.includes("dark"), B = ze($.current), P = Xe($.current);
2667
- ke.current.style.left = `${B}px`, ke.current.style.width = `${P}px`;
2668
- const U = $.current.getScrollTop();
2669
- if ($.current.getModel()) {
2670
- ke.current.innerHTML = "";
2671
- for (const Y of k) {
2672
- const _ = Y.startLine, ue = Y.endLine, Z = $.current.getTopForLineNumber(_) - U, H = $.current.getTopForLineNumber(ue) - U, J = $.current.getOption(O.editor.EditorOption.lineHeight), oe = ue > _ ? H - Z + J : J, G = document.createElement("div");
2673
- G.className = `conflict-issue-marker conflict-issue-${Y.type}`, G.setAttribute("data-conflict-id", Y.conflictId), G.setAttribute("data-issue-type", Y.type), G.title = Y.message, G.style.position = "absolute", G.style.top = `${Math.max(0, Z)}px`, G.style.height = `${oe}px`, G.style.width = "26px", G.style.display = "flex", G.style.alignItems = "center", G.style.justifyContent = "center", G.style.cursor = "help", G.style.pointerEvents = "auto";
2674
- const ie = document.createElement("div");
2675
- ie.className = "issue-icon", Y.type === "error" ? (ie.textContent = "✗", ie.style.color = I ? "#ff6666" : "#cc0000") : Y.type === "warning" ? (ie.textContent = Nt, ie.style.color = I ? "#ffaa00" : "#ff8800") : Y.type === "smart-merge" && (ie.textContent = "↕", ie.style.color = I ? "#0096ff" : "#0078d4"), ie.style.fontSize = "14px", ie.style.fontWeight = "bold", G.appendChild(ie), ke.current.appendChild(G);
2664
+ const w = we.current;
2665
+ if (!w) return;
2666
+ const N = o === "vs-dark" || typeof o == "string" && o.includes("dark"), O = Ke(B.current), k = et(B.current);
2667
+ je.current.style.left = `${O}px`, je.current.style.width = `${k}px`;
2668
+ const F = B.current.getScrollTop();
2669
+ if (B.current.getModel()) {
2670
+ je.current.innerHTML = "";
2671
+ for (const z of P) {
2672
+ const j = z.startLine, ue = z.endLine, te = B.current.getTopForLineNumber(j) - F, H = B.current.getTopForLineNumber(ue) - F, J = B.current.getOption(w.editor.EditorOption.lineHeight), ie = ue > j ? H - te + J : J, G = document.createElement("div");
2673
+ G.className = `conflict-issue-marker conflict-issue-${z.type}`, G.setAttribute("data-conflict-id", z.conflictId), G.setAttribute("data-issue-type", z.type), G.title = z.message, G.style.position = "absolute", G.style.top = `${Math.max(0, te)}px`, G.style.height = `${ie}px`, G.style.width = "26px", G.style.display = "flex", G.style.alignItems = "center", G.style.justifyContent = "center", G.style.cursor = "help", G.style.pointerEvents = "auto";
2674
+ const se = document.createElement("div");
2675
+ se.className = "issue-icon", z.type === "error" ? (se.textContent = "✗", se.style.color = N ? "#ff6666" : "#cc0000") : z.type === "warning" ? (se.textContent = Pt, se.style.color = N ? "#ffaa00" : "#ff8800") : z.type === "smart-merge" && (se.textContent = "↕", se.style.color = N ? "#0096ff" : "#0078d4"), se.style.fontSize = "14px", se.style.fontWeight = "bold", G.appendChild(se), je.current.appendChild(G);
2676
2676
  }
2677
2677
  }
2678
2678
  },
2679
- [m, o, ze, Xe]
2680
- ), rt = Ee(
2681
- (k) => {
2682
- var se, oe, G, ie;
2683
- if (!$.current || X)
2679
+ [m, o, Ke, et]
2680
+ ), ut = Te(
2681
+ (P) => {
2682
+ var ce, ie, G, se;
2683
+ if (!B.current || X)
2684
2684
  return;
2685
- const O = $.current.getModel(), I = (se = C.current) == null ? void 0 : se.getModel(), B = (oe = K.current) == null ? void 0 : oe.getModel(), P = (G = re.current) == null ? void 0 : G.getModel();
2686
- if (!O || !I || !B || !P)
2685
+ const w = B.current.getModel(), N = (ce = Q.current) == null ? void 0 : ce.getModel(), O = (ie = ee.current) == null ? void 0 : ie.getModel(), k = (G = pe.current) == null ? void 0 : G.getModel();
2686
+ if (!w || !N || !O || !k)
2687
2687
  return;
2688
- const U = P.getLinesContent(), Q = I.getLinesContent(), Y = B.getLinesContent(), _ = qr(U, Q, Y, k, N);
2689
- if (x(_.isValid ? null : _.validationError || "Invalid JSON"), A(_.warnings || []), R(_.conflictIssues || []), Le.current) {
2690
- const z = (h == null ? void 0 : h.result) || "Result";
2691
- _.isValid ? _.warnings && _.warnings.length > 0 ? (Le.current.textContent = `${z} ${Nt}`, Le.current.title = _.warnings.join(`
2692
- `)) : (Le.current.textContent = z, Le.current.style.color = "", Le.current.title = "") : (Le.current.textContent = `${z} ${Nt} Invalid JSON`, Le.current.style.color = "#ff4444", Le.current.title = _.validationError || "Invalid JSON - please fix manually");
2693
- }
2694
- if (O.getValue() !== _.content) {
2695
- const z = $.current.getPosition(), q = $.current.getSelection();
2696
- if (gt.current = !0, O.setValue(_.content), gt.current = !1, z) {
2697
- const he = O.getLineCount(), ee = O.getLineLength(he), ve = {
2698
- lineNumber: Math.min(z.lineNumber, he),
2699
- column: z.lineNumber <= he ? Math.min(z.column, O.getLineLength(z.lineNumber) + 1) : ee + 1
2688
+ const F = k.getLinesContent(), Z = N.getLinesContent(), z = O.getLinesContent(), j = Zr(F, Z, z, P, T);
2689
+ if ($(j.isValid ? null : j.validationError || "Invalid JSON"), E(j.warnings || []), R(j.conflictIssues || []), Ie.current) {
2690
+ const C = (h == null ? void 0 : h.result) || "Result";
2691
+ j.isValid ? j.warnings && j.warnings.length > 0 ? (Ie.current.textContent = `${C} ${Pt}`, Ie.current.title = j.warnings.join(`
2692
+ `)) : (Ie.current.textContent = C, Ie.current.style.color = "", Ie.current.title = "") : (Ie.current.textContent = `${C} ${Pt} Invalid JSON`, Ie.current.style.color = "#ff4444", Ie.current.title = j.validationError || "Invalid JSON - please fix manually");
2693
+ }
2694
+ if (w.getValue() !== j.content) {
2695
+ const C = B.current.getPosition(), q = B.current.getSelection();
2696
+ if (Nt.current = !0, w.setValue(j.content), Nt.current = !1, C) {
2697
+ const he = w.getLineCount(), Y = w.getLineLength(he), ye = {
2698
+ lineNumber: Math.min(C.lineNumber, he),
2699
+ column: C.lineNumber <= he ? Math.min(C.column, w.getLineLength(C.lineNumber) + 1) : Y + 1
2700
2700
  };
2701
- $.current.setPosition(ve), q && !q.isEmpty() && $.current.setSelection(q);
2701
+ B.current.setPosition(ye), q && !q.isEmpty() && B.current.setSelection(q);
2702
2702
  }
2703
2703
  }
2704
- const Z = fe.current, H = O;
2704
+ const te = we.current, H = w;
2705
2705
  let J = H._invalidDecorations;
2706
- if (!_.isValid && $.current && Z ? (J || (J = $.current.createDecorationsCollection([]), H._invalidDecorations = J), J.set([
2706
+ if (!j.isValid && B.current && te ? (J || (J = B.current.createDecorationsCollection([]), H._invalidDecorations = J), J.set([
2707
2707
  {
2708
- range: new Z.Range(1, 1, O.getLineCount(), Number.MAX_SAFE_INTEGER),
2708
+ range: new te.Range(1, 1, w.getLineCount(), Number.MAX_SAFE_INTEGER),
2709
2709
  options: {
2710
2710
  isWholeLine: !1,
2711
2711
  className: "merge-result-invalid",
2712
- hoverMessage: { value: _.validationError || "Invalid JSON - please fix manually" }
2712
+ hoverMessage: { value: j.validationError || "Invalid JSON - please fix manually" }
2713
2713
  }
2714
2714
  }
2715
- ])) : _.isValid && J && $.current && J.set([]), _.conflictIssues && _.conflictIssues.length > 0) {
2716
- if (nt(_.conflictIssues), $.current && Z) {
2717
- const z = O;
2718
- if (!z._conflictIssueDecorations) {
2719
- const ee = $.current.createDecorationsCollection(
2715
+ ])) : j.isValid && J && B.current && J.set([]), j.conflictIssues && j.conflictIssues.length > 0) {
2716
+ if (lt(j.conflictIssues), B.current && te) {
2717
+ const C = w;
2718
+ if (!C._conflictIssueDecorations) {
2719
+ const Y = B.current.createDecorationsCollection(
2720
2720
  []
2721
2721
  );
2722
- z._conflictIssueDecorations = ee;
2722
+ C._conflictIssueDecorations = Y;
2723
2723
  }
2724
- const q = z._conflictIssueDecorations, he = _.conflictIssues.map((ee) => {
2725
- let ve, Ae;
2726
- return ee.type === "error" ? (ve = o === "vs-dark" ? "rgba(255, 0, 0, 0.1)" : "rgba(255, 0, 0, 0.05)", Ae = o === "vs-dark" ? "#ff6666" : "#cc0000") : ee.type === "warning" ? (ve = o === "vs-dark" ? "rgba(255, 170, 0, 0.1)" : "rgba(255, 136, 0, 0.05)", Ae = o === "vs-dark" ? "#ffaa00" : "#ff8800") : (ve = o === "vs-dark" ? "rgba(0, 150, 255, 0.1)" : "rgba(0, 120, 212, 0.05)", Ae = o === "vs-dark" ? "#0096ff" : "#0078d4"), {
2727
- range: new Z.Range(ee.startLine, 1, ee.endLine, Number.MAX_SAFE_INTEGER),
2724
+ const q = C._conflictIssueDecorations, he = j.conflictIssues.map((Y) => {
2725
+ let ye, Ee;
2726
+ return Y.type === "error" ? (ye = o === "vs-dark" ? "rgba(255, 0, 0, 0.1)" : "rgba(255, 0, 0, 0.05)", Ee = o === "vs-dark" ? "#ff6666" : "#cc0000") : Y.type === "warning" ? (ye = o === "vs-dark" ? "rgba(255, 170, 0, 0.1)" : "rgba(255, 136, 0, 0.05)", Ee = o === "vs-dark" ? "#ffaa00" : "#ff8800") : (ye = o === "vs-dark" ? "rgba(0, 150, 255, 0.1)" : "rgba(0, 120, 212, 0.05)", Ee = o === "vs-dark" ? "#0096ff" : "#0078d4"), {
2727
+ range: new te.Range(Y.startLine, 1, Y.endLine, Number.MAX_SAFE_INTEGER),
2728
2728
  options: {
2729
2729
  isWholeLine: !0,
2730
- className: `conflict-issue-line conflict-issue-${ee.type}`,
2731
- linesDecorationsClassName: `conflict-issue-line-decoration conflict-issue-${ee.type}`,
2732
- backgroundColor: ve,
2730
+ className: `conflict-issue-line conflict-issue-${Y.type}`,
2731
+ linesDecorationsClassName: `conflict-issue-line-decoration conflict-issue-${Y.type}`,
2732
+ backgroundColor: ye,
2733
2733
  overviewRuler: {
2734
- color: Ae,
2735
- position: Z.editor.OverviewRulerLane.Right
2734
+ color: Ee,
2735
+ position: te.editor.OverviewRulerLane.Right
2736
2736
  },
2737
2737
  minimap: {
2738
- color: Ae,
2739
- position: Z.editor.MinimapPosition.Inline
2738
+ color: Ee,
2739
+ position: te.editor.MinimapPosition.Inline
2740
2740
  }
2741
2741
  }
2742
2742
  };
2743
2743
  });
2744
2744
  q.set(he);
2745
2745
  }
2746
- } else if ($.current) {
2747
- const z = O;
2748
- z._conflictIssueDecorations && z._conflictIssueDecorations.set([]), ke.current && m && (ke.current.innerHTML = "");
2746
+ } else if (B.current) {
2747
+ const C = w;
2748
+ C._conflictIssueDecorations && C._conflictIssueDecorations.set([]), je.current && m && (je.current.innerHTML = "");
2749
2749
  }
2750
2750
  if (y) {
2751
- const z = `${_.content}|${_.isValid}|${(ie = _.warnings) == null ? void 0 : ie.join(",")}`;
2752
- ae.current !== z && (ae.current = z, queueMicrotask(() => {
2753
- y(_.content, {
2754
- isValid: _.isValid,
2755
- validationError: _.validationError,
2756
- warnings: _.warnings,
2757
- conflictIssues: _.conflictIssues
2751
+ const C = `${j.content}|${j.isValid}|${(se = j.warnings) == null ? void 0 : se.join(",")}`;
2752
+ ke.current !== C && (ke.current = C, queueMicrotask(() => {
2753
+ y(j.content, {
2754
+ isValid: j.isValid,
2755
+ validationError: j.validationError,
2756
+ warnings: j.warnings,
2757
+ conflictIssues: j.conflictIssues
2758
2758
  });
2759
2759
  }));
2760
2760
  }
2761
2761
  },
2762
- [y, N, h, o, nt, m, X]
2763
- ), mt = Ee(
2764
- (k, O) => {
2765
- ne(!1), F((I) => {
2766
- const B = I.map((P) => {
2767
- if (P.id !== k) return P;
2768
- const Q = (O === 1 ? P.input1State : P.input2State) === te.excluded ? te.first : te.excluded;
2769
- return O === 1 ? { ...P, input1State: Q } : { ...P, input2State: Q };
2762
+ [y, T, h, o, lt, m, X]
2763
+ ), Et = Te(
2764
+ (P, w) => {
2765
+ re(!1), U((N) => {
2766
+ const O = N.map((k) => {
2767
+ if (k.id !== P) return k;
2768
+ const Z = (w === 1 ? k.input1State : k.input2State) === ne.excluded ? ne.first : ne.excluded;
2769
+ return w === 1 ? { ...k, input1State: Z } : { ...k, input2State: Z };
2770
2770
  });
2771
- return m && $.current && rt(B), B;
2771
+ return m && B.current && ut(O), O;
2772
2772
  });
2773
2773
  },
2774
- [m, rt]
2775
- ), yt = Ee(
2776
- (k, O, I, B, P, U, Q) => {
2777
- if (!fe.current) return;
2778
- const _ = B === 1 ? C.current : K.current;
2779
- if (!_) return;
2780
- const ue = B === 1 ? I.input1Range : I.input2Range, Z = B === 1 ? I.input1State : I.input2State, H = _.getModel();
2774
+ [m, ut]
2775
+ ), Tt = Te(
2776
+ (P, w, N, O, k, F, Z) => {
2777
+ if (!we.current) return;
2778
+ const j = O === 1 ? Q.current : ee.current;
2779
+ if (!j) return;
2780
+ const ue = O === 1 ? N.input1Range : N.input2Range, te = O === 1 ? N.input1State : N.input2State, H = j.getModel();
2781
2781
  if (!H) return;
2782
- const J = H.getLineCount(), se = Math.max(1, Math.min(ue.startLineNumber, J)), oe = Math.max(1, Math.min(ue.endLineNumberExclusive - 1, J));
2783
- if (se > J || oe < 1 || se > oe)
2782
+ const J = H.getLineCount(), ce = Math.max(1, Math.min(ue.startLineNumber, J)), ie = Math.max(1, Math.min(ue.endLineNumberExclusive - 1, J));
2783
+ if (ce > J || ie < 1 || ce > ie)
2784
2784
  return;
2785
- const G = _.getTopForLineNumber(se) - P, z = _.getBottomForLineNumber(oe) - P - G;
2786
- let q = Be.current.get(O);
2785
+ const G = j.getTopForLineNumber(ce) - k, C = j.getBottomForLineNumber(ie) - k - G;
2786
+ let q = Je.current.get(w);
2787
2787
  if (!q) {
2788
2788
  q = document.createElement("div"), q.className = "merge-accept-gutter-marker";
2789
- const ge = document.createElement("div");
2790
- ge.className = "background", q.appendChild(ge);
2791
- const pe = document.createElement("div");
2792
- pe.className = "checkbox";
2793
- const ye = document.createElement("div");
2794
- ye.className = "checkbox-background";
2795
- const Ne = me(Z, B, I.id, () => mt(I.id, B));
2796
- ye.appendChild(Ne), pe.appendChild(ye), q.appendChild(pe), k.appendChild(q), Be.current.set(O, q);
2797
- }
2798
- q.style.top = `${G}px`, q.style.height = `${z}px`;
2789
+ const fe = document.createElement("div");
2790
+ fe.className = "background", q.appendChild(fe);
2791
+ const K = document.createElement("div");
2792
+ K.className = "checkbox";
2793
+ const me = document.createElement("div");
2794
+ me.className = "checkbox-background";
2795
+ const ve = be(te, O, N.id, () => Et(N.id, O));
2796
+ me.appendChild(ve), K.appendChild(me), q.appendChild(K), P.appendChild(q), Je.current.set(w, q);
2797
+ }
2798
+ q.style.top = `${G}px`, q.style.height = `${C}px`;
2799
2799
  const he = q.querySelector(".checkbox-background");
2800
2800
  if (he) {
2801
2801
  he.innerHTML = "";
2802
- const ge = me(Z, B, I.id, () => mt(I.id, B));
2803
- he.appendChild(ge);
2804
- }
2805
- const ee = I.handled, ve = I.focused, Ae = z > 30;
2806
- q.className = "merge-accept-gutter-marker", ee && q.classList.add("handled"), ve && q.classList.add("focused"), Ae ? q.classList.add("multi-line") : q.classList.add("single-line");
2807
- const Oe = q.querySelector(".checkbox");
2808
- if (Oe) {
2809
- const pe = z / 2 - 12, ye = 24;
2810
- let Ne = pe;
2811
- const vn = ye, bn = U - ye - 24, Ht = ye, Gt = z - 24 - ye;
2812
- Ht < Gt && (Ne = Math.max(vn, Math.min(Ne + G, bn)) - G, Ne = Math.max(Ht, Math.min(Ne, Gt))), Oe.style.top = `${Ne + 5}px`;
2802
+ const fe = be(te, O, N.id, () => Et(N.id, O));
2803
+ he.appendChild(fe);
2804
+ }
2805
+ const Y = N.handled, ye = N.focused, Ee = C > 30;
2806
+ q.className = "merge-accept-gutter-marker", Y && q.classList.add("handled"), ye && q.classList.add("focused"), Ee ? q.classList.add("multi-line") : q.classList.add("single-line");
2807
+ const $e = q.querySelector(".checkbox");
2808
+ if ($e) {
2809
+ const K = C / 2 - 12, me = 24;
2810
+ let ve = K;
2811
+ const Le = me, _e = F - me - 24, Be = me, pt = C - 24 - me;
2812
+ Be < pt && (ve = Math.max(Le, Math.min(ve + G, _e)) - G, ve = Math.max(Be, Math.min(ve, pt))), $e.style.top = `${ve + 5}px`;
2813
2813
  }
2814
2814
  },
2815
- [mt, me]
2816
- ), ot = Ee(() => {
2815
+ [Et, be]
2816
+ ), ft = Te(() => {
2817
2817
  if (!m) {
2818
- const H = Be.current;
2819
- for (const [J, se] of H.entries())
2820
- se.remove(), H.delete(J);
2818
+ const H = Je.current;
2819
+ for (const [J, ce] of H.entries())
2820
+ ce.remove(), H.delete(J);
2821
2821
  return;
2822
2822
  }
2823
- if (!C.current || !K.current || !$e.current || !Ye.current || !fe.current)
2823
+ if (!Q.current || !ee.current || !Ve.current || !Ze.current || !we.current)
2824
2824
  return;
2825
- const O = o === "vs-dark" || typeof o == "string" && o.includes("dark"), I = ze(C.current), B = Xe(C.current), P = ze(K.current), U = Xe(K.current);
2826
- $e.current.style.left = `${I}px`, $e.current.style.width = `${B}px`, Ye.current.style.left = `${P}px`, Ye.current.style.width = `${U}px`;
2827
- const Q = C.current.getVisibleRanges();
2828
- if (!Q || Q.length === 0) return;
2829
- const Y = C.current.getScrollTop(), _ = $e.current.clientHeight, ue = /* @__PURE__ */ new Set();
2830
- for (const H of T)
2825
+ const w = o === "vs-dark" || typeof o == "string" && o.includes("dark"), N = Ke(Q.current), O = et(Q.current), k = Ke(ee.current), F = et(ee.current);
2826
+ Ve.current.style.left = `${N}px`, Ve.current.style.width = `${O}px`, Ze.current.style.left = `${k}px`, Ze.current.style.width = `${F}px`;
2827
+ const Z = Q.current.getVisibleRanges();
2828
+ if (!Z || Z.length === 0) return;
2829
+ const z = Q.current.getScrollTop(), j = Ve.current.clientHeight, ue = /* @__PURE__ */ new Set();
2830
+ for (const H of L)
2831
2831
  if (!(H.input1Diffs.length === 0 && H.input2Diffs.length === 0)) {
2832
2832
  if (H.input1Diffs.length > 0) {
2833
2833
  const J = `${H.id}-input1`;
2834
- ue.add(J), yt($e.current, J, H, 1, Y, _, O);
2834
+ ue.add(J), Tt(Ve.current, J, H, 1, z, j, w);
2835
2835
  }
2836
2836
  if (H.input2Diffs.length > 0) {
2837
2837
  const J = `${H.id}-input2`;
2838
- ue.add(J), yt(Ye.current, J, H, 2, Y, _, O);
2838
+ ue.add(J), Tt(Ze.current, J, H, 2, z, j, w);
2839
2839
  }
2840
2840
  }
2841
- const Z = Be.current;
2842
- for (const [H, J] of Z.entries())
2843
- ue.has(H) || (J.remove(), Z.delete(H));
2844
- }, [T, o, m, ze, Xe, yt]), be = Ee((k, O) => {
2845
- var I, B, P;
2841
+ const te = Je.current;
2842
+ for (const [H, J] of te.entries())
2843
+ ue.has(H) || (J.remove(), te.delete(H));
2844
+ }, [L, o, m, Ke, et, Tt]), Oe = Te((P, w) => {
2845
+ var N, O, k;
2846
2846
  try {
2847
- if (fe.current) {
2848
- const U = (B = (I = fe.current.editor).getTheme) == null ? void 0 : B.call(I);
2849
- if ((P = U == null ? void 0 : U.colors) != null && P[k])
2850
- return U.colors[k];
2847
+ if (we.current) {
2848
+ const F = (O = (N = we.current.editor).getTheme) == null ? void 0 : O.call(N);
2849
+ if ((k = F == null ? void 0 : F.colors) != null && k[P])
2850
+ return F.colors[P];
2851
2851
  }
2852
2852
  } catch {
2853
2853
  }
2854
- return O;
2855
- }, []), $t = Ee(() => {
2856
- if (!fe.current || !C.current || !K.current)
2854
+ return w;
2855
+ }, []), Wt = Te(() => {
2856
+ if (!we.current || !Q.current || !ee.current)
2857
2857
  return;
2858
- const k = fe.current, O = o === "vs-dark" || typeof o == "string" && o.includes("dark"), I = be("mergeEditor.change.background", O ? "rgba(255, 166, 0, 0.2)" : "rgba(255, 166, 0, 0.15)"), B = be(
2858
+ const P = we.current, w = o === "vs-dark" || typeof o == "string" && o.includes("dark"), N = Oe("mergeEditor.change.background", w ? "rgba(255, 166, 0, 0.2)" : "rgba(255, 166, 0, 0.15)"), O = Oe(
2859
2859
  "diffEditor.insertedTextBackground",
2860
- O ? "rgba(155, 185, 85, 0.2)" : "rgba(155, 185, 85, 0.15)"
2861
- ), P = be(
2860
+ w ? "rgba(155, 185, 85, 0.2)" : "rgba(155, 185, 85, 0.15)"
2861
+ ), k = Oe(
2862
2862
  "mergeEditor.changeBase.background",
2863
- O ? "rgba(255, 100, 100, 0.2)" : "rgba(255, 100, 100, 0.15)"
2864
- ), U = be(
2863
+ w ? "rgba(255, 100, 100, 0.2)" : "rgba(255, 100, 100, 0.15)"
2864
+ ), F = Oe(
2865
2865
  "editorOverviewRuler.modifiedForeground",
2866
- O ? "rgba(255, 166, 0, 0.8)" : "rgba(255, 166, 0, 1)"
2867
- ), Q = be(
2866
+ w ? "rgba(255, 166, 0, 0.8)" : "rgba(255, 166, 0, 1)"
2867
+ ), Z = Oe(
2868
2868
  "editorOverviewRuler.addedForeground",
2869
- O ? "rgba(155, 185, 85, 0.8)" : "rgba(155, 185, 85, 1)"
2870
- ), Y = be(
2869
+ w ? "rgba(155, 185, 85, 0.8)" : "rgba(155, 185, 85, 1)"
2870
+ ), z = Oe(
2871
2871
  "editorOverviewRuler.deletedForeground",
2872
- O ? "rgba(255, 100, 100, 0.8)" : "rgba(255, 100, 100, 1)"
2873
- ), _ = f, ue = {
2874
- conflictOverviewColor: U,
2875
- changeOverviewColor: Q,
2876
- baseOverviewColor: Y
2877
- }, { input1Decorations: Z, input2Decorations: H, baseDecorations: J } = Cr(
2878
- T,
2879
- _,
2872
+ w ? "rgba(255, 100, 100, 0.8)" : "rgba(255, 100, 100, 1)"
2873
+ ), j = f, ue = {
2874
+ conflictOverviewColor: F,
2875
+ changeOverviewColor: Z,
2876
+ baseOverviewColor: z
2877
+ }, { input1Decorations: te, input2Decorations: H, baseDecorations: J } = oo(
2878
+ L,
2879
+ j,
2880
2880
  ue,
2881
- k
2882
- ), se = be("input.background", O ? "#3c3c3c" : "#f3f3f3"), oe = be("input.border", O ? "#6b6b6b" : "#c8c8c8"), G = be("focusBorder", O ? "#007acc" : "#0078d4"), ie = be("inputOption.activeForeground", O ? "#3794ff" : "#0078d4"), z = "monaco-three-way-diff-dynamic";
2883
- let q = document.getElementById(z);
2884
- q || (q = document.createElement("style"), q.id = z, document.head.appendChild(q));
2885
- const he = be(
2881
+ P
2882
+ ), ce = Oe("input.background", w ? "#3c3c3c" : "#f3f3f3"), ie = Oe("input.border", w ? "#6b6b6b" : "#c8c8c8"), G = Oe("focusBorder", w ? "#007acc" : "#0078d4"), se = Oe("inputOption.activeForeground", w ? "#3794ff" : "#0078d4"), C = "monaco-three-way-diff-dynamic";
2883
+ let q = document.getElementById(C);
2884
+ q || (q = document.createElement("style"), q.id = C, document.head.appendChild(q));
2885
+ const he = Oe(
2886
2886
  "diffEditor.insertedTextBackground",
2887
- O ? "rgba(100, 100, 255, 0.15)" : "rgba(100, 100, 255, 0.1)"
2888
- ), ee = be(
2887
+ w ? "rgba(100, 100, 255, 0.15)" : "rgba(100, 100, 255, 0.1)"
2888
+ ), Y = Oe(
2889
2889
  "diffEditor.insertedTextBackground",
2890
- O ? "rgba(155, 185, 85, 0.2)" : "rgba(155, 185, 85, 0.15)"
2890
+ w ? "rgba(155, 185, 85, 0.2)" : "rgba(155, 185, 85, 0.15)"
2891
2891
  );
2892
2892
  q.textContent = `
2893
2893
  /* True conflict - both sides changed differently (orange/amber) */
2894
2894
  .monaco-editor .merge-conflict-incoming,
2895
2895
  .monaco-editor .merge-conflict-current {
2896
- background-color: ${I};
2896
+ background-color: ${N};
2897
2897
  }
2898
2898
 
2899
2899
  /* 2-way diff mode: red for deletions (input1 column) - must override merge-change-incoming */
2900
2900
  .monaco-editor .merge-2way-deletion,
2901
2901
  .monaco-editor .monaco-editor .merge-2way-deletion {
2902
- background-color: ${P} !important;
2902
+ background-color: ${k} !important;
2903
2903
  }
2904
2904
 
2905
2905
  /* Single-side change (green for input2/ours, orange for input1/theirs in 3-way) */
2906
2906
  .monaco-editor .merge-change-incoming {
2907
- background-color: ${ee};
2907
+ background-color: ${Y};
2908
2908
  }
2909
2909
  .monaco-editor .merge-change-current {
2910
- background-color: ${B};
2910
+ background-color: ${O};
2911
2911
  }
2912
2912
 
2913
2913
  /* Same change on both sides (blue/purple) */
@@ -2918,13 +2918,13 @@ function ro(e) {
2918
2918
  /* Base changes */
2919
2919
  .monaco-editor .merge-conflict-base,
2920
2920
  .monaco-editor .merge-change-base {
2921
- background-color: ${P};
2921
+ background-color: ${k};
2922
2922
  }
2923
2923
 
2924
2924
  /* Invalid JSON in result column */
2925
2925
  .monaco-editor .merge-result-invalid {
2926
- background-color: ${O ? "rgba(255, 0, 0, 0.2)" : "rgba(255, 0, 0, 0.1)"};
2927
- outline: 1px solid ${O ? "rgba(255, 100, 100, 0.5)" : "rgba(255, 0, 0, 0.3)"};
2926
+ background-color: ${w ? "rgba(255, 0, 0, 0.2)" : "rgba(255, 0, 0, 0.1)"};
2927
+ outline: 1px solid ${w ? "rgba(255, 100, 100, 0.5)" : "rgba(255, 0, 0, 0.3)"};
2928
2928
  }
2929
2929
 
2930
2930
  /* Diff symbols (+ and -) in line decorations - positioned in code area */
@@ -2956,7 +2956,7 @@ function ro(e) {
2956
2956
  pointer-events: none;
2957
2957
  font-family: "Courier New", monospace;
2958
2958
  width: 20px;
2959
- color: ${O ? "#9BB955" : "#6A9955"};
2959
+ color: ${w ? "#9BB955" : "#6A9955"};
2960
2960
  }
2961
2961
 
2962
2962
  .monaco-editor .diff-symbol.diff-symbol-minus::before {
@@ -2975,7 +2975,7 @@ function ro(e) {
2975
2975
  pointer-events: none;
2976
2976
  font-family: "Courier New", monospace;
2977
2977
  width: 20px;
2978
- color: ${O ? "#FF6464" : "#CC0000"};
2978
+ color: ${w ? "#FF6464" : "#CC0000"};
2979
2979
  }
2980
2980
 
2981
2981
  /* VSCode-style checkbox gutter - positioned at Monaco's glyph margin */
@@ -3018,8 +3018,8 @@ function ro(e) {
3018
3018
  width: 14px;
3019
3019
  height: 14px;
3020
3020
  border-radius: 3px;
3021
- background-color: ${se};
3022
- border: 1px solid ${oe};
3021
+ background-color: ${ce};
3022
+ border: 1px solid ${ie};
3023
3023
  }
3024
3024
 
3025
3025
  .merge-accept-gutter-marker.focused .checkbox-background {
@@ -3046,7 +3046,7 @@ function ro(e) {
3046
3046
  height: 16px;
3047
3047
  cursor: pointer;
3048
3048
  margin: 0;
3049
- accent-color: ${ie};
3049
+ accent-color: ${se};
3050
3050
  }
3051
3051
 
3052
3052
  /* Result column status indicator */
@@ -3074,65 +3074,85 @@ function ro(e) {
3074
3074
  outline: 2px solid ${G};
3075
3075
  outline-offset: 2px;
3076
3076
  }
3077
- `, Fe.current || (Fe.current = C.current.createDecorationsCollection([])), Fe.current.set(Z), Ue.current || (Ue.current = K.current.createDecorationsCollection([])), Ue.current.set(H), re.current && (Ve.current || (Ve.current = re.current.createDecorationsCollection([])), Ve.current.set(J));
3078
- }, [T, o, f, be]), Bt = Ee(() => {
3079
- if (!De.current && Ie.current && fe.current && !b) {
3080
- const k = fe.current;
3081
- Ie.current.innerHTML = "";
3082
- const O = document.createElement("div");
3083
- O.style.display = "flex", O.style.height = "100%", O.style.width = "100%";
3084
- const I = o === "vs-dark" || typeof o == "string" && o.includes("dark"), B = I ? "#444" : "#ddd", P = I ? "#fff" : "#333", U = (ee, ve) => {
3085
- var Ae, Oe, ge;
3077
+ `, He.current || (He.current = Q.current.createDecorationsCollection([])), He.current.set(te), Ge.current || (Ge.current = ee.current.createDecorationsCollection([])), Ge.current.set(H), pe.current && (We.current || (We.current = pe.current.createDecorationsCollection([])), We.current.set(J));
3078
+ }, [L, o, f, Oe]), qt = Te(() => {
3079
+ if (!Me.current && Qe.current && we.current && !b) {
3080
+ const P = we.current;
3081
+ Qe.current.innerHTML = "", Re.current.clear();
3082
+ const w = document.createElement("div");
3083
+ w.style.display = "flex", w.style.height = "100%", w.style.width = "100%";
3084
+ const N = o === "vs-dark" || typeof o == "string" && o.includes("dark"), O = N ? "#444" : "#ddd", k = N ? "#fff" : "#333", F = (Y, ye) => {
3085
+ var Ee, $e, fe;
3086
3086
  try {
3087
- const pe = (Oe = (Ae = k.editor).getTheme) == null ? void 0 : Oe.call(Ae);
3088
- if ((ge = pe == null ? void 0 : pe.colors) != null && ge[ee])
3089
- return pe.colors[ee];
3087
+ const K = ($e = (Ee = P.editor).getTheme) == null ? void 0 : $e.call(Ee);
3088
+ if ((fe = K == null ? void 0 : K.colors) != null && fe[Y])
3089
+ return K.colors[Y];
3090
3090
  } catch {
3091
3091
  }
3092
- return ve;
3093
- }, Q = U("mergeEditor.conflict.input1.header.background", I ? "#4B1818" : "#FFE6E6"), Y = U("editorGutter.background", I ? "#333" : "#f0f0f0"), _ = U("mergeEditor.conflict.input2.header.background", I ? "#1B4B18" : "#E6FFE6"), ue = U("mergeEditor.result.header.background", I ? "#7F5F00" : "#FFECB3"), Z = (ee, ve, Ae = !1) => {
3094
- const Oe = document.createElement("div");
3095
- Oe.style.flex = "1", Oe.style.display = "flex", Oe.style.flexDirection = "column", Oe.style.borderRight = `1px solid ${B}`;
3096
- const ge = document.createElement("div");
3097
- ge.textContent = ee, ge.style.padding = "4px 8px", ge.style.fontSize = "11px", ge.style.fontWeight = "500", ge.style.backgroundColor = ve, ge.style.color = P, ge.style.borderBottom = `1px solid ${B}`, Oe.appendChild(ge);
3098
- const pe = document.createElement("div");
3099
- pe.style.flex = "1", pe.style.position = "relative", pe.style.overflow = "hidden";
3100
- const ye = document.createElement("div");
3101
- ye.style.position = "absolute", ye.style.left = "0", ye.style.right = "0", ye.style.top = "0", ye.style.bottom = "0", pe.appendChild(ye);
3102
- let Ne = null;
3103
- return Ae && (Ne = document.createElement("div"), Ne.className = "merge-editor-gutter", pe.appendChild(Ne)), Oe.appendChild(pe), { container: Oe, editorDiv: ye, gutterDiv: Ne };
3104
- }, H = Z((h == null ? void 0 : h.input1) || "Theirs", Q, m), J = Z((h == null ? void 0 : h.input2) || "Ours", _, m);
3105
- H.gutterDiv && ($e.current = H.gutterDiv), J.gutterDiv && (Ye.current = J.gutterDiv);
3106
- const se = !!n;
3107
- let oe = null;
3108
- if (se) {
3109
- oe = Z((h == null ? void 0 : h.base) || "Base", Y, !1);
3110
- const ee = [];
3111
- d === 0 ? ee.push(oe.container, H.container, J.container) : d === 1 ? ee.push(H.container, oe.container, J.container) : d === 2 && ee.push(H.container, J.container, oe.container), ee.forEach((ve) => {
3112
- O.appendChild(ve);
3092
+ return ye;
3093
+ }, Z = F("mergeEditor.conflict.input1.header.background", N ? "#4B1818" : "#FFE6E6"), z = F("editorGutter.background", N ? "#333" : "#f0f0f0"), j = F("mergeEditor.conflict.input2.header.background", N ? "#1B4B18" : "#E6FFE6"), ue = F("mergeEditor.result.header.background", N ? "#7F5F00" : "#FFECB3"), te = (Y, ye, Ee, $e = !1) => {
3094
+ const fe = document.createElement("div");
3095
+ fe.style.flex = "1", fe.style.display = "flex", fe.style.flexDirection = "column", fe.style.borderRight = `1px solid ${O}`, fe.style.overflow = "hidden", fe.style.transition = "flex 0.2s ease, min-width 0.2s ease, max-width 0.2s ease", fe.dataset.columnKey = Y;
3096
+ const K = document.createElement("div");
3097
+ K.style.padding = "4px 8px", K.style.fontSize = "11px", K.style.fontWeight = "500", K.style.backgroundColor = Ee, K.style.color = k, K.style.borderBottom = `1px solid ${O}`, K.style.display = "flex", K.style.alignItems = "center", K.style.gap = "4px", K.style.height = "22px", K.style.boxSizing = "content-box", K.style.whiteSpace = "nowrap", K.style.overflow = "hidden";
3098
+ const me = document.createElement("span");
3099
+ me.textContent = ye, me.style.flex = "1", me.style.overflow = "hidden", me.style.textOverflow = "ellipsis", K.appendChild(me);
3100
+ const ve = document.createElement("div");
3101
+ ve.className = "column-collapse-icon", ve.title = "Collapse column", ve.innerHTML = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" style="display:block"><path d="M8 2L4 6L8 10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>', ve.addEventListener("click", (pt) => {
3102
+ pt.stopPropagation(), ge((Qt) => {
3103
+ const tt = new Set(Qt);
3104
+ if (tt.has(Y))
3105
+ tt.delete(Y);
3106
+ else {
3107
+ if (Array.from(Re.current.keys()).filter((Tn) => !tt.has(Tn)).length <= 1) return Qt;
3108
+ tt.add(Y);
3109
+ }
3110
+ return tt;
3111
+ });
3112
+ }), K.appendChild(ve), fe.appendChild(K);
3113
+ const Le = document.createElement("div");
3114
+ Le.style.flex = "1", Le.style.position = "relative", Le.style.overflow = "hidden", Le.style.transition = "opacity 0.2s ease";
3115
+ const _e = document.createElement("div");
3116
+ _e.style.position = "absolute", _e.style.left = "0", _e.style.right = "0", _e.style.top = "0", _e.style.bottom = "0", Le.appendChild(_e);
3117
+ let Be = null;
3118
+ return $e && (Be = document.createElement("div"), Be.className = "merge-editor-gutter", Le.appendChild(Be)), fe.appendChild(Le), Re.current.set(Y, { container: fe, editorWrapper: Le, labelDiv: K, labelText: me, collapseIcon: ve }), { container: fe, editorDiv: _e, gutterDiv: Be };
3119
+ }, H = te("input1", (h == null ? void 0 : h.input1) || "Theirs", Z, m), J = te("input2", (h == null ? void 0 : h.input2) || "Ours", j, m);
3120
+ H.gutterDiv && (Ve.current = H.gutterDiv), J.gutterDiv && (Ze.current = J.gutterDiv);
3121
+ const ce = !!n;
3122
+ let ie = null;
3123
+ if (ce) {
3124
+ ie = te("base", (h == null ? void 0 : h.base) || "Base", z, !1);
3125
+ const Y = [];
3126
+ d === 0 ? Y.push(ie.container, H.container, J.container) : d === 1 ? Y.push(H.container, ie.container, J.container) : d === 2 && Y.push(H.container, J.container, ie.container), Y.forEach((ye) => {
3127
+ w.appendChild(ye);
3113
3128
  });
3114
3129
  } else
3115
- O.appendChild(H.container), O.appendChild(J.container);
3130
+ w.appendChild(H.container), w.appendChild(J.container);
3116
3131
  let G = null;
3117
- m && se && (G = Z((h == null ? void 0 : h.result) || "Result", ue, !0), Le.current = G.container.querySelector("div"), G.gutterDiv && (ke.current = G.gutterDiv), O.appendChild(G.container)), Ie.current.appendChild(O);
3118
- const ie = k.editor.createModel(t || "", E), z = se ? k.editor.createModel(n || "", E) : null, q = k.editor.createModel(r || "", E);
3119
- if (C.current = k.editor.create(H.editorDiv, {
3120
- model: ie,
3132
+ if (m && ce) {
3133
+ G = te("result", (h == null ? void 0 : h.result) || "Result", ue, !0);
3134
+ const Y = Re.current.get("result");
3135
+ Ie.current = (Y == null ? void 0 : Y.labelText) ?? G.container.querySelector("span"), G.gutterDiv && (je.current = G.gutterDiv), w.appendChild(G.container);
3136
+ }
3137
+ Qe.current.appendChild(w);
3138
+ const se = P.editor.createModel(t || "", I), C = ce ? P.editor.createModel(n || "", I) : null, q = P.editor.createModel(r || "", I);
3139
+ if (Q.current = P.editor.create(H.editorDiv, {
3140
+ model: se,
3121
3141
  readOnly: !0,
3122
3142
  automaticLayout: !0,
3123
3143
  folding: !m,
3124
3144
  glyphMargin: !1,
3125
3145
  ...i,
3126
3146
  lineDecorationsWidth: m ? 26 : 10
3127
- }), se && oe && (re.current = k.editor.create(oe.editorDiv, {
3128
- model: z,
3147
+ }), ce && ie && (pe.current = P.editor.create(ie.editorDiv, {
3148
+ model: C,
3129
3149
  readOnly: !0,
3130
3150
  automaticLayout: !0,
3131
3151
  folding: !m,
3132
3152
  glyphMargin: !1,
3133
3153
  ...i,
3134
3154
  lineDecorationsWidth: 10
3135
- })), K.current = k.editor.create(J.editorDiv, {
3155
+ })), ee.current = P.editor.create(J.editorDiv, {
3136
3156
  model: q,
3137
3157
  readOnly: !0,
3138
3158
  automaticLayout: !0,
@@ -3141,102 +3161,117 @@ function ro(e) {
3141
3161
  ...i,
3142
3162
  lineDecorationsWidth: m ? 26 : 10
3143
3163
  }), m && G) {
3144
- const ee = k.editor.createModel(r || "", E);
3145
- $.current = k.editor.create(G.editorDiv, {
3146
- model: ee,
3164
+ const Y = P.editor.createModel(r || "", I);
3165
+ B.current = P.editor.create(G.editorDiv, {
3166
+ model: Y,
3147
3167
  automaticLayout: !0,
3148
3168
  folding: !m,
3149
3169
  glyphMargin: !1,
3150
3170
  ...i,
3151
3171
  readOnly: !1,
3152
3172
  lineDecorationsWidth: 26
3153
- }), ee.onDidChangeContent(() => {
3154
- gt.current || ne(!0);
3173
+ }), Y.onDidChangeContent(() => {
3174
+ Nt.current || re(!0);
3155
3175
  });
3156
3176
  }
3157
- k.editor.setTheme(o);
3158
- const he = xt(z, ie, q);
3159
- F(he), De.current = !0, l && C.current && K.current && l(
3177
+ P.editor.setTheme(o);
3178
+ const he = Gt(C, se, q);
3179
+ U(he), Me.current = !0, l && Q.current && ee.current && l(
3160
3180
  {
3161
- input1: C.current,
3162
- input2: K.current,
3163
- base: re.current,
3164
- result: $.current
3181
+ input1: Q.current,
3182
+ input2: ee.current,
3183
+ base: pe.current,
3184
+ result: B.current
3165
3185
  },
3166
- k
3186
+ P
3167
3187
  );
3168
3188
  }
3169
- }, [i, o, t, r, n, m, d, b, xt, l, h]), Ft = le(m), Ut = le(d), Vt = le(L), Jt = le(n);
3189
+ }, [i, o, t, r, n, m, d, b, Gt, l, h]), Yt = ae(m), zt = ae(d), Ct = ae(_), Xt = ae(n);
3170
3190
  return Se(() => {
3171
- var P, U, Q, Y, _, ue, Z, H, J, se, oe;
3172
- const k = Ft.current !== m, O = Ut.current !== d, I = Vt.current !== L, B = Jt.current !== n;
3173
- if ((k || O || I || B) && De.current) {
3174
- Ft.current = m, Ut.current = d, Vt.current = L, Jt.current = n, Be.current.forEach((he) => {
3191
+ var k, F, Z, z, j, ue, te, H, J, ce, ie;
3192
+ const P = Yt.current !== m, w = zt.current !== d, N = Ct.current !== _, O = Xt.current !== n;
3193
+ if ((P || w || N || O) && Me.current) {
3194
+ Yt.current = m, zt.current = d, Ct.current = _, Xt.current = n, Je.current.forEach((he) => {
3175
3195
  he.remove();
3176
- }), Be.current.clear(), (P = Fe.current) == null || P.set([]), (U = Ue.current) == null || U.set([]), (Q = Ve.current) == null || Q.set([]), Fe.current = null, Ue.current = null, Ve.current = null;
3177
- const G = (Y = C.current) == null ? void 0 : Y.getModel(), ie = (_ = re.current) == null ? void 0 : _.getModel(), z = (ue = K.current) == null ? void 0 : ue.getModel(), q = (Z = $.current) == null ? void 0 : Z.getModel();
3178
- (H = C.current) == null || H.dispose(), (J = re.current) == null || J.dispose(), (se = K.current) == null || se.dispose(), (oe = $.current) == null || oe.dispose(), G == null || G.dispose(), ie == null || ie.dispose(), z == null || z.dispose(), q == null || q.dispose(), De.current = !1, Te((he) => he + 1);
3179
- }
3180
- }, [m, d, L, n]), Se(() => {
3181
- !b && fe.current && Ie.current && !De.current && Bt();
3182
- }, [b, Bt]), Se(() => {
3183
- !S || !i || (C.current && C.current.updateOptions(i), K.current && K.current.updateOptions(i), re.current && re.current.updateOptions(i), $.current && $.current.updateOptions(i));
3196
+ }), Je.current.clear(), Re.current.clear(), ge(/* @__PURE__ */ new Set()), (k = He.current) == null || k.set([]), (F = Ge.current) == null || F.set([]), (Z = We.current) == null || Z.set([]), He.current = null, Ge.current = null, We.current = null;
3197
+ const G = (z = Q.current) == null ? void 0 : z.getModel(), se = (j = pe.current) == null ? void 0 : j.getModel(), C = (ue = ee.current) == null ? void 0 : ue.getModel(), q = (te = B.current) == null ? void 0 : te.getModel();
3198
+ (H = Q.current) == null || H.dispose(), (J = pe.current) == null || J.dispose(), (ce = ee.current) == null || ce.dispose(), (ie = B.current) == null || ie.dispose(), G == null || G.dispose(), se == null || se.dispose(), C == null || C.dispose(), q == null || q.dispose(), Me.current = !1, Ne((he) => he + 1);
3199
+ }
3200
+ }, [m, d, _, n]), Se(() => {
3201
+ !b && we.current && Qe.current && !Me.current && qt();
3202
+ }, [b, qt]), Se(() => {
3203
+ !S || !i || (Q.current && Q.current.updateOptions(i), ee.current && ee.current.updateOptions(i), pe.current && pe.current.updateOptions(i), B.current && B.current.updateOptions(i));
3184
3204
  }, [i, S]), Se(() => {
3185
- S && T.length > 0 && ($t(), m && ot());
3186
- }, [S, T, $t, ot, m]), Se(() => {
3187
- S && T.length > 0 && m && $.current && rt(T);
3188
- }, [S, T, m, rt]), Se(() => {
3205
+ S && L.length > 0 && (Wt(), m && ft());
3206
+ }, [S, L, Wt, ft, m]), Se(() => {
3207
+ S && L.length > 0 && m && B.current && ut(L);
3208
+ }, [S, L, m, ut]), Se(() => {
3189
3209
  if (!S) return;
3190
- const k = () => {
3191
- w.length > 0 && nt(w);
3192
- }, O = [], I = () => {
3193
- ot();
3210
+ const P = () => {
3211
+ A.length > 0 && lt(A);
3212
+ }, w = [], N = () => {
3213
+ ft();
3194
3214
  };
3195
- return C.current && O.push(C.current.onDidScrollChange(I)), K.current && O.push(K.current.onDidScrollChange(I)), $.current && m && (O.push($.current.onDidScrollChange(k)), O.push($.current.onDidLayoutChange(k))), C.current && O.push(C.current.onDidLayoutChange(I)), K.current && O.push(K.current.onDidLayoutChange(I)), () => {
3196
- O.forEach((B) => {
3197
- B == null || B.dispose();
3215
+ return Q.current && w.push(Q.current.onDidScrollChange(N)), ee.current && w.push(ee.current.onDidScrollChange(N)), B.current && m && (w.push(B.current.onDidScrollChange(P)), w.push(B.current.onDidLayoutChange(P))), Q.current && w.push(Q.current.onDidLayoutChange(N)), ee.current && w.push(ee.current.onDidLayoutChange(N)), () => {
3216
+ w.forEach((O) => {
3217
+ O == null || O.dispose();
3198
3218
  });
3199
3219
  };
3200
- }, [S, ot, nt, m, w]), Se(() => {
3220
+ }, [S, ft, lt, m, A]), Se(() => {
3201
3221
  if (!S) return;
3202
- const k = [C.current, re.current, K.current];
3203
- m && $.current && k.push($.current);
3204
- const O = [];
3205
- let I = !1;
3206
- const B = (P) => {
3207
- if (I) return;
3208
- I = !0;
3209
- const U = P.getScrollTop(), Q = P.getScrollLeft();
3210
- k.forEach((Y) => {
3211
- Y && Y !== P && (Y.setScrollTop(U), Y.setScrollLeft(Q));
3222
+ const P = [Q.current, pe.current, ee.current];
3223
+ m && B.current && P.push(B.current);
3224
+ const w = [];
3225
+ let N = !1;
3226
+ const O = (k) => {
3227
+ if (N) return;
3228
+ N = !0;
3229
+ const F = k.getScrollTop(), Z = k.getScrollLeft();
3230
+ P.forEach((z) => {
3231
+ z && z !== k && (z.setScrollTop(F), z.setScrollLeft(Z));
3212
3232
  }), setTimeout(() => {
3213
- I = !1;
3233
+ N = !1;
3214
3234
  }, 10);
3215
3235
  };
3216
- return k.forEach((P) => {
3217
- P && O.push(
3218
- P.onDidScrollChange(() => {
3219
- B(P);
3236
+ return P.forEach((k) => {
3237
+ k && w.push(
3238
+ k.onDidScrollChange(() => {
3239
+ O(k);
3220
3240
  })
3221
3241
  );
3222
3242
  }), () => {
3223
- O.forEach((P) => {
3224
- P == null || P.dispose();
3243
+ w.forEach((k) => {
3244
+ k == null || k.dispose();
3225
3245
  });
3226
3246
  };
3227
- }, [S, m]), Se(() => () => {
3228
- var P, U, Q, Y, _, ue, Z, H, J, se, oe;
3229
- (P = Fe.current) == null || P.set([]), (U = Ue.current) == null || U.set([]), (Q = Ve.current) == null || Q.set([]);
3230
- const k = (Y = C.current) == null ? void 0 : Y.getModel(), O = (_ = re.current) == null ? void 0 : _.getModel(), I = (ue = K.current) == null ? void 0 : ue.getModel(), B = (Z = $.current) == null ? void 0 : Z.getModel();
3231
- (H = C.current) == null || H.dispose(), (J = re.current) == null || J.dispose(), (se = K.current) == null || se.dispose(), (oe = $.current) == null || oe.dispose(), k == null || k.dispose(), O == null || O.dispose(), I == null || I.dispose(), B == null || B.dispose(), De.current = !1, g(!1);
3232
- }, []), b || !S ? /* @__PURE__ */ st(On, { children: u ?? /* @__PURE__ */ st(Kr, {}) }) : /* @__PURE__ */ st("div", { ref: Ie, style: { width: s, height: c }, className: a });
3247
+ }, [S, m]), Se(() => {
3248
+ if (!S) return;
3249
+ const w = Array.from(Re.current.keys()).filter((N) => !oe.has(N)).length;
3250
+ for (const [N, O] of Re.current.entries()) {
3251
+ const k = oe.has(N), F = w > 1 || k;
3252
+ k ? (O.container.style.flex = "0 0 28px", O.container.style.minWidth = "28px", O.container.style.maxWidth = "28px", O.editorWrapper.style.opacity = "0", O.editorWrapper.style.pointerEvents = "none", O.labelDiv.style.justifyContent = "center", O.labelText.style.display = "none", O.collapseIcon.style.transform = "rotate(180deg)", O.collapseIcon.title = "Expand column") : (O.container.style.flex = "1", O.container.style.minWidth = "", O.container.style.maxWidth = "", O.editorWrapper.style.opacity = "1", O.editorWrapper.style.pointerEvents = "", O.labelDiv.style.justifyContent = "", O.labelText.style.display = "", O.collapseIcon.style.transform = "", O.collapseIcon.title = "Collapse column"), !k && !F ? (O.collapseIcon.classList.add("column-collapse-icon--disabled"), O.collapseIcon.title = "Cannot collapse last column") : O.collapseIcon.classList.remove("column-collapse-icon--disabled");
3253
+ }
3254
+ requestAnimationFrame(() => {
3255
+ var N;
3256
+ for (const [O] of Re.current.entries())
3257
+ if (!oe.has(O)) {
3258
+ const k = O === "input1" ? Q : O === "input2" ? ee : O === "base" ? pe : O === "result" ? B : null;
3259
+ (N = k == null ? void 0 : k.current) == null || N.layout();
3260
+ }
3261
+ });
3262
+ }, [S, oe]), Se(() => () => {
3263
+ var k, F, Z, z, j, ue, te, H, J, ce, ie;
3264
+ (k = He.current) == null || k.set([]), (F = Ge.current) == null || F.set([]), (Z = We.current) == null || Z.set([]);
3265
+ const P = (z = Q.current) == null ? void 0 : z.getModel(), w = (j = pe.current) == null ? void 0 : j.getModel(), N = (ue = ee.current) == null ? void 0 : ue.getModel(), O = (te = B.current) == null ? void 0 : te.getModel();
3266
+ (H = Q.current) == null || H.dispose(), (J = pe.current) == null || J.dispose(), (ce = ee.current) == null || ce.dispose(), (ie = B.current) == null || ie.dispose(), P == null || P.dispose(), w == null || w.dispose(), N == null || N.dispose(), O == null || O.dispose(), Me.current = !1, g(!1);
3267
+ }, []), b || !S ? /* @__PURE__ */ ht(In, { children: u ?? /* @__PURE__ */ ht(io, {}) }) : /* @__PURE__ */ ht("div", { ref: Qe, style: { width: s, height: c }, className: a });
3233
3268
  }
3234
3269
  export {
3235
- ro as JsonDiffMergeEditor,
3236
- Fr as analyzeConflicts,
3237
- Ur as analyzeTwoWayConflicts,
3238
- no as computeDiffs,
3239
- Jr as computeDiffsJsonPatch,
3240
- Hr as computeLineConflictType
3270
+ fo as JsonDiffMergeEditor,
3271
+ Wr as analyzeConflicts,
3272
+ qr as analyzeTwoWayConflicts,
3273
+ uo as computeDiffs,
3274
+ zr as computeDiffsJsonPatch,
3275
+ Cr as computeLineConflictType
3241
3276
  };
3242
3277
  //# sourceMappingURL=index.mjs.map