frappe-react-sdk 1.0.6 → 1.0.7

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.
@@ -350,8 +350,8 @@ function Cr() {
350
350
  Sr = 1;
351
351
  var t = H, n = sa(), e = ua(), i = Qr, a = fa(), r = da(), s = pa(), c = tn(), d = en, o = ft();
352
352
  return Dt = function(f) {
353
- return new Promise(function(w, O) {
354
- var D = f.data, R = f.headers, m = f.responseType, E;
353
+ return new Promise(function(m, O) {
354
+ var D = f.data, R = f.headers, w = f.responseType, E;
355
355
  function te() {
356
356
  f.cancelToken && f.cancelToken.unsubscribe(E), f.signal && f.signal.removeEventListener("abort", E);
357
357
  }
@@ -365,7 +365,7 @@ function Cr() {
365
365
  y.open(f.method.toUpperCase(), i(X, f.params, f.paramsSerializer), !0), y.timeout = f.timeout;
366
366
  function re() {
367
367
  if (!!y) {
368
- var P = "getAllResponseHeaders" in y ? r(y.getAllResponseHeaders()) : null, Y = !m || m === "text" || m === "json" ? y.responseText : y.response, G = {
368
+ var P = "getAllResponseHeaders" in y ? r(y.getAllResponseHeaders()) : null, Y = !w || w === "text" || w === "json" ? y.responseText : y.response, G = {
369
369
  data: Y,
370
370
  status: y.status,
371
371
  statusText: y.statusText,
@@ -374,7 +374,7 @@ function Cr() {
374
374
  request: y
375
375
  };
376
376
  n(function(A) {
377
- w(A), te();
377
+ m(A), te();
378
378
  }, function(A) {
379
379
  O(A), te();
380
380
  }, G), y = null;
@@ -400,7 +400,7 @@ function Cr() {
400
400
  }
401
401
  "setRequestHeader" in y && t.forEach(R, function(Y, G) {
402
402
  typeof D > "u" && G.toLowerCase() === "content-type" ? delete R[G] : y.setRequestHeader(G, Y);
403
- }), t.isUndefined(f.withCredentials) || (y.withCredentials = !!f.withCredentials), m && m !== "json" && (y.responseType = f.responseType), typeof f.onDownloadProgress == "function" && y.addEventListener("progress", f.onDownloadProgress), typeof f.onUploadProgress == "function" && y.upload && y.upload.addEventListener("progress", f.onUploadProgress), (f.cancelToken || f.signal) && (E = function(P) {
403
+ }), t.isUndefined(f.withCredentials) || (y.withCredentials = !!f.withCredentials), w && w !== "json" && (y.responseType = f.responseType), typeof f.onDownloadProgress == "function" && y.addEventListener("progress", f.onDownloadProgress), typeof f.onUploadProgress == "function" && y.upload && y.upload.addEventListener("progress", f.onUploadProgress), (f.cancelToken || f.signal) && (E = function(P) {
404
404
  !y || (O(!P || P && P.type ? new o("canceled") : P), y.abort(), y = null);
405
405
  }, f.cancelToken && f.cancelToken.subscribe(E), f.signal && (f.signal.aborted ? E() : f.signal.addEventListener("abort", E))), D || (D = null), y.send(D);
406
406
  });
@@ -570,8 +570,8 @@ var Ca = function(n) {
570
570
  validateStatus: d
571
571
  };
572
572
  return Q.forEach(Object.keys(n).concat(Object.keys(e)), function(f) {
573
- var v = o[f] || r, w = v(f);
574
- Q.isUndefined(w) && v !== d || (i[f] = w);
573
+ var v = o[f] || r, m = v(f);
574
+ Q.isUndefined(m) && v !== d || (i[f] = m);
575
575
  }), i;
576
576
  }, Pt, Dr;
577
577
  function an() {
@@ -635,12 +635,12 @@ Ge.prototype.request = function(n, e) {
635
635
  clarifyTimeoutError: je.transitional(je.boolean)
636
636
  }, !1);
637
637
  var a = [], r = !0;
638
- this.interceptors.request.forEach(function(w) {
639
- typeof w.runWhen == "function" && w.runWhen(e) === !1 || (r = r && w.synchronous, a.unshift(w.fulfilled, w.rejected));
638
+ this.interceptors.request.forEach(function(m) {
639
+ typeof m.runWhen == "function" && m.runWhen(e) === !1 || (r = r && m.synchronous, a.unshift(m.fulfilled, m.rejected));
640
640
  });
641
641
  var s = [];
642
- this.interceptors.response.forEach(function(w) {
643
- s.push(w.fulfilled, w.rejected);
642
+ this.interceptors.response.forEach(function(m) {
643
+ s.push(m.fulfilled, m.rejected);
644
644
  });
645
645
  var c;
646
646
  if (!r) {
@@ -1128,13 +1128,13 @@ var Le = Ye.exports, qa = function() {
1128
1128
  }, t.prototype.getDocList = function(n, e) {
1129
1129
  var i;
1130
1130
  return Pe(this, void 0, void 0, function() {
1131
- var a, r, s, c, d, o, l, f, v, w, O;
1131
+ var a, r, s, c, d, o, l, f, v, m, O;
1132
1132
  return Ue(this, function(D) {
1133
- return a = {}, e && (r = e.fields, s = e.filters, c = e.orFilters, d = e.orderBy, o = e.limit, l = e.limit_start, f = e.asDict, v = f === void 0 ? !0 : f, w = d ? "".concat(d == null ? void 0 : d.field, " ").concat((i = d == null ? void 0 : d.order) !== null && i !== void 0 ? i : "asc") : "", a = {
1133
+ return a = {}, e && (r = e.fields, s = e.filters, c = e.orFilters, d = e.orderBy, o = e.limit, l = e.limit_start, f = e.asDict, v = f === void 0 ? !0 : f, m = d ? "".concat(d == null ? void 0 : d.field, " ").concat((i = d == null ? void 0 : d.order) !== null && i !== void 0 ? i : "asc") : "", a = {
1134
1134
  fields: r ? JSON.stringify(r) : void 0,
1135
1135
  filters: s ? JSON.stringify(s) : void 0,
1136
1136
  or_filters: c ? JSON.stringify(c) : void 0,
1137
- order_by: w,
1137
+ order_by: m,
1138
1138
  limit: o,
1139
1139
  page_limit_start: l,
1140
1140
  as_dict: v
@@ -1149,12 +1149,12 @@ var Le = Ye.exports, qa = function() {
1149
1149
  }).then(function(R) {
1150
1150
  return R.data.data;
1151
1151
  }).catch(function(R) {
1152
- var m, E;
1152
+ var w, E;
1153
1153
  throw {
1154
1154
  httpStatus: R.response.status,
1155
1155
  httpStatusText: R.response.statusText,
1156
1156
  message: "There was an error while fetching the documents.",
1157
- exception: (E = (m = R.response.data.exception) !== null && m !== void 0 ? m : R.response.data.exc_type) !== null && E !== void 0 ? E : ""
1157
+ exception: (E = (w = R.response.data.exception) !== null && w !== void 0 ? w : R.response.data.exc_type) !== null && E !== void 0 ? E : ""
1158
1158
  };
1159
1159
  })];
1160
1160
  });
@@ -1375,11 +1375,11 @@ var Ba = Ye.exports, Ma = function() {
1375
1375
  i && i(v.loaded, v.total);
1376
1376
  }
1377
1377
  }).catch(function(v) {
1378
- var w, O;
1378
+ var m, O;
1379
1379
  throw {
1380
1380
  httpStatus: v.response.status,
1381
1381
  httpStatusText: v.response.statusText,
1382
- message: (w = v.response.data.message) !== null && w !== void 0 ? w : "There was an error while uploading the file.",
1382
+ message: (m = v.response.data.message) !== null && m !== void 0 ? m : "There was an error while uploading the file.",
1383
1383
  exception: (O = v.response.data.exception) !== null && O !== void 0 ? O : ""
1384
1384
  };
1385
1385
  })];
@@ -1776,8 +1776,8 @@ var ue = function() {
1776
1776
  s === void 0 && (s = !0);
1777
1777
  var c = Ee.get(t), d = c[0], o = c[1], l = c[3], f = d[n], v = o[n];
1778
1778
  if (s && v)
1779
- for (var w = 0; w < v.length; ++w)
1780
- v[w](e, i, a);
1779
+ for (var m = 0; m < v.length; ++m)
1780
+ v[m](e, i, a);
1781
1781
  return r && (delete l[n], f && f[0]) ? f[0](mn).then(function() {
1782
1782
  return t.get(n);
1783
1783
  }) : t.get(n);
@@ -1787,11 +1787,11 @@ var ue = function() {
1787
1787
  for (var t = [], n = 0; n < arguments.length; n++)
1788
1788
  t[n] = arguments[n];
1789
1789
  return ln(void 0, void 0, void 0, function() {
1790
- var e, i, a, r, s, c, d, o, l, f, v, w, O, D, R, m, E, te, y, W, oe;
1790
+ var e, i, a, r, s, c, d, o, l, f, v, m, O, D, R, w, E, te, y, W, oe;
1791
1791
  return fn(this, function(X) {
1792
1792
  switch (X.label) {
1793
1793
  case 0:
1794
- if (e = t[0], i = t[1], a = t[2], r = t[3], s = typeof r == "boolean" ? { revalidate: r } : r || {}, c = V(s.populateCache) ? !0 : s.populateCache, d = s.revalidate !== !1, o = s.rollbackOnError !== !1, l = s.optimisticData, f = pn(i), v = f[0], w = f[2], !v)
1794
+ if (e = t[0], i = t[1], a = t[2], r = t[3], s = typeof r == "boolean" ? { revalidate: r } : r || {}, c = V(s.populateCache) ? !0 : s.populateCache, d = s.revalidate !== !1, o = s.rollbackOnError !== !1, l = s.optimisticData, f = pn(i), v = f[0], m = f[2], !v)
1795
1795
  return [2];
1796
1796
  if (O = Ee.get(e), D = O[2], t.length < 3)
1797
1797
  return [2, Je(e, v, e.get(v), J, J, d, !0)];
@@ -1799,30 +1799,30 @@ var ue = function() {
1799
1799
  try {
1800
1800
  R = R(e.get(v));
1801
1801
  } catch (re) {
1802
- m = re;
1802
+ w = re;
1803
1803
  }
1804
1804
  return R && we(R.then) ? [
1805
1805
  4,
1806
1806
  R.catch(function(re) {
1807
- m = re;
1807
+ w = re;
1808
1808
  })
1809
1809
  ] : [3, 2];
1810
1810
  case 1:
1811
1811
  if (R = X.sent(), E !== D[v][0]) {
1812
- if (m)
1813
- throw m;
1812
+ if (w)
1813
+ throw w;
1814
1814
  return [2, R];
1815
1815
  } else
1816
- m && te && o && (c = !0, R = y, e.set(v, y));
1816
+ w && te && o && (c = !0, R = y, e.set(v, y));
1817
1817
  X.label = 2;
1818
1818
  case 2:
1819
- return c && (m || (we(c) && (R = c(R, y)), e.set(v, R)), e.set(w, ye(e.get(w), { error: m }))), D[v][1] = Yt(), [
1819
+ return c && (w || (we(c) && (R = c(R, y)), e.set(v, R)), e.set(m, ye(e.get(m), { error: w }))), D[v][1] = Yt(), [
1820
1820
  4,
1821
- Je(e, v, R, m, J, d, !!c)
1821
+ Je(e, v, R, w, J, d, !!c)
1822
1822
  ];
1823
1823
  case 3:
1824
- if (oe = X.sent(), m)
1825
- throw m;
1824
+ if (oe = X.sent(), w)
1825
+ throw w;
1826
1826
  return [2, c ? oe : R];
1827
1827
  }
1828
1828
  });
@@ -1918,16 +1918,16 @@ var ue = function() {
1918
1918
  a >= 0 && (i[a] = i[i.length - 1], i.pop());
1919
1919
  };
1920
1920
  }, Mt = { dedupe: !0 }, mi = function(t, n, e) {
1921
- var i = e.cache, a = e.compare, r = e.fallbackData, s = e.suspense, c = e.revalidateOnMount, d = e.refreshInterval, o = e.refreshWhenHidden, l = e.refreshWhenOffline, f = Ee.get(i), v = f[0], w = f[1], O = f[2], D = f[3], R = pn(t), m = R[0], E = R[1], te = R[2], y = ge(!1), W = ge(!1), oe = ge(m), X = ge(n), re = ge(e), F = function() {
1921
+ var i = e.cache, a = e.compare, r = e.fallbackData, s = e.suspense, c = e.revalidateOnMount, d = e.refreshInterval, o = e.refreshWhenHidden, l = e.refreshWhenOffline, f = Ee.get(i), v = f[0], m = f[1], O = f[2], D = f[3], R = pn(t), w = R[0], E = R[1], te = R[2], y = ge(!1), W = ge(!1), oe = ge(w), X = ge(n), re = ge(e), F = function() {
1922
1922
  return re.current;
1923
1923
  }, P = function() {
1924
1924
  return F().isVisible() && F().isOnline();
1925
1925
  }, Y = function($) {
1926
1926
  return i.set(te, ye(i.get(te), $));
1927
- }, G = i.get(m), z = V(r) ? e.fallback[m] : r, A = V(G) ? z : G, pe = i.get(te) || {}, he = pe.error, Ne = !y.current, qe = function() {
1927
+ }, G = i.get(w), z = V(r) ? e.fallback[w] : r, A = V(G) ? z : G, pe = i.get(te) || {}, he = pe.error, Ne = !y.current, qe = function() {
1928
1928
  return Ne && !V(c) ? c : F().isPaused() ? !1 : s ? V(A) ? !1 : e.revalidateIfStale : V(A) || e.revalidateIfStale;
1929
1929
  }, Ze = function() {
1930
- return !m || !n ? !1 : pe.isValidating ? !0 : Ne && qe();
1930
+ return !w || !n ? !1 : pe.isValidating ? !0 : Ne && qe();
1931
1931
  }, Se = Ze(), Ce = di({
1932
1932
  data: A,
1933
1933
  error: he,
@@ -1939,38 +1939,38 @@ var ue = function() {
1939
1939
  return fn(this, function(Re) {
1940
1940
  switch (Re.label) {
1941
1941
  case 0:
1942
- if (U = X.current, !m || !U || W.current || F().isPaused())
1942
+ if (U = X.current, !w || !U || W.current || F().isPaused())
1943
1943
  return [2, !1];
1944
- _e = !0, ve = $ || {}, ne = !D[m] || !ve.dedupe, L = function() {
1945
- return !W.current && m === oe.current && y.current;
1944
+ _e = !0, ve = $ || {}, ne = !D[w] || !ve.dedupe, L = function() {
1945
+ return !W.current && w === oe.current && y.current;
1946
1946
  }, K = function() {
1947
- var Fe = D[m];
1948
- Fe && Fe[1] === I && delete D[m];
1947
+ var Fe = D[w];
1948
+ Fe && Fe[1] === I && delete D[w];
1949
1949
  }, B = { isValidating: !1 }, Oe = function() {
1950
1950
  Y({ isValidating: !1 }), L() && xe(B);
1951
1951
  }, Y({
1952
1952
  isValidating: !0
1953
1953
  }), xe({ isValidating: !0 }), Re.label = 1;
1954
1954
  case 1:
1955
- return Re.trys.push([1, 3, , 4]), ne && (Je(i, m, le.current.data, le.current.error, !0), e.loadingTimeout && !i.get(m) && setTimeout(function() {
1956
- _e && L() && F().onLoadingSlow(m, e);
1957
- }, e.loadingTimeout), D[m] = [U.apply(void 0, E), Yt()]), $e = D[m], q = $e[0], I = $e[1], [4, q];
1955
+ return Re.trys.push([1, 3, , 4]), ne && (Je(i, w, le.current.data, le.current.error, !0), e.loadingTimeout && !i.get(w) && setTimeout(function() {
1956
+ _e && L() && F().onLoadingSlow(w, e);
1957
+ }, e.loadingTimeout), D[w] = [U.apply(void 0, E), Yt()]), $e = D[w], q = $e[0], I = $e[1], [4, q];
1958
1958
  case 2:
1959
- return q = Re.sent(), ne && setTimeout(K, e.dedupingInterval), !D[m] || D[m][1] !== I ? (ne && L() && F().onDiscarded(m), [2, !1]) : (Y({
1959
+ return q = Re.sent(), ne && setTimeout(K, e.dedupingInterval), !D[w] || D[w][1] !== I ? (ne && L() && F().onDiscarded(w), [2, !1]) : (Y({
1960
1960
  error: J
1961
- }), B.error = J, me = O[m], !V(me) && (I <= me[0] || I <= me[1] || me[1] === 0) ? (Oe(), ne && L() && F().onDiscarded(m), [2, !1]) : (a(le.current.data, q) ? B.data = le.current.data : B.data = q, a(i.get(m), q) || i.set(m, q), ne && L() && F().onSuccess(q, m, e), [3, 4]));
1961
+ }), B.error = J, me = O[w], !V(me) && (I <= me[0] || I <= me[1] || me[1] === 0) ? (Oe(), ne && L() && F().onDiscarded(w), [2, !1]) : (a(le.current.data, q) ? B.data = le.current.data : B.data = q, a(i.get(w), q) || i.set(w, q), ne && L() && F().onSuccess(q, w, e), [3, 4]));
1962
1962
  case 3:
1963
- return se = Re.sent(), K(), F().isPaused() || (Y({ error: se }), B.error = se, ne && L() && (F().onError(se, m, e), (typeof e.shouldRetryOnError == "boolean" && e.shouldRetryOnError || we(e.shouldRetryOnError) && e.shouldRetryOnError(se)) && P() && F().onErrorRetry(se, m, e, fe, {
1963
+ return se = Re.sent(), K(), F().isPaused() || (Y({ error: se }), B.error = se, ne && L() && (F().onError(se, w, e), (typeof e.shouldRetryOnError == "boolean" && e.shouldRetryOnError || we(e.shouldRetryOnError) && e.shouldRetryOnError(se)) && P() && F().onErrorRetry(se, w, e, fe, {
1964
1964
  retryCount: (ve.retryCount || 0) + 1,
1965
1965
  dedupe: !0
1966
1966
  }))), [3, 4];
1967
1967
  case 4:
1968
- return _e = !1, Oe(), L() && ne && Je(i, m, B.data, B.error, !1), [2, !0];
1968
+ return _e = !1, Oe(), L() && ne && Je(i, w, B.data, B.error, !1), [2, !0];
1969
1969
  }
1970
1970
  });
1971
1971
  });
1972
1972
  },
1973
- [m]
1973
+ [w]
1974
1974
  ), Ie = ie(
1975
1975
  wn.bind(J, i, function() {
1976
1976
  return oe.current;
@@ -1980,8 +1980,8 @@ var ue = function() {
1980
1980
  if (st(function() {
1981
1981
  X.current = n, re.current = e;
1982
1982
  }), st(function() {
1983
- if (!!m) {
1984
- var $ = m !== oe.current, U = fe.bind(J, Mt), q = function(L, K, B) {
1983
+ if (!!w) {
1984
+ var $ = w !== oe.current, U = fe.bind(J, Mt), q = function(L, K, B) {
1985
1985
  xe(ye(
1986
1986
  {
1987
1987
  error: K,
@@ -1999,8 +1999,8 @@ var ue = function() {
1999
1999
  F().revalidateOnReconnect && P() && U();
2000
2000
  else if (L == mn)
2001
2001
  return fe();
2002
- }, ve = Mr(m, w, q), ne = Mr(m, v, _e);
2003
- return W.current = !1, oe.current = m, y.current = !0, $ && xe({
2002
+ }, ve = Mr(w, m, q), ne = Mr(w, v, _e);
2003
+ return W.current = !1, oe.current = w, y.current = !0, $ && xe({
2004
2004
  data: A,
2005
2005
  error: he,
2006
2006
  isValidating: Se
@@ -2008,7 +2008,7 @@ var ue = function() {
2008
2008
  W.current = !0, ve(), ne();
2009
2009
  };
2010
2010
  }
2011
- }, [m, fe]), st(function() {
2011
+ }, [w, fe]), st(function() {
2012
2012
  var $;
2013
2013
  function U() {
2014
2014
  var I = we(d) ? d(A) : d;
@@ -2020,7 +2020,7 @@ var ue = function() {
2020
2020
  return U(), function() {
2021
2021
  $ && (clearTimeout($), $ = -1);
2022
2022
  };
2023
- }, [d, o, l, fe]), In(A), s && V(A) && m)
2023
+ }, [d, o, l, fe]), In(A), s && V(A) && w)
2024
2024
  throw X.current = n, re.current = e, W.current = !1, V(he) ? fe(Mt) : he;
2025
2025
  return {
2026
2026
  mutate: Ie,
@@ -2051,14 +2051,14 @@ function wi() {
2051
2051
  Vr = 1;
2052
2052
  var t = Jr, n = Symbol.for("react.element"), e = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, r = { key: !0, ref: !0, __self: !0, __source: !0 };
2053
2053
  function s(c, d, o) {
2054
- var l, f = {}, v = null, w = null;
2055
- o !== void 0 && (v = "" + o), d.key !== void 0 && (v = "" + d.key), d.ref !== void 0 && (w = d.ref);
2054
+ var l, f = {}, v = null, m = null;
2055
+ o !== void 0 && (v = "" + o), d.key !== void 0 && (v = "" + d.key), d.ref !== void 0 && (m = d.ref);
2056
2056
  for (l in d)
2057
2057
  i.call(d, l) && !r.hasOwnProperty(l) && (f[l] = d[l]);
2058
2058
  if (c && c.defaultProps)
2059
2059
  for (l in d = c.defaultProps, d)
2060
2060
  f[l] === void 0 && (f[l] = d[l]);
2061
- return { $$typeof: n, type: c, key: v, ref: w, props: f, _owner: a.current };
2061
+ return { $$typeof: n, type: c, key: v, ref: m, props: f, _owner: a.current };
2062
2062
  }
2063
2063
  return Ve.Fragment = e, Ve.jsx = s, Ve.jsxs = s, Ve;
2064
2064
  }
@@ -2075,14 +2075,14 @@ var We = {};
2075
2075
  var Wr;
2076
2076
  function yi() {
2077
2077
  return Wr || (Wr = 1, process.env.NODE_ENV !== "production" && function() {
2078
- var t = Jr, n = Symbol.for("react.element"), e = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), o = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), O = Symbol.iterator, D = "@@iterator";
2078
+ var t = Jr, n = Symbol.for("react.element"), e = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), o = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), O = Symbol.iterator, D = "@@iterator";
2079
2079
  function R(u) {
2080
2080
  if (u === null || typeof u != "object")
2081
2081
  return null;
2082
2082
  var p = O && u[O] || u[D];
2083
2083
  return typeof p == "function" ? p : null;
2084
2084
  }
2085
- var m = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2085
+ var w = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2086
2086
  function E(u) {
2087
2087
  {
2088
2088
  for (var p = arguments.length, h = new Array(p > 1 ? p - 1 : 0), b = 1; b < p; b++)
@@ -2092,7 +2092,7 @@ function yi() {
2092
2092
  }
2093
2093
  function te(u, p, h) {
2094
2094
  {
2095
- var b = m.ReactDebugCurrentFrame, S = b.getStackAddendum();
2095
+ var b = w.ReactDebugCurrentFrame, S = b.getStackAddendum();
2096
2096
  S !== "" && (p += "%s", h = h.concat([S]));
2097
2097
  var C = h.map(function(g) {
2098
2098
  return String(g);
@@ -2103,7 +2103,7 @@ function yi() {
2103
2103
  var y = !1, W = !1, oe = !1, X = !1, re = !1, F;
2104
2104
  F = Symbol.for("react.module.reference");
2105
2105
  function P(u) {
2106
- return !!(typeof u == "string" || typeof u == "function" || u === i || u === r || re || u === a || u === o || u === l || X || u === w || y || W || oe || typeof u == "object" && u !== null && (u.$$typeof === v || u.$$typeof === f || u.$$typeof === s || u.$$typeof === c || u.$$typeof === d || u.$$typeof === F || u.getModuleId !== void 0));
2106
+ return !!(typeof u == "string" || typeof u == "function" || u === i || u === r || re || u === a || u === o || u === l || X || u === m || y || W || oe || typeof u == "object" && u !== null && (u.$$typeof === v || u.$$typeof === f || u.$$typeof === s || u.$$typeof === c || u.$$typeof === d || u.$$typeof === F || u.getModuleId !== void 0));
2107
2107
  }
2108
2108
  function Y(u, p, h) {
2109
2109
  var b = u.displayName;
@@ -2222,7 +2222,7 @@ function yi() {
2222
2222
  pe < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
2223
2223
  }
2224
2224
  }
2225
- var Ie = m.ReactCurrentDispatcher, $;
2225
+ var Ie = w.ReactCurrentDispatcher, $;
2226
2226
  function U(u, p, h) {
2227
2227
  {
2228
2228
  if ($ === void 0)
@@ -2348,7 +2348,7 @@ function yi() {
2348
2348
  }
2349
2349
  return "";
2350
2350
  }
2351
- var B = Object.prototype.hasOwnProperty, Oe = {}, me = m.ReactDebugCurrentFrame;
2351
+ var B = Object.prototype.hasOwnProperty, Oe = {}, me = w.ReactDebugCurrentFrame;
2352
2352
  function se(u) {
2353
2353
  if (u) {
2354
2354
  var p = u._owner, h = K(u.type, u._source, p ? p.type : null);
@@ -2399,7 +2399,7 @@ function yi() {
2399
2399
  if (gn(u))
2400
2400
  return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Rn(u)), nr(u);
2401
2401
  }
2402
- var Be = m.ReactCurrentOwner, En = {
2402
+ var Be = w.ReactCurrentOwner, En = {
2403
2403
  key: !0,
2404
2404
  ref: !0,
2405
2405
  __self: !0,
@@ -2494,7 +2494,7 @@ function yi() {
2494
2494
  return Fn(u, _, M, S, b, Be.current, g);
2495
2495
  }
2496
2496
  }
2497
- var wt = m.ReactCurrentOwner, sr = m.ReactDebugCurrentFrame;
2497
+ var wt = w.ReactCurrentOwner, sr = w.ReactDebugCurrentFrame;
2498
2498
  function De(u) {
2499
2499
  if (u) {
2500
2500
  var p = u._owner, h = K(u.type, u._source, p ? p.type : null);
@@ -2798,8 +2798,8 @@ const Ai = (t, n, e = !1, i = !1, a) => {
2798
2798
  i(null), r(!1), c(null), o(!1);
2799
2799
  }, []);
2800
2800
  return {
2801
- call: async (v) => (l(), n.post(t, v).then((w) => (i(w), r(!1), o(!0), w)).catch((w) => {
2802
- throw r(!1), o(!1), c(w), w;
2801
+ call: async (v) => (l(), n.post(t, v).then((m) => (i(m), r(!1), o(!0), m)).catch((m) => {
2802
+ throw r(!1), o(!1), c(m), m;
2803
2803
  })),
2804
2804
  result: e,
2805
2805
  loading: a,
@@ -2814,8 +2814,8 @@ const Ai = (t, n, e = !1, i = !1, a) => {
2814
2814
  i(null), r(!1), c(null), o(!1);
2815
2815
  }, []);
2816
2816
  return {
2817
- call: async (v) => (l(), n.put(t, v).then((w) => (i(w), r(!1), o(!0), w)).catch((w) => {
2818
- throw r(!1), o(!1), c(w), w;
2817
+ call: async (v) => (l(), n.put(t, v).then((m) => (i(m), r(!1), o(!0), m)).catch((m) => {
2818
+ throw r(!1), o(!1), c(m), m;
2819
2819
  })),
2820
2820
  result: e,
2821
2821
  loading: a,
@@ -2830,8 +2830,8 @@ const Ai = (t, n, e = !1, i = !1, a) => {
2830
2830
  i(null), r(!1), c(null), o(!1);
2831
2831
  }, []);
2832
2832
  return {
2833
- call: async (v) => (l(), n.delete(t, v).then((w) => (i(w), r(!1), o(!0), w)).catch((w) => {
2834
- throw r(!1), o(!1), c(w), w;
2833
+ call: async (v) => (l(), n.delete(t, v).then((m) => (i(m), r(!1), o(!0), m)).catch((m) => {
2834
+ throw r(!1), o(!1), c(m), m;
2835
2835
  })),
2836
2836
  result: e,
2837
2837
  loading: a,
@@ -2842,10 +2842,8 @@ const Ai = (t, n, e = !1, i = !1, a) => {
2842
2842
  }, Ui = () => {
2843
2843
  const {
2844
2844
  file: t
2845
- } = Z(ee), [n, e] = T(0), [i, a] = T(!1), [r, s] = T(null), [c, d] = T(!1), o = async (f, v) => (l(), a(!0), t.uploadFile(f, v, (w, O) => e(Math.round(w / O * 100))).then(() => {
2846
- d(!0), e(100), a(!1);
2847
- }).catch((w) => {
2848
- throw console.error(w), s(w), a(!1), w;
2845
+ } = Z(ee), [n, e] = T(0), [i, a] = T(!1), [r, s] = T(null), [c, d] = T(!1), o = async (f, v) => (l(), a(!0), t.uploadFile(f, v, (m, O) => e(Math.round(m / O * 100))).then((m) => (d(!0), e(100), a(!1), m.data.message)).catch((m) => {
2846
+ throw console.error(m), s(m), a(!1), m;
2849
2847
  })), l = ie(() => {
2850
2848
  e(0), a(!1), s(null), d(!1);
2851
2849
  }, []);
@@ -1,5 +1,5 @@
1
1
  (function(F,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],v):(F=typeof globalThis<"u"?globalThis:F||self,v(F["Frappe React"]={},F.React))})(this,function(F,v){"use strict";const tr=(t=>t&&typeof t=="object"&&"default"in t?t:{default:t})(v);var x=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ht={},Ue={},Le={},Ne={exports:{}},vt={exports:{}},rr=function(n,e){return function(){for(var a=new Array(arguments.length),r=0;r<a.length;r++)a[r]=arguments[r];return n.apply(e,a)}},bn=rr,de=Object.prototype.toString;function mt(t){return Array.isArray(t)}function wt(t){return typeof t>"u"}function _n(t){return t!==null&&!wt(t)&&t.constructor!==null&&!wt(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function nr(t){return de.call(t)==="[object ArrayBuffer]"}function Rn(t){return de.call(t)==="[object FormData]"}function gn(t){var n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(t):n=t&&t.buffer&&nr(t.buffer),n}function Sn(t){return typeof t=="string"}function Cn(t){return typeof t=="number"}function ar(t){return t!==null&&typeof t=="object"}function Qe(t){if(de.call(t)!=="[object Object]")return!1;var n=Object.getPrototypeOf(t);return n===null||n===Object.prototype}function En(t){return de.call(t)==="[object Date]"}function Tn(t){return de.call(t)==="[object File]"}function xn(t){return de.call(t)==="[object Blob]"}function ir(t){return de.call(t)==="[object Function]"}function On(t){return ar(t)&&ir(t.pipe)}function Fn(t){return de.call(t)==="[object URLSearchParams]"}function Dn(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function kn(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function yt(t,n){if(!(t===null||typeof t>"u"))if(typeof t!="object"&&(t=[t]),mt(t))for(var e=0,i=t.length;e<i;e++)n.call(null,t[e],e,t);else for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&n.call(null,t[a],a,t)}function bt(){var t={};function n(a,r){Qe(t[r])&&Qe(a)?t[r]=bt(t[r],a):Qe(a)?t[r]=bt({},a):mt(a)?t[r]=a.slice():t[r]=a}for(var e=0,i=arguments.length;e<i;e++)yt(arguments[e],n);return t}function An(t,n,e){return yt(n,function(a,r){e&&typeof a=="function"?t[r]=bn(a,e):t[r]=a}),t}function jn(t){return t.charCodeAt(0)===65279&&(t=t.slice(1)),t}var X={isArray:mt,isArrayBuffer:nr,isBuffer:_n,isFormData:Rn,isArrayBufferView:gn,isString:Sn,isNumber:Cn,isObject:ar,isPlainObject:Qe,isUndefined:wt,isDate:En,isFile:Tn,isBlob:xn,isFunction:ir,isStream:On,isURLSearchParams:Fn,isStandardBrowserEnv:kn,forEach:yt,merge:bt,extend:An,trim:Dn,stripBOM:jn},ge=X;function or(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var sr=function(n,e,i){if(!e)return n;var a;if(i)a=i(e);else if(ge.isURLSearchParams(e))a=e.toString();else{var r=[];ge.forEach(e,function(d,o){d===null||typeof d>"u"||(ge.isArray(d)?o=o+"[]":d=[d],ge.forEach(d,function(f){ge.isDate(f)?f=f.toISOString():ge.isObject(f)&&(f=JSON.stringify(f)),r.push(or(o)+"="+or(f))}))}),a=r.join("&")}if(a){var s=n.indexOf("#");s!==-1&&(n=n.slice(0,s)),n+=(n.indexOf("?")===-1?"?":"&")+a}return n},Pn=X;function Ze(){this.handlers=[]}Ze.prototype.use=function(n,e,i){return this.handlers.push({fulfilled:n,rejected:e,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1},Ze.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)},Ze.prototype.forEach=function(n){Pn.forEach(this.handlers,function(i){i!==null&&n(i)})};var Un=Ze,Ln=X,Nn=function(n,e){Ln.forEach(n,function(a,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(n[e]=a,delete n[r])})},ur=function(n,e,i,a,r){return n.config=e,i&&(n.code=i),n.request=a,n.response=r,n.isAxiosError=!0,n.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},n},lr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_t,cr;function fr(){if(cr)return _t;cr=1;var t=ur;return _t=function(e,i,a,r,s){var l=new Error(e);return t(l,i,a,r,s)},_t}var Rt,dr;function In(){if(dr)return Rt;dr=1;var t=fr();return Rt=function(e,i,a){var r=a.config.validateStatus;!a.status||!r||r(a.status)?e(a):i(t("Request failed with status code "+a.status,a.config,null,a.request,a))},Rt}var gt,pr;function Bn(){if(pr)return gt;pr=1;var t=X;return gt=t.isStandardBrowserEnv()?function(){return{write:function(i,a,r,s,l,d){var o=[];o.push(i+"="+encodeURIComponent(a)),t.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),t.isString(s)&&o.push("path="+s),t.isString(l)&&o.push("domain="+l),d===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(i){var a=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(i){this.write(i,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),gt}var St,hr;function Mn(){return hr||(hr=1,St=function(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}),St}var Ct,vr;function Vn(){return vr||(vr=1,Ct=function(n,e){return e?n.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):n}),Ct}var Et,mr;function Wn(){if(mr)return Et;mr=1;var t=Mn(),n=Vn();return Et=function(i,a){return i&&!t(a)?n(i,a):a},Et}var Tt,wr;function Jn(){if(wr)return Tt;wr=1;var t=X,n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Tt=function(i){var a={},r,s,l;return i&&t.forEach(i.split(`
2
- `),function(o){if(l=o.indexOf(":"),r=t.trim(o.substr(0,l)).toLowerCase(),s=t.trim(o.substr(l+1)),r){if(a[r]&&n.indexOf(r)>=0)return;r==="set-cookie"?a[r]=(a[r]?a[r]:[]).concat([s]):a[r]=a[r]?a[r]+", "+s:s}}),a},Tt}var xt,yr;function Hn(){if(yr)return xt;yr=1;var t=X;return xt=t.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a"),a;function r(s){var l=s;return e&&(i.setAttribute("href",l),l=i.href),i.setAttribute("href",l),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return a=r(window.location.href),function(l){var d=t.isString(l)?r(l):l;return d.protocol===a.protocol&&d.host===a.host}}():function(){return function(){return!0}}(),xt}var Ot,br;function $e(){if(br)return Ot;br=1;function t(n){this.message=n}return t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,Ot=t,Ot}var Ft,_r;function Rr(){if(_r)return Ft;_r=1;var t=X,n=In(),e=Bn(),i=sr,a=Wn(),r=Jn(),s=Hn(),l=fr(),d=lr,o=$e();return Ft=function(f){return new Promise(function(y,O){var k=f.data,g=f.headers,w=f.responseType,C;function te(){f.cancelToken&&f.cancelToken.unsubscribe(C),f.signal&&f.signal.removeEventListener("abort",C)}t.isFormData(k)&&delete g["Content-Type"];var b=new XMLHttpRequest;if(f.auth){var G=f.auth.username||"",ie=f.auth.password?unescape(encodeURIComponent(f.auth.password)):"";g.Authorization="Basic "+btoa(G+":"+ie)}var K=a(f.baseURL,f.url);b.open(f.method.toUpperCase(),i(K,f.params,f.paramsSerializer),!0),b.timeout=f.timeout;function re(){if(!!b){var L="getAllResponseHeaders"in b?r(b.getAllResponseHeaders()):null,Q=!w||w==="text"||w==="json"?b.responseText:b.response,Z={data:Q,status:b.status,statusText:b.statusText,headers:L,config:f,request:b};n(function(A){y(A),te()},function(A){O(A),te()},Z),b=null}}if("onloadend"in b?b.onloadend=re:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(re)},b.onabort=function(){!b||(O(l("Request aborted",f,"ECONNABORTED",b)),b=null)},b.onerror=function(){O(l("Network Error",f,null,b)),b=null},b.ontimeout=function(){var Q=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded",Z=f.transitional||d;f.timeoutErrorMessage&&(Q=f.timeoutErrorMessage),O(l(Q,f,Z.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},t.isStandardBrowserEnv()){var D=(f.withCredentials||s(K))&&f.xsrfCookieName?e.read(f.xsrfCookieName):void 0;D&&(g[f.xsrfHeaderName]=D)}"setRequestHeader"in b&&t.forEach(g,function(Q,Z){typeof k>"u"&&Z.toLowerCase()==="content-type"?delete g[Z]:b.setRequestHeader(Z,Q)}),t.isUndefined(f.withCredentials)||(b.withCredentials=!!f.withCredentials),w&&w!=="json"&&(b.responseType=f.responseType),typeof f.onDownloadProgress=="function"&&b.addEventListener("progress",f.onDownloadProgress),typeof f.onUploadProgress=="function"&&b.upload&&b.upload.addEventListener("progress",f.onUploadProgress),(f.cancelToken||f.signal)&&(C=function(L){!b||(O(!L||L&&L.type?new o("canceled"):L),b.abort(),b=null)},f.cancelToken&&f.cancelToken.subscribe(C),f.signal&&(f.signal.aborted?C():f.signal.addEventListener("abort",C))),k||(k=null),b.send(k)})},Ft}var U=X,gr=Nn,Xn=ur,qn=lr,Yn={"Content-Type":"application/x-www-form-urlencoded"};function Sr(t,n){!U.isUndefined(t)&&U.isUndefined(t["Content-Type"])&&(t["Content-Type"]=n)}function Gn(){var t;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(t=Rr()),t}function zn(t,n,e){if(U.isString(t))try{return(n||JSON.parse)(t),U.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(e||JSON.stringify)(t)}var et={transitional:qn,adapter:Gn(),transformRequest:[function(n,e){return gr(e,"Accept"),gr(e,"Content-Type"),U.isFormData(n)||U.isArrayBuffer(n)||U.isBuffer(n)||U.isStream(n)||U.isFile(n)||U.isBlob(n)?n:U.isArrayBufferView(n)?n.buffer:U.isURLSearchParams(n)?(Sr(e,"application/x-www-form-urlencoded;charset=utf-8"),n.toString()):U.isObject(n)||e&&e["Content-Type"]==="application/json"?(Sr(e,"application/json"),zn(n)):n}],transformResponse:[function(n){var e=this.transitional||et.transitional,i=e&&e.silentJSONParsing,a=e&&e.forcedJSONParsing,r=!i&&this.responseType==="json";if(r||a&&U.isString(n)&&n.length)try{return JSON.parse(n)}catch(s){if(r)throw s.name==="SyntaxError"?Xn(s,this,"E_JSON_PARSE"):s}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};U.forEach(["delete","get","head"],function(n){et.headers[n]={}}),U.forEach(["post","put","patch"],function(n){et.headers[n]=U.merge(Yn)});var Dt=et,Kn=X,Qn=Dt,Zn=function(n,e,i){var a=this||Qn;return Kn.forEach(i,function(s){n=s.call(a,n,e)}),n},kt,Cr;function Er(){return Cr||(Cr=1,kt=function(n){return!!(n&&n.__CANCEL__)}),kt}var Tr=X,At=Zn,$n=Er(),ea=Dt,ta=$e();function jt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ta("canceled")}var ra=function(n){jt(n),n.headers=n.headers||{},n.data=At.call(n,n.data,n.headers,n.transformRequest),n.headers=Tr.merge(n.headers.common||{},n.headers[n.method]||{},n.headers),Tr.forEach(["delete","get","head","post","put","patch","common"],function(a){delete n.headers[a]});var e=n.adapter||ea.adapter;return e(n).then(function(a){return jt(n),a.data=At.call(n,a.data,a.headers,n.transformResponse),a},function(a){return $n(a)||(jt(n),a&&a.response&&(a.response.data=At.call(n,a.response.data,a.response.headers,n.transformResponse))),Promise.reject(a)})},z=X,xr=function(n,e){e=e||{};var i={};function a(c,f){return z.isPlainObject(c)&&z.isPlainObject(f)?z.merge(c,f):z.isPlainObject(f)?z.merge({},f):z.isArray(f)?f.slice():f}function r(c){if(z.isUndefined(e[c])){if(!z.isUndefined(n[c]))return a(void 0,n[c])}else return a(n[c],e[c])}function s(c){if(!z.isUndefined(e[c]))return a(void 0,e[c])}function l(c){if(z.isUndefined(e[c])){if(!z.isUndefined(n[c]))return a(void 0,n[c])}else return a(void 0,e[c])}function d(c){if(c in e)return a(n[c],e[c]);if(c in n)return a(void 0,n[c])}var o={url:s,method:s,data:s,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:d};return z.forEach(Object.keys(n).concat(Object.keys(e)),function(f){var m=o[f]||r,y=m(f);z.isUndefined(y)&&m!==d||(i[f]=y)}),i},Pt,Or;function Fr(){return Or||(Or=1,Pt={version:"0.26.1"}),Pt}var na=Fr().version,Ut={};["object","boolean","number","function","string","symbol"].forEach(function(t,n){Ut[t]=function(i){return typeof i===t||"a"+(n<1?"n ":" ")+t}});var Dr={};Ut.transitional=function(n,e,i){function a(r,s){return"[Axios v"+na+"] Transitional option '"+r+"'"+s+(i?". "+i:"")}return function(r,s,l){if(n===!1)throw new Error(a(s," has been removed"+(e?" in "+e:"")));return e&&!Dr[s]&&(Dr[s]=!0,console.warn(a(s," has been deprecated since v"+e+" and will be removed in the near future"))),n?n(r,s,l):!0}};function aa(t,n,e){if(typeof t!="object")throw new TypeError("options must be an object");for(var i=Object.keys(t),a=i.length;a-- >0;){var r=i[a],s=n[r];if(s){var l=t[r],d=l===void 0||s(l,r,t);if(d!==!0)throw new TypeError("option "+r+" must be "+d);continue}if(e!==!0)throw Error("Unknown option "+r)}}var ia={assertOptions:aa,validators:Ut},kr=X,oa=sr,Ar=Un,jr=ra,tt=xr,Pr=ia,Se=Pr.validators;function Ie(t){this.defaults=t,this.interceptors={request:new Ar,response:new Ar}}Ie.prototype.request=function(n,e){typeof n=="string"?(e=e||{},e.url=n):e=n||{},e=tt(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var i=e.transitional;i!==void 0&&Pr.assertOptions(i,{silentJSONParsing:Se.transitional(Se.boolean),forcedJSONParsing:Se.transitional(Se.boolean),clarifyTimeoutError:Se.transitional(Se.boolean)},!1);var a=[],r=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(e)===!1||(r=r&&y.synchronous,a.unshift(y.fulfilled,y.rejected))});var s=[];this.interceptors.response.forEach(function(y){s.push(y.fulfilled,y.rejected)});var l;if(!r){var d=[jr,void 0];for(Array.prototype.unshift.apply(d,a),d=d.concat(s),l=Promise.resolve(e);d.length;)l=l.then(d.shift(),d.shift());return l}for(var o=e;a.length;){var c=a.shift(),f=a.shift();try{o=c(o)}catch(m){f(m);break}}try{l=jr(o)}catch(m){return Promise.reject(m)}for(;s.length;)l=l.then(s.shift(),s.shift());return l},Ie.prototype.getUri=function(n){return n=tt(this.defaults,n),oa(n.url,n.params,n.paramsSerializer).replace(/^\?/,"")},kr.forEach(["delete","get","head","options"],function(n){Ie.prototype[n]=function(e,i){return this.request(tt(i||{},{method:n,url:e,data:(i||{}).data}))}}),kr.forEach(["post","put","patch"],function(n){Ie.prototype[n]=function(e,i,a){return this.request(tt(a||{},{method:n,url:e,data:i}))}});var sa=Ie,Lt,Ur;function ua(){if(Ur)return Lt;Ur=1;var t=$e();function n(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var i;this.promise=new Promise(function(s){i=s});var a=this;this.promise.then(function(r){if(!!a._listeners){var s,l=a._listeners.length;for(s=0;s<l;s++)a._listeners[s](r);a._listeners=null}}),this.promise.then=function(r){var s,l=new Promise(function(d){a.subscribe(d),s=d}).then(r);return l.cancel=function(){a.unsubscribe(s)},l},e(function(s){a.reason||(a.reason=new t(s),i(a.reason))})}return n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.prototype.subscribe=function(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]},n.prototype.unsubscribe=function(i){if(!!this._listeners){var a=this._listeners.indexOf(i);a!==-1&&this._listeners.splice(a,1)}},n.source=function(){var i,a=new n(function(s){i=s});return{token:a,cancel:i}},Lt=n,Lt}var Nt,Lr;function la(){return Lr||(Lr=1,Nt=function(n){return function(i){return n.apply(null,i)}}),Nt}var It,Nr;function ca(){if(Nr)return It;Nr=1;var t=X;return It=function(e){return t.isObject(e)&&e.isAxiosError===!0},It}var Ir=X,fa=rr,rt=sa,da=xr,pa=Dt;function Br(t){var n=new rt(t),e=fa(rt.prototype.request,n);return Ir.extend(e,rt.prototype,n),Ir.extend(e,n),e.create=function(a){return Br(da(t,a))},e}var se=Br(pa);se.Axios=rt,se.Cancel=$e(),se.CancelToken=ua(),se.isCancel=Er(),se.VERSION=Fr().version,se.all=function(n){return Promise.all(n)},se.spread=la(),se.isAxiosError=ca(),vt.exports=se,vt.exports.default=se,function(t){t.exports=vt.exports}(Ne);var nt=x&&x.__assign||function(){return nt=Object.assign||function(t){for(var n,e=1,i=arguments.length;e<i;e++){n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},nt.apply(this,arguments)},at=x&&x.__awaiter||function(t,n,e,i){function a(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function l(c){try{o(i.next(c))}catch(f){s(f)}}function d(c){try{o(i.throw(c))}catch(f){s(f)}}function o(c){c.done?r(c.value):a(c.value).then(l,d)}o((i=i.apply(t,n||[])).next())})},it=x&&x.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(c){return d([o,c])}}function d(o){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,a&&(r=o[0]&2?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return e.label++,{value:o[1],done:!1};case 5:e.label++,a=o[1],o=[0];continue;case 7:o=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1],r=o;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(o);break}r[2]&&e.ops.pop(),e.trys.pop();continue}o=n.call(t,e)}catch(c){o=[6,c],a=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(Le,"__esModule",{value:!0}),Le.FrappeCall=void 0;var ot=Ne.exports,ha=function(){function t(n){this.appURL=n}return t.prototype.get=function(n,e){return at(this,void 0,void 0,function(){var i;return it(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,ot.default.get("".concat(this.appURL,"/api/method/").concat(n),{headers:i,params:e,withCredentials:!0}).then(function(r){return r.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error.",exception:(l=r.response.data.exception)!==null&&l!==void 0?l:""}})]})})},t.prototype.post=function(n,e){return at(this,void 0,void 0,function(){var i;return it(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,ot.default.post("".concat(this.appURL,"/api/method/").concat(n),nt({},e),{withCredentials:!0,headers:i}).then(function(r){return r.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error.",exception:(l=r.response.data.exception)!==null&&l!==void 0?l:""}})]})})},t.prototype.put=function(n,e){return at(this,void 0,void 0,function(){var i;return it(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,ot.default.put("".concat(this.appURL,"/api/method/").concat(n),nt({},e),{headers:i,withCredentials:!0}).then(function(r){return r.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error.",exception:(l=r.response.data.exception)!==null&&l!==void 0?l:""}})]})})},t.prototype.delete=function(n,e){return at(this,void 0,void 0,function(){var i;return it(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,ot.default.delete("".concat(this.appURL,"/api/method/").concat(n),{headers:i,params:e,withCredentials:!0}).then(function(r){return r.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error.",exception:(l=r.response.data.exception)!==null&&l!==void 0?l:""}})]})})},t}();Le.FrappeCall=ha;var Be={},st=x&&x.__assign||function(){return st=Object.assign||function(t){for(var n,e=1,i=arguments.length;e<i;e++){n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},st.apply(this,arguments)},Ce=x&&x.__awaiter||function(t,n,e,i){function a(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function l(c){try{o(i.next(c))}catch(f){s(f)}}function d(c){try{o(i.throw(c))}catch(f){s(f)}}function o(c){c.done?r(c.value):a(c.value).then(l,d)}o((i=i.apply(t,n||[])).next())})},Ee=x&&x.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(c){return d([o,c])}}function d(o){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,a&&(r=o[0]&2?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return e.label++,{value:o[1],done:!1};case 5:e.label++,a=o[1],o=[0];continue;case 7:o=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1],r=o;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(o);break}r[2]&&e.ops.pop(),e.trys.pop();continue}o=n.call(t,e)}catch(c){o=[6,c],a=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(Be,"__esModule",{value:!0}),Be.FrappeDB=void 0;var Te=Ne.exports,va=function(){function t(n){this.appURL=n}return t.prototype.getRequestURL=function(n,e){var i="".concat(this.appURL,"/api/resource/");return e?i+="".concat(n,"/").concat(e):i+="".concat(n),i},t.prototype.getDoc=function(n,e){return Ce(this,void 0,void 0,function(){var i;return Ee(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,Te.default.get(this.getRequestURL(n,e),{headers:i,withCredentials:!0}).then(function(r){return r.data.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:"There was an error while fetching the document.",exception:(l=(s=r.response.data.exception)!==null&&s!==void 0?s:r.response.data.exc_type)!==null&&l!==void 0?l:""}})]})})},t.prototype.getDocList=function(n,e){var i;return Ce(this,void 0,void 0,function(){var a,r,s,l,d,o,c,f,m,y,O;return Ee(this,function(k){return a={},e&&(r=e.fields,s=e.filters,l=e.orFilters,d=e.orderBy,o=e.limit,c=e.limit_start,f=e.asDict,m=f===void 0?!0:f,y=d?"".concat(d==null?void 0:d.field," ").concat((i=d==null?void 0:d.order)!==null&&i!==void 0?i:"asc"):"",a={fields:r?JSON.stringify(r):void 0,filters:s?JSON.stringify(s):void 0,or_filters:l?JSON.stringify(l):void 0,order_by:y,limit:o,page_limit_start:c,as_dict:m}),O={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(O["X-Frappe-CSRF-Token"]=window.csrf_token),[2,Te.default.get(this.getRequestURL(n),{params:a,headers:O,withCredentials:!0}).then(function(g){return g.data.data}).catch(function(g){var w,C;throw{httpStatus:g.response.status,httpStatusText:g.response.statusText,message:"There was an error while fetching the documents.",exception:(C=(w=g.response.data.exception)!==null&&w!==void 0?w:g.response.data.exc_type)!==null&&C!==void 0?C:""}})]})})},t.prototype.createDoc=function(n,e){return Ce(this,void 0,void 0,function(){var i;return Ee(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,Te.default.post(this.getRequestURL(n),st({},e),{headers:i,withCredentials:!0}).then(function(r){return r.data.data}).catch(function(r){var s,l,d;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error while creating the document.",exception:(d=(l=r.response.data.exception)!==null&&l!==void 0?l:r.response.data.exc_type)!==null&&d!==void 0?d:""}})]})})},t.prototype.updateDoc=function(n,e,i){return Ce(this,void 0,void 0,function(){var a;return Ee(this,function(r){return a={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(a["X-Frappe-CSRF-Token"]=window.csrf_token),[2,Te.default.put(this.getRequestURL(n,e),st({},i),{headers:a,withCredentials:!0}).then(function(s){return s.data.data}).catch(function(s){var l,d,o;throw{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(l=s.response.data.message)!==null&&l!==void 0?l:"There was an error while updating the document.",exception:(o=(d=s.response.data.exception)!==null&&d!==void 0?d:s.response.data.exc_type)!==null&&o!==void 0?o:""}})]})})},t.prototype.deleteDoc=function(n,e){return Ce(this,void 0,void 0,function(){var i;return Ee(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,Te.default.delete(this.getRequestURL(n,e),{headers:i,withCredentials:!0}).then(function(r){return r.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:"There was an error while deleting the document.",exception:(l=(s=r.response.data.exception)!==null&&s!==void 0?s:r.response.data.exc_type)!==null&&l!==void 0?l:""}})]})})},t.prototype.getCount=function(n,e,i,a){return i===void 0&&(i=!1),a===void 0&&(a=!1),Ce(this,void 0,void 0,function(){var r,s;return Ee(this,function(l){return r={doctype:n,debug:a,cache:i,filters:[]},e&&(r.filters=e?JSON.stringify(e):void 0),s={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(s["X-Frappe-CSRF-Token"]=window.csrf_token),[2,Te.default.get("".concat(this.appURL,"/api/method/frappe.client.get_count"),{params:r,headers:s,withCredentials:!0}).then(function(d){return d.data.message}).catch(function(d){var o,c;throw{httpStatus:d.response.status,httpStatusText:d.response.statusText,message:"There was an error while getting the count.",exception:(c=(o=d.response.data.exception)!==null&&o!==void 0?o:d.response.data.exc_type)!==null&&c!==void 0?c:""}})]})})},t}();Be.FrappeDB=va;var Me={},ma=x&&x.__awaiter||function(t,n,e,i){function a(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function l(c){try{o(i.next(c))}catch(f){s(f)}}function d(c){try{o(i.throw(c))}catch(f){s(f)}}function o(c){c.done?r(c.value):a(c.value).then(l,d)}o((i=i.apply(t,n||[])).next())})},wa=x&&x.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(c){return d([o,c])}}function d(o){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,a&&(r=o[0]&2?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return e.label++,{value:o[1],done:!1};case 5:e.label++,a=o[1],o=[0];continue;case 7:o=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1],r=o;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(o);break}r[2]&&e.ops.pop(),e.trys.pop();continue}o=n.call(t,e)}catch(c){o=[6,c],a=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(Me,"__esModule",{value:!0}),Me.FrappeFileUpload=void 0;var ya=Ne.exports,ba=function(){function t(n){this.appURL=n}return t.prototype.uploadFile=function(n,e,i){return ma(this,void 0,void 0,function(){var a,r,s,l,d,o,c;return wa(this,function(f){return a=new FormData,n&&a.append("file",n,n.name),r=e.isPrivate,s=e.folder,l=e.file_url,d=e.doctype,o=e.docname,r&&a.append("is_private","1"),s&&a.append("folder",s),l&&a.append("file_url",l),d&&o&&(a.append("doctype",d),a.append("docname",o)),c={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(c["X-Frappe-CSRF-Token"]=window.csrf_token),[2,ya.default.post("".concat(this.appURL,"/api/method/upload_file"),a,{headers:c,onUploadProgress:function(m){i&&i(m.loaded,m.total)}}).catch(function(m){var y,O;throw{httpStatus:m.response.status,httpStatusText:m.response.statusText,message:(y=m.response.data.message)!==null&&y!==void 0?y:"There was an error while uploading the file.",exception:(O=m.response.data.exception)!==null&&O!==void 0?O:""}})]})})},t}();Me.FrappeFileUpload=ba;var Mr;function _a(){if(Mr)return Ue;Mr=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.FrappeApp=void 0;var t=Wr(),n=Le,e=Be,i=Me,a=function(){function r(s,l){this.url=s,this.name=l!=null?l:"FrappeApp"}return r.prototype.auth=function(){return new t.FrappeAuth(this.url)},r.prototype.db=function(){return new e.FrappeDB(this.url)},r.prototype.file=function(){return new i.FrappeFileUpload(this.url)},r.prototype.call=function(){return new n.FrappeCall(this.url)},r}();return Ue.FrappeApp=a,Ue}var ut={},Bt=x&&x.__awaiter||function(t,n,e,i){function a(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function l(c){try{o(i.next(c))}catch(f){s(f)}}function d(c){try{o(i.throw(c))}catch(f){s(f)}}function o(c){c.done?r(c.value):a(c.value).then(l,d)}o((i=i.apply(t,n||[])).next())})},Mt=x&&x.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(c){return d([o,c])}}function d(o){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,a&&(r=o[0]&2?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return e.label++,{value:o[1],done:!1};case 5:e.label++,a=o[1],o=[0];continue;case 7:o=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1],r=o;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(o);break}r[2]&&e.ops.pop(),e.trys.pop();continue}o=n.call(t,e)}catch(c){o=[6,c],a=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(ut,"__esModule",{value:!0}),ut.FrappeAuth=void 0;var Vt=Ne.exports,Ra=function(){function t(n){this.appURL=n}return t.prototype.loginWithUsernamePassword=function(n){return Bt(this,void 0,void 0,function(){var e,i;return Mt(this,function(a){return e=n.username,i=n.password,[2,Vt.default.post("".concat(this.appURL,"/api/method/login"),{usr:e,pwd:i},{headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0}).then(function(r){return r.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error while logging in",exception:(l=r.response.data.exception)!==null&&l!==void 0?l:""}})]})})},t.prototype.getLoggedInUser=function(){return Bt(this,void 0,void 0,function(){return Mt(this,function(n){return[2,Vt.default.get("".concat(this.appURL,"/api/method/frappe.auth.get_logged_user"),{headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0}).then(function(e){return e.data.message}).catch(function(e){var i;throw{httpStatus:e.response.status,httpStatusText:e.response.statusText,message:"There was an error while fetching the logged in user",exception:(i=e.response.data.exception)!==null&&i!==void 0?i:""}})]})})},t.prototype.logout=function(){return Bt(this,void 0,void 0,function(){return Mt(this,function(n){return[2,Vt.default.post("".concat(this.appURL,"/api/method/logout"),{},{headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0}).then(function(){}).catch(function(e){var i,a;throw{httpStatus:e.response.status,httpStatusText:e.response.statusText,message:(i=e.response.data.message)!==null&&i!==void 0?i:"There was an error while logging out",exception:(a=e.response.data.exception)!==null&&a!==void 0?a:""}})]})})},t}();ut.FrappeAuth=Ra;var Vr;function Wr(){return Vr||(Vr=1,function(t){var n=x&&x.__createBinding||(Object.create?function(i,a,r,s){s===void 0&&(s=r);var l=Object.getOwnPropertyDescriptor(a,r);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(i,s,l)}:function(i,a,r,s){s===void 0&&(s=r),i[s]=a[r]}),e=x&&x.__exportStar||function(i,a){for(var r in i)r!=="default"&&!Object.prototype.hasOwnProperty.call(a,r)&&n(a,i,r)};Object.defineProperty(t,"__esModule",{value:!0}),e(_a(),t),e(ut,t),e(Be,t),e(Me,t),e(Le,t)}(ht)),ht}var ga=Wr();/*! *****************************************************************************
2
+ `),function(o){if(l=o.indexOf(":"),r=t.trim(o.substr(0,l)).toLowerCase(),s=t.trim(o.substr(l+1)),r){if(a[r]&&n.indexOf(r)>=0)return;r==="set-cookie"?a[r]=(a[r]?a[r]:[]).concat([s]):a[r]=a[r]?a[r]+", "+s:s}}),a},Tt}var xt,yr;function Hn(){if(yr)return xt;yr=1;var t=X;return xt=t.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a"),a;function r(s){var l=s;return e&&(i.setAttribute("href",l),l=i.href),i.setAttribute("href",l),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return a=r(window.location.href),function(l){var d=t.isString(l)?r(l):l;return d.protocol===a.protocol&&d.host===a.host}}():function(){return function(){return!0}}(),xt}var Ot,br;function $e(){if(br)return Ot;br=1;function t(n){this.message=n}return t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,Ot=t,Ot}var Ft,_r;function Rr(){if(_r)return Ft;_r=1;var t=X,n=In(),e=Bn(),i=sr,a=Wn(),r=Jn(),s=Hn(),l=fr(),d=lr,o=$e();return Ft=function(f){return new Promise(function(w,O){var k=f.data,g=f.headers,y=f.responseType,C;function te(){f.cancelToken&&f.cancelToken.unsubscribe(C),f.signal&&f.signal.removeEventListener("abort",C)}t.isFormData(k)&&delete g["Content-Type"];var b=new XMLHttpRequest;if(f.auth){var G=f.auth.username||"",ie=f.auth.password?unescape(encodeURIComponent(f.auth.password)):"";g.Authorization="Basic "+btoa(G+":"+ie)}var K=a(f.baseURL,f.url);b.open(f.method.toUpperCase(),i(K,f.params,f.paramsSerializer),!0),b.timeout=f.timeout;function re(){if(!!b){var L="getAllResponseHeaders"in b?r(b.getAllResponseHeaders()):null,Q=!y||y==="text"||y==="json"?b.responseText:b.response,Z={data:Q,status:b.status,statusText:b.statusText,headers:L,config:f,request:b};n(function(A){w(A),te()},function(A){O(A),te()},Z),b=null}}if("onloadend"in b?b.onloadend=re:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(re)},b.onabort=function(){!b||(O(l("Request aborted",f,"ECONNABORTED",b)),b=null)},b.onerror=function(){O(l("Network Error",f,null,b)),b=null},b.ontimeout=function(){var Q=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded",Z=f.transitional||d;f.timeoutErrorMessage&&(Q=f.timeoutErrorMessage),O(l(Q,f,Z.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},t.isStandardBrowserEnv()){var D=(f.withCredentials||s(K))&&f.xsrfCookieName?e.read(f.xsrfCookieName):void 0;D&&(g[f.xsrfHeaderName]=D)}"setRequestHeader"in b&&t.forEach(g,function(Q,Z){typeof k>"u"&&Z.toLowerCase()==="content-type"?delete g[Z]:b.setRequestHeader(Z,Q)}),t.isUndefined(f.withCredentials)||(b.withCredentials=!!f.withCredentials),y&&y!=="json"&&(b.responseType=f.responseType),typeof f.onDownloadProgress=="function"&&b.addEventListener("progress",f.onDownloadProgress),typeof f.onUploadProgress=="function"&&b.upload&&b.upload.addEventListener("progress",f.onUploadProgress),(f.cancelToken||f.signal)&&(C=function(L){!b||(O(!L||L&&L.type?new o("canceled"):L),b.abort(),b=null)},f.cancelToken&&f.cancelToken.subscribe(C),f.signal&&(f.signal.aborted?C():f.signal.addEventListener("abort",C))),k||(k=null),b.send(k)})},Ft}var U=X,gr=Nn,Xn=ur,qn=lr,Yn={"Content-Type":"application/x-www-form-urlencoded"};function Sr(t,n){!U.isUndefined(t)&&U.isUndefined(t["Content-Type"])&&(t["Content-Type"]=n)}function Gn(){var t;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(t=Rr()),t}function zn(t,n,e){if(U.isString(t))try{return(n||JSON.parse)(t),U.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(e||JSON.stringify)(t)}var et={transitional:qn,adapter:Gn(),transformRequest:[function(n,e){return gr(e,"Accept"),gr(e,"Content-Type"),U.isFormData(n)||U.isArrayBuffer(n)||U.isBuffer(n)||U.isStream(n)||U.isFile(n)||U.isBlob(n)?n:U.isArrayBufferView(n)?n.buffer:U.isURLSearchParams(n)?(Sr(e,"application/x-www-form-urlencoded;charset=utf-8"),n.toString()):U.isObject(n)||e&&e["Content-Type"]==="application/json"?(Sr(e,"application/json"),zn(n)):n}],transformResponse:[function(n){var e=this.transitional||et.transitional,i=e&&e.silentJSONParsing,a=e&&e.forcedJSONParsing,r=!i&&this.responseType==="json";if(r||a&&U.isString(n)&&n.length)try{return JSON.parse(n)}catch(s){if(r)throw s.name==="SyntaxError"?Xn(s,this,"E_JSON_PARSE"):s}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};U.forEach(["delete","get","head"],function(n){et.headers[n]={}}),U.forEach(["post","put","patch"],function(n){et.headers[n]=U.merge(Yn)});var Dt=et,Kn=X,Qn=Dt,Zn=function(n,e,i){var a=this||Qn;return Kn.forEach(i,function(s){n=s.call(a,n,e)}),n},kt,Cr;function Er(){return Cr||(Cr=1,kt=function(n){return!!(n&&n.__CANCEL__)}),kt}var Tr=X,At=Zn,$n=Er(),ea=Dt,ta=$e();function jt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ta("canceled")}var ra=function(n){jt(n),n.headers=n.headers||{},n.data=At.call(n,n.data,n.headers,n.transformRequest),n.headers=Tr.merge(n.headers.common||{},n.headers[n.method]||{},n.headers),Tr.forEach(["delete","get","head","post","put","patch","common"],function(a){delete n.headers[a]});var e=n.adapter||ea.adapter;return e(n).then(function(a){return jt(n),a.data=At.call(n,a.data,a.headers,n.transformResponse),a},function(a){return $n(a)||(jt(n),a&&a.response&&(a.response.data=At.call(n,a.response.data,a.response.headers,n.transformResponse))),Promise.reject(a)})},z=X,xr=function(n,e){e=e||{};var i={};function a(c,f){return z.isPlainObject(c)&&z.isPlainObject(f)?z.merge(c,f):z.isPlainObject(f)?z.merge({},f):z.isArray(f)?f.slice():f}function r(c){if(z.isUndefined(e[c])){if(!z.isUndefined(n[c]))return a(void 0,n[c])}else return a(n[c],e[c])}function s(c){if(!z.isUndefined(e[c]))return a(void 0,e[c])}function l(c){if(z.isUndefined(e[c])){if(!z.isUndefined(n[c]))return a(void 0,n[c])}else return a(void 0,e[c])}function d(c){if(c in e)return a(n[c],e[c]);if(c in n)return a(void 0,n[c])}var o={url:s,method:s,data:s,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:d};return z.forEach(Object.keys(n).concat(Object.keys(e)),function(f){var m=o[f]||r,w=m(f);z.isUndefined(w)&&m!==d||(i[f]=w)}),i},Pt,Or;function Fr(){return Or||(Or=1,Pt={version:"0.26.1"}),Pt}var na=Fr().version,Ut={};["object","boolean","number","function","string","symbol"].forEach(function(t,n){Ut[t]=function(i){return typeof i===t||"a"+(n<1?"n ":" ")+t}});var Dr={};Ut.transitional=function(n,e,i){function a(r,s){return"[Axios v"+na+"] Transitional option '"+r+"'"+s+(i?". "+i:"")}return function(r,s,l){if(n===!1)throw new Error(a(s," has been removed"+(e?" in "+e:"")));return e&&!Dr[s]&&(Dr[s]=!0,console.warn(a(s," has been deprecated since v"+e+" and will be removed in the near future"))),n?n(r,s,l):!0}};function aa(t,n,e){if(typeof t!="object")throw new TypeError("options must be an object");for(var i=Object.keys(t),a=i.length;a-- >0;){var r=i[a],s=n[r];if(s){var l=t[r],d=l===void 0||s(l,r,t);if(d!==!0)throw new TypeError("option "+r+" must be "+d);continue}if(e!==!0)throw Error("Unknown option "+r)}}var ia={assertOptions:aa,validators:Ut},kr=X,oa=sr,Ar=Un,jr=ra,tt=xr,Pr=ia,Se=Pr.validators;function Ie(t){this.defaults=t,this.interceptors={request:new Ar,response:new Ar}}Ie.prototype.request=function(n,e){typeof n=="string"?(e=e||{},e.url=n):e=n||{},e=tt(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var i=e.transitional;i!==void 0&&Pr.assertOptions(i,{silentJSONParsing:Se.transitional(Se.boolean),forcedJSONParsing:Se.transitional(Se.boolean),clarifyTimeoutError:Se.transitional(Se.boolean)},!1);var a=[],r=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(e)===!1||(r=r&&w.synchronous,a.unshift(w.fulfilled,w.rejected))});var s=[];this.interceptors.response.forEach(function(w){s.push(w.fulfilled,w.rejected)});var l;if(!r){var d=[jr,void 0];for(Array.prototype.unshift.apply(d,a),d=d.concat(s),l=Promise.resolve(e);d.length;)l=l.then(d.shift(),d.shift());return l}for(var o=e;a.length;){var c=a.shift(),f=a.shift();try{o=c(o)}catch(m){f(m);break}}try{l=jr(o)}catch(m){return Promise.reject(m)}for(;s.length;)l=l.then(s.shift(),s.shift());return l},Ie.prototype.getUri=function(n){return n=tt(this.defaults,n),oa(n.url,n.params,n.paramsSerializer).replace(/^\?/,"")},kr.forEach(["delete","get","head","options"],function(n){Ie.prototype[n]=function(e,i){return this.request(tt(i||{},{method:n,url:e,data:(i||{}).data}))}}),kr.forEach(["post","put","patch"],function(n){Ie.prototype[n]=function(e,i,a){return this.request(tt(a||{},{method:n,url:e,data:i}))}});var sa=Ie,Lt,Ur;function ua(){if(Ur)return Lt;Ur=1;var t=$e();function n(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var i;this.promise=new Promise(function(s){i=s});var a=this;this.promise.then(function(r){if(!!a._listeners){var s,l=a._listeners.length;for(s=0;s<l;s++)a._listeners[s](r);a._listeners=null}}),this.promise.then=function(r){var s,l=new Promise(function(d){a.subscribe(d),s=d}).then(r);return l.cancel=function(){a.unsubscribe(s)},l},e(function(s){a.reason||(a.reason=new t(s),i(a.reason))})}return n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.prototype.subscribe=function(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]},n.prototype.unsubscribe=function(i){if(!!this._listeners){var a=this._listeners.indexOf(i);a!==-1&&this._listeners.splice(a,1)}},n.source=function(){var i,a=new n(function(s){i=s});return{token:a,cancel:i}},Lt=n,Lt}var Nt,Lr;function la(){return Lr||(Lr=1,Nt=function(n){return function(i){return n.apply(null,i)}}),Nt}var It,Nr;function ca(){if(Nr)return It;Nr=1;var t=X;return It=function(e){return t.isObject(e)&&e.isAxiosError===!0},It}var Ir=X,fa=rr,rt=sa,da=xr,pa=Dt;function Br(t){var n=new rt(t),e=fa(rt.prototype.request,n);return Ir.extend(e,rt.prototype,n),Ir.extend(e,n),e.create=function(a){return Br(da(t,a))},e}var se=Br(pa);se.Axios=rt,se.Cancel=$e(),se.CancelToken=ua(),se.isCancel=Er(),se.VERSION=Fr().version,se.all=function(n){return Promise.all(n)},se.spread=la(),se.isAxiosError=ca(),vt.exports=se,vt.exports.default=se,function(t){t.exports=vt.exports}(Ne);var nt=x&&x.__assign||function(){return nt=Object.assign||function(t){for(var n,e=1,i=arguments.length;e<i;e++){n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},nt.apply(this,arguments)},at=x&&x.__awaiter||function(t,n,e,i){function a(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function l(c){try{o(i.next(c))}catch(f){s(f)}}function d(c){try{o(i.throw(c))}catch(f){s(f)}}function o(c){c.done?r(c.value):a(c.value).then(l,d)}o((i=i.apply(t,n||[])).next())})},it=x&&x.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(c){return d([o,c])}}function d(o){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,a&&(r=o[0]&2?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return e.label++,{value:o[1],done:!1};case 5:e.label++,a=o[1],o=[0];continue;case 7:o=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1],r=o;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(o);break}r[2]&&e.ops.pop(),e.trys.pop();continue}o=n.call(t,e)}catch(c){o=[6,c],a=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(Le,"__esModule",{value:!0}),Le.FrappeCall=void 0;var ot=Ne.exports,ha=function(){function t(n){this.appURL=n}return t.prototype.get=function(n,e){return at(this,void 0,void 0,function(){var i;return it(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,ot.default.get("".concat(this.appURL,"/api/method/").concat(n),{headers:i,params:e,withCredentials:!0}).then(function(r){return r.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error.",exception:(l=r.response.data.exception)!==null&&l!==void 0?l:""}})]})})},t.prototype.post=function(n,e){return at(this,void 0,void 0,function(){var i;return it(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,ot.default.post("".concat(this.appURL,"/api/method/").concat(n),nt({},e),{withCredentials:!0,headers:i}).then(function(r){return r.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error.",exception:(l=r.response.data.exception)!==null&&l!==void 0?l:""}})]})})},t.prototype.put=function(n,e){return at(this,void 0,void 0,function(){var i;return it(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,ot.default.put("".concat(this.appURL,"/api/method/").concat(n),nt({},e),{headers:i,withCredentials:!0}).then(function(r){return r.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error.",exception:(l=r.response.data.exception)!==null&&l!==void 0?l:""}})]})})},t.prototype.delete=function(n,e){return at(this,void 0,void 0,function(){var i;return it(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,ot.default.delete("".concat(this.appURL,"/api/method/").concat(n),{headers:i,params:e,withCredentials:!0}).then(function(r){return r.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error.",exception:(l=r.response.data.exception)!==null&&l!==void 0?l:""}})]})})},t}();Le.FrappeCall=ha;var Be={},st=x&&x.__assign||function(){return st=Object.assign||function(t){for(var n,e=1,i=arguments.length;e<i;e++){n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},st.apply(this,arguments)},Ce=x&&x.__awaiter||function(t,n,e,i){function a(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function l(c){try{o(i.next(c))}catch(f){s(f)}}function d(c){try{o(i.throw(c))}catch(f){s(f)}}function o(c){c.done?r(c.value):a(c.value).then(l,d)}o((i=i.apply(t,n||[])).next())})},Ee=x&&x.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(c){return d([o,c])}}function d(o){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,a&&(r=o[0]&2?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return e.label++,{value:o[1],done:!1};case 5:e.label++,a=o[1],o=[0];continue;case 7:o=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1],r=o;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(o);break}r[2]&&e.ops.pop(),e.trys.pop();continue}o=n.call(t,e)}catch(c){o=[6,c],a=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(Be,"__esModule",{value:!0}),Be.FrappeDB=void 0;var Te=Ne.exports,va=function(){function t(n){this.appURL=n}return t.prototype.getRequestURL=function(n,e){var i="".concat(this.appURL,"/api/resource/");return e?i+="".concat(n,"/").concat(e):i+="".concat(n),i},t.prototype.getDoc=function(n,e){return Ce(this,void 0,void 0,function(){var i;return Ee(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,Te.default.get(this.getRequestURL(n,e),{headers:i,withCredentials:!0}).then(function(r){return r.data.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:"There was an error while fetching the document.",exception:(l=(s=r.response.data.exception)!==null&&s!==void 0?s:r.response.data.exc_type)!==null&&l!==void 0?l:""}})]})})},t.prototype.getDocList=function(n,e){var i;return Ce(this,void 0,void 0,function(){var a,r,s,l,d,o,c,f,m,w,O;return Ee(this,function(k){return a={},e&&(r=e.fields,s=e.filters,l=e.orFilters,d=e.orderBy,o=e.limit,c=e.limit_start,f=e.asDict,m=f===void 0?!0:f,w=d?"".concat(d==null?void 0:d.field," ").concat((i=d==null?void 0:d.order)!==null&&i!==void 0?i:"asc"):"",a={fields:r?JSON.stringify(r):void 0,filters:s?JSON.stringify(s):void 0,or_filters:l?JSON.stringify(l):void 0,order_by:w,limit:o,page_limit_start:c,as_dict:m}),O={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(O["X-Frappe-CSRF-Token"]=window.csrf_token),[2,Te.default.get(this.getRequestURL(n),{params:a,headers:O,withCredentials:!0}).then(function(g){return g.data.data}).catch(function(g){var y,C;throw{httpStatus:g.response.status,httpStatusText:g.response.statusText,message:"There was an error while fetching the documents.",exception:(C=(y=g.response.data.exception)!==null&&y!==void 0?y:g.response.data.exc_type)!==null&&C!==void 0?C:""}})]})})},t.prototype.createDoc=function(n,e){return Ce(this,void 0,void 0,function(){var i;return Ee(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,Te.default.post(this.getRequestURL(n),st({},e),{headers:i,withCredentials:!0}).then(function(r){return r.data.data}).catch(function(r){var s,l,d;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error while creating the document.",exception:(d=(l=r.response.data.exception)!==null&&l!==void 0?l:r.response.data.exc_type)!==null&&d!==void 0?d:""}})]})})},t.prototype.updateDoc=function(n,e,i){return Ce(this,void 0,void 0,function(){var a;return Ee(this,function(r){return a={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(a["X-Frappe-CSRF-Token"]=window.csrf_token),[2,Te.default.put(this.getRequestURL(n,e),st({},i),{headers:a,withCredentials:!0}).then(function(s){return s.data.data}).catch(function(s){var l,d,o;throw{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(l=s.response.data.message)!==null&&l!==void 0?l:"There was an error while updating the document.",exception:(o=(d=s.response.data.exception)!==null&&d!==void 0?d:s.response.data.exc_type)!==null&&o!==void 0?o:""}})]})})},t.prototype.deleteDoc=function(n,e){return Ce(this,void 0,void 0,function(){var i;return Ee(this,function(a){return i={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(i["X-Frappe-CSRF-Token"]=window.csrf_token),[2,Te.default.delete(this.getRequestURL(n,e),{headers:i,withCredentials:!0}).then(function(r){return r.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:"There was an error while deleting the document.",exception:(l=(s=r.response.data.exception)!==null&&s!==void 0?s:r.response.data.exc_type)!==null&&l!==void 0?l:""}})]})})},t.prototype.getCount=function(n,e,i,a){return i===void 0&&(i=!1),a===void 0&&(a=!1),Ce(this,void 0,void 0,function(){var r,s;return Ee(this,function(l){return r={doctype:n,debug:a,cache:i,filters:[]},e&&(r.filters=e?JSON.stringify(e):void 0),s={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(s["X-Frappe-CSRF-Token"]=window.csrf_token),[2,Te.default.get("".concat(this.appURL,"/api/method/frappe.client.get_count"),{params:r,headers:s,withCredentials:!0}).then(function(d){return d.data.message}).catch(function(d){var o,c;throw{httpStatus:d.response.status,httpStatusText:d.response.statusText,message:"There was an error while getting the count.",exception:(c=(o=d.response.data.exception)!==null&&o!==void 0?o:d.response.data.exc_type)!==null&&c!==void 0?c:""}})]})})},t}();Be.FrappeDB=va;var Me={},ma=x&&x.__awaiter||function(t,n,e,i){function a(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function l(c){try{o(i.next(c))}catch(f){s(f)}}function d(c){try{o(i.throw(c))}catch(f){s(f)}}function o(c){c.done?r(c.value):a(c.value).then(l,d)}o((i=i.apply(t,n||[])).next())})},wa=x&&x.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(c){return d([o,c])}}function d(o){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,a&&(r=o[0]&2?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return e.label++,{value:o[1],done:!1};case 5:e.label++,a=o[1],o=[0];continue;case 7:o=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1],r=o;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(o);break}r[2]&&e.ops.pop(),e.trys.pop();continue}o=n.call(t,e)}catch(c){o=[6,c],a=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(Me,"__esModule",{value:!0}),Me.FrappeFileUpload=void 0;var ya=Ne.exports,ba=function(){function t(n){this.appURL=n}return t.prototype.uploadFile=function(n,e,i){return ma(this,void 0,void 0,function(){var a,r,s,l,d,o,c;return wa(this,function(f){return a=new FormData,n&&a.append("file",n,n.name),r=e.isPrivate,s=e.folder,l=e.file_url,d=e.doctype,o=e.docname,r&&a.append("is_private","1"),s&&a.append("folder",s),l&&a.append("file_url",l),d&&o&&(a.append("doctype",d),a.append("docname",o)),c={Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(c["X-Frappe-CSRF-Token"]=window.csrf_token),[2,ya.default.post("".concat(this.appURL,"/api/method/upload_file"),a,{headers:c,onUploadProgress:function(m){i&&i(m.loaded,m.total)}}).catch(function(m){var w,O;throw{httpStatus:m.response.status,httpStatusText:m.response.statusText,message:(w=m.response.data.message)!==null&&w!==void 0?w:"There was an error while uploading the file.",exception:(O=m.response.data.exception)!==null&&O!==void 0?O:""}})]})})},t}();Me.FrappeFileUpload=ba;var Mr;function _a(){if(Mr)return Ue;Mr=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.FrappeApp=void 0;var t=Wr(),n=Le,e=Be,i=Me,a=function(){function r(s,l){this.url=s,this.name=l!=null?l:"FrappeApp"}return r.prototype.auth=function(){return new t.FrappeAuth(this.url)},r.prototype.db=function(){return new e.FrappeDB(this.url)},r.prototype.file=function(){return new i.FrappeFileUpload(this.url)},r.prototype.call=function(){return new n.FrappeCall(this.url)},r}();return Ue.FrappeApp=a,Ue}var ut={},Bt=x&&x.__awaiter||function(t,n,e,i){function a(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function l(c){try{o(i.next(c))}catch(f){s(f)}}function d(c){try{o(i.throw(c))}catch(f){s(f)}}function o(c){c.done?r(c.value):a(c.value).then(l,d)}o((i=i.apply(t,n||[])).next())})},Mt=x&&x.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(c){return d([o,c])}}function d(o){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,a&&(r=o[0]&2?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return e.label++,{value:o[1],done:!1};case 5:e.label++,a=o[1],o=[0];continue;case 7:o=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1],r=o;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(o);break}r[2]&&e.ops.pop(),e.trys.pop();continue}o=n.call(t,e)}catch(c){o=[6,c],a=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(ut,"__esModule",{value:!0}),ut.FrappeAuth=void 0;var Vt=Ne.exports,Ra=function(){function t(n){this.appURL=n}return t.prototype.loginWithUsernamePassword=function(n){return Bt(this,void 0,void 0,function(){var e,i;return Mt(this,function(a){return e=n.username,i=n.password,[2,Vt.default.post("".concat(this.appURL,"/api/method/login"),{usr:e,pwd:i},{headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0}).then(function(r){return r.data}).catch(function(r){var s,l;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error while logging in",exception:(l=r.response.data.exception)!==null&&l!==void 0?l:""}})]})})},t.prototype.getLoggedInUser=function(){return Bt(this,void 0,void 0,function(){return Mt(this,function(n){return[2,Vt.default.get("".concat(this.appURL,"/api/method/frappe.auth.get_logged_user"),{headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0}).then(function(e){return e.data.message}).catch(function(e){var i;throw{httpStatus:e.response.status,httpStatusText:e.response.statusText,message:"There was an error while fetching the logged in user",exception:(i=e.response.data.exception)!==null&&i!==void 0?i:""}})]})})},t.prototype.logout=function(){return Bt(this,void 0,void 0,function(){return Mt(this,function(n){return[2,Vt.default.post("".concat(this.appURL,"/api/method/logout"),{},{headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0}).then(function(){}).catch(function(e){var i,a;throw{httpStatus:e.response.status,httpStatusText:e.response.statusText,message:(i=e.response.data.message)!==null&&i!==void 0?i:"There was an error while logging out",exception:(a=e.response.data.exception)!==null&&a!==void 0?a:""}})]})})},t}();ut.FrappeAuth=Ra;var Vr;function Wr(){return Vr||(Vr=1,function(t){var n=x&&x.__createBinding||(Object.create?function(i,a,r,s){s===void 0&&(s=r);var l=Object.getOwnPropertyDescriptor(a,r);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(i,s,l)}:function(i,a,r,s){s===void 0&&(s=r),i[s]=a[r]}),e=x&&x.__exportStar||function(i,a){for(var r in i)r!=="default"&&!Object.prototype.hasOwnProperty.call(a,r)&&n(a,i,r)};Object.defineProperty(t,"__esModule",{value:!0}),e(_a(),t),e(ut,t),e(Be,t),e(Me,t),e(Le,t)}(ht)),ht}var ga=Wr();/*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
@@ -12,7 +12,7 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function Jr(t,n,e,i){function a(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function l(c){try{o(i.next(c))}catch(f){s(f)}}function d(c){try{o(i.throw(c))}catch(f){s(f)}}function o(c){c.done?r(c.value):a(c.value).then(l,d)}o((i=i.apply(t,n||[])).next())})}function Hr(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(c){return d([o,c])}}function d(o){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,a&&(r=o[0]&2?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return e.label++,{value:o[1],done:!1};case 5:e.label++,a=o[1],o=[0];continue;case 7:o=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1],r=o;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(o);break}r[2]&&e.ops.pop(),e.trys.pop();continue}o=n.call(t,e)}catch(c){o=[6,c],a=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}var ue=function(){},q=ue(),lt=Object,V=function(t){return t===q},pe=function(t){return typeof t=="function"},he=function(t,n){return lt.assign({},t,n)},Wt="undefined",Jt=function(){return typeof window!=Wt},Sa=function(){return typeof document!=Wt},Ca=function(){return Jt()&&typeof window.requestAnimationFrame!=Wt},ct=new WeakMap,Ea=0,Ve=function(t){var n=typeof t,e=t&&t.constructor,i=e==Date,a,r;if(lt(t)===t&&!i&&e!=RegExp){if(a=ct.get(t),a)return a;if(a=++Ea+"~",ct.set(t,a),e==Array){for(a="@",r=0;r<t.length;r++)a+=Ve(t[r])+",";ct.set(t,a)}if(e==lt){a="#";for(var s=lt.keys(t).sort();!V(r=s.pop());)V(t[r])||(a+=r+":"+Ve(t[r])+",");ct.set(t,a)}}else a=i?t.toJSON():n=="symbol"?t.toString():n=="string"?JSON.stringify(t):""+t;return a},Ht=!0,Ta=function(){return Ht},Xr=Jt(),Xt=Sa(),qt=Xr&&window.addEventListener?window.addEventListener.bind(window):ue,xa=Xt?document.addEventListener.bind(document):ue,Yt=Xr&&window.removeEventListener?window.removeEventListener.bind(window):ue,Oa=Xt?document.removeEventListener.bind(document):ue,Fa=function(){var t=Xt&&document.visibilityState;return V(t)||t!=="hidden"},Da=function(t){return xa("visibilitychange",t),qt("focus",t),function(){Oa("visibilitychange",t),Yt("focus",t)}},ka=function(t){var n=function(){Ht=!0,t()},e=function(){Ht=!1};return qt("online",n),qt("offline",e),function(){Yt("online",n),Yt("offline",e)}},Aa={isOnline:Ta,isVisible:Fa},ja={initFocus:Da,initReconnect:ka},ft=!Jt()||"Deno"in window,Pa=function(t){return Ca()?window.requestAnimationFrame(t):setTimeout(t,1)},dt=ft?v.useEffect:v.useLayoutEffect,Gt=typeof navigator<"u"&&navigator.connection,qr=!ft&&Gt&&(["slow-2g","2g"].includes(Gt.effectiveType)||Gt.saveData),Yr=function(t){if(pe(t))try{t=t()}catch{t=""}var n=[].concat(t);t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?Ve(t):"";var e=t?"$swr$"+t:"";return[t,n,e]},be=new WeakMap,Gr=0,zr=1,Kr=2,We=function(t,n,e,i,a,r,s){s===void 0&&(s=!0);var l=be.get(t),d=l[0],o=l[1],c=l[3],f=d[n],m=o[n];if(s&&m)for(var y=0;y<m.length;++y)m[y](e,i,a);return r&&(delete c[n],f&&f[0])?f[0](Kr).then(function(){return t.get(n)}):t.get(n)},Ua=0,zt=function(){return++Ua},Qr=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Jr(void 0,void 0,void 0,function(){var e,i,a,r,s,l,d,o,c,f,m,y,O,k,g,w,C,te,b,G,ie;return Hr(this,function(K){switch(K.label){case 0:if(e=t[0],i=t[1],a=t[2],r=t[3],s=typeof r=="boolean"?{revalidate:r}:r||{},l=V(s.populateCache)?!0:s.populateCache,d=s.revalidate!==!1,o=s.rollbackOnError!==!1,c=s.optimisticData,f=Yr(i),m=f[0],y=f[2],!m)return[2];if(O=be.get(e),k=O[2],t.length<3)return[2,We(e,m,e.get(m),q,q,d,!0)];if(g=a,C=zt(),k[m]=[C,0],te=!V(c),b=e.get(m),te&&(G=pe(c)?c(b):c,e.set(m,G),We(e,m,G)),pe(g))try{g=g(e.get(m))}catch(re){w=re}return g&&pe(g.then)?[4,g.catch(function(re){w=re})]:[3,2];case 1:if(g=K.sent(),C!==k[m][0]){if(w)throw w;return[2,g]}else w&&te&&o&&(l=!0,g=b,e.set(m,b));K.label=2;case 2:return l&&(w||(pe(l)&&(g=l(g,b)),e.set(m,g)),e.set(y,he(e.get(y),{error:w}))),k[m][1]=zt(),[4,We(e,m,g,w,q,d,!!l)];case 3:if(ie=K.sent(),w)throw w;return[2,l?ie:g]}})})},Zr=function(t,n){for(var e in t)t[e][0]&&t[e][0](n)},La=function(t,n){if(!be.has(t)){var e=he(ja,n),i={},a=Qr.bind(q,t),r=ue;if(be.set(t,[i,{},{},{},a]),!ft){var s=e.initFocus(setTimeout.bind(q,Zr.bind(q,i,Gr))),l=e.initReconnect(setTimeout.bind(q,Zr.bind(q,i,zr)));r=function(){s&&s(),l&&l(),be.delete(t)}}return[t,a,r]}return[t,be.get(t)[4]]},Na=function(t,n,e,i,a){var r=e.errorRetryCount,s=a.retryCount,l=~~((Math.random()+.5)*(1<<(s<8?s:8)))*e.errorRetryInterval;!V(r)&&s>r||setTimeout(i,l,a)},$r=La(new Map),Ia=$r[0],Ba=$r[1],Ma=he({onLoadingSlow:ue,onSuccess:ue,onError:ue,onErrorRetry:Na,onDiscarded:ue,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:qr?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:qr?5e3:3e3,compare:function(t,n){return Ve(t)==Ve(n)},isPaused:function(){return!1},cache:Ia,mutate:Ba,fallback:{}},Aa),Va=function(t,n){var e=he(t,n);if(n){var i=t.use,a=t.fallback,r=n.use,s=n.fallback;i&&r&&(e.use=i.concat(r)),a&&s&&(e.fallback=he(a,s))}return e},Wa=v.createContext({}),Ja=function(t,n){var e=v.useState({})[1],i=v.useRef(t),a=v.useRef({data:!1,error:!1,isValidating:!1}),r=v.useCallback(function(s){var l=!1,d=i.current;for(var o in s){var c=o;d[c]!==s[c]&&(d[c]=s[c],a.current[c]&&(l=!0))}l&&!n.current&&e({})},[]);return dt(function(){i.current=t}),[i,a.current,r]},Ha=function(t){return pe(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(t[1]===null?t[2]:t[1])||{}]},Xa=function(){return he(Ma,v.useContext(Wa))},qa=function(t){return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var a=Xa(),r=Ha(e),s=r[0],l=r[1],d=r[2],o=Va(a,d),c=t,f=o.use;if(f)for(var m=f.length;m-- >0;)c=f[m](c);return c(s,l||o.fetcher,o)}},en=function(t,n,e){var i=n[t]||(n[t]=[]);return i.push(e),function(){var a=i.indexOf(e);a>=0&&(i[a]=i[i.length-1],i.pop())}},Kt={dedupe:!0},Ya=function(t,n,e){var i=e.cache,a=e.compare,r=e.fallbackData,s=e.suspense,l=e.revalidateOnMount,d=e.refreshInterval,o=e.refreshWhenHidden,c=e.refreshWhenOffline,f=be.get(i),m=f[0],y=f[1],O=f[2],k=f[3],g=Yr(t),w=g[0],C=g[1],te=g[2],b=v.useRef(!1),G=v.useRef(!1),ie=v.useRef(w),K=v.useRef(n),re=v.useRef(e),D=function(){return re.current},L=function(){return D().isVisible()&&D().isOnline()},Q=function(W){return i.set(te,he(i.get(te),W))},Z=i.get(w),$=V(r)?e.fallback[w]:r,A=V(Z)?$:Z,ve=i.get(te)||{},me=ve.error,qe=!b.current,Ye=function(){return qe&&!V(l)?l:D().isPaused()?!1:s?V(A)?!1:e.revalidateIfStale:V(A)||e.revalidateIfStale},pt=function(){return!w||!n?!1:ve.isValidating?!0:qe&&Ye()},xe=pt(),Oe=Ja({data:A,error:me,isValidating:xe},G),le=Oe[0],Fe=Oe[1],De=Oe[2],ce=v.useCallback(function(W){return Jr(void 0,void 0,void 0,function(){var N,B,M,_e,we,ne,I,ee,J,ke,ye,oe,ze;return Hr(this,function(Re){switch(Re.label){case 0:if(N=K.current,!w||!N||G.current||D().isPaused())return[2,!1];_e=!0,we=W||{},ne=!k[w]||!we.dedupe,I=function(){return!G.current&&w===ie.current&&b.current},ee=function(){var Ae=k[w];Ae&&Ae[1]===M&&delete k[w]},J={isValidating:!1},ke=function(){Q({isValidating:!1}),I()&&De(J)},Q({isValidating:!0}),De({isValidating:!0}),Re.label=1;case 1:return Re.trys.push([1,3,,4]),ne&&(We(i,w,le.current.data,le.current.error,!0),e.loadingTimeout&&!i.get(w)&&setTimeout(function(){_e&&I()&&D().onLoadingSlow(w,e)},e.loadingTimeout),k[w]=[N.apply(void 0,C),zt()]),ze=k[w],B=ze[0],M=ze[1],[4,B];case 2:return B=Re.sent(),ne&&setTimeout(ee,e.dedupingInterval),!k[w]||k[w][1]!==M?(ne&&I()&&D().onDiscarded(w),[2,!1]):(Q({error:q}),J.error=q,ye=O[w],!V(ye)&&(M<=ye[0]||M<=ye[1]||ye[1]===0)?(ke(),ne&&I()&&D().onDiscarded(w),[2,!1]):(a(le.current.data,B)?J.data=le.current.data:J.data=B,a(i.get(w),B)||i.set(w,B),ne&&I()&&D().onSuccess(B,w,e),[3,4]));case 3:return oe=Re.sent(),ee(),D().isPaused()||(Q({error:oe}),J.error=oe,ne&&I()&&(D().onError(oe,w,e),(typeof e.shouldRetryOnError=="boolean"&&e.shouldRetryOnError||pe(e.shouldRetryOnError)&&e.shouldRetryOnError(oe))&&L()&&D().onErrorRetry(oe,w,e,ce,{retryCount:(we.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return _e=!1,ke(),I()&&ne&&We(i,w,J.data,J.error,!1),[2,!0]}})})},[w]),Ge=v.useCallback(Qr.bind(q,i,function(){return ie.current}),[]);if(dt(function(){K.current=n,re.current=e}),dt(function(){if(!!w){var W=w!==ie.current,N=ce.bind(q,Kt),B=function(I,ee,J){De(he({error:ee,isValidating:J},a(le.current.data,I)?q:{data:I}))},M=0,_e=function(I){if(I==Gr){var ee=Date.now();D().revalidateOnFocus&&ee>M&&L()&&(M=ee+D().focusThrottleInterval,N())}else if(I==zr)D().revalidateOnReconnect&&L()&&N();else if(I==Kr)return ce()},we=en(w,y,B),ne=en(w,m,_e);return G.current=!1,ie.current=w,b.current=!0,W&&De({data:A,error:me,isValidating:xe}),Ye()&&(V(A)||ft?N():Pa(N)),function(){G.current=!0,we(),ne()}}},[w,ce]),dt(function(){var W;function N(){var M=pe(d)?d(A):d;M&&W!==-1&&(W=setTimeout(B,M))}function B(){!le.current.error&&(o||D().isVisible())&&(c||D().isOnline())?ce(Kt).then(N):N()}return N(),function(){W&&(clearTimeout(W),W=-1)}},[d,o,c,ce]),v.useDebugValue(A),s&&V(A)&&w)throw K.current=n,re.current=e,G.current=!1,V(me)?ce(Kt):me;return{mutate:Ge,get data(){return Fe.data=!0,A},get error(){return Fe.error=!0,me},get isValidating(){return Fe.isValidating=!0,xe}}},Je=qa(Ya),tn={exports:{}},He={};/**
15
+ ***************************************************************************** */function Jr(t,n,e,i){function a(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function l(c){try{o(i.next(c))}catch(f){s(f)}}function d(c){try{o(i.throw(c))}catch(f){s(f)}}function o(c){c.done?r(c.value):a(c.value).then(l,d)}o((i=i.apply(t,n||[])).next())})}function Hr(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(c){return d([o,c])}}function d(o){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,a&&(r=o[0]&2?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[o[0]&2,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return e.label++,{value:o[1],done:!1};case 5:e.label++,a=o[1],o=[0];continue;case 7:o=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1],r=o;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(o);break}r[2]&&e.ops.pop(),e.trys.pop();continue}o=n.call(t,e)}catch(c){o=[6,c],a=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}var ue=function(){},q=ue(),lt=Object,V=function(t){return t===q},pe=function(t){return typeof t=="function"},he=function(t,n){return lt.assign({},t,n)},Wt="undefined",Jt=function(){return typeof window!=Wt},Sa=function(){return typeof document!=Wt},Ca=function(){return Jt()&&typeof window.requestAnimationFrame!=Wt},ct=new WeakMap,Ea=0,Ve=function(t){var n=typeof t,e=t&&t.constructor,i=e==Date,a,r;if(lt(t)===t&&!i&&e!=RegExp){if(a=ct.get(t),a)return a;if(a=++Ea+"~",ct.set(t,a),e==Array){for(a="@",r=0;r<t.length;r++)a+=Ve(t[r])+",";ct.set(t,a)}if(e==lt){a="#";for(var s=lt.keys(t).sort();!V(r=s.pop());)V(t[r])||(a+=r+":"+Ve(t[r])+",");ct.set(t,a)}}else a=i?t.toJSON():n=="symbol"?t.toString():n=="string"?JSON.stringify(t):""+t;return a},Ht=!0,Ta=function(){return Ht},Xr=Jt(),Xt=Sa(),qt=Xr&&window.addEventListener?window.addEventListener.bind(window):ue,xa=Xt?document.addEventListener.bind(document):ue,Yt=Xr&&window.removeEventListener?window.removeEventListener.bind(window):ue,Oa=Xt?document.removeEventListener.bind(document):ue,Fa=function(){var t=Xt&&document.visibilityState;return V(t)||t!=="hidden"},Da=function(t){return xa("visibilitychange",t),qt("focus",t),function(){Oa("visibilitychange",t),Yt("focus",t)}},ka=function(t){var n=function(){Ht=!0,t()},e=function(){Ht=!1};return qt("online",n),qt("offline",e),function(){Yt("online",n),Yt("offline",e)}},Aa={isOnline:Ta,isVisible:Fa},ja={initFocus:Da,initReconnect:ka},ft=!Jt()||"Deno"in window,Pa=function(t){return Ca()?window.requestAnimationFrame(t):setTimeout(t,1)},dt=ft?v.useEffect:v.useLayoutEffect,Gt=typeof navigator<"u"&&navigator.connection,qr=!ft&&Gt&&(["slow-2g","2g"].includes(Gt.effectiveType)||Gt.saveData),Yr=function(t){if(pe(t))try{t=t()}catch{t=""}var n=[].concat(t);t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?Ve(t):"";var e=t?"$swr$"+t:"";return[t,n,e]},be=new WeakMap,Gr=0,zr=1,Kr=2,We=function(t,n,e,i,a,r,s){s===void 0&&(s=!0);var l=be.get(t),d=l[0],o=l[1],c=l[3],f=d[n],m=o[n];if(s&&m)for(var w=0;w<m.length;++w)m[w](e,i,a);return r&&(delete c[n],f&&f[0])?f[0](Kr).then(function(){return t.get(n)}):t.get(n)},Ua=0,zt=function(){return++Ua},Qr=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Jr(void 0,void 0,void 0,function(){var e,i,a,r,s,l,d,o,c,f,m,w,O,k,g,y,C,te,b,G,ie;return Hr(this,function(K){switch(K.label){case 0:if(e=t[0],i=t[1],a=t[2],r=t[3],s=typeof r=="boolean"?{revalidate:r}:r||{},l=V(s.populateCache)?!0:s.populateCache,d=s.revalidate!==!1,o=s.rollbackOnError!==!1,c=s.optimisticData,f=Yr(i),m=f[0],w=f[2],!m)return[2];if(O=be.get(e),k=O[2],t.length<3)return[2,We(e,m,e.get(m),q,q,d,!0)];if(g=a,C=zt(),k[m]=[C,0],te=!V(c),b=e.get(m),te&&(G=pe(c)?c(b):c,e.set(m,G),We(e,m,G)),pe(g))try{g=g(e.get(m))}catch(re){y=re}return g&&pe(g.then)?[4,g.catch(function(re){y=re})]:[3,2];case 1:if(g=K.sent(),C!==k[m][0]){if(y)throw y;return[2,g]}else y&&te&&o&&(l=!0,g=b,e.set(m,b));K.label=2;case 2:return l&&(y||(pe(l)&&(g=l(g,b)),e.set(m,g)),e.set(w,he(e.get(w),{error:y}))),k[m][1]=zt(),[4,We(e,m,g,y,q,d,!!l)];case 3:if(ie=K.sent(),y)throw y;return[2,l?ie:g]}})})},Zr=function(t,n){for(var e in t)t[e][0]&&t[e][0](n)},La=function(t,n){if(!be.has(t)){var e=he(ja,n),i={},a=Qr.bind(q,t),r=ue;if(be.set(t,[i,{},{},{},a]),!ft){var s=e.initFocus(setTimeout.bind(q,Zr.bind(q,i,Gr))),l=e.initReconnect(setTimeout.bind(q,Zr.bind(q,i,zr)));r=function(){s&&s(),l&&l(),be.delete(t)}}return[t,a,r]}return[t,be.get(t)[4]]},Na=function(t,n,e,i,a){var r=e.errorRetryCount,s=a.retryCount,l=~~((Math.random()+.5)*(1<<(s<8?s:8)))*e.errorRetryInterval;!V(r)&&s>r||setTimeout(i,l,a)},$r=La(new Map),Ia=$r[0],Ba=$r[1],Ma=he({onLoadingSlow:ue,onSuccess:ue,onError:ue,onErrorRetry:Na,onDiscarded:ue,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:qr?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:qr?5e3:3e3,compare:function(t,n){return Ve(t)==Ve(n)},isPaused:function(){return!1},cache:Ia,mutate:Ba,fallback:{}},Aa),Va=function(t,n){var e=he(t,n);if(n){var i=t.use,a=t.fallback,r=n.use,s=n.fallback;i&&r&&(e.use=i.concat(r)),a&&s&&(e.fallback=he(a,s))}return e},Wa=v.createContext({}),Ja=function(t,n){var e=v.useState({})[1],i=v.useRef(t),a=v.useRef({data:!1,error:!1,isValidating:!1}),r=v.useCallback(function(s){var l=!1,d=i.current;for(var o in s){var c=o;d[c]!==s[c]&&(d[c]=s[c],a.current[c]&&(l=!0))}l&&!n.current&&e({})},[]);return dt(function(){i.current=t}),[i,a.current,r]},Ha=function(t){return pe(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(t[1]===null?t[2]:t[1])||{}]},Xa=function(){return he(Ma,v.useContext(Wa))},qa=function(t){return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var a=Xa(),r=Ha(e),s=r[0],l=r[1],d=r[2],o=Va(a,d),c=t,f=o.use;if(f)for(var m=f.length;m-- >0;)c=f[m](c);return c(s,l||o.fetcher,o)}},en=function(t,n,e){var i=n[t]||(n[t]=[]);return i.push(e),function(){var a=i.indexOf(e);a>=0&&(i[a]=i[i.length-1],i.pop())}},Kt={dedupe:!0},Ya=function(t,n,e){var i=e.cache,a=e.compare,r=e.fallbackData,s=e.suspense,l=e.revalidateOnMount,d=e.refreshInterval,o=e.refreshWhenHidden,c=e.refreshWhenOffline,f=be.get(i),m=f[0],w=f[1],O=f[2],k=f[3],g=Yr(t),y=g[0],C=g[1],te=g[2],b=v.useRef(!1),G=v.useRef(!1),ie=v.useRef(y),K=v.useRef(n),re=v.useRef(e),D=function(){return re.current},L=function(){return D().isVisible()&&D().isOnline()},Q=function(W){return i.set(te,he(i.get(te),W))},Z=i.get(y),$=V(r)?e.fallback[y]:r,A=V(Z)?$:Z,ve=i.get(te)||{},me=ve.error,qe=!b.current,Ye=function(){return qe&&!V(l)?l:D().isPaused()?!1:s?V(A)?!1:e.revalidateIfStale:V(A)||e.revalidateIfStale},pt=function(){return!y||!n?!1:ve.isValidating?!0:qe&&Ye()},xe=pt(),Oe=Ja({data:A,error:me,isValidating:xe},G),le=Oe[0],Fe=Oe[1],De=Oe[2],ce=v.useCallback(function(W){return Jr(void 0,void 0,void 0,function(){var N,B,M,_e,we,ne,I,ee,J,ke,ye,oe,ze;return Hr(this,function(Re){switch(Re.label){case 0:if(N=K.current,!y||!N||G.current||D().isPaused())return[2,!1];_e=!0,we=W||{},ne=!k[y]||!we.dedupe,I=function(){return!G.current&&y===ie.current&&b.current},ee=function(){var Ae=k[y];Ae&&Ae[1]===M&&delete k[y]},J={isValidating:!1},ke=function(){Q({isValidating:!1}),I()&&De(J)},Q({isValidating:!0}),De({isValidating:!0}),Re.label=1;case 1:return Re.trys.push([1,3,,4]),ne&&(We(i,y,le.current.data,le.current.error,!0),e.loadingTimeout&&!i.get(y)&&setTimeout(function(){_e&&I()&&D().onLoadingSlow(y,e)},e.loadingTimeout),k[y]=[N.apply(void 0,C),zt()]),ze=k[y],B=ze[0],M=ze[1],[4,B];case 2:return B=Re.sent(),ne&&setTimeout(ee,e.dedupingInterval),!k[y]||k[y][1]!==M?(ne&&I()&&D().onDiscarded(y),[2,!1]):(Q({error:q}),J.error=q,ye=O[y],!V(ye)&&(M<=ye[0]||M<=ye[1]||ye[1]===0)?(ke(),ne&&I()&&D().onDiscarded(y),[2,!1]):(a(le.current.data,B)?J.data=le.current.data:J.data=B,a(i.get(y),B)||i.set(y,B),ne&&I()&&D().onSuccess(B,y,e),[3,4]));case 3:return oe=Re.sent(),ee(),D().isPaused()||(Q({error:oe}),J.error=oe,ne&&I()&&(D().onError(oe,y,e),(typeof e.shouldRetryOnError=="boolean"&&e.shouldRetryOnError||pe(e.shouldRetryOnError)&&e.shouldRetryOnError(oe))&&L()&&D().onErrorRetry(oe,y,e,ce,{retryCount:(we.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return _e=!1,ke(),I()&&ne&&We(i,y,J.data,J.error,!1),[2,!0]}})})},[y]),Ge=v.useCallback(Qr.bind(q,i,function(){return ie.current}),[]);if(dt(function(){K.current=n,re.current=e}),dt(function(){if(!!y){var W=y!==ie.current,N=ce.bind(q,Kt),B=function(I,ee,J){De(he({error:ee,isValidating:J},a(le.current.data,I)?q:{data:I}))},M=0,_e=function(I){if(I==Gr){var ee=Date.now();D().revalidateOnFocus&&ee>M&&L()&&(M=ee+D().focusThrottleInterval,N())}else if(I==zr)D().revalidateOnReconnect&&L()&&N();else if(I==Kr)return ce()},we=en(y,w,B),ne=en(y,m,_e);return G.current=!1,ie.current=y,b.current=!0,W&&De({data:A,error:me,isValidating:xe}),Ye()&&(V(A)||ft?N():Pa(N)),function(){G.current=!0,we(),ne()}}},[y,ce]),dt(function(){var W;function N(){var M=pe(d)?d(A):d;M&&W!==-1&&(W=setTimeout(B,M))}function B(){!le.current.error&&(o||D().isVisible())&&(c||D().isOnline())?ce(Kt).then(N):N()}return N(),function(){W&&(clearTimeout(W),W=-1)}},[d,o,c,ce]),v.useDebugValue(A),s&&V(A)&&y)throw K.current=n,re.current=e,G.current=!1,V(me)?ce(Kt):me;return{mutate:Ge,get data(){return Fe.data=!0,A},get error(){return Fe.error=!0,me},get isValidating(){return Fe.isValidating=!0,xe}}},Je=qa(Ya),tn={exports:{}},He={};/**
16
16
  * @license React
17
17
  * react-jsx-runtime.production.min.js
18
18
  *
@@ -20,7 +20,7 @@
20
20
  *
21
21
  * This source code is licensed under the MIT license found in the
22
22
  * LICENSE file in the root directory of this source tree.
23
- */var rn;function Ga(){if(rn)return He;rn=1;var t=tr.default,n=Symbol.for("react.element"),e=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function s(l,d,o){var c,f={},m=null,y=null;o!==void 0&&(m=""+o),d.key!==void 0&&(m=""+d.key),d.ref!==void 0&&(y=d.ref);for(c in d)i.call(d,c)&&!r.hasOwnProperty(c)&&(f[c]=d[c]);if(l&&l.defaultProps)for(c in d=l.defaultProps,d)f[c]===void 0&&(f[c]=d[c]);return{$$typeof:n,type:l,key:m,ref:y,props:f,_owner:a.current}}return He.Fragment=e,He.jsx=s,He.jsxs=s,He}var Xe={};/**
23
+ */var rn;function Ga(){if(rn)return He;rn=1;var t=tr.default,n=Symbol.for("react.element"),e=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function s(l,d,o){var c,f={},m=null,w=null;o!==void 0&&(m=""+o),d.key!==void 0&&(m=""+d.key),d.ref!==void 0&&(w=d.ref);for(c in d)i.call(d,c)&&!r.hasOwnProperty(c)&&(f[c]=d[c]);if(l&&l.defaultProps)for(c in d=l.defaultProps,d)f[c]===void 0&&(f[c]=d[c]);return{$$typeof:n,type:l,key:m,ref:w,props:f,_owner:a.current}}return He.Fragment=e,He.jsx=s,He.jsxs=s,He}var Xe={};/**
24
24
  * @license React
25
25
  * react-jsx-runtime.development.js
26
26
  *
@@ -28,14 +28,14 @@
28
28
  *
29
29
  * This source code is licensed under the MIT license found in the
30
30
  * LICENSE file in the root directory of this source tree.
31
- */var nn;function za(){return nn||(nn=1,process.env.NODE_ENV!=="production"&&function(){var t=tr.default,n=Symbol.for("react.element"),e=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),o=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),O=Symbol.iterator,k="@@iterator";function g(u){if(u===null||typeof u!="object")return null;var p=O&&u[O]||u[k];return typeof p=="function"?p:null}var w=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(u){{for(var p=arguments.length,h=new Array(p>1?p-1:0),_=1;_<p;_++)h[_-1]=arguments[_];te("error",u,h)}}function te(u,p,h){{var _=w.ReactDebugCurrentFrame,E=_.getStackAddendum();E!==""&&(p+="%s",h=h.concat([E]));var T=h.map(function(S){return String(S)});T.unshift("Warning: "+p),Function.prototype.apply.call(console[u],console,T)}}var b=!1,G=!1,ie=!1,K=!1,re=!1,D;D=Symbol.for("react.module.reference");function L(u){return!!(typeof u=="string"||typeof u=="function"||u===i||u===r||re||u===a||u===o||u===c||K||u===y||b||G||ie||typeof u=="object"&&u!==null&&(u.$$typeof===m||u.$$typeof===f||u.$$typeof===s||u.$$typeof===l||u.$$typeof===d||u.$$typeof===D||u.getModuleId!==void 0))}function Q(u,p,h){var _=u.displayName;if(_)return _;var E=p.displayName||p.name||"";return E!==""?h+"("+E+")":h}function Z(u){return u.displayName||"Context"}function $(u){if(u==null)return null;if(typeof u.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case i:return"Fragment";case e:return"Portal";case r:return"Profiler";case a:return"StrictMode";case o:return"Suspense";case c:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case l:var p=u;return Z(p)+".Consumer";case s:var h=u;return Z(h._context)+".Provider";case d:return Q(u,u.render,"ForwardRef");case f:var _=u.displayName||null;return _!==null?_:$(u.type)||"Memo";case m:{var E=u,T=E._payload,S=E._init;try{return $(S(T))}catch{return null}}}return null}var A=Object.assign,ve=0,me,qe,Ye,pt,xe,Oe,le;function Fe(){}Fe.__reactDisabledLog=!0;function De(){{if(ve===0){me=console.log,qe=console.info,Ye=console.warn,pt=console.error,xe=console.group,Oe=console.groupCollapsed,le=console.groupEnd;var u={configurable:!0,enumerable:!0,value:Fe,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}ve++}}function ce(){{if(ve--,ve===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},u,{value:me}),info:A({},u,{value:qe}),warn:A({},u,{value:Ye}),error:A({},u,{value:pt}),group:A({},u,{value:xe}),groupCollapsed:A({},u,{value:Oe}),groupEnd:A({},u,{value:le})})}ve<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ge=w.ReactCurrentDispatcher,W;function N(u,p,h){{if(W===void 0)try{throw Error()}catch(E){var _=E.stack.trim().match(/\n( *(at )?)/);W=_&&_[1]||""}return`
31
+ */var nn;function za(){return nn||(nn=1,process.env.NODE_ENV!=="production"&&function(){var t=tr.default,n=Symbol.for("react.element"),e=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),o=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),O=Symbol.iterator,k="@@iterator";function g(u){if(u===null||typeof u!="object")return null;var p=O&&u[O]||u[k];return typeof p=="function"?p:null}var y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(u){{for(var p=arguments.length,h=new Array(p>1?p-1:0),_=1;_<p;_++)h[_-1]=arguments[_];te("error",u,h)}}function te(u,p,h){{var _=y.ReactDebugCurrentFrame,E=_.getStackAddendum();E!==""&&(p+="%s",h=h.concat([E]));var T=h.map(function(S){return String(S)});T.unshift("Warning: "+p),Function.prototype.apply.call(console[u],console,T)}}var b=!1,G=!1,ie=!1,K=!1,re=!1,D;D=Symbol.for("react.module.reference");function L(u){return!!(typeof u=="string"||typeof u=="function"||u===i||u===r||re||u===a||u===o||u===c||K||u===w||b||G||ie||typeof u=="object"&&u!==null&&(u.$$typeof===m||u.$$typeof===f||u.$$typeof===s||u.$$typeof===l||u.$$typeof===d||u.$$typeof===D||u.getModuleId!==void 0))}function Q(u,p,h){var _=u.displayName;if(_)return _;var E=p.displayName||p.name||"";return E!==""?h+"("+E+")":h}function Z(u){return u.displayName||"Context"}function $(u){if(u==null)return null;if(typeof u.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case i:return"Fragment";case e:return"Portal";case r:return"Profiler";case a:return"StrictMode";case o:return"Suspense";case c:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case l:var p=u;return Z(p)+".Consumer";case s:var h=u;return Z(h._context)+".Provider";case d:return Q(u,u.render,"ForwardRef");case f:var _=u.displayName||null;return _!==null?_:$(u.type)||"Memo";case m:{var E=u,T=E._payload,S=E._init;try{return $(S(T))}catch{return null}}}return null}var A=Object.assign,ve=0,me,qe,Ye,pt,xe,Oe,le;function Fe(){}Fe.__reactDisabledLog=!0;function De(){{if(ve===0){me=console.log,qe=console.info,Ye=console.warn,pt=console.error,xe=console.group,Oe=console.groupCollapsed,le=console.groupEnd;var u={configurable:!0,enumerable:!0,value:Fe,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}ve++}}function ce(){{if(ve--,ve===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},u,{value:me}),info:A({},u,{value:qe}),warn:A({},u,{value:Ye}),error:A({},u,{value:pt}),group:A({},u,{value:xe}),groupCollapsed:A({},u,{value:Oe}),groupEnd:A({},u,{value:le})})}ve<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ge=y.ReactCurrentDispatcher,W;function N(u,p,h){{if(W===void 0)try{throw Error()}catch(E){var _=E.stack.trim().match(/\n( *(at )?)/);W=_&&_[1]||""}return`
32
32
  `+W+u}}var B=!1,M;{var _e=typeof WeakMap=="function"?WeakMap:Map;M=new _e}function we(u,p){if(!u||B)return"";{var h=M.get(u);if(h!==void 0)return h}var _;B=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var T;T=Ge.current,Ge.current=null,De();try{if(p){var S=function(){throw Error()};if(Object.defineProperty(S.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(S,[])}catch(fe){_=fe}Reflect.construct(u,[],S)}else{try{S.call()}catch(fe){_=fe}u.call(S.prototype)}}else{try{throw Error()}catch(fe){_=fe}u()}}catch(fe){if(fe&&_&&typeof fe.stack=="string"){for(var R=fe.stack.split(`
33
33
  `),H=_.stack.split(`
34
34
  `),j=R.length-1,P=H.length-1;j>=1&&P>=0&&R[j]!==H[P];)P--;for(;j>=1&&P>=0;j--,P--)if(R[j]!==H[P]){if(j!==1||P!==1)do if(j--,P--,P<0||R[j]!==H[P]){var ae=`
35
- `+R[j].replace(" at new "," at ");return u.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",u.displayName)),typeof u=="function"&&M.set(u,ae),ae}while(j>=1&&P>=0);break}}}finally{B=!1,Ge.current=T,ce(),Error.prepareStackTrace=E}var Pe=u?u.displayName||u.name:"",yn=Pe?N(Pe):"";return typeof u=="function"&&M.set(u,yn),yn}function ne(u,p,h){return we(u,!1)}function I(u){var p=u.prototype;return!!(p&&p.isReactComponent)}function ee(u,p,h){if(u==null)return"";if(typeof u=="function")return we(u,I(u));if(typeof u=="string")return N(u);switch(u){case o:return N("Suspense");case c:return N("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case d:return ne(u.render);case f:return ee(u.type,p,h);case m:{var _=u,E=_._payload,T=_._init;try{return ee(T(E),p,h)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,ke={},ye=w.ReactDebugCurrentFrame;function oe(u){if(u){var p=u._owner,h=ee(u.type,u._source,p?p.type:null);ye.setExtraStackFrame(h)}else ye.setExtraStackFrame(null)}function ze(u,p,h,_,E){{var T=Function.call.bind(J);for(var S in u)if(T(u,S)){var R=void 0;try{if(typeof u[S]!="function"){var H=Error((_||"React class")+": "+h+" type `"+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[S]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw H.name="Invariant Violation",H}R=u[S](p,S,_,h,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(j){R=j}R&&!(R instanceof Error)&&(oe(E),C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",_||"React class",h,S,typeof R),oe(null)),R instanceof Error&&!(R.message in ke)&&(ke[R.message]=!0,oe(E),C("Failed %s type: %s",h,R.message),oe(null))}}}var Re=Array.isArray;function Ae(u){return Re(u)}function fi(u){{var p=typeof Symbol=="function"&&Symbol.toStringTag,h=p&&u[Symbol.toStringTag]||u.constructor.name||"Object";return h}}function di(u){try{return un(u),!1}catch{return!0}}function un(u){return""+u}function ln(u){if(di(u))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",fi(u)),un(u)}var Ke=w.ReactCurrentOwner,pi={key:!0,ref:!0,__self:!0,__source:!0},cn,fn,Qt;Qt={};function hi(u){if(J.call(u,"ref")){var p=Object.getOwnPropertyDescriptor(u,"ref").get;if(p&&p.isReactWarning)return!1}return u.ref!==void 0}function vi(u){if(J.call(u,"key")){var p=Object.getOwnPropertyDescriptor(u,"key").get;if(p&&p.isReactWarning)return!1}return u.key!==void 0}function mi(u,p){if(typeof u.ref=="string"&&Ke.current&&p&&Ke.current.stateNode!==p){var h=$(Ke.current.type);Qt[h]||(C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',$(Ke.current.type),u.ref),Qt[h]=!0)}}function wi(u,p){{var h=function(){cn||(cn=!0,C("%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://reactjs.org/link/special-props)",p))};h.isReactWarning=!0,Object.defineProperty(u,"key",{get:h,configurable:!0})}}function yi(u,p){{var h=function(){fn||(fn=!0,C("%s: `ref` 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://reactjs.org/link/special-props)",p))};h.isReactWarning=!0,Object.defineProperty(u,"ref",{get:h,configurable:!0})}}var bi=function(u,p,h,_,E,T,S){var R={$$typeof:n,type:u,key:p,ref:h,props:S,_owner:T};return R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(R,"_self",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.defineProperty(R,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R};function _i(u,p,h,_,E){{var T,S={},R=null,H=null;h!==void 0&&(ln(h),R=""+h),vi(p)&&(ln(p.key),R=""+p.key),hi(p)&&(H=p.ref,mi(p,E));for(T in p)J.call(p,T)&&!pi.hasOwnProperty(T)&&(S[T]=p[T]);if(u&&u.defaultProps){var j=u.defaultProps;for(T in j)S[T]===void 0&&(S[T]=j[T])}if(R||H){var P=typeof u=="function"?u.displayName||u.name||"Unknown":u;R&&wi(S,P),H&&yi(S,P)}return bi(u,R,H,E,_,Ke.current,S)}}var Zt=w.ReactCurrentOwner,dn=w.ReactDebugCurrentFrame;function je(u){if(u){var p=u._owner,h=ee(u.type,u._source,p?p.type:null);dn.setExtraStackFrame(h)}else dn.setExtraStackFrame(null)}var $t;$t=!1;function er(u){return typeof u=="object"&&u!==null&&u.$$typeof===n}function pn(){{if(Zt.current){var u=$(Zt.current.type);if(u)return`
35
+ `+R[j].replace(" at new "," at ");return u.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",u.displayName)),typeof u=="function"&&M.set(u,ae),ae}while(j>=1&&P>=0);break}}}finally{B=!1,Ge.current=T,ce(),Error.prepareStackTrace=E}var Pe=u?u.displayName||u.name:"",yn=Pe?N(Pe):"";return typeof u=="function"&&M.set(u,yn),yn}function ne(u,p,h){return we(u,!1)}function I(u){var p=u.prototype;return!!(p&&p.isReactComponent)}function ee(u,p,h){if(u==null)return"";if(typeof u=="function")return we(u,I(u));if(typeof u=="string")return N(u);switch(u){case o:return N("Suspense");case c:return N("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case d:return ne(u.render);case f:return ee(u.type,p,h);case m:{var _=u,E=_._payload,T=_._init;try{return ee(T(E),p,h)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,ke={},ye=y.ReactDebugCurrentFrame;function oe(u){if(u){var p=u._owner,h=ee(u.type,u._source,p?p.type:null);ye.setExtraStackFrame(h)}else ye.setExtraStackFrame(null)}function ze(u,p,h,_,E){{var T=Function.call.bind(J);for(var S in u)if(T(u,S)){var R=void 0;try{if(typeof u[S]!="function"){var H=Error((_||"React class")+": "+h+" type `"+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[S]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw H.name="Invariant Violation",H}R=u[S](p,S,_,h,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(j){R=j}R&&!(R instanceof Error)&&(oe(E),C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",_||"React class",h,S,typeof R),oe(null)),R instanceof Error&&!(R.message in ke)&&(ke[R.message]=!0,oe(E),C("Failed %s type: %s",h,R.message),oe(null))}}}var Re=Array.isArray;function Ae(u){return Re(u)}function fi(u){{var p=typeof Symbol=="function"&&Symbol.toStringTag,h=p&&u[Symbol.toStringTag]||u.constructor.name||"Object";return h}}function di(u){try{return un(u),!1}catch{return!0}}function un(u){return""+u}function ln(u){if(di(u))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",fi(u)),un(u)}var Ke=y.ReactCurrentOwner,pi={key:!0,ref:!0,__self:!0,__source:!0},cn,fn,Qt;Qt={};function hi(u){if(J.call(u,"ref")){var p=Object.getOwnPropertyDescriptor(u,"ref").get;if(p&&p.isReactWarning)return!1}return u.ref!==void 0}function vi(u){if(J.call(u,"key")){var p=Object.getOwnPropertyDescriptor(u,"key").get;if(p&&p.isReactWarning)return!1}return u.key!==void 0}function mi(u,p){if(typeof u.ref=="string"&&Ke.current&&p&&Ke.current.stateNode!==p){var h=$(Ke.current.type);Qt[h]||(C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',$(Ke.current.type),u.ref),Qt[h]=!0)}}function wi(u,p){{var h=function(){cn||(cn=!0,C("%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://reactjs.org/link/special-props)",p))};h.isReactWarning=!0,Object.defineProperty(u,"key",{get:h,configurable:!0})}}function yi(u,p){{var h=function(){fn||(fn=!0,C("%s: `ref` 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://reactjs.org/link/special-props)",p))};h.isReactWarning=!0,Object.defineProperty(u,"ref",{get:h,configurable:!0})}}var bi=function(u,p,h,_,E,T,S){var R={$$typeof:n,type:u,key:p,ref:h,props:S,_owner:T};return R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(R,"_self",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.defineProperty(R,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R};function _i(u,p,h,_,E){{var T,S={},R=null,H=null;h!==void 0&&(ln(h),R=""+h),vi(p)&&(ln(p.key),R=""+p.key),hi(p)&&(H=p.ref,mi(p,E));for(T in p)J.call(p,T)&&!pi.hasOwnProperty(T)&&(S[T]=p[T]);if(u&&u.defaultProps){var j=u.defaultProps;for(T in j)S[T]===void 0&&(S[T]=j[T])}if(R||H){var P=typeof u=="function"?u.displayName||u.name||"Unknown":u;R&&wi(S,P),H&&yi(S,P)}return bi(u,R,H,E,_,Ke.current,S)}}var Zt=y.ReactCurrentOwner,dn=y.ReactDebugCurrentFrame;function je(u){if(u){var p=u._owner,h=ee(u.type,u._source,p?p.type:null);dn.setExtraStackFrame(h)}else dn.setExtraStackFrame(null)}var $t;$t=!1;function er(u){return typeof u=="object"&&u!==null&&u.$$typeof===n}function pn(){{if(Zt.current){var u=$(Zt.current.type);if(u)return`
36
36
 
37
37
  Check the render method of \``+u+"`."}return""}}function Ri(u){{if(u!==void 0){var p=u.fileName.replace(/^.*[\\\/]/,""),h=u.lineNumber;return`
38
38
 
39
39
  Check your code at `+p+":"+h+"."}return""}}var hn={};function gi(u){{var p=pn();if(!p){var h=typeof u=="string"?u:u.displayName||u.name;h&&(p=`
40
40
 
41
- Check the top-level render call using <`+h+">.")}return p}}function vn(u,p){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var h=gi(p);if(hn[h])return;hn[h]=!0;var _="";u&&u._owner&&u._owner!==Zt.current&&(_=" It was passed a child from "+$(u._owner.type)+"."),je(u),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,_),je(null)}}function mn(u,p){{if(typeof u!="object")return;if(Ae(u))for(var h=0;h<u.length;h++){var _=u[h];er(_)&&vn(_,p)}else if(er(u))u._store&&(u._store.validated=!0);else if(u){var E=g(u);if(typeof E=="function"&&E!==u.entries)for(var T=E.call(u),S;!(S=T.next()).done;)er(S.value)&&vn(S.value,p)}}}function Si(u){{var p=u.type;if(p==null||typeof p=="string")return;var h;if(typeof p=="function")h=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===d||p.$$typeof===f))h=p.propTypes;else return;if(h){var _=$(p);ze(h,u.props,"prop",_,u)}else if(p.PropTypes!==void 0&&!$t){$t=!0;var E=$(p);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ci(u){{for(var p=Object.keys(u.props),h=0;h<p.length;h++){var _=p[h];if(_!=="children"&&_!=="key"){je(u),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),je(null);break}}u.ref!==null&&(je(u),C("Invalid attribute `ref` supplied to `React.Fragment`."),je(null))}}function wn(u,p,h,_,E,T){{var S=L(u);if(!S){var R="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(R+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var H=Ri(E);H?R+=H:R+=pn();var j;u===null?j="null":Ae(u)?j="array":u!==void 0&&u.$$typeof===n?(j="<"+($(u.type)||"Unknown")+" />",R=" Did you accidentally export a JSX literal instead of a component?"):j=typeof u,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",j,R)}var P=_i(u,p,h,E,T);if(P==null)return P;if(S){var ae=p.children;if(ae!==void 0)if(_)if(Ae(ae)){for(var Pe=0;Pe<ae.length;Pe++)mn(ae[Pe],u);Object.freeze&&Object.freeze(ae)}else C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else mn(ae,u)}return u===i?Ci(P):Si(P),P}}function Ei(u,p,h){return wn(u,p,h,!0)}function Ti(u,p,h){return wn(u,p,h,!1)}var xi=Ti,Oi=Ei;Xe.Fragment=i,Xe.jsx=xi,Xe.jsxs=Oi}()),Xe}(function(t){process.env.NODE_ENV==="production"?t.exports=Ga():t.exports=za()})(tn);const Ka=tn.exports.jsx,Y=v.createContext(null),Qa=({url:t="",children:n})=>{const e=v.useMemo(()=>{const i=new ga.FrappeApp(t);return{url:t,app:i,auth:i.auth(),db:i.db(),call:i.call(),file:i.file()}},[t]);return Ka(Y.Provider,{value:e,children:n})},Za=t=>{const{url:n,auth:e}=v.useContext(Y),{data:i,error:a,isValidating:r,mutate:s}=Je(`${n}/api/method/frappe.auth.get_logged_user`,()=>e.getLoggedInUser(),t),l=v.useCallback(async(o,c)=>e.loginWithUsernamePassword({username:o,password:c}).then(f=>{console.log(f),s()}),[]),d=v.useCallback(async()=>e.logout().then(()=>s(null)),[]);return{currentUser:i,isValidating:r,error:a,login:l,logout:d,updateCurrentUser:s}},$a=(t,n,e)=>{const{db:i}=v.useContext(Y);return{...Je(i.getRequestURL(t,n),()=>i.getDoc(t,n),e)}},an=t=>{var e,i,a;let n="";if(t!=null&&t.fields&&(n+="fields="+JSON.stringify(t==null?void 0:t.fields)+"&"),t!=null&&t.filters&&(n+="filters="+JSON.stringify(t==null?void 0:t.filters)+"&"),t!=null&&t.orFilters&&(n+="or_filters="+JSON.stringify(t==null?void 0:t.orFilters)+"&"),t!=null&&t.limit_start&&(n+="limit_start="+JSON.stringify(t==null?void 0:t.limit_start)+"&"),t!=null&&t.limit&&(n+="limit="+JSON.stringify(t==null?void 0:t.limit)+"&"),t!=null&&t.orderBy){const r=`${(e=t.orderBy)==null?void 0:e.field} ${(a=(i=t.orderBy)==null?void 0:i.order)!=null?a:"asc"}`;n+="order_by="+r+"&"}return t!=null&&t.asDict&&(n+="as_dict="+t.asDict),n},ei=(t,n,e)=>{const{db:i}=v.useContext(Y);return{...Je(`${i.getRequestURL(t)}?${an(n)}`,()=>i.getDocList(t,n),e)}},ti=()=>{const{db:t}=v.useContext(Y),[n,e]=v.useState(!1),[i,a]=v.useState(null),[r,s]=v.useState(!1),l=v.useCallback(()=>{e(!1),a(null),s(!1)},[]);return{createDoc:async(o,c)=>(l(),t.createDoc(o,c).then(f=>(e(!1),s(!0),f)).catch(f=>{throw e(!1),s(!1),a(f),f})),loading:n,error:i,isCompleted:r,reset:l}},ri=()=>{const{db:t}=v.useContext(Y),[n,e]=v.useState(!1),[i,a]=v.useState(null),[r,s]=v.useState(!1),l=v.useCallback(()=>{e(!1),a(null),s(!1)},[]);return{updateDoc:async(o,c,f)=>(l(),t.updateDoc(o,c,f).then(m=>(e(!1),s(!0),m)).catch(m=>{throw e(!1),s(!1),a(m),m})),loading:n,error:i,reset:l,isCompleted:r}},ni=()=>{const{db:t}=v.useContext(Y),[n,e]=v.useState(!1),[i,a]=v.useState(null),[r,s]=v.useState(!1),l=v.useCallback(()=>{e(!1),a(null),s(!1)},[]);return{deleteDoc:async(o,c)=>(l(),t.deleteDoc(o,c).then(f=>(e(!1),s(!0),f)).catch(f=>{throw e(!1),s(!1),a(f),f})),loading:n,error:i,reset:l,isCompleted:r}};function on(t){const n=[];for(let e in t)n.push(encodeURIComponent(e)+"="+encodeURIComponent(t[e]));return n.join("&")}const ai=(t,n,e=!1,i=!1,a)=>{const{url:r,db:s}=v.useContext(Y);return{...Je((()=>{const o=on({filters:n!=null?n:[],cache:e,debug:i});return`${r}/api/method/frappe.client.get_count?${o}`})(),()=>s.getCount(t,n,e,i),a)}},sn=(t,n,e,i)=>{const{call:a}=v.useContext(Y),r=on(n!=null?n:{}),s=`${t}?${r}`;return console.log(s),{...Je(e!=null?e:s,()=>a.get(t,n),i)}},ii=t=>{const{call:n}=v.useContext(Y),[e,i]=v.useState(null),[a,r]=v.useState(!1),[s,l]=v.useState(null),[d,o]=v.useState(!1),c=v.useCallback(()=>{i(null),r(!1),l(null),o(!1)},[]);return{call:async m=>(c(),n.post(t,m).then(y=>(i(y),r(!1),o(!0),y)).catch(y=>{throw r(!1),o(!1),l(y),y})),result:e,loading:a,error:s,reset:c,isCompleted:d}},oi=t=>{const{call:n}=v.useContext(Y),[e,i]=v.useState(null),[a,r]=v.useState(!1),[s,l]=v.useState(null),[d,o]=v.useState(!1),c=v.useCallback(()=>{i(null),r(!1),l(null),o(!1)},[]);return{call:async m=>(c(),n.put(t,m).then(y=>(i(y),r(!1),o(!0),y)).catch(y=>{throw r(!1),o(!1),l(y),y})),result:e,loading:a,error:s,reset:c,isCompleted:d}},si=t=>{const{call:n}=v.useContext(Y),[e,i]=v.useState(null),[a,r]=v.useState(!1),[s,l]=v.useState(null),[d,o]=v.useState(!1),c=v.useCallback(()=>{i(null),r(!1),l(null),o(!1)},[]);return{call:async m=>(c(),n.delete(t,m).then(y=>(i(y),r(!1),o(!0),y)).catch(y=>{throw r(!1),o(!1),l(y),y})),result:e,loading:a,error:s,reset:c,isCompleted:d}},ui=()=>{const{file:t}=v.useContext(Y),[n,e]=v.useState(0),[i,a]=v.useState(!1),[r,s]=v.useState(null),[l,d]=v.useState(!1),o=async(f,m)=>(c(),a(!0),t.uploadFile(f,m,(y,O)=>e(Math.round(y/O*100))).then(()=>{d(!0),e(100),a(!1)}).catch(y=>{throw console.error(y),s(y),a(!1),y})),c=v.useCallback(()=>{e(0),a(!1),s(null),d(!1)},[]);return{upload:o,progress:n,loading:i,isCompleted:l,error:r,reset:c}},li=(t,n,e=[],i=20,a=250)=>{const r=ci(n,a);return sn("/api/method/frappe.desk.search.search_link",{page_length:i,doctype:t,txt:r,filters:e})},ci=(t,n)=>{const[e,i]=v.useState(t);return v.useEffect(()=>{const a=setTimeout(()=>{i(t)},n);return()=>{clearTimeout(a)}},[t,n]),e};F.FrappeContext=Y,F.FrappeProvider=Qa,F.getDocListQueryString=an,F.useFrappeAuth=Za,F.useFrappeCreateDoc=ti,F.useFrappeDeleteCall=si,F.useFrappeDeleteDoc=ni,F.useFrappeFileUpload=ui,F.useFrappeGetCall=sn,F.useFrappeGetDoc=$a,F.useFrappeGetDocCount=ai,F.useFrappeGetDocList=ei,F.useFrappePostCall=ii,F.useFrappePutCall=oi,F.useFrappeUpdateDoc=ri,F.useSearch=li,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
41
+ Check the top-level render call using <`+h+">.")}return p}}function vn(u,p){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var h=gi(p);if(hn[h])return;hn[h]=!0;var _="";u&&u._owner&&u._owner!==Zt.current&&(_=" It was passed a child from "+$(u._owner.type)+"."),je(u),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,_),je(null)}}function mn(u,p){{if(typeof u!="object")return;if(Ae(u))for(var h=0;h<u.length;h++){var _=u[h];er(_)&&vn(_,p)}else if(er(u))u._store&&(u._store.validated=!0);else if(u){var E=g(u);if(typeof E=="function"&&E!==u.entries)for(var T=E.call(u),S;!(S=T.next()).done;)er(S.value)&&vn(S.value,p)}}}function Si(u){{var p=u.type;if(p==null||typeof p=="string")return;var h;if(typeof p=="function")h=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===d||p.$$typeof===f))h=p.propTypes;else return;if(h){var _=$(p);ze(h,u.props,"prop",_,u)}else if(p.PropTypes!==void 0&&!$t){$t=!0;var E=$(p);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ci(u){{for(var p=Object.keys(u.props),h=0;h<p.length;h++){var _=p[h];if(_!=="children"&&_!=="key"){je(u),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),je(null);break}}u.ref!==null&&(je(u),C("Invalid attribute `ref` supplied to `React.Fragment`."),je(null))}}function wn(u,p,h,_,E,T){{var S=L(u);if(!S){var R="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(R+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var H=Ri(E);H?R+=H:R+=pn();var j;u===null?j="null":Ae(u)?j="array":u!==void 0&&u.$$typeof===n?(j="<"+($(u.type)||"Unknown")+" />",R=" Did you accidentally export a JSX literal instead of a component?"):j=typeof u,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",j,R)}var P=_i(u,p,h,E,T);if(P==null)return P;if(S){var ae=p.children;if(ae!==void 0)if(_)if(Ae(ae)){for(var Pe=0;Pe<ae.length;Pe++)mn(ae[Pe],u);Object.freeze&&Object.freeze(ae)}else C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else mn(ae,u)}return u===i?Ci(P):Si(P),P}}function Ei(u,p,h){return wn(u,p,h,!0)}function Ti(u,p,h){return wn(u,p,h,!1)}var xi=Ti,Oi=Ei;Xe.Fragment=i,Xe.jsx=xi,Xe.jsxs=Oi}()),Xe}(function(t){process.env.NODE_ENV==="production"?t.exports=Ga():t.exports=za()})(tn);const Ka=tn.exports.jsx,Y=v.createContext(null),Qa=({url:t="",children:n})=>{const e=v.useMemo(()=>{const i=new ga.FrappeApp(t);return{url:t,app:i,auth:i.auth(),db:i.db(),call:i.call(),file:i.file()}},[t]);return Ka(Y.Provider,{value:e,children:n})},Za=t=>{const{url:n,auth:e}=v.useContext(Y),{data:i,error:a,isValidating:r,mutate:s}=Je(`${n}/api/method/frappe.auth.get_logged_user`,()=>e.getLoggedInUser(),t),l=v.useCallback(async(o,c)=>e.loginWithUsernamePassword({username:o,password:c}).then(f=>{console.log(f),s()}),[]),d=v.useCallback(async()=>e.logout().then(()=>s(null)),[]);return{currentUser:i,isValidating:r,error:a,login:l,logout:d,updateCurrentUser:s}},$a=(t,n,e)=>{const{db:i}=v.useContext(Y);return{...Je(i.getRequestURL(t,n),()=>i.getDoc(t,n),e)}},an=t=>{var e,i,a;let n="";if(t!=null&&t.fields&&(n+="fields="+JSON.stringify(t==null?void 0:t.fields)+"&"),t!=null&&t.filters&&(n+="filters="+JSON.stringify(t==null?void 0:t.filters)+"&"),t!=null&&t.orFilters&&(n+="or_filters="+JSON.stringify(t==null?void 0:t.orFilters)+"&"),t!=null&&t.limit_start&&(n+="limit_start="+JSON.stringify(t==null?void 0:t.limit_start)+"&"),t!=null&&t.limit&&(n+="limit="+JSON.stringify(t==null?void 0:t.limit)+"&"),t!=null&&t.orderBy){const r=`${(e=t.orderBy)==null?void 0:e.field} ${(a=(i=t.orderBy)==null?void 0:i.order)!=null?a:"asc"}`;n+="order_by="+r+"&"}return t!=null&&t.asDict&&(n+="as_dict="+t.asDict),n},ei=(t,n,e)=>{const{db:i}=v.useContext(Y);return{...Je(`${i.getRequestURL(t)}?${an(n)}`,()=>i.getDocList(t,n),e)}},ti=()=>{const{db:t}=v.useContext(Y),[n,e]=v.useState(!1),[i,a]=v.useState(null),[r,s]=v.useState(!1),l=v.useCallback(()=>{e(!1),a(null),s(!1)},[]);return{createDoc:async(o,c)=>(l(),t.createDoc(o,c).then(f=>(e(!1),s(!0),f)).catch(f=>{throw e(!1),s(!1),a(f),f})),loading:n,error:i,isCompleted:r,reset:l}},ri=()=>{const{db:t}=v.useContext(Y),[n,e]=v.useState(!1),[i,a]=v.useState(null),[r,s]=v.useState(!1),l=v.useCallback(()=>{e(!1),a(null),s(!1)},[]);return{updateDoc:async(o,c,f)=>(l(),t.updateDoc(o,c,f).then(m=>(e(!1),s(!0),m)).catch(m=>{throw e(!1),s(!1),a(m),m})),loading:n,error:i,reset:l,isCompleted:r}},ni=()=>{const{db:t}=v.useContext(Y),[n,e]=v.useState(!1),[i,a]=v.useState(null),[r,s]=v.useState(!1),l=v.useCallback(()=>{e(!1),a(null),s(!1)},[]);return{deleteDoc:async(o,c)=>(l(),t.deleteDoc(o,c).then(f=>(e(!1),s(!0),f)).catch(f=>{throw e(!1),s(!1),a(f),f})),loading:n,error:i,reset:l,isCompleted:r}};function on(t){const n=[];for(let e in t)n.push(encodeURIComponent(e)+"="+encodeURIComponent(t[e]));return n.join("&")}const ai=(t,n,e=!1,i=!1,a)=>{const{url:r,db:s}=v.useContext(Y);return{...Je((()=>{const o=on({filters:n!=null?n:[],cache:e,debug:i});return`${r}/api/method/frappe.client.get_count?${o}`})(),()=>s.getCount(t,n,e,i),a)}},sn=(t,n,e,i)=>{const{call:a}=v.useContext(Y),r=on(n!=null?n:{}),s=`${t}?${r}`;return console.log(s),{...Je(e!=null?e:s,()=>a.get(t,n),i)}},ii=t=>{const{call:n}=v.useContext(Y),[e,i]=v.useState(null),[a,r]=v.useState(!1),[s,l]=v.useState(null),[d,o]=v.useState(!1),c=v.useCallback(()=>{i(null),r(!1),l(null),o(!1)},[]);return{call:async m=>(c(),n.post(t,m).then(w=>(i(w),r(!1),o(!0),w)).catch(w=>{throw r(!1),o(!1),l(w),w})),result:e,loading:a,error:s,reset:c,isCompleted:d}},oi=t=>{const{call:n}=v.useContext(Y),[e,i]=v.useState(null),[a,r]=v.useState(!1),[s,l]=v.useState(null),[d,o]=v.useState(!1),c=v.useCallback(()=>{i(null),r(!1),l(null),o(!1)},[]);return{call:async m=>(c(),n.put(t,m).then(w=>(i(w),r(!1),o(!0),w)).catch(w=>{throw r(!1),o(!1),l(w),w})),result:e,loading:a,error:s,reset:c,isCompleted:d}},si=t=>{const{call:n}=v.useContext(Y),[e,i]=v.useState(null),[a,r]=v.useState(!1),[s,l]=v.useState(null),[d,o]=v.useState(!1),c=v.useCallback(()=>{i(null),r(!1),l(null),o(!1)},[]);return{call:async m=>(c(),n.delete(t,m).then(w=>(i(w),r(!1),o(!0),w)).catch(w=>{throw r(!1),o(!1),l(w),w})),result:e,loading:a,error:s,reset:c,isCompleted:d}},ui=()=>{const{file:t}=v.useContext(Y),[n,e]=v.useState(0),[i,a]=v.useState(!1),[r,s]=v.useState(null),[l,d]=v.useState(!1),o=async(f,m)=>(c(),a(!0),t.uploadFile(f,m,(w,O)=>e(Math.round(w/O*100))).then(w=>(d(!0),e(100),a(!1),w.data.message)).catch(w=>{throw console.error(w),s(w),a(!1),w})),c=v.useCallback(()=>{e(0),a(!1),s(null),d(!1)},[]);return{upload:o,progress:n,loading:i,isCompleted:l,error:r,reset:c}},li=(t,n,e=[],i=20,a=250)=>{const r=ci(n,a);return sn("/api/method/frappe.desk.search.search_link",{page_length:i,doctype:t,txt:r,filters:e})},ci=(t,n)=>{const[e,i]=v.useState(t);return v.useEffect(()=>{const a=setTimeout(()=>{i(t)},n);return()=>{clearTimeout(a)}},[t,n]),e};F.FrappeContext=Y,F.FrappeProvider=Qa,F.getDocListQueryString=an,F.useFrappeAuth=Za,F.useFrappeCreateDoc=ti,F.useFrappeDeleteCall=si,F.useFrappeDeleteDoc=ni,F.useFrappeFileUpload=ui,F.useFrappeGetCall=sn,F.useFrappeGetDoc=$a,F.useFrappeGetDocCount=ai,F.useFrappeGetDocList=ei,F.useFrappePostCall=ii,F.useFrappePutCall=oi,F.useFrappeUpdateDoc=ri,F.useSearch=li,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -202,6 +202,36 @@ export declare const useFrappeDeleteCall: <T>(method: string) => {
202
202
  /** Function to reset the state of the hook */
203
203
  reset: () => void;
204
204
  };
205
+ export interface FrappeFileUploadResponse {
206
+ /** Name of the file documnet in the database */
207
+ "name": string;
208
+ "owner": string;
209
+ "creation": string;
210
+ "modified": string;
211
+ "modified_by": string;
212
+ "docstatus": 0 | 1 | 2;
213
+ "idx": number;
214
+ /** Name of the uploaded file */
215
+ "file_name": string;
216
+ /** File is not accessible by guest users */
217
+ "is_private": 1 | 0;
218
+ "is_home_folder": 0 | 1;
219
+ "is_attachments_folder": 0 | 1;
220
+ /** File size in bytes */
221
+ "file_size": number;
222
+ /** Path of the file ex: /private/files/file_name.jpg */
223
+ "file_url": string;
224
+ "folder": string;
225
+ "is_folder": 0 | 1;
226
+ /** Doctype the file is linked to */
227
+ "attached_to_doctype": string;
228
+ /** Document the file is linked to */
229
+ "attached_to_name": string;
230
+ "content_hash": string;
231
+ "uploaded_to_dropbox": 0 | 1;
232
+ "uploaded_to_google_drive": 0 | 1;
233
+ "doctype": "File";
234
+ }
205
235
  /**
206
236
  * Hook to upload files to the server
207
237
  *
@@ -209,7 +239,7 @@ export declare const useFrappeDeleteCall: <T>(method: string) => {
209
239
  */
210
240
  export declare const useFrappeFileUpload: () => {
211
241
  /** Function to upload the file */
212
- upload: (file: File, args: FileArgs) => Promise<void>;
242
+ upload: (file: File, args: FileArgs) => Promise<FrappeFileUploadResponse>;
213
243
  /** Upload Progress in % - rounded off */
214
244
  progress: number;
215
245
  /** Will be true when the file is being uploaded */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "frappe-react-sdk",
3
3
  "description": "React hooks for Frappe Framework",
4
- "version": "1.0.6",
4
+ "version": "1.0.7",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Nikhil Kothari",