@stytch/nextjs 20.1.0 → 20.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/adminPortal/index.d.ts +12 -3
- package/dist/adminPortal/index.esm.d.ts +12 -3
- package/dist/adminPortal/index.esm.js +1195 -363
- package/dist/adminPortal/index.js +1195 -362
- package/dist/b2b/index.headless.d.ts +1 -1
- package/dist/b2b/index.headless.esm.d.ts +1 -1
- package/dist/b2b/index.ui.d.ts +1 -1
- package/dist/b2b/index.ui.esm.d.ts +1 -1
- package/dist/index.headless.d.ts +1 -1
- package/dist/index.headless.esm.d.ts +1 -1
- package/dist/index.ui.d.ts +1 -1
- package/dist/index.ui.esm.d.ts +1 -1
- package/package.json +3 -3
|
@@ -261,13 +261,13 @@ var B2BOAuthProviders;
|
|
|
261
261
|
B2BOAuthProviders["Google"] = "google";
|
|
262
262
|
B2BOAuthProviders["Microsoft"] = "microsoft";
|
|
263
263
|
})(B2BOAuthProviders || (B2BOAuthProviders = {}));
|
|
264
|
-
function _slicedToArray$
|
|
265
|
-
return _arrayWithHoles$
|
|
264
|
+
function _slicedToArray$3(arr, i) {
|
|
265
|
+
return _arrayWithHoles$3(arr) || _iterableToArrayLimit$3(arr, i) || _unsupportedIterableToArray$4(arr, i) || _nonIterableRest$3();
|
|
266
266
|
}
|
|
267
|
-
function _nonIterableRest$
|
|
267
|
+
function _nonIterableRest$3() {
|
|
268
268
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
269
269
|
}
|
|
270
|
-
function _iterableToArrayLimit$
|
|
270
|
+
function _iterableToArrayLimit$3(r, l) {
|
|
271
271
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
272
272
|
if (null != t) {
|
|
273
273
|
var e, n, i, u, a = [], f = !0, o = !1;
|
|
@@ -297,37 +297,37 @@ function _iterableToArrayLimit$2(r, l) {
|
|
|
297
297
|
return a;
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
|
-
function _arrayWithHoles$
|
|
300
|
+
function _arrayWithHoles$3(arr) {
|
|
301
301
|
if (Array.isArray(arr))
|
|
302
302
|
return arr;
|
|
303
303
|
}
|
|
304
|
-
function _unsupportedIterableToArray$
|
|
304
|
+
function _unsupportedIterableToArray$4(o, minLen) {
|
|
305
305
|
if (!o)
|
|
306
306
|
return;
|
|
307
307
|
if (typeof o === "string")
|
|
308
|
-
return _arrayLikeToArray$
|
|
308
|
+
return _arrayLikeToArray$4(o, minLen);
|
|
309
309
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
310
310
|
if (n === "Object" && o.constructor)
|
|
311
311
|
n = o.constructor.name;
|
|
312
312
|
if (n === "Map" || n === "Set")
|
|
313
313
|
return Array.from(o);
|
|
314
314
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
315
|
-
return _arrayLikeToArray$
|
|
315
|
+
return _arrayLikeToArray$4(o, minLen);
|
|
316
316
|
}
|
|
317
|
-
function _arrayLikeToArray$
|
|
317
|
+
function _arrayLikeToArray$4(arr, len) {
|
|
318
318
|
if (len == null || len > arr.length)
|
|
319
319
|
len = arr.length;
|
|
320
320
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
321
321
|
arr2[i] = arr[i];
|
|
322
322
|
return arr2;
|
|
323
323
|
}
|
|
324
|
-
function _typeof$
|
|
324
|
+
function _typeof$7(o) {
|
|
325
325
|
"@babel/helpers - typeof";
|
|
326
|
-
return _typeof$
|
|
326
|
+
return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
327
327
|
return typeof o;
|
|
328
328
|
} : function (o) {
|
|
329
329
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
330
|
-
}, _typeof$
|
|
330
|
+
}, _typeof$7(o);
|
|
331
331
|
}
|
|
332
332
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
333
333
|
var e = new Error(message);
|
|
@@ -362,20 +362,20 @@ Promise.resolve({
|
|
|
362
362
|
var createDeepEqual = function createDeepEqual() {
|
|
363
363
|
var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref8$KEYS_TO_EXCLUDE = _ref8.KEYS_TO_EXCLUDE, KEYS_TO_EXCLUDE = _ref8$KEYS_TO_EXCLUDE === void 0 ? [] : _ref8$KEYS_TO_EXCLUDE;
|
|
364
364
|
var deepEqual = function deepEqual(a, b) {
|
|
365
|
-
if (_typeof$
|
|
365
|
+
if (_typeof$7(a) !== _typeof$7(b))
|
|
366
366
|
return false;
|
|
367
367
|
if (a === null || b === null)
|
|
368
368
|
return a === b;
|
|
369
|
-
if (_typeof$
|
|
369
|
+
if (_typeof$7(a) === 'object') {
|
|
370
370
|
if (Object.keys(a).length !== Object.keys(b).length || Object.keys(a).some(function (k) {
|
|
371
371
|
return !(k in b);
|
|
372
372
|
}))
|
|
373
373
|
return false;
|
|
374
374
|
return Object.entries(a).filter(function (_ref9) {
|
|
375
|
-
var _ref10 = _slicedToArray$
|
|
375
|
+
var _ref10 = _slicedToArray$3(_ref9, 1), k = _ref10[0];
|
|
376
376
|
return !KEYS_TO_EXCLUDE.includes(k);
|
|
377
377
|
}).every(function (_ref11) {
|
|
378
|
-
var _ref12 = _slicedToArray$
|
|
378
|
+
var _ref12 = _slicedToArray$3(_ref11, 2), k = _ref12[0], v = _ref12[1];
|
|
379
379
|
return deepEqual(v, b[k]);
|
|
380
380
|
});
|
|
381
381
|
}
|
|
@@ -428,6 +428,11 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
428
428
|
var e = new Error(message);
|
|
429
429
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
430
430
|
};
|
|
431
|
+
var LOCAL_STORAGE_KEY_PREFIX = 'stytch_sdk_state_';
|
|
432
|
+
var getLocalStorageKey = function getLocalStorageKey(publicToken) {
|
|
433
|
+
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
434
|
+
return "".concat(LOCAL_STORAGE_KEY_PREFIX).concat(publicToken).concat(key ? "::".concat(key) : '');
|
|
435
|
+
};
|
|
431
436
|
var internalSymB2B = Symbol["for"]('stytch__internal_b2b');
|
|
432
437
|
var readB2BInternals = function readB2BInternals(obj) {
|
|
433
438
|
var casted = obj;
|
|
@@ -467,7 +472,7 @@ function _regeneratorRuntime$1() {
|
|
|
467
472
|
function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); }
|
|
468
473
|
function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) {
|
|
469
474
|
var u = c.arg, h = u.value;
|
|
470
|
-
return h && "object" == _typeof$
|
|
475
|
+
return h && "object" == _typeof$6(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); });
|
|
471
476
|
} a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); }
|
|
472
477
|
function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f)
|
|
473
478
|
throw new Error("Generator is already running"); if (o === s) {
|
|
@@ -520,7 +525,7 @@ function _regeneratorRuntime$1() {
|
|
|
520
525
|
return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; };
|
|
521
526
|
return i.next = i;
|
|
522
527
|
}
|
|
523
|
-
} throw new TypeError(_typeof$
|
|
528
|
+
} throw new TypeError(_typeof$6(e) + " is not iterable"); }
|
|
524
529
|
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e)
|
|
525
530
|
r.push(n); return r.reverse(), function next() { for (; r.length;) {
|
|
526
531
|
var t = r.pop();
|
|
@@ -577,7 +582,7 @@ function _regeneratorRuntime$1() {
|
|
|
577
582
|
} throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e;
|
|
578
583
|
}
|
|
579
584
|
function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) {
|
|
580
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray$
|
|
585
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
581
586
|
if (it)
|
|
582
587
|
o = it;
|
|
583
588
|
var i = 0;
|
|
@@ -608,18 +613,18 @@ else {
|
|
|
608
613
|
Promise.resolve(value).then(_next, _throw);
|
|
609
614
|
} }
|
|
610
615
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
611
|
-
function _slicedToArray$
|
|
612
|
-
function _nonIterableRest$
|
|
613
|
-
function _unsupportedIterableToArray$
|
|
616
|
+
function _slicedToArray$2(arr, i) { return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i) || _unsupportedIterableToArray$3(arr, i) || _nonIterableRest$2(); }
|
|
617
|
+
function _nonIterableRest$2() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
618
|
+
function _unsupportedIterableToArray$3(o, minLen) { if (!o)
|
|
614
619
|
return; if (typeof o === "string")
|
|
615
|
-
return _arrayLikeToArray$
|
|
620
|
+
return _arrayLikeToArray$3(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor)
|
|
616
621
|
n = o.constructor.name; if (n === "Map" || n === "Set")
|
|
617
622
|
return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
618
|
-
return _arrayLikeToArray$
|
|
619
|
-
function _arrayLikeToArray$
|
|
623
|
+
return _arrayLikeToArray$3(o, minLen); }
|
|
624
|
+
function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length)
|
|
620
625
|
len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
621
626
|
arr2[i] = arr[i]; return arr2; }
|
|
622
|
-
function _iterableToArrayLimit$
|
|
627
|
+
function _iterableToArrayLimit$2(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) {
|
|
623
628
|
var e, n, i, u, a = [], f = !0, o = !1;
|
|
624
629
|
try {
|
|
625
630
|
if (i = (t = t.call(r)).next, 0 === l) {
|
|
@@ -646,7 +651,7 @@ function _iterableToArrayLimit$1(r, l) { var t = null == r ? null : "undefined"
|
|
|
646
651
|
}
|
|
647
652
|
return a;
|
|
648
653
|
} }
|
|
649
|
-
function _arrayWithHoles$
|
|
654
|
+
function _arrayWithHoles$2(arr) { if (Array.isArray(arr))
|
|
650
655
|
return arr; }
|
|
651
656
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) {
|
|
652
657
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -654,9 +659,9 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
654
659
|
} return t; }
|
|
655
660
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) {
|
|
656
661
|
var t = null != arguments[r] ? arguments[r] : {};
|
|
657
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty$
|
|
662
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty$2(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); });
|
|
658
663
|
} return e; }
|
|
659
|
-
function _defineProperty$
|
|
664
|
+
function _defineProperty$2(obj, key, value) { key = _toPropertyKey$1(key); if (key in obj) {
|
|
660
665
|
Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
|
|
661
666
|
}
|
|
662
667
|
else {
|
|
@@ -676,16 +681,16 @@ function _defineProperties$2(target, props) { for (var i = 0; i < props.length;
|
|
|
676
681
|
function _createClass$2(Constructor, protoProps, staticProps) { if (protoProps)
|
|
677
682
|
_defineProperties$2(Constructor.prototype, protoProps); if (staticProps)
|
|
678
683
|
_defineProperties$2(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
679
|
-
function _toPropertyKey$1(t) { var i = _toPrimitive$1(t, "string"); return "symbol" == _typeof$
|
|
680
|
-
function _toPrimitive$1(t, r) { if ("object" != _typeof$
|
|
684
|
+
function _toPropertyKey$1(t) { var i = _toPrimitive$1(t, "string"); return "symbol" == _typeof$6(i) ? i : String(i); }
|
|
685
|
+
function _toPrimitive$1(t, r) { if ("object" != _typeof$6(t) || !t)
|
|
681
686
|
return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) {
|
|
682
687
|
var i = e.call(t, r || "default");
|
|
683
|
-
if ("object" != _typeof$
|
|
688
|
+
if ("object" != _typeof$6(i))
|
|
684
689
|
return i;
|
|
685
690
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
686
691
|
} return ("string" === r ? String : Number)(t); }
|
|
687
692
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
688
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof$
|
|
693
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof$6(call) === "object" || typeof call === "function")) {
|
|
689
694
|
return call;
|
|
690
695
|
}
|
|
691
696
|
else if (call !== void 0) {
|
|
@@ -720,9 +725,9 @@ catch (e) {
|
|
|
720
725
|
} }
|
|
721
726
|
function _setPrototypeOf$1(o, p) { _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$1(o, p); }
|
|
722
727
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
723
|
-
function _typeof$
|
|
728
|
+
function _typeof$6(o) {
|
|
724
729
|
"@babel/helpers - typeof";
|
|
725
|
-
return _typeof$
|
|
730
|
+
return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$6(o);
|
|
726
731
|
}
|
|
727
732
|
var n$3, l$4, u$3, i$1, o$1, r$4, f$3, e$4, c$3 = {}, s$1 = [], a$1 = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, h$5 = Array.isArray;
|
|
728
733
|
function v$4(n, l) {
|
|
@@ -1456,7 +1461,7 @@ function j$1(n, e) {
|
|
|
1456
1461
|
});
|
|
1457
1462
|
};
|
|
1458
1463
|
var z$3 = "undefined" != typeof Symbol && Symbol["for"] && Symbol["for"]("react.element") || 60103, B$2 = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, H$2 = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Z$1 = /[A-Z0-9]/g, Y$1 = "undefined" != typeof document, $$1 = function $$1(n) {
|
|
1459
|
-
return ("undefined" != typeof Symbol && "symbol" == _typeof$
|
|
1464
|
+
return ("undefined" != typeof Symbol && "symbol" == _typeof$6(Symbol()) ? /fil|che|rad/ : /fil|che|ra/).test(n);
|
|
1460
1465
|
};
|
|
1461
1466
|
function q$4(n, t, e) {
|
|
1462
1467
|
return null == t.__k && (t.textContent = ""), q$6(n, t), "function" == typeof e && e(), n ? n.__c : null;
|
|
@@ -1749,7 +1754,7 @@ if ("function" === typeof Symbol && Symbol["for"]) {
|
|
|
1749
1754
|
w$2 = x$2("react.legacy_hidden");
|
|
1750
1755
|
}
|
|
1751
1756
|
function y$1(a) {
|
|
1752
|
-
if ("object" === _typeof$
|
|
1757
|
+
if ("object" === _typeof$6(a) && null !== a) {
|
|
1753
1758
|
var t = a.$$typeof;
|
|
1754
1759
|
switch (t) {
|
|
1755
1760
|
case b$2:
|
|
@@ -1802,7 +1807,7 @@ reactIs_production_min$1.isContextProvider = function (a) {
|
|
|
1802
1807
|
return y$1(a) === g$2;
|
|
1803
1808
|
};
|
|
1804
1809
|
reactIs_production_min$1.isElement = function (a) {
|
|
1805
|
-
return "object" === _typeof$
|
|
1810
|
+
return "object" === _typeof$6(a) && null !== a && a.$$typeof === b$2;
|
|
1806
1811
|
};
|
|
1807
1812
|
reactIs_production_min$1.isForwardRef = function (a) {
|
|
1808
1813
|
return y$1(a) === k$3;
|
|
@@ -1829,7 +1834,7 @@ reactIs_production_min$1.isSuspense = function (a) {
|
|
|
1829
1834
|
return y$1(a) === l$2;
|
|
1830
1835
|
};
|
|
1831
1836
|
reactIs_production_min$1.isValidElementType = function (a) {
|
|
1832
|
-
return "string" === typeof a || "function" === typeof a || a === d$1 || a === f$1 || a === v$2 || a === e$2 || a === l$2 || a === m$2 || a === w$2 || "object" === _typeof$
|
|
1837
|
+
return "string" === typeof a || "function" === typeof a || a === d$1 || a === f$1 || a === v$2 || a === e$2 || a === l$2 || a === m$2 || a === w$2 || "object" === _typeof$6(a) && null !== a && (a.$$typeof === p$2 || a.$$typeof === n$2 || a.$$typeof === g$2 || a.$$typeof === h$3 || a.$$typeof === k$3 || a.$$typeof === u$1 || a.$$typeof === q$3 || a[0] === r$2) ? !0 : !1;
|
|
1833
1838
|
};
|
|
1834
1839
|
reactIs_production_min$1.typeOf = y$1;
|
|
1835
1840
|
{
|
|
@@ -1844,7 +1849,7 @@ var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
|
|
1844
1849
|
if (objA === objB) {
|
|
1845
1850
|
return true;
|
|
1846
1851
|
}
|
|
1847
|
-
if (_typeof$
|
|
1852
|
+
if (_typeof$6(objA) !== "object" || !objA || _typeof$6(objB) !== "object" || !objB) {
|
|
1848
1853
|
return false;
|
|
1849
1854
|
}
|
|
1850
1855
|
var keysA = Object.keys(objA);
|
|
@@ -2317,7 +2322,7 @@ function stylis_min(W) {
|
|
|
2317
2322
|
default:
|
|
2318
2323
|
if ('function' === typeof d)
|
|
2319
2324
|
S[A++] = d;
|
|
2320
|
-
else if ('object' === _typeof$
|
|
2325
|
+
else if ('object' === _typeof$6(d))
|
|
2321
2326
|
for (var c = 0, e = d.length; c < e; ++c) {
|
|
2322
2327
|
T(d[c]);
|
|
2323
2328
|
}
|
|
@@ -2418,7 +2423,7 @@ var reactIs$1 = {
|
|
|
2418
2423
|
var reactIs_production_min = {};
|
|
2419
2424
|
var b$1 = "function" === typeof Symbol && Symbol["for"], c = b$1 ? Symbol["for"]("react.element") : 60103, d = b$1 ? Symbol["for"]("react.portal") : 60106, e$1 = b$1 ? Symbol["for"]("react.fragment") : 60107, f = b$1 ? Symbol["for"]("react.strict_mode") : 60108, g$1 = b$1 ? Symbol["for"]("react.profiler") : 60114, h$1 = b$1 ? Symbol["for"]("react.provider") : 60109, k$2 = b$1 ? Symbol["for"]("react.context") : 60110, l$1 = b$1 ? Symbol["for"]("react.async_mode") : 60111, m$1 = b$1 ? Symbol["for"]("react.concurrent_mode") : 60111, n$1 = b$1 ? Symbol["for"]("react.forward_ref") : 60112, p$1 = b$1 ? Symbol["for"]("react.suspense") : 60113, q$2 = b$1 ? Symbol["for"]("react.suspense_list") : 60120, r$1 = b$1 ? Symbol["for"]("react.memo") : 60115, t$1 = b$1 ? Symbol["for"]("react.lazy") : 60116, v$1 = b$1 ? Symbol["for"]("react.block") : 60121, w$1 = b$1 ? Symbol["for"]("react.fundamental") : 60117, x$1 = b$1 ? Symbol["for"]("react.responder") : 60118, y = b$1 ? Symbol["for"]("react.scope") : 60119;
|
|
2420
2425
|
function z$1(a) {
|
|
2421
|
-
if ("object" === _typeof$
|
|
2426
|
+
if ("object" === _typeof$6(a) && null !== a) {
|
|
2422
2427
|
var u = a.$$typeof;
|
|
2423
2428
|
switch (u) {
|
|
2424
2429
|
case c:
|
|
@@ -2474,7 +2479,7 @@ reactIs_production_min.isContextProvider = function (a) {
|
|
|
2474
2479
|
return z$1(a) === h$1;
|
|
2475
2480
|
};
|
|
2476
2481
|
reactIs_production_min.isElement = function (a) {
|
|
2477
|
-
return "object" === _typeof$
|
|
2482
|
+
return "object" === _typeof$6(a) && null !== a && a.$$typeof === c;
|
|
2478
2483
|
};
|
|
2479
2484
|
reactIs_production_min.isForwardRef = function (a) {
|
|
2480
2485
|
return z$1(a) === n$1;
|
|
@@ -2501,7 +2506,7 @@ reactIs_production_min.isSuspense = function (a) {
|
|
|
2501
2506
|
return z$1(a) === p$1;
|
|
2502
2507
|
};
|
|
2503
2508
|
reactIs_production_min.isValidElementType = function (a) {
|
|
2504
|
-
return "string" === typeof a || "function" === typeof a || a === e$1 || a === m$1 || a === g$1 || a === f || a === p$1 || a === q$2 || "object" === _typeof$
|
|
2509
|
+
return "string" === typeof a || "function" === typeof a || a === e$1 || a === m$1 || a === g$1 || a === f || a === p$1 || a === q$2 || "object" === _typeof$6(a) && null !== a && (a.$$typeof === t$1 || a.$$typeof === r$1 || a.$$typeof === h$1 || a.$$typeof === k$2 || a.$$typeof === n$1 || a.$$typeof === w$1 || a.$$typeof === x$1 || a.$$typeof === y || a.$$typeof === v$1);
|
|
2505
2510
|
};
|
|
2506
2511
|
reactIs_production_min.typeOf = z$1;
|
|
2507
2512
|
{
|
|
@@ -2605,7 +2610,7 @@ var g = function g(e, t) {
|
|
|
2605
2610
|
n.push(t[r], e[r + 1]);
|
|
2606
2611
|
return n;
|
|
2607
2612
|
}, S = function S(t) {
|
|
2608
|
-
return null !== t && "object" == _typeof$
|
|
2613
|
+
return null !== t && "object" == _typeof$6(t) && "[object Object]" === (t.toString ? t.toString() : Object.prototype.toString.call(t)) && !reactIsExports$1.typeOf(t);
|
|
2609
2614
|
}, w = Object.freeze([]), E = Object.freeze({});
|
|
2610
2615
|
function b(e) {
|
|
2611
2616
|
return "function" == typeof e;
|
|
@@ -3027,7 +3032,7 @@ function ke(e) {
|
|
|
3027
3032
|
return "string" == typeof e && "production" === "production";
|
|
3028
3033
|
}
|
|
3029
3034
|
var Ve = function Ve(e) {
|
|
3030
|
-
return "function" == typeof e || "object" == _typeof$
|
|
3035
|
+
return "function" == typeof e || "object" == _typeof$6(e) && null !== e && !Array.isArray(e);
|
|
3031
3036
|
}, Be = function Be(e) {
|
|
3032
3037
|
return "__proto__" !== e && "constructor" !== e && "prototype" !== e;
|
|
3033
3038
|
};
|
|
@@ -3278,6 +3283,9 @@ function CreateSSRSafeWebComponent(ReactComponent, webComponentName) {
|
|
|
3278
3283
|
}
|
|
3279
3284
|
};
|
|
3280
3285
|
}
|
|
3286
|
+
var isTruthy = function isTruthy(value) {
|
|
3287
|
+
return Boolean(value);
|
|
3288
|
+
};
|
|
3281
3289
|
var lodash_merge = {
|
|
3282
3290
|
exports: {}
|
|
3283
3291
|
};
|
|
@@ -3295,8 +3303,8 @@ lodash_merge.exports;
|
|
|
3295
3303
|
var typedArrayTags = {};
|
|
3296
3304
|
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
3297
3305
|
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
3298
|
-
var freeGlobal = _typeof$
|
|
3299
|
-
var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof$
|
|
3306
|
+
var freeGlobal = _typeof$6(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
3307
|
+
var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof$6(self)) == 'object' && self && self.Object === Object && self;
|
|
3300
3308
|
var root = freeGlobal || freeSelf || Function('return this')();
|
|
3301
3309
|
var freeExports = exports && !exports.nodeType && exports;
|
|
3302
3310
|
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
@@ -3806,7 +3814,7 @@ lodash_merge.exports;
|
|
|
3806
3814
|
return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
|
|
3807
3815
|
}
|
|
3808
3816
|
function isIndex(value, length) {
|
|
3809
|
-
var type = _typeof$
|
|
3817
|
+
var type = _typeof$6(value);
|
|
3810
3818
|
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
3811
3819
|
return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
|
|
3812
3820
|
}
|
|
@@ -3814,14 +3822,14 @@ lodash_merge.exports;
|
|
|
3814
3822
|
if (!isObject(object)) {
|
|
3815
3823
|
return false;
|
|
3816
3824
|
}
|
|
3817
|
-
var type = _typeof$
|
|
3825
|
+
var type = _typeof$6(index);
|
|
3818
3826
|
if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) {
|
|
3819
3827
|
return eq(object[index], value);
|
|
3820
3828
|
}
|
|
3821
3829
|
return false;
|
|
3822
3830
|
}
|
|
3823
3831
|
function isKeyable(value) {
|
|
3824
|
-
var type = _typeof$
|
|
3832
|
+
var type = _typeof$6(value);
|
|
3825
3833
|
return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
|
|
3826
3834
|
}
|
|
3827
3835
|
function isMasked(func) {
|
|
@@ -3925,11 +3933,11 @@ lodash_merge.exports;
|
|
|
3925
3933
|
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
3926
3934
|
}
|
|
3927
3935
|
function isObject(value) {
|
|
3928
|
-
var type = _typeof$
|
|
3936
|
+
var type = _typeof$6(value);
|
|
3929
3937
|
return value != null && (type == 'object' || type == 'function');
|
|
3930
3938
|
}
|
|
3931
3939
|
function isObjectLike(value) {
|
|
3932
|
-
return value != null && _typeof$
|
|
3940
|
+
return value != null && _typeof$6(value) == 'object';
|
|
3933
3941
|
}
|
|
3934
3942
|
function isPlainObject(value) {
|
|
3935
3943
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
@@ -4040,10 +4048,10 @@ var mergeObjects = function mergeObjects(a, b) {
|
|
|
4040
4048
|
return _objectSpread(_objectSpread({}, a), b);
|
|
4041
4049
|
};
|
|
4042
4050
|
var STR_UNDEFINED = 'undefined';
|
|
4043
|
-
var isWindowDefined = (typeof window === "undefined" ? "undefined" : _typeof$
|
|
4044
|
-
var isDocumentDefined = (typeof document === "undefined" ? "undefined" : _typeof$
|
|
4051
|
+
var isWindowDefined = (typeof window === "undefined" ? "undefined" : _typeof$6(window)) != STR_UNDEFINED;
|
|
4052
|
+
var isDocumentDefined = (typeof document === "undefined" ? "undefined" : _typeof$6(document)) != STR_UNDEFINED;
|
|
4045
4053
|
var hasRequestAnimationFrame = function hasRequestAnimationFrame() {
|
|
4046
|
-
return isWindowDefined && _typeof$
|
|
4054
|
+
return isWindowDefined && _typeof$6(window['requestAnimationFrame']) != STR_UNDEFINED;
|
|
4047
4055
|
};
|
|
4048
4056
|
var createCacheHelper = function createCacheHelper(cache, key) {
|
|
4049
4057
|
var state = SWRGlobalState.get(cache);
|
|
@@ -4068,7 +4076,7 @@ var createCacheHelper = function createCacheHelper(cache, key) {
|
|
|
4068
4076
|
var table = new WeakMap();
|
|
4069
4077
|
var counter = 0;
|
|
4070
4078
|
var stableHash = function stableHash(arg) {
|
|
4071
|
-
var type = _typeof$
|
|
4079
|
+
var type = _typeof$6(arg);
|
|
4072
4080
|
var constructor = arg && arg.constructor;
|
|
4073
4081
|
var isDate = constructor == Date;
|
|
4074
4082
|
var result;
|
|
@@ -4106,7 +4114,7 @@ var online = true;
|
|
|
4106
4114
|
var isOnline = function isOnline() {
|
|
4107
4115
|
return online;
|
|
4108
4116
|
};
|
|
4109
|
-
var _ref$
|
|
4117
|
+
var _ref$4 = isWindowDefined && window.addEventListener ? [window.addEventListener.bind(window), window.removeEventListener.bind(window)] : [noop$2, noop$2], _ref2$3 = _slicedToArray$2(_ref$4, 2), onWindowEvent = _ref2$3[0], offWindowEvent = _ref2$3[1];
|
|
4110
4118
|
var isVisible = function isVisible() {
|
|
4111
4119
|
var visibilityState = isDocumentDefined && document.visibilityState;
|
|
4112
4120
|
return isUndefined(visibilityState) || visibilityState !== 'hidden';
|
|
@@ -4199,15 +4207,15 @@ function _internalMutate() {
|
|
|
4199
4207
|
while (1)
|
|
4200
4208
|
switch (_context2.prev = _context2.next) {
|
|
4201
4209
|
case 0:
|
|
4202
|
-
_serialize3 = serialize(_k), _serialize4 = _slicedToArray$
|
|
4210
|
+
_serialize3 = serialize(_k), _serialize4 = _slicedToArray$2(_serialize3, 1), key = _serialize4[0];
|
|
4203
4211
|
if (key) {
|
|
4204
4212
|
_context2.next = 3;
|
|
4205
4213
|
break;
|
|
4206
4214
|
}
|
|
4207
4215
|
return _context2.abrupt("return");
|
|
4208
4216
|
case 3:
|
|
4209
|
-
_createCacheHelper3 = createCacheHelper(cache, key), _createCacheHelper4 = _slicedToArray$
|
|
4210
|
-
_SWRGlobalState$get5 = SWRGlobalState.get(cache), _SWRGlobalState$get6 = _slicedToArray$
|
|
4217
|
+
_createCacheHelper3 = createCacheHelper(cache, key), _createCacheHelper4 = _slicedToArray$2(_createCacheHelper3, 2), get = _createCacheHelper4[0], set = _createCacheHelper4[1];
|
|
4218
|
+
_SWRGlobalState$get5 = SWRGlobalState.get(cache), _SWRGlobalState$get6 = _slicedToArray$2(_SWRGlobalState$get5, 3), EVENT_REVALIDATORS = _SWRGlobalState$get6[0], MUTATION = _SWRGlobalState$get6[1], FETCH = _SWRGlobalState$get6[2];
|
|
4211
4219
|
revalidators = EVENT_REVALIDATORS[key];
|
|
4212
4220
|
startRevalidate = function startRevalidate() {
|
|
4213
4221
|
if (revalidate) {
|
|
@@ -4436,7 +4444,7 @@ var onErrorRetry = function onErrorRetry(_, __, config, revalidate, opts) {
|
|
|
4436
4444
|
var compare = function compare(currentData, newData) {
|
|
4437
4445
|
return stableHash(currentData) == stableHash(newData);
|
|
4438
4446
|
};
|
|
4439
|
-
var _initCache = initCache(new Map()), _initCache2 = _slicedToArray$
|
|
4447
|
+
var _initCache = initCache(new Map()), _initCache2 = _slicedToArray$2(_initCache, 2), cache$3 = _initCache2[0], mutate = _initCache2[1];
|
|
4440
4448
|
var defaultConfig = mergeObjects({
|
|
4441
4449
|
onLoadingSlow: noop$2,
|
|
4442
4450
|
onSuccess: noop$2,
|
|
@@ -4491,7 +4499,7 @@ var middleware = function middleware(useSWRNext) {
|
|
|
4491
4499
|
return function (key_, fetcher_, config) {
|
|
4492
4500
|
var fetcher = fetcher_ && function () {
|
|
4493
4501
|
var key = serialize(key_)[0];
|
|
4494
|
-
var _SWRGlobalState$get = SWRGlobalState.get(cache$3), _SWRGlobalState$get2 = _slicedToArray$
|
|
4502
|
+
var _SWRGlobalState$get = SWRGlobalState.get(cache$3), _SWRGlobalState$get2 = _slicedToArray$2(_SWRGlobalState$get, 4), PRELOAD = _SWRGlobalState$get2[3];
|
|
4495
4503
|
var req = PRELOAD[key];
|
|
4496
4504
|
if (req) {
|
|
4497
4505
|
delete PRELOAD[key];
|
|
@@ -4509,7 +4517,7 @@ var withArgs = function withArgs(hook) {
|
|
|
4509
4517
|
for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
|
|
4510
4518
|
args[_key3] = arguments[_key3];
|
|
4511
4519
|
}
|
|
4512
|
-
var _normalize = normalize(args), _normalize2 = _slicedToArray$
|
|
4520
|
+
var _normalize = normalize(args), _normalize2 = _slicedToArray$2(_normalize, 3), key = _normalize2[0], fn = _normalize2[1], _config = _normalize2[2];
|
|
4513
4521
|
var config = mergeConfigs(fallbackConfig, _config);
|
|
4514
4522
|
var next = hook;
|
|
4515
4523
|
var use = config.use;
|
|
@@ -4537,8 +4545,8 @@ var WITH_DEDUPE = {
|
|
|
4537
4545
|
};
|
|
4538
4546
|
var useSWRHandler = function useSWRHandler(_key, fetcher, config) {
|
|
4539
4547
|
var cache = config.cache, compare = config.compare, suspense = config.suspense, fallbackData = config.fallbackData, revalidateOnMount = config.revalidateOnMount, revalidateIfStale = config.revalidateIfStale, refreshInterval = config.refreshInterval, refreshWhenHidden = config.refreshWhenHidden, refreshWhenOffline = config.refreshWhenOffline, keepPreviousData = config.keepPreviousData;
|
|
4540
|
-
var _SWRGlobalState$get3 = SWRGlobalState.get(cache), _SWRGlobalState$get4 = _slicedToArray$
|
|
4541
|
-
var _serialize = serialize(_key), _serialize2 = _slicedToArray$
|
|
4548
|
+
var _SWRGlobalState$get3 = SWRGlobalState.get(cache), _SWRGlobalState$get4 = _slicedToArray$2(_SWRGlobalState$get3, 3), EVENT_REVALIDATORS = _SWRGlobalState$get4[0], MUTATION = _SWRGlobalState$get4[1], FETCH = _SWRGlobalState$get4[2];
|
|
4549
|
+
var _serialize = serialize(_key), _serialize2 = _slicedToArray$2(_serialize, 2), key = _serialize2[0], fnArg = _serialize2[1];
|
|
4542
4550
|
var initialMountedRef = _$1(false);
|
|
4543
4551
|
var unmountedRef = _$1(false);
|
|
4544
4552
|
var keyRef = _$1(key);
|
|
@@ -4550,7 +4558,7 @@ var useSWRHandler = function useSWRHandler(_key, fetcher, config) {
|
|
|
4550
4558
|
var isActive = function isActive() {
|
|
4551
4559
|
return getConfig().isVisible() && getConfig().isOnline();
|
|
4552
4560
|
};
|
|
4553
|
-
var _createCacheHelper = createCacheHelper(cache, key), _createCacheHelper2 = _slicedToArray$
|
|
4561
|
+
var _createCacheHelper = createCacheHelper(cache, key), _createCacheHelper2 = _slicedToArray$2(_createCacheHelper, 4), getCache = _createCacheHelper2[0], setCache = _createCacheHelper2[1], subscribeCache = _createCacheHelper2[2], getInitialCache = _createCacheHelper2[3];
|
|
4554
4562
|
var stateDependencies = _$1({}).current;
|
|
4555
4563
|
var fallback = isUndefined(fallbackData) ? config.fallback[key] : fallbackData;
|
|
4556
4564
|
var isEqual = function isEqual(prev, current) {
|
|
@@ -4697,7 +4705,7 @@ var useSWRHandler = function useSWRHandler(_key, fetcher, config) {
|
|
|
4697
4705
|
}
|
|
4698
4706
|
FETCH[key] = [currentFetcher(fnArg), getTimestamp()];
|
|
4699
4707
|
}
|
|
4700
|
-
_FETCH$key = _slicedToArray$
|
|
4708
|
+
_FETCH$key = _slicedToArray$2(FETCH[key], 2);
|
|
4701
4709
|
newData = _FETCH$key[0];
|
|
4702
4710
|
startAt = _FETCH$key[1];
|
|
4703
4711
|
_context.next = 19;
|
|
@@ -4896,7 +4904,7 @@ var useSWRHandler = function useSWRHandler(_key, fetcher, config) {
|
|
|
4896
4904
|
};
|
|
4897
4905
|
var useSWR = withArgs(useSWRHandler);
|
|
4898
4906
|
var extractErrorMessage = function extractErrorMessage(error) {
|
|
4899
|
-
if (error && _typeof$
|
|
4907
|
+
if (error && _typeof$6(error) === 'object') {
|
|
4900
4908
|
if ('error_message' in error && typeof error.error_message === 'string') {
|
|
4901
4909
|
return error.error_message;
|
|
4902
4910
|
}
|
|
@@ -4906,6 +4914,10 @@ var extractErrorMessage = function extractErrorMessage(error) {
|
|
|
4906
4914
|
}
|
|
4907
4915
|
};
|
|
4908
4916
|
|
|
4917
|
+
var _templateObject;
|
|
4918
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) {
|
|
4919
|
+
raw = strings.slice(0);
|
|
4920
|
+
} return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
4909
4921
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) {
|
|
4910
4922
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray2(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
4911
4923
|
if (it)
|
|
@@ -5155,11 +5167,11 @@ function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : func
|
|
|
5155
5167
|
}
|
|
5156
5168
|
}
|
|
5157
5169
|
} return target; }; return _extends$5.apply(this, arguments); }
|
|
5158
|
-
function _typeof$
|
|
5170
|
+
function _typeof$5(o) {
|
|
5159
5171
|
"@babel/helpers - typeof";
|
|
5160
|
-
return _typeof$
|
|
5172
|
+
return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$5(o);
|
|
5161
5173
|
}
|
|
5162
|
-
function isPlainObject(item) { return item && _typeof$
|
|
5174
|
+
function isPlainObject(item) { return item && _typeof$5(item) === 'object' && item.constructor === Object; }
|
|
5163
5175
|
function deepmerge(target, source) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { clone: true }; var output = options.clone ? _extends$5({}, target) : target; if (isPlainObject(target) && isPlainObject(source)) {
|
|
5164
5176
|
Object.keys(source).forEach(function (key) { if (key === '__proto__') {
|
|
5165
5177
|
return;
|
|
@@ -5217,19 +5229,19 @@ else if (color.type.indexOf('rgb') !== -1) {
|
|
|
5217
5229
|
color.values[i] += (255 - color.values[i]) * coefficient;
|
|
5218
5230
|
}
|
|
5219
5231
|
} return recomposeColor(color); }
|
|
5220
|
-
function _typeof$
|
|
5232
|
+
function _typeof$4(o) {
|
|
5221
5233
|
"@babel/helpers - typeof";
|
|
5222
|
-
return _typeof$
|
|
5234
|
+
return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$4(o);
|
|
5223
5235
|
}
|
|
5224
|
-
function toPrimitive$
|
|
5236
|
+
function toPrimitive$2(t, r) { if ("object" != _typeof$4(t) || !t)
|
|
5225
5237
|
return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) {
|
|
5226
5238
|
var i = e.call(t, r || "default");
|
|
5227
|
-
if ("object" != _typeof$
|
|
5239
|
+
if ("object" != _typeof$4(i))
|
|
5228
5240
|
return i;
|
|
5229
5241
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
5230
5242
|
} return ("string" === r ? String : Number)(t); }
|
|
5231
|
-
function toPropertyKey$
|
|
5232
|
-
function _defineProperty(obj, key, value) { key = toPropertyKey$
|
|
5243
|
+
function toPropertyKey$2(t) { var i = toPrimitive$2(t, "string"); return "symbol" == _typeof$4(i) ? i : i + ""; }
|
|
5244
|
+
function _defineProperty$1(obj, key, value) { key = toPropertyKey$2(key); if (key in obj) {
|
|
5233
5245
|
Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
|
|
5234
5246
|
}
|
|
5235
5247
|
else {
|
|
@@ -5268,7 +5280,7 @@ function createBreakpoints(breakpoints) { var _breakpoints$values = breakpoints.
|
|
|
5268
5280
|
} var value = typeof upperbound === 'number' && endIndex > 0 ? upperbound : key; return "@media (max-width:".concat(value - step / 100).concat(unit, ")"); } function between(start, end) { var endIndex = keys.indexOf(end); if (endIndex === keys.length - 1) {
|
|
5269
5281
|
return up(start);
|
|
5270
5282
|
} return "@media (min-width:".concat(typeof values[start] === 'number' ? values[start] : start).concat(unit, ") and ") + "(max-width:".concat((endIndex !== -1 && typeof values[keys[endIndex + 1]] === 'number' ? values[keys[endIndex + 1]] : end) - step / 100).concat(unit, ")"); } function only(key) { return between(key, key); } function width(key) { return values[key]; } return _extends$4({ keys: keys, values: values, up: up, down: down, between: between, only: only, width: width }, other); }
|
|
5271
|
-
function createMixins(breakpoints, spacing, mixins) { var _toolbar; return _extends$4({ gutters: function gutters() { var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; console.warn(['Material-UI: theme.mixins.gutters() is deprecated.', 'You can use the source of the mixin directly:', "\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join('\n')); return _extends$4({ paddingLeft: spacing(2), paddingRight: spacing(2) }, styles, _defineProperty({}, breakpoints.up('sm'), _extends$4({ paddingLeft: spacing(3), paddingRight: spacing(3) }, styles[breakpoints.up('sm')]))); }, toolbar: (_toolbar = { minHeight: 56 }, _defineProperty(_toolbar, "".concat(breakpoints.up('xs'), " and (orientation: landscape)"), { minHeight: 48 }), _defineProperty(_toolbar, breakpoints.up('sm'), { minHeight: 64 }), _toolbar) }, mixins); }
|
|
5283
|
+
function createMixins(breakpoints, spacing, mixins) { var _toolbar; return _extends$4({ gutters: function gutters() { var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; console.warn(['Material-UI: theme.mixins.gutters() is deprecated.', 'You can use the source of the mixin directly:', "\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join('\n')); return _extends$4({ paddingLeft: spacing(2), paddingRight: spacing(2) }, styles, _defineProperty$1({}, breakpoints.up('sm'), _extends$4({ paddingLeft: spacing(3), paddingRight: spacing(3) }, styles[breakpoints.up('sm')]))); }, toolbar: (_toolbar = { minHeight: 56 }, _defineProperty$1(_toolbar, "".concat(breakpoints.up('xs'), " and (orientation: landscape)"), { minHeight: 48 }), _defineProperty$1(_toolbar, breakpoints.up('sm'), { minHeight: 64 }), _toolbar) }, mixins); }
|
|
5272
5284
|
var light = { text: { primary: 'rgba(0, 0, 0, 0.87)', secondary: 'rgba(0, 0, 0, 0.54)', disabled: 'rgba(0, 0, 0, 0.38)', hint: 'rgba(0, 0, 0, 0.38)' }, divider: 'rgba(0, 0, 0, 0.12)', background: { paper: common.white, "default": grey[50] }, action: { active: 'rgba(0, 0, 0, 0.54)', hover: 'rgba(0, 0, 0, 0.04)', hoverOpacity: 0.04, selected: 'rgba(0, 0, 0, 0.08)', selectedOpacity: 0.08, disabled: 'rgba(0, 0, 0, 0.26)', disabledBackground: 'rgba(0, 0, 0, 0.12)', disabledOpacity: 0.38, focus: 'rgba(0, 0, 0, 0.12)', focusOpacity: 0.12, activatedOpacity: 0.12 } };
|
|
5273
5285
|
var dark = { text: { primary: common.white, secondary: 'rgba(255, 255, 255, 0.7)', disabled: 'rgba(255, 255, 255, 0.5)', hint: 'rgba(255, 255, 255, 0.5)', icon: 'rgba(255, 255, 255, 0.5)' }, divider: 'rgba(255, 255, 255, 0.12)', background: { paper: grey[800], "default": '#303030' }, action: { active: common.white, hover: 'rgba(255, 255, 255, 0.08)', hoverOpacity: 0.08, selected: 'rgba(255, 255, 255, 0.16)', selectedOpacity: 0.16, disabled: 'rgba(255, 255, 255, 0.3)', disabledBackground: 'rgba(255, 255, 255, 0.12)', disabledOpacity: 0.38, focus: 'rgba(255, 255, 255, 0.12)', focusOpacity: 0.12, activatedOpacity: 0.24 } };
|
|
5274
5286
|
function addLightOrDark(intent, direction, shade, tonalOffset) { var tonalOffsetLight = tonalOffset.light || tonalOffset; var tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5; if (!intent[direction]) {
|
|
@@ -5360,27 +5372,27 @@ function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : func
|
|
|
5360
5372
|
}
|
|
5361
5373
|
}
|
|
5362
5374
|
} return target; }; return _extends$3.apply(this, arguments); }
|
|
5363
|
-
var _typeof$
|
|
5364
|
-
var isBrowser$1 = (typeof window === "undefined" ? "undefined" : _typeof$
|
|
5365
|
-
function _typeof$
|
|
5375
|
+
var _typeof$3 = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { return _typeof2(obj); } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); };
|
|
5376
|
+
var isBrowser$1 = (typeof window === "undefined" ? "undefined" : _typeof$3(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof$3(document)) === 'object' && document.nodeType === 9;
|
|
5377
|
+
function _typeof$2(o) {
|
|
5366
5378
|
"@babel/helpers - typeof";
|
|
5367
|
-
return _typeof$
|
|
5379
|
+
return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$2(o);
|
|
5368
5380
|
}
|
|
5369
|
-
function toPrimitive(t, r) { if ("object" != _typeof$
|
|
5381
|
+
function toPrimitive$1(t, r) { if ("object" != _typeof$2(t) || !t)
|
|
5370
5382
|
return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) {
|
|
5371
5383
|
var i = e.call(t, r);
|
|
5372
|
-
if ("object" != _typeof$
|
|
5384
|
+
if ("object" != _typeof$2(i))
|
|
5373
5385
|
return i;
|
|
5374
5386
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
5375
5387
|
} return String(t); }
|
|
5376
|
-
function toPropertyKey(t) { var i = toPrimitive(t, "string"); return "symbol" == _typeof$
|
|
5388
|
+
function toPropertyKey$1(t) { var i = toPrimitive$1(t, "string"); return "symbol" == _typeof$2(i) ? i : String(i); }
|
|
5377
5389
|
function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) {
|
|
5378
5390
|
var descriptor = props[i];
|
|
5379
5391
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
5380
5392
|
descriptor.configurable = true;
|
|
5381
5393
|
if ("value" in descriptor)
|
|
5382
5394
|
descriptor.writable = true;
|
|
5383
|
-
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
|
5395
|
+
Object.defineProperty(target, toPropertyKey$1(descriptor.key), descriptor);
|
|
5384
5396
|
} }
|
|
5385
5397
|
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps)
|
|
5386
5398
|
_defineProperties$1(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -6137,21 +6149,21 @@ function defaultUnit(options) { if (options === void 0) {
|
|
|
6137
6149
|
return style; for (var prop in style) {
|
|
6138
6150
|
style[prop] = iterate(prop, style[prop], camelCasedOptions);
|
|
6139
6151
|
} return style; } function onChangeValue(value, prop) { return iterate(prop, value, camelCasedOptions); } return { onProcessStyle: onProcessStyle, onChangeValue: onChangeValue }; }
|
|
6140
|
-
function _arrayLikeToArray$
|
|
6152
|
+
function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length)
|
|
6141
6153
|
len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
6142
6154
|
arr2[i] = arr[i]; return arr2; }
|
|
6143
6155
|
function _arrayWithoutHoles$1(arr) { if (Array.isArray(arr))
|
|
6144
|
-
return _arrayLikeToArray$
|
|
6156
|
+
return _arrayLikeToArray$2(arr); }
|
|
6145
6157
|
function _iterableToArray$1(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
6146
6158
|
return Array.from(iter); }
|
|
6147
|
-
function _unsupportedIterableToArray$
|
|
6159
|
+
function _unsupportedIterableToArray$2(o, minLen) { if (!o)
|
|
6148
6160
|
return; if (typeof o === "string")
|
|
6149
|
-
return _arrayLikeToArray$
|
|
6161
|
+
return _arrayLikeToArray$2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor)
|
|
6150
6162
|
n = o.constructor.name; if (n === "Map" || n === "Set")
|
|
6151
6163
|
return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
6152
|
-
return _arrayLikeToArray$
|
|
6164
|
+
return _arrayLikeToArray$2(o, minLen); }
|
|
6153
6165
|
function _nonIterableSpread$1() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6154
|
-
function _toConsumableArray$1(arr) { return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$
|
|
6166
|
+
function _toConsumableArray$1(arr) { return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$2(arr) || _nonIterableSpread$1(); }
|
|
6155
6167
|
var js = '';
|
|
6156
6168
|
var css = '';
|
|
6157
6169
|
var vendor = '';
|
|
@@ -6533,10 +6545,10 @@ function createChainedFunction() { for (var _len = arguments.length, funcs = new
|
|
|
6533
6545
|
} return function chainedFunction() { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
6534
6546
|
args[_key2] = arguments[_key2];
|
|
6535
6547
|
} acc.apply(this, args); func.apply(this, args); }; }, function () { }); }
|
|
6536
|
-
var styles$
|
|
6548
|
+
var styles$Z = function styles(theme) { return { root: { userSelect: 'none', width: '1em', height: '1em', display: 'inline-block', fill: 'currentColor', flexShrink: 0, fontSize: theme.typography.pxToRem(24), transition: theme.transitions.create('fill', { duration: theme.transitions.duration.shorter }) }, colorPrimary: { color: theme.palette.primary.main }, colorSecondary: { color: theme.palette.secondary.main }, colorAction: { color: theme.palette.action.active }, colorError: { color: theme.palette.error.main }, colorDisabled: { color: theme.palette.action.disabled }, fontSizeInherit: { fontSize: 'inherit' }, fontSizeSmall: { fontSize: theme.typography.pxToRem(20) }, fontSizeLarge: { fontSize: theme.typography.pxToRem(35) } }; };
|
|
6537
6549
|
var SvgIcon = /*#__PURE__*/ N$1(function SvgIcon(props, ref) { var children = props.children, classes = props.classes, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'inherit' : _props$color, _props$component = props.component, Component = _props$component === void 0 ? 'svg' : _props$component, _props$fontSize = props.fontSize, fontSize = _props$fontSize === void 0 ? 'medium' : _props$fontSize, htmlColor = props.htmlColor, titleAccess = props.titleAccess, _props$viewBox = props.viewBox, viewBox = _props$viewBox === void 0 ? '0 0 24 24' : _props$viewBox, other = _objectWithoutProperties$2(props, ["children", "classes", "className", "color", "component", "fontSize", "htmlColor", "titleAccess", "viewBox"]); return /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, className, color !== 'inherit' && classes["color".concat(capitalize(color))], fontSize !== 'default' && fontSize !== 'medium' && classes["fontSize".concat(capitalize(fontSize))]), focusable: "false", viewBox: viewBox, color: htmlColor, "aria-hidden": titleAccess ? undefined : true, role: titleAccess ? 'img' : undefined, ref: ref }, other), children, titleAccess ? /*#__PURE__*/ y$3("title", null, titleAccess) : null); });
|
|
6538
6550
|
SvgIcon.muiName = 'SvgIcon';
|
|
6539
|
-
var SvgIcon$1 = withStyles(styles$
|
|
6551
|
+
var SvgIcon$1 = withStyles(styles$Z, { name: 'MuiSvgIcon' })(SvgIcon);
|
|
6540
6552
|
function createSvgIcon$1(path, displayName) { var Component = function Component(props, ref) { return /*#__PURE__*/ wn.createElement(SvgIcon$1, _extends$4({ ref: ref }, props), path); }; Component.muiName = SvgIcon$1.muiName; return /*#__PURE__*/ wn.memo(/*#__PURE__*/ wn.forwardRef(Component)); }
|
|
6541
6553
|
function debounce$1(func) { var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166; var timeout; function debounced() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
6542
6554
|
args[_key] = arguments[_key];
|
|
@@ -6600,22 +6612,22 @@ function useIsFocusVisible() { var ref = T$2(function (instance) { var node = vn
|
|
|
6600
6612
|
prepare(node.ownerDocument);
|
|
6601
6613
|
} }, []); return { isFocusVisible: isFocusVisible, onBlurVisible: handleBlurVisible, ref: ref }; }
|
|
6602
6614
|
var utils = /*#__PURE__*/ Object.freeze({ __proto__: null, capitalize: capitalize, createChainedFunction: createChainedFunction, createSvgIcon: createSvgIcon$1, debounce: debounce$1, deprecatedPropType: deprecatedPropType, isMuiElement: isMuiElement, ownerDocument: ownerDocument, ownerWindow: ownerWindow, requirePropFactory: requirePropFactory, setRef: setRef, unstable_useId: useId, unsupportedProp: unsupportedProp, useControlled: useControlled, useEventCallback: useEventCallback, useForkRef: useForkRef, useIsFocusVisible: useIsFocusVisible });
|
|
6603
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr))
|
|
6615
|
+
function _arrayWithHoles$1(arr) { if (Array.isArray(arr))
|
|
6604
6616
|
return arr; }
|
|
6605
6617
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
6606
6618
|
return Array.from(iter); }
|
|
6607
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length)
|
|
6619
|
+
function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length)
|
|
6608
6620
|
len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
6609
6621
|
arr2[i] = arr[i]; return arr2; }
|
|
6610
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o)
|
|
6622
|
+
function _unsupportedIterableToArray$1(o, minLen) { if (!o)
|
|
6611
6623
|
return; if (typeof o === "string")
|
|
6612
|
-
return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor)
|
|
6624
|
+
return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor)
|
|
6613
6625
|
n = o.constructor.name; if (n === "Map" || n === "Set")
|
|
6614
6626
|
return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
6615
|
-
return _arrayLikeToArray(o, minLen); }
|
|
6616
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6617
|
-
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
|
|
6618
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) {
|
|
6627
|
+
return _arrayLikeToArray$1(o, minLen); }
|
|
6628
|
+
function _nonIterableRest$1() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6629
|
+
function _toArray(arr) { return _arrayWithHoles$1(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableRest$1(); }
|
|
6630
|
+
function _iterableToArrayLimit$1(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) {
|
|
6619
6631
|
var e, n, i, u, a = [], f = !0, o = !1;
|
|
6620
6632
|
try {
|
|
6621
6633
|
if (i = (t = t.call(r)).next, 0 === l)
|
|
@@ -6639,7 +6651,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6639
6651
|
}
|
|
6640
6652
|
return a;
|
|
6641
6653
|
} }
|
|
6642
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6654
|
+
function _slicedToArray$1(arr, i) { return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1(); }
|
|
6643
6655
|
var config = { disabled: false };
|
|
6644
6656
|
var TransitionGroupContext = /*#__PURE__*/ wn.createContext(null);
|
|
6645
6657
|
var forceReflow = function forceReflow(node) { return node.scrollTop; };
|
|
@@ -6782,9 +6794,9 @@ TransitionGroup.propTypes = {};
|
|
|
6782
6794
|
TransitionGroup.defaultProps = defaultProps;
|
|
6783
6795
|
var reflow = function reflow(node) { return node.scrollTop; };
|
|
6784
6796
|
function getTransitionProps(props, options) { var timeout = props.timeout, _props$style = props.style, style = _props$style === void 0 ? {} : _props$style; return { duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode] || 0, delay: style.transitionDelay }; }
|
|
6785
|
-
var styles$
|
|
6797
|
+
var styles$Y = function styles(theme) { return { root: { height: 0, overflow: 'hidden', transition: theme.transitions.create('height') }, entered: { height: 'auto', overflow: 'visible' }, hidden: { visibility: 'hidden' }, wrapper: { display: 'flex' }, wrapperInner: { width: '100%' } }; };
|
|
6786
6798
|
var Collapse = /*#__PURE__*/ N$1(function Collapse(props, ref) { var children = props.children, classes = props.classes, className = props.className, collapsedHeight = props.collapsedHeight, _props$collapsedSize = props.collapsedSize, collapsedSizeProp = _props$collapsedSize === void 0 ? '0px' : _props$collapsedSize, _props$component = props.component, Component = _props$component === void 0 ? 'div' : _props$component, _props$disableStrictM = props.disableStrictModeCompat, disableStrictModeCompat = _props$disableStrictM === void 0 ? false : _props$disableStrictM, inProp = props["in"], onEnter = props.onEnter, onEntered = props.onEntered, onEntering = props.onEntering, onExit = props.onExit, onExited = props.onExited, onExiting = props.onExiting, style = props.style, _props$timeout = props.timeout, timeout = _props$timeout === void 0 ? duration.standard : _props$timeout, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Transition : _props$TransitionComp, other = _objectWithoutProperties$2(props, ["children", "classes", "className", "collapsedHeight", "collapsedSize", "component", "disableStrictModeCompat", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"]); var theme = useTheme(); var timer = _$1(); var wrapperRef = _$1(null); var autoTransitionDuration = _$1(); var collapsedSize = typeof (collapsedHeight || collapsedSizeProp) === 'number' ? "".concat(collapsedHeight || collapsedSizeProp, "px") : collapsedHeight || collapsedSizeProp; p$3(function () { return function () { clearTimeout(timer.current); }; }, []); var enableStrictModeCompat = theme.unstable_strictMode && !disableStrictModeCompat; var nodeRef = _$1(null); var handleRef = useForkRef(ref, enableStrictModeCompat ? nodeRef : undefined); var normalizedTransitionCallback = function normalizedTransitionCallback(callback) { return function (nodeOrAppearing, maybeAppearing) { if (callback) {
|
|
6787
|
-
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing], _ref2 = _slicedToArray(_ref, 2), node = _ref2[0], isAppearing = _ref2[1];
|
|
6799
|
+
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing], _ref2 = _slicedToArray$1(_ref, 2), node = _ref2[0], isAppearing = _ref2[1];
|
|
6788
6800
|
if (isAppearing === undefined) {
|
|
6789
6801
|
callback(node);
|
|
6790
6802
|
}
|
|
@@ -6819,23 +6831,23 @@ else {
|
|
|
6819
6831
|
timer.current = setTimeout(next, autoTransitionDuration.current || 0);
|
|
6820
6832
|
} }; return /*#__PURE__*/ y$3(TransitionComponent, _extends$4({ "in": inProp, onEnter: handleEnter, onEntered: handleEntered, onEntering: handleEntering, onExit: handleExit, onExited: handleExited, onExiting: handleExiting, addEndListener: addEndListener, nodeRef: enableStrictModeCompat ? nodeRef : undefined, timeout: timeout === 'auto' ? null : timeout }, other), function (state, childProps) { return /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, classes.container, className, { 'entered': classes.entered, 'exited': !inProp && collapsedSize === '0px' && classes.hidden }[state]), style: _extends$4({ minHeight: collapsedSize }, style), ref: handleRef }, childProps), /*#__PURE__*/ y$3("div", { className: classes.wrapper, ref: wrapperRef }, /*#__PURE__*/ y$3("div", { className: classes.wrapperInner }, children))); }); });
|
|
6821
6833
|
Collapse.muiSupportAuto = true;
|
|
6822
|
-
var Collapse$1 = withStyles(styles$
|
|
6823
|
-
var styles$
|
|
6834
|
+
var Collapse$1 = withStyles(styles$Y, { name: 'MuiCollapse' })(Collapse);
|
|
6835
|
+
var styles$X = function styles(theme) { var elevations = {}; theme.shadows.forEach(function (shadow, index) { elevations["elevation".concat(index)] = { boxShadow: shadow }; }); return _extends$4({ root: { backgroundColor: theme.palette.background.paper, color: theme.palette.text.primary, transition: theme.transitions.create('box-shadow') }, rounded: { borderRadius: theme.shape.borderRadius }, outlined: { border: "1px solid ".concat(theme.palette.divider) } }, elevations); };
|
|
6824
6836
|
var Paper = /*#__PURE__*/ N$1(function Paper(props, ref) { var classes = props.classes, className = props.className, _props$component = props.component, Component = _props$component === void 0 ? 'div' : _props$component, _props$square = props.square, square = _props$square === void 0 ? false : _props$square, _props$elevation = props.elevation, elevation = _props$elevation === void 0 ? 1 : _props$elevation, _props$variant = props.variant, variant = _props$variant === void 0 ? 'elevation' : _props$variant, other = _objectWithoutProperties$2(props, ["classes", "className", "component", "square", "elevation", "variant"]); return /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, className, variant === 'outlined' ? classes.outlined : classes["elevation".concat(elevation)], !square && classes.rounded), ref: ref }, other)); });
|
|
6825
|
-
var Paper$1 = withStyles(styles$
|
|
6837
|
+
var Paper$1 = withStyles(styles$X, { name: 'MuiPaper' })(Paper);
|
|
6826
6838
|
var AccordionContext = /*#__PURE__*/ F$4({});
|
|
6827
|
-
var styles$
|
|
6828
|
-
var Accordion$1 = /*#__PURE__*/ N$1(function Accordion(props, ref) { var childrenProp = props.children, classes = props.classes, className = props.className, _props$defaultExpande = props.defaultExpanded, defaultExpanded = _props$defaultExpande === void 0 ? false : _props$defaultExpande, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, expandedProp = props.expanded, onChange = props.onChange, _props$square = props.square, square = _props$square === void 0 ? false : _props$square, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Collapse$1 : _props$TransitionComp, TransitionProps = props.TransitionProps, other = _objectWithoutProperties$2(props, ["children", "classes", "className", "defaultExpanded", "disabled", "expanded", "onChange", "square", "TransitionComponent", "TransitionProps"]); var _useControlled = useControlled({ controlled: expandedProp, "default": defaultExpanded, name: 'Accordion', state: 'expanded' }), _useControlled2 = _slicedToArray(_useControlled, 2), expanded = _useControlled2[0], setExpandedState = _useControlled2[1]; var handleChange = T$2(function (event) { setExpandedState(!expanded); if (onChange) {
|
|
6839
|
+
var styles$W = function styles(theme) { var transition = { duration: theme.transitions.duration.shortest }; return { root: { position: 'relative', transition: theme.transitions.create(['margin'], transition), '&:before': { position: 'absolute', left: 0, top: -1, right: 0, height: 1, content: '""', opacity: 1, backgroundColor: theme.palette.divider, transition: theme.transitions.create(['opacity', 'background-color'], transition) }, '&:first-child': { '&:before': { display: 'none' } }, '&$expanded': { margin: '16px 0', '&:first-child': { marginTop: 0 }, '&:last-child': { marginBottom: 0 }, '&:before': { opacity: 0 } }, '&$expanded + &': { '&:before': { display: 'none' } }, '&$disabled': { backgroundColor: theme.palette.action.disabledBackground } }, rounded: { borderRadius: 0, '&:first-child': { borderTopLeftRadius: theme.shape.borderRadius, borderTopRightRadius: theme.shape.borderRadius }, '&:last-child': { borderBottomLeftRadius: theme.shape.borderRadius, borderBottomRightRadius: theme.shape.borderRadius, '@supports (-ms-ime-align: auto)': { borderBottomLeftRadius: 0, borderBottomRightRadius: 0 } } }, expanded: {}, disabled: {} }; };
|
|
6840
|
+
var Accordion$1 = /*#__PURE__*/ N$1(function Accordion(props, ref) { var childrenProp = props.children, classes = props.classes, className = props.className, _props$defaultExpande = props.defaultExpanded, defaultExpanded = _props$defaultExpande === void 0 ? false : _props$defaultExpande, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, expandedProp = props.expanded, onChange = props.onChange, _props$square = props.square, square = _props$square === void 0 ? false : _props$square, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Collapse$1 : _props$TransitionComp, TransitionProps = props.TransitionProps, other = _objectWithoutProperties$2(props, ["children", "classes", "className", "defaultExpanded", "disabled", "expanded", "onChange", "square", "TransitionComponent", "TransitionProps"]); var _useControlled = useControlled({ controlled: expandedProp, "default": defaultExpanded, name: 'Accordion', state: 'expanded' }), _useControlled2 = _slicedToArray$1(_useControlled, 2), expanded = _useControlled2[0], setExpandedState = _useControlled2[1]; var handleChange = T$2(function (event) { setExpandedState(!expanded); if (onChange) {
|
|
6829
6841
|
onChange(event, !expanded);
|
|
6830
6842
|
} }, [expanded, onChange, setExpandedState]); var _React$Children$toArr = A$3.toArray(childrenProp), _React$Children$toArr2 = _toArray(_React$Children$toArr), summary = _React$Children$toArr2[0], children = _React$Children$toArr2.slice(1); var contextValue = F$3(function () { return { expanded: expanded, disabled: disabled, toggle: handleChange }; }, [expanded, disabled, handleChange]); return /*#__PURE__*/ y$3(Paper$1, _extends$4({ className: clsx(classes.root, className, expanded && classes.expanded, disabled && classes.disabled, !square && classes.rounded), ref: ref, square: square }, other), /*#__PURE__*/ y$3(AccordionContext.Provider, { value: contextValue }, summary), /*#__PURE__*/ y$3(TransitionComponent, _extends$4({ "in": expanded, timeout: "auto" }, TransitionProps), /*#__PURE__*/ y$3("div", { "aria-labelledby": summary.props.id, id: summary.props['aria-controls'], role: "region" }, children))); });
|
|
6831
|
-
var MUIAccordion = withStyles(styles$
|
|
6832
|
-
var styles$
|
|
6843
|
+
var MUIAccordion = withStyles(styles$W, { name: 'MuiAccordion' })(Accordion$1);
|
|
6844
|
+
var styles$V = function styles(theme) { return { root: { display: 'flex', padding: theme.spacing(1, 2, 2) } }; };
|
|
6833
6845
|
var AccordionDetails$1 = /*#__PURE__*/ N$1(function AccordionDetails(props, ref) { var classes = props.classes, className = props.className, other = _objectWithoutProperties$2(props, ["classes", "className"]); return /*#__PURE__*/ y$3("div", _extends$4({ className: clsx(classes.root, className), ref: ref }, other)); });
|
|
6834
|
-
var MUIAccordionDetails = withStyles(styles$
|
|
6846
|
+
var MUIAccordionDetails = withStyles(styles$V, { name: 'MuiAccordionDetails' })(AccordionDetails$1);
|
|
6835
6847
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr))
|
|
6836
|
-
return _arrayLikeToArray(arr); }
|
|
6848
|
+
return _arrayLikeToArray$1(arr); }
|
|
6837
6849
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6838
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6850
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread(); }
|
|
6839
6851
|
var useEnhancedEffect$6 = typeof window === 'undefined' ? p$3 : y$2;
|
|
6840
6852
|
function Ripple(props) { var classes = props.classes, _props$pulsate = props.pulsate, pulsate = _props$pulsate === void 0 ? false : _props$pulsate, rippleX = props.rippleX, rippleY = props.rippleY, rippleSize = props.rippleSize, inProp = props["in"], _props$onExited = props.onExited, onExited = _props$onExited === void 0 ? function () { } : _props$onExited, timeout = props.timeout; var _React$useState = h$4(false), leaving = _React$useState[0], setLeaving = _React$useState[1]; var rippleClassName = clsx(classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate); var rippleStyles = { width: rippleSize, height: rippleSize, top: -(rippleSize / 2) + rippleY, left: -(rippleSize / 2) + rippleX }; var childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate); var handleExited = useEventCallback(onExited); useEnhancedEffect$6(function () { if (!inProp) {
|
|
6841
6853
|
setLeaving(true);
|
|
@@ -6844,7 +6856,7 @@ function Ripple(props) { var classes = props.classes, _props$pulsate = props.pul
|
|
|
6844
6856
|
} return undefined; }, [handleExited, inProp, timeout]); return /*#__PURE__*/ y$3("span", { className: rippleClassName, style: rippleStyles }, /*#__PURE__*/ y$3("span", { className: childClassName })); }
|
|
6845
6857
|
var DURATION = 550;
|
|
6846
6858
|
var DELAY_RIPPLE = 80;
|
|
6847
|
-
var styles$
|
|
6859
|
+
var styles$U = function styles(theme) { return { root: { overflow: 'hidden', pointerEvents: 'none', position: 'absolute', zIndex: 0, top: 0, right: 0, bottom: 0, left: 0, borderRadius: 'inherit' }, ripple: { opacity: 0, position: 'absolute' }, rippleVisible: { opacity: 0.3, transform: 'scale(1)', animation: "$enter ".concat(DURATION, "ms ").concat(theme.transitions.easing.easeInOut) }, ripplePulsate: { animationDuration: "".concat(theme.transitions.duration.shorter, "ms") }, child: { opacity: 1, display: 'block', width: '100%', height: '100%', borderRadius: '50%', backgroundColor: 'currentColor' }, childLeaving: { opacity: 0, animation: "$exit ".concat(DURATION, "ms ").concat(theme.transitions.easing.easeInOut) }, childPulsate: { position: 'absolute', left: 0, top: 0, animation: "$pulsate 2500ms ".concat(theme.transitions.easing.easeInOut, " 200ms infinite") }, '@keyframes enter': { '0%': { transform: 'scale(0)', opacity: 0.1 }, '100%': { transform: 'scale(1)', opacity: 0.3 } }, '@keyframes exit': { '0%': { opacity: 1 }, '100%': { opacity: 0 } }, '@keyframes pulsate': { '0%': { transform: 'scale(1)' }, '50%': { transform: 'scale(0.92)' }, '100%': { transform: 'scale(1)' } } }; };
|
|
6848
6860
|
var TouchRipple = /*#__PURE__*/ N$1(function TouchRipple(props, ref) { var _props$center = props.center, centerProp = _props$center === void 0 ? false : _props$center, classes = props.classes, className = props.className, other = _objectWithoutProperties$2(props, ["center", "classes", "className"]); var _React$useState = h$4([]), ripples = _React$useState[0], setRipples = _React$useState[1]; var nextKey = _$1(0); var rippleCallback = _$1(null); p$3(function () { if (rippleCallback.current) {
|
|
6849
6861
|
rippleCallback.current();
|
|
6850
6862
|
rippleCallback.current = null;
|
|
@@ -6891,8 +6903,8 @@ else {
|
|
|
6891
6903
|
} startTimerCommit.current = null; setRipples(function (oldRipples) { if (oldRipples.length > 0) {
|
|
6892
6904
|
return oldRipples.slice(1);
|
|
6893
6905
|
} return oldRipples; }); rippleCallback.current = cb; }, []); A$4(ref, function () { return { pulsate: pulsate, start: start, stop: stop }; }, [pulsate, start, stop]); return /*#__PURE__*/ y$3("span", _extends$4({ className: clsx(classes.root, className), ref: container }, other), /*#__PURE__*/ y$3(TransitionGroup, { component: null, exit: true }, ripples)); });
|
|
6894
|
-
var TouchRipple$1 = withStyles(styles$
|
|
6895
|
-
var styles$
|
|
6906
|
+
var TouchRipple$1 = withStyles(styles$U, { flip: false, name: 'MuiTouchRipple' })(/*#__PURE__*/ w$3(TouchRipple));
|
|
6907
|
+
var styles$T = { root: { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', position: 'relative', WebkitTapHighlightColor: 'transparent', backgroundColor: 'transparent', outline: 0, border: 0, margin: 0, borderRadius: 0, padding: 0, cursor: 'pointer', userSelect: 'none', verticalAlign: 'middle', '-moz-appearance': 'none', '-webkit-appearance': 'none', textDecoration: 'none', color: 'inherit', '&::-moz-focus-inner': { borderStyle: 'none' }, '&$disabled': { pointerEvents: 'none', cursor: 'default' }, '@media print': { colorAdjust: 'exact' } }, disabled: {}, focusVisible: {} };
|
|
6896
6908
|
var ButtonBase = /*#__PURE__*/ N$1(function ButtonBase(props, ref) { var action = props.action, buttonRefProp = props.buttonRef, _props$centerRipple = props.centerRipple, centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple, children = props.children, classes = props.classes, className = props.className, _props$component = props.component, component = _props$component === void 0 ? 'button' : _props$component, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, _props$disableRipple = props.disableRipple, disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple, _props$disableTouchRi = props.disableTouchRipple, disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi, _props$focusRipple = props.focusRipple, focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple, focusVisibleClassName = props.focusVisibleClassName, onBlur = props.onBlur, onClick = props.onClick, onFocus = props.onFocus, onFocusVisible = props.onFocusVisible, onKeyDown = props.onKeyDown, onKeyUp = props.onKeyUp, onMouseDown = props.onMouseDown, onMouseLeave = props.onMouseLeave, onMouseUp = props.onMouseUp, onTouchEnd = props.onTouchEnd, onTouchMove = props.onTouchMove, onTouchStart = props.onTouchStart, onDragLeave = props.onDragLeave, _props$tabIndex = props.tabIndex, tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex, TouchRippleProps = props.TouchRippleProps, _props$type = props.type, type = _props$type === void 0 ? 'button' : _props$type, other = _objectWithoutProperties$2(props, ["action", "buttonRef", "centerRipple", "children", "classes", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "onBlur", "onClick", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "onDragLeave", "tabIndex", "TouchRippleProps", "type"]); var buttonRef = _$1(null); function getButtonNode() { return vn(buttonRef.current); } var rippleRef = _$1(null); var _React$useState = h$4(false), focusVisible = _React$useState[0], setFocusVisible = _React$useState[1]; if (disabled && focusVisible) {
|
|
6897
6909
|
setFocusVisible(false);
|
|
6898
6910
|
} var _useIsFocusVisible = useIsFocusVisible(), isFocusVisible = _useIsFocusVisible.isFocusVisible, onBlurVisible = _useIsFocusVisible.onBlurVisible, focusVisibleRef = _useIsFocusVisible.ref; A$4(action, function () { return { focusVisible: function focusVisible() { setFocusVisible(true); buttonRef.current.focus(); } }; }, []); p$3(function () { if (focusVisible && focusRipple && !disableRipple) {
|
|
@@ -6952,21 +6964,21 @@ else {
|
|
|
6952
6964
|
}
|
|
6953
6965
|
buttonProps['aria-disabled'] = disabled;
|
|
6954
6966
|
} var handleUserRef = useForkRef(buttonRefProp, ref); var handleOwnRef = useForkRef(focusVisibleRef, buttonRef); var handleRef = useForkRef(handleUserRef, handleOwnRef); var _React$useState2 = h$4(false), mountedState = _React$useState2[0], setMountedState = _React$useState2[1]; p$3(function () { setMountedState(true); }, []); var enableTouchRipple = mountedState && !disableRipple && !disabled; return /*#__PURE__*/ y$3(ComponentProp, _extends$4({ className: clsx(classes.root, className, focusVisible && [classes.focusVisible, focusVisibleClassName], disabled && classes.disabled), onBlur: handleBlur, onClick: onClick, onFocus: handleFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onMouseDown: handleMouseDown, onMouseLeave: handleMouseLeave, onMouseUp: handleMouseUp, onDragLeave: handleDragLeave, onTouchEnd: handleTouchEnd, onTouchMove: handleTouchMove, onTouchStart: handleTouchStart, ref: handleRef, tabIndex: disabled ? -1 : tabIndex }, buttonProps, other), children, enableTouchRipple ? /*#__PURE__*/ y$3(TouchRipple$1, _extends$4({ ref: rippleRef, center: centerRipple }, TouchRippleProps)) : null); });
|
|
6955
|
-
var ButtonBase$1 = withStyles(styles$
|
|
6956
|
-
var styles$
|
|
6967
|
+
var ButtonBase$1 = withStyles(styles$T, { name: 'MuiButtonBase' })(ButtonBase);
|
|
6968
|
+
var styles$S = function styles(theme) { return { root: { textAlign: 'center', flex: '0 0 auto', fontSize: theme.typography.pxToRem(24), padding: 12, borderRadius: '50%', overflow: 'visible', color: theme.palette.action.active, transition: theme.transitions.create('background-color', { duration: theme.transitions.duration.shortest }), '&:hover': { backgroundColor: alpha(theme.palette.action.active, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } }, '&$disabled': { backgroundColor: 'transparent', color: theme.palette.action.disabled } }, edgeStart: { marginLeft: -12, '$sizeSmall&': { marginLeft: -3 } }, edgeEnd: { marginRight: -12, '$sizeSmall&': { marginRight: -3 } }, colorInherit: { color: 'inherit' }, colorPrimary: { color: theme.palette.primary.main, '&:hover': { backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } } }, colorSecondary: { color: theme.palette.secondary.main, '&:hover': { backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } } }, disabled: {}, sizeSmall: { padding: 3, fontSize: theme.typography.pxToRem(18) }, label: { width: '100%', display: 'flex', alignItems: 'inherit', justifyContent: 'inherit' } }; };
|
|
6957
6969
|
var IconButton = /*#__PURE__*/ N$1(function IconButton(props, ref) { var _props$edge = props.edge, edge = _props$edge === void 0 ? false : _props$edge, children = props.children, classes = props.classes, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'default' : _props$color, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, _props$disableFocusRi = props.disableFocusRipple, disableFocusRipple = _props$disableFocusRi === void 0 ? false : _props$disableFocusRi, _props$size = props.size, size = _props$size === void 0 ? 'medium' : _props$size, other = _objectWithoutProperties$2(props, ["edge", "children", "classes", "className", "color", "disabled", "disableFocusRipple", "size"]); return /*#__PURE__*/ y$3(ButtonBase$1, _extends$4({ className: clsx(classes.root, className, color !== 'default' && classes["color".concat(capitalize(color))], disabled && classes.disabled, size === "small" && classes["size".concat(capitalize(size))], { 'start': classes.edgeStart, 'end': classes.edgeEnd }[edge]), centerRipple: true, focusRipple: !disableFocusRipple, disabled: disabled, ref: ref }, other), /*#__PURE__*/ y$3("span", { className: classes.label }, children)); });
|
|
6958
|
-
var IconButton$1 = withStyles(styles$
|
|
6959
|
-
var styles$
|
|
6970
|
+
var IconButton$1 = withStyles(styles$S, { name: 'MuiIconButton' })(IconButton);
|
|
6971
|
+
var styles$R = function styles(theme) { var transition = { duration: theme.transitions.duration.shortest }; return { root: { display: 'flex', minHeight: 8 * 6, transition: theme.transitions.create(['min-height', 'background-color'], transition), padding: theme.spacing(0, 2), '&:hover:not($disabled)': { cursor: 'pointer' }, '&$expanded': { minHeight: 64 }, '&$focused, &$focusVisible': { backgroundColor: theme.palette.action.focus }, '&$disabled': { opacity: theme.palette.action.disabledOpacity } }, expanded: {}, focused: {}, focusVisible: {}, disabled: {}, content: { display: 'flex', flexGrow: 1, transition: theme.transitions.create(['margin'], transition), margin: '12px 0', '&$expanded': { margin: '20px 0' } }, expandIcon: { transform: 'rotate(0deg)', transition: theme.transitions.create('transform', transition), '&:hover': { backgroundColor: 'transparent' }, '&$expanded': { transform: 'rotate(180deg)' } } }; };
|
|
6960
6972
|
var AccordionSummary$1 = /*#__PURE__*/ N$1(function AccordionSummary(props, ref) { var children = props.children, classes = props.classes, className = props.className, expandIcon = props.expandIcon, focusVisibleClassName = props.focusVisibleClassName, _props$IconButtonProp = props.IconButtonProps, IconButtonProps = _props$IconButtonProp === void 0 ? {} : _props$IconButtonProp, onClick = props.onClick, other = _objectWithoutProperties$2(props, ["children", "classes", "className", "expandIcon", "focusVisibleClassName", "IconButtonProps", "onClick"]); var _React$useContext = q$5(AccordionContext), _React$useContext$dis = _React$useContext.disabled, disabled = _React$useContext$dis === void 0 ? false : _React$useContext$dis, expanded = _React$useContext.expanded, toggle = _React$useContext.toggle; var handleChange = function handleChange(event) { if (toggle) {
|
|
6961
6973
|
toggle(event);
|
|
6962
6974
|
} if (onClick) {
|
|
6963
6975
|
onClick(event);
|
|
6964
6976
|
} }; return /*#__PURE__*/ y$3(ButtonBase$1, _extends$4({ focusRipple: false, disableRipple: true, disabled: disabled, component: "div", "aria-expanded": expanded, className: clsx(classes.root, className, disabled && classes.disabled, expanded && classes.expanded), focusVisibleClassName: clsx(classes.focusVisible, classes.focused, focusVisibleClassName), onClick: handleChange, ref: ref }, other), /*#__PURE__*/ y$3("div", { className: clsx(classes.content, expanded && classes.expanded) }, children), expandIcon && /*#__PURE__*/ y$3(IconButton$1, _extends$4({ className: clsx(classes.expandIcon, expanded && classes.expanded), edge: "end", component: "div", tabIndex: null, role: null, "aria-hidden": true }, IconButtonProps), expandIcon)); });
|
|
6965
|
-
var MUIAccordionSummary = withStyles(styles$
|
|
6966
|
-
var styles$
|
|
6977
|
+
var MUIAccordionSummary = withStyles(styles$R, { name: 'MuiAccordionSummary' })(AccordionSummary$1);
|
|
6978
|
+
var styles$Q = { entering: { opacity: 1 }, entered: { opacity: 1 } };
|
|
6967
6979
|
var defaultTimeout = { enter: duration.enteringScreen, exit: duration.leavingScreen };
|
|
6968
6980
|
var Fade = /*#__PURE__*/ N$1(function Fade(props, ref) { var children = props.children, _props$disableStrictM = props.disableStrictModeCompat, disableStrictModeCompat = _props$disableStrictM === void 0 ? false : _props$disableStrictM, inProp = props["in"], onEnter = props.onEnter, onEntered = props.onEntered, onEntering = props.onEntering, onExit = props.onExit, onExited = props.onExited, onExiting = props.onExiting, style = props.style, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Transition : _props$TransitionComp, _props$timeout = props.timeout, timeout = _props$timeout === void 0 ? defaultTimeout : _props$timeout, other = _objectWithoutProperties$2(props, ["children", "disableStrictModeCompat", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "TransitionComponent", "timeout"]); var theme = useTheme(); var enableStrictModeCompat = theme.unstable_strictMode && !disableStrictModeCompat; var nodeRef = _$1(null); var foreignRef = useForkRef(children.ref, ref); var handleRef = useForkRef(enableStrictModeCompat ? nodeRef : undefined, foreignRef); var normalizedTransitionCallback = function normalizedTransitionCallback(callback) { return function (nodeOrAppearing, maybeAppearing) { if (callback) {
|
|
6969
|
-
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing], _ref2 = _slicedToArray(_ref, 2), node = _ref2[0], isAppearing = _ref2[1];
|
|
6981
|
+
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing], _ref2 = _slicedToArray$1(_ref, 2), node = _ref2[0], isAppearing = _ref2[1];
|
|
6970
6982
|
if (isAppearing === undefined) {
|
|
6971
6983
|
callback(node);
|
|
6972
6984
|
}
|
|
@@ -6977,22 +6989,75 @@ var Fade = /*#__PURE__*/ N$1(function Fade(props, ref) { var children = props.ch
|
|
|
6977
6989
|
onEnter(node, isAppearing);
|
|
6978
6990
|
} }); var handleEntered = normalizedTransitionCallback(onEntered); var handleExiting = normalizedTransitionCallback(onExiting); var handleExit = normalizedTransitionCallback(function (node) { var transitionProps = getTransitionProps({ style: style, timeout: timeout }, { mode: 'exit' }); node.style.webkitTransition = theme.transitions.create('opacity', transitionProps); node.style.transition = theme.transitions.create('opacity', transitionProps); if (onExit) {
|
|
6979
6991
|
onExit(node);
|
|
6980
|
-
} }); var handleExited = normalizedTransitionCallback(onExited); return /*#__PURE__*/ y$3(TransitionComponent, _extends$4({ appear: true, "in": inProp, nodeRef: enableStrictModeCompat ? nodeRef : undefined, onEnter: handleEnter, onEntered: handleEntered, onEntering: handleEntering, onExit: handleExit, onExited: handleExited, onExiting: handleExiting, timeout: timeout }, other), function (state, childProps) { return /*#__PURE__*/ sn(children, _extends$4({ style: _extends$4({ opacity: 0, visibility: state === 'exited' && !inProp ? 'hidden' : undefined }, styles$
|
|
6981
|
-
var styles$
|
|
6992
|
+
} }); var handleExited = normalizedTransitionCallback(onExited); return /*#__PURE__*/ y$3(TransitionComponent, _extends$4({ appear: true, "in": inProp, nodeRef: enableStrictModeCompat ? nodeRef : undefined, onEnter: handleEnter, onEntered: handleEntered, onEntering: handleEntering, onExit: handleExit, onExited: handleExited, onExiting: handleExiting, timeout: timeout }, other), function (state, childProps) { return /*#__PURE__*/ sn(children, _extends$4({ style: _extends$4({ opacity: 0, visibility: state === 'exited' && !inProp ? 'hidden' : undefined }, styles$Q[state], style, children.props.style), ref: handleRef }, childProps)); }); });
|
|
6993
|
+
var styles$P = { root: { zIndex: -1, position: 'fixed', display: 'flex', alignItems: 'center', justifyContent: 'center', right: 0, bottom: 0, top: 0, left: 0, backgroundColor: 'rgba(0, 0, 0, 0.5)', WebkitTapHighlightColor: 'transparent' }, invisible: { backgroundColor: 'transparent' } };
|
|
6982
6994
|
var Backdrop = /*#__PURE__*/ N$1(function Backdrop(props, ref) { var children = props.children, classes = props.classes, className = props.className, _props$invisible = props.invisible, invisible = _props$invisible === void 0 ? false : _props$invisible, open = props.open, transitionDuration = props.transitionDuration, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Fade : _props$TransitionComp, other = _objectWithoutProperties$2(props, ["children", "classes", "className", "invisible", "open", "transitionDuration", "TransitionComponent"]); return /*#__PURE__*/ y$3(TransitionComponent, _extends$4({ "in": open, timeout: transitionDuration }, other), /*#__PURE__*/ y$3("div", { className: clsx(classes.root, className, invisible && classes.invisible), "aria-hidden": true, ref: ref }, children)); });
|
|
6983
|
-
var Backdrop$1 = withStyles(styles$
|
|
6984
|
-
var styles$
|
|
6995
|
+
var Backdrop$1 = withStyles(styles$P, { name: 'MuiBackdrop' })(Backdrop);
|
|
6996
|
+
var styles$O = function styles(theme) { return { root: { margin: 0 }, body2: theme.typography.body2, body1: theme.typography.body1, caption: theme.typography.caption, button: theme.typography.button, h1: theme.typography.h1, h2: theme.typography.h2, h3: theme.typography.h3, h4: theme.typography.h4, h5: theme.typography.h5, h6: theme.typography.h6, subtitle1: theme.typography.subtitle1, subtitle2: theme.typography.subtitle2, overline: theme.typography.overline, srOnly: { position: 'absolute', height: 1, width: 1, overflow: 'hidden' }, alignLeft: { textAlign: 'left' }, alignCenter: { textAlign: 'center' }, alignRight: { textAlign: 'right' }, alignJustify: { textAlign: 'justify' }, noWrap: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }, gutterBottom: { marginBottom: '0.35em' }, paragraph: { marginBottom: 16 }, colorInherit: { color: 'inherit' }, colorPrimary: { color: theme.palette.primary.main }, colorSecondary: { color: theme.palette.secondary.main }, colorTextPrimary: { color: theme.palette.text.primary }, colorTextSecondary: { color: theme.palette.text.secondary }, colorError: { color: theme.palette.error.main }, displayInline: { display: 'inline' }, displayBlock: { display: 'block' } }; };
|
|
6985
6997
|
var defaultVariantMapping = { h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', h6: 'h6', subtitle1: 'h6', subtitle2: 'h6', body1: 'p', body2: 'p' };
|
|
6986
6998
|
var Typography$1 = /*#__PURE__*/ N$1(function Typography(props, ref) { var _props$align = props.align, align = _props$align === void 0 ? 'inherit' : _props$align, classes = props.classes, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'initial' : _props$color, component = props.component, _props$display = props.display, display = _props$display === void 0 ? 'initial' : _props$display, _props$gutterBottom = props.gutterBottom, gutterBottom = _props$gutterBottom === void 0 ? false : _props$gutterBottom, _props$noWrap = props.noWrap, noWrap = _props$noWrap === void 0 ? false : _props$noWrap, _props$paragraph = props.paragraph, paragraph = _props$paragraph === void 0 ? false : _props$paragraph, _props$variant = props.variant, variant = _props$variant === void 0 ? 'body1' : _props$variant, _props$variantMapping = props.variantMapping, variantMapping = _props$variantMapping === void 0 ? defaultVariantMapping : _props$variantMapping, other = _objectWithoutProperties$2(props, ["align", "classes", "className", "color", "component", "display", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"]); var Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span'; return /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, className, variant !== 'inherit' && classes[variant], color !== 'initial' && classes["color".concat(capitalize(color))], noWrap && classes.noWrap, gutterBottom && classes.gutterBottom, paragraph && classes.paragraph, align !== 'inherit' && classes["align".concat(capitalize(align))], display !== 'initial' && classes["display".concat(capitalize(display))]), ref: ref }, other)); });
|
|
6987
|
-
var
|
|
6988
|
-
var styles$
|
|
6999
|
+
var Typography$2 = withStyles(styles$O, { name: 'MuiTypography' })(Typography$1);
|
|
7000
|
+
var styles$N = function styles(theme) { return { root: _extends$4({}, theme.typography.button, { boxSizing: 'border-box', minWidth: 64, padding: '6px 16px', borderRadius: theme.shape.borderRadius, color: theme.palette.text.primary, transition: theme.transitions.create(['background-color', 'box-shadow', 'border'], { duration: theme.transitions.duration["short"] }), '&:hover': { textDecoration: 'none', backgroundColor: alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' }, '&$disabled': { backgroundColor: 'transparent' } }, '&$disabled': { color: theme.palette.action.disabled } }), label: { width: '100%', display: 'inherit', alignItems: 'inherit', justifyContent: 'inherit' }, text: { padding: '6px 8px' }, textPrimary: { color: theme.palette.primary.main, '&:hover': { backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } } }, textSecondary: { color: theme.palette.secondary.main, '&:hover': { backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } } }, outlined: { padding: '5px 15px', border: "1px solid ".concat(theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'), '&$disabled': { border: "1px solid ".concat(theme.palette.action.disabledBackground) } }, outlinedPrimary: { color: theme.palette.primary.main, border: "1px solid ".concat(alpha(theme.palette.primary.main, 0.5)), '&:hover': { border: "1px solid ".concat(theme.palette.primary.main), backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } } }, outlinedSecondary: { color: theme.palette.secondary.main, border: "1px solid ".concat(alpha(theme.palette.secondary.main, 0.5)), '&:hover': { border: "1px solid ".concat(theme.palette.secondary.main), backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } }, '&$disabled': { border: "1px solid ".concat(theme.palette.action.disabled) } }, contained: { color: theme.palette.getContrastText(theme.palette.grey[300]), backgroundColor: theme.palette.grey[300], boxShadow: theme.shadows[2], '&:hover': { backgroundColor: theme.palette.grey.A100, boxShadow: theme.shadows[4], '@media (hover: none)': { boxShadow: theme.shadows[2], backgroundColor: theme.palette.grey[300] }, '&$disabled': { backgroundColor: theme.palette.action.disabledBackground } }, '&$focusVisible': { boxShadow: theme.shadows[6] }, '&:active': { boxShadow: theme.shadows[8] }, '&$disabled': { color: theme.palette.action.disabled, boxShadow: theme.shadows[0], backgroundColor: theme.palette.action.disabledBackground } }, containedPrimary: { color: theme.palette.primary.contrastText, backgroundColor: theme.palette.primary.main, '&:hover': { backgroundColor: theme.palette.primary.dark, '@media (hover: none)': { backgroundColor: theme.palette.primary.main } } }, containedSecondary: { color: theme.palette.secondary.contrastText, backgroundColor: theme.palette.secondary.main, '&:hover': { backgroundColor: theme.palette.secondary.dark, '@media (hover: none)': { backgroundColor: theme.palette.secondary.main } } }, disableElevation: { boxShadow: 'none', '&:hover': { boxShadow: 'none' }, '&$focusVisible': { boxShadow: 'none' }, '&:active': { boxShadow: 'none' }, '&$disabled': { boxShadow: 'none' } }, focusVisible: {}, disabled: {}, colorInherit: { color: 'inherit', borderColor: 'currentColor' }, textSizeSmall: { padding: '4px 5px', fontSize: theme.typography.pxToRem(13) }, textSizeLarge: { padding: '8px 11px', fontSize: theme.typography.pxToRem(15) }, outlinedSizeSmall: { padding: '3px 9px', fontSize: theme.typography.pxToRem(13) }, outlinedSizeLarge: { padding: '7px 21px', fontSize: theme.typography.pxToRem(15) }, containedSizeSmall: { padding: '4px 10px', fontSize: theme.typography.pxToRem(13) }, containedSizeLarge: { padding: '8px 22px', fontSize: theme.typography.pxToRem(15) }, sizeSmall: {}, sizeLarge: {}, fullWidth: { width: '100%' }, startIcon: { display: 'inherit', marginRight: 8, marginLeft: -4, '&$iconSizeSmall': { marginLeft: -2 } }, endIcon: { display: 'inherit', marginRight: -4, marginLeft: 8, '&$iconSizeSmall': { marginRight: -2 } }, iconSizeSmall: { '& > *:first-child': { fontSize: 18 } }, iconSizeMedium: { '& > *:first-child': { fontSize: 20 } }, iconSizeLarge: { '& > *:first-child': { fontSize: 22 } } }; };
|
|
6989
7001
|
var Button$1 = /*#__PURE__*/ N$1(function Button(props, ref) { var children = props.children, classes = props.classes, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'default' : _props$color, _props$component = props.component, component = _props$component === void 0 ? 'button' : _props$component, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, _props$disableElevati = props.disableElevation, disableElevation = _props$disableElevati === void 0 ? false : _props$disableElevati, _props$disableFocusRi = props.disableFocusRipple, disableFocusRipple = _props$disableFocusRi === void 0 ? false : _props$disableFocusRi, endIconProp = props.endIcon, focusVisibleClassName = props.focusVisibleClassName, _props$fullWidth = props.fullWidth, fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth, _props$size = props.size, size = _props$size === void 0 ? 'medium' : _props$size, startIconProp = props.startIcon, _props$type = props.type, type = _props$type === void 0 ? 'button' : _props$type, _props$variant = props.variant, variant = _props$variant === void 0 ? 'text' : _props$variant, other = _objectWithoutProperties$2(props, ["children", "classes", "className", "color", "component", "disabled", "disableElevation", "disableFocusRipple", "endIcon", "focusVisibleClassName", "fullWidth", "size", "startIcon", "type", "variant"]); var startIcon = startIconProp && /*#__PURE__*/ y$3("span", { className: clsx(classes.startIcon, classes["iconSize".concat(capitalize(size))]) }, startIconProp); var endIcon = endIconProp && /*#__PURE__*/ y$3("span", { className: clsx(classes.endIcon, classes["iconSize".concat(capitalize(size))]) }, endIconProp); return /*#__PURE__*/ y$3(ButtonBase$1, _extends$4({ className: clsx(classes.root, classes[variant], className, color === 'inherit' ? classes.colorInherit : color !== 'default' && classes["".concat(variant).concat(capitalize(color))], size !== 'medium' && [classes["".concat(variant, "Size").concat(capitalize(size))], classes["size".concat(capitalize(size))]], disableElevation && classes.disableElevation, disabled && classes.disabled, fullWidth && classes.fullWidth), component: component, disabled: disabled, focusRipple: !disableFocusRipple, focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName), ref: ref, type: type }, other), /*#__PURE__*/ y$3("span", { className: classes.label }, startIcon, children, endIcon)); });
|
|
6990
|
-
var MUIButton = withStyles(styles$
|
|
7002
|
+
var MUIButton = withStyles(styles$N, { name: 'MuiButton' })(Button$1);
|
|
6991
7003
|
var FormControlContext = /*#__PURE__*/ F$4();
|
|
6992
7004
|
function useFormControl$1() { return q$5(FormControlContext); }
|
|
6993
7005
|
function useFormControl() { return q$5(FormControlContext); }
|
|
7006
|
+
var styles$M = { root: { padding: 9 }, checked: {}, disabled: {}, input: { cursor: 'inherit', position: 'absolute', opacity: 0, width: '100%', height: '100%', top: 0, left: 0, margin: 0, padding: 0, zIndex: 1 } };
|
|
7007
|
+
var SwitchBase = /*#__PURE__*/ N$1(function SwitchBase(props, ref) { var autoFocus = props.autoFocus, checkedProp = props.checked, checkedIcon = props.checkedIcon, classes = props.classes, className = props.className, defaultChecked = props.defaultChecked, disabledProp = props.disabled, icon = props.icon, id = props.id, inputProps = props.inputProps, inputRef = props.inputRef, name = props.name, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, readOnly = props.readOnly, required = props.required, tabIndex = props.tabIndex, type = props.type, value = props.value, other = _objectWithoutProperties$2(props, ["autoFocus", "checked", "checkedIcon", "classes", "className", "defaultChecked", "disabled", "icon", "id", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "readOnly", "required", "tabIndex", "type", "value"]); var _useControlled = useControlled({ controlled: checkedProp, "default": Boolean(defaultChecked), name: 'SwitchBase', state: 'checked' }), _useControlled2 = _slicedToArray$1(_useControlled, 2), checked = _useControlled2[0], setCheckedState = _useControlled2[1]; var muiFormControl = useFormControl(); var handleFocus = function handleFocus(event) { if (onFocus) {
|
|
7008
|
+
onFocus(event);
|
|
7009
|
+
} if (muiFormControl && muiFormControl.onFocus) {
|
|
7010
|
+
muiFormControl.onFocus(event);
|
|
7011
|
+
} }; var handleBlur = function handleBlur(event) { if (onBlur) {
|
|
7012
|
+
onBlur(event);
|
|
7013
|
+
} if (muiFormControl && muiFormControl.onBlur) {
|
|
7014
|
+
muiFormControl.onBlur(event);
|
|
7015
|
+
} }; var handleInputChange = function handleInputChange(event) { var newChecked = event.target.checked; setCheckedState(newChecked); if (onChange) {
|
|
7016
|
+
onChange(event, newChecked);
|
|
7017
|
+
} }; var disabled = disabledProp; if (muiFormControl) {
|
|
7018
|
+
if (typeof disabled === 'undefined') {
|
|
7019
|
+
disabled = muiFormControl.disabled;
|
|
7020
|
+
}
|
|
7021
|
+
} var hasLabelFor = type === 'checkbox' || type === 'radio'; return /*#__PURE__*/ y$3(IconButton$1, _extends$4({ component: "span", className: clsx(classes.root, className, checked && classes.checked, disabled && classes.disabled), disabled: disabled, tabIndex: null, role: undefined, onFocus: handleFocus, onBlur: handleBlur, ref: ref }, other), /*#__PURE__*/ y$3("input", _extends$4({ autoFocus: autoFocus, checked: checkedProp, defaultChecked: defaultChecked, className: classes.input, disabled: disabled, id: hasLabelFor && id, name: name, onChange: handleInputChange, readOnly: readOnly, ref: inputRef, required: required, tabIndex: tabIndex, type: type, value: value }, inputProps)), checked ? checkedIcon : icon); });
|
|
7022
|
+
var SwitchBase$1 = withStyles(styles$M, { name: 'PrivateSwitchBase' })(SwitchBase);
|
|
7023
|
+
var CheckBoxOutlineBlankIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z" }));
|
|
7024
|
+
var CheckBoxIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }));
|
|
7025
|
+
var IndeterminateCheckBoxIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z" }));
|
|
7026
|
+
var styles$L = function styles(theme) { return { root: { color: theme.palette.text.secondary }, checked: {}, disabled: {}, indeterminate: {}, colorPrimary: { '&$checked': { color: theme.palette.primary.main, '&:hover': { backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } } }, '&$disabled': { color: theme.palette.action.disabled } }, colorSecondary: { '&$checked': { color: theme.palette.secondary.main, '&:hover': { backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } } }, '&$disabled': { color: theme.palette.action.disabled } } }; };
|
|
7027
|
+
var defaultCheckedIcon$1 = /*#__PURE__*/ y$3(CheckBoxIcon, null);
|
|
7028
|
+
var defaultIcon$1 = /*#__PURE__*/ y$3(CheckBoxOutlineBlankIcon, null);
|
|
7029
|
+
var defaultIndeterminateIcon = /*#__PURE__*/ y$3(IndeterminateCheckBoxIcon, null);
|
|
7030
|
+
var Checkbox$1 = /*#__PURE__*/ N$1(function Checkbox(props, ref) { var _props$checkedIcon = props.checkedIcon, checkedIcon = _props$checkedIcon === void 0 ? defaultCheckedIcon$1 : _props$checkedIcon, classes = props.classes, _props$color = props.color, color = _props$color === void 0 ? 'secondary' : _props$color, _props$icon = props.icon, iconProp = _props$icon === void 0 ? defaultIcon$1 : _props$icon, _props$indeterminate = props.indeterminate, indeterminate = _props$indeterminate === void 0 ? false : _props$indeterminate, _props$indeterminateI = props.indeterminateIcon, indeterminateIconProp = _props$indeterminateI === void 0 ? defaultIndeterminateIcon : _props$indeterminateI, inputProps = props.inputProps, _props$size = props.size, size = _props$size === void 0 ? 'medium' : _props$size, other = _objectWithoutProperties$2(props, ["checkedIcon", "classes", "color", "icon", "indeterminate", "indeterminateIcon", "inputProps", "size"]); var icon = indeterminate ? indeterminateIconProp : iconProp; var indeterminateIcon = indeterminate ? indeterminateIconProp : checkedIcon; return /*#__PURE__*/ y$3(SwitchBase$1, _extends$4({ type: "checkbox", classes: { root: clsx(classes.root, classes["color".concat(capitalize(color))], indeterminate && classes.indeterminate), checked: classes.checked, disabled: classes.disabled }, color: color, inputProps: _extends$4({ 'data-indeterminate': indeterminate }, inputProps), icon: /*#__PURE__*/ sn(icon, { fontSize: icon.props.fontSize === undefined && size === "small" ? size : icon.props.fontSize }), checkedIcon: /*#__PURE__*/ sn(indeterminateIcon, { fontSize: indeterminateIcon.props.fontSize === undefined && size === "small" ? size : indeterminateIcon.props.fontSize }), ref: ref }, other)); });
|
|
7031
|
+
var MUICheckbox = withStyles(styles$L, { name: 'MuiCheckbox' })(Checkbox$1);
|
|
7032
|
+
var CancelIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" }));
|
|
7033
|
+
var styles$K = function styles(theme) { var backgroundColor = theme.palette.type === 'light' ? theme.palette.grey[300] : theme.palette.grey[700]; var deleteIconColor = alpha(theme.palette.text.primary, 0.26); return { root: { fontFamily: theme.typography.fontFamily, fontSize: theme.typography.pxToRem(13), display: 'inline-flex', alignItems: 'center', justifyContent: 'center', height: 32, color: theme.palette.getContrastText(backgroundColor), backgroundColor: backgroundColor, borderRadius: 32 / 2, whiteSpace: 'nowrap', transition: theme.transitions.create(['background-color', 'box-shadow']), cursor: 'default', outline: 0, textDecoration: 'none', border: 'none', padding: 0, verticalAlign: 'middle', boxSizing: 'border-box', '&$disabled': { opacity: 0.5, pointerEvents: 'none' }, '& $avatar': { marginLeft: 5, marginRight: -6, width: 24, height: 24, color: theme.palette.type === 'light' ? theme.palette.grey[700] : theme.palette.grey[300], fontSize: theme.typography.pxToRem(12) }, '& $avatarColorPrimary': { color: theme.palette.primary.contrastText, backgroundColor: theme.palette.primary.dark }, '& $avatarColorSecondary': { color: theme.palette.secondary.contrastText, backgroundColor: theme.palette.secondary.dark }, '& $avatarSmall': { marginLeft: 4, marginRight: -4, width: 18, height: 18, fontSize: theme.typography.pxToRem(10) } }, sizeSmall: { height: 24 }, colorPrimary: { backgroundColor: theme.palette.primary.main, color: theme.palette.primary.contrastText }, colorSecondary: { backgroundColor: theme.palette.secondary.main, color: theme.palette.secondary.contrastText }, disabled: {}, clickable: { userSelect: 'none', WebkitTapHighlightColor: 'transparent', cursor: 'pointer', '&:hover, &:focus': { backgroundColor: emphasize(backgroundColor, 0.08) }, '&:active': { boxShadow: theme.shadows[1] } }, clickableColorPrimary: { '&:hover, &:focus': { backgroundColor: emphasize(theme.palette.primary.main, 0.08) } }, clickableColorSecondary: { '&:hover, &:focus': { backgroundColor: emphasize(theme.palette.secondary.main, 0.08) } }, deletable: { '&:focus': { backgroundColor: emphasize(backgroundColor, 0.08) } }, deletableColorPrimary: { '&:focus': { backgroundColor: emphasize(theme.palette.primary.main, 0.2) } }, deletableColorSecondary: { '&:focus': { backgroundColor: emphasize(theme.palette.secondary.main, 0.2) } }, outlined: { backgroundColor: 'transparent', border: "1px solid ".concat(theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'), '$clickable&:hover, $clickable&:focus, $deletable&:focus': { backgroundColor: alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity) }, '& $avatar': { marginLeft: 4 }, '& $avatarSmall': { marginLeft: 2 }, '& $icon': { marginLeft: 4 }, '& $iconSmall': { marginLeft: 2 }, '& $deleteIcon': { marginRight: 5 }, '& $deleteIconSmall': { marginRight: 3 } }, outlinedPrimary: { color: theme.palette.primary.main, border: "1px solid ".concat(theme.palette.primary.main), '$clickable&:hover, $clickable&:focus, $deletable&:focus': { backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity) } }, outlinedSecondary: { color: theme.palette.secondary.main, border: "1px solid ".concat(theme.palette.secondary.main), '$clickable&:hover, $clickable&:focus, $deletable&:focus': { backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity) } }, avatar: {}, avatarSmall: {}, avatarColorPrimary: {}, avatarColorSecondary: {}, icon: { color: theme.palette.type === 'light' ? theme.palette.grey[700] : theme.palette.grey[300], marginLeft: 5, marginRight: -6 }, iconSmall: { width: 18, height: 18, marginLeft: 4, marginRight: -4 }, iconColorPrimary: { color: 'inherit' }, iconColorSecondary: { color: 'inherit' }, label: { overflow: 'hidden', textOverflow: 'ellipsis', paddingLeft: 12, paddingRight: 12, whiteSpace: 'nowrap' }, labelSmall: { paddingLeft: 8, paddingRight: 8 }, deleteIcon: { WebkitTapHighlightColor: 'transparent', color: deleteIconColor, height: 22, width: 22, cursor: 'pointer', margin: '0 5px 0 -6px', '&:hover': { color: alpha(deleteIconColor, 0.4) } }, deleteIconSmall: { height: 16, width: 16, marginRight: 4, marginLeft: -4 }, deleteIconColorPrimary: { color: alpha(theme.palette.primary.contrastText, 0.7), '&:hover, &:active': { color: theme.palette.primary.contrastText } }, deleteIconColorSecondary: { color: alpha(theme.palette.secondary.contrastText, 0.7), '&:hover, &:active': { color: theme.palette.secondary.contrastText } }, deleteIconOutlinedColorPrimary: { color: alpha(theme.palette.primary.main, 0.7), '&:hover, &:active': { color: theme.palette.primary.main } }, deleteIconOutlinedColorSecondary: { color: alpha(theme.palette.secondary.main, 0.7), '&:hover, &:active': { color: theme.palette.secondary.main } } }; };
|
|
7034
|
+
function isDeleteKeyboardEvent(keyboardEvent) { return keyboardEvent.key === 'Backspace' || keyboardEvent.key === 'Delete'; }
|
|
7035
|
+
var Chip = /*#__PURE__*/ N$1(function Chip(props, ref) { var avatarProp = props.avatar, classes = props.classes, className = props.className, clickableProp = props.clickable, _props$color = props.color, color = _props$color === void 0 ? 'default' : _props$color, ComponentProp = props.component, deleteIconProp = props.deleteIcon, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, iconProp = props.icon, label = props.label, onClick = props.onClick, onDelete = props.onDelete, onKeyDown = props.onKeyDown, onKeyUp = props.onKeyUp, _props$size = props.size, size = _props$size === void 0 ? 'medium' : _props$size, _props$variant = props.variant, variant = _props$variant === void 0 ? 'default' : _props$variant, other = _objectWithoutProperties$2(props, ["avatar", "classes", "className", "clickable", "color", "component", "deleteIcon", "disabled", "icon", "label", "onClick", "onDelete", "onKeyDown", "onKeyUp", "size", "variant"]); var chipRef = _$1(null); var handleRef = useForkRef(chipRef, ref); var handleDeleteIconClick = function handleDeleteIconClick(event) { event.stopPropagation(); if (onDelete) {
|
|
7036
|
+
onDelete(event);
|
|
7037
|
+
} }; var handleKeyDown = function handleKeyDown(event) { if (event.currentTarget === event.target && isDeleteKeyboardEvent(event)) {
|
|
7038
|
+
event.preventDefault();
|
|
7039
|
+
} if (onKeyDown) {
|
|
7040
|
+
onKeyDown(event);
|
|
7041
|
+
} }; var handleKeyUp = function handleKeyUp(event) { if (event.currentTarget === event.target) {
|
|
7042
|
+
if (onDelete && isDeleteKeyboardEvent(event)) {
|
|
7043
|
+
onDelete(event);
|
|
7044
|
+
}
|
|
7045
|
+
else if (event.key === 'Escape' && chipRef.current) {
|
|
7046
|
+
chipRef.current.blur();
|
|
7047
|
+
}
|
|
7048
|
+
} if (onKeyUp) {
|
|
7049
|
+
onKeyUp(event);
|
|
7050
|
+
} }; var clickable = clickableProp !== false && onClick ? true : clickableProp; var small = size === 'small'; var Component = ComponentProp || (clickable ? ButtonBase$1 : 'div'); var moreProps = Component === ButtonBase$1 ? { component: 'div' } : {}; var deleteIcon = null; if (onDelete) {
|
|
7051
|
+
var customClasses = clsx(color !== 'default' && (variant === "default" ? classes["deleteIconColor".concat(capitalize(color))] : classes["deleteIconOutlinedColor".concat(capitalize(color))]), small && classes.deleteIconSmall);
|
|
7052
|
+
deleteIcon = deleteIconProp && /*#__PURE__*/ fn(deleteIconProp) ? /*#__PURE__*/ sn(deleteIconProp, { className: clsx(deleteIconProp.props.className, classes.deleteIcon, customClasses), onClick: handleDeleteIconClick }) : /*#__PURE__*/ y$3(CancelIcon, { className: clsx(classes.deleteIcon, customClasses), onClick: handleDeleteIconClick });
|
|
7053
|
+
} var avatar = null; if (avatarProp && /*#__PURE__*/ fn(avatarProp)) {
|
|
7054
|
+
avatar = /*#__PURE__*/ sn(avatarProp, { className: clsx(classes.avatar, avatarProp.props.className, small && classes.avatarSmall, color !== 'default' && classes["avatarColor".concat(capitalize(color))]) });
|
|
7055
|
+
} var icon = null; if (iconProp && /*#__PURE__*/ fn(iconProp)) {
|
|
7056
|
+
icon = /*#__PURE__*/ sn(iconProp, { className: clsx(classes.icon, iconProp.props.className, small && classes.iconSmall, color !== 'default' && classes["iconColor".concat(capitalize(color))]) });
|
|
7057
|
+
} return /*#__PURE__*/ y$3(Component, _extends$4({ role: clickable || onDelete ? 'button' : undefined, className: clsx(classes.root, className, color !== 'default' && [classes["color".concat(capitalize(color))], clickable && classes["clickableColor".concat(capitalize(color))], onDelete && classes["deletableColor".concat(capitalize(color))]], variant !== "default" && [classes.outlined, { 'primary': classes.outlinedPrimary, 'secondary': classes.outlinedSecondary }[color]], disabled && classes.disabled, small && classes.sizeSmall, clickable && classes.clickable, onDelete && classes.deletable), "aria-disabled": disabled ? true : undefined, tabIndex: clickable || onDelete ? 0 : undefined, onClick: onClick, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, ref: handleRef }, moreProps, other), avatar || icon, /*#__PURE__*/ y$3("span", { className: clsx(classes.label, small && classes.labelSmall) }, label), deleteIcon); });
|
|
7058
|
+
var Chip$1 = withStyles(styles$K, { name: 'MuiChip' })(Chip);
|
|
6994
7059
|
var SIZE = 44;
|
|
6995
|
-
var styles$
|
|
7060
|
+
var styles$J = function styles(theme) { return { root: { display: 'inline-block' }, "static": { transition: theme.transitions.create('transform') }, indeterminate: { animation: '$circular-rotate 1.4s linear infinite' }, determinate: { transition: theme.transitions.create('transform') }, colorPrimary: { color: theme.palette.primary.main }, colorSecondary: { color: theme.palette.secondary.main }, svg: { display: 'block' }, circle: { stroke: 'currentColor' }, circleStatic: { transition: theme.transitions.create('stroke-dashoffset') }, circleIndeterminate: { animation: '$circular-dash 1.4s ease-in-out infinite', strokeDasharray: '80px, 200px', strokeDashoffset: '0px' }, circleDeterminate: { transition: theme.transitions.create('stroke-dashoffset') }, '@keyframes circular-rotate': { '0%': { transformOrigin: '50% 50%' }, '100%': { transform: 'rotate(360deg)' } }, '@keyframes circular-dash': { '0%': { strokeDasharray: '1px, 200px', strokeDashoffset: '0px' }, '50%': { strokeDasharray: '100px, 200px', strokeDashoffset: '-15px' }, '100%': { strokeDasharray: '100px, 200px', strokeDashoffset: '-125px' } }, circleDisableShrink: { animation: 'none' } }; };
|
|
6996
7061
|
var CircularProgress = /*#__PURE__*/ N$1(function CircularProgress(props, ref) { var classes = props.classes, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'primary' : _props$color, _props$disableShrink = props.disableShrink, disableShrink = _props$disableShrink === void 0 ? false : _props$disableShrink, _props$size = props.size, size = _props$size === void 0 ? 40 : _props$size, style = props.style, _props$thickness = props.thickness, thickness = _props$thickness === void 0 ? 3.6 : _props$thickness, _props$value = props.value, value = _props$value === void 0 ? 0 : _props$value, _props$variant = props.variant, variant = _props$variant === void 0 ? 'indeterminate' : _props$variant, other = _objectWithoutProperties$2(props, ["classes", "className", "color", "disableShrink", "size", "style", "thickness", "value", "variant"]); var circleStyle = {}; var rootStyle = {}; var rootProps = {}; if (variant === 'determinate' || variant === 'static') {
|
|
6997
7062
|
var circumference = 2 * Math.PI * ((SIZE - thickness) / 2);
|
|
6998
7063
|
circleStyle.strokeDasharray = circumference.toFixed(3);
|
|
@@ -7000,7 +7065,7 @@ var CircularProgress = /*#__PURE__*/ N$1(function CircularProgress(props, ref) {
|
|
|
7000
7065
|
circleStyle.strokeDashoffset = "".concat(((100 - value) / 100 * circumference).toFixed(3), "px");
|
|
7001
7066
|
rootStyle.transform = 'rotate(-90deg)';
|
|
7002
7067
|
} return /*#__PURE__*/ y$3("div", _extends$4({ className: clsx(classes.root, className, color !== 'inherit' && classes["color".concat(capitalize(color))], { 'determinate': classes.determinate, 'indeterminate': classes.indeterminate, 'static': classes["static"] }[variant]), style: _extends$4({ width: size, height: size }, rootStyle, style), ref: ref, role: "progressbar" }, rootProps, other), /*#__PURE__*/ y$3("svg", { className: classes.svg, viewBox: "".concat(SIZE / 2, " ").concat(SIZE / 2, " ").concat(SIZE, " ").concat(SIZE) }, /*#__PURE__*/ y$3("circle", { className: clsx(classes.circle, disableShrink && classes.circleDisableShrink, { 'determinate': classes.circleDeterminate, 'indeterminate': classes.circleIndeterminate, 'static': classes.circleStatic }[variant]), style: circleStyle, cx: SIZE, cy: SIZE, r: (SIZE - thickness) / 2, fill: "none", strokeWidth: thickness }))); });
|
|
7003
|
-
var CircularProgress$1 = withStyles(styles$
|
|
7068
|
+
var CircularProgress$1 = withStyles(styles$J, { name: 'MuiCircularProgress', flip: false })(CircularProgress);
|
|
7004
7069
|
function mapEventPropToEvent(eventProp) { return eventProp.substring(2).toLowerCase(); }
|
|
7005
7070
|
function clickedRootScrollbar(event) { return document.documentElement.clientWidth < event.clientX || document.documentElement.clientHeight < event.clientY; }
|
|
7006
7071
|
function ClickAwayListener(props) { var children = props.children, _props$disableReactTr = props.disableReactTree, disableReactTree = _props$disableReactTr === void 0 ? false : _props$disableReactTr, _props$mouseEvent = props.mouseEvent, mouseEvent = _props$mouseEvent === void 0 ? 'onClick' : _props$mouseEvent, onClickAway = props.onClickAway, _props$touchEvent = props.touchEvent, touchEvent = _props$touchEvent === void 0 ? 'onTouchEnd' : _props$touchEvent; var movedRef = _$1(false); var nodeRef = _$1(null); var activatedRef = _$1(false); var syntheticEventRef = _$1(false); p$3(function () { setTimeout(function () { activatedRef.current = true; }, 0); return function () { activatedRef.current = false; }; }, []); var handleOwnRef = T$2(function (instance) { nodeRef.current = vn(instance); }, []); var handleRef = useForkRef(children.ref, handleOwnRef); var handleClickAway = useEventCallback(function (event) { var insideReactTree = syntheticEventRef.current; syntheticEventRef.current = false; if (!activatedRef.current || !nodeRef.current || clickedRootScrollbar(event)) {
|
|
@@ -7059,7 +7124,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
7059
7124
|
descriptor.configurable = true;
|
|
7060
7125
|
if ("value" in descriptor)
|
|
7061
7126
|
descriptor.writable = true;
|
|
7062
|
-
Object.defineProperty(target, toPropertyKey$
|
|
7127
|
+
Object.defineProperty(target, toPropertyKey$2(descriptor.key), descriptor);
|
|
7063
7128
|
} }
|
|
7064
7129
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps)
|
|
7065
7130
|
_defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -7168,12 +7233,12 @@ function Unstable_TrapFocus(props) { var children = props.children, _props$disab
|
|
|
7168
7233
|
}
|
|
7169
7234
|
nodeToRestore.current = null;
|
|
7170
7235
|
} }; }, [disableAutoFocus, disableEnforceFocus, disableRestoreFocus, isEnabled, open]); return /*#__PURE__*/ y$3(g$5, null, /*#__PURE__*/ y$3("div", { tabIndex: 0, ref: sentinelStart, "data-test": "sentinelStart" }), /*#__PURE__*/ sn(children, { ref: handleRef }), /*#__PURE__*/ y$3("div", { tabIndex: 0, ref: sentinelEnd, "data-test": "sentinelEnd" })); }
|
|
7171
|
-
var styles$
|
|
7172
|
-
var SimpleBackdrop = /*#__PURE__*/ N$1(function SimpleBackdrop(props, ref) { var _props$invisible = props.invisible, invisible = _props$invisible === void 0 ? false : _props$invisible, open = props.open, other = _objectWithoutProperties$2(props, ["invisible", "open"]); return open ? /*#__PURE__*/ y$3("div", _extends$4({ "aria-hidden": true, ref: ref }, other, { style: _extends$4({}, styles$
|
|
7236
|
+
var styles$I = { root: { zIndex: -1, position: 'fixed', right: 0, bottom: 0, top: 0, left: 0, backgroundColor: 'rgba(0, 0, 0, 0.5)', WebkitTapHighlightColor: 'transparent' }, invisible: { backgroundColor: 'transparent' } };
|
|
7237
|
+
var SimpleBackdrop = /*#__PURE__*/ N$1(function SimpleBackdrop(props, ref) { var _props$invisible = props.invisible, invisible = _props$invisible === void 0 ? false : _props$invisible, open = props.open, other = _objectWithoutProperties$2(props, ["invisible", "open"]); return open ? /*#__PURE__*/ y$3("div", _extends$4({ "aria-hidden": true, ref: ref }, other, { style: _extends$4({}, styles$I.root, invisible ? styles$I.invisible : {}, other.style) })) : null; });
|
|
7173
7238
|
function getContainer(container) { container = typeof container === 'function' ? container() : container; return vn(container); }
|
|
7174
7239
|
function getHasTransition(props) { return props.children ? props.children.props.hasOwnProperty('in') : false; }
|
|
7175
7240
|
var defaultManager = new ModalManager();
|
|
7176
|
-
var styles$
|
|
7241
|
+
var styles$H = function styles(theme) { return { root: { position: 'fixed', zIndex: theme.zIndex.modal, right: 0, bottom: 0, top: 0, left: 0 }, hidden: { visibility: 'hidden' } }; };
|
|
7177
7242
|
var Modal$1 = /*#__PURE__*/ N$1(function Modal(inProps, ref) { var theme = useTheme$1(); var props = getThemeProps({ name: 'MuiModal', props: _extends$4({}, inProps), theme: theme }); var _props$BackdropCompon = props.BackdropComponent, BackdropComponent = _props$BackdropCompon === void 0 ? SimpleBackdrop : _props$BackdropCompon, BackdropProps = props.BackdropProps, children = props.children, _props$closeAfterTran = props.closeAfterTransition, closeAfterTransition = _props$closeAfterTran === void 0 ? false : _props$closeAfterTran, container = props.container, _props$disableAutoFoc = props.disableAutoFocus, disableAutoFocus = _props$disableAutoFoc === void 0 ? false : _props$disableAutoFoc, _props$disableBackdro = props.disableBackdropClick, disableBackdropClick = _props$disableBackdro === void 0 ? false : _props$disableBackdro, _props$disableEnforce = props.disableEnforceFocus, disableEnforceFocus = _props$disableEnforce === void 0 ? false : _props$disableEnforce, _props$disableEscapeK = props.disableEscapeKeyDown, disableEscapeKeyDown = _props$disableEscapeK === void 0 ? false : _props$disableEscapeK, _props$disablePortal = props.disablePortal, disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal, _props$disableRestore = props.disableRestoreFocus, disableRestoreFocus = _props$disableRestore === void 0 ? false : _props$disableRestore, _props$disableScrollL = props.disableScrollLock, disableScrollLock = _props$disableScrollL === void 0 ? false : _props$disableScrollL, _props$hideBackdrop = props.hideBackdrop, hideBackdrop = _props$hideBackdrop === void 0 ? false : _props$hideBackdrop, _props$keepMounted = props.keepMounted, keepMounted = _props$keepMounted === void 0 ? false : _props$keepMounted, _props$manager = props.manager, manager = _props$manager === void 0 ? defaultManager : _props$manager, onBackdropClick = props.onBackdropClick, onClose = props.onClose, onEscapeKeyDown = props.onEscapeKeyDown, onRendered = props.onRendered, open = props.open, other = _objectWithoutProperties$2(props, ["BackdropComponent", "BackdropProps", "children", "closeAfterTransition", "container", "disableAutoFocus", "disableBackdropClick", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onEscapeKeyDown", "onRendered", "open"]); var _React$useState = h$4(true), exited = _React$useState[0], setExited = _React$useState[1]; var modal = _$1({}); var mountNodeRef = _$1(null); var modalRef = _$1(null); var handleRef = useForkRef(modalRef, ref); var hasTransition = getHasTransition(props); var getDoc = function getDoc() { return ownerDocument(mountNodeRef.current); }; var getModal = function getModal() { modal.current.modalRef = modalRef.current; modal.current.mountNode = mountNodeRef.current; return modal.current; }; var handleMounted = function handleMounted() { manager.mount(getModal(), { disableScrollLock: disableScrollLock }); modalRef.current.scrollTop = 0; }; var handleOpen = useEventCallback(function () { var resolvedContainer = getContainer(container) || getDoc().body; manager.add(getModal(), resolvedContainer); if (modalRef.current) {
|
|
7178
7243
|
handleMounted();
|
|
7179
7244
|
} }); var isTopModal = T$2(function () { return manager.isTopModal(getModal()); }, [manager]); var handlePortalRef = useEventCallback(function (node) { mountNodeRef.current = node; if (!node) {
|
|
@@ -7209,13 +7274,13 @@ else if (!hasTransition || !closeAfterTransition) {
|
|
|
7209
7274
|
if (onClose) {
|
|
7210
7275
|
onClose(event, 'escapeKeyDown');
|
|
7211
7276
|
}
|
|
7212
|
-
} }; var inlineStyle = styles$
|
|
7277
|
+
} }; var inlineStyle = styles$H(theme || { zIndex: zIndex }); var childProps = {}; if (children.props.tabIndex === undefined) {
|
|
7213
7278
|
childProps.tabIndex = children.props.tabIndex || '-1';
|
|
7214
7279
|
} if (hasTransition) {
|
|
7215
7280
|
childProps.onEnter = createChainedFunction(handleEnter, children.props.onEnter);
|
|
7216
7281
|
childProps.onExited = createChainedFunction(handleExited, children.props.onExited);
|
|
7217
7282
|
} return /*#__PURE__*/ y$3(Portal, { ref: handlePortalRef, container: container, disablePortal: disablePortal }, /*#__PURE__*/ y$3("div", _extends$4({ ref: handleRef, onKeyDown: handleKeyDown, role: "presentation" }, other, { style: _extends$4({}, inlineStyle.root, !open && exited ? inlineStyle.hidden : {}, other.style) }), hideBackdrop ? null : /*#__PURE__*/ y$3(BackdropComponent, _extends$4({ open: open, onClick: handleBackdropClick }, BackdropProps)), /*#__PURE__*/ y$3(Unstable_TrapFocus, { disableEnforceFocus: disableEnforceFocus, disableAutoFocus: disableAutoFocus, disableRestoreFocus: disableRestoreFocus, getDoc: getDoc, isEnabled: isTopModal, open: open }, /*#__PURE__*/ sn(children, childProps)))); });
|
|
7218
|
-
var styles$
|
|
7283
|
+
var styles$G = function styles(theme) { return { root: { '@media print': { position: 'absolute !important' } }, scrollPaper: { display: 'flex', justifyContent: 'center', alignItems: 'center' }, scrollBody: { overflowY: 'auto', overflowX: 'hidden', textAlign: 'center', '&:after': { content: '""', display: 'inline-block', verticalAlign: 'middle', height: '100%', width: '0' } }, container: { height: '100%', '@media print': { height: 'auto' }, outline: 0 }, paper: { margin: 32, position: 'relative', overflowY: 'auto', '@media print': { overflowY: 'visible', boxShadow: 'none' } }, paperScrollPaper: { display: 'flex', flexDirection: 'column', maxHeight: 'calc(100% - 64px)' }, paperScrollBody: { display: 'inline-block', verticalAlign: 'middle', textAlign: 'left' }, paperWidthFalse: { maxWidth: 'calc(100% - 64px)' }, paperWidthXs: { maxWidth: Math.max(theme.breakpoints.values.xs, 444), '&$paperScrollBody': _defineProperty$1({}, theme.breakpoints.down(Math.max(theme.breakpoints.values.xs, 444) + 32 * 2), { maxWidth: 'calc(100% - 64px)' }) }, paperWidthSm: { maxWidth: theme.breakpoints.values.sm, '&$paperScrollBody': _defineProperty$1({}, theme.breakpoints.down(theme.breakpoints.values.sm + 32 * 2), { maxWidth: 'calc(100% - 64px)' }) }, paperWidthMd: { maxWidth: theme.breakpoints.values.md, '&$paperScrollBody': _defineProperty$1({}, theme.breakpoints.down(theme.breakpoints.values.md + 32 * 2), { maxWidth: 'calc(100% - 64px)' }) }, paperWidthLg: { maxWidth: theme.breakpoints.values.lg, '&$paperScrollBody': _defineProperty$1({}, theme.breakpoints.down(theme.breakpoints.values.lg + 32 * 2), { maxWidth: 'calc(100% - 64px)' }) }, paperWidthXl: { maxWidth: theme.breakpoints.values.xl, '&$paperScrollBody': _defineProperty$1({}, theme.breakpoints.down(theme.breakpoints.values.xl + 32 * 2), { maxWidth: 'calc(100% - 64px)' }) }, paperFullWidth: { width: 'calc(100% - 64px)' }, paperFullScreen: { margin: 0, width: '100%', maxWidth: '100%', height: '100%', maxHeight: 'none', borderRadius: 0, '&$paperScrollBody': { margin: 0, maxWidth: '100%' } } }; };
|
|
7219
7284
|
var defaultTransitionDuration = { enter: duration.enteringScreen, exit: duration.leavingScreen };
|
|
7220
7285
|
var Dialog = /*#__PURE__*/ N$1(function Dialog(props, ref) { var BackdropProps = props.BackdropProps, children = props.children, classes = props.classes, className = props.className, _props$disableBackdro = props.disableBackdropClick, disableBackdropClick = _props$disableBackdro === void 0 ? false : _props$disableBackdro, _props$disableEscapeK = props.disableEscapeKeyDown, disableEscapeKeyDown = _props$disableEscapeK === void 0 ? false : _props$disableEscapeK, _props$fullScreen = props.fullScreen, fullScreen = _props$fullScreen === void 0 ? false : _props$fullScreen, _props$fullWidth = props.fullWidth, fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth, _props$maxWidth = props.maxWidth, maxWidth = _props$maxWidth === void 0 ? 'sm' : _props$maxWidth, onBackdropClick = props.onBackdropClick, onClose = props.onClose, onEnter = props.onEnter, onEntered = props.onEntered, onEntering = props.onEntering, onEscapeKeyDown = props.onEscapeKeyDown, onExit = props.onExit, onExited = props.onExited, onExiting = props.onExiting, open = props.open, _props$PaperComponent = props.PaperComponent, PaperComponent = _props$PaperComponent === void 0 ? Paper$1 : _props$PaperComponent, _props$PaperProps = props.PaperProps, PaperProps = _props$PaperProps === void 0 ? {} : _props$PaperProps, _props$scroll = props.scroll, scroll = _props$scroll === void 0 ? 'paper' : _props$scroll, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Fade : _props$TransitionComp, _props$transitionDura = props.transitionDuration, transitionDuration = _props$transitionDura === void 0 ? defaultTransitionDuration : _props$transitionDura, TransitionProps = props.TransitionProps, ariaDescribedby = props['aria-describedby'], ariaLabelledby = props['aria-labelledby'], other = _objectWithoutProperties$2(props, ["BackdropProps", "children", "classes", "className", "disableBackdropClick", "disableEscapeKeyDown", "fullScreen", "fullWidth", "maxWidth", "onBackdropClick", "onClose", "onEnter", "onEntered", "onEntering", "onEscapeKeyDown", "onExit", "onExited", "onExiting", "open", "PaperComponent", "PaperProps", "scroll", "TransitionComponent", "transitionDuration", "TransitionProps", "aria-describedby", "aria-labelledby"]); var mouseDownTarget = _$1(); var handleMouseDown = function handleMouseDown(event) { mouseDownTarget.current = event.target; }; var handleBackdropClick = function handleBackdropClick(event) { if (event.target !== event.currentTarget) {
|
|
7221
7286
|
return;
|
|
@@ -7226,16 +7291,19 @@ var Dialog = /*#__PURE__*/ N$1(function Dialog(props, ref) { var BackdropProps =
|
|
|
7226
7291
|
} if (!disableBackdropClick && onClose) {
|
|
7227
7292
|
onClose(event, 'backdropClick');
|
|
7228
7293
|
} }; return /*#__PURE__*/ y$3(Modal$1, _extends$4({ className: clsx(classes.root, className), BackdropComponent: Backdrop$1, BackdropProps: _extends$4({ transitionDuration: transitionDuration }, BackdropProps), closeAfterTransition: true }, disableBackdropClick ? { disableBackdropClick: disableBackdropClick } : {}, { disableEscapeKeyDown: disableEscapeKeyDown, onEscapeKeyDown: onEscapeKeyDown, onClose: onClose, open: open, ref: ref }, other), /*#__PURE__*/ y$3(TransitionComponent, _extends$4({ appear: true, "in": open, timeout: transitionDuration, onEnter: onEnter, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, role: "none presentation" }, TransitionProps), /*#__PURE__*/ y$3("div", { className: clsx(classes.container, classes["scroll".concat(capitalize(scroll))]), onMouseUp: handleBackdropClick, onMouseDown: handleMouseDown }, /*#__PURE__*/ y$3(PaperComponent, _extends$4({ elevation: 24, role: "dialog", "aria-describedby": ariaDescribedby, "aria-labelledby": ariaLabelledby }, PaperProps, { className: clsx(classes.paper, classes["paperScroll".concat(capitalize(scroll))], classes["paperWidth".concat(capitalize(String(maxWidth)))], PaperProps.className, fullScreen && classes.paperFullScreen, fullWidth && classes.paperFullWidth) }), children)))); });
|
|
7229
|
-
var Dialog$1 = withStyles(styles$
|
|
7230
|
-
var styles$
|
|
7294
|
+
var Dialog$1 = withStyles(styles$G, { name: 'MuiDialog' })(Dialog);
|
|
7295
|
+
var styles$F = { root: { display: 'flex', alignItems: 'center', padding: 8, justifyContent: 'flex-end', flex: '0 0 auto' }, spacing: { '& > :not(:first-child)': { marginLeft: 8 } } };
|
|
7231
7296
|
var DialogActions = /*#__PURE__*/ N$1(function DialogActions(props, ref) { var _props$disableSpacing = props.disableSpacing, disableSpacing = _props$disableSpacing === void 0 ? false : _props$disableSpacing, classes = props.classes, className = props.className, other = _objectWithoutProperties$2(props, ["disableSpacing", "classes", "className"]); return /*#__PURE__*/ y$3("div", _extends$4({ className: clsx(classes.root, className, !disableSpacing && classes.spacing), ref: ref }, other)); });
|
|
7232
|
-
var DialogActions$1 = withStyles(styles$
|
|
7233
|
-
var styles$
|
|
7297
|
+
var DialogActions$1 = withStyles(styles$F, { name: 'MuiDialogActions' })(DialogActions);
|
|
7298
|
+
var styles$E = function styles(theme) { return { root: { flex: '1 1 auto', WebkitOverflowScrolling: 'touch', overflowY: 'auto', padding: '8px 24px', '&:first-child': { paddingTop: 20 } }, dividers: { padding: '16px 24px', borderTop: "1px solid ".concat(theme.palette.divider), borderBottom: "1px solid ".concat(theme.palette.divider) } }; };
|
|
7234
7299
|
var DialogContent = /*#__PURE__*/ N$1(function DialogContent(props, ref) { var classes = props.classes, className = props.className, _props$dividers = props.dividers, dividers = _props$dividers === void 0 ? false : _props$dividers, other = _objectWithoutProperties$2(props, ["classes", "className", "dividers"]); return /*#__PURE__*/ y$3("div", _extends$4({ className: clsx(classes.root, className, dividers && classes.dividers), ref: ref }, other)); });
|
|
7235
|
-
var DialogContent$1 = withStyles(styles$
|
|
7236
|
-
var styles$
|
|
7237
|
-
var DialogTitle = /*#__PURE__*/ N$1(function DialogTitle(props, ref) { var children = props.children, classes = props.classes, className = props.className, _props$disableTypogra = props.disableTypography, disableTypography = _props$disableTypogra === void 0 ? false : _props$disableTypogra, other = _objectWithoutProperties$2(props, ["children", "classes", "className", "disableTypography"]); return /*#__PURE__*/ y$3("div", _extends$4({ className: clsx(classes.root, className), ref: ref }, other), disableTypography ? children : /*#__PURE__*/ y$3(
|
|
7238
|
-
var DialogTitle$1 = withStyles(styles$
|
|
7300
|
+
var DialogContent$1 = withStyles(styles$E, { name: 'MuiDialogContent' })(DialogContent);
|
|
7301
|
+
var styles$D = { root: { margin: 0, padding: '16px 24px', flex: '0 0 auto' } };
|
|
7302
|
+
var DialogTitle = /*#__PURE__*/ N$1(function DialogTitle(props, ref) { var children = props.children, classes = props.classes, className = props.className, _props$disableTypogra = props.disableTypography, disableTypography = _props$disableTypogra === void 0 ? false : _props$disableTypogra, other = _objectWithoutProperties$2(props, ["children", "classes", "className", "disableTypography"]); return /*#__PURE__*/ y$3("div", _extends$4({ className: clsx(classes.root, className), ref: ref }, other), disableTypography ? children : /*#__PURE__*/ y$3(Typography$2, { component: "h2", variant: "h6" }, children)); });
|
|
7303
|
+
var DialogTitle$1 = withStyles(styles$D, { name: 'MuiDialogTitle' })(DialogTitle);
|
|
7304
|
+
var styles$C = function styles(theme) { return { root: { height: 1, margin: 0, border: 'none', flexShrink: 0, backgroundColor: theme.palette.divider }, absolute: { position: 'absolute', bottom: 0, left: 0, width: '100%' }, inset: { marginLeft: 72 }, light: { backgroundColor: alpha(theme.palette.divider, 0.08) }, middle: { marginLeft: theme.spacing(2), marginRight: theme.spacing(2) }, vertical: { height: '100%', width: 1 }, flexItem: { alignSelf: 'stretch', height: 'auto' } }; };
|
|
7305
|
+
var Divider = /*#__PURE__*/ N$1(function Divider(props, ref) { var _props$absolute = props.absolute, absolute = _props$absolute === void 0 ? false : _props$absolute, classes = props.classes, className = props.className, _props$component = props.component, Component = _props$component === void 0 ? 'hr' : _props$component, _props$flexItem = props.flexItem, flexItem = _props$flexItem === void 0 ? false : _props$flexItem, _props$light = props.light, light = _props$light === void 0 ? false : _props$light, _props$orientation = props.orientation, orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation, _props$role = props.role, role = _props$role === void 0 ? Component !== 'hr' ? 'separator' : undefined : _props$role, _props$variant = props.variant, variant = _props$variant === void 0 ? 'fullWidth' : _props$variant, other = _objectWithoutProperties$2(props, ["absolute", "classes", "className", "component", "flexItem", "light", "orientation", "role", "variant"]); return /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, className, variant !== 'fullWidth' && classes[variant], absolute && classes.absolute, flexItem && classes.flexItem, light && classes.light, orientation === 'vertical' && classes.vertical), role: role, ref: ref }, other)); });
|
|
7306
|
+
var Divider$1 = withStyles(styles$C, { name: 'MuiDivider' })(Divider);
|
|
7239
7307
|
function formControlState(_ref) { var props = _ref.props, states = _ref.states, muiFormControl = _ref.muiFormControl; return states.reduce(function (acc, state) { acc[state] = props[state]; if (muiFormControl) {
|
|
7240
7308
|
if (typeof props[state] === 'undefined') {
|
|
7241
7309
|
acc[state] = muiFormControl[state];
|
|
@@ -7243,7 +7311,7 @@ function formControlState(_ref) { var props = _ref.props, states = _ref.states,
|
|
|
7243
7311
|
} return acc; }, {}); }
|
|
7244
7312
|
function getStyleValue(computedStyle, property) { return parseInt(computedStyle[property], 10) || 0; }
|
|
7245
7313
|
var useEnhancedEffect$4 = typeof window !== 'undefined' ? y$2 : p$3;
|
|
7246
|
-
var styles$
|
|
7314
|
+
var styles$B = { shadow: { visibility: 'hidden', position: 'absolute', overflow: 'hidden', height: 0, top: 0, left: 0, transform: 'translateZ(0)' } };
|
|
7247
7315
|
var TextareaAutosize = /*#__PURE__*/ N$1(function TextareaAutosize(props, ref) { var onChange = props.onChange, rows = props.rows, rowsMax = props.rowsMax, rowsMinProp = props.rowsMin, maxRowsProp = props.maxRows, _props$minRows = props.minRows, minRowsProp = _props$minRows === void 0 ? 1 : _props$minRows, style = props.style, value = props.value, other = _objectWithoutProperties$2(props, ["onChange", "rows", "rowsMax", "rowsMin", "maxRows", "minRows", "style", "value"]); var maxRows = maxRowsProp || rowsMax; var minRows = rows || rowsMinProp || minRowsProp; var _React$useRef = _$1(value != null), isControlled = _React$useRef.current; var inputRef = _$1(null); var handleRef = useForkRef(ref, inputRef); var shadowRef = _$1(null); var renders = _$1(0); var _React$useState = h$4({}), state = _React$useState[0], setState = _React$useState[1]; var syncHeight = T$2(function () { var input = inputRef.current; var computedStyle = window.getComputedStyle(input); var inputShallow = shadowRef.current; inputShallow.style.width = computedStyle.width; inputShallow.value = input.value || props.placeholder || 'x'; if (inputShallow.value.slice(-1) === '\n') {
|
|
7248
7316
|
inputShallow.value += ' ';
|
|
7249
7317
|
} var boxSizing = computedStyle['box-sizing']; var padding = getStyleValue(computedStyle, 'padding-bottom') + getStyleValue(computedStyle, 'padding-top'); var border = getStyleValue(computedStyle, 'border-bottom-width') + getStyleValue(computedStyle, 'border-top-width'); var innerHeight = inputShallow.scrollHeight - padding; inputShallow.value = 'x'; var singleRowHeight = inputShallow.scrollHeight - padding; var outerHeight = innerHeight; if (minRows) {
|
|
@@ -7257,10 +7325,11 @@ var TextareaAutosize = /*#__PURE__*/ N$1(function TextareaAutosize(props, ref) {
|
|
|
7257
7325
|
syncHeight();
|
|
7258
7326
|
} if (onChange) {
|
|
7259
7327
|
onChange(event);
|
|
7260
|
-
} }; return /*#__PURE__*/ y$3(g$5, null, /*#__PURE__*/ y$3("textarea", _extends$4({ value: value, onChange: handleChange, ref: handleRef, rows: minRows, style: _extends$4({ height: state.outerHeightStyle, overflow: state.overflow ? 'hidden' : null }, style) }, other)), /*#__PURE__*/ y$3("textarea", { "aria-hidden": true, className: props.className, readOnly: true, ref: shadowRef, tabIndex: -1, style: _extends$4({}, styles$
|
|
7328
|
+
} }; return /*#__PURE__*/ y$3(g$5, null, /*#__PURE__*/ y$3("textarea", _extends$4({ value: value, onChange: handleChange, ref: handleRef, rows: minRows, style: _extends$4({ height: state.outerHeightStyle, overflow: state.overflow ? 'hidden' : null }, style) }, other)), /*#__PURE__*/ y$3("textarea", { "aria-hidden": true, className: props.className, readOnly: true, ref: shadowRef, tabIndex: -1, style: _extends$4({}, styles$B.shadow, style) })); });
|
|
7261
7329
|
function hasValue(value) { return value != null && !(Array.isArray(value) && value.length === 0); }
|
|
7262
7330
|
function isFilled(obj) { var SSR = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; return obj && (hasValue(obj.value) && obj.value !== '' || SSR && hasValue(obj.defaultValue) && obj.defaultValue !== ''); }
|
|
7263
|
-
|
|
7331
|
+
function isAdornedStart(obj) { return obj.startAdornment; }
|
|
7332
|
+
var styles$A = function styles(theme) { var light = theme.palette.type === 'light'; var placeholder = { color: 'currentColor', opacity: light ? 0.42 : 0.5, transition: theme.transitions.create('opacity', { duration: theme.transitions.duration.shorter }) }; var placeholderHidden = { opacity: '0 !important' }; var placeholderVisible = { opacity: light ? 0.42 : 0.5 }; return { '@global': { '@keyframes mui-auto-fill': {}, '@keyframes mui-auto-fill-cancel': {} }, root: _extends$4({}, theme.typography.body1, { color: theme.palette.text.primary, lineHeight: '1.1876em', boxSizing: 'border-box', position: 'relative', cursor: 'text', display: 'inline-flex', alignItems: 'center', '&$disabled': { color: theme.palette.text.disabled, cursor: 'default' } }), formControl: {}, focused: {}, disabled: {}, adornedStart: {}, adornedEnd: {}, error: {}, marginDense: {}, multiline: { padding: "".concat(8 - 2, "px 0 ").concat(8 - 1, "px"), '&$marginDense': { paddingTop: 4 - 1 } }, colorSecondary: {}, fullWidth: { width: '100%' }, input: { font: 'inherit', letterSpacing: 'inherit', color: 'currentColor', padding: "".concat(8 - 2, "px 0 ").concat(8 - 1, "px"), border: 0, boxSizing: 'content-box', background: 'none', height: '1.1876em', margin: 0, WebkitTapHighlightColor: 'transparent', display: 'block', minWidth: 0, width: '100%', animationName: 'mui-auto-fill-cancel', animationDuration: '10ms', '&::-webkit-input-placeholder': placeholder, '&::-moz-placeholder': placeholder, '&:-ms-input-placeholder': placeholder, '&::-ms-input-placeholder': placeholder, '&:focus': { outline: 0 }, '&:invalid': { boxShadow: 'none' }, '&::-webkit-search-decoration': { '-webkit-appearance': 'none' }, 'label[data-shrink=false] + $formControl &': { '&::-webkit-input-placeholder': placeholderHidden, '&::-moz-placeholder': placeholderHidden, '&:-ms-input-placeholder': placeholderHidden, '&::-ms-input-placeholder': placeholderHidden, '&:focus::-webkit-input-placeholder': placeholderVisible, '&:focus::-moz-placeholder': placeholderVisible, '&:focus:-ms-input-placeholder': placeholderVisible, '&:focus::-ms-input-placeholder': placeholderVisible }, '&$disabled': { opacity: 1 }, '&:-webkit-autofill': { animationDuration: '5000s', animationName: 'mui-auto-fill' } }, inputMarginDense: { paddingTop: 4 - 1 }, inputMultiline: { height: 'auto', resize: 'none', padding: 0 }, inputTypeSearch: { '-moz-appearance': 'textfield', '-webkit-appearance': 'textfield' }, inputAdornedStart: {}, inputAdornedEnd: {}, inputHiddenLabel: {} }; };
|
|
7264
7333
|
var useEnhancedEffect$3 = typeof window === 'undefined' ? p$3 : y$2;
|
|
7265
7334
|
var InputBase = /*#__PURE__*/ N$1(function InputBase(props, ref) { var ariaDescribedby = props['aria-describedby'], autoComplete = props.autoComplete, autoFocus = props.autoFocus, classes = props.classes, className = props.className; props.color; var defaultValue = props.defaultValue, disabled = props.disabled, endAdornment = props.endAdornment; props.error; var _props$fullWidth = props.fullWidth, fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth, id = props.id, _props$inputComponent = props.inputComponent, inputComponent = _props$inputComponent === void 0 ? 'input' : _props$inputComponent, _props$inputProps = props.inputProps, inputPropsProp = _props$inputProps === void 0 ? {} : _props$inputProps, inputRefProp = props.inputRef; props.margin; var _props$multiline = props.multiline, multiline = _props$multiline === void 0 ? false : _props$multiline, name = props.name, onBlur = props.onBlur, onChange = props.onChange, onClick = props.onClick, onFocus = props.onFocus, onKeyDown = props.onKeyDown, onKeyUp = props.onKeyUp, placeholder = props.placeholder, readOnly = props.readOnly, renderSuffix = props.renderSuffix, rows = props.rows, rowsMax = props.rowsMax, rowsMin = props.rowsMin, maxRows = props.maxRows, minRows = props.minRows, startAdornment = props.startAdornment, _props$type = props.type, type = _props$type === void 0 ? 'text' : _props$type, valueProp = props.value, other = _objectWithoutProperties$2(props, ["aria-describedby", "autoComplete", "autoFocus", "classes", "className", "color", "defaultValue", "disabled", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "rowsMax", "rowsMin", "maxRows", "minRows", "startAdornment", "type", "value"]); var value = inputPropsProp.value != null ? inputPropsProp.value : valueProp; var _React$useRef = _$1(value != null), isControlled = _React$useRef.current; var inputRef = _$1(); var handleInputRefWarning = T$2(function (instance) { }, []); var handleInputPropsRefProp = useForkRef(inputPropsProp.ref, handleInputRefWarning); var handleInputRefProp = useForkRef(inputRefProp, handleInputPropsRefProp); var handleInputRef = useForkRef(inputRef, handleInputRefProp); var _React$useState = h$4(false), focused = _React$useState[0], setFocused = _React$useState[1]; var muiFormControl = useFormControl$1(); var fcs = formControlState({ props: props, muiFormControl: muiFormControl, states: ['color', 'disabled', 'error', 'hiddenLabel', 'margin', 'required', 'filled'] }); fcs.focused = muiFormControl ? muiFormControl.focused : focused; p$3(function () { if (!muiFormControl && disabled && focused) {
|
|
7266
7335
|
setFocused(false);
|
|
@@ -7330,15 +7399,50 @@ else {
|
|
|
7330
7399
|
} var handleAutoFill = function handleAutoFill(event) { checkDirty(event.animationName === 'mui-auto-fill-cancel' ? inputRef.current : { value: 'x' }); }; p$3(function () { if (muiFormControl) {
|
|
7331
7400
|
muiFormControl.setAdornedStart(Boolean(startAdornment));
|
|
7332
7401
|
} }, [muiFormControl, startAdornment]); return /*#__PURE__*/ y$3("div", _extends$4({ className: clsx(classes.root, classes["color".concat(capitalize(fcs.color || 'primary'))], className, fcs.disabled && classes.disabled, fcs.error && classes.error, fullWidth && classes.fullWidth, fcs.focused && classes.focused, muiFormControl && classes.formControl, multiline && classes.multiline, startAdornment && classes.adornedStart, endAdornment && classes.adornedEnd, fcs.margin === 'dense' && classes.marginDense), onClick: handleClick, ref: ref }, other), startAdornment, /*#__PURE__*/ y$3(FormControlContext.Provider, { value: null }, /*#__PURE__*/ y$3(InputComponent, _extends$4({ "aria-invalid": fcs.error, "aria-describedby": ariaDescribedby, autoComplete: autoComplete, autoFocus: autoFocus, defaultValue: defaultValue, disabled: fcs.disabled, id: id, onAnimationStart: handleAutoFill, name: name, placeholder: placeholder, readOnly: readOnly, required: fcs.required, rows: rows, value: value, onKeyDown: onKeyDown, onKeyUp: onKeyUp }, inputProps, { className: clsx(classes.input, inputPropsProp.className, fcs.disabled && classes.disabled, multiline && classes.inputMultiline, fcs.hiddenLabel && classes.inputHiddenLabel, startAdornment && classes.inputAdornedStart, endAdornment && classes.inputAdornedEnd, type === 'search' && classes.inputTypeSearch, fcs.margin === 'dense' && classes.inputMarginDense), onBlur: handleBlur, onChange: handleChange, onFocus: handleFocus }))), endAdornment, renderSuffix ? renderSuffix(_extends$4({}, fcs, { startAdornment: startAdornment })) : null); });
|
|
7333
|
-
var InputBase$1 = withStyles(styles$
|
|
7334
|
-
var styles$
|
|
7402
|
+
var InputBase$1 = withStyles(styles$A, { name: 'MuiInputBase' })(InputBase);
|
|
7403
|
+
var styles$z = function styles(theme) { var light = theme.palette.type === 'light'; var bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)'; var backgroundColor = light ? 'rgba(0, 0, 0, 0.09)' : 'rgba(255, 255, 255, 0.09)'; return { root: { position: 'relative', backgroundColor: backgroundColor, borderTopLeftRadius: theme.shape.borderRadius, borderTopRightRadius: theme.shape.borderRadius, transition: theme.transitions.create('background-color', { duration: theme.transitions.duration.shorter, easing: theme.transitions.easing.easeOut }), '&:hover': { backgroundColor: light ? 'rgba(0, 0, 0, 0.13)' : 'rgba(255, 255, 255, 0.13)', '@media (hover: none)': { backgroundColor: backgroundColor } }, '&$focused': { backgroundColor: light ? 'rgba(0, 0, 0, 0.09)' : 'rgba(255, 255, 255, 0.09)' }, '&$disabled': { backgroundColor: light ? 'rgba(0, 0, 0, 0.12)' : 'rgba(255, 255, 255, 0.12)' } }, colorSecondary: { '&$underline:after': { borderBottomColor: theme.palette.secondary.main } }, underline: { '&:after': { borderBottom: "2px solid ".concat(theme.palette.primary.main), left: 0, bottom: 0, content: '""', position: 'absolute', right: 0, transform: 'scaleX(0)', transition: theme.transitions.create('transform', { duration: theme.transitions.duration.shorter, easing: theme.transitions.easing.easeOut }), pointerEvents: 'none' }, '&$focused:after': { transform: 'scaleX(1)' }, '&$error:after': { borderBottomColor: theme.palette.error.main, transform: 'scaleX(1)' }, '&:before': { borderBottom: "1px solid ".concat(bottomLineColor), left: 0, bottom: 0, content: '"\\00a0"', position: 'absolute', right: 0, transition: theme.transitions.create('border-bottom-color', { duration: theme.transitions.duration.shorter }), pointerEvents: 'none' }, '&:hover:before': { borderBottom: "1px solid ".concat(theme.palette.text.primary) }, '&$disabled:before': { borderBottomStyle: 'dotted' } }, focused: {}, disabled: {}, adornedStart: { paddingLeft: 12 }, adornedEnd: { paddingRight: 12 }, error: {}, marginDense: {}, multiline: { padding: '27px 12px 10px', '&$marginDense': { paddingTop: 23, paddingBottom: 6 } }, input: { padding: '27px 12px 10px', '&:-webkit-autofill': { WebkitBoxShadow: theme.palette.type === 'light' ? null : '0 0 0 100px #266798 inset', WebkitTextFillColor: theme.palette.type === 'light' ? null : '#fff', caretColor: theme.palette.type === 'light' ? null : '#fff', borderTopLeftRadius: 'inherit', borderTopRightRadius: 'inherit' } }, inputMarginDense: { paddingTop: 23, paddingBottom: 6 }, inputHiddenLabel: { paddingTop: 18, paddingBottom: 19, '&$inputMarginDense': { paddingTop: 10, paddingBottom: 11 } }, inputMultiline: { padding: 0 }, inputAdornedStart: { paddingLeft: 0 }, inputAdornedEnd: { paddingRight: 0 } }; };
|
|
7335
7404
|
var FilledInput = /*#__PURE__*/ N$1(function FilledInput(props, ref) { var disableUnderline = props.disableUnderline, classes = props.classes, _props$fullWidth = props.fullWidth, fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth, _props$inputComponent = props.inputComponent, inputComponent = _props$inputComponent === void 0 ? 'input' : _props$inputComponent, _props$multiline = props.multiline, multiline = _props$multiline === void 0 ? false : _props$multiline, _props$type = props.type, type = _props$type === void 0 ? 'text' : _props$type, other = _objectWithoutProperties$2(props, ["disableUnderline", "classes", "fullWidth", "inputComponent", "multiline", "type"]); return /*#__PURE__*/ y$3(InputBase$1, _extends$4({ classes: _extends$4({}, classes, { root: clsx(classes.root, !disableUnderline && classes.underline), underline: null }), fullWidth: fullWidth, inputComponent: inputComponent, multiline: multiline, ref: ref, type: type }, other)); });
|
|
7336
7405
|
FilledInput.muiName = 'Input';
|
|
7337
|
-
var FilledInput$1 = withStyles(styles$
|
|
7406
|
+
var FilledInput$1 = withStyles(styles$z, { name: 'MuiFilledInput' })(FilledInput);
|
|
7407
|
+
var styles$y = { root: { display: 'inline-flex', flexDirection: 'column', position: 'relative', minWidth: 0, padding: 0, margin: 0, border: 0, verticalAlign: 'top' }, marginNormal: { marginTop: 16, marginBottom: 8 }, marginDense: { marginTop: 8, marginBottom: 4 }, fullWidth: { width: '100%' } };
|
|
7408
|
+
var FormControl = /*#__PURE__*/ N$1(function FormControl(props, ref) { var children = props.children, classes = props.classes, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'primary' : _props$color, _props$component = props.component, Component = _props$component === void 0 ? 'div' : _props$component, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, _props$error = props.error, error = _props$error === void 0 ? false : _props$error, _props$fullWidth = props.fullWidth, fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth, visuallyFocused = props.focused, _props$hiddenLabel = props.hiddenLabel, hiddenLabel = _props$hiddenLabel === void 0 ? false : _props$hiddenLabel, _props$margin = props.margin, margin = _props$margin === void 0 ? 'none' : _props$margin, _props$required = props.required, required = _props$required === void 0 ? false : _props$required, size = props.size, _props$variant = props.variant, variant = _props$variant === void 0 ? 'standard' : _props$variant, other = _objectWithoutProperties$2(props, ["children", "classes", "className", "color", "component", "disabled", "error", "fullWidth", "focused", "hiddenLabel", "margin", "required", "size", "variant"]); var _React$useState = h$4(function () { var initialAdornedStart = false; if (children) {
|
|
7409
|
+
A$3.forEach(children, function (child) { if (!isMuiElement(child, ['Input', 'Select'])) {
|
|
7410
|
+
return;
|
|
7411
|
+
} var input = isMuiElement(child, ['Select']) ? child.props.input : child; if (input && isAdornedStart(input.props)) {
|
|
7412
|
+
initialAdornedStart = true;
|
|
7413
|
+
} });
|
|
7414
|
+
} return initialAdornedStart; }), adornedStart = _React$useState[0], setAdornedStart = _React$useState[1]; var _React$useState2 = h$4(function () { var initialFilled = false; if (children) {
|
|
7415
|
+
A$3.forEach(children, function (child) { if (!isMuiElement(child, ['Input', 'Select'])) {
|
|
7416
|
+
return;
|
|
7417
|
+
} if (isFilled(child.props, true)) {
|
|
7418
|
+
initialFilled = true;
|
|
7419
|
+
} });
|
|
7420
|
+
} return initialFilled; }), filled = _React$useState2[0], setFilled = _React$useState2[1]; var _React$useState3 = h$4(false), _focused = _React$useState3[0], setFocused = _React$useState3[1]; var focused = visuallyFocused !== undefined ? visuallyFocused : _focused; if (disabled && focused) {
|
|
7421
|
+
setFocused(false);
|
|
7422
|
+
} var registerEffect; var onFilled = T$2(function () { setFilled(true); }, []); var onEmpty = T$2(function () { setFilled(false); }, []); var childContext = { adornedStart: adornedStart, setAdornedStart: setAdornedStart, color: color, disabled: disabled, error: error, filled: filled, focused: focused, fullWidth: fullWidth, hiddenLabel: hiddenLabel, margin: (size === 'small' ? 'dense' : undefined) || margin, onBlur: function onBlur() { setFocused(false); }, onEmpty: onEmpty, onFilled: onFilled, onFocus: function onFocus() { setFocused(true); }, registerEffect: registerEffect, required: required, variant: variant }; return /*#__PURE__*/ y$3(FormControlContext.Provider, { value: childContext }, /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, className, margin !== 'none' && classes["margin".concat(capitalize(margin))], fullWidth && classes.fullWidth), ref: ref }, other), children)); });
|
|
7423
|
+
var FormControl$1 = withStyles(styles$y, { name: 'MuiFormControl' })(FormControl);
|
|
7424
|
+
var styles$x = function styles(theme) { return { root: { display: 'inline-flex', alignItems: 'center', cursor: 'pointer', verticalAlign: 'middle', WebkitTapHighlightColor: 'transparent', marginLeft: -11, marginRight: 16, '&$disabled': { cursor: 'default' } }, labelPlacementStart: { flexDirection: 'row-reverse', marginLeft: 16, marginRight: -11 }, labelPlacementTop: { flexDirection: 'column-reverse', marginLeft: 16 }, labelPlacementBottom: { flexDirection: 'column', marginLeft: 16 }, disabled: {}, label: { '&$disabled': { color: theme.palette.text.disabled } } }; };
|
|
7425
|
+
var FormControlLabel = /*#__PURE__*/ N$1(function FormControlLabel(props, ref) { props.checked; var classes = props.classes, className = props.className, control = props.control, disabledProp = props.disabled; props.inputRef; var label = props.label, _props$labelPlacement = props.labelPlacement, labelPlacement = _props$labelPlacement === void 0 ? 'end' : _props$labelPlacement; props.name; props.onChange; props.value; var other = _objectWithoutProperties$2(props, ["checked", "classes", "className", "control", "disabled", "inputRef", "label", "labelPlacement", "name", "onChange", "value"]); var muiFormControl = useFormControl(); var disabled = disabledProp; if (typeof disabled === 'undefined' && typeof control.props.disabled !== 'undefined') {
|
|
7426
|
+
disabled = control.props.disabled;
|
|
7427
|
+
} if (typeof disabled === 'undefined' && muiFormControl) {
|
|
7428
|
+
disabled = muiFormControl.disabled;
|
|
7429
|
+
} var controlProps = { disabled: disabled }; ['checked', 'name', 'onChange', 'value', 'inputRef'].forEach(function (key) { if (typeof control.props[key] === 'undefined' && typeof props[key] !== 'undefined') {
|
|
7430
|
+
controlProps[key] = props[key];
|
|
7431
|
+
} }); return /*#__PURE__*/ y$3("label", _extends$4({ className: clsx(classes.root, className, labelPlacement !== 'end' && classes["labelPlacement".concat(capitalize(labelPlacement))], disabled && classes.disabled), ref: ref }, other), /*#__PURE__*/ sn(control, controlProps), /*#__PURE__*/ y$3(Typography$2, { component: "span", className: clsx(classes.label, disabled && classes.disabled) }, label)); });
|
|
7432
|
+
var FormControlLabel$1 = withStyles(styles$x, { name: 'MuiFormControlLabel' })(FormControlLabel);
|
|
7433
|
+
var styles$w = { root: { display: 'flex', flexDirection: 'column', flexWrap: 'wrap' }, row: { flexDirection: 'row' } };
|
|
7434
|
+
var FormGroup = /*#__PURE__*/ N$1(function FormGroup(props, ref) { var classes = props.classes, className = props.className, _props$row = props.row, row = _props$row === void 0 ? false : _props$row, other = _objectWithoutProperties$2(props, ["classes", "className", "row"]); return /*#__PURE__*/ y$3("div", _extends$4({ className: clsx(classes.root, className, row && classes.row), ref: ref }, other)); });
|
|
7435
|
+
var FormGroup$1 = withStyles(styles$w, { name: 'MuiFormGroup' })(FormGroup);
|
|
7436
|
+
var styles$v = function styles(theme) { return { root: _extends$4({ color: theme.palette.text.secondary }, theme.typography.caption, { textAlign: 'left', marginTop: 3, margin: 0, '&$disabled': { color: theme.palette.text.disabled }, '&$error': { color: theme.palette.error.main } }), error: {}, disabled: {}, marginDense: { marginTop: 4 }, contained: { marginLeft: 14, marginRight: 14 }, focused: {}, filled: {}, required: {} }; };
|
|
7437
|
+
var FormHelperText = /*#__PURE__*/ N$1(function FormHelperText(props, ref) { var children = props.children, classes = props.classes, className = props.className, _props$component = props.component, Component = _props$component === void 0 ? 'p' : _props$component; props.disabled; props.error; props.filled; props.focused; props.margin; props.required; props.variant; var other = _objectWithoutProperties$2(props, ["children", "classes", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"]); var muiFormControl = useFormControl(); var fcs = formControlState({ props: props, muiFormControl: muiFormControl, states: ['variant', 'margin', 'disabled', 'error', 'filled', 'focused', 'required'] }); return /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, (fcs.variant === 'filled' || fcs.variant === 'outlined') && classes.contained, className, fcs.disabled && classes.disabled, fcs.error && classes.error, fcs.filled && classes.filled, fcs.focused && classes.focused, fcs.required && classes.required, fcs.margin === 'dense' && classes.marginDense), ref: ref }, other), children === ' ' ? /*#__PURE__*/ y$3("span", { dangerouslySetInnerHTML: { __html: '​' } }) : children); });
|
|
7438
|
+
var FormHelperText$1 = withStyles(styles$v, { name: 'MuiFormHelperText' })(FormHelperText);
|
|
7439
|
+
var styles$u = function styles(theme) { return { root: _extends$4({ color: theme.palette.text.secondary }, theme.typography.body1, { lineHeight: 1, padding: 0, '&$focused': { color: theme.palette.primary.main }, '&$disabled': { color: theme.palette.text.disabled }, '&$error': { color: theme.palette.error.main } }), colorSecondary: { '&$focused': { color: theme.palette.secondary.main } }, focused: {}, disabled: {}, error: {}, filled: {}, required: {}, asterisk: { '&$error': { color: theme.palette.error.main } } }; };
|
|
7440
|
+
var FormLabel = /*#__PURE__*/ N$1(function FormLabel(props, ref) { var children = props.children, classes = props.classes, className = props.className; props.color; var _props$component = props.component, Component = _props$component === void 0 ? 'label' : _props$component; props.disabled; props.error; props.filled; props.focused; props.required; var other = _objectWithoutProperties$2(props, ["children", "classes", "className", "color", "component", "disabled", "error", "filled", "focused", "required"]); var muiFormControl = useFormControl(); var fcs = formControlState({ props: props, muiFormControl: muiFormControl, states: ['color', 'required', 'focused', 'disabled', 'error', 'filled'] }); return /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, classes["color".concat(capitalize(fcs.color || 'primary'))], className, fcs.disabled && classes.disabled, fcs.error && classes.error, fcs.filled && classes.filled, fcs.focused && classes.focused, fcs.required && classes.required), ref: ref }, other), children, fcs.required && /*#__PURE__*/ y$3("span", { "aria-hidden": true, className: clsx(classes.asterisk, fcs.error && classes.error) }, "\u2009", '*')); });
|
|
7441
|
+
var FormLabel$1 = withStyles(styles$u, { name: 'MuiFormLabel' })(FormLabel);
|
|
7338
7442
|
function getScale(value) { return "scale(".concat(value, ", ").concat(Math.pow(value, 2), ")"); }
|
|
7339
|
-
var styles$
|
|
7443
|
+
var styles$t = { entering: { opacity: 1, transform: getScale(1) }, entered: { opacity: 1, transform: 'none' } };
|
|
7340
7444
|
var Grow = /*#__PURE__*/ N$1(function Grow(props, ref) { var children = props.children, _props$disableStrictM = props.disableStrictModeCompat, disableStrictModeCompat = _props$disableStrictM === void 0 ? false : _props$disableStrictM, inProp = props["in"], onEnter = props.onEnter, onEntered = props.onEntered, onEntering = props.onEntering, onExit = props.onExit, onExited = props.onExited, onExiting = props.onExiting, style = props.style, _props$timeout = props.timeout, timeout = _props$timeout === void 0 ? 'auto' : _props$timeout, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Transition : _props$TransitionComp, other = _objectWithoutProperties$2(props, ["children", "disableStrictModeCompat", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"]); var timer = _$1(); var autoTimeout = _$1(); var theme = useTheme(); var enableStrictModeCompat = theme.unstable_strictMode && !disableStrictModeCompat; var nodeRef = _$1(null); var foreignRef = useForkRef(children.ref, ref); var handleRef = useForkRef(enableStrictModeCompat ? nodeRef : undefined, foreignRef); var normalizedTransitionCallback = function normalizedTransitionCallback(callback) { return function (nodeOrAppearing, maybeAppearing) { if (callback) {
|
|
7341
|
-
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing], _ref2 = _slicedToArray(_ref, 2), node = _ref2[0], isAppearing = _ref2[1];
|
|
7445
|
+
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing], _ref2 = _slicedToArray$1(_ref, 2), node = _ref2[0], isAppearing = _ref2[1];
|
|
7342
7446
|
if (isAppearing === undefined) {
|
|
7343
7447
|
callback(node);
|
|
7344
7448
|
}
|
|
@@ -7363,7 +7467,7 @@ else {
|
|
|
7363
7467
|
onExit(node);
|
|
7364
7468
|
} }); var handleExited = normalizedTransitionCallback(onExited); var addEndListener = function addEndListener(nodeOrNext, maybeNext) { var next = enableStrictModeCompat ? nodeOrNext : maybeNext; if (timeout === 'auto') {
|
|
7365
7469
|
timer.current = setTimeout(next, autoTimeout.current || 0);
|
|
7366
|
-
} }; p$3(function () { return function () { clearTimeout(timer.current); }; }, []); return /*#__PURE__*/ y$3(TransitionComponent, _extends$4({ appear: true, "in": inProp, nodeRef: enableStrictModeCompat ? nodeRef : undefined, onEnter: handleEnter, onEntered: handleEntered, onEntering: handleEntering, onExit: handleExit, onExited: handleExited, onExiting: handleExiting, addEndListener: addEndListener, timeout: timeout === 'auto' ? null : timeout }, other), function (state, childProps) { return /*#__PURE__*/ sn(children, _extends$4({ style: _extends$4({ opacity: 0, transform: getScale(0.75), visibility: state === 'exited' && !inProp ? 'hidden' : undefined }, styles$
|
|
7470
|
+
} }; p$3(function () { return function () { clearTimeout(timer.current); }; }, []); return /*#__PURE__*/ y$3(TransitionComponent, _extends$4({ appear: true, "in": inProp, nodeRef: enableStrictModeCompat ? nodeRef : undefined, onEnter: handleEnter, onEntered: handleEntered, onEntering: handleEntering, onExit: handleExit, onExited: handleExited, onExiting: handleExiting, addEndListener: addEndListener, timeout: timeout === 'auto' ? null : timeout }, other), function (state, childProps) { return /*#__PURE__*/ sn(children, _extends$4({ style: _extends$4({ opacity: 0, transform: getScale(0.75), visibility: state === 'exited' && !inProp ? 'hidden' : undefined }, styles$t[state], style, children.props.style), ref: handleRef }, childProps)); }); });
|
|
7367
7471
|
Grow.muiSupportAuto = true;
|
|
7368
7472
|
function useMediaQuery(queryInput) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var theme = useTheme$1(); var props = getThemeProps({ theme: theme, name: 'MuiUseMediaQuery', props: {} }); var query = typeof queryInput === 'function' ? queryInput(theme) : queryInput; query = query.replace(/^@media( ?)/m, ''); var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined'; var _props$options = _extends$4({}, props, options), _props$options$defaul = _props$options.defaultMatches, defaultMatches = _props$options$defaul === void 0 ? false : _props$options$defaul, _props$options$matchM = _props$options.matchMedia, matchMedia = _props$options$matchM === void 0 ? supportMatchMedia ? window.matchMedia : null : _props$options$matchM, _props$options$noSsr = _props$options.noSsr, noSsr = _props$options$noSsr === void 0 ? false : _props$options$noSsr, _props$options$ssrMat = _props$options.ssrMatchMedia, ssrMatchMedia = _props$options$ssrMat === void 0 ? null : _props$options$ssrMat; var _React$useState = h$4(function () { if (noSsr && supportMatchMedia) {
|
|
7369
7473
|
return matchMedia(query).matches;
|
|
@@ -7374,15 +7478,20 @@ function useMediaQuery(queryInput) { var options = arguments.length > 1 && argum
|
|
|
7374
7478
|
} var queryList = matchMedia(query); var updateMatch = function updateMatch() { if (active) {
|
|
7375
7479
|
setMatch(queryList.matches);
|
|
7376
7480
|
} }; updateMatch(); queryList.addListener(updateMatch); return function () { active = false; queryList.removeListener(updateMatch); }; }, [query, matchMedia, supportMatchMedia]); return match; }
|
|
7377
|
-
var styles$
|
|
7378
|
-
var Input$
|
|
7379
|
-
Input$
|
|
7380
|
-
var Input$
|
|
7481
|
+
var styles$s = function styles(theme) { var light = theme.palette.type === 'light'; var bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)'; return { root: { position: 'relative' }, formControl: { 'label + &': { marginTop: 16 } }, focused: {}, disabled: {}, colorSecondary: { '&$underline:after': { borderBottomColor: theme.palette.secondary.main } }, underline: { '&:after': { borderBottom: "2px solid ".concat(theme.palette.primary.main), left: 0, bottom: 0, content: '""', position: 'absolute', right: 0, transform: 'scaleX(0)', transition: theme.transitions.create('transform', { duration: theme.transitions.duration.shorter, easing: theme.transitions.easing.easeOut }), pointerEvents: 'none' }, '&$focused:after': { transform: 'scaleX(1)' }, '&$error:after': { borderBottomColor: theme.palette.error.main, transform: 'scaleX(1)' }, '&:before': { borderBottom: "1px solid ".concat(bottomLineColor), left: 0, bottom: 0, content: '"\\00a0"', position: 'absolute', right: 0, transition: theme.transitions.create('border-bottom-color', { duration: theme.transitions.duration.shorter }), pointerEvents: 'none' }, '&:hover:not($disabled):before': { borderBottom: "2px solid ".concat(theme.palette.text.primary), '@media (hover: none)': { borderBottom: "1px solid ".concat(bottomLineColor) } }, '&$disabled:before': { borderBottomStyle: 'dotted' } }, error: {}, marginDense: {}, multiline: {}, fullWidth: {}, input: {}, inputMarginDense: {}, inputMultiline: {}, inputTypeSearch: {} }; };
|
|
7482
|
+
var Input$2 = /*#__PURE__*/ N$1(function Input(props, ref) { var disableUnderline = props.disableUnderline, classes = props.classes, _props$fullWidth = props.fullWidth, fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth, _props$inputComponent = props.inputComponent, inputComponent = _props$inputComponent === void 0 ? 'input' : _props$inputComponent, _props$multiline = props.multiline, multiline = _props$multiline === void 0 ? false : _props$multiline, _props$type = props.type, type = _props$type === void 0 ? 'text' : _props$type, other = _objectWithoutProperties$2(props, ["disableUnderline", "classes", "fullWidth", "inputComponent", "multiline", "type"]); return /*#__PURE__*/ y$3(InputBase$1, _extends$4({ classes: _extends$4({}, classes, { root: clsx(classes.root, !disableUnderline && classes.underline), underline: null }), fullWidth: fullWidth, inputComponent: inputComponent, multiline: multiline, ref: ref, type: type }, other)); });
|
|
7483
|
+
Input$2.muiName = 'Input';
|
|
7484
|
+
var Input$3 = withStyles(styles$s, { name: 'MuiInput' })(Input$2);
|
|
7485
|
+
var styles$r = function styles(theme) { return { root: { display: 'block', transformOrigin: 'top left' }, focused: {}, disabled: {}, error: {}, required: {}, asterisk: {}, formControl: { position: 'absolute', left: 0, top: 0, transform: 'translate(0, 24px) scale(1)' }, marginDense: { transform: 'translate(0, 21px) scale(1)' }, shrink: { transform: 'translate(0, 1.5px) scale(0.75)', transformOrigin: 'top left' }, animated: { transition: theme.transitions.create(['color', 'transform'], { duration: theme.transitions.duration.shorter, easing: theme.transitions.easing.easeOut }) }, filled: { zIndex: 1, pointerEvents: 'none', transform: 'translate(12px, 20px) scale(1)', '&$marginDense': { transform: 'translate(12px, 17px) scale(1)' }, '&$shrink': { transform: 'translate(12px, 10px) scale(0.75)', '&$marginDense': { transform: 'translate(12px, 7px) scale(0.75)' } } }, outlined: { zIndex: 1, pointerEvents: 'none', transform: 'translate(14px, 20px) scale(1)', '&$marginDense': { transform: 'translate(14px, 12px) scale(1)' }, '&$shrink': { transform: 'translate(14px, -6px) scale(0.75)' } } }; };
|
|
7486
|
+
var InputLabel = /*#__PURE__*/ N$1(function InputLabel(props, ref) { var classes = props.classes, className = props.className, _props$disableAnimati = props.disableAnimation, disableAnimation = _props$disableAnimati === void 0 ? false : _props$disableAnimati; props.margin; var shrinkProp = props.shrink; props.variant; var other = _objectWithoutProperties$2(props, ["classes", "className", "disableAnimation", "margin", "shrink", "variant"]); var muiFormControl = useFormControl(); var shrink = shrinkProp; if (typeof shrink === 'undefined' && muiFormControl) {
|
|
7487
|
+
shrink = muiFormControl.filled || muiFormControl.focused || muiFormControl.adornedStart;
|
|
7488
|
+
} var fcs = formControlState({ props: props, muiFormControl: muiFormControl, states: ['margin', 'variant'] }); return /*#__PURE__*/ y$3(FormLabel$1, _extends$4({ "data-shrink": shrink, className: clsx(classes.root, className, muiFormControl && classes.formControl, !disableAnimation && classes.animated, shrink && classes.shrink, fcs.margin === 'dense' && classes.marginDense, { 'filled': classes.filled, 'outlined': classes.outlined }[fcs.variant]), classes: { focused: classes.focused, disabled: classes.disabled, error: classes.error, required: classes.required, asterisk: classes.asterisk }, ref: ref }, other)); });
|
|
7489
|
+
var InputLabel$1 = withStyles(styles$r, { name: 'MuiInputLabel' })(InputLabel);
|
|
7381
7490
|
var ListContext = /*#__PURE__*/ F$4({});
|
|
7382
|
-
var styles$
|
|
7491
|
+
var styles$q = { root: { listStyle: 'none', margin: 0, padding: 0, position: 'relative' }, padding: { paddingTop: 8, paddingBottom: 8 }, dense: {}, subheader: { paddingTop: 0 } };
|
|
7383
7492
|
var List = /*#__PURE__*/ N$1(function List(props, ref) { var children = props.children, classes = props.classes, className = props.className, _props$component = props.component, Component = _props$component === void 0 ? 'ul' : _props$component, _props$dense = props.dense, dense = _props$dense === void 0 ? false : _props$dense, _props$disablePadding = props.disablePadding, disablePadding = _props$disablePadding === void 0 ? false : _props$disablePadding, subheader = props.subheader, other = _objectWithoutProperties$2(props, ["children", "classes", "className", "component", "dense", "disablePadding", "subheader"]); var context = F$3(function () { return { dense: dense }; }, [dense]); return /*#__PURE__*/ y$3(ListContext.Provider, { value: context }, /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, className, dense && classes.dense, !disablePadding && classes.padding, subheader && classes.subheader), ref: ref }, other), subheader, children)); });
|
|
7384
|
-
var List$1 = withStyles(styles$
|
|
7385
|
-
var styles$
|
|
7493
|
+
var List$1 = withStyles(styles$q, { name: 'MuiList' })(List);
|
|
7494
|
+
var styles$p = function styles(theme) { return { root: { display: 'flex', justifyContent: 'flex-start', alignItems: 'center', position: 'relative', textDecoration: 'none', width: '100%', boxSizing: 'border-box', textAlign: 'left', paddingTop: 8, paddingBottom: 8, '&$focusVisible': { backgroundColor: theme.palette.action.selected }, '&$selected, &$selected:hover': { backgroundColor: theme.palette.action.selected }, '&$disabled': { opacity: 0.5 } }, container: { position: 'relative' }, focusVisible: {}, dense: { paddingTop: 4, paddingBottom: 4 }, alignItemsFlexStart: { alignItems: 'flex-start' }, disabled: {}, divider: { borderBottom: "1px solid ".concat(theme.palette.divider), backgroundClip: 'padding-box' }, gutters: { paddingLeft: 16, paddingRight: 16 }, button: { transition: theme.transitions.create('background-color', { duration: theme.transitions.duration.shortest }), '&:hover': { textDecoration: 'none', backgroundColor: theme.palette.action.hover, '@media (hover: none)': { backgroundColor: 'transparent' } } }, secondaryAction: { paddingRight: 48 }, selected: {} }; };
|
|
7386
7495
|
var useEnhancedEffect$2 = typeof window === 'undefined' ? p$3 : y$2;
|
|
7387
7496
|
var ListItem = /*#__PURE__*/ N$1(function ListItem(props, ref) { var _props$alignItems = props.alignItems, alignItems = _props$alignItems === void 0 ? 'center' : _props$alignItems, _props$autoFocus = props.autoFocus, autoFocus = _props$autoFocus === void 0 ? false : _props$autoFocus, _props$button = props.button, button = _props$button === void 0 ? false : _props$button, childrenProp = props.children, classes = props.classes, className = props.className, componentProp = props.component, _props$ContainerCompo = props.ContainerComponent, ContainerComponent = _props$ContainerCompo === void 0 ? 'li' : _props$ContainerCompo, _props$ContainerProps = props.ContainerProps; _props$ContainerProps = _props$ContainerProps === void 0 ? {} : _props$ContainerProps; var ContainerClassName = _props$ContainerProps.className, ContainerProps = _objectWithoutProperties$2(_props$ContainerProps, ["className"]), _props$dense = props.dense, dense = _props$dense === void 0 ? false : _props$dense, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, _props$disableGutters = props.disableGutters, disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters, _props$divider = props.divider, divider = _props$divider === void 0 ? false : _props$divider, focusVisibleClassName = props.focusVisibleClassName, _props$selected = props.selected, selected = _props$selected === void 0 ? false : _props$selected, other = _objectWithoutProperties$2(props, ["alignItems", "autoFocus", "button", "children", "classes", "className", "component", "ContainerComponent", "ContainerProps", "dense", "disabled", "disableGutters", "divider", "focusVisibleClassName", "selected"]); var context = q$5(ListContext); var childContext = { dense: dense || context.dense || false, alignItems: alignItems }; var listItemRef = _$1(null); useEnhancedEffect$2(function () { if (autoFocus) {
|
|
7388
7497
|
if (listItemRef.current) {
|
|
@@ -7404,7 +7513,10 @@ var ListItem = /*#__PURE__*/ N$1(function ListItem(props, ref) { var _props$alig
|
|
|
7404
7513
|
}
|
|
7405
7514
|
return /*#__PURE__*/ y$3(ListContext.Provider, { value: childContext }, /*#__PURE__*/ y$3(ContainerComponent, _extends$4({ className: clsx(classes.container, ContainerClassName), ref: handleRef }, ContainerProps), /*#__PURE__*/ y$3(Component, componentProps, children), children.pop()));
|
|
7406
7515
|
} return /*#__PURE__*/ y$3(ListContext.Provider, { value: childContext }, /*#__PURE__*/ y$3(Component, _extends$4({ ref: handleRef }, componentProps), children)); });
|
|
7407
|
-
var ListItem$1 = withStyles(styles$
|
|
7516
|
+
var ListItem$1 = withStyles(styles$p, { name: 'MuiListItem' })(ListItem);
|
|
7517
|
+
var styles$o = function styles(theme) { return { root: { boxSizing: 'border-box', lineHeight: '48px', listStyle: 'none', color: theme.palette.text.secondary, fontFamily: theme.typography.fontFamily, fontWeight: theme.typography.fontWeightMedium, fontSize: theme.typography.pxToRem(14) }, colorPrimary: { color: theme.palette.primary.main }, colorInherit: { color: 'inherit' }, gutters: { paddingLeft: 16, paddingRight: 16 }, inset: { paddingLeft: 72 }, sticky: { position: 'sticky', top: 0, zIndex: 1, backgroundColor: 'inherit' } }; };
|
|
7518
|
+
var ListSubheader = /*#__PURE__*/ N$1(function ListSubheader(props, ref) { var classes = props.classes, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'default' : _props$color, _props$component = props.component, Component = _props$component === void 0 ? 'li' : _props$component, _props$disableGutters = props.disableGutters, disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters, _props$disableSticky = props.disableSticky, disableSticky = _props$disableSticky === void 0 ? false : _props$disableSticky, _props$inset = props.inset, inset = _props$inset === void 0 ? false : _props$inset, other = _objectWithoutProperties$2(props, ["classes", "className", "color", "component", "disableGutters", "disableSticky", "inset"]); return /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, className, color !== 'default' && classes["color".concat(capitalize(color))], inset && classes.inset, !disableSticky && classes.sticky, !disableGutters && classes.gutters), ref: ref }, other)); });
|
|
7519
|
+
var ListSubheader$1 = withStyles(styles$o, { name: 'MuiListSubheader' })(ListSubheader);
|
|
7408
7520
|
function getOffsetTop(rect, vertical) { var offset = 0; if (typeof vertical === 'number') {
|
|
7409
7521
|
offset = vertical;
|
|
7410
7522
|
}
|
|
@@ -7429,7 +7541,7 @@ function getScrollParent$1(parent, child) { var element = child; var scrollTop =
|
|
|
7429
7541
|
scrollTop += element.scrollTop;
|
|
7430
7542
|
} return scrollTop; }
|
|
7431
7543
|
function getAnchorEl$1(anchorEl) { return typeof anchorEl === 'function' ? anchorEl() : anchorEl; }
|
|
7432
|
-
var styles$
|
|
7544
|
+
var styles$n = { root: {}, paper: { position: 'absolute', overflowY: 'auto', overflowX: 'hidden', minWidth: 16, minHeight: 16, maxWidth: 'calc(100% - 32px)', maxHeight: 'calc(100% - 32px)', outline: 0 } };
|
|
7433
7545
|
var Popover = /*#__PURE__*/ N$1(function Popover(props, ref) { var action = props.action, anchorEl = props.anchorEl, _props$anchorOrigin = props.anchorOrigin, anchorOrigin = _props$anchorOrigin === void 0 ? { vertical: 'top', horizontal: 'left' } : _props$anchorOrigin, anchorPosition = props.anchorPosition, _props$anchorReferenc = props.anchorReference, anchorReference = _props$anchorReferenc === void 0 ? 'anchorEl' : _props$anchorReferenc, children = props.children, classes = props.classes, className = props.className, containerProp = props.container, _props$elevation = props.elevation, elevation = _props$elevation === void 0 ? 8 : _props$elevation, getContentAnchorEl = props.getContentAnchorEl, _props$marginThreshol = props.marginThreshold, marginThreshold = _props$marginThreshol === void 0 ? 16 : _props$marginThreshol, onEnter = props.onEnter, onEntered = props.onEntered, onEntering = props.onEntering, onExit = props.onExit, onExited = props.onExited, onExiting = props.onExiting, open = props.open, _props$PaperProps = props.PaperProps, PaperProps = _props$PaperProps === void 0 ? {} : _props$PaperProps, _props$transformOrigi = props.transformOrigin, transformOrigin = _props$transformOrigi === void 0 ? { vertical: 'top', horizontal: 'left' } : _props$transformOrigi, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Grow : _props$TransitionComp, _props$transitionDura = props.transitionDuration, transitionDurationProp = _props$transitionDura === void 0 ? 'auto' : _props$transitionDura, _props$TransitionProp = props.TransitionProps, TransitionProps = _props$TransitionProp === void 0 ? {} : _props$TransitionProp, other = _objectWithoutProperties$2(props, ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "classes", "className", "container", "elevation", "getContentAnchorEl", "marginThreshold", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "open", "PaperProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"]); var paperRef = _$1(); var getAnchorOffset = T$2(function (contentAnchorOffset) { if (anchorReference === 'anchorPosition') {
|
|
7434
7546
|
return anchorPosition;
|
|
7435
7547
|
} var resolvedAnchorEl = getAnchorEl$1(anchorEl); var anchorElement = resolvedAnchorEl && resolvedAnchorEl.nodeType === 1 ? resolvedAnchorEl : ownerDocument(paperRef.current).body; var anchorRect = anchorElement.getBoundingClientRect(); var anchorVertical = contentAnchorOffset === 0 ? anchorOrigin.vertical : 'center'; return { top: anchorRect.top + getOffsetTop(anchorRect, anchorVertical), left: anchorRect.left + getOffsetLeft(anchorRect, anchorOrigin.horizontal) }; }, [anchorEl, anchorOrigin.horizontal, anchorOrigin.vertical, anchorPosition, anchorReference]); var getContentAnchorOffset = T$2(function (element) { var contentAnchorOffset = 0; if (getContentAnchorEl && anchorReference === 'anchorEl') {
|
|
@@ -7473,7 +7585,7 @@ else if (right > widthThreshold) {
|
|
|
7473
7585
|
} var handleResize = debounce$1(function () { setPositioningStyles(); }); window.addEventListener('resize', handleResize); return function () { handleResize.clear(); window.removeEventListener('resize', handleResize); }; }, [open, setPositioningStyles]); var transitionDuration = transitionDurationProp; if (transitionDurationProp === 'auto' && !TransitionComponent.muiSupportAuto) {
|
|
7474
7586
|
transitionDuration = undefined;
|
|
7475
7587
|
} var container = containerProp || (anchorEl ? ownerDocument(getAnchorEl$1(anchorEl)).body : undefined); return /*#__PURE__*/ y$3(Modal$1, _extends$4({ container: container, open: open, ref: ref, BackdropProps: { invisible: true }, className: clsx(classes.root, className) }, other), /*#__PURE__*/ y$3(TransitionComponent, _extends$4({ appear: true, "in": open, onEnter: onEnter, onEntered: onEntered, onExit: onExit, onExited: onExited, onExiting: onExiting, timeout: transitionDuration }, TransitionProps, { onEntering: createChainedFunction(handleEntering, TransitionProps.onEntering) }), /*#__PURE__*/ y$3(Paper$1, _extends$4({ elevation: elevation, ref: handlePaperRef }, PaperProps, { className: clsx(classes.paper, PaperProps.className) }), children))); });
|
|
7476
|
-
var Popover$1 = withStyles(styles$
|
|
7588
|
+
var Popover$1 = withStyles(styles$n, { name: 'MuiPopover' })(Popover);
|
|
7477
7589
|
function nextItem(list, item, disableListWrap) { if (list === item) {
|
|
7478
7590
|
return list.firstChild;
|
|
7479
7591
|
} if (item && item.nextElementSibling) {
|
|
@@ -7578,7 +7690,7 @@ else if (key.length === 1) {
|
|
|
7578
7690
|
} return child; }); return /*#__PURE__*/ y$3(List$1, _extends$4({ role: "menu", ref: handleRef, className: className, onKeyDown: handleKeyDown, tabIndex: autoFocus ? 0 : -1 }, other), items); });
|
|
7579
7691
|
var RTL_ORIGIN = { vertical: 'top', horizontal: 'right' };
|
|
7580
7692
|
var LTR_ORIGIN = { vertical: 'top', horizontal: 'left' };
|
|
7581
|
-
var styles$
|
|
7693
|
+
var styles$m = { paper: { maxHeight: 'calc(100% - 96px)', WebkitOverflowScrolling: 'touch' }, list: { outline: 0 } };
|
|
7582
7694
|
var Menu = /*#__PURE__*/ N$1(function Menu(props, ref) { var _props$autoFocus = props.autoFocus, autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus, children = props.children, classes = props.classes, _props$disableAutoFoc = props.disableAutoFocusItem, disableAutoFocusItem = _props$disableAutoFoc === void 0 ? false : _props$disableAutoFoc, _props$MenuListProps = props.MenuListProps, MenuListProps = _props$MenuListProps === void 0 ? {} : _props$MenuListProps, onClose = props.onClose, onEnteringProp = props.onEntering, open = props.open, _props$PaperProps = props.PaperProps, PaperProps = _props$PaperProps === void 0 ? {} : _props$PaperProps, PopoverClasses = props.PopoverClasses, _props$transitionDura = props.transitionDuration, transitionDuration = _props$transitionDura === void 0 ? 'auto' : _props$transitionDura, _props$TransitionProp = props.TransitionProps; _props$TransitionProp = _props$TransitionProp === void 0 ? {} : _props$TransitionProp; var onEntering = _props$TransitionProp.onEntering, TransitionProps = _objectWithoutProperties$2(_props$TransitionProp, ["onEntering"]), _props$variant = props.variant, variant = _props$variant === void 0 ? 'selectedMenu' : _props$variant, other = _objectWithoutProperties$2(props, ["autoFocus", "children", "classes", "disableAutoFocusItem", "MenuListProps", "onClose", "onEntering", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant"]); var theme = useTheme(); var autoFocusItem = autoFocus && !disableAutoFocusItem && open; var menuListActionsRef = _$1(null); var contentAnchorRef = _$1(null); var getContentAnchorEl = function getContentAnchorEl() { return contentAnchorRef.current; }; var handleEntering = function handleEntering(element, isAppearing) { if (menuListActionsRef.current) {
|
|
7583
7695
|
menuListActionsRef.current.adjustStyleForScrollbar(element, theme);
|
|
7584
7696
|
} if (onEnteringProp) {
|
|
@@ -7602,28 +7714,28 @@ var Menu = /*#__PURE__*/ N$1(function Menu(props, ref) { var _props$autoFocus =
|
|
|
7602
7714
|
} }); var items = A$3.map(children, function (child, index) { if (index === activeItemIndex) {
|
|
7603
7715
|
return /*#__PURE__*/ sn(child, { ref: function ref(instance) { contentAnchorRef.current = vn(instance); setRef(child.ref, instance); } });
|
|
7604
7716
|
} return child; }); return /*#__PURE__*/ y$3(Popover$1, _extends$4({ getContentAnchorEl: getContentAnchorEl, classes: PopoverClasses, onClose: onClose, TransitionProps: _extends$4({ onEntering: handleEntering }, TransitionProps), anchorOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN, transformOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN, PaperProps: _extends$4({}, PaperProps, { classes: _extends$4({}, PaperProps.classes, { root: classes.paper }) }), open: open, ref: ref, transitionDuration: transitionDuration }, other), /*#__PURE__*/ y$3(MenuList, _extends$4({ onKeyDown: handleListKeyDown, actions: menuListActionsRef, autoFocus: autoFocus && (activeItemIndex === -1 || disableAutoFocusItem), autoFocusItem: autoFocusItem, variant: variant }, MenuListProps, { className: clsx(classes.list, MenuListProps.className) }), items)); });
|
|
7605
|
-
var Menu$1 = withStyles(styles$
|
|
7606
|
-
var styles$
|
|
7717
|
+
var Menu$1 = withStyles(styles$m, { name: 'MuiMenu' })(Menu);
|
|
7718
|
+
var styles$l = function styles(theme) { return { root: _extends$4({}, theme.typography.body1, _defineProperty$1({ minHeight: 48, paddingTop: 6, paddingBottom: 6, boxSizing: 'border-box', width: 'auto', overflow: 'hidden', whiteSpace: 'nowrap' }, theme.breakpoints.up('sm'), { minHeight: 'auto' })), gutters: {}, selected: {}, dense: _extends$4({}, theme.typography.body2, { minHeight: 'auto' }) }; };
|
|
7607
7719
|
var MenuItem$1 = /*#__PURE__*/ N$1(function MenuItem(props, ref) { var classes = props.classes, className = props.className, _props$component = props.component, component = _props$component === void 0 ? 'li' : _props$component, _props$disableGutters = props.disableGutters, disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters, ListItemClasses = props.ListItemClasses, _props$role = props.role, role = _props$role === void 0 ? 'menuitem' : _props$role, selected = props.selected, tabIndexProp = props.tabIndex, other = _objectWithoutProperties$2(props, ["classes", "className", "component", "disableGutters", "ListItemClasses", "role", "selected", "tabIndex"]); var tabIndex; if (!props.disabled) {
|
|
7608
7720
|
tabIndex = tabIndexProp !== undefined ? tabIndexProp : -1;
|
|
7609
7721
|
} return /*#__PURE__*/ y$3(ListItem$1, _extends$4({ button: true, role: role, tabIndex: tabIndex, component: component, selected: selected, disableGutters: disableGutters, classes: _extends$4({ dense: classes.dense }, ListItemClasses), className: clsx(classes.root, className, selected && classes.selected, !disableGutters && classes.gutters), ref: ref }, other)); });
|
|
7610
|
-
var MenuItem$2 = withStyles(styles$
|
|
7722
|
+
var MenuItem$2 = withStyles(styles$l, { name: 'MuiMenuItem' })(MenuItem$1);
|
|
7611
7723
|
var NativeSelectInput = /*#__PURE__*/ N$1(function NativeSelectInput(props, ref) { var classes = props.classes, className = props.className, disabled = props.disabled, IconComponent = props.IconComponent, inputRef = props.inputRef, _props$variant = props.variant, variant = _props$variant === void 0 ? 'standard' : _props$variant, other = _objectWithoutProperties$2(props, ["classes", "className", "disabled", "IconComponent", "inputRef", "variant"]); return /*#__PURE__*/ y$3(g$5, null, /*#__PURE__*/ y$3("select", _extends$4({ className: clsx(classes.root, classes.select, classes[variant], className, disabled && classes.disabled), disabled: disabled, ref: inputRef || ref }, other)), props.multiple ? null : /*#__PURE__*/ y$3(IconComponent, { className: clsx(classes.icon, classes["icon".concat(capitalize(variant))], disabled && classes.disabled) })); });
|
|
7612
|
-
var ArrowDropDownIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M7 10l5 5 5-5z" }));
|
|
7613
|
-
var styles$
|
|
7614
|
-
var defaultInput = /*#__PURE__*/ y$3(Input$
|
|
7615
|
-
var NativeSelect = /*#__PURE__*/ N$1(function NativeSelect(props, ref) { var children = props.children, classes = props.classes, _props$IconComponent = props.IconComponent, IconComponent = _props$IconComponent === void 0 ? ArrowDropDownIcon : _props$IconComponent, _props$input = props.input, input = _props$input === void 0 ? defaultInput : _props$input, inputProps = props.inputProps; props.variant; var other = _objectWithoutProperties$2(props, ["children", "classes", "IconComponent", "input", "inputProps", "variant"]); var muiFormControl = useFormControl(); var fcs = formControlState({ props: props, muiFormControl: muiFormControl, states: ['variant'] }); return /*#__PURE__*/ sn(input, _extends$4({ inputComponent: NativeSelectInput, inputProps: _extends$4({ children: children, classes: classes, IconComponent: IconComponent, variant: fcs.variant, type: undefined }, inputProps, input ? input.props.inputProps : {}), ref: ref }, other)); });
|
|
7724
|
+
var ArrowDropDownIcon$1 = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M7 10l5 5 5-5z" }));
|
|
7725
|
+
var styles$k = function styles(theme) { return { root: {}, select: { '-moz-appearance': 'none', '-webkit-appearance': 'none', userSelect: 'none', borderRadius: 0, minWidth: 16, cursor: 'pointer', '&:focus': { backgroundColor: theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)', borderRadius: 0 }, '&::-ms-expand': { display: 'none' }, '&$disabled': { cursor: 'default' }, '&[multiple]': { height: 'auto' }, '&:not([multiple]) option, &:not([multiple]) optgroup': { backgroundColor: theme.palette.background.paper }, '&&': { paddingRight: 24 } }, filled: { '&&': { paddingRight: 32 } }, outlined: { borderRadius: theme.shape.borderRadius, '&&': { paddingRight: 32 } }, selectMenu: { height: 'auto', minHeight: '1.1876em', textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' }, disabled: {}, icon: { position: 'absolute', right: 0, top: 'calc(50% - 12px)', pointerEvents: 'none', color: theme.palette.action.active, '&$disabled': { color: theme.palette.action.disabled } }, iconOpen: { transform: 'rotate(180deg)' }, iconFilled: { right: 7 }, iconOutlined: { right: 7 }, nativeInput: { bottom: 0, left: 0, position: 'absolute', opacity: 0, pointerEvents: 'none', width: '100%' } }; };
|
|
7726
|
+
var defaultInput = /*#__PURE__*/ y$3(Input$3, null);
|
|
7727
|
+
var NativeSelect = /*#__PURE__*/ N$1(function NativeSelect(props, ref) { var children = props.children, classes = props.classes, _props$IconComponent = props.IconComponent, IconComponent = _props$IconComponent === void 0 ? ArrowDropDownIcon$1 : _props$IconComponent, _props$input = props.input, input = _props$input === void 0 ? defaultInput : _props$input, inputProps = props.inputProps; props.variant; var other = _objectWithoutProperties$2(props, ["children", "classes", "IconComponent", "input", "inputProps", "variant"]); var muiFormControl = useFormControl(); var fcs = formControlState({ props: props, muiFormControl: muiFormControl, states: ['variant'] }); return /*#__PURE__*/ sn(input, _extends$4({ inputComponent: NativeSelectInput, inputProps: _extends$4({ children: children, classes: classes, IconComponent: IconComponent, variant: fcs.variant, type: undefined }, inputProps, input ? input.props.inputProps : {}), ref: ref }, other)); });
|
|
7616
7728
|
NativeSelect.muiName = 'Select';
|
|
7617
|
-
withStyles(styles$
|
|
7618
|
-
var styles$
|
|
7729
|
+
withStyles(styles$k, { name: 'MuiNativeSelect' })(NativeSelect);
|
|
7730
|
+
var styles$j = function styles(theme) { return { root: { position: 'absolute', bottom: 0, right: 0, top: -5, left: 0, margin: 0, padding: '0 8px', pointerEvents: 'none', borderRadius: 'inherit', borderStyle: 'solid', borderWidth: 1, overflow: 'hidden' }, legend: { textAlign: 'left', padding: 0, lineHeight: '11px', transition: theme.transitions.create('width', { duration: 150, easing: theme.transitions.easing.easeOut }) }, legendLabelled: { display: 'block', width: 'auto', textAlign: 'left', padding: 0, height: 11, fontSize: '0.75em', visibility: 'hidden', maxWidth: 0.01, transition: theme.transitions.create('max-width', { duration: 50, easing: theme.transitions.easing.easeOut }), '& > span': { paddingLeft: 5, paddingRight: 5, display: 'inline-block' } }, legendNotched: { maxWidth: 1000, transition: theme.transitions.create('max-width', { duration: 100, easing: theme.transitions.easing.easeOut, delay: 50 }) } }; };
|
|
7619
7731
|
var NotchedOutline = /*#__PURE__*/ N$1(function NotchedOutline(props, ref) { props.children; var classes = props.classes, className = props.className, label = props.label, labelWidthProp = props.labelWidth, notched = props.notched, style = props.style, other = _objectWithoutProperties$2(props, ["children", "classes", "className", "label", "labelWidth", "notched", "style"]); var theme = useTheme(); var align = theme.direction === 'rtl' ? 'right' : 'left'; if (label !== undefined) {
|
|
7620
7732
|
return /*#__PURE__*/ y$3("fieldset", _extends$4({ "aria-hidden": true, className: clsx(classes.root, className), ref: ref, style: style }, other), /*#__PURE__*/ y$3("legend", { className: clsx(classes.legendLabelled, notched && classes.legendNotched) }, label ? /*#__PURE__*/ y$3("span", null, label) : /*#__PURE__*/ y$3("span", { dangerouslySetInnerHTML: { __html: '​' } })));
|
|
7621
|
-
} var labelWidth = labelWidthProp > 0 ? labelWidthProp * 0.75 + 8 : 0.01; return /*#__PURE__*/ y$3("fieldset", _extends$4({ "aria-hidden": true, style: _extends$4(_defineProperty({}, "padding".concat(capitalize(align)), 8), style), className: clsx(classes.root, className), ref: ref }, other), /*#__PURE__*/ y$3("legend", { className: classes.legend, style: { width: notched ? labelWidth : 0.01 } }, /*#__PURE__*/ y$3("span", { dangerouslySetInnerHTML: { __html: '​' } }))); });
|
|
7622
|
-
var NotchedOutline$1 = withStyles(styles$
|
|
7623
|
-
var styles$
|
|
7733
|
+
} var labelWidth = labelWidthProp > 0 ? labelWidthProp * 0.75 + 8 : 0.01; return /*#__PURE__*/ y$3("fieldset", _extends$4({ "aria-hidden": true, style: _extends$4(_defineProperty$1({}, "padding".concat(capitalize(align)), 8), style), className: clsx(classes.root, className), ref: ref }, other), /*#__PURE__*/ y$3("legend", { className: classes.legend, style: { width: notched ? labelWidth : 0.01 } }, /*#__PURE__*/ y$3("span", { dangerouslySetInnerHTML: { __html: '​' } }))); });
|
|
7734
|
+
var NotchedOutline$1 = withStyles(styles$j, { name: 'PrivateNotchedOutline' })(NotchedOutline);
|
|
7735
|
+
var styles$i = function styles(theme) { var borderColor = theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'; return { root: { position: 'relative', borderRadius: theme.shape.borderRadius, '&:hover $notchedOutline': { borderColor: theme.palette.text.primary }, '@media (hover: none)': { '&:hover $notchedOutline': { borderColor: borderColor } }, '&$focused $notchedOutline': { borderColor: theme.palette.primary.main, borderWidth: 2 }, '&$error $notchedOutline': { borderColor: theme.palette.error.main }, '&$disabled $notchedOutline': { borderColor: theme.palette.action.disabled } }, colorSecondary: { '&$focused $notchedOutline': { borderColor: theme.palette.secondary.main } }, focused: {}, disabled: {}, adornedStart: { paddingLeft: 14 }, adornedEnd: { paddingRight: 14 }, error: {}, marginDense: {}, multiline: { padding: '18.5px 14px', '&$marginDense': { paddingTop: 10.5, paddingBottom: 10.5 } }, notchedOutline: { borderColor: borderColor }, input: { padding: '18.5px 14px', '&:-webkit-autofill': { WebkitBoxShadow: theme.palette.type === 'light' ? null : '0 0 0 100px #266798 inset', WebkitTextFillColor: theme.palette.type === 'light' ? null : '#fff', caretColor: theme.palette.type === 'light' ? null : '#fff', borderRadius: 'inherit' } }, inputMarginDense: { paddingTop: 10.5, paddingBottom: 10.5 }, inputMultiline: { padding: 0 }, inputAdornedStart: { paddingLeft: 0 }, inputAdornedEnd: { paddingRight: 0 } }; };
|
|
7624
7736
|
var OutlinedInput = /*#__PURE__*/ N$1(function OutlinedInput(props, ref) { var classes = props.classes, _props$fullWidth = props.fullWidth, fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth, _props$inputComponent = props.inputComponent, inputComponent = _props$inputComponent === void 0 ? 'input' : _props$inputComponent, label = props.label, _props$labelWidth = props.labelWidth, labelWidth = _props$labelWidth === void 0 ? 0 : _props$labelWidth, _props$multiline = props.multiline, multiline = _props$multiline === void 0 ? false : _props$multiline, notched = props.notched, _props$type = props.type, type = _props$type === void 0 ? 'text' : _props$type, other = _objectWithoutProperties$2(props, ["classes", "fullWidth", "inputComponent", "label", "labelWidth", "multiline", "notched", "type"]); return /*#__PURE__*/ y$3(InputBase$1, _extends$4({ renderSuffix: function renderSuffix(state) { return /*#__PURE__*/ y$3(NotchedOutline$1, { className: classes.notchedOutline, label: label, labelWidth: labelWidth, notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused) }); }, classes: _extends$4({}, classes, { root: clsx(classes.root, classes.underline), notchedOutline: null }), fullWidth: fullWidth, inputComponent: inputComponent, multiline: multiline, ref: ref, type: type }, other)); });
|
|
7625
7737
|
OutlinedInput.muiName = 'Input';
|
|
7626
|
-
var OutlinedInput$1 = withStyles(styles$
|
|
7738
|
+
var OutlinedInput$1 = withStyles(styles$i, { name: 'MuiOutlinedInput' })(OutlinedInput);
|
|
7627
7739
|
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
|
|
7628
7740
|
var timeoutDuration = function () { var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
|
|
7629
7741
|
if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
|
|
@@ -7822,10 +7934,10 @@ else {
|
|
|
7822
7934
|
function find(arr, check) { if (Array.prototype.find) {
|
|
7823
7935
|
return arr.find(check);
|
|
7824
7936
|
} return arr.filter(check)[0]; }
|
|
7825
|
-
function findIndex(arr, prop, value) { if (Array.prototype.findIndex) {
|
|
7937
|
+
function findIndex$1(arr, prop, value) { if (Array.prototype.findIndex) {
|
|
7826
7938
|
return arr.findIndex(function (cur) { return cur[prop] === value; });
|
|
7827
7939
|
} var match = find(arr, function (obj) { return obj[prop] === value; }); return arr.indexOf(match); }
|
|
7828
|
-
function runModifiers(modifiers, data, ends) { var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); modifiersToRun.forEach(function (modifier) { if (modifier['function']) {
|
|
7940
|
+
function runModifiers(modifiers, data, ends) { var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex$1(modifiers, 'name', ends)); modifiersToRun.forEach(function (modifier) { if (modifier['function']) {
|
|
7829
7941
|
console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
|
|
7830
7942
|
} var fn = modifier['function'] || modifier.fn; if (modifier.enabled && isFunction(fn)) {
|
|
7831
7943
|
data.offsets.popper = getClientRect(data.offsets.popper);
|
|
@@ -8128,11 +8240,30 @@ var Popper = /*#__PURE__*/ N$1(function Popper(props, ref) { var anchorEl = prop
|
|
|
8128
8240
|
} var childProps = { placement: placement }; if (transition) {
|
|
8129
8241
|
childProps.TransitionProps = { "in": open, onEnter: handleEnter, onExited: handleExited };
|
|
8130
8242
|
} return /*#__PURE__*/ y$3(Portal, { disablePortal: disablePortal, container: container }, /*#__PURE__*/ y$3("div", _extends$4({ ref: handleRef, role: "tooltip" }, other, { style: _extends$4({ position: 'fixed', top: 0, left: 0, display: !open && keepMounted && !transition ? 'none' : null }, style) }), typeof children === 'function' ? children(childProps) : children)); });
|
|
8131
|
-
|
|
8243
|
+
var RadioButtonUncheckedIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" }));
|
|
8244
|
+
var RadioButtonCheckedIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z" }));
|
|
8245
|
+
var styles$h = function styles(theme) { return { root: { position: 'relative', display: 'flex', '&$checked $layer': { transform: 'scale(1)', transition: theme.transitions.create('transform', { easing: theme.transitions.easing.easeOut, duration: theme.transitions.duration.shortest }) } }, layer: { left: 0, position: 'absolute', transform: 'scale(0)', transition: theme.transitions.create('transform', { easing: theme.transitions.easing.easeIn, duration: theme.transitions.duration.shortest }) }, checked: {} }; };
|
|
8246
|
+
function RadioButtonIcon(props) { var checked = props.checked, classes = props.classes, fontSize = props.fontSize; return /*#__PURE__*/ y$3("div", { className: clsx(classes.root, checked && classes.checked) }, /*#__PURE__*/ y$3(RadioButtonUncheckedIcon, { fontSize: fontSize }), /*#__PURE__*/ y$3(RadioButtonCheckedIcon, { fontSize: fontSize, className: classes.layer })); }
|
|
8247
|
+
var RadioButtonIcon$1 = withStyles(styles$h, { name: 'PrivateRadioButtonIcon' })(RadioButtonIcon);
|
|
8248
|
+
var RadioGroupContext = /*#__PURE__*/ F$4();
|
|
8249
|
+
function useRadioGroup() { return q$5(RadioGroupContext); }
|
|
8250
|
+
var styles$g = function styles(theme) { return { root: { color: theme.palette.text.secondary }, checked: {}, disabled: {}, colorPrimary: { '&$checked': { color: theme.palette.primary.main, '&:hover': { backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } } }, '&$disabled': { color: theme.palette.action.disabled } }, colorSecondary: { '&$checked': { color: theme.palette.secondary.main, '&:hover': { backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } } }, '&$disabled': { color: theme.palette.action.disabled } } }; };
|
|
8251
|
+
var defaultCheckedIcon = /*#__PURE__*/ y$3(RadioButtonIcon$1, { checked: true });
|
|
8252
|
+
var defaultIcon = /*#__PURE__*/ y$3(RadioButtonIcon$1, null);
|
|
8253
|
+
var Radio = /*#__PURE__*/ N$1(function Radio(props, ref) { var checkedProp = props.checked, classes = props.classes, _props$color = props.color, color = _props$color === void 0 ? 'secondary' : _props$color, nameProp = props.name, onChangeProp = props.onChange, _props$size = props.size, size = _props$size === void 0 ? 'medium' : _props$size, other = _objectWithoutProperties$2(props, ["checked", "classes", "color", "name", "onChange", "size"]); var radioGroup = useRadioGroup(); var checked = checkedProp; var onChange = createChainedFunction(onChangeProp, radioGroup && radioGroup.onChange); var name = nameProp; if (radioGroup) {
|
|
8254
|
+
if (typeof checked === 'undefined') {
|
|
8255
|
+
checked = radioGroup.value === props.value;
|
|
8256
|
+
}
|
|
8257
|
+
if (typeof name === 'undefined') {
|
|
8258
|
+
name = radioGroup.name;
|
|
8259
|
+
}
|
|
8260
|
+
} return /*#__PURE__*/ y$3(SwitchBase$1, _extends$4({ color: color, type: "radio", icon: /*#__PURE__*/ sn(defaultIcon, { fontSize: size === 'small' ? 'small' : 'medium' }), checkedIcon: /*#__PURE__*/ sn(defaultCheckedIcon, { fontSize: size === 'small' ? 'small' : 'medium' }), classes: { root: clsx(classes.root, classes["color".concat(capitalize(color))]), checked: classes.checked, disabled: classes.disabled }, name: name, checked: checked, onChange: onChange, ref: ref }, other)); });
|
|
8261
|
+
var MUIRadio = withStyles(styles$g, { name: 'MuiRadio' })(Radio);
|
|
8262
|
+
function areEqualValues(a, b) { if (_typeof$4(b) === 'object' && b !== null) {
|
|
8132
8263
|
return a === b;
|
|
8133
8264
|
} return String(a) === String(b); }
|
|
8134
8265
|
function isEmpty(display) { return display == null || typeof display === 'string' && !display.trim(); }
|
|
8135
|
-
var SelectInput = /*#__PURE__*/ N$1(function SelectInput(props, ref) { var ariaLabel = props['aria-label'], autoFocus = props.autoFocus, autoWidth = props.autoWidth, children = props.children, classes = props.classes, className = props.className, defaultValue = props.defaultValue, disabled = props.disabled, displayEmpty = props.displayEmpty, IconComponent = props.IconComponent, inputRefProp = props.inputRef, labelId = props.labelId, _props$MenuProps = props.MenuProps, MenuProps = _props$MenuProps === void 0 ? {} : _props$MenuProps, multiple = props.multiple, name = props.name, onBlur = props.onBlur, onChange = props.onChange, onClose = props.onClose, onFocus = props.onFocus, onOpen = props.onOpen, openProp = props.open, readOnly = props.readOnly, renderValue = props.renderValue, _props$SelectDisplayP = props.SelectDisplayProps, SelectDisplayProps = _props$SelectDisplayP === void 0 ? {} : _props$SelectDisplayP, tabIndexProp = props.tabIndex; props.type; var valueProp = props.value, _props$variant = props.variant, variant = _props$variant === void 0 ? 'standard' : _props$variant, other = _objectWithoutProperties$2(props, ["aria-label", "autoFocus", "autoWidth", "children", "classes", "className", "defaultValue", "disabled", "displayEmpty", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"]); var _useControlled = useControlled({ controlled: valueProp, "default": defaultValue, name: 'Select' }), _useControlled2 = _slicedToArray(_useControlled, 2), value = _useControlled2[0], setValue = _useControlled2[1]; var inputRef = _$1(null); var _React$useState = h$4(null), displayNode = _React$useState[0], setDisplayNode = _React$useState[1]; var _React$useRef = _$1(openProp != null), isOpenControlled = _React$useRef.current; var _React$useState2 = h$4(), menuMinWidthState = _React$useState2[0], setMenuMinWidthState = _React$useState2[1]; var _React$useState3 = h$4(false), openState = _React$useState3[0], setOpenState = _React$useState3[1]; var handleRef = useForkRef(ref, inputRefProp); A$4(handleRef, function () { return { focus: function focus() { displayNode.focus(); }, node: inputRef.current, value: value }; }, [displayNode, value]); p$3(function () { if (autoFocus && displayNode) {
|
|
8266
|
+
var SelectInput = /*#__PURE__*/ N$1(function SelectInput(props, ref) { var ariaLabel = props['aria-label'], autoFocus = props.autoFocus, autoWidth = props.autoWidth, children = props.children, classes = props.classes, className = props.className, defaultValue = props.defaultValue, disabled = props.disabled, displayEmpty = props.displayEmpty, IconComponent = props.IconComponent, inputRefProp = props.inputRef, labelId = props.labelId, _props$MenuProps = props.MenuProps, MenuProps = _props$MenuProps === void 0 ? {} : _props$MenuProps, multiple = props.multiple, name = props.name, onBlur = props.onBlur, onChange = props.onChange, onClose = props.onClose, onFocus = props.onFocus, onOpen = props.onOpen, openProp = props.open, readOnly = props.readOnly, renderValue = props.renderValue, _props$SelectDisplayP = props.SelectDisplayProps, SelectDisplayProps = _props$SelectDisplayP === void 0 ? {} : _props$SelectDisplayP, tabIndexProp = props.tabIndex; props.type; var valueProp = props.value, _props$variant = props.variant, variant = _props$variant === void 0 ? 'standard' : _props$variant, other = _objectWithoutProperties$2(props, ["aria-label", "autoFocus", "autoWidth", "children", "classes", "className", "defaultValue", "disabled", "displayEmpty", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"]); var _useControlled = useControlled({ controlled: valueProp, "default": defaultValue, name: 'Select' }), _useControlled2 = _slicedToArray$1(_useControlled, 2), value = _useControlled2[0], setValue = _useControlled2[1]; var inputRef = _$1(null); var _React$useState = h$4(null), displayNode = _React$useState[0], setDisplayNode = _React$useState[1]; var _React$useRef = _$1(openProp != null), isOpenControlled = _React$useRef.current; var _React$useState2 = h$4(), menuMinWidthState = _React$useState2[0], setMenuMinWidthState = _React$useState2[1]; var _React$useState3 = h$4(false), openState = _React$useState3[0], setOpenState = _React$useState3[1]; var handleRef = useForkRef(ref, inputRefProp); A$4(handleRef, function () { return { focus: function focus() { displayNode.focus(); }, node: inputRef.current, value: value }; }, [displayNode, value]); p$3(function () { if (autoFocus && displayNode) {
|
|
8136
8267
|
displayNode.focus();
|
|
8137
8268
|
} }, [autoFocus, displayNode]); p$3(function () { if (displayNode) {
|
|
8138
8269
|
var label = ownerDocument(displayNode).getElementById(labelId);
|
|
@@ -8228,16 +8359,16 @@ else {
|
|
|
8228
8359
|
else {
|
|
8229
8360
|
tabIndex = disabled ? null : 0;
|
|
8230
8361
|
} var buttonId = SelectDisplayProps.id || (name ? "mui-component-select-".concat(name) : undefined); return /*#__PURE__*/ y$3(g$5, null, /*#__PURE__*/ y$3("div", _extends$4({ className: clsx(classes.root, classes.select, classes.selectMenu, classes[variant], className, disabled && classes.disabled), ref: setDisplayNode, tabIndex: tabIndex, role: "button", "aria-disabled": disabled ? 'true' : undefined, "aria-expanded": open ? 'true' : undefined, "aria-haspopup": "listbox", "aria-label": ariaLabel, "aria-labelledby": [labelId, buttonId].filter(Boolean).join(' ') || undefined, onKeyDown: handleKeyDown, onMouseDown: disabled || readOnly ? null : handleMouseDown, onBlur: handleBlur, onFocus: onFocus }, SelectDisplayProps, { id: buttonId }), isEmpty(display) ? /*#__PURE__*/ y$3("span", { dangerouslySetInnerHTML: { __html: '​' } }) : display), /*#__PURE__*/ y$3("input", _extends$4({ value: Array.isArray(value) ? value.join(',') : value, name: name, ref: inputRef, "aria-hidden": true, onChange: handleChange, tabIndex: -1, className: classes.nativeInput, autoFocus: autoFocus }, other)), /*#__PURE__*/ y$3(IconComponent, { className: clsx(classes.icon, classes["icon".concat(capitalize(variant))], open && classes.iconOpen, disabled && classes.disabled) }), /*#__PURE__*/ y$3(Menu$1, _extends$4({ id: "menu-".concat(name || ''), anchorEl: displayNode, open: open, onClose: handleClose }, MenuProps, { MenuListProps: _extends$4({ 'aria-labelledby': labelId, role: 'listbox', disableListWrap: true }, MenuProps.MenuListProps), PaperProps: _extends$4({}, MenuProps.PaperProps, { style: _extends$4({ minWidth: menuMinWidth }, MenuProps.PaperProps != null ? MenuProps.PaperProps.style : null) }) }), items)); });
|
|
8231
|
-
var styles$
|
|
8232
|
-
var _ref$
|
|
8233
|
-
var _ref2$
|
|
8234
|
-
var Select$1 = /*#__PURE__*/ N$1(function Select(props, ref) { var _props$autoWidth = props.autoWidth, autoWidth = _props$autoWidth === void 0 ? false : _props$autoWidth, children = props.children, classes = props.classes, _props$displayEmpty = props.displayEmpty, displayEmpty = _props$displayEmpty === void 0 ? false : _props$displayEmpty, _props$IconComponent = props.IconComponent, IconComponent = _props$IconComponent === void 0 ? ArrowDropDownIcon : _props$IconComponent, id = props.id, input = props.input, inputProps = props.inputProps, label = props.label, labelId = props.labelId, _props$labelWidth = props.labelWidth, labelWidth = _props$labelWidth === void 0 ? 0 : _props$labelWidth, MenuProps = props.MenuProps, _props$multiple = props.multiple, multiple = _props$multiple === void 0 ? false : _props$multiple, _props$native = props["native"], _native = _props$native === void 0 ? false : _props$native, onClose = props.onClose, onOpen = props.onOpen, open = props.open, renderValue = props.renderValue, SelectDisplayProps = props.SelectDisplayProps, _props$variant = props.variant, variantProps = _props$variant === void 0 ? 'standard' : _props$variant, other = _objectWithoutProperties$2(props, ["autoWidth", "children", "classes", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "labelWidth", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]); var inputComponent = _native ? NativeSelectInput : SelectInput; var muiFormControl = useFormControl(); var fcs = formControlState({ props: props, muiFormControl: muiFormControl, states: ['variant'] }); var variant = fcs.variant || variantProps; var InputComponent = input || { standard: _ref$
|
|
8362
|
+
var styles$f = styles$k;
|
|
8363
|
+
var _ref$3 = /*#__PURE__*/ y$3(Input$3, null);
|
|
8364
|
+
var _ref2$2 = /*#__PURE__*/ y$3(FilledInput$1, null);
|
|
8365
|
+
var Select$1 = /*#__PURE__*/ N$1(function Select(props, ref) { var _props$autoWidth = props.autoWidth, autoWidth = _props$autoWidth === void 0 ? false : _props$autoWidth, children = props.children, classes = props.classes, _props$displayEmpty = props.displayEmpty, displayEmpty = _props$displayEmpty === void 0 ? false : _props$displayEmpty, _props$IconComponent = props.IconComponent, IconComponent = _props$IconComponent === void 0 ? ArrowDropDownIcon$1 : _props$IconComponent, id = props.id, input = props.input, inputProps = props.inputProps, label = props.label, labelId = props.labelId, _props$labelWidth = props.labelWidth, labelWidth = _props$labelWidth === void 0 ? 0 : _props$labelWidth, MenuProps = props.MenuProps, _props$multiple = props.multiple, multiple = _props$multiple === void 0 ? false : _props$multiple, _props$native = props["native"], _native = _props$native === void 0 ? false : _props$native, onClose = props.onClose, onOpen = props.onOpen, open = props.open, renderValue = props.renderValue, SelectDisplayProps = props.SelectDisplayProps, _props$variant = props.variant, variantProps = _props$variant === void 0 ? 'standard' : _props$variant, other = _objectWithoutProperties$2(props, ["autoWidth", "children", "classes", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "labelWidth", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]); var inputComponent = _native ? NativeSelectInput : SelectInput; var muiFormControl = useFormControl(); var fcs = formControlState({ props: props, muiFormControl: muiFormControl, states: ['variant'] }); var variant = fcs.variant || variantProps; var InputComponent = input || { standard: _ref$3, outlined: /*#__PURE__*/ y$3(OutlinedInput$1, { label: label, labelWidth: labelWidth }), filled: _ref2$2 }[variant]; return /*#__PURE__*/ sn(InputComponent, _extends$4({ inputComponent: inputComponent, inputProps: _extends$4({ children: children, IconComponent: IconComponent, variant: variant, type: undefined, multiple: multiple }, _native ? { id: id } : { autoWidth: autoWidth, displayEmpty: displayEmpty, labelId: labelId, MenuProps: MenuProps, onClose: onClose, onOpen: onOpen, open: open, renderValue: renderValue, SelectDisplayProps: _extends$4({ id: id }, SelectDisplayProps) }, inputProps, { classes: inputProps ? mergeClasses({ baseClasses: classes, newClasses: inputProps.classes, Component: Select }) : classes }, input ? input.props.inputProps : {}), ref: ref }, other)); });
|
|
8235
8366
|
Select$1.muiName = 'Select';
|
|
8236
|
-
var MuiSelect = withStyles(styles$
|
|
8237
|
-
var styles$
|
|
8367
|
+
var MuiSelect = withStyles(styles$f, { name: 'MuiSelect' })(Select$1);
|
|
8368
|
+
var styles$e = function styles(theme) { var emphasis = theme.palette.type === 'light' ? 0.8 : 0.98; var backgroundColor = emphasize(theme.palette.background["default"], emphasis); return { root: _extends$4({}, theme.typography.body2, _defineProperty$1({ color: theme.palette.getContrastText(backgroundColor), backgroundColor: backgroundColor, display: 'flex', alignItems: 'center', flexWrap: 'wrap', padding: '6px 16px', borderRadius: theme.shape.borderRadius, flexGrow: 1 }, theme.breakpoints.up('sm'), { flexGrow: 'initial', minWidth: 288 })), message: { padding: '8px 0' }, action: { display: 'flex', alignItems: 'center', marginLeft: 'auto', paddingLeft: 16, marginRight: -8 } }; };
|
|
8238
8369
|
var SnackbarContent = /*#__PURE__*/ N$1(function SnackbarContent(props, ref) { var action = props.action, classes = props.classes, className = props.className, message = props.message, _props$role = props.role, role = _props$role === void 0 ? 'alert' : _props$role, other = _objectWithoutProperties$2(props, ["action", "classes", "className", "message", "role"]); return /*#__PURE__*/ y$3(Paper$1, _extends$4({ role: role, square: true, elevation: 6, className: clsx(classes.root, className), ref: ref }, other), /*#__PURE__*/ y$3("div", { className: classes.message }, message), action ? /*#__PURE__*/ y$3("div", { className: classes.action }, action) : null); });
|
|
8239
|
-
var SnackbarContent$1 = withStyles(styles$
|
|
8240
|
-
var styles$
|
|
8370
|
+
var SnackbarContent$1 = withStyles(styles$e, { name: 'MuiSnackbarContent' })(SnackbarContent);
|
|
8371
|
+
var styles$d = function styles(theme) { var top1 = { top: 8 }; var bottom1 = { bottom: 8 }; var right = { justifyContent: 'flex-end' }; var left = { justifyContent: 'flex-start' }; var top3 = { top: 24 }; var bottom3 = { bottom: 24 }; var right3 = { right: 24 }; var left3 = { left: 24 }; var center = { left: '50%', right: 'auto', transform: 'translateX(-50%)' }; return { root: { zIndex: theme.zIndex.snackbar, position: 'fixed', display: 'flex', left: 8, right: 8, justifyContent: 'center', alignItems: 'center' }, anchorOriginTopCenter: _extends$4({}, top1, _defineProperty$1({}, theme.breakpoints.up('sm'), _extends$4({}, top3, center))), anchorOriginBottomCenter: _extends$4({}, bottom1, _defineProperty$1({}, theme.breakpoints.up('sm'), _extends$4({}, bottom3, center))), anchorOriginTopRight: _extends$4({}, top1, right, _defineProperty$1({}, theme.breakpoints.up('sm'), _extends$4({ left: 'auto' }, top3, right3))), anchorOriginBottomRight: _extends$4({}, bottom1, right, _defineProperty$1({}, theme.breakpoints.up('sm'), _extends$4({ left: 'auto' }, bottom3, right3))), anchorOriginTopLeft: _extends$4({}, top1, left, _defineProperty$1({}, theme.breakpoints.up('sm'), _extends$4({ right: 'auto' }, top3, left3))), anchorOriginBottomLeft: _extends$4({}, bottom1, left, _defineProperty$1({}, theme.breakpoints.up('sm'), _extends$4({ right: 'auto' }, bottom3, left3))) }; };
|
|
8241
8372
|
var Snackbar = /*#__PURE__*/ N$1(function Snackbar(props, ref) { var action = props.action, _props$anchorOrigin = props.anchorOrigin; _props$anchorOrigin = _props$anchorOrigin === void 0 ? { vertical: 'bottom', horizontal: 'center' } : _props$anchorOrigin; var vertical = _props$anchorOrigin.vertical, horizontal = _props$anchorOrigin.horizontal, _props$autoHideDurati = props.autoHideDuration, autoHideDuration = _props$autoHideDurati === void 0 ? null : _props$autoHideDurati, children = props.children, classes = props.classes, className = props.className, ClickAwayListenerProps = props.ClickAwayListenerProps, ContentProps = props.ContentProps, _props$disableWindowB = props.disableWindowBlurListener, disableWindowBlurListener = _props$disableWindowB === void 0 ? false : _props$disableWindowB, message = props.message, onClose = props.onClose, onEnter = props.onEnter, onEntered = props.onEntered, onEntering = props.onEntering, onExit = props.onExit, onExited = props.onExited, onExiting = props.onExiting, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, open = props.open, resumeHideDuration = props.resumeHideDuration, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Grow : _props$TransitionComp, _props$transitionDura = props.transitionDuration, transitionDuration = _props$transitionDura === void 0 ? { enter: duration.enteringScreen, exit: duration.leavingScreen } : _props$transitionDura, TransitionProps = props.TransitionProps, other = _objectWithoutProperties$2(props, ["action", "anchorOrigin", "autoHideDuration", "children", "classes", "className", "ClickAwayListenerProps", "ContentProps", "disableWindowBlurListener", "message", "onClose", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "TransitionComponent", "transitionDuration", "TransitionProps"]); var timerAutoHide = _$1(); var _React$useState = h$4(true), exited = _React$useState[0], setExited = _React$useState[1]; var handleClose = useEventCallback(function () { if (onClose) {
|
|
8242
8373
|
onClose.apply(void 0, arguments);
|
|
8243
8374
|
} }); var setAutoHideTimer = useEventCallback(function (autoHideDurationParam) { if (!onClose || autoHideDurationParam == null) {
|
|
@@ -8259,19 +8390,22 @@ var Snackbar = /*#__PURE__*/ N$1(function Snackbar(props, ref) { var action = pr
|
|
|
8259
8390
|
} return undefined; }, [disableWindowBlurListener, handleResume, open]); if (!open && exited) {
|
|
8260
8391
|
return null;
|
|
8261
8392
|
} return /*#__PURE__*/ y$3(ClickAwayListener, _extends$4({ onClickAway: handleClickAway }, ClickAwayListenerProps), /*#__PURE__*/ y$3("div", _extends$4({ className: clsx(classes.root, classes["anchorOrigin".concat(capitalize(vertical)).concat(capitalize(horizontal))], className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: ref }, other), /*#__PURE__*/ y$3(TransitionComponent, _extends$4({ appear: true, "in": open, onEnter: createChainedFunction(handleEnter, onEnter), onEntered: onEntered, onEntering: onEntering, onExit: onExit, onExited: createChainedFunction(handleExited, onExited), onExiting: onExiting, timeout: transitionDuration, direction: vertical === 'top' ? 'down' : 'up' }, TransitionProps), children || /*#__PURE__*/ y$3(SnackbarContent$1, _extends$4({ message: message, action: action }, ContentProps))))); });
|
|
8262
|
-
var Snackbar$1 = withStyles(styles$
|
|
8393
|
+
var Snackbar$1 = withStyles(styles$d, { flip: false, name: 'MuiSnackbar' })(Snackbar);
|
|
8394
|
+
var styles$c = function styles(theme) { return { root: { display: 'inline-flex', width: 34 + 12 * 2, height: 14 + 12 * 2, overflow: 'hidden', padding: 12, boxSizing: 'border-box', position: 'relative', flexShrink: 0, zIndex: 0, verticalAlign: 'middle', '@media print': { colorAdjust: 'exact' } }, edgeStart: { marginLeft: -8 }, edgeEnd: { marginRight: -8 }, switchBase: { position: 'absolute', top: 0, left: 0, zIndex: 1, color: theme.palette.type === 'light' ? theme.palette.grey[50] : theme.palette.grey[400], transition: theme.transitions.create(['left', 'transform'], { duration: theme.transitions.duration.shortest }), '&$checked': { transform: 'translateX(20px)' }, '&$disabled': { color: theme.palette.type === 'light' ? theme.palette.grey[400] : theme.palette.grey[800] }, '&$checked + $track': { opacity: 0.5 }, '&$disabled + $track': { opacity: theme.palette.type === 'light' ? 0.12 : 0.1 } }, colorPrimary: { '&$checked': { color: theme.palette.primary.main, '&:hover': { backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } } }, '&$disabled': { color: theme.palette.type === 'light' ? theme.palette.grey[400] : theme.palette.grey[800] }, '&$checked + $track': { backgroundColor: theme.palette.primary.main }, '&$disabled + $track': { backgroundColor: theme.palette.type === 'light' ? theme.palette.common.black : theme.palette.common.white } }, colorSecondary: { '&$checked': { color: theme.palette.secondary.main, '&:hover': { backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity), '@media (hover: none)': { backgroundColor: 'transparent' } } }, '&$disabled': { color: theme.palette.type === 'light' ? theme.palette.grey[400] : theme.palette.grey[800] }, '&$checked + $track': { backgroundColor: theme.palette.secondary.main }, '&$disabled + $track': { backgroundColor: theme.palette.type === 'light' ? theme.palette.common.black : theme.palette.common.white } }, sizeSmall: { width: 40, height: 24, padding: 7, '& $thumb': { width: 16, height: 16 }, '& $switchBase': { padding: 4, '&$checked': { transform: 'translateX(16px)' } } }, checked: {}, disabled: {}, input: { left: '-100%', width: '300%' }, thumb: { boxShadow: theme.shadows[1], backgroundColor: 'currentColor', width: 20, height: 20, borderRadius: '50%' }, track: { height: '100%', width: '100%', borderRadius: 14 / 2, zIndex: -1, transition: theme.transitions.create(['opacity', 'background-color'], { duration: theme.transitions.duration.shortest }), backgroundColor: theme.palette.type === 'light' ? theme.palette.common.black : theme.palette.common.white, opacity: theme.palette.type === 'light' ? 0.38 : 0.3 } }; };
|
|
8395
|
+
var Switch$1 = /*#__PURE__*/ N$1(function Switch(props, ref) { var classes = props.classes, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'secondary' : _props$color, _props$edge = props.edge, edge = _props$edge === void 0 ? false : _props$edge, _props$size = props.size, size = _props$size === void 0 ? 'medium' : _props$size, other = _objectWithoutProperties$2(props, ["classes", "className", "color", "edge", "size"]); var icon = /*#__PURE__*/ y$3("span", { className: classes.thumb }); return /*#__PURE__*/ y$3("span", { className: clsx(classes.root, className, { 'start': classes.edgeStart, 'end': classes.edgeEnd }[edge], size === "small" && classes["size".concat(capitalize(size))]) }, /*#__PURE__*/ y$3(SwitchBase$1, _extends$4({ type: "checkbox", icon: icon, checkedIcon: icon, classes: { root: clsx(classes.switchBase, classes["color".concat(capitalize(color))]), input: classes.input, checked: classes.checked, disabled: classes.disabled }, ref: ref }, other)), /*#__PURE__*/ y$3("span", { className: classes.track })); });
|
|
8396
|
+
var MUISwitch = withStyles(styles$c, { name: 'MuiSwitch' })(Switch$1);
|
|
8263
8397
|
var TableContext = /*#__PURE__*/ F$4();
|
|
8264
|
-
var styles$
|
|
8398
|
+
var styles$b = function styles(theme) { return { root: { display: 'table', width: '100%', borderCollapse: 'collapse', borderSpacing: 0, '& caption': _extends$4({}, theme.typography.body2, { padding: theme.spacing(2), color: theme.palette.text.secondary, textAlign: 'left', captionSide: 'bottom' }) }, stickyHeader: { borderCollapse: 'separate' } }; };
|
|
8265
8399
|
var defaultComponent$3 = 'table';
|
|
8266
8400
|
var Table$1 = /*#__PURE__*/ N$1(function Table(props, ref) { var classes = props.classes, className = props.className, _props$component = props.component, Component = _props$component === void 0 ? defaultComponent$3 : _props$component, _props$padding = props.padding, padding = _props$padding === void 0 ? 'normal' : _props$padding, _props$size = props.size, size = _props$size === void 0 ? 'medium' : _props$size, _props$stickyHeader = props.stickyHeader, stickyHeader = _props$stickyHeader === void 0 ? false : _props$stickyHeader, other = _objectWithoutProperties$2(props, ["classes", "className", "component", "padding", "size", "stickyHeader"]); var table = F$3(function () { return { padding: padding, size: size, stickyHeader: stickyHeader }; }, [padding, size, stickyHeader]); return /*#__PURE__*/ y$3(TableContext.Provider, { value: table }, /*#__PURE__*/ y$3(Component, _extends$4({ role: Component === defaultComponent$3 ? null : 'table', ref: ref, className: clsx(classes.root, className, stickyHeader && classes.stickyHeader) }, other))); });
|
|
8267
|
-
var MUITable = withStyles(styles$
|
|
8401
|
+
var MUITable = withStyles(styles$b, { name: 'MuiTable' })(Table$1);
|
|
8268
8402
|
var Tablelvl2Context = /*#__PURE__*/ F$4();
|
|
8269
|
-
var styles$
|
|
8403
|
+
var styles$a = { root: { display: 'table-row-group' } };
|
|
8270
8404
|
var tablelvl2$1 = { variant: 'body' };
|
|
8271
8405
|
var defaultComponent$2 = 'tbody';
|
|
8272
8406
|
var TableBody = /*#__PURE__*/ N$1(function TableBody(props, ref) { var classes = props.classes, className = props.className, _props$component = props.component, Component = _props$component === void 0 ? defaultComponent$2 : _props$component, other = _objectWithoutProperties$2(props, ["classes", "className", "component"]); return /*#__PURE__*/ y$3(Tablelvl2Context.Provider, { value: tablelvl2$1 }, /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, className), ref: ref, role: Component === defaultComponent$2 ? null : 'rowgroup' }, other))); });
|
|
8273
|
-
var TableBody$1 = withStyles(styles$
|
|
8274
|
-
var styles$
|
|
8407
|
+
var TableBody$1 = withStyles(styles$a, { name: 'MuiTableBody' })(TableBody);
|
|
8408
|
+
var styles$9 = function styles(theme) { return { root: _extends$4({}, theme.typography.body2, { display: 'table-cell', verticalAlign: 'inherit', borderBottom: "1px solid\n ".concat(theme.palette.type === 'light' ? lighten(alpha(theme.palette.divider, 1), 0.88) : darken(alpha(theme.palette.divider, 1), 0.68)), textAlign: 'left', padding: 16 }), head: { color: theme.palette.text.primary, lineHeight: theme.typography.pxToRem(24), fontWeight: theme.typography.fontWeightMedium }, body: { color: theme.palette.text.primary }, footer: { color: theme.palette.text.secondary, lineHeight: theme.typography.pxToRem(21), fontSize: theme.typography.pxToRem(12) }, sizeSmall: { padding: '6px 24px 6px 16px', '&:last-child': { paddingRight: 16 }, '&$paddingCheckbox': { width: 24, padding: '0 12px 0 16px', '&:last-child': { paddingLeft: 12, paddingRight: 16 }, '& > *': { padding: 0 } } }, paddingCheckbox: { width: 48, padding: '0 0 0 4px', '&:last-child': { paddingLeft: 0, paddingRight: 4 } }, paddingNone: { padding: 0, '&:last-child': { padding: 0 } }, alignLeft: { textAlign: 'left' }, alignCenter: { textAlign: 'center' }, alignRight: { textAlign: 'right', flexDirection: 'row-reverse' }, alignJustify: { textAlign: 'justify' }, stickyHeader: { position: 'sticky', top: 0, left: 0, zIndex: 2, backgroundColor: theme.palette.background["default"] } }; };
|
|
8275
8409
|
var TableCell$1 = /*#__PURE__*/ N$1(function TableCell(props, ref) { var _props$align = props.align, align = _props$align === void 0 ? 'inherit' : _props$align, classes = props.classes, className = props.className, component = props.component, paddingProp = props.padding, scopeProp = props.scope, sizeProp = props.size, sortDirection = props.sortDirection, variantProp = props.variant, other = _objectWithoutProperties$2(props, ["align", "classes", "className", "component", "padding", "scope", "size", "sortDirection", "variant"]); var table = q$5(TableContext); var tablelvl2 = q$5(Tablelvl2Context); var isHeadCell = tablelvl2 && tablelvl2.variant === 'head'; var role; var Component; if (component) {
|
|
8276
8410
|
Component = component;
|
|
8277
8411
|
role = isHeadCell ? 'columnheader' : 'cell';
|
|
@@ -8283,42 +8417,60 @@ else {
|
|
|
8283
8417
|
} var padding = paddingProp || (table && table.padding ? table.padding : 'normal'); var size = sizeProp || (table && table.size ? table.size : 'medium'); var variant = variantProp || tablelvl2 && tablelvl2.variant; var ariaSort = null; if (sortDirection) {
|
|
8284
8418
|
ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';
|
|
8285
8419
|
} return /*#__PURE__*/ y$3(Component, _extends$4({ ref: ref, className: clsx(classes.root, classes[variant], className, align !== 'inherit' && classes["align".concat(capitalize(align))], padding !== 'normal' && classes["padding".concat(capitalize(padding))], size !== 'medium' && classes["size".concat(capitalize(size))], variant === 'head' && table && table.stickyHeader && classes.stickyHeader), "aria-sort": ariaSort, role: role, scope: scope }, other)); });
|
|
8286
|
-
var MUITableCell = withStyles(styles$
|
|
8287
|
-
var styles$
|
|
8420
|
+
var MUITableCell = withStyles(styles$9, { name: 'MuiTableCell' })(TableCell$1);
|
|
8421
|
+
var styles$8 = { root: { width: '100%', overflowX: 'auto' } };
|
|
8288
8422
|
var TableContainer = /*#__PURE__*/ N$1(function TableContainer(props, ref) { var classes = props.classes, className = props.className, _props$component = props.component, Component = _props$component === void 0 ? 'div' : _props$component, other = _objectWithoutProperties$2(props, ["classes", "className", "component"]); return /*#__PURE__*/ y$3(Component, _extends$4({ ref: ref, className: clsx(classes.root, className) }, other)); });
|
|
8289
|
-
var TableContainer$1 = withStyles(styles$
|
|
8290
|
-
var styles$
|
|
8423
|
+
var TableContainer$1 = withStyles(styles$8, { name: 'MuiTableContainer' })(TableContainer);
|
|
8424
|
+
var styles$7 = { root: { display: 'table-header-group' } };
|
|
8291
8425
|
var tablelvl2 = { variant: 'head' };
|
|
8292
8426
|
var defaultComponent$1 = 'thead';
|
|
8293
8427
|
var TableHead = /*#__PURE__*/ N$1(function TableHead(props, ref) { var classes = props.classes, className = props.className, _props$component = props.component, Component = _props$component === void 0 ? defaultComponent$1 : _props$component, other = _objectWithoutProperties$2(props, ["classes", "className", "component"]); return /*#__PURE__*/ y$3(Tablelvl2Context.Provider, { value: tablelvl2 }, /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, className), ref: ref, role: Component === defaultComponent$1 ? null : 'rowgroup' }, other))); });
|
|
8294
|
-
var TableHead$1 = withStyles(styles$
|
|
8295
|
-
var styles$
|
|
8428
|
+
var TableHead$1 = withStyles(styles$7, { name: 'MuiTableHead' })(TableHead);
|
|
8429
|
+
var styles$6 = function styles(theme) { return { root: { position: 'relative', display: 'flex', alignItems: 'center' }, gutters: _defineProperty$1({ paddingLeft: theme.spacing(2), paddingRight: theme.spacing(2) }, theme.breakpoints.up('sm'), { paddingLeft: theme.spacing(3), paddingRight: theme.spacing(3) }), regular: theme.mixins.toolbar, dense: { minHeight: 48 } }; };
|
|
8296
8430
|
var Toolbar = /*#__PURE__*/ N$1(function Toolbar(props, ref) { var classes = props.classes, className = props.className, _props$component = props.component, Component = _props$component === void 0 ? 'div' : _props$component, _props$disableGutters = props.disableGutters, disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters, _props$variant = props.variant, variant = _props$variant === void 0 ? 'regular' : _props$variant, other = _objectWithoutProperties$2(props, ["classes", "className", "component", "disableGutters", "variant"]); return /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, classes[variant], className, !disableGutters && classes.gutters), ref: ref }, other)); });
|
|
8297
|
-
var Toolbar$1 = withStyles(styles$
|
|
8431
|
+
var Toolbar$1 = withStyles(styles$6, { name: 'MuiToolbar' })(Toolbar);
|
|
8298
8432
|
var KeyboardArrowLeft = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z" }));
|
|
8299
8433
|
var KeyboardArrowRight = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" }));
|
|
8300
|
-
var _ref$
|
|
8301
|
-
var _ref2 = /*#__PURE__*/ y$3(KeyboardArrowLeft, null);
|
|
8434
|
+
var _ref$2 = /*#__PURE__*/ y$3(KeyboardArrowRight, null);
|
|
8435
|
+
var _ref2$1 = /*#__PURE__*/ y$3(KeyboardArrowLeft, null);
|
|
8302
8436
|
var _ref3 = /*#__PURE__*/ y$3(KeyboardArrowLeft, null);
|
|
8303
8437
|
var _ref4 = /*#__PURE__*/ y$3(KeyboardArrowRight, null);
|
|
8304
|
-
var TablePaginationActions = /*#__PURE__*/ N$1(function TablePaginationActions(props, ref) { var backIconButtonProps = props.backIconButtonProps, count = props.count, nextIconButtonProps = props.nextIconButtonProps, _props$onChangePage = props.onChangePage, onChangePage = _props$onChangePage === void 0 ? function () { } : _props$onChangePage, _props$onPageChange = props.onPageChange, onPageChange = _props$onPageChange === void 0 ? function () { } : _props$onPageChange, page = props.page, rowsPerPage = props.rowsPerPage, other = _objectWithoutProperties$2(props, ["backIconButtonProps", "count", "nextIconButtonProps", "onChangePage", "onPageChange", "page", "rowsPerPage"]); var theme = useTheme(); var handleBackButtonClick = function handleBackButtonClick(event) { onChangePage(event, page - 1); onPageChange(event, page - 1); }; var handleNextButtonClick = function handleNextButtonClick(event) { onChangePage(event, page + 1); onPageChange(event, page + 1); }; return /*#__PURE__*/ y$3("div", _extends$4({ ref: ref }, other), /*#__PURE__*/ y$3(IconButton$1, _extends$4({ onClick: handleBackButtonClick, disabled: page === 0, color: "inherit" }, backIconButtonProps), theme.direction === 'rtl' ? _ref$
|
|
8305
|
-
var styles$
|
|
8438
|
+
var TablePaginationActions = /*#__PURE__*/ N$1(function TablePaginationActions(props, ref) { var backIconButtonProps = props.backIconButtonProps, count = props.count, nextIconButtonProps = props.nextIconButtonProps, _props$onChangePage = props.onChangePage, onChangePage = _props$onChangePage === void 0 ? function () { } : _props$onChangePage, _props$onPageChange = props.onPageChange, onPageChange = _props$onPageChange === void 0 ? function () { } : _props$onPageChange, page = props.page, rowsPerPage = props.rowsPerPage, other = _objectWithoutProperties$2(props, ["backIconButtonProps", "count", "nextIconButtonProps", "onChangePage", "onPageChange", "page", "rowsPerPage"]); var theme = useTheme(); var handleBackButtonClick = function handleBackButtonClick(event) { onChangePage(event, page - 1); onPageChange(event, page - 1); }; var handleNextButtonClick = function handleNextButtonClick(event) { onChangePage(event, page + 1); onPageChange(event, page + 1); }; return /*#__PURE__*/ y$3("div", _extends$4({ ref: ref }, other), /*#__PURE__*/ y$3(IconButton$1, _extends$4({ onClick: handleBackButtonClick, disabled: page === 0, color: "inherit" }, backIconButtonProps), theme.direction === 'rtl' ? _ref$2 : _ref2$1), /*#__PURE__*/ y$3(IconButton$1, _extends$4({ onClick: handleNextButtonClick, disabled: count !== -1 ? page >= Math.ceil(count / rowsPerPage) - 1 : false, color: "inherit" }, nextIconButtonProps), theme.direction === 'rtl' ? _ref3 : _ref4)); });
|
|
8439
|
+
var styles$5 = function styles(theme) { return { root: { color: theme.palette.text.primary, fontSize: theme.typography.pxToRem(14), overflow: 'auto', '&:last-child': { padding: 0 } }, toolbar: { minHeight: 52, paddingRight: 2 }, spacer: { flex: '1 1 100%' }, caption: { flexShrink: 0 }, selectRoot: { marginRight: 32, marginLeft: 8 }, select: { paddingLeft: 8, paddingRight: 24, textAlign: 'right', textAlignLast: 'right' }, selectIcon: {}, input: { color: 'inherit', fontSize: 'inherit', flexShrink: 0 }, menuItem: {}, actions: { flexShrink: 0, marginLeft: 20 } }; };
|
|
8306
8440
|
var defaultLabelDisplayedRows = function defaultLabelDisplayedRows(_ref) { var from = _ref.from, to = _ref.to, count = _ref.count; return "".concat(from, "-").concat(to, " of ").concat(count !== -1 ? count : "more than ".concat(to)); };
|
|
8307
|
-
var defaultRowsPerPageOptions = [10, 25, 50, 100];
|
|
8308
|
-
var TablePagination = /*#__PURE__*/ N$1(function TablePagination(props, ref) { var _props$ActionsCompone = props.ActionsComponent, ActionsComponent = _props$ActionsCompone === void 0 ? TablePaginationActions : _props$ActionsCompone, backIconButtonProps = props.backIconButtonProps, _props$backIconButton = props.backIconButtonText, backIconButtonText = _props$backIconButton === void 0 ? 'Previous page' : _props$backIconButton, classes = props.classes, className = props.className, colSpanProp = props.colSpan, _props$component = props.component, Component = _props$component === void 0 ? MUITableCell : _props$component, count = props.count, _props$labelDisplayed = props.labelDisplayedRows, labelDisplayedRows = _props$labelDisplayed === void 0 ? defaultLabelDisplayedRows : _props$labelDisplayed, _props$labelRowsPerPa = props.labelRowsPerPage, labelRowsPerPage = _props$labelRowsPerPa === void 0 ? 'Rows per page:' : _props$labelRowsPerPa, nextIconButtonProps = props.nextIconButtonProps, _props$nextIconButton = props.nextIconButtonText, nextIconButtonText = _props$nextIconButton === void 0 ? 'Next page' : _props$nextIconButton, onChangePage = props.onChangePage, onPageChange = props.onPageChange, onChangeRowsPerPageProp = props.onChangeRowsPerPage, onRowsPerPageChangeProp = props.onRowsPerPageChange, page = props.page, rowsPerPage = props.rowsPerPage, _props$rowsPerPageOpt = props.rowsPerPageOptions, rowsPerPageOptions = _props$rowsPerPageOpt === void 0 ? defaultRowsPerPageOptions : _props$rowsPerPageOpt, _props$SelectProps = props.SelectProps, SelectProps = _props$SelectProps === void 0 ? {} : _props$SelectProps, other = _objectWithoutProperties$2(props, ["ActionsComponent", "backIconButtonProps", "backIconButtonText", "classes", "className", "colSpan", "component", "count", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "nextIconButtonText", "onChangePage", "onPageChange", "onChangeRowsPerPage", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps"]); var onChangeRowsPerPage = onChangeRowsPerPageProp || onRowsPerPageChangeProp; var colSpan; if (Component === MUITableCell || Component === 'td') {
|
|
8441
|
+
var defaultRowsPerPageOptions$1 = [10, 25, 50, 100];
|
|
8442
|
+
var TablePagination = /*#__PURE__*/ N$1(function TablePagination(props, ref) { var _props$ActionsCompone = props.ActionsComponent, ActionsComponent = _props$ActionsCompone === void 0 ? TablePaginationActions : _props$ActionsCompone, backIconButtonProps = props.backIconButtonProps, _props$backIconButton = props.backIconButtonText, backIconButtonText = _props$backIconButton === void 0 ? 'Previous page' : _props$backIconButton, classes = props.classes, className = props.className, colSpanProp = props.colSpan, _props$component = props.component, Component = _props$component === void 0 ? MUITableCell : _props$component, count = props.count, _props$labelDisplayed = props.labelDisplayedRows, labelDisplayedRows = _props$labelDisplayed === void 0 ? defaultLabelDisplayedRows : _props$labelDisplayed, _props$labelRowsPerPa = props.labelRowsPerPage, labelRowsPerPage = _props$labelRowsPerPa === void 0 ? 'Rows per page:' : _props$labelRowsPerPa, nextIconButtonProps = props.nextIconButtonProps, _props$nextIconButton = props.nextIconButtonText, nextIconButtonText = _props$nextIconButton === void 0 ? 'Next page' : _props$nextIconButton, onChangePage = props.onChangePage, onPageChange = props.onPageChange, onChangeRowsPerPageProp = props.onChangeRowsPerPage, onRowsPerPageChangeProp = props.onRowsPerPageChange, page = props.page, rowsPerPage = props.rowsPerPage, _props$rowsPerPageOpt = props.rowsPerPageOptions, rowsPerPageOptions = _props$rowsPerPageOpt === void 0 ? defaultRowsPerPageOptions$1 : _props$rowsPerPageOpt, _props$SelectProps = props.SelectProps, SelectProps = _props$SelectProps === void 0 ? {} : _props$SelectProps, other = _objectWithoutProperties$2(props, ["ActionsComponent", "backIconButtonProps", "backIconButtonText", "classes", "className", "colSpan", "component", "count", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "nextIconButtonText", "onChangePage", "onPageChange", "onChangeRowsPerPage", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps"]); var onChangeRowsPerPage = onChangeRowsPerPageProp || onRowsPerPageChangeProp; var colSpan; if (Component === MUITableCell || Component === 'td') {
|
|
8309
8443
|
colSpan = colSpanProp || 1000;
|
|
8310
|
-
} var selectId = useId(); var labelId = useId(); var MenuItemComponent = SelectProps["native"] ? 'option' : MenuItem$2; return /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, className), colSpan: colSpan, ref: ref }, other), /*#__PURE__*/ y$3(Toolbar$1, { className: classes.toolbar }, /*#__PURE__*/ y$3("div", { className: classes.spacer }), rowsPerPageOptions.length > 1 && /*#__PURE__*/ y$3(
|
|
8311
|
-
var TablePagination$1 = withStyles(styles$
|
|
8312
|
-
var styles$
|
|
8444
|
+
} var selectId = useId(); var labelId = useId(); var MenuItemComponent = SelectProps["native"] ? 'option' : MenuItem$2; return /*#__PURE__*/ y$3(Component, _extends$4({ className: clsx(classes.root, className), colSpan: colSpan, ref: ref }, other), /*#__PURE__*/ y$3(Toolbar$1, { className: classes.toolbar }, /*#__PURE__*/ y$3("div", { className: classes.spacer }), rowsPerPageOptions.length > 1 && /*#__PURE__*/ y$3(Typography$2, { color: "inherit", variant: "body2", className: classes.caption, id: labelId }, labelRowsPerPage), rowsPerPageOptions.length > 1 && /*#__PURE__*/ y$3(MuiSelect, _extends$4({ classes: { select: classes.select, icon: classes.selectIcon }, input: /*#__PURE__*/ y$3(InputBase$1, { className: clsx(classes.input, classes.selectRoot) }), value: rowsPerPage, onChange: onChangeRowsPerPage, id: selectId, labelId: labelId }, SelectProps), rowsPerPageOptions.map(function (rowsPerPageOption) { return /*#__PURE__*/ y$3(MenuItemComponent, { className: classes.menuItem, key: rowsPerPageOption.value ? rowsPerPageOption.value : rowsPerPageOption, value: rowsPerPageOption.value ? rowsPerPageOption.value : rowsPerPageOption }, rowsPerPageOption.label ? rowsPerPageOption.label : rowsPerPageOption); })), /*#__PURE__*/ y$3(Typography$2, { color: "inherit", variant: "body2", className: classes.caption }, labelDisplayedRows({ from: count === 0 ? 0 : page * rowsPerPage + 1, to: count !== -1 ? Math.min(count, (page + 1) * rowsPerPage) : (page + 1) * rowsPerPage, count: count === -1 ? -1 : count, page: page })), /*#__PURE__*/ y$3(ActionsComponent, { className: classes.actions, backIconButtonProps: _extends$4({ title: backIconButtonText, 'aria-label': backIconButtonText }, backIconButtonProps), count: count, nextIconButtonProps: _extends$4({ title: nextIconButtonText, 'aria-label': nextIconButtonText }, nextIconButtonProps), onChangePage: onChangePage, onPageChange: onPageChange, page: page, rowsPerPage: rowsPerPage }))); });
|
|
8445
|
+
var TablePagination$1 = withStyles(styles$5, { name: 'MuiTablePagination' })(TablePagination);
|
|
8446
|
+
var styles$4 = function styles(theme) { return { root: { color: 'inherit', display: 'table-row', verticalAlign: 'middle', outline: 0, '&$hover:hover': { backgroundColor: theme.palette.action.hover }, '&$selected, &$selected:hover': { backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.selectedOpacity) } }, selected: {}, hover: {}, head: {}, footer: {} }; };
|
|
8313
8447
|
var defaultComponent = 'tr';
|
|
8314
8448
|
var TableRow$1 = /*#__PURE__*/ N$1(function TableRow(props, ref) { var classes = props.classes, className = props.className, _props$component = props.component, Component = _props$component === void 0 ? defaultComponent : _props$component, _props$hover = props.hover, hover = _props$hover === void 0 ? false : _props$hover, _props$selected = props.selected, selected = _props$selected === void 0 ? false : _props$selected, other = _objectWithoutProperties$2(props, ["classes", "className", "component", "hover", "selected"]); var tablelvl2 = q$5(Tablelvl2Context); return /*#__PURE__*/ y$3(Component, _extends$4({ ref: ref, className: clsx(classes.root, className, tablelvl2 && { 'head': classes.head, 'footer': classes.footer }[tablelvl2.variant], hover && classes.hover, selected && classes.selected), role: Component === defaultComponent ? null : 'row' }, other)); });
|
|
8315
|
-
var MUITableRow = withStyles(styles$
|
|
8449
|
+
var MUITableRow = withStyles(styles$4, { name: 'MuiTableRow' })(TableRow$1);
|
|
8450
|
+
var variantComponent = { standard: Input$3, filled: FilledInput$1, outlined: OutlinedInput$1 };
|
|
8451
|
+
var styles$3 = { root: {} };
|
|
8452
|
+
var TextField = /*#__PURE__*/ N$1(function TextField(props, ref) { var autoComplete = props.autoComplete, _props$autoFocus = props.autoFocus, autoFocus = _props$autoFocus === void 0 ? false : _props$autoFocus, children = props.children, classes = props.classes, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'primary' : _props$color, defaultValue = props.defaultValue, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, _props$error = props.error, error = _props$error === void 0 ? false : _props$error, FormHelperTextProps = props.FormHelperTextProps, _props$fullWidth = props.fullWidth, fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth, helperText = props.helperText, hiddenLabel = props.hiddenLabel, id = props.id, InputLabelProps = props.InputLabelProps, inputProps = props.inputProps, InputProps = props.InputProps, inputRef = props.inputRef, label = props.label, _props$multiline = props.multiline, multiline = _props$multiline === void 0 ? false : _props$multiline, name = props.name, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, placeholder = props.placeholder, _props$required = props.required, required = _props$required === void 0 ? false : _props$required, rows = props.rows, rowsMax = props.rowsMax, maxRows = props.maxRows, minRows = props.minRows, _props$select = props.select, select = _props$select === void 0 ? false : _props$select, SelectProps = props.SelectProps, type = props.type, value = props.value, _props$variant = props.variant, variant = _props$variant === void 0 ? 'standard' : _props$variant, other = _objectWithoutProperties$2(props, ["autoComplete", "autoFocus", "children", "classes", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "hiddenLabel", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "multiline", "name", "onBlur", "onChange", "onFocus", "placeholder", "required", "rows", "rowsMax", "maxRows", "minRows", "select", "SelectProps", "type", "value", "variant"]); var InputMore = {}; if (variant === 'outlined') {
|
|
8453
|
+
if (InputLabelProps && typeof InputLabelProps.shrink !== 'undefined') {
|
|
8454
|
+
InputMore.notched = InputLabelProps.shrink;
|
|
8455
|
+
}
|
|
8456
|
+
if (label) {
|
|
8457
|
+
var _InputLabelProps$requ;
|
|
8458
|
+
var displayRequired = (_InputLabelProps$requ = InputLabelProps === null || InputLabelProps === void 0 ? void 0 : InputLabelProps.required) !== null && _InputLabelProps$requ !== void 0 ? _InputLabelProps$requ : required;
|
|
8459
|
+
InputMore.label = /*#__PURE__*/ y$3(g$5, null, label, displayRequired && "\xA0*");
|
|
8460
|
+
}
|
|
8461
|
+
} if (select) {
|
|
8462
|
+
if (!SelectProps || !SelectProps["native"]) {
|
|
8463
|
+
InputMore.id = undefined;
|
|
8464
|
+
}
|
|
8465
|
+
InputMore['aria-describedby'] = undefined;
|
|
8466
|
+
} var helperTextId = helperText && id ? "".concat(id, "-helper-text") : undefined; var inputLabelId = label && id ? "".concat(id, "-label") : undefined; var InputComponent = variantComponent[variant]; var InputElement = /*#__PURE__*/ y$3(InputComponent, _extends$4({ "aria-describedby": helperTextId, autoComplete: autoComplete, autoFocus: autoFocus, defaultValue: defaultValue, fullWidth: fullWidth, multiline: multiline, name: name, rows: rows, rowsMax: rowsMax, maxRows: maxRows, minRows: minRows, type: type, value: value, id: id, inputRef: inputRef, onBlur: onBlur, onChange: onChange, onFocus: onFocus, placeholder: placeholder, inputProps: inputProps }, InputMore, InputProps)); return /*#__PURE__*/ y$3(FormControl$1, _extends$4({ className: clsx(classes.root, className), disabled: disabled, error: error, fullWidth: fullWidth, hiddenLabel: hiddenLabel, ref: ref, required: required, color: color, variant: variant }, other), label && /*#__PURE__*/ y$3(InputLabel$1, _extends$4({ htmlFor: id, id: inputLabelId }, InputLabelProps), label), select ? /*#__PURE__*/ y$3(MuiSelect, _extends$4({ "aria-describedby": helperTextId, id: id, labelId: inputLabelId, value: value, input: InputElement }, SelectProps), children) : InputElement, helperText && /*#__PURE__*/ y$3(FormHelperText$1, _extends$4({ id: helperTextId }, FormHelperTextProps), helperText)); });
|
|
8467
|
+
var TextField$1 = withStyles(styles$3, { name: 'MuiTextField' })(TextField);
|
|
8316
8468
|
function round(value) { return Math.round(value * 1e5) / 1e5; }
|
|
8317
8469
|
function arrowGenerator() { return { '&[x-placement*="bottom"] $arrow': { top: 0, left: 0, marginTop: '-0.71em', marginLeft: 4, marginRight: 4, '&::before': { transformOrigin: '0 100%' } }, '&[x-placement*="top"] $arrow': { bottom: 0, left: 0, marginBottom: '-0.71em', marginLeft: 4, marginRight: 4, '&::before': { transformOrigin: '100% 0' } }, '&[x-placement*="right"] $arrow': { left: 0, marginLeft: '-0.71em', height: '1em', width: '0.71em', marginTop: 4, marginBottom: 4, '&::before': { transformOrigin: '100% 100%' } }, '&[x-placement*="left"] $arrow': { right: 0, marginRight: '-0.71em', height: '1em', width: '0.71em', marginTop: 4, marginBottom: 4, '&::before': { transformOrigin: '0 0' } } }; }
|
|
8318
|
-
var styles$
|
|
8470
|
+
var styles$2 = function styles(theme) { return { popper: { zIndex: theme.zIndex.tooltip, pointerEvents: 'none' }, popperInteractive: { pointerEvents: 'auto' }, popperArrow: arrowGenerator(), tooltip: { backgroundColor: alpha(theme.palette.grey[700], 0.9), borderRadius: theme.shape.borderRadius, color: theme.palette.common.white, fontFamily: theme.typography.fontFamily, padding: '4px 8px', fontSize: theme.typography.pxToRem(10), lineHeight: "".concat(round(14 / 10), "em"), maxWidth: 300, wordWrap: 'break-word', fontWeight: theme.typography.fontWeightMedium }, tooltipArrow: { position: 'relative', margin: '0' }, arrow: { overflow: 'hidden', position: 'absolute', width: '1em', height: '0.71em', boxSizing: 'border-box', color: alpha(theme.palette.grey[700], 0.9), '&::before': { content: '""', margin: 'auto', display: 'block', width: '100%', height: '100%', backgroundColor: 'currentColor', transform: 'rotate(45deg)' } }, touch: { padding: '8px 16px', fontSize: theme.typography.pxToRem(14), lineHeight: "".concat(round(16 / 14), "em"), fontWeight: theme.typography.fontWeightRegular }, tooltipPlacementLeft: _defineProperty$1({ transformOrigin: 'right center', margin: '0 24px ' }, theme.breakpoints.up('sm'), { margin: '0 14px' }), tooltipPlacementRight: _defineProperty$1({ transformOrigin: 'left center', margin: '0 24px' }, theme.breakpoints.up('sm'), { margin: '0 14px' }), tooltipPlacementTop: _defineProperty$1({ transformOrigin: 'center bottom', margin: '24px 0' }, theme.breakpoints.up('sm'), { margin: '14px 0' }), tooltipPlacementBottom: _defineProperty$1({ transformOrigin: 'center top', margin: '24px 0' }, theme.breakpoints.up('sm'), { margin: '14px 0' }) }; };
|
|
8319
8471
|
var hystersisOpen = false;
|
|
8320
8472
|
var hystersisTimer = null;
|
|
8321
|
-
var Tooltip$1 = /*#__PURE__*/ N$1(function Tooltip(props, ref) { var _props$arrow = props.arrow, arrow = _props$arrow === void 0 ? false : _props$arrow, children = props.children, classes = props.classes, _props$disableFocusLi = props.disableFocusListener, disableFocusListener = _props$disableFocusLi === void 0 ? false : _props$disableFocusLi, _props$disableHoverLi = props.disableHoverListener, disableHoverListener = _props$disableHoverLi === void 0 ? false : _props$disableHoverLi, _props$disableTouchLi = props.disableTouchListener, disableTouchListener = _props$disableTouchLi === void 0 ? false : _props$disableTouchLi, _props$enterDelay = props.enterDelay, enterDelay = _props$enterDelay === void 0 ? 100 : _props$enterDelay, _props$enterNextDelay = props.enterNextDelay, enterNextDelay = _props$enterNextDelay === void 0 ? 0 : _props$enterNextDelay, _props$enterTouchDela = props.enterTouchDelay, enterTouchDelay = _props$enterTouchDela === void 0 ? 700 : _props$enterTouchDela, idProp = props.id, _props$interactive = props.interactive, interactive = _props$interactive === void 0 ? false : _props$interactive, _props$leaveDelay = props.leaveDelay, leaveDelay = _props$leaveDelay === void 0 ? 0 : _props$leaveDelay, _props$leaveTouchDela = props.leaveTouchDelay, leaveTouchDelay = _props$leaveTouchDela === void 0 ? 1500 : _props$leaveTouchDela, onClose = props.onClose, onOpen = props.onOpen, openProp = props.open, _props$placement = props.placement, placement = _props$placement === void 0 ? 'bottom' : _props$placement, _props$PopperComponen = props.PopperComponent, PopperComponent = _props$PopperComponen === void 0 ? Popper : _props$PopperComponen, PopperProps = props.PopperProps, title = props.title, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Grow : _props$TransitionComp, TransitionProps = props.TransitionProps, other = _objectWithoutProperties$2(props, ["arrow", "children", "classes", "disableFocusListener", "disableHoverListener", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "id", "interactive", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "title", "TransitionComponent", "TransitionProps"]); var theme = useTheme(); var _React$useState = h$4(), childNode = _React$useState[0], setChildNode = _React$useState[1]; var _React$useState2 = h$4(null), arrowRef = _React$useState2[0], setArrowRef = _React$useState2[1]; var ignoreNonTouchEvents = _$1(false); var closeTimer = _$1(); var enterTimer = _$1(); var leaveTimer = _$1(); var touchTimer = _$1(); var _useControlled = useControlled({ controlled: openProp, "default": false, name: 'Tooltip', state: 'open' }), _useControlled2 = _slicedToArray(_useControlled, 2), openState = _useControlled2[0], setOpenState = _useControlled2[1]; var open = openState; var id = useId(idProp); p$3(function () { return function () { clearTimeout(closeTimer.current); clearTimeout(enterTimer.current); clearTimeout(leaveTimer.current); clearTimeout(touchTimer.current); }; }, []); var handleOpen = function handleOpen(event) { clearTimeout(hystersisTimer); hystersisOpen = true; setOpenState(true); if (onOpen) {
|
|
8473
|
+
var Tooltip$1 = /*#__PURE__*/ N$1(function Tooltip(props, ref) { var _props$arrow = props.arrow, arrow = _props$arrow === void 0 ? false : _props$arrow, children = props.children, classes = props.classes, _props$disableFocusLi = props.disableFocusListener, disableFocusListener = _props$disableFocusLi === void 0 ? false : _props$disableFocusLi, _props$disableHoverLi = props.disableHoverListener, disableHoverListener = _props$disableHoverLi === void 0 ? false : _props$disableHoverLi, _props$disableTouchLi = props.disableTouchListener, disableTouchListener = _props$disableTouchLi === void 0 ? false : _props$disableTouchLi, _props$enterDelay = props.enterDelay, enterDelay = _props$enterDelay === void 0 ? 100 : _props$enterDelay, _props$enterNextDelay = props.enterNextDelay, enterNextDelay = _props$enterNextDelay === void 0 ? 0 : _props$enterNextDelay, _props$enterTouchDela = props.enterTouchDelay, enterTouchDelay = _props$enterTouchDela === void 0 ? 700 : _props$enterTouchDela, idProp = props.id, _props$interactive = props.interactive, interactive = _props$interactive === void 0 ? false : _props$interactive, _props$leaveDelay = props.leaveDelay, leaveDelay = _props$leaveDelay === void 0 ? 0 : _props$leaveDelay, _props$leaveTouchDela = props.leaveTouchDelay, leaveTouchDelay = _props$leaveTouchDela === void 0 ? 1500 : _props$leaveTouchDela, onClose = props.onClose, onOpen = props.onOpen, openProp = props.open, _props$placement = props.placement, placement = _props$placement === void 0 ? 'bottom' : _props$placement, _props$PopperComponen = props.PopperComponent, PopperComponent = _props$PopperComponen === void 0 ? Popper : _props$PopperComponen, PopperProps = props.PopperProps, title = props.title, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Grow : _props$TransitionComp, TransitionProps = props.TransitionProps, other = _objectWithoutProperties$2(props, ["arrow", "children", "classes", "disableFocusListener", "disableHoverListener", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "id", "interactive", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "title", "TransitionComponent", "TransitionProps"]); var theme = useTheme(); var _React$useState = h$4(), childNode = _React$useState[0], setChildNode = _React$useState[1]; var _React$useState2 = h$4(null), arrowRef = _React$useState2[0], setArrowRef = _React$useState2[1]; var ignoreNonTouchEvents = _$1(false); var closeTimer = _$1(); var enterTimer = _$1(); var leaveTimer = _$1(); var touchTimer = _$1(); var _useControlled = useControlled({ controlled: openProp, "default": false, name: 'Tooltip', state: 'open' }), _useControlled2 = _slicedToArray$1(_useControlled, 2), openState = _useControlled2[0], setOpenState = _useControlled2[1]; var open = openState; var id = useId(idProp); p$3(function () { return function () { clearTimeout(closeTimer.current); clearTimeout(enterTimer.current); clearTimeout(leaveTimer.current); clearTimeout(touchTimer.current); }; }, []); var handleOpen = function handleOpen(event) { clearTimeout(hystersisTimer); hystersisOpen = true; setOpenState(true); if (onOpen) {
|
|
8322
8474
|
onOpen(event);
|
|
8323
8475
|
} }; var handleEnter = function handleEnter() { var forward = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; return function (event) { var childrenProps = children.props; if (event.type === 'mouseover' && childrenProps.onMouseOver && forward) {
|
|
8324
8476
|
childrenProps.onMouseOver(event);
|
|
@@ -8375,21 +8527,23 @@ else {
|
|
|
8375
8527
|
interactiveWrapperListeners.onBlur = handleLeave(false);
|
|
8376
8528
|
}
|
|
8377
8529
|
} var mergedPopperProps = F$3(function () { return deepmerge({ popperOptions: { modifiers: { arrow: { enabled: Boolean(arrowRef), element: arrowRef } } } }, PopperProps); }, [arrowRef, PopperProps]); return /*#__PURE__*/ y$3(g$5, null, /*#__PURE__*/ sn(children, childrenProps), /*#__PURE__*/ y$3(PopperComponent, _extends$4({ className: clsx(classes.popper, interactive && classes.popperInteractive, arrow && classes.popperArrow), placement: placement, anchorEl: childNode, open: childNode ? open : false, id: childrenProps['aria-describedby'], transition: true }, interactiveWrapperListeners, mergedPopperProps), function (_ref) { var placementInner = _ref.placement, TransitionPropsInner = _ref.TransitionProps; return /*#__PURE__*/ y$3(TransitionComponent, _extends$4({ timeout: theme.transitions.duration.shorter }, TransitionPropsInner, TransitionProps), /*#__PURE__*/ y$3("div", { className: clsx(classes.tooltip, classes["tooltipPlacement".concat(capitalize(placementInner.split('-')[0]))], ignoreNonTouchEvents.current && classes.touch, arrow && classes.tooltipArrow) }, title, arrow ? /*#__PURE__*/ y$3("span", { className: classes.arrow, ref: setArrowRef }) : null)); })); });
|
|
8378
|
-
var
|
|
8379
|
-
var useStyles$
|
|
8380
|
-
var MainContainer = function MainContainer(
|
|
8381
|
-
var StytchClientContext = /*#__PURE__*/ wn.createContext(null);
|
|
8530
|
+
var Tooltip$2 = withStyles(styles$2, { name: 'MuiTooltip', flip: false })(Tooltip$1);
|
|
8531
|
+
var useStyles$p = makeStyles(function (theme) { return { root: { background: theme.styleConfig.container.backgroundColor, border: '1px solid', borderColor: theme.styleConfig.container.borderColor, borderRadius: theme.styleConfig.container.borderRadius, color: theme.styleConfig.colors.primary, width: theme.styleConfig.container.width, padding: theme.spacing(6), boxSizing: 'border-box' } }; });
|
|
8532
|
+
var MainContainer = function MainContainer(_ref6) { var children = _ref6.children; var classes = useStyles$p(); return /*#__PURE__*/ wn.createElement("div", { className: classes.root }, children); };
|
|
8533
|
+
var StytchClientContext = /*#__PURE__*/ wn.createContext({ client: null });
|
|
8534
|
+
var useAdminPortalContext = function useAdminPortalContext() { return q$5(StytchClientContext); };
|
|
8535
|
+
var useAdminPortalOrgUIConfig = function useAdminPortalOrgUIConfig() { return useAdminPortalContext().config; };
|
|
8382
8536
|
var CheckCircle = {};
|
|
8383
8537
|
var interopRequireDefault = { exports: {} };
|
|
8384
8538
|
(function (module) { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; })(interopRequireDefault);
|
|
8385
8539
|
var interopRequireDefaultExports = interopRequireDefault.exports;
|
|
8386
8540
|
var interopRequireWildcard = { exports: {} };
|
|
8387
|
-
var _typeof = { exports: {} };
|
|
8541
|
+
var _typeof$1 = { exports: {} };
|
|
8388
8542
|
(function (module) { function _typeof(o) {
|
|
8389
8543
|
"@babel/helpers - typeof";
|
|
8390
8544
|
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
|
8391
|
-
} module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; })(_typeof);
|
|
8392
|
-
var _typeofExports = _typeof.exports;
|
|
8545
|
+
} module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; })(_typeof$1);
|
|
8546
|
+
var _typeofExports = _typeof$1.exports;
|
|
8393
8547
|
(function (module) { var _typeof = _typeofExports["default"]; function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap)
|
|
8394
8548
|
return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule)
|
|
8395
8549
|
return e; if (null === e || "object" != _typeof(e) && "function" != typeof e)
|
|
@@ -8463,11 +8617,11 @@ var ReportProblemOutlinedIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "
|
|
|
8463
8617
|
var ErrorOutlineIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" }));
|
|
8464
8618
|
var InfoOutlinedIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z" }));
|
|
8465
8619
|
var CloseIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }));
|
|
8466
|
-
var styles = function styles(theme) { var getColor = theme.palette.type === 'light' ? darken : lighten; var getBackgroundColor = theme.palette.type === 'light' ? lighten : darken; return { root: _extends({}, theme.typography.body2, { borderRadius: theme.shape.borderRadius, backgroundColor: 'transparent', display: 'flex', padding: '6px 16px' }), standardSuccess: { color: getColor(theme.palette.success.main, 0.6), backgroundColor: getBackgroundColor(theme.palette.success.main, 0.9), '& $icon': { color: theme.palette.success.main } }, standardInfo: { color: getColor(theme.palette.info.main, 0.6), backgroundColor: getBackgroundColor(theme.palette.info.main, 0.9), '& $icon': { color: theme.palette.info.main } }, standardWarning: { color: getColor(theme.palette.warning.main, 0.6), backgroundColor: getBackgroundColor(theme.palette.warning.main, 0.9), '& $icon': { color: theme.palette.warning.main } }, standardError: { color: getColor(theme.palette.error.main, 0.6), backgroundColor: getBackgroundColor(theme.palette.error.main, 0.9), '& $icon': { color: theme.palette.error.main } }, outlinedSuccess: { color: getColor(theme.palette.success.main, 0.6), border: "1px solid ".concat(theme.palette.success.main), '& $icon': { color: theme.palette.success.main } }, outlinedInfo: { color: getColor(theme.palette.info.main, 0.6), border: "1px solid ".concat(theme.palette.info.main), '& $icon': { color: theme.palette.info.main } }, outlinedWarning: { color: getColor(theme.palette.warning.main, 0.6), border: "1px solid ".concat(theme.palette.warning.main), '& $icon': { color: theme.palette.warning.main } }, outlinedError: { color: getColor(theme.palette.error.main, 0.6), border: "1px solid ".concat(theme.palette.error.main), '& $icon': { color: theme.palette.error.main } }, filledSuccess: { color: '#fff', fontWeight: theme.typography.fontWeightMedium, backgroundColor: theme.palette.success.main }, filledInfo: { color: '#fff', fontWeight: theme.typography.fontWeightMedium, backgroundColor: theme.palette.info.main }, filledWarning: { color: '#fff', fontWeight: theme.typography.fontWeightMedium, backgroundColor: theme.palette.warning.main }, filledError: { color: '#fff', fontWeight: theme.typography.fontWeightMedium, backgroundColor: theme.palette.error.main }, icon: { marginRight: 12, padding: '7px 0', display: 'flex', fontSize: 22, opacity: 0.9 }, message: { padding: '8px 0' }, action: { display: 'flex', alignItems: 'center', marginLeft: 'auto', paddingLeft: 16, marginRight: -8 } }; };
|
|
8620
|
+
var styles$1 = function styles(theme) { var getColor = theme.palette.type === 'light' ? darken : lighten; var getBackgroundColor = theme.palette.type === 'light' ? lighten : darken; return { root: _extends({}, theme.typography.body2, { borderRadius: theme.shape.borderRadius, backgroundColor: 'transparent', display: 'flex', padding: '6px 16px' }), standardSuccess: { color: getColor(theme.palette.success.main, 0.6), backgroundColor: getBackgroundColor(theme.palette.success.main, 0.9), '& $icon': { color: theme.palette.success.main } }, standardInfo: { color: getColor(theme.palette.info.main, 0.6), backgroundColor: getBackgroundColor(theme.palette.info.main, 0.9), '& $icon': { color: theme.palette.info.main } }, standardWarning: { color: getColor(theme.palette.warning.main, 0.6), backgroundColor: getBackgroundColor(theme.palette.warning.main, 0.9), '& $icon': { color: theme.palette.warning.main } }, standardError: { color: getColor(theme.palette.error.main, 0.6), backgroundColor: getBackgroundColor(theme.palette.error.main, 0.9), '& $icon': { color: theme.palette.error.main } }, outlinedSuccess: { color: getColor(theme.palette.success.main, 0.6), border: "1px solid ".concat(theme.palette.success.main), '& $icon': { color: theme.palette.success.main } }, outlinedInfo: { color: getColor(theme.palette.info.main, 0.6), border: "1px solid ".concat(theme.palette.info.main), '& $icon': { color: theme.palette.info.main } }, outlinedWarning: { color: getColor(theme.palette.warning.main, 0.6), border: "1px solid ".concat(theme.palette.warning.main), '& $icon': { color: theme.palette.warning.main } }, outlinedError: { color: getColor(theme.palette.error.main, 0.6), border: "1px solid ".concat(theme.palette.error.main), '& $icon': { color: theme.palette.error.main } }, filledSuccess: { color: '#fff', fontWeight: theme.typography.fontWeightMedium, backgroundColor: theme.palette.success.main }, filledInfo: { color: '#fff', fontWeight: theme.typography.fontWeightMedium, backgroundColor: theme.palette.info.main }, filledWarning: { color: '#fff', fontWeight: theme.typography.fontWeightMedium, backgroundColor: theme.palette.warning.main }, filledError: { color: '#fff', fontWeight: theme.typography.fontWeightMedium, backgroundColor: theme.palette.error.main }, icon: { marginRight: 12, padding: '7px 0', display: 'flex', fontSize: 22, opacity: 0.9 }, message: { padding: '8px 0' }, action: { display: 'flex', alignItems: 'center', marginLeft: 'auto', paddingLeft: 16, marginRight: -8 } }; };
|
|
8467
8621
|
var defaultIconMapping = { success: /*#__PURE__*/ y$3(SuccessOutlinedIcon, { fontSize: "inherit" }), warning: /*#__PURE__*/ y$3(ReportProblemOutlinedIcon, { fontSize: "inherit" }), error: /*#__PURE__*/ y$3(ErrorOutlineIcon, { fontSize: "inherit" }), info: /*#__PURE__*/ y$3(InfoOutlinedIcon, { fontSize: "inherit" }) };
|
|
8468
|
-
var _ref = /*#__PURE__*/ y$3(CloseIcon, { fontSize: "small" });
|
|
8469
|
-
var Alert$1 = /*#__PURE__*/ N$1(function Alert(props, ref) { var action = props.action, children = props.children, classes = props.classes, className = props.className, _props$closeText = props.closeText, closeText = _props$closeText === void 0 ? 'Close' : _props$closeText, color = props.color, icon = props.icon, _props$iconMapping = props.iconMapping, iconMapping = _props$iconMapping === void 0 ? defaultIconMapping : _props$iconMapping, onClose = props.onClose, _props$role = props.role, role = _props$role === void 0 ? 'alert' : _props$role, _props$severity = props.severity, severity = _props$severity === void 0 ? 'success' : _props$severity, _props$variant = props.variant, variant = _props$variant === void 0 ? 'standard' : _props$variant, other = _objectWithoutProperties(props, ["action", "children", "classes", "className", "closeText", "color", "icon", "iconMapping", "onClose", "role", "severity", "variant"]); return /*#__PURE__*/ y$3(Paper$1, _extends({ role: role, square: true, elevation: 0, className: clsx(classes.root, classes["".concat(variant).concat(capitalize(color || severity))], className), ref: ref }, other), icon !== false ? /*#__PURE__*/ y$3("div", { className: classes.icon }, icon || iconMapping[severity] || defaultIconMapping[severity]) : null, /*#__PURE__*/ y$3("div", { className: classes.message }, children), action != null ? /*#__PURE__*/ y$3("div", { className: classes.action }, action) : null, action == null && onClose ? /*#__PURE__*/ y$3("div", { className: classes.action }, /*#__PURE__*/ y$3(IconButton$1, { size: "small", "aria-label": closeText, title: closeText, color: "inherit", onClick: onClose }, _ref)) : null); });
|
|
8470
|
-
var MUIAlert = withStyles(styles, { name: 'MuiAlert' })(Alert$1);
|
|
8622
|
+
var _ref$1 = /*#__PURE__*/ y$3(CloseIcon, { fontSize: "small" });
|
|
8623
|
+
var Alert$1 = /*#__PURE__*/ N$1(function Alert(props, ref) { var action = props.action, children = props.children, classes = props.classes, className = props.className, _props$closeText = props.closeText, closeText = _props$closeText === void 0 ? 'Close' : _props$closeText, color = props.color, icon = props.icon, _props$iconMapping = props.iconMapping, iconMapping = _props$iconMapping === void 0 ? defaultIconMapping : _props$iconMapping, onClose = props.onClose, _props$role = props.role, role = _props$role === void 0 ? 'alert' : _props$role, _props$severity = props.severity, severity = _props$severity === void 0 ? 'success' : _props$severity, _props$variant = props.variant, variant = _props$variant === void 0 ? 'standard' : _props$variant, other = _objectWithoutProperties(props, ["action", "children", "classes", "className", "closeText", "color", "icon", "iconMapping", "onClose", "role", "severity", "variant"]); return /*#__PURE__*/ y$3(Paper$1, _extends({ role: role, square: true, elevation: 0, className: clsx(classes.root, classes["".concat(variant).concat(capitalize(color || severity))], className), ref: ref }, other), icon !== false ? /*#__PURE__*/ y$3("div", { className: classes.icon }, icon || iconMapping[severity] || defaultIconMapping[severity]) : null, /*#__PURE__*/ y$3("div", { className: classes.message }, children), action != null ? /*#__PURE__*/ y$3("div", { className: classes.action }, action) : null, action == null && onClose ? /*#__PURE__*/ y$3("div", { className: classes.action }, /*#__PURE__*/ y$3(IconButton$1, { size: "small", "aria-label": closeText, title: closeText, color: "inherit", onClick: onClose }, _ref$1)) : null); });
|
|
8624
|
+
var MUIAlert = withStyles(styles$1, { name: 'MuiAlert' })(Alert$1);
|
|
8471
8625
|
var classnames = { exports: {} }; /*!
|
|
8472
8626
|
Copyright (c) 2018 Jed Watson.
|
|
8473
8627
|
Licensed under the MIT License (MIT), see
|
|
@@ -8517,24 +8671,24 @@ var getToastIcon = function getToastIcon(type) { switch (type) {
|
|
|
8517
8671
|
case 'error': return default_1$a;
|
|
8518
8672
|
default: return default_1$c;
|
|
8519
8673
|
} };
|
|
8520
|
-
var Toast = function Toast(
|
|
8674
|
+
var Toast = function Toast(_ref7) { var children = _ref7.children, _ref7$type = _ref7.type, type = _ref7$type === void 0 ? 'success' : _ref7$type, onClose = _ref7.onClose, classes = _ref7.classes, Typography = _ref7.TypographyComponent; var Icon = getToastIcon(type); return /*#__PURE__*/ wn.createElement(MUIAlert, { action: /*#__PURE__*/ wn.createElement(IconButton$1, { className: classes.closeButton, disableRipple: true, onClick: onClose }, /*#__PURE__*/ wn.createElement(default_1$b, { className: C(classes.closeIcon, _defineProperty2(_defineProperty2({}, classes.errorIcon, type === 'error'), classes.successIcon, type === 'success')) })), className: C(classes.toast, _defineProperty2(_defineProperty2({}, classes.error, type === 'error'), classes.success, type === 'success')), elevation: 6, icon: /*#__PURE__*/ wn.createElement(Icon, { className: C(_defineProperty2(_defineProperty2({}, classes.errorIcon, type === 'error'), classes.successIcon, type === 'success')), fontSize: "small" }), variant: "filled" }, /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, children)); };
|
|
8521
8675
|
var DEFAULT_STATE$1 = { openToast: noop, closeToast: noop };
|
|
8522
8676
|
var ToastContext = /*#__PURE__*/ F$4(DEFAULT_STATE$1);
|
|
8523
8677
|
var useToast = function useToast() { return q$5(ToastContext); };
|
|
8524
|
-
var ToastContextProviderCore = function ToastContextProviderCore(
|
|
8678
|
+
var ToastContextProviderCore = function ToastContextProviderCore(_ref8) { var children = _ref8.children, classes = _ref8.classes, TypographyComponent = _ref8.TypographyComponent; var _h = h$4(false), _h2 = _slicedToArray2(_h, 2), open = _h2[0], setOpen = _h2[1]; var _h3 = h$4(''), _h4 = _slicedToArray2(_h3, 2), toastText = _h4[0], setToastText = _h4[1]; var _h5 = h$4('success'), _h6 = _slicedToArray2(_h5, 2), toastType = _h6[0], setToastType = _h6[1]; var timeoutRef = _$1(null); var closeToast = function closeToast() { return setOpen(false); }; var triggerOpen = T$2(function (openDurationMS) { setOpen(true); if (timeoutRef.current) {
|
|
8525
8679
|
clearTimeout(timeoutRef.current);
|
|
8526
|
-
} timeoutRef.current = setTimeout(function () { setOpen(false); }, openDurationMS); }, []); var openToast = T$2(function (
|
|
8680
|
+
} timeoutRef.current = setTimeout(function () { setOpen(false); }, openDurationMS); }, []); var openToast = T$2(function (_ref9) { var type = _ref9.type, text = _ref9.text, _ref9$openDurationMS = _ref9.openDurationMS, openDurationMS = _ref9$openDurationMS === void 0 ? 5000 : _ref9$openDurationMS; setToastType(type); setToastText(text); triggerOpen(openDurationMS); }, [triggerOpen]); return /*#__PURE__*/ wn.createElement(ToastContext.Provider, { value: { openToast: openToast, closeToast: closeToast } }, /*#__PURE__*/ wn.createElement(Snackbar$1, { anchorOrigin: { horizontal: 'center', vertical: 'bottom' }, className: classes.snackbar, open: open }, /*#__PURE__*/ wn.createElement(Toast, { TypographyComponent: TypographyComponent, classes: classes, onClose: closeToast, type: toastType }, toastText)), children); };
|
|
8527
8681
|
var makeTypographyStyles = makeStylesFactory(function (theme) { return { typography: { '& ul': { margin: theme.spacing(1, 0, 0) } }, disabled: {} }; });
|
|
8528
8682
|
var colorToMUIColor = { primary: 'primary', secondary: 'textSecondary', error: 'error' };
|
|
8529
|
-
var TypographyCore = function TypographyCore(
|
|
8530
|
-
var useStyles$
|
|
8531
|
-
var Typography = function Typography(props) { var classes = useStyles$
|
|
8532
|
-
var useStyles$
|
|
8533
|
-
var ToastContextProvider = function ToastContextProvider(props) { var classes = useStyles$
|
|
8683
|
+
var TypographyCore = function TypographyCore(_ref10) { var align = _ref10.align, children = _ref10.children, color = _ref10.color, component = _ref10.component, disabled = _ref10.disabled, _ref10$variant = _ref10.variant, variant = _ref10$variant === void 0 ? 'body1' : _ref10$variant, classes = _ref10.classes; return /*#__PURE__*/ wn.createElement(Typography$2, { align: align, className: C(classes.typography, _defineProperty2({}, classes.disabled, disabled)), color: color ? colorToMUIColor[color] : disabled ? 'textSecondary' : undefined, component: component, variant: variant }, children); };
|
|
8684
|
+
var useStyles$o = makeTypographyStyles();
|
|
8685
|
+
var Typography = function Typography(props) { var classes = useStyles$o(); return /*#__PURE__*/ wn.createElement(TypographyCore, Object.assign({}, props, { classes: classes })); };
|
|
8686
|
+
var useStyles$n = makeToastStyles(function (theme) { return { toast: { backgroundColor: theme.styleConfig.container.backgroundColor, boxShadow: '0px 5px 10px 0px rgba(0, 0, 0, 0.20)', border: '1px solid', borderColor: theme.styleConfig.container.borderColor, borderRadius: theme.styleConfig.borderRadius }, error: { '& p': { color: theme.styleConfig.colors.error }, backgroundColor: theme.styleConfig.container.backgroundColor, color: theme.styleConfig.colors.error }, errorIcon: { color: theme.styleConfig.colors.error }, success: { '& p': { color: theme.styleConfig.colors.success }, backgroundColor: theme.styleConfig.container.backgroundColor, color: theme.styleConfig.colors.success }, successIcon: { color: theme.styleConfig.colors.success } }; });
|
|
8687
|
+
var ToastContextProvider = function ToastContextProvider(props) { var classes = useStyles$n(); return /*#__PURE__*/ wn.createElement(ToastContextProviderCore, Object.assign({ TypographyComponent: Typography, classes: classes }, props)); };
|
|
8534
8688
|
var DEFAULT_ADMIN_PORTAL_STYLE_CONFIG = { container: { backgroundColor: '#FFFFFF', borderColor: '#FFFFFF', width: '100%' }, colors: { primary: '#000000', secondary: '#5C727D', success: '#005D26', error: '#BB0003', accent: '#ECFAFF', accentText: '#000000', subtle: '#EFEFEF' }, buttons: { primary: { backgroundColor: '#000000', textColor: '#FFFFFF', borderColor: '#000000' }, secondary: { backgroundColor: '#FFFFFF', textColor: '#000000', borderColor: '#000000' }, disabled: { backgroundColor: '#EFEFEF', textColor: '#B4B4B4', borderColor: '#EFEFEF' } }, inputs: { backgroundColor: '#FFFFFF', borderColor: '#D9D9D9', placeholderColor: '#5C727D', textColor: '#000000' }, borderRadius: '4px', fontFamily: 'Arial, Helvetica, sans-serif' };
|
|
8535
|
-
var getTheme = function getTheme(styles) { var _a, _b, _c, _d, _e, _f; var styleConfig = merge({}, DEFAULT_ADMIN_PORTAL_STYLE_CONFIG, styles); var resolvedConfig = Object.assign(Object.assign({}, styleConfig), { buttons: { primary: Object.assign(Object.assign({}, styleConfig.buttons.primary), { borderRadius: (_a = styleConfig.buttons.primary.borderRadius) !== null && _a !== void 0 ? _a : styleConfig.borderRadius }), secondary: Object.assign(Object.assign({}, styleConfig.buttons.secondary), { borderRadius: (_b = styleConfig.buttons.secondary.borderRadius) !== null && _b !== void 0 ? _b : styleConfig.borderRadius }), disabled: Object.assign(Object.assign({}, styleConfig.buttons.disabled), { borderRadius: (_d = (_c = styleConfig.buttons.disabled) === null || _c === void 0 ? void 0 : _c.borderRadius) !== null && _d !== void 0 ? _d : styleConfig.borderRadius }) }, container: Object.assign(Object.assign({}, styleConfig.container), { borderRadius: (_e = styleConfig.container.borderRadius) !== null && _e !== void 0 ? _e : styleConfig.borderRadius }), inputs: Object.assign(Object.assign({}, styleConfig.inputs), { borderRadius: (_f = styleConfig.inputs.borderRadius) !== null && _f !== void 0 ? _f : styleConfig.borderRadius }) }); var theme = createTheme({ typography: { allVariants: { color: resolvedConfig.colors.primary }, button: { textTransform: 'none' }, fontFamily: styleConfig.fontFamily, h1: { fontSize: 30, fontWeight: 600, lineHeight: '125%' }, h2: { fontSize: 24, fontWeight: 600, lineHeight: '125%' }, h3: { fontSize: 20, fontWeight: 600, lineHeight: '125%' }, h4: { fontSize: 18, fontWeight: 600, lineHeight: '125%' }, body1: { fontSize: 18, fontWeight: 400, lineHeight: '150%' }, body2: { fontSize: 14, fontWeight: 400, lineHeight: '150%' } }, overrides: { MuiIconButton: { root: { color: resolvedConfig.colors.primary } }, MuiPaper: { root: { backgroundColor: resolvedConfig.container.backgroundColor, border: '1px solid', borderColor: resolvedConfig.colors.subtle, borderRadius: resolvedConfig.container.borderRadius } }, MuiTypography: { colorTextSecondary: { color: resolvedConfig.colors.secondary }, colorError: { color: resolvedConfig.colors.error } } }, styleConfig: resolvedConfig }); return theme; };
|
|
8536
|
-
var ContextProvider = function ContextProvider(
|
|
8537
|
-
var AdminPortalWrapper = function AdminPortalWrapper(
|
|
8689
|
+
var getTheme = function getTheme(styles) { var _a, _b, _c, _d, _e, _f; var styleConfig = merge({}, DEFAULT_ADMIN_PORTAL_STYLE_CONFIG, styles); var resolvedConfig = Object.assign(Object.assign({}, styleConfig), { buttons: { primary: Object.assign(Object.assign({}, styleConfig.buttons.primary), { borderRadius: (_a = styleConfig.buttons.primary.borderRadius) !== null && _a !== void 0 ? _a : styleConfig.borderRadius }), secondary: Object.assign(Object.assign({}, styleConfig.buttons.secondary), { borderRadius: (_b = styleConfig.buttons.secondary.borderRadius) !== null && _b !== void 0 ? _b : styleConfig.borderRadius }), disabled: Object.assign(Object.assign({}, styleConfig.buttons.disabled), { borderRadius: (_d = (_c = styleConfig.buttons.disabled) === null || _c === void 0 ? void 0 : _c.borderRadius) !== null && _d !== void 0 ? _d : styleConfig.borderRadius }) }, container: Object.assign(Object.assign({}, styleConfig.container), { borderRadius: (_e = styleConfig.container.borderRadius) !== null && _e !== void 0 ? _e : styleConfig.borderRadius }), inputs: Object.assign(Object.assign({}, styleConfig.inputs), { borderRadius: (_f = styleConfig.inputs.borderRadius) !== null && _f !== void 0 ? _f : styleConfig.borderRadius }) }); var theme = createTheme({ typography: { allVariants: { color: resolvedConfig.colors.primary }, button: { textTransform: 'none' }, fontFamily: styleConfig.fontFamily, h1: { fontSize: 30, fontWeight: 600, lineHeight: '125%' }, h2: { fontSize: 24, fontWeight: 600, lineHeight: '125%' }, h3: { fontSize: 20, fontWeight: 600, lineHeight: '125%' }, h4: { fontSize: 18, fontWeight: 600, lineHeight: '125%' }, body1: { fontSize: 18, fontWeight: 400, lineHeight: '150%' }, body2: { fontSize: 14, fontWeight: 400, lineHeight: '150%' } }, overrides: { MuiRadio: { root: { color: resolvedConfig.colors.primary }, colorPrimary: { '&$checked': { color: resolvedConfig.colors.primary }, '&.Mui-disabled': { color: resolvedConfig.colors.secondary } } }, MuiIconButton: { root: { color: resolvedConfig.colors.primary } }, MuiPaper: { root: { backgroundColor: resolvedConfig.container.backgroundColor, border: '1px solid', borderColor: resolvedConfig.colors.subtle, borderRadius: resolvedConfig.container.borderRadius } }, MuiTypography: { colorTextSecondary: { color: resolvedConfig.colors.secondary }, colorError: { color: resolvedConfig.colors.error } } }, styleConfig: resolvedConfig }); return theme; };
|
|
8690
|
+
var ContextProvider = function ContextProvider(_ref11) { var theme = _ref11.theme, options = _ref11.options, children = _ref11.children; var clientAndConfig = F$3(function () { return { client: options.client, config: options.config }; }, [options]); return /*#__PURE__*/ wn.createElement(ThemeProvider, { theme: theme }, /*#__PURE__*/ wn.createElement(StytchClientContext.Provider, { value: clientAndConfig }, children)); };
|
|
8691
|
+
var AdminPortalWrapper = function AdminPortalWrapper(_ref12) { var children = _ref12.children, options = _ref12.options; var theme = getTheme(options.styles); return /*#__PURE__*/ wn.createElement(ContextProvider, { options: options, theme: theme }, /*#__PURE__*/ wn.createElement(MainContainer, null, /*#__PURE__*/ wn.createElement(ToastContextProvider, null, children))); };
|
|
8538
8692
|
var ReportProblemOutlined = {};
|
|
8539
8693
|
var _interopRequireDefault$9 = interopRequireDefaultExports;
|
|
8540
8694
|
var _interopRequireWildcard$9 = interopRequireWildcardExports;
|
|
@@ -8544,10 +8698,10 @@ var React$9 = _interopRequireWildcard$9(require$$2);
|
|
|
8544
8698
|
var _createSvgIcon$9 = _interopRequireDefault$9(requireCreateSvgIcon());
|
|
8545
8699
|
var _default$9 = (0, _createSvgIcon$9["default"])(/*#__PURE__*/ React$9.createElement("path", { d: "M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z" }), 'ReportProblemOutlined');
|
|
8546
8700
|
default_1$9 = ReportProblemOutlined["default"] = _default$9;
|
|
8547
|
-
var useStyles$
|
|
8548
|
-
var Alert = function Alert(
|
|
8701
|
+
var useStyles$m = makeStyles(function (theme) { return { alert: { color: theme.styleConfig.colors.primary, padding: theme.spacing(3), backgroundColor: theme.styleConfig.colors.accent, display: 'flex', gap: theme.spacing(1) } }; });
|
|
8702
|
+
var Alert = function Alert(_ref13) { var children = _ref13.children; var classes = useStyles$m(); return /*#__PURE__*/ wn.createElement("div", { className: classes.alert }, /*#__PURE__*/ wn.createElement(default_1$9, null), /*#__PURE__*/ wn.createElement(Typography, null, children)); };
|
|
8549
8703
|
var PageLoadingIndicator = function PageLoadingIndicator() { return /*#__PURE__*/ wn.createElement("div", { style: { height: '100%', minHeight: 400, display: 'flex', alignItems: 'center', justifyContent: 'center' } }, /*#__PURE__*/ wn.createElement(CircularProgress$1, { color: "inherit" })); };
|
|
8550
|
-
var useStytchClient = function useStytchClient() { var client = wn.useContext(StytchClientContext); if (!client) {
|
|
8704
|
+
var useStytchClient = function useStytchClient() { var client = wn.useContext(StytchClientContext).client; if (!client) {
|
|
8551
8705
|
throw new Error('A Stytch client could not be found');
|
|
8552
8706
|
} return client; };
|
|
8553
8707
|
var useB2BInternals = function useB2BInternals() { var client = useStytchClient(); return readB2BInternals(client); };
|
|
@@ -8567,14 +8721,14 @@ var makeButtonStyles = makeStylesFactory(function (theme) { return { button: _de
|
|
|
8567
8721
|
var variantToMUIVariant = { ghost: 'outlined', primary: 'contained', secondary: 'contained', text: 'text' };
|
|
8568
8722
|
var ButtonCore = function ButtonCore(_a) { var children = _a.children, className = _a.className, compact = _a.compact, component = _a.component, variant = _a.variant, warning = _a.warning, classes = _a.classes, props = __rest(_a, ["children", "className", "compact", "component", "variant", "warning", "classes"]); var variantStyles = { ghost: classes.ghost, primary: classes.primary, secondary: classes.secondary, text: classes.text }; var buttonWarningStyles = { ghost: classes.warningGhost, primary: classes.warningPrimary, secondary: classes.warningPrimary, text: classes.warningText }; var buttonVariant = variant !== null && variant !== void 0 ? variant : 'primary'; var buttonStyles = warning ? buttonWarningStyles[buttonVariant] : variantStyles[buttonVariant]; return /*#__PURE__*/ wn.createElement(MUIButton, Object.assign({}, props, { className: C(classes.button, buttonStyles, _defineProperty2({}, classes.compact, compact), _defineProperty2({}, classes.iconOnly, !children), className), component: component !== null && component !== void 0 ? component : 'button', disableRipple: true, variant: variantToMUIVariant[buttonVariant] }), children); };
|
|
8569
8723
|
var mixed = function mixed(color) { return "color-mix(in srgb, ".concat(color, " 80%, #333)"); };
|
|
8570
|
-
var useStyles$
|
|
8571
|
-
var Button = function Button(_a) { var props = __rest(_a, []); var classes = useStyles$
|
|
8724
|
+
var useStyles$l = makeButtonStyles(function (theme) { var disabledStyle = { backgroundColor: theme.styleConfig.buttons.disabled.backgroundColor, borderColor: theme.styleConfig.buttons.disabled.borderColor, borderRadius: theme.styleConfig.buttons.disabled.borderRadius, color: theme.styleConfig.buttons.disabled.textColor }; return { button: { borderRadius: theme.styleConfig.borderRadius, fontWeight: 700 }, ghost: { '&:disabled': disabledStyle, '&:hover': { backgroundColor: mixed(theme.styleConfig.buttons.secondary.backgroundColor) }, backgroundColor: theme.styleConfig.buttons.secondary.backgroundColor, color: theme.styleConfig.buttons.secondary.textColor }, primary: { '&:disabled': disabledStyle, '&:hover': { backgroundColor: mixed(theme.styleConfig.buttons.primary.backgroundColor) }, backgroundColor: theme.styleConfig.buttons.primary.backgroundColor, color: theme.styleConfig.buttons.primary.textColor, borderRadius: theme.styleConfig.buttons.primary.borderRadius }, secondary: { '&:disabled': disabledStyle, '&:hover': { backgroundColor: mixed(theme.styleConfig.buttons.secondary.backgroundColor) }, backgroundColor: theme.styleConfig.buttons.secondary.backgroundColor, color: theme.styleConfig.buttons.secondary.textColor, borderRadius: theme.styleConfig.buttons.secondary.borderRadius }, text: { '&:disabled': disabledStyle, '&:hover': { backgroundColor: 'rgba(0, 0, 0, 0.1)' }, backgroundColor: 'transparent', color: theme.styleConfig.colors.primary }, warningGhost: { '&:disabled': disabledStyle, '&:hover': { backgroundColor: mixed(theme.styleConfig.buttons.secondary.backgroundColor), borderColor: theme.styleConfig.colors.error, color: theme.styleConfig.colors.error }, backgroundColor: theme.styleConfig.buttons.secondary.backgroundColor, borderColor: theme.styleConfig.colors.error, color: theme.styleConfig.colors.error }, warningPrimary: { '&:disabled': disabledStyle, '&:hover': { backgroundColor: mixed(theme.styleConfig.colors.error), color: theme.styleConfig.buttons.primary.textColor }, backgroundColor: theme.styleConfig.colors.error, color: theme.styleConfig.buttons.primary.textColor }, warningText: { '&:disabled': disabledStyle, '&:hover': { backgroundColor: 'rgba(0, 0, 0, 0.1)', color: theme.styleConfig.colors.error }, backgroundColor: 'transparent', color: theme.styleConfig.colors.error } }; });
|
|
8725
|
+
var Button = function Button(_a) { var props = __rest(_a, []); var classes = useStyles$l(); return /*#__PURE__*/ wn.createElement(ButtonCore, Object.assign({}, props, { classes: classes })); };
|
|
8572
8726
|
var getShortId = function getShortId(prefix) { return "".concat(prefix !== null && prefix !== void 0 ? prefix : '').concat(Math.random().toString(36).slice(-6)); };
|
|
8573
8727
|
var useShortId = function useShortId(prefix) { return F$3(function () { return getShortId(prefix); }, [prefix]); };
|
|
8574
8728
|
var DEFAULT_GAP = 1;
|
|
8575
8729
|
var DEFAULT_GRID_COLUMN_WIDTH = 360;
|
|
8576
8730
|
var DEFAULT_MAX_ITEM_WIDTH = 720 + DEFAULT_GAP;
|
|
8577
|
-
var FlexBox = function FlexBox(
|
|
8731
|
+
var FlexBox = function FlexBox(_ref14) { var children = _ref14.children, gap = _ref14.gap, alignItems = _ref14.alignItems, flexDirection = _ref14.flexDirection, justifyContent = _ref14.justifyContent, flexWrap = _ref14.flexWrap; var theme = useTheme(); return /*#__PURE__*/ wn.createElement("div", { style: { display: 'flex', gap: theme.spacing(gap !== null && gap !== void 0 ? gap : DEFAULT_GAP), alignItems: alignItems, justifyContent: justifyContent, flexDirection: flexDirection, flexWrap: flexWrap } }, children); };
|
|
8578
8732
|
var useToggleState = function useToggleState(initialState) { var _h7 = h$4(false), _h8 = _slicedToArray2(_h7, 2), isOpen = _h8[0], setIsOpen = _h8[1]; var toggle = function toggle() { return setIsOpen(function (prev) { return !prev; }); }; var open = function open() { return setIsOpen(true); }; var close = function close() { return setIsOpen(false); }; return { close: close, isOpen: isOpen, open: open, toggle: toggle }; };
|
|
8579
8733
|
var promiseNoop = function promiseNoop() { return Promise.resolve(); };
|
|
8580
8734
|
var useModalState = function useModalState() { var confirmAction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : promiseNoop; var _useToggleState = useToggleState(), isOpen = _useToggleState.isOpen, open = _useToggleState.open, close = _useToggleState.close; var _useToast = useToast(), openToast = _useToast.openToast; var confirm = function confirm() { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee() { return _regeneratorRuntime().wrap(function _callee$(_context) { while (1)
|
|
@@ -8597,8 +8751,8 @@ var useModalState = function useModalState() { var confirmAction = arguments.len
|
|
|
8597
8751
|
} }, _callee, null, [[0, 5]]); })); }; return { isOpen: isOpen, open: open, close: close, confirm: confirm }; };
|
|
8598
8752
|
var useAsyncState = h$4;
|
|
8599
8753
|
var MODAL_WIDTH = 800;
|
|
8600
|
-
var useStyles$
|
|
8601
|
-
var Modal = function Modal(
|
|
8754
|
+
var useStyles$k = makeStyles(function (theme) { return { closeButton: { position: 'absolute', right: theme.spacing(1), top: theme.spacing(1) }, contentText: { whiteSpace: 'pre-line' }, dialog: { '& .MuiDialogTitle-root': { padding: theme.spacing(4, 4, 0, 4) }, '& .MuiDialogContent-root': { padding: theme.spacing(2, 4) }, '& .MuiDialogActions-root': { justifyContent: 'flex-start', padding: theme.spacing(2, 4, 4, 4) }, '& .MuiDialogActions-spacing > :not(:first-child)': { marginLeft: theme.spacing(2) }, '& .MuiDialog-paper': _defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2({}, theme.breakpoints.down('xs'), { width: '100%', margin: 0, borderRadius: 0 }), "backgroundColor", theme.styleConfig.container.backgroundColor), "borderRadius", theme.styleConfig.container.borderRadius), "width", MODAL_WIDTH), "maxWidth", MODAL_WIDTH), "margin", theme.spacing(6)) }, content: { display: 'flex', flexDirection: 'column', gap: theme.spacing(1.5) } }; });
|
|
8755
|
+
var Modal = function Modal(_ref15) { var cancelButtonText = _ref15.cancelButtonText, children = _ref15.children, description = _ref15.description, confirmButtonText = _ref15.confirmButtonText, disableConfirm = _ref15.disableConfirm, warning = _ref15.warning, close = _ref15.close, confirm = _ref15.confirm, title = _ref15.title, showLoadingOnConfirm = _ref15.showLoadingOnConfirm, noCancelButton = _ref15.noCancelButton, isOpen = _ref15.isOpen, keepOpenOnConfirm = _ref15.keepOpenOnConfirm; var classes = useStyles$k(); var _useAsyncState = useAsyncState(false), _useAsyncState2 = _slicedToArray2(_useAsyncState, 2), confirming = _useAsyncState2[0], setConfirming = _useAsyncState2[1]; var isXsScreen = useMediaQuery(function (theme) { return theme.breakpoints.down('xs'); }); var descriptionId = useShortId('confirmation-modal-description'); var titleId = useShortId('confirmation-modal-title'); var handleConfirm = function handleConfirm(e) { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee2() { return _regeneratorRuntime().wrap(function _callee2$(_context2) { while (1)
|
|
8602
8756
|
switch (_context2.prev = _context2.next) {
|
|
8603
8757
|
case 0:
|
|
8604
8758
|
e.preventDefault();
|
|
@@ -8617,7 +8771,7 @@ var Modal = function Modal(_ref14) { var cancelButtonText = _ref14.cancelButtonT
|
|
|
8617
8771
|
case 10:
|
|
8618
8772
|
case "end": return _context2.stop();
|
|
8619
8773
|
} }, _callee2, null, [[2, , 6, 10]]); })); }; var onClose = function onClose() { close(); }; var confirmDisabled = confirming || disableConfirm; return /*#__PURE__*/ wn.createElement(Dialog$1, { "aria-describedby": descriptionId, "aria-labelledby": titleId, className: classes.dialog, fullScreen: isXsScreen, onClose: onClose, open: isOpen }, isXsScreen && ( /*#__PURE__*/wn.createElement(IconButton$1, { className: classes.closeButton, disableRipple: true, onClick: onClose }, /*#__PURE__*/ wn.createElement(default_1$b, { fontSize: "small" }))), /*#__PURE__*/ wn.createElement(DialogTitle$1, { id: titleId }, /*#__PURE__*/ wn.createElement(Typography, { variant: "h2" }, title)), /*#__PURE__*/ wn.createElement("form", { onSubmit: handleConfirm }, /*#__PURE__*/ wn.createElement(DialogContent$1, { className: classes.content }, description && /*#__PURE__*/ wn.createElement(Typography, null, description), children && /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column" }, children)), /*#__PURE__*/ wn.createElement(DialogActions$1, null, !noCancelButton && ( /*#__PURE__*/wn.createElement(Button, { autoFocus: warning, disabled: confirming, onClick: onClose, variant: "ghost" }, cancelButtonText !== null && cancelButtonText !== void 0 ? cancelButtonText : "Cancel")), /*#__PURE__*/ wn.createElement(Button, { autoFocus: !warning, disabled: confirmDisabled, type: "submit", variant: "primary", warning: warning }, confirming && showLoadingOnConfirm ? /*#__PURE__*/ wn.createElement(CircularProgress$1, { size: 18 }) : confirmButtonText !== null && confirmButtonText !== void 0 ? confirmButtonText : 'Ok')))); };
|
|
8620
|
-
var useMutateWithToast = function useMutateWithToast(callback) { var _useToast2 = useToast(), openToast = _useToast2.openToast; var mutate = T$2(function (properties) { var
|
|
8774
|
+
var useMutateWithToast = function useMutateWithToast(callback) { var _useToast2 = useToast(), openToast = _useToast2.openToast; var mutate = T$2(function (properties) { var _ref16 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, errorMessage = _ref16.errorMessage; return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee3() { return _regeneratorRuntime().wrap(function _callee3$(_context3) { while (1)
|
|
8621
8775
|
switch (_context3.prev = _context3.next) {
|
|
8622
8776
|
case 0:
|
|
8623
8777
|
_context3.prev = 0;
|
|
@@ -8635,14 +8789,14 @@ var useMutateWithToast = function useMutateWithToast(callback) { var _useToast2
|
|
|
8635
8789
|
case "end": return _context3.stop();
|
|
8636
8790
|
} }, _callee3, null, [[0, 6]]); })); }, [callback, openToast]); return { mutate: mutate }; };
|
|
8637
8791
|
var ssoGetConnectionsKey = function ssoGetConnectionsKey(orgId) { return ['sso.getConnections', orgId]; };
|
|
8638
|
-
var useSsoConnections = function useSsoConnections() { var _a; var client = useStytchClient(); var orgId = (_a = client.organization.getSync()) === null || _a === void 0 ? void 0 : _a.organization_id; return useSWR(ssoGetConnectionsKey(orgId), function () { return client.sso.getConnections(); }); };
|
|
8792
|
+
var useSsoConnections = function useSsoConnections(canGetSso) { var _a; var client = useStytchClient(); var orgId = (_a = client.organization.getSync()) === null || _a === void 0 ? void 0 : _a.organization_id; return useSWR(canGetSso ? ssoGetConnectionsKey(orgId) : null, function () { return client.sso.getConnections(); }); };
|
|
8639
8793
|
var useRevalidateConnectionList = function useRevalidateConnectionList() { var _useSWRConfig = useSWRConfig(), mutate = _useSWRConfig.mutate; var client = useStytchClient(); return T$2(function () { var _a; var orgId = (_a = client.organization.getSync()) === null || _a === void 0 ? void 0 : _a.organization_id; if (orgId) {
|
|
8640
8794
|
return mutate(ssoGetConnectionsKey(orgId));
|
|
8641
8795
|
} }, [client.organization, mutate]); };
|
|
8642
8796
|
var mutateSamlConnection = function mutateSamlConnection(client) { return function (options) { return client.sso.saml.updateConnection(options); }; };
|
|
8643
8797
|
var mutateOidcConnection = function mutateOidcConnection(client) { return function (options) { return client.sso.oidc.updateConnection(options); }; };
|
|
8644
8798
|
var updateConnectionByURL = function updateConnectionByURL(client) { return function (options) { return client.sso.saml.updateConnectionByURL(options); }; };
|
|
8645
|
-
var deleteConnection = function deleteConnection(client) { return function (
|
|
8799
|
+
var deleteConnection = function deleteConnection(client) { return function (_ref17) { var connection_id = _ref17.connection_id; return client.sso.deleteConnection(connection_id); }; };
|
|
8646
8800
|
var deleteVerificationCertificate = function deleteVerificationCertificate(client) { return function (options) { return client.sso.saml.deleteVerificationCertificate(options); }; };
|
|
8647
8801
|
var useMutateFnSsoConnection = function useMutateFnSsoConnection(mutateFn) { var _useSWRConfig2 = useSWRConfig(), mutateSWR = _useSWRConfig2.mutate; var client = useStytchClient(); var revalidateConnectionList = useRevalidateConnectionList(); return useMutateWithToast(T$2(function (options) { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee4() { return _regeneratorRuntime().wrap(function _callee4$(_context4) { while (1)
|
|
8648
8802
|
switch (_context4.prev = _context4.next) {
|
|
@@ -8659,8 +8813,8 @@ var useDeleteSsoConnectionCert = function useDeleteSsoConnectionCert() { return
|
|
|
8659
8813
|
var useMutateSsoConnection = function useMutateSsoConnection(connectionType) { return useMutateFnSsoConnection(connectionType === 'saml' ? mutateSamlConnection : mutateOidcConnection); };
|
|
8660
8814
|
var useMutateSamlConnection = function useMutateSamlConnection() { return useMutateSsoConnection('saml'); };
|
|
8661
8815
|
var DeleteConfirmModal = function DeleteConfirmModal(_a) { var connectionName = _a.connectionName, modalProps = __rest(_a, ["connectionName"]); return /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, modalProps, { title: "Delete ".concat(connectionName || 'connection', "?"), confirmButtonText: "Delete", warning: true }), /*#__PURE__*/ wn.createElement(Typography, null, "Once deleted, the connection cannot be restored. Any members assigned implicit roles via this connection, as well as members allowed to JIT provision via this SSO connection, will lose access immediately.")); };
|
|
8662
|
-
var useMutateDeleteConnection = function useMutateDeleteConnection() { var _useDeleteSsoConnecti = useDeleteSsoConnection(), mutate = _useDeleteSsoConnecti.mutate; var deleteConnection = function deleteConnection(
|
|
8663
|
-
var useDeleteConnection = function useDeleteConnection() { var
|
|
8816
|
+
var useMutateDeleteConnection = function useMutateDeleteConnection() { var _useDeleteSsoConnecti = useDeleteSsoConnection(), mutate = _useDeleteSsoConnecti.mutate; var deleteConnection = function deleteConnection(_ref18) { var connectionId = _ref18.connectionId; return mutate({ connection_id: connectionId }); }; return { deleteConnection: deleteConnection }; };
|
|
8817
|
+
var useDeleteConnection = function useDeleteConnection() { var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, onConfirm = _ref19.onConfirm; var _h9 = h$4(), _h10 = _slicedToArray2(_h9, 2), connection = _h10[0], setConnection = _h10[1]; var _useMutateDeleteConne = useMutateDeleteConnection(), deleteConnection = _useMutateDeleteConne.deleteConnection; var handleConfirm = function handleConfirm() { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee5() { return _regeneratorRuntime().wrap(function _callee5$(_context5) { while (1)
|
|
8664
8818
|
switch (_context5.prev = _context5.next) {
|
|
8665
8819
|
case 0:
|
|
8666
8820
|
if (!connection) {
|
|
@@ -8682,24 +8836,24 @@ var useDeleteConnection = function useDeleteConnection() { var _ref18 = argument
|
|
|
8682
8836
|
case "end": return _context5.stop();
|
|
8683
8837
|
} }, _callee5, null, [[1, 6]]); })); }; var _useModalState = useModalState(handleConfirm), close = _useModalState.close, confirm = _useModalState.confirm, isOpen = _useModalState.isOpen, open = _useModalState.open; var handleRequestDelete = T$2(function (connection) { setConnection(connection); open(); }, [open]); return { handleRequestDelete: handleRequestDelete, modalProps: { connectionName: connection === null || connection === void 0 ? void 0 : connection.displayName, isOpen: isOpen, close: close, confirm: confirm } }; };
|
|
8684
8838
|
var makeTagStyles = makeStylesFactory(function (theme) { return { tag: { fontFamily: 'IBM Plex Mono, monospace', fontSize: 18, fontWeight: 400, lineHeight: '150%', padding: theme.spacing(0, 1), borderRadius: 4, width: 'fit-content' } }; });
|
|
8685
|
-
var TagCore = function TagCore(
|
|
8686
|
-
var useStyles$
|
|
8687
|
-
var Tag = function Tag(props) { var classes = useStyles$
|
|
8839
|
+
var TagCore = function TagCore(_ref20) { var children = _ref20.children, classes = _ref20.classes; return /*#__PURE__*/ wn.createElement("span", { className: classes.tag }, children); };
|
|
8840
|
+
var useStyles$j = makeTagStyles(function (theme) { return { tag: { fontFamily: theme.styleConfig.fontFamily, fontSize: function fontSize(_ref21) { var size = _ref21.size; return size === 'sm' ? 14 : 18; }, backgroundColor: theme.styleConfig.colors.accent, color: theme.styleConfig.colors.accentText } }; });
|
|
8841
|
+
var Tag = function Tag(props) { var classes = useStyles$j(props); return /*#__PURE__*/ wn.createElement(TagCore, Object.assign({}, props, { classes: classes })); };
|
|
8688
8842
|
var organizationGetKey = function organizationGetKey(orgId) { return ['organization.get', orgId]; };
|
|
8689
8843
|
var useOrgInfo = function useOrgInfo() { var _a; var client = useStytchClient(); var orgId = (_a = client.organization.getSync()) === null || _a === void 0 ? void 0 : _a.organization_id; return useSWR(organizationGetKey(orgId), function () { return client.organization.get(); }); };
|
|
8690
8844
|
var deepEqual = createDeepEqual();
|
|
8691
8845
|
var CODE_HORIZONTAL_PADDING = 1;
|
|
8692
8846
|
var commonCodeStyles$1 = { code: { borderRadius: 4, width: 'fit-content' } };
|
|
8693
8847
|
var makeCodeStyles = makeStylesFactory(commonCodeStyles$1, function (theme) { return { code: { fontFamily: 'IBM Plex Mono, monospace', fontSize: 16, fontWeight: 400, lineHeight: '150%', padding: theme.spacing(0.5, CODE_HORIZONTAL_PADDING), wordBreak: 'break-word' } }; });
|
|
8694
|
-
var CodeCore = function CodeCore(
|
|
8848
|
+
var CodeCore = function CodeCore(_ref22) { var children = _ref22.children, classes = _ref22.classes; return /*#__PURE__*/ wn.createElement("span", { className: C(classes.code) }, children); };
|
|
8695
8849
|
var commonCodeStyles = function commonCodeStyles(theme) { return { code: { color: theme.styleConfig.colors.accentText, backgroundColor: theme.styleConfig.colors.accent } }; };
|
|
8696
|
-
var useStyles$
|
|
8697
|
-
var Code = function Code(props) { var classes = useStyles$
|
|
8698
|
-
var useStyles$
|
|
8699
|
-
var LabelCore = function LabelCore(
|
|
8850
|
+
var useStyles$i = makeCodeStyles(commonCodeStyles);
|
|
8851
|
+
var Code = function Code(props) { var classes = useStyles$i(); return /*#__PURE__*/ wn.createElement(CodeCore, Object.assign({}, props, { classes: classes })); };
|
|
8852
|
+
var useStyles$h = makeStyles(function () { return { labelContainer: { display: 'flex', alignItems: 'center' } }; });
|
|
8853
|
+
var LabelCore = function LabelCore(_ref23) { var children = _ref23.children, disabled = _ref23.disabled, htmlFor = _ref23.htmlFor, required = _ref23.required, _ref23$variant = _ref23.variant, variant = _ref23$variant === void 0 ? 'body2' : _ref23$variant, Typography = _ref23.TypographyComponent; var classes = useStyles$h(); return /*#__PURE__*/ wn.createElement("span", { className: classes.labelContainer }, /*#__PURE__*/ wn.createElement("label", { "aria-required": required, htmlFor: htmlFor }, /*#__PURE__*/ wn.createElement(Typography, { disabled: disabled, variant: variant }, children)), required && ( /*#__PURE__*/wn.createElement(Typography, { color: "error", disabled: disabled, variant: "body2" }, "*"))); };
|
|
8700
8854
|
var Label = function Label(props) { return /*#__PURE__*/ wn.createElement(LabelCore, Object.assign({}, props, { TypographyComponent: Typography })); };
|
|
8701
8855
|
var makeCopyableTextStyles = makeStylesFactory(commonCodeStyles$1, function (theme) { return { copyableText: { '&:hover': { marginRight: 0 }, '& svg': { marginRight: theme.spacing(CODE_HORIZONTAL_PADDING) }, borderRadius: 4, display: 'flex', alignItems: 'center', height: 'fit-content', width: 'fit-content', marginRight: theme.spacing(3.5) }, copyIcon: { '& svg': { marginRight: theme.spacing(CODE_HORIZONTAL_PADDING) } }, hasCopiedIcon: { marginRight: 0 }, noWrap: { '& span': { wordBreak: 'unset', whiteSpace: 'nowrap' } } }; });
|
|
8702
|
-
var CopyableTextCore = function CopyableTextCore(
|
|
8856
|
+
var CopyableTextCore = function CopyableTextCore(_ref24) { var children = _ref24.children, textToCopy = _ref24.textToCopy, noWrap = _ref24.noWrap, id = _ref24.id, label = _ref24.label, classes = _ref24.classes, Code = _ref24.CodeComponent, Label = _ref24.LabelComponent, Typography = _ref24.TypographyComponent, useClickToCopy = _ref24.useClickToCopy; var _a; var inputId = useShortId(id); if (children && typeof children !== 'string') {
|
|
8703
8857
|
throw new Error('CopyableText children must be a string');
|
|
8704
8858
|
} var _useClickToCopy = useClickToCopy({ text: (_a = textToCopy !== null && textToCopy !== void 0 ? textToCopy : children) !== null && _a !== void 0 ? _a : '' }), copied = _useClickToCopy.copied, copyToClipboard = _useClickToCopy.copyToClipboard, CopyIcon = _useClickToCopy.CopyIcon, containerHoverClass = _useClickToCopy.containerHoverClass; return /*#__PURE__*/ wn.createElement("div", { className: C(_defineProperty2({}, classes.noWrap, noWrap)) }, label && /*#__PURE__*/ wn.createElement(Label, { htmlFor: inputId }, label), !children && /*#__PURE__*/ wn.createElement(Typography, null, "\u2013"), children && ( /*#__PURE__*/wn.createElement("span", { className: C(containerHoverClass, classes.copyableText, classes.code, _defineProperty2({}, classes.hasCopiedIcon, copied)), onClick: copyToClipboard }, /*#__PURE__*/ wn.createElement(Code, null, children), /*#__PURE__*/ wn.createElement("div", { className: classes.copyIcon }, CopyIcon)))); };
|
|
8705
8859
|
var CheckCircleOutlined = {};
|
|
@@ -8721,26 +8875,26 @@ var _createSvgIcon$7 = _interopRequireDefault$7(requireCreateSvgIcon());
|
|
|
8721
8875
|
var _default$7 = (0, _createSvgIcon$7["default"])(/*#__PURE__*/ React$7.createElement("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z" }), 'FileCopyOutlined');
|
|
8722
8876
|
default_1$7 = FileCopyOutlined["default"] = _default$7;
|
|
8723
8877
|
var makeClickToCopyStyles = makeStylesFactory({ checkCircle: { display: 'block !important' }, darkBackground: {}, containerHover: { '&:hover': { '& svg': { display: 'block' }, cursor: 'pointer' }, '& svg': { display: 'none' } } });
|
|
8724
|
-
var useClickToCopyCore = function useClickToCopyCore(
|
|
8725
|
-
var useStyles$
|
|
8726
|
-
var useClickToCopy = function useClickToCopy(params) { var classes = useStyles$
|
|
8727
|
-
var useStyles$
|
|
8728
|
-
var CopyableText = function CopyableText(props) { var classes = useStyles$
|
|
8878
|
+
var useClickToCopyCore = function useClickToCopyCore(_ref25) { var classes = _ref25.classes, darkBackground = _ref25.darkBackground, _ref25$iconSize = _ref25.iconSize, iconSize = _ref25$iconSize === void 0 ? 'small' : _ref25$iconSize, text = _ref25.text; var _h11 = h$4(false), _h12 = _slicedToArray2(_h11, 2), copied = _h12[0], setCopied = _h12[1]; var copyToClipboard = function copyToClipboard(e) { e.stopPropagation(); setCopied(true); navigator.clipboard.writeText(text); setTimeout(function () { return setCopied(false); }, 1000); }; var CopyIcon = copied ? ( /*#__PURE__*/wn.createElement(default_1$8, { className: C(classes.checkCircle, _defineProperty2({}, classes.darkBackground, darkBackground)), fontSize: iconSize })) : ( /*#__PURE__*/wn.createElement(default_1$7, { fontSize: iconSize })); return { copied: copied, copyToClipboard: copyToClipboard, CopyIcon: CopyIcon, containerHoverClass: classes.containerHover }; };
|
|
8879
|
+
var useStyles$g = makeClickToCopyStyles();
|
|
8880
|
+
var useClickToCopy = function useClickToCopy(params) { var classes = useStyles$g(); return useClickToCopyCore(Object.assign(Object.assign({}, params), { classes: classes })); };
|
|
8881
|
+
var useStyles$f = makeCopyableTextStyles(commonCodeStyles, { copyableText: { whiteSpace: function whiteSpace(_ref26) { var _whiteSpace = _ref26.whiteSpace; return _whiteSpace; } } });
|
|
8882
|
+
var CopyableText = function CopyableText(props) { var classes = useStyles$f(props); return /*#__PURE__*/ wn.createElement(CopyableTextCore, Object.assign({}, props, { CodeComponent: Code, LabelComponent: Label, TypographyComponent: Typography, classes: classes, useClickToCopy: useClickToCopy })); };
|
|
8729
8883
|
var makeInputStyles = makeStylesFactory(function (theme) { return { inputContainer: _defineProperty2(_defineProperty2(_defineProperty2({}, theme.breakpoints.down('sm'), { width: '100%', minWidth: 'unset', flex: 1 }), "width", DEFAULT_GRID_COLUMN_WIDTH), "minWidth", DEFAULT_GRID_COLUMN_WIDTH), multilineContainer: { width: '100%', maxWidth: DEFAULT_MAX_ITEM_WIDTH }, readOnlyContainer: { display: '-webkit-box', '-webkit-line-clamp': 2, '-webkit-box-orient': 'vertical', overflow: 'hidden', overflowWrap: 'break-word' }, input: { '& .MuiOutlinedInput-notchedOutline': { border: '1px solid', borderRadius: 4 }, '&.MuiOutlinedInput-multiline': { padding: 0 }, '& [class*="MuiOutlinedInput-input"]': { '&::placeholder': { opacity: 1 }, padding: theme.spacing(1) }, '&:hover .MuiOutlinedInput-notchedOutline, &.Mui-focused .MuiOutlinedInput-notchedOutline': { borderWidth: 1 } }, fullWidth: { width: '100%' }, fileUploadContainer: { alignItems: 'center', display: 'flex', marginBottom: theme.spacing(0.5), gap: theme.spacing(0.5) }, fileUploadHidden: { display: 'none' } }; });
|
|
8730
8884
|
var FILE_UPLOAD_ID = 'file-upload';
|
|
8731
|
-
var FileUpload = function FileUpload(
|
|
8885
|
+
var FileUpload = function FileUpload(_ref27) { var onChange = _ref27.onChange, readOnly = _ref27.readOnly, filename = _ref27.filename, setFilename = _ref27.setFilename, classes = _ref27.classes, Button = _ref27.ButtonComponent, Typography = _ref27.TypographyComponent; var _h13 = h$4(new FileReader()), _h14 = _slicedToArray2(_h13, 1), fileReader = _h14[0]; var fileInputKey = Math.floor(Math.random() * 10000); p$3(function () { var onLoad = function onLoad() { if (typeof fileReader.result === 'string') {
|
|
8732
8886
|
onChange === null || onChange === void 0 ? void 0 : onChange(fileReader.result);
|
|
8733
8887
|
} }; fileReader.addEventListener('load', onLoad); return function () { return fileReader.removeEventListener('load', onLoad); }; }, [fileReader, onChange]); p$3(function () { setFilename(null); }, [readOnly, setFilename]); var onFileUpload = function onFileUpload(event) { var file = event.target.files ? event.target.files[0] : null; var filename = (file === null || file === void 0 ? void 0 : file.name) ? file.name.replace('C:\\fakepath\\', '') : null; setFilename(filename); if (file) {
|
|
8734
8888
|
fileReader.readAsText(file);
|
|
8735
8889
|
} }; var resetFileUpload = function resetFileUpload() { var inputElement = document.querySelector('input[type=file]'); if (inputElement) {
|
|
8736
8890
|
inputElement.value = '';
|
|
8737
8891
|
} }; var uploadedFilename = filename !== null && filename !== void 0 ? filename : 'No file chosen'; var fileInputId = "".concat(FILE_UPLOAD_ID, "-").concat(fileInputKey); return /*#__PURE__*/ wn.createElement("label", { className: classes.fileUploadContainer, htmlFor: fileInputId }, /*#__PURE__*/ wn.createElement("input", { className: classes.fileUploadHidden, id: fileInputId, onChange: onFileUpload, onClick: resetFileUpload, type: "file" }), /*#__PURE__*/ wn.createElement(Button, { compact: true, component: "span", variant: "secondary" }, "Choose file"), /*#__PURE__*/ wn.createElement(Typography, null, uploadedFilename)); };
|
|
8738
|
-
var InputCore = function InputCore(
|
|
8892
|
+
var InputCore = function InputCore(_ref28) { var caption = _ref28.caption, copyable = _ref28.copyable, disabled = _ref28.disabled, error = _ref28.error, fileUpload = _ref28.fileUpload, fullWidth = _ref28.fullWidth, id = _ref28.id, inputProps = _ref28.inputProps, inputRef = _ref28.inputRef, label = _ref28.label, multiline = _ref28.multiline, onBlur = _ref28.onBlur, onChange = _ref28.onChange, onFocus = _ref28.onFocus, onKeyDown = _ref28.onKeyDown, placeholder = _ref28.placeholder, readOnly = _ref28.readOnly, readOnlyConcealed = _ref28.readOnlyConcealed, required = _ref28.required, type = _ref28.type, value = _ref28.value, classes = _ref28.classes, ButtonComponent = _ref28.ButtonComponent, CopyableText = _ref28.CopyableTextComponent, Label = _ref28.LabelComponent, Typography = _ref28.TypographyComponent; var inputId = useShortId(id); var _h15 = h$4(null), _h16 = _slicedToArray2(_h15, 2), filename = _h16[0], setFilename = _h16[1]; var handleOnChange = function handleOnChange(e) { onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value); if (fileUpload && filename) {
|
|
8739
8893
|
setFilename(null);
|
|
8740
8894
|
} }; var showCaption = !!caption && !error; var concealedValue = (value === null || value === void 0 ? void 0 : value.length) ? '•'.repeat(Math.min(25, value.length)) : ''; var visibleValue = readOnlyConcealed ? concealedValue : value; var shouldDisable = disabled && !readOnly; var showCopyableText = readOnly && copyable && !!visibleValue; var showPlainText = readOnly && (!copyable || !visibleValue); return /*#__PURE__*/ wn.createElement("div", { className: C(classes.inputContainer, _defineProperty2(_defineProperty2(_defineProperty2({}, classes.multilineContainer, multiline), classes.readOnlyContainer, readOnly), classes.fullWidth, fullWidth)) }, label && ( /*#__PURE__*/wn.createElement(Label, { disabled: shouldDisable, htmlFor: inputId, required: required }, label)), showPlainText && /*#__PURE__*/ wn.createElement(Typography, null, visibleValue || '–'), showCopyableText && /*#__PURE__*/ wn.createElement(CopyableText, { textToCopy: value }, visibleValue), !readOnly && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, fileUpload && ( /*#__PURE__*/wn.createElement(FileUpload, { ButtonComponent: ButtonComponent, TypographyComponent: Typography, classes: classes, filename: filename, onChange: onChange, readOnly: shouldDisable, setFilename: setFilename })), /*#__PURE__*/ wn.createElement(OutlinedInput$1, { className: classes.input, disabled: shouldDisable, error: !!error, fullWidth: true, id: inputId, inputProps: inputProps, inputRef: inputRef, multiline: multiline, onBlur: onBlur, onChange: handleOnChange, onFocus: onFocus, onKeyDown: onKeyDown, placeholder: placeholder, required: required, rows: 3, type: type, value: value }), showCaption && ( /*#__PURE__*/wn.createElement(Typography, { disabled: shouldDisable, variant: "body2" }, caption)), error && ( /*#__PURE__*/wn.createElement(Typography, { color: "error", variant: "body2" }, error))))); };
|
|
8741
|
-
var useStyles$
|
|
8895
|
+
var useStyles$e = makeInputStyles(function (theme) { return { input: { color: theme.styleConfig.inputs.textColor, '& .MuiOutlinedInput-notchedOutline': { borderColor: theme.styleConfig.inputs.borderColor }, '& [class*="MuiOutlinedInput-input"]': { '&::placeholder': { color: theme.styleConfig.inputs.placeholderColor } }, '&.Mui-disabled .MuiOutlinedInput-notchedOutline': { borderColor: theme.styleConfig.inputs.borderColor }, '&:hover .MuiOutlinedInput-notchedOutline, &.Mui-focused .MuiOutlinedInput-notchedOutline': { borderColor: theme.styleConfig.inputs.borderColor }, '&.Mui-error': { color: theme.styleConfig.colors.error } } }; });
|
|
8742
8896
|
var LabelBody1 = function LabelBody1(props) { return /*#__PURE__*/ wn.createElement(Label, Object.assign({ variant: "body1" }, props)); };
|
|
8743
|
-
var Input = function Input(_a) { var labelVariant = _a.labelVariant, props = __rest(_a, ["labelVariant"]); var classes = useStyles$
|
|
8897
|
+
var Input$1 = function Input$1(_a) { var labelVariant = _a.labelVariant, props = __rest(_a, ["labelVariant"]); var classes = useStyles$e(props); return /*#__PURE__*/ wn.createElement(InputCore, Object.assign({}, props, { classes: classes, ButtonComponent: Button, CopyableTextComponent: CopyableText, LabelComponent: labelVariant === 'body1' ? LabelBody1 : Label, TypographyComponent: Typography })); };
|
|
8744
8898
|
var AddRounded = {};
|
|
8745
8899
|
var _interopRequireDefault$6 = interopRequireDefaultExports;
|
|
8746
8900
|
var _interopRequireWildcard$6 = interopRequireWildcardExports;
|
|
@@ -8750,11 +8904,11 @@ var React$6 = _interopRequireWildcard$6(require$$2);
|
|
|
8750
8904
|
var _createSvgIcon$6 = _interopRequireDefault$6(requireCreateSvgIcon());
|
|
8751
8905
|
var _default$6 = (0, _createSvgIcon$6["default"])(/*#__PURE__*/ React$6.createElement("path", { d: "M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z" }), 'AddRounded');
|
|
8752
8906
|
default_1$6 = AddRounded["default"] = _default$6;
|
|
8753
|
-
var ContentSpacingCore = function ContentSpacingCore(
|
|
8907
|
+
var ContentSpacingCore = function ContentSpacingCore(_ref29) { var children = _ref29.children, gap = _ref29.gap; var theme = useTheme(); return /*#__PURE__*/ wn.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: theme.spacing(gap !== null && gap !== void 0 ? gap : DEFAULT_GAP) } }, children); };
|
|
8754
8908
|
var ADD_NEW_BUTTON_TEXT = 'Add new';
|
|
8755
|
-
var ListEditorCore = function ListEditorCore(_a) { var title = _a.title, description = _a.description, limit = _a.limit, addModalProps = _a.addModalProps, hideAddButton = _a.hideAddButton, onAdd = _a.onAdd, Button = _a.ButtonComponent, EmbeddedTable = _a.EmbeddedTableComponent, Modal = _a.ModalComponent, Typography = _a.TypographyComponent, embeddedTableProps = __rest(_a, ["title", "description", "limit", "addModalProps", "hideAddButton", "onAdd", "ButtonComponent", "EmbeddedTableComponent", "ModalComponent", "TypographyComponent"]); if (!addModalProps && !onAdd) {
|
|
8909
|
+
var ListEditorCore = function ListEditorCore(_a) { var title = _a.title, description = _a.description, limit = _a.limit, addModalProps = _a.addModalProps, hideAddButton = _a.hideAddButton, onAdd = _a.onAdd, addButtonText = _a.addButtonText, Button = _a.ButtonComponent, EmbeddedTable = _a.EmbeddedTableComponent, Modal = _a.ModalComponent, Typography = _a.TypographyComponent, embeddedTableProps = __rest(_a, ["title", "description", "limit", "addModalProps", "hideAddButton", "onAdd", "addButtonText", "ButtonComponent", "EmbeddedTableComponent", "ModalComponent", "TypographyComponent"]); if (!addModalProps && !onAdd) {
|
|
8756
8910
|
throw new Error('Either addModalProps or onAdd prop must be provided');
|
|
8757
|
-
} var modalState = useModalState(addModalProps === null || addModalProps === void 0 ? void 0 : addModalProps.confirm); var items = embeddedTableProps.items, readOnly = embeddedTableProps.readOnly; var onClose = function onClose() { var _a; (_a = addModalProps === null || addModalProps === void 0 ? void 0 : addModalProps.close) === null || _a === void 0 ? void 0 : _a.call(addModalProps); modalState.close(); }; var addNew = addModalProps ? modalState.open : onAdd; return /*#__PURE__*/ wn.createElement(ContentSpacingCore, null, addModalProps && ( /*#__PURE__*/wn.createElement(Modal, Object.assign({}, addModalProps, modalState, { close: onClose }), addModalProps.content)), /*#__PURE__*/ wn.createElement("div", null, title && /*#__PURE__*/ wn.createElement(Typography, { variant: "h4" }, title), description && /*#__PURE__*/ wn.createElement(Typography, null, description)), items && items.length > 0 && ( /*#__PURE__*/wn.createElement(EmbeddedTable, Object.assign({}, embeddedTableProps, { bottomAction: !hideAddButton && (!limit || items.length < limit) && ( /*#__PURE__*/wn.createElement(Button, { compact: true, onClick: addNew, startIcon: /*#__PURE__*/ wn.createElement(default_1$6, null), variant: "text" },
|
|
8911
|
+
} addButtonText = addButtonText || ADD_NEW_BUTTON_TEXT; var modalState = useModalState(addModalProps === null || addModalProps === void 0 ? void 0 : addModalProps.confirm); var items = embeddedTableProps.items, readOnly = embeddedTableProps.readOnly; var onClose = function onClose() { var _a; (_a = addModalProps === null || addModalProps === void 0 ? void 0 : addModalProps.close) === null || _a === void 0 ? void 0 : _a.call(addModalProps); modalState.close(); }; var addNew = addModalProps ? modalState.open : onAdd; return /*#__PURE__*/ wn.createElement(ContentSpacingCore, null, addModalProps && ( /*#__PURE__*/wn.createElement(Modal, Object.assign({}, addModalProps, modalState, { close: onClose }), addModalProps.content)), /*#__PURE__*/ wn.createElement("div", null, title && /*#__PURE__*/ wn.createElement(Typography, { variant: "h4" }, title), description && /*#__PURE__*/ wn.createElement(Typography, null, description)), items && items.length > 0 && ( /*#__PURE__*/wn.createElement(EmbeddedTable, Object.assign({}, embeddedTableProps, { bottomAction: !hideAddButton && (!limit || items.length < limit) && ( /*#__PURE__*/wn.createElement(Button, { compact: true, onClick: addNew, startIcon: /*#__PURE__*/ wn.createElement(default_1$6, null), variant: "text" }, addButtonText)) }))), !hideAddButton && !readOnly && !items.length && ( /*#__PURE__*/wn.createElement(Button, { compact: true, onClick: addNew, startIcon: /*#__PURE__*/ wn.createElement(default_1$6, null), variant: "ghost" }, addButtonText))); };
|
|
8758
8912
|
var validateRowKey = function validateRowKey(items, rowKeyExtractor) { var _a; if (items.length > 0 && typeof items[0] !== 'string' && (!((_a = items[0]) === null || _a === void 0 ? void 0 : _a.id) || typeof items[0].id !== 'string') && !rowKeyExtractor) {
|
|
8759
8913
|
throw new Error('rowKeyExtractor is required if items are not strings or do not have an id property');
|
|
8760
8914
|
} };
|
|
@@ -8765,13 +8919,13 @@ var getTableCellValue = function getTableCellValue(children) { var value = child
|
|
|
8765
8919
|
} return value; };
|
|
8766
8920
|
var useTableActionStyles = makeStyles(function (theme) { return { tableActions: { display: 'flex', gap: theme.spacing(1), margin: theme.spacing(0, -1.25) } }; });
|
|
8767
8921
|
var TABLE_ACTIONS_HEADER = 'Actions';
|
|
8768
|
-
var TableActionsCore = function TableActionsCore(
|
|
8922
|
+
var TableActionsCore = function TableActionsCore(_ref30) { var warningAction = _ref30.warningAction, action = _ref30.action, customAction = _ref30.customAction, Button = _ref30.ButtonComponent; var classes = useTableActionStyles(); return /*#__PURE__*/ wn.createElement("div", { className: classes.tableActions }, action && ( /*#__PURE__*/wn.createElement(Button, { compact: true, onClick: action.onClick, variant: "text" }, action.text)), warningAction && ( /*#__PURE__*/wn.createElement(Button, { compact: true, onClick: warningAction.onClick, variant: "text", warning: true }, warningAction.text)), customAction); };
|
|
8769
8923
|
var makeEmbeddedTableStyles = makeStylesFactory(function (theme) { return { embeddedTableWithActions: { width: 'calc(100% - 2px)' }, tableCell: { padding: theme.spacing(0.5, 1), minWidth: 80 }, tableActionsCell: { position: 'sticky', right: 0, width: '1%' }, tableHeader: {}, bottomAction: { borderBottom: 'none' } }; });
|
|
8770
|
-
var EmbeddedTableCore = function EmbeddedTableCore(
|
|
8924
|
+
var EmbeddedTableCore = function EmbeddedTableCore(_ref31) { var itemRenderer = _ref31.itemRenderer, items = _ref31.items, rowKeyExtractor = _ref31.rowKeyExtractor, getItemActionProps = _ref31.getItemActionProps, readOnly = _ref31.readOnly, bottomAction = _ref31.bottomAction, initialItemState = _ref31.initialItemState, classes = _ref31.classes, TableActions = _ref31.TableActionsComponent, Typography = _ref31.TypographyComponent; var tableActionClasses = useTableActionStyles(); validateRowKey(items, rowKeyExtractor); var getId = T$2(function (item) { return rowKeyExtractor ? rowKeyExtractor(item) : typeof item === 'string' ? item : item.id; }, [rowKeyExtractor]); var itemState = initialItemState !== null && initialItemState !== void 0 ? initialItemState : {}; var _h17 = h$4(items.reduce(function (acc, item) { return Object.assign(Object.assign({}, acc), _defineProperty2({}, getId(item), itemState)); }, {})), _h18 = _slicedToArray2(_h17, 2), itemsState = _h18[0], setItemsState = _h18[1]; var setItemState = function setItemState(item, state) { var id = getId(item); setItemsState(function (prevState) { return Object.assign(Object.assign({}, prevState), _defineProperty2({}, id, state)); }); }; p$3(function () { setItemsState(items.reduce(function (acc, item) { var _a; return Object.assign(Object.assign({}, acc), _defineProperty2({}, getId(item), (_a = itemsState[getId(item)]) !== null && _a !== void 0 ? _a : itemState)); }, {})); }, [items, getId]); return /*#__PURE__*/ wn.createElement(TableContainer$1, null, /*#__PURE__*/ wn.createElement(MUITable, { className: C(_defineProperty2({}, classes.embeddedTableWithActions, getItemActionProps)) }, /*#__PURE__*/ wn.createElement(TableHead$1, null, /*#__PURE__*/ wn.createElement(MUITableRow, null, itemRenderer.map(function (column) { return /*#__PURE__*/ wn.createElement(MUITableCell, { className: C(classes.tableCell, classes.tableHeader), key: "col-header-".concat(column.title) }, /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, column.title)); }), !readOnly && getItemActionProps && ( /*#__PURE__*/wn.createElement(MUITableCell, { className: C(classes.tableCell, classes.tableActionsCell, classes.tableHeader) }, /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, TABLE_ACTIONS_HEADER))))), /*#__PURE__*/ wn.createElement(TableBody$1, null, items.map(function (item) { var id = getId(item); return /*#__PURE__*/ wn.createElement(MUITableRow, { key: id }, itemRenderer.map(function (column, i) { var children = column.getValue(item, itemsState[id]); var value = getTableCellValue(children); return /*#__PURE__*/ wn.createElement(MUITableCell, { className: classes.tableCell, key: "col-".concat(column.title, "-").concat(i) }, typeof value === 'string' ? /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, value) : value); }), !readOnly && getItemActionProps && ( /*#__PURE__*/wn.createElement(MUITableCell, { className: C(classes.tableCell, classes.tableActionsCell) }, /*#__PURE__*/ wn.createElement(TableActions, Object.assign({}, getItemActionProps(item, function (state) { return state && setItemState(item, state); }, itemsState[id])))))); }), !readOnly && bottomAction && ( /*#__PURE__*/wn.createElement(MUITableRow, null, /*#__PURE__*/ wn.createElement(MUITableCell, { className: C(classes.tableCell, classes.bottomAction), colSpan: getItemActionProps ? itemRenderer.length : itemRenderer.length - 1 }), /*#__PURE__*/ wn.createElement(MUITableCell, { className: C(classes.tableCell, classes.tableActionsCell, classes.bottomAction) }, /*#__PURE__*/ wn.createElement("div", { className: tableActionClasses.tableActions }, bottomAction))))))); };
|
|
8771
8925
|
makeStyles(function (theme) { return { tableActions: { display: 'flex', gap: theme.spacing(1), margin: theme.spacing(0, -1.25) } }; });
|
|
8772
8926
|
var TableActions = function TableActions(props) { return /*#__PURE__*/ wn.createElement(TableActionsCore, Object.assign({}, props, { ButtonComponent: Button })); };
|
|
8773
|
-
var useStyles$
|
|
8774
|
-
var EmbeddedTable = function EmbeddedTable(props) { var classes = useStyles$
|
|
8927
|
+
var useStyles$d = makeEmbeddedTableStyles(function (theme) { return { tableHeader: { borderBottomColor: theme.styleConfig.colors.subtle } }; });
|
|
8928
|
+
var EmbeddedTable = function EmbeddedTable(props) { var classes = useStyles$d(); return /*#__PURE__*/ wn.createElement(EmbeddedTableCore, Object.assign({}, props, { TableActionsComponent: TableActions, TypographyComponent: Typography, classes: classes })); };
|
|
8775
8929
|
var ListEditor = function ListEditor(props) { return /*#__PURE__*/ wn.createElement(ListEditorCore, Object.assign({}, props, { ButtonComponent: Button, EmbeddedTableComponent: EmbeddedTable, ModalComponent: Modal, TypographyComponent: Typography })); };
|
|
8776
8930
|
var CheckRounded = {};
|
|
8777
8931
|
var _interopRequireDefault$5 = interopRequireDefaultExports;
|
|
@@ -8811,7 +8965,7 @@ var _default$2 = (0, _createSvgIcon$2["default"])(/*#__PURE__*/ React$2.createEl
|
|
|
8811
8965
|
default_1$2 = RemoveRounded["default"] = _default$2;
|
|
8812
8966
|
var MULTISELECT_VALUE = 'all_values';
|
|
8813
8967
|
var makeSelectStyles = makeStylesFactory(function (theme) { return { checkIcon: {}, menuPaper: { marginTop: theme.spacing(0.5), maxHeight: 280, maxWidth: DEFAULT_GRID_COLUMN_WIDTH }, readOnlyContainer: { display: '-webkit-box', '-webkit-line-clamp': 2, '-webkit-box-orient': 'vertical', overflow: 'hidden' }, select: { '& .MuiInputBase-root': { padding: 0 }, '& .MuiInputBase-input': { padding: theme.spacing(1, 3, 1, 1) }, '& .MuiSelect-icon': { fontSize: 20, marginRight: theme.spacing(0.5), marginTop: theme.spacing(0.25) }, '& .MuiSelect-select': { '&:focus': { backgroundColor: 'transparent' } }, '&:hover': {}, border: '1px solid', borderRadius: 4 }, selectContainer: _defineProperty2(_defineProperty2(_defineProperty2({}, theme.breakpoints.down('sm'), { width: '100%', minWidth: 'unset', flex: 1 }), "width", DEFAULT_GRID_COLUMN_WIDTH), "minWidth", DEFAULT_GRID_COLUMN_WIDTH), selectContainerOpen: {}, disabled: {}, fullWidth: { width: '100%' } }; });
|
|
8814
|
-
var SelectCore = function SelectCore(
|
|
8968
|
+
var SelectCore = function SelectCore(_ref32) { var caption = _ref32.caption, disabled = _ref32.disabled, fullWidth = _ref32.fullWidth, id = _ref32.id, label = _ref32.label, menuAnchorHorizontal = _ref32.menuAnchorHorizontal, selectItems = _ref32.selectItems, multiple = _ref32.multiple, onChange = _ref32.onChange, placeholder = _ref32.placeholder, readOnly = _ref32.readOnly, required = _ref32.required, value = _ref32.value, classes = _ref32.classes, Label = _ref32.LabelComponent, MenuItem = _ref32.MenuItemComponent, Typography = _ref32.TypographyComponent; var _a; var selectId = useShortId(id); var _h19 = h$4(false), _h20 = _slicedToArray2(_h19, 2), isOpen = _h20[0], setIsOpen = _h20[1]; var totalOptions = selectItems.filter(function (item) { return !item.disabled; }).length; var isMultiSelect = multiple && Array.isArray(value); var hasMoreThanOneChild = totalOptions > 1; var MultiSelectIcon; var canSelectAll; if (isMultiSelect && hasMoreThanOneChild) {
|
|
8815
8969
|
if (value.length > 0) {
|
|
8816
8970
|
MultiSelectIcon = default_1$2;
|
|
8817
8971
|
canSelectAll = false;
|
|
@@ -8837,16 +8991,16 @@ var SelectCore = function SelectCore(_ref31) { var caption = _ref31.caption, dis
|
|
|
8837
8991
|
else if (Array.isArray(val) && val.length === totalOptions && hasMoreThanOneChild) {
|
|
8838
8992
|
return 'All';
|
|
8839
8993
|
} return renderText; }; var shouldDisable = disabled && !readOnly; return /*#__PURE__*/ wn.createElement("div", { className: C(classes.selectContainer, _defineProperty2(_defineProperty2(_defineProperty2({}, classes.selectContainerOpen, isOpen), classes.readOnlyContainer, readOnly), classes.fullWidth, fullWidth)) }, label && ( /*#__PURE__*/wn.createElement(Label, { disabled: shouldDisable, htmlFor: selectId, required: required }, label)), readOnly && /*#__PURE__*/ wn.createElement(Typography, null, (_a = getRenderValue(value)) !== null && _a !== void 0 ? _a : 'None selected'), !readOnly && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(MuiSelect, { IconComponent: default_1$3, MenuProps: { anchorOrigin: { horizontal: menuAnchorHorizontal !== null && menuAnchorHorizontal !== void 0 ? menuAnchorHorizontal : 'center', vertical: 'bottom' }, getContentAnchorEl: null, transformOrigin: { horizontal: 'center', vertical: 'top' }, PopoverClasses: { paper: classes.menuPaper } }, className: C(classes.select, _defineProperty2({}, classes.disabled, disabled)), disableUnderline: true, disabled: shouldDisable, displayEmpty: true, fullWidth: true, id: selectId, multiple: multiple, onChange: handleChange, onClose: function onClose() { return setIsOpen(false); }, onOpen: function onOpen() { return setIsOpen(true); }, renderValue: renderValue, value: value !== null && value !== void 0 ? value : '' }, isMultiSelect && hasMoreThanOneChild && ( /*#__PURE__*/wn.createElement(MenuItem, { Icon: MultiSelectIcon ? /*#__PURE__*/ wn.createElement(MultiSelectIcon, { className: classes.checkIcon, fontSize: "small" }) : /*#__PURE__*/ wn.createElement("div", null), forceSelected: !!MultiSelectIcon, label: canSelectAll ? 'Select all' : 'Unselect', onClick: canSelectAll ? selectAll : deselectAll, value: MULTISELECT_VALUE })), selectItems.map(function (menuItem) { return /*#__PURE__*/ wn.createElement(MenuItem, Object.assign({ Icon: /*#__PURE__*/ wn.createElement(default_1$5, { className: classes.checkIcon, fontSize: "small" }), key: menuItem.value }, menuItem)); })), caption && ( /*#__PURE__*/wn.createElement(Typography, { disabled: shouldDisable, variant: "body2" }, caption))))); };
|
|
8840
|
-
var useStyles$
|
|
8841
|
-
var MenuItemCore = function MenuItemCore(
|
|
8994
|
+
var useStyles$c = makeStyles(function (theme) { return { container: { display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, icon: { '& .MuiSvgIcon-root': { marginTop: theme.spacing(0.5) }, display: 'flex', marginRight: theme.spacing(1), visibility: 'hidden' }, iconVisible: { visibility: 'visible' }, text: { display: 'flex', flexDirection: 'column', textWrap: 'wrap' }, menuItem: { display: 'flex', alignItems: 'flex-start', padding: theme.spacing(1), flex: 1 }, premiumButton: { marginRight: theme.spacing(1) } }; });
|
|
8995
|
+
var MenuItemCore = function MenuItemCore(_ref33) { var Icon = _ref33.Icon, disabled = _ref33.disabled, footer = _ref33.footer, forceSelected = _ref33.forceSelected, label = _ref33.label, onClick = _ref33.onClick, selected = _ref33.selected, subtext = _ref33.subtext, Typography = _ref33.TypographyComponent; var classes = useStyles$c(); return /*#__PURE__*/ wn.createElement("div", { className: classes.container }, /*#__PURE__*/ wn.createElement(MenuItem$2, { button: !!onClick || undefined, className: classes.menuItem, "data-value": label, disableRipple: true, disabled: disabled, onClick: onClick }, Icon && /*#__PURE__*/ wn.createElement("div", { className: C(classes.icon, _defineProperty2({}, classes.iconVisible, selected || forceSelected)) }, Icon), /*#__PURE__*/ wn.createElement("div", { className: classes.text }, /*#__PURE__*/ wn.createElement(Typography, null, label), /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, subtext))), footer); };
|
|
8842
8996
|
var MenuItem = function MenuItem(props) { return /*#__PURE__*/ wn.createElement(MenuItemCore, Object.assign({}, props, { TypographyComponent: Typography })); };
|
|
8843
|
-
var useStyles$
|
|
8844
|
-
var Select = function Select(props) { var classes = useStyles$
|
|
8845
|
-
var useStyles$
|
|
8997
|
+
var useStyles$b = makeSelectStyles(function (theme) { return { checkIcon: { color: theme.styleConfig.colors.primary }, menuPaper: { backgroundColor: theme.styleConfig.container.backgroundColor, color: theme.styleConfig.colors.primary }, select: { color: theme.styleConfig.colors.primary, '& .MuiSelect-icon': { color: theme.styleConfig.colors.primary }, borderColor: theme.styleConfig.inputs.borderColor }, selectContainer: { width: function width(props) { return props === null || props === void 0 ? void 0 : props.width; } } }; });
|
|
8998
|
+
var Select = function Select(props) { var classes = useStyles$b(props); return /*#__PURE__*/ wn.createElement(SelectCore, Object.assign({}, props, { LabelComponent: Label, MenuItemComponent: MenuItem, TypographyComponent: Typography, classes: classes })); };
|
|
8999
|
+
var useStyles$a = makeStyles(function (theme) { return { settingsContainer: { border: '1px solid', borderColor: theme.styleConfig.colors.subtle, borderRadius: theme.styleConfig.borderRadius, backgroundColor: theme.styleConfig.container.backgroundColor }, titleContainer: _defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2({}, theme.breakpoints.down('xs'), { flexDirection: 'column', alignItems: 'flex-start', gap: theme.spacing(1) }), "padding", theme.spacing(1.5, 2)), "borderBottom", '1px solid'), "borderBottomColor", theme.styleConfig.colors.subtle), "display", 'flex'), "justifyContent", 'space-between'), "alignItems", 'center'), content: { padding: theme.spacing(2) }, actions: { display: 'flex', gap: theme.spacing(1), alignItems: 'center' } }; });
|
|
8846
9000
|
var DEFAULT_STATE = { editing: false, setEditing: noop };
|
|
8847
9001
|
var SettingsContext = /*#__PURE__*/ F$4(DEFAULT_STATE);
|
|
8848
9002
|
var useSettingsContainer = function useSettingsContainer() { return q$5(SettingsContext); };
|
|
8849
|
-
var SettingsContainer = function SettingsContainer(
|
|
9003
|
+
var SettingsContainer = function SettingsContainer(_ref34) { var _ref34$canEdit = _ref34.canEdit, canEdit = _ref34$canEdit === void 0 ? true : _ref34$canEdit, disableSave = _ref34.disableSave, children = _ref34.children, hasCTA = _ref34.hasCTA, onCancel = _ref34.onCancel, onSave = _ref34.onSave, title = _ref34.title, customCTA = _ref34.customCTA, creating = _ref34.creating, externalEditing = _ref34.editing, externalSetEditing = _ref34.setEditing, modalDescription = _ref34.modalDescription, useBlockNavigation = _ref34.useBlockNavigation; var classes = useStyles$a(); var _h21 = h$4(creating !== null && creating !== void 0 ? creating : false), _h22 = _slicedToArray2(_h21, 2), internalEditing = _h22[0], internalSetEditing = _h22[1]; var _h23 = h$4(false), _h24 = _slicedToArray2(_h23, 2), isSaving = _h24[0], setIsSaving = _h24[1]; var _useToast3 = useToast(), openToast = _useToast3.openToast, closeToast = _useToast3.closeToast; var shouldUseExternalEditing = externalEditing !== undefined && !!externalSetEditing; var editing = shouldUseExternalEditing ? externalEditing : internalEditing; var setEditing = shouldUseExternalEditing ? externalSetEditing : internalSetEditing; var _useBlockNavigation = useBlockNavigation(editing && !isSaving), allowNavigation = _useBlockNavigation.allowNavigation, blocked = _useBlockNavigation.blocked, cancelNavigation = _useBlockNavigation.cancelNavigation; var edit = function edit() { setEditing(true); }; var cancel = function cancel() { onCancel === null || onCancel === void 0 ? void 0 : onCancel(); closeToast(); setEditing(false); }; var save = function save() { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee6() { var message; return _regeneratorRuntime().wrap(function _callee6$(_context6) { while (1)
|
|
8850
9004
|
switch (_context6.prev = _context6.next) {
|
|
8851
9005
|
case 0:
|
|
8852
9006
|
setIsSaving(true);
|
|
@@ -8873,20 +9027,20 @@ var SettingsContainer = function SettingsContainer(_ref33) { var _ref33$canEdit
|
|
|
8873
9027
|
} }, _callee6, null, [[1, 7, 11, 14]]); })); }; var modalState = useModalState(save); if (!modalDescription) {
|
|
8874
9028
|
modalDescription = 'Double check before saving your changes.';
|
|
8875
9029
|
} return /*#__PURE__*/ wn.createElement(SettingsContext.Provider, { value: { editing: editing, setEditing: setEditing } }, /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, modalState, { confirmButtonText: "Save changes", description: modalDescription, title: "Save changes?", warning: true })), /*#__PURE__*/ wn.createElement(Modal, { isOpen: blocked, close: cancelNavigation, confirm: function confirm() { allowNavigation(); return Promise.resolve(); }, confirmButtonText: "Navigate without saving", cancelButtonText: "Keep editing", description: 'Your changes are unsaved – are you sure you want to navigate away?', title: "Save changes?", warning: true }), /*#__PURE__*/ wn.createElement("div", { className: classes.settingsContainer }, /*#__PURE__*/ wn.createElement("div", { className: classes.titleContainer }, /*#__PURE__*/ wn.createElement(Typography, { variant: "h3" }, title), /*#__PURE__*/ wn.createElement("div", { className: classes.actions }, hasCTA && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, editing ? ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Button, { compact: true, onClick: cancel, variant: "ghost" }, "Cancel"), /*#__PURE__*/ wn.createElement(Button, { compact: true, disabled: disableSave, onClick: modalState.open }, "Save"))) : ( /*#__PURE__*/wn.createElement(wn.Fragment, null, customCTA ? customCTA : canEdit && ( /*#__PURE__*/wn.createElement(Button, { compact: true, onClick: edit, variant: "ghost" }, "Edit")))))))), /*#__PURE__*/ wn.createElement("div", { className: classes.content }, children))); };
|
|
8876
|
-
var SettingsList = function SettingsList(
|
|
8877
|
-
var SettingsListItem = function SettingsListItem(
|
|
9030
|
+
var SettingsList = function SettingsList(_ref35) { var children = _ref35.children; return /*#__PURE__*/ wn.createElement("dl", { style: { margin: 0 } }, children); };
|
|
9031
|
+
var SettingsListItem = function SettingsListItem(_ref36) { var children = _ref36.children, title = _ref36.title; return /*#__PURE__*/ wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Typography, { component: "dt" }, title), /*#__PURE__*/ wn.createElement("dd", { style: { margin: '0 0 8px' } }, children)); };
|
|
8878
9032
|
var makeInfoIconStyles = makeStylesFactory(function () { return { infoIconContainer: { width: 'fit-content' } }; });
|
|
8879
|
-
var InfoIconCore = function InfoIconCore(
|
|
9033
|
+
var InfoIconCore = function InfoIconCore(_ref37) { var tooltipText = _ref37.tooltipText, classes = _ref37.classes, Tooltip = _ref37.TooltipComponent; return /*#__PURE__*/ wn.createElement("div", { className: classes.infoIconContainer }, /*#__PURE__*/ wn.createElement(Tooltip, { text: tooltipText }, /*#__PURE__*/ wn.createElement(InfoOutlined, null))); };
|
|
8880
9034
|
var makeTooltipStyles = makeStylesFactory(function (theme) { return { targetWrapper: { display: 'flex', width: 'fit-content' }, tooltip: { '& .MuiTooltip-tooltip': { maxWidth: 240, padding: theme.spacing(1), borderRadius: 4 }, '& .MuiTooltip-tooltipPlacementRight': { margin: theme.spacing(0, 1) }, '& .MuiTooltip-tooltipPlacementLeft': { margin: theme.spacing(0, 1) }, zIndex: 2000 } }; });
|
|
8881
|
-
var TooltipCore = function TooltipCore(
|
|
9035
|
+
var TooltipCore = function TooltipCore(_ref38) { var text = _ref38.text, children = _ref38.children, disabled = _ref38.disabled, _ref38$placement = _ref38.placement, placement = _ref38$placement === void 0 ? 'right' : _ref38$placement, classes = _ref38.classes, Typography = _ref38.TypographyComponent; if (disabled) {
|
|
8882
9036
|
return children;
|
|
8883
|
-
} return /*#__PURE__*/ wn.createElement(
|
|
8884
|
-
var useStyles$
|
|
8885
|
-
var Tooltip = function Tooltip(props) { var classes = useStyles$
|
|
8886
|
-
var useStyles$
|
|
8887
|
-
var InfoIcon = function InfoIcon(props) { var classes = useStyles$
|
|
8888
|
-
var SettingsSection = function SettingsSection(
|
|
8889
|
-
var useFormState = function useFormState(
|
|
9037
|
+
} return /*#__PURE__*/ wn.createElement(Tooltip$2, { PopperProps: { className: classes.tooltip }, interactive: true, placement: placement, title: /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, text) }, /*#__PURE__*/ wn.createElement("span", { className: classes.targetWrapper }, children)); };
|
|
9038
|
+
var useStyles$9 = makeTooltipStyles(function (theme) { return { tooltip: { '& .MuiTooltip-tooltip': { '& p': { color: theme.styleConfig.buttons.primary.textColor }, backgroundColor: theme.styleConfig.buttons.primary.backgroundColor } } }; });
|
|
9039
|
+
var Tooltip = function Tooltip(props) { var classes = useStyles$9(); return /*#__PURE__*/ wn.createElement(TooltipCore, Object.assign({}, props, { TypographyComponent: Typography, classes: classes })); };
|
|
9040
|
+
var useStyles$8 = makeInfoIconStyles(function (theme) { return { infoIconContainer: { color: theme.styleConfig.colors.primary } }; });
|
|
9041
|
+
var InfoIcon = function InfoIcon(props) { var classes = useStyles$8(); return /*#__PURE__*/ wn.createElement(InfoIconCore, Object.assign({}, props, { classes: classes, TooltipComponent: Tooltip })); };
|
|
9042
|
+
var SettingsSection = function SettingsSection(_ref39) { var children = _ref39.children, title = _ref39.title, tooltipText = _ref39.tooltipText; return /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 0.5 }, /*#__PURE__*/ wn.createElement(FlexBox, { alignItems: "center", flexDirection: "row", gap: 1 }, /*#__PURE__*/ wn.createElement(Typography, { variant: "h4" }, title), tooltipText && /*#__PURE__*/ wn.createElement(InfoIcon, { tooltipText: tooltipText })), children); };
|
|
9043
|
+
var useFormState = function useFormState(_ref40) { var remoteState = _ref40.remoteState; var _h25 = h$4(remoteState), _h26 = _slicedToArray2(_h25, 2), localState = _h26[0], setLocalState = _h26[1]; var resetLocalState = T$2(function () { setLocalState(remoteState); }, [remoteState]); var _h27 = h$4(false), _h28 = _slicedToArray2(_h27, 2), editing = _h28[0], setEditing = _h28[1]; var handleSetEditing = T$2(function (newEditing) { if (newEditing) {
|
|
8890
9044
|
resetLocalState();
|
|
8891
9045
|
} setEditing(newEditing); }, [resetLocalState]); return { localState: localState, setLocalState: setLocalState, editing: editing, handleSetEditing: handleSetEditing }; };
|
|
8892
9046
|
var useStateSliceSetter = function useStateSliceSetter(setState, key) { return T$2(function (value) { setState(function (state) { return Object.assign(Object.assign({}, state), _defineProperty2({}, key, value)); }); }, [key, setState]); };
|
|
@@ -8901,13 +9055,13 @@ else {
|
|
|
8901
9055
|
return { idp: oidcIdpMap[_idpKey], type: type };
|
|
8902
9056
|
} };
|
|
8903
9057
|
var getIdpAndConnectionInfo = function getIdpAndConnectionInfo(connection) { return Object.assign(Object.assign({}, getIdpInfo(connection.identity_provider, connection.connectionType)), { connection: connection }); };
|
|
8904
|
-
var AppDetails = function AppDetails(
|
|
9058
|
+
var AppDetails = function AppDetails(_ref41) { var connectionProp = _ref41.connection; var _getIdpAndConnectionI = getIdpAndConnectionInfo(connectionProp), connection = _getIdpAndConnectionI.connection, idp = _getIdpAndConnectionI.idp, type = _getIdpAndConnectionI.type; return /*#__PURE__*/ wn.createElement(wn.Fragment, null, type === 'saml' && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(SettingsListItem, { title: idp.acsUrlLabel }, /*#__PURE__*/ wn.createElement(CopyableText, null, connection.acs_url)), /*#__PURE__*/ wn.createElement(SettingsListItem, { title: idp.audienceUriLabel }, /*#__PURE__*/ wn.createElement(CopyableText, null, connection.audience_uri)))), type === 'oidc' && ( /*#__PURE__*/wn.createElement(SettingsListItem, { title: idp.redirectUrlLabel }, /*#__PURE__*/ wn.createElement(CopyableText, null, connection.redirect_url))), type === 'saml' && ( /*#__PURE__*/wn.createElement(SettingsListItem, { title: idp.nameIdFormatLabel }, /*#__PURE__*/ wn.createElement(Typography, { color: "secondary" }, idp.nameIdFormatValue)))); };
|
|
8905
9059
|
var collator = Intl.Collator();
|
|
8906
9060
|
var nameKeys = new Set(['full_name', 'first_name', 'last_name']);
|
|
8907
9061
|
var requiredKeys = new Set([].concat(_toConsumableArray2(nameKeys), ['email']));
|
|
8908
|
-
var attributeMappingItemRenderer = [{ title: 'Key', getValue: function getValue(
|
|
8909
|
-
var attributeMappingKeyExtractor = function attributeMappingKeyExtractor(
|
|
8910
|
-
var AttributeMappingTable = function AttributeMappingTable(
|
|
9062
|
+
var attributeMappingItemRenderer = [{ title: 'Key', getValue: function getValue(_ref42) { var key = _ref42.key; var isRequiredKey = requiredKeys.has(key); var label = key; return /*#__PURE__*/ wn.createElement(Typography, { color: "secondary" }, label, isRequiredKey && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, ' ', /*#__PURE__*/ wn.createElement(Typography, { component: "span", color: "error" }, "*")))); } }, { title: 'Value', getValue: function getValue(_ref43) { var value = _ref43.value; return /*#__PURE__*/ wn.createElement(Typography, { color: "secondary" }, value); } }];
|
|
9063
|
+
var attributeMappingKeyExtractor = function attributeMappingKeyExtractor(_ref44) { var key = _ref44.key; return key; };
|
|
9064
|
+
var AttributeMappingTable = function AttributeMappingTable(_ref45) { var editing = _ref45.editing, localState = _ref45.localState, remoteState = _ref45.remoteState, setLocalState = _ref45.setLocalState; var _ref46 = editing ? localState : remoteState, attributeMapping = _ref46.attributeMapping; var attributeMappingItems = F$3(function () { return Object.entries(attributeMapping).map(function (_ref47) { var _ref48 = _slicedToArray2(_ref47, 2), key = _ref48[0], value = _ref48[1]; return { key: key, value: value }; }).sort(function (a, b) { return collator.compare(a.key, b.key); }); }, [attributeMapping]); var _h29 = h$4([['', '']]), _h30 = _slicedToArray2(_h29, 2), pendingAttributeMapping = _h30[0], setPendingAttributeMapping = _h30[1]; var _h31 = h$4('key'), _h32 = _slicedToArray2(_h31, 2), editMode = _h32[0], setEditMode = _h32[1]; var _h33 = h$4(''), _h34 = _slicedToArray2(_h33, 2), editedAttributeMappingKey = _h34[0], setEditedAttributeMappingKey = _h34[1]; var _h35 = h$4(''), _h36 = _slicedToArray2(_h35, 2), editedAttributeMappingValue = _h36[0], setEditedAttributeMappingValue = _h36[1]; var _h37 = h$4(''), _h38 = _slicedToArray2(_h37, 2), editedAttributeMappingLastNameValue = _h38[0], setEditedAttributeMappingLastNameValue = _h38[1]; var editAttributeMappingModalProps = useModalState(function () { var editedMapping = editMode === 'name' && editedAttributeMappingKey === 'first_name' ? { first_name: editedAttributeMappingValue, last_name: editedAttributeMappingLastNameValue } : _defineProperty2({}, editedAttributeMappingKey, editedAttributeMappingValue); setLocalState(function (state) { var mergedMapping = Object.assign(Object.assign({}, state.attributeMapping), editedMapping); if (editMode === 'name') {
|
|
8911
9065
|
if (editedAttributeMappingKey === 'full_name') {
|
|
8912
9066
|
delete mergedMapping.first_name;
|
|
8913
9067
|
delete mergedMapping.last_name;
|
|
@@ -8934,11 +9088,11 @@ else {
|
|
|
8934
9088
|
else {
|
|
8935
9089
|
setPendingDeleteAttributeMappingKey(key);
|
|
8936
9090
|
deleteAttributeMappingModalProps.open();
|
|
8937
|
-
} }, [deleteAttributeMapping, deleteAttributeMappingModalProps]); return /*#__PURE__*/ wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, editAttributeMappingModalProps, { title: "Edit custom mapping", confirmButtonText: "Save" }), /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 1 }, editMode === 'name' ? ( /*#__PURE__*/wn.createElement(Select, { selectItems: [{ label: 'Full Name', value: 'full_name' }, { label: 'First Name, Last Name', value: 'first_last_name' }], fullWidth: true, caption: "You can change the format of the key.", value: editedAttributeMappingKey === 'full_name' ? 'full_name' : 'first_last_name', onChange: function onChange(value) { setEditedAttributeMappingKey(value === 'full_name' ? 'full_name' : 'first_name'); } })) : ( /*#__PURE__*/wn.createElement(Input, { label: "Key", fullWidth: true, value: editedAttributeMappingKey, onChange: setEditedAttributeMappingKey })), editMode === 'name' && (editedAttributeMappingKey === 'first_name' || editedAttributeMappingKey === 'last_name') ? ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(FlexBox, { gap: 2 }, /*#__PURE__*/ wn.createElement(Input, { label: "First Name", fullWidth: true, value: editedAttributeMappingValue, onChange: setEditedAttributeMappingValue }), /*#__PURE__*/ wn.createElement(Input, { label: "Last Name", fullWidth: true, value: editedAttributeMappingLastNameValue, onChange: setEditedAttributeMappingLastNameValue })))) : ( /*#__PURE__*/wn.createElement(Input, { label: "Value", fullWidth: true, value: editedAttributeMappingValue, onChange: setEditedAttributeMappingValue })))), /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, deleteAttributeMappingModalProps, { title: "Delete mapping?", confirmButtonText: "Delete", warning: true }), /*#__PURE__*/ wn.createElement(Typography, null, "Deleting the Groups attribute mapping will also disable any Group Role assignments you have added above. They will not be deleted, but you must add a Groups mapping to make edits.")), /*#__PURE__*/ wn.createElement(ListEditor, { items: attributeMappingItems, itemRenderer: attributeMappingItemRenderer, rowKeyExtractor: attributeMappingKeyExtractor, addModalProps: { confirm: function confirm() { setLocalState(function (state) { return Object.assign(Object.assign({}, state), { attributeMapping: Object.assign(Object.assign({}, state.attributeMapping), Object.fromEntries(pendingAttributeMapping.filter(function (
|
|
9091
|
+
} }, [deleteAttributeMapping, deleteAttributeMappingModalProps]); return /*#__PURE__*/ wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, editAttributeMappingModalProps, { title: "Edit custom mapping", confirmButtonText: "Save" }), /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 1 }, editMode === 'name' ? ( /*#__PURE__*/wn.createElement(Select, { selectItems: [{ label: 'Full Name', value: 'full_name' }, { label: 'First Name, Last Name', value: 'first_last_name' }], fullWidth: true, caption: "You can change the format of the key.", value: editedAttributeMappingKey === 'full_name' ? 'full_name' : 'first_last_name', onChange: function onChange(value) { setEditedAttributeMappingKey(value === 'full_name' ? 'full_name' : 'first_name'); } })) : ( /*#__PURE__*/wn.createElement(Input$1, { label: "Key", fullWidth: true, value: editedAttributeMappingKey, onChange: setEditedAttributeMappingKey })), editMode === 'name' && (editedAttributeMappingKey === 'first_name' || editedAttributeMappingKey === 'last_name') ? ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(FlexBox, { gap: 2 }, /*#__PURE__*/ wn.createElement(Input$1, { label: "First Name", fullWidth: true, value: editedAttributeMappingValue, onChange: setEditedAttributeMappingValue }), /*#__PURE__*/ wn.createElement(Input$1, { label: "Last Name", fullWidth: true, value: editedAttributeMappingLastNameValue, onChange: setEditedAttributeMappingLastNameValue })))) : ( /*#__PURE__*/wn.createElement(Input$1, { label: "Value", fullWidth: true, value: editedAttributeMappingValue, onChange: setEditedAttributeMappingValue })))), /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, deleteAttributeMappingModalProps, { title: "Delete mapping?", confirmButtonText: "Delete", warning: true }), /*#__PURE__*/ wn.createElement(Typography, null, "Deleting the Groups attribute mapping will also disable any Group Role assignments you have added above. They will not be deleted, but you must add a Groups mapping to make edits.")), /*#__PURE__*/ wn.createElement(ListEditor, { items: attributeMappingItems, itemRenderer: attributeMappingItemRenderer, rowKeyExtractor: attributeMappingKeyExtractor, addModalProps: { confirm: function confirm() { setLocalState(function (state) { return Object.assign(Object.assign({}, state), { attributeMapping: Object.assign(Object.assign({}, state.attributeMapping), Object.fromEntries(pendingAttributeMapping.filter(function (_ref50) { var _ref51 = _slicedToArray2(_ref50, 2), key = _ref51[0], value = _ref51[1]; return key && value && !state.attributeMapping[key]; }))) }); }); return Promise.resolve(); }, title: 'Add custom mapping', content: ( /*#__PURE__*/wn.createElement(FlexBox, { flexDirection: "column", gap: 1 }, pendingAttributeMapping.map(function (_ref52, i) { var _ref53 = _slicedToArray2(_ref52, 2), key = _ref53[0], value = _ref53[1]; return /*#__PURE__*/ wn.createElement(FlexBox, { gap: 1, key: i }, /*#__PURE__*/ wn.createElement(Input$1, { label: "Key", fullWidth: true, value: key, onChange: function onChange(value) { setPendingAttributeMapping(function (state) { return state.map(function (item, index) { return index === i ? [value, item[1]] : item; }); }); } }), /*#__PURE__*/ wn.createElement(Input$1, { label: "Value", fullWidth: true, value: value, onChange: function onChange(value) { setPendingAttributeMapping(function (state) { return state.map(function (item, index) { return index === i ? [item[0], value] : item; }); }); } })); }), /*#__PURE__*/ wn.createElement(Button, { variant: "text", startIcon: /*#__PURE__*/ wn.createElement(Add, null), fullWidth: true, onClick: function onClick() { setPendingAttributeMapping(function (state) { return [].concat(_toConsumableArray2(state), [['', '']]); }); } }, "Add custom mapping"))) }, hideAddButton: !editing, getItemActionProps: editing ? function (item) { return { action: item.key === 'email' && item.value === 'NameID' ? undefined : { text: 'Edit', onClick: function onClick() { handleEditAttributeMapping(item.key); } }, warningAction: item.key === 'email' || nameKeys.has(item.key) && !(hasFirstAndLastNameKeys && hasFullNameKey) ? undefined : { text: 'Delete', onClick: function onClick() { handleRequestDeleteAttributeMapping(item.key); } } }; } : undefined })); };
|
|
8938
9092
|
var makeSamlOption = function makeSamlOption(idpName) { return { idp: samlIdpMap[idpName], idpName: idpName, type: 'saml' }; };
|
|
8939
9093
|
var makeOidcOption = function makeOidcOption(idpName) { return { idp: oidcIdpMap[idpName], idpName: idpName, type: 'oidc' }; };
|
|
8940
9094
|
var idpOptions = { 'saml:google-workspace': makeSamlOption('google-workspace'), 'saml:okta': makeSamlOption('okta'), 'oidc:okta': makeOidcOption('okta'), 'saml:microsoft-entra': makeSamlOption('microsoft-entra'), 'oidc:microsoft-entra': makeOidcOption('microsoft-entra'), 'saml:generic': makeSamlOption('generic'), 'oidc:generic': makeOidcOption('generic') };
|
|
8941
|
-
var idpSelectItems = Object.entries(idpOptions).map(function (
|
|
9095
|
+
var idpSelectItems = Object.entries(idpOptions).map(function (_ref54) { var _ref55 = _slicedToArray2(_ref54, 2), idpKey = _ref55[0], idp = _ref55[1].idp; return { label: idp.displayName, value: idpKey }; });
|
|
8942
9096
|
var samlIdpSelectItems = Object.values(idpOptions).filter(function (item) { return item.type === 'saml'; }).map(function (item) { return { label: item.idp.displayName, value: item.idpName }; });
|
|
8943
9097
|
var oidcIdpSelectItems = Object.values(idpOptions).filter(function (item) { return item.type === 'oidc'; }).map(function (item) { return { label: item.idp.displayName, value: item.idpName }; });
|
|
8944
9098
|
var useBeforeUnloadNavigationBlock = function useBeforeUnloadNavigationBlock(shouldWarn) { p$3(function () { if (shouldWarn) {
|
|
@@ -8973,18 +9127,18 @@ var routerReducer = function routerReducer(state, action) { switch (action.type)
|
|
|
8973
9127
|
case 'cancelNavigation': return Object.assign(Object.assign({}, state), { pendingRoute: undefined });
|
|
8974
9128
|
default: return state;
|
|
8975
9129
|
} };
|
|
8976
|
-
var createRouter = function createRouter() { var initialState = { blockersActive: new Set() }; var StateContext = /*#__PURE__*/ wn.createContext({}); var ControllerContext = /*#__PURE__*/ wn.createContext({ navigate: noop, useBlockNavigation: function useBlockNavigation() { return { blocked: false, allowNavigation: noop, cancelNavigation: noop }; } }); var useRouterState = function useRouterState() { return wn.useContext(StateContext); }; var useRouterController = function useRouterController() { return wn.useContext(ControllerContext); }; var Router = function Router(
|
|
9130
|
+
var createRouter = function createRouter() { var initialState = { blockersActive: new Set() }; var StateContext = /*#__PURE__*/ wn.createContext({}); var ControllerContext = /*#__PURE__*/ wn.createContext({ navigate: noop, useBlockNavigation: function useBlockNavigation() { return { blocked: false, allowNavigation: noop, cancelNavigation: noop }; } }); var useRouterState = function useRouterState() { return wn.useContext(StateContext); }; var useRouterController = function useRouterController() { return wn.useContext(ControllerContext); }; var Router = function Router(_ref56) { var routeMap = _ref56.routeMap; var _useRouterState = useRouterState(), currentRoute = _useRouterState.currentRoute; var ChildComponent = routeMap[currentRoute.screen]; var childComponentProps = currentRoute.params; return ChildComponent ? /*#__PURE__*/ wn.createElement(ChildComponent, Object.assign({}, childComponentProps)) : null; }; var RouterProvider = function RouterProvider(_ref57) { var children = _ref57.children, initialRoute = _ref57.initialRoute; var _wn$useReducer = wn.useReducer(routerReducer, Object.assign(Object.assign({}, initialState), { currentRoute: initialRoute })), _wn$useReducer2 = _slicedToArray2(_wn$useReducer, 2), state = _wn$useReducer2[0], dispatch = _wn$useReducer2[1]; var navigate = T$2(function (destination) { dispatch({ type: 'navigate', payload: destination }); }, []); var routerState = F$3(function () { return { currentRoute: state.currentRoute }; }, [state.currentRoute]); var isNavigationBlocked = !!state.pendingRoute; var useBlockNavigation = T$2(function (enableBlock) { var callback = F$3(function () { return typeof enableBlock === 'function' ? enableBlock : function () { return enableBlock; }; }, [enableBlock]); p$3(function () { var shouldEnableBlock = callback(); if (shouldEnableBlock) {
|
|
8977
9131
|
dispatch({ type: 'addBlocker', payload: { callback: callback } });
|
|
8978
9132
|
return function () { dispatch({ type: 'removeBlocker', payload: { callback: callback } }); };
|
|
8979
9133
|
} }, [callback, enableBlock]); return { blocked: isNavigationBlocked, allowNavigation: function allowNavigation() { dispatch({ type: 'approveNavigation' }); }, cancelNavigation: function cancelNavigation() { dispatch({ type: 'cancelNavigation' }); } }; }, [isNavigationBlocked]); useBeforeUnloadNavigationBlock(state.blockersActive.size > 0); var controller = F$3(function () { return { navigate: navigate, useBlockNavigation: useBlockNavigation }; }, [navigate, useBlockNavigation]); return /*#__PURE__*/ wn.createElement(ControllerContext.Provider, { value: controller }, /*#__PURE__*/ wn.createElement(StateContext.Provider, { value: routerState }, children)); }; return { RouterProvider: RouterProvider, Router: Router, useRouterController: useRouterController, useRouterState: useRouterState }; };
|
|
8980
9134
|
var _createRouter = createRouter(), SsoRouterProvider = _createRouter.RouterProvider, SsoRouter = _createRouter.Router, useSsoRouterController = _createRouter.useRouterController;
|
|
8981
9135
|
var certItemRenderer = [{ title: 'Issuer', getValue: function getValue(item) { return /*#__PURE__*/ wn.createElement(Typography, { color: "secondary" }, 'issuer' in item ? item.issuer : 'Pending'); } }, { title: 'Created', getValue: function getValue(item) { return /*#__PURE__*/ wn.createElement(Typography, { color: "secondary" }, 'created_at' in item ? new Date(item.created_at).toLocaleString() : 'Pending'); } }, { title: 'Expires', getValue: function getValue(item) { return /*#__PURE__*/ wn.createElement(Typography, { color: "secondary" }, 'expires_at' in item ? new Date(item.expires_at).toLocaleString() : 'Pending'); } }];
|
|
8982
9136
|
var certKeyExtractor = function certKeyExtractor(item) { return 'certificate_id' in item ? item.certificate_id : 'new-certificate-id-pending'; };
|
|
8983
|
-
var CertificateTable = function CertificateTable(
|
|
9137
|
+
var CertificateTable = function CertificateTable(_ref49) { var editing = _ref49.editing, localState = _ref49.localState, manualConfiguration = _ref49.manualConfiguration, remoteState = _ref49.remoteState, setLocalState = _ref49.setLocalState; var _a, _b, _c; var certificates = F$3(function () { if (!remoteState) {
|
|
8984
9138
|
return undefined;
|
|
8985
9139
|
} var remoteCertificates = remoteState; if (!editing) {
|
|
8986
9140
|
return remoteCertificates;
|
|
8987
|
-
} return [].concat(_toConsumableArray2(remoteCertificates.filter(function (cert) { var _a; return !((_a = localState.deletedCertificateIds) === null || _a === void 0 ? void 0 : _a.includes(cert.certificate_id)); })), _toConsumableArray2(localState.certificate ? [{ certificate: localState.certificate, isPending: true }] : [])); }, [editing, localState, remoteState]); var viewCertModalProps = useModalState(); var _h41 = h$4(), _h42 = _slicedToArray2(_h41, 2), viewCertificateContents = _h42[0], setViewCertificateContents = _h42[1]; var persistPendingCertificate = useStateSliceSetter(setLocalState, 'certificate'); var addCertModalProps = useModalState(function () { persistPendingCertificate(pendingCert); }); var _h43 = h$4(''), _h44 = _slicedToArray2(_h43, 2), pendingCert = _h44[0], setPendingCert = _h44[1]; var remoteCertificateCount = (_a = remoteState === null || remoteState === void 0 ? void 0 : remoteState.length) !== null && _a !== void 0 ? _a : 0; var remoteCertificatePendingDeletionCount = (_c = (_b = localState.deletedCertificateIds) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0; var minimumRequiredCertificates = 1; var maximumAllowedCertificates = 5; var canDeleteCertificates = remoteCertificateCount - remoteCertificatePendingDeletionCount > minimumRequiredCertificates; var canAddCertificate = editing && manualConfiguration && !localState.certificate && remoteCertificateCount - remoteCertificatePendingDeletionCount < maximumAllowedCertificates; return /*#__PURE__*/ wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, viewCertModalProps, { title: "View x509 Certificate", confirmButtonText: "Close", noCancelButton: true }), /*#__PURE__*/ wn.createElement(CopyableText, { whiteSpace: "pre-wrap" }, viewCertificateContents)), /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, addCertModalProps, { title: "Add Certificate" }), /*#__PURE__*/ wn.createElement(Input, { label: "x509 Certificate", multiline: true, onChange: function onChange(value) { setPendingCert(value); }, placeholder: "Enter certificate", value: pendingCert })), /*#__PURE__*/ wn.createElement(ListEditor, { items: certificates !== null && certificates !== void 0 ? certificates : [], itemRenderer: certItemRenderer, rowKeyExtractor: certKeyExtractor, onAdd: function onAdd() { setPendingCert(''); addCertModalProps.open(); }, getItemActionProps: function getItemActionProps(item) { return { action: { text: item.isPending ? 'Edit' : 'View', onClick: function onClick() { if (item.isPending) {
|
|
9141
|
+
} return [].concat(_toConsumableArray2(remoteCertificates.filter(function (cert) { var _a; return !((_a = localState.deletedCertificateIds) === null || _a === void 0 ? void 0 : _a.includes(cert.certificate_id)); })), _toConsumableArray2(localState.certificate ? [{ certificate: localState.certificate, isPending: true }] : [])); }, [editing, localState, remoteState]); var viewCertModalProps = useModalState(); var _h41 = h$4(), _h42 = _slicedToArray2(_h41, 2), viewCertificateContents = _h42[0], setViewCertificateContents = _h42[1]; var persistPendingCertificate = useStateSliceSetter(setLocalState, 'certificate'); var addCertModalProps = useModalState(function () { persistPendingCertificate(pendingCert); }); var _h43 = h$4(''), _h44 = _slicedToArray2(_h43, 2), pendingCert = _h44[0], setPendingCert = _h44[1]; var remoteCertificateCount = (_a = remoteState === null || remoteState === void 0 ? void 0 : remoteState.length) !== null && _a !== void 0 ? _a : 0; var remoteCertificatePendingDeletionCount = (_c = (_b = localState.deletedCertificateIds) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0; var minimumRequiredCertificates = 1; var maximumAllowedCertificates = 5; var canDeleteCertificates = remoteCertificateCount - remoteCertificatePendingDeletionCount > minimumRequiredCertificates; var canAddCertificate = editing && manualConfiguration && !localState.certificate && remoteCertificateCount - remoteCertificatePendingDeletionCount < maximumAllowedCertificates; return /*#__PURE__*/ wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, viewCertModalProps, { title: "View x509 Certificate", confirmButtonText: "Close", noCancelButton: true }), /*#__PURE__*/ wn.createElement(CopyableText, { whiteSpace: "pre-wrap" }, viewCertificateContents)), /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, addCertModalProps, { title: "Add Certificate" }), /*#__PURE__*/ wn.createElement(Input$1, { label: "x509 Certificate", multiline: true, onChange: function onChange(value) { setPendingCert(value); }, placeholder: "Enter certificate", value: pendingCert })), /*#__PURE__*/ wn.createElement(ListEditor, { items: certificates !== null && certificates !== void 0 ? certificates : [], itemRenderer: certItemRenderer, rowKeyExtractor: certKeyExtractor, onAdd: function onAdd() { setPendingCert(''); addCertModalProps.open(); }, getItemActionProps: function getItemActionProps(item) { return { action: { text: item.isPending ? 'Edit' : 'View', onClick: function onClick() { if (item.isPending) {
|
|
8988
9142
|
setPendingCert(item.certificate);
|
|
8989
9143
|
addCertModalProps.open();
|
|
8990
9144
|
}
|
|
@@ -8997,8 +9151,8 @@ var CertificateTable = function CertificateTable(_ref48) { var editing = _ref48.
|
|
|
8997
9151
|
else if ('certificate_id' in item) {
|
|
8998
9152
|
setLocalState(function (state) { var _a; return Object.assign(Object.assign({}, state), { deletedCertificateIds: [].concat(_toConsumableArray2((_a = state.deletedCertificateIds) !== null && _a !== void 0 ? _a : []), [item.certificate_id]) }); });
|
|
8999
9153
|
} } } : undefined }; }, hideAddButton: !canAddCertificate })); };
|
|
9000
|
-
var DetailsSectionBody = function DetailsSectionBody(
|
|
9001
|
-
var DetailsSection = function DetailsSection(
|
|
9154
|
+
var DetailsSectionBody = function DetailsSectionBody(_ref58) { var taggedConnection = _ref58.connection, localState = _ref58.localState, remoteState = _ref58.remoteState, setLocalState = _ref58.setLocalState; var _a, _b; var _useSettingsContainer = useSettingsContainer(), editing = _useSettingsContainer.editing; var _ref59 = editing ? localState : remoteState, displayName = _ref59.displayName, identityProvider = _ref59.identityProvider; var handleDisplayNameChange = useStateSliceSetter(setLocalState, 'displayName'); var handleIdentityProviderChange = useStateSliceSetter(setLocalState, 'identityProvider'); var handleMetadataUrlChange = useStateSliceSetter(setLocalState, 'metadataUrl'); var handleSsoUrlChange = useStateSliceSetter(setLocalState, 'ssoUrl'); var handleEntityIdChange = useStateSliceSetter(setLocalState, 'entityId'); var handleClientIdChange = useStateSliceSetter(setLocalState, 'clientId'); var handleClientSecretChange = useStateSliceSetter(setLocalState, 'clientSecret'); var handleIssuerChange = useStateSliceSetter(setLocalState, 'issuer'); var handleIssuerDerivedValueChange = useStateSliceSetter(setLocalState, 'issuerDerivedValue'); var handleAuthorizationUrlChange = useStateSliceSetter(setLocalState, 'authorizationUrl'); var handleTokenUrlChange = useStateSliceSetter(setLocalState, 'tokenUrl'); var handleUserInfoUrlChange = useStateSliceSetter(setLocalState, 'userInfoUrl'); var handleJwksUrlChange = useStateSliceSetter(setLocalState, 'jwksUrl'); var _getIdpAndConnectionI2 = getIdpAndConnectionInfo(taggedConnection), connection = _getIdpAndConnectionI2.connection, idp = _getIdpAndConnectionI2.idp, type = _getIdpAndConnectionI2.type; var idpRequiresManualConfig = type === 'saml' && idp.metadataUrlLabel === false; var manualConfiguration = localState.manualConfiguration || idpRequiresManualConfig; var setManualConfiguration = useStateSliceSetter(setLocalState, 'manualConfiguration'); return /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 2 }, /*#__PURE__*/ wn.createElement(SettingsSection, { title: "Display Name" }, editing ? ( /*#__PURE__*/wn.createElement(Input$1, { value: displayName, onChange: handleDisplayNameChange })) : ( /*#__PURE__*/wn.createElement(Typography, null, displayName))), /*#__PURE__*/ wn.createElement(SettingsSection, { title: "IdP" }, editing ? ( /*#__PURE__*/wn.createElement(Select, { placeholder: "Select", selectItems: type === 'saml' ? samlIdpSelectItems : oidcIdpSelectItems, value: identityProvider, onChange: handleIdentityProviderChange })) : ( /*#__PURE__*/wn.createElement(Typography, null, idp.displayName))), /*#__PURE__*/ wn.createElement(SettingsSection, { title: "App Values", tooltipText: "Copy these App (Service Provider) Values into your IdP." }, /*#__PURE__*/ wn.createElement(SettingsList, null, /*#__PURE__*/ wn.createElement(SettingsListItem, { title: "Connection ID" }, /*#__PURE__*/ wn.createElement(CopyableText, null, connection.connection_id)), /*#__PURE__*/ wn.createElement(AppDetails, { connection: connection }))), /*#__PURE__*/ wn.createElement(SettingsSection, { title: "IdP Values" }, /*#__PURE__*/ wn.createElement(SettingsList, null, type === 'saml' && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, editing && !manualConfiguration ? ( /*#__PURE__*/wn.createElement(SettingsListItem, { title: idp.metadataUrlLabel }, /*#__PURE__*/ wn.createElement(Input$1, { placeholder: "Enter ".concat(idp.metadataUrlLabel), value: localState.metadataUrl || '', onChange: handleMetadataUrlChange }))) : ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(SettingsListItem, { title: idp.idpSsoUrlLabel }, editing ? ( /*#__PURE__*/wn.createElement(Input$1, { placeholder: "Enter ".concat(idp.idpSsoUrlLabel), value: localState.ssoUrl || '', onChange: handleSsoUrlChange })) : ( /*#__PURE__*/wn.createElement(Typography, { color: "secondary" }, connection.idp_sso_url || '–'))), /*#__PURE__*/ wn.createElement(SettingsListItem, { title: idp.idpEntityIdLabel }, editing ? ( /*#__PURE__*/wn.createElement(Input$1, { placeholder: "Enter ".concat(idp.idpEntityIdLabel), value: localState.entityId || '', onChange: handleEntityIdChange })) : ( /*#__PURE__*/wn.createElement(Typography, { color: "secondary" }, connection.idp_entity_id || '–'))))), /*#__PURE__*/ wn.createElement(SettingsListItem, { title: idp.x509CertificateLabel }, /*#__PURE__*/ wn.createElement(CertificateTable, { editing: editing, remoteState: connection.verification_certificates, localState: localState, setLocalState: setLocalState, manualConfiguration: manualConfiguration })), editing && !idpRequiresManualConfig && ( /*#__PURE__*/wn.createElement(Button, { compact: true, variant: "ghost", onClick: function onClick() { setManualConfiguration(!manualConfiguration); } }, manualConfiguration ? "Configure using ".concat(idp.metadataUrlLabel) : 'Configure manually')))), type === 'oidc' && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(SettingsListItem, { title: idp.clientIdLabel }, editing ? ( /*#__PURE__*/wn.createElement(Input$1, { placeholder: "Enter ".concat(idp.clientIdLabel), value: localState.clientId || '', onChange: handleClientIdChange })) : ( /*#__PURE__*/wn.createElement(Typography, { color: "secondary" }, connection.client_id || '–'))), /*#__PURE__*/ wn.createElement(SettingsListItem, { title: idp.clientSecretLabel }, editing ? ( /*#__PURE__*/wn.createElement(Input$1, { placeholder: "Enter ".concat(idp.clientSecretLabel), value: localState.clientSecret || '', onChange: handleClientSecretChange })) : ( /*#__PURE__*/wn.createElement(Typography, { color: "secondary" }, connection.client_secret || '–'))), idp.issuerDerivedLabel ? ( /*#__PURE__*/wn.createElement(SettingsListItem, { title: idp.issuerDerivedLabel }, editing ? ( /*#__PURE__*/wn.createElement(Input$1, { placeholder: "Enter ".concat(idp.issuerDerivedLabel), value: localState.issuerDerivedValue || '', onChange: handleIssuerDerivedValueChange })) : ( /*#__PURE__*/wn.createElement(Typography, { color: "secondary" }, ((_a = idp.extractIssuerFromInput) === null || _a === void 0 ? void 0 : _a.call(idp, connection.issuer)) || '–')))) : ( /*#__PURE__*/wn.createElement(SettingsListItem, { title: idp.issuerLabel }, editing ? ( /*#__PURE__*/wn.createElement(Input$1, { placeholder: "URL", value: localState.issuer || '', onChange: handleIssuerChange })) : ( /*#__PURE__*/wn.createElement(Typography, { color: "secondary" }, connection.issuer || '–')))), editing && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, manualConfiguration && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(SettingsListItem, { title: "Authorization URL" }, /*#__PURE__*/ wn.createElement(Input$1, { placeholder: "Enter Authorization URL", value: localState.authorizationUrl || '', onChange: handleAuthorizationUrlChange })), /*#__PURE__*/ wn.createElement(SettingsListItem, { title: "Token URL" }, /*#__PURE__*/ wn.createElement(Input$1, { placeholder: "Enter Token URL", value: localState.tokenUrl || '', onChange: handleTokenUrlChange })), /*#__PURE__*/ wn.createElement(SettingsListItem, { title: "User info URL" }, /*#__PURE__*/ wn.createElement(Input$1, { placeholder: "Enter User info URL", value: localState.userInfoUrl || '', onChange: handleUserInfoUrlChange })), /*#__PURE__*/ wn.createElement(SettingsListItem, { title: "JWKS URL" }, /*#__PURE__*/ wn.createElement(Input$1, { placeholder: "Enter JWKS URL", value: localState.jwksUrl || '', onChange: handleJwksUrlChange })))), /*#__PURE__*/ wn.createElement(Button, { compact: true, variant: "ghost", onClick: function onClick() { setManualConfiguration(!manualConfiguration); } }, manualConfiguration ? "Configure using ".concat((_b = idp.issuerDerivedLabel) !== null && _b !== void 0 ? _b : idp.issuerLabel) : 'Configure manually'))))))), type === 'saml' && ( /*#__PURE__*/wn.createElement(SettingsSection, { title: idp.attributeMappingLabel }, /*#__PURE__*/ wn.createElement(AttributeMappingTable, { editing: editing, localState: localState, remoteState: remoteState, setLocalState: setLocalState })))); };
|
|
9155
|
+
var DetailsSection = function DetailsSection(_ref60) { var canUpdateConnection = _ref60.canUpdateConnection, connectionProp = _ref60.connection; var _getIdpAndConnectionI3 = getIdpAndConnectionInfo(connectionProp), idp = _getIdpAndConnectionI3.idp, connection = _getIdpAndConnectionI3.connection, type = _getIdpAndConnectionI3.type; var remoteState = F$3(function () { var _a; return { displayName: connection.display_name, identityProvider: connection.identity_provider, attributeMapping: 'attribute_mapping' in connection ? connection.attribute_mapping : {}, manualConfiguration: false, authorizationUrl: 'authorization_url' in connection ? connection.authorization_url : undefined, clientId: 'client_id' in connection ? connection.client_id : undefined, clientSecret: 'client_secret' in connection ? connection.client_secret : undefined, entityId: 'idp_entity_id' in connection ? connection.idp_entity_id : undefined, issuer: 'issuer' in connection ? connection.issuer : undefined, issuerDerivedValue: type === 'oidc' ? (_a = idp.extractIssuerFromInput) === null || _a === void 0 ? void 0 : _a.call(idp, connection.issuer) : undefined, jwksUrl: 'jwks_url' in connection ? connection.jwks_url : undefined, ssoUrl: 'idp_sso_url' in connection ? connection.idp_sso_url : undefined, tokenUrl: 'token_url' in connection ? connection.token_url : undefined, userInfoUrl: 'userinfo_url' in connection ? connection.userinfo_url : undefined }; }, [connection, idp, type]); var _useFormState = useFormState({ remoteState: remoteState }), localState = _useFormState.localState, setLocalState = _useFormState.setLocalState, editing = _useFormState.editing, handleSetEditing = _useFormState.handleSetEditing; var _useMutateSsoConnecti = useMutateSsoConnection(type), mutate = _useMutateSsoConnecti.mutate; var _useDeleteSsoConnecti2 = useDeleteSsoConnectionCert(), deleteCertificate = _useDeleteSsoConnecti2.mutate; var _useMutateSsoConnecti2 = useMutateSsoConnectionByUrl(), mutateByUrl = _useMutateSsoConnecti2.mutate; var handleSave = T$2(function () { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee7() { var _a, baseOptions, mutatedProperties, idpRequiresManualConfig, isManualConfig, _iterator, _step, _loop, _ret, getIssuer, issuer; return _regeneratorRuntime().wrap(function _callee7$(_context8) { while (1)
|
|
9002
9156
|
switch (_context8.prev = _context8.next) {
|
|
9003
9157
|
case 0:
|
|
9004
9158
|
baseOptions = { connection_id: connection.connection_id };
|
|
@@ -9163,8 +9317,8 @@ var useMutateOrganization = function useMutateOrganization() { var _useSWRConfig
|
|
|
9163
9317
|
case "end": return _context10.stop();
|
|
9164
9318
|
} }, _callee9); })); }, [client.organization, mutateSWR])); };
|
|
9165
9319
|
var SetDefaultConfirmModal = function SetDefaultConfirmModal(_a) { var connectionName = _a.connectionName, defaultConnectionName = _a.defaultConnectionName, modalProps = __rest(_a, ["connectionName", "defaultConnectionName"]); return /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, modalProps, { title: "Set ".concat(connectionName || '', " as default?"), confirmButtonText: "Set as default" }), /*#__PURE__*/ wn.createElement(Typography, null, "This will be the default SSO connection for your entire organization. The default connection ID is used to initiate the SSO authentication flow if the connection ID is missing and you only specify the org ID or slug."), defaultConnectionName && ( /*#__PURE__*/wn.createElement(Typography, { color: "error" }, "This will replace ", defaultConnectionName, " as the default connection for your organization."))); };
|
|
9166
|
-
var useMutateDefaultConnection = function useMutateDefaultConnection() { var _useMutateOrganizatio = useMutateOrganization(), mutate = _useMutateOrganizatio.mutate; var setDefault = function setDefault(
|
|
9167
|
-
var useSetDefaultConnection = function useSetDefaultConnection(
|
|
9320
|
+
var useMutateDefaultConnection = function useMutateDefaultConnection() { var _useMutateOrganizatio = useMutateOrganization(), mutate = _useMutateOrganizatio.mutate; var setDefault = function setDefault(_ref61) { var connectionId = _ref61.connectionId, connectionName = _ref61.connectionName; return mutate({ sso_default_connection_id: connectionId }, { errorMessage: "Failed to set ".concat(connectionName, " as default connection") }); }; return { setDefault: setDefault }; };
|
|
9321
|
+
var useSetDefaultConnection = function useSetDefaultConnection(_ref62) { var defaultConnectionName = _ref62.defaultConnectionName; var _h45 = h$4(), _h46 = _slicedToArray2(_h45, 2), connection = _h46[0], setConnection = _h46[1]; var _h47 = h$4(defaultConnectionName), _h48 = _slicedToArray2(_h47, 2), cachedDefaultConnectionName = _h48[0], setCachedDefaultConnectionName = _h48[1]; var _useToggleState2 = useToggleState(), isOpen = _useToggleState2.isOpen, open = _useToggleState2.open, close = _useToggleState2.close; var handleRequestSetDefault = T$2(function (connection) { setConnection(connection); setCachedDefaultConnectionName(defaultConnectionName); open(); }, [defaultConnectionName, open]); var _useMutateDefaultConn = useMutateDefaultConnection(), setDefault = _useMutateDefaultConn.setDefault; var confirm = function confirm() { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee10() { return _regeneratorRuntime().wrap(function _callee10$(_context11) { while (1)
|
|
9168
9322
|
switch (_context11.prev = _context11.next) {
|
|
9169
9323
|
case 0:
|
|
9170
9324
|
if (!connection) {
|
|
@@ -9177,8 +9331,8 @@ var useSetDefaultConnection = function useSetDefaultConnection(_ref61) { var def
|
|
|
9177
9331
|
case 4:
|
|
9178
9332
|
case "end": return _context11.stop();
|
|
9179
9333
|
} }, _callee10); })); }; return { handleRequestSetDefault: handleRequestSetDefault, modalProps: { connectionName: connection === null || connection === void 0 ? void 0 : connection.displayName, defaultConnectionName: cachedDefaultConnectionName, isOpen: isOpen, close: close, confirm: confirm } }; };
|
|
9180
|
-
var OrganizationUpdatesSectionBody = function OrganizationUpdatesSectionBody(
|
|
9181
|
-
var OrganizationUpdatesSection = function OrganizationUpdatesSection(
|
|
9334
|
+
var OrganizationUpdatesSectionBody = function OrganizationUpdatesSectionBody(_ref63) { var connection = _ref63.connection, defaultConnectionName = _ref63.defaultConnectionName, orgJitProvisioningPolicy = _ref63.orgJitProvisioningPolicy, localState = _ref63.localState, setLocalState = _ref63.setLocalState, remoteState = _ref63.remoteState; var _useSettingsContainer2 = useSettingsContainer(), editing = _useSettingsContainer2.editing; var _useSetDefaultConnect = useSetDefaultConnection({ defaultConnectionName: defaultConnectionName }), handleRequestSetDefault = _useSetDefaultConnect.handleRequestSetDefault, modalProps = _useSetDefaultConnect.modalProps; var _ref64 = editing ? localState : remoteState, isDefaultConnection = _ref64.isDefaultConnection, jitProvisioningEnabled = _ref64.jitProvisioningEnabled; var _useRbac = useRbac('stytch.organization', 'update.settings.default-sso-connection'), canSetDefaultConnection = _useRbac.data; var _useRbac2 = useRbac('stytch.organization', 'update.settings.sso-jit-provisioning'), canSetSsoJitProvisioning = _useRbac2.data; return /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 2 }, editing && ( /*#__PURE__*/wn.createElement(SetDefaultConfirmModal, Object.assign({}, modalProps, { confirm: function confirm() { setLocalState(function (state) { return Object.assign(Object.assign({}, state), { isDefaultConnection: true }); }); return Promise.resolve(); } }))), /*#__PURE__*/ wn.createElement(SettingsSection, { title: "Set as default SSO Connection", tooltipText: "The default connection ID is used to initiate the SSO authentication flow if the connection ID is missing and you only specify the org ID or slug. You can only have one default connection. " }, editing && !remoteState.isDefaultConnection && canSetDefaultConnection ? isDefaultConnection ? ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Typography, null, "This connection will be set as the default upon saving."), /*#__PURE__*/ wn.createElement(Button, { variant: "ghost", compact: true, onClick: function onClick() { setLocalState(function (state) { return Object.assign(Object.assign({}, state), { isDefaultConnection: false }); }); } }, "Cancel"))) : ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Typography, null, "This will replace your existing default SSO connection."), /*#__PURE__*/ wn.createElement(Button, { variant: "ghost", compact: true, onClick: function onClick() { handleRequestSetDefault({ displayName: connection.display_name, id: connection.connection_id }); } }, "Set as default"))) : isDefaultConnection ? ( /*#__PURE__*/wn.createElement(Typography, null, "This connection is already set as the default.")) : ( /*#__PURE__*/wn.createElement(Typography, null, "This connection is not set as the default."))), /*#__PURE__*/ wn.createElement(SettingsSection, { title: "JIT provisioning via this connection", tooltipText: "If enabled, users who successfully authenticate through this SSO Connection will be automatically granted an account if they do not already exist within your organization." }, editing && canSetSsoJitProvisioning && (orgJitProvisioningPolicy === 'RESTRICTED' || orgJitProvisioningPolicy === 'NOT_ALLOWED') ? jitProvisioningEnabled ? ( /*#__PURE__*/wn.createElement(Button, { variant: "ghost", compact: true, onClick: function onClick() { setLocalState(function (state) { return Object.assign(Object.assign({}, state), { jitProvisioningEnabled: false }); }); }, warning: true }, "Disable")) : ( /*#__PURE__*/wn.createElement(Button, { variant: "ghost", compact: true, onClick: function onClick() { setLocalState(function (state) { return Object.assign(Object.assign({}, state), { jitProvisioningEnabled: true }); }); } }, "Enable")) : ( /*#__PURE__*/wn.createElement(Typography, null, orgJitProvisioningPolicy === 'ALL_ALLOWED' ? 'Enabled at the organization level for all SSO connections.' : !jitProvisioningEnabled || orgJitProvisioningPolicy === 'NOT_ALLOWED' ? 'Disabled' : 'Enabled')))); };
|
|
9335
|
+
var OrganizationUpdatesSection = function OrganizationUpdatesSection(_ref65) { var connection = _ref65.connection, defaultConnectionName = _ref65.defaultConnectionName, isDefaultConnection = _ref65.isDefaultConnection; var _useRbac3 = useRbac('stytch.organization', 'update.settings.default-sso-connection'), canSetDefaultConnection = _useRbac3.data; var _useRbac4 = useRbac('stytch.organization', 'update.settings.sso-jit-provisioning'), canSetSsoJitProvisioning = _useRbac4.data; var _useOrgInfo = useOrgInfo(), organization = _useOrgInfo.data; var orgJitProvisioningPolicy = organization === null || organization === void 0 ? void 0 : organization.sso_jit_provisioning; var remoteState = F$3(function () { return { isDefaultConnection: isDefaultConnection, jitProvisioningEnabled: !!(orgJitProvisioningPolicy === 'ALL_ALLOWED' || orgJitProvisioningPolicy === 'RESTRICTED' && (organization === null || organization === void 0 ? void 0 : organization.sso_jit_provisioning_allowed_connections.includes(connection.connection_id))) }; }, [connection.connection_id, isDefaultConnection, orgJitProvisioningPolicy, organization === null || organization === void 0 ? void 0 : organization.sso_jit_provisioning_allowed_connections]); var _useFormState2 = useFormState({ remoteState: remoteState }), localState = _useFormState2.localState, setLocalState = _useFormState2.setLocalState, editing = _useFormState2.editing, handleSetEditing = _useFormState2.handleSetEditing; var _useMutateDefaultConn2 = useMutateDefaultConnection(), setDefault = _useMutateDefaultConn2.setDefault; var _useMutateOrganizatio2 = useMutateOrganization(), mutate = _useMutateOrganizatio2.mutate; var handleSave = T$2(function () { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee11() { var _a, _b, promises, allowedConnections, _allowedConnections; return _regeneratorRuntime().wrap(function _callee11$(_context12) { while (1)
|
|
9182
9336
|
switch (_context12.prev = _context12.next) {
|
|
9183
9337
|
case 0:
|
|
9184
9338
|
if (organization) {
|
|
@@ -9209,39 +9363,454 @@ var OrganizationUpdatesSection = function OrganizationUpdatesSection(_ref64) { v
|
|
|
9209
9363
|
case 7:
|
|
9210
9364
|
case "end": return _context12.stop();
|
|
9211
9365
|
} }, _callee11); })); }, [connection.connection_id, connection.display_name, localState.isDefaultConnection, localState.jitProvisioningEnabled, mutate, orgJitProvisioningPolicy, organization, remoteState.isDefaultConnection, remoteState.jitProvisioningEnabled, setDefault]); var _useSsoRouterControll2 = useSsoRouterController(), useBlockNavigation = _useSsoRouterControll2.useBlockNavigation; return /*#__PURE__*/ wn.createElement(SettingsContainer, { title: "Organization updates", hasCTA: canSetDefaultConnection || canSetSsoJitProvisioning, onSave: handleSave, useBlockNavigation: useBlockNavigation, editing: editing, setEditing: handleSetEditing }, /*#__PURE__*/ wn.createElement(OrganizationUpdatesSectionBody, { connection: connection, defaultConnectionName: defaultConnectionName, orgJitProvisioningPolicy: orgJitProvisioningPolicy, remoteState: remoteState, localState: localState, setLocalState: setLocalState })); };
|
|
9212
|
-
|
|
9366
|
+
function _typeof(o) {
|
|
9367
|
+
"@babel/helpers - typeof";
|
|
9368
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o);
|
|
9369
|
+
}
|
|
9370
|
+
function toPrimitive(t, r) { if ("object" != _typeof(t) || !t)
|
|
9371
|
+
return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) {
|
|
9372
|
+
var i = e.call(t, r || "default");
|
|
9373
|
+
if ("object" != _typeof(i))
|
|
9374
|
+
return i;
|
|
9375
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
9376
|
+
} return ("string" === r ? String : Number)(t); }
|
|
9377
|
+
function toPropertyKey(t) { var i = toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9378
|
+
function _defineProperty(obj, key, value) { key = toPropertyKey(key); if (key in obj) {
|
|
9379
|
+
Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
|
|
9380
|
+
}
|
|
9381
|
+
else {
|
|
9382
|
+
obj[key] = value;
|
|
9383
|
+
} return obj; }
|
|
9384
|
+
var ArrowDropDownIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M7 10l5 5 5-5z" }));
|
|
9385
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr))
|
|
9386
|
+
return arr; }
|
|
9387
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) {
|
|
9388
|
+
var e, n, i, u, a = [], f = !0, o = !1;
|
|
9389
|
+
try {
|
|
9390
|
+
if (i = (t = t.call(r)).next, 0 === l)
|
|
9391
|
+
;
|
|
9392
|
+
else
|
|
9393
|
+
for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0)
|
|
9394
|
+
;
|
|
9395
|
+
}
|
|
9396
|
+
catch (r) {
|
|
9397
|
+
o = !0, n = r;
|
|
9398
|
+
}
|
|
9399
|
+
finally {
|
|
9400
|
+
try {
|
|
9401
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u))
|
|
9402
|
+
return;
|
|
9403
|
+
}
|
|
9404
|
+
finally {
|
|
9405
|
+
if (o)
|
|
9406
|
+
throw n;
|
|
9407
|
+
}
|
|
9408
|
+
}
|
|
9409
|
+
return a;
|
|
9410
|
+
} }
|
|
9411
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length)
|
|
9412
|
+
len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
9413
|
+
arr2[i] = arr[i]; return arr2; }
|
|
9414
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o)
|
|
9415
|
+
return; if (typeof o === "string")
|
|
9416
|
+
return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor)
|
|
9417
|
+
n = o.constructor.name; if (n === "Map" || n === "Set")
|
|
9418
|
+
return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
9419
|
+
return _arrayLikeToArray(o, minLen); }
|
|
9420
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9421
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9422
|
+
function stripDiacritics(string) { return typeof string.normalize !== 'undefined' ? string.normalize('NFD').replace(/[\u0300-\u036f]/g, '') : string; }
|
|
9423
|
+
function createFilterOptions() { var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _config$ignoreAccents = config.ignoreAccents, ignoreAccents = _config$ignoreAccents === void 0 ? true : _config$ignoreAccents, _config$ignoreCase = config.ignoreCase, ignoreCase = _config$ignoreCase === void 0 ? true : _config$ignoreCase, limit = config.limit, _config$matchFrom = config.matchFrom, matchFrom = _config$matchFrom === void 0 ? 'any' : _config$matchFrom, stringify = config.stringify, _config$trim = config.trim, trim = _config$trim === void 0 ? false : _config$trim; return function (options, _ref) { var inputValue = _ref.inputValue, getOptionLabel = _ref.getOptionLabel; var input = trim ? inputValue.trim() : inputValue; if (ignoreCase) {
|
|
9424
|
+
input = input.toLowerCase();
|
|
9425
|
+
} if (ignoreAccents) {
|
|
9426
|
+
input = stripDiacritics(input);
|
|
9427
|
+
} var filteredOptions = options.filter(function (option) { var candidate = (stringify || getOptionLabel)(option); if (ignoreCase) {
|
|
9428
|
+
candidate = candidate.toLowerCase();
|
|
9429
|
+
} if (ignoreAccents) {
|
|
9430
|
+
candidate = stripDiacritics(candidate);
|
|
9431
|
+
} return matchFrom === 'start' ? candidate.indexOf(input) === 0 : candidate.indexOf(input) > -1; }); return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions; }; }
|
|
9432
|
+
function findIndex(array, comp) { for (var i = 0; i < array.length; i += 1) {
|
|
9433
|
+
if (comp(array[i])) {
|
|
9434
|
+
return i;
|
|
9435
|
+
}
|
|
9436
|
+
} return -1; }
|
|
9437
|
+
var defaultFilterOptions = createFilterOptions();
|
|
9438
|
+
var pageSize = 5;
|
|
9439
|
+
function useAutocomplete(props) { var _props$autoComplete = props.autoComplete, autoComplete = _props$autoComplete === void 0 ? false : _props$autoComplete, _props$autoHighlight = props.autoHighlight, autoHighlight = _props$autoHighlight === void 0 ? false : _props$autoHighlight, _props$autoSelect = props.autoSelect, autoSelect = _props$autoSelect === void 0 ? false : _props$autoSelect, _props$blurOnSelect = props.blurOnSelect, blurOnSelect = _props$blurOnSelect === void 0 ? false : _props$blurOnSelect, _props$clearOnBlur = props.clearOnBlur, clearOnBlur = _props$clearOnBlur === void 0 ? !props.freeSolo : _props$clearOnBlur, _props$clearOnEscape = props.clearOnEscape, clearOnEscape = _props$clearOnEscape === void 0 ? false : _props$clearOnEscape, _props$componentName = props.componentName, componentName = _props$componentName === void 0 ? 'useAutocomplete' : _props$componentName, _props$debug = props.debug, debug = _props$debug === void 0 ? false : _props$debug, _props$defaultValue = props.defaultValue, defaultValue = _props$defaultValue === void 0 ? props.multiple ? [] : null : _props$defaultValue, _props$disableClearab = props.disableClearable, disableClearable = _props$disableClearab === void 0 ? false : _props$disableClearab, _props$disableCloseOn = props.disableCloseOnSelect, disableCloseOnSelect = _props$disableCloseOn === void 0 ? false : _props$disableCloseOn, _props$disabledItemsF = props.disabledItemsFocusable, disabledItemsFocusable = _props$disabledItemsF === void 0 ? false : _props$disabledItemsF, _props$disableListWra = props.disableListWrap, disableListWrap = _props$disableListWra === void 0 ? false : _props$disableListWra, _props$filterOptions = props.filterOptions, filterOptions = _props$filterOptions === void 0 ? defaultFilterOptions : _props$filterOptions, _props$filterSelected = props.filterSelectedOptions, filterSelectedOptions = _props$filterSelected === void 0 ? false : _props$filterSelected, _props$freeSolo = props.freeSolo, freeSolo = _props$freeSolo === void 0 ? false : _props$freeSolo, getOptionDisabled = props.getOptionDisabled, _props$getOptionLabel = props.getOptionLabel, getOptionLabelProp = _props$getOptionLabel === void 0 ? function (option) { return option; } : _props$getOptionLabel, _props$getOptionSelec = props.getOptionSelected, getOptionSelected = _props$getOptionSelec === void 0 ? function (option, value) { return option === value; } : _props$getOptionSelec, groupBy = props.groupBy, _props$handleHomeEndK = props.handleHomeEndKeys, handleHomeEndKeys = _props$handleHomeEndK === void 0 ? !props.freeSolo : _props$handleHomeEndK, idProp = props.id, _props$includeInputIn = props.includeInputInList, includeInputInList = _props$includeInputIn === void 0 ? false : _props$includeInputIn, inputValueProp = props.inputValue, _props$multiple = props.multiple, multiple = _props$multiple === void 0 ? false : _props$multiple, onChange = props.onChange, onClose = props.onClose, onHighlightChange = props.onHighlightChange, onInputChange = props.onInputChange, onOpen = props.onOpen, openProp = props.open, _props$openOnFocus = props.openOnFocus, openOnFocus = _props$openOnFocus === void 0 ? false : _props$openOnFocus, options = props.options, _props$selectOnFocus = props.selectOnFocus, selectOnFocus = _props$selectOnFocus === void 0 ? !props.freeSolo : _props$selectOnFocus, valueProp = props.value; var id = useId(idProp); var getOptionLabel = getOptionLabelProp; var ignoreFocus = _$1(false); var firstFocus = _$1(true); var inputRef = _$1(null); var listboxRef = _$1(null); var _React$useState = h$4(null), anchorEl = _React$useState[0], setAnchorEl = _React$useState[1]; var _React$useState2 = h$4(-1), focusedTag = _React$useState2[0], setFocusedTag = _React$useState2[1]; var defaultHighlighted = autoHighlight ? 0 : -1; var highlightedIndexRef = _$1(defaultHighlighted); var _useControlled = useControlled({ controlled: valueProp, "default": defaultValue, name: componentName }), _useControlled2 = _slicedToArray(_useControlled, 2), value = _useControlled2[0], setValue = _useControlled2[1]; var _useControlled3 = useControlled({ controlled: inputValueProp, "default": '', name: componentName, state: 'inputValue' }), _useControlled4 = _slicedToArray(_useControlled3, 2), inputValue = _useControlled4[0], setInputValue = _useControlled4[1]; var _React$useState3 = h$4(false), focused = _React$useState3[0], setFocused = _React$useState3[1]; var resetInputValue = useEventCallback(function (event, newValue) { var newInputValue; if (multiple) {
|
|
9440
|
+
newInputValue = '';
|
|
9441
|
+
}
|
|
9442
|
+
else if (newValue == null) {
|
|
9443
|
+
newInputValue = '';
|
|
9444
|
+
}
|
|
9445
|
+
else {
|
|
9446
|
+
var optionLabel = getOptionLabel(newValue);
|
|
9447
|
+
newInputValue = typeof optionLabel === 'string' ? optionLabel : '';
|
|
9448
|
+
} if (inputValue === newInputValue) {
|
|
9449
|
+
return;
|
|
9450
|
+
} setInputValue(newInputValue); if (onInputChange) {
|
|
9451
|
+
onInputChange(event, newInputValue, 'reset');
|
|
9452
|
+
} }); p$3(function () { resetInputValue(null, value); }, [value, resetInputValue]); var _useControlled5 = useControlled({ controlled: openProp, "default": false, name: componentName, state: 'open' }), _useControlled6 = _slicedToArray(_useControlled5, 2), open = _useControlled6[0], setOpenState = _useControlled6[1]; var inputValueIsSelectedValue = !multiple && value != null && inputValue === getOptionLabel(value); var popupOpen = open; var filteredOptions = popupOpen ? filterOptions(options.filter(function (option) { if (filterSelectedOptions && (multiple ? value : [value]).some(function (value2) { return value2 !== null && getOptionSelected(option, value2); })) {
|
|
9453
|
+
return false;
|
|
9454
|
+
} return true; }), { inputValue: inputValueIsSelectedValue ? '' : inputValue, getOptionLabel: getOptionLabel }) : []; var focusTag = useEventCallback(function (tagToFocus) { if (tagToFocus === -1) {
|
|
9455
|
+
inputRef.current.focus();
|
|
9456
|
+
}
|
|
9457
|
+
else {
|
|
9458
|
+
anchorEl.querySelector("[data-tag-index=\"".concat(tagToFocus, "\"]")).focus();
|
|
9459
|
+
} }); p$3(function () { if (multiple && focusedTag > value.length - 1) {
|
|
9460
|
+
setFocusedTag(-1);
|
|
9461
|
+
focusTag(-1);
|
|
9462
|
+
} }, [value, multiple, focusedTag, focusTag]); function validOptionIndex(index, direction) { if (!listboxRef.current || index === -1) {
|
|
9463
|
+
return -1;
|
|
9464
|
+
} var nextFocus = index; while (true) {
|
|
9465
|
+
if (direction === 'next' && nextFocus === filteredOptions.length || direction === 'previous' && nextFocus === -1) {
|
|
9466
|
+
return -1;
|
|
9467
|
+
}
|
|
9468
|
+
var option = listboxRef.current.querySelector("[data-option-index=\"".concat(nextFocus, "\"]"));
|
|
9469
|
+
var nextFocusDisabled = disabledItemsFocusable ? false : option && (option.disabled || option.getAttribute('aria-disabled') === 'true');
|
|
9470
|
+
if (option && !option.hasAttribute('tabindex') || nextFocusDisabled) {
|
|
9471
|
+
nextFocus += direction === 'next' ? 1 : -1;
|
|
9472
|
+
}
|
|
9473
|
+
else {
|
|
9474
|
+
return nextFocus;
|
|
9475
|
+
}
|
|
9476
|
+
} } var setHighlightedIndex = useEventCallback(function (_ref2) { var event = _ref2.event, index = _ref2.index, _ref2$reason = _ref2.reason, reason = _ref2$reason === void 0 ? 'auto' : _ref2$reason; highlightedIndexRef.current = index; if (index === -1) {
|
|
9477
|
+
inputRef.current.removeAttribute('aria-activedescendant');
|
|
9478
|
+
}
|
|
9479
|
+
else {
|
|
9480
|
+
inputRef.current.setAttribute('aria-activedescendant', "".concat(id, "-option-").concat(index));
|
|
9481
|
+
} if (onHighlightChange) {
|
|
9482
|
+
onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
|
|
9483
|
+
} if (!listboxRef.current) {
|
|
9484
|
+
return;
|
|
9485
|
+
} var prev = listboxRef.current.querySelector('[data-focus]'); if (prev) {
|
|
9486
|
+
prev.removeAttribute('data-focus');
|
|
9487
|
+
} var listboxNode = listboxRef.current.parentElement.querySelector('[role="listbox"]'); if (!listboxNode) {
|
|
9488
|
+
return;
|
|
9489
|
+
} if (index === -1) {
|
|
9490
|
+
listboxNode.scrollTop = 0;
|
|
9491
|
+
return;
|
|
9492
|
+
} var option = listboxRef.current.querySelector("[data-option-index=\"".concat(index, "\"]")); if (!option) {
|
|
9493
|
+
return;
|
|
9494
|
+
} option.setAttribute('data-focus', 'true'); if (listboxNode.scrollHeight > listboxNode.clientHeight && reason !== 'mouse') {
|
|
9495
|
+
var element = option;
|
|
9496
|
+
var scrollBottom = listboxNode.clientHeight + listboxNode.scrollTop;
|
|
9497
|
+
var elementBottom = element.offsetTop + element.offsetHeight;
|
|
9498
|
+
if (elementBottom > scrollBottom) {
|
|
9499
|
+
listboxNode.scrollTop = elementBottom - listboxNode.clientHeight;
|
|
9500
|
+
}
|
|
9501
|
+
else if (element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0) < listboxNode.scrollTop) {
|
|
9502
|
+
listboxNode.scrollTop = element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0);
|
|
9503
|
+
}
|
|
9504
|
+
} }); var changeHighlightedIndex = useEventCallback(function (_ref3) { var event = _ref3.event, diff = _ref3.diff, _ref3$direction = _ref3.direction, direction = _ref3$direction === void 0 ? 'next' : _ref3$direction, _ref3$reason = _ref3.reason, reason = _ref3$reason === void 0 ? 'auto' : _ref3$reason; if (!popupOpen) {
|
|
9505
|
+
return;
|
|
9506
|
+
} var getNextIndex = function getNextIndex() { var maxIndex = filteredOptions.length - 1; if (diff === 'reset') {
|
|
9507
|
+
return defaultHighlighted;
|
|
9508
|
+
} if (diff === 'start') {
|
|
9509
|
+
return 0;
|
|
9510
|
+
} if (diff === 'end') {
|
|
9511
|
+
return maxIndex;
|
|
9512
|
+
} var newIndex = highlightedIndexRef.current + diff; if (newIndex < 0) {
|
|
9513
|
+
if (newIndex === -1 && includeInputInList) {
|
|
9514
|
+
return -1;
|
|
9515
|
+
}
|
|
9516
|
+
if (disableListWrap && highlightedIndexRef.current !== -1 || Math.abs(diff) > 1) {
|
|
9517
|
+
return 0;
|
|
9518
|
+
}
|
|
9519
|
+
return maxIndex;
|
|
9520
|
+
} if (newIndex > maxIndex) {
|
|
9521
|
+
if (newIndex === maxIndex + 1 && includeInputInList) {
|
|
9522
|
+
return -1;
|
|
9523
|
+
}
|
|
9524
|
+
if (disableListWrap || Math.abs(diff) > 1) {
|
|
9525
|
+
return maxIndex;
|
|
9526
|
+
}
|
|
9527
|
+
return 0;
|
|
9528
|
+
} return newIndex; }; var nextIndex = validOptionIndex(getNextIndex(), direction); setHighlightedIndex({ index: nextIndex, reason: reason, event: event }); if (autoComplete && diff !== 'reset') {
|
|
9529
|
+
if (nextIndex === -1) {
|
|
9530
|
+
inputRef.current.value = inputValue;
|
|
9531
|
+
}
|
|
9532
|
+
else {
|
|
9533
|
+
var option = getOptionLabel(filteredOptions[nextIndex]);
|
|
9534
|
+
inputRef.current.value = option;
|
|
9535
|
+
var index = option.toLowerCase().indexOf(inputValue.toLowerCase());
|
|
9536
|
+
if (index === 0 && inputValue.length > 0) {
|
|
9537
|
+
inputRef.current.setSelectionRange(inputValue.length, option.length);
|
|
9538
|
+
}
|
|
9539
|
+
}
|
|
9540
|
+
} }); var syncHighlightedIndex = T$2(function () { if (!popupOpen) {
|
|
9541
|
+
return;
|
|
9542
|
+
} var valueItem = multiple ? value[0] : value; if (filteredOptions.length === 0 || valueItem == null) {
|
|
9543
|
+
changeHighlightedIndex({ diff: 'reset' });
|
|
9544
|
+
return;
|
|
9545
|
+
} if (!listboxRef.current) {
|
|
9546
|
+
return;
|
|
9547
|
+
} if (!filterSelectedOptions && valueItem != null) {
|
|
9548
|
+
var currentOption = filteredOptions[highlightedIndexRef.current];
|
|
9549
|
+
if (multiple && currentOption && findIndex(value, function (val) { return getOptionSelected(currentOption, val); }) !== -1) {
|
|
9550
|
+
return;
|
|
9551
|
+
}
|
|
9552
|
+
var itemIndex = findIndex(filteredOptions, function (optionItem) { return getOptionSelected(optionItem, valueItem); });
|
|
9553
|
+
if (itemIndex === -1) {
|
|
9554
|
+
changeHighlightedIndex({ diff: 'reset' });
|
|
9555
|
+
}
|
|
9556
|
+
else {
|
|
9557
|
+
setHighlightedIndex({ index: itemIndex });
|
|
9558
|
+
}
|
|
9559
|
+
return;
|
|
9560
|
+
} if (highlightedIndexRef.current >= filteredOptions.length - 1) {
|
|
9561
|
+
setHighlightedIndex({ index: filteredOptions.length - 1 });
|
|
9562
|
+
return;
|
|
9563
|
+
} setHighlightedIndex({ index: highlightedIndexRef.current }); }, [filteredOptions.length === 0, multiple ? false : value, filterSelectedOptions, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]); var handleListboxRef = useEventCallback(function (node) { setRef(listboxRef, node); if (!node) {
|
|
9564
|
+
return;
|
|
9565
|
+
} syncHighlightedIndex(); }); p$3(function () { syncHighlightedIndex(); }, [syncHighlightedIndex]); var handleOpen = function handleOpen(event) { if (open) {
|
|
9566
|
+
return;
|
|
9567
|
+
} setOpenState(true); if (onOpen) {
|
|
9568
|
+
onOpen(event);
|
|
9569
|
+
} }; var handleClose = function handleClose(event, reason) { if (!open) {
|
|
9570
|
+
return;
|
|
9571
|
+
} setOpenState(false); if (onClose) {
|
|
9572
|
+
onClose(event, reason);
|
|
9573
|
+
} }; var handleValue = function handleValue(event, newValue, reason, details) { if (value === newValue) {
|
|
9574
|
+
return;
|
|
9575
|
+
} if (onChange) {
|
|
9576
|
+
onChange(event, newValue, reason, details);
|
|
9577
|
+
} setValue(newValue); }; var isTouch = _$1(false); var selectNewValue = function selectNewValue(event, option) { var reasonProp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'select-option'; var origin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'options'; var reason = reasonProp; var newValue = option; if (multiple) {
|
|
9578
|
+
newValue = Array.isArray(value) ? value.slice() : [];
|
|
9579
|
+
var itemIndex = findIndex(newValue, function (valueItem) { return getOptionSelected(option, valueItem); });
|
|
9580
|
+
if (itemIndex === -1) {
|
|
9581
|
+
newValue.push(option);
|
|
9582
|
+
}
|
|
9583
|
+
else if (origin !== 'freeSolo') {
|
|
9584
|
+
newValue.splice(itemIndex, 1);
|
|
9585
|
+
reason = 'remove-option';
|
|
9586
|
+
}
|
|
9587
|
+
} resetInputValue(event, newValue); handleValue(event, newValue, reason, { option: option }); if (!disableCloseOnSelect) {
|
|
9588
|
+
handleClose(event, reason);
|
|
9589
|
+
} if (blurOnSelect === true || blurOnSelect === 'touch' && isTouch.current || blurOnSelect === 'mouse' && !isTouch.current) {
|
|
9590
|
+
inputRef.current.blur();
|
|
9591
|
+
} }; function validTagIndex(index, direction) { if (index === -1) {
|
|
9592
|
+
return -1;
|
|
9593
|
+
} var nextFocus = index; while (true) {
|
|
9594
|
+
if (direction === 'next' && nextFocus === value.length || direction === 'previous' && nextFocus === -1) {
|
|
9595
|
+
return -1;
|
|
9596
|
+
}
|
|
9597
|
+
var option = anchorEl.querySelector("[data-tag-index=\"".concat(nextFocus, "\"]"));
|
|
9598
|
+
if (option && (!option.hasAttribute('tabindex') || option.disabled || option.getAttribute('aria-disabled') === 'true')) {
|
|
9599
|
+
nextFocus += direction === 'next' ? 1 : -1;
|
|
9600
|
+
}
|
|
9601
|
+
else {
|
|
9602
|
+
return nextFocus;
|
|
9603
|
+
}
|
|
9604
|
+
} } var handleFocusTag = function handleFocusTag(event, direction) { if (!multiple) {
|
|
9605
|
+
return;
|
|
9606
|
+
} handleClose(event, 'toggleInput'); var nextTag = focusedTag; if (focusedTag === -1) {
|
|
9607
|
+
if (inputValue === '' && direction === 'previous') {
|
|
9608
|
+
nextTag = value.length - 1;
|
|
9609
|
+
}
|
|
9610
|
+
}
|
|
9611
|
+
else {
|
|
9612
|
+
nextTag += direction === 'next' ? 1 : -1;
|
|
9613
|
+
if (nextTag < 0) {
|
|
9614
|
+
nextTag = 0;
|
|
9615
|
+
}
|
|
9616
|
+
if (nextTag === value.length) {
|
|
9617
|
+
nextTag = -1;
|
|
9618
|
+
}
|
|
9619
|
+
} nextTag = validTagIndex(nextTag, direction); setFocusedTag(nextTag); focusTag(nextTag); }; var handleClear = function handleClear(event) { ignoreFocus.current = true; setInputValue(''); if (onInputChange) {
|
|
9620
|
+
onInputChange(event, '', 'clear');
|
|
9621
|
+
} handleValue(event, multiple ? [] : null, 'clear'); }; var handleKeyDown = function handleKeyDown(other) { return function (event) { if (focusedTag !== -1 && ['ArrowLeft', 'ArrowRight'].indexOf(event.key) === -1) {
|
|
9622
|
+
setFocusedTag(-1);
|
|
9623
|
+
focusTag(-1);
|
|
9624
|
+
} switch (event.key) {
|
|
9625
|
+
case 'Home':
|
|
9626
|
+
if (popupOpen && handleHomeEndKeys) {
|
|
9627
|
+
event.preventDefault();
|
|
9628
|
+
changeHighlightedIndex({ diff: 'start', direction: 'next', reason: 'keyboard', event: event });
|
|
9629
|
+
}
|
|
9630
|
+
break;
|
|
9631
|
+
case 'End':
|
|
9632
|
+
if (popupOpen && handleHomeEndKeys) {
|
|
9633
|
+
event.preventDefault();
|
|
9634
|
+
changeHighlightedIndex({ diff: 'end', direction: 'previous', reason: 'keyboard', event: event });
|
|
9635
|
+
}
|
|
9636
|
+
break;
|
|
9637
|
+
case 'PageUp':
|
|
9638
|
+
event.preventDefault();
|
|
9639
|
+
changeHighlightedIndex({ diff: -pageSize, direction: 'previous', reason: 'keyboard', event: event });
|
|
9640
|
+
handleOpen(event);
|
|
9641
|
+
break;
|
|
9642
|
+
case 'PageDown':
|
|
9643
|
+
event.preventDefault();
|
|
9644
|
+
changeHighlightedIndex({ diff: pageSize, direction: 'next', reason: 'keyboard', event: event });
|
|
9645
|
+
handleOpen(event);
|
|
9646
|
+
break;
|
|
9647
|
+
case 'ArrowDown':
|
|
9648
|
+
event.preventDefault();
|
|
9649
|
+
changeHighlightedIndex({ diff: 1, direction: 'next', reason: 'keyboard', event: event });
|
|
9650
|
+
handleOpen(event);
|
|
9651
|
+
break;
|
|
9652
|
+
case 'ArrowUp':
|
|
9653
|
+
event.preventDefault();
|
|
9654
|
+
changeHighlightedIndex({ diff: -1, direction: 'previous', reason: 'keyboard', event: event });
|
|
9655
|
+
handleOpen(event);
|
|
9656
|
+
break;
|
|
9657
|
+
case 'ArrowLeft':
|
|
9658
|
+
handleFocusTag(event, 'previous');
|
|
9659
|
+
break;
|
|
9660
|
+
case 'ArrowRight':
|
|
9661
|
+
handleFocusTag(event, 'next');
|
|
9662
|
+
break;
|
|
9663
|
+
case 'Enter':
|
|
9664
|
+
if (event.which === 229) {
|
|
9665
|
+
break;
|
|
9666
|
+
}
|
|
9667
|
+
if (highlightedIndexRef.current !== -1 && popupOpen) {
|
|
9668
|
+
var option = filteredOptions[highlightedIndexRef.current];
|
|
9669
|
+
var disabled = getOptionDisabled ? getOptionDisabled(option) : false;
|
|
9670
|
+
event.preventDefault();
|
|
9671
|
+
if (disabled) {
|
|
9672
|
+
return;
|
|
9673
|
+
}
|
|
9674
|
+
selectNewValue(event, option, 'select-option');
|
|
9675
|
+
if (autoComplete) {
|
|
9676
|
+
inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);
|
|
9677
|
+
}
|
|
9678
|
+
}
|
|
9679
|
+
else if (freeSolo && inputValue !== '' && inputValueIsSelectedValue === false) {
|
|
9680
|
+
if (multiple) {
|
|
9681
|
+
event.preventDefault();
|
|
9682
|
+
}
|
|
9683
|
+
selectNewValue(event, inputValue, 'create-option', 'freeSolo');
|
|
9684
|
+
}
|
|
9685
|
+
break;
|
|
9686
|
+
case 'Escape':
|
|
9687
|
+
if (popupOpen) {
|
|
9688
|
+
event.preventDefault();
|
|
9689
|
+
event.stopPropagation();
|
|
9690
|
+
handleClose(event, 'escape');
|
|
9691
|
+
}
|
|
9692
|
+
else if (clearOnEscape && (inputValue !== '' || multiple && value.length > 0)) {
|
|
9693
|
+
event.preventDefault();
|
|
9694
|
+
event.stopPropagation();
|
|
9695
|
+
handleClear(event);
|
|
9696
|
+
}
|
|
9697
|
+
break;
|
|
9698
|
+
case 'Backspace':
|
|
9699
|
+
if (multiple && inputValue === '' && value.length > 0) {
|
|
9700
|
+
var index = focusedTag === -1 ? value.length - 1 : focusedTag;
|
|
9701
|
+
var newValue = value.slice();
|
|
9702
|
+
newValue.splice(index, 1);
|
|
9703
|
+
handleValue(event, newValue, 'remove-option', { option: value[index] });
|
|
9704
|
+
}
|
|
9705
|
+
break;
|
|
9706
|
+
} if (other.onKeyDown) {
|
|
9707
|
+
other.onKeyDown(event);
|
|
9708
|
+
} }; }; var handleFocus = function handleFocus(event) { setFocused(true); if (openOnFocus && !ignoreFocus.current) {
|
|
9709
|
+
handleOpen(event);
|
|
9710
|
+
} }; var handleBlur = function handleBlur(event) { if (listboxRef.current !== null && document.activeElement === listboxRef.current.parentElement) {
|
|
9711
|
+
inputRef.current.focus();
|
|
9712
|
+
return;
|
|
9713
|
+
} setFocused(false); firstFocus.current = true; ignoreFocus.current = false; if (debug && inputValue !== '') {
|
|
9714
|
+
return;
|
|
9715
|
+
} if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen) {
|
|
9716
|
+
selectNewValue(event, filteredOptions[highlightedIndexRef.current], 'blur');
|
|
9717
|
+
}
|
|
9718
|
+
else if (autoSelect && freeSolo && inputValue !== '') {
|
|
9719
|
+
selectNewValue(event, inputValue, 'blur', 'freeSolo');
|
|
9720
|
+
}
|
|
9721
|
+
else if (clearOnBlur) {
|
|
9722
|
+
resetInputValue(event, value);
|
|
9723
|
+
} handleClose(event, 'blur'); }; var handleInputChange = function handleInputChange(event) { var newValue = event.target.value; if (inputValue !== newValue) {
|
|
9724
|
+
setInputValue(newValue);
|
|
9725
|
+
if (onInputChange) {
|
|
9726
|
+
onInputChange(event, newValue, 'input');
|
|
9727
|
+
}
|
|
9728
|
+
} if (newValue === '') {
|
|
9729
|
+
if (!disableClearable && !multiple) {
|
|
9730
|
+
handleValue(event, null, 'clear');
|
|
9731
|
+
}
|
|
9732
|
+
}
|
|
9733
|
+
else {
|
|
9734
|
+
handleOpen(event);
|
|
9735
|
+
} }; var handleOptionMouseOver = function handleOptionMouseOver(event) { setHighlightedIndex({ event: event, index: Number(event.currentTarget.getAttribute('data-option-index')), reason: 'mouse' }); }; var handleOptionTouchStart = function handleOptionTouchStart() { isTouch.current = true; }; var handleOptionClick = function handleOptionClick(event) { var index = Number(event.currentTarget.getAttribute('data-option-index')); selectNewValue(event, filteredOptions[index], 'select-option'); isTouch.current = false; }; var handleTagDelete = function handleTagDelete(index) { return function (event) { var newValue = value.slice(); newValue.splice(index, 1); handleValue(event, newValue, 'remove-option', { option: value[index] }); }; }; var handlePopupIndicator = function handlePopupIndicator(event) { if (open) {
|
|
9736
|
+
handleClose(event, 'toggleInput');
|
|
9737
|
+
}
|
|
9738
|
+
else {
|
|
9739
|
+
handleOpen(event);
|
|
9740
|
+
} }; var handleMouseDown = function handleMouseDown(event) { if (event.target.getAttribute('id') !== id) {
|
|
9741
|
+
event.preventDefault();
|
|
9742
|
+
} }; var handleClick = function handleClick() { inputRef.current.focus(); if (selectOnFocus && firstFocus.current && inputRef.current.selectionEnd - inputRef.current.selectionStart === 0) {
|
|
9743
|
+
inputRef.current.select();
|
|
9744
|
+
} firstFocus.current = false; }; var handleInputMouseDown = function handleInputMouseDown(event) { if (inputValue === '' || !open) {
|
|
9745
|
+
handlePopupIndicator(event);
|
|
9746
|
+
} }; var dirty = freeSolo && inputValue.length > 0; dirty = dirty || (multiple ? value.length > 0 : value !== null); var groupedOptions = filteredOptions; if (groupBy) {
|
|
9747
|
+
groupedOptions = filteredOptions.reduce(function (acc, option, index) { var group = groupBy(option); if (acc.length > 0 && acc[acc.length - 1].group === group) {
|
|
9748
|
+
acc[acc.length - 1].options.push(option);
|
|
9749
|
+
}
|
|
9750
|
+
else {
|
|
9751
|
+
acc.push({ key: index, index: index, group: group, options: [option] });
|
|
9752
|
+
} return acc; }, []);
|
|
9753
|
+
} return { getRootProps: function getRootProps() { var other = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _extends({ 'aria-owns': popupOpen ? "".concat(id, "-popup") : null, role: 'combobox', 'aria-expanded': popupOpen }, other, { onKeyDown: handleKeyDown(other), onMouseDown: handleMouseDown, onClick: handleClick }); }, getInputLabelProps: function getInputLabelProps() { return { id: "".concat(id, "-label"), htmlFor: id }; }, getInputProps: function getInputProps() { return { id: id, value: inputValue, onBlur: handleBlur, onFocus: handleFocus, onChange: handleInputChange, onMouseDown: handleInputMouseDown, 'aria-activedescendant': popupOpen ? '' : null, 'aria-autocomplete': autoComplete ? 'both' : 'list', 'aria-controls': popupOpen ? "".concat(id, "-popup") : null, autoComplete: 'off', ref: inputRef, autoCapitalize: 'none', spellCheck: 'false' }; }, getClearProps: function getClearProps() { return { tabIndex: -1, onClick: handleClear }; }, getPopupIndicatorProps: function getPopupIndicatorProps() { return { tabIndex: -1, onClick: handlePopupIndicator }; }, getTagProps: function getTagProps(_ref4) { var index = _ref4.index; return { key: index, 'data-tag-index': index, tabIndex: -1, onDelete: handleTagDelete(index) }; }, getListboxProps: function getListboxProps() { return { role: 'listbox', id: "".concat(id, "-popup"), 'aria-labelledby': "".concat(id, "-label"), ref: handleListboxRef, onMouseDown: function onMouseDown(event) { event.preventDefault(); } }; }, getOptionProps: function getOptionProps(_ref5) { var index = _ref5.index, option = _ref5.option; var selected = (multiple ? value : [value]).some(function (value2) { return value2 != null && getOptionSelected(option, value2); }); var disabled = getOptionDisabled ? getOptionDisabled(option) : false; return { key: index, tabIndex: -1, role: 'option', id: "".concat(id, "-option-").concat(index), onMouseOver: handleOptionMouseOver, onClick: handleOptionClick, onTouchStart: handleOptionTouchStart, 'data-option-index': index, 'aria-disabled': disabled, 'aria-selected': selected }; }, id: id, inputValue: inputValue, value: value, dirty: dirty, popupOpen: popupOpen, focused: focused || focusedTag !== -1, anchorEl: anchorEl, setAnchorEl: setAnchorEl, focusedTag: focusedTag, groupedOptions: groupedOptions }; }
|
|
9754
|
+
var styles = function styles(theme) { var _option; return { root: { '&$focused $clearIndicatorDirty': { visibility: 'visible' }, '@media (pointer: fine)': { '&:hover $clearIndicatorDirty': { visibility: 'visible' } } }, fullWidth: { width: '100%' }, focused: {}, tag: { margin: 3, maxWidth: 'calc(100% - 6px)' }, tagSizeSmall: { margin: 2, maxWidth: 'calc(100% - 4px)' }, hasPopupIcon: {}, hasClearIcon: {}, inputRoot: { flexWrap: 'wrap', '$hasPopupIcon &, $hasClearIcon &': { paddingRight: 26 + 4 }, '$hasPopupIcon$hasClearIcon &': { paddingRight: 52 + 4 }, '& $input': { width: 0, minWidth: 30 }, '&[class*="MuiInput-root"]': { paddingBottom: 1, '& $input': { padding: 4 }, '& $input:first-child': { padding: '6px 0' } }, '&[class*="MuiInput-root"][class*="MuiInput-marginDense"]': { '& $input': { padding: '4px 4px 5px' }, '& $input:first-child': { padding: '3px 0 6px' } }, '&[class*="MuiOutlinedInput-root"]': { padding: 9, '$hasPopupIcon &, $hasClearIcon &': { paddingRight: 26 + 4 + 9 }, '$hasPopupIcon$hasClearIcon &': { paddingRight: 52 + 4 + 9 }, '& $input': { padding: '9.5px 4px' }, '& $input:first-child': { paddingLeft: 6 }, '& $endAdornment': { right: 9 } }, '&[class*="MuiOutlinedInput-root"][class*="MuiOutlinedInput-marginDense"]': { padding: 6, '& $input': { padding: '4.5px 4px' } }, '&[class*="MuiFilledInput-root"]': { paddingTop: 19, paddingLeft: 8, '$hasPopupIcon &, $hasClearIcon &': { paddingRight: 26 + 4 + 9 }, '$hasPopupIcon$hasClearIcon &': { paddingRight: 52 + 4 + 9 }, '& $input': { padding: '9px 4px' }, '& $endAdornment': { right: 9 } }, '&[class*="MuiFilledInput-root"][class*="MuiFilledInput-marginDense"]': { paddingBottom: 1, '& $input': { padding: '4.5px 4px' } } }, input: { flexGrow: 1, textOverflow: 'ellipsis', opacity: 0 }, inputFocused: { opacity: 1 }, endAdornment: { position: 'absolute', right: 0, top: 'calc(50% - 14px)' }, clearIndicator: { marginRight: -2, padding: 4, visibility: 'hidden' }, clearIndicatorDirty: {}, popupIndicator: { padding: 2, marginRight: -2 }, popupIndicatorOpen: { transform: 'rotate(180deg)' }, popper: { zIndex: theme.zIndex.modal }, popperDisablePortal: { position: 'absolute' }, paper: _extends({}, theme.typography.body1, { overflow: 'hidden', margin: '4px 0' }), listbox: { listStyle: 'none', margin: 0, padding: '8px 0', maxHeight: '40vh', overflow: 'auto' }, loading: { color: theme.palette.text.secondary, padding: '14px 16px' }, noOptions: { color: theme.palette.text.secondary, padding: '14px 16px' }, option: (_option = { minHeight: 48, display: 'flex', justifyContent: 'flex-start', alignItems: 'center', cursor: 'pointer', paddingTop: 6, boxSizing: 'border-box', outline: '0', WebkitTapHighlightColor: 'transparent', paddingBottom: 6, paddingLeft: 16, paddingRight: 16 }, _defineProperty(_option, theme.breakpoints.up('sm'), { minHeight: 'auto' }), _defineProperty(_option, '&[aria-selected="true"]', { backgroundColor: theme.palette.action.selected }), _defineProperty(_option, '&[data-focus="true"]', { backgroundColor: theme.palette.action.hover }), _defineProperty(_option, '&:active', { backgroundColor: theme.palette.action.selected }), _defineProperty(_option, '&[aria-disabled="true"]', { opacity: theme.palette.action.disabledOpacity, pointerEvents: 'none' }), _option), groupLabel: { backgroundColor: theme.palette.background.paper, top: -8 }, groupUl: { padding: 0, '& $option': { paddingLeft: 24 } } }; };
|
|
9755
|
+
function DisablePortal(props) { props.anchorEl; props.open; var other = _objectWithoutProperties(props, ["anchorEl", "open"]); return /*#__PURE__*/ y$3("div", other); }
|
|
9756
|
+
var _ref = /*#__PURE__*/ y$3(CloseIcon, { fontSize: "small" });
|
|
9757
|
+
var _ref2 = /*#__PURE__*/ y$3(ArrowDropDownIcon, null);
|
|
9758
|
+
var Autocomplete$1 = /*#__PURE__*/ N$1(function Autocomplete(props, ref) { props.autoComplete; props.autoHighlight; props.autoSelect; props.blurOnSelect; var ChipProps = props.ChipProps, classes = props.classes, className = props.className, _props$clearOnBlur = props.clearOnBlur; _props$clearOnBlur === void 0 ? !props.freeSolo : _props$clearOnBlur; props.clearOnEscape; var _props$clearText = props.clearText, clearText = _props$clearText === void 0 ? 'Clear' : _props$clearText, _props$closeIcon = props.closeIcon, closeIcon = _props$closeIcon === void 0 ? _ref : _props$closeIcon, _props$closeText = props.closeText, closeText = _props$closeText === void 0 ? 'Close' : _props$closeText; props.debug; var _props$defaultValue = props.defaultValue; _props$defaultValue === void 0 ? props.multiple ? [] : null : _props$defaultValue; var _props$disableClearab = props.disableClearable, disableClearable = _props$disableClearab === void 0 ? false : _props$disableClearab; props.disableCloseOnSelect; var _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled; props.disabledItemsFocusable; props.disableListWrap; var _props$disablePortal = props.disablePortal, disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal; props.filterOptions; props.filterSelectedOptions; var _props$forcePopupIcon = props.forcePopupIcon, forcePopupIcon = _props$forcePopupIcon === void 0 ? 'auto' : _props$forcePopupIcon, _props$freeSolo = props.freeSolo, freeSolo = _props$freeSolo === void 0 ? false : _props$freeSolo, _props$fullWidth = props.fullWidth, fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth, _props$getLimitTagsTe = props.getLimitTagsText, getLimitTagsText = _props$getLimitTagsTe === void 0 ? function (more) { return "+".concat(more); } : _props$getLimitTagsTe; props.getOptionDisabled; var _props$getOptionLabel = props.getOptionLabel, getOptionLabel = _props$getOptionLabel === void 0 ? function (x) { return x; } : _props$getOptionLabel; props.getOptionSelected; var groupBy = props.groupBy, _props$handleHomeEndK = props.handleHomeEndKeys; _props$handleHomeEndK === void 0 ? !props.freeSolo : _props$handleHomeEndK; props.id; props.includeInputInList; props.inputValue; var _props$limitTags = props.limitTags, limitTags = _props$limitTags === void 0 ? -1 : _props$limitTags, _props$ListboxCompone = props.ListboxComponent, ListboxComponent = _props$ListboxCompone === void 0 ? 'ul' : _props$ListboxCompone, ListboxProps = props.ListboxProps, _props$loading = props.loading, loading = _props$loading === void 0 ? false : _props$loading, _props$loadingText = props.loadingText, loadingText = _props$loadingText === void 0 ? 'Loading…' : _props$loadingText, _props$multiple = props.multiple, multiple = _props$multiple === void 0 ? false : _props$multiple, _props$noOptionsText = props.noOptionsText, noOptionsText = _props$noOptionsText === void 0 ? 'No options' : _props$noOptionsText; props.onChange; props.onClose; props.onHighlightChange; props.onInputChange; props.onOpen; props.open; props.openOnFocus; var _props$openText = props.openText, openText = _props$openText === void 0 ? 'Open' : _props$openText; props.options; var _props$PaperComponent = props.PaperComponent, PaperComponent = _props$PaperComponent === void 0 ? Paper$1 : _props$PaperComponent, _props$PopperComponen = props.PopperComponent, PopperComponentProp = _props$PopperComponen === void 0 ? Popper : _props$PopperComponen, _props$popupIcon = props.popupIcon, popupIcon = _props$popupIcon === void 0 ? _ref2 : _props$popupIcon, renderGroupProp = props.renderGroup, renderInput = props.renderInput, renderOptionProp = props.renderOption, renderTags = props.renderTags, _props$selectOnFocus = props.selectOnFocus; _props$selectOnFocus === void 0 ? !props.freeSolo : _props$selectOnFocus; var _props$size = props.size, size = _props$size === void 0 ? 'medium' : _props$size; props.value; var other = _objectWithoutProperties(props, ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "classes", "className", "clearOnBlur", "clearOnEscape", "clearText", "closeIcon", "closeText", "debug", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "getOptionSelected", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"]); var PopperComponent = disablePortal ? DisablePortal : PopperComponentProp; var _useAutocomplete = useAutocomplete(_extends({}, props, { componentName: 'Autocomplete' })), getRootProps = _useAutocomplete.getRootProps, getInputProps = _useAutocomplete.getInputProps, getInputLabelProps = _useAutocomplete.getInputLabelProps, getPopupIndicatorProps = _useAutocomplete.getPopupIndicatorProps, getClearProps = _useAutocomplete.getClearProps, getTagProps = _useAutocomplete.getTagProps, getListboxProps = _useAutocomplete.getListboxProps, getOptionProps = _useAutocomplete.getOptionProps, value = _useAutocomplete.value, dirty = _useAutocomplete.dirty, id = _useAutocomplete.id, popupOpen = _useAutocomplete.popupOpen, focused = _useAutocomplete.focused, focusedTag = _useAutocomplete.focusedTag, anchorEl = _useAutocomplete.anchorEl, setAnchorEl = _useAutocomplete.setAnchorEl, inputValue = _useAutocomplete.inputValue, groupedOptions = _useAutocomplete.groupedOptions; var startAdornment; if (multiple && value.length > 0) {
|
|
9759
|
+
var getCustomizedTagProps = function getCustomizedTagProps(params) { return _extends({ className: clsx(classes.tag, size === 'small' && classes.tagSizeSmall), disabled: disabled }, getTagProps(params)); };
|
|
9760
|
+
if (renderTags) {
|
|
9761
|
+
startAdornment = renderTags(value, getCustomizedTagProps);
|
|
9762
|
+
}
|
|
9763
|
+
else {
|
|
9764
|
+
startAdornment = value.map(function (option, index) { return /*#__PURE__*/ y$3(Chip$1, _extends({ label: getOptionLabel(option), size: size }, getCustomizedTagProps({ index: index }), ChipProps)); });
|
|
9765
|
+
}
|
|
9766
|
+
} if (limitTags > -1 && Array.isArray(startAdornment)) {
|
|
9767
|
+
var more = startAdornment.length - limitTags;
|
|
9768
|
+
if (!focused && more > 0) {
|
|
9769
|
+
startAdornment = startAdornment.splice(0, limitTags);
|
|
9770
|
+
startAdornment.push(/*#__PURE__*/ y$3("span", { className: classes.tag, key: startAdornment.length }, getLimitTagsText(more)));
|
|
9771
|
+
}
|
|
9772
|
+
} var defaultRenderGroup = function defaultRenderGroup(params) { return /*#__PURE__*/ y$3("li", { key: params.key }, /*#__PURE__*/ y$3(ListSubheader$1, { className: classes.groupLabel, component: "div" }, params.group), /*#__PURE__*/ y$3("ul", { className: classes.groupUl }, params.children)); }; var renderGroup = renderGroupProp || defaultRenderGroup; var renderOption = renderOptionProp || getOptionLabel; var renderListOption = function renderListOption(option, index) { var optionProps = getOptionProps({ option: option, index: index }); return /*#__PURE__*/ y$3("li", _extends({}, optionProps, { className: classes.option }), renderOption(option, { selected: optionProps['aria-selected'], inputValue: inputValue })); }; var hasClearIcon = !disableClearable && !disabled; var hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false; return /*#__PURE__*/ y$3(g$5, null, /*#__PURE__*/ y$3("div", _extends({ ref: ref, className: clsx(classes.root, className, focused && classes.focused, fullWidth && classes.fullWidth, hasClearIcon && classes.hasClearIcon, hasPopupIcon && classes.hasPopupIcon) }, getRootProps(other)), renderInput({ id: id, disabled: disabled, fullWidth: true, size: size === 'small' ? 'small' : undefined, InputLabelProps: getInputLabelProps(), InputProps: { ref: setAnchorEl, className: classes.inputRoot, startAdornment: startAdornment, endAdornment: /*#__PURE__*/ y$3("div", { className: classes.endAdornment }, hasClearIcon ? /*#__PURE__*/ y$3(IconButton$1, _extends({}, getClearProps(), { "aria-label": clearText, title: clearText, className: clsx(classes.clearIndicator, dirty && classes.clearIndicatorDirty) }), closeIcon) : null, hasPopupIcon ? /*#__PURE__*/ y$3(IconButton$1, _extends({}, getPopupIndicatorProps(), { disabled: disabled, "aria-label": popupOpen ? closeText : openText, title: popupOpen ? closeText : openText, className: clsx(classes.popupIndicator, popupOpen && classes.popupIndicatorOpen) }), popupIcon) : null) }, inputProps: _extends({ className: clsx(classes.input, focusedTag === -1 && classes.inputFocused), disabled: disabled }, getInputProps()) })), popupOpen && anchorEl ? /*#__PURE__*/ y$3(PopperComponent, { className: clsx(classes.popper, disablePortal && classes.popperDisablePortal), style: { width: anchorEl ? anchorEl.clientWidth : null }, role: "presentation", anchorEl: anchorEl, open: true }, /*#__PURE__*/ y$3(PaperComponent, { className: classes.paper }, loading && groupedOptions.length === 0 ? /*#__PURE__*/ y$3("div", { className: classes.loading }, loadingText) : null, groupedOptions.length === 0 && !freeSolo && !loading ? /*#__PURE__*/ y$3("div", { className: classes.noOptions }, noOptionsText) : null, groupedOptions.length > 0 ? /*#__PURE__*/ y$3(ListboxComponent, _extends({ className: classes.listbox }, getListboxProps(), ListboxProps), groupedOptions.map(function (option, index) { if (groupBy) {
|
|
9773
|
+
return renderGroup({ key: option.key, group: option.group, children: option.options.map(function (option2, index2) { return renderListOption(option2, option.index + index2); }) });
|
|
9774
|
+
} return renderListOption(option, index); })) : null)) : null); });
|
|
9775
|
+
var MuiAutocomplete = withStyles(styles, { name: 'MuiAutocomplete' })(Autocomplete$1);
|
|
9776
|
+
var AutocompleteTag = function AutocompleteTag(_a) { var children = _a.children, onDelete = _a.onDelete, props = __rest(_a, ["children", "onDelete"]); return /*#__PURE__*/ wn.createElement(Tag, Object.assign({}, props, { size: "sm" }), /*#__PURE__*/ wn.createElement(FlexBox, { gap: 0.5, alignItems: "center" }, children, onDelete && ( /*#__PURE__*/wn.createElement(IconButton$1, { size: "small", onClick: onDelete }, /*#__PURE__*/ wn.createElement(default_1$b, { fontSize: "inherit" }))))); };
|
|
9777
|
+
var Input = function Input(props) { return /*#__PURE__*/ wn.createElement(TextField$1, Object.assign({}, props, { variant: "outlined" })); };
|
|
9778
|
+
var useStyles$7 = makeStyles(function (theme) { return { autocomplete: { '& .MuiInputBase-root': { padding: theme.spacing(1), gap: theme.spacing(0.5) }, '& .MuiOutlinedInput-input.MuiAutocomplete-input': { padding: 0, height: 24, '&::placeholder': { color: theme.styleConfig.inputs.placeholderColor, opacity: 1 } }, '& .MuiOutlinedInput-notchedOutline': { border: '1px solid', borderRadius: theme.styleConfig.inputs.borderRadius, borderColor: theme.styleConfig.inputs.borderColor }, '&:hover .MuiOutlinedInput-notchedOutline, &.Mui-focused .MuiOutlinedInput-notchedOutline': { borderWidth: 1, borderColor: theme.styleConfig.inputs.borderColor }, '& .MuiAutocomplete-endAdornment .MuiIconButton-root': { fontSize: 20 } } }; });
|
|
9779
|
+
var defaultGetOptionLabel = function defaultGetOptionLabel(item) { return item; };
|
|
9780
|
+
var Autocomplete = function Autocomplete(_ref66) { var caption = _ref66.caption, fullWidth = _ref66.fullWidth, _ref66$getOptionLabel = _ref66.getOptionLabel, getOptionLabel = _ref66$getOptionLabel === void 0 ? defaultGetOptionLabel : _ref66$getOptionLabel, id = _ref66.id, label = _ref66.label, _onChange = _ref66.onChange, placeholder = _ref66.placeholder, required = _ref66.required, selectItems = _ref66.selectItems, value = _ref66.value; var selectId = useShortId(id); var _h49 = h$4(false), _h50 = _slicedToArray2(_h49, 2), isOpen = _h50[0], setIsOpen = _h50[1]; var autocompleteClasses = useStyles$7(); var selectClasses = useStyles$b(); return /*#__PURE__*/ wn.createElement("div", { className: C(selectClasses.selectContainer, _defineProperty2({}, selectClasses.fullWidth, fullWidth)) }, label && ( /*#__PURE__*/wn.createElement(Label, { htmlFor: selectId, required: required }, label)), /*#__PURE__*/ wn.createElement(MuiAutocomplete, { popupIcon: /*#__PURE__*/ wn.createElement(default_1$3, null), className: autocompleteClasses.autocomplete, fullWidth: true, id: selectId, multiple: true, onChange: function onChange(_, value) { _onChange === null || _onChange === void 0 ? void 0 : _onChange(value); }, onClose: function onClose() { return setIsOpen(false); }, onOpen: function onOpen() { return setIsOpen(true); }, open: isOpen, value: value, options: selectItems, getOptionLabel: getOptionLabel, renderOption: function renderOption(option, state) { return /*#__PURE__*/ wn.createElement(FlexBox, { gap: 0.5, alignItems: "center" }, /*#__PURE__*/ wn.createElement(default_1$5, { fontSize: "small", style: { visibility: state.selected ? 'visible' : 'hidden' }, "aria-visibility": state.selected }), getOptionLabel(option)); }, renderInput: function renderInput(params) { return /*#__PURE__*/ wn.createElement(Input, Object.assign({}, params, { placeholder: placeholder })); }, renderTags: function renderTags(value, getTagProps) { return value.map(function (option, index) { return /*#__PURE__*/ wn.createElement(AutocompleteTag, Object.assign({}, getTagProps({ index: index })), getOptionLabel(option)); }); } }), caption && /*#__PURE__*/ wn.createElement(Typography$2, { variant: "body2" }, caption)); };
|
|
9781
|
+
var ArrowRight = {};
|
|
9213
9782
|
var _interopRequireDefault$1 = interopRequireDefaultExports;
|
|
9214
9783
|
var _interopRequireWildcard$1 = interopRequireWildcardExports;
|
|
9215
|
-
Object.defineProperty(
|
|
9216
|
-
var default_1$1 =
|
|
9784
|
+
Object.defineProperty(ArrowRight, "__esModule", { value: true });
|
|
9785
|
+
var default_1$1 = ArrowRight["default"] = void 0;
|
|
9217
9786
|
var React$1 = _interopRequireWildcard$1(require$$2);
|
|
9218
9787
|
var _createSvgIcon$1 = _interopRequireDefault$1(requireCreateSvgIcon());
|
|
9219
|
-
var _default$1 = (0, _createSvgIcon$1["default"])(/*#__PURE__*/ React$1.createElement("path", { d: "M10
|
|
9220
|
-
default_1$1 =
|
|
9788
|
+
var _default$1 = (0, _createSvgIcon$1["default"])(/*#__PURE__*/ React$1.createElement("path", { d: "M10 17l5-5-5-5v10z" }), 'ArrowRight');
|
|
9789
|
+
default_1$1 = ArrowRight["default"] = _default$1;
|
|
9221
9790
|
var TABLE_CONTAINER_ID = 'table-container';
|
|
9222
9791
|
var EXPANDED_CONTENT_CLASSNAME = 'expanded-content';
|
|
9223
9792
|
var leftAlignExpandedContent = function leftAlignExpandedContent(containerId) { var container = document.getElementById(containerId); var expandedContentDivs = document.querySelectorAll("#".concat(containerId, " .").concat(EXPANDED_CONTENT_CLASSNAME)); expandedContentDivs.forEach(function (expandedContent) { expandedContent.style.marginLeft = (container === null || container === void 0 ? void 0 : container.scrollLeft) + 'px'; }); };
|
|
9224
|
-
var makeTableStyles = makeStylesFactory(function (theme) { return { tableCell: { padding: theme.spacing(0.5, 1), minWidth: 80 }, tableHeader: {}, tableWithExpandedContent: { '& tr td:nth-child(2), & tr th:nth-child(2)': { paddingLeft: theme.spacing(0) } }, tableWithActions: { width: 'calc(100% - 2px)' }, tableActionsCell: { position: 'sticky', right: 0, width: '1%' }, tableHeaderActionsCell: {}, cellWithExpandedContent: { borderBottom: 'none' }, expandMoreCell: { padding: theme.spacing(0, 0, 0, 1), width: theme.spacing(4.5), minWidth: 'unset' }, openChevron: { transform: 'rotate(90deg)' }, expandedRow: {}, expandedContentCell: { padding: 0 }, expandedContentContainer: { padding: theme.spacing(0.5, 2, 1) }, clickable: { cursor: 'pointer' } }; });
|
|
9793
|
+
var makeTableStyles = makeStylesFactory(function (theme) { return { tableCell: { padding: theme.spacing(0.5, 1), minWidth: 80 }, tableHeader: {}, tableWithExpandedContent: { '& tr td:nth-child(2), & tr th:nth-child(2)': { paddingLeft: theme.spacing(0) } }, tableWithActions: { width: 'calc(100% - 2px)' }, tableActionsCell: { position: 'sticky', right: 0, width: '1%' }, tableHeaderActionsCell: {}, cellWithExpandedContent: { borderBottom: 'none' }, expandMoreCell: { padding: theme.spacing(0, 0, 0, 1), width: theme.spacing(4.5), minWidth: 'unset' }, openChevron: { transform: 'rotate(90deg)' }, expandedRow: {}, expandedContentCell: { padding: 0 }, expandedContentContainer: { padding: theme.spacing(0.5, 2, 1) }, clickable: { cursor: 'pointer' }, tableRow: {} }; });
|
|
9225
9794
|
var TableCell = function TableCell(_a) { var children = _a.children, className = _a.className, classes = _a.classes, Typography = _a.TypographyComponent, props = __rest(_a, ["children", "className", "classes", "TypographyComponent"]); var value = getTableCellValue(children); return /*#__PURE__*/ wn.createElement(MUITableCell, Object.assign({ className: C(classes.tableCell, className) }, props), typeof value === 'string' ? /*#__PURE__*/ wn.createElement(Typography, null, value) : children); };
|
|
9226
|
-
var TableRow = function TableRow(
|
|
9795
|
+
var TableRow = function TableRow(_ref67) { var id = _ref67.id, ExpandedContent = _ref67.ExpandedContent, item = _ref67.item, itemRenderer = _ref67.itemRenderer, onRowClick = _ref67.onRowClick, tableWidth = _ref67.tableWidth, tableContainerId = _ref67.tableContainerId, getItemActionProps = _ref67.getItemActionProps, classes = _ref67.classes, TableActions = _ref67.TableActionsComponent, Typography = _ref67.TypographyComponent; var _h51 = h$4(false), _h52 = _slicedToArray2(_h51, 2), open = _h52[0], setOpen = _h52[1]; p$3(function () { if (open) {
|
|
9227
9796
|
leftAlignExpandedContent(tableContainerId);
|
|
9228
9797
|
} }, [open, tableContainerId]); var toggleOpen = function toggleOpen(e) { e.stopPropagation(); setOpen(function (prev) { return !prev; }); }; var handleRowClick = function handleRowClick(e) { if (onRowClick) {
|
|
9229
9798
|
onRowClick(id);
|
|
9230
9799
|
}
|
|
9231
9800
|
else if (ExpandedContent) {
|
|
9232
9801
|
toggleOpen(e);
|
|
9233
|
-
} }; return /*#__PURE__*/ wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(MUITableRow, { className: C(_defineProperty2(_defineProperty2({}, classes.expandedRow, open), classes.clickable, !!onRowClick)), onClick: handleRowClick, style: { width: 'fit-content' } }, ExpandedContent && ( /*#__PURE__*/wn.createElement(TableCell, { TypographyComponent: Typography, className: C(classes.expandMoreCell, _defineProperty2({}, classes.cellWithExpandedContent, !!ExpandedContent)), classes: classes }, /*#__PURE__*/ wn.createElement(IconButton$1, { "aria-label": "expand row", onClick: toggleOpen, size: "small" }, /*#__PURE__*/ wn.createElement(default_1$1, { className: open ? classes.openChevron :
|
|
9234
|
-
var TableCore = function TableCore(
|
|
9802
|
+
} }; return /*#__PURE__*/ wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(MUITableRow, { className: C(_defineProperty2(_defineProperty2({}, classes.expandedRow, open), classes.clickable, !!onRowClick), classes.tableRow), onClick: handleRowClick, style: { width: 'fit-content' } }, ExpandedContent && ( /*#__PURE__*/wn.createElement(TableCell, { TypographyComponent: Typography, className: C(classes.expandMoreCell, _defineProperty2({}, classes.cellWithExpandedContent, !!ExpandedContent)), classes: classes }, /*#__PURE__*/ wn.createElement(IconButton$1, { "aria-label": "expand row", onClick: toggleOpen, size: "small" }, ExpandedContent && /*#__PURE__*/ wn.createElement(default_1$1, { className: open ? classes.openChevron : undefined })))), itemRenderer.map(function (column) { return /*#__PURE__*/ wn.createElement(TableCell, { TypographyComponent: Typography, className: C(_defineProperty2({}, classes.cellWithExpandedContent, !!ExpandedContent)), classes: classes, key: "row-".concat(id, "-col-").concat(String(column.title)) }, column.getValue(item)); }), getItemActionProps && ( /*#__PURE__*/wn.createElement(TableCell, { TypographyComponent: Typography, className: C(classes.tableCell, classes.tableActionsCell), classes: classes }, /*#__PURE__*/ wn.createElement(TableActions, Object.assign({}, getItemActionProps(item)))))), ExpandedContent && ( /*#__PURE__*/wn.createElement(MUITableRow, null, /*#__PURE__*/ wn.createElement(TableCell, { TypographyComponent: Typography, className: C(classes.expandedRow, classes.expandedContentCell), classes: classes, colSpan: itemRenderer.length + 1 }, /*#__PURE__*/ wn.createElement(Collapse$1, { "in": open, timeout: "auto", unmountOnExit: true }, /*#__PURE__*/ wn.createElement("div", { className: "".concat(EXPANDED_CONTENT_CLASSNAME, " ").concat(classes.expandedContentContainer), style: { width: tableWidth } }, /*#__PURE__*/ wn.createElement(ExpandedContent, { data: item }))))))); };
|
|
9803
|
+
var TableCore = function TableCore(_ref68) { var ExpandedContent = _ref68.ExpandedContent, itemRenderer = _ref68.itemRenderer, items = _ref68.items, rowKeyExtractor = _ref68.rowKeyExtractor, onRowClick = _ref68.onRowClick, getItemActionProps = _ref68.getItemActionProps, classes = _ref68.classes, TableActions = _ref68.TableActionsComponent, Typography = _ref68.TypographyComponent, disableBottomBorder = _ref68.disableBottomBorder; var containerId = useShortId(TABLE_CONTAINER_ID); var _h53 = h$4(), _h54 = _slicedToArray2(_h53, 2), setTableWidth = _h54[1]; p$3(function () { var _a; var container = document.getElementById(containerId); var originalTableWidth = (_a = document.querySelector("#".concat(containerId, " thead"))) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width; function handleScroll() { if (!originalTableWidth || !container)
|
|
9235
9804
|
return; var tableWidth = container.getBoundingClientRect().width; if (originalTableWidth - container.scrollLeft + 16 >= tableWidth) {
|
|
9236
9805
|
leftAlignExpandedContent(containerId);
|
|
9237
|
-
} } function handleResize() { var _a; setTableWidth((_a = container === null || container === void 0 ? void 0 : container.getBoundingClientRect().width) !== null && _a !== void 0 ? _a : 0); handleScroll(); } handleResize(); window.addEventListener('resize', handleResize); container === null || container === void 0 ? void 0 : container.addEventListener('scroll', handleScroll); return function () { container === null || container === void 0 ? void 0 : container.removeEventListener('scroll', handleScroll); window.removeEventListener('resize', handleResize); }; }, [containerId]); validateRowKey(items, rowKeyExtractor); return /*#__PURE__*/ wn.createElement(TableContainer$1, { id: containerId }, /*#__PURE__*/ wn.createElement(MUITable, { className: C(_defineProperty2(_defineProperty2({}, classes.tableWithExpandedContent, !!ExpandedContent), classes.tableWithActions, !!getItemActionProps)) }, /*#__PURE__*/ wn.createElement(TableHead$1, null, /*#__PURE__*/ wn.createElement(MUITableRow, null, ExpandedContent && ( /*#__PURE__*/wn.createElement(TableCell, { TypographyComponent: Typography, className: C(classes.expandMoreCell, classes.tableHeader), classes: classes }, /*#__PURE__*/ wn.createElement(wn.Fragment, null))), itemRenderer.map(function (column) { return /*#__PURE__*/ wn.createElement(TableCell, { TypographyComponent: Typography, className: classes.tableHeader, classes: classes, key: "col-header-".concat(String(column.title)) }, /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, column.title)); }), getItemActionProps && ( /*#__PURE__*/wn.createElement(TableCell, { TypographyComponent: Typography, className: C(classes.tableCell, classes.tableActionsCell, classes.tableHeader, classes.tableHeaderActionsCell), classes: classes }, /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, TABLE_ACTIONS_HEADER))))), /*#__PURE__*/ wn.createElement(TableBody$1, null, items.map(function (item) { var id = rowKeyExtractor ? rowKeyExtractor(item) : item.id; return /*#__PURE__*/ wn.createElement(TableRow, { ExpandedContent: ExpandedContent, TableActionsComponent: TableActions, TypographyComponent: Typography, classes: classes, getItemActionProps: getItemActionProps, id: id, item: item, itemRenderer: itemRenderer, key: id, onRowClick: onRowClick, tableContainerId: containerId,
|
|
9238
|
-
var useStyles$
|
|
9239
|
-
var Table = function Table(props) { var classes = useStyles$
|
|
9240
|
-
var TagList = function TagList(
|
|
9241
|
-
var RoleAssignmentsSectionBody = function RoleAssignmentsSectionBody(
|
|
9242
|
-
var roleAssignmentKeyExtractor = function roleAssignmentKeyExtractor(
|
|
9243
|
-
var roleAssignmentItemRenderer = [{ title: 'Group', getValue: function getValue(
|
|
9244
|
-
var RoleAssignmentsSection = function RoleAssignmentsSection(
|
|
9806
|
+
} } function handleResize() { var _a; setTableWidth((_a = container === null || container === void 0 ? void 0 : container.getBoundingClientRect().width) !== null && _a !== void 0 ? _a : 0); handleScroll(); } handleResize(); window.addEventListener('resize', handleResize); container === null || container === void 0 ? void 0 : container.addEventListener('scroll', handleScroll); return function () { container === null || container === void 0 ? void 0 : container.removeEventListener('scroll', handleScroll); window.removeEventListener('resize', handleResize); }; }, [containerId]); validateRowKey(items, rowKeyExtractor); return /*#__PURE__*/ wn.createElement(TableContainer$1, { id: containerId }, /*#__PURE__*/ wn.createElement(MUITable, { className: C(_defineProperty2(_defineProperty2({}, classes.tableWithExpandedContent, !!ExpandedContent), classes.tableWithActions, !!getItemActionProps)) }, /*#__PURE__*/ wn.createElement(TableHead$1, null, /*#__PURE__*/ wn.createElement(MUITableRow, null, ExpandedContent && ( /*#__PURE__*/wn.createElement(TableCell, { TypographyComponent: Typography, className: C(classes.expandMoreCell, classes.tableHeader), classes: classes }, /*#__PURE__*/ wn.createElement(wn.Fragment, null))), itemRenderer.map(function (column) { return /*#__PURE__*/ wn.createElement(TableCell, { TypographyComponent: Typography, className: classes.tableHeader, classes: classes, key: "col-header-".concat(String(column.title)) }, /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, column.title)); }), getItemActionProps && ( /*#__PURE__*/wn.createElement(TableCell, { TypographyComponent: Typography, className: C(classes.tableCell, classes.tableActionsCell, classes.tableHeader, classes.tableHeaderActionsCell), classes: classes }, /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, TABLE_ACTIONS_HEADER))))), /*#__PURE__*/ wn.createElement(TableBody$1, null, items.map(function (item) { var id = rowKeyExtractor ? rowKeyExtractor(item) : item.id; return /*#__PURE__*/ wn.createElement(TableRow, { ExpandedContent: ExpandedContent, TableActionsComponent: TableActions, TypographyComponent: Typography, classes: classes, getItemActionProps: getItemActionProps, id: id, item: item, itemRenderer: itemRenderer, key: id, onRowClick: onRowClick, tableContainerId: containerId, disableBottomBorder: disableBottomBorder }); })))); };
|
|
9807
|
+
var useStyles$6 = makeTableStyles(function (theme) { return { tableCell: { borderBottomColor: theme.styleConfig.colors.subtle, color: theme.styleConfig.colors.primary }, tableActionsCell: { minWidth: 0 }, tableHeaderActionsCell: { '& > *': { position: 'absolute', left: -10000, top: 'auto', width: 1, height: 1, overflow: 'hidden' } }, tableRow: function tableRow(_ref69) { var disableBottomBorder = _ref69.disableBottomBorder; return disableBottomBorder ? { '&:last-child th, &:last-child td': { borderBottom: 0 } } : {}; }, expandMoreCell: { padding: 0, width: theme.spacing(2) }, expandedContentContainer: { padding: theme.spacing(1, 2, 1, 2) } }; });
|
|
9808
|
+
var Table = function Table(props) { var classes = useStyles$6(props); return /*#__PURE__*/ wn.createElement(TableCore, Object.assign({}, props, { TableActionsComponent: TableActions, TypographyComponent: Typography, classes: classes })); };
|
|
9809
|
+
var TagList = function TagList(_ref70) { var tags = _ref70.tags; return /*#__PURE__*/ wn.createElement("ul", { style: { listStyle: 'none', padding: 0, margin: 0, display: 'flex', gap: 8 } }, tags.map(function (tag) { return /*#__PURE__*/ wn.createElement("li", { key: tag }, /*#__PURE__*/ wn.createElement(Tag, null, tag)); })); };
|
|
9810
|
+
var RoleAssignmentsSectionBody = function RoleAssignmentsSectionBody(_ref71) { var connection = _ref71.connection, localState = _ref71.localState, setLocalState = _ref71.setLocalState, remoteState = _ref71.remoteState; var _a, _b; var _useSettingsContainer3 = useSettingsContainer(), editing = _useSettingsContainer3.editing; var _ref72 = editing ? localState : remoteState, connectionRoleIds = _ref72.connectionRoleIds, groupedRoles = _ref72.groupedRoles; var hasGroupAttributeMapping = !!((_a = connection.attribute_mapping) === null || _a === void 0 ? void 0 : _a.groups); var roles = (_b = useB2BInternals().bootstrap.getSync().rbacPolicy) === null || _b === void 0 ? void 0 : _b.roles; var rolesSelectItems = F$3(function () { var _a; return (_a = roles === null || roles === void 0 ? void 0 : roles.map(function (_ref73) { var role_id = _ref73.role_id; return role_id; })) !== null && _a !== void 0 ? _a : []; }, [roles]); var handleAddGroupRole = T$2(function () { setLocalState(function (state) { return Object.assign(Object.assign({}, state), { groupedRoles: [].concat(_toConsumableArray2(state.groupedRoles), [{ group: '', roleIds: [] }]) }); }); }, [setLocalState]); var handleConnectionRolesChange = T$2(function (value) { return setLocalState(function (state) { return Object.assign(Object.assign({}, state), { connectionRoleIds: value }); }); }, [setLocalState]); var _getIdpInfo = getIdpInfo(connection.identity_provider, 'saml'), idp = _getIdpInfo.idp; return /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 2 }, /*#__PURE__*/ wn.createElement(SettingsSection, { title: "Connection Roles", tooltipText: "Connection Roles are automatically assigned to all Members who authenticate via this SSO connection." }, editing ? ( /*#__PURE__*/wn.createElement(Autocomplete, { selectItems: rolesSelectItems, value: connectionRoleIds, onChange: handleConnectionRolesChange })) : connection.saml_connection_implicit_role_assignments.length > 0 ? ( /*#__PURE__*/wn.createElement(TagList, { tags: connection.saml_connection_implicit_role_assignments.map(function (_ref74) { var role_id = _ref74.role_id; return role_id; }) })) : ( /*#__PURE__*/wn.createElement(Typography, null, "No roles assigned."))), /*#__PURE__*/ wn.createElement(SettingsSection, { title: "Group Roles", tooltipText: "If a Member is part of a group, they will be assigned both the Connection Role and their Group Role." }, hasGroupAttributeMapping ? editing ? ( /*#__PURE__*/wn.createElement(wn.Fragment, null, groupedRoles.map(function (_ref75, i) { var group = _ref75.group, roleIds = _ref75.roleIds; return /*#__PURE__*/ wn.createElement(FlexBox, { key: i, alignItems: "stretch", justifyContent: "space-between" }, /*#__PURE__*/ wn.createElement(Input$1, { label: "Group name", fullWidth: true, value: group, onChange: function onChange(value) { setLocalState(function (state) { return Object.assign(Object.assign({}, state), { groupedRoles: state.groupedRoles.map(function (item, index) { return index === i ? Object.assign(Object.assign({}, item), { group: value }) : item; }) }); }); } }), /*#__PURE__*/ wn.createElement(Autocomplete, { label: "Group Role", selectItems: rolesSelectItems, value: roleIds, fullWidth: true, onChange: function onChange(values) { setLocalState(function (state) { return Object.assign(Object.assign({}, state), { groupedRoles: state.groupedRoles.map(function (item, index) { return index === i ? Object.assign(Object.assign({}, item), { roleIds: values }) : item; }) }); }); } })); }), /*#__PURE__*/ wn.createElement(Button, { variant: "text", startIcon: /*#__PURE__*/ wn.createElement(Add, null), onClick: handleAddGroupRole }, "Add group roles"))) : groupedRoles.length > 0 ? ( /*#__PURE__*/wn.createElement(Table, { items: groupedRoles, rowKeyExtractor: roleAssignmentKeyExtractor, itemRenderer: roleAssignmentItemRenderer })) : ( /*#__PURE__*/wn.createElement(Typography, null, "No roles assigned.")) : ( /*#__PURE__*/wn.createElement(Typography, null, "Add a \"groups\" key in the ", idp.attributeMappingLabel, " first to assign group roles.")))); };
|
|
9811
|
+
var roleAssignmentKeyExtractor = function roleAssignmentKeyExtractor(_ref76) { var group = _ref76.group; return group; };
|
|
9812
|
+
var roleAssignmentItemRenderer = [{ title: 'Group', getValue: function getValue(_ref77) { var group = _ref77.group; return /*#__PURE__*/ wn.createElement(Typography, { color: "secondary" }, group); } }, { title: 'Role', getValue: function getValue(_ref78) { var roleIds = _ref78.roleIds; return /*#__PURE__*/ wn.createElement(TagList, { tags: roleIds }); } }];
|
|
9813
|
+
var RoleAssignmentsSection = function RoleAssignmentsSection(_ref79) { var canUpdateConnection = _ref79.canUpdateConnection, connection = _ref79.connection; var connectionRoleIds = F$3(function () { return connection.saml_connection_implicit_role_assignments.map(function (_ref80) { var role_id = _ref80.role_id; return role_id; }); }, [connection.saml_connection_implicit_role_assignments]); var groupedRoles = F$3(function () { return Object.values(connection.saml_group_implicit_role_assignments.reduce(function (acc, _ref81) { var group = _ref81.group, role_id = _ref81.role_id; if (!acc[group]) {
|
|
9245
9814
|
acc[group] = { group: group, roleIds: [] };
|
|
9246
9815
|
} acc[group].roleIds.push(role_id); return acc; }, {})); }, [connection.saml_group_implicit_role_assignments]); var remoteState = F$3(function () { return { connectionRoleIds: connectionRoleIds, groupedRoles: groupedRoles }; }, [connectionRoleIds, groupedRoles]); var _useFormState3 = useFormState({ remoteState: remoteState }), localState = _useFormState3.localState, setLocalState = _useFormState3.setLocalState, editing = _useFormState3.editing, handleSetEditing = _useFormState3.handleSetEditing; var _useMutateSamlConnect = useMutateSamlConnection(), mutate = _useMutateSamlConnect.mutate; var handleSave = T$2(function () { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee12() { var baseOptions, mutatedProperties, filteredGroupRoles; return _regeneratorRuntime().wrap(function _callee12$(_context13) { while (1)
|
|
9247
9816
|
switch (_context13.prev = _context13.next) {
|
|
@@ -9251,9 +9820,9 @@ var RoleAssignmentsSection = function RoleAssignmentsSection(_ref76) { var canUp
|
|
|
9251
9820
|
if (!deepEqual(remoteState.connectionRoleIds, localState.connectionRoleIds)) {
|
|
9252
9821
|
mutatedProperties.saml_connection_implicit_role_assignments = localState.connectionRoleIds.map(function (role_id) { return { role_id: role_id }; });
|
|
9253
9822
|
}
|
|
9254
|
-
filteredGroupRoles = localState.groupedRoles.filter(function (
|
|
9823
|
+
filteredGroupRoles = localState.groupedRoles.filter(function (_ref82) { var group = _ref82.group, roleIds = _ref82.roleIds; return group && roleIds.length > 0; });
|
|
9255
9824
|
if (!deepEqual(remoteState.groupedRoles, filteredGroupRoles)) {
|
|
9256
|
-
mutatedProperties.saml_group_implicit_role_assignments = filteredGroupRoles.flatMap(function (
|
|
9825
|
+
mutatedProperties.saml_group_implicit_role_assignments = filteredGroupRoles.flatMap(function (_ref83) { var group = _ref83.group, roleIds = _ref83.roleIds; return roleIds.map(function (role_id) { return { group: group, role_id: role_id }; }); });
|
|
9257
9826
|
}
|
|
9258
9827
|
if (!(Object.keys(mutatedProperties).length > 0)) {
|
|
9259
9828
|
_context13.next = 7;
|
|
@@ -9264,9 +9833,9 @@ var RoleAssignmentsSection = function RoleAssignmentsSection(_ref76) { var canUp
|
|
|
9264
9833
|
case 8:
|
|
9265
9834
|
case "end": return _context13.stop();
|
|
9266
9835
|
} }, _callee12); })); }, [connection.connection_id, localState.connectionRoleIds, localState.groupedRoles, mutate, remoteState.connectionRoleIds, remoteState.groupedRoles]); var _useSsoRouterControll3 = useSsoRouterController(), useBlockNavigation = _useSsoRouterControll3.useBlockNavigation; return /*#__PURE__*/ wn.createElement(SettingsContainer, { title: "Role assignments", hasCTA: canUpdateConnection, onSave: handleSave, useBlockNavigation: useBlockNavigation, editing: editing, setEditing: handleSetEditing }, /*#__PURE__*/ wn.createElement(RoleAssignmentsSectionBody, { connection: connection, localState: localState, remoteState: remoteState, setLocalState: setLocalState })); };
|
|
9267
|
-
var SSOConnectionDetailsScreen = function SSOConnectionDetailsScreen(
|
|
9836
|
+
var SSOConnectionDetailsScreen = function SSOConnectionDetailsScreen(_ref84) { var connectionId = _ref84.connectionId; var _a, _b; var _useSsoRouterControll4 = useSsoRouterController(), navigate = _useSsoRouterControll4.navigate; var _useRbac5 = useRbac('stytch.sso', 'get'), canGetConnection = _useRbac5.data; var _useRbac6 = useRbac('stytch.sso', 'delete'), canDeleteConnection = _useRbac6.data; var _useRbac7 = useRbac('stytch.sso', 'update'), canUpdateConnection = _useRbac7.data; var _useSsoConnections = useSsoConnections(!!canGetConnection), connections = _useSsoConnections.data, isLoading = _useSsoConnections.isLoading; var _useOrgInfo2 = useOrgInfo(), orgInfo = _useOrgInfo2.data; var defaultConnectionId = orgInfo === null || orgInfo === void 0 ? void 0 : orgInfo.sso_default_connection_id; var defaultConnectionName = F$3(function () { var _a; return connections ? (_a = [].concat(_toConsumableArray2(connections.oidc_connections), _toConsumableArray2(connections.saml_connections)).find(function (connection) { return connection.connection_id === defaultConnectionId; })) === null || _a === void 0 ? void 0 : _a.display_name : undefined; }, [connections, defaultConnectionId]); var connection = F$3(function () { var _a, _b; var oidcMatch = (_a = connections === null || connections === void 0 ? void 0 : connections.oidc_connections) === null || _a === void 0 ? void 0 : _a.find(function (_ref85) { var connection_id = _ref85.connection_id; return connection_id === connectionId; }); if (oidcMatch) {
|
|
9268
9837
|
return Object.assign(Object.assign({}, oidcMatch), { connectionType: 'oidc' });
|
|
9269
|
-
} var samlMatch = (_b = connections === null || connections === void 0 ? void 0 : connections.saml_connections) === null || _b === void 0 ? void 0 : _b.find(function (
|
|
9838
|
+
} var samlMatch = (_b = connections === null || connections === void 0 ? void 0 : connections.saml_connections) === null || _b === void 0 ? void 0 : _b.find(function (_ref86) { var connection_id = _ref86.connection_id; return connection_id === connectionId; }); if (samlMatch) {
|
|
9270
9839
|
return Object.assign(Object.assign({}, samlMatch), { connectionType: 'saml' });
|
|
9271
9840
|
} return null; }, [connectionId, connections === null || connections === void 0 ? void 0 : connections.oidc_connections, connections === null || connections === void 0 ? void 0 : connections.saml_connections]); var connectionType = connection === null || connection === void 0 ? void 0 : connection.connectionType; var connectionName = connection === null || connection === void 0 ? void 0 : connection.display_name; var isDefaultConnection = (connection === null || connection === void 0 ? void 0 : connection.connection_id) === defaultConnectionId; var isOnlyConnection = ((_a = connections === null || connections === void 0 ? void 0 : connections.oidc_connections.length) !== null && _a !== void 0 ? _a : 0) + ((_b = connections === null || connections === void 0 ? void 0 : connections.saml_connections.length) !== null && _b !== void 0 ? _b : 0) === 1; var _useDeleteConnection = useDeleteConnection({ onConfirm: function onConfirm() { navigate({ screen: 'connectionsList' }); } }), handleRequestDelete = _useDeleteConnection.handleRequestDelete, modalProps = _useDeleteConnection.modalProps; var handleDeleteClick = T$2(function () { if (connectionId && connectionName) {
|
|
9272
9841
|
handleRequestDelete({ id: connectionId, displayName: connectionName });
|
|
@@ -9274,10 +9843,10 @@ var SSOConnectionDetailsScreen = function SSOConnectionDetailsScreen(_ref81) { v
|
|
|
9274
9843
|
var ActionMenuItem = function ActionMenuItem(_a) { var children = _a.children, onClick = _a.onClick, onClose = _a.onClose, color = _a.color, icon = _a.icon, item = _a.item, rest = __rest(_a, ["children", "onClick", "onClose", "color", "icon", "item"]); var handleClick = T$2(function () { onClick(item); onClose(); }, [item, onClick, onClose]); return /*#__PURE__*/ wn.createElement(MenuItem$2, Object.assign({}, rest, { disableRipple: true, onClick: handleClick }), /*#__PURE__*/ wn.createElement(Typography, { color: color }, /*#__PURE__*/ wn.createElement(FlexBox, null, icon, children))); };
|
|
9275
9844
|
var anchorOrigin = { horizontal: 'center', vertical: 'bottom' };
|
|
9276
9845
|
var transformOrigin = { horizontal: 'right', vertical: 'top' };
|
|
9277
|
-
var ActionMenu = function ActionMenu(
|
|
9846
|
+
var ActionMenu = function ActionMenu(_ref87) { var actions = _ref87.actions, item = _ref87.item, idPrefix = _ref87.idPrefix; var _h55 = h$4(), _h56 = _slicedToArray2(_h55, 2), anchorEl = _h56[0], setAnchorEl = _h56[1]; var handleClose = T$2(function () { setAnchorEl(undefined); }, []); var handleOpen = T$2(function (e) { setAnchorEl(e.currentTarget); }, []); var id = useShortId(idPrefix); var children = F$3(function () { return actions.map(function (_ref88) { var key = _ref88.key, label = _ref88.label, onClick = _ref88.onClick, icon = _ref88.icon, isDangerous = _ref88.isDangerous, _ref88$isVisible = _ref88.isVisible, isVisible = _ref88$isVisible === void 0 ? true : _ref88$isVisible; if (!isVisible || typeof isVisible === 'function' && !isVisible(item)) {
|
|
9278
9847
|
return null;
|
|
9279
9848
|
} return /*#__PURE__*/ wn.createElement(ActionMenuItem, { key: key, item: item, onClick: onClick, onClose: handleClose, color: isDangerous ? 'error' : undefined, icon: icon }, label); }); }, [actions, handleClose, item]); var isOpen = !!anchorEl; return /*#__PURE__*/ wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(IconButton$1, { disableTouchRipple: true, "aria-label": "actions", color: "inherit", onClick: handleOpen, "aria-controls": id, "aria-haspopup": true }, /*#__PURE__*/ wn.createElement(MoreVert, null)), /*#__PURE__*/ wn.createElement(Menu$1, { id: id, open: isOpen, anchorEl: anchorEl, getContentAnchorEl: null, variant: "menu", anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, onClose: handleClose }, children)); };
|
|
9280
|
-
var useActionMenu = function useActionMenu(
|
|
9849
|
+
var useActionMenu = function useActionMenu(_ref89) { var actions = _ref89.actions, idPrefix = _ref89.idPrefix; var getItemActionProps = T$2(function (item) { var hasVisibleActions = actions.some(function (_ref90) { var _ref90$isVisible = _ref90.isVisible, isVisible = _ref90$isVisible === void 0 ? true : _ref90$isVisible; return typeof isVisible === 'function' ? isVisible(item) : isVisible; }); if (!hasVisibleActions) {
|
|
9281
9850
|
return {};
|
|
9282
9851
|
} return { customAction: /*#__PURE__*/ wn.createElement(ActionMenu, { actions: actions, item: item, idPrefix: "".concat(idPrefix, "-action-menu-").concat(item.id) }) }; }, [actions, idPrefix]); return { getItemActionProps: getItemActionProps }; };
|
|
9283
9852
|
var DEFAULT_TABLE_ROWS_PER_PAGE = 20;
|
|
@@ -9285,7 +9854,8 @@ var LOAD_NEXT_PAGE_ERROR = 'Failed to load the next page.';
|
|
|
9285
9854
|
var ZERO_RESULTS_MESSAGE = 'No results found.';
|
|
9286
9855
|
var PAGINATED_TABLE_ID = 'paginated-table';
|
|
9287
9856
|
var makePaginatedTableStyles = makeStylesFactory(function (theme) { return { tablePagination: { '& .MuiTablePagination-actions .MuiIconButton-root': { padding: theme.spacing(1) }, alignItems: 'center', display: 'flex', justifyContent: 'flex-end', padding: 0 }, paginationBoder: { borderTopWidth: 1, borderTopStyle: 'solid' }, emptyTable: { alignItems: 'flex-start', display: 'flex', justifyContent: 'center', padding: theme.spacing(4) } }; });
|
|
9288
|
-
var
|
|
9857
|
+
var defaultRowsPerPageOptions = [];
|
|
9858
|
+
var PaginatedTableCore = function PaginatedTableCore(_a) { var _b, _c, _d; var currentPage = _a.currentPage, loadNext = _a.loadNext, isLoading = _a.isLoading, metadata = _a.metadata, setCurrentPage = _a.setCurrentPage, _a$rowsPerPage = _a.rowsPerPage, rowsPerPage = _a$rowsPerPage === void 0 ? DEFAULT_TABLE_ROWS_PER_PAGE : _a$rowsPerPage, _a$rowsPerPageOptions = _a.rowsPerPageOptions, rowsPerPageOptions = _a$rowsPerPageOptions === void 0 ? defaultRowsPerPageOptions : _a$rowsPerPageOptions, onRowsPerPageChange = _a.onRowsPerPageChange, _a$keepConsistentCont = _a.keepConsistentContentHeight, keepConsistentContentHeight = _a$keepConsistentCont === void 0 ? true : _a$keepConsistentCont, classes = _a.classes, Table = _a.TableComponent, Typography = _a.TypographyComponent, tableProps = __rest(_a, ["currentPage", "loadNext", "isLoading", "metadata", "setCurrentPage", "rowsPerPage", "rowsPerPageOptions", "onRowsPerPageChange", "keepConsistentContentHeight", "classes", "TableComponent", "TypographyComponent"]); var items = tableProps.items; var tableId = useShortId(PAGINATED_TABLE_ID); var _useToast4 = useToast(), openToast = _useToast4.openToast; var tableRowHeight = _$1(); var currFirstRowIndex = currentPage * rowsPerPage; var loadNextHandler = function loadNextHandler(newPage) { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee13() { var _e, totalLoadedResults; return _regeneratorRuntime().wrap(function _callee13$(_context14) { while (1)
|
|
9289
9859
|
switch (_context14.prev = _context14.next) {
|
|
9290
9860
|
case 0:
|
|
9291
9861
|
tableRowHeight.current = (_e = document.querySelector("#".concat(tableId, " tbody tr"))) === null || _e === void 0 ? void 0 : _e.clientHeight;
|
|
@@ -9321,9 +9891,9 @@ var PaginatedTableCore = function PaginatedTableCore(_a) { var _b, _c, _d; var c
|
|
|
9321
9891
|
else {
|
|
9322
9892
|
countForPagination = (_b = metadata === null || metadata === void 0 ? void 0 : metadata.total) !== null && _b !== void 0 ? _b : 0;
|
|
9323
9893
|
moreRowsToShow = ((_c = metadata === null || metadata === void 0 ? void 0 : metadata.total) !== null && _c !== void 0 ? _c : 0) > rowsPerPage;
|
|
9324
|
-
} var showPagination = !showEmptyTable && moreRowsToShow; var paginationMarginTop = (rowsPerPage - pageResults.length) * ((_d = tableRowHeight.current) !== null && _d !== void 0 ? _d : 0) - 1; return /*#__PURE__*/ wn.createElement("div", { id: tableId }, /*#__PURE__*/ wn.createElement(Table, Object.assign({}, tableProps, { items: showEmptyTable ? [] : pageResults })), showEmptyTable && ( /*#__PURE__*/wn.createElement("div", { className: classes.emptyTable, style: tableRowHeight.current ? { height: Math.min(rowsPerPage, pageResults.length) * tableRowHeight.current } : undefined }, showLoading && /*#__PURE__*/ wn.createElement(CircularProgress$1, { color: "inherit" }), showNoResults && /*#__PURE__*/ wn.createElement(Typography, null, ZERO_RESULTS_MESSAGE))), showPagination && ( /*#__PURE__*/wn.createElement("div", { className: C(classes.tablePagination, _defineProperty2({}, classes.paginationBoder, paginationMarginTop)), style: { marginTop: paginationMarginTop } }, /*#__PURE__*/ wn.createElement(TablePagination$1, { component: "div", count: countForPagination, onPageChange: handleChangePage, page: currentPage, rowsPerPage: rowsPerPage, rowsPerPageOptions:
|
|
9325
|
-
var useStyles$
|
|
9326
|
-
var PaginatedTable = function PaginatedTable(props) { var classes = useStyles$
|
|
9894
|
+
} var showPagination = !showEmptyTable && moreRowsToShow || rowsPerPageOptions.length > 1; var paginationMarginTop = (rowsPerPage - pageResults.length) * ((_d = tableRowHeight.current) !== null && _d !== void 0 ? _d : 0) - 1; return /*#__PURE__*/ wn.createElement("div", { id: tableId }, /*#__PURE__*/ wn.createElement(Table, Object.assign({}, tableProps, { items: showEmptyTable ? [] : pageResults })), showEmptyTable && ( /*#__PURE__*/wn.createElement("div", { className: classes.emptyTable, style: tableRowHeight.current ? { height: Math.min(rowsPerPage, pageResults.length) * tableRowHeight.current } : undefined }, showLoading && /*#__PURE__*/ wn.createElement(CircularProgress$1, { color: "inherit" }), showNoResults && /*#__PURE__*/ wn.createElement(Typography, null, ZERO_RESULTS_MESSAGE))), showPagination && ( /*#__PURE__*/wn.createElement("div", { className: C(classes.tablePagination, _defineProperty2({}, classes.paginationBoder, paginationMarginTop)), style: keepConsistentContentHeight ? { marginTop: paginationMarginTop } : undefined }, /*#__PURE__*/ wn.createElement(TablePagination$1, { component: "div", count: countForPagination, onPageChange: handleChangePage, page: currentPage, rowsPerPage: rowsPerPage, rowsPerPageOptions: rowsPerPageOptions, onRowsPerPageChange: onRowsPerPageChange })))); };
|
|
9895
|
+
var useStyles$5 = makePaginatedTableStyles(function (theme) { return { tablePagination: { '& .MuiTablePagination-root': { color: theme.styleConfig.colors.primary }, '& .MuiTablePagination-actions .MuiIconButton-root.Mui-disabled': { color: theme.styleConfig.colors.secondary } }, paginationBoder: { borderTopColor: theme.styleConfig.colors.subtle } }; });
|
|
9896
|
+
var PaginatedTable = function PaginatedTable(props) { var classes = useStyles$5(); return /*#__PURE__*/ wn.createElement(PaginatedTableCore, Object.assign({}, props, { keepConsistentContentHeight: false, TableComponent: Table, TypographyComponent: Typography, classes: classes })); };
|
|
9327
9897
|
var Search = {};
|
|
9328
9898
|
var _interopRequireDefault = interopRequireDefaultExports;
|
|
9329
9899
|
var _interopRequireWildcard = interopRequireWildcardExports;
|
|
@@ -9336,7 +9906,7 @@ default_1 = Search["default"] = _default;
|
|
|
9336
9906
|
var Keys;
|
|
9337
9907
|
(function (Keys) { Keys["Backspace"] = "Backspace"; Keys["Tab"] = "Tab"; Keys["Enter"] = "Enter"; Keys["Space"] = " "; Keys["Shift"] = "Shift"; Keys["Control"] = "Control"; Keys["Alt"] = "Alt"; Keys["Command"] = "Meta"; Keys["Escape"] = "Escape"; Keys["PageUp"] = "PageUp"; Keys["PageDown"] = "PageDown"; Keys["ArrowLeft"] = "ArrowLeft"; Keys["ArrowUp"] = "ArrowUp"; Keys["ArrowRight"] = "ArrowRight"; Keys["ArrowDown"] = "ArrowDown"; Keys["Delete"] = "Delete"; Keys["Fn"] = "Fn"; Keys["End"] = "End"; Keys["Home"] = "Home"; Keys["Clear"] = "Clear"; Keys["Insert"] = "Insert"; Keys["A"] = "a"; Keys["B"] = "b"; Keys["C"] = "c"; Keys["D"] = "d"; Keys["E"] = "e"; Keys["F"] = "f"; Keys["G"] = "g"; Keys["H"] = "h"; Keys["I"] = "i"; Keys["J"] = "j"; Keys["K"] = "k"; Keys["L"] = "l"; Keys["M"] = "m"; Keys["N"] = "n"; Keys["O"] = "o"; Keys["P"] = "p"; Keys["Q"] = "q"; Keys["R"] = "r"; Keys["S"] = "s"; Keys["T"] = "t"; Keys["U"] = "u"; Keys["V"] = "v"; Keys["W"] = "w"; Keys["X"] = "x"; Keys["Y"] = "y"; Keys["Z"] = "z"; Keys["Zero"] = "0"; Keys["One"] = "1"; Keys["Two"] = "2"; Keys["Three"] = "3"; Keys["Four"] = "4"; Keys["Five"] = "5"; Keys["Six"] = "6"; Keys["Seven"] = "7"; Keys["Eight"] = "8"; Keys["Nine"] = "9"; Keys["F1"] = "F1"; Keys["F2"] = "F2"; Keys["F3"] = "F3"; Keys["F4"] = "F4"; Keys["F5"] = "F5"; Keys["F6"] = "F6"; Keys["F7"] = "F7"; Keys["F8"] = "F8"; Keys["F9"] = "F9"; Keys["F10"] = "F10"; Keys["F11"] = "F11"; Keys["F12"] = "F12"; Keys["Hyphen"] = "-"; Keys["ForwardSlash"] = "/"; Keys["BackSlash"] = "\\"; })(Keys || (Keys = {}));
|
|
9338
9908
|
var makeSearchBarStyles = makeStylesFactory(function (theme) { return { searchBar: { position: 'relative', width: '100%' }, icon: { alignItems: 'center', display: 'flex', justifyContent: 'center', position: 'absolute', bottom: 0, marginBottom: theme.spacing(1) }, searchInput: { '& input': { paddingLeft: "".concat(theme.spacing(4), "px !important"), paddingRight: "".concat(theme.spacing(6), "px !important") }, '&:hover': { cursor: 'pointer' } }, searchIcon: { padding: theme.spacing(0.5, 1, 0, 1) }, slashIcon: { border: '1px solid', borderRadius: theme.shape.borderRadius, padding: theme.spacing(0, 1) }, slashIconContainer: { right: theme.spacing(1) } }; });
|
|
9339
|
-
var SearchBarCore = function SearchBarCore(_a) { var classes = _a.classes, Input = _a.InputComponent, inputProps = __rest(_a, ["classes", "InputComponent"]); var
|
|
9909
|
+
var SearchBarCore = function SearchBarCore(_a) { var classes = _a.classes, Input = _a.InputComponent, inputProps = __rest(_a, ["classes", "InputComponent"]); var _h57 = h$4(null), _h58 = _slicedToArray2(_h57, 2), inputRef = _h58[0], setInputRef = _h58[1]; var _h59 = h$4(false), _h60 = _slicedToArray2(_h59, 2), focused = _h60[0], setFocused = _h60[1]; var onFocus = T$2(function () { return setFocused(true); }, []); var onBlur = T$2(function () { return setFocused(false); }, []); p$3(function () { var handleKey = function handleKey(e) { if (inputRef && !focused) {
|
|
9340
9910
|
if (e.metaKey && e.key === Keys.K || e.key === Keys.ForwardSlash) {
|
|
9341
9911
|
e.stopPropagation();
|
|
9342
9912
|
inputRef.focus();
|
|
@@ -9345,32 +9915,44 @@ var SearchBarCore = function SearchBarCore(_a) { var classes = _a.classes, Input
|
|
|
9345
9915
|
}
|
|
9346
9916
|
}
|
|
9347
9917
|
} }; document.addEventListener('keydown', handleKey); return function () { return document.removeEventListener('keydown', handleKey); }; }, [inputRef, focused]); return /*#__PURE__*/ wn.createElement("div", { className: classes.searchBar }, /*#__PURE__*/ wn.createElement("div", { className: C(classes.icon, classes.searchIcon) }, /*#__PURE__*/ wn.createElement(default_1, { fontSize: "small" })), /*#__PURE__*/ wn.createElement("div", { className: C(classes.icon, classes.slashIconContainer) }, /*#__PURE__*/ wn.createElement("div", { className: classes.slashIcon }, "/")), /*#__PURE__*/ wn.createElement("div", { className: classes.searchInput }, /*#__PURE__*/ wn.createElement(Input, Object.assign({}, inputProps, { fullWidth: true, inputRef: setInputRef, onBlur: onBlur, onFocus: onFocus })))); };
|
|
9348
|
-
var useStyles$
|
|
9349
|
-
var SearchBar = function SearchBar(props) { var classes = useStyles$
|
|
9350
|
-
var
|
|
9918
|
+
var useStyles$4 = makeSearchBarStyles(function (theme) { return { searchIcon: { color: theme.styleConfig.inputs.placeholderColor }, slashIcon: { borderColor: theme.styleConfig.inputs.placeholderColor, color: theme.styleConfig.inputs.placeholderColor, fontFamily: theme.styleConfig.fontFamily, fontSize: theme.typography.fontSize, lineHeight: 1, padding: theme.spacing(0.5, 1) } }; });
|
|
9919
|
+
var SearchBar = function SearchBar(props) { var classes = useStyles$4(props); return /*#__PURE__*/ wn.createElement(SearchBarCore, Object.assign({}, props, { classes: classes, InputComponent: Input$1 })); };
|
|
9920
|
+
var tryParseJson = function tryParseJson(value) { try {
|
|
9921
|
+
if (value) {
|
|
9922
|
+
return JSON.parse(value);
|
|
9923
|
+
}
|
|
9924
|
+
}
|
|
9925
|
+
catch (e) { } return undefined; };
|
|
9926
|
+
var useLocalStorage = function useLocalStorage(defaultValue, key) { var publicToken = useB2BInternals().publicToken; var fullKey = getLocalStorageKey(publicToken, key); var _h61 = h$4(function () { var storedValue = localStorage.getItem(fullKey); return storedValue ? tryParseJson(storedValue) : defaultValue; }), _h62 = _slicedToArray2(_h61, 2), cachedValue = _h62[0], setCachedValue = _h62[1]; var setValue = function setValue(value) { localStorage.setItem(fullKey, JSON.stringify(value)); setCachedValue(value); }; return [cachedValue, setValue]; };
|
|
9927
|
+
var itemsPerPageOptions = [10, 15, 25, 50, 100];
|
|
9928
|
+
var useItemsPerPage = function useItemsPerPage(_ref91) { var viewId = _ref91.viewId, defaultItemsPerPage = _ref91.defaultItemsPerPage; var _useLocalStorage = useLocalStorage(defaultItemsPerPage, "".concat(viewId, "_itemsPerPage")), _useLocalStorage2 = _slicedToArray2(_useLocalStorage, 2), itemsPerPage = _useLocalStorage2[0], setItemsPerPage = _useLocalStorage2[1]; var handleItemsPerPageChange = function handleItemsPerPageChange(e) { var value = parseInt(e.target.value, 10); if (!Number.isNaN(value)) {
|
|
9929
|
+
setItemsPerPage(value);
|
|
9930
|
+
} }; return [itemsPerPage, handleItemsPerPageChange]; };
|
|
9931
|
+
var useDisplayPagination = function useDisplayPagination(_ref92) { var items = _ref92.items, _ref92$defaultItemsPe = _ref92.defaultItemsPerPage, defaultItemsPerPage = _ref92$defaultItemsPe === void 0 ? 15 : _ref92$defaultItemsPe, viewId = _ref92.viewId; var _h63 = h$4(0), _h64 = _slicedToArray2(_h63, 2), currentPage = _h64[0], setCurrentPage = _h64[1]; var metadata = F$3(function () { return { total: items.length, cursor: 'none' }; }, [items.length]); var _useItemsPerPage = useItemsPerPage({ viewId: viewId, defaultItemsPerPage: defaultItemsPerPage }), _useItemsPerPage2 = _slicedToArray2(_useItemsPerPage, 2), itemsPerPage = _useItemsPerPage2[0], handleItemsPerPageChange = _useItemsPerPage2[1]; var pageCount = Math.ceil(items.length / itemsPerPage); var lastPageIndex = Math.max(0, pageCount - 1); if (currentPage > lastPageIndex) {
|
|
9351
9932
|
setCurrentPage(lastPageIndex);
|
|
9352
|
-
} return { items: items, currentPage: currentPage, setCurrentPage: setCurrentPage, loadNext: noop, metadata: metadata, rowsPerPage: itemsPerPage }; };
|
|
9353
|
-
var
|
|
9933
|
+
} return { items: items, currentPage: currentPage, setCurrentPage: setCurrentPage, loadNext: noop, metadata: metadata, rowsPerPage: itemsPerPage, rowsPerPageOptions: itemsPerPageOptions, onRowsPerPageChange: handleItemsPerPageChange }; };
|
|
9934
|
+
var DEFAULT_ROWS_PER_PAGE = 10;
|
|
9935
|
+
var itemRenderer = [{ title: 'Display Name', getValue: function getValue(_ref93) { var displayName = _ref93.displayName, isDefault = _ref93.isDefault; return isDefault ? ( /*#__PURE__*/wn.createElement(Typography, null, displayName, " ", /*#__PURE__*/ wn.createElement(Tag, { size: "sm" }, "Default"))) : displayName; } }, { title: 'IdP', getValue: function getValue(_ref94) { var idp = _ref94.idp, connectionType = _ref94.connectionType; return getIdpInfo(idp, connectionType).idp.displayName; } }, { title: 'Status', getValue: function getValue(_ref95) { var status = _ref95.status; switch (status) {
|
|
9354
9936
|
case 'active': return 'Active';
|
|
9355
9937
|
case 'pending': return 'Pending';
|
|
9356
9938
|
default: return status;
|
|
9357
9939
|
} } }];
|
|
9358
|
-
var useSearchFilter = function useSearchFilter(
|
|
9940
|
+
var useSearchFilter = function useSearchFilter(_ref96) { var data = _ref96.data, searchKeys = _ref96.searchKeys; var _h65 = h$4(''), _h66 = _slicedToArray2(_h65, 2), filterText = _h66[0], setFilterText = _h66[1]; var filteredData = F$3(function () { if (!filterText) {
|
|
9359
9941
|
return data;
|
|
9360
9942
|
} var filterTextLower = filterText.toLowerCase(); return data.filter(function (item) { return searchKeys.some(function (key) { return String(item[key]).toLowerCase().includes(filterTextLower); }); }); }, [data, filterText, searchKeys]); return { filteredData: filteredData, filterText: filterText, setFilterText: setFilterText }; };
|
|
9361
9943
|
var useCanProjectCreateSsoConnection = function useCanProjectCreateSsoConnection() { var _useAdminPortalConfig = useAdminPortalConfig(), data = _useAdminPortalConfig.data; return (data === null || data === void 0 ? void 0 : data.sso_config.can_create_oidc_connection) && data.sso_config.can_create_saml_connection; };
|
|
9362
|
-
var useConnections = function useConnections() { var _a; var ssoConnections = useSsoConnections(); var orgInfo = useOrgInfo(); var defaultConnectionId = (_a = orgInfo.data) === null || _a === void 0 ? void 0 : _a.sso_default_connection_id; var connections = F$3(function () { return ssoConnections.data ? [].concat(_toConsumableArray2(ssoConnections.data.saml_connections.map(function (c) { return Object.assign({ connectionType: 'saml' }, c); })), _toConsumableArray2(ssoConnections.data.oidc_connections.map(function (c) { return Object.assign({ connectionType: 'oidc' }, c); }))).map(function (connection) { return { displayName: connection.display_name, idp: connection.identity_provider, connectionType: connection.connectionType, status: connection.status, id: connection.connection_id, isDefault: connection.connection_id === defaultConnectionId }; }).sort(function (a, b) { return collator.compare(a.displayName, b.displayName); }) : []; }, [defaultConnectionId, ssoConnections.data]); return { connections: connections, isLoading: ssoConnections.isLoading }; };
|
|
9363
|
-
var SSOConnectionsScreen = function SSOConnectionsScreen() { var _useSsoRouterControll5 = useSsoRouterController(), navigate = _useSsoRouterControll5.navigate; var canProjectCreateSsoConnection = useCanProjectCreateSsoConnection(); var
|
|
9944
|
+
var useConnections = function useConnections(canGetSso) { var _a; var ssoConnections = useSsoConnections(canGetSso); var orgInfo = useOrgInfo(); var defaultConnectionId = (_a = orgInfo.data) === null || _a === void 0 ? void 0 : _a.sso_default_connection_id; var connections = F$3(function () { return ssoConnections.data ? [].concat(_toConsumableArray2(ssoConnections.data.saml_connections.map(function (c) { return Object.assign({ connectionType: 'saml' }, c); })), _toConsumableArray2(ssoConnections.data.oidc_connections.map(function (c) { return Object.assign({ connectionType: 'oidc' }, c); }))).map(function (connection) { return { displayName: connection.display_name, idp: connection.identity_provider, connectionType: connection.connectionType, status: connection.status, id: connection.connection_id, isDefault: connection.connection_id === defaultConnectionId }; }).sort(function (a, b) { return collator.compare(a.displayName, b.displayName); }) : []; }, [defaultConnectionId, ssoConnections.data]); return { connections: connections, isLoading: ssoConnections.isLoading }; };
|
|
9945
|
+
var SSOConnectionsScreen = function SSOConnectionsScreen() { var _useSsoRouterControll5 = useSsoRouterController(), navigate = _useSsoRouterControll5.navigate; var canProjectCreateSsoConnection = useCanProjectCreateSsoConnection(); var _useRbac8 = useRbac('stytch.sso', 'get'), canGetConnection = _useRbac8.data; var _useRbac9 = useRbac('stytch.sso', 'create'), canCreatePermission = _useRbac9.data; var _useRbac10 = useRbac('stytch.sso', 'delete'), canDeleteConnection = _useRbac10.data; var _useRbac11 = useRbac('stytch.sso', 'update'), canUpdateConnection = _useRbac11.data; var _useRbac12 = useRbac('stytch.organization', 'update.settings.default-sso-connection'), canSetDefaultConnection = _useRbac12.data; var canCreateConnection = canCreatePermission && canProjectCreateSsoConnection; var _useConnections = useConnections(!!canGetConnection), connections = _useConnections.connections, isLoading = _useConnections.isLoading; var _useSearchFilter = useSearchFilter({ data: connections, searchKeys: ['displayName'] }), filterText = _useSearchFilter.filterText, setFilterText = _useSearchFilter.setFilterText, filteredData = _useSearchFilter.filteredData; var tableProps = useDisplayPagination({ items: filteredData, defaultItemsPerPage: DEFAULT_ROWS_PER_PAGE, viewId: 'adminPortalSsoConnections' }); var defaultConnectionName = F$3(function () { var _a; return (_a = connections.find(function (connection) { return connection.isDefault; })) === null || _a === void 0 ? void 0 : _a.displayName; }, [connections]); var _useSetDefaultConnect2 = useSetDefaultConnection({ defaultConnectionName: defaultConnectionName }), setDefaultModalProps = _useSetDefaultConnect2.modalProps, handleSetDefault = _useSetDefaultConnect2.handleRequestSetDefault; var _useDeleteConnection2 = useDeleteConnection(), deleteModalProps = _useDeleteConnection2.modalProps, handleDelete = _useDeleteConnection2.handleRequestDelete; var handleEdit = T$2(function (connection) { navigate({ screen: 'connectionDetails', params: { connectionId: connection.id } }); }, [navigate]); var handleNewConnectionClick = T$2(function () { navigate({ screen: 'newConnection' }); }, [navigate]); var hasExactlyOneConnection = connections.length === 1; var actions = F$3(function () { return [{ key: 'view', label: 'View connection', icon: /*#__PURE__*/ wn.createElement(VisibilityOutlined, null), onClick: handleEdit, isVisible: !canUpdateConnection }, { key: 'edit', label: 'Edit connection', icon: /*#__PURE__*/ wn.createElement(EditOutlined, null), onClick: handleEdit, isVisible: !!canUpdateConnection }, { key: 'set-default', label: 'Set as default', icon: /*#__PURE__*/ wn.createElement(Tune, null), onClick: handleSetDefault, isVisible: function isVisible(connection) { return !connection.isDefault && !!canSetDefaultConnection; } }, { key: 'delete', label: 'Delete', icon: /*#__PURE__*/ wn.createElement(DeleteOutlined, null), onClick: handleDelete, isDangerous: true, isVisible: function isVisible(connection) { return (!connection.isDefault || hasExactlyOneConnection) && !!canDeleteConnection; } }]; }, [canDeleteConnection, canSetDefaultConnection, canUpdateConnection, handleDelete, handleEdit, handleSetDefault, hasExactlyOneConnection]); var _useActionMenu = useActionMenu({ actions: actions, idPrefix: 'connection' }), getItemActionProps = _useActionMenu.getItemActionProps; return /*#__PURE__*/ wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 3 }, canCreatePermission && !canCreateConnection && ( /*#__PURE__*/wn.createElement(Alert, null, "You\u2019ve reached the maximum number of allowed connections. Delete an existing connection in order to add a new one.")), /*#__PURE__*/ wn.createElement(FlexBox, { alignItems: "center", justifyContent: "space-between" }, /*#__PURE__*/ wn.createElement(Typography, { variant: "h2" }, "SSO Connections"), canCreateConnection && ( /*#__PURE__*/wn.createElement(Button, { variant: "primary", startIcon: /*#__PURE__*/ wn.createElement(Add, null), onClick: handleNewConnectionClick }, "New connection"))), /*#__PURE__*/ wn.createElement(SearchBar, { placeholder: "Search", value: filterText, onChange: setFilterText }), /*#__PURE__*/ wn.createElement(PaginatedTable, Object.assign({}, tableProps, { itemRenderer: itemRenderer, isLoading: isLoading, getItemActionProps: getItemActionProps }))), /*#__PURE__*/ wn.createElement(SetDefaultConfirmModal, Object.assign({}, setDefaultModalProps)), /*#__PURE__*/ wn.createElement(DeleteConfirmModal, Object.assign({}, deleteModalProps))); };
|
|
9364
9946
|
var makeAccordionStyles = makeStylesFactory(function (theme) { return { accordion: { '&.Mui-expanded.Mui-expanded, &.Mui-expanded + &.MuiAccordion-root': { border: '1px solid' }, '&:not(.Mui-expanded) + *': { borderWidth: '0px 1px 1px' }, '&.MuiAccordion-root:before': { display: 'none' }, border: 'solid', borderWidth: '1px 1px 1px' }, accordionDetails: { alignItems: 'flex-start', display: 'flex', flexDirection: 'column', padding: theme.spacing(2) }, accordionExpanded: { '& $accordionSummary': { margin: theme.spacing(1.5, 0) }, minHeight: '0 !important' }, accordionSummary: { alignItems: 'center', display: 'flex', margin: theme.spacing(1.5, 0) } }; });
|
|
9365
9947
|
var AccordionCore = function AccordionCore(props) { var className = props.className, classes = props.classes, rest = __rest(props, ["className", "classes"]); return /*#__PURE__*/ wn.createElement(MUIAccordion, Object.assign({ className: C(classes.accordion, className) }, rest)); };
|
|
9366
9948
|
var AccordionSummaryCore = function AccordionSummaryCore(_a) { var classes = _a.classes, props = __rest(_a, ["classes"]); return /*#__PURE__*/ wn.createElement(MUIAccordionSummary, Object.assign({ classes: { content: C(classes.accordionSummary, classes.content), expanded: C(classes.accordionExpanded, classes.expanded) }, expandIcon: /*#__PURE__*/ wn.createElement(ExpandMore$1, null) }, props)); };
|
|
9367
9949
|
var AccordionDetailsCore = function AccordionDetailsCore(props) { var className = props.className, classes = props.classes, rest = __rest(props, ["className", "classes"]); return /*#__PURE__*/ wn.createElement(MUIAccordionDetails, Object.assign({ className: C(classes.accordionDetails, className) }, rest)); };
|
|
9368
|
-
var useStyles = makeAccordionStyles(function (theme) { return { accordion: { '&.Mui-expanded.Mui-expanded, &.Mui-expanded + &.MuiAccordion-root': { borderColor: theme.styleConfig.colors.subtle }, backgroundColor: theme.styleConfig.container.backgroundColor, borderColor: theme.styleConfig.colors.subtle }, accordionDetails: { padding: theme.spacing(3, 3, 3, 7), alignItems: 'stretch' } }; });
|
|
9369
|
-
var Accordion = function Accordion(props) { var classes = useStyles(); return /*#__PURE__*/ wn.createElement(AccordionCore, Object.assign({}, props, { classes: classes })); };
|
|
9370
|
-
var AccordionSummary = function AccordionSummary(props) { var classes = useStyles(); return /*#__PURE__*/ wn.createElement(AccordionSummaryCore, Object.assign({}, props, { classes: classes })); };
|
|
9371
|
-
var AccordionDetails = function AccordionDetails(props) { var classes = useStyles(); return /*#__PURE__*/ wn.createElement(AccordionDetailsCore, Object.assign({}, props, { classes: classes })); };
|
|
9372
|
-
var useManualConfigurationState = function useManualConfigurationState(
|
|
9373
|
-
var SSONewConnectionConfigureScreen = function SSONewConnectionConfigureScreen(
|
|
9950
|
+
var useStyles$3 = makeAccordionStyles(function (theme) { return { accordion: { '&.Mui-expanded.Mui-expanded, &.Mui-expanded + &.MuiAccordion-root': { borderColor: theme.styleConfig.colors.subtle }, backgroundColor: theme.styleConfig.container.backgroundColor, borderColor: theme.styleConfig.colors.subtle }, accordionDetails: { padding: theme.spacing(3, 3, 3, 7), alignItems: 'stretch' } }; });
|
|
9951
|
+
var Accordion = function Accordion(props) { var classes = useStyles$3(); return /*#__PURE__*/ wn.createElement(AccordionCore, Object.assign({}, props, { classes: classes })); };
|
|
9952
|
+
var AccordionSummary = function AccordionSummary(props) { var classes = useStyles$3(); return /*#__PURE__*/ wn.createElement(AccordionSummaryCore, Object.assign({}, props, { classes: classes })); };
|
|
9953
|
+
var AccordionDetails = function AccordionDetails(props) { var classes = useStyles$3(); return /*#__PURE__*/ wn.createElement(AccordionDetailsCore, Object.assign({}, props, { classes: classes })); };
|
|
9954
|
+
var useManualConfigurationState = function useManualConfigurationState(_ref97) { var idp = _ref97.idp, type = _ref97.type; var _h67 = h$4(false), _h68 = _slicedToArray2(_h67, 2), manualConfigurationState = _h68[0], setManualConfigurationState = _h68[1]; var idpRequiresManualConfig = type === 'saml' && idp.metadataUrlLabel === false; var manualConfiguration = manualConfigurationState || idpRequiresManualConfig; return [manualConfiguration, setManualConfigurationState]; };
|
|
9955
|
+
var SSONewConnectionConfigureScreen = function SSONewConnectionConfigureScreen(_ref98) { var connectionProp = _ref98.connection; var _a; var _useSsoRouterControll6 = useSsoRouterController(), navigate = _useSsoRouterControll6.navigate; var info = getIdpAndConnectionInfo(connectionProp); var connection = info.connection, idp = info.idp, type = info.type; var connectionDisplayName = connection.display_name; var _useMutateSsoConnecti3 = useMutateSsoConnection(type), mutate = _useMutateSsoConnecti3.mutate; var _useMutateSsoConnecti4 = useMutateSsoConnectionByUrl(), mutateByUrl = _useMutateSsoConnecti4.mutate; var _useSsoRouterControll7 = useSsoRouterController(), useBlockNavigation = _useSsoRouterControll7.useBlockNavigation; var _h69 = h$4(true), _h70 = _slicedToArray2(_h69, 2), block = _h70[0], setBlock = _h70[1]; var _useBlockNavigation2 = useBlockNavigation(block), allowNavigation = _useBlockNavigation2.allowNavigation, blocked = _useBlockNavigation2.blocked, cancelNavigation = _useBlockNavigation2.cancelNavigation; var _useManualConfigurati = useManualConfigurationState(info), _useManualConfigurati2 = _slicedToArray2(_useManualConfigurati, 2), manualConfiguration = _useManualConfigurati2[0], setManualConfiguration = _useManualConfigurati2[1]; var _h71 = h$4(''), _h72 = _slicedToArray2(_h71, 2), metadataUrl = _h72[0], setMetadataUrl = _h72[1]; var _h73 = h$4(''), _h74 = _slicedToArray2(_h73, 2), ssoUrl = _h74[0], setSsoUrl = _h74[1]; var _h75 = h$4(''), _h76 = _slicedToArray2(_h75, 2), entityId = _h76[0], setEntityId = _h76[1]; var _h77 = h$4(''), _h78 = _slicedToArray2(_h77, 2), x509Certificate = _h78[0], setX509Certificate = _h78[1]; var _h79 = h$4(''), _h80 = _slicedToArray2(_h79, 2), clientId = _h80[0], setClientId = _h80[1]; var _h81 = h$4(''), _h82 = _slicedToArray2(_h81, 2), clientSecret = _h82[0], setClientSecret = _h82[1]; var _h83 = h$4(''), _h84 = _slicedToArray2(_h83, 2), issuer = _h84[0], setIssuer = _h84[1]; var _h85 = h$4(''), _h86 = _slicedToArray2(_h85, 2), issuerDerivedValue = _h86[0], setIssuerDerivedValue = _h86[1]; var _h87 = h$4(''), _h88 = _slicedToArray2(_h87, 2), authorizationUrl = _h88[0], setAuthorizationUrl = _h88[1]; var _h89 = h$4(''), _h90 = _slicedToArray2(_h89, 2), tokenUrl = _h90[0], setTokenUrl = _h90[1]; var _h91 = h$4(''), _h92 = _slicedToArray2(_h91, 2), userInfoUrl = _h92[0], setUserInfoUrl = _h92[1]; var _h93 = h$4(''), _h94 = _slicedToArray2(_h93, 2), jwksUrl = _h94[0], setJwksUrl = _h94[1]; var _h95 = h$4({ attributeMapping: { email: 'NameID', first_name: 'firstName', last_name: 'lastName', groups: '' } }), _h96 = _slicedToArray2(_h95, 2), attributeMappingState = _h96[0], setAttributeMappingState = _h96[1]; var attributeMapping = F$3(function () { return Object.fromEntries(Object.entries(attributeMappingState.attributeMapping).filter(function (_ref99) { var _ref100 = _slicedToArray2(_ref99, 2), value = _ref100[1]; return value; })); }, [attributeMappingState.attributeMapping]); var _useToast5 = useToast(), openToast = _useToast5.openToast; var handleSubmit = T$2(function (e) { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee15() { var options, message; return _regeneratorRuntime().wrap(function _callee15$(_context16) { while (1)
|
|
9374
9956
|
switch (_context16.prev = _context16.next) {
|
|
9375
9957
|
case 0:
|
|
9376
9958
|
e.preventDefault();
|
|
@@ -9437,8 +10019,8 @@ var SSONewConnectionConfigureScreen = function SSONewConnectionConfigureScreen(_
|
|
|
9437
10019
|
openToast({ text: message || 'Unable to save connection', type: 'error' });
|
|
9438
10020
|
case 30:
|
|
9439
10021
|
case "end": return _context16.stop();
|
|
9440
|
-
} }, _callee15, null, [[3, 26]]); })); }, [connection, type, navigate, manualConfiguration, mutate, ssoUrl, entityId, x509Certificate, attributeMapping, metadataUrl, mutateByUrl, clientId, clientSecret, idp, issuerDerivedValue, issuer, authorizationUrl, tokenUrl, userInfoUrl, jwksUrl, openToast]); var idpValueInputs = type === 'saml' ? { ssoUrl: ( /*#__PURE__*/wn.createElement(Input, { label: idp.idpSsoUrlLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.idpSsoUrlLabel), value: ssoUrl, onChange: setSsoUrl })), entityId: ( /*#__PURE__*/wn.createElement(Input, { label: idp.idpEntityIdLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.idpEntityIdLabel), value: entityId, onChange: setEntityId })), certificate: ( /*#__PURE__*/wn.createElement(Input, { label: idp.x509CertificateLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.x509CertificateLabel), value: x509Certificate, onChange: setX509Certificate })) } : undefined; var stepMap = { copyToIdp: ( /*#__PURE__*/wn.createElement(Accordion, null, /*#__PURE__*/ wn.createElement(AccordionSummary, null, /*#__PURE__*/ wn.createElement(Typography, null, "Copy the following App values to your IdP.")), /*#__PURE__*/ wn.createElement(AccordionDetails, null, /*#__PURE__*/ wn.createElement(SettingsList, null, /*#__PURE__*/ wn.createElement(AppDetails, { connection: connection }))))), copyFromIdp: ( /*#__PURE__*/wn.createElement(Accordion, null, /*#__PURE__*/ wn.createElement(AccordionSummary, null, /*#__PURE__*/ wn.createElement(Typography, null, "Enter the following IdP values.")), /*#__PURE__*/ wn.createElement(AccordionDetails, null, /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 2 }, type === 'saml' && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, manualConfiguration && idpValueInputs ? idp.idpValueOrder.map(function (key) { return /*#__PURE__*/ wn.createElement(wn.Fragment, { key: key }, idpValueInputs[key]); }) : ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement("label", null, /*#__PURE__*/ wn.createElement(Typography, null, "Enter the ", idp.metadataUrlLabel, " to configure your connection automatically."), /*#__PURE__*/ wn.createElement(Input, { placeholder: "Enter ".concat(idp.metadataUrlLabel), caption: "If you don\u2019t know your ".concat(idp.metadataUrlLabel, ", you can configure your connection manually."), value: metadataUrl, onChange: setMetadataUrl })))), !!idp.metadataUrlLabel && ( /*#__PURE__*/wn.createElement(Button, { compact: true, variant: "ghost", onClick: function onClick() { setManualConfiguration(!manualConfiguration); } }, manualConfiguration ? "Configure using ".concat(idp.metadataUrlLabel) : 'Configure manually')))), type === 'oidc' && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Input, { label: idp.clientIdLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.clientIdLabel), value: clientId, onChange: setClientId }), /*#__PURE__*/ wn.createElement(Input, { label: idp.clientSecretLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.clientSecretLabel), value: clientSecret, onChange: setClientSecret }), idp.transformInputToIssuer ? ( /*#__PURE__*/wn.createElement(Input, { label: idp.issuerDerivedLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.issuerDerivedLabel), value: issuerDerivedValue, onChange: setIssuerDerivedValue })) : ( /*#__PURE__*/wn.createElement(Input, { label: idp.issuerLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.issuerLabel), value: issuer, onChange: setIssuer })), manualConfiguration && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Input, { label: "Authorization URL", labelVariant: "body1", placeholder: "Enter Authorization URL", value: authorizationUrl, onChange: setAuthorizationUrl }), /*#__PURE__*/ wn.createElement(Input, { label: "Token URL", labelVariant: "body1", placeholder: "Enter Token URL", value: tokenUrl, onChange: setTokenUrl }), /*#__PURE__*/ wn.createElement(Input, { label: "User Info URL", labelVariant: "body1", placeholder: "Enter User Info", value: userInfoUrl, onChange: setUserInfoUrl }), /*#__PURE__*/ wn.createElement(Input, { label: "JWKS URL", labelVariant: "body1", placeholder: "Enter JWKS URL", value: jwksUrl, onChange: setJwksUrl }))), /*#__PURE__*/ wn.createElement(Button, { compact: true, variant: "ghost", onClick: function onClick() { setManualConfiguration(!manualConfiguration); } }, manualConfiguration ? "Configure using ".concat((_a = idp.issuerDerivedLabel) !== null && _a !== void 0 ? _a : idp.issuerLabel) : 'Configure manually'))))))), attributeMapping: type === 'saml' && ( /*#__PURE__*/wn.createElement(Accordion, null, /*#__PURE__*/ wn.createElement(AccordionSummary, null, /*#__PURE__*/ wn.createElement(Typography, null, "Set your ", idp.attributeMappingLabel, ".")), /*#__PURE__*/ wn.createElement(AccordionDetails, null, /*#__PURE__*/ wn.createElement(Typography, null, "The following values are automatically filled based on your IdP. Make changes or add custom mappings."), /*#__PURE__*/ wn.createElement(AttributeMappingTable, { editing: true, localState: attributeMappingState, setLocalState: setAttributeMappingState, remoteState: attributeMappingState })))) }; var steps = idp.setupOrder.map(function (step) { return /*#__PURE__*/ wn.createElement(wn.Fragment, { key: step }, stepMap[step]); }); return /*#__PURE__*/ wn.createElement("form", { onSubmit: handleSubmit }, /*#__PURE__*/ wn.createElement(Modal, { isOpen: block && blocked, close: cancelNavigation, confirm: function confirm() { allowNavigation(); return Promise.resolve(); }, title: "Save ".concat(connectionDisplayName, "?"), confirmButtonText: "Save and complete later", description: 'Your SSO connection is not fully configured. It will remain pending until you complete all necessary configuration steps. You can save your progress and complete later or cancel to finish configuration.' }), /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 3 }, /*#__PURE__*/ wn.createElement(Button, { variant: "ghost", compact: true, onClick: function onClick() { navigate({ screen: 'connectionsList' }); }, startIcon: /*#__PURE__*/ wn.createElement(ChevronLeft, null) }, "Back to all SSO connections"), /*#__PURE__*/ wn.createElement(Typography, { variant: "h2" }, "Configure ", connectionDisplayName), /*#__PURE__*/ wn.createElement("div", null, steps), /*#__PURE__*/ wn.createElement(FlexBox, { justifyContent: "flex-end" }, /*#__PURE__*/ wn.createElement(Button, { type: "submit" }, "Create")))); };
|
|
9441
|
-
var SSONewConnectionScreen = function SSONewConnectionScreen() { var _useSsoRouterControll8 = useSsoRouterController(), navigate = _useSsoRouterControll8.navigate; var
|
|
10022
|
+
} }, _callee15, null, [[3, 26]]); })); }, [connection, type, navigate, manualConfiguration, mutate, ssoUrl, entityId, x509Certificate, attributeMapping, metadataUrl, mutateByUrl, clientId, clientSecret, idp, issuerDerivedValue, issuer, authorizationUrl, tokenUrl, userInfoUrl, jwksUrl, openToast]); var idpValueInputs = type === 'saml' ? { ssoUrl: ( /*#__PURE__*/wn.createElement(Input$1, { label: idp.idpSsoUrlLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.idpSsoUrlLabel), value: ssoUrl, onChange: setSsoUrl })), entityId: ( /*#__PURE__*/wn.createElement(Input$1, { label: idp.idpEntityIdLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.idpEntityIdLabel), value: entityId, onChange: setEntityId })), certificate: ( /*#__PURE__*/wn.createElement(Input$1, { label: idp.x509CertificateLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.x509CertificateLabel), value: x509Certificate, onChange: setX509Certificate })) } : undefined; var stepMap = { copyToIdp: ( /*#__PURE__*/wn.createElement(Accordion, null, /*#__PURE__*/ wn.createElement(AccordionSummary, null, /*#__PURE__*/ wn.createElement(Typography, null, "Copy the following App values to your IdP.")), /*#__PURE__*/ wn.createElement(AccordionDetails, null, /*#__PURE__*/ wn.createElement(SettingsList, null, /*#__PURE__*/ wn.createElement(AppDetails, { connection: connection }))))), copyFromIdp: ( /*#__PURE__*/wn.createElement(Accordion, null, /*#__PURE__*/ wn.createElement(AccordionSummary, null, /*#__PURE__*/ wn.createElement(Typography, null, "Enter the following IdP values.")), /*#__PURE__*/ wn.createElement(AccordionDetails, null, /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 2 }, type === 'saml' && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, manualConfiguration && idpValueInputs ? idp.idpValueOrder.map(function (key) { return /*#__PURE__*/ wn.createElement(wn.Fragment, { key: key }, idpValueInputs[key]); }) : ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement("label", null, /*#__PURE__*/ wn.createElement(Typography, null, "Enter the ", idp.metadataUrlLabel, " to configure your connection automatically."), /*#__PURE__*/ wn.createElement(Input$1, { placeholder: "Enter ".concat(idp.metadataUrlLabel), caption: "If you don\u2019t know your ".concat(idp.metadataUrlLabel, ", you can configure your connection manually."), value: metadataUrl, onChange: setMetadataUrl })))), !!idp.metadataUrlLabel && ( /*#__PURE__*/wn.createElement(Button, { compact: true, variant: "ghost", onClick: function onClick() { setManualConfiguration(!manualConfiguration); } }, manualConfiguration ? "Configure using ".concat(idp.metadataUrlLabel) : 'Configure manually')))), type === 'oidc' && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Input$1, { label: idp.clientIdLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.clientIdLabel), value: clientId, onChange: setClientId }), /*#__PURE__*/ wn.createElement(Input$1, { label: idp.clientSecretLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.clientSecretLabel), value: clientSecret, onChange: setClientSecret }), idp.transformInputToIssuer ? ( /*#__PURE__*/wn.createElement(Input$1, { label: idp.issuerDerivedLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.issuerDerivedLabel), value: issuerDerivedValue, onChange: setIssuerDerivedValue })) : ( /*#__PURE__*/wn.createElement(Input$1, { label: idp.issuerLabel, labelVariant: "body1", placeholder: "Enter ".concat(idp.issuerLabel), value: issuer, onChange: setIssuer })), manualConfiguration && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Input$1, { label: "Authorization URL", labelVariant: "body1", placeholder: "Enter Authorization URL", value: authorizationUrl, onChange: setAuthorizationUrl }), /*#__PURE__*/ wn.createElement(Input$1, { label: "Token URL", labelVariant: "body1", placeholder: "Enter Token URL", value: tokenUrl, onChange: setTokenUrl }), /*#__PURE__*/ wn.createElement(Input$1, { label: "User Info URL", labelVariant: "body1", placeholder: "Enter User Info", value: userInfoUrl, onChange: setUserInfoUrl }), /*#__PURE__*/ wn.createElement(Input$1, { label: "JWKS URL", labelVariant: "body1", placeholder: "Enter JWKS URL", value: jwksUrl, onChange: setJwksUrl }))), /*#__PURE__*/ wn.createElement(Button, { compact: true, variant: "ghost", onClick: function onClick() { setManualConfiguration(!manualConfiguration); } }, manualConfiguration ? "Configure using ".concat((_a = idp.issuerDerivedLabel) !== null && _a !== void 0 ? _a : idp.issuerLabel) : 'Configure manually'))))))), attributeMapping: type === 'saml' && ( /*#__PURE__*/wn.createElement(Accordion, null, /*#__PURE__*/ wn.createElement(AccordionSummary, null, /*#__PURE__*/ wn.createElement(Typography, null, "Set your ", idp.attributeMappingLabel, ".")), /*#__PURE__*/ wn.createElement(AccordionDetails, null, /*#__PURE__*/ wn.createElement(Typography, null, "The following values are automatically filled based on your IdP. Make changes or add custom mappings."), /*#__PURE__*/ wn.createElement(AttributeMappingTable, { editing: true, localState: attributeMappingState, setLocalState: setAttributeMappingState, remoteState: attributeMappingState })))) }; var steps = idp.setupOrder.map(function (step) { return /*#__PURE__*/ wn.createElement(wn.Fragment, { key: step }, stepMap[step]); }); return /*#__PURE__*/ wn.createElement("form", { onSubmit: handleSubmit }, /*#__PURE__*/ wn.createElement(Modal, { isOpen: block && blocked, close: cancelNavigation, confirm: function confirm() { allowNavigation(); return Promise.resolve(); }, title: "Save ".concat(connectionDisplayName, "?"), confirmButtonText: "Save and complete later", description: 'Your SSO connection is not fully configured. It will remain pending until you complete all necessary configuration steps. You can save your progress and complete later or cancel to finish configuration.' }), /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 3 }, /*#__PURE__*/ wn.createElement(Button, { variant: "ghost", compact: true, onClick: function onClick() { navigate({ screen: 'connectionsList' }); }, startIcon: /*#__PURE__*/ wn.createElement(ChevronLeft, null) }, "Back to all SSO connections"), /*#__PURE__*/ wn.createElement(Typography, { variant: "h2" }, "Configure ", connectionDisplayName), /*#__PURE__*/ wn.createElement("div", null, steps), /*#__PURE__*/ wn.createElement(FlexBox, { justifyContent: "flex-end" }, /*#__PURE__*/ wn.createElement(Button, { type: "submit" }, "Create")))); };
|
|
10023
|
+
var SSONewConnectionScreen = function SSONewConnectionScreen() { var _useSsoRouterControll8 = useSsoRouterController(), navigate = _useSsoRouterControll8.navigate; var _h97 = h$4(''), _h98 = _slicedToArray2(_h97, 2), displayName = _h98[0], setDisplayName = _h98[1]; var _h99 = h$4(), _h100 = _slicedToArray2(_h99, 2), idp = _h100[0], setIdp = _h100[1]; var canCreate = displayName && idp; var client = useStytchClient(); var _useSWRConfig4 = useSWRConfig(), mutate = _useSWRConfig4.mutate; var revalidateConnectionList = useRevalidateConnectionList(); var handleSubmit = T$2(function (e) { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee17() { var _idpOptions$idp, idpName, type, response; return _regeneratorRuntime().wrap(function _callee17$(_context18) { while (1)
|
|
9442
10024
|
switch (_context18.prev = _context18.next) {
|
|
9443
10025
|
case 0:
|
|
9444
10026
|
e.preventDefault();
|
|
@@ -9477,10 +10059,10 @@ var SSONewConnectionScreen = function SSONewConnectionScreen() { var _useSsoRout
|
|
|
9477
10059
|
}
|
|
9478
10060
|
case 10:
|
|
9479
10061
|
case "end": return _context18.stop();
|
|
9480
|
-
} }, _callee17); })); }, [canCreate, client.sso.oidc, client.sso.saml, idp, displayName, mutate, navigate, revalidateConnectionList]); return /*#__PURE__*/ wn.createElement("form", { onSubmit: handleSubmit }, /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 3 }, /*#__PURE__*/ wn.createElement(Button, { variant: "ghost", compact: true, onClick: function onClick() { navigate({ screen: 'connectionsList' }); }, startIcon: /*#__PURE__*/ wn.createElement(ChevronLeft, null) }, "Back to all SSO connections"), /*#__PURE__*/ wn.createElement(Typography, { variant: "h2" }, "New SSO Connection"), /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 1 }, /*#__PURE__*/ wn.createElement(Typography, null, "Set a display name for your connection."), /*#__PURE__*/ wn.createElement(Input, { placeholder: "Text", value: displayName, onChange: setDisplayName, caption: "You will be able to edit this again in the future." })), /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 1 }, /*#__PURE__*/ wn.createElement(Typography, null, "Select your identity provider or choose to configure a custom SAML / OIDC connection."), /*#__PURE__*/ wn.createElement(Select, { placeholder: "Select", selectItems: idpSelectItems, value: idp, onChange: setIdp }), /*#__PURE__*/ wn.createElement(Typography, null, "Once you click \u201CCreate\u201D the SSO connection will be created. If you need to change the connection type after this, you will need to start over.")), /*#__PURE__*/ wn.createElement(FlexBox, { justifyContent: "space-between" }, /*#__PURE__*/ wn.createElement(Button, { variant: "ghost", onClick: function onClick() { navigate({ screen: 'connectionsList' }); } }, "Cancel"), /*#__PURE__*/ wn.createElement(Button, { type: "submit", disabled: !canCreate }, "Create")))); };
|
|
9481
|
-
var routeMap = { connectionDetails: SSOConnectionDetailsScreen, connectionsList: SSOConnectionsScreen, newConnection: SSONewConnectionScreen, newConnectionConfigure: SSONewConnectionConfigureScreen };
|
|
9482
|
-
var initialRoute = { screen: 'connectionsList' };
|
|
9483
|
-
var Content = function Content() { var _useAdminPortalConfig2 = useAdminPortalConfig(), adminPortalConfig = _useAdminPortalConfig2.data, adminPortalConfigError = _useAdminPortalConfig2.error; var
|
|
10062
|
+
} }, _callee17); })); }, [canCreate, client.sso.oidc, client.sso.saml, idp, displayName, mutate, navigate, revalidateConnectionList]); return /*#__PURE__*/ wn.createElement("form", { onSubmit: handleSubmit }, /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 3 }, /*#__PURE__*/ wn.createElement(Button, { variant: "ghost", compact: true, onClick: function onClick() { navigate({ screen: 'connectionsList' }); }, startIcon: /*#__PURE__*/ wn.createElement(ChevronLeft, null) }, "Back to all SSO connections"), /*#__PURE__*/ wn.createElement(Typography, { variant: "h2" }, "New SSO Connection"), /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 1 }, /*#__PURE__*/ wn.createElement(Typography, null, "Set a display name for your connection."), /*#__PURE__*/ wn.createElement(Input$1, { placeholder: "Text", value: displayName, onChange: setDisplayName, caption: "You will be able to edit this again in the future." })), /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 1 }, /*#__PURE__*/ wn.createElement(Typography, null, "Select your identity provider or choose to configure a custom SAML / OIDC connection."), /*#__PURE__*/ wn.createElement(Select, { placeholder: "Select", selectItems: idpSelectItems, value: idp, onChange: setIdp }), /*#__PURE__*/ wn.createElement(Typography, null, "Once you click \u201CCreate\u201D the SSO connection will be created. If you need to change the connection type after this, you will need to start over.")), /*#__PURE__*/ wn.createElement(FlexBox, { justifyContent: "space-between" }, /*#__PURE__*/ wn.createElement(Button, { variant: "ghost", onClick: function onClick() { navigate({ screen: 'connectionsList' }); } }, "Cancel"), /*#__PURE__*/ wn.createElement(Button, { type: "submit", disabled: !canCreate }, "Create")))); };
|
|
10063
|
+
var routeMap$1 = { connectionDetails: SSOConnectionDetailsScreen, connectionsList: SSOConnectionsScreen, newConnection: SSONewConnectionScreen, newConnectionConfigure: SSONewConnectionConfigureScreen };
|
|
10064
|
+
var initialRoute$1 = { screen: 'connectionsList' };
|
|
10065
|
+
var Content$1 = function Content$1() { var _useAdminPortalConfig2 = useAdminPortalConfig(), adminPortalConfig = _useAdminPortalConfig2.data, adminPortalConfigError = _useAdminPortalConfig2.error; var _useRbac13 = useRbac('stytch.sso', 'get'), canGetSso = _useRbac13.data; if (adminPortalConfigError) {
|
|
9484
10066
|
return /*#__PURE__*/ wn.createElement(Alert, null, "SSO Connections could not be loaded. Please contact your admin if you think this is a mistake.");
|
|
9485
10067
|
} if (canGetSso === undefined || !adminPortalConfig) {
|
|
9486
10068
|
return /*#__PURE__*/ wn.createElement(PageLoadingIndicator, null);
|
|
@@ -9488,9 +10070,251 @@ var Content = function Content() { var _useAdminPortalConfig2 = useAdminPortalCo
|
|
|
9488
10070
|
return /*#__PURE__*/ wn.createElement(Alert, null, "You do not have permission to view SSO Connections. Please contact your admin if you think this is a mistake.");
|
|
9489
10071
|
} if (!adminPortalConfig.sso_config.sso_enabled) {
|
|
9490
10072
|
return /*#__PURE__*/ wn.createElement(Alert, null, "SSO Connections are not supported. Please contact your admin if you think this is a mistake.");
|
|
9491
|
-
} return /*#__PURE__*/ wn.createElement(SsoRouterProvider, { initialRoute: initialRoute }, /*#__PURE__*/ wn.createElement(SsoRouter, { routeMap: routeMap })); };
|
|
9492
|
-
var AdminPortalSSO$1 = function AdminPortalSSO(props) { var initialClient = _$1(props.client); p$3(function () { readB2BInternals(initialClient.current).networkClient.logEvent({ name: 'render_b2b_admin_portal_sso', details: {} }); }, []); return /*#__PURE__*/ wn.createElement(AdminPortalWrapper, { options: props }, /*#__PURE__*/ wn.createElement(Content, null)); };
|
|
10073
|
+
} return /*#__PURE__*/ wn.createElement(SsoRouterProvider, { initialRoute: initialRoute$1 }, /*#__PURE__*/ wn.createElement(SsoRouter, { routeMap: routeMap$1 })); };
|
|
10074
|
+
var AdminPortalSSO$1 = function AdminPortalSSO(props) { var initialClient = _$1(props.client); p$3(function () { readB2BInternals(initialClient.current).networkClient.logEvent({ name: 'render_b2b_admin_portal_sso', details: {} }); }, []); return /*#__PURE__*/ wn.createElement(AdminPortalWrapper, { options: props }, /*#__PURE__*/ wn.createElement(Content$1, null)); };
|
|
9493
10075
|
var mountAdminPortalSSO = makeAdminPortalComponentMountFn(AdminPortalSSO$1, 'stytch-b2b-admin-portal-sso-ui', 'mountAdminPortalSSO');
|
|
10076
|
+
var _createRouter2 = createRouter(), OrgSettingsRouterProvider = _createRouter2.RouterProvider, OrgSettingsRouter = _createRouter2.Router, useOrgSettingsRouterController = _createRouter2.useRouterController;
|
|
10077
|
+
var isEmptyObject = function isEmptyObject(value) { for (var prop in value) {
|
|
10078
|
+
if (Object.prototype.hasOwnProperty.call(value, prop)) {
|
|
10079
|
+
return false;
|
|
10080
|
+
}
|
|
10081
|
+
} return true; };
|
|
10082
|
+
var useMutateOrgSettingsDetails = function useMutateOrgSettingsDetails() { var _useMutateOrganizatio3 = useMutateOrganization(), mutate = _useMutateOrganizatio3.mutate; var setOrgDetails = function setOrgDetails(_ref101) { var organizationName = _ref101.organizationName, organizationSlug = _ref101.organizationSlug; return mutate(Object.assign(Object.assign({}, organizationName && { organization_name: organizationName }), organizationSlug && { organization_slug: organizationSlug }), { errorMessage: 'Failed to update organization details.' }); }; return { setOrgDetails: setOrgDetails }; };
|
|
10083
|
+
var OrgSettingsDetailsBody = function OrgSettingsDetailsBody(_ref102) { var canSetName = _ref102.canSetName, canSetSlug = _ref102.canSetSlug, remoteState = _ref102.remoteState, localState = _ref102.localState, setLocalState = _ref102.setLocalState; var handleNameChange = useStateSliceSetter(setLocalState, 'organizationName'); var handleSlugChange = useStateSliceSetter(setLocalState, 'organizationSlug'); var _useSettingsContainer4 = useSettingsContainer(), editing = _useSettingsContainer4.editing; return /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 2 }, /*#__PURE__*/ wn.createElement(SettingsList, null, /*#__PURE__*/ wn.createElement(SettingsListItem, { title: "Name" }, editing && canSetName ? ( /*#__PURE__*/wn.createElement(Input$1, { placeholder: "Enter Name", value: localState.organizationName, onChange: handleNameChange })) : ( /*#__PURE__*/wn.createElement(Typography, { variant: "body2", color: "secondary" }, remoteState.organizationName))), /*#__PURE__*/ wn.createElement(SettingsListItem, { title: "Slug" }, editing && canSetSlug ? ( /*#__PURE__*/wn.createElement(Input$1, { placeholder: "Enter Slug", value: localState.organizationSlug, onChange: handleSlugChange })) : ( /*#__PURE__*/wn.createElement(Typography, { variant: "body2", color: "secondary" }, remoteState.organizationSlug))))); };
|
|
10084
|
+
var OrgSettingsDetailsSection = function OrgSettingsDetailsSection(_ref103) { var orgInfo = _ref103.orgInfo; var _useRbac14 = useRbac('stytch.organization', 'update.info.name'), canSetName = _useRbac14.data; var _useRbac15 = useRbac('stytch.organization', 'update.info.slug'), canSetSlug = _useRbac15.data; var remoteState = F$3(function () { return { organizationName: orgInfo.organization_name, organizationSlug: orgInfo.organization_slug }; }, [orgInfo]); var _useFormState4 = useFormState({ remoteState: remoteState }), localState = _useFormState4.localState, setLocalState = _useFormState4.setLocalState, editing = _useFormState4.editing, handleSetEditing = _useFormState4.handleSetEditing; var _useOrgSettingsRouter = useOrgSettingsRouterController(), useBlockNavigation = _useOrgSettingsRouter.useBlockNavigation; var _useMutateOrgSettings = useMutateOrgSettingsDetails(), setOrgDetails = _useMutateOrgSettings.setOrgDetails; var findMutatedProperties = T$2(function () { var mutatedProperties = {}; if (remoteState.organizationName !== localState.organizationName && localState.organizationName.length > 0) {
|
|
10085
|
+
mutatedProperties.organizationName = localState.organizationName;
|
|
10086
|
+
} if (remoteState.organizationSlug !== localState.organizationSlug && localState.organizationSlug.length > 0) {
|
|
10087
|
+
mutatedProperties.organizationSlug = localState.organizationSlug;
|
|
10088
|
+
} return mutatedProperties; }, [localState.organizationName, localState.organizationSlug, remoteState.organizationName, remoteState.organizationSlug]); var handleSave = T$2(function () { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee18() { var mutatedProperties; return _regeneratorRuntime().wrap(function _callee18$(_context19) { while (1)
|
|
10089
|
+
switch (_context19.prev = _context19.next) {
|
|
10090
|
+
case 0:
|
|
10091
|
+
mutatedProperties = findMutatedProperties();
|
|
10092
|
+
if (isEmptyObject(mutatedProperties)) {
|
|
10093
|
+
_context19.next = 4;
|
|
10094
|
+
break;
|
|
10095
|
+
}
|
|
10096
|
+
_context19.next = 4;
|
|
10097
|
+
return setOrgDetails({ organizationName: mutatedProperties.organizationName, organizationSlug: mutatedProperties.organizationSlug });
|
|
10098
|
+
case 4: return _context19.abrupt("return");
|
|
10099
|
+
case 5:
|
|
10100
|
+
case "end": return _context19.stop();
|
|
10101
|
+
} }, _callee18); })); }, [setOrgDetails, findMutatedProperties]); var disableSave = isEmptyObject(findMutatedProperties()); return /*#__PURE__*/ wn.createElement(SettingsContainer, { title: "Details", hasCTA: canSetName || canSetSlug, onSave: handleSave, useBlockNavigation: useBlockNavigation, editing: editing, setEditing: handleSetEditing, disableSave: disableSave }, /*#__PURE__*/ wn.createElement(OrgSettingsDetailsBody, { canSetName: canSetName, canSetSlug: canSetSlug, localState: localState, remoteState: remoteState, setLocalState: setLocalState })); };
|
|
10102
|
+
var makeRowStyles = makeStyles(function () { return { rowItemContainer: { maxWidth: DEFAULT_GRID_COLUMN_WIDTH }, rowItemFullWidth: { maxWidth: DEFAULT_MAX_ITEM_WIDTH } }; });
|
|
10103
|
+
var RowItemCore = function RowItemCore(_ref104) { var children = _ref104.children, fullWidth = _ref104.fullWidth; var classes = makeRowStyles(); return /*#__PURE__*/ wn.createElement("div", { className: C(classes.rowItemContainer, _defineProperty2({}, classes.rowItemFullWidth, fullWidth)) }, children); };
|
|
10104
|
+
var useStyles$2 = makeStyles(function (theme) { var primary = theme.styleConfig.buttons.primary.backgroundColor; var secondary = theme.styleConfig.colors.secondary; var containerBackground = theme.styleConfig.container.backgroundColor; return { root: { width: 46, height: 31, padding: 8, overflow: 'hidden', display: 'flex', boxSizing: 'border-box' }, switchBase: { margin: '2px 3px', '&$checked': { margin: '2px -3px', '& + .MuiSwitch-track': { opacity: 1, backgroundColor: primary } }, '&.Mui-disabled': { '& .MuiSwitch-thumb': { color: secondary }, '& + .MuiSwitch-track': { border: '3px solid', borderColor: secondary, opacity: 1, backgroundColor: containerBackground }, '&$checked': { '& + .MuiSwitch-track': { opacity: 1, backgroundColor: secondary }, '& .MuiSwitch-thumb': { color: containerBackground } } }, '&$checked $thumb': { color: containerBackground } }, thumb: { height: 7, width: 7, margin: 1, boxShadow: 'none', color: primary }, colorSecondary: { '&:hover': { backgroundColor: alpha(containerBackground, 0) }, '&$checked': { '&:hover': { backgroundColor: alpha(containerBackground, 0) } } }, track: { border: '3px solid', borderColor: primary, backgroundColor: containerBackground, borderRadius: 30 / 2, height: 9, opacity: 1 }, checked: {}, disabled: {} }; });
|
|
10105
|
+
var stopPropagateOnClick = function stopPropagateOnClick(e) { e.stopPropagation(); };
|
|
10106
|
+
var Switch = function Switch(_ref105) { var checked = _ref105.checked, label = _ref105.label, onChange = _ref105.onChange, readOnly = _ref105.readOnly; var classes = useStyles$2(); var handleChange = function handleChange(e) { onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked); }; return /*#__PURE__*/ wn.createElement(RowItemCore, { fullWidth: true }, /*#__PURE__*/ wn.createElement(FormControlLabel$1, { control: /*#__PURE__*/ wn.createElement(MUISwitch, { "aria-label": "".concat(checked ? 'Disable' : 'Enable', " ").concat(label), checked: checked, classes: classes, disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, disabled: readOnly, onChange: handleChange, onClick: stopPropagateOnClick }), disabled: readOnly, label: /*#__PURE__*/ wn.createElement(FlexBox, null, label && ( /*#__PURE__*/wn.createElement(Typography, { variant: 'body2', disabled: readOnly }, label))) })); };
|
|
10107
|
+
var makeCheckboxStyles = makeStylesFactory(function (theme) { return { checkbox: { '&:hover, &.Mui-checked:hover': { backgroundColor: 'transparent' }, '&.MuiCheckbox-root': { padding: 0 }, marginRight: theme.spacing(0.5), marginTop: theme.spacing(0.5) }, checkboxContainer: { display: 'flex', alignItems: 'flex-start', marginLeft: theme.spacing(-0.25), width: 'fit-content' } }; });
|
|
10108
|
+
var CheckboxCore = function CheckboxCore(_ref106) { var autoFocus = _ref106.autoFocus, checked = _ref106.checked, disabled = _ref106.disabled, indeterminate = _ref106.indeterminate, label = _ref106.label, onClick = _ref106.onClick, value = _ref106.value, classes = _ref106.classes; var handleChange = function handleChange(e) { onClick === null || onClick === void 0 ? void 0 : onClick(e.target.checked, e.target.name); }; return /*#__PURE__*/ wn.createElement(FormControlLabel$1, { className: classes.checkboxContainer, control: /*#__PURE__*/ wn.createElement(MUICheckbox, { autoFocus: autoFocus, checked: checked, className: classes.checkbox, color: "primary", disableRipple: true, indeterminate: indeterminate, name: value, onChange: handleChange, size: "small" }), disabled: disabled, label: label && ( /*#__PURE__*/wn.createElement("div", { style: { paddingTop: '4px' } }, /*#__PURE__*/ wn.createElement(Typography, { variant: 'body2', disabled: disabled }, label))) }); };
|
|
10109
|
+
var useStyles$1 = makeCheckboxStyles(function (theme) { return { checkbox: { '&.MuiCheckbox-root': { padding: 0, color: theme.styleConfig.colors.primary, '&.Mui-disabled': { color: theme.styleConfig.colors.secondary } } } }; });
|
|
10110
|
+
var Checkbox = function Checkbox(_a) { var props = __rest(_a, []); var classes = useStyles$1(); return /*#__PURE__*/ wn.createElement(CheckboxCore, Object.assign({}, props, { classes: classes })); };
|
|
10111
|
+
var PaddingLeft = He.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-left: 34px;\n"])));
|
|
10112
|
+
var arraysHaveSameContents = function arraysHaveSameContents(arr1, arr2) { if (Array.isArray(arr1) && Array.isArray(arr2)) {
|
|
10113
|
+
if (arr1.length !== arr2.length) {
|
|
10114
|
+
return false;
|
|
10115
|
+
}
|
|
10116
|
+
var array2Sorted = arr2.slice().sort();
|
|
10117
|
+
var isEqual = arr1.slice().sort().every(function (value, index) { return JSON.stringify(value) === JSON.stringify(array2Sorted[index]); });
|
|
10118
|
+
if (!isEqual)
|
|
10119
|
+
return false;
|
|
10120
|
+
return true;
|
|
10121
|
+
} return false; };
|
|
10122
|
+
var allowedAuthMethodsLabelMap = { magic_link: 'Email Magic Links', sso: 'Single Sign-On', google_oauth: 'Google OAuth', microsoft_oauth: 'Microsoft OAuth', password: 'Password' };
|
|
10123
|
+
var allowedMfaMethodsLabelMap = { sms_otp: 'SMS OTP', totp: 'TOTP' };
|
|
10124
|
+
var useMutateAuthSettings$1 = function useMutateAuthSettings$1() { var _useMutateOrganizatio4 = useMutateOrganization(), mutate = _useMutateOrganizatio4.mutate; var setOrgAuthSettings = function setOrgAuthSettings(mutatedProperties) { return mutate(mutatedProperties, { errorMessage: 'Failed to update authorization details.' }); }; return { setOrgAuthSettings: setOrgAuthSettings }; };
|
|
10125
|
+
var OrgSettingsAuthenticationSettingsBody = function OrgSettingsAuthenticationSettingsBody(_ref107) { var orgConfigAuthMethods = _ref107.orgConfigAuthMethods, orgConfigMfaMethods = _ref107.orgConfigMfaMethods, canSetAllowedAuthMethods = _ref107.canSetAllowedAuthMethods, canSetMfaPolicy = _ref107.canSetMfaPolicy, canSetAllowedMfaMethods = _ref107.canSetAllowedMfaMethods, mfaPolicyConfig = _ref107.mfaPolicyConfig, localState = _ref107.localState, setLocalState = _ref107.setLocalState; var _useSettingsContainer5 = useSettingsContainer(), editing = _useSettingsContainer5.editing; var handlePrimaryAuthChange = function handlePrimaryAuthChange(value) { setLocalState(function (prevState) { return Object.assign(Object.assign({}, prevState), { isPrimaryAuthAllAllowed: value }); }); }; var handleMfaPolicyChange = function handleMfaPolicyChange(value) { setLocalState(function (prevState) { return Object.assign(Object.assign({}, prevState), { isMfaPolicyRequiredForAll: value }); }); }; var handleSecondaryAuthChange = function handleSecondaryAuthChange(value) { setLocalState(function (prevState) { return Object.assign(Object.assign({}, prevState), { isSecondaryAuthAllAllowed: value }); }); }; var isAuthMethodChecked = function isAuthMethodChecked(authMethod) { var _a; return (_a = localState.allowedAuthMethods) === null || _a === void 0 ? void 0 : _a.includes(authMethod); }; var isMfaMethodChecked = function isMfaMethodChecked(mfaMethod) { var _a; return (_a = localState.allowedMfaMethods) === null || _a === void 0 ? void 0 : _a.includes(mfaMethod); }; var handleAllowedAuthMethodClick = function handleAllowedAuthMethodClick(authMethod) { if (localState.allowedAuthMethods.includes(authMethod)) {
|
|
10126
|
+
setLocalState(function (prevState) { return Object.assign(Object.assign({}, prevState), { allowedAuthMethods: prevState.allowedAuthMethods.filter(function (method) { return method !== authMethod; }) }); });
|
|
10127
|
+
}
|
|
10128
|
+
else {
|
|
10129
|
+
setLocalState(function (prevState) { return Object.assign(Object.assign({}, prevState), { allowedAuthMethods: [].concat(_toConsumableArray2(prevState.allowedAuthMethods), [authMethod]) }); });
|
|
10130
|
+
} }; var handleAllowedMfaMethodClick = function handleAllowedMfaMethodClick(mfaMethod) { if (localState.allowedMfaMethods.includes(mfaMethod)) {
|
|
10131
|
+
setLocalState(function (prevState) { var _a; return Object.assign(Object.assign({}, prevState), { allowedMfaMethods: (_a = prevState.allowedMfaMethods) === null || _a === void 0 ? void 0 : _a.filter(function (method) { return method !== mfaMethod; }) }); });
|
|
10132
|
+
}
|
|
10133
|
+
else {
|
|
10134
|
+
setLocalState(function (prevState) { var _a; return Object.assign(Object.assign({}, prevState), { allowedMfaMethods: [].concat(_toConsumableArray2((_a = prevState === null || prevState === void 0 ? void 0 : prevState.allowedMfaMethods) !== null && _a !== void 0 ? _a : []), [mfaMethod]) }); });
|
|
10135
|
+
} }; return /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 2 }, /*#__PURE__*/ wn.createElement(SettingsSection, { title: "Primary authentication" }, editing && !localState.isPrimaryAuthAllAllowed && !!localState.allowedAuthMethods && localState.allowedAuthMethods.length === 0 && ( /*#__PURE__*/wn.createElement(Alert, null, 'Please select at least one primary authentication method.')), /*#__PURE__*/ wn.createElement(Switch, { readOnly: !editing || !canSetAllowedAuthMethods, label: 'Allow all primary auth methods', checked: localState.isPrimaryAuthAllAllowed, onChange: handlePrimaryAuthChange }), !localState.isPrimaryAuthAllAllowed && ( /*#__PURE__*/wn.createElement(PaddingLeft, null, /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "row", flexWrap: "wrap" }, orgConfigAuthMethods.map(function (authMethod) { var label = allowedAuthMethodsLabelMap[authMethod]; return /*#__PURE__*/ wn.createElement(Checkbox, { key: authMethod, label: label, disabled: !editing, checked: isAuthMethodChecked(authMethod), onClick: function onClick() { return handleAllowedAuthMethodClick(authMethod); } }); }))))), /*#__PURE__*/ wn.createElement(SettingsSection, { title: "Secondary authentication" }, editing && !localState.isSecondaryAuthAllAllowed && !!localState.allowedMfaMethods && localState.allowedMfaMethods.length === 0 && ( /*#__PURE__*/wn.createElement(Alert, null, 'Please select at least one secondary authentication method.')), /*#__PURE__*/ wn.createElement(Typography, { variant: 'body2' }, 'All members logging in will be required to set up one of the allowed secondary auth methods.'), mfaPolicyConfig && ( /*#__PURE__*/wn.createElement(Switch, { readOnly: !editing || !canSetMfaPolicy, label: 'Require MFA for all users', checked: localState.isMfaPolicyRequiredForAll, onChange: handleMfaPolicyChange })), /*#__PURE__*/ wn.createElement(Switch, { readOnly: !editing || !canSetAllowedMfaMethods, label: 'Allow all secondary auth methods', checked: localState.isSecondaryAuthAllAllowed, onChange: handleSecondaryAuthChange }), !localState.isSecondaryAuthAllAllowed && ( /*#__PURE__*/wn.createElement(PaddingLeft, null, /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "row", flexWrap: "wrap" }, orgConfigMfaMethods.map(function (authMethod) { var label = allowedMfaMethodsLabelMap[authMethod]; return /*#__PURE__*/ wn.createElement(Checkbox, { key: authMethod, label: label, disabled: !editing || !canSetAllowedMfaMethods, checked: isMfaMethodChecked(authMethod), onClick: function onClick() { return handleAllowedMfaMethodClick(authMethod); } }); })))))); };
|
|
10136
|
+
var configAuthMethodMap = { emailMagicLinks: 'magic_link', sso: 'sso', password: 'password', oauthGoogle: 'google_oauth', oauthMicrosoft: 'microsoft_oauth' };
|
|
10137
|
+
var configMfaMethodMap = { smsOtp: 'sms_otp', totp: 'totp' };
|
|
10138
|
+
var OrgSettingsAuthenticationSettingsSection = function OrgSettingsAuthenticationSettingsSection(_ref108) { var orgInfo = _ref108.orgInfo; var _useRbac16 = useRbac('stytch.organization', 'update.settings.allowed-auth-methods'), canSetAllowedAuthMethods = _useRbac16.data; var _useRbac17 = useRbac('stytch.organization', 'update.settings.mfa-policy'), canSetMfaPolicy = _useRbac17.data; var _useRbac18 = useRbac('stytch.organization', 'update.settings.allowed-mfa-methods'), canSetAllowedMfaMethods = _useRbac18.data; var _useMutateAuthSetting = useMutateAuthSettings$1(), setOrgAuthSettings = _useMutateAuthSetting.setOrgAuthSettings; var _useAdminPortalConfig3 = useAdminPortalConfig(), adminPortalConfig = _useAdminPortalConfig3.data; var mfaPolicyConfig = adminPortalConfig === null || adminPortalConfig === void 0 ? void 0 : adminPortalConfig.organization_config.mfa_controls_enabled; var orgUIConfig = useAdminPortalOrgUIConfig(); var _F = F$3(function () { var _a, _b; var authMethods = (_a = orgUIConfig === null || orgUIConfig === void 0 ? void 0 : orgUIConfig.allowedAuthMethods) !== null && _a !== void 0 ? _a : Object.keys(configAuthMethodMap); var mfaMethods = (_b = orgUIConfig === null || orgUIConfig === void 0 ? void 0 : orgUIConfig.allowedMfaAuthMethods) !== null && _b !== void 0 ? _b : Object.keys(configMfaMethodMap); var mappedAuthMethods = authMethods.map(function (method) { return configAuthMethodMap[method]; }).filter(isTruthy); var mappedMfaMethods = mfaMethods.map(function (method) { return configMfaMethodMap[method]; }).filter(isTruthy); return { orgConfigAuthMethods: mappedAuthMethods, orgConfigMfaMethods: mappedMfaMethods }; }, [orgUIConfig === null || orgUIConfig === void 0 ? void 0 : orgUIConfig.allowedAuthMethods, orgUIConfig === null || orgUIConfig === void 0 ? void 0 : orgUIConfig.allowedMfaAuthMethods]), orgConfigAuthMethods = _F.orgConfigAuthMethods, orgConfigMfaMethods = _F.orgConfigMfaMethods; var remoteState = F$3(function () { return { authMethods: orgInfo.auth_methods, allowedAuthMethods: orgInfo.allowed_auth_methods, mfaPolicy: orgInfo.mfa_policy, mfaMethods: orgInfo.mfa_methods, allowedMfaMethods: orgInfo.allowed_mfa_methods, isPrimaryAuthAllAllowed: orgInfo.auth_methods === 'ALL_ALLOWED', isSecondaryAuthAllAllowed: orgInfo.mfa_methods === 'ALL_ALLOWED', isMfaPolicyRequiredForAll: orgInfo.mfa_policy === 'REQUIRED_FOR_ALL' }; }, [orgInfo.allowed_auth_methods, orgInfo.allowed_mfa_methods, orgInfo.auth_methods, orgInfo.mfa_methods, orgInfo.mfa_policy]); var _useFormState5 = useFormState({ remoteState: remoteState }), localState = _useFormState5.localState, setLocalState = _useFormState5.setLocalState, editing = _useFormState5.editing, handleSetEditing = _useFormState5.handleSetEditing; var _useOrgSettingsRouter2 = useOrgSettingsRouterController(), useBlockNavigation = _useOrgSettingsRouter2.useBlockNavigation; var handleSave = T$2(function () { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee19() { var mutatedProperties; return _regeneratorRuntime().wrap(function _callee19$(_context20) { while (1)
|
|
10139
|
+
switch (_context20.prev = _context20.next) {
|
|
10140
|
+
case 0:
|
|
10141
|
+
mutatedProperties = {};
|
|
10142
|
+
if (localState.isPrimaryAuthAllAllowed !== remoteState.isPrimaryAuthAllAllowed) {
|
|
10143
|
+
mutatedProperties.auth_methods = localState.isPrimaryAuthAllAllowed ? 'ALL_ALLOWED' : 'RESTRICTED';
|
|
10144
|
+
}
|
|
10145
|
+
if (!arraysHaveSameContents(localState.allowedAuthMethods, remoteState.allowedAuthMethods)) {
|
|
10146
|
+
mutatedProperties.allowed_auth_methods = localState.allowedAuthMethods;
|
|
10147
|
+
}
|
|
10148
|
+
if (localState.isSecondaryAuthAllAllowed !== remoteState.isSecondaryAuthAllAllowed) {
|
|
10149
|
+
mutatedProperties.mfa_methods = localState.isSecondaryAuthAllAllowed ? 'ALL_ALLOWED' : 'RESTRICTED';
|
|
10150
|
+
}
|
|
10151
|
+
if (!arraysHaveSameContents(localState.allowedMfaMethods, remoteState.allowedMfaMethods)) {
|
|
10152
|
+
mutatedProperties.allowed_mfa_methods = localState.allowedMfaMethods;
|
|
10153
|
+
}
|
|
10154
|
+
if (localState.isMfaPolicyRequiredForAll !== remoteState.isMfaPolicyRequiredForAll) {
|
|
10155
|
+
mutatedProperties.mfa_policy = localState.isMfaPolicyRequiredForAll ? 'REQUIRED_FOR_ALL' : 'OPTIONAL';
|
|
10156
|
+
}
|
|
10157
|
+
if (!(Object.keys(mutatedProperties).length > 0)) {
|
|
10158
|
+
_context20.next = 9;
|
|
10159
|
+
break;
|
|
10160
|
+
}
|
|
10161
|
+
_context20.next = 9;
|
|
10162
|
+
return setOrgAuthSettings(mutatedProperties);
|
|
10163
|
+
case 9:
|
|
10164
|
+
case "end": return _context20.stop();
|
|
10165
|
+
} }, _callee19); })); }, [localState, remoteState, setOrgAuthSettings]); var handleCancel = T$2(function () { setLocalState(remoteState); }, [remoteState, setLocalState]); var disableSave = F$3(function () { var isDeepEqual = arraysHaveSameContents(localState.allowedAuthMethods, remoteState.allowedAuthMethods) && arraysHaveSameContents(localState.allowedMfaMethods, remoteState.allowedMfaMethods) && localState.isPrimaryAuthAllAllowed === remoteState.isPrimaryAuthAllAllowed && localState.isMfaPolicyRequiredForAll === remoteState.isMfaPolicyRequiredForAll && localState.isSecondaryAuthAllAllowed === remoteState.isSecondaryAuthAllAllowed; var allowPrimaryAuth = !localState.isPrimaryAuthAllAllowed && !!localState.allowedAuthMethods && localState.allowedAuthMethods.length === 0; var allowSecondaryAuth = !localState.isSecondaryAuthAllAllowed && localState.allowedMfaMethods && localState.allowedMfaMethods.length === 0; return isDeepEqual || allowPrimaryAuth || allowSecondaryAuth; }, [remoteState, localState]); return /*#__PURE__*/ wn.createElement(SettingsContainer, { title: "Authentication Settings", hasCTA: canSetAllowedAuthMethods || canSetMfaPolicy || canSetAllowedMfaMethods, onSave: handleSave, useBlockNavigation: useBlockNavigation, editing: editing, setEditing: handleSetEditing, disableSave: disableSave, onCancel: handleCancel }, /*#__PURE__*/ wn.createElement(OrgSettingsAuthenticationSettingsBody, { canSetAllowedAuthMethods: canSetAllowedAuthMethods, canSetMfaPolicy: canSetMfaPolicy, canSetAllowedMfaMethods: canSetAllowedMfaMethods, localState: localState, setLocalState: setLocalState, remoteState: remoteState, orgConfigAuthMethods: orgConfigAuthMethods, orgConfigMfaMethods: orgConfigMfaMethods, mfaPolicyConfig: mfaPolicyConfig })); };
|
|
10166
|
+
var roleAssignmentsItemRenderers = function roleAssignmentsItemRenderers(idMap) { return [{ title: 'Role', getValue: function getValue(role) { return /*#__PURE__*/ wn.createElement(Tag, null, role.role_id); } }, { title: 'Number of Sources Assigned', getValue: function getValue(role) { var _a, _b; return /*#__PURE__*/ wn.createElement(Typography, { variant: "body2", color: "secondary" }, String((_b = (_a = idMap[role.role_id]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0)); } }]; };
|
|
10167
|
+
var roleAssigmnentsKeyExtractor = function roleAssigmnentsKeyExtractor(role) { return role.role_id; };
|
|
10168
|
+
var roleItemRendererer = [{ title: 'Source', getValue: function getValue(value) { return /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, value.source); } }, { title: 'Display Name', getValue: function getValue(value) { return /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, value.displayName); } }, { title: 'Groups', getValue: function getValue(value) { return /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, value.source === 'SSO' ? value.groups : ''); } }];
|
|
10169
|
+
var roleKeyExtractor = function roleKeyExtractor(role) { return role.displayName; };
|
|
10170
|
+
var useMutateRoleAssignments = function useMutateRoleAssignments() { var _useMutateOrganizatio5 = useMutateOrganization(), mutate = _useMutateOrganizatio5.mutate; var setOrgEmailAssignments = function setOrgEmailAssignments(_ref109) { var idMap = _ref109.idMap; var rbacEmails = []; Object.entries(idMap).forEach(function (_ref110) { var _ref111 = _slicedToArray2(_ref110, 2), roleId = _ref111[0], values = _ref111[1]; values.forEach(function (value) { if (value.source === 'Email') {
|
|
10171
|
+
rbacEmails.push({ role_id: roleId, domain: value.displayName });
|
|
10172
|
+
} }); }); return mutate({ rbac_email_implicit_role_assignments: rbacEmails }, { errorMessage: 'Failed to update email role assignments.' }); }; return { setOrgEmailAssignments: setOrgEmailAssignments }; };
|
|
10173
|
+
var RoleTable = function RoleTable(_ref112) { var localState = _ref112.localState, remoteState = _ref112.remoteState, editing = _ref112.editing, setLocalState = _ref112.setLocalState, role = _ref112.role, canUpdateSso = _ref112.canUpdateSso; var _a; var roleId = role.role_id; var items = (_a = (editing ? localState : remoteState).idMap[roleId]) !== null && _a !== void 0 ? _a : []; return /*#__PURE__*/ wn.createElement(TableContainer$1, { component: Paper$1, variant: 'outlined' }, /*#__PURE__*/ wn.createElement(Table, { itemRenderer: roleItemRendererer, items: items, rowKeyExtractor: roleKeyExtractor, disableBottomBorder: true, getItemActionProps: editing ? function (roleAssignment) { return { warningAction: roleAssignment.source === 'Email' || roleAssignment.source === 'SSO' && canUpdateSso ? { text: 'Delete', onClick: function onClick() { setLocalState(function (state) { var assignments = state.idMap[roleId].filter(function (item) { return item !== roleAssignment; }); return Object.assign(Object.assign({}, state), { idMap: Object.assign(Object.assign({}, state.idMap), _defineProperty2({}, roleId, assignments)) }); }); } } : undefined }; } : undefined })); };
|
|
10174
|
+
var filterRoleAssignmentsBy = function filterRoleAssignmentsBy(arr, _ref113) { var source = _ref113.source; return arr.slice().filter(function (val) { return val.source === source; }); };
|
|
10175
|
+
var uniqueValuesSplitOnSpaces = function uniqueValuesSplitOnSpaces(_ref114) { var input = _ref114.input; return new Set(input.split(' ').map(function (val) { return val.trim(); }).filter(function (val) { return val.length > 0; })); };
|
|
10176
|
+
var OrgSettingsRoleAssignmentsBody = function OrgSettingsRoleAssignmentsBody(_ref115) { var editing = _ref115.editing, ssoSamlConnections = _ref115.ssoSamlConnections, roles = _ref115.roles, localState = _ref115.localState, remoteState = _ref115.remoteState, setLocalState = _ref115.setLocalState, canUpdateSso = _ref115.canUpdateSso, isSsoEnabled = _ref115.isSsoEnabled; var idMap = (editing ? localState : remoteState).idMap; var rolesWithAssignments = roles.filter(function (role) { return idMap[role.role_id].length > 0; }); var itemRenderers = roleAssignmentsItemRenderers(idMap); var _h101 = h$4(null), _h102 = _slicedToArray2(_h101, 2), selectedRole = _h102[0], setSelectedRole = _h102[1]; var _h103 = h$4(null), _h104 = _slicedToArray2(_h103, 2), selectedSource = _h104[0], setSelectedSource = _h104[1]; var _h105 = h$4(''), _h106 = _slicedToArray2(_h105, 2), emailDomain = _h106[0], setEmailDomain = _h106[1]; var _h107 = h$4([{ id: '', groups: '' }]), _h108 = _slicedToArray2(_h107, 2), ssoRoleAssignments = _h108[0], setSsoRoleAssignments = _h108[1]; var idToHasGroupAttributeMapping = ssoSamlConnections.reduce(function (acc, val) { acc[val.connection_id] = !!val.attribute_mapping.groups; return acc; }, {}); var sourceItems = new Set(['Email']); if (isSsoEnabled && canUpdateSso && ssoSamlConnections.length > 0) {
|
|
10177
|
+
sourceItems.add('SSO');
|
|
10178
|
+
} var sourceSelectItems = Array.from(sourceItems).map(function (source) { return { label: source, value: source }; }); var addRoleAssignmentModalProps = useModalState(function () { if (!selectedSource)
|
|
10179
|
+
return; var roleId = selectedRole; setLocalState(function (state) { var remoteRoleAssignments = _toConsumableArray2(state.idMap[roleId]); var mergedRoleAssignments = _toConsumableArray2(remoteRoleAssignments); var filteredRoleAssignments = filterRoleAssignmentsBy(remoteRoleAssignments, { source: selectedSource }); if (selectedSource === 'Email') {
|
|
10180
|
+
var domains = new Set();
|
|
10181
|
+
filteredRoleAssignments.forEach(function (roleAssignment) { domains.add(roleAssignment.displayName); });
|
|
10182
|
+
uniqueValuesSplitOnSpaces({ input: emailDomain }).forEach(function (domain) { if (!domains.has(domain)) {
|
|
10183
|
+
domains.add(domain);
|
|
10184
|
+
mergedRoleAssignments.push({ source: selectedSource, displayName: domain });
|
|
10185
|
+
} });
|
|
10186
|
+
}
|
|
10187
|
+
else if (selectedSource === 'SSO') {
|
|
10188
|
+
var idToGroups = {};
|
|
10189
|
+
filteredRoleAssignments.forEach(function (ssoRoleAssignment) { idToGroups[ssoRoleAssignment.id] = new Set([ssoRoleAssignment.groups]); });
|
|
10190
|
+
ssoRoleAssignments.forEach(function (ssoConnection) { var connectionId = ssoConnection.id; if (connectionId.length !== 0) {
|
|
10191
|
+
uniqueValuesSplitOnSpaces({ input: ssoConnection.groups }).forEach(function (group) { var _a, _b; if (!idToGroups[connectionId]) {
|
|
10192
|
+
idToGroups[connectionId] = new Set();
|
|
10193
|
+
} if (!idToGroups[connectionId].has(group)) {
|
|
10194
|
+
mergedRoleAssignments.push({ source: selectedSource, displayName: (_b = (_a = ssoSamlConnections.find(function (val) { return val.connection_id === connectionId; })) === null || _a === void 0 ? void 0 : _a.display_name) !== null && _b !== void 0 ? _b : '', id: ssoConnection.id, groups: group });
|
|
10195
|
+
idToGroups[ssoConnection.id].add(group);
|
|
10196
|
+
} });
|
|
10197
|
+
} });
|
|
10198
|
+
} if (mergedRoleAssignments.length !== remoteRoleAssignments.length) {
|
|
10199
|
+
return Object.assign(Object.assign({}, state), { idMap: Object.assign(Object.assign({}, state.idMap), _defineProperty2({}, roleId, mergedRoleAssignments)) });
|
|
10200
|
+
} return state; }); }); var showInputContent = !!selectedRole && !!selectedSource; var disableConfirm = !showInputContent || selectedSource === 'Email' && emailDomain.length === 0 || selectedSource === 'SSO' && ssoRoleAssignments.every(function (connection) { return !connection.id; }); var roleSelectItems = F$3(function () { return roles.map(function (role) { return { label: role.role_id, value: role.role_id }; }); }, [roles]); var selectedSsoRoleAssignmentIds = ssoRoleAssignments.map(function (connection) { return connection.id; }); var ssoGroupSelectItems = function ssoGroupSelectItems(currentId) { return ssoSamlConnections.filter(function (_ref116) { var id = _ref116.connection_id; return !selectedSsoRoleAssignmentIds.includes(id) || id === currentId; }).map(function (_ref117) { var id = _ref117.connection_id, displayName = _ref117.display_name; return { label: displayName, value: id }; }); }; var sourceToInputContentMap = { Email: ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(SettingsSection, { title: "Email Domain" }, /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, "Separate domains by a single space to assign to multiple email domains."), /*#__PURE__*/ wn.createElement(Input$1, { label: "Domain", fullWidth: true, value: emailDomain, onChange: setEmailDomain })))), SSO: ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(SettingsSection, { title: "SSO" }, /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, "Enter a Group name to assign a Role at the Group level, or leave blank to assign at the SSO connection level. Separate groups by a single space to assign to multiple groups."), ssoRoleAssignments.map(function (_ref118, index) { var id = _ref118.id, groups = _ref118.groups; var isValidConnection = !!id; var connectionHasGroupMapping = !!idToHasGroupAttributeMapping[id]; var isValidConnectionWithGroupMapping = isValidConnection && connectionHasGroupMapping; var disableGroupInput = !isValidConnectionWithGroupMapping; var groupInputPlaceholder = isValidConnection && !connectionHasGroupMapping ? 'Add a "groups" key first' : 'Enter or leave blank'; var groupInputCaption = isValidConnection && !connectionHasGroupMapping ? 'Add a "groups" key in the SSO Attribute Mapping first to assign group roles.' : undefined; return /*#__PURE__*/ wn.createElement(FlexBox, { key: index, flexDirection: "row", gap: 2, alignItems: "flex-start" }, /*#__PURE__*/ wn.createElement("div", null, /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, "Connection Display Name"), /*#__PURE__*/ wn.createElement(Select, { width: 250, placeholder: "Select", selectItems: selectedRole ? ssoGroupSelectItems(id) : [], value: id, onChange: function onChange(val) { setSsoRoleAssignments(function (connections) { return connections.map(function (connection, currentIndex) { if (currentIndex === index) {
|
|
10201
|
+
return Object.assign(Object.assign({}, connection), { id: val });
|
|
10202
|
+
} return connection; }); }); } })), /*#__PURE__*/ wn.createElement(Input$1, { label: "Group name", value: groups, disabled: disableGroupInput, placeholder: groupInputPlaceholder, caption: groupInputCaption, onChange: function onChange(val) { setSsoRoleAssignments(function (connections) { return connections.map(function (connection, currentIndex) { var _a; if (currentIndex === index) {
|
|
10203
|
+
return Object.assign(Object.assign({}, connection), { groups: val, id: id, hasGroupAttributeMapping: !!((_a = ssoSamlConnections.find(function (ssoSamlConnection) { return ssoSamlConnection.connection_id === val; })) === null || _a === void 0 ? void 0 : _a.attribute_mapping.groups) });
|
|
10204
|
+
} return connection; }); }); } })); }), /*#__PURE__*/ wn.createElement(Button, { variant: "text", startIcon: /*#__PURE__*/ wn.createElement(default_1$6, null), compact: true, disabled: ssoRoleAssignments.length >= ssoSamlConnections.length, onClick: function onClick() { setSsoRoleAssignments(function (connections) { return [].concat(_toConsumableArray2(connections), [{ id: '', groups: '' }]); }); } }, "Add SSO Role assignment")))) }; return /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 1 }, /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, addRoleAssignmentModalProps, { title: "Add Role assignment", confirmButtonText: "Save", disableConfirm: disableConfirm, close: function close() { addRoleAssignmentModalProps.close(); setSelectedRole(null); setSelectedSource(null); setEmailDomain(''); setSsoRoleAssignments([{ id: '', groups: '' }]); } }), /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 2 }, /*#__PURE__*/ wn.createElement(Select, { label: "Select Role", selectItems: roleSelectItems, value: selectedRole, onChange: function onChange(val) { setSelectedRole(val); }, placeholder: "Select Role" }), /*#__PURE__*/ wn.createElement(Select, { label: "Select Source", selectItems: sourceSelectItems, value: selectedSource, placeholder: "Select Source", onChange: function onChange(val) { setSelectedSource(val); } }), showInputContent && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(Divider$1, null), sourceToInputContentMap[selectedSource])))), editing && ( /*#__PURE__*/wn.createElement(FlexBox, { justifyContent: "flex-end" }, /*#__PURE__*/ wn.createElement(Button, { variant: "text", startIcon: /*#__PURE__*/ wn.createElement(default_1$6, null), compact: true, onClick: addRoleAssignmentModalProps.open }, "Add Role assignment"))), rolesWithAssignments.length > 0 ? ( /*#__PURE__*/wn.createElement(Table, { itemRenderer: itemRenderers, items: rolesWithAssignments, rowKeyExtractor: roleAssigmnentsKeyExtractor, ExpandedContent: function ExpandedContent(_ref119) { var role = _ref119.data; return /*#__PURE__*/ wn.createElement(RoleTable, { role: role, editing: editing, setLocalState: setLocalState, localState: localState, remoteState: remoteState, canUpdateSso: canUpdateSso }); } })) : ( /*#__PURE__*/wn.createElement(Typography, { variant: "body2" }, "No role assignments."))); };
|
|
10205
|
+
var OrgSettingsRoleAssignmentsSection = function OrgSettingsRoleAssignmentsSection(_ref120) { var orgInfo = _ref120.orgInfo; var _a, _b; var _useAdminPortalConfig4 = useAdminPortalConfig(), adminPortalConfig = _useAdminPortalConfig4.data; var isSsoEnabled = (_a = adminPortalConfig === null || adminPortalConfig === void 0 ? void 0 : adminPortalConfig.sso_config.sso_enabled) !== null && _a !== void 0 ? _a : false; var _useRbac19 = useRbac('stytch.organization', 'update.settings.implicit-roles'), canSetRoles = _useRbac19.data; var _useRbac20 = useRbac('stytch.sso', 'get'), canGetSso = _useRbac20.data; var _useRbac21 = useRbac('stytch.sso', 'update'), canUpdateSso = _useRbac21.data; var _useSsoConnections2 = useSsoConnections(isSsoEnabled && !!canGetSso), ssoConnections = _useSsoConnections2.data, isLoading = _useSsoConnections2.isLoading; var b2bInterals = useB2BInternals(); var _h109 = h$4((_b = b2bInterals.bootstrap.getSync().rbacPolicy) === null || _b === void 0 ? void 0 : _b.roles), _h110 = _slicedToArray2(_h109, 2), roles = _h110[0], setRoles = _h110[1]; p$3(function () { b2bInterals.bootstrap.getAsync().then(function (value) { var _a; setRoles((_a = value.rbacPolicy) === null || _a === void 0 ? void 0 : _a.roles); }); }); var sortedRoles = F$3(function () { var _a; return (_a = roles === null || roles === void 0 ? void 0 : roles.slice().sort(function (a, b) { if (a.role_id === 'stytch_admin') {
|
|
10206
|
+
return -1;
|
|
10207
|
+
} if (b.role_id === 'stytch_admin') {
|
|
10208
|
+
return 1;
|
|
10209
|
+
} if (a.role_id === 'stytch_member') {
|
|
10210
|
+
return -1;
|
|
10211
|
+
} if (b.role_id === 'stytch_member') {
|
|
10212
|
+
return 1;
|
|
10213
|
+
} return a.role_id.localeCompare(b.role_id); })) !== null && _a !== void 0 ? _a : []; }, [roles]); var rbacEmails = orgInfo.rbac_email_implicit_role_assignments; var connections = ssoConnections === null || ssoConnections === void 0 ? void 0 : ssoConnections.saml_connections; var _useMutateRoleAssignm = useMutateRoleAssignments(), setOrgEmailAssignments = _useMutateRoleAssignm.setOrgEmailAssignments; var _useMutateSsoConnecti5 = useMutateSsoConnection('saml'), mutate = _useMutateSsoConnecti5.mutate; var idMap = F$3(function () { var idToRoleAssignments = {}; sortedRoles.forEach(function (role) { idToRoleAssignments[role.role_id] = []; }); connections === null || connections === void 0 ? void 0 : connections.forEach(function (ssoSamlConnection) { var connectionRoleAssignments = ssoSamlConnection.saml_connection_implicit_role_assignments; var groupRoleAssignments = ssoSamlConnection.saml_group_implicit_role_assignments; connectionRoleAssignments.forEach(function (implicitRole) { var role = implicitRole.role_id; if (!idToRoleAssignments[role]) {
|
|
10214
|
+
idToRoleAssignments[role] = [];
|
|
10215
|
+
} idToRoleAssignments[role].push({ source: 'SSO', displayName: ssoSamlConnection.display_name, id: ssoSamlConnection.connection_id, groups: '' }); }); groupRoleAssignments.forEach(function (implicitRole) { var role = implicitRole.role_id; if (!idToRoleAssignments[role]) {
|
|
10216
|
+
idToRoleAssignments[role] = [];
|
|
10217
|
+
} idToRoleAssignments[role].push({ source: 'SSO', displayName: ssoSamlConnection.display_name, id: ssoSamlConnection.connection_id, groups: implicitRole.group }); }); }); rbacEmails === null || rbacEmails === void 0 ? void 0 : rbacEmails.forEach(function (rbacEmail) { var role = rbacEmail.role_id; if (!idToRoleAssignments[role]) {
|
|
10218
|
+
idToRoleAssignments[role] = [];
|
|
10219
|
+
} idToRoleAssignments[role].push({ source: 'Email', displayName: rbacEmail.domain }); }); return idToRoleAssignments; }, [connections, rbacEmails, sortedRoles]); var remoteState = { idMap: idMap }; var _useFormState6 = useFormState({ remoteState: remoteState }), localState = _useFormState6.localState, setLocalState = _useFormState6.setLocalState, editing = _useFormState6.editing, handleSetEditing = _useFormState6.handleSetEditing; var _useOrgSettingsRouter3 = useOrgSettingsRouterController(), useBlockNavigation = _useOrgSettingsRouter3.useBlockNavigation; var disableSave = false; var handleSave = function handleSave() { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee21() { var mutatedConnections, copyConnections; return _regeneratorRuntime().wrap(function _callee21$(_context22) { while (1)
|
|
10220
|
+
switch (_context22.prev = _context22.next) {
|
|
10221
|
+
case 0:
|
|
10222
|
+
if (!canSetRoles) {
|
|
10223
|
+
_context22.next = 10;
|
|
10224
|
+
break;
|
|
10225
|
+
}
|
|
10226
|
+
_context22.next = 3;
|
|
10227
|
+
return setOrgEmailAssignments(localState);
|
|
10228
|
+
case 3:
|
|
10229
|
+
if (!canUpdateSso) {
|
|
10230
|
+
_context22.next = 10;
|
|
10231
|
+
break;
|
|
10232
|
+
}
|
|
10233
|
+
mutatedConnections = {};
|
|
10234
|
+
copyConnections = {};
|
|
10235
|
+
connections === null || connections === void 0 ? void 0 : connections.forEach(function (val) { var shallow = Object.assign({}, { connection_id: val.connection_id, saml_connection_implicit_role_assignments: val.saml_connection_implicit_role_assignments, saml_group_implicit_role_assignments: val.saml_group_implicit_role_assignments }); copyConnections[val.connection_id] = Object.assign({}, shallow); shallow.saml_connection_implicit_role_assignments = []; shallow.saml_group_implicit_role_assignments = []; mutatedConnections[val.connection_id] = shallow; });
|
|
10236
|
+
Object.entries(localState.idMap).forEach(function (_ref121) { var _ref122 = _slicedToArray2(_ref121, 2), roleId = _ref122[0], roleAssignments = _ref122[1]; roleAssignments.forEach(function (roleAssignment) { if (roleAssignment.source === 'SSO') {
|
|
10237
|
+
var connectionId = roleAssignment.id;
|
|
10238
|
+
if (roleAssignment.groups) {
|
|
10239
|
+
mutatedConnections[connectionId].saml_group_implicit_role_assignments.push({ role_id: roleId, group: roleAssignment.groups });
|
|
10240
|
+
}
|
|
10241
|
+
else {
|
|
10242
|
+
mutatedConnections[connectionId].saml_connection_implicit_role_assignments.push({ role_id: roleId });
|
|
10243
|
+
}
|
|
10244
|
+
} }); });
|
|
10245
|
+
_context22.next = 10;
|
|
10246
|
+
return Promise.all(Object.entries(mutatedConnections).map(function (_ref123) { var _ref124 = _slicedToArray2(_ref123, 2), connectionId = _ref124[0], mutatedConnection = _ref124[1]; return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee20() { var originalConnection; return _regeneratorRuntime().wrap(function _callee20$(_context21) { while (1)
|
|
10247
|
+
switch (_context21.prev = _context21.next) {
|
|
10248
|
+
case 0:
|
|
10249
|
+
originalConnection = copyConnections[connectionId];
|
|
10250
|
+
if (!(!arraysHaveSameContents(mutatedConnection.saml_connection_implicit_role_assignments.map(function (val) { return val.role_id; }), originalConnection.saml_connection_implicit_role_assignments.map(function (val) { return val.role_id; })) || !arraysHaveSameContents(mutatedConnection.saml_group_implicit_role_assignments.map(function (val) { return _defineProperty2({}, val.role_id, val.group); }), originalConnection.saml_group_implicit_role_assignments.map(function (val) { return _defineProperty2({}, val.role_id, val.group); })))) {
|
|
10251
|
+
_context21.next = 4;
|
|
10252
|
+
break;
|
|
10253
|
+
}
|
|
10254
|
+
_context21.next = 4;
|
|
10255
|
+
return mutate(Object.assign({}, mutatedConnection));
|
|
10256
|
+
case 4:
|
|
10257
|
+
case "end": return _context21.stop();
|
|
10258
|
+
} }, _callee20); })); }));
|
|
10259
|
+
case 10:
|
|
10260
|
+
case "end": return _context22.stop();
|
|
10261
|
+
} }, _callee21); })); }; if (isLoading && canGetSso) {
|
|
10262
|
+
return /*#__PURE__*/ wn.createElement(PageLoadingIndicator, null);
|
|
10263
|
+
} return /*#__PURE__*/ wn.createElement(SettingsContainer, { title: "Role assignments", hasCTA: canSetRoles, onSave: handleSave, useBlockNavigation: useBlockNavigation, editing: editing, setEditing: handleSetEditing, disableSave: disableSave }, /*#__PURE__*/ wn.createElement(OrgSettingsRoleAssignmentsBody, { editing: editing, remoteState: remoteState, localState: localState, setLocalState: setLocalState, ssoSamlConnections: connections !== null && connections !== void 0 ? connections : [], roles: sortedRoles, canUpdateSso: !!canUpdateSso, isSsoEnabled: isSsoEnabled })); };
|
|
10264
|
+
var RadioCore = function RadioCore(_ref127) { var autoFocus = _ref127.autoFocus, checked = _ref127.checked, disabled = _ref127.disabled, label = _ref127.label, onClick = _ref127.onClick, value = _ref127.value, classes = _ref127.classes; var handleChange = function handleChange(e) { onClick === null || onClick === void 0 ? void 0 : onClick(e.target.value); }; return /*#__PURE__*/ wn.createElement(FormControlLabel$1, { control: /*#__PURE__*/ wn.createElement(MUIRadio, { autoFocus: autoFocus, checked: checked, classes: classes, disableRipple: true, onChange: handleChange, color: "primary", size: "small", value: value }), disabled: disabled, label: /*#__PURE__*/ wn.createElement(FlexBox, null, label && ( /*#__PURE__*/wn.createElement(Typography, { variant: 'body2', disabled: disabled }, label))) }); };
|
|
10265
|
+
var makeRadioGroupStyles = makeStylesFactory(function (theme) { return { radioGroup: { display: 'flex', flexDirection: 'column', gap: theme.spacing(0.5) } }; });
|
|
10266
|
+
var RadioGroupCore = function RadioGroupCore(_ref128) { var id = _ref128.id, items = _ref128.items, onChange = _ref128.onChange, readOnly = _ref128.readOnly, value = _ref128.value, classes = _ref128.classes; var radioGroupId = useShortId(id); var onClick = function onClick(value) { onChange === null || onChange === void 0 ? void 0 : onChange(value); }; return /*#__PURE__*/ wn.createElement(RowItemCore, { fullWidth: true }, /*#__PURE__*/ wn.createElement(FormGroup$1, { className: classes.radioGroup, id: radioGroupId }, items.map(function (item) { return /*#__PURE__*/ wn.createElement(RadioCore, Object.assign({}, item, { classes: Object.assign(Object.assign({}, classes), { checkbox: '', root: '', checkboxContainer: '' }), checked: item.value === value, disabled: item.disabled || readOnly, key: item.value, onClick: onClick, label: item.label })); }))); };
|
|
10267
|
+
var useStyles = makeRadioGroupStyles(function (theme) { return { radioGroup: { display: 'flex', flexDirection: 'row', gap: theme.spacing(0.5) } }; });
|
|
10268
|
+
var RadioGroup = function RadioGroup(props) { var classes = useStyles(props); return /*#__PURE__*/ wn.createElement(RadioGroupCore, Object.assign({ classes: classes }, props)); };
|
|
10269
|
+
var useMutateAuthSettings = function useMutateAuthSettings() { var _useMutateOrganizatio6 = useMutateOrganization(), mutate = _useMutateOrganizatio6.mutate; var setOrgAuthSettings = function setOrgAuthSettings(mutatedProperties) { return mutate(mutatedProperties, { errorMessage: 'Failed to update email domain details.' }); }; return { setOrgAuthSettings: setOrgAuthSettings }; };
|
|
10270
|
+
var emailAllowedDomainsRenderer = [{ title: 'Domain', getValue: function getValue(email) { return /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, email); } }];
|
|
10271
|
+
var emailInvitesLabelMap = { ALL_ALLOWED: 'Anybody', RESTRICTED: 'Users from allowed email domains' };
|
|
10272
|
+
var EmailDomainsTable = function EmailDomainsTable(_ref129) { var localState = _ref129.localState, remoteState = _ref129.remoteState, setLocalState = _ref129.setLocalState, canSetAllowedDomains = _ref129.canSetAllowedDomains, editing = _ref129.editing; var emailAllowedDomains = editing ? localState.emailAllowedDomains : remoteState.emailAllowedDomains; var _h111 = h$4(''), _h112 = _slicedToArray2(_h111, 2), email = _h112[0], setEmail = _h112[1]; var addEmailModalProps = useModalState(function () { setLocalState(function (state) { return Object.assign(Object.assign({}, state), { emailAllowedDomains: _toConsumableArray2(new Set([].concat(_toConsumableArray2(localState.emailAllowedDomains), [email]))) }); }); setEmail(''); }); return /*#__PURE__*/ wn.createElement(SettingsSection, { title: "Allowed email domains" }, /*#__PURE__*/ wn.createElement(Modal, Object.assign({}, addEmailModalProps, { title: "Add allowed email domain" }), /*#__PURE__*/ wn.createElement(Input$1, { label: "Domain", onChange: setEmail, placeholder: "Enter domain", value: email })), /*#__PURE__*/ wn.createElement(ListEditor, { items: emailAllowedDomains !== null && emailAllowedDomains !== void 0 ? emailAllowedDomains : [], itemRenderer: emailAllowedDomainsRenderer, onAdd: function onAdd() { addEmailModalProps.open(); }, getItemActionProps: editing && canSetAllowedDomains ? function (item) { return { warningAction: { text: 'Delete', onClick: function onClick() { setEmail(''); setLocalState(function (prevState) { return Object.assign(Object.assign({}, prevState), { emailAllowedDomains: localState.emailAllowedDomains.filter(function (domain) { return domain !== item; }) }); }); } } }; } : undefined, hideAddButton: !canSetAllowedDomains || !editing, addButtonText: "Add Domain" })); };
|
|
10273
|
+
var OrgSettingsEmailDomainsBody = function OrgSettingsEmailDomainsBody(_ref130) { var canSetEmailInvites = _ref130.canSetEmailInvites, canSetEmailJitProvisioning = _ref130.canSetEmailJitProvisioning, canSetAllowedDomains = _ref130.canSetAllowedDomains, localState = _ref130.localState, remoteState = _ref130.remoteState, setLocalState = _ref130.setLocalState; var _useSettingsContainer6 = useSettingsContainer(), editing = _useSettingsContainer6.editing; var handleJitProvisioningChange = useStateSliceSetter(setLocalState, 'isEmailJitProvisioningAllowed'); var handleEmailInvitesChange = useStateSliceSetter(setLocalState, 'emailInvites'); return /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 2 }, /*#__PURE__*/ wn.createElement(SettingsSection, { title: "Email Invites" }, /*#__PURE__*/ wn.createElement(Switch, { readOnly: !editing || !canSetEmailInvites, label: 'Allow inviting members to your organization via allowed email domains', checked: localState.emailInvites !== 'NOT_ALLOWED', onChange: function onChange(value) { return handleEmailInvitesChange(value ? 'ALL_ALLOWED' : 'NOT_ALLOWED'); } }), localState.emailInvites !== 'NOT_ALLOWED' && ( /*#__PURE__*/wn.createElement(PaddingLeft, null, /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "row", flexWrap: "wrap" }, /*#__PURE__*/ wn.createElement(RadioGroup, { onChange: handleEmailInvitesChange, value: localState.emailInvites, items: Object.entries(emailInvitesLabelMap).map(function (_ref131) { var _ref132 = _slicedToArray2(_ref131, 2), value = _ref132[0], label = _ref132[1]; return { value: value, label: label, disabled: !editing || !canSetEmailInvites }; }) }))))), /*#__PURE__*/ wn.createElement(SettingsSection, { title: "JIT Provisioning", tooltipText: "If enabled, users who successfully authenticate via allowed email domains will be automatically granted an account if they do not already exist within your organization." }, /*#__PURE__*/ wn.createElement(Switch, { readOnly: !editing || !canSetEmailJitProvisioning, label: 'Allow JIT provisioning for users from allowed email domains', checked: localState.isEmailJitProvisioningAllowed, onChange: handleJitProvisioningChange })), /*#__PURE__*/ wn.createElement(EmailDomainsTable, { localState: localState, remoteState: remoteState, setLocalState: setLocalState, canSetAllowedDomains: canSetAllowedDomains, editing: editing, manualConfiguration: false })); };
|
|
10274
|
+
var OrgSettingsEmailDomainsSection = function OrgSettingsEmailDomainsSection(_ref133) { var orgInfo = _ref133.orgInfo; var _useRbac22 = useRbac('stytch.organization', 'update.settings.email-jit-provisioning'), canSetEmailJitProvisioning = _useRbac22.data; var _useRbac23 = useRbac('stytch.organization', 'update.settings.email-invites'), canSetEmailInvites = _useRbac23.data; var _useRbac24 = useRbac('stytch.organization', 'update.settings.allowed-domains'), canSetAllowedDomains = _useRbac24.data; var remoteState = F$3(function () { return { emailInvites: orgInfo.email_invites, emailAllowedDomains: orgInfo.email_allowed_domains, isEmailJitProvisioningAllowed: orgInfo.email_jit_provisioning !== 'NOT_ALLOWED' }; }, [orgInfo]); var _useFormState7 = useFormState({ remoteState: remoteState }), localState = _useFormState7.localState, setLocalState = _useFormState7.setLocalState, editing = _useFormState7.editing, handleSetEditing = _useFormState7.handleSetEditing; var _useMutateAuthSetting2 = useMutateAuthSettings(), setOrgAuthSettings = _useMutateAuthSetting2.setOrgAuthSettings; var _useOrgSettingsRouter4 = useOrgSettingsRouterController(), useBlockNavigation = _useOrgSettingsRouter4.useBlockNavigation; var handleSave = T$2(function () { return __awaiter(void 0, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee22() { var mutatedProperties; return _regeneratorRuntime().wrap(function _callee22$(_context23) { while (1)
|
|
10275
|
+
switch (_context23.prev = _context23.next) {
|
|
10276
|
+
case 0:
|
|
10277
|
+
mutatedProperties = {};
|
|
10278
|
+
if (localState.isEmailJitProvisioningAllowed !== remoteState.isEmailJitProvisioningAllowed) {
|
|
10279
|
+
mutatedProperties.email_jit_provisioning = localState.isEmailJitProvisioningAllowed ? 'RESTRICTED' : 'NOT_ALLOWED';
|
|
10280
|
+
}
|
|
10281
|
+
if (localState.emailInvites !== remoteState.emailInvites) {
|
|
10282
|
+
mutatedProperties.email_invites = localState.emailInvites;
|
|
10283
|
+
}
|
|
10284
|
+
if (!arraysHaveSameContents(localState.emailAllowedDomains, remoteState.emailAllowedDomains)) {
|
|
10285
|
+
mutatedProperties.email_allowed_domains = localState.emailAllowedDomains;
|
|
10286
|
+
}
|
|
10287
|
+
if (!(Object.keys(mutatedProperties).length > 0)) {
|
|
10288
|
+
_context23.next = 7;
|
|
10289
|
+
break;
|
|
10290
|
+
}
|
|
10291
|
+
_context23.next = 7;
|
|
10292
|
+
return setOrgAuthSettings(mutatedProperties);
|
|
10293
|
+
case 7:
|
|
10294
|
+
case "end": return _context23.stop();
|
|
10295
|
+
} }, _callee22); })); }, [localState.emailAllowedDomains, localState.emailInvites, localState.isEmailJitProvisioningAllowed, remoteState.emailAllowedDomains, remoteState.emailInvites, remoteState.isEmailJitProvisioningAllowed, setOrgAuthSettings]); var disableSave = F$3(function () { return arraysHaveSameContents(localState.emailAllowedDomains, remoteState.emailAllowedDomains) && localState.emailInvites === remoteState.emailInvites && localState.isEmailJitProvisioningAllowed === remoteState.isEmailJitProvisioningAllowed; }, [localState.emailAllowedDomains, localState.emailInvites, localState.isEmailJitProvisioningAllowed, remoteState.emailAllowedDomains, remoteState.emailInvites, remoteState.isEmailJitProvisioningAllowed]); return /*#__PURE__*/ wn.createElement(SettingsContainer, { title: "Email Domain Settings", hasCTA: canSetEmailJitProvisioning || canSetEmailInvites || canSetAllowedDomains, onSave: handleSave, useBlockNavigation: useBlockNavigation, editing: editing, setEditing: handleSetEditing, disableSave: disableSave }, /*#__PURE__*/ wn.createElement(OrgSettingsEmailDomainsBody, { canSetEmailJitProvisioning: canSetEmailJitProvisioning, canSetEmailInvites: canSetEmailInvites, canSetAllowedDomains: canSetAllowedDomains, localState: localState, remoteState: remoteState, setLocalState: setLocalState })); };
|
|
10296
|
+
var OrgSettingsScreen = function OrgSettingsScreen() { var _useOrgInfo3 = useOrgInfo(), isLoading = _useOrgInfo3.isLoading, error = _useOrgInfo3.error, orgInfo = _useOrgInfo3.data; if (isLoading) {
|
|
10297
|
+
return /*#__PURE__*/ wn.createElement(PageLoadingIndicator, null);
|
|
10298
|
+
} if (error) {
|
|
10299
|
+
return /*#__PURE__*/ wn.createElement(Alert, null, extractErrorMessage(error));
|
|
10300
|
+
} return /*#__PURE__*/ wn.createElement(FlexBox, { flexDirection: "column", gap: 3 }, /*#__PURE__*/ wn.createElement(Typography, { variant: "h2" }, "Organization Settings"), orgInfo && ( /*#__PURE__*/wn.createElement(wn.Fragment, null, /*#__PURE__*/ wn.createElement(OrgSettingsDetailsSection, { orgInfo: orgInfo }), /*#__PURE__*/ wn.createElement(OrgSettingsAuthenticationSettingsSection, { orgInfo: orgInfo }), /*#__PURE__*/ wn.createElement(OrgSettingsEmailDomainsSection, { orgInfo: orgInfo }), /*#__PURE__*/ wn.createElement(OrgSettingsRoleAssignmentsSection, { orgInfo: orgInfo })))); };
|
|
10301
|
+
var validateConfig = function validateConfig(config) { if (!config)
|
|
10302
|
+
return; if (config.allowedAuthMethods.length === 0) {
|
|
10303
|
+
throw new Error('allowedAuthMethods must contain at least one value');
|
|
10304
|
+
} if (config.allowedMfaAuthMethods.length === 0) {
|
|
10305
|
+
throw new Error('mfaAuthMethods must contain at least one value');
|
|
10306
|
+
} };
|
|
10307
|
+
var AdminPortalB2BProducts;
|
|
10308
|
+
(function (AdminPortalB2BProducts) { AdminPortalB2BProducts["emailMagicLinks"] = "emailMagicLinks"; AdminPortalB2BProducts["sso"] = "sso"; AdminPortalB2BProducts["password"] = "password"; AdminPortalB2BProducts["oauthGoogle"] = "oauthGoogle"; AdminPortalB2BProducts["oauthMicrosoft"] = "oauthMicrosoft"; })(AdminPortalB2BProducts || (AdminPortalB2BProducts = {}));
|
|
10309
|
+
var routeMap = { orgSettingsScreen: OrgSettingsScreen };
|
|
10310
|
+
var initialRoute = { screen: 'orgSettingsScreen' };
|
|
10311
|
+
var Content = function Content() { var _useAdminPortalConfig5 = useAdminPortalConfig(), adminPortalConfigError = _useAdminPortalConfig5.error, isLoading = _useAdminPortalConfig5.isLoading; if (adminPortalConfigError) {
|
|
10312
|
+
return /*#__PURE__*/ wn.createElement(Alert, null, "Organization Settings could not be loaded. Please contact your admin if you think this is a mistake.");
|
|
10313
|
+
} if (isLoading) {
|
|
10314
|
+
return /*#__PURE__*/ wn.createElement(PageLoadingIndicator, null);
|
|
10315
|
+
} return /*#__PURE__*/ wn.createElement(OrgSettingsRouterProvider, { initialRoute: initialRoute }, /*#__PURE__*/ wn.createElement(OrgSettingsRouter, { routeMap: routeMap })); };
|
|
10316
|
+
var AdminPortalOrgSettings$1 = function AdminPortalOrgSettings(props) { var uiConfig = useAdminPortalOrgUIConfig(); var initialClient = _$1(props.client); p$3(function () { readB2BInternals(initialClient.current).networkClient.logEvent({ name: 'render_b2b_admin_portal_org_settings', details: {} }); }, []); p$3(function () { validateConfig(uiConfig); }, [uiConfig]); return /*#__PURE__*/ wn.createElement(AdminPortalWrapper, { options: props }, /*#__PURE__*/ wn.createElement(Content, null)); };
|
|
10317
|
+
var mountAdminPortalOrgSettings = makeAdminPortalComponentMountFn(AdminPortalOrgSettings$1, 'stytch-b2b-admin-portal-org-settings-ui', 'mountAdminPortalOrgSettings');
|
|
9494
10318
|
|
|
9495
10319
|
const makeAdminPortalComponent = (mountFn, componentName) => {
|
|
9496
10320
|
const Component = (props) => {
|
|
@@ -9516,4 +10340,12 @@ const makeAdminPortalComponent = (mountFn, componentName) => {
|
|
|
9516
10340
|
*/
|
|
9517
10341
|
const AdminPortalSSO = makeAdminPortalComponent(mountAdminPortalSSO, 'AdminPortalSSO');
|
|
9518
10342
|
|
|
9519
|
-
|
|
10343
|
+
/**
|
|
10344
|
+
* The Admin Portal Organization Settings UI component.
|
|
10345
|
+
* This component must be rendered within a {@link StytchB2BProvider}.
|
|
10346
|
+
*
|
|
10347
|
+
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
10348
|
+
*/
|
|
10349
|
+
const AdminPortalOrgSettings = makeAdminPortalComponent(mountAdminPortalOrgSettings, 'AdminPortalOrgSettings');
|
|
10350
|
+
|
|
10351
|
+
export { AdminPortalB2BProducts, AdminPortalOrgSettings, AdminPortalSSO };
|