mongodb-chatbot-ui
Version:
UI React components for the MongoDB Chatbot Framework
1,393 lines • 312 kB
JavaScript
import { a as tl, g as bu, p as te, c as wl } from "./jsx-runtime.js";
import Wc from "react";
import { p as zc } from "./Transition.js";
import { r as ct, p as yu, i as Vc, a as Gc, o as Kc } from "./index3.js";
import { c as rl, x as Yc, y as Xc, A as qe, B as Jc, C as hu, D as Qc, E as Ue, G as V, H as gu, I as dt, J as Ru, L as Zc, a as Eu, O as Cu, P as ed } from "./index2.js";
/*!
* tabbable 5.3.3
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/
var _u = ["input", "select", "textarea", "a[href]", "button", "[tabindex]:not(slot)", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"], At = /* @__PURE__ */ _u.join(","), Pu = typeof Element > "u", $e = Pu ? function() {
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Ro = !Pu && Element.prototype.getRootNode ? function(e) {
return e.getRootNode();
} : function(e) {
return e.ownerDocument;
}, wu = function(t, r, a) {
var n = Array.prototype.slice.apply(t.querySelectorAll(At));
return r && $e.call(t, At) && n.unshift(t), n = n.filter(a), n;
}, qu = function e(t, r, a) {
for (var n = [], o = Array.from(t); o.length; ) {
var l = o.shift();
if (l.tagName === "SLOT") {
var u = l.assignedElements(), i = u.length ? u : l.children, s = e(i, !0, a);
a.flatten ? n.push.apply(n, s) : n.push({
scope: l,
candidates: s
});
} else {
var p = $e.call(l, At);
p && a.filter(l) && (r || !t.includes(l)) && n.push(l);
var f = l.shadowRoot || // check for an undisclosed shadow
typeof a.getShadowRoot == "function" && a.getShadowRoot(l), m = !a.shadowRootFilter || a.shadowRootFilter(l);
if (f && m) {
var C = e(f === !0 ? l.children : f.children, !0, a);
a.flatten ? n.push.apply(n, C) : n.push({
scope: l,
candidates: C
});
} else
o.unshift.apply(o, l.children);
}
}
return n;
}, Tu = function(t, r) {
return t.tabIndex < 0 && (r || /^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || t.isContentEditable) && isNaN(parseInt(t.getAttribute("tabindex"), 10)) ? 0 : t.tabIndex;
}, td = function(t, r) {
return t.tabIndex === r.tabIndex ? t.documentOrder - r.documentOrder : t.tabIndex - r.tabIndex;
}, Su = function(t) {
return t.tagName === "INPUT";
}, rd = function(t) {
return Su(t) && t.type === "hidden";
}, ad = function(t) {
var r = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(a) {
return a.tagName === "SUMMARY";
});
return r;
}, nd = function(t, r) {
for (var a = 0; a < t.length; a++)
if (t[a].checked && t[a].form === r)
return t[a];
}, od = function(t) {
if (!t.name)
return !0;
var r = t.form || Ro(t), a = function(u) {
return r.querySelectorAll('input[type="radio"][name="' + u + '"]');
}, n;
if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
n = a(window.CSS.escape(t.name));
else
try {
n = a(t.name);
} catch (l) {
return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", l.message), !1;
}
var o = nd(n, t.form);
return !o || o === t;
}, ld = function(t) {
return Su(t) && t.type === "radio";
}, id = function(t) {
return ld(t) && !od(t);
}, ql = function(t) {
var r = t.getBoundingClientRect(), a = r.width, n = r.height;
return a === 0 && n === 0;
}, ud = function(t, r) {
var a = r.displayCheck, n = r.getShadowRoot;
if (getComputedStyle(t).visibility === "hidden")
return !0;
var o = $e.call(t, "details>summary:first-of-type"), l = o ? t.parentElement : t;
if ($e.call(l, "details:not([open]) *"))
return !0;
var u = Ro(t).host, i = (u == null ? void 0 : u.ownerDocument.contains(u)) || t.ownerDocument.contains(t);
if (!a || a === "full") {
if (typeof n == "function") {
for (var s = t; t; ) {
var p = t.parentElement, f = Ro(t);
if (p && !p.shadowRoot && n(p) === !0)
return ql(t);
t.assignedSlot ? t = t.assignedSlot : !p && f !== t.ownerDocument ? t = f.host : t = p;
}
t = s;
}
if (i)
return !t.getClientRects().length;
} else if (a === "non-zero-area")
return ql(t);
return !1;
}, sd = function(t) {
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
for (var r = t.parentElement; r; ) {
if (r.tagName === "FIELDSET" && r.disabled) {
for (var a = 0; a < r.children.length; a++) {
var n = r.children.item(a);
if (n.tagName === "LEGEND")
return $e.call(r, "fieldset[disabled] *") ? !0 : !n.contains(t);
}
return !0;
}
r = r.parentElement;
}
return !1;
}, Mt = function(t, r) {
return !(r.disabled || rd(r) || ud(r, t) || // For a details element with a summary, the summary element gets the focus
ad(r) || sd(r));
}, Eo = function(t, r) {
return !(id(r) || Tu(r) < 0 || !Mt(t, r));
}, cd = function(t) {
var r = parseInt(t.getAttribute("tabindex"), 10);
return !!(isNaN(r) || r >= 0);
}, dd = function e(t) {
var r = [], a = [];
return t.forEach(function(n, o) {
var l = !!n.scope, u = l ? n.scope : n, i = Tu(u, l), s = l ? e(n.candidates) : u;
i === 0 ? l ? r.push.apply(r, s) : r.push(u) : a.push({
documentOrder: o,
tabIndex: i,
item: n,
isScope: l,
content: s
});
}), a.sort(td).reduce(function(n, o) {
return o.isScope ? n.push.apply(n, o.content) : n.push(o.content), n;
}, []).concat(r);
}, xu = function(t, r) {
r = r || {};
var a;
return r.getShadowRoot ? a = qu([t], r.includeContainer, {
filter: Eo.bind(null, r),
flatten: !1,
getShadowRoot: r.getShadowRoot,
shadowRootFilter: cd
}) : a = wu(t, r.includeContainer, Eo.bind(null, r)), dd(a);
}, Ou = function(t, r) {
r = r || {};
var a;
return r.getShadowRoot ? a = qu([t], r.includeContainer, {
filter: Mt.bind(null, r),
flatten: !0,
getShadowRoot: r.getShadowRoot
}) : a = wu(t, r.includeContainer, Mt.bind(null, r)), a;
}, Qe = function(t, r) {
if (r = r || {}, !t)
throw new Error("No node provided");
return $e.call(t, At) === !1 ? !1 : Eo(r, t);
}, fd = /* @__PURE__ */ _u.concat("iframe").join(","), Tt = function(t, r) {
if (r = r || {}, !t)
throw new Error("No node provided");
return $e.call(t, fd) === !1 ? !1 : Mt(r, t);
};
const pd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
focusable: Ou,
isFocusable: Tt,
isTabbable: Qe,
tabbable: xu
}, Symbol.toStringTag, { value: "Module" }));
/*!
* focus-trap 6.9.4
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
*/
function Tl(e, t) {
var r = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var a = Object.getOwnPropertySymbols(e);
t && (a = a.filter(function(n) {
return Object.getOwnPropertyDescriptor(e, n).enumerable;
})), r.push.apply(r, a);
}
return r;
}
function Sl(e) {
for (var t = 1; t < arguments.length; t++) {
var r = arguments[t] != null ? arguments[t] : {};
t % 2 ? Tl(Object(r), !0).forEach(function(a) {
vd(e, a, r[a]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Tl(Object(r)).forEach(function(a) {
Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
});
}
return e;
}
function vd(e, t, r) {
return t in e ? Object.defineProperty(e, t, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = r, e;
}
var xl = function() {
var e = [];
return {
activateTrap: function(r) {
if (e.length > 0) {
var a = e[e.length - 1];
a !== r && a.pause();
}
var n = e.indexOf(r);
n === -1 || e.splice(n, 1), e.push(r);
},
deactivateTrap: function(r) {
var a = e.indexOf(r);
a !== -1 && e.splice(a, 1), e.length > 0 && e[e.length - 1].unpause();
}
};
}(), md = function(t) {
return t.tagName && t.tagName.toLowerCase() === "input" && typeof t.select == "function";
}, bd = function(t) {
return t.key === "Escape" || t.key === "Esc" || t.keyCode === 27;
}, yd = function(t) {
return t.key === "Tab" || t.keyCode === 9;
}, Ol = function(t) {
return setTimeout(t, 0);
}, $l = function(t, r) {
var a = -1;
return t.every(function(n, o) {
return r(n) ? (a = o, !1) : !0;
}), a;
}, Ve = function(t) {
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
a[n - 1] = arguments[n];
return typeof t == "function" ? t.apply(void 0, a) : t;
}, gt = function(t) {
return t.target.shadowRoot && typeof t.composedPath == "function" ? t.composedPath()[0] : t.target;
}, hd = function(t, r) {
var a = (r == null ? void 0 : r.document) || document, n = Sl({
returnFocusOnDeactivate: !0,
escapeDeactivates: !0,
delayInitialFocus: !0
}, r), o = {
// containers given to createFocusTrap()
// @type {Array<HTMLElement>}
containers: [],
// list of objects identifying tabbable nodes in `containers` in the trap
// NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
// is active, but the trap should never get to a state where there isn't at least one group
// with at least one tabbable node in it (that would lead to an error condition that would
// result in an error being thrown)
// @type {Array<{
// container: HTMLElement,
// tabbableNodes: Array<HTMLElement>, // empty if none
// focusableNodes: Array<HTMLElement>, // empty if none
// firstTabbableNode: HTMLElement|null,
// lastTabbableNode: HTMLElement|null,
// nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
// }>}
containerGroups: [],
// same order/length as `containers` list
// references to objects in `containerGroups`, but only those that actually have
// tabbable nodes in them
// NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
// the same length
tabbableGroups: [],
nodeFocusedBeforeActivation: null,
mostRecentlyFocusedNode: null,
active: !1,
paused: !1,
// timer ID for when delayInitialFocus is true and initial focus in this trap
// has been delayed during activation
delayInitialFocusTimer: void 0
}, l, u = function(c, v, b) {
return c && c[v] !== void 0 ? c[v] : n[b || v];
}, i = function(c) {
return o.containerGroups.findIndex(function(v) {
var b = v.container, O = v.tabbableNodes;
return b.contains(c) || // fall back to explicit tabbable search which will take into consideration any
// web components if the `tabbableOptions.getShadowRoot` option was used for
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
// look inside web components even if open)
O.find(function(A) {
return A === c;
});
});
}, s = function(c) {
var v = n[c];
if (typeof v == "function") {
for (var b = arguments.length, O = new Array(b > 1 ? b - 1 : 0), A = 1; A < b; A++)
O[A - 1] = arguments[A];
v = v.apply(void 0, O);
}
if (v === !0 && (v = void 0), !v) {
if (v === void 0 || v === !1)
return v;
throw new Error("`".concat(c, "` was specified but was not a node, or did not return a node"));
}
var M = v;
if (typeof v == "string" && (M = a.querySelector(v), !M))
throw new Error("`".concat(c, "` as selector refers to no known node"));
return M;
}, p = function() {
var c = s("initialFocus");
if (c === !1)
return !1;
if (c === void 0)
if (i(a.activeElement) >= 0)
c = a.activeElement;
else {
var v = o.tabbableGroups[0], b = v && v.firstTabbableNode;
c = b || s("fallbackFocus");
}
if (!c)
throw new Error("Your focus-trap needs to have at least one focusable element");
return c;
}, f = function() {
if (o.containerGroups = o.containers.map(function(c) {
var v = xu(c, n.tabbableOptions), b = Ou(c, n.tabbableOptions);
return {
container: c,
tabbableNodes: v,
focusableNodes: b,
firstTabbableNode: v.length > 0 ? v[0] : null,
lastTabbableNode: v.length > 0 ? v[v.length - 1] : null,
/**
* Finds the __tabbable__ node that follows the given node in the specified direction,
* in this container, if any.
* @param {HTMLElement} node
* @param {boolean} [forward] True if going in forward tab order; false if going
* in reverse.
* @returns {HTMLElement|undefined} The next tabbable node, if any.
*/
nextTabbableNode: function(A) {
var M = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, B = b.findIndex(function(h) {
return h === A;
});
if (!(B < 0))
return M ? b.slice(B + 1).find(function(h) {
return Qe(h, n.tabbableOptions);
}) : b.slice(0, B).reverse().find(function(h) {
return Qe(h, n.tabbableOptions);
});
}
};
}), o.tabbableGroups = o.containerGroups.filter(function(c) {
return c.tabbableNodes.length > 0;
}), o.tabbableGroups.length <= 0 && !s("fallbackFocus"))
throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
}, m = function R(c) {
if (c !== !1 && c !== a.activeElement) {
if (!c || !c.focus) {
R(p());
return;
}
c.focus({
preventScroll: !!n.preventScroll
}), o.mostRecentlyFocusedNode = c, md(c) && c.select();
}
}, C = function(c) {
var v = s("setReturnFocus", c);
return v || (v === !1 ? !1 : c);
}, w = function(c) {
var v = gt(c);
if (!(i(v) >= 0)) {
if (Ve(n.clickOutsideDeactivates, c)) {
l.deactivate({
// if, on deactivation, we should return focus to the node originally-focused
// when the trap was activated (or the configured `setReturnFocus` node),
// then assume it's also OK to return focus to the outside node that was
// just clicked, causing deactivation, as long as that node is focusable;
// if it isn't focusable, then return focus to the original node focused
// on activation (or the configured `setReturnFocus` node)
// NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
// which will result in the outside click setting focus to the node
// that was clicked, whether it's focusable or not; by setting
// `returnFocus: true`, we'll attempt to re-focus the node originally-focused
// on activation (or the configured `setReturnFocus` node)
returnFocus: n.returnFocusOnDeactivate && !Tt(v, n.tabbableOptions)
});
return;
}
Ve(n.allowOutsideClick, c) || c.preventDefault();
}
}, P = function(c) {
var v = gt(c), b = i(v) >= 0;
b || v instanceof Document ? b && (o.mostRecentlyFocusedNode = v) : (c.stopImmediatePropagation(), m(o.mostRecentlyFocusedNode || p()));
}, x = function(c) {
var v = gt(c);
f();
var b = null;
if (o.tabbableGroups.length > 0) {
var O = i(v), A = O >= 0 ? o.containerGroups[O] : void 0;
if (O < 0)
c.shiftKey ? b = o.tabbableGroups[o.tabbableGroups.length - 1].lastTabbableNode : b = o.tabbableGroups[0].firstTabbableNode;
else if (c.shiftKey) {
var M = $l(o.tabbableGroups, function(H) {
var Y = H.firstTabbableNode;
return v === Y;
});
if (M < 0 && (A.container === v || Tt(v, n.tabbableOptions) && !Qe(v, n.tabbableOptions) && !A.nextTabbableNode(v, !1)) && (M = O), M >= 0) {
var B = M === 0 ? o.tabbableGroups.length - 1 : M - 1, h = o.tabbableGroups[B];
b = h.lastTabbableNode;
}
} else {
var q = $l(o.tabbableGroups, function(H) {
var Y = H.lastTabbableNode;
return v === Y;
});
if (q < 0 && (A.container === v || Tt(v, n.tabbableOptions) && !Qe(v, n.tabbableOptions) && !A.nextTabbableNode(v)) && (q = O), q >= 0) {
var j = q === o.tabbableGroups.length - 1 ? 0 : q + 1, L = o.tabbableGroups[j];
b = L.firstTabbableNode;
}
}
} else
b = s("fallbackFocus");
b && (c.preventDefault(), m(b));
}, d = function(c) {
if (bd(c) && Ve(n.escapeDeactivates, c) !== !1) {
c.preventDefault(), l.deactivate();
return;
}
if (yd(c)) {
x(c);
return;
}
}, g = function(c) {
var v = gt(c);
i(v) >= 0 || Ve(n.clickOutsideDeactivates, c) || Ve(n.allowOutsideClick, c) || (c.preventDefault(), c.stopImmediatePropagation());
}, _ = function() {
if (o.active)
return xl.activateTrap(l), o.delayInitialFocusTimer = n.delayInitialFocus ? Ol(function() {
m(p());
}) : m(p()), a.addEventListener("focusin", P, !0), a.addEventListener("mousedown", w, {
capture: !0,
passive: !1
}), a.addEventListener("touchstart", w, {
capture: !0,
passive: !1
}), a.addEventListener("click", g, {
capture: !0,
passive: !1
}), a.addEventListener("keydown", d, {
capture: !0,
passive: !1
}), l;
}, E = function() {
if (o.active)
return a.removeEventListener("focusin", P, !0), a.removeEventListener("mousedown", w, !0), a.removeEventListener("touchstart", w, !0), a.removeEventListener("click", g, !0), a.removeEventListener("keydown", d, !0), l;
};
return l = {
get active() {
return o.active;
},
get paused() {
return o.paused;
},
activate: function(c) {
if (o.active)
return this;
var v = u(c, "onActivate"), b = u(c, "onPostActivate"), O = u(c, "checkCanFocusTrap");
O || f(), o.active = !0, o.paused = !1, o.nodeFocusedBeforeActivation = a.activeElement, v && v();
var A = function() {
O && f(), _(), b && b();
};
return O ? (O(o.containers.concat()).then(A, A), this) : (A(), this);
},
deactivate: function(c) {
if (!o.active)
return this;
var v = Sl({
onDeactivate: n.onDeactivate,
onPostDeactivate: n.onPostDeactivate,
checkCanReturnFocus: n.checkCanReturnFocus
}, c);
clearTimeout(o.delayInitialFocusTimer), o.delayInitialFocusTimer = void 0, E(), o.active = !1, o.paused = !1, xl.deactivateTrap(l);
var b = u(v, "onDeactivate"), O = u(v, "onPostDeactivate"), A = u(v, "checkCanReturnFocus"), M = u(v, "returnFocus", "returnFocusOnDeactivate");
b && b();
var B = function() {
Ol(function() {
M && m(C(o.nodeFocusedBeforeActivation)), O && O();
});
};
return M && A ? (A(C(o.nodeFocusedBeforeActivation)).then(B, B), this) : (B(), this);
},
pause: function() {
return o.paused || !o.active ? this : (o.paused = !0, E(), this);
},
unpause: function() {
return !o.paused || !o.active ? this : (o.paused = !1, f(), _(), this);
},
updateContainerElements: function(c) {
var v = [].concat(c).filter(Boolean);
return o.containers = v.map(function(b) {
return typeof b == "string" ? a.querySelector(b) : b;
}), o.active && f(), this;
}
}, l.updateContainerElements(t), l;
};
const gd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
createFocusTrap: hd
}, Symbol.toStringTag, { value: "Module" })), Rd = /* @__PURE__ */ tl(gd), Ed = /* @__PURE__ */ tl(pd);
function Co(e) {
"@babel/helpers - typeof";
return Co = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, Co(e);
}
function Cd(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function Al(e, t) {
for (var r = 0; r < t.length; r++) {
var a = t[r];
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a);
}
}
function _d(e, t, r) {
return t && Al(e.prototype, t), r && Al(e, r), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function Pd(e, t) {
if (typeof t != "function" && t !== null)
throw new TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && _o(e, t);
}
function _o(e, t) {
return _o = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, n) {
return a.__proto__ = n, a;
}, _o(e, t);
}
function wd(e) {
var t = Td();
return function() {
var a = It(e), n;
if (t) {
var o = It(this).constructor;
n = Reflect.construct(a, arguments, o);
} else
n = a.apply(this, arguments);
return qd(this, n);
};
}
function qd(e, t) {
if (t && (Co(t) === "object" || typeof t == "function"))
return t;
if (t !== void 0)
throw new TypeError("Derived constructors may only return object or undefined");
return Ze(e);
}
function Ze(e) {
if (e === void 0)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e;
}
function Td() {
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
return !1;
if (typeof Proxy == "function")
return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
})), !0;
} catch {
return !1;
}
}
function It(e) {
return It = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(r) {
return r.__proto__ || Object.getPrototypeOf(r);
}, It(e);
}
function Sd(e, t, r) {
return t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
}
var Rt = Wc, S = zc, xd = Rd, Od = xd.createFocusTrap, $d = Ed, Ad = $d.isFocusable, al = /* @__PURE__ */ function(e) {
Pd(r, e);
var t = wd(r);
function r(a) {
var n;
Cd(this, r), n = t.call(this, a), Sd(Ze(n), "getNodeForOption", function(u) {
var i, s = (i = this.internalOptions[u]) !== null && i !== void 0 ? i : this.originalOptions[u];
if (typeof s == "function") {
for (var p = arguments.length, f = new Array(p > 1 ? p - 1 : 0), m = 1; m < p; m++)
f[m - 1] = arguments[m];
s = s.apply(void 0, f);
}
if (s === !0 && (s = void 0), !s) {
if (s === void 0 || s === !1)
return s;
throw new Error("`".concat(u, "` was specified but was not a node, or did not return a node"));
}
var C = s;
if (typeof s == "string") {
var w;
if (C = (w = this.getDocument()) === null || w === void 0 ? void 0 : w.querySelector(s), !C)
throw new Error("`".concat(u, "` as selector refers to no known node"));
}
return C;
}), n.handleDeactivate = n.handleDeactivate.bind(Ze(n)), n.handlePostDeactivate = n.handlePostDeactivate.bind(Ze(n)), n.handleClickOutsideDeactivates = n.handleClickOutsideDeactivates.bind(Ze(n)), n.internalOptions = {
// We need to hijack the returnFocusOnDeactivate option,
// because React can move focus into the element before we arrived at
// this lifecycle hook (e.g. with autoFocus inputs). So the component
// captures the previouslyFocusedElement in componentWillMount,
// then (optionally) returns focus to it in componentWillUnmount.
returnFocusOnDeactivate: !1,
// the rest of these are also related to deactivation of the trap, and we
// need to use them and control them as well
checkCanReturnFocus: null,
onDeactivate: n.handleDeactivate,
onPostDeactivate: n.handlePostDeactivate,
// we need to special-case this setting as well so that we can know if we should
// NOT return focus if the trap gets auto-deactivated as the result of an
// outside click (otherwise, we'll always think we should return focus because
// of how we manage that flag internally here)
clickOutsideDeactivates: n.handleClickOutsideDeactivates
}, n.originalOptions = {
// because of the above `internalOptions`, we maintain our own flag for
// this option, and default it to `true` because that's focus-trap's default
returnFocusOnDeactivate: !0,
// because of the above `internalOptions`, we keep these separate since
// they're part of the deactivation process which we configure (internally) to
// be shared between focus-trap and focus-trap-react
onDeactivate: null,
onPostDeactivate: null,
checkCanReturnFocus: null,
// the user's setting, defaulted to false since focus-trap defaults this to false
clickOutsideDeactivates: !1
};
var o = a.focusTrapOptions;
for (var l in o)
if (Object.prototype.hasOwnProperty.call(o, l)) {
if (l === "returnFocusOnDeactivate" || l === "onDeactivate" || l === "onPostDeactivate" || l === "checkCanReturnFocus" || l === "clickOutsideDeactivates") {
n.originalOptions[l] = o[l];
continue;
}
n.internalOptions[l] = o[l];
}
return n.outsideClick = null, n.focusTrapElements = a.containerElements || [], n.updatePreviousElement(), n;
}
return _d(r, [{
key: "getDocument",
value: function() {
return this.props.focusTrapOptions.document || (typeof document < "u" ? document : void 0);
}
/**
* Gets the node for the given option, which is expected to be an option that
* can be either a DOM node, a string that is a selector to get a node, `false`
* (if a node is explicitly NOT given), or a function that returns any of these
* values.
* @param {string} optionName
* @returns {undefined | false | HTMLElement | SVGElement} Returns
* `undefined` if the option is not specified; `false` if the option
* resolved to `false` (node explicitly not given); otherwise, the resolved
* DOM node.
* @throws {Error} If the option is set, not `false`, and is not, or does not
* resolve to a node.
*/
}, {
key: "getReturnFocusNode",
value: function() {
var n = this.getNodeForOption("setReturnFocus", this.previouslyFocusedElement);
return n || (n === !1 ? !1 : this.previouslyFocusedElement);
}
/** Update the previously focused element with the currently focused element. */
}, {
key: "updatePreviousElement",
value: function() {
var n = this.getDocument();
n && (this.previouslyFocusedElement = n.activeElement);
}
}, {
key: "deactivateTrap",
value: function() {
!this.focusTrap || !this.focusTrap.active || this.focusTrap.deactivate({
// NOTE: we never let the trap return the focus since we do that ourselves
returnFocus: !1,
// we'll call this in our own post deactivate handler so make sure the trap doesn't
// do it prematurely
checkCanReturnFocus: null,
// let it call the user's original deactivate handler, if any, instead of
// our own which calls back into this function
onDeactivate: this.originalOptions.onDeactivate
// NOTE: for post deactivate, don't specify anything so that it calls the
// onPostDeactivate handler specified on `this.internalOptions`
// which will always be our own `handlePostDeactivate()` handler, which
// will finish things off by calling the user's provided onPostDeactivate
// handler, if any, at the right time
// onPostDeactivate: NOTHING
});
}
}, {
key: "handleClickOutsideDeactivates",
value: function(n) {
var o = typeof this.originalOptions.clickOutsideDeactivates == "function" ? this.originalOptions.clickOutsideDeactivates.call(null, n) : this.originalOptions.clickOutsideDeactivates;
return o && (this.outsideClick = {
target: n.target,
allowDeactivation: o
}), o;
}
}, {
key: "handleDeactivate",
value: function() {
this.originalOptions.onDeactivate && this.originalOptions.onDeactivate.call(null), this.deactivateTrap();
}
}, {
key: "handlePostDeactivate",
value: function() {
var n = this, o = function() {
var u = n.getReturnFocusNode(), i = !!// did the consumer allow it?
(n.originalOptions.returnFocusOnDeactivate && // can we actually focus the node?
u !== null && u !== void 0 && u.focus && // was there an outside click that allowed deactivation?
(!n.outsideClick || // did the consumer allow deactivation when the outside node was clicked?
n.outsideClick.allowDeactivation && // is the outside node NOT focusable (implying that it did NOT receive focus
// as a result of the click-through) -- in which case do NOT restore focus
// to `returnFocusNode` because focus should remain on the outside node
!Ad(n.outsideClick.target, n.internalOptions.tabbableOptions))), s = n.internalOptions.preventScroll, p = s === void 0 ? !1 : s;
i && u.focus({
preventScroll: p
}), n.originalOptions.onPostDeactivate && n.originalOptions.onPostDeactivate.call(null), n.outsideClick = null;
};
this.originalOptions.checkCanReturnFocus ? this.originalOptions.checkCanReturnFocus.call(null, this.getReturnFocusNode()).then(o, o) : o();
}
}, {
key: "setupFocusTrap",
value: function() {
if (this.focusTrap)
this.props.active && !this.focusTrap.active && (this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
else {
var n = this.focusTrapElements.some(Boolean);
n && (this.focusTrap = this.props._createFocusTrap(this.focusTrapElements, this.internalOptions), this.props.active && this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
}
}
}, {
key: "componentDidMount",
value: function() {
this.props.active && this.setupFocusTrap();
}
}, {
key: "componentDidUpdate",
value: function(n) {
if (this.focusTrap) {
n.containerElements !== this.props.containerElements && this.focusTrap.updateContainerElements(this.props.containerElements);
var o = !n.active && this.props.active, l = n.active && !this.props.active, u = !n.paused && this.props.paused, i = n.paused && !this.props.paused;
if (o && (this.updatePreviousElement(), this.focusTrap.activate()), l) {
this.deactivateTrap();
return;
}
u && this.focusTrap.pause(), i && this.focusTrap.unpause();
} else
n.containerElements !== this.props.containerElements && (this.focusTrapElements = this.props.containerElements), this.props.active && (this.updatePreviousElement(), this.setupFocusTrap());
}
}, {
key: "componentWillUnmount",
value: function() {
this.deactivateTrap();
}
}, {
key: "render",
value: function() {
var n = this, o = this.props.children ? Rt.Children.only(this.props.children) : void 0;
if (o) {
if (o.type && o.type === Rt.Fragment)
throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");
var l = function(s) {
var p = n.props.containerElements;
o && (typeof o.ref == "function" ? o.ref(s) : o.ref && (o.ref.current = s)), n.focusTrapElements = p || [s];
}, u = Rt.cloneElement(o, {
ref: l
});
return u;
}
return null;
}
}]), r;
}(Rt.Component), Ge = typeof Element > "u" ? Function : Element;
al.propTypes = {
active: S.bool,
paused: S.bool,
focusTrapOptions: S.shape({
document: S.object,
onActivate: S.func,
onPostActivate: S.func,
checkCanFocusTrap: S.func,
onDeactivate: S.func,
onPostDeactivate: S.func,
checkCanReturnFocus: S.func,
initialFocus: S.oneOfType([S.instanceOf(Ge), S.string, S.bool, S.func]),
fallbackFocus: S.oneOfType([
S.instanceOf(Ge),
S.string,
// NOTE: does not support `false` as value (or return value from function)
S.func
]),
escapeDeactivates: S.oneOfType([S.bool, S.func]),
clickOutsideDeactivates: S.oneOfType([S.bool, S.func]),
returnFocusOnDeactivate: S.bool,
setReturnFocus: S.oneOfType([S.instanceOf(Ge), S.string, S.bool, S.func]),
allowOutsideClick: S.oneOfType([S.bool, S.func]),
preventScroll: S.bool,
tabbableOptions: S.shape({
displayCheck: S.oneOf(["full", "non-zero-area", "none"]),
getShadowRoot: S.oneOfType([S.bool, S.func])
})
}),
containerElements: S.arrayOf(S.instanceOf(Ge)),
// DOM element ONLY
children: S.oneOfType([
S.element,
// React element
S.instanceOf(Ge)
// DOM element
])
// NOTE: _createFocusTrap is internal, for testing purposes only, so we don't
// specify it here. It's expected to be set to the function returned from
// require('focus-trap'), or one with a compatible interface.
};
al.defaultProps = {
active: !0,
paused: !1,
focusTrapOptions: {},
_createFocusTrap: Od
};
var Md = al;
const qS = /* @__PURE__ */ bu(Md);
var we = {}, nl = { exports: {} };
nl.exports;
(function(e) {
const r = (o = 0) => (l) => `\x1B[${38 + o};5;${l}m`, a = (o = 0) => (l, u, i) => `\x1B[${38 + o};2;${l};${u};${i}m`;
function n() {
const o = /* @__PURE__ */ new Map(), l = {
modifier: {
reset: [0, 0],
// 21 isn't widely supported and 22 does the same thing
bold: [1, 22],
dim: [2, 22],
italic: [3, 23],
underline: [4, 24],
overline: [53, 55],
inverse: [7, 27],
hidden: [8, 28],
strikethrough: [9, 29]
},
color: {
black: [30, 39],
red: [31, 39],
green: [32, 39],
yellow: [33, 39],
blue: [34, 39],
magenta: [35, 39],
cyan: [36, 39],
white: [37, 39],
// Bright color
blackBright: [90, 39],
redBright: [91, 39],
greenBright: [92, 39],
yellowBright: [93, 39],
blueBright: [94, 39],
magentaBright: [95, 39],
cyanBright: [96, 39],
whiteBright: [97, 39]
},
bgColor: {
bgBlack: [40, 49],
bgRed: [41, 49],
bgGreen: [42, 49],
bgYellow: [43, 49],
bgBlue: [44, 49],
bgMagenta: [45, 49],
bgCyan: [46, 49],
bgWhite: [47, 49],
// Bright color
bgBlackBright: [100, 49],
bgRedBright: [101, 49],
bgGreenBright: [102, 49],
bgYellowBright: [103, 49],
bgBlueBright: [104, 49],
bgMagentaBright: [105, 49],
bgCyanBright: [106, 49],
bgWhiteBright: [107, 49]
}
};
l.color.gray = l.color.blackBright, l.bgColor.bgGray = l.bgColor.bgBlackBright, l.color.grey = l.color.blackBright, l.bgColor.bgGrey = l.bgColor.bgBlackBright;
for (const [u, i] of Object.entries(l)) {
for (const [s, p] of Object.entries(i))
l[s] = {
open: `\x1B[${p[0]}m`,
close: `\x1B[${p[1]}m`
}, i[s] = l[s], o.set(p[0], p[1]);
Object.defineProperty(l, u, {
value: i,
enumerable: !1
});
}
return Object.defineProperty(l, "codes", {
value: o,
enumerable: !1
}), l.color.close = "\x1B[39m", l.bgColor.close = "\x1B[49m", l.color.ansi256 = r(), l.color.ansi16m = a(), l.bgColor.ansi256 = r(10), l.bgColor.ansi16m = a(10), Object.defineProperties(l, {
rgbToAnsi256: {
value: (u, i, s) => u === i && i === s ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(i / 255 * 5) + Math.round(s / 255 * 5),
enumerable: !1
},
hexToRgb: {
value: (u) => {
const i = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(u.toString(16));
if (!i)
return [0, 0, 0];
let { colorString: s } = i.groups;
s.length === 3 && (s = s.split("").map((f) => f + f).join(""));
const p = Number.parseInt(s, 16);
return [
p >> 16 & 255,
p >> 8 & 255,
p & 255
];
},
enumerable: !1
},
hexToAnsi256: {
value: (u) => l.rgbToAnsi256(...l.hexToRgb(u)),
enumerable: !1
}
}), l;
}
Object.defineProperty(e, "exports", {
enumerable: !0,
get: n
});
})(nl);
var $u = nl.exports, se = {};
Object.defineProperty(se, "__esModule", {
value: !0
});
se.printIteratorEntries = Nd;
se.printIteratorValues = Bd;
se.printListItems = kd;
se.printObjectProperties = Fd;
const Id = (e, t) => {
const r = Object.keys(e).sort(t);
return Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(e).forEach((a) => {
Object.getOwnPropertyDescriptor(e, a).enumerable && r.push(a);
}), r;
};
function Nd(e, t, r, a, n, o, l = ": ") {
let u = "", i = e.next();
if (!i.done) {
u += t.spacingOuter;
const s = r + t.indent;
for (; !i.done; ) {
const p = o(
i.value[0],
t,
s,
a,
n
), f = o(
i.value[1],
t,
s,
a,
n
);
u += s + p + l + f, i = e.next(), i.done ? t.min || (u += ",") : u += "," + t.spacingInner;
}
u += t.spacingOuter + r;
}
return u;
}
function Bd(e, t, r, a, n, o) {
let l = "", u = e.next();
if (!u.done) {
l += t.spacingOuter;
const i = r + t.indent;
for (; !u.done; )
l += i + o(u.value, t, i, a, n), u = e.next(), u.done ? t.min || (l += ",") : l += "," + t.spacingInner;
l += t.spacingOuter + r;
}
return l;
}
function kd(e, t, r, a, n, o) {
let l = "";
if (e.length) {
l += t.spacingOuter;
const u = r + t.indent;
for (let i = 0; i < e.length; i++)
l += u, i in e && (l += o(e[i], t, u, a, n)), i < e.length - 1 ? l += "," + t.spacingInner : t.min || (l += ",");
l += t.spacingOuter + r;
}
return l;
}
function Fd(e, t, r, a, n, o) {
let l = "";
const u = Id(e, t.compareKeys);
if (u.length) {
l += t.spacingOuter;
const i = r + t.indent;
for (let s = 0; s < u.length; s++) {
const p = u[s], f = o(p, t, i, a, n), m = o(e[p], t, i, a, n);
l += i + f + ": " + m, s < u.length - 1 ? l += "," + t.spacingInner : t.min || (l += ",");
}
l += t.spacingOuter + r;
}
return l;
}
var he = {};
Object.defineProperty(he, "__esModule", {
value: !0
});
he.test = he.serialize = he.default = void 0;
var Ml = se, Nt = function() {
return typeof globalThis < "u" ? globalThis : typeof Nt < "u" ? Nt : typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")();
}(), Wn = Nt["jest-symbol-do-not-touch"] || Nt.Symbol;
const Dd = typeof Wn == "function" && Wn.for ? Wn.for("jest.asymmetricMatcher") : 1267621, Et = " ", Au = (e, t, r, a, n, o) => {
const l = e.toString();
return l === "ArrayContaining" || l === "ArrayNotContaining" ? ++a > t.maxDepth ? "[" + l + "]" : l + Et + "[" + (0, Ml.printListItems)(
e.sample,
t,
r,
a,
n,
o
) + "]" : l === "ObjectContaining" || l === "ObjectNotContaining" ? ++a > t.maxDepth ? "[" + l + "]" : l + Et + "{" + (0, Ml.printObjectProperties)(
e.sample,
t,
r,
a,
n,
o
) + "}" : l === "StringMatching" || l === "StringNotMatching" || l === "StringContaining" || l === "StringNotContaining" ? l + Et + o(e.sample, t, r, a, n) : e.toAsymmetricMatcher();
};
he.serialize = Au;
const Mu = (e) => e && e.$$typeof === Dd;
he.test = Mu;
const Ld = {
serialize: Au,
test: Mu
};
var jd = Ld;
he.default = jd;
var ge = {}, Hd = ({ onlyFirst: e = !1 } = {}) => {
const t = [
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
].join("|");
return new RegExp(t, e ? void 0 : "g");
};
Object.defineProperty(ge, "__esModule", {
value: !0
});
ge.test = ge.serialize = ge.default = void 0;
var Iu = Nu(Hd), k = Nu($u);
function Nu(e) {
return e && e.__esModule ? e : { default: e };
}
const Ud = (e) => e.replace((0, Iu.default)(), (t) => {
switch (t) {
case k.default.red.close:
case k.default.green.close:
case k.default.cyan.close:
case k.default.gray.close:
case k.default.white.close:
case k.default.yellow.close:
case k.default.bgRed.close:
case k.default.bgGreen.close:
case k.default.bgYellow.close:
case k.default.inverse.close:
case k.default.dim.close:
case k.default.bold.close:
case k.default.reset.open:
case k.default.reset.close:
return "</>";
case k.default.red.open:
return "<red>";
case k.default.green.open:
return "<green>";
case k.default.cyan.open:
return "<cyan>";
case k.default.gray.open:
return "<gray>";
case k.default.white.open:
return "<white>";
case k.default.yellow.open:
return "<yellow>";
case k.default.bgRed.open:
return "<bgRed>";
case k.default.bgGreen.open:
return "<bgGreen>";
case k.default.bgYellow.open:
return "<bgYellow>";
case k.default.inverse.open:
return "<inverse>";
case k.default.dim.open:
return "<dim>";
case k.default.bold.open:
return "<bold>";
default:
return "";
}
}), Bu = (e) => typeof e == "string" && !!e.match((0, Iu.default)());
ge.test = Bu;
const ku = (e, t, r, a, n, o) => o(Ud(e), t, r, a, n);
ge.serialize = ku;
const Wd = {
serialize: ku,
test: Bu
};
var zd = Wd;
ge.default = zd;
var Re = {};
Object.defineProperty(Re, "__esModule", {
value: !0
});
Re.test = Re.serialize = Re.default = void 0;
var Il = se;
const Vd = " ", Fu = ["DOMStringMap", "NamedNodeMap"], Gd = /^(HTML\w*Collection|NodeList)$/, Kd = (e) => Fu.indexOf(e) !== -1 || Gd.test(e), Du = (e) => e && e.constructor && !!e.constructor.name && Kd(e.constructor.name);
Re.test = Du;
const Yd = (e) => e.constructor.name === "NamedNodeMap", Lu = (e, t, r, a, n, o) => {
const l = e.constructor.name;
return ++a > t.maxDepth ? "[" + l + "]" : (t.min ? "" : l + Vd) + (Fu.indexOf(l) !== -1 ? "{" + (0, Il.printObjectProperties)(
Yd(e) ? Array.from(e).reduce((u, i) => (u[i.name] = i.value, u), {}) : { ...e },
t,
r,
a,
n,
o
) + "}" : "[" + (0, Il.printListItems)(
Array.from(e),
t,
r,
a,
n,
o
) + "]");
};
Re.serialize = Lu;
const Xd = {
serialize: Lu,
test: Du
};
var Jd = Xd;
Re.default = Jd;
var Ee = {}, U = {}, ol = {};
Object.defineProperty(ol, "__esModule", {
value: !0
});
ol.default = Qd;
function Qd(e) {
return e.replace(/</g, "<").replace(/>/g, ">");
}
Object.defineProperty(U, "__esModule", {
value: !0
});
U.printText = U.printProps = U.printElementAsLeaf = U.printElement = U.printComment = U.printChildren = void 0;
var ju = Zd(ol);
function Zd(e) {
return e && e.__esModule ? e : { default: e };
}
const ef = (e, t, r, a, n, o, l) => {
const u = a + r.indent, i = r.colors;
return e.map((s) => {
const p = t[s];
let f = l(p, r, u, n, o);
return typeof p != "string" && (f.indexOf(`
`) !== -1 && (f = r.spacingOuter + u + f + r.spacingOuter + a), f = "{" + f + "}"), r.spacingInner + a + i.prop.open + s + i.prop.close + "=" + i.value.open + f + i.value.close;
}).join("");
};
U.printProps = ef;
const tf = (e, t, r, a, n, o) => e.map(
(l) => t.spacingOuter + r + (typeof l == "string" ? Hu(l, t) : o(l, t, r, a, n))
).join("");
U.printChildren = tf;
const Hu = (e, t) => {
const r = t.colors.content;
return r.open + (0, ju.default)(e) + r.close;
};
U.printText = Hu;
const rf = (e, t) => {
const r = t.colors.comment;
return r.open + "<!--" + (0, ju.default)(e) + "-->" + r.close;
};
U.printComment = rf;
const af = (e, t, r, a, n) => {
const o = a.colors.tag;
return o.open + "<" + e + (t && o.close + t + a.spacingOuter + n + o.open) + (r ? ">" + o.close + r + a.spacingOuter + n + o.open + "</" + e : (t && !a.min ? "" : " ") + "/") + ">" + o.close;
};
U.printElement = af;
const nf = (e, t) => {
const r = t.colors.tag;
return r.open + "<" + e + r.close + " …" + r.open + " />" + r.close;
};
U.printElementAsLeaf = nf;
Object.defineProperty(Ee, "__esModule", {
value: !0
});
Ee.test = Ee.serialize = Ee.default = void 0;
var Ne = U;
const of = 1, Uu = 3, Wu = 8, zu = 11, lf = /^((HTML|SVG)\w*)?Element$/, uf = (e) => {
try {
return typeof e.hasAttribute == "function" && e.hasAttribute("is");
} catch {
return !1;
}
}, sf = (e) => {
const t = e.constructor.name, { nodeType: r, tagName: a } = e, n = typeof a == "string" && a.includes("-") || uf(e);
return r === of && (lf.test(t) || n) || r === Uu && t === "Text" || r === Wu && t === "Comment" || r === zu && t === "DocumentFragment";
}, Vu = (e) => {
var t;
return (e == null || (t = e.constructor) === null || t === void 0 ? void 0 : t.name) && sf(e);
};
Ee.test = Vu;
function cf(e) {
return e.nodeType === Uu;
}
function df(e) {
return e.nodeType === Wu;
}
function zn(e) {
return e.nodeType === zu;
}
const Gu = (e, t, r, a, n, o) => {
if (cf(e))
return (0, Ne.printText)(e.data, t);
if (df(e))
return (0, Ne.printComment)(e.data, t);
const l = zn(e) ? "DocumentFragment" : e.tagName.toLowerCase();
return ++a > t.maxDepth ? (0, Ne.printElementAsLeaf)(l, t) : (0, Ne.printElement)(
l,
(0, Ne.printProps)(
zn(e) ? [] : Array.from(e.attributes).map((u) => u.name).sort(),
zn(e) ? {} : Array.from(e.attributes).reduce((u, i) => (u[i.name] = i.value, u), {}),
t,
r + t.indent,
a,
n,
o
),
(0, Ne.printChildren)(
Array.prototype.slice.call(e.childNodes || e.children),
t,
r + t.indent,
a,
n,
o
),
t,
r
);
};
Ee.serialize = Gu;
const ff = {
serialize: Gu,
test: Vu
};
var pf = ff;
Ee.default = pf;
var Ce = {};
Object.defineProperty(Ce, "__esModule", {
value: !0
});
Ce.test = Ce.serialize = Ce.default = void 0;
var nt = se;
const vf = "@@__IMMUTABLE_ITERABLE__@@", mf = "@@__IMMUTABLE_LIST__@@", bf = "@@__IMMUTABLE_KEYED__@@", yf = "@@__IMMUTABLE_MAP__@@", Nl = "@@__IMMUTABLE_ORDERED__@@", hf = "@@__IMMUTABLE_RECORD__@@", gf = "@@__IMMUTABLE_SEQ__@@", Rf = "@@__IMMUTABLE_SET__@@", Ef = "@@__IMMUTABLE_STACK__@@", Le = (e) => "Immutable." + e, Zt = (e) => "[" + e + "]", ot = " ", Bl = "…", Cf = (e, t, r, a, n, o, l) => ++a > t.maxDepth ? Zt(Le(l)) : Le(l) + ot + "{" + (0, nt.printIteratorEntries)(
e.entries(),
t,
r,
a,
n,
o
) + "}";
function _f(e) {
let t = 0;
return {
next() {
if (t < e._keys.length) {
const r = e._keys[t++];
return {
done: !1,
value: [r, e.get(r)]
};
}
return {
done: !0,
value: void 0
};
}
};
}
const Pf = (e, t, r, a, n, o) => {
const l = Le(e._name || "Record");
return ++a > t.maxDepth ? Zt(l) : l + ot + "{" + (0, nt.printIteratorEntries)(
_f(e),
t,
r,
a,
n,
o
) + "}";
}, wf = (e, t, r, a, n, o) => {
const l = Le("Seq");
return ++a > t.maxDepth ? Zt(l) : e[bf] ? l + ot + "{" + // from Immutable collection of entries or from ECMAScript object
(e._iter || e._object ? (0, nt.printIteratorEntries)(
e.entries(),
t,
r,
a,
n,
o
) : Bl) + "}" : l + ot + "[" + (e._iter || // from Immutable collection of values
e._array || // from ECMAScript array
e._collection || // from ECMAScript collection in immutable v4
e._iterable ? (0, nt.printIteratorValues)(
e.values(),
t,
r,
a,
n,
o
) : Bl) + "]";
}, Vn = (e, t, r, a, n, o, l) => ++a > t.maxDepth ? Zt(Le(l)) : Le(l) + ot + "[" + (0, nt.printIteratorValues)(
e.values(),
t,
r,
a,
n,
o
) + "]", Ku = (e, t, r, a, n, o) => e[yf] ? Cf(
e,
t,
r,
a,
n,
o,
e[Nl] ? "OrderedMap" : "Map"
) : e[mf] ? Vn(
e,
t,
r,
a,
n,
o,
"List"
) : e[Rf] ? Vn(
e,
t,
r,
a,
n,
o,
e[Nl] ? "OrderedSet" : "Set"
) : e[Ef] ? Vn(
e,
t,
r,
a,
n,
o,
"Stack"
) : e[gf] ? wf(e, t, r, a, n, o) : Pf(e, t, r, a, n, o);
Ce.serialize = Ku;
const Yu = (e) => e && (e[vf] === !0 || e[hf] === !0);
Ce.test = Yu;
const qf = {
serialize: Ku,
test: Yu
};
var Tf = qf;
Ce.default = Tf;
var _e = {}, Po = { exports: {} }, I = {};
/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var kl;
function Sf() {
if (kl)
return I;
kl = 1;
var e = 60103, t = 60106, r = 60107, a = 60108, n = 60114, o = 60109, l = 60110, u = 60112, i = 60113, s = 60120, p = 60115, f = 60116, m = 60121, C = 60122, w = 60117, P = 60129, x = 60131;
if (typeof Symbol == "function" && Symbol.for) {
var d = Symbol.for;
e = d("react.element"), t = d("react.portal"), r = d("react.fragment"), a = d("react.strict_mode"), n = d("react.profiler"), o = d("react.provider"), l = d("react.context"), u = d("react.forward_ref"), i = d("react.suspense"), s = d("react.suspense_list"), p = d("react.memo"), f = d("react.lazy"), m = d("react.block"), C = d("react.se