linuxdo-next

一个呼吸顺畅的 linux.do 论坛

当前为 2024-03-13 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name linuxdo-next
  3. // @namespace linuxdo-next
  4. // @version 0.1.0
  5. // @author delph1s
  6. // @description 一个呼吸顺畅的 linux.do 论坛
  7. // @license GPLv2
  8. // @iconURL https://cdn.linux.do/uploads/default/original/1X/3a18b4b0da3e8cf96f7eea15241c3d251f28a39b.png
  9. // @homepageURL https://github.com/delph1s/linuxdo-next
  10. // @match *://linux.do/
  11. // @match *://linux.do/*
  12. // @require https://cdn.jsdelivr.net/npm/react@18.2.0/umd/react.production.min.js
  13. // @require https://cdn.jsdelivr.net/npm/react-dom@18.2.0/umd/react-dom.production.min.js
  14. // @grant GM_addStyle
  15. // @run-at document-end
  16. // ==/UserScript==
  17.  
  18. (n=>{if(typeof GM_addStyle=="function"){GM_addStyle(n);return}const t=document.createElement("style");t.textContent=n,document.head.append(t)})(' :export{appName:"linuxdo-next";pluginContainer:linuxdo-next-container;pandoraButton:linuxdo-next-pandora-next}#linuxdo-next-container{left:0;font-size:12px}.linuxdo-next-pandora-next{position:fixed;right:1rem;bottom:1rem;z-index:9999} ');
  19.  
  20. (function (React, ReactDOM__default) {
  21. 'use strict';
  22.  
  23. function _interopNamespaceDefault(e) {
  24. const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
  25. if (e) {
  26. for (const k in e) {
  27. if (k !== 'default') {
  28. const d = Object.getOwnPropertyDescriptor(e, k);
  29. Object.defineProperty(n, k, d.get ? d : {
  30. enumerable: true,
  31. get: () => e[k]
  32. });
  33. }
  34. }
  35. }
  36. n.default = e;
  37. return Object.freeze(n);
  38. }
  39.  
  40. const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
  41. const ReactDOM__default__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM__default);
  42.  
  43. var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  44. function getDefaultExportFromCjs(x2) {
  45. return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
  46. }
  47. function getAugmentedNamespace(n2) {
  48. if (n2.__esModule)
  49. return n2;
  50. var f2 = n2.default;
  51. if (typeof f2 == "function") {
  52. var a = function a2() {
  53. if (this instanceof a2) {
  54. return Reflect.construct(f2, arguments, this.constructor);
  55. }
  56. return f2.apply(this, arguments);
  57. };
  58. a.prototype = f2.prototype;
  59. } else
  60. a = {};
  61. Object.defineProperty(a, "__esModule", { value: true });
  62. Object.keys(n2).forEach(function(k2) {
  63. var d2 = Object.getOwnPropertyDescriptor(n2, k2);
  64. Object.defineProperty(a, k2, d2.get ? d2 : {
  65. enumerable: true,
  66. get: function() {
  67. return n2[k2];
  68. }
  69. });
  70. });
  71. return a;
  72. }
  73. var jsxRuntime = { exports: {} };
  74. var reactJsxRuntime_production_min = {};
  75. /**
  76. * @license React
  77. * react-jsx-runtime.production.min.js
  78. *
  79. * Copyright (c) Facebook, Inc. and its affiliates.
  80. *
  81. * This source code is licensed under the MIT license found in the
  82. * LICENSE file in the root directory of this source tree.
  83. */
  84. var f$2 = React, k$2 = Symbol.for("react.element"), l$2 = Symbol.for("react.fragment"), m$3 = Object.prototype.hasOwnProperty, n$2 = f$2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p$2 = { key: true, ref: true, __self: true, __source: true };
  85. function q$2(c2, a, g2) {
  86. var b2, d2 = {}, e2 = null, h2 = null;
  87. void 0 !== g2 && (e2 = "" + g2);
  88. void 0 !== a.key && (e2 = "" + a.key);
  89. void 0 !== a.ref && (h2 = a.ref);
  90. for (b2 in a)
  91. m$3.call(a, b2) && !p$2.hasOwnProperty(b2) && (d2[b2] = a[b2]);
  92. if (c2 && c2.defaultProps)
  93. for (b2 in a = c2.defaultProps, a)
  94. void 0 === d2[b2] && (d2[b2] = a[b2]);
  95. return { $$typeof: k$2, type: c2, key: e2, ref: h2, props: d2, _owner: n$2.current };
  96. }
  97. reactJsxRuntime_production_min.Fragment = l$2;
  98. reactJsxRuntime_production_min.jsx = q$2;
  99. reactJsxRuntime_production_min.jsxs = q$2;
  100. {
  101. jsxRuntime.exports = reactJsxRuntime_production_min;
  102. }
  103. var jsxRuntimeExports = jsxRuntime.exports;
  104. const appName = '"linuxdo-next"';
  105. const pluginContainer = "linuxdo-next-container";
  106. const pandoraButton = "linuxdo-next-pandora-next";
  107. const styles$1 = {
  108. appName,
  109. pluginContainer,
  110. pandoraButton
  111. };
  112. var client = {};
  113. var m$2 = ReactDOM__default;
  114. {
  115. client.createRoot = m$2.createRoot;
  116. client.hydrateRoot = m$2.hydrateRoot;
  117. }
  118. const uiConfig = {
  119. pandoraDrawerWidth: "280px",
  120. pandoraDrawerMinHeight: "50%",
  121. pandoraDrawerMaxHeight: "70%"
  122. };
  123. const filterForwardProps = (targetProp, excludeProps) => excludeProps.indexOf(targetProp) === -1;
  124. function _objectWithoutPropertiesLoose(source, excluded) {
  125. if (source == null)
  126. return {};
  127. var target = {};
  128. var sourceKeys = Object.keys(source);
  129. var key, i;
  130. for (i = 0; i < sourceKeys.length; i++) {
  131. key = sourceKeys[i];
  132. if (excluded.indexOf(key) >= 0)
  133. continue;
  134. target[key] = source[key];
  135. }
  136. return target;
  137. }
  138. function _extends$1() {
  139. _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
  140. for (var i = 1; i < arguments.length; i++) {
  141. var source = arguments[i];
  142. for (var key in source) {
  143. if (Object.prototype.hasOwnProperty.call(source, key)) {
  144. target[key] = source[key];
  145. }
  146. }
  147. }
  148. return target;
  149. };
  150. return _extends$1.apply(this, arguments);
  151. }
  152. function r$1(e2) {
  153. var t2, f2, n2 = "";
  154. if ("string" == typeof e2 || "number" == typeof e2)
  155. n2 += e2;
  156. else if ("object" == typeof e2)
  157. if (Array.isArray(e2)) {
  158. var o = e2.length;
  159. for (t2 = 0; t2 < o; t2++)
  160. e2[t2] && (f2 = r$1(e2[t2])) && (n2 && (n2 += " "), n2 += f2);
  161. } else
  162. for (f2 in e2)
  163. e2[f2] && (n2 && (n2 += " "), n2 += f2);
  164. return n2;
  165. }
  166. function clsx() {
  167. for (var e2, t2, f2 = 0, n2 = "", o = arguments.length; f2 < o; f2++)
  168. (e2 = arguments[f2]) && (t2 = r$1(e2)) && (n2 && (n2 += " "), n2 += t2);
  169. return n2;
  170. }
  171. function resolveProps(defaultProps2, props) {
  172. const output = _extends$1({}, props);
  173. Object.keys(defaultProps2).forEach((propName) => {
  174. if (propName.toString().match(/^(components|slots)$/)) {
  175. output[propName] = _extends$1({}, defaultProps2[propName], output[propName]);
  176. } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
  177. const defaultSlotProps = defaultProps2[propName] || {};
  178. const slotProps = props[propName];
  179. output[propName] = {};
  180. if (!slotProps || !Object.keys(slotProps)) {
  181. output[propName] = defaultSlotProps;
  182. } else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {
  183. output[propName] = slotProps;
  184. } else {
  185. output[propName] = _extends$1({}, slotProps);
  186. Object.keys(defaultSlotProps).forEach((slotPropName) => {
  187. output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
  188. });
  189. }
  190. } else if (output[propName] === void 0) {
  191. output[propName] = defaultProps2[propName];
  192. }
  193. });
  194. return output;
  195. }
  196. function composeClasses(slots, getUtilityClass, classes = void 0) {
  197. const output = {};
  198. Object.keys(slots).forEach(
  199. // `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
  200. // @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
  201. (slot) => {
  202. output[slot] = slots[slot].reduce((acc, key) => {
  203. if (key) {
  204. const utilityClass = getUtilityClass(key);
  205. if (utilityClass !== "") {
  206. acc.push(utilityClass);
  207. }
  208. if (classes && classes[key]) {
  209. acc.push(classes[key]);
  210. }
  211. }
  212. return acc;
  213. }, []).join(" ");
  214. }
  215. );
  216. return output;
  217. }
  218. var colorManipulator = {};
  219. var interopRequireDefault = { exports: {} };
  220. (function(module) {
  221. function _interopRequireDefault2(obj) {
  222. return obj && obj.__esModule ? obj : {
  223. "default": obj
  224. };
  225. }
  226. module.exports = _interopRequireDefault2, module.exports.__esModule = true, module.exports["default"] = module.exports;
  227. })(interopRequireDefault);
  228. var interopRequireDefaultExports = interopRequireDefault.exports;
  229. function formatMuiErrorMessage$1(code) {
  230. let url = "https://mui.com/production-error/?code=" + code;
  231. for (let i = 1; i < arguments.length; i += 1) {
  232. url += "&args[]=" + encodeURIComponent(arguments[i]);
  233. }
  234. return "Minified MUI error #" + code + "; visit " + url + " for the full message.";
  235. }
  236. const formatMuiErrorMessage = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  237. __proto__: null,
  238. default: formatMuiErrorMessage$1
  239. }, Symbol.toStringTag, { value: "Module" }));
  240. const require$$1$1 = /* @__PURE__ */ getAugmentedNamespace(formatMuiErrorMessage);
  241. function clamp$1(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
  242. return Math.max(min, Math.min(val, max));
  243. }
  244. const clamp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  245. __proto__: null,
  246. default: clamp$1
  247. }, Symbol.toStringTag, { value: "Module" }));
  248. const require$$2 = /* @__PURE__ */ getAugmentedNamespace(clamp);
  249. var _interopRequireDefault$1 = interopRequireDefaultExports;
  250. Object.defineProperty(colorManipulator, "__esModule", {
  251. value: true
  252. });
  253. var alpha_1 = colorManipulator.alpha = alpha;
  254. colorManipulator.blend = blend;
  255. colorManipulator.colorChannel = void 0;
  256. var darken_1 = colorManipulator.darken = darken;
  257. colorManipulator.decomposeColor = decomposeColor;
  258. colorManipulator.emphasize = emphasize;
  259. var getContrastRatio_1 = colorManipulator.getContrastRatio = getContrastRatio;
  260. colorManipulator.getLuminance = getLuminance;
  261. colorManipulator.hexToRgb = hexToRgb;
  262. colorManipulator.hslToRgb = hslToRgb;
  263. var lighten_1 = colorManipulator.lighten = lighten;
  264. colorManipulator.private_safeAlpha = private_safeAlpha;
  265. colorManipulator.private_safeColorChannel = void 0;
  266. colorManipulator.private_safeDarken = private_safeDarken;
  267. colorManipulator.private_safeEmphasize = private_safeEmphasize;
  268. colorManipulator.private_safeLighten = private_safeLighten;
  269. colorManipulator.recomposeColor = recomposeColor;
  270. colorManipulator.rgbToHex = rgbToHex;
  271. var _formatMuiErrorMessage2 = _interopRequireDefault$1(require$$1$1);
  272. var _clamp = _interopRequireDefault$1(require$$2);
  273. function clampWrapper(value, min = 0, max = 1) {
  274. return (0, _clamp.default)(value, min, max);
  275. }
  276. function hexToRgb(color2) {
  277. color2 = color2.slice(1);
  278. const re = new RegExp(`.{1,${color2.length >= 6 ? 2 : 1}}`, "g");
  279. let colors = color2.match(re);
  280. if (colors && colors[0].length === 1) {
  281. colors = colors.map((n2) => n2 + n2);
  282. }
  283. return colors ? `rgb${colors.length === 4 ? "a" : ""}(${colors.map((n2, index) => {
  284. return index < 3 ? parseInt(n2, 16) : Math.round(parseInt(n2, 16) / 255 * 1e3) / 1e3;
  285. }).join(", ")})` : "";
  286. }
  287. function intToHex(int) {
  288. const hex = int.toString(16);
  289. return hex.length === 1 ? `0${hex}` : hex;
  290. }
  291. function decomposeColor(color2) {
  292. if (color2.type) {
  293. return color2;
  294. }
  295. if (color2.charAt(0) === "#") {
  296. return decomposeColor(hexToRgb(color2));
  297. }
  298. const marker = color2.indexOf("(");
  299. const type = color2.substring(0, marker);
  300. if (["rgb", "rgba", "hsl", "hsla", "color"].indexOf(type) === -1) {
  301. throw new Error((0, _formatMuiErrorMessage2.default)(9, color2));
  302. }
  303. let values2 = color2.substring(marker + 1, color2.length - 1);
  304. let colorSpace;
  305. if (type === "color") {
  306. values2 = values2.split(" ");
  307. colorSpace = values2.shift();
  308. if (values2.length === 4 && values2[3].charAt(0) === "/") {
  309. values2[3] = values2[3].slice(1);
  310. }
  311. if (["srgb", "display-p3", "a98-rgb", "prophoto-rgb", "rec-2020"].indexOf(colorSpace) === -1) {
  312. throw new Error((0, _formatMuiErrorMessage2.default)(10, colorSpace));
  313. }
  314. } else {
  315. values2 = values2.split(",");
  316. }
  317. values2 = values2.map((value) => parseFloat(value));
  318. return {
  319. type,
  320. values: values2,
  321. colorSpace
  322. };
  323. }
  324. const colorChannel = (color2) => {
  325. const decomposedColor = decomposeColor(color2);
  326. return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf("hsl") !== -1 && idx !== 0 ? `${val}%` : val).join(" ");
  327. };
  328. colorManipulator.colorChannel = colorChannel;
  329. const private_safeColorChannel = (color2, warning) => {
  330. try {
  331. return colorChannel(color2);
  332. } catch (error) {
  333. if (warning && false) {
  334. console.warn(warning);
  335. }
  336. return color2;
  337. }
  338. };
  339. colorManipulator.private_safeColorChannel = private_safeColorChannel;
  340. function recomposeColor(color2) {
  341. const {
  342. type,
  343. colorSpace
  344. } = color2;
  345. let {
  346. values: values2
  347. } = color2;
  348. if (type.indexOf("rgb") !== -1) {
  349. values2 = values2.map((n2, i) => i < 3 ? parseInt(n2, 10) : n2);
  350. } else if (type.indexOf("hsl") !== -1) {
  351. values2[1] = `${values2[1]}%`;
  352. values2[2] = `${values2[2]}%`;
  353. }
  354. if (type.indexOf("color") !== -1) {
  355. values2 = `${colorSpace} ${values2.join(" ")}`;
  356. } else {
  357. values2 = `${values2.join(", ")}`;
  358. }
  359. return `${type}(${values2})`;
  360. }
  361. function rgbToHex(color2) {
  362. if (color2.indexOf("#") === 0) {
  363. return color2;
  364. }
  365. const {
  366. values: values2
  367. } = decomposeColor(color2);
  368. return `#${values2.map((n2, i) => intToHex(i === 3 ? Math.round(255 * n2) : n2)).join("")}`;
  369. }
  370. function hslToRgb(color2) {
  371. color2 = decomposeColor(color2);
  372. const {
  373. values: values2
  374. } = color2;
  375. const h2 = values2[0];
  376. const s = values2[1] / 100;
  377. const l2 = values2[2] / 100;
  378. const a = s * Math.min(l2, 1 - l2);
  379. const f2 = (n2, k2 = (n2 + h2 / 30) % 12) => l2 - a * Math.max(Math.min(k2 - 3, 9 - k2, 1), -1);
  380. let type = "rgb";
  381. const rgb = [Math.round(f2(0) * 255), Math.round(f2(8) * 255), Math.round(f2(4) * 255)];
  382. if (color2.type === "hsla") {
  383. type += "a";
  384. rgb.push(values2[3]);
  385. }
  386. return recomposeColor({
  387. type,
  388. values: rgb
  389. });
  390. }
  391. function getLuminance(color2) {
  392. color2 = decomposeColor(color2);
  393. let rgb = color2.type === "hsl" || color2.type === "hsla" ? decomposeColor(hslToRgb(color2)).values : color2.values;
  394. rgb = rgb.map((val) => {
  395. if (color2.type !== "color") {
  396. val /= 255;
  397. }
  398. return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;
  399. });
  400. return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
  401. }
  402. function getContrastRatio(foreground, background) {
  403. const lumA = getLuminance(foreground);
  404. const lumB = getLuminance(background);
  405. return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
  406. }
  407. function alpha(color2, value) {
  408. color2 = decomposeColor(color2);
  409. value = clampWrapper(value);
  410. if (color2.type === "rgb" || color2.type === "hsl") {
  411. color2.type += "a";
  412. }
  413. if (color2.type === "color") {
  414. color2.values[3] = `/${value}`;
  415. } else {
  416. color2.values[3] = value;
  417. }
  418. return recomposeColor(color2);
  419. }
  420. function private_safeAlpha(color2, value, warning) {
  421. try {
  422. return alpha(color2, value);
  423. } catch (error) {
  424. if (warning && false) {
  425. console.warn(warning);
  426. }
  427. return color2;
  428. }
  429. }
  430. function darken(color2, coefficient) {
  431. color2 = decomposeColor(color2);
  432. coefficient = clampWrapper(coefficient);
  433. if (color2.type.indexOf("hsl") !== -1) {
  434. color2.values[2] *= 1 - coefficient;
  435. } else if (color2.type.indexOf("rgb") !== -1 || color2.type.indexOf("color") !== -1) {
  436. for (let i = 0; i < 3; i += 1) {
  437. color2.values[i] *= 1 - coefficient;
  438. }
  439. }
  440. return recomposeColor(color2);
  441. }
  442. function private_safeDarken(color2, coefficient, warning) {
  443. try {
  444. return darken(color2, coefficient);
  445. } catch (error) {
  446. if (warning && false) {
  447. console.warn(warning);
  448. }
  449. return color2;
  450. }
  451. }
  452. function lighten(color2, coefficient) {
  453. color2 = decomposeColor(color2);
  454. coefficient = clampWrapper(coefficient);
  455. if (color2.type.indexOf("hsl") !== -1) {
  456. color2.values[2] += (100 - color2.values[2]) * coefficient;
  457. } else if (color2.type.indexOf("rgb") !== -1) {
  458. for (let i = 0; i < 3; i += 1) {
  459. color2.values[i] += (255 - color2.values[i]) * coefficient;
  460. }
  461. } else if (color2.type.indexOf("color") !== -1) {
  462. for (let i = 0; i < 3; i += 1) {
  463. color2.values[i] += (1 - color2.values[i]) * coefficient;
  464. }
  465. }
  466. return recomposeColor(color2);
  467. }
  468. function private_safeLighten(color2, coefficient, warning) {
  469. try {
  470. return lighten(color2, coefficient);
  471. } catch (error) {
  472. if (warning && false) {
  473. console.warn(warning);
  474. }
  475. return color2;
  476. }
  477. }
  478. function emphasize(color2, coefficient = 0.15) {
  479. return getLuminance(color2) > 0.5 ? darken(color2, coefficient) : lighten(color2, coefficient);
  480. }
  481. function private_safeEmphasize(color2, coefficient, warning) {
  482. try {
  483. return private_safeEmphasize(color2, coefficient);
  484. } catch (error) {
  485. if (warning && false) {
  486. console.warn(warning);
  487. }
  488. return color2;
  489. }
  490. }
  491. function blend(background, overlay, opacity, gamma = 1) {
  492. const blendChannel = (b2, o) => Math.round((b2 ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);
  493. const backgroundColor2 = decomposeColor(background);
  494. const overlayColor = decomposeColor(overlay);
  495. const rgb = [blendChannel(backgroundColor2.values[0], overlayColor.values[0]), blendChannel(backgroundColor2.values[1], overlayColor.values[1]), blendChannel(backgroundColor2.values[2], overlayColor.values[2])];
  496. return recomposeColor({
  497. type: "rgb",
  498. values: rgb
  499. });
  500. }
  501. var createStyled$2 = {};
  502. var _extends = { exports: {} };
  503. var hasRequired_extends;
  504. function require_extends() {
  505. if (hasRequired_extends)
  506. return _extends.exports;
  507. hasRequired_extends = 1;
  508. (function(module) {
  509. function _extends3() {
  510. module.exports = _extends3 = Object.assign ? Object.assign.bind() : function(target) {
  511. for (var i = 1; i < arguments.length; i++) {
  512. var source = arguments[i];
  513. for (var key in source) {
  514. if (Object.prototype.hasOwnProperty.call(source, key)) {
  515. target[key] = source[key];
  516. }
  517. }
  518. }
  519. return target;
  520. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  521. return _extends3.apply(this, arguments);
  522. }
  523. module.exports = _extends3, module.exports.__esModule = true, module.exports["default"] = module.exports;
  524. })(_extends);
  525. return _extends.exports;
  526. }
  527. var objectWithoutPropertiesLoose = { exports: {} };
  528. var hasRequiredObjectWithoutPropertiesLoose;
  529. function requireObjectWithoutPropertiesLoose() {
  530. if (hasRequiredObjectWithoutPropertiesLoose)
  531. return objectWithoutPropertiesLoose.exports;
  532. hasRequiredObjectWithoutPropertiesLoose = 1;
  533. (function(module) {
  534. function _objectWithoutPropertiesLoose3(source, excluded) {
  535. if (source == null)
  536. return {};
  537. var target = {};
  538. var sourceKeys = Object.keys(source);
  539. var key, i;
  540. for (i = 0; i < sourceKeys.length; i++) {
  541. key = sourceKeys[i];
  542. if (excluded.indexOf(key) >= 0)
  543. continue;
  544. target[key] = source[key];
  545. }
  546. return target;
  547. }
  548. module.exports = _objectWithoutPropertiesLoose3, module.exports.__esModule = true, module.exports["default"] = module.exports;
  549. })(objectWithoutPropertiesLoose);
  550. return objectWithoutPropertiesLoose.exports;
  551. }
  552. function memoize$1(fn) {
  553. var cache2 = /* @__PURE__ */ Object.create(null);
  554. return function(arg) {
  555. if (cache2[arg] === void 0)
  556. cache2[arg] = fn(arg);
  557. return cache2[arg];
  558. };
  559. }
  560. var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
  561. var isPropValid = /* @__PURE__ */ memoize$1(
  562. function(prop) {
  563. return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
  564. }
  565. /* Z+1 */
  566. );
  567. function sheetForTag(tag) {
  568. if (tag.sheet) {
  569. return tag.sheet;
  570. }
  571. for (var i = 0; i < document.styleSheets.length; i++) {
  572. if (document.styleSheets[i].ownerNode === tag) {
  573. return document.styleSheets[i];
  574. }
  575. }
  576. }
  577. function createStyleElement(options) {
  578. var tag = document.createElement("style");
  579. tag.setAttribute("data-emotion", options.key);
  580. if (options.nonce !== void 0) {
  581. tag.setAttribute("nonce", options.nonce);
  582. }
  583. tag.appendChild(document.createTextNode(""));
  584. tag.setAttribute("data-s", "");
  585. return tag;
  586. }
  587. var StyleSheet = /* @__PURE__ */ function() {
  588. function StyleSheet2(options) {
  589. var _this = this;
  590. this._insertTag = function(tag) {
  591. var before;
  592. if (_this.tags.length === 0) {
  593. if (_this.insertionPoint) {
  594. before = _this.insertionPoint.nextSibling;
  595. } else if (_this.prepend) {
  596. before = _this.container.firstChild;
  597. } else {
  598. before = _this.before;
  599. }
  600. } else {
  601. before = _this.tags[_this.tags.length - 1].nextSibling;
  602. }
  603. _this.container.insertBefore(tag, before);
  604. _this.tags.push(tag);
  605. };
  606. this.isSpeedy = options.speedy === void 0 ? true : options.speedy;
  607. this.tags = [];
  608. this.ctr = 0;
  609. this.nonce = options.nonce;
  610. this.key = options.key;
  611. this.container = options.container;
  612. this.prepend = options.prepend;
  613. this.insertionPoint = options.insertionPoint;
  614. this.before = null;
  615. }
  616. var _proto = StyleSheet2.prototype;
  617. _proto.hydrate = function hydrate(nodes) {
  618. nodes.forEach(this._insertTag);
  619. };
  620. _proto.insert = function insert(rule) {
  621. if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) {
  622. this._insertTag(createStyleElement(this));
  623. }
  624. var tag = this.tags[this.tags.length - 1];
  625. if (this.isSpeedy) {
  626. var sheet = sheetForTag(tag);
  627. try {
  628. sheet.insertRule(rule, sheet.cssRules.length);
  629. } catch (e2) {
  630. }
  631. } else {
  632. tag.appendChild(document.createTextNode(rule));
  633. }
  634. this.ctr++;
  635. };
  636. _proto.flush = function flush() {
  637. this.tags.forEach(function(tag) {
  638. return tag.parentNode && tag.parentNode.removeChild(tag);
  639. });
  640. this.tags = [];
  641. this.ctr = 0;
  642. };
  643. return StyleSheet2;
  644. }();
  645. var MS = "-ms-";
  646. var MOZ = "-moz-";
  647. var WEBKIT = "-webkit-";
  648. var COMMENT = "comm";
  649. var RULESET = "rule";
  650. var DECLARATION = "decl";
  651. var IMPORT = "@import";
  652. var KEYFRAMES = "@keyframes";
  653. var LAYER = "@layer";
  654. var abs = Math.abs;
  655. var from = String.fromCharCode;
  656. var assign = Object.assign;
  657. function hash(value, length2) {
  658. return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
  659. }
  660. function trim(value) {
  661. return value.trim();
  662. }
  663. function match(value, pattern) {
  664. return (value = pattern.exec(value)) ? value[0] : value;
  665. }
  666. function replace(value, pattern, replacement) {
  667. return value.replace(pattern, replacement);
  668. }
  669. function indexof(value, search) {
  670. return value.indexOf(search);
  671. }
  672. function charat(value, index) {
  673. return value.charCodeAt(index) | 0;
  674. }
  675. function substr(value, begin, end) {
  676. return value.slice(begin, end);
  677. }
  678. function strlen(value) {
  679. return value.length;
  680. }
  681. function sizeof(value) {
  682. return value.length;
  683. }
  684. function append(value, array) {
  685. return array.push(value), value;
  686. }
  687. function combine(array, callback) {
  688. return array.map(callback).join("");
  689. }
  690. var line = 1;
  691. var column = 1;
  692. var length = 0;
  693. var position = 0;
  694. var character = 0;
  695. var characters = "";
  696. function node(value, root2, parent, type, props, children, length2) {
  697. return { value, root: root2, parent, type, props, children, line, column, length: length2, return: "" };
  698. }
  699. function copy(root2, props) {
  700. return assign(node("", null, null, "", null, null, 0), root2, { length: -root2.length }, props);
  701. }
  702. function char() {
  703. return character;
  704. }
  705. function prev() {
  706. character = position > 0 ? charat(characters, --position) : 0;
  707. if (column--, character === 10)
  708. column = 1, line--;
  709. return character;
  710. }
  711. function next() {
  712. character = position < length ? charat(characters, position++) : 0;
  713. if (column++, character === 10)
  714. column = 1, line++;
  715. return character;
  716. }
  717. function peek() {
  718. return charat(characters, position);
  719. }
  720. function caret() {
  721. return position;
  722. }
  723. function slice(begin, end) {
  724. return substr(characters, begin, end);
  725. }
  726. function token(type) {
  727. switch (type) {
  728. case 0:
  729. case 9:
  730. case 10:
  731. case 13:
  732. case 32:
  733. return 5;
  734. case 33:
  735. case 43:
  736. case 44:
  737. case 47:
  738. case 62:
  739. case 64:
  740. case 126:
  741. case 59:
  742. case 123:
  743. case 125:
  744. return 4;
  745. case 58:
  746. return 3;
  747. case 34:
  748. case 39:
  749. case 40:
  750. case 91:
  751. return 2;
  752. case 41:
  753. case 93:
  754. return 1;
  755. }
  756. return 0;
  757. }
  758. function alloc(value) {
  759. return line = column = 1, length = strlen(characters = value), position = 0, [];
  760. }
  761. function dealloc(value) {
  762. return characters = "", value;
  763. }
  764. function delimit(type) {
  765. return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
  766. }
  767. function whitespace(type) {
  768. while (character = peek())
  769. if (character < 33)
  770. next();
  771. else
  772. break;
  773. return token(type) > 2 || token(character) > 3 ? "" : " ";
  774. }
  775. function escaping(index, count) {
  776. while (--count && next())
  777. if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
  778. break;
  779. return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
  780. }
  781. function delimiter(type) {
  782. while (next())
  783. switch (character) {
  784. case type:
  785. return position;
  786. case 34:
  787. case 39:
  788. if (type !== 34 && type !== 39)
  789. delimiter(character);
  790. break;
  791. case 40:
  792. if (type === 41)
  793. delimiter(type);
  794. break;
  795. case 92:
  796. next();
  797. break;
  798. }
  799. return position;
  800. }
  801. function commenter(type, index) {
  802. while (next())
  803. if (type + character === 47 + 10)
  804. break;
  805. else if (type + character === 42 + 42 && peek() === 47)
  806. break;
  807. return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
  808. }
  809. function identifier(index) {
  810. while (!token(peek()))
  811. next();
  812. return slice(index, position);
  813. }
  814. function compile(value) {
  815. return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
  816. }
  817. function parse(value, root2, parent, rule, rules, rulesets, pseudo, points, declarations) {
  818. var index = 0;
  819. var offset = 0;
  820. var length2 = pseudo;
  821. var atrule = 0;
  822. var property = 0;
  823. var previous = 0;
  824. var variable = 1;
  825. var scanning = 1;
  826. var ampersand = 1;
  827. var character2 = 0;
  828. var type = "";
  829. var props = rules;
  830. var children = rulesets;
  831. var reference = rule;
  832. var characters2 = type;
  833. while (scanning)
  834. switch (previous = character2, character2 = next()) {
  835. case 40:
  836. if (previous != 108 && charat(characters2, length2 - 1) == 58) {
  837. if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1)
  838. ampersand = -1;
  839. break;
  840. }
  841. case 34:
  842. case 39:
  843. case 91:
  844. characters2 += delimit(character2);
  845. break;
  846. case 9:
  847. case 10:
  848. case 13:
  849. case 32:
  850. characters2 += whitespace(previous);
  851. break;
  852. case 92:
  853. characters2 += escaping(caret() - 1, 7);
  854. continue;
  855. case 47:
  856. switch (peek()) {
  857. case 42:
  858. case 47:
  859. append(comment(commenter(next(), caret()), root2, parent), declarations);
  860. break;
  861. default:
  862. characters2 += "/";
  863. }
  864. break;
  865. case 123 * variable:
  866. points[index++] = strlen(characters2) * ampersand;
  867. case 125 * variable:
  868. case 59:
  869. case 0:
  870. switch (character2) {
  871. case 0:
  872. case 125:
  873. scanning = 0;
  874. case 59 + offset:
  875. if (ampersand == -1)
  876. characters2 = replace(characters2, /\f/g, "");
  877. if (property > 0 && strlen(characters2) - length2)
  878. append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations);
  879. break;
  880. case 59:
  881. characters2 += ";";
  882. default:
  883. append(reference = ruleset(characters2, root2, parent, index, offset, rules, points, type, props = [], children = [], length2), rulesets);
  884. if (character2 === 123)
  885. if (offset === 0)
  886. parse(characters2, root2, reference, reference, props, rulesets, length2, points, children);
  887. else
  888. switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
  889. case 100:
  890. case 108:
  891. case 109:
  892. case 115:
  893. parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length2), children), rules, children, length2, points, rule ? props : children);
  894. break;
  895. default:
  896. parse(characters2, reference, reference, reference, [""], children, 0, points, children);
  897. }
  898. }
  899. index = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
  900. break;
  901. case 58:
  902. length2 = 1 + strlen(characters2), property = previous;
  903. default:
  904. if (variable < 1) {
  905. if (character2 == 123)
  906. --variable;
  907. else if (character2 == 125 && variable++ == 0 && prev() == 125)
  908. continue;
  909. }
  910. switch (characters2 += from(character2), character2 * variable) {
  911. case 38:
  912. ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
  913. break;
  914. case 44:
  915. points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
  916. break;
  917. case 64:
  918. if (peek() === 45)
  919. characters2 += delimit(next());
  920. atrule = peek(), offset = length2 = strlen(type = characters2 += identifier(caret())), character2++;
  921. break;
  922. case 45:
  923. if (previous === 45 && strlen(characters2) == 2)
  924. variable = 0;
  925. }
  926. }
  927. return rulesets;
  928. }
  929. function ruleset(value, root2, parent, index, offset, rules, points, type, props, children, length2) {
  930. var post = offset - 1;
  931. var rule = offset === 0 ? rules : [""];
  932. var size = sizeof(rule);
  933. for (var i = 0, j = 0, k2 = 0; i < index; ++i)
  934. for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j = points[i])), z2 = value; x2 < size; ++x2)
  935. if (z2 = trim(j > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2])))
  936. props[k2++] = z2;
  937. return node(value, root2, parent, offset === 0 ? RULESET : type, props, children, length2);
  938. }
  939. function comment(value, root2, parent) {
  940. return node(value, root2, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
  941. }
  942. function declaration(value, root2, parent, length2) {
  943. return node(value, root2, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2);
  944. }
  945. function serialize(children, callback) {
  946. var output = "";
  947. var length2 = sizeof(children);
  948. for (var i = 0; i < length2; i++)
  949. output += callback(children[i], i, children, callback) || "";
  950. return output;
  951. }
  952. function stringify(element, index, children, callback) {
  953. switch (element.type) {
  954. case LAYER:
  955. if (element.children.length)
  956. break;
  957. case IMPORT:
  958. case DECLARATION:
  959. return element.return = element.return || element.value;
  960. case COMMENT:
  961. return "";
  962. case KEYFRAMES:
  963. return element.return = element.value + "{" + serialize(element.children, callback) + "}";
  964. case RULESET:
  965. element.value = element.props.join(",");
  966. }
  967. return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
  968. }
  969. function middleware(collection) {
  970. var length2 = sizeof(collection);
  971. return function(element, index, children, callback) {
  972. var output = "";
  973. for (var i = 0; i < length2; i++)
  974. output += collection[i](element, index, children, callback) || "";
  975. return output;
  976. };
  977. }
  978. function rulesheet(callback) {
  979. return function(element) {
  980. if (!element.root) {
  981. if (element = element.return)
  982. callback(element);
  983. }
  984. };
  985. }
  986. var identifierWithPointTracking = function identifierWithPointTracking2(begin, points, index) {
  987. var previous = 0;
  988. var character2 = 0;
  989. while (true) {
  990. previous = character2;
  991. character2 = peek();
  992. if (previous === 38 && character2 === 12) {
  993. points[index] = 1;
  994. }
  995. if (token(character2)) {
  996. break;
  997. }
  998. next();
  999. }
  1000. return slice(begin, position);
  1001. };
  1002. var toRules = function toRules2(parsed, points) {
  1003. var index = -1;
  1004. var character2 = 44;
  1005. do {
  1006. switch (token(character2)) {
  1007. case 0:
  1008. if (character2 === 38 && peek() === 12) {
  1009. points[index] = 1;
  1010. }
  1011. parsed[index] += identifierWithPointTracking(position - 1, points, index);
  1012. break;
  1013. case 2:
  1014. parsed[index] += delimit(character2);
  1015. break;
  1016. case 4:
  1017. if (character2 === 44) {
  1018. parsed[++index] = peek() === 58 ? "&\f" : "";
  1019. points[index] = parsed[index].length;
  1020. break;
  1021. }
  1022. default:
  1023. parsed[index] += from(character2);
  1024. }
  1025. } while (character2 = next());
  1026. return parsed;
  1027. };
  1028. var getRules = function getRules2(value, points) {
  1029. return dealloc(toRules(alloc(value), points));
  1030. };
  1031. var fixedElements = /* @__PURE__ */ new WeakMap();
  1032. var compat = function compat2(element) {
  1033. if (element.type !== "rule" || !element.parent || // positive .length indicates that this rule contains pseudo
  1034. // negative .length indicates that this rule has been already prefixed
  1035. element.length < 1) {
  1036. return;
  1037. }
  1038. var value = element.value, parent = element.parent;
  1039. var isImplicitRule = element.column === parent.column && element.line === parent.line;
  1040. while (parent.type !== "rule") {
  1041. parent = parent.parent;
  1042. if (!parent)
  1043. return;
  1044. }
  1045. if (element.props.length === 1 && value.charCodeAt(0) !== 58 && !fixedElements.get(parent)) {
  1046. return;
  1047. }
  1048. if (isImplicitRule) {
  1049. return;
  1050. }
  1051. fixedElements.set(element, true);
  1052. var points = [];
  1053. var rules = getRules(value, points);
  1054. var parentRules = parent.props;
  1055. for (var i = 0, k2 = 0; i < rules.length; i++) {
  1056. for (var j = 0; j < parentRules.length; j++, k2++) {
  1057. element.props[k2] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
  1058. }
  1059. }
  1060. };
  1061. var removeLabel = function removeLabel2(element) {
  1062. if (element.type === "decl") {
  1063. var value = element.value;
  1064. if (
  1065. // charcode for l
  1066. value.charCodeAt(0) === 108 && // charcode for b
  1067. value.charCodeAt(2) === 98
  1068. ) {
  1069. element["return"] = "";
  1070. element.value = "";
  1071. }
  1072. }
  1073. };
  1074. function prefix(value, length2) {
  1075. switch (hash(value, length2)) {
  1076. case 5103:
  1077. return WEBKIT + "print-" + value + value;
  1078. case 5737:
  1079. case 4201:
  1080. case 3177:
  1081. case 3433:
  1082. case 1641:
  1083. case 4457:
  1084. case 2921:
  1085. case 5572:
  1086. case 6356:
  1087. case 5844:
  1088. case 3191:
  1089. case 6645:
  1090. case 3005:
  1091. case 6391:
  1092. case 5879:
  1093. case 5623:
  1094. case 6135:
  1095. case 4599:
  1096. case 4855:
  1097. case 4215:
  1098. case 6389:
  1099. case 5109:
  1100. case 5365:
  1101. case 5621:
  1102. case 3829:
  1103. return WEBKIT + value + value;
  1104. case 5349:
  1105. case 4246:
  1106. case 4810:
  1107. case 6968:
  1108. case 2756:
  1109. return WEBKIT + value + MOZ + value + MS + value + value;
  1110. case 6828:
  1111. case 4268:
  1112. return WEBKIT + value + MS + value + value;
  1113. case 6165:
  1114. return WEBKIT + value + MS + "flex-" + value + value;
  1115. case 5187:
  1116. return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
  1117. case 5443:
  1118. return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/, "") + value;
  1119. case 4675:
  1120. return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/, "") + value;
  1121. case 5548:
  1122. return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
  1123. case 5292:
  1124. return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
  1125. case 6060:
  1126. return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
  1127. case 4554:
  1128. return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
  1129. case 6187:
  1130. return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
  1131. case 5495:
  1132. case 3959:
  1133. return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
  1134. case 4968:
  1135. return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
  1136. case 4095:
  1137. case 3583:
  1138. case 4068:
  1139. case 2532:
  1140. return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
  1141. case 8116:
  1142. case 7059:
  1143. case 5753:
  1144. case 5535:
  1145. case 5445:
  1146. case 5701:
  1147. case 4933:
  1148. case 4677:
  1149. case 5533:
  1150. case 5789:
  1151. case 5021:
  1152. case 4765:
  1153. if (strlen(value) - 1 - length2 > 6)
  1154. switch (charat(value, length2 + 1)) {
  1155. case 109:
  1156. if (charat(value, length2 + 4) !== 45)
  1157. break;
  1158. case 102:
  1159. return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
  1160. case 115:
  1161. return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length2) + value : value;
  1162. }
  1163. break;
  1164. case 4949:
  1165. if (charat(value, length2 + 1) !== 115)
  1166. break;
  1167. case 6444:
  1168. switch (charat(value, strlen(value) - 3 - (~indexof(value, "!important") && 10))) {
  1169. case 107:
  1170. return replace(value, ":", ":" + WEBKIT) + value;
  1171. case 101:
  1172. return replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
  1173. }
  1174. break;
  1175. case 5936:
  1176. switch (charat(value, length2 + 11)) {
  1177. case 114:
  1178. return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
  1179. case 108:
  1180. return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
  1181. case 45:
  1182. return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
  1183. }
  1184. return WEBKIT + value + MS + value + value;
  1185. }
  1186. return value;
  1187. }
  1188. var prefixer = function prefixer2(element, index, children, callback) {
  1189. if (element.length > -1) {
  1190. if (!element["return"])
  1191. switch (element.type) {
  1192. case DECLARATION:
  1193. element["return"] = prefix(element.value, element.length);
  1194. break;
  1195. case KEYFRAMES:
  1196. return serialize([copy(element, {
  1197. value: replace(element.value, "@", "@" + WEBKIT)
  1198. })], callback);
  1199. case RULESET:
  1200. if (element.length)
  1201. return combine(element.props, function(value) {
  1202. switch (match(value, /(::plac\w+|:read-\w+)/)) {
  1203. case ":read-only":
  1204. case ":read-write":
  1205. return serialize([copy(element, {
  1206. props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")]
  1207. })], callback);
  1208. case "::placeholder":
  1209. return serialize([copy(element, {
  1210. props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")]
  1211. }), copy(element, {
  1212. props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")]
  1213. }), copy(element, {
  1214. props: [replace(value, /:(plac\w+)/, MS + "input-$1")]
  1215. })], callback);
  1216. }
  1217. return "";
  1218. });
  1219. }
  1220. }
  1221. };
  1222. var defaultStylisPlugins = [prefixer];
  1223. var createCache = function createCache2(options) {
  1224. var key = options.key;
  1225. if (key === "css") {
  1226. var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
  1227. Array.prototype.forEach.call(ssrStyles, function(node2) {
  1228. var dataEmotionAttribute = node2.getAttribute("data-emotion");
  1229. if (dataEmotionAttribute.indexOf(" ") === -1) {
  1230. return;
  1231. }
  1232. document.head.appendChild(node2);
  1233. node2.setAttribute("data-s", "");
  1234. });
  1235. }
  1236. var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
  1237. var inserted = {};
  1238. var container;
  1239. var nodesToHydrate = [];
  1240. {
  1241. container = options.container || document.head;
  1242. Array.prototype.forEach.call(
  1243. // this means we will ignore elements which don't have a space in them which
  1244. // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
  1245. document.querySelectorAll('style[data-emotion^="' + key + ' "]'),
  1246. function(node2) {
  1247. var attrib = node2.getAttribute("data-emotion").split(" ");
  1248. for (var i = 1; i < attrib.length; i++) {
  1249. inserted[attrib[i]] = true;
  1250. }
  1251. nodesToHydrate.push(node2);
  1252. }
  1253. );
  1254. }
  1255. var _insert;
  1256. var omnipresentPlugins = [compat, removeLabel];
  1257. {
  1258. var currentSheet;
  1259. var finalizingPlugins = [stringify, rulesheet(function(rule) {
  1260. currentSheet.insert(rule);
  1261. })];
  1262. var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
  1263. var stylis = function stylis2(styles2) {
  1264. return serialize(compile(styles2), serializer);
  1265. };
  1266. _insert = function insert(selector, serialized, sheet, shouldCache) {
  1267. currentSheet = sheet;
  1268. stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
  1269. if (shouldCache) {
  1270. cache2.inserted[serialized.name] = true;
  1271. }
  1272. };
  1273. }
  1274. var cache2 = {
  1275. key,
  1276. sheet: new StyleSheet({
  1277. key,
  1278. container,
  1279. nonce: options.nonce,
  1280. speedy: options.speedy,
  1281. prepend: options.prepend,
  1282. insertionPoint: options.insertionPoint
  1283. }),
  1284. nonce: options.nonce,
  1285. inserted,
  1286. registered: {},
  1287. insert: _insert
  1288. };
  1289. cache2.sheet.hydrate(nodesToHydrate);
  1290. return cache2;
  1291. };
  1292. var reactIs$2 = { exports: {} };
  1293. var reactIs_production_min$1 = {};
  1294. /** @license React v16.13.1
  1295. * react-is.production.min.js
  1296. *
  1297. * Copyright (c) Facebook, Inc. and its affiliates.
  1298. *
  1299. * This source code is licensed under the MIT license found in the
  1300. * LICENSE file in the root directory of this source tree.
  1301. */
  1302. var b$1 = "function" === typeof Symbol && Symbol.for, c$1 = b$1 ? Symbol.for("react.element") : 60103, d$1 = b$1 ? Symbol.for("react.portal") : 60106, e$1 = b$1 ? Symbol.for("react.fragment") : 60107, f$1 = 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$1 = 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$1 = b$1 ? Symbol.for("react.suspense_list") : 60120, r = 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 = b$1 ? Symbol.for("react.fundamental") : 60117, x = b$1 ? Symbol.for("react.responder") : 60118, y = b$1 ? Symbol.for("react.scope") : 60119;
  1303. function z(a) {
  1304. if ("object" === typeof a && null !== a) {
  1305. var u2 = a.$$typeof;
  1306. switch (u2) {
  1307. case c$1:
  1308. switch (a = a.type, a) {
  1309. case l$1:
  1310. case m$1:
  1311. case e$1:
  1312. case g$1:
  1313. case f$1:
  1314. case p$1:
  1315. return a;
  1316. default:
  1317. switch (a = a && a.$$typeof, a) {
  1318. case k$1:
  1319. case n$1:
  1320. case t$1:
  1321. case r:
  1322. case h$1:
  1323. return a;
  1324. default:
  1325. return u2;
  1326. }
  1327. }
  1328. case d$1:
  1329. return u2;
  1330. }
  1331. }
  1332. }
  1333. function A(a) {
  1334. return z(a) === m$1;
  1335. }
  1336. reactIs_production_min$1.AsyncMode = l$1;
  1337. reactIs_production_min$1.ConcurrentMode = m$1;
  1338. reactIs_production_min$1.ContextConsumer = k$1;
  1339. reactIs_production_min$1.ContextProvider = h$1;
  1340. reactIs_production_min$1.Element = c$1;
  1341. reactIs_production_min$1.ForwardRef = n$1;
  1342. reactIs_production_min$1.Fragment = e$1;
  1343. reactIs_production_min$1.Lazy = t$1;
  1344. reactIs_production_min$1.Memo = r;
  1345. reactIs_production_min$1.Portal = d$1;
  1346. reactIs_production_min$1.Profiler = g$1;
  1347. reactIs_production_min$1.StrictMode = f$1;
  1348. reactIs_production_min$1.Suspense = p$1;
  1349. reactIs_production_min$1.isAsyncMode = function(a) {
  1350. return A(a) || z(a) === l$1;
  1351. };
  1352. reactIs_production_min$1.isConcurrentMode = A;
  1353. reactIs_production_min$1.isContextConsumer = function(a) {
  1354. return z(a) === k$1;
  1355. };
  1356. reactIs_production_min$1.isContextProvider = function(a) {
  1357. return z(a) === h$1;
  1358. };
  1359. reactIs_production_min$1.isElement = function(a) {
  1360. return "object" === typeof a && null !== a && a.$$typeof === c$1;
  1361. };
  1362. reactIs_production_min$1.isForwardRef = function(a) {
  1363. return z(a) === n$1;
  1364. };
  1365. reactIs_production_min$1.isFragment = function(a) {
  1366. return z(a) === e$1;
  1367. };
  1368. reactIs_production_min$1.isLazy = function(a) {
  1369. return z(a) === t$1;
  1370. };
  1371. reactIs_production_min$1.isMemo = function(a) {
  1372. return z(a) === r;
  1373. };
  1374. reactIs_production_min$1.isPortal = function(a) {
  1375. return z(a) === d$1;
  1376. };
  1377. reactIs_production_min$1.isProfiler = function(a) {
  1378. return z(a) === g$1;
  1379. };
  1380. reactIs_production_min$1.isStrictMode = function(a) {
  1381. return z(a) === f$1;
  1382. };
  1383. reactIs_production_min$1.isSuspense = function(a) {
  1384. return z(a) === p$1;
  1385. };
  1386. reactIs_production_min$1.isValidElementType = function(a) {
  1387. return "string" === typeof a || "function" === typeof a || a === e$1 || a === m$1 || a === g$1 || a === f$1 || a === p$1 || a === q$1 || "object" === typeof a && null !== a && (a.$$typeof === t$1 || a.$$typeof === r || a.$$typeof === h$1 || a.$$typeof === k$1 || a.$$typeof === n$1 || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v$1);
  1388. };
  1389. reactIs_production_min$1.typeOf = z;
  1390. {
  1391. reactIs$2.exports = reactIs_production_min$1;
  1392. }
  1393. var reactIsExports$1 = reactIs$2.exports;
  1394. var reactIs$1 = reactIsExports$1;
  1395. var FORWARD_REF_STATICS = {
  1396. "$$typeof": true,
  1397. render: true,
  1398. defaultProps: true,
  1399. displayName: true,
  1400. propTypes: true
  1401. };
  1402. var MEMO_STATICS = {
  1403. "$$typeof": true,
  1404. compare: true,
  1405. defaultProps: true,
  1406. displayName: true,
  1407. propTypes: true,
  1408. type: true
  1409. };
  1410. var TYPE_STATICS = {};
  1411. TYPE_STATICS[reactIs$1.ForwardRef] = FORWARD_REF_STATICS;
  1412. TYPE_STATICS[reactIs$1.Memo] = MEMO_STATICS;
  1413. var isBrowser = true;
  1414. function getRegisteredStyles(registered, registeredStyles, classNames) {
  1415. var rawClassName = "";
  1416. classNames.split(" ").forEach(function(className) {
  1417. if (registered[className] !== void 0) {
  1418. registeredStyles.push(registered[className] + ";");
  1419. } else {
  1420. rawClassName += className + " ";
  1421. }
  1422. });
  1423. return rawClassName;
  1424. }
  1425. var registerStyles = function registerStyles2(cache2, serialized, isStringTag2) {
  1426. var className = cache2.key + "-" + serialized.name;
  1427. if (
  1428. // we only need to add the styles to the registered cache if the
  1429. // class name could be used further down
  1430. // the tree but if it's a string tag, we know it won't
  1431. // so we don't have to add it to registered cache.
  1432. // this improves memory usage since we can avoid storing the whole style string
  1433. (isStringTag2 === false || // we need to always store it if we're in compat mode and
  1434. // in node since emotion-server relies on whether a style is in
  1435. // the registered cache to know whether a style is global or not
  1436. // also, note that this check will be dead code eliminated in the browser
  1437. isBrowser === false) && cache2.registered[className] === void 0
  1438. ) {
  1439. cache2.registered[className] = serialized.styles;
  1440. }
  1441. };
  1442. var insertStyles = function insertStyles2(cache2, serialized, isStringTag2) {
  1443. registerStyles(cache2, serialized, isStringTag2);
  1444. var className = cache2.key + "-" + serialized.name;
  1445. if (cache2.inserted[serialized.name] === void 0) {
  1446. var current = serialized;
  1447. do {
  1448. cache2.insert(serialized === current ? "." + className : "", current, cache2.sheet, true);
  1449. current = current.next;
  1450. } while (current !== void 0);
  1451. }
  1452. };
  1453. function murmur2(str) {
  1454. var h2 = 0;
  1455. var k2, i = 0, len = str.length;
  1456. for (; len >= 4; ++i, len -= 4) {
  1457. k2 = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
  1458. k2 = /* Math.imul(k, m): */
  1459. (k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16);
  1460. k2 ^= /* k >>> r: */
  1461. k2 >>> 24;
  1462. h2 = /* Math.imul(k, m): */
  1463. (k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
  1464. (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
  1465. }
  1466. switch (len) {
  1467. case 3:
  1468. h2 ^= (str.charCodeAt(i + 2) & 255) << 16;
  1469. case 2:
  1470. h2 ^= (str.charCodeAt(i + 1) & 255) << 8;
  1471. case 1:
  1472. h2 ^= str.charCodeAt(i) & 255;
  1473. h2 = /* Math.imul(h, m): */
  1474. (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
  1475. }
  1476. h2 ^= h2 >>> 13;
  1477. h2 = /* Math.imul(h, m): */
  1478. (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
  1479. return ((h2 ^ h2 >>> 15) >>> 0).toString(36);
  1480. }
  1481. var unitlessKeys = {
  1482. animationIterationCount: 1,
  1483. aspectRatio: 1,
  1484. borderImageOutset: 1,
  1485. borderImageSlice: 1,
  1486. borderImageWidth: 1,
  1487. boxFlex: 1,
  1488. boxFlexGroup: 1,
  1489. boxOrdinalGroup: 1,
  1490. columnCount: 1,
  1491. columns: 1,
  1492. flex: 1,
  1493. flexGrow: 1,
  1494. flexPositive: 1,
  1495. flexShrink: 1,
  1496. flexNegative: 1,
  1497. flexOrder: 1,
  1498. gridRow: 1,
  1499. gridRowEnd: 1,
  1500. gridRowSpan: 1,
  1501. gridRowStart: 1,
  1502. gridColumn: 1,
  1503. gridColumnEnd: 1,
  1504. gridColumnSpan: 1,
  1505. gridColumnStart: 1,
  1506. msGridRow: 1,
  1507. msGridRowSpan: 1,
  1508. msGridColumn: 1,
  1509. msGridColumnSpan: 1,
  1510. fontWeight: 1,
  1511. lineHeight: 1,
  1512. opacity: 1,
  1513. order: 1,
  1514. orphans: 1,
  1515. tabSize: 1,
  1516. widows: 1,
  1517. zIndex: 1,
  1518. zoom: 1,
  1519. WebkitLineClamp: 1,
  1520. // SVG-related properties
  1521. fillOpacity: 1,
  1522. floodOpacity: 1,
  1523. stopOpacity: 1,
  1524. strokeDasharray: 1,
  1525. strokeDashoffset: 1,
  1526. strokeMiterlimit: 1,
  1527. strokeOpacity: 1,
  1528. strokeWidth: 1
  1529. };
  1530. var hyphenateRegex = /[A-Z]|^ms/g;
  1531. var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
  1532. var isCustomProperty = function isCustomProperty2(property) {
  1533. return property.charCodeAt(1) === 45;
  1534. };
  1535. var isProcessableValue = function isProcessableValue2(value) {
  1536. return value != null && typeof value !== "boolean";
  1537. };
  1538. var processStyleName = /* @__PURE__ */ memoize$1(function(styleName) {
  1539. return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
  1540. });
  1541. var processStyleValue = function processStyleValue2(key, value) {
  1542. switch (key) {
  1543. case "animation":
  1544. case "animationName": {
  1545. if (typeof value === "string") {
  1546. return value.replace(animationRegex, function(match2, p1, p2) {
  1547. cursor = {
  1548. name: p1,
  1549. styles: p2,
  1550. next: cursor
  1551. };
  1552. return p1;
  1553. });
  1554. }
  1555. }
  1556. }
  1557. if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
  1558. return value + "px";
  1559. }
  1560. return value;
  1561. };
  1562. var noComponentSelectorMessage = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";
  1563. function handleInterpolation(mergedProps, registered, interpolation) {
  1564. if (interpolation == null) {
  1565. return "";
  1566. }
  1567. if (interpolation.__emotion_styles !== void 0) {
  1568. return interpolation;
  1569. }
  1570. switch (typeof interpolation) {
  1571. case "boolean": {
  1572. return "";
  1573. }
  1574. case "object": {
  1575. if (interpolation.anim === 1) {
  1576. cursor = {
  1577. name: interpolation.name,
  1578. styles: interpolation.styles,
  1579. next: cursor
  1580. };
  1581. return interpolation.name;
  1582. }
  1583. if (interpolation.styles !== void 0) {
  1584. var next2 = interpolation.next;
  1585. if (next2 !== void 0) {
  1586. while (next2 !== void 0) {
  1587. cursor = {
  1588. name: next2.name,
  1589. styles: next2.styles,
  1590. next: cursor
  1591. };
  1592. next2 = next2.next;
  1593. }
  1594. }
  1595. var styles2 = interpolation.styles + ";";
  1596. return styles2;
  1597. }
  1598. return createStringFromObject(mergedProps, registered, interpolation);
  1599. }
  1600. case "function": {
  1601. if (mergedProps !== void 0) {
  1602. var previousCursor = cursor;
  1603. var result = interpolation(mergedProps);
  1604. cursor = previousCursor;
  1605. return handleInterpolation(mergedProps, registered, result);
  1606. }
  1607. break;
  1608. }
  1609. }
  1610. if (registered == null) {
  1611. return interpolation;
  1612. }
  1613. var cached = registered[interpolation];
  1614. return cached !== void 0 ? cached : interpolation;
  1615. }
  1616. function createStringFromObject(mergedProps, registered, obj) {
  1617. var string = "";
  1618. if (Array.isArray(obj)) {
  1619. for (var i = 0; i < obj.length; i++) {
  1620. string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
  1621. }
  1622. } else {
  1623. for (var _key in obj) {
  1624. var value = obj[_key];
  1625. if (typeof value !== "object") {
  1626. if (registered != null && registered[value] !== void 0) {
  1627. string += _key + "{" + registered[value] + "}";
  1628. } else if (isProcessableValue(value)) {
  1629. string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
  1630. }
  1631. } else {
  1632. if (_key === "NO_COMPONENT_SELECTOR" && false) {
  1633. throw new Error(noComponentSelectorMessage);
  1634. }
  1635. if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
  1636. for (var _i = 0; _i < value.length; _i++) {
  1637. if (isProcessableValue(value[_i])) {
  1638. string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
  1639. }
  1640. }
  1641. } else {
  1642. var interpolated = handleInterpolation(mergedProps, registered, value);
  1643. switch (_key) {
  1644. case "animation":
  1645. case "animationName": {
  1646. string += processStyleName(_key) + ":" + interpolated + ";";
  1647. break;
  1648. }
  1649. default: {
  1650. string += _key + "{" + interpolated + "}";
  1651. }
  1652. }
  1653. }
  1654. }
  1655. }
  1656. }
  1657. return string;
  1658. }
  1659. var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
  1660. var cursor;
  1661. var serializeStyles = function serializeStyles2(args, registered, mergedProps) {
  1662. if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
  1663. return args[0];
  1664. }
  1665. var stringMode = true;
  1666. var styles2 = "";
  1667. cursor = void 0;
  1668. var strings = args[0];
  1669. if (strings == null || strings.raw === void 0) {
  1670. stringMode = false;
  1671. styles2 += handleInterpolation(mergedProps, registered, strings);
  1672. } else {
  1673. styles2 += strings[0];
  1674. }
  1675. for (var i = 1; i < args.length; i++) {
  1676. styles2 += handleInterpolation(mergedProps, registered, args[i]);
  1677. if (stringMode) {
  1678. styles2 += strings[i];
  1679. }
  1680. }
  1681. labelPattern.lastIndex = 0;
  1682. var identifierName = "";
  1683. var match2;
  1684. while ((match2 = labelPattern.exec(styles2)) !== null) {
  1685. identifierName += "-" + // $FlowFixMe we know it's not null
  1686. match2[1];
  1687. }
  1688. var name = murmur2(styles2) + identifierName;
  1689. return {
  1690. name,
  1691. styles: styles2,
  1692. next: cursor
  1693. };
  1694. };
  1695. var syncFallback = function syncFallback2(create) {
  1696. return create();
  1697. };
  1698. var useInsertionEffect = React__namespace["useInsertionEffect"] ? React__namespace["useInsertionEffect"] : false;
  1699. var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
  1700. var useInsertionEffectWithLayoutFallback = useInsertionEffect || React__namespace.useLayoutEffect;
  1701. var EmotionCacheContext = /* @__PURE__ */ React__namespace.createContext(
  1702. // we're doing this to avoid preconstruct's dead code elimination in this one case
  1703. // because this module is primarily intended for the browser and node
  1704. // but it's also required in react native and similar environments sometimes
  1705. // and we could have a special build just for that
  1706. // but this is much easier and the native packages
  1707. // might use a different theme context in the future anyway
  1708. typeof HTMLElement !== "undefined" ? /* @__PURE__ */ createCache({
  1709. key: "css"
  1710. }) : null
  1711. );
  1712. var CacheProvider = EmotionCacheContext.Provider;
  1713. var withEmotionCache = function withEmotionCache2(func) {
  1714. return /* @__PURE__ */ React.forwardRef(function(props, ref) {
  1715. var cache2 = React.useContext(EmotionCacheContext);
  1716. return func(props, cache2, ref);
  1717. });
  1718. };
  1719. var ThemeContext$2 = /* @__PURE__ */ React__namespace.createContext({});
  1720. var Global = /* @__PURE__ */ withEmotionCache(function(props, cache2) {
  1721. var styles2 = props.styles;
  1722. var serialized = serializeStyles([styles2], void 0, React__namespace.useContext(ThemeContext$2));
  1723. var sheetRef = React__namespace.useRef();
  1724. useInsertionEffectWithLayoutFallback(function() {
  1725. var key = cache2.key + "-global";
  1726. var sheet = new cache2.sheet.constructor({
  1727. key,
  1728. nonce: cache2.sheet.nonce,
  1729. container: cache2.sheet.container,
  1730. speedy: cache2.sheet.isSpeedy
  1731. });
  1732. var rehydrating = false;
  1733. var node2 = document.querySelector('style[data-emotion="' + key + " " + serialized.name + '"]');
  1734. if (cache2.sheet.tags.length) {
  1735. sheet.before = cache2.sheet.tags[0];
  1736. }
  1737. if (node2 !== null) {
  1738. rehydrating = true;
  1739. node2.setAttribute("data-emotion", key);
  1740. sheet.hydrate([node2]);
  1741. }
  1742. sheetRef.current = [sheet, rehydrating];
  1743. return function() {
  1744. sheet.flush();
  1745. };
  1746. }, [cache2]);
  1747. useInsertionEffectWithLayoutFallback(function() {
  1748. var sheetRefCurrent = sheetRef.current;
  1749. var sheet = sheetRefCurrent[0], rehydrating = sheetRefCurrent[1];
  1750. if (rehydrating) {
  1751. sheetRefCurrent[1] = false;
  1752. return;
  1753. }
  1754. if (serialized.next !== void 0) {
  1755. insertStyles(cache2, serialized.next, true);
  1756. }
  1757. if (sheet.tags.length) {
  1758. var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
  1759. sheet.before = element;
  1760. sheet.flush();
  1761. }
  1762. cache2.insert("", serialized, sheet, false);
  1763. }, [cache2, serialized.name]);
  1764. return null;
  1765. });
  1766. function css() {
  1767. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1768. args[_key] = arguments[_key];
  1769. }
  1770. return serializeStyles(args);
  1771. }
  1772. var keyframes = function keyframes2() {
  1773. var insertable = css.apply(void 0, arguments);
  1774. var name = "animation-" + insertable.name;
  1775. return {
  1776. name,
  1777. styles: "@keyframes " + name + "{" + insertable.styles + "}",
  1778. anim: 1,
  1779. toString: function toString() {
  1780. return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
  1781. }
  1782. };
  1783. };
  1784. var testOmitPropsOnStringTag = isPropValid;
  1785. var testOmitPropsOnComponent = function testOmitPropsOnComponent2(key) {
  1786. return key !== "theme";
  1787. };
  1788. var getDefaultShouldForwardProp = function getDefaultShouldForwardProp2(tag) {
  1789. return typeof tag === "string" && // 96 is one less than the char code
  1790. // for "a" so this is checking that
  1791. // it's a lowercase character
  1792. tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
  1793. };
  1794. var composeShouldForwardProps = function composeShouldForwardProps2(tag, options, isReal) {
  1795. var shouldForwardProp2;
  1796. if (options) {
  1797. var optionsShouldForwardProp = options.shouldForwardProp;
  1798. shouldForwardProp2 = tag.__emotion_forwardProp && optionsShouldForwardProp ? function(propName) {
  1799. return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
  1800. } : optionsShouldForwardProp;
  1801. }
  1802. if (typeof shouldForwardProp2 !== "function" && isReal) {
  1803. shouldForwardProp2 = tag.__emotion_forwardProp;
  1804. }
  1805. return shouldForwardProp2;
  1806. };
  1807. var Insertion = function Insertion2(_ref) {
  1808. var cache2 = _ref.cache, serialized = _ref.serialized, isStringTag2 = _ref.isStringTag;
  1809. registerStyles(cache2, serialized, isStringTag2);
  1810. useInsertionEffectAlwaysWithSyncFallback(function() {
  1811. return insertStyles(cache2, serialized, isStringTag2);
  1812. });
  1813. return null;
  1814. };
  1815. var createStyled$1 = function createStyled2(tag, options) {
  1816. var isReal = tag.__emotion_real === tag;
  1817. var baseTag = isReal && tag.__emotion_base || tag;
  1818. var identifierName;
  1819. var targetClassName;
  1820. if (options !== void 0) {
  1821. identifierName = options.label;
  1822. targetClassName = options.target;
  1823. }
  1824. var shouldForwardProp2 = composeShouldForwardProps(tag, options, isReal);
  1825. var defaultShouldForwardProp = shouldForwardProp2 || getDefaultShouldForwardProp(baseTag);
  1826. var shouldUseAs = !defaultShouldForwardProp("as");
  1827. return function() {
  1828. var args = arguments;
  1829. var styles2 = isReal && tag.__emotion_styles !== void 0 ? tag.__emotion_styles.slice(0) : [];
  1830. if (identifierName !== void 0) {
  1831. styles2.push("label:" + identifierName + ";");
  1832. }
  1833. if (args[0] == null || args[0].raw === void 0) {
  1834. styles2.push.apply(styles2, args);
  1835. } else {
  1836. styles2.push(args[0][0]);
  1837. var len = args.length;
  1838. var i = 1;
  1839. for (; i < len; i++) {
  1840. styles2.push(args[i], args[0][i]);
  1841. }
  1842. }
  1843. var Styled = withEmotionCache(function(props, cache2, ref) {
  1844. var FinalTag = shouldUseAs && props.as || baseTag;
  1845. var className = "";
  1846. var classInterpolations = [];
  1847. var mergedProps = props;
  1848. if (props.theme == null) {
  1849. mergedProps = {};
  1850. for (var key in props) {
  1851. mergedProps[key] = props[key];
  1852. }
  1853. mergedProps.theme = React__namespace.useContext(ThemeContext$2);
  1854. }
  1855. if (typeof props.className === "string") {
  1856. className = getRegisteredStyles(cache2.registered, classInterpolations, props.className);
  1857. } else if (props.className != null) {
  1858. className = props.className + " ";
  1859. }
  1860. var serialized = serializeStyles(styles2.concat(classInterpolations), cache2.registered, mergedProps);
  1861. className += cache2.key + "-" + serialized.name;
  1862. if (targetClassName !== void 0) {
  1863. className += " " + targetClassName;
  1864. }
  1865. var finalShouldForwardProp = shouldUseAs && shouldForwardProp2 === void 0 ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
  1866. var newProps = {};
  1867. for (var _key in props) {
  1868. if (shouldUseAs && _key === "as")
  1869. continue;
  1870. if (
  1871. // $FlowFixMe
  1872. finalShouldForwardProp(_key)
  1873. ) {
  1874. newProps[_key] = props[_key];
  1875. }
  1876. }
  1877. newProps.className = className;
  1878. newProps.ref = ref;
  1879. return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(Insertion, {
  1880. cache: cache2,
  1881. serialized,
  1882. isStringTag: typeof FinalTag === "string"
  1883. }), /* @__PURE__ */ React__namespace.createElement(FinalTag, newProps));
  1884. });
  1885. Styled.displayName = identifierName !== void 0 ? identifierName : "Styled(" + (typeof baseTag === "string" ? baseTag : baseTag.displayName || baseTag.name || "Component") + ")";
  1886. Styled.defaultProps = tag.defaultProps;
  1887. Styled.__emotion_real = Styled;
  1888. Styled.__emotion_base = baseTag;
  1889. Styled.__emotion_styles = styles2;
  1890. Styled.__emotion_forwardProp = shouldForwardProp2;
  1891. Object.defineProperty(Styled, "toString", {
  1892. value: function value() {
  1893. if (targetClassName === void 0 && false) {
  1894. return "NO_COMPONENT_SELECTOR";
  1895. }
  1896. return "." + targetClassName;
  1897. }
  1898. });
  1899. Styled.withComponent = function(nextTag, nextOptions) {
  1900. return createStyled2(nextTag, _extends$1({}, options, nextOptions, {
  1901. shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
  1902. })).apply(void 0, styles2);
  1903. };
  1904. return Styled;
  1905. };
  1906. };
  1907. var tags = [
  1908. "a",
  1909. "abbr",
  1910. "address",
  1911. "area",
  1912. "article",
  1913. "aside",
  1914. "audio",
  1915. "b",
  1916. "base",
  1917. "bdi",
  1918. "bdo",
  1919. "big",
  1920. "blockquote",
  1921. "body",
  1922. "br",
  1923. "button",
  1924. "canvas",
  1925. "caption",
  1926. "cite",
  1927. "code",
  1928. "col",
  1929. "colgroup",
  1930. "data",
  1931. "datalist",
  1932. "dd",
  1933. "del",
  1934. "details",
  1935. "dfn",
  1936. "dialog",
  1937. "div",
  1938. "dl",
  1939. "dt",
  1940. "em",
  1941. "embed",
  1942. "fieldset",
  1943. "figcaption",
  1944. "figure",
  1945. "footer",
  1946. "form",
  1947. "h1",
  1948. "h2",
  1949. "h3",
  1950. "h4",
  1951. "h5",
  1952. "h6",
  1953. "head",
  1954. "header",
  1955. "hgroup",
  1956. "hr",
  1957. "html",
  1958. "i",
  1959. "iframe",
  1960. "img",
  1961. "input",
  1962. "ins",
  1963. "kbd",
  1964. "keygen",
  1965. "label",
  1966. "legend",
  1967. "li",
  1968. "link",
  1969. "main",
  1970. "map",
  1971. "mark",
  1972. "marquee",
  1973. "menu",
  1974. "menuitem",
  1975. "meta",
  1976. "meter",
  1977. "nav",
  1978. "noscript",
  1979. "object",
  1980. "ol",
  1981. "optgroup",
  1982. "option",
  1983. "output",
  1984. "p",
  1985. "param",
  1986. "picture",
  1987. "pre",
  1988. "progress",
  1989. "q",
  1990. "rp",
  1991. "rt",
  1992. "ruby",
  1993. "s",
  1994. "samp",
  1995. "script",
  1996. "section",
  1997. "select",
  1998. "small",
  1999. "source",
  2000. "span",
  2001. "strong",
  2002. "style",
  2003. "sub",
  2004. "summary",
  2005. "sup",
  2006. "table",
  2007. "tbody",
  2008. "td",
  2009. "textarea",
  2010. "tfoot",
  2011. "th",
  2012. "thead",
  2013. "time",
  2014. "title",
  2015. "tr",
  2016. "track",
  2017. "u",
  2018. "ul",
  2019. "var",
  2020. "video",
  2021. "wbr",
  2022. // SVG
  2023. "circle",
  2024. "clipPath",
  2025. "defs",
  2026. "ellipse",
  2027. "foreignObject",
  2028. "g",
  2029. "image",
  2030. "line",
  2031. "linearGradient",
  2032. "mask",
  2033. "path",
  2034. "pattern",
  2035. "polygon",
  2036. "polyline",
  2037. "radialGradient",
  2038. "rect",
  2039. "stop",
  2040. "svg",
  2041. "text",
  2042. "tspan"
  2043. ];
  2044. var newStyled = createStyled$1.bind();
  2045. tags.forEach(function(tagName) {
  2046. newStyled[tagName] = newStyled(tagName);
  2047. });
  2048. let cache;
  2049. if (typeof document === "object") {
  2050. cache = createCache({
  2051. key: "css",
  2052. prepend: true
  2053. });
  2054. }
  2055. function StyledEngineProvider(props) {
  2056. const {
  2057. injectFirst,
  2058. children
  2059. } = props;
  2060. return injectFirst && cache ? /* @__PURE__ */ jsxRuntimeExports.jsx(CacheProvider, {
  2061. value: cache,
  2062. children
  2063. }) : children;
  2064. }
  2065. function isEmpty$1(obj) {
  2066. return obj === void 0 || obj === null || Object.keys(obj).length === 0;
  2067. }
  2068. function GlobalStyles(props) {
  2069. const {
  2070. styles: styles2,
  2071. defaultTheme: defaultTheme2 = {}
  2072. } = props;
  2073. const globalStyles = typeof styles2 === "function" ? (themeInput) => styles2(isEmpty$1(themeInput) ? defaultTheme2 : themeInput) : styles2;
  2074. return /* @__PURE__ */ jsxRuntimeExports.jsx(Global, {
  2075. styles: globalStyles
  2076. });
  2077. }
  2078. function styled$1(tag, options) {
  2079. const stylesFactory = newStyled(tag, options);
  2080. return stylesFactory;
  2081. }
  2082. const internal_processStyles = (tag, processor) => {
  2083. if (Array.isArray(tag.__emotion_styles)) {
  2084. tag.__emotion_styles = processor(tag.__emotion_styles);
  2085. }
  2086. };
  2087. const styledEngine = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  2088. __proto__: null,
  2089. GlobalStyles,
  2090. StyledEngineProvider,
  2091. ThemeContext: ThemeContext$2,
  2092. css,
  2093. default: styled$1,
  2094. internal_processStyles,
  2095. keyframes
  2096. }, Symbol.toStringTag, { value: "Module" }));
  2097. const require$$1 = /* @__PURE__ */ getAugmentedNamespace(styledEngine);
  2098. function isPlainObject(item) {
  2099. if (typeof item !== "object" || item === null) {
  2100. return false;
  2101. }
  2102. const prototype = Object.getPrototypeOf(item);
  2103. return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
  2104. }
  2105. function deepClone(source) {
  2106. if (!isPlainObject(source)) {
  2107. return source;
  2108. }
  2109. const output = {};
  2110. Object.keys(source).forEach((key) => {
  2111. output[key] = deepClone(source[key]);
  2112. });
  2113. return output;
  2114. }
  2115. function deepmerge$1(target, source, options = {
  2116. clone: true
  2117. }) {
  2118. const output = options.clone ? _extends$1({}, target) : target;
  2119. if (isPlainObject(target) && isPlainObject(source)) {
  2120. Object.keys(source).forEach((key) => {
  2121. if (key === "__proto__") {
  2122. return;
  2123. }
  2124. if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
  2125. output[key] = deepmerge$1(target[key], source[key], options);
  2126. } else if (options.clone) {
  2127. output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];
  2128. } else {
  2129. output[key] = source[key];
  2130. }
  2131. });
  2132. }
  2133. return output;
  2134. }
  2135. const deepmerge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  2136. __proto__: null,
  2137. default: deepmerge$1,
  2138. isPlainObject
  2139. }, Symbol.toStringTag, { value: "Module" }));
  2140. const require$$4 = /* @__PURE__ */ getAugmentedNamespace(deepmerge);
  2141. function capitalize$1(string) {
  2142. if (typeof string !== "string") {
  2143. throw new Error(formatMuiErrorMessage$1(7));
  2144. }
  2145. return string.charAt(0).toUpperCase() + string.slice(1);
  2146. }
  2147. const capitalize = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  2148. __proto__: null,
  2149. default: capitalize$1
  2150. }, Symbol.toStringTag, { value: "Module" }));
  2151. const require$$5 = /* @__PURE__ */ getAugmentedNamespace(capitalize);
  2152. var reactIs = { exports: {} };
  2153. var reactIs_production_min = {};
  2154. /**
  2155. * @license React
  2156. * react-is.production.min.js
  2157. *
  2158. * Copyright (c) Facebook, Inc. and its affiliates.
  2159. *
  2160. * This source code is licensed under the MIT license found in the
  2161. * LICENSE file in the root directory of this source tree.
  2162. */
  2163. var b = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), h = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), u;
  2164. u = Symbol.for("react.module.reference");
  2165. function v(a) {
  2166. if ("object" === typeof a && null !== a) {
  2167. var r2 = a.$$typeof;
  2168. switch (r2) {
  2169. case b:
  2170. switch (a = a.type, a) {
  2171. case d:
  2172. case f:
  2173. case e:
  2174. case m:
  2175. case n:
  2176. return a;
  2177. default:
  2178. switch (a = a && a.$$typeof, a) {
  2179. case k:
  2180. case h:
  2181. case l:
  2182. case q:
  2183. case p:
  2184. case g:
  2185. return a;
  2186. default:
  2187. return r2;
  2188. }
  2189. }
  2190. case c:
  2191. return r2;
  2192. }
  2193. }
  2194. }
  2195. reactIs_production_min.ContextConsumer = h;
  2196. reactIs_production_min.ContextProvider = g;
  2197. reactIs_production_min.Element = b;
  2198. reactIs_production_min.ForwardRef = l;
  2199. reactIs_production_min.Fragment = d;
  2200. reactIs_production_min.Lazy = q;
  2201. reactIs_production_min.Memo = p;
  2202. reactIs_production_min.Portal = c;
  2203. reactIs_production_min.Profiler = f;
  2204. reactIs_production_min.StrictMode = e;
  2205. reactIs_production_min.Suspense = m;
  2206. reactIs_production_min.SuspenseList = n;
  2207. reactIs_production_min.isAsyncMode = function() {
  2208. return false;
  2209. };
  2210. reactIs_production_min.isConcurrentMode = function() {
  2211. return false;
  2212. };
  2213. reactIs_production_min.isContextConsumer = function(a) {
  2214. return v(a) === h;
  2215. };
  2216. reactIs_production_min.isContextProvider = function(a) {
  2217. return v(a) === g;
  2218. };
  2219. reactIs_production_min.isElement = function(a) {
  2220. return "object" === typeof a && null !== a && a.$$typeof === b;
  2221. };
  2222. reactIs_production_min.isForwardRef = function(a) {
  2223. return v(a) === l;
  2224. };
  2225. reactIs_production_min.isFragment = function(a) {
  2226. return v(a) === d;
  2227. };
  2228. reactIs_production_min.isLazy = function(a) {
  2229. return v(a) === q;
  2230. };
  2231. reactIs_production_min.isMemo = function(a) {
  2232. return v(a) === p;
  2233. };
  2234. reactIs_production_min.isPortal = function(a) {
  2235. return v(a) === c;
  2236. };
  2237. reactIs_production_min.isProfiler = function(a) {
  2238. return v(a) === f;
  2239. };
  2240. reactIs_production_min.isStrictMode = function(a) {
  2241. return v(a) === e;
  2242. };
  2243. reactIs_production_min.isSuspense = function(a) {
  2244. return v(a) === m;
  2245. };
  2246. reactIs_production_min.isSuspenseList = function(a) {
  2247. return v(a) === n;
  2248. };
  2249. reactIs_production_min.isValidElementType = function(a) {
  2250. return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? true : false;
  2251. };
  2252. reactIs_production_min.typeOf = v;
  2253. {
  2254. reactIs.exports = reactIs_production_min;
  2255. }
  2256. var reactIsExports = reactIs.exports;
  2257. const fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
  2258. function getFunctionName(fn) {
  2259. const match2 = `${fn}`.match(fnNameMatchRegex);
  2260. const name = match2 && match2[1];
  2261. return name || "";
  2262. }
  2263. function getFunctionComponentName(Component, fallback = "") {
  2264. return Component.displayName || Component.name || getFunctionName(Component) || fallback;
  2265. }
  2266. function getWrappedName(outerType, innerType, wrapperName) {
  2267. const functionName = getFunctionComponentName(innerType);
  2268. return outerType.displayName || (functionName !== "" ? `${wrapperName}(${functionName})` : wrapperName);
  2269. }
  2270. function getDisplayName$1(Component) {
  2271. if (Component == null) {
  2272. return void 0;
  2273. }
  2274. if (typeof Component === "string") {
  2275. return Component;
  2276. }
  2277. if (typeof Component === "function") {
  2278. return getFunctionComponentName(Component, "Component");
  2279. }
  2280. if (typeof Component === "object") {
  2281. switch (Component.$$typeof) {
  2282. case reactIsExports.ForwardRef:
  2283. return getWrappedName(Component, Component.render, "ForwardRef");
  2284. case reactIsExports.Memo:
  2285. return getWrappedName(Component, Component.type, "memo");
  2286. default:
  2287. return void 0;
  2288. }
  2289. }
  2290. return void 0;
  2291. }
  2292. const getDisplayName = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  2293. __proto__: null,
  2294. default: getDisplayName$1,
  2295. getFunctionName
  2296. }, Symbol.toStringTag, { value: "Module" }));
  2297. const require$$6 = /* @__PURE__ */ getAugmentedNamespace(getDisplayName);
  2298. const _excluded$j = ["values", "unit", "step"];
  2299. const sortBreakpointsValues = (values2) => {
  2300. const breakpointsAsArray = Object.keys(values2).map((key) => ({
  2301. key,
  2302. val: values2[key]
  2303. })) || [];
  2304. breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
  2305. return breakpointsAsArray.reduce((acc, obj) => {
  2306. return _extends$1({}, acc, {
  2307. [obj.key]: obj.val
  2308. });
  2309. }, {});
  2310. };
  2311. function createBreakpoints(breakpoints) {
  2312. const {
  2313. // The breakpoint **start** at this value.
  2314. // For instance with the first breakpoint xs: [xs, sm).
  2315. values: values2 = {
  2316. xs: 0,
  2317. // phone
  2318. sm: 600,
  2319. // tablet
  2320. md: 900,
  2321. // small laptop
  2322. lg: 1200,
  2323. // desktop
  2324. xl: 1536
  2325. // large screen
  2326. },
  2327. unit = "px",
  2328. step = 5
  2329. } = breakpoints, other = _objectWithoutPropertiesLoose(breakpoints, _excluded$j);
  2330. const sortedValues = sortBreakpointsValues(values2);
  2331. const keys2 = Object.keys(sortedValues);
  2332. function up(key) {
  2333. const value = typeof values2[key] === "number" ? values2[key] : key;
  2334. return `@media (min-width:${value}${unit})`;
  2335. }
  2336. function down(key) {
  2337. const value = typeof values2[key] === "number" ? values2[key] : key;
  2338. return `@media (max-width:${value - step / 100}${unit})`;
  2339. }
  2340. function between(start, end) {
  2341. const endIndex = keys2.indexOf(end);
  2342. return `@media (min-width:${typeof values2[start] === "number" ? values2[start] : start}${unit}) and (max-width:${(endIndex !== -1 && typeof values2[keys2[endIndex]] === "number" ? values2[keys2[endIndex]] : end) - step / 100}${unit})`;
  2343. }
  2344. function only(key) {
  2345. if (keys2.indexOf(key) + 1 < keys2.length) {
  2346. return between(key, keys2[keys2.indexOf(key) + 1]);
  2347. }
  2348. return up(key);
  2349. }
  2350. function not(key) {
  2351. const keyIndex = keys2.indexOf(key);
  2352. if (keyIndex === 0) {
  2353. return up(keys2[1]);
  2354. }
  2355. if (keyIndex === keys2.length - 1) {
  2356. return down(keys2[keyIndex]);
  2357. }
  2358. return between(key, keys2[keys2.indexOf(key) + 1]).replace("@media", "@media not all and");
  2359. }
  2360. return _extends$1({
  2361. keys: keys2,
  2362. values: sortedValues,
  2363. up,
  2364. down,
  2365. between,
  2366. only,
  2367. not,
  2368. unit
  2369. }, other);
  2370. }
  2371. const shape = {
  2372. borderRadius: 4
  2373. };
  2374. const shape$1 = shape;
  2375. function merge(acc, item) {
  2376. if (!item) {
  2377. return acc;
  2378. }
  2379. return deepmerge$1(acc, item, {
  2380. clone: false
  2381. // No need to clone deep, it's way faster.
  2382. });
  2383. }
  2384. const values$1 = {
  2385. xs: 0,
  2386. // phone
  2387. sm: 600,
  2388. // tablet
  2389. md: 900,
  2390. // small laptop
  2391. lg: 1200,
  2392. // desktop
  2393. xl: 1536
  2394. // large screen
  2395. };
  2396. const defaultBreakpoints = {
  2397. // Sorted ASC by size. That's important.
  2398. // It can't be configured as it's used statically for propTypes.
  2399. keys: ["xs", "sm", "md", "lg", "xl"],
  2400. up: (key) => `@media (min-width:${values$1[key]}px)`
  2401. };
  2402. function handleBreakpoints(props, propValue, styleFromPropValue) {
  2403. const theme = props.theme || {};
  2404. if (Array.isArray(propValue)) {
  2405. const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
  2406. return propValue.reduce((acc, item, index) => {
  2407. acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
  2408. return acc;
  2409. }, {});
  2410. }
  2411. if (typeof propValue === "object") {
  2412. const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
  2413. return Object.keys(propValue).reduce((acc, breakpoint) => {
  2414. if (Object.keys(themeBreakpoints.values || values$1).indexOf(breakpoint) !== -1) {
  2415. const mediaKey = themeBreakpoints.up(breakpoint);
  2416. acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
  2417. } else {
  2418. const cssKey = breakpoint;
  2419. acc[cssKey] = propValue[cssKey];
  2420. }
  2421. return acc;
  2422. }, {});
  2423. }
  2424. const output = styleFromPropValue(propValue);
  2425. return output;
  2426. }
  2427. function createEmptyBreakpointObject(breakpointsInput = {}) {
  2428. var _breakpointsInput$key;
  2429. const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {
  2430. const breakpointStyleKey = breakpointsInput.up(key);
  2431. acc[breakpointStyleKey] = {};
  2432. return acc;
  2433. }, {});
  2434. return breakpointsInOrder || {};
  2435. }
  2436. function removeUnusedBreakpoints(breakpointKeys, style2) {
  2437. return breakpointKeys.reduce((acc, key) => {
  2438. const breakpointOutput = acc[key];
  2439. const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
  2440. if (isBreakpointUnused) {
  2441. delete acc[key];
  2442. }
  2443. return acc;
  2444. }, style2);
  2445. }
  2446. function getPath(obj, path, checkVars = true) {
  2447. if (!path || typeof path !== "string") {
  2448. return null;
  2449. }
  2450. if (obj && obj.vars && checkVars) {
  2451. const val = `vars.${path}`.split(".").reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
  2452. if (val != null) {
  2453. return val;
  2454. }
  2455. }
  2456. return path.split(".").reduce((acc, item) => {
  2457. if (acc && acc[item] != null) {
  2458. return acc[item];
  2459. }
  2460. return null;
  2461. }, obj);
  2462. }
  2463. function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
  2464. let value;
  2465. if (typeof themeMapping === "function") {
  2466. value = themeMapping(propValueFinal);
  2467. } else if (Array.isArray(themeMapping)) {
  2468. value = themeMapping[propValueFinal] || userValue;
  2469. } else {
  2470. value = getPath(themeMapping, propValueFinal) || userValue;
  2471. }
  2472. if (transform) {
  2473. value = transform(value, userValue, themeMapping);
  2474. }
  2475. return value;
  2476. }
  2477. function style$1(options) {
  2478. const {
  2479. prop,
  2480. cssProperty = options.prop,
  2481. themeKey,
  2482. transform
  2483. } = options;
  2484. const fn = (props) => {
  2485. if (props[prop] == null) {
  2486. return null;
  2487. }
  2488. const propValue = props[prop];
  2489. const theme = props.theme;
  2490. const themeMapping = getPath(theme, themeKey) || {};
  2491. const styleFromPropValue = (propValueFinal) => {
  2492. let value = getStyleValue(themeMapping, transform, propValueFinal);
  2493. if (propValueFinal === value && typeof propValueFinal === "string") {
  2494. value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize$1(propValueFinal)}`, propValueFinal);
  2495. }
  2496. if (cssProperty === false) {
  2497. return value;
  2498. }
  2499. return {
  2500. [cssProperty]: value
  2501. };
  2502. };
  2503. return handleBreakpoints(props, propValue, styleFromPropValue);
  2504. };
  2505. fn.propTypes = {};
  2506. fn.filterProps = [prop];
  2507. return fn;
  2508. }
  2509. function memoize(fn) {
  2510. const cache2 = {};
  2511. return (arg) => {
  2512. if (cache2[arg] === void 0) {
  2513. cache2[arg] = fn(arg);
  2514. }
  2515. return cache2[arg];
  2516. };
  2517. }
  2518. const properties = {
  2519. m: "margin",
  2520. p: "padding"
  2521. };
  2522. const directions = {
  2523. t: "Top",
  2524. r: "Right",
  2525. b: "Bottom",
  2526. l: "Left",
  2527. x: ["Left", "Right"],
  2528. y: ["Top", "Bottom"]
  2529. };
  2530. const aliases = {
  2531. marginX: "mx",
  2532. marginY: "my",
  2533. paddingX: "px",
  2534. paddingY: "py"
  2535. };
  2536. const getCssProperties = memoize((prop) => {
  2537. if (prop.length > 2) {
  2538. if (aliases[prop]) {
  2539. prop = aliases[prop];
  2540. } else {
  2541. return [prop];
  2542. }
  2543. }
  2544. const [a, b2] = prop.split("");
  2545. const property = properties[a];
  2546. const direction = directions[b2] || "";
  2547. return Array.isArray(direction) ? direction.map((dir) => property + dir) : [property + direction];
  2548. });
  2549. const marginKeys = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"];
  2550. const paddingKeys = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"];
  2551. [...marginKeys, ...paddingKeys];
  2552. function createUnaryUnit(theme, themeKey, defaultValue, propName) {
  2553. var _getPath;
  2554. const themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue;
  2555. if (typeof themeSpacing === "number") {
  2556. return (abs2) => {
  2557. if (typeof abs2 === "string") {
  2558. return abs2;
  2559. }
  2560. return themeSpacing * abs2;
  2561. };
  2562. }
  2563. if (Array.isArray(themeSpacing)) {
  2564. return (abs2) => {
  2565. if (typeof abs2 === "string") {
  2566. return abs2;
  2567. }
  2568. return themeSpacing[abs2];
  2569. };
  2570. }
  2571. if (typeof themeSpacing === "function") {
  2572. return themeSpacing;
  2573. }
  2574. return () => void 0;
  2575. }
  2576. function createUnarySpacing(theme) {
  2577. return createUnaryUnit(theme, "spacing", 8);
  2578. }
  2579. function getValue$2(transformer, propValue) {
  2580. if (typeof propValue === "string" || propValue == null) {
  2581. return propValue;
  2582. }
  2583. const abs2 = Math.abs(propValue);
  2584. const transformed = transformer(abs2);
  2585. if (propValue >= 0) {
  2586. return transformed;
  2587. }
  2588. if (typeof transformed === "number") {
  2589. return -transformed;
  2590. }
  2591. return `-${transformed}`;
  2592. }
  2593. function getStyleFromPropValue(cssProperties, transformer) {
  2594. return (propValue) => cssProperties.reduce((acc, cssProperty) => {
  2595. acc[cssProperty] = getValue$2(transformer, propValue);
  2596. return acc;
  2597. }, {});
  2598. }
  2599. function resolveCssProperty(props, keys2, prop, transformer) {
  2600. if (keys2.indexOf(prop) === -1) {
  2601. return null;
  2602. }
  2603. const cssProperties = getCssProperties(prop);
  2604. const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
  2605. const propValue = props[prop];
  2606. return handleBreakpoints(props, propValue, styleFromPropValue);
  2607. }
  2608. function style(props, keys2) {
  2609. const transformer = createUnarySpacing(props.theme);
  2610. return Object.keys(props).map((prop) => resolveCssProperty(props, keys2, prop, transformer)).reduce(merge, {});
  2611. }
  2612. function margin(props) {
  2613. return style(props, marginKeys);
  2614. }
  2615. margin.propTypes = {};
  2616. margin.filterProps = marginKeys;
  2617. function padding(props) {
  2618. return style(props, paddingKeys);
  2619. }
  2620. padding.propTypes = {};
  2621. padding.filterProps = paddingKeys;
  2622. function createSpacing(spacingInput = 8) {
  2623. if (spacingInput.mui) {
  2624. return spacingInput;
  2625. }
  2626. const transform = createUnarySpacing({
  2627. spacing: spacingInput
  2628. });
  2629. const spacing = (...argsInput) => {
  2630. const args = argsInput.length === 0 ? [1] : argsInput;
  2631. return args.map((argument) => {
  2632. const output = transform(argument);
  2633. return typeof output === "number" ? `${output}px` : output;
  2634. }).join(" ");
  2635. };
  2636. spacing.mui = true;
  2637. return spacing;
  2638. }
  2639. function compose(...styles2) {
  2640. const handlers = styles2.reduce((acc, style2) => {
  2641. style2.filterProps.forEach((prop) => {
  2642. acc[prop] = style2;
  2643. });
  2644. return acc;
  2645. }, {});
  2646. const fn = (props) => {
  2647. return Object.keys(props).reduce((acc, prop) => {
  2648. if (handlers[prop]) {
  2649. return merge(acc, handlers[prop](props));
  2650. }
  2651. return acc;
  2652. }, {});
  2653. };
  2654. fn.propTypes = {};
  2655. fn.filterProps = styles2.reduce((acc, style2) => acc.concat(style2.filterProps), []);
  2656. return fn;
  2657. }
  2658. function borderTransform(value) {
  2659. if (typeof value !== "number") {
  2660. return value;
  2661. }
  2662. return `${value}px solid`;
  2663. }
  2664. function createBorderStyle(prop, transform) {
  2665. return style$1({
  2666. prop,
  2667. themeKey: "borders",
  2668. transform
  2669. });
  2670. }
  2671. const border = createBorderStyle("border", borderTransform);
  2672. const borderTop = createBorderStyle("borderTop", borderTransform);
  2673. const borderRight = createBorderStyle("borderRight", borderTransform);
  2674. const borderBottom = createBorderStyle("borderBottom", borderTransform);
  2675. const borderLeft = createBorderStyle("borderLeft", borderTransform);
  2676. const borderColor = createBorderStyle("borderColor");
  2677. const borderTopColor = createBorderStyle("borderTopColor");
  2678. const borderRightColor = createBorderStyle("borderRightColor");
  2679. const borderBottomColor = createBorderStyle("borderBottomColor");
  2680. const borderLeftColor = createBorderStyle("borderLeftColor");
  2681. const outline = createBorderStyle("outline", borderTransform);
  2682. const outlineColor = createBorderStyle("outlineColor");
  2683. const borderRadius = (props) => {
  2684. if (props.borderRadius !== void 0 && props.borderRadius !== null) {
  2685. const transformer = createUnaryUnit(props.theme, "shape.borderRadius", 4);
  2686. const styleFromPropValue = (propValue) => ({
  2687. borderRadius: getValue$2(transformer, propValue)
  2688. });
  2689. return handleBreakpoints(props, props.borderRadius, styleFromPropValue);
  2690. }
  2691. return null;
  2692. };
  2693. borderRadius.propTypes = {};
  2694. borderRadius.filterProps = ["borderRadius"];
  2695. compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius, outline, outlineColor);
  2696. const gap = (props) => {
  2697. if (props.gap !== void 0 && props.gap !== null) {
  2698. const transformer = createUnaryUnit(props.theme, "spacing", 8);
  2699. const styleFromPropValue = (propValue) => ({
  2700. gap: getValue$2(transformer, propValue)
  2701. });
  2702. return handleBreakpoints(props, props.gap, styleFromPropValue);
  2703. }
  2704. return null;
  2705. };
  2706. gap.propTypes = {};
  2707. gap.filterProps = ["gap"];
  2708. const columnGap = (props) => {
  2709. if (props.columnGap !== void 0 && props.columnGap !== null) {
  2710. const transformer = createUnaryUnit(props.theme, "spacing", 8);
  2711. const styleFromPropValue = (propValue) => ({
  2712. columnGap: getValue$2(transformer, propValue)
  2713. });
  2714. return handleBreakpoints(props, props.columnGap, styleFromPropValue);
  2715. }
  2716. return null;
  2717. };
  2718. columnGap.propTypes = {};
  2719. columnGap.filterProps = ["columnGap"];
  2720. const rowGap = (props) => {
  2721. if (props.rowGap !== void 0 && props.rowGap !== null) {
  2722. const transformer = createUnaryUnit(props.theme, "spacing", 8);
  2723. const styleFromPropValue = (propValue) => ({
  2724. rowGap: getValue$2(transformer, propValue)
  2725. });
  2726. return handleBreakpoints(props, props.rowGap, styleFromPropValue);
  2727. }
  2728. return null;
  2729. };
  2730. rowGap.propTypes = {};
  2731. rowGap.filterProps = ["rowGap"];
  2732. const gridColumn = style$1({
  2733. prop: "gridColumn"
  2734. });
  2735. const gridRow = style$1({
  2736. prop: "gridRow"
  2737. });
  2738. const gridAutoFlow = style$1({
  2739. prop: "gridAutoFlow"
  2740. });
  2741. const gridAutoColumns = style$1({
  2742. prop: "gridAutoColumns"
  2743. });
  2744. const gridAutoRows = style$1({
  2745. prop: "gridAutoRows"
  2746. });
  2747. const gridTemplateColumns = style$1({
  2748. prop: "gridTemplateColumns"
  2749. });
  2750. const gridTemplateRows = style$1({
  2751. prop: "gridTemplateRows"
  2752. });
  2753. const gridTemplateAreas = style$1({
  2754. prop: "gridTemplateAreas"
  2755. });
  2756. const gridArea = style$1({
  2757. prop: "gridArea"
  2758. });
  2759. compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
  2760. function paletteTransform(value, userValue) {
  2761. if (userValue === "grey") {
  2762. return userValue;
  2763. }
  2764. return value;
  2765. }
  2766. const color = style$1({
  2767. prop: "color",
  2768. themeKey: "palette",
  2769. transform: paletteTransform
  2770. });
  2771. const bgcolor = style$1({
  2772. prop: "bgcolor",
  2773. cssProperty: "backgroundColor",
  2774. themeKey: "palette",
  2775. transform: paletteTransform
  2776. });
  2777. const backgroundColor = style$1({
  2778. prop: "backgroundColor",
  2779. themeKey: "palette",
  2780. transform: paletteTransform
  2781. });
  2782. compose(color, bgcolor, backgroundColor);
  2783. function sizingTransform(value) {
  2784. return value <= 1 && value !== 0 ? `${value * 100}%` : value;
  2785. }
  2786. const width = style$1({
  2787. prop: "width",
  2788. transform: sizingTransform
  2789. });
  2790. const maxWidth = (props) => {
  2791. if (props.maxWidth !== void 0 && props.maxWidth !== null) {
  2792. const styleFromPropValue = (propValue) => {
  2793. var _props$theme, _props$theme2;
  2794. const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || values$1[propValue];
  2795. if (!breakpoint) {
  2796. return {
  2797. maxWidth: sizingTransform(propValue)
  2798. };
  2799. }
  2800. if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== "px") {
  2801. return {
  2802. maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
  2803. };
  2804. }
  2805. return {
  2806. maxWidth: breakpoint
  2807. };
  2808. };
  2809. return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
  2810. }
  2811. return null;
  2812. };
  2813. maxWidth.filterProps = ["maxWidth"];
  2814. const minWidth = style$1({
  2815. prop: "minWidth",
  2816. transform: sizingTransform
  2817. });
  2818. const height = style$1({
  2819. prop: "height",
  2820. transform: sizingTransform
  2821. });
  2822. const maxHeight = style$1({
  2823. prop: "maxHeight",
  2824. transform: sizingTransform
  2825. });
  2826. const minHeight = style$1({
  2827. prop: "minHeight",
  2828. transform: sizingTransform
  2829. });
  2830. style$1({
  2831. prop: "size",
  2832. cssProperty: "width",
  2833. transform: sizingTransform
  2834. });
  2835. style$1({
  2836. prop: "size",
  2837. cssProperty: "height",
  2838. transform: sizingTransform
  2839. });
  2840. const boxSizing = style$1({
  2841. prop: "boxSizing"
  2842. });
  2843. compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
  2844. const defaultSxConfig = {
  2845. // borders
  2846. border: {
  2847. themeKey: "borders",
  2848. transform: borderTransform
  2849. },
  2850. borderTop: {
  2851. themeKey: "borders",
  2852. transform: borderTransform
  2853. },
  2854. borderRight: {
  2855. themeKey: "borders",
  2856. transform: borderTransform
  2857. },
  2858. borderBottom: {
  2859. themeKey: "borders",
  2860. transform: borderTransform
  2861. },
  2862. borderLeft: {
  2863. themeKey: "borders",
  2864. transform: borderTransform
  2865. },
  2866. borderColor: {
  2867. themeKey: "palette"
  2868. },
  2869. borderTopColor: {
  2870. themeKey: "palette"
  2871. },
  2872. borderRightColor: {
  2873. themeKey: "palette"
  2874. },
  2875. borderBottomColor: {
  2876. themeKey: "palette"
  2877. },
  2878. borderLeftColor: {
  2879. themeKey: "palette"
  2880. },
  2881. outline: {
  2882. themeKey: "borders",
  2883. transform: borderTransform
  2884. },
  2885. outlineColor: {
  2886. themeKey: "palette"
  2887. },
  2888. borderRadius: {
  2889. themeKey: "shape.borderRadius",
  2890. style: borderRadius
  2891. },
  2892. // palette
  2893. color: {
  2894. themeKey: "palette",
  2895. transform: paletteTransform
  2896. },
  2897. bgcolor: {
  2898. themeKey: "palette",
  2899. cssProperty: "backgroundColor",
  2900. transform: paletteTransform
  2901. },
  2902. backgroundColor: {
  2903. themeKey: "palette",
  2904. transform: paletteTransform
  2905. },
  2906. // spacing
  2907. p: {
  2908. style: padding
  2909. },
  2910. pt: {
  2911. style: padding
  2912. },
  2913. pr: {
  2914. style: padding
  2915. },
  2916. pb: {
  2917. style: padding
  2918. },
  2919. pl: {
  2920. style: padding
  2921. },
  2922. px: {
  2923. style: padding
  2924. },
  2925. py: {
  2926. style: padding
  2927. },
  2928. padding: {
  2929. style: padding
  2930. },
  2931. paddingTop: {
  2932. style: padding
  2933. },
  2934. paddingRight: {
  2935. style: padding
  2936. },
  2937. paddingBottom: {
  2938. style: padding
  2939. },
  2940. paddingLeft: {
  2941. style: padding
  2942. },
  2943. paddingX: {
  2944. style: padding
  2945. },
  2946. paddingY: {
  2947. style: padding
  2948. },
  2949. paddingInline: {
  2950. style: padding
  2951. },
  2952. paddingInlineStart: {
  2953. style: padding
  2954. },
  2955. paddingInlineEnd: {
  2956. style: padding
  2957. },
  2958. paddingBlock: {
  2959. style: padding
  2960. },
  2961. paddingBlockStart: {
  2962. style: padding
  2963. },
  2964. paddingBlockEnd: {
  2965. style: padding
  2966. },
  2967. m: {
  2968. style: margin
  2969. },
  2970. mt: {
  2971. style: margin
  2972. },
  2973. mr: {
  2974. style: margin
  2975. },
  2976. mb: {
  2977. style: margin
  2978. },
  2979. ml: {
  2980. style: margin
  2981. },
  2982. mx: {
  2983. style: margin
  2984. },
  2985. my: {
  2986. style: margin
  2987. },
  2988. margin: {
  2989. style: margin
  2990. },
  2991. marginTop: {
  2992. style: margin
  2993. },
  2994. marginRight: {
  2995. style: margin
  2996. },
  2997. marginBottom: {
  2998. style: margin
  2999. },
  3000. marginLeft: {
  3001. style: margin
  3002. },
  3003. marginX: {
  3004. style: margin
  3005. },
  3006. marginY: {
  3007. style: margin
  3008. },
  3009. marginInline: {
  3010. style: margin
  3011. },
  3012. marginInlineStart: {
  3013. style: margin
  3014. },
  3015. marginInlineEnd: {
  3016. style: margin
  3017. },
  3018. marginBlock: {
  3019. style: margin
  3020. },
  3021. marginBlockStart: {
  3022. style: margin
  3023. },
  3024. marginBlockEnd: {
  3025. style: margin
  3026. },
  3027. // display
  3028. displayPrint: {
  3029. cssProperty: false,
  3030. transform: (value) => ({
  3031. "@media print": {
  3032. display: value
  3033. }
  3034. })
  3035. },
  3036. display: {},
  3037. overflow: {},
  3038. textOverflow: {},
  3039. visibility: {},
  3040. whiteSpace: {},
  3041. // flexbox
  3042. flexBasis: {},
  3043. flexDirection: {},
  3044. flexWrap: {},
  3045. justifyContent: {},
  3046. alignItems: {},
  3047. alignContent: {},
  3048. order: {},
  3049. flex: {},
  3050. flexGrow: {},
  3051. flexShrink: {},
  3052. alignSelf: {},
  3053. justifyItems: {},
  3054. justifySelf: {},
  3055. // grid
  3056. gap: {
  3057. style: gap
  3058. },
  3059. rowGap: {
  3060. style: rowGap
  3061. },
  3062. columnGap: {
  3063. style: columnGap
  3064. },
  3065. gridColumn: {},
  3066. gridRow: {},
  3067. gridAutoFlow: {},
  3068. gridAutoColumns: {},
  3069. gridAutoRows: {},
  3070. gridTemplateColumns: {},
  3071. gridTemplateRows: {},
  3072. gridTemplateAreas: {},
  3073. gridArea: {},
  3074. // positions
  3075. position: {},
  3076. zIndex: {
  3077. themeKey: "zIndex"
  3078. },
  3079. top: {},
  3080. right: {},
  3081. bottom: {},
  3082. left: {},
  3083. // shadows
  3084. boxShadow: {
  3085. themeKey: "shadows"
  3086. },
  3087. // sizing
  3088. width: {
  3089. transform: sizingTransform
  3090. },
  3091. maxWidth: {
  3092. style: maxWidth
  3093. },
  3094. minWidth: {
  3095. transform: sizingTransform
  3096. },
  3097. height: {
  3098. transform: sizingTransform
  3099. },
  3100. maxHeight: {
  3101. transform: sizingTransform
  3102. },
  3103. minHeight: {
  3104. transform: sizingTransform
  3105. },
  3106. boxSizing: {},
  3107. // typography
  3108. fontFamily: {
  3109. themeKey: "typography"
  3110. },
  3111. fontSize: {
  3112. themeKey: "typography"
  3113. },
  3114. fontStyle: {
  3115. themeKey: "typography"
  3116. },
  3117. fontWeight: {
  3118. themeKey: "typography"
  3119. },
  3120. letterSpacing: {},
  3121. textTransform: {},
  3122. lineHeight: {},
  3123. textAlign: {},
  3124. typography: {
  3125. cssProperty: false,
  3126. themeKey: "typography"
  3127. }
  3128. };
  3129. const defaultSxConfig$1 = defaultSxConfig;
  3130. function objectsHaveSameKeys(...objects) {
  3131. const allKeys = objects.reduce((keys2, object) => keys2.concat(Object.keys(object)), []);
  3132. const union = new Set(allKeys);
  3133. return objects.every((object) => union.size === Object.keys(object).length);
  3134. }
  3135. function callIfFn(maybeFn, arg) {
  3136. return typeof maybeFn === "function" ? maybeFn(arg) : maybeFn;
  3137. }
  3138. function unstable_createStyleFunctionSx() {
  3139. function getThemeValue(prop, val, theme, config2) {
  3140. const props = {
  3141. [prop]: val,
  3142. theme
  3143. };
  3144. const options = config2[prop];
  3145. if (!options) {
  3146. return {
  3147. [prop]: val
  3148. };
  3149. }
  3150. const {
  3151. cssProperty = prop,
  3152. themeKey,
  3153. transform,
  3154. style: style2
  3155. } = options;
  3156. if (val == null) {
  3157. return null;
  3158. }
  3159. if (themeKey === "typography" && val === "inherit") {
  3160. return {
  3161. [prop]: val
  3162. };
  3163. }
  3164. const themeMapping = getPath(theme, themeKey) || {};
  3165. if (style2) {
  3166. return style2(props);
  3167. }
  3168. const styleFromPropValue = (propValueFinal) => {
  3169. let value = getStyleValue(themeMapping, transform, propValueFinal);
  3170. if (propValueFinal === value && typeof propValueFinal === "string") {
  3171. value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize$1(propValueFinal)}`, propValueFinal);
  3172. }
  3173. if (cssProperty === false) {
  3174. return value;
  3175. }
  3176. return {
  3177. [cssProperty]: value
  3178. };
  3179. };
  3180. return handleBreakpoints(props, val, styleFromPropValue);
  3181. }
  3182. function styleFunctionSx2(props) {
  3183. var _theme$unstable_sxCon;
  3184. const {
  3185. sx,
  3186. theme = {}
  3187. } = props || {};
  3188. if (!sx) {
  3189. return null;
  3190. }
  3191. const config2 = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig$1;
  3192. function traverse(sxInput) {
  3193. let sxObject = sxInput;
  3194. if (typeof sxInput === "function") {
  3195. sxObject = sxInput(theme);
  3196. } else if (typeof sxInput !== "object") {
  3197. return sxInput;
  3198. }
  3199. if (!sxObject) {
  3200. return null;
  3201. }
  3202. const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
  3203. const breakpointsKeys = Object.keys(emptyBreakpoints);
  3204. let css2 = emptyBreakpoints;
  3205. Object.keys(sxObject).forEach((styleKey) => {
  3206. const value = callIfFn(sxObject[styleKey], theme);
  3207. if (value !== null && value !== void 0) {
  3208. if (typeof value === "object") {
  3209. if (config2[styleKey]) {
  3210. css2 = merge(css2, getThemeValue(styleKey, value, theme, config2));
  3211. } else {
  3212. const breakpointsValues = handleBreakpoints({
  3213. theme
  3214. }, value, (x2) => ({
  3215. [styleKey]: x2
  3216. }));
  3217. if (objectsHaveSameKeys(breakpointsValues, value)) {
  3218. css2[styleKey] = styleFunctionSx2({
  3219. sx: value,
  3220. theme
  3221. });
  3222. } else {
  3223. css2 = merge(css2, breakpointsValues);
  3224. }
  3225. }
  3226. } else {
  3227. css2 = merge(css2, getThemeValue(styleKey, value, theme, config2));
  3228. }
  3229. }
  3230. });
  3231. return removeUnusedBreakpoints(breakpointsKeys, css2);
  3232. }
  3233. return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
  3234. }
  3235. return styleFunctionSx2;
  3236. }
  3237. const styleFunctionSx$1 = unstable_createStyleFunctionSx();
  3238. styleFunctionSx$1.filterProps = ["sx"];
  3239. function applyStyles(key, styles2) {
  3240. const theme = this;
  3241. if (theme.vars && typeof theme.getColorSchemeSelector === "function") {
  3242. const selector = theme.getColorSchemeSelector(key).replace(/(\[[^\]]+\])/, "*:where($1)");
  3243. return {
  3244. [selector]: styles2
  3245. };
  3246. }
  3247. if (theme.palette.mode === key) {
  3248. return styles2;
  3249. }
  3250. return {};
  3251. }
  3252. const _excluded$i = ["breakpoints", "palette", "spacing", "shape"];
  3253. function createTheme$2(options = {}, ...args) {
  3254. const {
  3255. breakpoints: breakpointsInput = {},
  3256. palette: paletteInput = {},
  3257. spacing: spacingInput,
  3258. shape: shapeInput = {}
  3259. } = options, other = _objectWithoutPropertiesLoose(options, _excluded$i);
  3260. const breakpoints = createBreakpoints(breakpointsInput);
  3261. const spacing = createSpacing(spacingInput);
  3262. let muiTheme = deepmerge$1({
  3263. breakpoints,
  3264. direction: "ltr",
  3265. components: {},
  3266. // Inject component definitions.
  3267. palette: _extends$1({
  3268. mode: "light"
  3269. }, paletteInput),
  3270. spacing,
  3271. shape: _extends$1({}, shape$1, shapeInput)
  3272. }, other);
  3273. muiTheme.applyStyles = applyStyles;
  3274. muiTheme = args.reduce((acc, argument) => deepmerge$1(acc, argument), muiTheme);
  3275. muiTheme.unstable_sxConfig = _extends$1({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
  3276. muiTheme.unstable_sx = function sx(props) {
  3277. return styleFunctionSx$1({
  3278. sx: props,
  3279. theme: this
  3280. });
  3281. };
  3282. return muiTheme;
  3283. }
  3284. const createTheme$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  3285. __proto__: null,
  3286. default: createTheme$2,
  3287. private_createBreakpoints: createBreakpoints,
  3288. unstable_applyStyles: applyStyles
  3289. }, Symbol.toStringTag, { value: "Module" }));
  3290. const require$$7 = /* @__PURE__ */ getAugmentedNamespace(createTheme$1);
  3291. const _excluded$h = ["sx"];
  3292. const splitProps = (props) => {
  3293. var _props$theme$unstable, _props$theme;
  3294. const result = {
  3295. systemProps: {},
  3296. otherProps: {}
  3297. };
  3298. const config2 = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig$1;
  3299. Object.keys(props).forEach((prop) => {
  3300. if (config2[prop]) {
  3301. result.systemProps[prop] = props[prop];
  3302. } else {
  3303. result.otherProps[prop] = props[prop];
  3304. }
  3305. });
  3306. return result;
  3307. };
  3308. function extendSxProp(props) {
  3309. const {
  3310. sx: inSx
  3311. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$h);
  3312. const {
  3313. systemProps,
  3314. otherProps
  3315. } = splitProps(other);
  3316. let finalSx;
  3317. if (Array.isArray(inSx)) {
  3318. finalSx = [systemProps, ...inSx];
  3319. } else if (typeof inSx === "function") {
  3320. finalSx = (...args) => {
  3321. const result = inSx(...args);
  3322. if (!isPlainObject(result)) {
  3323. return systemProps;
  3324. }
  3325. return _extends$1({}, systemProps, result);
  3326. };
  3327. } else {
  3328. finalSx = _extends$1({}, systemProps, inSx);
  3329. }
  3330. return _extends$1({}, otherProps, {
  3331. sx: finalSx
  3332. });
  3333. }
  3334. const styleFunctionSx = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  3335. __proto__: null,
  3336. default: styleFunctionSx$1,
  3337. extendSxProp,
  3338. unstable_createStyleFunctionSx,
  3339. unstable_defaultSxConfig: defaultSxConfig$1
  3340. }, Symbol.toStringTag, { value: "Module" }));
  3341. const require$$8 = /* @__PURE__ */ getAugmentedNamespace(styleFunctionSx);
  3342. var _interopRequireDefault = interopRequireDefaultExports;
  3343. Object.defineProperty(createStyled$2, "__esModule", {
  3344. value: true
  3345. });
  3346. var _default = createStyled$2.default = createStyled;
  3347. var shouldForwardProp_1 = createStyled$2.shouldForwardProp = shouldForwardProp;
  3348. createStyled$2.systemDefaultTheme = void 0;
  3349. var _extends2 = _interopRequireDefault(require_extends());
  3350. var _objectWithoutPropertiesLoose2 = _interopRequireDefault(requireObjectWithoutPropertiesLoose());
  3351. var _styledEngine = _interopRequireWildcard(require$$1);
  3352. var _deepmerge = require$$4;
  3353. _interopRequireDefault(require$$5);
  3354. _interopRequireDefault(require$$6);
  3355. var _createTheme = _interopRequireDefault(require$$7);
  3356. var _styleFunctionSx = _interopRequireDefault(require$$8);
  3357. const _excluded$g = ["ownerState"], _excluded2$1 = ["variants"], _excluded3 = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
  3358. function _getRequireWildcardCache(e2) {
  3359. if ("function" != typeof WeakMap)
  3360. return null;
  3361. var r2 = /* @__PURE__ */ new WeakMap(), t2 = /* @__PURE__ */ new WeakMap();
  3362. return (_getRequireWildcardCache = function(e22) {
  3363. return e22 ? t2 : r2;
  3364. })(e2);
  3365. }
  3366. function _interopRequireWildcard(e2, r2) {
  3367. if (!r2 && e2 && e2.__esModule)
  3368. return e2;
  3369. if (null === e2 || "object" != typeof e2 && "function" != typeof e2)
  3370. return { default: e2 };
  3371. var t2 = _getRequireWildcardCache(r2);
  3372. if (t2 && t2.has(e2))
  3373. return t2.get(e2);
  3374. var n2 = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor;
  3375. for (var u2 in e2)
  3376. if ("default" !== u2 && Object.prototype.hasOwnProperty.call(e2, u2)) {
  3377. var i = a ? Object.getOwnPropertyDescriptor(e2, u2) : null;
  3378. i && (i.get || i.set) ? Object.defineProperty(n2, u2, i) : n2[u2] = e2[u2];
  3379. }
  3380. return n2.default = e2, t2 && t2.set(e2, n2), n2;
  3381. }
  3382. function isEmpty(obj) {
  3383. return Object.keys(obj).length === 0;
  3384. }
  3385. function isStringTag(tag) {
  3386. return typeof tag === "string" && // 96 is one less than the char code
  3387. // for "a" so this is checking that
  3388. // it's a lowercase character
  3389. tag.charCodeAt(0) > 96;
  3390. }
  3391. function shouldForwardProp(prop) {
  3392. return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
  3393. }
  3394. const systemDefaultTheme$1 = createStyled$2.systemDefaultTheme = (0, _createTheme.default)();
  3395. const lowercaseFirstLetter = (string) => {
  3396. if (!string) {
  3397. return string;
  3398. }
  3399. return string.charAt(0).toLowerCase() + string.slice(1);
  3400. };
  3401. function resolveTheme({
  3402. defaultTheme: defaultTheme2,
  3403. theme,
  3404. themeId
  3405. }) {
  3406. return isEmpty(theme) ? defaultTheme2 : theme[themeId] || theme;
  3407. }
  3408. function defaultOverridesResolver(slot) {
  3409. if (!slot) {
  3410. return null;
  3411. }
  3412. return (props, styles2) => styles2[slot];
  3413. }
  3414. function processStyleArg(callableStyle, _ref) {
  3415. let {
  3416. ownerState
  3417. } = _ref, props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded$g);
  3418. const resolvedStylesArg = typeof callableStyle === "function" ? callableStyle((0, _extends2.default)({
  3419. ownerState
  3420. }, props)) : callableStyle;
  3421. if (Array.isArray(resolvedStylesArg)) {
  3422. return resolvedStylesArg.flatMap((resolvedStyle) => processStyleArg(resolvedStyle, (0, _extends2.default)({
  3423. ownerState
  3424. }, props)));
  3425. }
  3426. if (!!resolvedStylesArg && typeof resolvedStylesArg === "object" && Array.isArray(resolvedStylesArg.variants)) {
  3427. const {
  3428. variants = []
  3429. } = resolvedStylesArg, otherStyles = (0, _objectWithoutPropertiesLoose2.default)(resolvedStylesArg, _excluded2$1);
  3430. let result = otherStyles;
  3431. variants.forEach((variant) => {
  3432. let isMatch = true;
  3433. if (typeof variant.props === "function") {
  3434. isMatch = variant.props((0, _extends2.default)({
  3435. ownerState
  3436. }, props, ownerState));
  3437. } else {
  3438. Object.keys(variant.props).forEach((key) => {
  3439. if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) {
  3440. isMatch = false;
  3441. }
  3442. });
  3443. }
  3444. if (isMatch) {
  3445. if (!Array.isArray(result)) {
  3446. result = [result];
  3447. }
  3448. result.push(typeof variant.style === "function" ? variant.style((0, _extends2.default)({
  3449. ownerState
  3450. }, props, ownerState)) : variant.style);
  3451. }
  3452. });
  3453. return result;
  3454. }
  3455. return resolvedStylesArg;
  3456. }
  3457. function createStyled(input = {}) {
  3458. const {
  3459. themeId,
  3460. defaultTheme: defaultTheme2 = systemDefaultTheme$1,
  3461. rootShouldForwardProp: rootShouldForwardProp2 = shouldForwardProp,
  3462. slotShouldForwardProp = shouldForwardProp
  3463. } = input;
  3464. const systemSx = (props) => {
  3465. return (0, _styleFunctionSx.default)((0, _extends2.default)({}, props, {
  3466. theme: resolveTheme((0, _extends2.default)({}, props, {
  3467. defaultTheme: defaultTheme2,
  3468. themeId
  3469. }))
  3470. }));
  3471. };
  3472. systemSx.__mui_systemSx = true;
  3473. return (tag, inputOptions = {}) => {
  3474. (0, _styledEngine.internal_processStyles)(tag, (styles2) => styles2.filter((style2) => !(style2 != null && style2.__mui_systemSx)));
  3475. const {
  3476. name: componentName,
  3477. slot: componentSlot,
  3478. skipVariantsResolver: inputSkipVariantsResolver,
  3479. skipSx: inputSkipSx,
  3480. // TODO v6: remove `lowercaseFirstLetter()` in the next major release
  3481. // For more details: https://github.com/mui/material-ui/pull/37908
  3482. overridesResolver: overridesResolver2 = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
  3483. } = inputOptions, options = (0, _objectWithoutPropertiesLoose2.default)(inputOptions, _excluded3);
  3484. const skipVariantsResolver = inputSkipVariantsResolver !== void 0 ? inputSkipVariantsResolver : (
  3485. // TODO v6: remove `Root` in the next major release
  3486. // For more details: https://github.com/mui/material-ui/pull/37908
  3487. componentSlot && componentSlot !== "Root" && componentSlot !== "root" || false
  3488. );
  3489. const skipSx = inputSkipSx || false;
  3490. let label;
  3491. let shouldForwardPropOption = shouldForwardProp;
  3492. if (componentSlot === "Root" || componentSlot === "root") {
  3493. shouldForwardPropOption = rootShouldForwardProp2;
  3494. } else if (componentSlot) {
  3495. shouldForwardPropOption = slotShouldForwardProp;
  3496. } else if (isStringTag(tag)) {
  3497. shouldForwardPropOption = void 0;
  3498. }
  3499. const defaultStyledResolver = (0, _styledEngine.default)(tag, (0, _extends2.default)({
  3500. shouldForwardProp: shouldForwardPropOption,
  3501. label
  3502. }, options));
  3503. const transformStyleArg = (stylesArg) => {
  3504. if (typeof stylesArg === "function" && stylesArg.__emotion_real !== stylesArg || (0, _deepmerge.isPlainObject)(stylesArg)) {
  3505. return (props) => processStyleArg(stylesArg, (0, _extends2.default)({}, props, {
  3506. theme: resolveTheme({
  3507. theme: props.theme,
  3508. defaultTheme: defaultTheme2,
  3509. themeId
  3510. })
  3511. }));
  3512. }
  3513. return stylesArg;
  3514. };
  3515. const muiStyledResolver = (styleArg, ...expressions) => {
  3516. let transformedStyleArg = transformStyleArg(styleArg);
  3517. const expressionsWithDefaultTheme = expressions ? expressions.map(transformStyleArg) : [];
  3518. if (componentName && overridesResolver2) {
  3519. expressionsWithDefaultTheme.push((props) => {
  3520. const theme = resolveTheme((0, _extends2.default)({}, props, {
  3521. defaultTheme: defaultTheme2,
  3522. themeId
  3523. }));
  3524. if (!theme.components || !theme.components[componentName] || !theme.components[componentName].styleOverrides) {
  3525. return null;
  3526. }
  3527. const styleOverrides = theme.components[componentName].styleOverrides;
  3528. const resolvedStyleOverrides = {};
  3529. Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {
  3530. resolvedStyleOverrides[slotKey] = processStyleArg(slotStyle, (0, _extends2.default)({}, props, {
  3531. theme
  3532. }));
  3533. });
  3534. return overridesResolver2(props, resolvedStyleOverrides);
  3535. });
  3536. }
  3537. if (componentName && !skipVariantsResolver) {
  3538. expressionsWithDefaultTheme.push((props) => {
  3539. var _theme$components;
  3540. const theme = resolveTheme((0, _extends2.default)({}, props, {
  3541. defaultTheme: defaultTheme2,
  3542. themeId
  3543. }));
  3544. const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants;
  3545. return processStyleArg({
  3546. variants: themeVariants
  3547. }, (0, _extends2.default)({}, props, {
  3548. theme
  3549. }));
  3550. });
  3551. }
  3552. if (!skipSx) {
  3553. expressionsWithDefaultTheme.push(systemSx);
  3554. }
  3555. const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
  3556. if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
  3557. const placeholders = new Array(numOfCustomFnsApplied).fill("");
  3558. transformedStyleArg = [...styleArg, ...placeholders];
  3559. transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
  3560. }
  3561. const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
  3562. if (tag.muiName) {
  3563. Component.muiName = tag.muiName;
  3564. }
  3565. return Component;
  3566. };
  3567. if (defaultStyledResolver.withConfig) {
  3568. muiStyledResolver.withConfig = defaultStyledResolver.withConfig;
  3569. }
  3570. return muiStyledResolver;
  3571. };
  3572. }
  3573. const defaultGenerator = (componentName) => componentName;
  3574. const createClassNameGenerator = () => {
  3575. let generate = defaultGenerator;
  3576. return {
  3577. configure(generator) {
  3578. generate = generator;
  3579. },
  3580. generate(componentName) {
  3581. return generate(componentName);
  3582. },
  3583. reset() {
  3584. generate = defaultGenerator;
  3585. }
  3586. };
  3587. };
  3588. const ClassNameGenerator = createClassNameGenerator();
  3589. const globalStateClasses = {
  3590. active: "active",
  3591. checked: "checked",
  3592. completed: "completed",
  3593. disabled: "disabled",
  3594. error: "error",
  3595. expanded: "expanded",
  3596. focused: "focused",
  3597. focusVisible: "focusVisible",
  3598. open: "open",
  3599. readOnly: "readOnly",
  3600. required: "required",
  3601. selected: "selected"
  3602. };
  3603. function generateUtilityClass(componentName, slot, globalStatePrefix = "Mui") {
  3604. const globalStateClass = globalStateClasses[slot];
  3605. return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;
  3606. }
  3607. function createMixins(breakpoints, mixins) {
  3608. return _extends$1({
  3609. toolbar: {
  3610. minHeight: 56,
  3611. [breakpoints.up("xs")]: {
  3612. "@media (orientation: landscape)": {
  3613. minHeight: 48
  3614. }
  3615. },
  3616. [breakpoints.up("sm")]: {
  3617. minHeight: 64
  3618. }
  3619. }
  3620. }, mixins);
  3621. }
  3622. const common = {
  3623. black: "#000",
  3624. white: "#fff"
  3625. };
  3626. const common$1 = common;
  3627. const grey = {
  3628. 50: "#fafafa",
  3629. 100: "#f5f5f5",
  3630. 200: "#eeeeee",
  3631. 300: "#e0e0e0",
  3632. 400: "#bdbdbd",
  3633. 500: "#9e9e9e",
  3634. 600: "#757575",
  3635. 700: "#616161",
  3636. 800: "#424242",
  3637. 900: "#212121",
  3638. A100: "#f5f5f5",
  3639. A200: "#eeeeee",
  3640. A400: "#bdbdbd",
  3641. A700: "#616161"
  3642. };
  3643. const grey$1 = grey;
  3644. const purple = {
  3645. 50: "#f3e5f5",
  3646. 100: "#e1bee7",
  3647. 200: "#ce93d8",
  3648. 300: "#ba68c8",
  3649. 400: "#ab47bc",
  3650. 500: "#9c27b0",
  3651. 600: "#8e24aa",
  3652. 700: "#7b1fa2",
  3653. 800: "#6a1b9a",
  3654. 900: "#4a148c",
  3655. A100: "#ea80fc",
  3656. A200: "#e040fb",
  3657. A400: "#d500f9",
  3658. A700: "#aa00ff"
  3659. };
  3660. const purple$1 = purple;
  3661. const red = {
  3662. 50: "#ffebee",
  3663. 100: "#ffcdd2",
  3664. 200: "#ef9a9a",
  3665. 300: "#e57373",
  3666. 400: "#ef5350",
  3667. 500: "#f44336",
  3668. 600: "#e53935",
  3669. 700: "#d32f2f",
  3670. 800: "#c62828",
  3671. 900: "#b71c1c",
  3672. A100: "#ff8a80",
  3673. A200: "#ff5252",
  3674. A400: "#ff1744",
  3675. A700: "#d50000"
  3676. };
  3677. const red$1 = red;
  3678. const orange = {
  3679. 50: "#fff3e0",
  3680. 100: "#ffe0b2",
  3681. 200: "#ffcc80",
  3682. 300: "#ffb74d",
  3683. 400: "#ffa726",
  3684. 500: "#ff9800",
  3685. 600: "#fb8c00",
  3686. 700: "#f57c00",
  3687. 800: "#ef6c00",
  3688. 900: "#e65100",
  3689. A100: "#ffd180",
  3690. A200: "#ffab40",
  3691. A400: "#ff9100",
  3692. A700: "#ff6d00"
  3693. };
  3694. const orange$1 = orange;
  3695. const blue = {
  3696. 50: "#e3f2fd",
  3697. 100: "#bbdefb",
  3698. 200: "#90caf9",
  3699. 300: "#64b5f6",
  3700. 400: "#42a5f5",
  3701. 500: "#2196f3",
  3702. 600: "#1e88e5",
  3703. 700: "#1976d2",
  3704. 800: "#1565c0",
  3705. 900: "#0d47a1",
  3706. A100: "#82b1ff",
  3707. A200: "#448aff",
  3708. A400: "#2979ff",
  3709. A700: "#2962ff"
  3710. };
  3711. const blue$1 = blue;
  3712. const lightBlue = {
  3713. 50: "#e1f5fe",
  3714. 100: "#b3e5fc",
  3715. 200: "#81d4fa",
  3716. 300: "#4fc3f7",
  3717. 400: "#29b6f6",
  3718. 500: "#03a9f4",
  3719. 600: "#039be5",
  3720. 700: "#0288d1",
  3721. 800: "#0277bd",
  3722. 900: "#01579b",
  3723. A100: "#80d8ff",
  3724. A200: "#40c4ff",
  3725. A400: "#00b0ff",
  3726. A700: "#0091ea"
  3727. };
  3728. const lightBlue$1 = lightBlue;
  3729. const green = {
  3730. 50: "#e8f5e9",
  3731. 100: "#c8e6c9",
  3732. 200: "#a5d6a7",
  3733. 300: "#81c784",
  3734. 400: "#66bb6a",
  3735. 500: "#4caf50",
  3736. 600: "#43a047",
  3737. 700: "#388e3c",
  3738. 800: "#2e7d32",
  3739. 900: "#1b5e20",
  3740. A100: "#b9f6ca",
  3741. A200: "#69f0ae",
  3742. A400: "#00e676",
  3743. A700: "#00c853"
  3744. };
  3745. const green$1 = green;
  3746. const _excluded$f = ["mode", "contrastThreshold", "tonalOffset"];
  3747. const light = {
  3748. // The colors used to style the text.
  3749. text: {
  3750. // The most important text.
  3751. primary: "rgba(0, 0, 0, 0.87)",
  3752. // Secondary text.
  3753. secondary: "rgba(0, 0, 0, 0.6)",
  3754. // Disabled text have even lower visual prominence.
  3755. disabled: "rgba(0, 0, 0, 0.38)"
  3756. },
  3757. // The color used to divide different elements.
  3758. divider: "rgba(0, 0, 0, 0.12)",
  3759. // The background colors used to style the surfaces.
  3760. // Consistency between these values is important.
  3761. background: {
  3762. paper: common$1.white,
  3763. default: common$1.white
  3764. },
  3765. // The colors used to style the action elements.
  3766. action: {
  3767. // The color of an active action like an icon button.
  3768. active: "rgba(0, 0, 0, 0.54)",
  3769. // The color of an hovered action.
  3770. hover: "rgba(0, 0, 0, 0.04)",
  3771. hoverOpacity: 0.04,
  3772. // The color of a selected action.
  3773. selected: "rgba(0, 0, 0, 0.08)",
  3774. selectedOpacity: 0.08,
  3775. // The color of a disabled action.
  3776. disabled: "rgba(0, 0, 0, 0.26)",
  3777. // The background color of a disabled action.
  3778. disabledBackground: "rgba(0, 0, 0, 0.12)",
  3779. disabledOpacity: 0.38,
  3780. focus: "rgba(0, 0, 0, 0.12)",
  3781. focusOpacity: 0.12,
  3782. activatedOpacity: 0.12
  3783. }
  3784. };
  3785. const dark = {
  3786. text: {
  3787. primary: common$1.white,
  3788. secondary: "rgba(255, 255, 255, 0.7)",
  3789. disabled: "rgba(255, 255, 255, 0.5)",
  3790. icon: "rgba(255, 255, 255, 0.5)"
  3791. },
  3792. divider: "rgba(255, 255, 255, 0.12)",
  3793. background: {
  3794. paper: "#121212",
  3795. default: "#121212"
  3796. },
  3797. action: {
  3798. active: common$1.white,
  3799. hover: "rgba(255, 255, 255, 0.08)",
  3800. hoverOpacity: 0.08,
  3801. selected: "rgba(255, 255, 255, 0.16)",
  3802. selectedOpacity: 0.16,
  3803. disabled: "rgba(255, 255, 255, 0.3)",
  3804. disabledBackground: "rgba(255, 255, 255, 0.12)",
  3805. disabledOpacity: 0.38,
  3806. focus: "rgba(255, 255, 255, 0.12)",
  3807. focusOpacity: 0.12,
  3808. activatedOpacity: 0.24
  3809. }
  3810. };
  3811. function addLightOrDark(intent, direction, shade, tonalOffset) {
  3812. const tonalOffsetLight = tonalOffset.light || tonalOffset;
  3813. const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
  3814. if (!intent[direction]) {
  3815. if (intent.hasOwnProperty(shade)) {
  3816. intent[direction] = intent[shade];
  3817. } else if (direction === "light") {
  3818. intent.light = lighten_1(intent.main, tonalOffsetLight);
  3819. } else if (direction === "dark") {
  3820. intent.dark = darken_1(intent.main, tonalOffsetDark);
  3821. }
  3822. }
  3823. }
  3824. function getDefaultPrimary(mode = "light") {
  3825. if (mode === "dark") {
  3826. return {
  3827. main: blue$1[200],
  3828. light: blue$1[50],
  3829. dark: blue$1[400]
  3830. };
  3831. }
  3832. return {
  3833. main: blue$1[700],
  3834. light: blue$1[400],
  3835. dark: blue$1[800]
  3836. };
  3837. }
  3838. function getDefaultSecondary(mode = "light") {
  3839. if (mode === "dark") {
  3840. return {
  3841. main: purple$1[200],
  3842. light: purple$1[50],
  3843. dark: purple$1[400]
  3844. };
  3845. }
  3846. return {
  3847. main: purple$1[500],
  3848. light: purple$1[300],
  3849. dark: purple$1[700]
  3850. };
  3851. }
  3852. function getDefaultError(mode = "light") {
  3853. if (mode === "dark") {
  3854. return {
  3855. main: red$1[500],
  3856. light: red$1[300],
  3857. dark: red$1[700]
  3858. };
  3859. }
  3860. return {
  3861. main: red$1[700],
  3862. light: red$1[400],
  3863. dark: red$1[800]
  3864. };
  3865. }
  3866. function getDefaultInfo(mode = "light") {
  3867. if (mode === "dark") {
  3868. return {
  3869. main: lightBlue$1[400],
  3870. light: lightBlue$1[300],
  3871. dark: lightBlue$1[700]
  3872. };
  3873. }
  3874. return {
  3875. main: lightBlue$1[700],
  3876. light: lightBlue$1[500],
  3877. dark: lightBlue$1[900]
  3878. };
  3879. }
  3880. function getDefaultSuccess(mode = "light") {
  3881. if (mode === "dark") {
  3882. return {
  3883. main: green$1[400],
  3884. light: green$1[300],
  3885. dark: green$1[700]
  3886. };
  3887. }
  3888. return {
  3889. main: green$1[800],
  3890. light: green$1[500],
  3891. dark: green$1[900]
  3892. };
  3893. }
  3894. function getDefaultWarning(mode = "light") {
  3895. if (mode === "dark") {
  3896. return {
  3897. main: orange$1[400],
  3898. light: orange$1[300],
  3899. dark: orange$1[700]
  3900. };
  3901. }
  3902. return {
  3903. main: "#ed6c02",
  3904. // closest to orange[800] that pass 3:1.
  3905. light: orange$1[500],
  3906. dark: orange$1[900]
  3907. };
  3908. }
  3909. function createPalette(palette) {
  3910. const {
  3911. mode = "light",
  3912. contrastThreshold = 3,
  3913. tonalOffset = 0.2
  3914. } = palette, other = _objectWithoutPropertiesLoose(palette, _excluded$f);
  3915. const primary = palette.primary || getDefaultPrimary(mode);
  3916. const secondary = palette.secondary || getDefaultSecondary(mode);
  3917. const error = palette.error || getDefaultError(mode);
  3918. const info = palette.info || getDefaultInfo(mode);
  3919. const success = palette.success || getDefaultSuccess(mode);
  3920. const warning = palette.warning || getDefaultWarning(mode);
  3921. function getContrastText(background) {
  3922. const contrastText = getContrastRatio_1(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
  3923. return contrastText;
  3924. }
  3925. const augmentColor = ({
  3926. color: color2,
  3927. name,
  3928. mainShade = 500,
  3929. lightShade = 300,
  3930. darkShade = 700
  3931. }) => {
  3932. color2 = _extends$1({}, color2);
  3933. if (!color2.main && color2[mainShade]) {
  3934. color2.main = color2[mainShade];
  3935. }
  3936. if (!color2.hasOwnProperty("main")) {
  3937. throw new Error(formatMuiErrorMessage$1(11, name ? ` (${name})` : "", mainShade));
  3938. }
  3939. if (typeof color2.main !== "string") {
  3940. throw new Error(formatMuiErrorMessage$1(12, name ? ` (${name})` : "", JSON.stringify(color2.main)));
  3941. }
  3942. addLightOrDark(color2, "light", lightShade, tonalOffset);
  3943. addLightOrDark(color2, "dark", darkShade, tonalOffset);
  3944. if (!color2.contrastText) {
  3945. color2.contrastText = getContrastText(color2.main);
  3946. }
  3947. return color2;
  3948. };
  3949. const modes = {
  3950. dark,
  3951. light
  3952. };
  3953. const paletteOutput = deepmerge$1(_extends$1({
  3954. // A collection of common colors.
  3955. common: _extends$1({}, common$1),
  3956. // prevent mutable object.
  3957. // The palette mode, can be light or dark.
  3958. mode,
  3959. // The colors used to represent primary interface elements for a user.
  3960. primary: augmentColor({
  3961. color: primary,
  3962. name: "primary"
  3963. }),
  3964. // The colors used to represent secondary interface elements for a user.
  3965. secondary: augmentColor({
  3966. color: secondary,
  3967. name: "secondary",
  3968. mainShade: "A400",
  3969. lightShade: "A200",
  3970. darkShade: "A700"
  3971. }),
  3972. // The colors used to represent interface elements that the user should be made aware of.
  3973. error: augmentColor({
  3974. color: error,
  3975. name: "error"
  3976. }),
  3977. // The colors used to represent potentially dangerous actions or important messages.
  3978. warning: augmentColor({
  3979. color: warning,
  3980. name: "warning"
  3981. }),
  3982. // The colors used to present information to the user that is neutral and not necessarily important.
  3983. info: augmentColor({
  3984. color: info,
  3985. name: "info"
  3986. }),
  3987. // The colors used to indicate the successful completion of an action that user triggered.
  3988. success: augmentColor({
  3989. color: success,
  3990. name: "success"
  3991. }),
  3992. // The grey colors.
  3993. grey: grey$1,
  3994. // Used by `getContrastText()` to maximize the contrast between
  3995. // the background and the text.
  3996. contrastThreshold,
  3997. // Takes a background color and returns the text color that maximizes the contrast.
  3998. getContrastText,
  3999. // Generate a rich color object.
  4000. augmentColor,
  4001. // Used by the functions below to shift a color's luminance by approximately
  4002. // two indexes within its tonal palette.
  4003. // E.g., shift from Red 500 to Red 300 or Red 700.
  4004. tonalOffset
  4005. }, modes[mode]), other);
  4006. return paletteOutput;
  4007. }
  4008. const _excluded$e = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
  4009. function round(value) {
  4010. return Math.round(value * 1e5) / 1e5;
  4011. }
  4012. const caseAllCaps = {
  4013. textTransform: "uppercase"
  4014. };
  4015. const defaultFontFamily = '"Roboto", "Helvetica", "Arial", sans-serif';
  4016. function createTypography(palette, typography) {
  4017. const _ref = typeof typography === "function" ? typography(palette) : typography, {
  4018. fontFamily = defaultFontFamily,
  4019. // The default font size of the Material Specification.
  4020. fontSize = 14,
  4021. // px
  4022. fontWeightLight = 300,
  4023. fontWeightRegular = 400,
  4024. fontWeightMedium = 500,
  4025. fontWeightBold = 700,
  4026. // Tell MUI what's the font-size on the html element.
  4027. // 16px is the default font-size used by browsers.
  4028. htmlFontSize = 16,
  4029. // Apply the CSS properties to all the variants.
  4030. allVariants,
  4031. pxToRem: pxToRem2
  4032. } = _ref, other = _objectWithoutPropertiesLoose(_ref, _excluded$e);
  4033. const coef = fontSize / 14;
  4034. const pxToRem = pxToRem2 || ((size) => `${size / htmlFontSize * coef}rem`);
  4035. const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$1({
  4036. fontFamily,
  4037. fontWeight,
  4038. fontSize: pxToRem(size),
  4039. // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
  4040. lineHeight
  4041. }, fontFamily === defaultFontFamily ? {
  4042. letterSpacing: `${round(letterSpacing / size)}em`
  4043. } : {}, casing, allVariants);
  4044. const variants = {
  4045. h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),
  4046. h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),
  4047. h3: buildVariant(fontWeightRegular, 48, 1.167, 0),
  4048. h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),
  4049. h5: buildVariant(fontWeightRegular, 24, 1.334, 0),
  4050. h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),
  4051. subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),
  4052. subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),
  4053. body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),
  4054. body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),
  4055. button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),
  4056. caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
  4057. overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),
  4058. // TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types.
  4059. inherit: {
  4060. fontFamily: "inherit",
  4061. fontWeight: "inherit",
  4062. fontSize: "inherit",
  4063. lineHeight: "inherit",
  4064. letterSpacing: "inherit"
  4065. }
  4066. };
  4067. return deepmerge$1(_extends$1({
  4068. htmlFontSize,
  4069. pxToRem,
  4070. fontFamily,
  4071. fontSize,
  4072. fontWeightLight,
  4073. fontWeightRegular,
  4074. fontWeightMedium,
  4075. fontWeightBold
  4076. }, variants), other, {
  4077. clone: false
  4078. // No need to clone deep
  4079. });
  4080. }
  4081. const shadowKeyUmbraOpacity = 0.2;
  4082. const shadowKeyPenumbraOpacity = 0.14;
  4083. const shadowAmbientShadowOpacity = 0.12;
  4084. function createShadow(...px) {
  4085. return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",");
  4086. }
  4087. const shadows = ["none", createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
  4088. const _excluded$d = ["duration", "easing", "delay"];
  4089. const easing = {
  4090. // This is the most common easing curve.
  4091. easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
  4092. // Objects enter the screen at full velocity from off-screen and
  4093. // slowly decelerate to a resting point.
  4094. easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
  4095. // Objects leave the screen at full velocity. They do not decelerate when off-screen.
  4096. easeIn: "cubic-bezier(0.4, 0, 1, 1)",
  4097. // The sharp curve is used by objects that may return to the screen at any time.
  4098. sharp: "cubic-bezier(0.4, 0, 0.6, 1)"
  4099. };
  4100. const duration = {
  4101. shortest: 150,
  4102. shorter: 200,
  4103. short: 250,
  4104. // most basic recommended timing
  4105. standard: 300,
  4106. // this is to be used in complex animations
  4107. complex: 375,
  4108. // recommended when something is entering screen
  4109. enteringScreen: 225,
  4110. // recommended when something is leaving screen
  4111. leavingScreen: 195
  4112. };
  4113. function formatMs(milliseconds) {
  4114. return `${Math.round(milliseconds)}ms`;
  4115. }
  4116. function getAutoHeightDuration(height2) {
  4117. if (!height2) {
  4118. return 0;
  4119. }
  4120. const constant = height2 / 36;
  4121. return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
  4122. }
  4123. function createTransitions(inputTransitions) {
  4124. const mergedEasing = _extends$1({}, easing, inputTransitions.easing);
  4125. const mergedDuration = _extends$1({}, duration, inputTransitions.duration);
  4126. const create = (props = ["all"], options = {}) => {
  4127. const {
  4128. duration: durationOption = mergedDuration.standard,
  4129. easing: easingOption = mergedEasing.easeInOut,
  4130. delay = 0
  4131. } = options;
  4132. _objectWithoutPropertiesLoose(options, _excluded$d);
  4133. return (Array.isArray(props) ? props : [props]).map((animatedProp) => `${animatedProp} ${typeof durationOption === "string" ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === "string" ? delay : formatMs(delay)}`).join(",");
  4134. };
  4135. return _extends$1({
  4136. getAutoHeightDuration,
  4137. create
  4138. }, inputTransitions, {
  4139. easing: mergedEasing,
  4140. duration: mergedDuration
  4141. });
  4142. }
  4143. const zIndex = {
  4144. mobileStepper: 1e3,
  4145. fab: 1050,
  4146. speedDial: 1050,
  4147. appBar: 1100,
  4148. drawer: 1200,
  4149. modal: 1300,
  4150. snackbar: 1400,
  4151. tooltip: 1500
  4152. };
  4153. const zIndex$1 = zIndex;
  4154. const _excluded$c = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
  4155. function createTheme(options = {}, ...args) {
  4156. const {
  4157. mixins: mixinsInput = {},
  4158. palette: paletteInput = {},
  4159. transitions: transitionsInput = {},
  4160. typography: typographyInput = {}
  4161. } = options, other = _objectWithoutPropertiesLoose(options, _excluded$c);
  4162. if (options.vars) {
  4163. throw new Error(formatMuiErrorMessage$1(18));
  4164. }
  4165. const palette = createPalette(paletteInput);
  4166. const systemTheme = createTheme$2(options);
  4167. let muiTheme = deepmerge$1(systemTheme, {
  4168. mixins: createMixins(systemTheme.breakpoints, mixinsInput),
  4169. palette,
  4170. // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
  4171. shadows: shadows.slice(),
  4172. typography: createTypography(palette, typographyInput),
  4173. transitions: createTransitions(transitionsInput),
  4174. zIndex: _extends$1({}, zIndex$1)
  4175. });
  4176. muiTheme = deepmerge$1(muiTheme, other);
  4177. muiTheme = args.reduce((acc, argument) => deepmerge$1(acc, argument), muiTheme);
  4178. muiTheme.unstable_sxConfig = _extends$1({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
  4179. muiTheme.unstable_sx = function sx(props) {
  4180. return styleFunctionSx$1({
  4181. sx: props,
  4182. theme: this
  4183. });
  4184. };
  4185. return muiTheme;
  4186. }
  4187. const defaultTheme$1 = createTheme();
  4188. const defaultTheme$2 = defaultTheme$1;
  4189. const THEME_ID = "$$material";
  4190. const rootShouldForwardProp = (prop) => shouldForwardProp_1(prop) && prop !== "classes";
  4191. const styled = _default({
  4192. themeId: THEME_ID,
  4193. defaultTheme: defaultTheme$2,
  4194. rootShouldForwardProp
  4195. });
  4196. function getThemeProps(params) {
  4197. const {
  4198. theme,
  4199. name,
  4200. props
  4201. } = params;
  4202. if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
  4203. return props;
  4204. }
  4205. return resolveProps(theme.components[name].defaultProps, props);
  4206. }
  4207. function isObjectEmpty(obj) {
  4208. return Object.keys(obj).length === 0;
  4209. }
  4210. function useTheme$3(defaultTheme2 = null) {
  4211. const contextTheme = React__namespace.useContext(ThemeContext$2);
  4212. return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme2 : contextTheme;
  4213. }
  4214. const systemDefaultTheme = createTheme$2();
  4215. function useTheme$2(defaultTheme2 = systemDefaultTheme) {
  4216. return useTheme$3(defaultTheme2);
  4217. }
  4218. function useThemeProps$1({
  4219. props,
  4220. name,
  4221. defaultTheme: defaultTheme2,
  4222. themeId
  4223. }) {
  4224. let theme = useTheme$2(defaultTheme2);
  4225. if (themeId) {
  4226. theme = theme[themeId] || theme;
  4227. }
  4228. const mergedProps = getThemeProps({
  4229. theme,
  4230. name,
  4231. props
  4232. });
  4233. return mergedProps;
  4234. }
  4235. function useThemeProps({
  4236. props,
  4237. name
  4238. }) {
  4239. return useThemeProps$1({
  4240. props,
  4241. name,
  4242. defaultTheme: defaultTheme$2,
  4243. themeId: THEME_ID
  4244. });
  4245. }
  4246. function setRef(ref, value) {
  4247. if (typeof ref === "function") {
  4248. ref(value);
  4249. } else if (ref) {
  4250. ref.current = value;
  4251. }
  4252. }
  4253. function useForkRef(...refs) {
  4254. return React__namespace.useMemo(() => {
  4255. if (refs.every((ref) => ref == null)) {
  4256. return null;
  4257. }
  4258. return (instance) => {
  4259. refs.forEach((ref) => {
  4260. setRef(ref, instance);
  4261. });
  4262. };
  4263. }, refs);
  4264. }
  4265. const useEnhancedEffect = typeof window !== "undefined" ? React__namespace.useLayoutEffect : React__namespace.useEffect;
  4266. function useEventCallback(fn) {
  4267. const ref = React__namespace.useRef(fn);
  4268. useEnhancedEffect(() => {
  4269. ref.current = fn;
  4270. });
  4271. return React__namespace.useRef((...args) => (
  4272. // @ts-expect-error hide `this`
  4273. (0, ref.current)(...args)
  4274. )).current;
  4275. }
  4276. const UNINITIALIZED = {};
  4277. function useLazyRef(init, initArg) {
  4278. const ref = React__namespace.useRef(UNINITIALIZED);
  4279. if (ref.current === UNINITIALIZED) {
  4280. ref.current = init(initArg);
  4281. }
  4282. return ref;
  4283. }
  4284. const EMPTY = [];
  4285. function useOnMount(fn) {
  4286. React__namespace.useEffect(fn, EMPTY);
  4287. }
  4288. class Timeout {
  4289. constructor() {
  4290. this.currentId = null;
  4291. this.clear = () => {
  4292. if (this.currentId !== null) {
  4293. clearTimeout(this.currentId);
  4294. this.currentId = null;
  4295. }
  4296. };
  4297. this.disposeEffect = () => {
  4298. return this.clear;
  4299. };
  4300. }
  4301. static create() {
  4302. return new Timeout();
  4303. }
  4304. /**
  4305. * Executes `fn` after `delay`, clearing any previously scheduled call.
  4306. */
  4307. start(delay, fn) {
  4308. this.clear();
  4309. this.currentId = setTimeout(() => {
  4310. this.currentId = null;
  4311. fn();
  4312. }, delay);
  4313. }
  4314. }
  4315. function useTimeout() {
  4316. const timeout = useLazyRef(Timeout.create).current;
  4317. useOnMount(timeout.disposeEffect);
  4318. return timeout;
  4319. }
  4320. let hadKeyboardEvent = true;
  4321. let hadFocusVisibleRecently = false;
  4322. const hadFocusVisibleRecentlyTimeout = new Timeout();
  4323. const inputTypesWhitelist = {
  4324. text: true,
  4325. search: true,
  4326. url: true,
  4327. tel: true,
  4328. email: true,
  4329. password: true,
  4330. number: true,
  4331. date: true,
  4332. month: true,
  4333. week: true,
  4334. time: true,
  4335. datetime: true,
  4336. "datetime-local": true
  4337. };
  4338. function focusTriggersKeyboardModality(node2) {
  4339. const {
  4340. type,
  4341. tagName
  4342. } = node2;
  4343. if (tagName === "INPUT" && inputTypesWhitelist[type] && !node2.readOnly) {
  4344. return true;
  4345. }
  4346. if (tagName === "TEXTAREA" && !node2.readOnly) {
  4347. return true;
  4348. }
  4349. if (node2.isContentEditable) {
  4350. return true;
  4351. }
  4352. return false;
  4353. }
  4354. function handleKeyDown(event) {
  4355. if (event.metaKey || event.altKey || event.ctrlKey) {
  4356. return;
  4357. }
  4358. hadKeyboardEvent = true;
  4359. }
  4360. function handlePointerDown() {
  4361. hadKeyboardEvent = false;
  4362. }
  4363. function handleVisibilityChange() {
  4364. if (this.visibilityState === "hidden") {
  4365. if (hadFocusVisibleRecently) {
  4366. hadKeyboardEvent = true;
  4367. }
  4368. }
  4369. }
  4370. function prepare(doc) {
  4371. doc.addEventListener("keydown", handleKeyDown, true);
  4372. doc.addEventListener("mousedown", handlePointerDown, true);
  4373. doc.addEventListener("pointerdown", handlePointerDown, true);
  4374. doc.addEventListener("touchstart", handlePointerDown, true);
  4375. doc.addEventListener("visibilitychange", handleVisibilityChange, true);
  4376. }
  4377. function isFocusVisible(event) {
  4378. const {
  4379. target
  4380. } = event;
  4381. try {
  4382. return target.matches(":focus-visible");
  4383. } catch (error) {
  4384. }
  4385. return hadKeyboardEvent || focusTriggersKeyboardModality(target);
  4386. }
  4387. function useIsFocusVisible() {
  4388. const ref = React__namespace.useCallback((node2) => {
  4389. if (node2 != null) {
  4390. prepare(node2.ownerDocument);
  4391. }
  4392. }, []);
  4393. const isFocusVisibleRef = React__namespace.useRef(false);
  4394. function handleBlurVisible() {
  4395. if (isFocusVisibleRef.current) {
  4396. hadFocusVisibleRecently = true;
  4397. hadFocusVisibleRecentlyTimeout.start(100, () => {
  4398. hadFocusVisibleRecently = false;
  4399. });
  4400. isFocusVisibleRef.current = false;
  4401. return true;
  4402. }
  4403. return false;
  4404. }
  4405. function handleFocusVisible(event) {
  4406. if (isFocusVisible(event)) {
  4407. isFocusVisibleRef.current = true;
  4408. return true;
  4409. }
  4410. return false;
  4411. }
  4412. return {
  4413. isFocusVisibleRef,
  4414. onFocus: handleFocusVisible,
  4415. onBlur: handleBlurVisible,
  4416. ref
  4417. };
  4418. }
  4419. function _setPrototypeOf(o, p2) {
  4420. _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
  4421. o2.__proto__ = p3;
  4422. return o2;
  4423. };
  4424. return _setPrototypeOf(o, p2);
  4425. }
  4426. function _inheritsLoose(subClass, superClass) {
  4427. subClass.prototype = Object.create(superClass.prototype);
  4428. subClass.prototype.constructor = subClass;
  4429. _setPrototypeOf(subClass, superClass);
  4430. }
  4431. const config = {
  4432. disabled: false
  4433. };
  4434. const TransitionGroupContext = React.createContext(null);
  4435. var forceReflow = function forceReflow2(node2) {
  4436. return node2.scrollTop;
  4437. };
  4438. var UNMOUNTED = "unmounted";
  4439. var EXITED = "exited";
  4440. var ENTERING = "entering";
  4441. var ENTERED = "entered";
  4442. var EXITING = "exiting";
  4443. var Transition = /* @__PURE__ */ function(_React$Component) {
  4444. _inheritsLoose(Transition2, _React$Component);
  4445. function Transition2(props, context) {
  4446. var _this;
  4447. _this = _React$Component.call(this, props, context) || this;
  4448. var parentGroup = context;
  4449. var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
  4450. var initialStatus;
  4451. _this.appearStatus = null;
  4452. if (props.in) {
  4453. if (appear) {
  4454. initialStatus = EXITED;
  4455. _this.appearStatus = ENTERING;
  4456. } else {
  4457. initialStatus = ENTERED;
  4458. }
  4459. } else {
  4460. if (props.unmountOnExit || props.mountOnEnter) {
  4461. initialStatus = UNMOUNTED;
  4462. } else {
  4463. initialStatus = EXITED;
  4464. }
  4465. }
  4466. _this.state = {
  4467. status: initialStatus
  4468. };
  4469. _this.nextCallback = null;
  4470. return _this;
  4471. }
  4472. Transition2.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
  4473. var nextIn = _ref.in;
  4474. if (nextIn && prevState.status === UNMOUNTED) {
  4475. return {
  4476. status: EXITED
  4477. };
  4478. }
  4479. return null;
  4480. };
  4481. var _proto = Transition2.prototype;
  4482. _proto.componentDidMount = function componentDidMount() {
  4483. this.updateStatus(true, this.appearStatus);
  4484. };
  4485. _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
  4486. var nextStatus = null;
  4487. if (prevProps !== this.props) {
  4488. var status = this.state.status;
  4489. if (this.props.in) {
  4490. if (status !== ENTERING && status !== ENTERED) {
  4491. nextStatus = ENTERING;
  4492. }
  4493. } else {
  4494. if (status === ENTERING || status === ENTERED) {
  4495. nextStatus = EXITING;
  4496. }
  4497. }
  4498. }
  4499. this.updateStatus(false, nextStatus);
  4500. };
  4501. _proto.componentWillUnmount = function componentWillUnmount() {
  4502. this.cancelNextCallback();
  4503. };
  4504. _proto.getTimeouts = function getTimeouts() {
  4505. var timeout2 = this.props.timeout;
  4506. var exit, enter, appear;
  4507. exit = enter = appear = timeout2;
  4508. if (timeout2 != null && typeof timeout2 !== "number") {
  4509. exit = timeout2.exit;
  4510. enter = timeout2.enter;
  4511. appear = timeout2.appear !== void 0 ? timeout2.appear : enter;
  4512. }
  4513. return {
  4514. exit,
  4515. enter,
  4516. appear
  4517. };
  4518. };
  4519. _proto.updateStatus = function updateStatus(mounting, nextStatus) {
  4520. if (mounting === void 0) {
  4521. mounting = false;
  4522. }
  4523. if (nextStatus !== null) {
  4524. this.cancelNextCallback();
  4525. if (nextStatus === ENTERING) {
  4526. if (this.props.unmountOnExit || this.props.mountOnEnter) {
  4527. var node2 = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default.findDOMNode(this);
  4528. if (node2)
  4529. forceReflow(node2);
  4530. }
  4531. this.performEnter(mounting);
  4532. } else {
  4533. this.performExit();
  4534. }
  4535. } else if (this.props.unmountOnExit && this.state.status === EXITED) {
  4536. this.setState({
  4537. status: UNMOUNTED
  4538. });
  4539. }
  4540. };
  4541. _proto.performEnter = function performEnter(mounting) {
  4542. var _this2 = this;
  4543. var enter = this.props.enter;
  4544. var appearing = this.context ? this.context.isMounting : mounting;
  4545. var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM__default.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1];
  4546. var timeouts = this.getTimeouts();
  4547. var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
  4548. if (!mounting && !enter || config.disabled) {
  4549. this.safeSetState({
  4550. status: ENTERED
  4551. }, function() {
  4552. _this2.props.onEntered(maybeNode);
  4553. });
  4554. return;
  4555. }
  4556. this.props.onEnter(maybeNode, maybeAppearing);
  4557. this.safeSetState({
  4558. status: ENTERING
  4559. }, function() {
  4560. _this2.props.onEntering(maybeNode, maybeAppearing);
  4561. _this2.onTransitionEnd(enterTimeout, function() {
  4562. _this2.safeSetState({
  4563. status: ENTERED
  4564. }, function() {
  4565. _this2.props.onEntered(maybeNode, maybeAppearing);
  4566. });
  4567. });
  4568. });
  4569. };
  4570. _proto.performExit = function performExit() {
  4571. var _this3 = this;
  4572. var exit = this.props.exit;
  4573. var timeouts = this.getTimeouts();
  4574. var maybeNode = this.props.nodeRef ? void 0 : ReactDOM__default.findDOMNode(this);
  4575. if (!exit || config.disabled) {
  4576. this.safeSetState({
  4577. status: EXITED
  4578. }, function() {
  4579. _this3.props.onExited(maybeNode);
  4580. });
  4581. return;
  4582. }
  4583. this.props.onExit(maybeNode);
  4584. this.safeSetState({
  4585. status: EXITING
  4586. }, function() {
  4587. _this3.props.onExiting(maybeNode);
  4588. _this3.onTransitionEnd(timeouts.exit, function() {
  4589. _this3.safeSetState({
  4590. status: EXITED
  4591. }, function() {
  4592. _this3.props.onExited(maybeNode);
  4593. });
  4594. });
  4595. });
  4596. };
  4597. _proto.cancelNextCallback = function cancelNextCallback() {
  4598. if (this.nextCallback !== null) {
  4599. this.nextCallback.cancel();
  4600. this.nextCallback = null;
  4601. }
  4602. };
  4603. _proto.safeSetState = function safeSetState(nextState, callback) {
  4604. callback = this.setNextCallback(callback);
  4605. this.setState(nextState, callback);
  4606. };
  4607. _proto.setNextCallback = function setNextCallback(callback) {
  4608. var _this4 = this;
  4609. var active = true;
  4610. this.nextCallback = function(event) {
  4611. if (active) {
  4612. active = false;
  4613. _this4.nextCallback = null;
  4614. callback(event);
  4615. }
  4616. };
  4617. this.nextCallback.cancel = function() {
  4618. active = false;
  4619. };
  4620. return this.nextCallback;
  4621. };
  4622. _proto.onTransitionEnd = function onTransitionEnd(timeout2, handler) {
  4623. this.setNextCallback(handler);
  4624. var node2 = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default.findDOMNode(this);
  4625. var doesNotHaveTimeoutOrListener = timeout2 == null && !this.props.addEndListener;
  4626. if (!node2 || doesNotHaveTimeoutOrListener) {
  4627. setTimeout(this.nextCallback, 0);
  4628. return;
  4629. }
  4630. if (this.props.addEndListener) {
  4631. var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node2, this.nextCallback], maybeNode = _ref3[0], maybeNextCallback = _ref3[1];
  4632. this.props.addEndListener(maybeNode, maybeNextCallback);
  4633. }
  4634. if (timeout2 != null) {
  4635. setTimeout(this.nextCallback, timeout2);
  4636. }
  4637. };
  4638. _proto.render = function render() {
  4639. var status = this.state.status;
  4640. if (status === UNMOUNTED) {
  4641. return null;
  4642. }
  4643. var _this$props = this.props, children = _this$props.children;
  4644. _this$props.in;
  4645. _this$props.mountOnEnter;
  4646. _this$props.unmountOnExit;
  4647. _this$props.appear;
  4648. _this$props.enter;
  4649. _this$props.exit;
  4650. _this$props.timeout;
  4651. _this$props.addEndListener;
  4652. _this$props.onEnter;
  4653. _this$props.onEntering;
  4654. _this$props.onEntered;
  4655. _this$props.onExit;
  4656. _this$props.onExiting;
  4657. _this$props.onExited;
  4658. _this$props.nodeRef;
  4659. var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
  4660. return (
  4661. // allows for nested Transitions
  4662. /* @__PURE__ */ React.createElement(TransitionGroupContext.Provider, {
  4663. value: null
  4664. }, typeof children === "function" ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))
  4665. );
  4666. };
  4667. return Transition2;
  4668. }(React.Component);
  4669. Transition.contextType = TransitionGroupContext;
  4670. Transition.propTypes = {};
  4671. function noop() {
  4672. }
  4673. Transition.defaultProps = {
  4674. in: false,
  4675. mountOnEnter: false,
  4676. unmountOnExit: false,
  4677. appear: false,
  4678. enter: true,
  4679. exit: true,
  4680. onEnter: noop,
  4681. onEntering: noop,
  4682. onEntered: noop,
  4683. onExit: noop,
  4684. onExiting: noop,
  4685. onExited: noop
  4686. };
  4687. Transition.UNMOUNTED = UNMOUNTED;
  4688. Transition.EXITED = EXITED;
  4689. Transition.ENTERING = ENTERING;
  4690. Transition.ENTERED = ENTERED;
  4691. Transition.EXITING = EXITING;
  4692. const Transition$1 = Transition;
  4693. function _assertThisInitialized(self2) {
  4694. if (self2 === void 0) {
  4695. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  4696. }
  4697. return self2;
  4698. }
  4699. function getChildMapping(children, mapFn) {
  4700. var mapper = function mapper2(child) {
  4701. return mapFn && React.isValidElement(child) ? mapFn(child) : child;
  4702. };
  4703. var result = /* @__PURE__ */ Object.create(null);
  4704. if (children)
  4705. React.Children.map(children, function(c2) {
  4706. return c2;
  4707. }).forEach(function(child) {
  4708. result[child.key] = mapper(child);
  4709. });
  4710. return result;
  4711. }
  4712. function mergeChildMappings(prev2, next2) {
  4713. prev2 = prev2 || {};
  4714. next2 = next2 || {};
  4715. function getValueForKey(key) {
  4716. return key in next2 ? next2[key] : prev2[key];
  4717. }
  4718. var nextKeysPending = /* @__PURE__ */ Object.create(null);
  4719. var pendingKeys = [];
  4720. for (var prevKey in prev2) {
  4721. if (prevKey in next2) {
  4722. if (pendingKeys.length) {
  4723. nextKeysPending[prevKey] = pendingKeys;
  4724. pendingKeys = [];
  4725. }
  4726. } else {
  4727. pendingKeys.push(prevKey);
  4728. }
  4729. }
  4730. var i;
  4731. var childMapping = {};
  4732. for (var nextKey in next2) {
  4733. if (nextKeysPending[nextKey]) {
  4734. for (i = 0; i < nextKeysPending[nextKey].length; i++) {
  4735. var pendingNextKey = nextKeysPending[nextKey][i];
  4736. childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
  4737. }
  4738. }
  4739. childMapping[nextKey] = getValueForKey(nextKey);
  4740. }
  4741. for (i = 0; i < pendingKeys.length; i++) {
  4742. childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
  4743. }
  4744. return childMapping;
  4745. }
  4746. function getProp(child, prop, props) {
  4747. return props[prop] != null ? props[prop] : child.props[prop];
  4748. }
  4749. function getInitialChildMapping(props, onExited) {
  4750. return getChildMapping(props.children, function(child) {
  4751. return React.cloneElement(child, {
  4752. onExited: onExited.bind(null, child),
  4753. in: true,
  4754. appear: getProp(child, "appear", props),
  4755. enter: getProp(child, "enter", props),
  4756. exit: getProp(child, "exit", props)
  4757. });
  4758. });
  4759. }
  4760. function getNextChildMapping(nextProps, prevChildMapping, onExited) {
  4761. var nextChildMapping = getChildMapping(nextProps.children);
  4762. var children = mergeChildMappings(prevChildMapping, nextChildMapping);
  4763. Object.keys(children).forEach(function(key) {
  4764. var child = children[key];
  4765. if (!React.isValidElement(child))
  4766. return;
  4767. var hasPrev = key in prevChildMapping;
  4768. var hasNext = key in nextChildMapping;
  4769. var prevChild = prevChildMapping[key];
  4770. var isLeaving = React.isValidElement(prevChild) && !prevChild.props.in;
  4771. if (hasNext && (!hasPrev || isLeaving)) {
  4772. children[key] = React.cloneElement(child, {
  4773. onExited: onExited.bind(null, child),
  4774. in: true,
  4775. exit: getProp(child, "exit", nextProps),
  4776. enter: getProp(child, "enter", nextProps)
  4777. });
  4778. } else if (!hasNext && hasPrev && !isLeaving) {
  4779. children[key] = React.cloneElement(child, {
  4780. in: false
  4781. });
  4782. } else if (hasNext && hasPrev && React.isValidElement(prevChild)) {
  4783. children[key] = React.cloneElement(child, {
  4784. onExited: onExited.bind(null, child),
  4785. in: prevChild.props.in,
  4786. exit: getProp(child, "exit", nextProps),
  4787. enter: getProp(child, "enter", nextProps)
  4788. });
  4789. }
  4790. });
  4791. return children;
  4792. }
  4793. var values = Object.values || function(obj) {
  4794. return Object.keys(obj).map(function(k2) {
  4795. return obj[k2];
  4796. });
  4797. };
  4798. var defaultProps = {
  4799. component: "div",
  4800. childFactory: function childFactory(child) {
  4801. return child;
  4802. }
  4803. };
  4804. var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
  4805. _inheritsLoose(TransitionGroup2, _React$Component);
  4806. function TransitionGroup2(props, context) {
  4807. var _this;
  4808. _this = _React$Component.call(this, props, context) || this;
  4809. var handleExited = _this.handleExited.bind(_assertThisInitialized(_this));
  4810. _this.state = {
  4811. contextValue: {
  4812. isMounting: true
  4813. },
  4814. handleExited,
  4815. firstRender: true
  4816. };
  4817. return _this;
  4818. }
  4819. var _proto = TransitionGroup2.prototype;
  4820. _proto.componentDidMount = function componentDidMount() {
  4821. this.mounted = true;
  4822. this.setState({
  4823. contextValue: {
  4824. isMounting: false
  4825. }
  4826. });
  4827. };
  4828. _proto.componentWillUnmount = function componentWillUnmount() {
  4829. this.mounted = false;
  4830. };
  4831. TransitionGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
  4832. var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender;
  4833. return {
  4834. children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
  4835. firstRender: false
  4836. };
  4837. };
  4838. _proto.handleExited = function handleExited(child, node2) {
  4839. var currentChildMapping = getChildMapping(this.props.children);
  4840. if (child.key in currentChildMapping)
  4841. return;
  4842. if (child.props.onExited) {
  4843. child.props.onExited(node2);
  4844. }
  4845. if (this.mounted) {
  4846. this.setState(function(state) {
  4847. var children = _extends$1({}, state.children);
  4848. delete children[child.key];
  4849. return {
  4850. children
  4851. };
  4852. });
  4853. }
  4854. };
  4855. _proto.render = function render() {
  4856. var _this$props = this.props, Component = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
  4857. var contextValue = this.state.contextValue;
  4858. var children = values(this.state.children).map(childFactory2);
  4859. delete props.appear;
  4860. delete props.enter;
  4861. delete props.exit;
  4862. if (Component === null) {
  4863. return /* @__PURE__ */ React.createElement(TransitionGroupContext.Provider, {
  4864. value: contextValue
  4865. }, children);
  4866. }
  4867. return /* @__PURE__ */ React.createElement(TransitionGroupContext.Provider, {
  4868. value: contextValue
  4869. }, /* @__PURE__ */ React.createElement(Component, props, children));
  4870. };
  4871. return TransitionGroup2;
  4872. }(React.Component);
  4873. TransitionGroup.propTypes = {};
  4874. TransitionGroup.defaultProps = defaultProps;
  4875. const TransitionGroup$1 = TransitionGroup;
  4876. const _excluded$b = ["className", "component"];
  4877. function createBox(options = {}) {
  4878. const {
  4879. themeId,
  4880. defaultTheme: defaultTheme2,
  4881. defaultClassName = "MuiBox-root",
  4882. generateClassName
  4883. } = options;
  4884. const BoxRoot = styled$1("div", {
  4885. shouldForwardProp: (prop) => prop !== "theme" && prop !== "sx" && prop !== "as"
  4886. })(styleFunctionSx$1);
  4887. const Box2 = /* @__PURE__ */ React__namespace.forwardRef(function Box3(inProps, ref) {
  4888. const theme = useTheme$2(defaultTheme2);
  4889. const _extendSxProp = extendSxProp(inProps), {
  4890. className,
  4891. component = "div"
  4892. } = _extendSxProp, other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$b);
  4893. return /* @__PURE__ */ jsxRuntimeExports.jsx(BoxRoot, _extends$1({
  4894. as: component,
  4895. ref,
  4896. className: clsx(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),
  4897. theme: themeId ? theme[themeId] || theme : theme
  4898. }, other));
  4899. });
  4900. return Box2;
  4901. }
  4902. function generateUtilityClasses(componentName, slots, globalStatePrefix = "Mui") {
  4903. const result = {};
  4904. slots.forEach((slot) => {
  4905. result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
  4906. });
  4907. return result;
  4908. }
  4909. function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
  4910. const [match2, setMatch] = React__namespace.useState(() => {
  4911. if (noSsr && matchMedia) {
  4912. return matchMedia(query).matches;
  4913. }
  4914. if (ssrMatchMedia) {
  4915. return ssrMatchMedia(query).matches;
  4916. }
  4917. return defaultMatches;
  4918. });
  4919. useEnhancedEffect(() => {
  4920. let active = true;
  4921. if (!matchMedia) {
  4922. return void 0;
  4923. }
  4924. const queryList = matchMedia(query);
  4925. const updateMatch = () => {
  4926. if (active) {
  4927. setMatch(queryList.matches);
  4928. }
  4929. };
  4930. updateMatch();
  4931. queryList.addListener(updateMatch);
  4932. return () => {
  4933. active = false;
  4934. queryList.removeListener(updateMatch);
  4935. };
  4936. }, [query, matchMedia]);
  4937. return match2;
  4938. }
  4939. const maybeReactUseSyncExternalStore = React__namespace["useSyncExternalStore"];
  4940. function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
  4941. const getDefaultSnapshot = React__namespace.useCallback(() => defaultMatches, [defaultMatches]);
  4942. const getServerSnapshot = React__namespace.useMemo(() => {
  4943. if (noSsr && matchMedia) {
  4944. return () => matchMedia(query).matches;
  4945. }
  4946. if (ssrMatchMedia !== null) {
  4947. const {
  4948. matches
  4949. } = ssrMatchMedia(query);
  4950. return () => matches;
  4951. }
  4952. return getDefaultSnapshot;
  4953. }, [getDefaultSnapshot, query, ssrMatchMedia, noSsr, matchMedia]);
  4954. const [getSnapshot, subscribe] = React__namespace.useMemo(() => {
  4955. if (matchMedia === null) {
  4956. return [getDefaultSnapshot, () => () => {
  4957. }];
  4958. }
  4959. const mediaQueryList = matchMedia(query);
  4960. return [() => mediaQueryList.matches, (notify) => {
  4961. mediaQueryList.addListener(notify);
  4962. return () => {
  4963. mediaQueryList.removeListener(notify);
  4964. };
  4965. }];
  4966. }, [getDefaultSnapshot, matchMedia, query]);
  4967. const match2 = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
  4968. return match2;
  4969. }
  4970. function useMediaQuery(queryInput, options = {}) {
  4971. const theme = useTheme$3();
  4972. const supportMatchMedia = typeof window !== "undefined" && typeof window.matchMedia !== "undefined";
  4973. const {
  4974. defaultMatches = false,
  4975. matchMedia = supportMatchMedia ? window.matchMedia : null,
  4976. ssrMatchMedia = null,
  4977. noSsr = false
  4978. } = getThemeProps({
  4979. name: "MuiUseMediaQuery",
  4980. props: options,
  4981. theme
  4982. });
  4983. let query = typeof queryInput === "function" ? queryInput(theme) : queryInput;
  4984. query = query.replace(/^@media( ?)/m, "");
  4985. const useMediaQueryImplementation = maybeReactUseSyncExternalStore !== void 0 ? useMediaQueryNew : useMediaQueryOld;
  4986. const match2 = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);
  4987. return match2;
  4988. }
  4989. function createChainedFunction(...funcs) {
  4990. return funcs.reduce((acc, func) => {
  4991. if (func == null) {
  4992. return acc;
  4993. }
  4994. return function chainedFunction(...args) {
  4995. acc.apply(this, args);
  4996. func.apply(this, args);
  4997. };
  4998. }, () => {
  4999. });
  5000. }
  5001. function debounce(func, wait = 166) {
  5002. let timeout;
  5003. function debounced(...args) {
  5004. const later = () => {
  5005. func.apply(this, args);
  5006. };
  5007. clearTimeout(timeout);
  5008. timeout = setTimeout(later, wait);
  5009. }
  5010. debounced.clear = () => {
  5011. clearTimeout(timeout);
  5012. };
  5013. return debounced;
  5014. }
  5015. function ownerDocument(node2) {
  5016. return node2 && node2.ownerDocument || document;
  5017. }
  5018. function ownerWindow(node2) {
  5019. const doc = ownerDocument(node2);
  5020. return doc.defaultView || window;
  5021. }
  5022. function getScrollbarSize(doc) {
  5023. const documentWidth = doc.documentElement.clientWidth;
  5024. return Math.abs(window.innerWidth - documentWidth);
  5025. }
  5026. const ThemeContext = /* @__PURE__ */ React__namespace.createContext(null);
  5027. const ThemeContext$1 = ThemeContext;
  5028. function useTheme$1() {
  5029. const theme = React__namespace.useContext(ThemeContext$1);
  5030. return theme;
  5031. }
  5032. const hasSymbol = typeof Symbol === "function" && Symbol.for;
  5033. const nested = hasSymbol ? Symbol.for("mui.nested") : "__THEME_NESTED__";
  5034. function mergeOuterLocalTheme(outerTheme, localTheme) {
  5035. if (typeof localTheme === "function") {
  5036. const mergedTheme = localTheme(outerTheme);
  5037. return mergedTheme;
  5038. }
  5039. return _extends$1({}, outerTheme, localTheme);
  5040. }
  5041. function ThemeProvider$3(props) {
  5042. const {
  5043. children,
  5044. theme: localTheme
  5045. } = props;
  5046. const outerTheme = useTheme$1();
  5047. const theme = React__namespace.useMemo(() => {
  5048. const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);
  5049. if (output != null) {
  5050. output[nested] = outerTheme !== null;
  5051. }
  5052. return output;
  5053. }, [localTheme, outerTheme]);
  5054. return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeContext$1.Provider, {
  5055. value: theme,
  5056. children
  5057. });
  5058. }
  5059. const EMPTY_THEME = {};
  5060. function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
  5061. return React__namespace.useMemo(() => {
  5062. const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
  5063. if (typeof localTheme === "function") {
  5064. const mergedTheme = localTheme(resolvedTheme);
  5065. const result = themeId ? _extends$1({}, upperTheme, {
  5066. [themeId]: mergedTheme
  5067. }) : mergedTheme;
  5068. if (isPrivate) {
  5069. return () => result;
  5070. }
  5071. return result;
  5072. }
  5073. return themeId ? _extends$1({}, upperTheme, {
  5074. [themeId]: localTheme
  5075. }) : _extends$1({}, upperTheme, localTheme);
  5076. }, [themeId, upperTheme, localTheme, isPrivate]);
  5077. }
  5078. function ThemeProvider$2(props) {
  5079. const {
  5080. children,
  5081. theme: localTheme,
  5082. themeId
  5083. } = props;
  5084. const upperTheme = useTheme$3(EMPTY_THEME);
  5085. const upperPrivateTheme = useTheme$1() || EMPTY_THEME;
  5086. const engineTheme = useThemeScoping(themeId, upperTheme, localTheme);
  5087. const privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true);
  5088. return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider$3, {
  5089. theme: privateTheme,
  5090. children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeContext$2.Provider, {
  5091. value: engineTheme,
  5092. children
  5093. })
  5094. });
  5095. }
  5096. function Ripple(props) {
  5097. const {
  5098. className,
  5099. classes,
  5100. pulsate = false,
  5101. rippleX,
  5102. rippleY,
  5103. rippleSize,
  5104. in: inProp,
  5105. onExited,
  5106. timeout
  5107. } = props;
  5108. const [leaving, setLeaving] = React__namespace.useState(false);
  5109. const rippleClassName = clsx(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);
  5110. const rippleStyles = {
  5111. width: rippleSize,
  5112. height: rippleSize,
  5113. top: -(rippleSize / 2) + rippleY,
  5114. left: -(rippleSize / 2) + rippleX
  5115. };
  5116. const childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);
  5117. if (!inProp && !leaving) {
  5118. setLeaving(true);
  5119. }
  5120. React__namespace.useEffect(() => {
  5121. if (!inProp && onExited != null) {
  5122. const timeoutId = setTimeout(onExited, timeout);
  5123. return () => {
  5124. clearTimeout(timeoutId);
  5125. };
  5126. }
  5127. return void 0;
  5128. }, [onExited, inProp, timeout]);
  5129. return /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
  5130. className: rippleClassName,
  5131. style: rippleStyles,
  5132. children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
  5133. className: childClassName
  5134. })
  5135. });
  5136. }
  5137. const touchRippleClasses = generateUtilityClasses("MuiTouchRipple", ["root", "ripple", "rippleVisible", "ripplePulsate", "child", "childLeaving", "childPulsate"]);
  5138. const _excluded$a = ["center", "classes", "className"];
  5139. let _ = (t2) => t2, _t, _t2, _t3, _t4;
  5140. const DURATION = 550;
  5141. const DELAY_RIPPLE = 80;
  5142. const enterKeyframe = keyframes(_t || (_t = _`
  5143. 0% {
  5144. transform: scale(0);
  5145. opacity: 0.1;
  5146. }
  5147.  
  5148. 100% {
  5149. transform: scale(1);
  5150. opacity: 0.3;
  5151. }
  5152. `));
  5153. const exitKeyframe = keyframes(_t2 || (_t2 = _`
  5154. 0% {
  5155. opacity: 1;
  5156. }
  5157.  
  5158. 100% {
  5159. opacity: 0;
  5160. }
  5161. `));
  5162. const pulsateKeyframe = keyframes(_t3 || (_t3 = _`
  5163. 0% {
  5164. transform: scale(1);
  5165. }
  5166.  
  5167. 50% {
  5168. transform: scale(0.92);
  5169. }
  5170.  
  5171. 100% {
  5172. transform: scale(1);
  5173. }
  5174. `));
  5175. const TouchRippleRoot = styled("span", {
  5176. name: "MuiTouchRipple",
  5177. slot: "Root"
  5178. })({
  5179. overflow: "hidden",
  5180. pointerEvents: "none",
  5181. position: "absolute",
  5182. zIndex: 0,
  5183. top: 0,
  5184. right: 0,
  5185. bottom: 0,
  5186. left: 0,
  5187. borderRadius: "inherit"
  5188. });
  5189. const TouchRippleRipple = styled(Ripple, {
  5190. name: "MuiTouchRipple",
  5191. slot: "Ripple"
  5192. })(_t4 || (_t4 = _`
  5193. opacity: 0;
  5194. position: absolute;
  5195.  
  5196. &.${0} {
  5197. opacity: 0.3;
  5198. transform: scale(1);
  5199. animation-name: ${0};
  5200. animation-duration: ${0}ms;
  5201. animation-timing-function: ${0};
  5202. }
  5203.  
  5204. &.${0} {
  5205. animation-duration: ${0}ms;
  5206. }
  5207.  
  5208. & .${0} {
  5209. opacity: 1;
  5210. display: block;
  5211. width: 100%;
  5212. height: 100%;
  5213. border-radius: 50%;
  5214. background-color: currentColor;
  5215. }
  5216.  
  5217. & .${0} {
  5218. opacity: 0;
  5219. animation-name: ${0};
  5220. animation-duration: ${0}ms;
  5221. animation-timing-function: ${0};
  5222. }
  5223.  
  5224. & .${0} {
  5225. position: absolute;
  5226. /* @noflip */
  5227. left: 0px;
  5228. top: 0;
  5229. animation-name: ${0};
  5230. animation-duration: 2500ms;
  5231. animation-timing-function: ${0};
  5232. animation-iteration-count: infinite;
  5233. animation-delay: 200ms;
  5234. }
  5235. `), touchRippleClasses.rippleVisible, enterKeyframe, DURATION, ({
  5236. theme
  5237. }) => theme.transitions.easing.easeInOut, touchRippleClasses.ripplePulsate, ({
  5238. theme
  5239. }) => theme.transitions.duration.shorter, touchRippleClasses.child, touchRippleClasses.childLeaving, exitKeyframe, DURATION, ({
  5240. theme
  5241. }) => theme.transitions.easing.easeInOut, touchRippleClasses.childPulsate, pulsateKeyframe, ({
  5242. theme
  5243. }) => theme.transitions.easing.easeInOut);
  5244. const TouchRipple = /* @__PURE__ */ React__namespace.forwardRef(function TouchRipple2(inProps, ref) {
  5245. const props = useThemeProps({
  5246. props: inProps,
  5247. name: "MuiTouchRipple"
  5248. });
  5249. const {
  5250. center: centerProp = false,
  5251. classes = {},
  5252. className
  5253. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$a);
  5254. const [ripples, setRipples] = React__namespace.useState([]);
  5255. const nextKey = React__namespace.useRef(0);
  5256. const rippleCallback = React__namespace.useRef(null);
  5257. React__namespace.useEffect(() => {
  5258. if (rippleCallback.current) {
  5259. rippleCallback.current();
  5260. rippleCallback.current = null;
  5261. }
  5262. }, [ripples]);
  5263. const ignoringMouseDown = React__namespace.useRef(false);
  5264. const startTimer = useTimeout();
  5265. const startTimerCommit = React__namespace.useRef(null);
  5266. const container = React__namespace.useRef(null);
  5267. const startCommit = React__namespace.useCallback((params) => {
  5268. const {
  5269. pulsate: pulsate2,
  5270. rippleX,
  5271. rippleY,
  5272. rippleSize,
  5273. cb
  5274. } = params;
  5275. setRipples((oldRipples) => [...oldRipples, /* @__PURE__ */ jsxRuntimeExports.jsx(TouchRippleRipple, {
  5276. classes: {
  5277. ripple: clsx(classes.ripple, touchRippleClasses.ripple),
  5278. rippleVisible: clsx(classes.rippleVisible, touchRippleClasses.rippleVisible),
  5279. ripplePulsate: clsx(classes.ripplePulsate, touchRippleClasses.ripplePulsate),
  5280. child: clsx(classes.child, touchRippleClasses.child),
  5281. childLeaving: clsx(classes.childLeaving, touchRippleClasses.childLeaving),
  5282. childPulsate: clsx(classes.childPulsate, touchRippleClasses.childPulsate)
  5283. },
  5284. timeout: DURATION,
  5285. pulsate: pulsate2,
  5286. rippleX,
  5287. rippleY,
  5288. rippleSize
  5289. }, nextKey.current)]);
  5290. nextKey.current += 1;
  5291. rippleCallback.current = cb;
  5292. }, [classes]);
  5293. const start = React__namespace.useCallback((event = {}, options = {}, cb = () => {
  5294. }) => {
  5295. const {
  5296. pulsate: pulsate2 = false,
  5297. center = centerProp || options.pulsate,
  5298. fakeElement = false
  5299. // For test purposes
  5300. } = options;
  5301. if ((event == null ? void 0 : event.type) === "mousedown" && ignoringMouseDown.current) {
  5302. ignoringMouseDown.current = false;
  5303. return;
  5304. }
  5305. if ((event == null ? void 0 : event.type) === "touchstart") {
  5306. ignoringMouseDown.current = true;
  5307. }
  5308. const element = fakeElement ? null : container.current;
  5309. const rect = element ? element.getBoundingClientRect() : {
  5310. width: 0,
  5311. height: 0,
  5312. left: 0,
  5313. top: 0
  5314. };
  5315. let rippleX;
  5316. let rippleY;
  5317. let rippleSize;
  5318. if (center || event === void 0 || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
  5319. rippleX = Math.round(rect.width / 2);
  5320. rippleY = Math.round(rect.height / 2);
  5321. } else {
  5322. const {
  5323. clientX,
  5324. clientY
  5325. } = event.touches && event.touches.length > 0 ? event.touches[0] : event;
  5326. rippleX = Math.round(clientX - rect.left);
  5327. rippleY = Math.round(clientY - rect.top);
  5328. }
  5329. if (center) {
  5330. rippleSize = Math.sqrt((2 * rect.width ** 2 + rect.height ** 2) / 3);
  5331. if (rippleSize % 2 === 0) {
  5332. rippleSize += 1;
  5333. }
  5334. } else {
  5335. const sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;
  5336. const sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;
  5337. rippleSize = Math.sqrt(sizeX ** 2 + sizeY ** 2);
  5338. }
  5339. if (event != null && event.touches) {
  5340. if (startTimerCommit.current === null) {
  5341. startTimerCommit.current = () => {
  5342. startCommit({
  5343. pulsate: pulsate2,
  5344. rippleX,
  5345. rippleY,
  5346. rippleSize,
  5347. cb
  5348. });
  5349. };
  5350. startTimer.start(DELAY_RIPPLE, () => {
  5351. if (startTimerCommit.current) {
  5352. startTimerCommit.current();
  5353. startTimerCommit.current = null;
  5354. }
  5355. });
  5356. }
  5357. } else {
  5358. startCommit({
  5359. pulsate: pulsate2,
  5360. rippleX,
  5361. rippleY,
  5362. rippleSize,
  5363. cb
  5364. });
  5365. }
  5366. }, [centerProp, startCommit, startTimer]);
  5367. const pulsate = React__namespace.useCallback(() => {
  5368. start({}, {
  5369. pulsate: true
  5370. });
  5371. }, [start]);
  5372. const stop = React__namespace.useCallback((event, cb) => {
  5373. startTimer.clear();
  5374. if ((event == null ? void 0 : event.type) === "touchend" && startTimerCommit.current) {
  5375. startTimerCommit.current();
  5376. startTimerCommit.current = null;
  5377. startTimer.start(0, () => {
  5378. stop(event, cb);
  5379. });
  5380. return;
  5381. }
  5382. startTimerCommit.current = null;
  5383. setRipples((oldRipples) => {
  5384. if (oldRipples.length > 0) {
  5385. return oldRipples.slice(1);
  5386. }
  5387. return oldRipples;
  5388. });
  5389. rippleCallback.current = cb;
  5390. }, [startTimer]);
  5391. React__namespace.useImperativeHandle(ref, () => ({
  5392. pulsate,
  5393. start,
  5394. stop
  5395. }), [pulsate, start, stop]);
  5396. return /* @__PURE__ */ jsxRuntimeExports.jsx(TouchRippleRoot, _extends$1({
  5397. className: clsx(touchRippleClasses.root, classes.root, className),
  5398. ref: container
  5399. }, other, {
  5400. children: /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionGroup$1, {
  5401. component: null,
  5402. exit: true,
  5403. children: ripples
  5404. })
  5405. }));
  5406. });
  5407. const TouchRipple$1 = TouchRipple;
  5408. function getButtonBaseUtilityClass(slot) {
  5409. return generateUtilityClass("MuiButtonBase", slot);
  5410. }
  5411. const buttonBaseClasses = generateUtilityClasses("MuiButtonBase", ["root", "disabled", "focusVisible"]);
  5412. const _excluded$9 = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type"];
  5413. const useUtilityClasses$5 = (ownerState) => {
  5414. const {
  5415. disabled,
  5416. focusVisible,
  5417. focusVisibleClassName,
  5418. classes
  5419. } = ownerState;
  5420. const slots = {
  5421. root: ["root", disabled && "disabled", focusVisible && "focusVisible"]
  5422. };
  5423. const composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);
  5424. if (focusVisible && focusVisibleClassName) {
  5425. composedClasses.root += ` ${focusVisibleClassName}`;
  5426. }
  5427. return composedClasses;
  5428. };
  5429. const ButtonBaseRoot = styled("button", {
  5430. name: "MuiButtonBase",
  5431. slot: "Root",
  5432. overridesResolver: (props, styles2) => styles2.root
  5433. })({
  5434. display: "inline-flex",
  5435. alignItems: "center",
  5436. justifyContent: "center",
  5437. position: "relative",
  5438. boxSizing: "border-box",
  5439. WebkitTapHighlightColor: "transparent",
  5440. backgroundColor: "transparent",
  5441. // Reset default value
  5442. // We disable the focus ring for mouse, touch and keyboard users.
  5443. outline: 0,
  5444. border: 0,
  5445. margin: 0,
  5446. // Remove the margin in Safari
  5447. borderRadius: 0,
  5448. padding: 0,
  5449. // Remove the padding in Firefox
  5450. cursor: "pointer",
  5451. userSelect: "none",
  5452. verticalAlign: "middle",
  5453. MozAppearance: "none",
  5454. // Reset
  5455. WebkitAppearance: "none",
  5456. // Reset
  5457. textDecoration: "none",
  5458. // So we take precedent over the style of a native <a /> element.
  5459. color: "inherit",
  5460. "&::-moz-focus-inner": {
  5461. borderStyle: "none"
  5462. // Remove Firefox dotted outline.
  5463. },
  5464. [`&.${buttonBaseClasses.disabled}`]: {
  5465. pointerEvents: "none",
  5466. // Disable link interactions
  5467. cursor: "default"
  5468. },
  5469. "@media print": {
  5470. colorAdjust: "exact"
  5471. }
  5472. });
  5473. const ButtonBase = /* @__PURE__ */ React__namespace.forwardRef(function ButtonBase2(inProps, ref) {
  5474. const props = useThemeProps({
  5475. props: inProps,
  5476. name: "MuiButtonBase"
  5477. });
  5478. const {
  5479. action,
  5480. centerRipple = false,
  5481. children,
  5482. className,
  5483. component = "button",
  5484. disabled = false,
  5485. disableRipple = false,
  5486. disableTouchRipple = false,
  5487. focusRipple = false,
  5488. LinkComponent = "a",
  5489. onBlur,
  5490. onClick,
  5491. onContextMenu,
  5492. onDragLeave,
  5493. onFocus,
  5494. onFocusVisible,
  5495. onKeyDown,
  5496. onKeyUp,
  5497. onMouseDown,
  5498. onMouseLeave,
  5499. onMouseUp,
  5500. onTouchEnd,
  5501. onTouchMove,
  5502. onTouchStart,
  5503. tabIndex = 0,
  5504. TouchRippleProps,
  5505. touchRippleRef,
  5506. type
  5507. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$9);
  5508. const buttonRef = React__namespace.useRef(null);
  5509. const rippleRef = React__namespace.useRef(null);
  5510. const handleRippleRef = useForkRef(rippleRef, touchRippleRef);
  5511. const {
  5512. isFocusVisibleRef,
  5513. onFocus: handleFocusVisible,
  5514. onBlur: handleBlurVisible,
  5515. ref: focusVisibleRef
  5516. } = useIsFocusVisible();
  5517. const [focusVisible, setFocusVisible] = React__namespace.useState(false);
  5518. if (disabled && focusVisible) {
  5519. setFocusVisible(false);
  5520. }
  5521. React__namespace.useImperativeHandle(action, () => ({
  5522. focusVisible: () => {
  5523. setFocusVisible(true);
  5524. buttonRef.current.focus();
  5525. }
  5526. }), []);
  5527. const [mountedState, setMountedState] = React__namespace.useState(false);
  5528. React__namespace.useEffect(() => {
  5529. setMountedState(true);
  5530. }, []);
  5531. const enableTouchRipple = mountedState && !disableRipple && !disabled;
  5532. React__namespace.useEffect(() => {
  5533. if (focusVisible && focusRipple && !disableRipple && mountedState) {
  5534. rippleRef.current.pulsate();
  5535. }
  5536. }, [disableRipple, focusRipple, focusVisible, mountedState]);
  5537. function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {
  5538. return useEventCallback((event) => {
  5539. if (eventCallback) {
  5540. eventCallback(event);
  5541. }
  5542. const ignore = skipRippleAction;
  5543. if (!ignore && rippleRef.current) {
  5544. rippleRef.current[rippleAction](event);
  5545. }
  5546. return true;
  5547. });
  5548. }
  5549. const handleMouseDown = useRippleHandler("start", onMouseDown);
  5550. const handleContextMenu = useRippleHandler("stop", onContextMenu);
  5551. const handleDragLeave = useRippleHandler("stop", onDragLeave);
  5552. const handleMouseUp = useRippleHandler("stop", onMouseUp);
  5553. const handleMouseLeave = useRippleHandler("stop", (event) => {
  5554. if (focusVisible) {
  5555. event.preventDefault();
  5556. }
  5557. if (onMouseLeave) {
  5558. onMouseLeave(event);
  5559. }
  5560. });
  5561. const handleTouchStart = useRippleHandler("start", onTouchStart);
  5562. const handleTouchEnd = useRippleHandler("stop", onTouchEnd);
  5563. const handleTouchMove = useRippleHandler("stop", onTouchMove);
  5564. const handleBlur = useRippleHandler("stop", (event) => {
  5565. handleBlurVisible(event);
  5566. if (isFocusVisibleRef.current === false) {
  5567. setFocusVisible(false);
  5568. }
  5569. if (onBlur) {
  5570. onBlur(event);
  5571. }
  5572. }, false);
  5573. const handleFocus = useEventCallback((event) => {
  5574. if (!buttonRef.current) {
  5575. buttonRef.current = event.currentTarget;
  5576. }
  5577. handleFocusVisible(event);
  5578. if (isFocusVisibleRef.current === true) {
  5579. setFocusVisible(true);
  5580. if (onFocusVisible) {
  5581. onFocusVisible(event);
  5582. }
  5583. }
  5584. if (onFocus) {
  5585. onFocus(event);
  5586. }
  5587. });
  5588. const isNonNativeButton = () => {
  5589. const button = buttonRef.current;
  5590. return component && component !== "button" && !(button.tagName === "A" && button.href);
  5591. };
  5592. const keydownRef = React__namespace.useRef(false);
  5593. const handleKeyDown2 = useEventCallback((event) => {
  5594. if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === " ") {
  5595. keydownRef.current = true;
  5596. rippleRef.current.stop(event, () => {
  5597. rippleRef.current.start(event);
  5598. });
  5599. }
  5600. if (event.target === event.currentTarget && isNonNativeButton() && event.key === " ") {
  5601. event.preventDefault();
  5602. }
  5603. if (onKeyDown) {
  5604. onKeyDown(event);
  5605. }
  5606. if (event.target === event.currentTarget && isNonNativeButton() && event.key === "Enter" && !disabled) {
  5607. event.preventDefault();
  5608. if (onClick) {
  5609. onClick(event);
  5610. }
  5611. }
  5612. });
  5613. const handleKeyUp = useEventCallback((event) => {
  5614. if (focusRipple && event.key === " " && rippleRef.current && focusVisible && !event.defaultPrevented) {
  5615. keydownRef.current = false;
  5616. rippleRef.current.stop(event, () => {
  5617. rippleRef.current.pulsate(event);
  5618. });
  5619. }
  5620. if (onKeyUp) {
  5621. onKeyUp(event);
  5622. }
  5623. if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === " " && !event.defaultPrevented) {
  5624. onClick(event);
  5625. }
  5626. });
  5627. let ComponentProp = component;
  5628. if (ComponentProp === "button" && (other.href || other.to)) {
  5629. ComponentProp = LinkComponent;
  5630. }
  5631. const buttonProps = {};
  5632. if (ComponentProp === "button") {
  5633. buttonProps.type = type === void 0 ? "button" : type;
  5634. buttonProps.disabled = disabled;
  5635. } else {
  5636. if (!other.href && !other.to) {
  5637. buttonProps.role = "button";
  5638. }
  5639. if (disabled) {
  5640. buttonProps["aria-disabled"] = disabled;
  5641. }
  5642. }
  5643. const handleRef = useForkRef(ref, focusVisibleRef, buttonRef);
  5644. const ownerState = _extends$1({}, props, {
  5645. centerRipple,
  5646. component,
  5647. disabled,
  5648. disableRipple,
  5649. disableTouchRipple,
  5650. focusRipple,
  5651. tabIndex,
  5652. focusVisible
  5653. });
  5654. const classes = useUtilityClasses$5(ownerState);
  5655. return /* @__PURE__ */ jsxRuntimeExports.jsxs(ButtonBaseRoot, _extends$1({
  5656. as: ComponentProp,
  5657. className: clsx(classes.root, className),
  5658. ownerState,
  5659. onBlur: handleBlur,
  5660. onClick,
  5661. onContextMenu: handleContextMenu,
  5662. onFocus: handleFocus,
  5663. onKeyDown: handleKeyDown2,
  5664. onKeyUp: handleKeyUp,
  5665. onMouseDown: handleMouseDown,
  5666. onMouseLeave: handleMouseLeave,
  5667. onMouseUp: handleMouseUp,
  5668. onDragLeave: handleDragLeave,
  5669. onTouchEnd: handleTouchEnd,
  5670. onTouchMove: handleTouchMove,
  5671. onTouchStart: handleTouchStart,
  5672. ref: handleRef,
  5673. tabIndex: disabled ? -1 : tabIndex,
  5674. type
  5675. }, buttonProps, other, {
  5676. children: [children, enableTouchRipple ? (
  5677. /* TouchRipple is only needed client-side, x2 boost on the server. */
  5678. /* @__PURE__ */ jsxRuntimeExports.jsx(TouchRipple$1, _extends$1({
  5679. ref: handleRippleRef,
  5680. center: centerRipple
  5681. }, TouchRippleProps))
  5682. ) : null]
  5683. }));
  5684. });
  5685. const ButtonBase$1 = ButtonBase;
  5686. function getButtonUtilityClass(slot) {
  5687. return generateUtilityClass("MuiButton", slot);
  5688. }
  5689. const buttonClasses = generateUtilityClasses("MuiButton", ["root", "text", "textInherit", "textPrimary", "textSecondary", "textSuccess", "textError", "textInfo", "textWarning", "outlined", "outlinedInherit", "outlinedPrimary", "outlinedSecondary", "outlinedSuccess", "outlinedError", "outlinedInfo", "outlinedWarning", "contained", "containedInherit", "containedPrimary", "containedSecondary", "containedSuccess", "containedError", "containedInfo", "containedWarning", "disableElevation", "focusVisible", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorSuccess", "colorError", "colorInfo", "colorWarning", "textSizeSmall", "textSizeMedium", "textSizeLarge", "outlinedSizeSmall", "outlinedSizeMedium", "outlinedSizeLarge", "containedSizeSmall", "containedSizeMedium", "containedSizeLarge", "sizeMedium", "sizeSmall", "sizeLarge", "fullWidth", "startIcon", "endIcon", "icon", "iconSizeSmall", "iconSizeMedium", "iconSizeLarge"]);
  5690. const buttonClasses$1 = buttonClasses;
  5691. const ButtonGroupContext = /* @__PURE__ */ React__namespace.createContext({});
  5692. const ButtonGroupContext$1 = ButtonGroupContext;
  5693. const ButtonGroupButtonContext = /* @__PURE__ */ React__namespace.createContext(void 0);
  5694. const ButtonGroupButtonContext$1 = ButtonGroupButtonContext;
  5695. const _excluded$8 = ["children", "color", "component", "className", "disabled", "disableElevation", "disableFocusRipple", "endIcon", "focusVisibleClassName", "fullWidth", "size", "startIcon", "type", "variant"];
  5696. const useUtilityClasses$4 = (ownerState) => {
  5697. const {
  5698. color: color2,
  5699. disableElevation,
  5700. fullWidth,
  5701. size,
  5702. variant,
  5703. classes
  5704. } = ownerState;
  5705. const slots = {
  5706. root: ["root", variant, `${variant}${capitalize$1(color2)}`, `size${capitalize$1(size)}`, `${variant}Size${capitalize$1(size)}`, `color${capitalize$1(color2)}`, disableElevation && "disableElevation", fullWidth && "fullWidth"],
  5707. label: ["label"],
  5708. startIcon: ["icon", "startIcon", `iconSize${capitalize$1(size)}`],
  5709. endIcon: ["icon", "endIcon", `iconSize${capitalize$1(size)}`]
  5710. };
  5711. const composedClasses = composeClasses(slots, getButtonUtilityClass, classes);
  5712. return _extends$1({}, classes, composedClasses);
  5713. };
  5714. const commonIconStyles = (ownerState) => _extends$1({}, ownerState.size === "small" && {
  5715. "& > *:nth-of-type(1)": {
  5716. fontSize: 18
  5717. }
  5718. }, ownerState.size === "medium" && {
  5719. "& > *:nth-of-type(1)": {
  5720. fontSize: 20
  5721. }
  5722. }, ownerState.size === "large" && {
  5723. "& > *:nth-of-type(1)": {
  5724. fontSize: 22
  5725. }
  5726. });
  5727. const ButtonRoot = styled(ButtonBase$1, {
  5728. shouldForwardProp: (prop) => rootShouldForwardProp(prop) || prop === "classes",
  5729. name: "MuiButton",
  5730. slot: "Root",
  5731. overridesResolver: (props, styles2) => {
  5732. const {
  5733. ownerState
  5734. } = props;
  5735. return [styles2.root, styles2[ownerState.variant], styles2[`${ownerState.variant}${capitalize$1(ownerState.color)}`], styles2[`size${capitalize$1(ownerState.size)}`], styles2[`${ownerState.variant}Size${capitalize$1(ownerState.size)}`], ownerState.color === "inherit" && styles2.colorInherit, ownerState.disableElevation && styles2.disableElevation, ownerState.fullWidth && styles2.fullWidth];
  5736. }
  5737. })(({
  5738. theme,
  5739. ownerState
  5740. }) => {
  5741. var _theme$palette$getCon, _theme$palette;
  5742. const inheritContainedBackgroundColor = theme.palette.mode === "light" ? theme.palette.grey[300] : theme.palette.grey[800];
  5743. const inheritContainedHoverBackgroundColor = theme.palette.mode === "light" ? theme.palette.grey.A100 : theme.palette.grey[700];
  5744. return _extends$1({}, theme.typography.button, {
  5745. minWidth: 64,
  5746. padding: "6px 16px",
  5747. borderRadius: (theme.vars || theme).shape.borderRadius,
  5748. transition: theme.transitions.create(["background-color", "box-shadow", "border-color", "color"], {
  5749. duration: theme.transitions.duration.short
  5750. }),
  5751. "&:hover": _extends$1({
  5752. textDecoration: "none",
  5753. backgroundColor: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha_1(theme.palette.text.primary, theme.palette.action.hoverOpacity),
  5754. // Reset on touch devices, it doesn't add specificity
  5755. "@media (hover: none)": {
  5756. backgroundColor: "transparent"
  5757. }
  5758. }, ownerState.variant === "text" && ownerState.color !== "inherit" && {
  5759. backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha_1(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
  5760. // Reset on touch devices, it doesn't add specificity
  5761. "@media (hover: none)": {
  5762. backgroundColor: "transparent"
  5763. }
  5764. }, ownerState.variant === "outlined" && ownerState.color !== "inherit" && {
  5765. border: `1px solid ${(theme.vars || theme).palette[ownerState.color].main}`,
  5766. backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha_1(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
  5767. // Reset on touch devices, it doesn't add specificity
  5768. "@media (hover: none)": {
  5769. backgroundColor: "transparent"
  5770. }
  5771. }, ownerState.variant === "contained" && {
  5772. backgroundColor: theme.vars ? theme.vars.palette.Button.inheritContainedHoverBg : inheritContainedHoverBackgroundColor,
  5773. boxShadow: (theme.vars || theme).shadows[4],
  5774. // Reset on touch devices, it doesn't add specificity
  5775. "@media (hover: none)": {
  5776. boxShadow: (theme.vars || theme).shadows[2],
  5777. backgroundColor: (theme.vars || theme).palette.grey[300]
  5778. }
  5779. }, ownerState.variant === "contained" && ownerState.color !== "inherit" && {
  5780. backgroundColor: (theme.vars || theme).palette[ownerState.color].dark,
  5781. // Reset on touch devices, it doesn't add specificity
  5782. "@media (hover: none)": {
  5783. backgroundColor: (theme.vars || theme).palette[ownerState.color].main
  5784. }
  5785. }),
  5786. "&:active": _extends$1({}, ownerState.variant === "contained" && {
  5787. boxShadow: (theme.vars || theme).shadows[8]
  5788. }),
  5789. [`&.${buttonClasses$1.focusVisible}`]: _extends$1({}, ownerState.variant === "contained" && {
  5790. boxShadow: (theme.vars || theme).shadows[6]
  5791. }),
  5792. [`&.${buttonClasses$1.disabled}`]: _extends$1({
  5793. color: (theme.vars || theme).palette.action.disabled
  5794. }, ownerState.variant === "outlined" && {
  5795. border: `1px solid ${(theme.vars || theme).palette.action.disabledBackground}`
  5796. }, ownerState.variant === "contained" && {
  5797. color: (theme.vars || theme).palette.action.disabled,
  5798. boxShadow: (theme.vars || theme).shadows[0],
  5799. backgroundColor: (theme.vars || theme).palette.action.disabledBackground
  5800. })
  5801. }, ownerState.variant === "text" && {
  5802. padding: "6px 8px"
  5803. }, ownerState.variant === "text" && ownerState.color !== "inherit" && {
  5804. color: (theme.vars || theme).palette[ownerState.color].main
  5805. }, ownerState.variant === "outlined" && {
  5806. padding: "5px 15px",
  5807. border: "1px solid currentColor"
  5808. }, ownerState.variant === "outlined" && ownerState.color !== "inherit" && {
  5809. color: (theme.vars || theme).palette[ownerState.color].main,
  5810. border: theme.vars ? `1px solid rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.5)` : `1px solid ${alpha_1(theme.palette[ownerState.color].main, 0.5)}`
  5811. }, ownerState.variant === "contained" && {
  5812. color: theme.vars ? (
  5813. // this is safe because grey does not change between default light/dark mode
  5814. theme.vars.palette.text.primary
  5815. ) : (_theme$palette$getCon = (_theme$palette = theme.palette).getContrastText) == null ? void 0 : _theme$palette$getCon.call(_theme$palette, theme.palette.grey[300]),
  5816. backgroundColor: theme.vars ? theme.vars.palette.Button.inheritContainedBg : inheritContainedBackgroundColor,
  5817. boxShadow: (theme.vars || theme).shadows[2]
  5818. }, ownerState.variant === "contained" && ownerState.color !== "inherit" && {
  5819. color: (theme.vars || theme).palette[ownerState.color].contrastText,
  5820. backgroundColor: (theme.vars || theme).palette[ownerState.color].main
  5821. }, ownerState.color === "inherit" && {
  5822. color: "inherit",
  5823. borderColor: "currentColor"
  5824. }, ownerState.size === "small" && ownerState.variant === "text" && {
  5825. padding: "4px 5px",
  5826. fontSize: theme.typography.pxToRem(13)
  5827. }, ownerState.size === "large" && ownerState.variant === "text" && {
  5828. padding: "8px 11px",
  5829. fontSize: theme.typography.pxToRem(15)
  5830. }, ownerState.size === "small" && ownerState.variant === "outlined" && {
  5831. padding: "3px 9px",
  5832. fontSize: theme.typography.pxToRem(13)
  5833. }, ownerState.size === "large" && ownerState.variant === "outlined" && {
  5834. padding: "7px 21px",
  5835. fontSize: theme.typography.pxToRem(15)
  5836. }, ownerState.size === "small" && ownerState.variant === "contained" && {
  5837. padding: "4px 10px",
  5838. fontSize: theme.typography.pxToRem(13)
  5839. }, ownerState.size === "large" && ownerState.variant === "contained" && {
  5840. padding: "8px 22px",
  5841. fontSize: theme.typography.pxToRem(15)
  5842. }, ownerState.fullWidth && {
  5843. width: "100%"
  5844. });
  5845. }, ({
  5846. ownerState
  5847. }) => ownerState.disableElevation && {
  5848. boxShadow: "none",
  5849. "&:hover": {
  5850. boxShadow: "none"
  5851. },
  5852. [`&.${buttonClasses$1.focusVisible}`]: {
  5853. boxShadow: "none"
  5854. },
  5855. "&:active": {
  5856. boxShadow: "none"
  5857. },
  5858. [`&.${buttonClasses$1.disabled}`]: {
  5859. boxShadow: "none"
  5860. }
  5861. });
  5862. const ButtonStartIcon = styled("span", {
  5863. name: "MuiButton",
  5864. slot: "StartIcon",
  5865. overridesResolver: (props, styles2) => {
  5866. const {
  5867. ownerState
  5868. } = props;
  5869. return [styles2.startIcon, styles2[`iconSize${capitalize$1(ownerState.size)}`]];
  5870. }
  5871. })(({
  5872. ownerState
  5873. }) => _extends$1({
  5874. display: "inherit",
  5875. marginRight: 8,
  5876. marginLeft: -4
  5877. }, ownerState.size === "small" && {
  5878. marginLeft: -2
  5879. }, commonIconStyles(ownerState)));
  5880. const ButtonEndIcon = styled("span", {
  5881. name: "MuiButton",
  5882. slot: "EndIcon",
  5883. overridesResolver: (props, styles2) => {
  5884. const {
  5885. ownerState
  5886. } = props;
  5887. return [styles2.endIcon, styles2[`iconSize${capitalize$1(ownerState.size)}`]];
  5888. }
  5889. })(({
  5890. ownerState
  5891. }) => _extends$1({
  5892. display: "inherit",
  5893. marginRight: -4,
  5894. marginLeft: 8
  5895. }, ownerState.size === "small" && {
  5896. marginRight: -2
  5897. }, commonIconStyles(ownerState)));
  5898. const Button = /* @__PURE__ */ React__namespace.forwardRef(function Button2(inProps, ref) {
  5899. const contextProps = React__namespace.useContext(ButtonGroupContext$1);
  5900. const buttonGroupButtonContextPositionClassName = React__namespace.useContext(ButtonGroupButtonContext$1);
  5901. const resolvedProps = resolveProps(contextProps, inProps);
  5902. const props = useThemeProps({
  5903. props: resolvedProps,
  5904. name: "MuiButton"
  5905. });
  5906. const {
  5907. children,
  5908. color: color2 = "primary",
  5909. component = "button",
  5910. className,
  5911. disabled = false,
  5912. disableElevation = false,
  5913. disableFocusRipple = false,
  5914. endIcon: endIconProp,
  5915. focusVisibleClassName,
  5916. fullWidth = false,
  5917. size = "medium",
  5918. startIcon: startIconProp,
  5919. type,
  5920. variant = "text"
  5921. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$8);
  5922. const ownerState = _extends$1({}, props, {
  5923. color: color2,
  5924. component,
  5925. disabled,
  5926. disableElevation,
  5927. disableFocusRipple,
  5928. fullWidth,
  5929. size,
  5930. type,
  5931. variant
  5932. });
  5933. const classes = useUtilityClasses$4(ownerState);
  5934. const startIcon = startIconProp && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonStartIcon, {
  5935. className: classes.startIcon,
  5936. ownerState,
  5937. children: startIconProp
  5938. });
  5939. const endIcon = endIconProp && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonEndIcon, {
  5940. className: classes.endIcon,
  5941. ownerState,
  5942. children: endIconProp
  5943. });
  5944. const positionClassName = buttonGroupButtonContextPositionClassName || "";
  5945. return /* @__PURE__ */ jsxRuntimeExports.jsxs(ButtonRoot, _extends$1({
  5946. ownerState,
  5947. className: clsx(contextProps.className, classes.root, className, positionClassName),
  5948. component,
  5949. disabled,
  5950. focusRipple: !disableFocusRipple,
  5951. focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),
  5952. ref,
  5953. type
  5954. }, other, {
  5955. classes,
  5956. children: [startIcon, children, endIcon]
  5957. }));
  5958. });
  5959. const Button$1 = Button;
  5960. function useTheme() {
  5961. const theme = useTheme$2(defaultTheme$2);
  5962. return theme[THEME_ID] || theme;
  5963. }
  5964. const _excluded$7 = ["theme"];
  5965. function ThemeProvider$1(_ref) {
  5966. let {
  5967. theme: themeInput
  5968. } = _ref, props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
  5969. const scopedTheme = themeInput[THEME_ID];
  5970. return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider$2, _extends$1({}, props, {
  5971. themeId: scopedTheme ? THEME_ID : void 0,
  5972. theme: scopedTheme || themeInput
  5973. }));
  5974. }
  5975. const getOverlayAlpha = (elevation) => {
  5976. let alphaValue;
  5977. if (elevation < 1) {
  5978. alphaValue = 5.11916 * elevation ** 2;
  5979. } else {
  5980. alphaValue = 4.5 * Math.log(elevation + 1) + 2;
  5981. }
  5982. return (alphaValue / 100).toFixed(2);
  5983. };
  5984. const StyledPandoraButton = styled(Button$1, {
  5985. shouldForwardProp: (fieldName) => filterForwardProps(fieldName, ["openPandora", "buttonVisible", "buttonPosition"])
  5986. })(
  5987. ({ buttonPosition = "right", openPandora = false, buttonVisible = false, theme }) => {
  5988. const { transitions } = theme;
  5989. const baseStyle = {
  5990. position: "fixed"
  5991. };
  5992. switch (buttonPosition) {
  5993. case "top":
  5994. return {
  5995. ...baseStyle,
  5996. left: "50%",
  5997. top: 0,
  5998. transition: transitions.create(["top"], {
  5999. easing: transitions.easing.sharp,
  6000. duration: transitions.duration.shorter
  6001. }),
  6002. ...openPandora && {
  6003. top: uiConfig.pandoraDrawerWidth,
  6004. transition: transitions.create(["top"], {
  6005. easing: transitions.easing.sharp,
  6006. duration: transitions.duration.enteringScreen
  6007. })
  6008. }
  6009. };
  6010. case "right":
  6011. return {
  6012. ...baseStyle,
  6013. top: "50%",
  6014. right: 0,
  6015. transform: "translateX(60%) rotate(-90deg)",
  6016. transition: transitions.create(["right", "transform"], {
  6017. easing: transitions.easing.sharp,
  6018. duration: transitions.duration.shorter
  6019. }),
  6020. ...buttonVisible && {
  6021. transform: "translateX(28%) rotate(-90deg)",
  6022. transition: transitions.create(["right", "transform"], {
  6023. easing: transitions.easing.sharp,
  6024. duration: transitions.duration.enteringScreen
  6025. })
  6026. },
  6027. ...openPandora && {
  6028. right: uiConfig.pandoraDrawerWidth,
  6029. transform: "translateX(28%) rotate(-90deg)",
  6030. transition: transitions.create(["right", "transform"], {
  6031. easing: transitions.easing.sharp,
  6032. duration: transitions.duration.enteringScreen
  6033. })
  6034. }
  6035. };
  6036. case "bottom":
  6037. return {
  6038. ...baseStyle,
  6039. left: "50%",
  6040. bottom: 0,
  6041. transition: transitions.create(["bottom"], {
  6042. easing: transitions.easing.sharp,
  6043. duration: transitions.duration.shorter
  6044. }),
  6045. ...openPandora && {
  6046. left: uiConfig.pandoraDrawerWidth,
  6047. transition: transitions.create(["bottom"], {
  6048. easing: transitions.easing.sharp,
  6049. duration: transitions.duration.enteringScreen
  6050. })
  6051. }
  6052. };
  6053. case "left":
  6054. return {
  6055. ...baseStyle,
  6056. top: "50%",
  6057. left: 0,
  6058. transition: transitions.create(["left"], {
  6059. easing: transitions.easing.sharp,
  6060. duration: transitions.duration.shorter
  6061. }),
  6062. ...openPandora && {
  6063. left: uiConfig.pandoraDrawerWidth,
  6064. transition: transitions.create(["left"], {
  6065. easing: transitions.easing.sharp,
  6066. duration: transitions.duration.enteringScreen
  6067. })
  6068. }
  6069. };
  6070. default:
  6071. return {
  6072. ...baseStyle,
  6073. top: "50%",
  6074. right: 0,
  6075. transition: transitions.create(["right"], {
  6076. easing: transitions.easing.sharp,
  6077. duration: transitions.duration.shorter
  6078. }),
  6079. ...openPandora && {
  6080. right: uiConfig.pandoraDrawerWidth,
  6081. transition: transitions.create(["right"], {
  6082. easing: transitions.easing.sharp,
  6083. duration: transitions.duration.enteringScreen
  6084. })
  6085. }
  6086. };
  6087. }
  6088. }
  6089. );
  6090. function PandoraButton({ openPandora = false, pandoraButtonPosition = "right", ...restProps }) {
  6091. const visibleTimeout = React.useRef();
  6092. const [visible, setVisible] = React.useState(false);
  6093. const handleMouseEnter = () => {
  6094. clearTimeout(visibleTimeout.current);
  6095. setVisible(true);
  6096. };
  6097. const handleMouseLeave = () => {
  6098. visibleTimeout.current = setTimeout(() => setVisible(false), 1500);
  6099. };
  6100. return /* @__PURE__ */ jsxRuntimeExports.jsx(
  6101. StyledPandoraButton,
  6102. {
  6103. variant: "contained",
  6104. openPandora,
  6105. buttonPosition: pandoraButtonPosition,
  6106. buttonVisible: visible,
  6107. onMouseEnter: handleMouseEnter,
  6108. onMouseLeave: handleMouseLeave,
  6109. ...restProps,
  6110. children: openPandora ? "关闭助手" : "打开助手"
  6111. }
  6112. );
  6113. }
  6114. const qsFilter = (selector) => {
  6115. return selector;
  6116. };
  6117. const qsOne = (selectorOrElement, scopedSelector) => {
  6118. if (!scopedSelector) {
  6119. return document.querySelector(qsFilter(selectorOrElement));
  6120. }
  6121. return selectorOrElement.querySelector(qsFilter(scopedSelector));
  6122. };
  6123. const getCsrfToken = () => {
  6124. const csrfTokenMetaDom = qsOne('meta[name="csrf-token"]');
  6125. if (csrfTokenMetaDom) {
  6126. return csrfTokenMetaDom.getAttribute("content");
  6127. }
  6128. return null;
  6129. };
  6130. const getPreloadedData = () => {
  6131. const preloadedDataDom = qsOne("#data-preloaded");
  6132. if (preloadedDataDom) {
  6133. const preloadedStringData = preloadedDataDom.getAttribute("data-preloaded");
  6134. if (preloadedStringData) {
  6135. try {
  6136. const preloadedRawData = JSON.parse(preloadedStringData);
  6137. const preloadedData = {
  6138. currentUser: null,
  6139. topicTrackingStates: null
  6140. };
  6141. try {
  6142. preloadedData.currentUser = JSON.parse(preloadedRawData.currentUser);
  6143. } catch {
  6144. }
  6145. try {
  6146. preloadedData.topicTrackingStates = JSON.parse(preloadedRawData.topicTrackingStates);
  6147. } catch {
  6148. }
  6149. return preloadedData;
  6150. } catch {
  6151. return null;
  6152. }
  6153. }
  6154. return null;
  6155. }
  6156. return null;
  6157. };
  6158. const getPreloadedUsername = () => {
  6159. const preloadedData = getPreloadedData();
  6160. if (preloadedData && preloadedData.currentUser) {
  6161. const { username } = preloadedData.currentUser;
  6162. return username;
  6163. }
  6164. return null;
  6165. };
  6166. const reflow = (node2) => node2.scrollTop;
  6167. function getTransitionProps(props, options) {
  6168. var _style$transitionDura, _style$transitionTimi;
  6169. const {
  6170. timeout,
  6171. easing: easing2,
  6172. style: style2 = {}
  6173. } = props;
  6174. return {
  6175. duration: (_style$transitionDura = style2.transitionDuration) != null ? _style$transitionDura : typeof timeout === "number" ? timeout : timeout[options.mode] || 0,
  6176. easing: (_style$transitionTimi = style2.transitionTimingFunction) != null ? _style$transitionTimi : typeof easing2 === "object" ? easing2[options.mode] : easing2,
  6177. delay: style2.transitionDelay
  6178. };
  6179. }
  6180. function getPaperUtilityClass(slot) {
  6181. return generateUtilityClass("MuiPaper", slot);
  6182. }
  6183. generateUtilityClasses("MuiPaper", ["root", "rounded", "outlined", "elevation", "elevation0", "elevation1", "elevation2", "elevation3", "elevation4", "elevation5", "elevation6", "elevation7", "elevation8", "elevation9", "elevation10", "elevation11", "elevation12", "elevation13", "elevation14", "elevation15", "elevation16", "elevation17", "elevation18", "elevation19", "elevation20", "elevation21", "elevation22", "elevation23", "elevation24"]);
  6184. const _excluded$6 = ["className", "component", "elevation", "square", "variant"];
  6185. const useUtilityClasses$3 = (ownerState) => {
  6186. const {
  6187. square,
  6188. elevation,
  6189. variant,
  6190. classes
  6191. } = ownerState;
  6192. const slots = {
  6193. root: ["root", variant, !square && "rounded", variant === "elevation" && `elevation${elevation}`]
  6194. };
  6195. return composeClasses(slots, getPaperUtilityClass, classes);
  6196. };
  6197. const PaperRoot = styled("div", {
  6198. name: "MuiPaper",
  6199. slot: "Root",
  6200. overridesResolver: (props, styles2) => {
  6201. const {
  6202. ownerState
  6203. } = props;
  6204. return [styles2.root, styles2[ownerState.variant], !ownerState.square && styles2.rounded, ownerState.variant === "elevation" && styles2[`elevation${ownerState.elevation}`]];
  6205. }
  6206. })(({
  6207. theme,
  6208. ownerState
  6209. }) => {
  6210. var _theme$vars$overlays;
  6211. return _extends$1({
  6212. backgroundColor: (theme.vars || theme).palette.background.paper,
  6213. color: (theme.vars || theme).palette.text.primary,
  6214. transition: theme.transitions.create("box-shadow")
  6215. }, !ownerState.square && {
  6216. borderRadius: theme.shape.borderRadius
  6217. }, ownerState.variant === "outlined" && {
  6218. border: `1px solid ${(theme.vars || theme).palette.divider}`
  6219. }, ownerState.variant === "elevation" && _extends$1({
  6220. boxShadow: (theme.vars || theme).shadows[ownerState.elevation]
  6221. }, !theme.vars && theme.palette.mode === "dark" && {
  6222. backgroundImage: `linear-gradient(${alpha_1("#fff", getOverlayAlpha(ownerState.elevation))}, ${alpha_1("#fff", getOverlayAlpha(ownerState.elevation))})`
  6223. }, theme.vars && {
  6224. backgroundImage: (_theme$vars$overlays = theme.vars.overlays) == null ? void 0 : _theme$vars$overlays[ownerState.elevation]
  6225. }));
  6226. });
  6227. const Paper = /* @__PURE__ */ React__namespace.forwardRef(function Paper2(inProps, ref) {
  6228. const props = useThemeProps({
  6229. props: inProps,
  6230. name: "MuiPaper"
  6231. });
  6232. const {
  6233. className,
  6234. component = "div",
  6235. elevation = 1,
  6236. square = false,
  6237. variant = "elevation"
  6238. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$6);
  6239. const ownerState = _extends$1({}, props, {
  6240. component,
  6241. elevation,
  6242. square,
  6243. variant
  6244. });
  6245. const classes = useUtilityClasses$3(ownerState);
  6246. return /* @__PURE__ */ jsxRuntimeExports.jsx(PaperRoot, _extends$1({
  6247. as: component,
  6248. ownerState,
  6249. className: clsx(classes.root, className),
  6250. ref
  6251. }, other));
  6252. });
  6253. const Paper$1 = Paper;
  6254. function isHostComponent(element) {
  6255. return typeof element === "string";
  6256. }
  6257. function appendOwnerState(elementType, otherProps, ownerState) {
  6258. if (elementType === void 0 || isHostComponent(elementType)) {
  6259. return otherProps;
  6260. }
  6261. return _extends$1({}, otherProps, {
  6262. ownerState: _extends$1({}, otherProps.ownerState, ownerState)
  6263. });
  6264. }
  6265. function extractEventHandlers(object, excludeKeys = []) {
  6266. if (object === void 0) {
  6267. return {};
  6268. }
  6269. const result = {};
  6270. Object.keys(object).filter((prop) => prop.match(/^on[A-Z]/) && typeof object[prop] === "function" && !excludeKeys.includes(prop)).forEach((prop) => {
  6271. result[prop] = object[prop];
  6272. });
  6273. return result;
  6274. }
  6275. function resolveComponentProps(componentProps, ownerState, slotState) {
  6276. if (typeof componentProps === "function") {
  6277. return componentProps(ownerState, slotState);
  6278. }
  6279. return componentProps;
  6280. }
  6281. function omitEventHandlers(object) {
  6282. if (object === void 0) {
  6283. return {};
  6284. }
  6285. const result = {};
  6286. Object.keys(object).filter((prop) => !(prop.match(/^on[A-Z]/) && typeof object[prop] === "function")).forEach((prop) => {
  6287. result[prop] = object[prop];
  6288. });
  6289. return result;
  6290. }
  6291. function mergeSlotProps(parameters) {
  6292. const {
  6293. getSlotProps,
  6294. additionalProps,
  6295. externalSlotProps,
  6296. externalForwardedProps,
  6297. className
  6298. } = parameters;
  6299. if (!getSlotProps) {
  6300. const joinedClasses2 = clsx(additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
  6301. const mergedStyle2 = _extends$1({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);
  6302. const props2 = _extends$1({}, additionalProps, externalForwardedProps, externalSlotProps);
  6303. if (joinedClasses2.length > 0) {
  6304. props2.className = joinedClasses2;
  6305. }
  6306. if (Object.keys(mergedStyle2).length > 0) {
  6307. props2.style = mergedStyle2;
  6308. }
  6309. return {
  6310. props: props2,
  6311. internalRef: void 0
  6312. };
  6313. }
  6314. const eventHandlers = extractEventHandlers(_extends$1({}, externalForwardedProps, externalSlotProps));
  6315. const componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);
  6316. const otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);
  6317. const internalSlotProps = getSlotProps(eventHandlers);
  6318. const joinedClasses = clsx(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
  6319. const mergedStyle = _extends$1({}, internalSlotProps == null ? void 0 : internalSlotProps.style, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);
  6320. const props = _extends$1({}, internalSlotProps, additionalProps, otherPropsWithoutEventHandlers, componentsPropsWithoutEventHandlers);
  6321. if (joinedClasses.length > 0) {
  6322. props.className = joinedClasses;
  6323. }
  6324. if (Object.keys(mergedStyle).length > 0) {
  6325. props.style = mergedStyle;
  6326. }
  6327. return {
  6328. props,
  6329. internalRef: internalSlotProps.ref
  6330. };
  6331. }
  6332. const _excluded$5 = ["elementType", "externalSlotProps", "ownerState", "skipResolvingSlotProps"];
  6333. function useSlotProps(parameters) {
  6334. var _parameters$additiona;
  6335. const {
  6336. elementType,
  6337. externalSlotProps,
  6338. ownerState,
  6339. skipResolvingSlotProps = false
  6340. } = parameters, rest = _objectWithoutPropertiesLoose(parameters, _excluded$5);
  6341. const resolvedComponentsProps = skipResolvingSlotProps ? {} : resolveComponentProps(externalSlotProps, ownerState);
  6342. const {
  6343. props: mergedProps,
  6344. internalRef
  6345. } = mergeSlotProps(_extends$1({}, rest, {
  6346. externalSlotProps: resolvedComponentsProps
  6347. }));
  6348. const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_parameters$additiona = parameters.additionalProps) == null ? void 0 : _parameters$additiona.ref);
  6349. const props = appendOwnerState(elementType, _extends$1({}, mergedProps, {
  6350. ref
  6351. }), ownerState);
  6352. return props;
  6353. }
  6354. const candidatesSelector = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])'].join(",");
  6355. function getTabIndex(node2) {
  6356. const tabindexAttr = parseInt(node2.getAttribute("tabindex") || "", 10);
  6357. if (!Number.isNaN(tabindexAttr)) {
  6358. return tabindexAttr;
  6359. }
  6360. if (node2.contentEditable === "true" || (node2.nodeName === "AUDIO" || node2.nodeName === "VIDEO" || node2.nodeName === "DETAILS") && node2.getAttribute("tabindex") === null) {
  6361. return 0;
  6362. }
  6363. return node2.tabIndex;
  6364. }
  6365. function isNonTabbableRadio(node2) {
  6366. if (node2.tagName !== "INPUT" || node2.type !== "radio") {
  6367. return false;
  6368. }
  6369. if (!node2.name) {
  6370. return false;
  6371. }
  6372. const getRadio = (selector) => node2.ownerDocument.querySelector(`input[type="radio"]${selector}`);
  6373. let roving = getRadio(`[name="${node2.name}"]:checked`);
  6374. if (!roving) {
  6375. roving = getRadio(`[name="${node2.name}"]`);
  6376. }
  6377. return roving !== node2;
  6378. }
  6379. function isNodeMatchingSelectorFocusable(node2) {
  6380. if (node2.disabled || node2.tagName === "INPUT" && node2.type === "hidden" || isNonTabbableRadio(node2)) {
  6381. return false;
  6382. }
  6383. return true;
  6384. }
  6385. function defaultGetTabbable(root2) {
  6386. const regularTabNodes = [];
  6387. const orderedTabNodes = [];
  6388. Array.from(root2.querySelectorAll(candidatesSelector)).forEach((node2, i) => {
  6389. const nodeTabIndex = getTabIndex(node2);
  6390. if (nodeTabIndex === -1 || !isNodeMatchingSelectorFocusable(node2)) {
  6391. return;
  6392. }
  6393. if (nodeTabIndex === 0) {
  6394. regularTabNodes.push(node2);
  6395. } else {
  6396. orderedTabNodes.push({
  6397. documentOrder: i,
  6398. tabIndex: nodeTabIndex,
  6399. node: node2
  6400. });
  6401. }
  6402. });
  6403. return orderedTabNodes.sort((a, b2) => a.tabIndex === b2.tabIndex ? a.documentOrder - b2.documentOrder : a.tabIndex - b2.tabIndex).map((a) => a.node).concat(regularTabNodes);
  6404. }
  6405. function defaultIsEnabled() {
  6406. return true;
  6407. }
  6408. function FocusTrap(props) {
  6409. const {
  6410. children,
  6411. disableAutoFocus = false,
  6412. disableEnforceFocus = false,
  6413. disableRestoreFocus = false,
  6414. getTabbable = defaultGetTabbable,
  6415. isEnabled = defaultIsEnabled,
  6416. open
  6417. } = props;
  6418. const ignoreNextEnforceFocus = React__namespace.useRef(false);
  6419. const sentinelStart = React__namespace.useRef(null);
  6420. const sentinelEnd = React__namespace.useRef(null);
  6421. const nodeToRestore = React__namespace.useRef(null);
  6422. const reactFocusEventTarget = React__namespace.useRef(null);
  6423. const activated = React__namespace.useRef(false);
  6424. const rootRef = React__namespace.useRef(null);
  6425. const handleRef = useForkRef(children.ref, rootRef);
  6426. const lastKeydown = React__namespace.useRef(null);
  6427. React__namespace.useEffect(() => {
  6428. if (!open || !rootRef.current) {
  6429. return;
  6430. }
  6431. activated.current = !disableAutoFocus;
  6432. }, [disableAutoFocus, open]);
  6433. React__namespace.useEffect(() => {
  6434. if (!open || !rootRef.current) {
  6435. return;
  6436. }
  6437. const doc = ownerDocument(rootRef.current);
  6438. if (!rootRef.current.contains(doc.activeElement)) {
  6439. if (!rootRef.current.hasAttribute("tabIndex")) {
  6440. rootRef.current.setAttribute("tabIndex", "-1");
  6441. }
  6442. if (activated.current) {
  6443. rootRef.current.focus();
  6444. }
  6445. }
  6446. return () => {
  6447. if (!disableRestoreFocus) {
  6448. if (nodeToRestore.current && nodeToRestore.current.focus) {
  6449. ignoreNextEnforceFocus.current = true;
  6450. nodeToRestore.current.focus();
  6451. }
  6452. nodeToRestore.current = null;
  6453. }
  6454. };
  6455. }, [open]);
  6456. React__namespace.useEffect(() => {
  6457. if (!open || !rootRef.current) {
  6458. return;
  6459. }
  6460. const doc = ownerDocument(rootRef.current);
  6461. const loopFocus = (nativeEvent) => {
  6462. lastKeydown.current = nativeEvent;
  6463. if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== "Tab") {
  6464. return;
  6465. }
  6466. if (doc.activeElement === rootRef.current && nativeEvent.shiftKey) {
  6467. ignoreNextEnforceFocus.current = true;
  6468. if (sentinelEnd.current) {
  6469. sentinelEnd.current.focus();
  6470. }
  6471. }
  6472. };
  6473. const contain = () => {
  6474. const rootElement = rootRef.current;
  6475. if (rootElement === null) {
  6476. return;
  6477. }
  6478. if (!doc.hasFocus() || !isEnabled() || ignoreNextEnforceFocus.current) {
  6479. ignoreNextEnforceFocus.current = false;
  6480. return;
  6481. }
  6482. if (rootElement.contains(doc.activeElement)) {
  6483. return;
  6484. }
  6485. if (disableEnforceFocus && doc.activeElement !== sentinelStart.current && doc.activeElement !== sentinelEnd.current) {
  6486. return;
  6487. }
  6488. if (doc.activeElement !== reactFocusEventTarget.current) {
  6489. reactFocusEventTarget.current = null;
  6490. } else if (reactFocusEventTarget.current !== null) {
  6491. return;
  6492. }
  6493. if (!activated.current) {
  6494. return;
  6495. }
  6496. let tabbable = [];
  6497. if (doc.activeElement === sentinelStart.current || doc.activeElement === sentinelEnd.current) {
  6498. tabbable = getTabbable(rootRef.current);
  6499. }
  6500. if (tabbable.length > 0) {
  6501. var _lastKeydown$current, _lastKeydown$current2;
  6502. const isShiftTab = Boolean(((_lastKeydown$current = lastKeydown.current) == null ? void 0 : _lastKeydown$current.shiftKey) && ((_lastKeydown$current2 = lastKeydown.current) == null ? void 0 : _lastKeydown$current2.key) === "Tab");
  6503. const focusNext = tabbable[0];
  6504. const focusPrevious = tabbable[tabbable.length - 1];
  6505. if (typeof focusNext !== "string" && typeof focusPrevious !== "string") {
  6506. if (isShiftTab) {
  6507. focusPrevious.focus();
  6508. } else {
  6509. focusNext.focus();
  6510. }
  6511. }
  6512. } else {
  6513. rootElement.focus();
  6514. }
  6515. };
  6516. doc.addEventListener("focusin", contain);
  6517. doc.addEventListener("keydown", loopFocus, true);
  6518. const interval = setInterval(() => {
  6519. if (doc.activeElement && doc.activeElement.tagName === "BODY") {
  6520. contain();
  6521. }
  6522. }, 50);
  6523. return () => {
  6524. clearInterval(interval);
  6525. doc.removeEventListener("focusin", contain);
  6526. doc.removeEventListener("keydown", loopFocus, true);
  6527. };
  6528. }, [disableAutoFocus, disableEnforceFocus, disableRestoreFocus, isEnabled, open, getTabbable]);
  6529. const onFocus = (event) => {
  6530. if (nodeToRestore.current === null) {
  6531. nodeToRestore.current = event.relatedTarget;
  6532. }
  6533. activated.current = true;
  6534. reactFocusEventTarget.current = event.target;
  6535. const childrenPropsHandler = children.props.onFocus;
  6536. if (childrenPropsHandler) {
  6537. childrenPropsHandler(event);
  6538. }
  6539. };
  6540. const handleFocusSentinel = (event) => {
  6541. if (nodeToRestore.current === null) {
  6542. nodeToRestore.current = event.relatedTarget;
  6543. }
  6544. activated.current = true;
  6545. };
  6546. return /* @__PURE__ */ jsxRuntimeExports.jsxs(React__namespace.Fragment, {
  6547. children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
  6548. tabIndex: open ? 0 : -1,
  6549. onFocus: handleFocusSentinel,
  6550. ref: sentinelStart,
  6551. "data-testid": "sentinelStart"
  6552. }), /* @__PURE__ */ React__namespace.cloneElement(children, {
  6553. ref: handleRef,
  6554. onFocus
  6555. }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
  6556. tabIndex: open ? 0 : -1,
  6557. onFocus: handleFocusSentinel,
  6558. ref: sentinelEnd,
  6559. "data-testid": "sentinelEnd"
  6560. })]
  6561. });
  6562. }
  6563. function getContainer$1(container) {
  6564. return typeof container === "function" ? container() : container;
  6565. }
  6566. const Portal = /* @__PURE__ */ React__namespace.forwardRef(function Portal2(props, forwardedRef) {
  6567. const {
  6568. children,
  6569. container,
  6570. disablePortal = false
  6571. } = props;
  6572. const [mountNode, setMountNode] = React__namespace.useState(null);
  6573. const handleRef = useForkRef(/* @__PURE__ */ React__namespace.isValidElement(children) ? children.ref : null, forwardedRef);
  6574. useEnhancedEffect(() => {
  6575. if (!disablePortal) {
  6576. setMountNode(getContainer$1(container) || document.body);
  6577. }
  6578. }, [container, disablePortal]);
  6579. useEnhancedEffect(() => {
  6580. if (mountNode && !disablePortal) {
  6581. setRef(forwardedRef, mountNode);
  6582. return () => {
  6583. setRef(forwardedRef, null);
  6584. };
  6585. }
  6586. return void 0;
  6587. }, [forwardedRef, mountNode, disablePortal]);
  6588. if (disablePortal) {
  6589. if (/* @__PURE__ */ React__namespace.isValidElement(children)) {
  6590. const newProps = {
  6591. ref: handleRef
  6592. };
  6593. return /* @__PURE__ */ React__namespace.cloneElement(children, newProps);
  6594. }
  6595. return /* @__PURE__ */ jsxRuntimeExports.jsx(React__namespace.Fragment, {
  6596. children
  6597. });
  6598. }
  6599. return /* @__PURE__ */ jsxRuntimeExports.jsx(React__namespace.Fragment, {
  6600. children: mountNode ? /* @__PURE__ */ ReactDOM__default__namespace.createPortal(children, mountNode) : mountNode
  6601. });
  6602. });
  6603. function isOverflowing(container) {
  6604. const doc = ownerDocument(container);
  6605. if (doc.body === container) {
  6606. return ownerWindow(container).innerWidth > doc.documentElement.clientWidth;
  6607. }
  6608. return container.scrollHeight > container.clientHeight;
  6609. }
  6610. function ariaHidden(element, show) {
  6611. if (show) {
  6612. element.setAttribute("aria-hidden", "true");
  6613. } else {
  6614. element.removeAttribute("aria-hidden");
  6615. }
  6616. }
  6617. function getPaddingRight(element) {
  6618. return parseInt(ownerWindow(element).getComputedStyle(element).paddingRight, 10) || 0;
  6619. }
  6620. function isAriaHiddenForbiddenOnElement(element) {
  6621. const forbiddenTagNames = ["TEMPLATE", "SCRIPT", "STYLE", "LINK", "MAP", "META", "NOSCRIPT", "PICTURE", "COL", "COLGROUP", "PARAM", "SLOT", "SOURCE", "TRACK"];
  6622. const isForbiddenTagName = forbiddenTagNames.indexOf(element.tagName) !== -1;
  6623. const isInputHidden = element.tagName === "INPUT" && element.getAttribute("type") === "hidden";
  6624. return isForbiddenTagName || isInputHidden;
  6625. }
  6626. function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude, show) {
  6627. const blacklist = [mountElement, currentElement, ...elementsToExclude];
  6628. [].forEach.call(container.children, (element) => {
  6629. const isNotExcludedElement = blacklist.indexOf(element) === -1;
  6630. const isNotForbiddenElement = !isAriaHiddenForbiddenOnElement(element);
  6631. if (isNotExcludedElement && isNotForbiddenElement) {
  6632. ariaHidden(element, show);
  6633. }
  6634. });
  6635. }
  6636. function findIndexOf(items, callback) {
  6637. let idx = -1;
  6638. items.some((item, index) => {
  6639. if (callback(item)) {
  6640. idx = index;
  6641. return true;
  6642. }
  6643. return false;
  6644. });
  6645. return idx;
  6646. }
  6647. function handleContainer(containerInfo, props) {
  6648. const restoreStyle = [];
  6649. const container = containerInfo.container;
  6650. if (!props.disableScrollLock) {
  6651. if (isOverflowing(container)) {
  6652. const scrollbarSize = getScrollbarSize(ownerDocument(container));
  6653. restoreStyle.push({
  6654. value: container.style.paddingRight,
  6655. property: "padding-right",
  6656. el: container
  6657. });
  6658. container.style.paddingRight = `${getPaddingRight(container) + scrollbarSize}px`;
  6659. const fixedElements2 = ownerDocument(container).querySelectorAll(".mui-fixed");
  6660. [].forEach.call(fixedElements2, (element) => {
  6661. restoreStyle.push({
  6662. value: element.style.paddingRight,
  6663. property: "padding-right",
  6664. el: element
  6665. });
  6666. element.style.paddingRight = `${getPaddingRight(element) + scrollbarSize}px`;
  6667. });
  6668. }
  6669. let scrollContainer;
  6670. if (container.parentNode instanceof DocumentFragment) {
  6671. scrollContainer = ownerDocument(container).body;
  6672. } else {
  6673. const parent = container.parentElement;
  6674. const containerWindow = ownerWindow(container);
  6675. scrollContainer = (parent == null ? void 0 : parent.nodeName) === "HTML" && containerWindow.getComputedStyle(parent).overflowY === "scroll" ? parent : container;
  6676. }
  6677. restoreStyle.push({
  6678. value: scrollContainer.style.overflow,
  6679. property: "overflow",
  6680. el: scrollContainer
  6681. }, {
  6682. value: scrollContainer.style.overflowX,
  6683. property: "overflow-x",
  6684. el: scrollContainer
  6685. }, {
  6686. value: scrollContainer.style.overflowY,
  6687. property: "overflow-y",
  6688. el: scrollContainer
  6689. });
  6690. scrollContainer.style.overflow = "hidden";
  6691. }
  6692. const restore = () => {
  6693. restoreStyle.forEach(({
  6694. value,
  6695. el,
  6696. property
  6697. }) => {
  6698. if (value) {
  6699. el.style.setProperty(property, value);
  6700. } else {
  6701. el.style.removeProperty(property);
  6702. }
  6703. });
  6704. };
  6705. return restore;
  6706. }
  6707. function getHiddenSiblings(container) {
  6708. const hiddenSiblings = [];
  6709. [].forEach.call(container.children, (element) => {
  6710. if (element.getAttribute("aria-hidden") === "true") {
  6711. hiddenSiblings.push(element);
  6712. }
  6713. });
  6714. return hiddenSiblings;
  6715. }
  6716. class ModalManager {
  6717. constructor() {
  6718. this.containers = void 0;
  6719. this.modals = void 0;
  6720. this.modals = [];
  6721. this.containers = [];
  6722. }
  6723. add(modal, container) {
  6724. let modalIndex = this.modals.indexOf(modal);
  6725. if (modalIndex !== -1) {
  6726. return modalIndex;
  6727. }
  6728. modalIndex = this.modals.length;
  6729. this.modals.push(modal);
  6730. if (modal.modalRef) {
  6731. ariaHidden(modal.modalRef, false);
  6732. }
  6733. const hiddenSiblings = getHiddenSiblings(container);
  6734. ariaHiddenSiblings(container, modal.mount, modal.modalRef, hiddenSiblings, true);
  6735. const containerIndex = findIndexOf(this.containers, (item) => item.container === container);
  6736. if (containerIndex !== -1) {
  6737. this.containers[containerIndex].modals.push(modal);
  6738. return modalIndex;
  6739. }
  6740. this.containers.push({
  6741. modals: [modal],
  6742. container,
  6743. restore: null,
  6744. hiddenSiblings
  6745. });
  6746. return modalIndex;
  6747. }
  6748. mount(modal, props) {
  6749. const containerIndex = findIndexOf(this.containers, (item) => item.modals.indexOf(modal) !== -1);
  6750. const containerInfo = this.containers[containerIndex];
  6751. if (!containerInfo.restore) {
  6752. containerInfo.restore = handleContainer(containerInfo, props);
  6753. }
  6754. }
  6755. remove(modal, ariaHiddenState = true) {
  6756. const modalIndex = this.modals.indexOf(modal);
  6757. if (modalIndex === -1) {
  6758. return modalIndex;
  6759. }
  6760. const containerIndex = findIndexOf(this.containers, (item) => item.modals.indexOf(modal) !== -1);
  6761. const containerInfo = this.containers[containerIndex];
  6762. containerInfo.modals.splice(containerInfo.modals.indexOf(modal), 1);
  6763. this.modals.splice(modalIndex, 1);
  6764. if (containerInfo.modals.length === 0) {
  6765. if (containerInfo.restore) {
  6766. containerInfo.restore();
  6767. }
  6768. if (modal.modalRef) {
  6769. ariaHidden(modal.modalRef, ariaHiddenState);
  6770. }
  6771. ariaHiddenSiblings(containerInfo.container, modal.mount, modal.modalRef, containerInfo.hiddenSiblings, false);
  6772. this.containers.splice(containerIndex, 1);
  6773. } else {
  6774. const nextTop = containerInfo.modals[containerInfo.modals.length - 1];
  6775. if (nextTop.modalRef) {
  6776. ariaHidden(nextTop.modalRef, false);
  6777. }
  6778. }
  6779. return modalIndex;
  6780. }
  6781. isTopModal(modal) {
  6782. return this.modals.length > 0 && this.modals[this.modals.length - 1] === modal;
  6783. }
  6784. }
  6785. function getContainer(container) {
  6786. return typeof container === "function" ? container() : container;
  6787. }
  6788. function getHasTransition(children) {
  6789. return children ? children.props.hasOwnProperty("in") : false;
  6790. }
  6791. const defaultManager = new ModalManager();
  6792. function useModal(parameters) {
  6793. const {
  6794. container,
  6795. disableEscapeKeyDown = false,
  6796. disableScrollLock = false,
  6797. // @ts-ignore internal logic - Base UI supports the manager as a prop too
  6798. manager = defaultManager,
  6799. closeAfterTransition = false,
  6800. onTransitionEnter,
  6801. onTransitionExited,
  6802. children,
  6803. onClose,
  6804. open,
  6805. rootRef
  6806. } = parameters;
  6807. const modal = React__namespace.useRef({});
  6808. const mountNodeRef = React__namespace.useRef(null);
  6809. const modalRef = React__namespace.useRef(null);
  6810. const handleRef = useForkRef(modalRef, rootRef);
  6811. const [exited, setExited] = React__namespace.useState(!open);
  6812. const hasTransition = getHasTransition(children);
  6813. let ariaHiddenProp = true;
  6814. if (parameters["aria-hidden"] === "false" || parameters["aria-hidden"] === false) {
  6815. ariaHiddenProp = false;
  6816. }
  6817. const getDoc = () => ownerDocument(mountNodeRef.current);
  6818. const getModal = () => {
  6819. modal.current.modalRef = modalRef.current;
  6820. modal.current.mount = mountNodeRef.current;
  6821. return modal.current;
  6822. };
  6823. const handleMounted = () => {
  6824. manager.mount(getModal(), {
  6825. disableScrollLock
  6826. });
  6827. if (modalRef.current) {
  6828. modalRef.current.scrollTop = 0;
  6829. }
  6830. };
  6831. const handleOpen = useEventCallback(() => {
  6832. const resolvedContainer = getContainer(container) || getDoc().body;
  6833. manager.add(getModal(), resolvedContainer);
  6834. if (modalRef.current) {
  6835. handleMounted();
  6836. }
  6837. });
  6838. const isTopModal = React__namespace.useCallback(() => manager.isTopModal(getModal()), [manager]);
  6839. const handlePortalRef = useEventCallback((node2) => {
  6840. mountNodeRef.current = node2;
  6841. if (!node2) {
  6842. return;
  6843. }
  6844. if (open && isTopModal()) {
  6845. handleMounted();
  6846. } else if (modalRef.current) {
  6847. ariaHidden(modalRef.current, ariaHiddenProp);
  6848. }
  6849. });
  6850. const handleClose = React__namespace.useCallback(() => {
  6851. manager.remove(getModal(), ariaHiddenProp);
  6852. }, [ariaHiddenProp, manager]);
  6853. React__namespace.useEffect(() => {
  6854. return () => {
  6855. handleClose();
  6856. };
  6857. }, [handleClose]);
  6858. React__namespace.useEffect(() => {
  6859. if (open) {
  6860. handleOpen();
  6861. } else if (!hasTransition || !closeAfterTransition) {
  6862. handleClose();
  6863. }
  6864. }, [open, handleClose, hasTransition, closeAfterTransition, handleOpen]);
  6865. const createHandleKeyDown = (otherHandlers) => (event) => {
  6866. var _otherHandlers$onKeyD;
  6867. (_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null || _otherHandlers$onKeyD.call(otherHandlers, event);
  6868. if (event.key !== "Escape" || event.which === 229 || // Wait until IME is settled.
  6869. !isTopModal()) {
  6870. return;
  6871. }
  6872. if (!disableEscapeKeyDown) {
  6873. event.stopPropagation();
  6874. if (onClose) {
  6875. onClose(event, "escapeKeyDown");
  6876. }
  6877. }
  6878. };
  6879. const createHandleBackdropClick = (otherHandlers) => (event) => {
  6880. var _otherHandlers$onClic;
  6881. (_otherHandlers$onClic = otherHandlers.onClick) == null || _otherHandlers$onClic.call(otherHandlers, event);
  6882. if (event.target !== event.currentTarget) {
  6883. return;
  6884. }
  6885. if (onClose) {
  6886. onClose(event, "backdropClick");
  6887. }
  6888. };
  6889. const getRootProps = (otherHandlers = {}) => {
  6890. const propsEventHandlers = extractEventHandlers(parameters);
  6891. delete propsEventHandlers.onTransitionEnter;
  6892. delete propsEventHandlers.onTransitionExited;
  6893. const externalEventHandlers = _extends$1({}, propsEventHandlers, otherHandlers);
  6894. return _extends$1({
  6895. role: "presentation"
  6896. }, externalEventHandlers, {
  6897. onKeyDown: createHandleKeyDown(externalEventHandlers),
  6898. ref: handleRef
  6899. });
  6900. };
  6901. const getBackdropProps = (otherHandlers = {}) => {
  6902. const externalEventHandlers = otherHandlers;
  6903. return _extends$1({
  6904. "aria-hidden": true
  6905. }, externalEventHandlers, {
  6906. onClick: createHandleBackdropClick(externalEventHandlers),
  6907. open
  6908. });
  6909. };
  6910. const getTransitionProps2 = () => {
  6911. const handleEnter = () => {
  6912. setExited(false);
  6913. if (onTransitionEnter) {
  6914. onTransitionEnter();
  6915. }
  6916. };
  6917. const handleExited = () => {
  6918. setExited(true);
  6919. if (onTransitionExited) {
  6920. onTransitionExited();
  6921. }
  6922. if (closeAfterTransition) {
  6923. handleClose();
  6924. }
  6925. };
  6926. return {
  6927. onEnter: createChainedFunction(handleEnter, children == null ? void 0 : children.props.onEnter),
  6928. onExited: createChainedFunction(handleExited, children == null ? void 0 : children.props.onExited)
  6929. };
  6930. };
  6931. return {
  6932. getRootProps,
  6933. getBackdropProps,
  6934. getTransitionProps: getTransitionProps2,
  6935. rootRef: handleRef,
  6936. portalRef: handlePortalRef,
  6937. isTopModal,
  6938. exited,
  6939. hasTransition
  6940. };
  6941. }
  6942. const _excluded$4 = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
  6943. const styles = {
  6944. entering: {
  6945. opacity: 1
  6946. },
  6947. entered: {
  6948. opacity: 1
  6949. }
  6950. };
  6951. const Fade = /* @__PURE__ */ React__namespace.forwardRef(function Fade2(props, ref) {
  6952. const theme = useTheme();
  6953. const defaultTimeout = {
  6954. enter: theme.transitions.duration.enteringScreen,
  6955. exit: theme.transitions.duration.leavingScreen
  6956. };
  6957. const {
  6958. addEndListener,
  6959. appear = true,
  6960. children,
  6961. easing: easing2,
  6962. in: inProp,
  6963. onEnter,
  6964. onEntered,
  6965. onEntering,
  6966. onExit,
  6967. onExited,
  6968. onExiting,
  6969. style: style2,
  6970. timeout = defaultTimeout,
  6971. // eslint-disable-next-line react/prop-types
  6972. TransitionComponent = Transition$1
  6973. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$4);
  6974. const nodeRef = React__namespace.useRef(null);
  6975. const handleRef = useForkRef(nodeRef, children.ref, ref);
  6976. const normalizedTransitionCallback = (callback) => (maybeIsAppearing) => {
  6977. if (callback) {
  6978. const node2 = nodeRef.current;
  6979. if (maybeIsAppearing === void 0) {
  6980. callback(node2);
  6981. } else {
  6982. callback(node2, maybeIsAppearing);
  6983. }
  6984. }
  6985. };
  6986. const handleEntering = normalizedTransitionCallback(onEntering);
  6987. const handleEnter = normalizedTransitionCallback((node2, isAppearing) => {
  6988. reflow(node2);
  6989. const transitionProps = getTransitionProps({
  6990. style: style2,
  6991. timeout,
  6992. easing: easing2
  6993. }, {
  6994. mode: "enter"
  6995. });
  6996. node2.style.webkitTransition = theme.transitions.create("opacity", transitionProps);
  6997. node2.style.transition = theme.transitions.create("opacity", transitionProps);
  6998. if (onEnter) {
  6999. onEnter(node2, isAppearing);
  7000. }
  7001. });
  7002. const handleEntered = normalizedTransitionCallback(onEntered);
  7003. const handleExiting = normalizedTransitionCallback(onExiting);
  7004. const handleExit = normalizedTransitionCallback((node2) => {
  7005. const transitionProps = getTransitionProps({
  7006. style: style2,
  7007. timeout,
  7008. easing: easing2
  7009. }, {
  7010. mode: "exit"
  7011. });
  7012. node2.style.webkitTransition = theme.transitions.create("opacity", transitionProps);
  7013. node2.style.transition = theme.transitions.create("opacity", transitionProps);
  7014. if (onExit) {
  7015. onExit(node2);
  7016. }
  7017. });
  7018. const handleExited = normalizedTransitionCallback(onExited);
  7019. const handleAddEndListener = (next2) => {
  7020. if (addEndListener) {
  7021. addEndListener(nodeRef.current, next2);
  7022. }
  7023. };
  7024. return /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionComponent, _extends$1({
  7025. appear,
  7026. in: inProp,
  7027. nodeRef,
  7028. onEnter: handleEnter,
  7029. onEntered: handleEntered,
  7030. onEntering: handleEntering,
  7031. onExit: handleExit,
  7032. onExited: handleExited,
  7033. onExiting: handleExiting,
  7034. addEndListener: handleAddEndListener,
  7035. timeout
  7036. }, other, {
  7037. children: (state, childProps) => {
  7038. return /* @__PURE__ */ React__namespace.cloneElement(children, _extends$1({
  7039. style: _extends$1({
  7040. opacity: 0,
  7041. visibility: state === "exited" && !inProp ? "hidden" : void 0
  7042. }, styles[state], style2, children.props.style),
  7043. ref: handleRef
  7044. }, childProps));
  7045. }
  7046. }));
  7047. });
  7048. const Fade$1 = Fade;
  7049. function getBackdropUtilityClass(slot) {
  7050. return generateUtilityClass("MuiBackdrop", slot);
  7051. }
  7052. generateUtilityClasses("MuiBackdrop", ["root", "invisible"]);
  7053. const _excluded$3 = ["children", "className", "component", "components", "componentsProps", "invisible", "open", "slotProps", "slots", "TransitionComponent", "transitionDuration"];
  7054. const useUtilityClasses$2 = (ownerState) => {
  7055. const {
  7056. classes,
  7057. invisible
  7058. } = ownerState;
  7059. const slots = {
  7060. root: ["root", invisible && "invisible"]
  7061. };
  7062. return composeClasses(slots, getBackdropUtilityClass, classes);
  7063. };
  7064. const BackdropRoot = styled("div", {
  7065. name: "MuiBackdrop",
  7066. slot: "Root",
  7067. overridesResolver: (props, styles2) => {
  7068. const {
  7069. ownerState
  7070. } = props;
  7071. return [styles2.root, ownerState.invisible && styles2.invisible];
  7072. }
  7073. })(({
  7074. ownerState
  7075. }) => _extends$1({
  7076. position: "fixed",
  7077. display: "flex",
  7078. alignItems: "center",
  7079. justifyContent: "center",
  7080. right: 0,
  7081. bottom: 0,
  7082. top: 0,
  7083. left: 0,
  7084. backgroundColor: "rgba(0, 0, 0, 0.5)",
  7085. WebkitTapHighlightColor: "transparent"
  7086. }, ownerState.invisible && {
  7087. backgroundColor: "transparent"
  7088. }));
  7089. const Backdrop = /* @__PURE__ */ React__namespace.forwardRef(function Backdrop2(inProps, ref) {
  7090. var _slotProps$root, _ref, _slots$root;
  7091. const props = useThemeProps({
  7092. props: inProps,
  7093. name: "MuiBackdrop"
  7094. });
  7095. const {
  7096. children,
  7097. className,
  7098. component = "div",
  7099. components = {},
  7100. componentsProps = {},
  7101. invisible = false,
  7102. open,
  7103. slotProps = {},
  7104. slots = {},
  7105. TransitionComponent = Fade$1,
  7106. transitionDuration
  7107. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$3);
  7108. const ownerState = _extends$1({}, props, {
  7109. component,
  7110. invisible
  7111. });
  7112. const classes = useUtilityClasses$2(ownerState);
  7113. const rootSlotProps = (_slotProps$root = slotProps.root) != null ? _slotProps$root : componentsProps.root;
  7114. return /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionComponent, _extends$1({
  7115. in: open,
  7116. timeout: transitionDuration
  7117. }, other, {
  7118. children: /* @__PURE__ */ jsxRuntimeExports.jsx(BackdropRoot, _extends$1({
  7119. "aria-hidden": true
  7120. }, rootSlotProps, {
  7121. as: (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : component,
  7122. className: clsx(classes.root, className, rootSlotProps == null ? void 0 : rootSlotProps.className),
  7123. ownerState: _extends$1({}, ownerState, rootSlotProps == null ? void 0 : rootSlotProps.ownerState),
  7124. classes,
  7125. ref,
  7126. children
  7127. }))
  7128. }));
  7129. });
  7130. const Backdrop$1 = Backdrop;
  7131. const boxClasses = generateUtilityClasses("MuiBox", ["root"]);
  7132. const boxClasses$1 = boxClasses;
  7133. const defaultTheme = createTheme();
  7134. const Box = createBox({
  7135. themeId: THEME_ID,
  7136. defaultTheme,
  7137. defaultClassName: boxClasses$1.root,
  7138. generateClassName: ClassNameGenerator.generate
  7139. });
  7140. const Box$1 = Box;
  7141. function getModalUtilityClass(slot) {
  7142. return generateUtilityClass("MuiModal", slot);
  7143. }
  7144. generateUtilityClasses("MuiModal", ["root", "hidden", "backdrop"]);
  7145. const _excluded$2 = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "onTransitionEnter", "onTransitionExited", "open", "slotProps", "slots", "theme"];
  7146. const useUtilityClasses$1 = (ownerState) => {
  7147. const {
  7148. open,
  7149. exited,
  7150. classes
  7151. } = ownerState;
  7152. const slots = {
  7153. root: ["root", !open && exited && "hidden"],
  7154. backdrop: ["backdrop"]
  7155. };
  7156. return composeClasses(slots, getModalUtilityClass, classes);
  7157. };
  7158. const ModalRoot = styled("div", {
  7159. name: "MuiModal",
  7160. slot: "Root",
  7161. overridesResolver: (props, styles2) => {
  7162. const {
  7163. ownerState
  7164. } = props;
  7165. return [styles2.root, !ownerState.open && ownerState.exited && styles2.hidden];
  7166. }
  7167. })(({
  7168. theme,
  7169. ownerState
  7170. }) => _extends$1({
  7171. position: "fixed",
  7172. zIndex: (theme.vars || theme).zIndex.modal,
  7173. right: 0,
  7174. bottom: 0,
  7175. top: 0,
  7176. left: 0
  7177. }, !ownerState.open && ownerState.exited && {
  7178. visibility: "hidden"
  7179. }));
  7180. const ModalBackdrop = styled(Backdrop$1, {
  7181. name: "MuiModal",
  7182. slot: "Backdrop",
  7183. overridesResolver: (props, styles2) => {
  7184. return styles2.backdrop;
  7185. }
  7186. })({
  7187. zIndex: -1
  7188. });
  7189. const Modal = /* @__PURE__ */ React__namespace.forwardRef(function Modal2(inProps, ref) {
  7190. var _ref, _slots$root, _ref2, _slots$backdrop, _slotProps$root, _slotProps$backdrop;
  7191. const props = useThemeProps({
  7192. name: "MuiModal",
  7193. props: inProps
  7194. });
  7195. const {
  7196. BackdropComponent = ModalBackdrop,
  7197. BackdropProps,
  7198. className,
  7199. closeAfterTransition = false,
  7200. children,
  7201. container,
  7202. component,
  7203. components = {},
  7204. componentsProps = {},
  7205. disableAutoFocus = false,
  7206. disableEnforceFocus = false,
  7207. disableEscapeKeyDown = false,
  7208. disablePortal = false,
  7209. disableRestoreFocus = false,
  7210. disableScrollLock = false,
  7211. hideBackdrop = false,
  7212. keepMounted = false,
  7213. onBackdropClick,
  7214. open,
  7215. slotProps,
  7216. slots
  7217. // eslint-disable-next-line react/prop-types
  7218. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$2);
  7219. const propsWithDefaults = _extends$1({}, props, {
  7220. closeAfterTransition,
  7221. disableAutoFocus,
  7222. disableEnforceFocus,
  7223. disableEscapeKeyDown,
  7224. disablePortal,
  7225. disableRestoreFocus,
  7226. disableScrollLock,
  7227. hideBackdrop,
  7228. keepMounted
  7229. });
  7230. const {
  7231. getRootProps,
  7232. getBackdropProps,
  7233. getTransitionProps: getTransitionProps2,
  7234. portalRef,
  7235. isTopModal,
  7236. exited,
  7237. hasTransition
  7238. } = useModal(_extends$1({}, propsWithDefaults, {
  7239. rootRef: ref
  7240. }));
  7241. const ownerState = _extends$1({}, propsWithDefaults, {
  7242. exited
  7243. });
  7244. const classes = useUtilityClasses$1(ownerState);
  7245. const childProps = {};
  7246. if (children.props.tabIndex === void 0) {
  7247. childProps.tabIndex = "-1";
  7248. }
  7249. if (hasTransition) {
  7250. const {
  7251. onEnter,
  7252. onExited
  7253. } = getTransitionProps2();
  7254. childProps.onEnter = onEnter;
  7255. childProps.onExited = onExited;
  7256. }
  7257. const RootSlot = (_ref = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components.Root) != null ? _ref : ModalRoot;
  7258. const BackdropSlot = (_ref2 = (_slots$backdrop = slots == null ? void 0 : slots.backdrop) != null ? _slots$backdrop : components.Backdrop) != null ? _ref2 : BackdropComponent;
  7259. const rootSlotProps = (_slotProps$root = slotProps == null ? void 0 : slotProps.root) != null ? _slotProps$root : componentsProps.root;
  7260. const backdropSlotProps = (_slotProps$backdrop = slotProps == null ? void 0 : slotProps.backdrop) != null ? _slotProps$backdrop : componentsProps.backdrop;
  7261. const rootProps = useSlotProps({
  7262. elementType: RootSlot,
  7263. externalSlotProps: rootSlotProps,
  7264. externalForwardedProps: other,
  7265. getSlotProps: getRootProps,
  7266. additionalProps: {
  7267. ref,
  7268. as: component
  7269. },
  7270. ownerState,
  7271. className: clsx(className, rootSlotProps == null ? void 0 : rootSlotProps.className, classes == null ? void 0 : classes.root, !ownerState.open && ownerState.exited && (classes == null ? void 0 : classes.hidden))
  7272. });
  7273. const backdropProps = useSlotProps({
  7274. elementType: BackdropSlot,
  7275. externalSlotProps: backdropSlotProps,
  7276. additionalProps: BackdropProps,
  7277. getSlotProps: (otherHandlers) => {
  7278. return getBackdropProps(_extends$1({}, otherHandlers, {
  7279. onClick: (e2) => {
  7280. if (onBackdropClick) {
  7281. onBackdropClick(e2);
  7282. }
  7283. if (otherHandlers != null && otherHandlers.onClick) {
  7284. otherHandlers.onClick(e2);
  7285. }
  7286. }
  7287. }));
  7288. },
  7289. className: clsx(backdropSlotProps == null ? void 0 : backdropSlotProps.className, BackdropProps == null ? void 0 : BackdropProps.className, classes == null ? void 0 : classes.backdrop),
  7290. ownerState
  7291. });
  7292. if (!keepMounted && !open && (!hasTransition || exited)) {
  7293. return null;
  7294. }
  7295. return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, {
  7296. ref: portalRef,
  7297. container,
  7298. disablePortal,
  7299. children: /* @__PURE__ */ jsxRuntimeExports.jsxs(RootSlot, _extends$1({}, rootProps, {
  7300. children: [!hideBackdrop && BackdropComponent ? /* @__PURE__ */ jsxRuntimeExports.jsx(BackdropSlot, _extends$1({}, backdropProps)) : null, /* @__PURE__ */ jsxRuntimeExports.jsx(FocusTrap, {
  7301. disableEnforceFocus,
  7302. disableAutoFocus,
  7303. disableRestoreFocus,
  7304. isEnabled: isTopModal,
  7305. open,
  7306. children: /* @__PURE__ */ React__namespace.cloneElement(children, childProps)
  7307. })]
  7308. }))
  7309. });
  7310. });
  7311. const Modal$1 = Modal;
  7312. const _excluded$1 = ["addEndListener", "appear", "children", "container", "direction", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
  7313. function getTranslateValue(direction, node2, resolvedContainer) {
  7314. const rect = node2.getBoundingClientRect();
  7315. const containerRect = resolvedContainer && resolvedContainer.getBoundingClientRect();
  7316. const containerWindow = ownerWindow(node2);
  7317. let transform;
  7318. if (node2.fakeTransform) {
  7319. transform = node2.fakeTransform;
  7320. } else {
  7321. const computedStyle = containerWindow.getComputedStyle(node2);
  7322. transform = computedStyle.getPropertyValue("-webkit-transform") || computedStyle.getPropertyValue("transform");
  7323. }
  7324. let offsetX = 0;
  7325. let offsetY = 0;
  7326. if (transform && transform !== "none" && typeof transform === "string") {
  7327. const transformValues = transform.split("(")[1].split(")")[0].split(",");
  7328. offsetX = parseInt(transformValues[4], 10);
  7329. offsetY = parseInt(transformValues[5], 10);
  7330. }
  7331. if (direction === "left") {
  7332. if (containerRect) {
  7333. return `translateX(${containerRect.right + offsetX - rect.left}px)`;
  7334. }
  7335. return `translateX(${containerWindow.innerWidth + offsetX - rect.left}px)`;
  7336. }
  7337. if (direction === "right") {
  7338. if (containerRect) {
  7339. return `translateX(-${rect.right - containerRect.left - offsetX}px)`;
  7340. }
  7341. return `translateX(-${rect.left + rect.width - offsetX}px)`;
  7342. }
  7343. if (direction === "up") {
  7344. if (containerRect) {
  7345. return `translateY(${containerRect.bottom + offsetY - rect.top}px)`;
  7346. }
  7347. return `translateY(${containerWindow.innerHeight + offsetY - rect.top}px)`;
  7348. }
  7349. if (containerRect) {
  7350. return `translateY(-${rect.top - containerRect.top + rect.height - offsetY}px)`;
  7351. }
  7352. return `translateY(-${rect.top + rect.height - offsetY}px)`;
  7353. }
  7354. function resolveContainer(containerPropProp) {
  7355. return typeof containerPropProp === "function" ? containerPropProp() : containerPropProp;
  7356. }
  7357. function setTranslateValue(direction, node2, containerProp) {
  7358. const resolvedContainer = resolveContainer(containerProp);
  7359. const transform = getTranslateValue(direction, node2, resolvedContainer);
  7360. if (transform) {
  7361. node2.style.webkitTransform = transform;
  7362. node2.style.transform = transform;
  7363. }
  7364. }
  7365. const Slide = /* @__PURE__ */ React__namespace.forwardRef(function Slide2(props, ref) {
  7366. const theme = useTheme();
  7367. const defaultEasing = {
  7368. enter: theme.transitions.easing.easeOut,
  7369. exit: theme.transitions.easing.sharp
  7370. };
  7371. const defaultTimeout = {
  7372. enter: theme.transitions.duration.enteringScreen,
  7373. exit: theme.transitions.duration.leavingScreen
  7374. };
  7375. const {
  7376. addEndListener,
  7377. appear = true,
  7378. children,
  7379. container: containerProp,
  7380. direction = "down",
  7381. easing: easingProp = defaultEasing,
  7382. in: inProp,
  7383. onEnter,
  7384. onEntered,
  7385. onEntering,
  7386. onExit,
  7387. onExited,
  7388. onExiting,
  7389. style: style2,
  7390. timeout = defaultTimeout,
  7391. // eslint-disable-next-line react/prop-types
  7392. TransitionComponent = Transition$1
  7393. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$1);
  7394. const childrenRef = React__namespace.useRef(null);
  7395. const handleRef = useForkRef(children.ref, childrenRef, ref);
  7396. const normalizedTransitionCallback = (callback) => (isAppearing) => {
  7397. if (callback) {
  7398. if (isAppearing === void 0) {
  7399. callback(childrenRef.current);
  7400. } else {
  7401. callback(childrenRef.current, isAppearing);
  7402. }
  7403. }
  7404. };
  7405. const handleEnter = normalizedTransitionCallback((node2, isAppearing) => {
  7406. setTranslateValue(direction, node2, containerProp);
  7407. reflow(node2);
  7408. if (onEnter) {
  7409. onEnter(node2, isAppearing);
  7410. }
  7411. });
  7412. const handleEntering = normalizedTransitionCallback((node2, isAppearing) => {
  7413. const transitionProps = getTransitionProps({
  7414. timeout,
  7415. style: style2,
  7416. easing: easingProp
  7417. }, {
  7418. mode: "enter"
  7419. });
  7420. node2.style.webkitTransition = theme.transitions.create("-webkit-transform", _extends$1({}, transitionProps));
  7421. node2.style.transition = theme.transitions.create("transform", _extends$1({}, transitionProps));
  7422. node2.style.webkitTransform = "none";
  7423. node2.style.transform = "none";
  7424. if (onEntering) {
  7425. onEntering(node2, isAppearing);
  7426. }
  7427. });
  7428. const handleEntered = normalizedTransitionCallback(onEntered);
  7429. const handleExiting = normalizedTransitionCallback(onExiting);
  7430. const handleExit = normalizedTransitionCallback((node2) => {
  7431. const transitionProps = getTransitionProps({
  7432. timeout,
  7433. style: style2,
  7434. easing: easingProp
  7435. }, {
  7436. mode: "exit"
  7437. });
  7438. node2.style.webkitTransition = theme.transitions.create("-webkit-transform", transitionProps);
  7439. node2.style.transition = theme.transitions.create("transform", transitionProps);
  7440. setTranslateValue(direction, node2, containerProp);
  7441. if (onExit) {
  7442. onExit(node2);
  7443. }
  7444. });
  7445. const handleExited = normalizedTransitionCallback((node2) => {
  7446. node2.style.webkitTransition = "";
  7447. node2.style.transition = "";
  7448. if (onExited) {
  7449. onExited(node2);
  7450. }
  7451. });
  7452. const handleAddEndListener = (next2) => {
  7453. if (addEndListener) {
  7454. addEndListener(childrenRef.current, next2);
  7455. }
  7456. };
  7457. const updatePosition = React__namespace.useCallback(() => {
  7458. if (childrenRef.current) {
  7459. setTranslateValue(direction, childrenRef.current, containerProp);
  7460. }
  7461. }, [direction, containerProp]);
  7462. React__namespace.useEffect(() => {
  7463. if (inProp || direction === "down" || direction === "right") {
  7464. return void 0;
  7465. }
  7466. const handleResize = debounce(() => {
  7467. if (childrenRef.current) {
  7468. setTranslateValue(direction, childrenRef.current, containerProp);
  7469. }
  7470. });
  7471. const containerWindow = ownerWindow(childrenRef.current);
  7472. containerWindow.addEventListener("resize", handleResize);
  7473. return () => {
  7474. handleResize.clear();
  7475. containerWindow.removeEventListener("resize", handleResize);
  7476. };
  7477. }, [direction, inProp, containerProp]);
  7478. React__namespace.useEffect(() => {
  7479. if (!inProp) {
  7480. updatePosition();
  7481. }
  7482. }, [inProp, updatePosition]);
  7483. return /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionComponent, _extends$1({
  7484. nodeRef: childrenRef,
  7485. onEnter: handleEnter,
  7486. onEntered: handleEntered,
  7487. onEntering: handleEntering,
  7488. onExit: handleExit,
  7489. onExited: handleExited,
  7490. onExiting: handleExiting,
  7491. addEndListener: handleAddEndListener,
  7492. appear,
  7493. in: inProp,
  7494. timeout
  7495. }, other, {
  7496. children: (state, childProps) => {
  7497. return /* @__PURE__ */ React__namespace.cloneElement(children, _extends$1({
  7498. ref: handleRef,
  7499. style: _extends$1({
  7500. visibility: state === "exited" && !inProp ? "hidden" : void 0
  7501. }, style2, children.props.style)
  7502. }, childProps));
  7503. }
  7504. }));
  7505. });
  7506. const Slide$1 = Slide;
  7507. function getDrawerUtilityClass(slot) {
  7508. return generateUtilityClass("MuiDrawer", slot);
  7509. }
  7510. const drawerClasses = generateUtilityClasses("MuiDrawer", ["root", "docked", "paper", "paperAnchorLeft", "paperAnchorRight", "paperAnchorTop", "paperAnchorBottom", "paperAnchorDockedLeft", "paperAnchorDockedRight", "paperAnchorDockedTop", "paperAnchorDockedBottom", "modal"]);
  7511. const drawerClasses$1 = drawerClasses;
  7512. const _excluded = ["BackdropProps"], _excluded2 = ["anchor", "BackdropProps", "children", "className", "elevation", "hideBackdrop", "ModalProps", "onClose", "open", "PaperProps", "SlideProps", "TransitionComponent", "transitionDuration", "variant"];
  7513. const overridesResolver = (props, styles2) => {
  7514. const {
  7515. ownerState
  7516. } = props;
  7517. return [styles2.root, (ownerState.variant === "permanent" || ownerState.variant === "persistent") && styles2.docked, styles2.modal];
  7518. };
  7519. const useUtilityClasses = (ownerState) => {
  7520. const {
  7521. classes,
  7522. anchor,
  7523. variant
  7524. } = ownerState;
  7525. const slots = {
  7526. root: ["root"],
  7527. docked: [(variant === "permanent" || variant === "persistent") && "docked"],
  7528. modal: ["modal"],
  7529. paper: ["paper", `paperAnchor${capitalize$1(anchor)}`, variant !== "temporary" && `paperAnchorDocked${capitalize$1(anchor)}`]
  7530. };
  7531. return composeClasses(slots, getDrawerUtilityClass, classes);
  7532. };
  7533. const DrawerRoot = styled(Modal$1, {
  7534. name: "MuiDrawer",
  7535. slot: "Root",
  7536. overridesResolver
  7537. })(({
  7538. theme
  7539. }) => ({
  7540. zIndex: (theme.vars || theme).zIndex.drawer
  7541. }));
  7542. const DrawerDockedRoot = styled("div", {
  7543. shouldForwardProp: rootShouldForwardProp,
  7544. name: "MuiDrawer",
  7545. slot: "Docked",
  7546. skipVariantsResolver: false,
  7547. overridesResolver
  7548. })({
  7549. flex: "0 0 auto"
  7550. });
  7551. const DrawerPaper = styled(Paper$1, {
  7552. name: "MuiDrawer",
  7553. slot: "Paper",
  7554. overridesResolver: (props, styles2) => {
  7555. const {
  7556. ownerState
  7557. } = props;
  7558. return [styles2.paper, styles2[`paperAnchor${capitalize$1(ownerState.anchor)}`], ownerState.variant !== "temporary" && styles2[`paperAnchorDocked${capitalize$1(ownerState.anchor)}`]];
  7559. }
  7560. })(({
  7561. theme,
  7562. ownerState
  7563. }) => _extends$1({
  7564. overflowY: "auto",
  7565. display: "flex",
  7566. flexDirection: "column",
  7567. height: "100%",
  7568. flex: "1 0 auto",
  7569. zIndex: (theme.vars || theme).zIndex.drawer,
  7570. // Add iOS momentum scrolling for iOS < 13.0
  7571. WebkitOverflowScrolling: "touch",
  7572. // temporary style
  7573. position: "fixed",
  7574. top: 0,
  7575. // We disable the focus ring for mouse, touch and keyboard users.
  7576. // At some point, it would be better to keep it for keyboard users.
  7577. // :focus-ring CSS pseudo-class will help.
  7578. outline: 0
  7579. }, ownerState.anchor === "left" && {
  7580. left: 0
  7581. }, ownerState.anchor === "top" && {
  7582. top: 0,
  7583. left: 0,
  7584. right: 0,
  7585. height: "auto",
  7586. maxHeight: "100%"
  7587. }, ownerState.anchor === "right" && {
  7588. right: 0
  7589. }, ownerState.anchor === "bottom" && {
  7590. top: "auto",
  7591. left: 0,
  7592. bottom: 0,
  7593. right: 0,
  7594. height: "auto",
  7595. maxHeight: "100%"
  7596. }, ownerState.anchor === "left" && ownerState.variant !== "temporary" && {
  7597. borderRight: `1px solid ${(theme.vars || theme).palette.divider}`
  7598. }, ownerState.anchor === "top" && ownerState.variant !== "temporary" && {
  7599. borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
  7600. }, ownerState.anchor === "right" && ownerState.variant !== "temporary" && {
  7601. borderLeft: `1px solid ${(theme.vars || theme).palette.divider}`
  7602. }, ownerState.anchor === "bottom" && ownerState.variant !== "temporary" && {
  7603. borderTop: `1px solid ${(theme.vars || theme).palette.divider}`
  7604. }));
  7605. const oppositeDirection = {
  7606. left: "right",
  7607. right: "left",
  7608. top: "down",
  7609. bottom: "up"
  7610. };
  7611. function isHorizontal(anchor) {
  7612. return ["left", "right"].indexOf(anchor) !== -1;
  7613. }
  7614. function getAnchor(theme, anchor) {
  7615. return theme.direction === "rtl" && isHorizontal(anchor) ? oppositeDirection[anchor] : anchor;
  7616. }
  7617. const Drawer = /* @__PURE__ */ React__namespace.forwardRef(function Drawer2(inProps, ref) {
  7618. const props = useThemeProps({
  7619. props: inProps,
  7620. name: "MuiDrawer"
  7621. });
  7622. const theme = useTheme();
  7623. const defaultTransitionDuration = {
  7624. enter: theme.transitions.duration.enteringScreen,
  7625. exit: theme.transitions.duration.leavingScreen
  7626. };
  7627. const {
  7628. anchor: anchorProp = "left",
  7629. BackdropProps,
  7630. children,
  7631. className,
  7632. elevation = 16,
  7633. hideBackdrop = false,
  7634. ModalProps: {
  7635. BackdropProps: BackdropPropsProp
  7636. } = {},
  7637. onClose,
  7638. open = false,
  7639. PaperProps = {},
  7640. SlideProps,
  7641. // eslint-disable-next-line react/prop-types
  7642. TransitionComponent = Slide$1,
  7643. transitionDuration = defaultTransitionDuration,
  7644. variant = "temporary"
  7645. } = props, ModalProps = _objectWithoutPropertiesLoose(props.ModalProps, _excluded), other = _objectWithoutPropertiesLoose(props, _excluded2);
  7646. const mounted = React__namespace.useRef(false);
  7647. React__namespace.useEffect(() => {
  7648. mounted.current = true;
  7649. }, []);
  7650. const anchorInvariant = getAnchor(theme, anchorProp);
  7651. const anchor = anchorProp;
  7652. const ownerState = _extends$1({}, props, {
  7653. anchor,
  7654. elevation,
  7655. open,
  7656. variant
  7657. }, other);
  7658. const classes = useUtilityClasses(ownerState);
  7659. const drawer = /* @__PURE__ */ jsxRuntimeExports.jsx(DrawerPaper, _extends$1({
  7660. elevation: variant === "temporary" ? elevation : 0,
  7661. square: true
  7662. }, PaperProps, {
  7663. className: clsx(classes.paper, PaperProps.className),
  7664. ownerState,
  7665. children
  7666. }));
  7667. if (variant === "permanent") {
  7668. return /* @__PURE__ */ jsxRuntimeExports.jsx(DrawerDockedRoot, _extends$1({
  7669. className: clsx(classes.root, classes.docked, className),
  7670. ownerState,
  7671. ref
  7672. }, other, {
  7673. children: drawer
  7674. }));
  7675. }
  7676. const slidingDrawer = /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionComponent, _extends$1({
  7677. in: open,
  7678. direction: oppositeDirection[anchorInvariant],
  7679. timeout: transitionDuration,
  7680. appear: mounted.current
  7681. }, SlideProps, {
  7682. children: drawer
  7683. }));
  7684. if (variant === "persistent") {
  7685. return /* @__PURE__ */ jsxRuntimeExports.jsx(DrawerDockedRoot, _extends$1({
  7686. className: clsx(classes.root, classes.docked, className),
  7687. ownerState,
  7688. ref
  7689. }, other, {
  7690. children: slidingDrawer
  7691. }));
  7692. }
  7693. return /* @__PURE__ */ jsxRuntimeExports.jsx(DrawerRoot, _extends$1({
  7694. BackdropProps: _extends$1({}, BackdropProps, BackdropPropsProp, {
  7695. transitionDuration
  7696. }),
  7697. className: clsx(classes.root, classes.modal, className),
  7698. open,
  7699. ownerState,
  7700. onClose,
  7701. hideBackdrop,
  7702. ref
  7703. }, other, ModalProps, {
  7704. children: slidingDrawer
  7705. }));
  7706. });
  7707. const Drawer$1 = Drawer;
  7708. const appConfig = {
  7709. domain: "https://linux.do"
  7710. };
  7711. const fetchGetInvites = (username, csrfToken, filter = "pending", offset = 0) => {
  7712. return fetch(`${appConfig.domain}/u/${username}/invited.json?filter=${filter}&offset=${offset}`, {
  7713. headers: {
  7714. accept: "application/json, text/javascript, */*; q=0.01",
  7715. "accept-language": "zh-CN,zh;q=0.9,en;q=0.8",
  7716. "discourse-logged-in": "true",
  7717. "discourse-present": "true",
  7718. "discourse-track-view": "true",
  7719. "x-csrf-token": csrfToken,
  7720. "x-requested-with": "XMLHttpRequest"
  7721. },
  7722. body: null,
  7723. method: "GET",
  7724. mode: "cors",
  7725. credentials: "include"
  7726. }).then((serverPromise) => {
  7727. return serverPromise.json().then((res) => {
  7728. return res;
  7729. }).catch((err) => {
  7730. console.error(err);
  7731. return null;
  7732. });
  7733. }).catch((err) => {
  7734. console.error(err);
  7735. return null;
  7736. });
  7737. };
  7738. const fetchUpdateInvite = (inviteID, csrfToken, maxRedemptionsAllowed = 10, expiresAt = "2099-12-31+23%3A59%2B08%3A00") => {
  7739. return fetch(`${appConfig.domain}/invites/${inviteID}`, {
  7740. headers: {
  7741. accept: "*/*",
  7742. "accept-language": "zh-CN,zh;q=0.9,en;q=0.8",
  7743. "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
  7744. "discourse-logged-in": "true",
  7745. "discourse-present": "true",
  7746. "x-csrf-token": csrfToken,
  7747. "x-requested-with": "XMLHttpRequest"
  7748. },
  7749. body: `max_redemptions_allowed=${maxRedemptionsAllowed}&expires_at=${expiresAt}`,
  7750. method: "PUT",
  7751. mode: "cors",
  7752. credentials: "include"
  7753. }).then((serverPromise) => {
  7754. return serverPromise.json().then((res) => {
  7755. return res;
  7756. }).catch((err) => {
  7757. console.error(err);
  7758. return null;
  7759. });
  7760. }).catch((err) => {
  7761. console.error(err);
  7762. return null;
  7763. });
  7764. };
  7765. function eq$2(value, other) {
  7766. return value === other || value !== value && other !== other;
  7767. }
  7768. var eq_1 = eq$2;
  7769. var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
  7770. var _freeGlobal = freeGlobal$1;
  7771. var freeGlobal = _freeGlobal;
  7772. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  7773. var root$8 = freeGlobal || freeSelf || Function("return this")();
  7774. var _root = root$8;
  7775. var root$7 = _root;
  7776. var Symbol$4 = root$7.Symbol;
  7777. var _Symbol = Symbol$4;
  7778. var Symbol$3 = _Symbol;
  7779. var objectProto$c = Object.prototype;
  7780. var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
  7781. var nativeObjectToString$1 = objectProto$c.toString;
  7782. var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : void 0;
  7783. function getRawTag$1(value) {
  7784. var isOwn = hasOwnProperty$9.call(value, symToStringTag$1), tag = value[symToStringTag$1];
  7785. try {
  7786. value[symToStringTag$1] = void 0;
  7787. var unmasked = true;
  7788. } catch (e2) {
  7789. }
  7790. var result = nativeObjectToString$1.call(value);
  7791. if (unmasked) {
  7792. if (isOwn) {
  7793. value[symToStringTag$1] = tag;
  7794. } else {
  7795. delete value[symToStringTag$1];
  7796. }
  7797. }
  7798. return result;
  7799. }
  7800. var _getRawTag = getRawTag$1;
  7801. var objectProto$b = Object.prototype;
  7802. var nativeObjectToString = objectProto$b.toString;
  7803. function objectToString$1(value) {
  7804. return nativeObjectToString.call(value);
  7805. }
  7806. var _objectToString = objectToString$1;
  7807. var Symbol$2 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
  7808. var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
  7809. var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
  7810. function baseGetTag$4(value) {
  7811. if (value == null) {
  7812. return value === void 0 ? undefinedTag : nullTag;
  7813. }
  7814. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  7815. }
  7816. var _baseGetTag = baseGetTag$4;
  7817. function isObject$5(value) {
  7818. var type = typeof value;
  7819. return value != null && (type == "object" || type == "function");
  7820. }
  7821. var isObject_1 = isObject$5;
  7822. var baseGetTag$3 = _baseGetTag, isObject$4 = isObject_1;
  7823. var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
  7824. function isFunction$2(value) {
  7825. if (!isObject$4(value)) {
  7826. return false;
  7827. }
  7828. var tag = baseGetTag$3(value);
  7829. return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
  7830. }
  7831. var isFunction_1 = isFunction$2;
  7832. var MAX_SAFE_INTEGER$1 = 9007199254740991;
  7833. function isLength$2(value) {
  7834. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
  7835. }
  7836. var isLength_1 = isLength$2;
  7837. var isFunction$1 = isFunction_1, isLength$1 = isLength_1;
  7838. function isArrayLike$2(value) {
  7839. return value != null && isLength$1(value.length) && !isFunction$1(value);
  7840. }
  7841. var isArrayLike_1 = isArrayLike$2;
  7842. var MAX_SAFE_INTEGER = 9007199254740991;
  7843. var reIsUint = /^(?:0|[1-9]\d*)$/;
  7844. function isIndex$1(value, length2) {
  7845. var type = typeof value;
  7846. length2 = length2 == null ? MAX_SAFE_INTEGER : length2;
  7847. return !!length2 && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2);
  7848. }
  7849. var _isIndex = isIndex$1;
  7850. function isObjectLike$5(value) {
  7851. return value != null && typeof value == "object";
  7852. }
  7853. var isObjectLike_1 = isObjectLike$5;
  7854. function listCacheClear$1() {
  7855. this.__data__ = [];
  7856. this.size = 0;
  7857. }
  7858. var _listCacheClear = listCacheClear$1;
  7859. var eq$1 = eq_1;
  7860. function assocIndexOf$4(array, key) {
  7861. var length2 = array.length;
  7862. while (length2--) {
  7863. if (eq$1(array[length2][0], key)) {
  7864. return length2;
  7865. }
  7866. }
  7867. return -1;
  7868. }
  7869. var _assocIndexOf = assocIndexOf$4;
  7870. var assocIndexOf$3 = _assocIndexOf;
  7871. var arrayProto = Array.prototype;
  7872. var splice = arrayProto.splice;
  7873. function listCacheDelete$1(key) {
  7874. var data = this.__data__, index = assocIndexOf$3(data, key);
  7875. if (index < 0) {
  7876. return false;
  7877. }
  7878. var lastIndex = data.length - 1;
  7879. if (index == lastIndex) {
  7880. data.pop();
  7881. } else {
  7882. splice.call(data, index, 1);
  7883. }
  7884. --this.size;
  7885. return true;
  7886. }
  7887. var _listCacheDelete = listCacheDelete$1;
  7888. var assocIndexOf$2 = _assocIndexOf;
  7889. function listCacheGet$1(key) {
  7890. var data = this.__data__, index = assocIndexOf$2(data, key);
  7891. return index < 0 ? void 0 : data[index][1];
  7892. }
  7893. var _listCacheGet = listCacheGet$1;
  7894. var assocIndexOf$1 = _assocIndexOf;
  7895. function listCacheHas$1(key) {
  7896. return assocIndexOf$1(this.__data__, key) > -1;
  7897. }
  7898. var _listCacheHas = listCacheHas$1;
  7899. var assocIndexOf = _assocIndexOf;
  7900. function listCacheSet$1(key, value) {
  7901. var data = this.__data__, index = assocIndexOf(data, key);
  7902. if (index < 0) {
  7903. ++this.size;
  7904. data.push([key, value]);
  7905. } else {
  7906. data[index][1] = value;
  7907. }
  7908. return this;
  7909. }
  7910. var _listCacheSet = listCacheSet$1;
  7911. var listCacheClear = _listCacheClear, listCacheDelete = _listCacheDelete, listCacheGet = _listCacheGet, listCacheHas = _listCacheHas, listCacheSet = _listCacheSet;
  7912. function ListCache$4(entries) {
  7913. var index = -1, length2 = entries == null ? 0 : entries.length;
  7914. this.clear();
  7915. while (++index < length2) {
  7916. var entry = entries[index];
  7917. this.set(entry[0], entry[1]);
  7918. }
  7919. }
  7920. ListCache$4.prototype.clear = listCacheClear;
  7921. ListCache$4.prototype["delete"] = listCacheDelete;
  7922. ListCache$4.prototype.get = listCacheGet;
  7923. ListCache$4.prototype.has = listCacheHas;
  7924. ListCache$4.prototype.set = listCacheSet;
  7925. var _ListCache = ListCache$4;
  7926. var ListCache$3 = _ListCache;
  7927. function stackClear$1() {
  7928. this.__data__ = new ListCache$3();
  7929. this.size = 0;
  7930. }
  7931. var _stackClear = stackClear$1;
  7932. function stackDelete$1(key) {
  7933. var data = this.__data__, result = data["delete"](key);
  7934. this.size = data.size;
  7935. return result;
  7936. }
  7937. var _stackDelete = stackDelete$1;
  7938. function stackGet$1(key) {
  7939. return this.__data__.get(key);
  7940. }
  7941. var _stackGet = stackGet$1;
  7942. function stackHas$1(key) {
  7943. return this.__data__.has(key);
  7944. }
  7945. var _stackHas = stackHas$1;
  7946. var root$6 = _root;
  7947. var coreJsData$1 = root$6["__core-js_shared__"];
  7948. var _coreJsData = coreJsData$1;
  7949. var coreJsData = _coreJsData;
  7950. var maskSrcKey = function() {
  7951. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
  7952. return uid ? "Symbol(src)_1." + uid : "";
  7953. }();
  7954. function isMasked$1(func) {
  7955. return !!maskSrcKey && maskSrcKey in func;
  7956. }
  7957. var _isMasked = isMasked$1;
  7958. var funcProto$1 = Function.prototype;
  7959. var funcToString$1 = funcProto$1.toString;
  7960. function toSource$2(func) {
  7961. if (func != null) {
  7962. try {
  7963. return funcToString$1.call(func);
  7964. } catch (e2) {
  7965. }
  7966. try {
  7967. return func + "";
  7968. } catch (e2) {
  7969. }
  7970. }
  7971. return "";
  7972. }
  7973. var _toSource = toSource$2;
  7974. var isFunction = isFunction_1, isMasked = _isMasked, isObject$3 = isObject_1, toSource$1 = _toSource;
  7975. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  7976. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  7977. var funcProto = Function.prototype, objectProto$a = Object.prototype;
  7978. var funcToString = funcProto.toString;
  7979. var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
  7980. var reIsNative = RegExp(
  7981. "^" + funcToString.call(hasOwnProperty$8).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
  7982. );
  7983. function baseIsNative$1(value) {
  7984. if (!isObject$3(value) || isMasked(value)) {
  7985. return false;
  7986. }
  7987. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  7988. return pattern.test(toSource$1(value));
  7989. }
  7990. var _baseIsNative = baseIsNative$1;
  7991. function getValue$1(object, key) {
  7992. return object == null ? void 0 : object[key];
  7993. }
  7994. var _getValue = getValue$1;
  7995. var baseIsNative = _baseIsNative, getValue = _getValue;
  7996. function getNative$7(object, key) {
  7997. var value = getValue(object, key);
  7998. return baseIsNative(value) ? value : void 0;
  7999. }
  8000. var _getNative = getNative$7;
  8001. var getNative$6 = _getNative, root$5 = _root;
  8002. var Map$3 = getNative$6(root$5, "Map");
  8003. var _Map = Map$3;
  8004. var getNative$5 = _getNative;
  8005. var nativeCreate$4 = getNative$5(Object, "create");
  8006. var _nativeCreate = nativeCreate$4;
  8007. var nativeCreate$3 = _nativeCreate;
  8008. function hashClear$1() {
  8009. this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
  8010. this.size = 0;
  8011. }
  8012. var _hashClear = hashClear$1;
  8013. function hashDelete$1(key) {
  8014. var result = this.has(key) && delete this.__data__[key];
  8015. this.size -= result ? 1 : 0;
  8016. return result;
  8017. }
  8018. var _hashDelete = hashDelete$1;
  8019. var nativeCreate$2 = _nativeCreate;
  8020. var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
  8021. var objectProto$9 = Object.prototype;
  8022. var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
  8023. function hashGet$1(key) {
  8024. var data = this.__data__;
  8025. if (nativeCreate$2) {
  8026. var result = data[key];
  8027. return result === HASH_UNDEFINED$1 ? void 0 : result;
  8028. }
  8029. return hasOwnProperty$7.call(data, key) ? data[key] : void 0;
  8030. }
  8031. var _hashGet = hashGet$1;
  8032. var nativeCreate$1 = _nativeCreate;
  8033. var objectProto$8 = Object.prototype;
  8034. var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
  8035. function hashHas$1(key) {
  8036. var data = this.__data__;
  8037. return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$6.call(data, key);
  8038. }
  8039. var _hashHas = hashHas$1;
  8040. var nativeCreate = _nativeCreate;
  8041. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  8042. function hashSet$1(key, value) {
  8043. var data = this.__data__;
  8044. this.size += this.has(key) ? 0 : 1;
  8045. data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
  8046. return this;
  8047. }
  8048. var _hashSet = hashSet$1;
  8049. var hashClear = _hashClear, hashDelete = _hashDelete, hashGet = _hashGet, hashHas = _hashHas, hashSet = _hashSet;
  8050. function Hash$1(entries) {
  8051. var index = -1, length2 = entries == null ? 0 : entries.length;
  8052. this.clear();
  8053. while (++index < length2) {
  8054. var entry = entries[index];
  8055. this.set(entry[0], entry[1]);
  8056. }
  8057. }
  8058. Hash$1.prototype.clear = hashClear;
  8059. Hash$1.prototype["delete"] = hashDelete;
  8060. Hash$1.prototype.get = hashGet;
  8061. Hash$1.prototype.has = hashHas;
  8062. Hash$1.prototype.set = hashSet;
  8063. var _Hash = Hash$1;
  8064. var Hash = _Hash, ListCache$2 = _ListCache, Map$2 = _Map;
  8065. function mapCacheClear$1() {
  8066. this.size = 0;
  8067. this.__data__ = {
  8068. "hash": new Hash(),
  8069. "map": new (Map$2 || ListCache$2)(),
  8070. "string": new Hash()
  8071. };
  8072. }
  8073. var _mapCacheClear = mapCacheClear$1;
  8074. function isKeyable$1(value) {
  8075. var type = typeof value;
  8076. return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
  8077. }
  8078. var _isKeyable = isKeyable$1;
  8079. var isKeyable = _isKeyable;
  8080. function getMapData$4(map, key) {
  8081. var data = map.__data__;
  8082. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  8083. }
  8084. var _getMapData = getMapData$4;
  8085. var getMapData$3 = _getMapData;
  8086. function mapCacheDelete$1(key) {
  8087. var result = getMapData$3(this, key)["delete"](key);
  8088. this.size -= result ? 1 : 0;
  8089. return result;
  8090. }
  8091. var _mapCacheDelete = mapCacheDelete$1;
  8092. var getMapData$2 = _getMapData;
  8093. function mapCacheGet$1(key) {
  8094. return getMapData$2(this, key).get(key);
  8095. }
  8096. var _mapCacheGet = mapCacheGet$1;
  8097. var getMapData$1 = _getMapData;
  8098. function mapCacheHas$1(key) {
  8099. return getMapData$1(this, key).has(key);
  8100. }
  8101. var _mapCacheHas = mapCacheHas$1;
  8102. var getMapData = _getMapData;
  8103. function mapCacheSet$1(key, value) {
  8104. var data = getMapData(this, key), size = data.size;
  8105. data.set(key, value);
  8106. this.size += data.size == size ? 0 : 1;
  8107. return this;
  8108. }
  8109. var _mapCacheSet = mapCacheSet$1;
  8110. var mapCacheClear = _mapCacheClear, mapCacheDelete = _mapCacheDelete, mapCacheGet = _mapCacheGet, mapCacheHas = _mapCacheHas, mapCacheSet = _mapCacheSet;
  8111. function MapCache$1(entries) {
  8112. var index = -1, length2 = entries == null ? 0 : entries.length;
  8113. this.clear();
  8114. while (++index < length2) {
  8115. var entry = entries[index];
  8116. this.set(entry[0], entry[1]);
  8117. }
  8118. }
  8119. MapCache$1.prototype.clear = mapCacheClear;
  8120. MapCache$1.prototype["delete"] = mapCacheDelete;
  8121. MapCache$1.prototype.get = mapCacheGet;
  8122. MapCache$1.prototype.has = mapCacheHas;
  8123. MapCache$1.prototype.set = mapCacheSet;
  8124. var _MapCache = MapCache$1;
  8125. var ListCache$1 = _ListCache, Map$1 = _Map, MapCache = _MapCache;
  8126. var LARGE_ARRAY_SIZE = 200;
  8127. function stackSet$1(key, value) {
  8128. var data = this.__data__;
  8129. if (data instanceof ListCache$1) {
  8130. var pairs = data.__data__;
  8131. if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) {
  8132. pairs.push([key, value]);
  8133. this.size = ++data.size;
  8134. return this;
  8135. }
  8136. data = this.__data__ = new MapCache(pairs);
  8137. }
  8138. data.set(key, value);
  8139. this.size = data.size;
  8140. return this;
  8141. }
  8142. var _stackSet = stackSet$1;
  8143. var ListCache = _ListCache, stackClear = _stackClear, stackDelete = _stackDelete, stackGet = _stackGet, stackHas = _stackHas, stackSet = _stackSet;
  8144. function Stack$1(entries) {
  8145. var data = this.__data__ = new ListCache(entries);
  8146. this.size = data.size;
  8147. }
  8148. Stack$1.prototype.clear = stackClear;
  8149. Stack$1.prototype["delete"] = stackDelete;
  8150. Stack$1.prototype.get = stackGet;
  8151. Stack$1.prototype.has = stackHas;
  8152. Stack$1.prototype.set = stackSet;
  8153. var _Stack = Stack$1;
  8154. function arrayEach$1(array, iteratee) {
  8155. var index = -1, length2 = array == null ? 0 : array.length;
  8156. while (++index < length2) {
  8157. if (iteratee(array[index], index, array) === false) {
  8158. break;
  8159. }
  8160. }
  8161. return array;
  8162. }
  8163. var _arrayEach = arrayEach$1;
  8164. var getNative$4 = _getNative;
  8165. var defineProperty$1 = function() {
  8166. try {
  8167. var func = getNative$4(Object, "defineProperty");
  8168. func({}, "", {});
  8169. return func;
  8170. } catch (e2) {
  8171. }
  8172. }();
  8173. var _defineProperty = defineProperty$1;
  8174. var defineProperty = _defineProperty;
  8175. function baseAssignValue$2(object, key, value) {
  8176. if (key == "__proto__" && defineProperty) {
  8177. defineProperty(object, key, {
  8178. "configurable": true,
  8179. "enumerable": true,
  8180. "value": value,
  8181. "writable": true
  8182. });
  8183. } else {
  8184. object[key] = value;
  8185. }
  8186. }
  8187. var _baseAssignValue = baseAssignValue$2;
  8188. var baseAssignValue$1 = _baseAssignValue, eq = eq_1;
  8189. var objectProto$7 = Object.prototype;
  8190. var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
  8191. function assignValue$2(object, key, value) {
  8192. var objValue = object[key];
  8193. if (!(hasOwnProperty$5.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
  8194. baseAssignValue$1(object, key, value);
  8195. }
  8196. }
  8197. var _assignValue = assignValue$2;
  8198. var assignValue$1 = _assignValue, baseAssignValue = _baseAssignValue;
  8199. function copyObject$4(source, props, object, customizer) {
  8200. var isNew = !object;
  8201. object || (object = {});
  8202. var index = -1, length2 = props.length;
  8203. while (++index < length2) {
  8204. var key = props[index];
  8205. var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
  8206. if (newValue === void 0) {
  8207. newValue = source[key];
  8208. }
  8209. if (isNew) {
  8210. baseAssignValue(object, key, newValue);
  8211. } else {
  8212. assignValue$1(object, key, newValue);
  8213. }
  8214. }
  8215. return object;
  8216. }
  8217. var _copyObject = copyObject$4;
  8218. function baseTimes$1(n2, iteratee) {
  8219. var index = -1, result = Array(n2);
  8220. while (++index < n2) {
  8221. result[index] = iteratee(index);
  8222. }
  8223. return result;
  8224. }
  8225. var _baseTimes = baseTimes$1;
  8226. var baseGetTag$2 = _baseGetTag, isObjectLike$4 = isObjectLike_1;
  8227. var argsTag$2 = "[object Arguments]";
  8228. function baseIsArguments$1(value) {
  8229. return isObjectLike$4(value) && baseGetTag$2(value) == argsTag$2;
  8230. }
  8231. var _baseIsArguments = baseIsArguments$1;
  8232. var baseIsArguments = _baseIsArguments, isObjectLike$3 = isObjectLike_1;
  8233. var objectProto$6 = Object.prototype;
  8234. var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
  8235. var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
  8236. var isArguments$1 = baseIsArguments(/* @__PURE__ */ function() {
  8237. return arguments;
  8238. }()) ? baseIsArguments : function(value) {
  8239. return isObjectLike$3(value) && hasOwnProperty$4.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
  8240. };
  8241. var isArguments_1 = isArguments$1;
  8242. var isArray$3 = Array.isArray;
  8243. var isArray_1 = isArray$3;
  8244. var isBuffer$2 = { exports: {} };
  8245. function stubFalse() {
  8246. return false;
  8247. }
  8248. var stubFalse_1 = stubFalse;
  8249. isBuffer$2.exports;
  8250. (function(module, exports) {
  8251. var root2 = _root, stubFalse2 = stubFalse_1;
  8252. var freeExports = exports && !exports.nodeType && exports;
  8253. var freeModule = freeExports && true && module && !module.nodeType && module;
  8254. var moduleExports = freeModule && freeModule.exports === freeExports;
  8255. var Buffer = moduleExports ? root2.Buffer : void 0;
  8256. var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
  8257. var isBuffer2 = nativeIsBuffer || stubFalse2;
  8258. module.exports = isBuffer2;
  8259. })(isBuffer$2, isBuffer$2.exports);
  8260. var isBufferExports = isBuffer$2.exports;
  8261. var baseGetTag$1 = _baseGetTag, isLength = isLength_1, isObjectLike$2 = isObjectLike_1;
  8262. var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", errorTag$1 = "[object Error]", funcTag$1 = "[object Function]", mapTag$4 = "[object Map]", numberTag$2 = "[object Number]", objectTag$2 = "[object Object]", regexpTag$2 = "[object RegExp]", setTag$4 = "[object Set]", stringTag$2 = "[object String]", weakMapTag$2 = "[object WeakMap]";
  8263. var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$3 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
  8264. var typedArrayTags = {};
  8265. typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
  8266. typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] = typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] = typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] = typedArrayTags[weakMapTag$2] = false;
  8267. function baseIsTypedArray$1(value) {
  8268. return isObjectLike$2(value) && isLength(value.length) && !!typedArrayTags[baseGetTag$1(value)];
  8269. }
  8270. var _baseIsTypedArray = baseIsTypedArray$1;
  8271. function baseUnary$3(func) {
  8272. return function(value) {
  8273. return func(value);
  8274. };
  8275. }
  8276. var _baseUnary = baseUnary$3;
  8277. var _nodeUtil = { exports: {} };
  8278. _nodeUtil.exports;
  8279. (function(module, exports) {
  8280. var freeGlobal2 = _freeGlobal;
  8281. var freeExports = exports && !exports.nodeType && exports;
  8282. var freeModule = freeExports && true && module && !module.nodeType && module;
  8283. var moduleExports = freeModule && freeModule.exports === freeExports;
  8284. var freeProcess = moduleExports && freeGlobal2.process;
  8285. var nodeUtil2 = function() {
  8286. try {
  8287. var types = freeModule && freeModule.require && freeModule.require("util").types;
  8288. if (types) {
  8289. return types;
  8290. }
  8291. return freeProcess && freeProcess.binding && freeProcess.binding("util");
  8292. } catch (e2) {
  8293. }
  8294. }();
  8295. module.exports = nodeUtil2;
  8296. })(_nodeUtil, _nodeUtil.exports);
  8297. var _nodeUtilExports = _nodeUtil.exports;
  8298. var baseIsTypedArray = _baseIsTypedArray, baseUnary$2 = _baseUnary, nodeUtil$2 = _nodeUtilExports;
  8299. var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
  8300. var isTypedArray$1 = nodeIsTypedArray ? baseUnary$2(nodeIsTypedArray) : baseIsTypedArray;
  8301. var isTypedArray_1 = isTypedArray$1;
  8302. var baseTimes = _baseTimes, isArguments = isArguments_1, isArray$2 = isArray_1, isBuffer$1 = isBufferExports, isIndex = _isIndex, isTypedArray = isTypedArray_1;
  8303. var objectProto$5 = Object.prototype;
  8304. var hasOwnProperty$3 = objectProto$5.hasOwnProperty;
  8305. function arrayLikeKeys$2(value, inherited) {
  8306. var isArr = isArray$2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length2 = result.length;
  8307. for (var key in value) {
  8308. if ((inherited || hasOwnProperty$3.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
  8309. (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
  8310. isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
  8311. isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
  8312. isIndex(key, length2)))) {
  8313. result.push(key);
  8314. }
  8315. }
  8316. return result;
  8317. }
  8318. var _arrayLikeKeys = arrayLikeKeys$2;
  8319. var objectProto$4 = Object.prototype;
  8320. function isPrototype$3(value) {
  8321. var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$4;
  8322. return value === proto;
  8323. }
  8324. var _isPrototype = isPrototype$3;
  8325. function overArg$2(func, transform) {
  8326. return function(arg) {
  8327. return func(transform(arg));
  8328. };
  8329. }
  8330. var _overArg = overArg$2;
  8331. var overArg$1 = _overArg;
  8332. var nativeKeys$1 = overArg$1(Object.keys, Object);
  8333. var _nativeKeys = nativeKeys$1;
  8334. var isPrototype$2 = _isPrototype, nativeKeys = _nativeKeys;
  8335. var objectProto$3 = Object.prototype;
  8336. var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
  8337. function baseKeys$1(object) {
  8338. if (!isPrototype$2(object)) {
  8339. return nativeKeys(object);
  8340. }
  8341. var result = [];
  8342. for (var key in Object(object)) {
  8343. if (hasOwnProperty$2.call(object, key) && key != "constructor") {
  8344. result.push(key);
  8345. }
  8346. }
  8347. return result;
  8348. }
  8349. var _baseKeys = baseKeys$1;
  8350. var arrayLikeKeys$1 = _arrayLikeKeys, baseKeys = _baseKeys, isArrayLike$1 = isArrayLike_1;
  8351. function keys$3(object) {
  8352. return isArrayLike$1(object) ? arrayLikeKeys$1(object) : baseKeys(object);
  8353. }
  8354. var keys_1 = keys$3;
  8355. var copyObject$3 = _copyObject, keys$2 = keys_1;
  8356. function baseAssign$1(object, source) {
  8357. return object && copyObject$3(source, keys$2(source), object);
  8358. }
  8359. var _baseAssign = baseAssign$1;
  8360. function nativeKeysIn$1(object) {
  8361. var result = [];
  8362. if (object != null) {
  8363. for (var key in Object(object)) {
  8364. result.push(key);
  8365. }
  8366. }
  8367. return result;
  8368. }
  8369. var _nativeKeysIn = nativeKeysIn$1;
  8370. var isObject$2 = isObject_1, isPrototype$1 = _isPrototype, nativeKeysIn = _nativeKeysIn;
  8371. var objectProto$2 = Object.prototype;
  8372. var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
  8373. function baseKeysIn$1(object) {
  8374. if (!isObject$2(object)) {
  8375. return nativeKeysIn(object);
  8376. }
  8377. var isProto = isPrototype$1(object), result = [];
  8378. for (var key in object) {
  8379. if (!(key == "constructor" && (isProto || !hasOwnProperty$1.call(object, key)))) {
  8380. result.push(key);
  8381. }
  8382. }
  8383. return result;
  8384. }
  8385. var _baseKeysIn = baseKeysIn$1;
  8386. var arrayLikeKeys = _arrayLikeKeys, baseKeysIn = _baseKeysIn, isArrayLike = isArrayLike_1;
  8387. function keysIn$3(object) {
  8388. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  8389. }
  8390. var keysIn_1 = keysIn$3;
  8391. var copyObject$2 = _copyObject, keysIn$2 = keysIn_1;
  8392. function baseAssignIn$1(object, source) {
  8393. return object && copyObject$2(source, keysIn$2(source), object);
  8394. }
  8395. var _baseAssignIn = baseAssignIn$1;
  8396. var _cloneBuffer = { exports: {} };
  8397. _cloneBuffer.exports;
  8398. (function(module, exports) {
  8399. var root2 = _root;
  8400. var freeExports = exports && !exports.nodeType && exports;
  8401. var freeModule = freeExports && true && module && !module.nodeType && module;
  8402. var moduleExports = freeModule && freeModule.exports === freeExports;
  8403. var Buffer = moduleExports ? root2.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
  8404. function cloneBuffer2(buffer, isDeep) {
  8405. if (isDeep) {
  8406. return buffer.slice();
  8407. }
  8408. var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2);
  8409. buffer.copy(result);
  8410. return result;
  8411. }
  8412. module.exports = cloneBuffer2;
  8413. })(_cloneBuffer, _cloneBuffer.exports);
  8414. var _cloneBufferExports = _cloneBuffer.exports;
  8415. function copyArray$1(source, array) {
  8416. var index = -1, length2 = source.length;
  8417. array || (array = Array(length2));
  8418. while (++index < length2) {
  8419. array[index] = source[index];
  8420. }
  8421. return array;
  8422. }
  8423. var _copyArray = copyArray$1;
  8424. function arrayFilter$1(array, predicate) {
  8425. var index = -1, length2 = array == null ? 0 : array.length, resIndex = 0, result = [];
  8426. while (++index < length2) {
  8427. var value = array[index];
  8428. if (predicate(value, index, array)) {
  8429. result[resIndex++] = value;
  8430. }
  8431. }
  8432. return result;
  8433. }
  8434. var _arrayFilter = arrayFilter$1;
  8435. function stubArray$2() {
  8436. return [];
  8437. }
  8438. var stubArray_1 = stubArray$2;
  8439. var arrayFilter = _arrayFilter, stubArray$1 = stubArray_1;
  8440. var objectProto$1 = Object.prototype;
  8441. var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
  8442. var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
  8443. var getSymbols$3 = !nativeGetSymbols$1 ? stubArray$1 : function(object) {
  8444. if (object == null) {
  8445. return [];
  8446. }
  8447. object = Object(object);
  8448. return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
  8449. return propertyIsEnumerable.call(object, symbol);
  8450. });
  8451. };
  8452. var _getSymbols = getSymbols$3;
  8453. var copyObject$1 = _copyObject, getSymbols$2 = _getSymbols;
  8454. function copySymbols$1(source, object) {
  8455. return copyObject$1(source, getSymbols$2(source), object);
  8456. }
  8457. var _copySymbols = copySymbols$1;
  8458. function arrayPush$2(array, values2) {
  8459. var index = -1, length2 = values2.length, offset = array.length;
  8460. while (++index < length2) {
  8461. array[offset + index] = values2[index];
  8462. }
  8463. return array;
  8464. }
  8465. var _arrayPush = arrayPush$2;
  8466. var overArg = _overArg;
  8467. var getPrototype$2 = overArg(Object.getPrototypeOf, Object);
  8468. var _getPrototype = getPrototype$2;
  8469. var arrayPush$1 = _arrayPush, getPrototype$1 = _getPrototype, getSymbols$1 = _getSymbols, stubArray = stubArray_1;
  8470. var nativeGetSymbols = Object.getOwnPropertySymbols;
  8471. var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object) {
  8472. var result = [];
  8473. while (object) {
  8474. arrayPush$1(result, getSymbols$1(object));
  8475. object = getPrototype$1(object);
  8476. }
  8477. return result;
  8478. };
  8479. var _getSymbolsIn = getSymbolsIn$2;
  8480. var copyObject = _copyObject, getSymbolsIn$1 = _getSymbolsIn;
  8481. function copySymbolsIn$1(source, object) {
  8482. return copyObject(source, getSymbolsIn$1(source), object);
  8483. }
  8484. var _copySymbolsIn = copySymbolsIn$1;
  8485. var arrayPush = _arrayPush, isArray$1 = isArray_1;
  8486. function baseGetAllKeys$2(object, keysFunc, symbolsFunc) {
  8487. var result = keysFunc(object);
  8488. return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
  8489. }
  8490. var _baseGetAllKeys = baseGetAllKeys$2;
  8491. var baseGetAllKeys$1 = _baseGetAllKeys, getSymbols = _getSymbols, keys$1 = keys_1;
  8492. function getAllKeys$1(object) {
  8493. return baseGetAllKeys$1(object, keys$1, getSymbols);
  8494. }
  8495. var _getAllKeys = getAllKeys$1;
  8496. var baseGetAllKeys = _baseGetAllKeys, getSymbolsIn = _getSymbolsIn, keysIn$1 = keysIn_1;
  8497. function getAllKeysIn$1(object) {
  8498. return baseGetAllKeys(object, keysIn$1, getSymbolsIn);
  8499. }
  8500. var _getAllKeysIn = getAllKeysIn$1;
  8501. var getNative$3 = _getNative, root$4 = _root;
  8502. var DataView$1 = getNative$3(root$4, "DataView");
  8503. var _DataView = DataView$1;
  8504. var getNative$2 = _getNative, root$3 = _root;
  8505. var Promise$2 = getNative$2(root$3, "Promise");
  8506. var _Promise = Promise$2;
  8507. var getNative$1 = _getNative, root$2 = _root;
  8508. var Set$2 = getNative$1(root$2, "Set");
  8509. var _Set = Set$2;
  8510. var getNative = _getNative, root$1 = _root;
  8511. var WeakMap$2 = getNative(root$1, "WeakMap");
  8512. var _WeakMap = WeakMap$2;
  8513. var DataView = _DataView, Map = _Map, Promise$1 = _Promise, Set$1 = _Set, WeakMap$1 = _WeakMap, baseGetTag = _baseGetTag, toSource = _toSource;
  8514. var mapTag$3 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$3 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
  8515. var dataViewTag$2 = "[object DataView]";
  8516. var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
  8517. var getTag$3 = baseGetTag;
  8518. if (DataView && getTag$3(new DataView(new ArrayBuffer(1))) != dataViewTag$2 || Map && getTag$3(new Map()) != mapTag$3 || Promise$1 && getTag$3(Promise$1.resolve()) != promiseTag || Set$1 && getTag$3(new Set$1()) != setTag$3 || WeakMap$1 && getTag$3(new WeakMap$1()) != weakMapTag$1) {
  8519. getTag$3 = function(value) {
  8520. var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
  8521. if (ctorString) {
  8522. switch (ctorString) {
  8523. case dataViewCtorString:
  8524. return dataViewTag$2;
  8525. case mapCtorString:
  8526. return mapTag$3;
  8527. case promiseCtorString:
  8528. return promiseTag;
  8529. case setCtorString:
  8530. return setTag$3;
  8531. case weakMapCtorString:
  8532. return weakMapTag$1;
  8533. }
  8534. }
  8535. return result;
  8536. };
  8537. }
  8538. var _getTag = getTag$3;
  8539. var objectProto = Object.prototype;
  8540. var hasOwnProperty = objectProto.hasOwnProperty;
  8541. function initCloneArray$1(array) {
  8542. var length2 = array.length, result = new array.constructor(length2);
  8543. if (length2 && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
  8544. result.index = array.index;
  8545. result.input = array.input;
  8546. }
  8547. return result;
  8548. }
  8549. var _initCloneArray = initCloneArray$1;
  8550. var root = _root;
  8551. var Uint8Array$1 = root.Uint8Array;
  8552. var _Uint8Array = Uint8Array$1;
  8553. var Uint8Array = _Uint8Array;
  8554. function cloneArrayBuffer$3(arrayBuffer) {
  8555. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  8556. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  8557. return result;
  8558. }
  8559. var _cloneArrayBuffer = cloneArrayBuffer$3;
  8560. var cloneArrayBuffer$2 = _cloneArrayBuffer;
  8561. function cloneDataView$1(dataView, isDeep) {
  8562. var buffer = isDeep ? cloneArrayBuffer$2(dataView.buffer) : dataView.buffer;
  8563. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  8564. }
  8565. var _cloneDataView = cloneDataView$1;
  8566. var reFlags = /\w*$/;
  8567. function cloneRegExp$1(regexp) {
  8568. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  8569. result.lastIndex = regexp.lastIndex;
  8570. return result;
  8571. }
  8572. var _cloneRegExp = cloneRegExp$1;
  8573. var Symbol$1 = _Symbol;
  8574. var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
  8575. function cloneSymbol$1(symbol) {
  8576. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  8577. }
  8578. var _cloneSymbol = cloneSymbol$1;
  8579. var cloneArrayBuffer$1 = _cloneArrayBuffer;
  8580. function cloneTypedArray$1(typedArray, isDeep) {
  8581. var buffer = isDeep ? cloneArrayBuffer$1(typedArray.buffer) : typedArray.buffer;
  8582. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  8583. }
  8584. var _cloneTypedArray = cloneTypedArray$1;
  8585. var cloneArrayBuffer = _cloneArrayBuffer, cloneDataView = _cloneDataView, cloneRegExp = _cloneRegExp, cloneSymbol = _cloneSymbol, cloneTypedArray = _cloneTypedArray;
  8586. var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]";
  8587. var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
  8588. function initCloneByTag$1(object, tag, isDeep) {
  8589. var Ctor = object.constructor;
  8590. switch (tag) {
  8591. case arrayBufferTag$1:
  8592. return cloneArrayBuffer(object);
  8593. case boolTag$1:
  8594. case dateTag$1:
  8595. return new Ctor(+object);
  8596. case dataViewTag$1:
  8597. return cloneDataView(object, isDeep);
  8598. case float32Tag$1:
  8599. case float64Tag$1:
  8600. case int8Tag$1:
  8601. case int16Tag$1:
  8602. case int32Tag$1:
  8603. case uint8Tag$1:
  8604. case uint8ClampedTag$1:
  8605. case uint16Tag$1:
  8606. case uint32Tag$1:
  8607. return cloneTypedArray(object, isDeep);
  8608. case mapTag$2:
  8609. return new Ctor();
  8610. case numberTag$1:
  8611. case stringTag$1:
  8612. return new Ctor(object);
  8613. case regexpTag$1:
  8614. return cloneRegExp(object);
  8615. case setTag$2:
  8616. return new Ctor();
  8617. case symbolTag$1:
  8618. return cloneSymbol(object);
  8619. }
  8620. }
  8621. var _initCloneByTag = initCloneByTag$1;
  8622. var isObject$1 = isObject_1;
  8623. var objectCreate = Object.create;
  8624. var baseCreate$1 = /* @__PURE__ */ function() {
  8625. function object() {
  8626. }
  8627. return function(proto) {
  8628. if (!isObject$1(proto)) {
  8629. return {};
  8630. }
  8631. if (objectCreate) {
  8632. return objectCreate(proto);
  8633. }
  8634. object.prototype = proto;
  8635. var result = new object();
  8636. object.prototype = void 0;
  8637. return result;
  8638. };
  8639. }();
  8640. var _baseCreate = baseCreate$1;
  8641. var baseCreate = _baseCreate, getPrototype = _getPrototype, isPrototype = _isPrototype;
  8642. function initCloneObject$1(object) {
  8643. return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  8644. }
  8645. var _initCloneObject = initCloneObject$1;
  8646. var getTag$2 = _getTag, isObjectLike$1 = isObjectLike_1;
  8647. var mapTag$1 = "[object Map]";
  8648. function baseIsMap$1(value) {
  8649. return isObjectLike$1(value) && getTag$2(value) == mapTag$1;
  8650. }
  8651. var _baseIsMap = baseIsMap$1;
  8652. var baseIsMap = _baseIsMap, baseUnary$1 = _baseUnary, nodeUtil$1 = _nodeUtilExports;
  8653. var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
  8654. var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
  8655. var isMap_1 = isMap$1;
  8656. var getTag$1 = _getTag, isObjectLike = isObjectLike_1;
  8657. var setTag$1 = "[object Set]";
  8658. function baseIsSet$1(value) {
  8659. return isObjectLike(value) && getTag$1(value) == setTag$1;
  8660. }
  8661. var _baseIsSet = baseIsSet$1;
  8662. var baseIsSet = _baseIsSet, baseUnary = _baseUnary, nodeUtil = _nodeUtilExports;
  8663. var nodeIsSet = nodeUtil && nodeUtil.isSet;
  8664. var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  8665. var isSet_1 = isSet$1;
  8666. var Stack = _Stack, arrayEach = _arrayEach, assignValue = _assignValue, baseAssign = _baseAssign, baseAssignIn = _baseAssignIn, cloneBuffer = _cloneBufferExports, copyArray = _copyArray, copySymbols = _copySymbols, copySymbolsIn = _copySymbolsIn, getAllKeys = _getAllKeys, getAllKeysIn = _getAllKeysIn, getTag = _getTag, initCloneArray = _initCloneArray, initCloneByTag = _initCloneByTag, initCloneObject = _initCloneObject, isArray = isArray_1, isBuffer = isBufferExports, isMap = isMap_1, isObject = isObject_1, isSet = isSet_1, keys = keys_1, keysIn = keysIn_1;
  8667. var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$1 = 4;
  8668. var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
  8669. var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
  8670. var cloneableTags = {};
  8671. cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  8672. cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
  8673. function baseClone$1(value, bitmask, customizer, key, object, stack) {
  8674. var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
  8675. if (customizer) {
  8676. result = object ? customizer(value, key, object, stack) : customizer(value);
  8677. }
  8678. if (result !== void 0) {
  8679. return result;
  8680. }
  8681. if (!isObject(value)) {
  8682. return value;
  8683. }
  8684. var isArr = isArray(value);
  8685. if (isArr) {
  8686. result = initCloneArray(value);
  8687. if (!isDeep) {
  8688. return copyArray(value, result);
  8689. }
  8690. } else {
  8691. var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
  8692. if (isBuffer(value)) {
  8693. return cloneBuffer(value, isDeep);
  8694. }
  8695. if (tag == objectTag || tag == argsTag || isFunc && !object) {
  8696. result = isFlat || isFunc ? {} : initCloneObject(value);
  8697. if (!isDeep) {
  8698. return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
  8699. }
  8700. } else {
  8701. if (!cloneableTags[tag]) {
  8702. return object ? value : {};
  8703. }
  8704. result = initCloneByTag(value, tag, isDeep);
  8705. }
  8706. }
  8707. stack || (stack = new Stack());
  8708. var stacked = stack.get(value);
  8709. if (stacked) {
  8710. return stacked;
  8711. }
  8712. stack.set(value, result);
  8713. if (isSet(value)) {
  8714. value.forEach(function(subValue) {
  8715. result.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack));
  8716. });
  8717. } else if (isMap(value)) {
  8718. value.forEach(function(subValue, key2) {
  8719. result.set(key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
  8720. });
  8721. }
  8722. var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
  8723. var props = isArr ? void 0 : keysFunc(value);
  8724. arrayEach(props || value, function(subValue, key2) {
  8725. if (props) {
  8726. key2 = subValue;
  8727. subValue = value[key2];
  8728. }
  8729. assignValue(result, key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
  8730. });
  8731. return result;
  8732. }
  8733. var _baseClone = baseClone$1;
  8734. var baseClone = _baseClone;
  8735. var CLONE_SYMBOLS_FLAG = 4;
  8736. function clone(value) {
  8737. return baseClone(value, CLONE_SYMBOLS_FLAG);
  8738. }
  8739. var clone_1 = clone;
  8740. const lodashClone = /* @__PURE__ */ getDefaultExportFromCjs(clone_1);
  8741. const StyledPandoraDrawer = styled(Drawer$1, {
  8742. shouldForwardProp: (fieldName) => filterForwardProps(fieldName, ["openPandora", "drawerPosition"])
  8743. })(
  8744. ({ drawerPosition = "right", openPandora = false, theme }) => {
  8745. const { breakpoints, transitions } = theme;
  8746. const matches = useMediaQuery(breakpoints.up("sm"));
  8747. const drawerSize = matches ? uiConfig.pandoraDrawerMaxHeight : uiConfig.pandoraDrawerMinHeight;
  8748. const drawerSizeGap = `${50 - parseInt(drawerSize.replace("%", ""), 10) / 2}%`;
  8749. const baseStyle = {
  8750. borderRadius: "0.75rem"
  8751. };
  8752. switch (drawerPosition) {
  8753. case "top":
  8754. return {
  8755. [`& .${drawerClasses$1.paper}`]: {
  8756. height: uiConfig.pandoraDrawerWidth,
  8757. width: `${drawerSize}`,
  8758. left: drawerSizeGap
  8759. }
  8760. };
  8761. case "right":
  8762. return {
  8763. [`& .${drawerClasses$1.paper}`]: {
  8764. ...baseStyle,
  8765. width: 0,
  8766. height: `${drawerSize}`,
  8767. top: drawerSizeGap,
  8768. transition: transitions.create(["width"], {
  8769. easing: transitions.easing.sharp,
  8770. duration: transitions.duration.shorter
  8771. }),
  8772. ...openPandora && {
  8773. width: uiConfig.pandoraDrawerWidth,
  8774. transition: transitions.create(["width"], {
  8775. easing: transitions.easing.sharp,
  8776. duration: transitions.duration.enteringScreen
  8777. })
  8778. }
  8779. }
  8780. };
  8781. case "bottom":
  8782. return {
  8783. [`& .${drawerClasses$1.paper}`]: {
  8784. height: uiConfig.pandoraDrawerWidth,
  8785. width: `${drawerSize}`,
  8786. left: drawerSizeGap
  8787. }
  8788. };
  8789. case "left":
  8790. return {
  8791. [`& .${drawerClasses$1.paper}`]: {
  8792. width: uiConfig.pandoraDrawerWidth,
  8793. height: `${drawerSize}`,
  8794. top: drawerSizeGap
  8795. }
  8796. };
  8797. default:
  8798. return {
  8799. [`& .${drawerClasses$1.paper}`]: {
  8800. width: uiConfig.pandoraDrawerWidth,
  8801. height: `${drawerSize}`,
  8802. top: drawerSizeGap
  8803. }
  8804. };
  8805. }
  8806. }
  8807. );
  8808. function PandoraDrawer({
  8809. openDrawer = false,
  8810. handleCloseDrawer = void 0,
  8811. drawerPosition = "right",
  8812. ...restProps
  8813. }) {
  8814. const theme = useTheme();
  8815. useMediaQuery(theme.breakpoints.up("sm"));
  8816. const [forceStop, setForceStop] = React.useState(false);
  8817. const drawerVariant = drawerPosition === "left" || drawerPosition === "right" ? "permanent" : "persistent";
  8818. const handleModifyInviteExpiredTime = async (inviteIDs, csrfToken) => {
  8819. if (forceStop) {
  8820. setForceStop(false);
  8821. console.warn("用户强制跳出");
  8822. return;
  8823. }
  8824. if (inviteIDs.length <= 0) {
  8825. return;
  8826. }
  8827. const inviteID = inviteIDs.splice(0, 1)[0];
  8828. const modifyRes = await fetchUpdateInvite(inviteID, csrfToken);
  8829. console.log(modifyRes);
  8830. const randSleepTime = Math.floor(Math.random() * (2e3 - 1e3 + 1)) + 1e3;
  8831. setTimeout(() => {
  8832. handleModifyInviteExpiredTime(inviteIDs, csrfToken);
  8833. }, randSleepTime);
  8834. };
  8835. const handleModifyInvitesExpiredTime = async () => {
  8836. const username = getPreloadedUsername();
  8837. const csrfToken = getCsrfToken();
  8838. if (username && csrfToken) {
  8839. const invitesData = await fetchGetInvites(username, csrfToken, "pending", 0);
  8840. if (invitesData) {
  8841. const invites = lodashClone(invitesData.invites);
  8842. await handleModifyInviteExpiredTime(invites.map((invite) => invite.id), csrfToken);
  8843. }
  8844. }
  8845. };
  8846. return /* @__PURE__ */ jsxRuntimeExports.jsx(
  8847. StyledPandoraDrawer,
  8848. {
  8849. anchor: drawerPosition,
  8850. variant: drawerVariant,
  8851. open: openDrawer,
  8852. onClose: () => handleCloseDrawer && handleCloseDrawer(),
  8853. ModalProps: {
  8854. keepMounted: true
  8855. },
  8856. openPandora: openDrawer,
  8857. drawerPosition,
  8858. children: /* @__PURE__ */ jsxRuntimeExports.jsx(Box$1, { component: "div", sx: { m: "0.5rem" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { variant: "contained", onClick: () => handleModifyInvitesExpiredTime(), children: "一键修改邀请时限" }) })
  8859. }
  8860. );
  8861. }
  8862. function ThemeProvider({ children, ...restProps }) {
  8863. const theme = createTheme({});
  8864. return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider$1, { theme, children });
  8865. }
  8866. function App() {
  8867. const [openPandora, setOpenPandora] = React.useState(false);
  8868. const toggleOpenPandora = () => {
  8869. setOpenPandora((prevState) => !prevState);
  8870. };
  8871. const handleClosePandora = () => {
  8872. setOpenPandora(false);
  8873. };
  8874. return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.pandoraButton, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ThemeProvider, { children: [
  8875. /* @__PURE__ */ jsxRuntimeExports.jsx(PandoraButton, { openPandora, onClick: () => toggleOpenPandora() }),
  8876. /* @__PURE__ */ jsxRuntimeExports.jsx(PandoraDrawer, { openDrawer: openPandora, handleCloseDrawer: handleClosePandora })
  8877. ] }) });
  8878. }
  8879. const appendLinuxDoNext = () => {
  8880. const app = document.createElement("div");
  8881. app.setAttribute("id", styles$1.pluginContainer);
  8882. document.body.append(app);
  8883. return app;
  8884. };
  8885. client.createRoot(appendLinuxDoNext()).render(
  8886. /* @__PURE__ */ jsxRuntimeExports.jsx(React.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App, {}) })
  8887. );
  8888.  
  8889. })(React, ReactDOM);