@kelet-ai/feedback-ui 0.7.1 → 1.0.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.
@@ -1,8 +1,8 @@
1
- import Ae, { createContext as ke, useContext as ae, useCallback as W, isValidElement as Z, cloneElement as Q, useState as X, useRef as z, useId as ce, useEffect as Ee } from "react";
1
+ import Ae, { createContext as ke, useContext as ae, useCallback as q, isValidElement as Z, cloneElement as Q, useState as X, useRef as z, useId as fe, useEffect as Ee } from "react";
2
2
  function _e(t) {
3
3
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
4
4
  }
5
- function je(t) {
5
+ function Ne(t) {
6
6
  if (Object.prototype.hasOwnProperty.call(t, "__esModule")) return t;
7
7
  var e = t.default;
8
8
  if (typeof e == "function") {
@@ -36,22 +36,22 @@ var re = { exports: {} }, V = {};
36
36
  * This source code is licensed under the MIT license found in the
37
37
  * LICENSE file in the root directory of this source tree.
38
38
  */
39
- var fe;
40
- function Ne() {
41
- if (fe) return V;
42
- fe = 1;
39
+ var ce;
40
+ function je() {
41
+ if (ce) return V;
42
+ ce = 1;
43
43
  var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
44
44
  function n(r, o, u) {
45
- var f = null;
46
- if (u !== void 0 && (f = "" + u), o.key !== void 0 && (f = "" + o.key), "key" in o) {
45
+ var p = null;
46
+ if (u !== void 0 && (p = "" + u), o.key !== void 0 && (p = "" + o.key), "key" in o) {
47
47
  u = {};
48
- for (var d in o)
49
- d !== "key" && (u[d] = o[d]);
48
+ for (var f in o)
49
+ f !== "key" && (u[f] = o[f]);
50
50
  } else u = o;
51
51
  return o = u.ref, {
52
52
  $$typeof: t,
53
53
  type: r,
54
- key: f,
54
+ key: p,
55
55
  ref: o !== void 0 ? o : null,
56
56
  props: u
57
57
  };
@@ -79,13 +79,13 @@ function Se() {
79
79
  switch (a) {
80
80
  case w:
81
81
  return "Fragment";
82
- case R:
83
- return "Profiler";
84
82
  case D:
83
+ return "Profiler";
84
+ case C:
85
85
  return "StrictMode";
86
- case O:
86
+ case P:
87
87
  return "Suspense";
88
- case N:
88
+ case j:
89
89
  return "SuspenseList";
90
90
  case l:
91
91
  return "Activity";
@@ -96,19 +96,19 @@ function Se() {
96
96
  ), a.$$typeof) {
97
97
  case h:
98
98
  return "Portal";
99
- case g:
99
+ case O:
100
100
  return (a.displayName || "Context") + ".Provider";
101
- case b:
101
+ case v:
102
102
  return (a._context.displayName || "Context") + ".Consumer";
103
103
  case k:
104
- var C = a.render;
105
- return a = a.displayName, a || (a = C.displayName || C.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
106
- case F:
107
- return C = a.displayName || null, C !== null ? C : t(a.type) || "Memo";
104
+ var T = a.render;
105
+ return a = a.displayName, a || (a = T.displayName || T.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
106
+ case S:
107
+ return T = a.displayName || null, T !== null ? T : t(a.type) || "Memo";
108
108
  case i:
109
- C = a._payload, a = a._init;
109
+ T = a._payload, a = a._init;
110
110
  try {
111
- return t(a(C));
111
+ return t(a(T));
112
112
  } catch {
113
113
  }
114
114
  }
@@ -120,17 +120,17 @@ function Se() {
120
120
  function n(a) {
121
121
  try {
122
122
  e(a);
123
- var C = !1;
123
+ var T = !1;
124
124
  } catch {
125
- C = !0;
125
+ T = !0;
126
126
  }
127
- if (C) {
128
- C = console;
129
- var _ = C.error, j = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
127
+ if (T) {
128
+ T = console;
129
+ var _ = T.error, N = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
130
130
  return _.call(
131
- C,
131
+ T,
132
132
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
133
- j
133
+ N
134
134
  ), e(a);
135
135
  }
136
136
  }
@@ -139,31 +139,31 @@ function Se() {
139
139
  if (typeof a == "object" && a !== null && a.$$typeof === i)
140
140
  return "<...>";
141
141
  try {
142
- var C = t(a);
143
- return C ? "<" + C + ">" : "<...>";
142
+ var T = t(a);
143
+ return T ? "<" + T + ">" : "<...>";
144
144
  } catch {
145
145
  return "<...>";
146
146
  }
147
147
  }
148
148
  function o() {
149
- var a = c.A;
149
+ var a = d.A;
150
150
  return a === null ? null : a.getOwner();
151
151
  }
152
152
  function u() {
153
153
  return Error("react-stack-top-frame");
154
154
  }
155
- function f(a) {
156
- if (v.call(a, "key")) {
157
- var C = Object.getOwnPropertyDescriptor(a, "key").get;
158
- if (C && C.isReactWarning) return !1;
155
+ function p(a) {
156
+ if (b.call(a, "key")) {
157
+ var T = Object.getOwnPropertyDescriptor(a, "key").get;
158
+ if (T && T.isReactWarning) return !1;
159
159
  }
160
160
  return a.key !== void 0;
161
161
  }
162
- function d(a, C) {
162
+ function f(a, T) {
163
163
  function _() {
164
164
  M || (M = !0, console.error(
165
165
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
166
- C
166
+ T
167
167
  ));
168
168
  }
169
169
  _.isReactWarning = !0, Object.defineProperty(a, "key", {
@@ -171,22 +171,22 @@ function Se() {
171
171
  configurable: !0
172
172
  });
173
173
  }
174
- function p() {
174
+ function c() {
175
175
  var a = t(this.type);
176
- return I[a] || (I[a] = !0, console.error(
176
+ return F[a] || (F[a] = !0, console.error(
177
177
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
178
178
  )), a = this.props.ref, a !== void 0 ? a : null;
179
179
  }
180
- function y(a, C, _, j, q, $, B, U) {
180
+ function y(a, T, _, N, W, $, B, U) {
181
181
  return _ = $.ref, a = {
182
- $$typeof: x,
182
+ $$typeof: E,
183
183
  type: a,
184
- key: C,
184
+ key: T,
185
185
  props: $,
186
- _owner: q
186
+ _owner: W
187
187
  }, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(a, "ref", {
188
188
  enumerable: !1,
189
- get: p
189
+ get: c
190
190
  }) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
191
191
  configurable: !1,
192
192
  enumerable: !1,
@@ -209,101 +209,101 @@ function Se() {
209
209
  value: U
210
210
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
211
211
  }
212
- function m(a, C, _, j, q, $, B, U) {
213
- var S = C.children;
214
- if (S !== void 0)
215
- if (j)
216
- if (A(S)) {
217
- for (j = 0; j < S.length; j++)
218
- P(S[j]);
219
- Object.freeze && Object.freeze(S);
212
+ function m(a, T, _, N, W, $, B, U) {
213
+ var I = T.children;
214
+ if (I !== void 0)
215
+ if (N)
216
+ if (A(I)) {
217
+ for (N = 0; N < I.length; N++)
218
+ R(I[N]);
219
+ Object.freeze && Object.freeze(I);
220
220
  } else
221
221
  console.error(
222
222
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
223
223
  );
224
- else P(S);
225
- if (v.call(C, "key")) {
226
- S = t(a);
227
- var Y = Object.keys(C).filter(function(De) {
224
+ else R(I);
225
+ if (b.call(T, "key")) {
226
+ I = t(a);
227
+ var Y = Object.keys(T).filter(function(De) {
228
228
  return De !== "key";
229
229
  });
230
- j = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", ne[S + j] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
230
+ N = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", ne[I + N] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
231
231
  `A props object containing a "key" prop is being spread into JSX:
232
232
  let props = %s;
233
233
  <%s {...props} />
234
234
  React keys must be passed directly to JSX without using spread:
235
235
  let props = %s;
236
236
  <%s key={someKey} {...props} />`,
237
- j,
238
- S,
237
+ N,
238
+ I,
239
239
  Y,
240
- S
241
- ), ne[S + j] = !0);
240
+ I
241
+ ), ne[I + N] = !0);
242
242
  }
243
- if (S = null, _ !== void 0 && (n(_), S = "" + _), f(C) && (n(C.key), S = "" + C.key), "key" in C) {
243
+ if (I = null, _ !== void 0 && (n(_), I = "" + _), p(T) && (n(T.key), I = "" + T.key), "key" in T) {
244
244
  _ = {};
245
- for (var le in C)
246
- le !== "key" && (_[le] = C[le]);
247
- } else _ = C;
248
- return S && d(
245
+ for (var le in T)
246
+ le !== "key" && (_[le] = T[le]);
247
+ } else _ = T;
248
+ return I && f(
249
249
  _,
250
250
  typeof a == "function" ? a.displayName || a.name || "Unknown" : a
251
251
  ), y(
252
252
  a,
253
- S,
253
+ I,
254
254
  $,
255
- q,
255
+ W,
256
256
  o(),
257
257
  _,
258
258
  B,
259
259
  U
260
260
  );
261
261
  }
262
- function P(a) {
263
- typeof a == "object" && a !== null && a.$$typeof === x && a._store && (a._store.validated = 1);
262
+ function R(a) {
263
+ typeof a == "object" && a !== null && a.$$typeof === E && a._store && (a._store.validated = 1);
264
264
  }
265
- var E = Ae, x = Symbol.for("react.transitional.element"), h = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), D = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), g = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), N = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), i = Symbol.for("react.lazy"), l = Symbol.for("react.activity"), s = Symbol.for("react.client.reference"), c = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, v = Object.prototype.hasOwnProperty, A = Array.isArray, T = console.createTask ? console.createTask : function() {
265
+ var g = Ae, E = Symbol.for("react.transitional.element"), h = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), O = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), j = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), i = Symbol.for("react.lazy"), l = Symbol.for("react.activity"), s = Symbol.for("react.client.reference"), d = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, b = Object.prototype.hasOwnProperty, A = Array.isArray, x = console.createTask ? console.createTask : function() {
266
266
  return null;
267
267
  };
268
- E = {
268
+ g = {
269
269
  react_stack_bottom_frame: function(a) {
270
270
  return a();
271
271
  }
272
272
  };
273
- var M, I = {}, K = E.react_stack_bottom_frame.bind(
274
- E,
273
+ var M, F = {}, K = g.react_stack_bottom_frame.bind(
274
+ g,
275
275
  u
276
- )(), J = T(r(u)), ne = {};
277
- G.Fragment = w, G.jsx = function(a, C, _, j, q) {
278
- var $ = 1e4 > c.recentlyCreatedOwnerStacks++;
276
+ )(), J = x(r(u)), ne = {};
277
+ G.Fragment = w, G.jsx = function(a, T, _, N, W) {
278
+ var $ = 1e4 > d.recentlyCreatedOwnerStacks++;
279
279
  return m(
280
280
  a,
281
- C,
281
+ T,
282
282
  _,
283
283
  !1,
284
- j,
285
- q,
284
+ N,
285
+ W,
286
286
  $ ? Error("react-stack-top-frame") : K,
287
- $ ? T(r(a)) : J
287
+ $ ? x(r(a)) : J
288
288
  );
289
- }, G.jsxs = function(a, C, _, j, q) {
290
- var $ = 1e4 > c.recentlyCreatedOwnerStacks++;
289
+ }, G.jsxs = function(a, T, _, N, W) {
290
+ var $ = 1e4 > d.recentlyCreatedOwnerStacks++;
291
291
  return m(
292
292
  a,
293
- C,
293
+ T,
294
294
  _,
295
295
  !0,
296
- j,
297
- q,
296
+ N,
297
+ W,
298
298
  $ ? Error("react-stack-top-frame") : K,
299
- $ ? T(r(a)) : J
299
+ $ ? x(r(a)) : J
300
300
  );
301
301
  };
302
302
  }()), G;
303
303
  }
304
304
  var pe;
305
305
  function Ie() {
306
- return pe || (pe = 1, process.env.NODE_ENV === "production" ? re.exports = Ne() : re.exports = Se()), re.exports;
306
+ return pe || (pe = 1, process.env.NODE_ENV === "production" ? re.exports = je() : re.exports = Se()), re.exports;
307
307
  }
308
308
  var L = Ie();
309
309
  const se = ke(null), Fe = "https://api.kelet.ai/api", pt = () => {
@@ -323,37 +323,37 @@ const se = ke(null), Fe = "https://api.kelet.ai/api", pt = () => {
323
323
  throw new Error(
324
324
  "apiKey is required either directly or from a parent KeletProvider"
325
325
  );
326
- const d = {
326
+ const f = {
327
327
  api_key: u,
328
328
  project: e,
329
- feedback: async (p) => {
330
- const m = `${n || Fe}/projects/${e}/feedback`, P = {
331
- tx_id: p.tx_id,
332
- source: p.source || "EXPLICIT",
333
- vote: p.vote,
334
- explanation: p.explanation,
335
- correction: p.correction,
336
- selection: p.selection
329
+ feedback: async (c) => {
330
+ const m = `${n || Fe}/projects/${e}/feedback`, R = {
331
+ tx_id: c.tx_id,
332
+ source: c.source || "EXPLICIT",
333
+ vote: c.vote,
334
+ explanation: c.explanation,
335
+ correction: c.correction,
336
+ selection: c.selection
337
337
  // Include trigger_name if needed in the future
338
- }, E = await fetch(m, {
338
+ }, g = await fetch(m, {
339
339
  method: "POST",
340
340
  headers: {
341
341
  "Content-Type": "application/json",
342
342
  Authorization: `Bearer ${u}`
343
343
  },
344
- body: JSON.stringify(P)
344
+ body: JSON.stringify(R)
345
345
  });
346
- if (!E.ok)
347
- throw new Error(`Failed to submit feedback: ${E.statusText}`);
346
+ if (!g.ok)
347
+ throw new Error(`Failed to submit feedback: ${g.statusText}`);
348
348
  }
349
349
  };
350
- return /* @__PURE__ */ L.jsx(se.Provider, { value: d, children: r });
350
+ return /* @__PURE__ */ L.jsx(se.Provider, { value: f, children: r });
351
351
  }, ee = (t, e) => {
352
352
  const n = { ...e };
353
353
  for (const r in e) {
354
354
  const o = t[r], u = e[r];
355
- /^on[A-Z]/.test(r) ? o && u ? n[r] = (...d) => {
356
- u(...d), o(...d);
355
+ /^on[A-Z]/.test(r) ? o && u ? n[r] = (...f) => {
356
+ u(...f), o(...f);
357
357
  } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...u } : r === "className" ? n[r] = [o, u].filter(Boolean).join(" ") : n[r] = u !== void 0 ? u : o;
358
358
  }
359
359
  return { ...t, ...n };
@@ -374,104 +374,104 @@ const se = ke(null), Fe = "https://api.kelet.ai/api", pt = () => {
374
374
  extra_metadata: o,
375
375
  trigger_name: u
376
376
  }) => {
377
- const f = typeof r == "function" ? r() : r, [d, p] = X(!1), [y, m] = X(n), [P, E] = X(!1), [x, h] = X(null), w = z(null), D = z(null), R = ce(), b = ce(), g = Pe(), k = e || g;
377
+ const p = typeof r == "function" ? r() : r, [f, c] = X(!1), [y, m] = X(n), [R, g] = X(!1), [E, h] = X(null), w = z(null), C = z(null), D = fe(), v = fe(), O = Pe(), k = e || O;
378
378
  Ee(() => {
379
- p(!1), m(n), E(!1), h(null), setTimeout(() => D.current?.focus(), 0);
380
- }, [f, n]);
381
- const O = W(async () => {
379
+ c(!1), m(n), g(!1), h(null), setTimeout(() => C.current?.focus(), 0);
380
+ }, [p, n]);
381
+ const P = q(async () => {
382
382
  h("upvote");
383
- const c = {
384
- tx_id: f,
383
+ const d = {
384
+ tx_id: p,
385
385
  vote: "upvote",
386
386
  ...o && { extra_metadata: o },
387
387
  ...u && { trigger_name: u }
388
388
  };
389
389
  try {
390
- E(!0), await k(c);
390
+ g(!0), await k(d);
391
391
  } finally {
392
- E(!1);
392
+ g(!1);
393
393
  }
394
- }, [k, f, o, u]), N = W(async () => {
394
+ }, [k, p, o, u]), j = q(async () => {
395
395
  if (h("downvote"), k) {
396
- const c = {
397
- tx_id: f,
396
+ const d = {
397
+ tx_id: p,
398
398
  vote: "downvote",
399
399
  ...o && { extra_metadata: o },
400
400
  ...u && { trigger_name: u }
401
401
  };
402
402
  try {
403
- E(!0), await k(c);
403
+ g(!0), await k(d);
404
404
  } finally {
405
- E(!1);
405
+ g(!1);
406
406
  }
407
407
  }
408
- p(!0), setTimeout(() => {
408
+ c(!0), setTimeout(() => {
409
409
  w.current?.focus();
410
- const c = document.createElement("div");
411
- c.setAttribute("aria-live", "polite"), c.setAttribute("aria-atomic", "true"), c.className = "sr-only", c.textContent = "Feedback dialog opened. You can provide additional details about your downvote.", document.body.appendChild(c), setTimeout(() => document.body.removeChild(c), 1e3);
410
+ const d = document.createElement("div");
411
+ d.setAttribute("aria-live", "polite"), d.setAttribute("aria-atomic", "true"), d.className = "sr-only", d.textContent = "Feedback dialog opened. You can provide additional details about your downvote.", document.body.appendChild(d), setTimeout(() => document.body.removeChild(d), 1e3);
412
412
  }, 0);
413
- }, [k, f, o, u]), F = W(
414
- (c) => {
415
- m(c.target.value);
413
+ }, [k, p, o, u]), S = q(
414
+ (d) => {
415
+ m(d.target.value);
416
416
  },
417
417
  []
418
- ), i = W(async () => {
419
- const c = y.trim().length > 0;
420
- if (c) {
421
- const v = {
422
- tx_id: f,
418
+ ), i = q(async () => {
419
+ const d = y.trim().length > 0;
420
+ if (d) {
421
+ const b = {
422
+ tx_id: p,
423
423
  vote: "downvote",
424
424
  explanation: y,
425
425
  ...o && { extra_metadata: o },
426
426
  ...u && { trigger_name: u }
427
427
  };
428
428
  try {
429
- E(!0), await k(v);
429
+ g(!0), await k(b);
430
430
  } finally {
431
- E(!1);
431
+ g(!1);
432
432
  }
433
433
  }
434
- if (p(!1), m(n), D.current?.focus(), c) {
435
- const v = document.createElement("div");
436
- v.setAttribute("aria-live", "polite"), v.className = "sr-only", v.textContent = "Feedback submitted successfully.", document.body.appendChild(v), setTimeout(() => document.body.removeChild(v), 1e3);
434
+ if (c(!1), m(n), C.current?.focus(), d) {
435
+ const b = document.createElement("div");
436
+ b.setAttribute("aria-live", "polite"), b.className = "sr-only", b.textContent = "Feedback submitted successfully.", document.body.appendChild(b), setTimeout(() => document.body.removeChild(b), 1e3);
437
437
  }
438
- }, [k, y, n, f, o, u]), l = W(
439
- (c) => {
440
- if (c.key === "Escape")
441
- p(!1), m(n), D.current?.focus();
442
- else if ((c.metaKey || c.ctrlKey) && c.key === "Enter")
443
- c.preventDefault(), i().then((v) => {
438
+ }, [k, y, n, p, o, u]), l = q(
439
+ (d) => {
440
+ if (d.key === "Escape")
441
+ c(!1), m(n), C.current?.focus();
442
+ else if ((d.metaKey || d.ctrlKey) && d.key === "Enter")
443
+ d.preventDefault(), i().then((b) => {
444
444
  });
445
- else if (c.key === "Tab" && d) {
446
- const v = document.getElementById(R);
447
- if (v) {
448
- const A = v.querySelectorAll(
445
+ else if (d.key === "Tab" && f) {
446
+ const b = document.getElementById(D);
447
+ if (b) {
448
+ const A = b.querySelectorAll(
449
449
  'button, textarea, input, select, a[href], [tabindex]:not([tabindex="-1"])'
450
- ), T = A[0], M = A[A.length - 1];
451
- c.shiftKey && document.activeElement === T ? (c.preventDefault(), M?.focus()) : !c.shiftKey && document.activeElement === M && (c.preventDefault(), T?.focus());
450
+ ), x = A[0], M = A[A.length - 1];
451
+ d.shiftKey && document.activeElement === x ? (d.preventDefault(), M?.focus()) : !d.shiftKey && document.activeElement === M && (d.preventDefault(), x?.focus());
452
452
  }
453
453
  }
454
454
  },
455
- [i, d, R, n]
455
+ [i, f, D, n]
456
456
  ), s = {
457
457
  onFeedback: k,
458
- showPopover: d,
459
- setShowPopover: p,
458
+ showPopover: f,
459
+ setShowPopover: c,
460
460
  feedbackText: y,
461
461
  setFeedbackText: m,
462
- isSubmitting: P,
463
- setIsSubmitting: E,
464
- vote: x,
465
- handleUpvote: O,
466
- handleDownvote: N,
467
- handleTextareaChange: F,
462
+ isSubmitting: R,
463
+ setIsSubmitting: g,
464
+ vote: E,
465
+ handleUpvote: P,
466
+ handleDownvote: j,
467
+ handleTextareaChange: S,
468
468
  handleSubmit: i,
469
469
  handleKeyDown: l,
470
470
  textareaRef: w,
471
- triggerRef: D,
472
- popoverId: R,
473
- triggerId: b,
474
- tx_id: f,
471
+ triggerRef: C,
472
+ popoverId: D,
473
+ triggerId: v,
474
+ tx_id: p,
475
475
  extra_metadata: o,
476
476
  trigger_name: u
477
477
  };
@@ -482,27 +482,27 @@ const se = ke(null), Fe = "https://api.kelet.ai/api", pt = () => {
482
482
  onClick: n,
483
483
  ...r
484
484
  }) => {
485
- const { handleUpvote: o, isSubmitting: u, vote: f } = te(), d = W(
485
+ const { handleUpvote: o, isSubmitting: u, vote: p } = te(), f = q(
486
486
  (m) => {
487
487
  o(), n?.(m);
488
488
  },
489
489
  [o, n]
490
- ), p = {
490
+ ), c = {
491
491
  ...r,
492
- onClick: d,
492
+ onClick: f,
493
493
  disabled: u || r.disabled,
494
494
  "aria-label": r["aria-label"] || "Upvote feedback",
495
495
  type: "button"
496
- }, y = f === "upvote";
496
+ }, y = p === "upvote";
497
497
  if (t) {
498
498
  const m = typeof e == "function" ? e({ isSelected: y }) : e;
499
499
  if (Z(m))
500
500
  return Q(
501
501
  m,
502
- ee(p, m.props)
502
+ ee(c, m.props)
503
503
  );
504
504
  }
505
- return /* @__PURE__ */ L.jsx("button", { ...p, children: typeof e == "function" ? e({ isSelected: y }) : e });
505
+ return /* @__PURE__ */ L.jsx("button", { ...c, children: typeof e == "function" ? e({ isSelected: y }) : e });
506
506
  }, $e = ({
507
507
  asChild: t,
508
508
  children: e,
@@ -512,43 +512,43 @@ const se = ke(null), Fe = "https://api.kelet.ai/api", pt = () => {
512
512
  const {
513
513
  handleDownvote: o,
514
514
  showPopover: u,
515
- isSubmitting: f,
516
- popoverId: d,
517
- triggerId: p,
515
+ isSubmitting: p,
516
+ popoverId: f,
517
+ triggerId: c,
518
518
  triggerRef: y,
519
519
  vote: m
520
- } = te(), P = W(
520
+ } = te(), R = q(
521
521
  (h) => {
522
522
  o(), n?.(h);
523
523
  },
524
524
  [o, n]
525
- ), E = {
525
+ ), g = {
526
526
  ...r,
527
527
  ref: y,
528
- onClick: P,
529
- disabled: f || r.disabled,
528
+ onClick: R,
529
+ disabled: p || r.disabled,
530
530
  "aria-label": r["aria-label"] || "Downvote feedback",
531
531
  "aria-expanded": u,
532
- "aria-controls": d,
533
- id: p,
532
+ "aria-controls": f,
533
+ id: c,
534
534
  type: "button"
535
- }, x = m === "downvote";
535
+ }, E = m === "downvote";
536
536
  if (t) {
537
- const h = typeof e == "function" ? e({ isSelected: x }) : e;
537
+ const h = typeof e == "function" ? e({ isSelected: E }) : e;
538
538
  if (Z(h))
539
- return Q(h, ee(E, h.props));
539
+ return Q(h, ee(g, h.props));
540
540
  if (h)
541
541
  return h;
542
542
  }
543
- return /* @__PURE__ */ L.jsx("button", { ...E, children: typeof e == "function" ? e({ isSelected: x }) : e });
544
- }, qe = ({ asChild: t, children: e, ...n }) => {
545
- const { showPopover: r, handleKeyDown: o, popoverId: u, triggerId: f } = te();
543
+ return /* @__PURE__ */ L.jsx("button", { ...g, children: typeof e == "function" ? e({ isSelected: E }) : e });
544
+ }, We = ({ asChild: t, children: e, ...n }) => {
545
+ const { showPopover: r, handleKeyDown: o, popoverId: u, triggerId: p } = te();
546
546
  if (!r)
547
547
  return null;
548
- const d = {
548
+ const f = {
549
549
  ...n,
550
550
  role: "dialog",
551
- "aria-labelledby": f,
551
+ "aria-labelledby": p,
552
552
  "aria-modal": !0,
553
553
  "aria-describedby": `${u}-description`,
554
554
  id: u,
@@ -558,29 +558,29 @@ const se = ke(null), Fe = "https://api.kelet.ai/api", pt = () => {
558
558
  return t && Z(e) ? /* @__PURE__ */ L.jsxs(L.Fragment, { children: [
559
559
  Q(
560
560
  e,
561
- ee(d, e.props)
561
+ ee(f, e.props)
562
562
  ),
563
563
  /* @__PURE__ */ L.jsx("div", { id: `${u}-description`, className: "sr-only", children: "Provide additional feedback for your downvote" })
564
- ] }) : /* @__PURE__ */ L.jsxs("div", { ...d, children: [
564
+ ] }) : /* @__PURE__ */ L.jsxs("div", { ...f, children: [
565
565
  /* @__PURE__ */ L.jsx("div", { id: `${u}-description`, className: "sr-only", children: "Provide additional feedback for your downvote" }),
566
566
  e
567
567
  ] });
568
- }, We = ({ asChild: t, value: e, onChange: n, ...r }) => {
568
+ }, qe = ({ asChild: t, value: e, onChange: n, ...r }) => {
569
569
  const {
570
570
  feedbackText: o,
571
571
  handleTextareaChange: u,
572
- textareaRef: f,
573
- handleKeyDown: d,
574
- popoverId: p
572
+ textareaRef: p,
573
+ handleKeyDown: f,
574
+ popoverId: c
575
575
  } = te(), y = {
576
576
  ...r,
577
- ref: f,
577
+ ref: p,
578
578
  value: e !== void 0 ? e : o,
579
579
  onChange: n || u,
580
- onKeyDown: d,
580
+ onKeyDown: f,
581
581
  placeholder: r.placeholder || "What did we miss?",
582
582
  "aria-label": r["aria-label"] || "Additional feedback",
583
- "aria-describedby": `${p}-help`,
583
+ "aria-describedby": `${c}-help`,
584
584
  rows: r.rows || 3
585
585
  };
586
586
  return t && Z(r.children) ? Q(
@@ -593,35 +593,35 @@ const se = ke(null), Fe = "https://api.kelet.ai/api", pt = () => {
593
593
  onClick: n,
594
594
  ...r
595
595
  }) => {
596
- const { handleSubmit: o, isSubmitting: u, feedbackText: f } = te(), d = W(
597
- (P) => {
598
- o(), n?.(P);
596
+ const { handleSubmit: o, isSubmitting: u, feedbackText: p } = te(), f = q(
597
+ (R) => {
598
+ o(), n?.(R);
599
599
  },
600
600
  [o, n]
601
- ), p = f.trim().length > 0, y = p ? "Submit feedback" : "Close without feedback", m = {
601
+ ), c = p.trim().length > 0, y = c ? "Submit feedback" : "Close without feedback", m = {
602
602
  ...r,
603
- onClick: d,
603
+ onClick: f,
604
604
  disabled: u || r.disabled,
605
605
  type: "button",
606
606
  "aria-label": r["aria-label"] || y,
607
- "aria-describedby": p ? void 0 : "submit-help"
607
+ "aria-describedby": c ? void 0 : "submit-help"
608
608
  };
609
609
  return t && Z(e) ? /* @__PURE__ */ L.jsxs(L.Fragment, { children: [
610
610
  Q(
611
611
  e,
612
612
  ee(m, e.props)
613
613
  ),
614
- !p && /* @__PURE__ */ L.jsx("span", { id: "submit-help", className: "sr-only", children: "This will close the dialog without submitting feedback" })
614
+ !c && /* @__PURE__ */ L.jsx("span", { id: "submit-help", className: "sr-only", children: "This will close the dialog without submitting feedback" })
615
615
  ] }) : /* @__PURE__ */ L.jsxs("button", { ...m, children: [
616
616
  e,
617
- !p && /* @__PURE__ */ L.jsx("span", { id: "submit-help", className: "sr-only", children: "This will close the dialog without submitting feedback" })
617
+ !c && /* @__PURE__ */ L.jsx("span", { id: "submit-help", className: "sr-only", children: "This will close the dialog without submitting feedback" })
618
618
  ] });
619
619
  }, mt = {
620
620
  Root: Le,
621
621
  UpvoteButton: Me,
622
622
  DownvoteButton: $e,
623
- Popover: qe,
624
- Textarea: We,
623
+ Popover: We,
624
+ Textarea: qe,
625
625
  SubmitButton: Ye
626
626
  };
627
627
  var ie = { exports: {} }, ze = ie.exports, he;
@@ -651,8 +651,8 @@ function He() {
651
651
  enumerable: !0
652
652
  });
653
653
  }
654
- function f(i, l, s) {
655
- f.super_.call(this, "E", i), Object.defineProperty(this, "lhs", {
654
+ function p(i, l, s) {
655
+ p.super_.call(this, "E", i), Object.defineProperty(this, "lhs", {
656
656
  value: l,
657
657
  enumerable: !0
658
658
  }), Object.defineProperty(this, "rhs", {
@@ -660,21 +660,21 @@ function He() {
660
660
  enumerable: !0
661
661
  });
662
662
  }
663
- o(f, u);
664
- function d(i, l) {
665
- d.super_.call(this, "N", i), Object.defineProperty(this, "rhs", {
663
+ o(p, u);
664
+ function f(i, l) {
665
+ f.super_.call(this, "N", i), Object.defineProperty(this, "rhs", {
666
666
  value: l,
667
667
  enumerable: !0
668
668
  });
669
669
  }
670
- o(d, u);
671
- function p(i, l) {
672
- p.super_.call(this, "D", i), Object.defineProperty(this, "lhs", {
670
+ o(f, u);
671
+ function c(i, l) {
672
+ c.super_.call(this, "D", i), Object.defineProperty(this, "lhs", {
673
673
  value: l,
674
674
  enumerable: !0
675
675
  });
676
676
  }
677
- o(p, u);
677
+ o(c, u);
678
678
  function y(i, l, s) {
679
679
  y.super_.call(this, "A", i), Object.defineProperty(this, "index", {
680
680
  value: l,
@@ -686,145 +686,145 @@ function He() {
686
686
  }
687
687
  o(y, u);
688
688
  function m(i, l, s) {
689
- var c = i.slice(l + 1 || i.length);
690
- return i.length = l < 0 ? i.length + l : l, i.push.apply(i, c), i;
689
+ var d = i.slice(l + 1 || i.length);
690
+ return i.length = l < 0 ? i.length + l : l, i.push.apply(i, d), i;
691
691
  }
692
- function P(i) {
692
+ function R(i) {
693
693
  var l = typeof i;
694
694
  return l !== "object" ? l : i === Math ? "math" : i === null ? "null" : Array.isArray(i) ? "array" : Object.prototype.toString.call(i) === "[object Date]" ? "date" : typeof i.toString == "function" && /^\/.*\//.test(i.toString()) ? "regexp" : "object";
695
695
  }
696
- function E(i) {
696
+ function g(i) {
697
697
  var l = 0;
698
698
  if (i.length === 0)
699
699
  return l;
700
700
  for (var s = 0; s < i.length; s++) {
701
- var c = i.charCodeAt(s);
702
- l = (l << 5) - l + c, l = l & l;
701
+ var d = i.charCodeAt(s);
702
+ l = (l << 5) - l + d, l = l & l;
703
703
  }
704
704
  return l;
705
705
  }
706
- function x(i) {
707
- var l = 0, s = P(i);
706
+ function E(i) {
707
+ var l = 0, s = R(i);
708
708
  if (s === "array") {
709
709
  i.forEach(function(M) {
710
- l += x(M);
710
+ l += E(M);
711
711
  });
712
- var c = "[type: array, hash: " + l + "]";
713
- return l + E(c);
712
+ var d = "[type: array, hash: " + l + "]";
713
+ return l + g(d);
714
714
  }
715
715
  if (s === "object") {
716
- for (var v in i)
717
- if (i.hasOwnProperty(v)) {
718
- var A = "[ type: object, key: " + v + ", value hash: " + x(i[v]) + "]";
719
- l += E(A);
716
+ for (var b in i)
717
+ if (i.hasOwnProperty(b)) {
718
+ var A = "[ type: object, key: " + b + ", value hash: " + E(i[b]) + "]";
719
+ l += g(A);
720
720
  }
721
721
  return l;
722
722
  }
723
- var T = "[ type: " + s + " ; value: " + i + "]";
724
- return l + E(T);
723
+ var x = "[ type: " + s + " ; value: " + i + "]";
724
+ return l + g(x);
725
725
  }
726
- function h(i, l, s, c, v, A, T, M) {
727
- s = s || [], v = v || [], T = T || [];
728
- var I = v.slice(0);
726
+ function h(i, l, s, d, b, A, x, M) {
727
+ s = s || [], b = b || [], x = x || [];
728
+ var F = b.slice(0);
729
729
  if (typeof A < "u" && A !== null) {
730
- if (c) {
731
- if (typeof c == "function" && c(I, A))
730
+ if (d) {
731
+ if (typeof d == "function" && d(F, A))
732
732
  return;
733
- if (typeof c == "object") {
734
- if (c.prefilter && c.prefilter(I, A))
733
+ if (typeof d == "object") {
734
+ if (d.prefilter && d.prefilter(F, A))
735
735
  return;
736
- if (c.normalize) {
737
- var K = c.normalize(I, A, i, l);
736
+ if (d.normalize) {
737
+ var K = d.normalize(F, A, i, l);
738
738
  K && (i = K[0], l = K[1]);
739
739
  }
740
740
  }
741
741
  }
742
- I.push(A);
742
+ F.push(A);
743
743
  }
744
- P(i) === "regexp" && P(l) === "regexp" && (i = i.toString(), l = l.toString());
745
- var J = typeof i, ne = typeof l, a, C, _, j, q = J !== "undefined" || T && T.length > 0 && T[T.length - 1].lhs && Object.getOwnPropertyDescriptor(T[T.length - 1].lhs, A), $ = ne !== "undefined" || T && T.length > 0 && T[T.length - 1].rhs && Object.getOwnPropertyDescriptor(T[T.length - 1].rhs, A);
746
- if (!q && $)
747
- s.push(new d(I, l));
748
- else if (!$ && q)
749
- s.push(new p(I, i));
750
- else if (P(i) !== P(l))
751
- s.push(new f(I, i, l));
752
- else if (P(i) === "date" && i - l !== 0)
753
- s.push(new f(I, i, l));
744
+ R(i) === "regexp" && R(l) === "regexp" && (i = i.toString(), l = l.toString());
745
+ var J = typeof i, ne = typeof l, a, T, _, N, W = J !== "undefined" || x && x.length > 0 && x[x.length - 1].lhs && Object.getOwnPropertyDescriptor(x[x.length - 1].lhs, A), $ = ne !== "undefined" || x && x.length > 0 && x[x.length - 1].rhs && Object.getOwnPropertyDescriptor(x[x.length - 1].rhs, A);
746
+ if (!W && $)
747
+ s.push(new f(F, l));
748
+ else if (!$ && W)
749
+ s.push(new c(F, i));
750
+ else if (R(i) !== R(l))
751
+ s.push(new p(F, i, l));
752
+ else if (R(i) === "date" && i - l !== 0)
753
+ s.push(new p(F, i, l));
754
754
  else if (J === "object" && i !== null && l !== null) {
755
- for (a = T.length - 1; a > -1; --a)
756
- if (T[a].lhs === i) {
757
- j = !0;
755
+ for (a = x.length - 1; a > -1; --a)
756
+ if (x[a].lhs === i) {
757
+ N = !0;
758
758
  break;
759
759
  }
760
- if (j)
761
- i !== l && s.push(new f(I, i, l));
760
+ if (N)
761
+ i !== l && s.push(new p(F, i, l));
762
762
  else {
763
- if (T.push({ lhs: i, rhs: l }), Array.isArray(i)) {
764
- for (M && (i.sort(function(S, Y) {
765
- return x(S) - x(Y);
766
- }), l.sort(function(S, Y) {
767
- return x(S) - x(Y);
768
- })), a = l.length - 1, C = i.length - 1; a > C; )
769
- s.push(new y(I, a, new d(void 0, l[a--])));
770
- for (; C > a; )
771
- s.push(new y(I, C, new p(void 0, i[C--])));
763
+ if (x.push({ lhs: i, rhs: l }), Array.isArray(i)) {
764
+ for (M && (i.sort(function(I, Y) {
765
+ return E(I) - E(Y);
766
+ }), l.sort(function(I, Y) {
767
+ return E(I) - E(Y);
768
+ })), a = l.length - 1, T = i.length - 1; a > T; )
769
+ s.push(new y(F, a, new f(void 0, l[a--])));
770
+ for (; T > a; )
771
+ s.push(new y(F, T, new c(void 0, i[T--])));
772
772
  for (; a >= 0; --a)
773
- h(i[a], l[a], s, c, I, a, T, M);
773
+ h(i[a], l[a], s, d, F, a, x, M);
774
774
  } else {
775
775
  var B = Object.keys(i), U = Object.keys(l);
776
776
  for (a = 0; a < B.length; ++a)
777
- _ = B[a], j = U.indexOf(_), j >= 0 ? (h(i[_], l[_], s, c, I, _, T, M), U[j] = null) : h(i[_], void 0, s, c, I, _, T, M);
777
+ _ = B[a], N = U.indexOf(_), N >= 0 ? (h(i[_], l[_], s, d, F, _, x, M), U[N] = null) : h(i[_], void 0, s, d, F, _, x, M);
778
778
  for (a = 0; a < U.length; ++a)
779
- _ = U[a], _ && h(void 0, l[_], s, c, I, _, T, M);
779
+ _ = U[a], _ && h(void 0, l[_], s, d, F, _, x, M);
780
780
  }
781
- T.length = T.length - 1;
781
+ x.length = x.length - 1;
782
782
  }
783
- } else i !== l && (J === "number" && isNaN(i) && isNaN(l) || s.push(new f(I, i, l)));
783
+ } else i !== l && (J === "number" && isNaN(i) && isNaN(l) || s.push(new p(F, i, l)));
784
784
  }
785
- function w(i, l, s, c, v) {
785
+ function w(i, l, s, d, b) {
786
786
  var A = [];
787
- if (h(i, l, A, c, null, null, null, v), s)
788
- for (var T = 0; T < A.length; ++T)
789
- s(A[T]);
787
+ if (h(i, l, A, d, null, null, null, b), s)
788
+ for (var x = 0; x < A.length; ++x)
789
+ s(A[x]);
790
790
  return A;
791
791
  }
792
- function D(i, l, s, c, v, A, T) {
793
- return h(i, l, s, c, v, A, T, !0);
792
+ function C(i, l, s, d, b, A, x) {
793
+ return h(i, l, s, d, b, A, x, !0);
794
794
  }
795
- function R(i, l, s, c) {
796
- var v = c ? function(T) {
797
- T && c.push(T);
798
- } : void 0, A = w(i, l, v, s);
799
- return c || (A.length ? A : void 0);
795
+ function D(i, l, s, d) {
796
+ var b = d ? function(x) {
797
+ x && d.push(x);
798
+ } : void 0, A = w(i, l, b, s);
799
+ return d || (A.length ? A : void 0);
800
800
  }
801
- function b(i, l, s, c) {
802
- var v = c ? function(T) {
803
- T && c.push(T);
804
- } : void 0, A = w(i, l, v, s, !0);
805
- return c || (A.length ? A : void 0);
801
+ function v(i, l, s, d) {
802
+ var b = d ? function(x) {
803
+ x && d.push(x);
804
+ } : void 0, A = w(i, l, b, s, !0);
805
+ return d || (A.length ? A : void 0);
806
806
  }
807
- function g(i, l, s) {
807
+ function O(i, l, s) {
808
808
  if (s.path && s.path.length) {
809
- var c = i[l], v, A = s.path.length - 1;
810
- for (v = 0; v < A; v++)
811
- c = c[s.path[v]];
809
+ var d = i[l], b, A = s.path.length - 1;
810
+ for (b = 0; b < A; b++)
811
+ d = d[s.path[b]];
812
812
  switch (s.kind) {
813
813
  case "A":
814
- g(c[s.path[v]], s.index, s.item);
814
+ O(d[s.path[b]], s.index, s.item);
815
815
  break;
816
816
  case "D":
817
- delete c[s.path[v]];
817
+ delete d[s.path[b]];
818
818
  break;
819
819
  case "E":
820
820
  case "N":
821
- c[s.path[v]] = s.rhs;
821
+ d[s.path[b]] = s.rhs;
822
822
  break;
823
823
  }
824
824
  } else
825
825
  switch (s.kind) {
826
826
  case "A":
827
- g(i[l], s.index, s.item);
827
+ O(i[l], s.index, s.item);
828
828
  break;
829
829
  case "D":
830
830
  i = m(i, l);
@@ -838,45 +838,45 @@ function He() {
838
838
  }
839
839
  function k(i, l, s) {
840
840
  if (typeof s > "u" && l && ~r.indexOf(l.kind) && (s = l), i && s && s.kind) {
841
- for (var c = i, v = -1, A = s.path ? s.path.length - 1 : 0; ++v < A; )
842
- typeof c[s.path[v]] > "u" && (c[s.path[v]] = typeof s.path[v + 1] < "u" && typeof s.path[v + 1] == "number" ? [] : {}), c = c[s.path[v]];
841
+ for (var d = i, b = -1, A = s.path ? s.path.length - 1 : 0; ++b < A; )
842
+ typeof d[s.path[b]] > "u" && (d[s.path[b]] = typeof s.path[b + 1] < "u" && typeof s.path[b + 1] == "number" ? [] : {}), d = d[s.path[b]];
843
843
  switch (s.kind) {
844
844
  case "A":
845
- s.path && typeof c[s.path[v]] > "u" && (c[s.path[v]] = []), g(s.path ? c[s.path[v]] : c, s.index, s.item);
845
+ s.path && typeof d[s.path[b]] > "u" && (d[s.path[b]] = []), O(s.path ? d[s.path[b]] : d, s.index, s.item);
846
846
  break;
847
847
  case "D":
848
- delete c[s.path[v]];
848
+ delete d[s.path[b]];
849
849
  break;
850
850
  case "E":
851
851
  case "N":
852
- c[s.path[v]] = s.rhs;
852
+ d[s.path[b]] = s.rhs;
853
853
  break;
854
854
  }
855
855
  }
856
856
  }
857
- function O(i, l, s) {
857
+ function P(i, l, s) {
858
858
  if (s.path && s.path.length) {
859
- var c = i[l], v, A = s.path.length - 1;
860
- for (v = 0; v < A; v++)
861
- c = c[s.path[v]];
859
+ var d = i[l], b, A = s.path.length - 1;
860
+ for (b = 0; b < A; b++)
861
+ d = d[s.path[b]];
862
862
  switch (s.kind) {
863
863
  case "A":
864
- O(c[s.path[v]], s.index, s.item);
864
+ P(d[s.path[b]], s.index, s.item);
865
865
  break;
866
866
  case "D":
867
- c[s.path[v]] = s.lhs;
867
+ d[s.path[b]] = s.lhs;
868
868
  break;
869
869
  case "E":
870
- c[s.path[v]] = s.lhs;
870
+ d[s.path[b]] = s.lhs;
871
871
  break;
872
872
  case "N":
873
- delete c[s.path[v]];
873
+ delete d[s.path[b]];
874
874
  break;
875
875
  }
876
876
  } else
877
877
  switch (s.kind) {
878
878
  case "A":
879
- O(i[l], s.index, s.item);
879
+ P(i[l], s.index, s.item);
880
880
  break;
881
881
  case "D":
882
882
  i[l] = s.lhs;
@@ -890,42 +890,42 @@ function He() {
890
890
  }
891
891
  return i;
892
892
  }
893
- function N(i, l, s) {
893
+ function j(i, l, s) {
894
894
  if (i && l && s && s.kind) {
895
- var c = i, v, A;
896
- for (A = s.path.length - 1, v = 0; v < A; v++)
897
- typeof c[s.path[v]] > "u" && (c[s.path[v]] = {}), c = c[s.path[v]];
895
+ var d = i, b, A;
896
+ for (A = s.path.length - 1, b = 0; b < A; b++)
897
+ typeof d[s.path[b]] > "u" && (d[s.path[b]] = {}), d = d[s.path[b]];
898
898
  switch (s.kind) {
899
899
  case "A":
900
- O(c[s.path[v]], s.index, s.item);
900
+ P(d[s.path[b]], s.index, s.item);
901
901
  break;
902
902
  case "D":
903
- c[s.path[v]] = s.lhs;
903
+ d[s.path[b]] = s.lhs;
904
904
  break;
905
905
  case "E":
906
- c[s.path[v]] = s.lhs;
906
+ d[s.path[b]] = s.lhs;
907
907
  break;
908
908
  case "N":
909
- delete c[s.path[v]];
909
+ delete d[s.path[b]];
910
910
  break;
911
911
  }
912
912
  }
913
913
  }
914
- function F(i, l, s) {
914
+ function S(i, l, s) {
915
915
  if (i && l) {
916
- var c = function(v) {
917
- (!s || s(i, l, v)) && k(i, l, v);
916
+ var d = function(b) {
917
+ (!s || s(i, l, b)) && k(i, l, b);
918
918
  };
919
- w(i, l, c);
919
+ w(i, l, d);
920
920
  }
921
921
  }
922
- return Object.defineProperties(R, {
922
+ return Object.defineProperties(D, {
923
923
  diff: {
924
- value: R,
924
+ value: D,
925
925
  enumerable: !0
926
926
  },
927
927
  orderIndependentDiff: {
928
- value: b,
928
+ value: v,
929
929
  enumerable: !0
930
930
  },
931
931
  observableDiff: {
@@ -933,15 +933,15 @@ function He() {
933
933
  enumerable: !0
934
934
  },
935
935
  orderIndependentObservableDiff: {
936
- value: D,
936
+ value: C,
937
937
  enumerable: !0
938
938
  },
939
939
  orderIndepHash: {
940
- value: x,
940
+ value: E,
941
941
  enumerable: !0
942
942
  },
943
943
  applyDiff: {
944
- value: F,
944
+ value: S,
945
945
  enumerable: !0
946
946
  },
947
947
  applyChange: {
@@ -949,7 +949,7 @@ function He() {
949
949
  enumerable: !0
950
950
  },
951
951
  revertChange: {
952
- value: N,
952
+ value: j,
953
953
  enumerable: !0
954
954
  },
955
955
  isConflict: {
@@ -958,55 +958,55 @@ function He() {
958
958
  },
959
959
  enumerable: !0
960
960
  }
961
- }), R.DeepDiff = R, n && (n.DeepDiff = R), R;
961
+ }), D.DeepDiff = D, n && (n.DeepDiff = D), D;
962
962
  });
963
963
  }(ie)), ie.exports;
964
964
  }
965
965
  var Te = He(), oe = { exports: {} };
966
966
  const H = new Uint32Array(65536), Ue = (t, e) => {
967
967
  const n = t.length, r = e.length, o = 1 << n - 1;
968
- let u = -1, f = 0, d = n, p = n;
969
- for (; p--; )
970
- H[t.charCodeAt(p)] |= 1 << p;
971
- for (p = 0; p < r; p++) {
972
- let y = H[e.charCodeAt(p)];
973
- const m = y | f;
974
- y |= (y & u) + u ^ u, f |= ~(y | u), u &= y, f & o && d++, u & o && d--, f = f << 1 | 1, u = u << 1 | ~(m | f), f &= m;
968
+ let u = -1, p = 0, f = n, c = n;
969
+ for (; c--; )
970
+ H[t.charCodeAt(c)] |= 1 << c;
971
+ for (c = 0; c < r; c++) {
972
+ let y = H[e.charCodeAt(c)];
973
+ const m = y | p;
974
+ y |= (y & u) + u ^ u, p |= ~(y | u), u &= y, p & o && f++, u & o && f--, p = p << 1 | 1, u = u << 1 | ~(m | p), p &= m;
975
975
  }
976
- for (p = n; p--; )
977
- H[t.charCodeAt(p)] = 0;
978
- return d;
976
+ for (c = n; c--; )
977
+ H[t.charCodeAt(c)] = 0;
978
+ return f;
979
979
  }, Ke = (t, e) => {
980
- const n = e.length, r = t.length, o = [], u = [], f = Math.ceil(n / 32), d = Math.ceil(r / 32);
981
- for (let h = 0; h < f; h++)
980
+ const n = e.length, r = t.length, o = [], u = [], p = Math.ceil(n / 32), f = Math.ceil(r / 32);
981
+ for (let h = 0; h < p; h++)
982
982
  u[h] = -1, o[h] = 0;
983
- let p = 0;
984
- for (; p < d - 1; p++) {
983
+ let c = 0;
984
+ for (; c < f - 1; c++) {
985
985
  let h = 0, w = -1;
986
- const D = p * 32, R = Math.min(32, r) + D;
987
- for (let b = D; b < R; b++)
988
- H[t.charCodeAt(b)] |= 1 << b;
989
- for (let b = 0; b < n; b++) {
990
- const g = H[e.charCodeAt(b)], k = u[b / 32 | 0] >>> b & 1, O = o[b / 32 | 0] >>> b & 1, N = g | h, F = ((g | O) & w) + w ^ w | g | O;
991
- let i = h | ~(F | w), l = w & F;
992
- i >>> 31 ^ k && (u[b / 32 | 0] ^= 1 << b), l >>> 31 ^ O && (o[b / 32 | 0] ^= 1 << b), i = i << 1 | k, l = l << 1 | O, w = l | ~(N | i), h = i & N;
986
+ const C = c * 32, D = Math.min(32, r) + C;
987
+ for (let v = C; v < D; v++)
988
+ H[t.charCodeAt(v)] |= 1 << v;
989
+ for (let v = 0; v < n; v++) {
990
+ const O = H[e.charCodeAt(v)], k = u[v / 32 | 0] >>> v & 1, P = o[v / 32 | 0] >>> v & 1, j = O | h, S = ((O | P) & w) + w ^ w | O | P;
991
+ let i = h | ~(S | w), l = w & S;
992
+ i >>> 31 ^ k && (u[v / 32 | 0] ^= 1 << v), l >>> 31 ^ P && (o[v / 32 | 0] ^= 1 << v), i = i << 1 | k, l = l << 1 | P, w = l | ~(j | i), h = i & j;
993
993
  }
994
- for (let b = D; b < R; b++)
995
- H[t.charCodeAt(b)] = 0;
994
+ for (let v = C; v < D; v++)
995
+ H[t.charCodeAt(v)] = 0;
996
996
  }
997
997
  let y = 0, m = -1;
998
- const P = p * 32, E = Math.min(32, r - P) + P;
999
- for (let h = P; h < E; h++)
998
+ const R = c * 32, g = Math.min(32, r - R) + R;
999
+ for (let h = R; h < g; h++)
1000
1000
  H[t.charCodeAt(h)] |= 1 << h;
1001
- let x = r;
1001
+ let E = r;
1002
1002
  for (let h = 0; h < n; h++) {
1003
- const w = H[e.charCodeAt(h)], D = u[h / 32 | 0] >>> h & 1, R = o[h / 32 | 0] >>> h & 1, b = w | y, g = ((w | R) & m) + m ^ m | w | R;
1004
- let k = y | ~(g | m), O = m & g;
1005
- x += k >>> r - 1 & 1, x -= O >>> r - 1 & 1, k >>> 31 ^ D && (u[h / 32 | 0] ^= 1 << h), O >>> 31 ^ R && (o[h / 32 | 0] ^= 1 << h), k = k << 1 | D, O = O << 1 | R, m = O | ~(b | k), y = k & b;
1003
+ const w = H[e.charCodeAt(h)], C = u[h / 32 | 0] >>> h & 1, D = o[h / 32 | 0] >>> h & 1, v = w | y, O = ((w | D) & m) + m ^ m | w | D;
1004
+ let k = y | ~(O | m), P = m & O;
1005
+ E += k >>> r - 1 & 1, E -= P >>> r - 1 & 1, k >>> 31 ^ C && (u[h / 32 | 0] ^= 1 << h), P >>> 31 ^ D && (o[h / 32 | 0] ^= 1 << h), k = k << 1 | C, P = P << 1 | D, m = P | ~(v | k), y = k & v;
1006
1006
  }
1007
- for (let h = P; h < E; h++)
1007
+ for (let h = R; h < g; h++)
1008
1008
  H[t.charCodeAt(h)] = 0;
1009
- return x;
1009
+ return E;
1010
1010
  }, Ce = (t, e) => {
1011
1011
  if (t.length < e.length) {
1012
1012
  const n = e;
@@ -1024,7 +1024,7 @@ const H = new Uint32Array(65536), Ue = (t, e) => {
1024
1024
  __proto__: null,
1025
1025
  closest: Je,
1026
1026
  distance: Ce
1027
- }, Symbol.toStringTag, { value: "Module" })), Ve = /* @__PURE__ */ je(Be);
1027
+ }, Symbol.toStringTag, { value: "Module" })), Ve = /* @__PURE__ */ Ne(Be);
1028
1028
  var me;
1029
1029
  function Ge() {
1030
1030
  return me || (me = 1, function(t, e) {
@@ -1035,7 +1035,7 @@ function Ge() {
1035
1035
  } catch {
1036
1036
  console.log("Collator could not be initialized and wouldn't be used");
1037
1037
  }
1038
- var r = Ve, o = [], u = [], f = {
1038
+ var r = Ve, o = [], u = [], p = {
1039
1039
  /**
1040
1040
  * Calculate levenshtein distance of the two strings.
1041
1041
  *
@@ -1045,28 +1045,28 @@ function Ge() {
1045
1045
  * @param [options.useCollator] Use `Intl.Collator` for locale-sensitive string comparison.
1046
1046
  * @return Integer the levenshtein distance (0 and above).
1047
1047
  */
1048
- get: function(d, p, y) {
1048
+ get: function(f, c, y) {
1049
1049
  var m = y && n && y.useCollator;
1050
1050
  if (m) {
1051
- var P = d.length, E = p.length;
1052
- if (P === 0) return E;
1053
- if (E === 0) return P;
1054
- var x, h, w, D, R;
1055
- for (w = 0; w < E; ++w)
1056
- o[w] = w, u[w] = p.charCodeAt(w);
1057
- o[E] = E;
1058
- var b;
1059
- for (w = 0; w < P; ++w) {
1060
- for (h = w + 1, D = 0; D < E; ++D)
1061
- x = h, b = n.compare(d.charAt(w), String.fromCharCode(u[D])) === 0, h = o[D] + (b ? 0 : 1), R = x + 1, h > R && (h = R), R = o[D + 1] + 1, h > R && (h = R), o[D] = x;
1062
- o[D] = h;
1051
+ var R = f.length, g = c.length;
1052
+ if (R === 0) return g;
1053
+ if (g === 0) return R;
1054
+ var E, h, w, C, D;
1055
+ for (w = 0; w < g; ++w)
1056
+ o[w] = w, u[w] = c.charCodeAt(w);
1057
+ o[g] = g;
1058
+ var v;
1059
+ for (w = 0; w < R; ++w) {
1060
+ for (h = w + 1, C = 0; C < g; ++C)
1061
+ E = h, v = n.compare(f.charAt(w), String.fromCharCode(u[C])) === 0, h = o[C] + (v ? 0 : 1), D = E + 1, h > D && (h = D), D = o[C + 1] + 1, h > D && (h = D), o[C] = E;
1062
+ o[C] = h;
1063
1063
  }
1064
1064
  return h;
1065
1065
  }
1066
- return r.distance(d, p);
1066
+ return r.distance(f, c);
1067
1067
  }
1068
1068
  };
1069
- t !== null && t.exports === e ? t.exports = f : typeof self < "u" && typeof self.postMessage == "function" && typeof self.importScripts == "function" ? self.Levenshtein = f : typeof window < "u" && window !== null && (window.Levenshtein = f);
1069
+ t !== null && t.exports === e ? t.exports = p : typeof self < "u" && typeof self.postMessage == "function" && typeof self.importScripts == "function" ? self.Levenshtein = p : typeof window < "u" && window !== null && (window.Levenshtein = p);
1070
1070
  })();
1071
1071
  }(oe, oe.exports)), oe.exports;
1072
1072
  }
@@ -1076,79 +1076,79 @@ class Qe {
1076
1076
  diff(e, n, r = {}) {
1077
1077
  let o;
1078
1078
  typeof r == "function" ? (o = r, r = {}) : "callback" in r && (o = r.callback);
1079
- const u = this.castInput(e, r), f = this.castInput(n, r), d = this.removeEmpty(this.tokenize(u, r)), p = this.removeEmpty(this.tokenize(f, r));
1080
- return this.diffWithOptionsObj(d, p, r, o);
1079
+ const u = this.castInput(e, r), p = this.castInput(n, r), f = this.removeEmpty(this.tokenize(u, r)), c = this.removeEmpty(this.tokenize(p, r));
1080
+ return this.diffWithOptionsObj(f, c, r, o);
1081
1081
  }
1082
1082
  diffWithOptionsObj(e, n, r, o) {
1083
1083
  var u;
1084
- const f = (b) => {
1085
- if (b = this.postProcess(b, r), o) {
1084
+ const p = (v) => {
1085
+ if (v = this.postProcess(v, r), o) {
1086
1086
  setTimeout(function() {
1087
- o(b);
1087
+ o(v);
1088
1088
  }, 0);
1089
1089
  return;
1090
1090
  } else
1091
- return b;
1092
- }, d = n.length, p = e.length;
1093
- let y = 1, m = d + p;
1091
+ return v;
1092
+ }, f = n.length, c = e.length;
1093
+ let y = 1, m = f + c;
1094
1094
  r.maxEditLength != null && (m = Math.min(m, r.maxEditLength));
1095
- const P = (u = r.timeout) !== null && u !== void 0 ? u : 1 / 0, E = Date.now() + P, x = [{ oldPos: -1, lastComponent: void 0 }];
1096
- let h = this.extractCommon(x[0], n, e, 0, r);
1097
- if (x[0].oldPos + 1 >= p && h + 1 >= d)
1098
- return f(this.buildValues(x[0].lastComponent, n, e));
1099
- let w = -1 / 0, D = 1 / 0;
1100
- const R = () => {
1101
- for (let b = Math.max(w, -y); b <= Math.min(D, y); b += 2) {
1102
- let g;
1103
- const k = x[b - 1], O = x[b + 1];
1104
- k && (x[b - 1] = void 0);
1105
- let N = !1;
1106
- if (O) {
1107
- const i = O.oldPos - b;
1108
- N = O && 0 <= i && i < d;
1095
+ const R = (u = r.timeout) !== null && u !== void 0 ? u : 1 / 0, g = Date.now() + R, E = [{ oldPos: -1, lastComponent: void 0 }];
1096
+ let h = this.extractCommon(E[0], n, e, 0, r);
1097
+ if (E[0].oldPos + 1 >= c && h + 1 >= f)
1098
+ return p(this.buildValues(E[0].lastComponent, n, e));
1099
+ let w = -1 / 0, C = 1 / 0;
1100
+ const D = () => {
1101
+ for (let v = Math.max(w, -y); v <= Math.min(C, y); v += 2) {
1102
+ let O;
1103
+ const k = E[v - 1], P = E[v + 1];
1104
+ k && (E[v - 1] = void 0);
1105
+ let j = !1;
1106
+ if (P) {
1107
+ const i = P.oldPos - v;
1108
+ j = P && 0 <= i && i < f;
1109
1109
  }
1110
- const F = k && k.oldPos + 1 < p;
1111
- if (!N && !F) {
1112
- x[b] = void 0;
1110
+ const S = k && k.oldPos + 1 < c;
1111
+ if (!j && !S) {
1112
+ E[v] = void 0;
1113
1113
  continue;
1114
1114
  }
1115
- if (!F || N && k.oldPos < O.oldPos ? g = this.addToPath(O, !0, !1, 0, r) : g = this.addToPath(k, !1, !0, 1, r), h = this.extractCommon(g, n, e, b, r), g.oldPos + 1 >= p && h + 1 >= d)
1116
- return f(this.buildValues(g.lastComponent, n, e)) || !0;
1117
- x[b] = g, g.oldPos + 1 >= p && (D = Math.min(D, b - 1)), h + 1 >= d && (w = Math.max(w, b + 1));
1115
+ if (!S || j && k.oldPos < P.oldPos ? O = this.addToPath(P, !0, !1, 0, r) : O = this.addToPath(k, !1, !0, 1, r), h = this.extractCommon(O, n, e, v, r), O.oldPos + 1 >= c && h + 1 >= f)
1116
+ return p(this.buildValues(O.lastComponent, n, e)) || !0;
1117
+ E[v] = O, O.oldPos + 1 >= c && (C = Math.min(C, v - 1)), h + 1 >= f && (w = Math.max(w, v + 1));
1118
1118
  }
1119
1119
  y++;
1120
1120
  };
1121
1121
  if (o)
1122
- (function b() {
1122
+ (function v() {
1123
1123
  setTimeout(function() {
1124
- if (y > m || Date.now() > E)
1124
+ if (y > m || Date.now() > g)
1125
1125
  return o(void 0);
1126
- R() || b();
1126
+ D() || v();
1127
1127
  }, 0);
1128
1128
  })();
1129
1129
  else
1130
- for (; y <= m && Date.now() <= E; ) {
1131
- const b = R();
1132
- if (b)
1133
- return b;
1130
+ for (; y <= m && Date.now() <= g; ) {
1131
+ const v = D();
1132
+ if (v)
1133
+ return v;
1134
1134
  }
1135
1135
  }
1136
1136
  addToPath(e, n, r, o, u) {
1137
- const f = e.lastComponent;
1138
- return f && !u.oneChangePerToken && f.added === n && f.removed === r ? {
1137
+ const p = e.lastComponent;
1138
+ return p && !u.oneChangePerToken && p.added === n && p.removed === r ? {
1139
1139
  oldPos: e.oldPos + o,
1140
- lastComponent: { count: f.count + 1, added: n, removed: r, previousComponent: f.previousComponent }
1140
+ lastComponent: { count: p.count + 1, added: n, removed: r, previousComponent: p.previousComponent }
1141
1141
  } : {
1142
1142
  oldPos: e.oldPos + o,
1143
- lastComponent: { count: 1, added: n, removed: r, previousComponent: f }
1143
+ lastComponent: { count: 1, added: n, removed: r, previousComponent: p }
1144
1144
  };
1145
1145
  }
1146
1146
  extractCommon(e, n, r, o, u) {
1147
- const f = n.length, d = r.length;
1148
- let p = e.oldPos, y = p - o, m = 0;
1149
- for (; y + 1 < f && p + 1 < d && this.equals(r[p + 1], n[y + 1], u); )
1150
- y++, p++, m++, u.oneChangePerToken && (e.lastComponent = { count: 1, previousComponent: e.lastComponent, added: !1, removed: !1 });
1151
- return m && !u.oneChangePerToken && (e.lastComponent = { count: m, previousComponent: e.lastComponent, added: !1, removed: !1 }), e.oldPos = p, y;
1147
+ const p = n.length, f = r.length;
1148
+ let c = e.oldPos, y = c - o, m = 0;
1149
+ for (; y + 1 < p && c + 1 < f && this.equals(r[c + 1], n[y + 1], u); )
1150
+ y++, c++, m++, u.oneChangePerToken && (e.lastComponent = { count: 1, previousComponent: e.lastComponent, added: !1, removed: !1 });
1151
+ return m && !u.oneChangePerToken && (e.lastComponent = { count: m, previousComponent: e.lastComponent, added: !1, removed: !1 }), e.oldPos = c, y;
1152
1152
  }
1153
1153
  equals(e, n, r) {
1154
1154
  return r.comparator ? r.comparator(e, n) : e === n || !!r.ignoreCase && e.toLowerCase() === n.toLowerCase();
@@ -1182,22 +1182,22 @@ class Qe {
1182
1182
  for (; e; )
1183
1183
  o.push(e), u = e.previousComponent, delete e.previousComponent, e = u;
1184
1184
  o.reverse();
1185
- const f = o.length;
1186
- let d = 0, p = 0, y = 0;
1187
- for (; d < f; d++) {
1188
- const m = o[d];
1185
+ const p = o.length;
1186
+ let f = 0, c = 0, y = 0;
1187
+ for (; f < p; f++) {
1188
+ const m = o[f];
1189
1189
  if (m.removed)
1190
1190
  m.value = this.join(r.slice(y, y + m.count)), y += m.count;
1191
1191
  else {
1192
1192
  if (!m.added && this.useLongestToken) {
1193
- let P = n.slice(p, p + m.count);
1194
- P = P.map(function(E, x) {
1195
- const h = r[y + x];
1196
- return h.length > E.length ? h : E;
1197
- }), m.value = this.join(P);
1193
+ let R = n.slice(c, c + m.count);
1194
+ R = R.map(function(g, E) {
1195
+ const h = r[y + E];
1196
+ return h.length > g.length ? h : g;
1197
+ }), m.value = this.join(R);
1198
1198
  } else
1199
- m.value = this.join(n.slice(p, p + m.count));
1200
- p += m.count, m.added || (y += m.count);
1199
+ m.value = this.join(n.slice(c, c + m.count));
1200
+ c += m.count, m.added || (y += m.count);
1201
1201
  }
1202
1202
  }
1203
1203
  return o;
@@ -1230,72 +1230,72 @@ function nt(t, e) {
1230
1230
  }
1231
1231
  return n;
1232
1232
  }
1233
- function be(t, e, n, r, o, u, f) {
1234
- let d;
1235
- f ? typeof f == "function" ? d = { callback: f } : d = f : d = {}, typeof d.context > "u" && (d.context = 4);
1236
- const p = d.context;
1237
- if (d.newlineIsToken)
1233
+ function be(t, e, n, r, o, u, p) {
1234
+ let f;
1235
+ p ? typeof p == "function" ? f = { callback: p } : f = p : f = {}, typeof f.context > "u" && (f.context = 4);
1236
+ const c = f.context;
1237
+ if (f.newlineIsToken)
1238
1238
  throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");
1239
- if (d.callback) {
1240
- const { callback: m } = d;
1241
- ve(n, r, Object.assign(Object.assign({}, d), { callback: (P) => {
1242
- const E = y(P);
1243
- m(E);
1239
+ if (f.callback) {
1240
+ const { callback: m } = f;
1241
+ ve(n, r, Object.assign(Object.assign({}, f), { callback: (R) => {
1242
+ const g = y(R);
1243
+ m(g);
1244
1244
  } }));
1245
1245
  } else
1246
- return y(ve(n, r, d));
1246
+ return y(ve(n, r, f));
1247
1247
  function y(m) {
1248
1248
  if (!m)
1249
1249
  return;
1250
1250
  m.push({ value: "", lines: [] });
1251
- function P(b) {
1252
- return b.map(function(g) {
1253
- return " " + g;
1251
+ function R(v) {
1252
+ return v.map(function(O) {
1253
+ return " " + O;
1254
1254
  });
1255
1255
  }
1256
- const E = [];
1257
- let x = 0, h = 0, w = [], D = 1, R = 1;
1258
- for (let b = 0; b < m.length; b++) {
1259
- const g = m[b], k = g.lines || ot(g.value);
1260
- if (g.lines = k, g.added || g.removed) {
1261
- if (!x) {
1262
- const O = m[b - 1];
1263
- x = D, h = R, O && (w = p > 0 ? P(O.lines.slice(-p)) : [], x -= w.length, h -= w.length);
1256
+ const g = [];
1257
+ let E = 0, h = 0, w = [], C = 1, D = 1;
1258
+ for (let v = 0; v < m.length; v++) {
1259
+ const O = m[v], k = O.lines || ot(O.value);
1260
+ if (O.lines = k, O.added || O.removed) {
1261
+ if (!E) {
1262
+ const P = m[v - 1];
1263
+ E = C, h = D, P && (w = c > 0 ? R(P.lines.slice(-c)) : [], E -= w.length, h -= w.length);
1264
1264
  }
1265
- for (const O of k)
1266
- w.push((g.added ? "+" : "-") + O);
1267
- g.added ? R += k.length : D += k.length;
1265
+ for (const P of k)
1266
+ w.push((O.added ? "+" : "-") + P);
1267
+ O.added ? D += k.length : C += k.length;
1268
1268
  } else {
1269
- if (x)
1270
- if (k.length <= p * 2 && b < m.length - 2)
1271
- for (const O of P(k))
1272
- w.push(O);
1269
+ if (E)
1270
+ if (k.length <= c * 2 && v < m.length - 2)
1271
+ for (const P of R(k))
1272
+ w.push(P);
1273
1273
  else {
1274
- const O = Math.min(k.length, p);
1275
- for (const F of P(k.slice(0, O)))
1276
- w.push(F);
1277
- const N = {
1278
- oldStart: x,
1279
- oldLines: D - x + O,
1274
+ const P = Math.min(k.length, c);
1275
+ for (const S of R(k.slice(0, P)))
1276
+ w.push(S);
1277
+ const j = {
1278
+ oldStart: E,
1279
+ oldLines: C - E + P,
1280
1280
  newStart: h,
1281
- newLines: R - h + O,
1281
+ newLines: D - h + P,
1282
1282
  lines: w
1283
1283
  };
1284
- E.push(N), x = 0, h = 0, w = [];
1284
+ g.push(j), E = 0, h = 0, w = [];
1285
1285
  }
1286
- D += k.length, R += k.length;
1286
+ C += k.length, D += k.length;
1287
1287
  }
1288
1288
  }
1289
- for (const b of E)
1290
- for (let g = 0; g < b.lines.length; g++)
1291
- b.lines[g].endsWith(`
1292
- `) ? b.lines[g] = b.lines[g].slice(0, -1) : (b.lines.splice(g + 1, 0, "\"), g++);
1289
+ for (const v of g)
1290
+ for (let O = 0; O < v.lines.length; O++)
1291
+ v.lines[O].endsWith(`
1292
+ `) ? v.lines[O] = v.lines[O].slice(0, -1) : (v.lines.splice(O + 1, 0, "\"), O++);
1293
1293
  return {
1294
1294
  oldFileName: t,
1295
1295
  newFileName: e,
1296
1296
  oldHeader: o,
1297
1297
  newHeader: u,
1298
- hunks: E
1298
+ hunks: g
1299
1299
  };
1300
1300
  }
1301
1301
  }
@@ -1315,15 +1315,15 @@ function ue(t) {
1315
1315
  `) + `
1316
1316
  `;
1317
1317
  }
1318
- function rt(t, e, n, r, o, u, f) {
1319
- if (typeof f == "function" && (f = { callback: f }), f?.callback) {
1320
- const { callback: d } = f;
1321
- be(t, e, n, r, o, u, Object.assign(Object.assign({}, f), { callback: (p) => {
1322
- d(p ? ue(p) : void 0);
1318
+ function rt(t, e, n, r, o, u, p) {
1319
+ if (typeof p == "function" && (p = { callback: p }), p?.callback) {
1320
+ const { callback: f } = p;
1321
+ be(t, e, n, r, o, u, Object.assign(Object.assign({}, p), { callback: (c) => {
1322
+ f(c ? ue(c) : void 0);
1323
1323
  } }));
1324
1324
  } else {
1325
- const d = be(t, e, n, r, o, u, f);
1326
- return d ? ue(d) : void 0;
1325
+ const f = be(t, e, n, r, o, u, p);
1326
+ return f ? ue(f) : void 0;
1327
1327
  }
1328
1328
  }
1329
1329
  function ot(t) {
@@ -1333,7 +1333,7 @@ function ot(t) {
1333
1333
  `);
1334
1334
  return e ? n.pop() : n.push(n.pop().slice(0, -1)), n;
1335
1335
  }
1336
- function it(t, e, n = "git", r = 3) {
1336
+ function it(t, e, n = "git", r = 1) {
1337
1337
  switch (n) {
1338
1338
  case "git":
1339
1339
  return ye(t, e, r);
@@ -1345,9 +1345,8 @@ function it(t, e, n = "git", r = 3) {
1345
1345
  return ye(t, e, r);
1346
1346
  }
1347
1347
  }
1348
- function ye(t, e, n = 3) {
1349
- const r = ge(t), o = ge(e);
1350
- return rt(
1348
+ function ye(t, e, n = 1) {
1349
+ const r = ge(t), o = ge(e), f = rt(
1351
1350
  /* oldFilename */
1352
1351
  "",
1353
1352
  /* newFilename */
@@ -1360,7 +1359,11 @@ function ye(t, e, n = 3) {
1360
1359
  "",
1361
1360
  { context: n }
1362
1361
  ).split(`
1363
- `).slice(2).join(`
1362
+ `).filter((c) => !c || c === "\" || c.startsWith("@@") || c.startsWith("---") || c.startsWith("+++") || c.startsWith(" ") ? !1 : !!(c.startsWith("+") || c.startsWith("-")));
1363
+ for (; f.length && f[0].trim() === ""; ) f.shift();
1364
+ for (; f.length && f[f.length - 1].trim() === ""; )
1365
+ f.pop();
1366
+ return f.join(`
1364
1367
  `);
1365
1368
  }
1366
1369
  function st(t, e) {
@@ -1398,36 +1401,36 @@ function ut(t, e) {
1398
1401
  if (n.length === 0) return 0;
1399
1402
  const r = we(t), o = we(e), u = Math.max(r, o);
1400
1403
  if (u === 0) return 0;
1401
- let f = 0;
1402
- for (const d of n)
1403
- switch (d.kind) {
1404
+ let p = 0;
1405
+ for (const f of n)
1406
+ switch (f.kind) {
1404
1407
  case "N":
1405
- f += 1;
1408
+ p += 1;
1406
1409
  break;
1407
1410
  case "D":
1408
- f += 1;
1411
+ p += 1;
1409
1412
  break;
1410
1413
  case "E":
1411
- if (typeof d.lhs == "string" && typeof d.rhs == "string") {
1412
- const p = Oe(
1413
- d.lhs,
1414
- d.rhs
1414
+ if (typeof f.lhs == "string" && typeof f.rhs == "string") {
1415
+ const c = Oe(
1416
+ f.lhs,
1417
+ f.rhs
1415
1418
  );
1416
- f += p;
1417
- } else if (typeof d.lhs == "number" && typeof d.rhs == "number") {
1418
- const p = Re(
1419
- d.lhs,
1420
- d.rhs
1419
+ p += c;
1420
+ } else if (typeof f.lhs == "number" && typeof f.rhs == "number") {
1421
+ const c = Re(
1422
+ f.lhs,
1423
+ f.rhs
1421
1424
  );
1422
- f += p;
1425
+ p += c;
1423
1426
  } else
1424
- f += 1;
1427
+ p += 1;
1425
1428
  break;
1426
1429
  case "A":
1427
- f += 0.5;
1430
+ p += 0.5;
1428
1431
  break;
1429
1432
  }
1430
- return Math.min(f / u, 1);
1433
+ return Math.min(p / u, 1);
1431
1434
  }
1432
1435
  function we(t) {
1433
1436
  if (t == null) return 0;
@@ -1449,94 +1452,96 @@ function ge(t) {
1449
1452
  return String(t);
1450
1453
  }
1451
1454
  }
1452
- function ct(t, e, n) {
1453
- const r = Pe(), o = n?.onFeedback || r, u = n?.debounceMs ?? 1500, f = n?.diffType ?? "git", d = n?.compareWith, p = n?.default_trigger_name ?? "auto_state_change", y = n?.ignoreInitialNullish ?? !0, m = z(t), P = z(t), E = z(!0), x = z(t), h = z(
1455
+ function ft(t, e, n) {
1456
+ const r = Pe(), o = n?.onFeedback || r, u = n?.debounceMs ?? 3e3, p = n?.diffType ?? "git", f = n?.compareWith, c = n?.default_trigger_name ?? "auto_state_change", y = n?.ignoreInitialNullish ?? !0, m = z(t), R = z(!0), g = z(t), E = z(t == null), h = z(
1454
1457
  t != null
1455
1458
  // != null catches both null and undefined
1456
- ), w = z(null), D = z(void 0), R = W(
1457
- (g, k, O) => {
1458
- const N = lt(g, k), F = it(g, k, f);
1459
- let i;
1460
- n?.vote ? typeof n.vote == "function" ? i = n.vote(g, k, N) : i = n.vote : i = N > 0.5 ? "downvote" : "upvote";
1461
- const l = typeof e == "function" ? e(k) : e;
1459
+ ), w = z(
1460
+ !(y && t == null)
1461
+ ), C = z(null), D = z(void 0), v = q(
1462
+ (k, P, j) => {
1463
+ const S = lt(k, P), i = it(k, P, p);
1464
+ let l;
1465
+ n?.vote ? typeof n.vote == "function" ? l = n.vote(k, P, S) : l = n.vote : l = S > 0.5 ? "downvote" : "upvote";
1466
+ const s = typeof e == "function" ? e(P) : e;
1462
1467
  o({
1463
- tx_id: l,
1464
- vote: i,
1465
- explanation: `State change with diff percentage: ${(N * 100).toFixed(1)}%`,
1466
- correction: F,
1468
+ tx_id: s,
1469
+ vote: l,
1470
+ explanation: `State change with diff percentage: ${(S * 100).toFixed(1)}%`,
1471
+ correction: i,
1467
1472
  source: "IMPLICIT",
1468
1473
  extra_metadata: n?.metadata,
1469
- trigger_name: O
1474
+ trigger_name: j
1470
1475
  });
1471
1476
  },
1472
- [n, e, f, o]
1473
- ), b = W(
1474
- (g) => {
1475
- const k = g || p;
1476
- if (w.current && D.current && D.current !== k) {
1477
- clearTimeout(w.current);
1478
- const O = P.current;
1479
- R(
1480
- O,
1477
+ [n, e, p, o]
1478
+ ), O = q(
1479
+ (k) => {
1480
+ const P = k || c;
1481
+ if (C.current && D.current && D.current !== P) {
1482
+ clearTimeout(C.current);
1483
+ const j = g.current;
1484
+ v(
1485
+ j,
1481
1486
  t,
1482
1487
  D.current
1483
- ), w.current = null;
1488
+ ), C.current = null;
1484
1489
  }
1485
- D.current = k;
1490
+ D.current = P;
1486
1491
  },
1487
- [t, p, R]
1492
+ [t, c, v]
1488
1493
  );
1489
1494
  return Ee(() => {
1490
- if (E.current) {
1491
- E.current = !1, m.current = t, P.current = t;
1495
+ if (R.current) {
1496
+ R.current = !1, m.current = t, (!y || t != null) && (g.current = t, w.current = !0);
1492
1497
  return;
1493
1498
  }
1494
- const g = m.current;
1495
- if (!(d ? d(g, t) : JSON.stringify(g) === JSON.stringify(t))) {
1496
- const O = y && x.current == null && // Initial state was nullish
1499
+ const k = m.current;
1500
+ if (!(f ? f(k, t) : JSON.stringify(k) === JSON.stringify(t))) {
1501
+ const j = y && E.current && // True initial state was nullish
1497
1502
  !h.current && // We haven't had non-nullish state before
1498
1503
  t != null;
1499
- if (t != null && (h.current = !0), O) {
1500
- m.current = t, P.current = t;
1504
+ if (t != null && (h.current = !0), j) {
1505
+ g.current = t, w.current = !0, m.current = t;
1501
1506
  return;
1502
1507
  }
1503
- w.current || (P.current = g), w.current && clearTimeout(w.current), m.current = t, w.current = setTimeout(() => {
1504
- const N = P.current, F = t;
1505
- R(
1506
- N,
1507
- F,
1508
- D.current || p
1509
- ), P.current = F, w.current = null;
1508
+ C.current && clearTimeout(C.current), m.current = t, C.current = setTimeout(() => {
1509
+ const S = g.current, i = t;
1510
+ w.current && v(
1511
+ S,
1512
+ i,
1513
+ D.current || c
1514
+ ), C.current = null;
1510
1515
  }, u);
1511
1516
  }
1512
1517
  return () => {
1513
- w.current && clearTimeout(w.current);
1518
+ C.current && clearTimeout(C.current);
1514
1519
  };
1515
1520
  }, [
1516
1521
  t,
1517
1522
  e,
1518
1523
  n,
1519
1524
  o,
1520
- f,
1521
- u,
1522
- d,
1523
1525
  p,
1526
+ u,
1527
+ f,
1528
+ c,
1524
1529
  y,
1525
- R
1530
+ v
1526
1531
  ]), {
1527
- notifyChange: b
1532
+ notifyChange: O
1528
1533
  };
1529
1534
  }
1530
1535
  function vt(t, e, n) {
1531
- const [r, o] = X(t), { notifyChange: u } = ct(r, e, n), f = W(
1532
- (d, p) => {
1533
- u(p), o((y) => typeof d == "function" ? d(y) : d);
1536
+ const [r, o] = X(t), { notifyChange: u } = ft(r, e, n), p = q(
1537
+ (f, c) => {
1538
+ u(c), o((y) => typeof f == "function" ? f(y) : f);
1534
1539
  },
1535
1540
  [u]
1536
1541
  );
1537
- return [r, f];
1542
+ return [r, p];
1538
1543
  }
1539
- let ft = () => {
1544
+ let ct = () => {
1540
1545
  try {
1541
1546
  return require("@opentelemetry/api");
1542
1547
  } catch {
@@ -1546,7 +1551,7 @@ let ft = () => {
1546
1551
  }
1547
1552
  };
1548
1553
  function bt() {
1549
- const { trace: t, context: e } = ft();
1554
+ const { trace: t, context: e } = ct();
1550
1555
  try {
1551
1556
  const n = t.getSpanContext(e.active());
1552
1557
  if (n?.traceId)