@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
|
@@ -269,13 +269,13 @@ var B2BOAuthProviders;
|
|
|
269
269
|
B2BOAuthProviders["Google"] = "google";
|
|
270
270
|
B2BOAuthProviders["Microsoft"] = "microsoft";
|
|
271
271
|
})(B2BOAuthProviders || (B2BOAuthProviders = {}));
|
|
272
|
-
function _slicedToArray$
|
|
273
|
-
return _arrayWithHoles$
|
|
272
|
+
function _slicedToArray$3(arr, i) {
|
|
273
|
+
return _arrayWithHoles$3(arr) || _iterableToArrayLimit$3(arr, i) || _unsupportedIterableToArray$4(arr, i) || _nonIterableRest$3();
|
|
274
274
|
}
|
|
275
|
-
function _nonIterableRest$
|
|
275
|
+
function _nonIterableRest$3() {
|
|
276
276
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
277
277
|
}
|
|
278
|
-
function _iterableToArrayLimit$
|
|
278
|
+
function _iterableToArrayLimit$3(r, l) {
|
|
279
279
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
280
280
|
if (null != t) {
|
|
281
281
|
var e, n, i, u, a = [], f = !0, o = !1;
|
|
@@ -305,37 +305,37 @@ function _iterableToArrayLimit$2(r, l) {
|
|
|
305
305
|
return a;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
function _arrayWithHoles$
|
|
308
|
+
function _arrayWithHoles$3(arr) {
|
|
309
309
|
if (Array.isArray(arr))
|
|
310
310
|
return arr;
|
|
311
311
|
}
|
|
312
|
-
function _unsupportedIterableToArray$
|
|
312
|
+
function _unsupportedIterableToArray$4(o, minLen) {
|
|
313
313
|
if (!o)
|
|
314
314
|
return;
|
|
315
315
|
if (typeof o === "string")
|
|
316
|
-
return _arrayLikeToArray$
|
|
316
|
+
return _arrayLikeToArray$4(o, minLen);
|
|
317
317
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
318
318
|
if (n === "Object" && o.constructor)
|
|
319
319
|
n = o.constructor.name;
|
|
320
320
|
if (n === "Map" || n === "Set")
|
|
321
321
|
return Array.from(o);
|
|
322
322
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
323
|
-
return _arrayLikeToArray$
|
|
323
|
+
return _arrayLikeToArray$4(o, minLen);
|
|
324
324
|
}
|
|
325
|
-
function _arrayLikeToArray$
|
|
325
|
+
function _arrayLikeToArray$4(arr, len) {
|
|
326
326
|
if (len == null || len > arr.length)
|
|
327
327
|
len = arr.length;
|
|
328
328
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
329
329
|
arr2[i] = arr[i];
|
|
330
330
|
return arr2;
|
|
331
331
|
}
|
|
332
|
-
function _typeof$
|
|
332
|
+
function _typeof$7(o) {
|
|
333
333
|
"@babel/helpers - typeof";
|
|
334
|
-
return _typeof$
|
|
334
|
+
return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
335
335
|
return typeof o;
|
|
336
336
|
} : function (o) {
|
|
337
337
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
338
|
-
}, _typeof$
|
|
338
|
+
}, _typeof$7(o);
|
|
339
339
|
}
|
|
340
340
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
341
341
|
var e = new Error(message);
|
|
@@ -370,20 +370,20 @@ Promise.resolve({
|
|
|
370
370
|
var createDeepEqual = function createDeepEqual() {
|
|
371
371
|
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;
|
|
372
372
|
var deepEqual = function deepEqual(a, b) {
|
|
373
|
-
if (_typeof$
|
|
373
|
+
if (_typeof$7(a) !== _typeof$7(b))
|
|
374
374
|
return false;
|
|
375
375
|
if (a === null || b === null)
|
|
376
376
|
return a === b;
|
|
377
|
-
if (_typeof$
|
|
377
|
+
if (_typeof$7(a) === 'object') {
|
|
378
378
|
if (Object.keys(a).length !== Object.keys(b).length || Object.keys(a).some(function (k) {
|
|
379
379
|
return !(k in b);
|
|
380
380
|
}))
|
|
381
381
|
return false;
|
|
382
382
|
return Object.entries(a).filter(function (_ref9) {
|
|
383
|
-
var _ref10 = _slicedToArray$
|
|
383
|
+
var _ref10 = _slicedToArray$3(_ref9, 1), k = _ref10[0];
|
|
384
384
|
return !KEYS_TO_EXCLUDE.includes(k);
|
|
385
385
|
}).every(function (_ref11) {
|
|
386
|
-
var _ref12 = _slicedToArray$
|
|
386
|
+
var _ref12 = _slicedToArray$3(_ref11, 2), k = _ref12[0], v = _ref12[1];
|
|
387
387
|
return deepEqual(v, b[k]);
|
|
388
388
|
});
|
|
389
389
|
}
|
|
@@ -436,6 +436,11 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
436
436
|
var e = new Error(message);
|
|
437
437
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
438
438
|
};
|
|
439
|
+
var LOCAL_STORAGE_KEY_PREFIX = 'stytch_sdk_state_';
|
|
440
|
+
var getLocalStorageKey = function getLocalStorageKey(publicToken) {
|
|
441
|
+
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
442
|
+
return "".concat(LOCAL_STORAGE_KEY_PREFIX).concat(publicToken).concat(key ? "::".concat(key) : '');
|
|
443
|
+
};
|
|
439
444
|
var internalSymB2B = Symbol["for"]('stytch__internal_b2b');
|
|
440
445
|
var readB2BInternals = function readB2BInternals(obj) {
|
|
441
446
|
var casted = obj;
|
|
@@ -475,7 +480,7 @@ function _regeneratorRuntime$1() {
|
|
|
475
480
|
function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); }
|
|
476
481
|
function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) {
|
|
477
482
|
var u = c.arg, h = u.value;
|
|
478
|
-
return h && "object" == _typeof$
|
|
483
|
+
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); });
|
|
479
484
|
} 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(); } }); }
|
|
480
485
|
function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f)
|
|
481
486
|
throw new Error("Generator is already running"); if (o === s) {
|
|
@@ -528,7 +533,7 @@ function _regeneratorRuntime$1() {
|
|
|
528
533
|
return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; };
|
|
529
534
|
return i.next = i;
|
|
530
535
|
}
|
|
531
|
-
} throw new TypeError(_typeof$
|
|
536
|
+
} throw new TypeError(_typeof$6(e) + " is not iterable"); }
|
|
532
537
|
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)
|
|
533
538
|
r.push(n); return r.reverse(), function next() { for (; r.length;) {
|
|
534
539
|
var t = r.pop();
|
|
@@ -585,7 +590,7 @@ function _regeneratorRuntime$1() {
|
|
|
585
590
|
} 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;
|
|
586
591
|
}
|
|
587
592
|
function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) {
|
|
588
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray$
|
|
593
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
589
594
|
if (it)
|
|
590
595
|
o = it;
|
|
591
596
|
var i = 0;
|
|
@@ -616,18 +621,18 @@ else {
|
|
|
616
621
|
Promise.resolve(value).then(_next, _throw);
|
|
617
622
|
} }
|
|
618
623
|
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); }); }; }
|
|
619
|
-
function _slicedToArray$
|
|
620
|
-
function _nonIterableRest$
|
|
621
|
-
function _unsupportedIterableToArray$
|
|
624
|
+
function _slicedToArray$2(arr, i) { return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i) || _unsupportedIterableToArray$3(arr, i) || _nonIterableRest$2(); }
|
|
625
|
+
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."); }
|
|
626
|
+
function _unsupportedIterableToArray$3(o, minLen) { if (!o)
|
|
622
627
|
return; if (typeof o === "string")
|
|
623
|
-
return _arrayLikeToArray$
|
|
628
|
+
return _arrayLikeToArray$3(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor)
|
|
624
629
|
n = o.constructor.name; if (n === "Map" || n === "Set")
|
|
625
630
|
return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
626
|
-
return _arrayLikeToArray$
|
|
627
|
-
function _arrayLikeToArray$
|
|
631
|
+
return _arrayLikeToArray$3(o, minLen); }
|
|
632
|
+
function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length)
|
|
628
633
|
len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
629
634
|
arr2[i] = arr[i]; return arr2; }
|
|
630
|
-
function _iterableToArrayLimit$
|
|
635
|
+
function _iterableToArrayLimit$2(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) {
|
|
631
636
|
var e, n, i, u, a = [], f = !0, o = !1;
|
|
632
637
|
try {
|
|
633
638
|
if (i = (t = t.call(r)).next, 0 === l) {
|
|
@@ -654,7 +659,7 @@ function _iterableToArrayLimit$1(r, l) { var t = null == r ? null : "undefined"
|
|
|
654
659
|
}
|
|
655
660
|
return a;
|
|
656
661
|
} }
|
|
657
|
-
function _arrayWithHoles$
|
|
662
|
+
function _arrayWithHoles$2(arr) { if (Array.isArray(arr))
|
|
658
663
|
return arr; }
|
|
659
664
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) {
|
|
660
665
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -662,9 +667,9 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
662
667
|
} return t; }
|
|
663
668
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) {
|
|
664
669
|
var t = null != arguments[r] ? arguments[r] : {};
|
|
665
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty$
|
|
670
|
+
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)); });
|
|
666
671
|
} return e; }
|
|
667
|
-
function _defineProperty$
|
|
672
|
+
function _defineProperty$2(obj, key, value) { key = _toPropertyKey$1(key); if (key in obj) {
|
|
668
673
|
Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
|
|
669
674
|
}
|
|
670
675
|
else {
|
|
@@ -684,16 +689,16 @@ function _defineProperties$2(target, props) { for (var i = 0; i < props.length;
|
|
|
684
689
|
function _createClass$2(Constructor, protoProps, staticProps) { if (protoProps)
|
|
685
690
|
_defineProperties$2(Constructor.prototype, protoProps); if (staticProps)
|
|
686
691
|
_defineProperties$2(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
687
|
-
function _toPropertyKey$1(t) { var i = _toPrimitive$1(t, "string"); return "symbol" == _typeof$
|
|
688
|
-
function _toPrimitive$1(t, r) { if ("object" != _typeof$
|
|
692
|
+
function _toPropertyKey$1(t) { var i = _toPrimitive$1(t, "string"); return "symbol" == _typeof$6(i) ? i : String(i); }
|
|
693
|
+
function _toPrimitive$1(t, r) { if ("object" != _typeof$6(t) || !t)
|
|
689
694
|
return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) {
|
|
690
695
|
var i = e.call(t, r || "default");
|
|
691
|
-
if ("object" != _typeof$
|
|
696
|
+
if ("object" != _typeof$6(i))
|
|
692
697
|
return i;
|
|
693
698
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
694
699
|
} return ("string" === r ? String : Number)(t); }
|
|
695
700
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
696
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof$
|
|
701
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof$6(call) === "object" || typeof call === "function")) {
|
|
697
702
|
return call;
|
|
698
703
|
}
|
|
699
704
|
else if (call !== void 0) {
|
|
@@ -728,9 +733,9 @@ catch (e) {
|
|
|
728
733
|
} }
|
|
729
734
|
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); }
|
|
730
735
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
731
|
-
function _typeof$
|
|
736
|
+
function _typeof$6(o) {
|
|
732
737
|
"@babel/helpers - typeof";
|
|
733
|
-
return _typeof$
|
|
738
|
+
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);
|
|
734
739
|
}
|
|
735
740
|
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;
|
|
736
741
|
function v$4(n, l) {
|
|
@@ -1464,7 +1469,7 @@ function j$1(n, e) {
|
|
|
1464
1469
|
});
|
|
1465
1470
|
};
|
|
1466
1471
|
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) {
|
|
1467
|
-
return ("undefined" != typeof Symbol && "symbol" == _typeof$
|
|
1472
|
+
return ("undefined" != typeof Symbol && "symbol" == _typeof$6(Symbol()) ? /fil|che|rad/ : /fil|che|ra/).test(n);
|
|
1468
1473
|
};
|
|
1469
1474
|
function q$4(n, t, e) {
|
|
1470
1475
|
return null == t.__k && (t.textContent = ""), q$6(n, t), "function" == typeof e && e(), n ? n.__c : null;
|
|
@@ -1757,7 +1762,7 @@ if ("function" === typeof Symbol && Symbol["for"]) {
|
|
|
1757
1762
|
w$2 = x$2("react.legacy_hidden");
|
|
1758
1763
|
}
|
|
1759
1764
|
function y$1(a) {
|
|
1760
|
-
if ("object" === _typeof$
|
|
1765
|
+
if ("object" === _typeof$6(a) && null !== a) {
|
|
1761
1766
|
var t = a.$$typeof;
|
|
1762
1767
|
switch (t) {
|
|
1763
1768
|
case b$2:
|
|
@@ -1810,7 +1815,7 @@ reactIs_production_min$1.isContextProvider = function (a) {
|
|
|
1810
1815
|
return y$1(a) === g$2;
|
|
1811
1816
|
};
|
|
1812
1817
|
reactIs_production_min$1.isElement = function (a) {
|
|
1813
|
-
return "object" === _typeof$
|
|
1818
|
+
return "object" === _typeof$6(a) && null !== a && a.$$typeof === b$2;
|
|
1814
1819
|
};
|
|
1815
1820
|
reactIs_production_min$1.isForwardRef = function (a) {
|
|
1816
1821
|
return y$1(a) === k$3;
|
|
@@ -1837,7 +1842,7 @@ reactIs_production_min$1.isSuspense = function (a) {
|
|
|
1837
1842
|
return y$1(a) === l$2;
|
|
1838
1843
|
};
|
|
1839
1844
|
reactIs_production_min$1.isValidElementType = function (a) {
|
|
1840
|
-
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$
|
|
1845
|
+
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;
|
|
1841
1846
|
};
|
|
1842
1847
|
reactIs_production_min$1.typeOf = y$1;
|
|
1843
1848
|
{
|
|
@@ -1852,7 +1857,7 @@ var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
|
|
1852
1857
|
if (objA === objB) {
|
|
1853
1858
|
return true;
|
|
1854
1859
|
}
|
|
1855
|
-
if (_typeof$
|
|
1860
|
+
if (_typeof$6(objA) !== "object" || !objA || _typeof$6(objB) !== "object" || !objB) {
|
|
1856
1861
|
return false;
|
|
1857
1862
|
}
|
|
1858
1863
|
var keysA = Object.keys(objA);
|
|
@@ -2325,7 +2330,7 @@ function stylis_min(W) {
|
|
|
2325
2330
|
default:
|
|
2326
2331
|
if ('function' === typeof d)
|
|
2327
2332
|
S[A++] = d;
|
|
2328
|
-
else if ('object' === _typeof$
|
|
2333
|
+
else if ('object' === _typeof$6(d))
|
|
2329
2334
|
for (var c = 0, e = d.length; c < e; ++c) {
|
|
2330
2335
|
T(d[c]);
|
|
2331
2336
|
}
|
|
@@ -2426,7 +2431,7 @@ var reactIs$1 = {
|
|
|
2426
2431
|
var reactIs_production_min = {};
|
|
2427
2432
|
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;
|
|
2428
2433
|
function z$1(a) {
|
|
2429
|
-
if ("object" === _typeof$
|
|
2434
|
+
if ("object" === _typeof$6(a) && null !== a) {
|
|
2430
2435
|
var u = a.$$typeof;
|
|
2431
2436
|
switch (u) {
|
|
2432
2437
|
case c:
|
|
@@ -2482,7 +2487,7 @@ reactIs_production_min.isContextProvider = function (a) {
|
|
|
2482
2487
|
return z$1(a) === h$1;
|
|
2483
2488
|
};
|
|
2484
2489
|
reactIs_production_min.isElement = function (a) {
|
|
2485
|
-
return "object" === _typeof$
|
|
2490
|
+
return "object" === _typeof$6(a) && null !== a && a.$$typeof === c;
|
|
2486
2491
|
};
|
|
2487
2492
|
reactIs_production_min.isForwardRef = function (a) {
|
|
2488
2493
|
return z$1(a) === n$1;
|
|
@@ -2509,7 +2514,7 @@ reactIs_production_min.isSuspense = function (a) {
|
|
|
2509
2514
|
return z$1(a) === p$1;
|
|
2510
2515
|
};
|
|
2511
2516
|
reactIs_production_min.isValidElementType = function (a) {
|
|
2512
|
-
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$
|
|
2517
|
+
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);
|
|
2513
2518
|
};
|
|
2514
2519
|
reactIs_production_min.typeOf = z$1;
|
|
2515
2520
|
{
|
|
@@ -2613,7 +2618,7 @@ var g = function g(e, t) {
|
|
|
2613
2618
|
n.push(t[r], e[r + 1]);
|
|
2614
2619
|
return n;
|
|
2615
2620
|
}, S = function S(t) {
|
|
2616
|
-
return null !== t && "object" == _typeof$
|
|
2621
|
+
return null !== t && "object" == _typeof$6(t) && "[object Object]" === (t.toString ? t.toString() : Object.prototype.toString.call(t)) && !reactIsExports$1.typeOf(t);
|
|
2617
2622
|
}, w = Object.freeze([]), E = Object.freeze({});
|
|
2618
2623
|
function b(e) {
|
|
2619
2624
|
return "function" == typeof e;
|
|
@@ -3035,7 +3040,7 @@ function ke(e) {
|
|
|
3035
3040
|
return "string" == typeof e && "production" === "production";
|
|
3036
3041
|
}
|
|
3037
3042
|
var Ve = function Ve(e) {
|
|
3038
|
-
return "function" == typeof e || "object" == _typeof$
|
|
3043
|
+
return "function" == typeof e || "object" == _typeof$6(e) && null !== e && !Array.isArray(e);
|
|
3039
3044
|
}, Be = function Be(e) {
|
|
3040
3045
|
return "__proto__" !== e && "constructor" !== e && "prototype" !== e;
|
|
3041
3046
|
};
|
|
@@ -3286,6 +3291,9 @@ function CreateSSRSafeWebComponent(ReactComponent, webComponentName) {
|
|
|
3286
3291
|
}
|
|
3287
3292
|
};
|
|
3288
3293
|
}
|
|
3294
|
+
var isTruthy = function isTruthy(value) {
|
|
3295
|
+
return Boolean(value);
|
|
3296
|
+
};
|
|
3289
3297
|
var lodash_merge = {
|
|
3290
3298
|
exports: {}
|
|
3291
3299
|
};
|
|
@@ -3303,8 +3311,8 @@ lodash_merge.exports;
|
|
|
3303
3311
|
var typedArrayTags = {};
|
|
3304
3312
|
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
3305
3313
|
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;
|
|
3306
|
-
var freeGlobal = _typeof$
|
|
3307
|
-
var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof$
|
|
3314
|
+
var freeGlobal = _typeof$6(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
3315
|
+
var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof$6(self)) == 'object' && self && self.Object === Object && self;
|
|
3308
3316
|
var root = freeGlobal || freeSelf || Function('return this')();
|
|
3309
3317
|
var freeExports = exports && !exports.nodeType && exports;
|
|
3310
3318
|
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
@@ -3814,7 +3822,7 @@ lodash_merge.exports;
|
|
|
3814
3822
|
return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
|
|
3815
3823
|
}
|
|
3816
3824
|
function isIndex(value, length) {
|
|
3817
|
-
var type = _typeof$
|
|
3825
|
+
var type = _typeof$6(value);
|
|
3818
3826
|
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
3819
3827
|
return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
|
|
3820
3828
|
}
|
|
@@ -3822,14 +3830,14 @@ lodash_merge.exports;
|
|
|
3822
3830
|
if (!isObject(object)) {
|
|
3823
3831
|
return false;
|
|
3824
3832
|
}
|
|
3825
|
-
var type = _typeof$
|
|
3833
|
+
var type = _typeof$6(index);
|
|
3826
3834
|
if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) {
|
|
3827
3835
|
return eq(object[index], value);
|
|
3828
3836
|
}
|
|
3829
3837
|
return false;
|
|
3830
3838
|
}
|
|
3831
3839
|
function isKeyable(value) {
|
|
3832
|
-
var type = _typeof$
|
|
3840
|
+
var type = _typeof$6(value);
|
|
3833
3841
|
return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
|
|
3834
3842
|
}
|
|
3835
3843
|
function isMasked(func) {
|
|
@@ -3933,11 +3941,11 @@ lodash_merge.exports;
|
|
|
3933
3941
|
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
3934
3942
|
}
|
|
3935
3943
|
function isObject(value) {
|
|
3936
|
-
var type = _typeof$
|
|
3944
|
+
var type = _typeof$6(value);
|
|
3937
3945
|
return value != null && (type == 'object' || type == 'function');
|
|
3938
3946
|
}
|
|
3939
3947
|
function isObjectLike(value) {
|
|
3940
|
-
return value != null && _typeof$
|
|
3948
|
+
return value != null && _typeof$6(value) == 'object';
|
|
3941
3949
|
}
|
|
3942
3950
|
function isPlainObject(value) {
|
|
3943
3951
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
@@ -4048,10 +4056,10 @@ var mergeObjects = function mergeObjects(a, b) {
|
|
|
4048
4056
|
return _objectSpread(_objectSpread({}, a), b);
|
|
4049
4057
|
};
|
|
4050
4058
|
var STR_UNDEFINED = 'undefined';
|
|
4051
|
-
var isWindowDefined = (typeof window === "undefined" ? "undefined" : _typeof$
|
|
4052
|
-
var isDocumentDefined = (typeof document === "undefined" ? "undefined" : _typeof$
|
|
4059
|
+
var isWindowDefined = (typeof window === "undefined" ? "undefined" : _typeof$6(window)) != STR_UNDEFINED;
|
|
4060
|
+
var isDocumentDefined = (typeof document === "undefined" ? "undefined" : _typeof$6(document)) != STR_UNDEFINED;
|
|
4053
4061
|
var hasRequestAnimationFrame = function hasRequestAnimationFrame() {
|
|
4054
|
-
return isWindowDefined && _typeof$
|
|
4062
|
+
return isWindowDefined && _typeof$6(window['requestAnimationFrame']) != STR_UNDEFINED;
|
|
4055
4063
|
};
|
|
4056
4064
|
var createCacheHelper = function createCacheHelper(cache, key) {
|
|
4057
4065
|
var state = SWRGlobalState.get(cache);
|
|
@@ -4076,7 +4084,7 @@ var createCacheHelper = function createCacheHelper(cache, key) {
|
|
|
4076
4084
|
var table = new WeakMap();
|
|
4077
4085
|
var counter = 0;
|
|
4078
4086
|
var stableHash = function stableHash(arg) {
|
|
4079
|
-
var type = _typeof$
|
|
4087
|
+
var type = _typeof$6(arg);
|
|
4080
4088
|
var constructor = arg && arg.constructor;
|
|
4081
4089
|
var isDate = constructor == Date;
|
|
4082
4090
|
var result;
|
|
@@ -4114,7 +4122,7 @@ var online = true;
|
|
|
4114
4122
|
var isOnline = function isOnline() {
|
|
4115
4123
|
return online;
|
|
4116
4124
|
};
|
|
4117
|
-
var _ref$
|
|
4125
|
+
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];
|
|
4118
4126
|
var isVisible = function isVisible() {
|
|
4119
4127
|
var visibilityState = isDocumentDefined && document.visibilityState;
|
|
4120
4128
|
return isUndefined(visibilityState) || visibilityState !== 'hidden';
|
|
@@ -4207,15 +4215,15 @@ function _internalMutate() {
|
|
|
4207
4215
|
while (1)
|
|
4208
4216
|
switch (_context2.prev = _context2.next) {
|
|
4209
4217
|
case 0:
|
|
4210
|
-
_serialize3 = serialize(_k), _serialize4 = _slicedToArray$
|
|
4218
|
+
_serialize3 = serialize(_k), _serialize4 = _slicedToArray$2(_serialize3, 1), key = _serialize4[0];
|
|
4211
4219
|
if (key) {
|
|
4212
4220
|
_context2.next = 3;
|
|
4213
4221
|
break;
|
|
4214
4222
|
}
|
|
4215
4223
|
return _context2.abrupt("return");
|
|
4216
4224
|
case 3:
|
|
4217
|
-
_createCacheHelper3 = createCacheHelper(cache, key), _createCacheHelper4 = _slicedToArray$
|
|
4218
|
-
_SWRGlobalState$get5 = SWRGlobalState.get(cache), _SWRGlobalState$get6 = _slicedToArray$
|
|
4225
|
+
_createCacheHelper3 = createCacheHelper(cache, key), _createCacheHelper4 = _slicedToArray$2(_createCacheHelper3, 2), get = _createCacheHelper4[0], set = _createCacheHelper4[1];
|
|
4226
|
+
_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];
|
|
4219
4227
|
revalidators = EVENT_REVALIDATORS[key];
|
|
4220
4228
|
startRevalidate = function startRevalidate() {
|
|
4221
4229
|
if (revalidate) {
|
|
@@ -4444,7 +4452,7 @@ var onErrorRetry = function onErrorRetry(_, __, config, revalidate, opts) {
|
|
|
4444
4452
|
var compare = function compare(currentData, newData) {
|
|
4445
4453
|
return stableHash(currentData) == stableHash(newData);
|
|
4446
4454
|
};
|
|
4447
|
-
var _initCache = initCache(new Map()), _initCache2 = _slicedToArray$
|
|
4455
|
+
var _initCache = initCache(new Map()), _initCache2 = _slicedToArray$2(_initCache, 2), cache$3 = _initCache2[0], mutate = _initCache2[1];
|
|
4448
4456
|
var defaultConfig = mergeObjects({
|
|
4449
4457
|
onLoadingSlow: noop$2,
|
|
4450
4458
|
onSuccess: noop$2,
|
|
@@ -4499,7 +4507,7 @@ var middleware = function middleware(useSWRNext) {
|
|
|
4499
4507
|
return function (key_, fetcher_, config) {
|
|
4500
4508
|
var fetcher = fetcher_ && function () {
|
|
4501
4509
|
var key = serialize(key_)[0];
|
|
4502
|
-
var _SWRGlobalState$get = SWRGlobalState.get(cache$3), _SWRGlobalState$get2 = _slicedToArray$
|
|
4510
|
+
var _SWRGlobalState$get = SWRGlobalState.get(cache$3), _SWRGlobalState$get2 = _slicedToArray$2(_SWRGlobalState$get, 4), PRELOAD = _SWRGlobalState$get2[3];
|
|
4503
4511
|
var req = PRELOAD[key];
|
|
4504
4512
|
if (req) {
|
|
4505
4513
|
delete PRELOAD[key];
|
|
@@ -4517,7 +4525,7 @@ var withArgs = function withArgs(hook) {
|
|
|
4517
4525
|
for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
|
|
4518
4526
|
args[_key3] = arguments[_key3];
|
|
4519
4527
|
}
|
|
4520
|
-
var _normalize = normalize(args), _normalize2 = _slicedToArray$
|
|
4528
|
+
var _normalize = normalize(args), _normalize2 = _slicedToArray$2(_normalize, 3), key = _normalize2[0], fn = _normalize2[1], _config = _normalize2[2];
|
|
4521
4529
|
var config = mergeConfigs(fallbackConfig, _config);
|
|
4522
4530
|
var next = hook;
|
|
4523
4531
|
var use = config.use;
|
|
@@ -4545,8 +4553,8 @@ var WITH_DEDUPE = {
|
|
|
4545
4553
|
};
|
|
4546
4554
|
var useSWRHandler = function useSWRHandler(_key, fetcher, config) {
|
|
4547
4555
|
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;
|
|
4548
|
-
var _SWRGlobalState$get3 = SWRGlobalState.get(cache), _SWRGlobalState$get4 = _slicedToArray$
|
|
4549
|
-
var _serialize = serialize(_key), _serialize2 = _slicedToArray$
|
|
4556
|
+
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];
|
|
4557
|
+
var _serialize = serialize(_key), _serialize2 = _slicedToArray$2(_serialize, 2), key = _serialize2[0], fnArg = _serialize2[1];
|
|
4550
4558
|
var initialMountedRef = _$1(false);
|
|
4551
4559
|
var unmountedRef = _$1(false);
|
|
4552
4560
|
var keyRef = _$1(key);
|
|
@@ -4558,7 +4566,7 @@ var useSWRHandler = function useSWRHandler(_key, fetcher, config) {
|
|
|
4558
4566
|
var isActive = function isActive() {
|
|
4559
4567
|
return getConfig().isVisible() && getConfig().isOnline();
|
|
4560
4568
|
};
|
|
4561
|
-
var _createCacheHelper = createCacheHelper(cache, key), _createCacheHelper2 = _slicedToArray$
|
|
4569
|
+
var _createCacheHelper = createCacheHelper(cache, key), _createCacheHelper2 = _slicedToArray$2(_createCacheHelper, 4), getCache = _createCacheHelper2[0], setCache = _createCacheHelper2[1], subscribeCache = _createCacheHelper2[2], getInitialCache = _createCacheHelper2[3];
|
|
4562
4570
|
var stateDependencies = _$1({}).current;
|
|
4563
4571
|
var fallback = isUndefined(fallbackData) ? config.fallback[key] : fallbackData;
|
|
4564
4572
|
var isEqual = function isEqual(prev, current) {
|
|
@@ -4705,7 +4713,7 @@ var useSWRHandler = function useSWRHandler(_key, fetcher, config) {
|
|
|
4705
4713
|
}
|
|
4706
4714
|
FETCH[key] = [currentFetcher(fnArg), getTimestamp()];
|
|
4707
4715
|
}
|
|
4708
|
-
_FETCH$key = _slicedToArray$
|
|
4716
|
+
_FETCH$key = _slicedToArray$2(FETCH[key], 2);
|
|
4709
4717
|
newData = _FETCH$key[0];
|
|
4710
4718
|
startAt = _FETCH$key[1];
|
|
4711
4719
|
_context.next = 19;
|
|
@@ -4904,7 +4912,7 @@ var useSWRHandler = function useSWRHandler(_key, fetcher, config) {
|
|
|
4904
4912
|
};
|
|
4905
4913
|
var useSWR = withArgs(useSWRHandler);
|
|
4906
4914
|
var extractErrorMessage = function extractErrorMessage(error) {
|
|
4907
|
-
if (error && _typeof$
|
|
4915
|
+
if (error && _typeof$6(error) === 'object') {
|
|
4908
4916
|
if ('error_message' in error && typeof error.error_message === 'string') {
|
|
4909
4917
|
return error.error_message;
|
|
4910
4918
|
}
|
|
@@ -4914,6 +4922,10 @@ var extractErrorMessage = function extractErrorMessage(error) {
|
|
|
4914
4922
|
}
|
|
4915
4923
|
};
|
|
4916
4924
|
|
|
4925
|
+
var _templateObject;
|
|
4926
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) {
|
|
4927
|
+
raw = strings.slice(0);
|
|
4928
|
+
} return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
4917
4929
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) {
|
|
4918
4930
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray2(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
4919
4931
|
if (it)
|
|
@@ -5163,11 +5175,11 @@ function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : func
|
|
|
5163
5175
|
}
|
|
5164
5176
|
}
|
|
5165
5177
|
} return target; }; return _extends$5.apply(this, arguments); }
|
|
5166
|
-
function _typeof$
|
|
5178
|
+
function _typeof$5(o) {
|
|
5167
5179
|
"@babel/helpers - typeof";
|
|
5168
|
-
return _typeof$
|
|
5180
|
+
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);
|
|
5169
5181
|
}
|
|
5170
|
-
function isPlainObject(item) { return item && _typeof$
|
|
5182
|
+
function isPlainObject(item) { return item && _typeof$5(item) === 'object' && item.constructor === Object; }
|
|
5171
5183
|
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)) {
|
|
5172
5184
|
Object.keys(source).forEach(function (key) { if (key === '__proto__') {
|
|
5173
5185
|
return;
|
|
@@ -5225,19 +5237,19 @@ else if (color.type.indexOf('rgb') !== -1) {
|
|
|
5225
5237
|
color.values[i] += (255 - color.values[i]) * coefficient;
|
|
5226
5238
|
}
|
|
5227
5239
|
} return recomposeColor(color); }
|
|
5228
|
-
function _typeof$
|
|
5240
|
+
function _typeof$4(o) {
|
|
5229
5241
|
"@babel/helpers - typeof";
|
|
5230
|
-
return _typeof$
|
|
5242
|
+
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);
|
|
5231
5243
|
}
|
|
5232
|
-
function toPrimitive$
|
|
5244
|
+
function toPrimitive$2(t, r) { if ("object" != _typeof$4(t) || !t)
|
|
5233
5245
|
return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) {
|
|
5234
5246
|
var i = e.call(t, r || "default");
|
|
5235
|
-
if ("object" != _typeof$
|
|
5247
|
+
if ("object" != _typeof$4(i))
|
|
5236
5248
|
return i;
|
|
5237
5249
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
5238
5250
|
} return ("string" === r ? String : Number)(t); }
|
|
5239
|
-
function toPropertyKey$
|
|
5240
|
-
function _defineProperty(obj, key, value) { key = toPropertyKey$
|
|
5251
|
+
function toPropertyKey$2(t) { var i = toPrimitive$2(t, "string"); return "symbol" == _typeof$4(i) ? i : i + ""; }
|
|
5252
|
+
function _defineProperty$1(obj, key, value) { key = toPropertyKey$2(key); if (key in obj) {
|
|
5241
5253
|
Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
|
|
5242
5254
|
}
|
|
5243
5255
|
else {
|
|
@@ -5276,7 +5288,7 @@ function createBreakpoints(breakpoints) { var _breakpoints$values = breakpoints.
|
|
|
5276
5288
|
} 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) {
|
|
5277
5289
|
return up(start);
|
|
5278
5290
|
} 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); }
|
|
5279
|
-
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); }
|
|
5291
|
+
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); }
|
|
5280
5292
|
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 } };
|
|
5281
5293
|
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 } };
|
|
5282
5294
|
function addLightOrDark(intent, direction, shade, tonalOffset) { var tonalOffsetLight = tonalOffset.light || tonalOffset; var tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5; if (!intent[direction]) {
|
|
@@ -5368,27 +5380,27 @@ function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : func
|
|
|
5368
5380
|
}
|
|
5369
5381
|
}
|
|
5370
5382
|
} return target; }; return _extends$3.apply(this, arguments); }
|
|
5371
|
-
var _typeof$
|
|
5372
|
-
var isBrowser$1 = (typeof window === "undefined" ? "undefined" : _typeof$
|
|
5373
|
-
function _typeof$
|
|
5383
|
+
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); };
|
|
5384
|
+
var isBrowser$1 = (typeof window === "undefined" ? "undefined" : _typeof$3(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof$3(document)) === 'object' && document.nodeType === 9;
|
|
5385
|
+
function _typeof$2(o) {
|
|
5374
5386
|
"@babel/helpers - typeof";
|
|
5375
|
-
return _typeof$
|
|
5387
|
+
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);
|
|
5376
5388
|
}
|
|
5377
|
-
function toPrimitive(t, r) { if ("object" != _typeof$
|
|
5389
|
+
function toPrimitive$1(t, r) { if ("object" != _typeof$2(t) || !t)
|
|
5378
5390
|
return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) {
|
|
5379
5391
|
var i = e.call(t, r);
|
|
5380
|
-
if ("object" != _typeof$
|
|
5392
|
+
if ("object" != _typeof$2(i))
|
|
5381
5393
|
return i;
|
|
5382
5394
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
5383
5395
|
} return String(t); }
|
|
5384
|
-
function toPropertyKey(t) { var i = toPrimitive(t, "string"); return "symbol" == _typeof$
|
|
5396
|
+
function toPropertyKey$1(t) { var i = toPrimitive$1(t, "string"); return "symbol" == _typeof$2(i) ? i : String(i); }
|
|
5385
5397
|
function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) {
|
|
5386
5398
|
var descriptor = props[i];
|
|
5387
5399
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
5388
5400
|
descriptor.configurable = true;
|
|
5389
5401
|
if ("value" in descriptor)
|
|
5390
5402
|
descriptor.writable = true;
|
|
5391
|
-
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
|
5403
|
+
Object.defineProperty(target, toPropertyKey$1(descriptor.key), descriptor);
|
|
5392
5404
|
} }
|
|
5393
5405
|
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps)
|
|
5394
5406
|
_defineProperties$1(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -6145,21 +6157,21 @@ function defaultUnit(options) { if (options === void 0) {
|
|
|
6145
6157
|
return style; for (var prop in style) {
|
|
6146
6158
|
style[prop] = iterate(prop, style[prop], camelCasedOptions);
|
|
6147
6159
|
} return style; } function onChangeValue(value, prop) { return iterate(prop, value, camelCasedOptions); } return { onProcessStyle: onProcessStyle, onChangeValue: onChangeValue }; }
|
|
6148
|
-
function _arrayLikeToArray$
|
|
6160
|
+
function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length)
|
|
6149
6161
|
len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
6150
6162
|
arr2[i] = arr[i]; return arr2; }
|
|
6151
6163
|
function _arrayWithoutHoles$1(arr) { if (Array.isArray(arr))
|
|
6152
|
-
return _arrayLikeToArray$
|
|
6164
|
+
return _arrayLikeToArray$2(arr); }
|
|
6153
6165
|
function _iterableToArray$1(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
6154
6166
|
return Array.from(iter); }
|
|
6155
|
-
function _unsupportedIterableToArray$
|
|
6167
|
+
function _unsupportedIterableToArray$2(o, minLen) { if (!o)
|
|
6156
6168
|
return; if (typeof o === "string")
|
|
6157
|
-
return _arrayLikeToArray$
|
|
6169
|
+
return _arrayLikeToArray$2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor)
|
|
6158
6170
|
n = o.constructor.name; if (n === "Map" || n === "Set")
|
|
6159
6171
|
return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
6160
|
-
return _arrayLikeToArray$
|
|
6172
|
+
return _arrayLikeToArray$2(o, minLen); }
|
|
6161
6173
|
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."); }
|
|
6162
|
-
function _toConsumableArray$1(arr) { return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$
|
|
6174
|
+
function _toConsumableArray$1(arr) { return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$2(arr) || _nonIterableSpread$1(); }
|
|
6163
6175
|
var js = '';
|
|
6164
6176
|
var css = '';
|
|
6165
6177
|
var vendor = '';
|
|
@@ -6541,10 +6553,10 @@ function createChainedFunction() { for (var _len = arguments.length, funcs = new
|
|
|
6541
6553
|
} return function chainedFunction() { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
6542
6554
|
args[_key2] = arguments[_key2];
|
|
6543
6555
|
} acc.apply(this, args); func.apply(this, args); }; }, function () { }); }
|
|
6544
|
-
var styles$
|
|
6556
|
+
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) } }; };
|
|
6545
6557
|
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); });
|
|
6546
6558
|
SvgIcon.muiName = 'SvgIcon';
|
|
6547
|
-
var SvgIcon$1 = withStyles(styles$
|
|
6559
|
+
var SvgIcon$1 = withStyles(styles$Z, { name: 'MuiSvgIcon' })(SvgIcon);
|
|
6548
6560
|
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)); }
|
|
6549
6561
|
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++) {
|
|
6550
6562
|
args[_key] = arguments[_key];
|
|
@@ -6608,22 +6620,22 @@ function useIsFocusVisible() { var ref = T$2(function (instance) { var node = vn
|
|
|
6608
6620
|
prepare(node.ownerDocument);
|
|
6609
6621
|
} }, []); return { isFocusVisible: isFocusVisible, onBlurVisible: handleBlurVisible, ref: ref }; }
|
|
6610
6622
|
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 });
|
|
6611
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr))
|
|
6623
|
+
function _arrayWithHoles$1(arr) { if (Array.isArray(arr))
|
|
6612
6624
|
return arr; }
|
|
6613
6625
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
6614
6626
|
return Array.from(iter); }
|
|
6615
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length)
|
|
6627
|
+
function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length)
|
|
6616
6628
|
len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
6617
6629
|
arr2[i] = arr[i]; return arr2; }
|
|
6618
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o)
|
|
6630
|
+
function _unsupportedIterableToArray$1(o, minLen) { if (!o)
|
|
6619
6631
|
return; if (typeof o === "string")
|
|
6620
|
-
return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor)
|
|
6632
|
+
return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor)
|
|
6621
6633
|
n = o.constructor.name; if (n === "Map" || n === "Set")
|
|
6622
6634
|
return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
6623
|
-
return _arrayLikeToArray(o, minLen); }
|
|
6624
|
-
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."); }
|
|
6625
|
-
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
|
|
6626
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) {
|
|
6635
|
+
return _arrayLikeToArray$1(o, minLen); }
|
|
6636
|
+
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."); }
|
|
6637
|
+
function _toArray(arr) { return _arrayWithHoles$1(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableRest$1(); }
|
|
6638
|
+
function _iterableToArrayLimit$1(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) {
|
|
6627
6639
|
var e, n, i, u, a = [], f = !0, o = !1;
|
|
6628
6640
|
try {
|
|
6629
6641
|
if (i = (t = t.call(r)).next, 0 === l)
|
|
@@ -6647,7 +6659,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6647
6659
|
}
|
|
6648
6660
|
return a;
|
|
6649
6661
|
} }
|
|
6650
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6662
|
+
function _slicedToArray$1(arr, i) { return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1(); }
|
|
6651
6663
|
var config = { disabled: false };
|
|
6652
6664
|
var TransitionGroupContext = /*#__PURE__*/ wn.createContext(null);
|
|
6653
6665
|
var forceReflow = function forceReflow(node) { return node.scrollTop; };
|
|
@@ -6790,9 +6802,9 @@ TransitionGroup.propTypes = {};
|
|
|
6790
6802
|
TransitionGroup.defaultProps = defaultProps;
|
|
6791
6803
|
var reflow = function reflow(node) { return node.scrollTop; };
|
|
6792
6804
|
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 }; }
|
|
6793
|
-
var styles$
|
|
6805
|
+
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%' } }; };
|
|
6794
6806
|
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) {
|
|
6795
|
-
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing], _ref2 = _slicedToArray(_ref, 2), node = _ref2[0], isAppearing = _ref2[1];
|
|
6807
|
+
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing], _ref2 = _slicedToArray$1(_ref, 2), node = _ref2[0], isAppearing = _ref2[1];
|
|
6796
6808
|
if (isAppearing === undefined) {
|
|
6797
6809
|
callback(node);
|
|
6798
6810
|
}
|
|
@@ -6827,23 +6839,23 @@ else {
|
|
|
6827
6839
|
timer.current = setTimeout(next, autoTransitionDuration.current || 0);
|
|
6828
6840
|
} }; 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))); }); });
|
|
6829
6841
|
Collapse.muiSupportAuto = true;
|
|
6830
|
-
var Collapse$1 = withStyles(styles$
|
|
6831
|
-
var styles$
|
|
6842
|
+
var Collapse$1 = withStyles(styles$Y, { name: 'MuiCollapse' })(Collapse);
|
|
6843
|
+
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); };
|
|
6832
6844
|
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)); });
|
|
6833
|
-
var Paper$1 = withStyles(styles$
|
|
6845
|
+
var Paper$1 = withStyles(styles$X, { name: 'MuiPaper' })(Paper);
|
|
6834
6846
|
var AccordionContext = /*#__PURE__*/ F$4({});
|
|
6835
|
-
var styles$
|
|
6836
|
-
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) {
|
|
6847
|
+
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: {} }; };
|
|
6848
|
+
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) {
|
|
6837
6849
|
onChange(event, !expanded);
|
|
6838
6850
|
} }, [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))); });
|
|
6839
|
-
var MUIAccordion = withStyles(styles$
|
|
6840
|
-
var styles$
|
|
6851
|
+
var MUIAccordion = withStyles(styles$W, { name: 'MuiAccordion' })(Accordion$1);
|
|
6852
|
+
var styles$V = function styles(theme) { return { root: { display: 'flex', padding: theme.spacing(1, 2, 2) } }; };
|
|
6841
6853
|
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)); });
|
|
6842
|
-
var MUIAccordionDetails = withStyles(styles$
|
|
6854
|
+
var MUIAccordionDetails = withStyles(styles$V, { name: 'MuiAccordionDetails' })(AccordionDetails$1);
|
|
6843
6855
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr))
|
|
6844
|
-
return _arrayLikeToArray(arr); }
|
|
6856
|
+
return _arrayLikeToArray$1(arr); }
|
|
6845
6857
|
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."); }
|
|
6846
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6858
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread(); }
|
|
6847
6859
|
var useEnhancedEffect$6 = typeof window === 'undefined' ? p$3 : y$2;
|
|
6848
6860
|
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) {
|
|
6849
6861
|
setLeaving(true);
|
|
@@ -6852,7 +6864,7 @@ function Ripple(props) { var classes = props.classes, _props$pulsate = props.pul
|
|
|
6852
6864
|
} return undefined; }, [handleExited, inProp, timeout]); return /*#__PURE__*/ y$3("span", { className: rippleClassName, style: rippleStyles }, /*#__PURE__*/ y$3("span", { className: childClassName })); }
|
|
6853
6865
|
var DURATION = 550;
|
|
6854
6866
|
var DELAY_RIPPLE = 80;
|
|
6855
|
-
var styles$
|
|
6867
|
+
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)' } } }; };
|
|
6856
6868
|
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) {
|
|
6857
6869
|
rippleCallback.current();
|
|
6858
6870
|
rippleCallback.current = null;
|
|
@@ -6899,8 +6911,8 @@ else {
|
|
|
6899
6911
|
} startTimerCommit.current = null; setRipples(function (oldRipples) { if (oldRipples.length > 0) {
|
|
6900
6912
|
return oldRipples.slice(1);
|
|
6901
6913
|
} 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)); });
|
|
6902
|
-
var TouchRipple$1 = withStyles(styles$
|
|
6903
|
-
var styles$
|
|
6914
|
+
var TouchRipple$1 = withStyles(styles$U, { flip: false, name: 'MuiTouchRipple' })(/*#__PURE__*/ w$3(TouchRipple));
|
|
6915
|
+
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: {} };
|
|
6904
6916
|
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) {
|
|
6905
6917
|
setFocusVisible(false);
|
|
6906
6918
|
} 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) {
|
|
@@ -6960,21 +6972,21 @@ else {
|
|
|
6960
6972
|
}
|
|
6961
6973
|
buttonProps['aria-disabled'] = disabled;
|
|
6962
6974
|
} 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); });
|
|
6963
|
-
var ButtonBase$1 = withStyles(styles$
|
|
6964
|
-
var styles$
|
|
6975
|
+
var ButtonBase$1 = withStyles(styles$T, { name: 'MuiButtonBase' })(ButtonBase);
|
|
6976
|
+
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' } }; };
|
|
6965
6977
|
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)); });
|
|
6966
|
-
var IconButton$1 = withStyles(styles$
|
|
6967
|
-
var styles$
|
|
6978
|
+
var IconButton$1 = withStyles(styles$S, { name: 'MuiIconButton' })(IconButton);
|
|
6979
|
+
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)' } } }; };
|
|
6968
6980
|
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) {
|
|
6969
6981
|
toggle(event);
|
|
6970
6982
|
} if (onClick) {
|
|
6971
6983
|
onClick(event);
|
|
6972
6984
|
} }; 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)); });
|
|
6973
|
-
var MUIAccordionSummary = withStyles(styles$
|
|
6974
|
-
var styles$
|
|
6985
|
+
var MUIAccordionSummary = withStyles(styles$R, { name: 'MuiAccordionSummary' })(AccordionSummary$1);
|
|
6986
|
+
var styles$Q = { entering: { opacity: 1 }, entered: { opacity: 1 } };
|
|
6975
6987
|
var defaultTimeout = { enter: duration.enteringScreen, exit: duration.leavingScreen };
|
|
6976
6988
|
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) {
|
|
6977
|
-
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing], _ref2 = _slicedToArray(_ref, 2), node = _ref2[0], isAppearing = _ref2[1];
|
|
6989
|
+
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing], _ref2 = _slicedToArray$1(_ref, 2), node = _ref2[0], isAppearing = _ref2[1];
|
|
6978
6990
|
if (isAppearing === undefined) {
|
|
6979
6991
|
callback(node);
|
|
6980
6992
|
}
|
|
@@ -6985,22 +6997,75 @@ var Fade = /*#__PURE__*/ N$1(function Fade(props, ref) { var children = props.ch
|
|
|
6985
6997
|
onEnter(node, isAppearing);
|
|
6986
6998
|
} }); 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) {
|
|
6987
6999
|
onExit(node);
|
|
6988
|
-
} }); 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$
|
|
6989
|
-
var styles$
|
|
7000
|
+
} }); 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)); }); });
|
|
7001
|
+
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' } };
|
|
6990
7002
|
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)); });
|
|
6991
|
-
var Backdrop$1 = withStyles(styles$
|
|
6992
|
-
var styles$
|
|
7003
|
+
var Backdrop$1 = withStyles(styles$P, { name: 'MuiBackdrop' })(Backdrop);
|
|
7004
|
+
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' } }; };
|
|
6993
7005
|
var defaultVariantMapping = { h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', h6: 'h6', subtitle1: 'h6', subtitle2: 'h6', body1: 'p', body2: 'p' };
|
|
6994
7006
|
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)); });
|
|
6995
|
-
var
|
|
6996
|
-
var styles$
|
|
7007
|
+
var Typography$2 = withStyles(styles$O, { name: 'MuiTypography' })(Typography$1);
|
|
7008
|
+
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 } } }; };
|
|
6997
7009
|
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)); });
|
|
6998
|
-
var MUIButton = withStyles(styles$
|
|
7010
|
+
var MUIButton = withStyles(styles$N, { name: 'MuiButton' })(Button$1);
|
|
6999
7011
|
var FormControlContext = /*#__PURE__*/ F$4();
|
|
7000
7012
|
function useFormControl$1() { return q$5(FormControlContext); }
|
|
7001
7013
|
function useFormControl() { return q$5(FormControlContext); }
|
|
7014
|
+
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 } };
|
|
7015
|
+
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) {
|
|
7016
|
+
onFocus(event);
|
|
7017
|
+
} if (muiFormControl && muiFormControl.onFocus) {
|
|
7018
|
+
muiFormControl.onFocus(event);
|
|
7019
|
+
} }; var handleBlur = function handleBlur(event) { if (onBlur) {
|
|
7020
|
+
onBlur(event);
|
|
7021
|
+
} if (muiFormControl && muiFormControl.onBlur) {
|
|
7022
|
+
muiFormControl.onBlur(event);
|
|
7023
|
+
} }; var handleInputChange = function handleInputChange(event) { var newChecked = event.target.checked; setCheckedState(newChecked); if (onChange) {
|
|
7024
|
+
onChange(event, newChecked);
|
|
7025
|
+
} }; var disabled = disabledProp; if (muiFormControl) {
|
|
7026
|
+
if (typeof disabled === 'undefined') {
|
|
7027
|
+
disabled = muiFormControl.disabled;
|
|
7028
|
+
}
|
|
7029
|
+
} 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); });
|
|
7030
|
+
var SwitchBase$1 = withStyles(styles$M, { name: 'PrivateSwitchBase' })(SwitchBase);
|
|
7031
|
+
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" }));
|
|
7032
|
+
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" }));
|
|
7033
|
+
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" }));
|
|
7034
|
+
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 } } }; };
|
|
7035
|
+
var defaultCheckedIcon$1 = /*#__PURE__*/ y$3(CheckBoxIcon, null);
|
|
7036
|
+
var defaultIcon$1 = /*#__PURE__*/ y$3(CheckBoxOutlineBlankIcon, null);
|
|
7037
|
+
var defaultIndeterminateIcon = /*#__PURE__*/ y$3(IndeterminateCheckBoxIcon, null);
|
|
7038
|
+
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)); });
|
|
7039
|
+
var MUICheckbox = withStyles(styles$L, { name: 'MuiCheckbox' })(Checkbox$1);
|
|
7040
|
+
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" }));
|
|
7041
|
+
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 } } }; };
|
|
7042
|
+
function isDeleteKeyboardEvent(keyboardEvent) { return keyboardEvent.key === 'Backspace' || keyboardEvent.key === 'Delete'; }
|
|
7043
|
+
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) {
|
|
7044
|
+
onDelete(event);
|
|
7045
|
+
} }; var handleKeyDown = function handleKeyDown(event) { if (event.currentTarget === event.target && isDeleteKeyboardEvent(event)) {
|
|
7046
|
+
event.preventDefault();
|
|
7047
|
+
} if (onKeyDown) {
|
|
7048
|
+
onKeyDown(event);
|
|
7049
|
+
} }; var handleKeyUp = function handleKeyUp(event) { if (event.currentTarget === event.target) {
|
|
7050
|
+
if (onDelete && isDeleteKeyboardEvent(event)) {
|
|
7051
|
+
onDelete(event);
|
|
7052
|
+
}
|
|
7053
|
+
else if (event.key === 'Escape' && chipRef.current) {
|
|
7054
|
+
chipRef.current.blur();
|
|
7055
|
+
}
|
|
7056
|
+
} if (onKeyUp) {
|
|
7057
|
+
onKeyUp(event);
|
|
7058
|
+
} }; 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) {
|
|
7059
|
+
var customClasses = clsx(color !== 'default' && (variant === "default" ? classes["deleteIconColor".concat(capitalize(color))] : classes["deleteIconOutlinedColor".concat(capitalize(color))]), small && classes.deleteIconSmall);
|
|
7060
|
+
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 });
|
|
7061
|
+
} var avatar = null; if (avatarProp && /*#__PURE__*/ fn(avatarProp)) {
|
|
7062
|
+
avatar = /*#__PURE__*/ sn(avatarProp, { className: clsx(classes.avatar, avatarProp.props.className, small && classes.avatarSmall, color !== 'default' && classes["avatarColor".concat(capitalize(color))]) });
|
|
7063
|
+
} var icon = null; if (iconProp && /*#__PURE__*/ fn(iconProp)) {
|
|
7064
|
+
icon = /*#__PURE__*/ sn(iconProp, { className: clsx(classes.icon, iconProp.props.className, small && classes.iconSmall, color !== 'default' && classes["iconColor".concat(capitalize(color))]) });
|
|
7065
|
+
} 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); });
|
|
7066
|
+
var Chip$1 = withStyles(styles$K, { name: 'MuiChip' })(Chip);
|
|
7002
7067
|
var SIZE = 44;
|
|
7003
|
-
var styles$
|
|
7068
|
+
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' } }; };
|
|
7004
7069
|
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') {
|
|
7005
7070
|
var circumference = 2 * Math.PI * ((SIZE - thickness) / 2);
|
|
7006
7071
|
circleStyle.strokeDasharray = circumference.toFixed(3);
|
|
@@ -7008,7 +7073,7 @@ var CircularProgress = /*#__PURE__*/ N$1(function CircularProgress(props, ref) {
|
|
|
7008
7073
|
circleStyle.strokeDashoffset = "".concat(((100 - value) / 100 * circumference).toFixed(3), "px");
|
|
7009
7074
|
rootStyle.transform = 'rotate(-90deg)';
|
|
7010
7075
|
} 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 }))); });
|
|
7011
|
-
var CircularProgress$1 = withStyles(styles$
|
|
7076
|
+
var CircularProgress$1 = withStyles(styles$J, { name: 'MuiCircularProgress', flip: false })(CircularProgress);
|
|
7012
7077
|
function mapEventPropToEvent(eventProp) { return eventProp.substring(2).toLowerCase(); }
|
|
7013
7078
|
function clickedRootScrollbar(event) { return document.documentElement.clientWidth < event.clientX || document.documentElement.clientHeight < event.clientY; }
|
|
7014
7079
|
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)) {
|
|
@@ -7067,7 +7132,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
7067
7132
|
descriptor.configurable = true;
|
|
7068
7133
|
if ("value" in descriptor)
|
|
7069
7134
|
descriptor.writable = true;
|
|
7070
|
-
Object.defineProperty(target, toPropertyKey$
|
|
7135
|
+
Object.defineProperty(target, toPropertyKey$2(descriptor.key), descriptor);
|
|
7071
7136
|
} }
|
|
7072
7137
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps)
|
|
7073
7138
|
_defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -7176,12 +7241,12 @@ function Unstable_TrapFocus(props) { var children = props.children, _props$disab
|
|
|
7176
7241
|
}
|
|
7177
7242
|
nodeToRestore.current = null;
|
|
7178
7243
|
} }; }, [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" })); }
|
|
7179
|
-
var styles$
|
|
7180
|
-
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$
|
|
7244
|
+
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' } };
|
|
7245
|
+
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; });
|
|
7181
7246
|
function getContainer(container) { container = typeof container === 'function' ? container() : container; return vn(container); }
|
|
7182
7247
|
function getHasTransition(props) { return props.children ? props.children.props.hasOwnProperty('in') : false; }
|
|
7183
7248
|
var defaultManager = new ModalManager();
|
|
7184
|
-
var styles$
|
|
7249
|
+
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' } }; };
|
|
7185
7250
|
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) {
|
|
7186
7251
|
handleMounted();
|
|
7187
7252
|
} }); var isTopModal = T$2(function () { return manager.isTopModal(getModal()); }, [manager]); var handlePortalRef = useEventCallback(function (node) { mountNodeRef.current = node; if (!node) {
|
|
@@ -7217,13 +7282,13 @@ else if (!hasTransition || !closeAfterTransition) {
|
|
|
7217
7282
|
if (onClose) {
|
|
7218
7283
|
onClose(event, 'escapeKeyDown');
|
|
7219
7284
|
}
|
|
7220
|
-
} }; var inlineStyle = styles$
|
|
7285
|
+
} }; var inlineStyle = styles$H(theme || { zIndex: zIndex }); var childProps = {}; if (children.props.tabIndex === undefined) {
|
|
7221
7286
|
childProps.tabIndex = children.props.tabIndex || '-1';
|
|
7222
7287
|
} if (hasTransition) {
|
|
7223
7288
|
childProps.onEnter = createChainedFunction(handleEnter, children.props.onEnter);
|
|
7224
7289
|
childProps.onExited = createChainedFunction(handleExited, children.props.onExited);
|
|
7225
7290
|
} 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)))); });
|
|
7226
|
-
var styles$
|
|
7291
|
+
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%' } } }; };
|
|
7227
7292
|
var defaultTransitionDuration = { enter: duration.enteringScreen, exit: duration.leavingScreen };
|
|
7228
7293
|
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) {
|
|
7229
7294
|
return;
|
|
@@ -7234,16 +7299,19 @@ var Dialog = /*#__PURE__*/ N$1(function Dialog(props, ref) { var BackdropProps =
|
|
|
7234
7299
|
} if (!disableBackdropClick && onClose) {
|
|
7235
7300
|
onClose(event, 'backdropClick');
|
|
7236
7301
|
} }; 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)))); });
|
|
7237
|
-
var Dialog$1 = withStyles(styles$
|
|
7238
|
-
var styles$
|
|
7302
|
+
var Dialog$1 = withStyles(styles$G, { name: 'MuiDialog' })(Dialog);
|
|
7303
|
+
var styles$F = { root: { display: 'flex', alignItems: 'center', padding: 8, justifyContent: 'flex-end', flex: '0 0 auto' }, spacing: { '& > :not(:first-child)': { marginLeft: 8 } } };
|
|
7239
7304
|
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)); });
|
|
7240
|
-
var DialogActions$1 = withStyles(styles$
|
|
7241
|
-
var styles$
|
|
7305
|
+
var DialogActions$1 = withStyles(styles$F, { name: 'MuiDialogActions' })(DialogActions);
|
|
7306
|
+
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) } }; };
|
|
7242
7307
|
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)); });
|
|
7243
|
-
var DialogContent$1 = withStyles(styles$
|
|
7244
|
-
var styles$
|
|
7245
|
-
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(
|
|
7246
|
-
var DialogTitle$1 = withStyles(styles$
|
|
7308
|
+
var DialogContent$1 = withStyles(styles$E, { name: 'MuiDialogContent' })(DialogContent);
|
|
7309
|
+
var styles$D = { root: { margin: 0, padding: '16px 24px', flex: '0 0 auto' } };
|
|
7310
|
+
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)); });
|
|
7311
|
+
var DialogTitle$1 = withStyles(styles$D, { name: 'MuiDialogTitle' })(DialogTitle);
|
|
7312
|
+
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' } }; };
|
|
7313
|
+
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)); });
|
|
7314
|
+
var Divider$1 = withStyles(styles$C, { name: 'MuiDivider' })(Divider);
|
|
7247
7315
|
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) {
|
|
7248
7316
|
if (typeof props[state] === 'undefined') {
|
|
7249
7317
|
acc[state] = muiFormControl[state];
|
|
@@ -7251,7 +7319,7 @@ function formControlState(_ref) { var props = _ref.props, states = _ref.states,
|
|
|
7251
7319
|
} return acc; }, {}); }
|
|
7252
7320
|
function getStyleValue(computedStyle, property) { return parseInt(computedStyle[property], 10) || 0; }
|
|
7253
7321
|
var useEnhancedEffect$4 = typeof window !== 'undefined' ? y$2 : p$3;
|
|
7254
|
-
var styles$
|
|
7322
|
+
var styles$B = { shadow: { visibility: 'hidden', position: 'absolute', overflow: 'hidden', height: 0, top: 0, left: 0, transform: 'translateZ(0)' } };
|
|
7255
7323
|
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') {
|
|
7256
7324
|
inputShallow.value += ' ';
|
|
7257
7325
|
} 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) {
|
|
@@ -7265,10 +7333,11 @@ var TextareaAutosize = /*#__PURE__*/ N$1(function TextareaAutosize(props, ref) {
|
|
|
7265
7333
|
syncHeight();
|
|
7266
7334
|
} if (onChange) {
|
|
7267
7335
|
onChange(event);
|
|
7268
|
-
} }; 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$
|
|
7336
|
+
} }; 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) })); });
|
|
7269
7337
|
function hasValue(value) { return value != null && !(Array.isArray(value) && value.length === 0); }
|
|
7270
7338
|
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 !== ''); }
|
|
7271
|
-
|
|
7339
|
+
function isAdornedStart(obj) { return obj.startAdornment; }
|
|
7340
|
+
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: {} }; };
|
|
7272
7341
|
var useEnhancedEffect$3 = typeof window === 'undefined' ? p$3 : y$2;
|
|
7273
7342
|
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) {
|
|
7274
7343
|
setFocused(false);
|
|
@@ -7338,15 +7407,50 @@ else {
|
|
|
7338
7407
|
} var handleAutoFill = function handleAutoFill(event) { checkDirty(event.animationName === 'mui-auto-fill-cancel' ? inputRef.current : { value: 'x' }); }; p$3(function () { if (muiFormControl) {
|
|
7339
7408
|
muiFormControl.setAdornedStart(Boolean(startAdornment));
|
|
7340
7409
|
} }, [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); });
|
|
7341
|
-
var InputBase$1 = withStyles(styles$
|
|
7342
|
-
var styles$
|
|
7410
|
+
var InputBase$1 = withStyles(styles$A, { name: 'MuiInputBase' })(InputBase);
|
|
7411
|
+
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 } }; };
|
|
7343
7412
|
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)); });
|
|
7344
7413
|
FilledInput.muiName = 'Input';
|
|
7345
|
-
var FilledInput$1 = withStyles(styles$
|
|
7414
|
+
var FilledInput$1 = withStyles(styles$z, { name: 'MuiFilledInput' })(FilledInput);
|
|
7415
|
+
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%' } };
|
|
7416
|
+
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) {
|
|
7417
|
+
A$3.forEach(children, function (child) { if (!isMuiElement(child, ['Input', 'Select'])) {
|
|
7418
|
+
return;
|
|
7419
|
+
} var input = isMuiElement(child, ['Select']) ? child.props.input : child; if (input && isAdornedStart(input.props)) {
|
|
7420
|
+
initialAdornedStart = true;
|
|
7421
|
+
} });
|
|
7422
|
+
} return initialAdornedStart; }), adornedStart = _React$useState[0], setAdornedStart = _React$useState[1]; var _React$useState2 = h$4(function () { var initialFilled = false; if (children) {
|
|
7423
|
+
A$3.forEach(children, function (child) { if (!isMuiElement(child, ['Input', 'Select'])) {
|
|
7424
|
+
return;
|
|
7425
|
+
} if (isFilled(child.props, true)) {
|
|
7426
|
+
initialFilled = true;
|
|
7427
|
+
} });
|
|
7428
|
+
} 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) {
|
|
7429
|
+
setFocused(false);
|
|
7430
|
+
} 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)); });
|
|
7431
|
+
var FormControl$1 = withStyles(styles$y, { name: 'MuiFormControl' })(FormControl);
|
|
7432
|
+
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 } } }; };
|
|
7433
|
+
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') {
|
|
7434
|
+
disabled = control.props.disabled;
|
|
7435
|
+
} if (typeof disabled === 'undefined' && muiFormControl) {
|
|
7436
|
+
disabled = muiFormControl.disabled;
|
|
7437
|
+
} var controlProps = { disabled: disabled }; ['checked', 'name', 'onChange', 'value', 'inputRef'].forEach(function (key) { if (typeof control.props[key] === 'undefined' && typeof props[key] !== 'undefined') {
|
|
7438
|
+
controlProps[key] = props[key];
|
|
7439
|
+
} }); 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)); });
|
|
7440
|
+
var FormControlLabel$1 = withStyles(styles$x, { name: 'MuiFormControlLabel' })(FormControlLabel);
|
|
7441
|
+
var styles$w = { root: { display: 'flex', flexDirection: 'column', flexWrap: 'wrap' }, row: { flexDirection: 'row' } };
|
|
7442
|
+
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)); });
|
|
7443
|
+
var FormGroup$1 = withStyles(styles$w, { name: 'MuiFormGroup' })(FormGroup);
|
|
7444
|
+
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: {} }; };
|
|
7445
|
+
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); });
|
|
7446
|
+
var FormHelperText$1 = withStyles(styles$v, { name: 'MuiFormHelperText' })(FormHelperText);
|
|
7447
|
+
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 } } }; };
|
|
7448
|
+
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", '*')); });
|
|
7449
|
+
var FormLabel$1 = withStyles(styles$u, { name: 'MuiFormLabel' })(FormLabel);
|
|
7346
7450
|
function getScale(value) { return "scale(".concat(value, ", ").concat(Math.pow(value, 2), ")"); }
|
|
7347
|
-
var styles$
|
|
7451
|
+
var styles$t = { entering: { opacity: 1, transform: getScale(1) }, entered: { opacity: 1, transform: 'none' } };
|
|
7348
7452
|
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) {
|
|
7349
|
-
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing], _ref2 = _slicedToArray(_ref, 2), node = _ref2[0], isAppearing = _ref2[1];
|
|
7453
|
+
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing], _ref2 = _slicedToArray$1(_ref, 2), node = _ref2[0], isAppearing = _ref2[1];
|
|
7350
7454
|
if (isAppearing === undefined) {
|
|
7351
7455
|
callback(node);
|
|
7352
7456
|
}
|
|
@@ -7371,7 +7475,7 @@ else {
|
|
|
7371
7475
|
onExit(node);
|
|
7372
7476
|
} }); var handleExited = normalizedTransitionCallback(onExited); var addEndListener = function addEndListener(nodeOrNext, maybeNext) { var next = enableStrictModeCompat ? nodeOrNext : maybeNext; if (timeout === 'auto') {
|
|
7373
7477
|
timer.current = setTimeout(next, autoTimeout.current || 0);
|
|
7374
|
-
} }; 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$
|
|
7478
|
+
} }; 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)); }); });
|
|
7375
7479
|
Grow.muiSupportAuto = true;
|
|
7376
7480
|
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) {
|
|
7377
7481
|
return matchMedia(query).matches;
|
|
@@ -7382,15 +7486,20 @@ function useMediaQuery(queryInput) { var options = arguments.length > 1 && argum
|
|
|
7382
7486
|
} var queryList = matchMedia(query); var updateMatch = function updateMatch() { if (active) {
|
|
7383
7487
|
setMatch(queryList.matches);
|
|
7384
7488
|
} }; updateMatch(); queryList.addListener(updateMatch); return function () { active = false; queryList.removeListener(updateMatch); }; }, [query, matchMedia, supportMatchMedia]); return match; }
|
|
7385
|
-
var styles$
|
|
7386
|
-
var Input$
|
|
7387
|
-
Input$
|
|
7388
|
-
var Input$
|
|
7489
|
+
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: {} }; };
|
|
7490
|
+
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)); });
|
|
7491
|
+
Input$2.muiName = 'Input';
|
|
7492
|
+
var Input$3 = withStyles(styles$s, { name: 'MuiInput' })(Input$2);
|
|
7493
|
+
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)' } } }; };
|
|
7494
|
+
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) {
|
|
7495
|
+
shrink = muiFormControl.filled || muiFormControl.focused || muiFormControl.adornedStart;
|
|
7496
|
+
} 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)); });
|
|
7497
|
+
var InputLabel$1 = withStyles(styles$r, { name: 'MuiInputLabel' })(InputLabel);
|
|
7389
7498
|
var ListContext = /*#__PURE__*/ F$4({});
|
|
7390
|
-
var styles$
|
|
7499
|
+
var styles$q = { root: { listStyle: 'none', margin: 0, padding: 0, position: 'relative' }, padding: { paddingTop: 8, paddingBottom: 8 }, dense: {}, subheader: { paddingTop: 0 } };
|
|
7391
7500
|
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)); });
|
|
7392
|
-
var List$1 = withStyles(styles$
|
|
7393
|
-
var styles$
|
|
7501
|
+
var List$1 = withStyles(styles$q, { name: 'MuiList' })(List);
|
|
7502
|
+
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: {} }; };
|
|
7394
7503
|
var useEnhancedEffect$2 = typeof window === 'undefined' ? p$3 : y$2;
|
|
7395
7504
|
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) {
|
|
7396
7505
|
if (listItemRef.current) {
|
|
@@ -7412,7 +7521,10 @@ var ListItem = /*#__PURE__*/ N$1(function ListItem(props, ref) { var _props$alig
|
|
|
7412
7521
|
}
|
|
7413
7522
|
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()));
|
|
7414
7523
|
} return /*#__PURE__*/ y$3(ListContext.Provider, { value: childContext }, /*#__PURE__*/ y$3(Component, _extends$4({ ref: handleRef }, componentProps), children)); });
|
|
7415
|
-
var ListItem$1 = withStyles(styles$
|
|
7524
|
+
var ListItem$1 = withStyles(styles$p, { name: 'MuiListItem' })(ListItem);
|
|
7525
|
+
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' } }; };
|
|
7526
|
+
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)); });
|
|
7527
|
+
var ListSubheader$1 = withStyles(styles$o, { name: 'MuiListSubheader' })(ListSubheader);
|
|
7416
7528
|
function getOffsetTop(rect, vertical) { var offset = 0; if (typeof vertical === 'number') {
|
|
7417
7529
|
offset = vertical;
|
|
7418
7530
|
}
|
|
@@ -7437,7 +7549,7 @@ function getScrollParent$1(parent, child) { var element = child; var scrollTop =
|
|
|
7437
7549
|
scrollTop += element.scrollTop;
|
|
7438
7550
|
} return scrollTop; }
|
|
7439
7551
|
function getAnchorEl$1(anchorEl) { return typeof anchorEl === 'function' ? anchorEl() : anchorEl; }
|
|
7440
|
-
var styles$
|
|
7552
|
+
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 } };
|
|
7441
7553
|
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') {
|
|
7442
7554
|
return anchorPosition;
|
|
7443
7555
|
} 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') {
|
|
@@ -7481,7 +7593,7 @@ else if (right > widthThreshold) {
|
|
|
7481
7593
|
} 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) {
|
|
7482
7594
|
transitionDuration = undefined;
|
|
7483
7595
|
} 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))); });
|
|
7484
|
-
var Popover$1 = withStyles(styles$
|
|
7596
|
+
var Popover$1 = withStyles(styles$n, { name: 'MuiPopover' })(Popover);
|
|
7485
7597
|
function nextItem(list, item, disableListWrap) { if (list === item) {
|
|
7486
7598
|
return list.firstChild;
|
|
7487
7599
|
} if (item && item.nextElementSibling) {
|
|
@@ -7586,7 +7698,7 @@ else if (key.length === 1) {
|
|
|
7586
7698
|
} return child; }); return /*#__PURE__*/ y$3(List$1, _extends$4({ role: "menu", ref: handleRef, className: className, onKeyDown: handleKeyDown, tabIndex: autoFocus ? 0 : -1 }, other), items); });
|
|
7587
7699
|
var RTL_ORIGIN = { vertical: 'top', horizontal: 'right' };
|
|
7588
7700
|
var LTR_ORIGIN = { vertical: 'top', horizontal: 'left' };
|
|
7589
|
-
var styles$
|
|
7701
|
+
var styles$m = { paper: { maxHeight: 'calc(100% - 96px)', WebkitOverflowScrolling: 'touch' }, list: { outline: 0 } };
|
|
7590
7702
|
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) {
|
|
7591
7703
|
menuListActionsRef.current.adjustStyleForScrollbar(element, theme);
|
|
7592
7704
|
} if (onEnteringProp) {
|
|
@@ -7610,28 +7722,28 @@ var Menu = /*#__PURE__*/ N$1(function Menu(props, ref) { var _props$autoFocus =
|
|
|
7610
7722
|
} }); var items = A$3.map(children, function (child, index) { if (index === activeItemIndex) {
|
|
7611
7723
|
return /*#__PURE__*/ sn(child, { ref: function ref(instance) { contentAnchorRef.current = vn(instance); setRef(child.ref, instance); } });
|
|
7612
7724
|
} 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)); });
|
|
7613
|
-
var Menu$1 = withStyles(styles$
|
|
7614
|
-
var styles$
|
|
7725
|
+
var Menu$1 = withStyles(styles$m, { name: 'MuiMenu' })(Menu);
|
|
7726
|
+
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' }) }; };
|
|
7615
7727
|
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) {
|
|
7616
7728
|
tabIndex = tabIndexProp !== undefined ? tabIndexProp : -1;
|
|
7617
7729
|
} 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)); });
|
|
7618
|
-
var MenuItem$2 = withStyles(styles$
|
|
7730
|
+
var MenuItem$2 = withStyles(styles$l, { name: 'MuiMenuItem' })(MenuItem$1);
|
|
7619
7731
|
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) })); });
|
|
7620
|
-
var ArrowDropDownIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M7 10l5 5 5-5z" }));
|
|
7621
|
-
var styles$
|
|
7622
|
-
var defaultInput = /*#__PURE__*/ y$3(Input$
|
|
7623
|
-
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)); });
|
|
7732
|
+
var ArrowDropDownIcon$1 = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M7 10l5 5 5-5z" }));
|
|
7733
|
+
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%' } }; };
|
|
7734
|
+
var defaultInput = /*#__PURE__*/ y$3(Input$3, null);
|
|
7735
|
+
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)); });
|
|
7624
7736
|
NativeSelect.muiName = 'Select';
|
|
7625
|
-
withStyles(styles$
|
|
7626
|
-
var styles$
|
|
7737
|
+
withStyles(styles$k, { name: 'MuiNativeSelect' })(NativeSelect);
|
|
7738
|
+
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 }) } }; };
|
|
7627
7739
|
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) {
|
|
7628
7740
|
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: '​' } })));
|
|
7629
|
-
} 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: '​' } }))); });
|
|
7630
|
-
var NotchedOutline$1 = withStyles(styles$
|
|
7631
|
-
var styles$
|
|
7741
|
+
} 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: '​' } }))); });
|
|
7742
|
+
var NotchedOutline$1 = withStyles(styles$j, { name: 'PrivateNotchedOutline' })(NotchedOutline);
|
|
7743
|
+
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 } }; };
|
|
7632
7744
|
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)); });
|
|
7633
7745
|
OutlinedInput.muiName = 'Input';
|
|
7634
|
-
var OutlinedInput$1 = withStyles(styles$
|
|
7746
|
+
var OutlinedInput$1 = withStyles(styles$i, { name: 'MuiOutlinedInput' })(OutlinedInput);
|
|
7635
7747
|
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
|
|
7636
7748
|
var timeoutDuration = function () { var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
|
|
7637
7749
|
if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
|
|
@@ -7830,10 +7942,10 @@ else {
|
|
|
7830
7942
|
function find(arr, check) { if (Array.prototype.find) {
|
|
7831
7943
|
return arr.find(check);
|
|
7832
7944
|
} return arr.filter(check)[0]; }
|
|
7833
|
-
function findIndex(arr, prop, value) { if (Array.prototype.findIndex) {
|
|
7945
|
+
function findIndex$1(arr, prop, value) { if (Array.prototype.findIndex) {
|
|
7834
7946
|
return arr.findIndex(function (cur) { return cur[prop] === value; });
|
|
7835
7947
|
} var match = find(arr, function (obj) { return obj[prop] === value; }); return arr.indexOf(match); }
|
|
7836
|
-
function runModifiers(modifiers, data, ends) { var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); modifiersToRun.forEach(function (modifier) { if (modifier['function']) {
|
|
7948
|
+
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']) {
|
|
7837
7949
|
console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
|
|
7838
7950
|
} var fn = modifier['function'] || modifier.fn; if (modifier.enabled && isFunction(fn)) {
|
|
7839
7951
|
data.offsets.popper = getClientRect(data.offsets.popper);
|
|
@@ -8136,11 +8248,30 @@ var Popper = /*#__PURE__*/ N$1(function Popper(props, ref) { var anchorEl = prop
|
|
|
8136
8248
|
} var childProps = { placement: placement }; if (transition) {
|
|
8137
8249
|
childProps.TransitionProps = { "in": open, onEnter: handleEnter, onExited: handleExited };
|
|
8138
8250
|
} 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)); });
|
|
8139
|
-
|
|
8251
|
+
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" }));
|
|
8252
|
+
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" }));
|
|
8253
|
+
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: {} }; };
|
|
8254
|
+
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 })); }
|
|
8255
|
+
var RadioButtonIcon$1 = withStyles(styles$h, { name: 'PrivateRadioButtonIcon' })(RadioButtonIcon);
|
|
8256
|
+
var RadioGroupContext = /*#__PURE__*/ F$4();
|
|
8257
|
+
function useRadioGroup() { return q$5(RadioGroupContext); }
|
|
8258
|
+
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 } } }; };
|
|
8259
|
+
var defaultCheckedIcon = /*#__PURE__*/ y$3(RadioButtonIcon$1, { checked: true });
|
|
8260
|
+
var defaultIcon = /*#__PURE__*/ y$3(RadioButtonIcon$1, null);
|
|
8261
|
+
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) {
|
|
8262
|
+
if (typeof checked === 'undefined') {
|
|
8263
|
+
checked = radioGroup.value === props.value;
|
|
8264
|
+
}
|
|
8265
|
+
if (typeof name === 'undefined') {
|
|
8266
|
+
name = radioGroup.name;
|
|
8267
|
+
}
|
|
8268
|
+
} 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)); });
|
|
8269
|
+
var MUIRadio = withStyles(styles$g, { name: 'MuiRadio' })(Radio);
|
|
8270
|
+
function areEqualValues(a, b) { if (_typeof$4(b) === 'object' && b !== null) {
|
|
8140
8271
|
return a === b;
|
|
8141
8272
|
} return String(a) === String(b); }
|
|
8142
8273
|
function isEmpty(display) { return display == null || typeof display === 'string' && !display.trim(); }
|
|
8143
|
-
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) {
|
|
8274
|
+
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) {
|
|
8144
8275
|
displayNode.focus();
|
|
8145
8276
|
} }, [autoFocus, displayNode]); p$3(function () { if (displayNode) {
|
|
8146
8277
|
var label = ownerDocument(displayNode).getElementById(labelId);
|
|
@@ -8236,16 +8367,16 @@ else {
|
|
|
8236
8367
|
else {
|
|
8237
8368
|
tabIndex = disabled ? null : 0;
|
|
8238
8369
|
} 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)); });
|
|
8239
|
-
var styles$
|
|
8240
|
-
var _ref$
|
|
8241
|
-
var _ref2$
|
|
8242
|
-
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$
|
|
8370
|
+
var styles$f = styles$k;
|
|
8371
|
+
var _ref$3 = /*#__PURE__*/ y$3(Input$3, null);
|
|
8372
|
+
var _ref2$2 = /*#__PURE__*/ y$3(FilledInput$1, null);
|
|
8373
|
+
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)); });
|
|
8243
8374
|
Select$1.muiName = 'Select';
|
|
8244
|
-
var MuiSelect = withStyles(styles$
|
|
8245
|
-
var styles$
|
|
8375
|
+
var MuiSelect = withStyles(styles$f, { name: 'MuiSelect' })(Select$1);
|
|
8376
|
+
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 } }; };
|
|
8246
8377
|
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); });
|
|
8247
|
-
var SnackbarContent$1 = withStyles(styles$
|
|
8248
|
-
var styles$
|
|
8378
|
+
var SnackbarContent$1 = withStyles(styles$e, { name: 'MuiSnackbarContent' })(SnackbarContent);
|
|
8379
|
+
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))) }; };
|
|
8249
8380
|
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) {
|
|
8250
8381
|
onClose.apply(void 0, arguments);
|
|
8251
8382
|
} }); var setAutoHideTimer = useEventCallback(function (autoHideDurationParam) { if (!onClose || autoHideDurationParam == null) {
|
|
@@ -8267,19 +8398,22 @@ var Snackbar = /*#__PURE__*/ N$1(function Snackbar(props, ref) { var action = pr
|
|
|
8267
8398
|
} return undefined; }, [disableWindowBlurListener, handleResume, open]); if (!open && exited) {
|
|
8268
8399
|
return null;
|
|
8269
8400
|
} 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))))); });
|
|
8270
|
-
var Snackbar$1 = withStyles(styles$
|
|
8401
|
+
var Snackbar$1 = withStyles(styles$d, { flip: false, name: 'MuiSnackbar' })(Snackbar);
|
|
8402
|
+
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 } }; };
|
|
8403
|
+
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 })); });
|
|
8404
|
+
var MUISwitch = withStyles(styles$c, { name: 'MuiSwitch' })(Switch$1);
|
|
8271
8405
|
var TableContext = /*#__PURE__*/ F$4();
|
|
8272
|
-
var styles$
|
|
8406
|
+
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' } }; };
|
|
8273
8407
|
var defaultComponent$3 = 'table';
|
|
8274
8408
|
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))); });
|
|
8275
|
-
var MUITable = withStyles(styles$
|
|
8409
|
+
var MUITable = withStyles(styles$b, { name: 'MuiTable' })(Table$1);
|
|
8276
8410
|
var Tablelvl2Context = /*#__PURE__*/ F$4();
|
|
8277
|
-
var styles$
|
|
8411
|
+
var styles$a = { root: { display: 'table-row-group' } };
|
|
8278
8412
|
var tablelvl2$1 = { variant: 'body' };
|
|
8279
8413
|
var defaultComponent$2 = 'tbody';
|
|
8280
8414
|
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))); });
|
|
8281
|
-
var TableBody$1 = withStyles(styles$
|
|
8282
|
-
var styles$
|
|
8415
|
+
var TableBody$1 = withStyles(styles$a, { name: 'MuiTableBody' })(TableBody);
|
|
8416
|
+
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"] } }; };
|
|
8283
8417
|
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) {
|
|
8284
8418
|
Component = component;
|
|
8285
8419
|
role = isHeadCell ? 'columnheader' : 'cell';
|
|
@@ -8291,42 +8425,60 @@ else {
|
|
|
8291
8425
|
} 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) {
|
|
8292
8426
|
ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';
|
|
8293
8427
|
} 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)); });
|
|
8294
|
-
var MUITableCell = withStyles(styles$
|
|
8295
|
-
var styles$
|
|
8428
|
+
var MUITableCell = withStyles(styles$9, { name: 'MuiTableCell' })(TableCell$1);
|
|
8429
|
+
var styles$8 = { root: { width: '100%', overflowX: 'auto' } };
|
|
8296
8430
|
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)); });
|
|
8297
|
-
var TableContainer$1 = withStyles(styles$
|
|
8298
|
-
var styles$
|
|
8431
|
+
var TableContainer$1 = withStyles(styles$8, { name: 'MuiTableContainer' })(TableContainer);
|
|
8432
|
+
var styles$7 = { root: { display: 'table-header-group' } };
|
|
8299
8433
|
var tablelvl2 = { variant: 'head' };
|
|
8300
8434
|
var defaultComponent$1 = 'thead';
|
|
8301
8435
|
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))); });
|
|
8302
|
-
var TableHead$1 = withStyles(styles$
|
|
8303
|
-
var styles$
|
|
8436
|
+
var TableHead$1 = withStyles(styles$7, { name: 'MuiTableHead' })(TableHead);
|
|
8437
|
+
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 } }; };
|
|
8304
8438
|
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)); });
|
|
8305
|
-
var Toolbar$1 = withStyles(styles$
|
|
8439
|
+
var Toolbar$1 = withStyles(styles$6, { name: 'MuiToolbar' })(Toolbar);
|
|
8306
8440
|
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" }));
|
|
8307
8441
|
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" }));
|
|
8308
|
-
var _ref$
|
|
8309
|
-
var _ref2 = /*#__PURE__*/ y$3(KeyboardArrowLeft, null);
|
|
8442
|
+
var _ref$2 = /*#__PURE__*/ y$3(KeyboardArrowRight, null);
|
|
8443
|
+
var _ref2$1 = /*#__PURE__*/ y$3(KeyboardArrowLeft, null);
|
|
8310
8444
|
var _ref3 = /*#__PURE__*/ y$3(KeyboardArrowLeft, null);
|
|
8311
8445
|
var _ref4 = /*#__PURE__*/ y$3(KeyboardArrowRight, null);
|
|
8312
|
-
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$
|
|
8313
|
-
var styles$
|
|
8446
|
+
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)); });
|
|
8447
|
+
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 } }; };
|
|
8314
8448
|
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)); };
|
|
8315
|
-
var defaultRowsPerPageOptions = [10, 25, 50, 100];
|
|
8316
|
-
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') {
|
|
8449
|
+
var defaultRowsPerPageOptions$1 = [10, 25, 50, 100];
|
|
8450
|
+
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') {
|
|
8317
8451
|
colSpan = colSpanProp || 1000;
|
|
8318
|
-
} 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(
|
|
8319
|
-
var TablePagination$1 = withStyles(styles$
|
|
8320
|
-
var styles$
|
|
8452
|
+
} 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 }))); });
|
|
8453
|
+
var TablePagination$1 = withStyles(styles$5, { name: 'MuiTablePagination' })(TablePagination);
|
|
8454
|
+
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: {} }; };
|
|
8321
8455
|
var defaultComponent = 'tr';
|
|
8322
8456
|
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)); });
|
|
8323
|
-
var MUITableRow = withStyles(styles$
|
|
8457
|
+
var MUITableRow = withStyles(styles$4, { name: 'MuiTableRow' })(TableRow$1);
|
|
8458
|
+
var variantComponent = { standard: Input$3, filled: FilledInput$1, outlined: OutlinedInput$1 };
|
|
8459
|
+
var styles$3 = { root: {} };
|
|
8460
|
+
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') {
|
|
8461
|
+
if (InputLabelProps && typeof InputLabelProps.shrink !== 'undefined') {
|
|
8462
|
+
InputMore.notched = InputLabelProps.shrink;
|
|
8463
|
+
}
|
|
8464
|
+
if (label) {
|
|
8465
|
+
var _InputLabelProps$requ;
|
|
8466
|
+
var displayRequired = (_InputLabelProps$requ = InputLabelProps === null || InputLabelProps === void 0 ? void 0 : InputLabelProps.required) !== null && _InputLabelProps$requ !== void 0 ? _InputLabelProps$requ : required;
|
|
8467
|
+
InputMore.label = /*#__PURE__*/ y$3(g$5, null, label, displayRequired && "\xA0*");
|
|
8468
|
+
}
|
|
8469
|
+
} if (select) {
|
|
8470
|
+
if (!SelectProps || !SelectProps["native"]) {
|
|
8471
|
+
InputMore.id = undefined;
|
|
8472
|
+
}
|
|
8473
|
+
InputMore['aria-describedby'] = undefined;
|
|
8474
|
+
} 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)); });
|
|
8475
|
+
var TextField$1 = withStyles(styles$3, { name: 'MuiTextField' })(TextField);
|
|
8324
8476
|
function round(value) { return Math.round(value * 1e5) / 1e5; }
|
|
8325
8477
|
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' } } }; }
|
|
8326
|
-
var styles$
|
|
8478
|
+
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' }) }; };
|
|
8327
8479
|
var hystersisOpen = false;
|
|
8328
8480
|
var hystersisTimer = null;
|
|
8329
|
-
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) {
|
|
8481
|
+
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) {
|
|
8330
8482
|
onOpen(event);
|
|
8331
8483
|
} }; 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) {
|
|
8332
8484
|
childrenProps.onMouseOver(event);
|
|
@@ -8383,21 +8535,23 @@ else {
|
|
|
8383
8535
|
interactiveWrapperListeners.onBlur = handleLeave(false);
|
|
8384
8536
|
}
|
|
8385
8537
|
} 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)); })); });
|
|
8386
|
-
var
|
|
8387
|
-
var useStyles$
|
|
8388
|
-
var MainContainer = function MainContainer(
|
|
8389
|
-
var StytchClientContext = /*#__PURE__*/ wn.createContext(null);
|
|
8538
|
+
var Tooltip$2 = withStyles(styles$2, { name: 'MuiTooltip', flip: false })(Tooltip$1);
|
|
8539
|
+
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' } }; });
|
|
8540
|
+
var MainContainer = function MainContainer(_ref6) { var children = _ref6.children; var classes = useStyles$p(); return /*#__PURE__*/ wn.createElement("div", { className: classes.root }, children); };
|
|
8541
|
+
var StytchClientContext = /*#__PURE__*/ wn.createContext({ client: null });
|
|
8542
|
+
var useAdminPortalContext = function useAdminPortalContext() { return q$5(StytchClientContext); };
|
|
8543
|
+
var useAdminPortalOrgUIConfig = function useAdminPortalOrgUIConfig() { return useAdminPortalContext().config; };
|
|
8390
8544
|
var CheckCircle = {};
|
|
8391
8545
|
var interopRequireDefault = { exports: {} };
|
|
8392
8546
|
(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);
|
|
8393
8547
|
var interopRequireDefaultExports = interopRequireDefault.exports;
|
|
8394
8548
|
var interopRequireWildcard = { exports: {} };
|
|
8395
|
-
var _typeof = { exports: {} };
|
|
8549
|
+
var _typeof$1 = { exports: {} };
|
|
8396
8550
|
(function (module) { function _typeof(o) {
|
|
8397
8551
|
"@babel/helpers - typeof";
|
|
8398
8552
|
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);
|
|
8399
|
-
} module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; })(_typeof);
|
|
8400
|
-
var _typeofExports = _typeof.exports;
|
|
8553
|
+
} module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; })(_typeof$1);
|
|
8554
|
+
var _typeofExports = _typeof$1.exports;
|
|
8401
8555
|
(function (module) { var _typeof = _typeofExports["default"]; function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap)
|
|
8402
8556
|
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)
|
|
8403
8557
|
return e; if (null === e || "object" != _typeof(e) && "function" != typeof e)
|
|
@@ -8471,11 +8625,11 @@ var ReportProblemOutlinedIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "
|
|
|
8471
8625
|
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" }));
|
|
8472
8626
|
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" }));
|
|
8473
8627
|
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" }));
|
|
8474
|
-
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 } }; };
|
|
8628
|
+
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 } }; };
|
|
8475
8629
|
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" }) };
|
|
8476
|
-
var _ref = /*#__PURE__*/ y$3(CloseIcon, { fontSize: "small" });
|
|
8477
|
-
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); });
|
|
8478
|
-
var MUIAlert = withStyles(styles, { name: 'MuiAlert' })(Alert$1);
|
|
8630
|
+
var _ref$1 = /*#__PURE__*/ y$3(CloseIcon, { fontSize: "small" });
|
|
8631
|
+
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); });
|
|
8632
|
+
var MUIAlert = withStyles(styles$1, { name: 'MuiAlert' })(Alert$1);
|
|
8479
8633
|
var classnames = { exports: {} }; /*!
|
|
8480
8634
|
Copyright (c) 2018 Jed Watson.
|
|
8481
8635
|
Licensed under the MIT License (MIT), see
|
|
@@ -8525,24 +8679,24 @@ var getToastIcon = function getToastIcon(type) { switch (type) {
|
|
|
8525
8679
|
case 'error': return default_1$a;
|
|
8526
8680
|
default: return default_1$c;
|
|
8527
8681
|
} };
|
|
8528
|
-
var Toast = function Toast(
|
|
8682
|
+
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)); };
|
|
8529
8683
|
var DEFAULT_STATE$1 = { openToast: noop, closeToast: noop };
|
|
8530
8684
|
var ToastContext = /*#__PURE__*/ F$4(DEFAULT_STATE$1);
|
|
8531
8685
|
var useToast = function useToast() { return q$5(ToastContext); };
|
|
8532
|
-
var ToastContextProviderCore = function ToastContextProviderCore(
|
|
8686
|
+
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) {
|
|
8533
8687
|
clearTimeout(timeoutRef.current);
|
|
8534
|
-
} timeoutRef.current = setTimeout(function () { setOpen(false); }, openDurationMS); }, []); var openToast = T$2(function (
|
|
8688
|
+
} 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); };
|
|
8535
8689
|
var makeTypographyStyles = makeStylesFactory(function (theme) { return { typography: { '& ul': { margin: theme.spacing(1, 0, 0) } }, disabled: {} }; });
|
|
8536
8690
|
var colorToMUIColor = { primary: 'primary', secondary: 'textSecondary', error: 'error' };
|
|
8537
|
-
var TypographyCore = function TypographyCore(
|
|
8538
|
-
var useStyles$
|
|
8539
|
-
var Typography = function Typography(props) { var classes = useStyles$
|
|
8540
|
-
var useStyles$
|
|
8541
|
-
var ToastContextProvider = function ToastContextProvider(props) { var classes = useStyles$
|
|
8691
|
+
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); };
|
|
8692
|
+
var useStyles$o = makeTypographyStyles();
|
|
8693
|
+
var Typography = function Typography(props) { var classes = useStyles$o(); return /*#__PURE__*/ wn.createElement(TypographyCore, Object.assign({}, props, { classes: classes })); };
|
|
8694
|
+
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 } }; });
|
|
8695
|
+
var ToastContextProvider = function ToastContextProvider(props) { var classes = useStyles$n(); return /*#__PURE__*/ wn.createElement(ToastContextProviderCore, Object.assign({ TypographyComponent: Typography, classes: classes }, props)); };
|
|
8542
8696
|
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' };
|
|
8543
|
-
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; };
|
|
8544
|
-
var ContextProvider = function ContextProvider(
|
|
8545
|
-
var AdminPortalWrapper = function AdminPortalWrapper(
|
|
8697
|
+
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; };
|
|
8698
|
+
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)); };
|
|
8699
|
+
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))); };
|
|
8546
8700
|
var ReportProblemOutlined = {};
|
|
8547
8701
|
var _interopRequireDefault$9 = interopRequireDefaultExports;
|
|
8548
8702
|
var _interopRequireWildcard$9 = interopRequireWildcardExports;
|
|
@@ -8552,10 +8706,10 @@ var React$9 = _interopRequireWildcard$9(require$$2);
|
|
|
8552
8706
|
var _createSvgIcon$9 = _interopRequireDefault$9(requireCreateSvgIcon());
|
|
8553
8707
|
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');
|
|
8554
8708
|
default_1$9 = ReportProblemOutlined["default"] = _default$9;
|
|
8555
|
-
var useStyles$
|
|
8556
|
-
var Alert = function Alert(
|
|
8709
|
+
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) } }; });
|
|
8710
|
+
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)); };
|
|
8557
8711
|
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" })); };
|
|
8558
|
-
var useStytchClient = function useStytchClient() { var client = wn.useContext(StytchClientContext); if (!client) {
|
|
8712
|
+
var useStytchClient = function useStytchClient() { var client = wn.useContext(StytchClientContext).client; if (!client) {
|
|
8559
8713
|
throw new Error('A Stytch client could not be found');
|
|
8560
8714
|
} return client; };
|
|
8561
8715
|
var useB2BInternals = function useB2BInternals() { var client = useStytchClient(); return readB2BInternals(client); };
|
|
@@ -8575,14 +8729,14 @@ var makeButtonStyles = makeStylesFactory(function (theme) { return { button: _de
|
|
|
8575
8729
|
var variantToMUIVariant = { ghost: 'outlined', primary: 'contained', secondary: 'contained', text: 'text' };
|
|
8576
8730
|
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); };
|
|
8577
8731
|
var mixed = function mixed(color) { return "color-mix(in srgb, ".concat(color, " 80%, #333)"); };
|
|
8578
|
-
var useStyles$
|
|
8579
|
-
var Button = function Button(_a) { var props = __rest(_a, []); var classes = useStyles$
|
|
8732
|
+
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 } }; });
|
|
8733
|
+
var Button = function Button(_a) { var props = __rest(_a, []); var classes = useStyles$l(); return /*#__PURE__*/ wn.createElement(ButtonCore, Object.assign({}, props, { classes: classes })); };
|
|
8580
8734
|
var getShortId = function getShortId(prefix) { return "".concat(prefix !== null && prefix !== void 0 ? prefix : '').concat(Math.random().toString(36).slice(-6)); };
|
|
8581
8735
|
var useShortId = function useShortId(prefix) { return F$3(function () { return getShortId(prefix); }, [prefix]); };
|
|
8582
8736
|
var DEFAULT_GAP = 1;
|
|
8583
8737
|
var DEFAULT_GRID_COLUMN_WIDTH = 360;
|
|
8584
8738
|
var DEFAULT_MAX_ITEM_WIDTH = 720 + DEFAULT_GAP;
|
|
8585
|
-
var FlexBox = function FlexBox(
|
|
8739
|
+
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); };
|
|
8586
8740
|
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 }; };
|
|
8587
8741
|
var promiseNoop = function promiseNoop() { return Promise.resolve(); };
|
|
8588
8742
|
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)
|
|
@@ -8605,8 +8759,8 @@ var useModalState = function useModalState() { var confirmAction = arguments.len
|
|
|
8605
8759
|
} }, _callee, null, [[0, 5]]); })); }; return { isOpen: isOpen, open: open, close: close, confirm: confirm }; };
|
|
8606
8760
|
var useAsyncState = h$4;
|
|
8607
8761
|
var MODAL_WIDTH = 800;
|
|
8608
|
-
var useStyles$
|
|
8609
|
-
var Modal = function Modal(
|
|
8762
|
+
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) } }; });
|
|
8763
|
+
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)
|
|
8610
8764
|
switch (_context2.prev = _context2.next) {
|
|
8611
8765
|
case 0:
|
|
8612
8766
|
e.preventDefault();
|
|
@@ -8625,7 +8779,7 @@ var Modal = function Modal(_ref14) { var cancelButtonText = _ref14.cancelButtonT
|
|
|
8625
8779
|
case 10:
|
|
8626
8780
|
case "end": return _context2.stop();
|
|
8627
8781
|
} }, _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')))); };
|
|
8628
|
-
var useMutateWithToast = function useMutateWithToast(callback) { var _useToast2 = useToast(), openToast = _useToast2.openToast; var mutate = T$2(function (properties) { var
|
|
8782
|
+
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)
|
|
8629
8783
|
switch (_context3.prev = _context3.next) {
|
|
8630
8784
|
case 0:
|
|
8631
8785
|
_context3.prev = 0;
|
|
@@ -8643,14 +8797,14 @@ var useMutateWithToast = function useMutateWithToast(callback) { var _useToast2
|
|
|
8643
8797
|
case "end": return _context3.stop();
|
|
8644
8798
|
} }, _callee3, null, [[0, 6]]); })); }, [callback, openToast]); return { mutate: mutate }; };
|
|
8645
8799
|
var ssoGetConnectionsKey = function ssoGetConnectionsKey(orgId) { return ['sso.getConnections', orgId]; };
|
|
8646
|
-
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(); }); };
|
|
8800
|
+
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(); }); };
|
|
8647
8801
|
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) {
|
|
8648
8802
|
return mutate(ssoGetConnectionsKey(orgId));
|
|
8649
8803
|
} }, [client.organization, mutate]); };
|
|
8650
8804
|
var mutateSamlConnection = function mutateSamlConnection(client) { return function (options) { return client.sso.saml.updateConnection(options); }; };
|
|
8651
8805
|
var mutateOidcConnection = function mutateOidcConnection(client) { return function (options) { return client.sso.oidc.updateConnection(options); }; };
|
|
8652
8806
|
var updateConnectionByURL = function updateConnectionByURL(client) { return function (options) { return client.sso.saml.updateConnectionByURL(options); }; };
|
|
8653
|
-
var deleteConnection = function deleteConnection(client) { return function (
|
|
8807
|
+
var deleteConnection = function deleteConnection(client) { return function (_ref17) { var connection_id = _ref17.connection_id; return client.sso.deleteConnection(connection_id); }; };
|
|
8654
8808
|
var deleteVerificationCertificate = function deleteVerificationCertificate(client) { return function (options) { return client.sso.saml.deleteVerificationCertificate(options); }; };
|
|
8655
8809
|
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)
|
|
8656
8810
|
switch (_context4.prev = _context4.next) {
|
|
@@ -8667,8 +8821,8 @@ var useDeleteSsoConnectionCert = function useDeleteSsoConnectionCert() { return
|
|
|
8667
8821
|
var useMutateSsoConnection = function useMutateSsoConnection(connectionType) { return useMutateFnSsoConnection(connectionType === 'saml' ? mutateSamlConnection : mutateOidcConnection); };
|
|
8668
8822
|
var useMutateSamlConnection = function useMutateSamlConnection() { return useMutateSsoConnection('saml'); };
|
|
8669
8823
|
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.")); };
|
|
8670
|
-
var useMutateDeleteConnection = function useMutateDeleteConnection() { var _useDeleteSsoConnecti = useDeleteSsoConnection(), mutate = _useDeleteSsoConnecti.mutate; var deleteConnection = function deleteConnection(
|
|
8671
|
-
var useDeleteConnection = function useDeleteConnection() { var
|
|
8824
|
+
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 }; };
|
|
8825
|
+
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)
|
|
8672
8826
|
switch (_context5.prev = _context5.next) {
|
|
8673
8827
|
case 0:
|
|
8674
8828
|
if (!connection) {
|
|
@@ -8690,24 +8844,24 @@ var useDeleteConnection = function useDeleteConnection() { var _ref18 = argument
|
|
|
8690
8844
|
case "end": return _context5.stop();
|
|
8691
8845
|
} }, _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 } }; };
|
|
8692
8846
|
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' } }; });
|
|
8693
|
-
var TagCore = function TagCore(
|
|
8694
|
-
var useStyles$
|
|
8695
|
-
var Tag = function Tag(props) { var classes = useStyles$
|
|
8847
|
+
var TagCore = function TagCore(_ref20) { var children = _ref20.children, classes = _ref20.classes; return /*#__PURE__*/ wn.createElement("span", { className: classes.tag }, children); };
|
|
8848
|
+
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 } }; });
|
|
8849
|
+
var Tag = function Tag(props) { var classes = useStyles$j(props); return /*#__PURE__*/ wn.createElement(TagCore, Object.assign({}, props, { classes: classes })); };
|
|
8696
8850
|
var organizationGetKey = function organizationGetKey(orgId) { return ['organization.get', orgId]; };
|
|
8697
8851
|
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(); }); };
|
|
8698
8852
|
var deepEqual = createDeepEqual();
|
|
8699
8853
|
var CODE_HORIZONTAL_PADDING = 1;
|
|
8700
8854
|
var commonCodeStyles$1 = { code: { borderRadius: 4, width: 'fit-content' } };
|
|
8701
8855
|
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' } }; });
|
|
8702
|
-
var CodeCore = function CodeCore(
|
|
8856
|
+
var CodeCore = function CodeCore(_ref22) { var children = _ref22.children, classes = _ref22.classes; return /*#__PURE__*/ wn.createElement("span", { className: C(classes.code) }, children); };
|
|
8703
8857
|
var commonCodeStyles = function commonCodeStyles(theme) { return { code: { color: theme.styleConfig.colors.accentText, backgroundColor: theme.styleConfig.colors.accent } }; };
|
|
8704
|
-
var useStyles$
|
|
8705
|
-
var Code = function Code(props) { var classes = useStyles$
|
|
8706
|
-
var useStyles$
|
|
8707
|
-
var LabelCore = function LabelCore(
|
|
8858
|
+
var useStyles$i = makeCodeStyles(commonCodeStyles);
|
|
8859
|
+
var Code = function Code(props) { var classes = useStyles$i(); return /*#__PURE__*/ wn.createElement(CodeCore, Object.assign({}, props, { classes: classes })); };
|
|
8860
|
+
var useStyles$h = makeStyles(function () { return { labelContainer: { display: 'flex', alignItems: 'center' } }; });
|
|
8861
|
+
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" }, "*"))); };
|
|
8708
8862
|
var Label = function Label(props) { return /*#__PURE__*/ wn.createElement(LabelCore, Object.assign({}, props, { TypographyComponent: Typography })); };
|
|
8709
8863
|
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' } } }; });
|
|
8710
|
-
var CopyableTextCore = function CopyableTextCore(
|
|
8864
|
+
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') {
|
|
8711
8865
|
throw new Error('CopyableText children must be a string');
|
|
8712
8866
|
} 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)))); };
|
|
8713
8867
|
var CheckCircleOutlined = {};
|
|
@@ -8729,26 +8883,26 @@ var _createSvgIcon$7 = _interopRequireDefault$7(requireCreateSvgIcon());
|
|
|
8729
8883
|
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');
|
|
8730
8884
|
default_1$7 = FileCopyOutlined["default"] = _default$7;
|
|
8731
8885
|
var makeClickToCopyStyles = makeStylesFactory({ checkCircle: { display: 'block !important' }, darkBackground: {}, containerHover: { '&:hover': { '& svg': { display: 'block' }, cursor: 'pointer' }, '& svg': { display: 'none' } } });
|
|
8732
|
-
var useClickToCopyCore = function useClickToCopyCore(
|
|
8733
|
-
var useStyles$
|
|
8734
|
-
var useClickToCopy = function useClickToCopy(params) { var classes = useStyles$
|
|
8735
|
-
var useStyles$
|
|
8736
|
-
var CopyableText = function CopyableText(props) { var classes = useStyles$
|
|
8886
|
+
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 }; };
|
|
8887
|
+
var useStyles$g = makeClickToCopyStyles();
|
|
8888
|
+
var useClickToCopy = function useClickToCopy(params) { var classes = useStyles$g(); return useClickToCopyCore(Object.assign(Object.assign({}, params), { classes: classes })); };
|
|
8889
|
+
var useStyles$f = makeCopyableTextStyles(commonCodeStyles, { copyableText: { whiteSpace: function whiteSpace(_ref26) { var _whiteSpace = _ref26.whiteSpace; return _whiteSpace; } } });
|
|
8890
|
+
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 })); };
|
|
8737
8891
|
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' } }; });
|
|
8738
8892
|
var FILE_UPLOAD_ID = 'file-upload';
|
|
8739
|
-
var FileUpload = function FileUpload(
|
|
8893
|
+
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') {
|
|
8740
8894
|
onChange === null || onChange === void 0 ? void 0 : onChange(fileReader.result);
|
|
8741
8895
|
} }; 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) {
|
|
8742
8896
|
fileReader.readAsText(file);
|
|
8743
8897
|
} }; var resetFileUpload = function resetFileUpload() { var inputElement = document.querySelector('input[type=file]'); if (inputElement) {
|
|
8744
8898
|
inputElement.value = '';
|
|
8745
8899
|
} }; 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)); };
|
|
8746
|
-
var InputCore = function InputCore(
|
|
8900
|
+
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) {
|
|
8747
8901
|
setFilename(null);
|
|
8748
8902
|
} }; 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))))); };
|
|
8749
|
-
var useStyles$
|
|
8903
|
+
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 } } }; });
|
|
8750
8904
|
var LabelBody1 = function LabelBody1(props) { return /*#__PURE__*/ wn.createElement(Label, Object.assign({ variant: "body1" }, props)); };
|
|
8751
|
-
var Input = function Input(_a) { var labelVariant = _a.labelVariant, props = __rest(_a, ["labelVariant"]); var classes = useStyles$
|
|
8905
|
+
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 })); };
|
|
8752
8906
|
var AddRounded = {};
|
|
8753
8907
|
var _interopRequireDefault$6 = interopRequireDefaultExports;
|
|
8754
8908
|
var _interopRequireWildcard$6 = interopRequireWildcardExports;
|
|
@@ -8758,11 +8912,11 @@ var React$6 = _interopRequireWildcard$6(require$$2);
|
|
|
8758
8912
|
var _createSvgIcon$6 = _interopRequireDefault$6(requireCreateSvgIcon());
|
|
8759
8913
|
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');
|
|
8760
8914
|
default_1$6 = AddRounded["default"] = _default$6;
|
|
8761
|
-
var ContentSpacingCore = function ContentSpacingCore(
|
|
8915
|
+
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); };
|
|
8762
8916
|
var ADD_NEW_BUTTON_TEXT = 'Add new';
|
|
8763
|
-
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) {
|
|
8917
|
+
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) {
|
|
8764
8918
|
throw new Error('Either addModalProps or onAdd prop must be provided');
|
|
8765
|
-
} 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" },
|
|
8919
|
+
} 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))); };
|
|
8766
8920
|
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) {
|
|
8767
8921
|
throw new Error('rowKeyExtractor is required if items are not strings or do not have an id property');
|
|
8768
8922
|
} };
|
|
@@ -8773,13 +8927,13 @@ var getTableCellValue = function getTableCellValue(children) { var value = child
|
|
|
8773
8927
|
} return value; };
|
|
8774
8928
|
var useTableActionStyles = makeStyles(function (theme) { return { tableActions: { display: 'flex', gap: theme.spacing(1), margin: theme.spacing(0, -1.25) } }; });
|
|
8775
8929
|
var TABLE_ACTIONS_HEADER = 'Actions';
|
|
8776
|
-
var TableActionsCore = function TableActionsCore(
|
|
8930
|
+
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); };
|
|
8777
8931
|
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' } }; });
|
|
8778
|
-
var EmbeddedTableCore = function EmbeddedTableCore(
|
|
8932
|
+
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))))))); };
|
|
8779
8933
|
makeStyles(function (theme) { return { tableActions: { display: 'flex', gap: theme.spacing(1), margin: theme.spacing(0, -1.25) } }; });
|
|
8780
8934
|
var TableActions = function TableActions(props) { return /*#__PURE__*/ wn.createElement(TableActionsCore, Object.assign({}, props, { ButtonComponent: Button })); };
|
|
8781
|
-
var useStyles$
|
|
8782
|
-
var EmbeddedTable = function EmbeddedTable(props) { var classes = useStyles$
|
|
8935
|
+
var useStyles$d = makeEmbeddedTableStyles(function (theme) { return { tableHeader: { borderBottomColor: theme.styleConfig.colors.subtle } }; });
|
|
8936
|
+
var EmbeddedTable = function EmbeddedTable(props) { var classes = useStyles$d(); return /*#__PURE__*/ wn.createElement(EmbeddedTableCore, Object.assign({}, props, { TableActionsComponent: TableActions, TypographyComponent: Typography, classes: classes })); };
|
|
8783
8937
|
var ListEditor = function ListEditor(props) { return /*#__PURE__*/ wn.createElement(ListEditorCore, Object.assign({}, props, { ButtonComponent: Button, EmbeddedTableComponent: EmbeddedTable, ModalComponent: Modal, TypographyComponent: Typography })); };
|
|
8784
8938
|
var CheckRounded = {};
|
|
8785
8939
|
var _interopRequireDefault$5 = interopRequireDefaultExports;
|
|
@@ -8819,7 +8973,7 @@ var _default$2 = (0, _createSvgIcon$2["default"])(/*#__PURE__*/ React$2.createEl
|
|
|
8819
8973
|
default_1$2 = RemoveRounded["default"] = _default$2;
|
|
8820
8974
|
var MULTISELECT_VALUE = 'all_values';
|
|
8821
8975
|
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%' } }; });
|
|
8822
|
-
var SelectCore = function SelectCore(
|
|
8976
|
+
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) {
|
|
8823
8977
|
if (value.length > 0) {
|
|
8824
8978
|
MultiSelectIcon = default_1$2;
|
|
8825
8979
|
canSelectAll = false;
|
|
@@ -8845,16 +8999,16 @@ var SelectCore = function SelectCore(_ref31) { var caption = _ref31.caption, dis
|
|
|
8845
8999
|
else if (Array.isArray(val) && val.length === totalOptions && hasMoreThanOneChild) {
|
|
8846
9000
|
return 'All';
|
|
8847
9001
|
} 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))))); };
|
|
8848
|
-
var useStyles$
|
|
8849
|
-
var MenuItemCore = function MenuItemCore(
|
|
9002
|
+
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) } }; });
|
|
9003
|
+
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); };
|
|
8850
9004
|
var MenuItem = function MenuItem(props) { return /*#__PURE__*/ wn.createElement(MenuItemCore, Object.assign({}, props, { TypographyComponent: Typography })); };
|
|
8851
|
-
var useStyles$
|
|
8852
|
-
var Select = function Select(props) { var classes = useStyles$
|
|
8853
|
-
var useStyles$
|
|
9005
|
+
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; } } }; });
|
|
9006
|
+
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 })); };
|
|
9007
|
+
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' } }; });
|
|
8854
9008
|
var DEFAULT_STATE = { editing: false, setEditing: noop };
|
|
8855
9009
|
var SettingsContext = /*#__PURE__*/ F$4(DEFAULT_STATE);
|
|
8856
9010
|
var useSettingsContainer = function useSettingsContainer() { return q$5(SettingsContext); };
|
|
8857
|
-
var SettingsContainer = function SettingsContainer(
|
|
9011
|
+
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)
|
|
8858
9012
|
switch (_context6.prev = _context6.next) {
|
|
8859
9013
|
case 0:
|
|
8860
9014
|
setIsSaving(true);
|
|
@@ -8881,20 +9035,20 @@ var SettingsContainer = function SettingsContainer(_ref33) { var _ref33$canEdit
|
|
|
8881
9035
|
} }, _callee6, null, [[1, 7, 11, 14]]); })); }; var modalState = useModalState(save); if (!modalDescription) {
|
|
8882
9036
|
modalDescription = 'Double check before saving your changes.';
|
|
8883
9037
|
} 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))); };
|
|
8884
|
-
var SettingsList = function SettingsList(
|
|
8885
|
-
var SettingsListItem = function SettingsListItem(
|
|
9038
|
+
var SettingsList = function SettingsList(_ref35) { var children = _ref35.children; return /*#__PURE__*/ wn.createElement("dl", { style: { margin: 0 } }, children); };
|
|
9039
|
+
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)); };
|
|
8886
9040
|
var makeInfoIconStyles = makeStylesFactory(function () { return { infoIconContainer: { width: 'fit-content' } }; });
|
|
8887
|
-
var InfoIconCore = function InfoIconCore(
|
|
9041
|
+
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))); };
|
|
8888
9042
|
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 } }; });
|
|
8889
|
-
var TooltipCore = function TooltipCore(
|
|
9043
|
+
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) {
|
|
8890
9044
|
return children;
|
|
8891
|
-
} return /*#__PURE__*/ wn.createElement(
|
|
8892
|
-
var useStyles$
|
|
8893
|
-
var Tooltip = function Tooltip(props) { var classes = useStyles$
|
|
8894
|
-
var useStyles$
|
|
8895
|
-
var InfoIcon = function InfoIcon(props) { var classes = useStyles$
|
|
8896
|
-
var SettingsSection = function SettingsSection(
|
|
8897
|
-
var useFormState = function useFormState(
|
|
9045
|
+
} 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)); };
|
|
9046
|
+
var useStyles$9 = makeTooltipStyles(function (theme) { return { tooltip: { '& .MuiTooltip-tooltip': { '& p': { color: theme.styleConfig.buttons.primary.textColor }, backgroundColor: theme.styleConfig.buttons.primary.backgroundColor } } }; });
|
|
9047
|
+
var Tooltip = function Tooltip(props) { var classes = useStyles$9(); return /*#__PURE__*/ wn.createElement(TooltipCore, Object.assign({}, props, { TypographyComponent: Typography, classes: classes })); };
|
|
9048
|
+
var useStyles$8 = makeInfoIconStyles(function (theme) { return { infoIconContainer: { color: theme.styleConfig.colors.primary } }; });
|
|
9049
|
+
var InfoIcon = function InfoIcon(props) { var classes = useStyles$8(); return /*#__PURE__*/ wn.createElement(InfoIconCore, Object.assign({}, props, { classes: classes, TooltipComponent: Tooltip })); };
|
|
9050
|
+
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); };
|
|
9051
|
+
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) {
|
|
8898
9052
|
resetLocalState();
|
|
8899
9053
|
} setEditing(newEditing); }, [resetLocalState]); return { localState: localState, setLocalState: setLocalState, editing: editing, handleSetEditing: handleSetEditing }; };
|
|
8900
9054
|
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]); };
|
|
@@ -8909,13 +9063,13 @@ else {
|
|
|
8909
9063
|
return { idp: oidcIdpMap[_idpKey], type: type };
|
|
8910
9064
|
} };
|
|
8911
9065
|
var getIdpAndConnectionInfo = function getIdpAndConnectionInfo(connection) { return Object.assign(Object.assign({}, getIdpInfo(connection.identity_provider, connection.connectionType)), { connection: connection }); };
|
|
8912
|
-
var AppDetails = function AppDetails(
|
|
9066
|
+
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)))); };
|
|
8913
9067
|
var collator = Intl.Collator();
|
|
8914
9068
|
var nameKeys = new Set(['full_name', 'first_name', 'last_name']);
|
|
8915
9069
|
var requiredKeys = new Set([].concat(_toConsumableArray2(nameKeys), ['email']));
|
|
8916
|
-
var attributeMappingItemRenderer = [{ title: 'Key', getValue: function getValue(
|
|
8917
|
-
var attributeMappingKeyExtractor = function attributeMappingKeyExtractor(
|
|
8918
|
-
var AttributeMappingTable = function AttributeMappingTable(
|
|
9070
|
+
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); } }];
|
|
9071
|
+
var attributeMappingKeyExtractor = function attributeMappingKeyExtractor(_ref44) { var key = _ref44.key; return key; };
|
|
9072
|
+
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') {
|
|
8919
9073
|
if (editedAttributeMappingKey === 'full_name') {
|
|
8920
9074
|
delete mergedMapping.first_name;
|
|
8921
9075
|
delete mergedMapping.last_name;
|
|
@@ -8942,11 +9096,11 @@ else {
|
|
|
8942
9096
|
else {
|
|
8943
9097
|
setPendingDeleteAttributeMappingKey(key);
|
|
8944
9098
|
deleteAttributeMappingModalProps.open();
|
|
8945
|
-
} }, [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 (
|
|
9099
|
+
} }, [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 })); };
|
|
8946
9100
|
var makeSamlOption = function makeSamlOption(idpName) { return { idp: samlIdpMap[idpName], idpName: idpName, type: 'saml' }; };
|
|
8947
9101
|
var makeOidcOption = function makeOidcOption(idpName) { return { idp: oidcIdpMap[idpName], idpName: idpName, type: 'oidc' }; };
|
|
8948
9102
|
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') };
|
|
8949
|
-
var idpSelectItems = Object.entries(idpOptions).map(function (
|
|
9103
|
+
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 }; });
|
|
8950
9104
|
var samlIdpSelectItems = Object.values(idpOptions).filter(function (item) { return item.type === 'saml'; }).map(function (item) { return { label: item.idp.displayName, value: item.idpName }; });
|
|
8951
9105
|
var oidcIdpSelectItems = Object.values(idpOptions).filter(function (item) { return item.type === 'oidc'; }).map(function (item) { return { label: item.idp.displayName, value: item.idpName }; });
|
|
8952
9106
|
var useBeforeUnloadNavigationBlock = function useBeforeUnloadNavigationBlock(shouldWarn) { p$3(function () { if (shouldWarn) {
|
|
@@ -8981,18 +9135,18 @@ var routerReducer = function routerReducer(state, action) { switch (action.type)
|
|
|
8981
9135
|
case 'cancelNavigation': return Object.assign(Object.assign({}, state), { pendingRoute: undefined });
|
|
8982
9136
|
default: return state;
|
|
8983
9137
|
} };
|
|
8984
|
-
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(
|
|
9138
|
+
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) {
|
|
8985
9139
|
dispatch({ type: 'addBlocker', payload: { callback: callback } });
|
|
8986
9140
|
return function () { dispatch({ type: 'removeBlocker', payload: { callback: callback } }); };
|
|
8987
9141
|
} }, [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 }; };
|
|
8988
9142
|
var _createRouter = createRouter(), SsoRouterProvider = _createRouter.RouterProvider, SsoRouter = _createRouter.Router, useSsoRouterController = _createRouter.useRouterController;
|
|
8989
9143
|
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'); } }];
|
|
8990
9144
|
var certKeyExtractor = function certKeyExtractor(item) { return 'certificate_id' in item ? item.certificate_id : 'new-certificate-id-pending'; };
|
|
8991
|
-
var CertificateTable = function CertificateTable(
|
|
9145
|
+
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) {
|
|
8992
9146
|
return undefined;
|
|
8993
9147
|
} var remoteCertificates = remoteState; if (!editing) {
|
|
8994
9148
|
return remoteCertificates;
|
|
8995
|
-
} 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) {
|
|
9149
|
+
} 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) {
|
|
8996
9150
|
setPendingCert(item.certificate);
|
|
8997
9151
|
addCertModalProps.open();
|
|
8998
9152
|
}
|
|
@@ -9005,8 +9159,8 @@ var CertificateTable = function CertificateTable(_ref48) { var editing = _ref48.
|
|
|
9005
9159
|
else if ('certificate_id' in item) {
|
|
9006
9160
|
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]) }); });
|
|
9007
9161
|
} } } : undefined }; }, hideAddButton: !canAddCertificate })); };
|
|
9008
|
-
var DetailsSectionBody = function DetailsSectionBody(
|
|
9009
|
-
var DetailsSection = function DetailsSection(
|
|
9162
|
+
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 })))); };
|
|
9163
|
+
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)
|
|
9010
9164
|
switch (_context8.prev = _context8.next) {
|
|
9011
9165
|
case 0:
|
|
9012
9166
|
baseOptions = { connection_id: connection.connection_id };
|
|
@@ -9171,8 +9325,8 @@ var useMutateOrganization = function useMutateOrganization() { var _useSWRConfig
|
|
|
9171
9325
|
case "end": return _context10.stop();
|
|
9172
9326
|
} }, _callee9); })); }, [client.organization, mutateSWR])); };
|
|
9173
9327
|
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."))); };
|
|
9174
|
-
var useMutateDefaultConnection = function useMutateDefaultConnection() { var _useMutateOrganizatio = useMutateOrganization(), mutate = _useMutateOrganizatio.mutate; var setDefault = function setDefault(
|
|
9175
|
-
var useSetDefaultConnection = function useSetDefaultConnection(
|
|
9328
|
+
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 }; };
|
|
9329
|
+
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)
|
|
9176
9330
|
switch (_context11.prev = _context11.next) {
|
|
9177
9331
|
case 0:
|
|
9178
9332
|
if (!connection) {
|
|
@@ -9185,8 +9339,8 @@ var useSetDefaultConnection = function useSetDefaultConnection(_ref61) { var def
|
|
|
9185
9339
|
case 4:
|
|
9186
9340
|
case "end": return _context11.stop();
|
|
9187
9341
|
} }, _callee10); })); }; return { handleRequestSetDefault: handleRequestSetDefault, modalProps: { connectionName: connection === null || connection === void 0 ? void 0 : connection.displayName, defaultConnectionName: cachedDefaultConnectionName, isOpen: isOpen, close: close, confirm: confirm } }; };
|
|
9188
|
-
var OrganizationUpdatesSectionBody = function OrganizationUpdatesSectionBody(
|
|
9189
|
-
var OrganizationUpdatesSection = function OrganizationUpdatesSection(
|
|
9342
|
+
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')))); };
|
|
9343
|
+
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)
|
|
9190
9344
|
switch (_context12.prev = _context12.next) {
|
|
9191
9345
|
case 0:
|
|
9192
9346
|
if (organization) {
|
|
@@ -9217,39 +9371,454 @@ var OrganizationUpdatesSection = function OrganizationUpdatesSection(_ref64) { v
|
|
|
9217
9371
|
case 7:
|
|
9218
9372
|
case "end": return _context12.stop();
|
|
9219
9373
|
} }, _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 })); };
|
|
9220
|
-
|
|
9374
|
+
function _typeof(o) {
|
|
9375
|
+
"@babel/helpers - typeof";
|
|
9376
|
+
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);
|
|
9377
|
+
}
|
|
9378
|
+
function toPrimitive(t, r) { if ("object" != _typeof(t) || !t)
|
|
9379
|
+
return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) {
|
|
9380
|
+
var i = e.call(t, r || "default");
|
|
9381
|
+
if ("object" != _typeof(i))
|
|
9382
|
+
return i;
|
|
9383
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
9384
|
+
} return ("string" === r ? String : Number)(t); }
|
|
9385
|
+
function toPropertyKey(t) { var i = toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9386
|
+
function _defineProperty(obj, key, value) { key = toPropertyKey(key); if (key in obj) {
|
|
9387
|
+
Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
|
|
9388
|
+
}
|
|
9389
|
+
else {
|
|
9390
|
+
obj[key] = value;
|
|
9391
|
+
} return obj; }
|
|
9392
|
+
var ArrowDropDownIcon = createSvgIcon$1(/*#__PURE__*/ y$3("path", { d: "M7 10l5 5 5-5z" }));
|
|
9393
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr))
|
|
9394
|
+
return arr; }
|
|
9395
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) {
|
|
9396
|
+
var e, n, i, u, a = [], f = !0, o = !1;
|
|
9397
|
+
try {
|
|
9398
|
+
if (i = (t = t.call(r)).next, 0 === l)
|
|
9399
|
+
;
|
|
9400
|
+
else
|
|
9401
|
+
for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0)
|
|
9402
|
+
;
|
|
9403
|
+
}
|
|
9404
|
+
catch (r) {
|
|
9405
|
+
o = !0, n = r;
|
|
9406
|
+
}
|
|
9407
|
+
finally {
|
|
9408
|
+
try {
|
|
9409
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u))
|
|
9410
|
+
return;
|
|
9411
|
+
}
|
|
9412
|
+
finally {
|
|
9413
|
+
if (o)
|
|
9414
|
+
throw n;
|
|
9415
|
+
}
|
|
9416
|
+
}
|
|
9417
|
+
return a;
|
|
9418
|
+
} }
|
|
9419
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length)
|
|
9420
|
+
len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
9421
|
+
arr2[i] = arr[i]; return arr2; }
|
|
9422
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o)
|
|
9423
|
+
return; if (typeof o === "string")
|
|
9424
|
+
return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor)
|
|
9425
|
+
n = o.constructor.name; if (n === "Map" || n === "Set")
|
|
9426
|
+
return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
9427
|
+
return _arrayLikeToArray(o, minLen); }
|
|
9428
|
+
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."); }
|
|
9429
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9430
|
+
function stripDiacritics(string) { return typeof string.normalize !== 'undefined' ? string.normalize('NFD').replace(/[\u0300-\u036f]/g, '') : string; }
|
|
9431
|
+
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) {
|
|
9432
|
+
input = input.toLowerCase();
|
|
9433
|
+
} if (ignoreAccents) {
|
|
9434
|
+
input = stripDiacritics(input);
|
|
9435
|
+
} var filteredOptions = options.filter(function (option) { var candidate = (stringify || getOptionLabel)(option); if (ignoreCase) {
|
|
9436
|
+
candidate = candidate.toLowerCase();
|
|
9437
|
+
} if (ignoreAccents) {
|
|
9438
|
+
candidate = stripDiacritics(candidate);
|
|
9439
|
+
} return matchFrom === 'start' ? candidate.indexOf(input) === 0 : candidate.indexOf(input) > -1; }); return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions; }; }
|
|
9440
|
+
function findIndex(array, comp) { for (var i = 0; i < array.length; i += 1) {
|
|
9441
|
+
if (comp(array[i])) {
|
|
9442
|
+
return i;
|
|
9443
|
+
}
|
|
9444
|
+
} return -1; }
|
|
9445
|
+
var defaultFilterOptions = createFilterOptions();
|
|
9446
|
+
var pageSize = 5;
|
|
9447
|
+
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) {
|
|
9448
|
+
newInputValue = '';
|
|
9449
|
+
}
|
|
9450
|
+
else if (newValue == null) {
|
|
9451
|
+
newInputValue = '';
|
|
9452
|
+
}
|
|
9453
|
+
else {
|
|
9454
|
+
var optionLabel = getOptionLabel(newValue);
|
|
9455
|
+
newInputValue = typeof optionLabel === 'string' ? optionLabel : '';
|
|
9456
|
+
} if (inputValue === newInputValue) {
|
|
9457
|
+
return;
|
|
9458
|
+
} setInputValue(newInputValue); if (onInputChange) {
|
|
9459
|
+
onInputChange(event, newInputValue, 'reset');
|
|
9460
|
+
} }); 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); })) {
|
|
9461
|
+
return false;
|
|
9462
|
+
} return true; }), { inputValue: inputValueIsSelectedValue ? '' : inputValue, getOptionLabel: getOptionLabel }) : []; var focusTag = useEventCallback(function (tagToFocus) { if (tagToFocus === -1) {
|
|
9463
|
+
inputRef.current.focus();
|
|
9464
|
+
}
|
|
9465
|
+
else {
|
|
9466
|
+
anchorEl.querySelector("[data-tag-index=\"".concat(tagToFocus, "\"]")).focus();
|
|
9467
|
+
} }); p$3(function () { if (multiple && focusedTag > value.length - 1) {
|
|
9468
|
+
setFocusedTag(-1);
|
|
9469
|
+
focusTag(-1);
|
|
9470
|
+
} }, [value, multiple, focusedTag, focusTag]); function validOptionIndex(index, direction) { if (!listboxRef.current || index === -1) {
|
|
9471
|
+
return -1;
|
|
9472
|
+
} var nextFocus = index; while (true) {
|
|
9473
|
+
if (direction === 'next' && nextFocus === filteredOptions.length || direction === 'previous' && nextFocus === -1) {
|
|
9474
|
+
return -1;
|
|
9475
|
+
}
|
|
9476
|
+
var option = listboxRef.current.querySelector("[data-option-index=\"".concat(nextFocus, "\"]"));
|
|
9477
|
+
var nextFocusDisabled = disabledItemsFocusable ? false : option && (option.disabled || option.getAttribute('aria-disabled') === 'true');
|
|
9478
|
+
if (option && !option.hasAttribute('tabindex') || nextFocusDisabled) {
|
|
9479
|
+
nextFocus += direction === 'next' ? 1 : -1;
|
|
9480
|
+
}
|
|
9481
|
+
else {
|
|
9482
|
+
return nextFocus;
|
|
9483
|
+
}
|
|
9484
|
+
} } 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) {
|
|
9485
|
+
inputRef.current.removeAttribute('aria-activedescendant');
|
|
9486
|
+
}
|
|
9487
|
+
else {
|
|
9488
|
+
inputRef.current.setAttribute('aria-activedescendant', "".concat(id, "-option-").concat(index));
|
|
9489
|
+
} if (onHighlightChange) {
|
|
9490
|
+
onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
|
|
9491
|
+
} if (!listboxRef.current) {
|
|
9492
|
+
return;
|
|
9493
|
+
} var prev = listboxRef.current.querySelector('[data-focus]'); if (prev) {
|
|
9494
|
+
prev.removeAttribute('data-focus');
|
|
9495
|
+
} var listboxNode = listboxRef.current.parentElement.querySelector('[role="listbox"]'); if (!listboxNode) {
|
|
9496
|
+
return;
|
|
9497
|
+
} if (index === -1) {
|
|
9498
|
+
listboxNode.scrollTop = 0;
|
|
9499
|
+
return;
|
|
9500
|
+
} var option = listboxRef.current.querySelector("[data-option-index=\"".concat(index, "\"]")); if (!option) {
|
|
9501
|
+
return;
|
|
9502
|
+
} option.setAttribute('data-focus', 'true'); if (listboxNode.scrollHeight > listboxNode.clientHeight && reason !== 'mouse') {
|
|
9503
|
+
var element = option;
|
|
9504
|
+
var scrollBottom = listboxNode.clientHeight + listboxNode.scrollTop;
|
|
9505
|
+
var elementBottom = element.offsetTop + element.offsetHeight;
|
|
9506
|
+
if (elementBottom > scrollBottom) {
|
|
9507
|
+
listboxNode.scrollTop = elementBottom - listboxNode.clientHeight;
|
|
9508
|
+
}
|
|
9509
|
+
else if (element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0) < listboxNode.scrollTop) {
|
|
9510
|
+
listboxNode.scrollTop = element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0);
|
|
9511
|
+
}
|
|
9512
|
+
} }); 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) {
|
|
9513
|
+
return;
|
|
9514
|
+
} var getNextIndex = function getNextIndex() { var maxIndex = filteredOptions.length - 1; if (diff === 'reset') {
|
|
9515
|
+
return defaultHighlighted;
|
|
9516
|
+
} if (diff === 'start') {
|
|
9517
|
+
return 0;
|
|
9518
|
+
} if (diff === 'end') {
|
|
9519
|
+
return maxIndex;
|
|
9520
|
+
} var newIndex = highlightedIndexRef.current + diff; if (newIndex < 0) {
|
|
9521
|
+
if (newIndex === -1 && includeInputInList) {
|
|
9522
|
+
return -1;
|
|
9523
|
+
}
|
|
9524
|
+
if (disableListWrap && highlightedIndexRef.current !== -1 || Math.abs(diff) > 1) {
|
|
9525
|
+
return 0;
|
|
9526
|
+
}
|
|
9527
|
+
return maxIndex;
|
|
9528
|
+
} if (newIndex > maxIndex) {
|
|
9529
|
+
if (newIndex === maxIndex + 1 && includeInputInList) {
|
|
9530
|
+
return -1;
|
|
9531
|
+
}
|
|
9532
|
+
if (disableListWrap || Math.abs(diff) > 1) {
|
|
9533
|
+
return maxIndex;
|
|
9534
|
+
}
|
|
9535
|
+
return 0;
|
|
9536
|
+
} return newIndex; }; var nextIndex = validOptionIndex(getNextIndex(), direction); setHighlightedIndex({ index: nextIndex, reason: reason, event: event }); if (autoComplete && diff !== 'reset') {
|
|
9537
|
+
if (nextIndex === -1) {
|
|
9538
|
+
inputRef.current.value = inputValue;
|
|
9539
|
+
}
|
|
9540
|
+
else {
|
|
9541
|
+
var option = getOptionLabel(filteredOptions[nextIndex]);
|
|
9542
|
+
inputRef.current.value = option;
|
|
9543
|
+
var index = option.toLowerCase().indexOf(inputValue.toLowerCase());
|
|
9544
|
+
if (index === 0 && inputValue.length > 0) {
|
|
9545
|
+
inputRef.current.setSelectionRange(inputValue.length, option.length);
|
|
9546
|
+
}
|
|
9547
|
+
}
|
|
9548
|
+
} }); var syncHighlightedIndex = T$2(function () { if (!popupOpen) {
|
|
9549
|
+
return;
|
|
9550
|
+
} var valueItem = multiple ? value[0] : value; if (filteredOptions.length === 0 || valueItem == null) {
|
|
9551
|
+
changeHighlightedIndex({ diff: 'reset' });
|
|
9552
|
+
return;
|
|
9553
|
+
} if (!listboxRef.current) {
|
|
9554
|
+
return;
|
|
9555
|
+
} if (!filterSelectedOptions && valueItem != null) {
|
|
9556
|
+
var currentOption = filteredOptions[highlightedIndexRef.current];
|
|
9557
|
+
if (multiple && currentOption && findIndex(value, function (val) { return getOptionSelected(currentOption, val); }) !== -1) {
|
|
9558
|
+
return;
|
|
9559
|
+
}
|
|
9560
|
+
var itemIndex = findIndex(filteredOptions, function (optionItem) { return getOptionSelected(optionItem, valueItem); });
|
|
9561
|
+
if (itemIndex === -1) {
|
|
9562
|
+
changeHighlightedIndex({ diff: 'reset' });
|
|
9563
|
+
}
|
|
9564
|
+
else {
|
|
9565
|
+
setHighlightedIndex({ index: itemIndex });
|
|
9566
|
+
}
|
|
9567
|
+
return;
|
|
9568
|
+
} if (highlightedIndexRef.current >= filteredOptions.length - 1) {
|
|
9569
|
+
setHighlightedIndex({ index: filteredOptions.length - 1 });
|
|
9570
|
+
return;
|
|
9571
|
+
} 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) {
|
|
9572
|
+
return;
|
|
9573
|
+
} syncHighlightedIndex(); }); p$3(function () { syncHighlightedIndex(); }, [syncHighlightedIndex]); var handleOpen = function handleOpen(event) { if (open) {
|
|
9574
|
+
return;
|
|
9575
|
+
} setOpenState(true); if (onOpen) {
|
|
9576
|
+
onOpen(event);
|
|
9577
|
+
} }; var handleClose = function handleClose(event, reason) { if (!open) {
|
|
9578
|
+
return;
|
|
9579
|
+
} setOpenState(false); if (onClose) {
|
|
9580
|
+
onClose(event, reason);
|
|
9581
|
+
} }; var handleValue = function handleValue(event, newValue, reason, details) { if (value === newValue) {
|
|
9582
|
+
return;
|
|
9583
|
+
} if (onChange) {
|
|
9584
|
+
onChange(event, newValue, reason, details);
|
|
9585
|
+
} 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) {
|
|
9586
|
+
newValue = Array.isArray(value) ? value.slice() : [];
|
|
9587
|
+
var itemIndex = findIndex(newValue, function (valueItem) { return getOptionSelected(option, valueItem); });
|
|
9588
|
+
if (itemIndex === -1) {
|
|
9589
|
+
newValue.push(option);
|
|
9590
|
+
}
|
|
9591
|
+
else if (origin !== 'freeSolo') {
|
|
9592
|
+
newValue.splice(itemIndex, 1);
|
|
9593
|
+
reason = 'remove-option';
|
|
9594
|
+
}
|
|
9595
|
+
} resetInputValue(event, newValue); handleValue(event, newValue, reason, { option: option }); if (!disableCloseOnSelect) {
|
|
9596
|
+
handleClose(event, reason);
|
|
9597
|
+
} if (blurOnSelect === true || blurOnSelect === 'touch' && isTouch.current || blurOnSelect === 'mouse' && !isTouch.current) {
|
|
9598
|
+
inputRef.current.blur();
|
|
9599
|
+
} }; function validTagIndex(index, direction) { if (index === -1) {
|
|
9600
|
+
return -1;
|
|
9601
|
+
} var nextFocus = index; while (true) {
|
|
9602
|
+
if (direction === 'next' && nextFocus === value.length || direction === 'previous' && nextFocus === -1) {
|
|
9603
|
+
return -1;
|
|
9604
|
+
}
|
|
9605
|
+
var option = anchorEl.querySelector("[data-tag-index=\"".concat(nextFocus, "\"]"));
|
|
9606
|
+
if (option && (!option.hasAttribute('tabindex') || option.disabled || option.getAttribute('aria-disabled') === 'true')) {
|
|
9607
|
+
nextFocus += direction === 'next' ? 1 : -1;
|
|
9608
|
+
}
|
|
9609
|
+
else {
|
|
9610
|
+
return nextFocus;
|
|
9611
|
+
}
|
|
9612
|
+
} } var handleFocusTag = function handleFocusTag(event, direction) { if (!multiple) {
|
|
9613
|
+
return;
|
|
9614
|
+
} handleClose(event, 'toggleInput'); var nextTag = focusedTag; if (focusedTag === -1) {
|
|
9615
|
+
if (inputValue === '' && direction === 'previous') {
|
|
9616
|
+
nextTag = value.length - 1;
|
|
9617
|
+
}
|
|
9618
|
+
}
|
|
9619
|
+
else {
|
|
9620
|
+
nextTag += direction === 'next' ? 1 : -1;
|
|
9621
|
+
if (nextTag < 0) {
|
|
9622
|
+
nextTag = 0;
|
|
9623
|
+
}
|
|
9624
|
+
if (nextTag === value.length) {
|
|
9625
|
+
nextTag = -1;
|
|
9626
|
+
}
|
|
9627
|
+
} nextTag = validTagIndex(nextTag, direction); setFocusedTag(nextTag); focusTag(nextTag); }; var handleClear = function handleClear(event) { ignoreFocus.current = true; setInputValue(''); if (onInputChange) {
|
|
9628
|
+
onInputChange(event, '', 'clear');
|
|
9629
|
+
} handleValue(event, multiple ? [] : null, 'clear'); }; var handleKeyDown = function handleKeyDown(other) { return function (event) { if (focusedTag !== -1 && ['ArrowLeft', 'ArrowRight'].indexOf(event.key) === -1) {
|
|
9630
|
+
setFocusedTag(-1);
|
|
9631
|
+
focusTag(-1);
|
|
9632
|
+
} switch (event.key) {
|
|
9633
|
+
case 'Home':
|
|
9634
|
+
if (popupOpen && handleHomeEndKeys) {
|
|
9635
|
+
event.preventDefault();
|
|
9636
|
+
changeHighlightedIndex({ diff: 'start', direction: 'next', reason: 'keyboard', event: event });
|
|
9637
|
+
}
|
|
9638
|
+
break;
|
|
9639
|
+
case 'End':
|
|
9640
|
+
if (popupOpen && handleHomeEndKeys) {
|
|
9641
|
+
event.preventDefault();
|
|
9642
|
+
changeHighlightedIndex({ diff: 'end', direction: 'previous', reason: 'keyboard', event: event });
|
|
9643
|
+
}
|
|
9644
|
+
break;
|
|
9645
|
+
case 'PageUp':
|
|
9646
|
+
event.preventDefault();
|
|
9647
|
+
changeHighlightedIndex({ diff: -pageSize, direction: 'previous', reason: 'keyboard', event: event });
|
|
9648
|
+
handleOpen(event);
|
|
9649
|
+
break;
|
|
9650
|
+
case 'PageDown':
|
|
9651
|
+
event.preventDefault();
|
|
9652
|
+
changeHighlightedIndex({ diff: pageSize, direction: 'next', reason: 'keyboard', event: event });
|
|
9653
|
+
handleOpen(event);
|
|
9654
|
+
break;
|
|
9655
|
+
case 'ArrowDown':
|
|
9656
|
+
event.preventDefault();
|
|
9657
|
+
changeHighlightedIndex({ diff: 1, direction: 'next', reason: 'keyboard', event: event });
|
|
9658
|
+
handleOpen(event);
|
|
9659
|
+
break;
|
|
9660
|
+
case 'ArrowUp':
|
|
9661
|
+
event.preventDefault();
|
|
9662
|
+
changeHighlightedIndex({ diff: -1, direction: 'previous', reason: 'keyboard', event: event });
|
|
9663
|
+
handleOpen(event);
|
|
9664
|
+
break;
|
|
9665
|
+
case 'ArrowLeft':
|
|
9666
|
+
handleFocusTag(event, 'previous');
|
|
9667
|
+
break;
|
|
9668
|
+
case 'ArrowRight':
|
|
9669
|
+
handleFocusTag(event, 'next');
|
|
9670
|
+
break;
|
|
9671
|
+
case 'Enter':
|
|
9672
|
+
if (event.which === 229) {
|
|
9673
|
+
break;
|
|
9674
|
+
}
|
|
9675
|
+
if (highlightedIndexRef.current !== -1 && popupOpen) {
|
|
9676
|
+
var option = filteredOptions[highlightedIndexRef.current];
|
|
9677
|
+
var disabled = getOptionDisabled ? getOptionDisabled(option) : false;
|
|
9678
|
+
event.preventDefault();
|
|
9679
|
+
if (disabled) {
|
|
9680
|
+
return;
|
|
9681
|
+
}
|
|
9682
|
+
selectNewValue(event, option, 'select-option');
|
|
9683
|
+
if (autoComplete) {
|
|
9684
|
+
inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);
|
|
9685
|
+
}
|
|
9686
|
+
}
|
|
9687
|
+
else if (freeSolo && inputValue !== '' && inputValueIsSelectedValue === false) {
|
|
9688
|
+
if (multiple) {
|
|
9689
|
+
event.preventDefault();
|
|
9690
|
+
}
|
|
9691
|
+
selectNewValue(event, inputValue, 'create-option', 'freeSolo');
|
|
9692
|
+
}
|
|
9693
|
+
break;
|
|
9694
|
+
case 'Escape':
|
|
9695
|
+
if (popupOpen) {
|
|
9696
|
+
event.preventDefault();
|
|
9697
|
+
event.stopPropagation();
|
|
9698
|
+
handleClose(event, 'escape');
|
|
9699
|
+
}
|
|
9700
|
+
else if (clearOnEscape && (inputValue !== '' || multiple && value.length > 0)) {
|
|
9701
|
+
event.preventDefault();
|
|
9702
|
+
event.stopPropagation();
|
|
9703
|
+
handleClear(event);
|
|
9704
|
+
}
|
|
9705
|
+
break;
|
|
9706
|
+
case 'Backspace':
|
|
9707
|
+
if (multiple && inputValue === '' && value.length > 0) {
|
|
9708
|
+
var index = focusedTag === -1 ? value.length - 1 : focusedTag;
|
|
9709
|
+
var newValue = value.slice();
|
|
9710
|
+
newValue.splice(index, 1);
|
|
9711
|
+
handleValue(event, newValue, 'remove-option', { option: value[index] });
|
|
9712
|
+
}
|
|
9713
|
+
break;
|
|
9714
|
+
} if (other.onKeyDown) {
|
|
9715
|
+
other.onKeyDown(event);
|
|
9716
|
+
} }; }; var handleFocus = function handleFocus(event) { setFocused(true); if (openOnFocus && !ignoreFocus.current) {
|
|
9717
|
+
handleOpen(event);
|
|
9718
|
+
} }; var handleBlur = function handleBlur(event) { if (listboxRef.current !== null && document.activeElement === listboxRef.current.parentElement) {
|
|
9719
|
+
inputRef.current.focus();
|
|
9720
|
+
return;
|
|
9721
|
+
} setFocused(false); firstFocus.current = true; ignoreFocus.current = false; if (debug && inputValue !== '') {
|
|
9722
|
+
return;
|
|
9723
|
+
} if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen) {
|
|
9724
|
+
selectNewValue(event, filteredOptions[highlightedIndexRef.current], 'blur');
|
|
9725
|
+
}
|
|
9726
|
+
else if (autoSelect && freeSolo && inputValue !== '') {
|
|
9727
|
+
selectNewValue(event, inputValue, 'blur', 'freeSolo');
|
|
9728
|
+
}
|
|
9729
|
+
else if (clearOnBlur) {
|
|
9730
|
+
resetInputValue(event, value);
|
|
9731
|
+
} handleClose(event, 'blur'); }; var handleInputChange = function handleInputChange(event) { var newValue = event.target.value; if (inputValue !== newValue) {
|
|
9732
|
+
setInputValue(newValue);
|
|
9733
|
+
if (onInputChange) {
|
|
9734
|
+
onInputChange(event, newValue, 'input');
|
|
9735
|
+
}
|
|
9736
|
+
} if (newValue === '') {
|
|
9737
|
+
if (!disableClearable && !multiple) {
|
|
9738
|
+
handleValue(event, null, 'clear');
|
|
9739
|
+
}
|
|
9740
|
+
}
|
|
9741
|
+
else {
|
|
9742
|
+
handleOpen(event);
|
|
9743
|
+
} }; 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) {
|
|
9744
|
+
handleClose(event, 'toggleInput');
|
|
9745
|
+
}
|
|
9746
|
+
else {
|
|
9747
|
+
handleOpen(event);
|
|
9748
|
+
} }; var handleMouseDown = function handleMouseDown(event) { if (event.target.getAttribute('id') !== id) {
|
|
9749
|
+
event.preventDefault();
|
|
9750
|
+
} }; var handleClick = function handleClick() { inputRef.current.focus(); if (selectOnFocus && firstFocus.current && inputRef.current.selectionEnd - inputRef.current.selectionStart === 0) {
|
|
9751
|
+
inputRef.current.select();
|
|
9752
|
+
} firstFocus.current = false; }; var handleInputMouseDown = function handleInputMouseDown(event) { if (inputValue === '' || !open) {
|
|
9753
|
+
handlePopupIndicator(event);
|
|
9754
|
+
} }; var dirty = freeSolo && inputValue.length > 0; dirty = dirty || (multiple ? value.length > 0 : value !== null); var groupedOptions = filteredOptions; if (groupBy) {
|
|
9755
|
+
groupedOptions = filteredOptions.reduce(function (acc, option, index) { var group = groupBy(option); if (acc.length > 0 && acc[acc.length - 1].group === group) {
|
|
9756
|
+
acc[acc.length - 1].options.push(option);
|
|
9757
|
+
}
|
|
9758
|
+
else {
|
|
9759
|
+
acc.push({ key: index, index: index, group: group, options: [option] });
|
|
9760
|
+
} return acc; }, []);
|
|
9761
|
+
} 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 }; }
|
|
9762
|
+
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 } } }; };
|
|
9763
|
+
function DisablePortal(props) { props.anchorEl; props.open; var other = _objectWithoutProperties(props, ["anchorEl", "open"]); return /*#__PURE__*/ y$3("div", other); }
|
|
9764
|
+
var _ref = /*#__PURE__*/ y$3(CloseIcon, { fontSize: "small" });
|
|
9765
|
+
var _ref2 = /*#__PURE__*/ y$3(ArrowDropDownIcon, null);
|
|
9766
|
+
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) {
|
|
9767
|
+
var getCustomizedTagProps = function getCustomizedTagProps(params) { return _extends({ className: clsx(classes.tag, size === 'small' && classes.tagSizeSmall), disabled: disabled }, getTagProps(params)); };
|
|
9768
|
+
if (renderTags) {
|
|
9769
|
+
startAdornment = renderTags(value, getCustomizedTagProps);
|
|
9770
|
+
}
|
|
9771
|
+
else {
|
|
9772
|
+
startAdornment = value.map(function (option, index) { return /*#__PURE__*/ y$3(Chip$1, _extends({ label: getOptionLabel(option), size: size }, getCustomizedTagProps({ index: index }), ChipProps)); });
|
|
9773
|
+
}
|
|
9774
|
+
} if (limitTags > -1 && Array.isArray(startAdornment)) {
|
|
9775
|
+
var more = startAdornment.length - limitTags;
|
|
9776
|
+
if (!focused && more > 0) {
|
|
9777
|
+
startAdornment = startAdornment.splice(0, limitTags);
|
|
9778
|
+
startAdornment.push(/*#__PURE__*/ y$3("span", { className: classes.tag, key: startAdornment.length }, getLimitTagsText(more)));
|
|
9779
|
+
}
|
|
9780
|
+
} 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) {
|
|
9781
|
+
return renderGroup({ key: option.key, group: option.group, children: option.options.map(function (option2, index2) { return renderListOption(option2, option.index + index2); }) });
|
|
9782
|
+
} return renderListOption(option, index); })) : null)) : null); });
|
|
9783
|
+
var MuiAutocomplete = withStyles(styles, { name: 'MuiAutocomplete' })(Autocomplete$1);
|
|
9784
|
+
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" }))))); };
|
|
9785
|
+
var Input = function Input(props) { return /*#__PURE__*/ wn.createElement(TextField$1, Object.assign({}, props, { variant: "outlined" })); };
|
|
9786
|
+
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 } } }; });
|
|
9787
|
+
var defaultGetOptionLabel = function defaultGetOptionLabel(item) { return item; };
|
|
9788
|
+
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)); };
|
|
9789
|
+
var ArrowRight = {};
|
|
9221
9790
|
var _interopRequireDefault$1 = interopRequireDefaultExports;
|
|
9222
9791
|
var _interopRequireWildcard$1 = interopRequireWildcardExports;
|
|
9223
|
-
Object.defineProperty(
|
|
9224
|
-
var default_1$1 =
|
|
9792
|
+
Object.defineProperty(ArrowRight, "__esModule", { value: true });
|
|
9793
|
+
var default_1$1 = ArrowRight["default"] = void 0;
|
|
9225
9794
|
var React$1 = _interopRequireWildcard$1(require$$2);
|
|
9226
9795
|
var _createSvgIcon$1 = _interopRequireDefault$1(requireCreateSvgIcon());
|
|
9227
|
-
var _default$1 = (0, _createSvgIcon$1["default"])(/*#__PURE__*/ React$1.createElement("path", { d: "M10
|
|
9228
|
-
default_1$1 =
|
|
9796
|
+
var _default$1 = (0, _createSvgIcon$1["default"])(/*#__PURE__*/ React$1.createElement("path", { d: "M10 17l5-5-5-5v10z" }), 'ArrowRight');
|
|
9797
|
+
default_1$1 = ArrowRight["default"] = _default$1;
|
|
9229
9798
|
var TABLE_CONTAINER_ID = 'table-container';
|
|
9230
9799
|
var EXPANDED_CONTENT_CLASSNAME = 'expanded-content';
|
|
9231
9800
|
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'; }); };
|
|
9232
|
-
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' } }; });
|
|
9801
|
+
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: {} }; });
|
|
9233
9802
|
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); };
|
|
9234
|
-
var TableRow = function TableRow(
|
|
9803
|
+
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) {
|
|
9235
9804
|
leftAlignExpandedContent(tableContainerId);
|
|
9236
9805
|
} }, [open, tableContainerId]); var toggleOpen = function toggleOpen(e) { e.stopPropagation(); setOpen(function (prev) { return !prev; }); }; var handleRowClick = function handleRowClick(e) { if (onRowClick) {
|
|
9237
9806
|
onRowClick(id);
|
|
9238
9807
|
}
|
|
9239
9808
|
else if (ExpandedContent) {
|
|
9240
9809
|
toggleOpen(e);
|
|
9241
|
-
} }; 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 :
|
|
9242
|
-
var TableCore = function TableCore(
|
|
9810
|
+
} }; 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 }))))))); };
|
|
9811
|
+
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)
|
|
9243
9812
|
return; var tableWidth = container.getBoundingClientRect().width; if (originalTableWidth - container.scrollLeft + 16 >= tableWidth) {
|
|
9244
9813
|
leftAlignExpandedContent(containerId);
|
|
9245
|
-
} } 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,
|
|
9246
|
-
var useStyles$
|
|
9247
|
-
var Table = function Table(props) { var classes = useStyles$
|
|
9248
|
-
var TagList = function TagList(
|
|
9249
|
-
var RoleAssignmentsSectionBody = function RoleAssignmentsSectionBody(
|
|
9250
|
-
var roleAssignmentKeyExtractor = function roleAssignmentKeyExtractor(
|
|
9251
|
-
var roleAssignmentItemRenderer = [{ title: 'Group', getValue: function getValue(
|
|
9252
|
-
var RoleAssignmentsSection = function RoleAssignmentsSection(
|
|
9814
|
+
} } 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 }); })))); };
|
|
9815
|
+
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) } }; });
|
|
9816
|
+
var Table = function Table(props) { var classes = useStyles$6(props); return /*#__PURE__*/ wn.createElement(TableCore, Object.assign({}, props, { TableActionsComponent: TableActions, TypographyComponent: Typography, classes: classes })); };
|
|
9817
|
+
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)); })); };
|
|
9818
|
+
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.")))); };
|
|
9819
|
+
var roleAssignmentKeyExtractor = function roleAssignmentKeyExtractor(_ref76) { var group = _ref76.group; return group; };
|
|
9820
|
+
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 }); } }];
|
|
9821
|
+
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]) {
|
|
9253
9822
|
acc[group] = { group: group, roleIds: [] };
|
|
9254
9823
|
} 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)
|
|
9255
9824
|
switch (_context13.prev = _context13.next) {
|
|
@@ -9259,9 +9828,9 @@ var RoleAssignmentsSection = function RoleAssignmentsSection(_ref76) { var canUp
|
|
|
9259
9828
|
if (!deepEqual(remoteState.connectionRoleIds, localState.connectionRoleIds)) {
|
|
9260
9829
|
mutatedProperties.saml_connection_implicit_role_assignments = localState.connectionRoleIds.map(function (role_id) { return { role_id: role_id }; });
|
|
9261
9830
|
}
|
|
9262
|
-
filteredGroupRoles = localState.groupedRoles.filter(function (
|
|
9831
|
+
filteredGroupRoles = localState.groupedRoles.filter(function (_ref82) { var group = _ref82.group, roleIds = _ref82.roleIds; return group && roleIds.length > 0; });
|
|
9263
9832
|
if (!deepEqual(remoteState.groupedRoles, filteredGroupRoles)) {
|
|
9264
|
-
mutatedProperties.saml_group_implicit_role_assignments = filteredGroupRoles.flatMap(function (
|
|
9833
|
+
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 }; }); });
|
|
9265
9834
|
}
|
|
9266
9835
|
if (!(Object.keys(mutatedProperties).length > 0)) {
|
|
9267
9836
|
_context13.next = 7;
|
|
@@ -9272,9 +9841,9 @@ var RoleAssignmentsSection = function RoleAssignmentsSection(_ref76) { var canUp
|
|
|
9272
9841
|
case 8:
|
|
9273
9842
|
case "end": return _context13.stop();
|
|
9274
9843
|
} }, _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 })); };
|
|
9275
|
-
var SSOConnectionDetailsScreen = function SSOConnectionDetailsScreen(
|
|
9844
|
+
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) {
|
|
9276
9845
|
return Object.assign(Object.assign({}, oidcMatch), { connectionType: 'oidc' });
|
|
9277
|
-
} var samlMatch = (_b = connections === null || connections === void 0 ? void 0 : connections.saml_connections) === null || _b === void 0 ? void 0 : _b.find(function (
|
|
9846
|
+
} 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) {
|
|
9278
9847
|
return Object.assign(Object.assign({}, samlMatch), { connectionType: 'saml' });
|
|
9279
9848
|
} 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) {
|
|
9280
9849
|
handleRequestDelete({ id: connectionId, displayName: connectionName });
|
|
@@ -9282,10 +9851,10 @@ var SSOConnectionDetailsScreen = function SSOConnectionDetailsScreen(_ref81) { v
|
|
|
9282
9851
|
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))); };
|
|
9283
9852
|
var anchorOrigin = { horizontal: 'center', vertical: 'bottom' };
|
|
9284
9853
|
var transformOrigin = { horizontal: 'right', vertical: 'top' };
|
|
9285
|
-
var ActionMenu = function ActionMenu(
|
|
9854
|
+
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)) {
|
|
9286
9855
|
return null;
|
|
9287
9856
|
} 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)); };
|
|
9288
|
-
var useActionMenu = function useActionMenu(
|
|
9857
|
+
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) {
|
|
9289
9858
|
return {};
|
|
9290
9859
|
} return { customAction: /*#__PURE__*/ wn.createElement(ActionMenu, { actions: actions, item: item, idPrefix: "".concat(idPrefix, "-action-menu-").concat(item.id) }) }; }, [actions, idPrefix]); return { getItemActionProps: getItemActionProps }; };
|
|
9291
9860
|
var DEFAULT_TABLE_ROWS_PER_PAGE = 20;
|
|
@@ -9293,7 +9862,8 @@ var LOAD_NEXT_PAGE_ERROR = 'Failed to load the next page.';
|
|
|
9293
9862
|
var ZERO_RESULTS_MESSAGE = 'No results found.';
|
|
9294
9863
|
var PAGINATED_TABLE_ID = 'paginated-table';
|
|
9295
9864
|
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) } }; });
|
|
9296
|
-
var
|
|
9865
|
+
var defaultRowsPerPageOptions = [];
|
|
9866
|
+
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)
|
|
9297
9867
|
switch (_context14.prev = _context14.next) {
|
|
9298
9868
|
case 0:
|
|
9299
9869
|
tableRowHeight.current = (_e = document.querySelector("#".concat(tableId, " tbody tr"))) === null || _e === void 0 ? void 0 : _e.clientHeight;
|
|
@@ -9329,9 +9899,9 @@ var PaginatedTableCore = function PaginatedTableCore(_a) { var _b, _c, _d; var c
|
|
|
9329
9899
|
else {
|
|
9330
9900
|
countForPagination = (_b = metadata === null || metadata === void 0 ? void 0 : metadata.total) !== null && _b !== void 0 ? _b : 0;
|
|
9331
9901
|
moreRowsToShow = ((_c = metadata === null || metadata === void 0 ? void 0 : metadata.total) !== null && _c !== void 0 ? _c : 0) > rowsPerPage;
|
|
9332
|
-
} 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:
|
|
9333
|
-
var useStyles$
|
|
9334
|
-
var PaginatedTable = function PaginatedTable(props) { var classes = useStyles$
|
|
9902
|
+
} 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 })))); };
|
|
9903
|
+
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 } }; });
|
|
9904
|
+
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 })); };
|
|
9335
9905
|
var Search = {};
|
|
9336
9906
|
var _interopRequireDefault = interopRequireDefaultExports;
|
|
9337
9907
|
var _interopRequireWildcard = interopRequireWildcardExports;
|
|
@@ -9344,7 +9914,7 @@ default_1 = Search["default"] = _default;
|
|
|
9344
9914
|
var Keys;
|
|
9345
9915
|
(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 = {}));
|
|
9346
9916
|
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) } }; });
|
|
9347
|
-
var SearchBarCore = function SearchBarCore(_a) { var classes = _a.classes, Input = _a.InputComponent, inputProps = __rest(_a, ["classes", "InputComponent"]); var
|
|
9917
|
+
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) {
|
|
9348
9918
|
if (e.metaKey && e.key === Keys.K || e.key === Keys.ForwardSlash) {
|
|
9349
9919
|
e.stopPropagation();
|
|
9350
9920
|
inputRef.focus();
|
|
@@ -9353,32 +9923,44 @@ var SearchBarCore = function SearchBarCore(_a) { var classes = _a.classes, Input
|
|
|
9353
9923
|
}
|
|
9354
9924
|
}
|
|
9355
9925
|
} }; 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 })))); };
|
|
9356
|
-
var useStyles$
|
|
9357
|
-
var SearchBar = function SearchBar(props) { var classes = useStyles$
|
|
9358
|
-
var
|
|
9926
|
+
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) } }; });
|
|
9927
|
+
var SearchBar = function SearchBar(props) { var classes = useStyles$4(props); return /*#__PURE__*/ wn.createElement(SearchBarCore, Object.assign({}, props, { classes: classes, InputComponent: Input$1 })); };
|
|
9928
|
+
var tryParseJson = function tryParseJson(value) { try {
|
|
9929
|
+
if (value) {
|
|
9930
|
+
return JSON.parse(value);
|
|
9931
|
+
}
|
|
9932
|
+
}
|
|
9933
|
+
catch (e) { } return undefined; };
|
|
9934
|
+
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]; };
|
|
9935
|
+
var itemsPerPageOptions = [10, 15, 25, 50, 100];
|
|
9936
|
+
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)) {
|
|
9937
|
+
setItemsPerPage(value);
|
|
9938
|
+
} }; return [itemsPerPage, handleItemsPerPageChange]; };
|
|
9939
|
+
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) {
|
|
9359
9940
|
setCurrentPage(lastPageIndex);
|
|
9360
|
-
} return { items: items, currentPage: currentPage, setCurrentPage: setCurrentPage, loadNext: noop, metadata: metadata, rowsPerPage: itemsPerPage }; };
|
|
9361
|
-
var
|
|
9941
|
+
} return { items: items, currentPage: currentPage, setCurrentPage: setCurrentPage, loadNext: noop, metadata: metadata, rowsPerPage: itemsPerPage, rowsPerPageOptions: itemsPerPageOptions, onRowsPerPageChange: handleItemsPerPageChange }; };
|
|
9942
|
+
var DEFAULT_ROWS_PER_PAGE = 10;
|
|
9943
|
+
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) {
|
|
9362
9944
|
case 'active': return 'Active';
|
|
9363
9945
|
case 'pending': return 'Pending';
|
|
9364
9946
|
default: return status;
|
|
9365
9947
|
} } }];
|
|
9366
|
-
var useSearchFilter = function useSearchFilter(
|
|
9948
|
+
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) {
|
|
9367
9949
|
return data;
|
|
9368
9950
|
} 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 }; };
|
|
9369
9951
|
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; };
|
|
9370
|
-
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 }; };
|
|
9371
|
-
var SSOConnectionsScreen = function SSOConnectionsScreen() { var _useSsoRouterControll5 = useSsoRouterController(), navigate = _useSsoRouterControll5.navigate; var canProjectCreateSsoConnection = useCanProjectCreateSsoConnection(); var
|
|
9952
|
+
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 }; };
|
|
9953
|
+
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))); };
|
|
9372
9954
|
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) } }; });
|
|
9373
9955
|
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)); };
|
|
9374
9956
|
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)); };
|
|
9375
9957
|
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)); };
|
|
9376
|
-
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' } }; });
|
|
9377
|
-
var Accordion = function Accordion(props) { var classes = useStyles(); return /*#__PURE__*/ wn.createElement(AccordionCore, Object.assign({}, props, { classes: classes })); };
|
|
9378
|
-
var AccordionSummary = function AccordionSummary(props) { var classes = useStyles(); return /*#__PURE__*/ wn.createElement(AccordionSummaryCore, Object.assign({}, props, { classes: classes })); };
|
|
9379
|
-
var AccordionDetails = function AccordionDetails(props) { var classes = useStyles(); return /*#__PURE__*/ wn.createElement(AccordionDetailsCore, Object.assign({}, props, { classes: classes })); };
|
|
9380
|
-
var useManualConfigurationState = function useManualConfigurationState(
|
|
9381
|
-
var SSONewConnectionConfigureScreen = function SSONewConnectionConfigureScreen(
|
|
9958
|
+
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' } }; });
|
|
9959
|
+
var Accordion = function Accordion(props) { var classes = useStyles$3(); return /*#__PURE__*/ wn.createElement(AccordionCore, Object.assign({}, props, { classes: classes })); };
|
|
9960
|
+
var AccordionSummary = function AccordionSummary(props) { var classes = useStyles$3(); return /*#__PURE__*/ wn.createElement(AccordionSummaryCore, Object.assign({}, props, { classes: classes })); };
|
|
9961
|
+
var AccordionDetails = function AccordionDetails(props) { var classes = useStyles$3(); return /*#__PURE__*/ wn.createElement(AccordionDetailsCore, Object.assign({}, props, { classes: classes })); };
|
|
9962
|
+
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]; };
|
|
9963
|
+
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)
|
|
9382
9964
|
switch (_context16.prev = _context16.next) {
|
|
9383
9965
|
case 0:
|
|
9384
9966
|
e.preventDefault();
|
|
@@ -9445,8 +10027,8 @@ var SSONewConnectionConfigureScreen = function SSONewConnectionConfigureScreen(_
|
|
|
9445
10027
|
openToast({ text: message || 'Unable to save connection', type: 'error' });
|
|
9446
10028
|
case 30:
|
|
9447
10029
|
case "end": return _context16.stop();
|
|
9448
|
-
} }, _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")))); };
|
|
9449
|
-
var SSONewConnectionScreen = function SSONewConnectionScreen() { var _useSsoRouterControll8 = useSsoRouterController(), navigate = _useSsoRouterControll8.navigate; var
|
|
10030
|
+
} }, _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")))); };
|
|
10031
|
+
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)
|
|
9450
10032
|
switch (_context18.prev = _context18.next) {
|
|
9451
10033
|
case 0:
|
|
9452
10034
|
e.preventDefault();
|
|
@@ -9485,10 +10067,10 @@ var SSONewConnectionScreen = function SSONewConnectionScreen() { var _useSsoRout
|
|
|
9485
10067
|
}
|
|
9486
10068
|
case 10:
|
|
9487
10069
|
case "end": return _context18.stop();
|
|
9488
|
-
} }, _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")))); };
|
|
9489
|
-
var routeMap = { connectionDetails: SSOConnectionDetailsScreen, connectionsList: SSOConnectionsScreen, newConnection: SSONewConnectionScreen, newConnectionConfigure: SSONewConnectionConfigureScreen };
|
|
9490
|
-
var initialRoute = { screen: 'connectionsList' };
|
|
9491
|
-
var Content = function Content() { var _useAdminPortalConfig2 = useAdminPortalConfig(), adminPortalConfig = _useAdminPortalConfig2.data, adminPortalConfigError = _useAdminPortalConfig2.error; var
|
|
10070
|
+
} }, _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")))); };
|
|
10071
|
+
var routeMap$1 = { connectionDetails: SSOConnectionDetailsScreen, connectionsList: SSOConnectionsScreen, newConnection: SSONewConnectionScreen, newConnectionConfigure: SSONewConnectionConfigureScreen };
|
|
10072
|
+
var initialRoute$1 = { screen: 'connectionsList' };
|
|
10073
|
+
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) {
|
|
9492
10074
|
return /*#__PURE__*/ wn.createElement(Alert, null, "SSO Connections could not be loaded. Please contact your admin if you think this is a mistake.");
|
|
9493
10075
|
} if (canGetSso === undefined || !adminPortalConfig) {
|
|
9494
10076
|
return /*#__PURE__*/ wn.createElement(PageLoadingIndicator, null);
|
|
@@ -9496,9 +10078,251 @@ var Content = function Content() { var _useAdminPortalConfig2 = useAdminPortalCo
|
|
|
9496
10078
|
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.");
|
|
9497
10079
|
} if (!adminPortalConfig.sso_config.sso_enabled) {
|
|
9498
10080
|
return /*#__PURE__*/ wn.createElement(Alert, null, "SSO Connections are not supported. Please contact your admin if you think this is a mistake.");
|
|
9499
|
-
} return /*#__PURE__*/ wn.createElement(SsoRouterProvider, { initialRoute: initialRoute }, /*#__PURE__*/ wn.createElement(SsoRouter, { routeMap: routeMap })); };
|
|
9500
|
-
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)); };
|
|
10081
|
+
} return /*#__PURE__*/ wn.createElement(SsoRouterProvider, { initialRoute: initialRoute$1 }, /*#__PURE__*/ wn.createElement(SsoRouter, { routeMap: routeMap$1 })); };
|
|
10082
|
+
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)); };
|
|
9501
10083
|
var mountAdminPortalSSO = makeAdminPortalComponentMountFn(AdminPortalSSO$1, 'stytch-b2b-admin-portal-sso-ui', 'mountAdminPortalSSO');
|
|
10084
|
+
var _createRouter2 = createRouter(), OrgSettingsRouterProvider = _createRouter2.RouterProvider, OrgSettingsRouter = _createRouter2.Router, useOrgSettingsRouterController = _createRouter2.useRouterController;
|
|
10085
|
+
var isEmptyObject = function isEmptyObject(value) { for (var prop in value) {
|
|
10086
|
+
if (Object.prototype.hasOwnProperty.call(value, prop)) {
|
|
10087
|
+
return false;
|
|
10088
|
+
}
|
|
10089
|
+
} return true; };
|
|
10090
|
+
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 }; };
|
|
10091
|
+
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))))); };
|
|
10092
|
+
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) {
|
|
10093
|
+
mutatedProperties.organizationName = localState.organizationName;
|
|
10094
|
+
} if (remoteState.organizationSlug !== localState.organizationSlug && localState.organizationSlug.length > 0) {
|
|
10095
|
+
mutatedProperties.organizationSlug = localState.organizationSlug;
|
|
10096
|
+
} 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)
|
|
10097
|
+
switch (_context19.prev = _context19.next) {
|
|
10098
|
+
case 0:
|
|
10099
|
+
mutatedProperties = findMutatedProperties();
|
|
10100
|
+
if (isEmptyObject(mutatedProperties)) {
|
|
10101
|
+
_context19.next = 4;
|
|
10102
|
+
break;
|
|
10103
|
+
}
|
|
10104
|
+
_context19.next = 4;
|
|
10105
|
+
return setOrgDetails({ organizationName: mutatedProperties.organizationName, organizationSlug: mutatedProperties.organizationSlug });
|
|
10106
|
+
case 4: return _context19.abrupt("return");
|
|
10107
|
+
case 5:
|
|
10108
|
+
case "end": return _context19.stop();
|
|
10109
|
+
} }, _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 })); };
|
|
10110
|
+
var makeRowStyles = makeStyles(function () { return { rowItemContainer: { maxWidth: DEFAULT_GRID_COLUMN_WIDTH }, rowItemFullWidth: { maxWidth: DEFAULT_MAX_ITEM_WIDTH } }; });
|
|
10111
|
+
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); };
|
|
10112
|
+
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: {} }; });
|
|
10113
|
+
var stopPropagateOnClick = function stopPropagateOnClick(e) { e.stopPropagation(); };
|
|
10114
|
+
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))) })); };
|
|
10115
|
+
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' } }; });
|
|
10116
|
+
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))) }); };
|
|
10117
|
+
var useStyles$1 = makeCheckboxStyles(function (theme) { return { checkbox: { '&.MuiCheckbox-root': { padding: 0, color: theme.styleConfig.colors.primary, '&.Mui-disabled': { color: theme.styleConfig.colors.secondary } } } }; });
|
|
10118
|
+
var Checkbox = function Checkbox(_a) { var props = __rest(_a, []); var classes = useStyles$1(); return /*#__PURE__*/ wn.createElement(CheckboxCore, Object.assign({}, props, { classes: classes })); };
|
|
10119
|
+
var PaddingLeft = He.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-left: 34px;\n"])));
|
|
10120
|
+
var arraysHaveSameContents = function arraysHaveSameContents(arr1, arr2) { if (Array.isArray(arr1) && Array.isArray(arr2)) {
|
|
10121
|
+
if (arr1.length !== arr2.length) {
|
|
10122
|
+
return false;
|
|
10123
|
+
}
|
|
10124
|
+
var array2Sorted = arr2.slice().sort();
|
|
10125
|
+
var isEqual = arr1.slice().sort().every(function (value, index) { return JSON.stringify(value) === JSON.stringify(array2Sorted[index]); });
|
|
10126
|
+
if (!isEqual)
|
|
10127
|
+
return false;
|
|
10128
|
+
return true;
|
|
10129
|
+
} return false; };
|
|
10130
|
+
var allowedAuthMethodsLabelMap = { magic_link: 'Email Magic Links', sso: 'Single Sign-On', google_oauth: 'Google OAuth', microsoft_oauth: 'Microsoft OAuth', password: 'Password' };
|
|
10131
|
+
var allowedMfaMethodsLabelMap = { sms_otp: 'SMS OTP', totp: 'TOTP' };
|
|
10132
|
+
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 }; };
|
|
10133
|
+
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)) {
|
|
10134
|
+
setLocalState(function (prevState) { return Object.assign(Object.assign({}, prevState), { allowedAuthMethods: prevState.allowedAuthMethods.filter(function (method) { return method !== authMethod; }) }); });
|
|
10135
|
+
}
|
|
10136
|
+
else {
|
|
10137
|
+
setLocalState(function (prevState) { return Object.assign(Object.assign({}, prevState), { allowedAuthMethods: [].concat(_toConsumableArray2(prevState.allowedAuthMethods), [authMethod]) }); });
|
|
10138
|
+
} }; var handleAllowedMfaMethodClick = function handleAllowedMfaMethodClick(mfaMethod) { if (localState.allowedMfaMethods.includes(mfaMethod)) {
|
|
10139
|
+
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; }) }); });
|
|
10140
|
+
}
|
|
10141
|
+
else {
|
|
10142
|
+
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]) }); });
|
|
10143
|
+
} }; 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); } }); })))))); };
|
|
10144
|
+
var configAuthMethodMap = { emailMagicLinks: 'magic_link', sso: 'sso', password: 'password', oauthGoogle: 'google_oauth', oauthMicrosoft: 'microsoft_oauth' };
|
|
10145
|
+
var configMfaMethodMap = { smsOtp: 'sms_otp', totp: 'totp' };
|
|
10146
|
+
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)
|
|
10147
|
+
switch (_context20.prev = _context20.next) {
|
|
10148
|
+
case 0:
|
|
10149
|
+
mutatedProperties = {};
|
|
10150
|
+
if (localState.isPrimaryAuthAllAllowed !== remoteState.isPrimaryAuthAllAllowed) {
|
|
10151
|
+
mutatedProperties.auth_methods = localState.isPrimaryAuthAllAllowed ? 'ALL_ALLOWED' : 'RESTRICTED';
|
|
10152
|
+
}
|
|
10153
|
+
if (!arraysHaveSameContents(localState.allowedAuthMethods, remoteState.allowedAuthMethods)) {
|
|
10154
|
+
mutatedProperties.allowed_auth_methods = localState.allowedAuthMethods;
|
|
10155
|
+
}
|
|
10156
|
+
if (localState.isSecondaryAuthAllAllowed !== remoteState.isSecondaryAuthAllAllowed) {
|
|
10157
|
+
mutatedProperties.mfa_methods = localState.isSecondaryAuthAllAllowed ? 'ALL_ALLOWED' : 'RESTRICTED';
|
|
10158
|
+
}
|
|
10159
|
+
if (!arraysHaveSameContents(localState.allowedMfaMethods, remoteState.allowedMfaMethods)) {
|
|
10160
|
+
mutatedProperties.allowed_mfa_methods = localState.allowedMfaMethods;
|
|
10161
|
+
}
|
|
10162
|
+
if (localState.isMfaPolicyRequiredForAll !== remoteState.isMfaPolicyRequiredForAll) {
|
|
10163
|
+
mutatedProperties.mfa_policy = localState.isMfaPolicyRequiredForAll ? 'REQUIRED_FOR_ALL' : 'OPTIONAL';
|
|
10164
|
+
}
|
|
10165
|
+
if (!(Object.keys(mutatedProperties).length > 0)) {
|
|
10166
|
+
_context20.next = 9;
|
|
10167
|
+
break;
|
|
10168
|
+
}
|
|
10169
|
+
_context20.next = 9;
|
|
10170
|
+
return setOrgAuthSettings(mutatedProperties);
|
|
10171
|
+
case 9:
|
|
10172
|
+
case "end": return _context20.stop();
|
|
10173
|
+
} }, _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 })); };
|
|
10174
|
+
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)); } }]; };
|
|
10175
|
+
var roleAssigmnentsKeyExtractor = function roleAssigmnentsKeyExtractor(role) { return role.role_id; };
|
|
10176
|
+
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 : ''); } }];
|
|
10177
|
+
var roleKeyExtractor = function roleKeyExtractor(role) { return role.displayName; };
|
|
10178
|
+
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') {
|
|
10179
|
+
rbacEmails.push({ role_id: roleId, domain: value.displayName });
|
|
10180
|
+
} }); }); return mutate({ rbac_email_implicit_role_assignments: rbacEmails }, { errorMessage: 'Failed to update email role assignments.' }); }; return { setOrgEmailAssignments: setOrgEmailAssignments }; };
|
|
10181
|
+
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 })); };
|
|
10182
|
+
var filterRoleAssignmentsBy = function filterRoleAssignmentsBy(arr, _ref113) { var source = _ref113.source; return arr.slice().filter(function (val) { return val.source === source; }); };
|
|
10183
|
+
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; })); };
|
|
10184
|
+
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) {
|
|
10185
|
+
sourceItems.add('SSO');
|
|
10186
|
+
} var sourceSelectItems = Array.from(sourceItems).map(function (source) { return { label: source, value: source }; }); var addRoleAssignmentModalProps = useModalState(function () { if (!selectedSource)
|
|
10187
|
+
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') {
|
|
10188
|
+
var domains = new Set();
|
|
10189
|
+
filteredRoleAssignments.forEach(function (roleAssignment) { domains.add(roleAssignment.displayName); });
|
|
10190
|
+
uniqueValuesSplitOnSpaces({ input: emailDomain }).forEach(function (domain) { if (!domains.has(domain)) {
|
|
10191
|
+
domains.add(domain);
|
|
10192
|
+
mergedRoleAssignments.push({ source: selectedSource, displayName: domain });
|
|
10193
|
+
} });
|
|
10194
|
+
}
|
|
10195
|
+
else if (selectedSource === 'SSO') {
|
|
10196
|
+
var idToGroups = {};
|
|
10197
|
+
filteredRoleAssignments.forEach(function (ssoRoleAssignment) { idToGroups[ssoRoleAssignment.id] = new Set([ssoRoleAssignment.groups]); });
|
|
10198
|
+
ssoRoleAssignments.forEach(function (ssoConnection) { var connectionId = ssoConnection.id; if (connectionId.length !== 0) {
|
|
10199
|
+
uniqueValuesSplitOnSpaces({ input: ssoConnection.groups }).forEach(function (group) { var _a, _b; if (!idToGroups[connectionId]) {
|
|
10200
|
+
idToGroups[connectionId] = new Set();
|
|
10201
|
+
} if (!idToGroups[connectionId].has(group)) {
|
|
10202
|
+
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 });
|
|
10203
|
+
idToGroups[ssoConnection.id].add(group);
|
|
10204
|
+
} });
|
|
10205
|
+
} });
|
|
10206
|
+
} if (mergedRoleAssignments.length !== remoteRoleAssignments.length) {
|
|
10207
|
+
return Object.assign(Object.assign({}, state), { idMap: Object.assign(Object.assign({}, state.idMap), _defineProperty2({}, roleId, mergedRoleAssignments)) });
|
|
10208
|
+
} 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) {
|
|
10209
|
+
return Object.assign(Object.assign({}, connection), { id: val });
|
|
10210
|
+
} 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) {
|
|
10211
|
+
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) });
|
|
10212
|
+
} 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."))); };
|
|
10213
|
+
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') {
|
|
10214
|
+
return -1;
|
|
10215
|
+
} if (b.role_id === 'stytch_admin') {
|
|
10216
|
+
return 1;
|
|
10217
|
+
} if (a.role_id === 'stytch_member') {
|
|
10218
|
+
return -1;
|
|
10219
|
+
} if (b.role_id === 'stytch_member') {
|
|
10220
|
+
return 1;
|
|
10221
|
+
} 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]) {
|
|
10222
|
+
idToRoleAssignments[role] = [];
|
|
10223
|
+
} 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]) {
|
|
10224
|
+
idToRoleAssignments[role] = [];
|
|
10225
|
+
} 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]) {
|
|
10226
|
+
idToRoleAssignments[role] = [];
|
|
10227
|
+
} 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)
|
|
10228
|
+
switch (_context22.prev = _context22.next) {
|
|
10229
|
+
case 0:
|
|
10230
|
+
if (!canSetRoles) {
|
|
10231
|
+
_context22.next = 10;
|
|
10232
|
+
break;
|
|
10233
|
+
}
|
|
10234
|
+
_context22.next = 3;
|
|
10235
|
+
return setOrgEmailAssignments(localState);
|
|
10236
|
+
case 3:
|
|
10237
|
+
if (!canUpdateSso) {
|
|
10238
|
+
_context22.next = 10;
|
|
10239
|
+
break;
|
|
10240
|
+
}
|
|
10241
|
+
mutatedConnections = {};
|
|
10242
|
+
copyConnections = {};
|
|
10243
|
+
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; });
|
|
10244
|
+
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') {
|
|
10245
|
+
var connectionId = roleAssignment.id;
|
|
10246
|
+
if (roleAssignment.groups) {
|
|
10247
|
+
mutatedConnections[connectionId].saml_group_implicit_role_assignments.push({ role_id: roleId, group: roleAssignment.groups });
|
|
10248
|
+
}
|
|
10249
|
+
else {
|
|
10250
|
+
mutatedConnections[connectionId].saml_connection_implicit_role_assignments.push({ role_id: roleId });
|
|
10251
|
+
}
|
|
10252
|
+
} }); });
|
|
10253
|
+
_context22.next = 10;
|
|
10254
|
+
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)
|
|
10255
|
+
switch (_context21.prev = _context21.next) {
|
|
10256
|
+
case 0:
|
|
10257
|
+
originalConnection = copyConnections[connectionId];
|
|
10258
|
+
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); })))) {
|
|
10259
|
+
_context21.next = 4;
|
|
10260
|
+
break;
|
|
10261
|
+
}
|
|
10262
|
+
_context21.next = 4;
|
|
10263
|
+
return mutate(Object.assign({}, mutatedConnection));
|
|
10264
|
+
case 4:
|
|
10265
|
+
case "end": return _context21.stop();
|
|
10266
|
+
} }, _callee20); })); }));
|
|
10267
|
+
case 10:
|
|
10268
|
+
case "end": return _context22.stop();
|
|
10269
|
+
} }, _callee21); })); }; if (isLoading && canGetSso) {
|
|
10270
|
+
return /*#__PURE__*/ wn.createElement(PageLoadingIndicator, null);
|
|
10271
|
+
} 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 })); };
|
|
10272
|
+
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))) }); };
|
|
10273
|
+
var makeRadioGroupStyles = makeStylesFactory(function (theme) { return { radioGroup: { display: 'flex', flexDirection: 'column', gap: theme.spacing(0.5) } }; });
|
|
10274
|
+
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 })); }))); };
|
|
10275
|
+
var useStyles = makeRadioGroupStyles(function (theme) { return { radioGroup: { display: 'flex', flexDirection: 'row', gap: theme.spacing(0.5) } }; });
|
|
10276
|
+
var RadioGroup = function RadioGroup(props) { var classes = useStyles(props); return /*#__PURE__*/ wn.createElement(RadioGroupCore, Object.assign({ classes: classes }, props)); };
|
|
10277
|
+
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 }; };
|
|
10278
|
+
var emailAllowedDomainsRenderer = [{ title: 'Domain', getValue: function getValue(email) { return /*#__PURE__*/ wn.createElement(Typography, { variant: "body2" }, email); } }];
|
|
10279
|
+
var emailInvitesLabelMap = { ALL_ALLOWED: 'Anybody', RESTRICTED: 'Users from allowed email domains' };
|
|
10280
|
+
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" })); };
|
|
10281
|
+
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 })); };
|
|
10282
|
+
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)
|
|
10283
|
+
switch (_context23.prev = _context23.next) {
|
|
10284
|
+
case 0:
|
|
10285
|
+
mutatedProperties = {};
|
|
10286
|
+
if (localState.isEmailJitProvisioningAllowed !== remoteState.isEmailJitProvisioningAllowed) {
|
|
10287
|
+
mutatedProperties.email_jit_provisioning = localState.isEmailJitProvisioningAllowed ? 'RESTRICTED' : 'NOT_ALLOWED';
|
|
10288
|
+
}
|
|
10289
|
+
if (localState.emailInvites !== remoteState.emailInvites) {
|
|
10290
|
+
mutatedProperties.email_invites = localState.emailInvites;
|
|
10291
|
+
}
|
|
10292
|
+
if (!arraysHaveSameContents(localState.emailAllowedDomains, remoteState.emailAllowedDomains)) {
|
|
10293
|
+
mutatedProperties.email_allowed_domains = localState.emailAllowedDomains;
|
|
10294
|
+
}
|
|
10295
|
+
if (!(Object.keys(mutatedProperties).length > 0)) {
|
|
10296
|
+
_context23.next = 7;
|
|
10297
|
+
break;
|
|
10298
|
+
}
|
|
10299
|
+
_context23.next = 7;
|
|
10300
|
+
return setOrgAuthSettings(mutatedProperties);
|
|
10301
|
+
case 7:
|
|
10302
|
+
case "end": return _context23.stop();
|
|
10303
|
+
} }, _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 })); };
|
|
10304
|
+
var OrgSettingsScreen = function OrgSettingsScreen() { var _useOrgInfo3 = useOrgInfo(), isLoading = _useOrgInfo3.isLoading, error = _useOrgInfo3.error, orgInfo = _useOrgInfo3.data; if (isLoading) {
|
|
10305
|
+
return /*#__PURE__*/ wn.createElement(PageLoadingIndicator, null);
|
|
10306
|
+
} if (error) {
|
|
10307
|
+
return /*#__PURE__*/ wn.createElement(Alert, null, extractErrorMessage(error));
|
|
10308
|
+
} 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 })))); };
|
|
10309
|
+
var validateConfig = function validateConfig(config) { if (!config)
|
|
10310
|
+
return; if (config.allowedAuthMethods.length === 0) {
|
|
10311
|
+
throw new Error('allowedAuthMethods must contain at least one value');
|
|
10312
|
+
} if (config.allowedMfaAuthMethods.length === 0) {
|
|
10313
|
+
throw new Error('mfaAuthMethods must contain at least one value');
|
|
10314
|
+
} };
|
|
10315
|
+
exports.AdminPortalB2BProducts = void 0;
|
|
10316
|
+
(function (AdminPortalB2BProducts) { AdminPortalB2BProducts["emailMagicLinks"] = "emailMagicLinks"; AdminPortalB2BProducts["sso"] = "sso"; AdminPortalB2BProducts["password"] = "password"; AdminPortalB2BProducts["oauthGoogle"] = "oauthGoogle"; AdminPortalB2BProducts["oauthMicrosoft"] = "oauthMicrosoft"; })(exports.AdminPortalB2BProducts || (exports.AdminPortalB2BProducts = {}));
|
|
10317
|
+
var routeMap = { orgSettingsScreen: OrgSettingsScreen };
|
|
10318
|
+
var initialRoute = { screen: 'orgSettingsScreen' };
|
|
10319
|
+
var Content = function Content() { var _useAdminPortalConfig5 = useAdminPortalConfig(), adminPortalConfigError = _useAdminPortalConfig5.error, isLoading = _useAdminPortalConfig5.isLoading; if (adminPortalConfigError) {
|
|
10320
|
+
return /*#__PURE__*/ wn.createElement(Alert, null, "Organization Settings could not be loaded. Please contact your admin if you think this is a mistake.");
|
|
10321
|
+
} if (isLoading) {
|
|
10322
|
+
return /*#__PURE__*/ wn.createElement(PageLoadingIndicator, null);
|
|
10323
|
+
} return /*#__PURE__*/ wn.createElement(OrgSettingsRouterProvider, { initialRoute: initialRoute }, /*#__PURE__*/ wn.createElement(OrgSettingsRouter, { routeMap: routeMap })); };
|
|
10324
|
+
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)); };
|
|
10325
|
+
var mountAdminPortalOrgSettings = makeAdminPortalComponentMountFn(AdminPortalOrgSettings$1, 'stytch-b2b-admin-portal-org-settings-ui', 'mountAdminPortalOrgSettings');
|
|
9502
10326
|
|
|
9503
10327
|
const makeAdminPortalComponent = (mountFn, componentName) => {
|
|
9504
10328
|
const Component = (props) => {
|
|
@@ -9524,4 +10348,13 @@ const makeAdminPortalComponent = (mountFn, componentName) => {
|
|
|
9524
10348
|
*/
|
|
9525
10349
|
const AdminPortalSSO = makeAdminPortalComponent(mountAdminPortalSSO, 'AdminPortalSSO');
|
|
9526
10350
|
|
|
10351
|
+
/**
|
|
10352
|
+
* The Admin Portal Organization Settings UI component.
|
|
10353
|
+
* This component must be rendered within a {@link StytchB2BProvider}.
|
|
10354
|
+
*
|
|
10355
|
+
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
10356
|
+
*/
|
|
10357
|
+
const AdminPortalOrgSettings = makeAdminPortalComponent(mountAdminPortalOrgSettings, 'AdminPortalOrgSettings');
|
|
10358
|
+
|
|
10359
|
+
exports.AdminPortalOrgSettings = AdminPortalOrgSettings;
|
|
9527
10360
|
exports.AdminPortalSSO = AdminPortalSSO;
|