@perses-dev/scatter-chart-plugin 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,174 +0,0 @@
1
- /*! For license information please see 11.d25f5643.js.LICENSE.txt */
2
- (self.webpackChunkScatterChart=self.webpackChunkScatterChart||[]).push([["11"],{7960:function(e,t,n){"use strict";function r(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,{Z:()=>r})},2747:function(e,t,n){"use strict";n.d(t,{O:()=>f});var r,i={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},o=n(7960),a=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!=typeof e},c=(0,o.Z)(function(e){return l(e)?e:e.replace(a,"-$&").toLowerCase()}),d=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(s,function(e,t,n){return r={name:t,styles:n,next:r},t})}return 1===i[e]||l(e)||"number"!=typeof t||0===t?t:t+"px"};function h(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return r={name:n.name,styles:n.styles,next:r},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)r={name:i.name,styles:i.styles,next:r},i=i.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=h(e,t,n[i])+";";else for(var o in n){var a=n[o];if("object"!=typeof a)null!=t&&void 0!==t[a]?r+=o+"{"+t[a]+"}":u(a)&&(r+=c(o)+":"+d(o,a)+";");else if(Array.isArray(a)&&"string"==typeof a[0]&&(null==t||void 0===t[a[0]]))for(var s=0;s<a.length;s++)u(a[s])&&(r+=c(o)+":"+d(o,a[s])+";");else{var l=h(e,t,a);switch(o){case"animation":case"animationName":r+=c(o)+":"+l+";";break;default:r+=o+"{"+l+"}"}}}return r}(e,t,n);case"function":if(void 0!==e){var o=r,a=n(e);return r=o,h(e,t,a)}}if(null==t)return n;var s=t[n];return void 0!==s?s:n}var p=/label:\s*([^\s;{]+)\s*(;|$)/g;function f(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var i,o=!0,a="";r=void 0;var s=e[0];null==s||void 0===s.raw?(o=!1,a+=h(n,t,s)):a+=s[0];for(var l=1;l<e.length;l++)a+=h(n,t,e[l]),o&&(a+=s[l]);p.lastIndex=0;for(var u="";null!==(i=p.exec(a));)u+="-"+i[1];return{name:function(e){for(var t,n=0,r=0,i=e.length;i>=4;++r,i-=4)t=(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))*0x5bd1e995+((t>>>16)*59797<<16),t^=t>>>24,n=(65535&t)*0x5bd1e995+((t>>>16)*59797<<16)^(65535&n)*0x5bd1e995+((n>>>16)*59797<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n^=255&e.charCodeAt(r),n=(65535&n)*0x5bd1e995+((n>>>16)*59797<<16)}return n^=n>>>13,(((n=(65535&n)*0x5bd1e995+((n>>>16)*59797<<16))^n>>>15)>>>0).toString(36)}(a)+u,styles:a,next:r}}},1751:function(e,t,n){"use strict";n.d(t,{i:()=>a});var r=n(4538),i=n(6819);n(4246);let o=r.createContext(void 0);function a(e){return function({props:e,name:t}){return function(e){let{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;let o=t.components[n];return o.defaultProps?(0,i.Z)(o.defaultProps,r):o.styleOverrides||o.variants?r:(0,i.Z)(o,r)}({props:e,name:t,theme:{components:r.useContext(o)}})}(e)}},6385:function(e,t,n){"use strict";n.d(t,{Z:()=>et});var r=n(2220),i=n(1170),o=n(6838);let a={black:"#000",white:"#fff"},s={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},l={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},u={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},c={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},d={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},h={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},p={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};function f(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:a.white,default:a.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}let g=f();function m(){return{text:{primary:a.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:a.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}let v=m();function y(e,t,n,r){let i=r.light||r,a=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,o.$n)(e.main,i):"dark"===t&&(e.dark=(0,o._j)(e.main,a)))}function b(e){let t;let{mode:n="light",contrastThreshold:b=3,tonalOffset:x=.2,...w}=e,S=e.primary||function(e="light"){return"dark"===e?{main:d["200"],light:d["50"],dark:d["400"]}:{main:d["700"],light:d["400"],dark:d["800"]}}(n),C=e.secondary||function(e="light"){return"dark"===e?{main:l["200"],light:l["50"],dark:l["400"]}:{main:l["500"],light:l["300"],dark:l["700"]}}(n),k=e.error||function(e="light"){return"dark"===e?{main:u["500"],light:u["300"],dark:u["700"]}:{main:u["700"],light:u["400"],dark:u["800"]}}(n),M=e.info||function(e="light"){return"dark"===e?{main:h["400"],light:h["300"],dark:h["700"]}:{main:h["700"],light:h["500"],dark:h["900"]}}(n),T=e.success||function(e="light"){return"dark"===e?{main:p["400"],light:p["300"],dark:p["700"]}:{main:p["800"],light:p["500"],dark:p["900"]}}(n),A=e.warning||function(e="light"){return"dark"===e?{main:c["400"],light:c["300"],dark:c["700"]}:{main:"#ed6c02",light:c["500"],dark:c["900"]}}(n);function I(e){return(0,o.mi)(e,v.text.primary)>=b?v.text.primary:g.text.primary}let P=({color:e,name:t,mainShade:n=500,lightShade:i=300,darkShade:o=700})=>{if(!(e={...e}).main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty("main"))throw Error((0,r.Z)(11,t?` (${t})`:"",n));if("string"!=typeof e.main)throw Error((0,r.Z)(12,t?` (${t})`:"",JSON.stringify(e.main)));return y(e,"light",i,x),y(e,"dark",o,x),e.contrastText||(e.contrastText=I(e.main)),e};return"light"===n?t=f():"dark"===n&&(t=m()),(0,i.Z)({common:{...a},mode:n,primary:P({color:S,name:"primary"}),secondary:P({color:C,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:P({color:k,name:"error"}),warning:P({color:A,name:"warning"}),info:P({color:M,name:"info"}),success:P({color:T,name:"success"}),grey:s,contrastThreshold:b,getContrastText:I,augmentColor:P,tonalOffset:x,...t},w)}var x=n(4715),w=n(2664);let S=(e,t,n,r=[])=>{let i=e;t.forEach((e,o)=>{o===t.length-1?Array.isArray(i)?i[Number(e)]=n:i&&"object"==typeof i&&(i[e]=n):i&&"object"==typeof i&&(i[e]||(i[e]=r.includes(e)?[]:{}),i=i[e])})},C=(e,t,n)=>{!function e(r,i=[],o=[]){Object.entries(r).forEach(([r,a])=>{n&&(!n||n([...i,r]))||null==a||("object"==typeof a&&Object.keys(a).length>0?e(a,[...i,r],Array.isArray(a)?[...o,r]:o):t([...i,r],a,o))})}(e)},k=(e,t)=>"number"==typeof t?["lineHeight","fontWeight","opacity","zIndex"].some(t=>e.includes(t))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function M(e,t){let{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},a={};return C(e,(e,t,s)=>{if(("string"==typeof t||"number"==typeof t)&&(!r||!r(e,t))){let r=`--${n?`${n}-`:""}${e.join("-")}`,l=k(e,t);Object.assign(i,{[r]:l}),S(o,e,`var(${r})`,s),S(a,e,`var(${r}, ${l})`,s)}},e=>"vars"===e[0]),{css:i,vars:o,varsWithDefaults:a}}let T=function(e,t={}){let{getSelector:n=function(t,n){let r=o;if("class"===o&&(r=".%s"),"data"===o&&(r="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(r=`[${o}="%s"]`),t){if("media"===r){if(e.defaultColorScheme===t)return":root";let r=a[t]?.palette?.mode||t;return{[`@media (prefers-color-scheme: ${r})`]:{":root":n}}}if(r)return e.defaultColorScheme===t?`:root, ${r.replace("%s",String(t))}`:r.replace("%s",String(t))}return":root"},disableCssColorScheme:r,colorSchemeSelector:o}=t,{colorSchemes:a={},components:s,defaultColorScheme:l="light",...u}=e,{vars:c,css:d,varsWithDefaults:h}=M(u,t),p=h,f={},{[l]:g,...m}=a;if(Object.entries(m||{}).forEach(([e,n])=>{let{vars:r,css:o,varsWithDefaults:a}=M(n,t);p=(0,i.Z)(p,a),f[e]={css:o,vars:r}}),g){let{css:e,vars:n,varsWithDefaults:r}=M(g,t);p=(0,i.Z)(p,r),f[l]={css:e,vars:n}}return{vars:p,generateThemeVars:()=>{let e={...c};return Object.entries(f).forEach(([,{vars:t}])=>{e=(0,i.Z)(e,t)}),e},generateStyleSheets:()=>{let t=[],i=e.defaultColorScheme||"light";function o(e,n){Object.keys(n).length&&t.push("string"==typeof e?{[e]:{...n}}:e)}o(n(void 0,{...d}),d);let{[i]:s,...l}=f;if(s){let{css:e}=s,t=a[i]?.palette?.mode,l=!r&&t?{colorScheme:t,...e}:{...e};o(n(i,{...l}),l)}return Object.entries(l).forEach(([e,{css:t}])=>{let i=a[e]?.palette?.mode,s=!r&&i?{colorScheme:i,...t}:{...t};o(n(e,{...s}),s)}),t}}};var A=n(273),I=n(1652),P=n(6798);let R={textTransform:"uppercase"},O='"Roboto", "Helvetica", "Arial", sans-serif';function E(...e){return`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2),${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14),${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`}let D=["none",E(0,2,1,-1,0,1,1,0,0,1,3,0),E(0,3,1,-2,0,2,2,0,0,1,5,0),E(0,3,3,-2,0,3,4,0,0,1,8,0),E(0,2,4,-1,0,4,5,0,0,1,10,0),E(0,3,5,-1,0,5,8,0,0,1,14,0),E(0,3,5,-1,0,6,10,0,0,1,18,0),E(0,4,5,-2,0,7,10,1,0,2,16,1),E(0,5,5,-3,0,8,10,1,0,3,14,2),E(0,5,6,-3,0,9,12,1,0,3,16,2),E(0,6,6,-3,0,10,14,1,0,4,18,3),E(0,6,7,-4,0,11,15,1,0,4,20,3),E(0,7,8,-4,0,12,17,2,0,5,22,4),E(0,7,8,-4,0,13,19,2,0,5,24,4),E(0,7,9,-4,0,14,21,2,0,5,26,4),E(0,8,9,-5,0,15,22,2,0,6,28,5),E(0,8,10,-5,0,16,24,2,0,6,30,5),E(0,8,11,-5,0,17,26,2,0,6,32,5),E(0,9,11,-5,0,18,28,2,0,7,34,6),E(0,9,12,-6,0,19,29,2,0,7,36,6),E(0,10,13,-6,0,20,31,3,0,8,38,7),E(0,10,13,-6,0,21,33,3,0,8,40,7),E(0,10,14,-6,0,22,35,3,0,8,42,7),E(0,11,14,-7,0,23,36,3,0,9,44,8),E(0,11,15,-7,0,24,38,3,0,9,46,8)],L={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},_={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function N(e){return`${Math.round(e)}ms`}function Z(e){if(!e)return 0;let t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}let j={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function B(e={}){let t={...e};return!function e(t){let n=Object.entries(t);for(let r=0;r<n.length;r++){let[o,a]=n[r];!((0,i.P)(a)||void 0===a||"string"==typeof a||"boolean"==typeof a||"number"==typeof a||Array.isArray(a))||o.startsWith("unstable_")?delete t[o]:(0,i.P)(a)&&(t[o]={...a},e(t[o]))}}(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
3
-
4
- const theme = ${JSON.stringify(t,null,2)};
5
-
6
- theme.breakpoints = createBreakpoints(theme.breakpoints || {});
7
- theme.transitions = createTransitions(theme.transitions || {});
8
-
9
- export default theme;`}let F=function(e={},...t){var n;let{breakpoints:o,mixins:a={},spacing:s,palette:l={},transitions:u={},typography:c={},shape:d,...h}=e;if(e.vars&&void 0===e.generateThemeVars)throw Error((0,r.Z)(20));let p=b(l),f=(0,P.Z)(e),g=(0,i.Z)(f,{mixins:{toolbar:{minHeight:56,[(n=f.breakpoints).up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[n.up("sm")]:{minHeight:64}},...a},palette:p,shadows:D.slice(),typography:function(e,t){let{fontFamily:n=O,fontSize:r=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:u=16,allVariants:c,pxToRem:d,...h}="function"==typeof t?t(e):t,p=r/14,f=d||(e=>`${e/u*p}rem`),g=(e,t,r,i,o)=>({fontFamily:n,fontWeight:e,fontSize:f(t),lineHeight:r,...n===O?{letterSpacing:`${Math.round(i/t*1e5)/1e5}em`}:{},...o,...c}),m={h1:g(o,96,1.167,-1.5),h2:g(o,60,1.2,-.5),h3:g(a,48,1.167,0),h4:g(a,34,1.235,.25),h5:g(a,24,1.334,0),h6:g(s,20,1.6,.15),subtitle1:g(a,16,1.75,.15),subtitle2:g(s,14,1.57,.1),body1:g(a,16,1.5,.15),body2:g(a,14,1.43,.15),button:g(s,14,1.75,.4,R),caption:g(a,12,1.66,.4),overline:g(a,12,2.66,1,R),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,i.Z)({htmlFontSize:u,pxToRem:f,fontFamily:n,fontSize:r,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l,...m},h,{clone:!1})}(p,c),transitions:function(e){let t={...L,...e.easing},n={..._,...e.duration};return{getAutoHeightDuration:Z,create:(e=["all"],r={})=>{let{duration:i=n.standard,easing:o=t.easeInOut,delay:a=0,...s}=r;return(Array.isArray(e)?e:[e]).map(e=>`${e} ${"string"==typeof i?i:N(i)} ${o} ${"string"==typeof a?a:N(a)}`).join(",")},...e,easing:t,duration:n}}(u),zIndex:{...j}});return g=(0,i.Z)(g,h),(g=t.reduce((e,t)=>(0,i.Z)(e,t),g)).unstable_sxConfig={...A.Z,...h?.unstable_sxConfig},g.unstable_sx=function(e){return(0,I.Z)({sx:e,theme:this})},g.toRuntimeSource=B,g};var z=n(8505);let $=[...Array(25)].map((e,t)=>{if(0===t)return"none";let n=(0,z.Z)(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function V(e){return{inputPlaceholder:"dark"===e?.5:.42,inputUnderline:"dark"===e?.7:.42,switchTrackDisabled:"dark"===e?.2:.12,switchTrack:"dark"===e?.3:.38}}function H(e){return"dark"===e?$:[]}function W(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||"palette"===e[0]&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}let q=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],G=e=>(t,n)=>{let r=e.rootSelector||":root",i=e.colorSchemeSelector,o=i;if("class"===i&&(o=".%s"),"data"===i&&(o="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),e.defaultColorScheme===t){if("dark"===t){let i={};return(q(e.cssVarPrefix).forEach(e=>{i[e]=n[e],delete n[e]}),"media"===o)?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:o?{[o.replace("%s",t)]:i,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:{...n,...i}}}if(o&&"media"!==o)return`${r}, ${o.replace("%s",String(t))}`}else if(t){if("media"===o)return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function U(e,t,n){!e[t]&&n&&(e[t]=n)}function K(e){return"string"==typeof e&&e.startsWith("hsl")?(0,o.ve)(e):e}function Y(e,t){`${t}Channel`in e||(e[`${t}Channel`]=(0,o.LR)(K(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
10
- To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}let X=e=>{try{return e()}catch(e){}},J=(e="mui")=>(function(e=""){return(t,...n)=>`var(--${e?`${e}-`:""}${t}${function t(...n){if(!n.length)return"";let r=n[0];return"string"!=typeof r||r.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, ${r}`:`, var(--${e?`${e}-`:""}${r}${t(...n.slice(1))})`}(...n)})`})(e);function Q(e,t,n,r){if(!t)return;t=!0===t?{}:t;let i="dark"===r?"dark":"light";if(!n){e[r]=function(e){let{palette:t={mode:"light"},opacity:n,overlays:r,...i}=e,o=b(t);return{palette:o,opacity:{...V(o.mode),...n},overlays:r||H(o.mode),...i}}({...t,palette:{mode:i,...t?.palette}});return}let{palette:o,...a}=F({...n,palette:{mode:i,...t?.palette}});return e[r]={...t,palette:o,opacity:{...V(i),...t?.opacity},overlays:t?.overlays||H(i)},a}function ee(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...!0!==n&&n,palette:b({...!0===n?{}:n.palette,mode:t})})}function et(e={},...t){let{palette:n,cssVariables:a=!1,colorSchemes:s=n?void 0:{light:!0},defaultColorScheme:l=n?.mode,...u}=e,c=l||"light",d=s?.[c],h={...s,...n?{[c]:{..."boolean"!=typeof d&&d,palette:n}}:void 0};if(!1===a){if(!("colorSchemes"in e))return F(e,...t);let r=n;"palette"in e||!h[c]||(!0!==h[c]?r=h[c].palette:"dark"!==c||(r={mode:"dark"}));let i=F({...e,palette:r},...t);return i.defaultColorScheme=c,i.colorSchemes=h,"light"===i.palette.mode&&(i.colorSchemes.light={...!0!==h.light&&h.light,palette:i.palette},ee(i,"dark",h.dark)),"dark"===i.palette.mode&&(i.colorSchemes.dark={...!0!==h.dark&&h.dark,palette:i.palette},ee(i,"light",h.light)),i}return n||"light"in h||"light"!==c||(h.light=!0),function(e={},...t){var n;let{colorSchemes:a={light:!0},defaultColorScheme:s,disableCssColorScheme:l=!1,cssVarPrefix:u="mui",shouldSkipGeneratingVar:c=W,colorSchemeSelector:d=a.light&&a.dark?"media":void 0,rootSelector:h=":root",...p}=e,f=Object.keys(a)[0],g=s||(a.light&&"light"!==f?"light":f),m=J(u),{[g]:v,light:y,dark:b,...S}=a,C={...S},k=v;if(("dark"!==g||"dark"in a)&&("light"!==g||"light"in a)||(k=!0),!k)throw Error((0,r.Z)(21,g));let M=Q(C,k,p,g);y&&!C.light&&Q(C,y,void 0,"light"),b&&!C.dark&&Q(C,b,void 0,"dark");let P={defaultColorScheme:g,...M,cssVarPrefix:u,colorSchemeSelector:d,rootSelector:h,getCssVar:m,colorSchemes:C,font:{...function(e){let t={};return Object.entries(e).forEach(e=>{let[n,r]=e;"object"==typeof r&&(t[n]=`${r.fontStyle?`${r.fontStyle} `:""}${r.fontVariant?`${r.fontVariant} `:""}${r.fontWeight?`${r.fontWeight} `:""}${r.fontStretch?`${r.fontStretch} `:""}${r.fontSize||""}${r.lineHeight?`/${r.lineHeight} `:""}${r.fontFamily||""}`)}),t}(M.typography),...M.font},spacing:"number"==typeof(n=p.spacing)?`${n}px`:"string"==typeof n||"function"==typeof n||Array.isArray(n)?n:"8px"};Object.keys(P.colorSchemes).forEach(e=>{let t=P.colorSchemes[e].palette,n=e=>{let n=e.split("-"),r=n[1],i=n[2];return m(e,t[r][i])};if("light"===t.mode&&(U(t.common,"background","#fff"),U(t.common,"onBackground","#000")),"dark"===t.mode&&(U(t.common,"background","#000"),U(t.common,"onBackground","#fff")),function(e,t){t.forEach(t=>{e[t]||(e[t]={})})}(t,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),"light"===t.mode){U(t.Alert,"errorColor",(0,o.q8)(t.error.light,.6)),U(t.Alert,"infoColor",(0,o.q8)(t.info.light,.6)),U(t.Alert,"successColor",(0,o.q8)(t.success.light,.6)),U(t.Alert,"warningColor",(0,o.q8)(t.warning.light,.6)),U(t.Alert,"errorFilledBg",n("palette-error-main")),U(t.Alert,"infoFilledBg",n("palette-info-main")),U(t.Alert,"successFilledBg",n("palette-success-main")),U(t.Alert,"warningFilledBg",n("palette-warning-main")),U(t.Alert,"errorFilledColor",X(()=>t.getContrastText(t.error.main))),U(t.Alert,"infoFilledColor",X(()=>t.getContrastText(t.info.main))),U(t.Alert,"successFilledColor",X(()=>t.getContrastText(t.success.main))),U(t.Alert,"warningFilledColor",X(()=>t.getContrastText(t.warning.main))),U(t.Alert,"errorStandardBg",(0,o.ux)(t.error.light,.9)),U(t.Alert,"infoStandardBg",(0,o.ux)(t.info.light,.9)),U(t.Alert,"successStandardBg",(0,o.ux)(t.success.light,.9)),U(t.Alert,"warningStandardBg",(0,o.ux)(t.warning.light,.9)),U(t.Alert,"errorIconColor",n("palette-error-main")),U(t.Alert,"infoIconColor",n("palette-info-main")),U(t.Alert,"successIconColor",n("palette-success-main")),U(t.Alert,"warningIconColor",n("palette-warning-main")),U(t.AppBar,"defaultBg",n("palette-grey-100")),U(t.Avatar,"defaultBg",n("palette-grey-400")),U(t.Button,"inheritContainedBg",n("palette-grey-300")),U(t.Button,"inheritContainedHoverBg",n("palette-grey-A100")),U(t.Chip,"defaultBorder",n("palette-grey-400")),U(t.Chip,"defaultAvatarColor",n("palette-grey-700")),U(t.Chip,"defaultIconColor",n("palette-grey-700")),U(t.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),U(t.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),U(t.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),U(t.LinearProgress,"primaryBg",(0,o.ux)(t.primary.main,.62)),U(t.LinearProgress,"secondaryBg",(0,o.ux)(t.secondary.main,.62)),U(t.LinearProgress,"errorBg",(0,o.ux)(t.error.main,.62)),U(t.LinearProgress,"infoBg",(0,o.ux)(t.info.main,.62)),U(t.LinearProgress,"successBg",(0,o.ux)(t.success.main,.62)),U(t.LinearProgress,"warningBg",(0,o.ux)(t.warning.main,.62)),U(t.Skeleton,"bg",`rgba(${n("palette-text-primaryChannel")} / 0.11)`),U(t.Slider,"primaryTrack",(0,o.ux)(t.primary.main,.62)),U(t.Slider,"secondaryTrack",(0,o.ux)(t.secondary.main,.62)),U(t.Slider,"errorTrack",(0,o.ux)(t.error.main,.62)),U(t.Slider,"infoTrack",(0,o.ux)(t.info.main,.62)),U(t.Slider,"successTrack",(0,o.ux)(t.success.main,.62)),U(t.Slider,"warningTrack",(0,o.ux)(t.warning.main,.62));let e=(0,o.fk)(t.background.default,.8);U(t.SnackbarContent,"bg",e),U(t.SnackbarContent,"color",X(()=>t.getContrastText(e))),U(t.SpeedDialAction,"fabHoverBg",(0,o.fk)(t.background.paper,.15)),U(t.StepConnector,"border",n("palette-grey-400")),U(t.StepContent,"border",n("palette-grey-400")),U(t.Switch,"defaultColor",n("palette-common-white")),U(t.Switch,"defaultDisabledColor",n("palette-grey-100")),U(t.Switch,"primaryDisabledColor",(0,o.ux)(t.primary.main,.62)),U(t.Switch,"secondaryDisabledColor",(0,o.ux)(t.secondary.main,.62)),U(t.Switch,"errorDisabledColor",(0,o.ux)(t.error.main,.62)),U(t.Switch,"infoDisabledColor",(0,o.ux)(t.info.main,.62)),U(t.Switch,"successDisabledColor",(0,o.ux)(t.success.main,.62)),U(t.Switch,"warningDisabledColor",(0,o.ux)(t.warning.main,.62)),U(t.TableCell,"border",(0,o.ux)((0,o.zp)(t.divider,1),.88)),U(t.Tooltip,"bg",(0,o.zp)(t.grey[700],.92))}if("dark"===t.mode){U(t.Alert,"errorColor",(0,o.ux)(t.error.light,.6)),U(t.Alert,"infoColor",(0,o.ux)(t.info.light,.6)),U(t.Alert,"successColor",(0,o.ux)(t.success.light,.6)),U(t.Alert,"warningColor",(0,o.ux)(t.warning.light,.6)),U(t.Alert,"errorFilledBg",n("palette-error-dark")),U(t.Alert,"infoFilledBg",n("palette-info-dark")),U(t.Alert,"successFilledBg",n("palette-success-dark")),U(t.Alert,"warningFilledBg",n("palette-warning-dark")),U(t.Alert,"errorFilledColor",X(()=>t.getContrastText(t.error.dark))),U(t.Alert,"infoFilledColor",X(()=>t.getContrastText(t.info.dark))),U(t.Alert,"successFilledColor",X(()=>t.getContrastText(t.success.dark))),U(t.Alert,"warningFilledColor",X(()=>t.getContrastText(t.warning.dark))),U(t.Alert,"errorStandardBg",(0,o.q8)(t.error.light,.9)),U(t.Alert,"infoStandardBg",(0,o.q8)(t.info.light,.9)),U(t.Alert,"successStandardBg",(0,o.q8)(t.success.light,.9)),U(t.Alert,"warningStandardBg",(0,o.q8)(t.warning.light,.9)),U(t.Alert,"errorIconColor",n("palette-error-main")),U(t.Alert,"infoIconColor",n("palette-info-main")),U(t.Alert,"successIconColor",n("palette-success-main")),U(t.Alert,"warningIconColor",n("palette-warning-main")),U(t.AppBar,"defaultBg",n("palette-grey-900")),U(t.AppBar,"darkBg",n("palette-background-paper")),U(t.AppBar,"darkColor",n("palette-text-primary")),U(t.Avatar,"defaultBg",n("palette-grey-600")),U(t.Button,"inheritContainedBg",n("palette-grey-800")),U(t.Button,"inheritContainedHoverBg",n("palette-grey-700")),U(t.Chip,"defaultBorder",n("palette-grey-700")),U(t.Chip,"defaultAvatarColor",n("palette-grey-300")),U(t.Chip,"defaultIconColor",n("palette-grey-300")),U(t.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),U(t.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),U(t.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),U(t.LinearProgress,"primaryBg",(0,o.q8)(t.primary.main,.5)),U(t.LinearProgress,"secondaryBg",(0,o.q8)(t.secondary.main,.5)),U(t.LinearProgress,"errorBg",(0,o.q8)(t.error.main,.5)),U(t.LinearProgress,"infoBg",(0,o.q8)(t.info.main,.5)),U(t.LinearProgress,"successBg",(0,o.q8)(t.success.main,.5)),U(t.LinearProgress,"warningBg",(0,o.q8)(t.warning.main,.5)),U(t.Skeleton,"bg",`rgba(${n("palette-text-primaryChannel")} / 0.13)`),U(t.Slider,"primaryTrack",(0,o.q8)(t.primary.main,.5)),U(t.Slider,"secondaryTrack",(0,o.q8)(t.secondary.main,.5)),U(t.Slider,"errorTrack",(0,o.q8)(t.error.main,.5)),U(t.Slider,"infoTrack",(0,o.q8)(t.info.main,.5)),U(t.Slider,"successTrack",(0,o.q8)(t.success.main,.5)),U(t.Slider,"warningTrack",(0,o.q8)(t.warning.main,.5));let e=(0,o.fk)(t.background.default,.98);U(t.SnackbarContent,"bg",e),U(t.SnackbarContent,"color",X(()=>t.getContrastText(e))),U(t.SpeedDialAction,"fabHoverBg",(0,o.fk)(t.background.paper,.15)),U(t.StepConnector,"border",n("palette-grey-600")),U(t.StepContent,"border",n("palette-grey-600")),U(t.Switch,"defaultColor",n("palette-grey-300")),U(t.Switch,"defaultDisabledColor",n("palette-grey-600")),U(t.Switch,"primaryDisabledColor",(0,o.q8)(t.primary.main,.55)),U(t.Switch,"secondaryDisabledColor",(0,o.q8)(t.secondary.main,.55)),U(t.Switch,"errorDisabledColor",(0,o.q8)(t.error.main,.55)),U(t.Switch,"infoDisabledColor",(0,o.q8)(t.info.main,.55)),U(t.Switch,"successDisabledColor",(0,o.q8)(t.success.main,.55)),U(t.Switch,"warningDisabledColor",(0,o.q8)(t.warning.main,.55)),U(t.TableCell,"border",(0,o.q8)((0,o.zp)(t.divider,1),.68)),U(t.Tooltip,"bg",(0,o.zp)(t.grey[700],.92))}Y(t.background,"default"),Y(t.background,"paper"),Y(t.common,"background"),Y(t.common,"onBackground"),Y(t,"divider"),Object.keys(t).forEach(e=>{let n=t[e];"tonalOffset"!==e&&n&&"object"==typeof n&&(n.main&&U(t[e],"mainChannel",(0,o.LR)(K(n.main))),n.light&&U(t[e],"lightChannel",(0,o.LR)(K(n.light))),n.dark&&U(t[e],"darkChannel",(0,o.LR)(K(n.dark))),n.contrastText&&U(t[e],"contrastTextChannel",(0,o.LR)(K(n.contrastText))),"text"===e&&(Y(t[e],"primary"),Y(t[e],"secondary")),"action"===e&&(n.active&&Y(t[e],"active"),n.selected&&Y(t[e],"selected")))})});let R={prefix:u,disableCssColorScheme:l,shouldSkipGeneratingVar:c,getSelector:G(P=t.reduce((e,t)=>(0,i.Z)(e,t),P))},{vars:O,generateThemeVars:E,generateStyleSheets:D}=T(P,R);return P.vars=O,Object.entries(P.colorSchemes[P.defaultColorScheme]).forEach(([e,t])=>{P[e]=t}),P.generateThemeVars=E,P.generateStyleSheets=D,P.generateSpacing=function(){return(0,x.Z)(p.spacing,(0,w.hB)(this))},P.getColorSchemeSelector=function(e){return"media"===d?`@media (prefers-color-scheme: ${e})`:d?d.startsWith("data-")&&!d.includes("%s")?`[${d}="${e}"] &`:"class"===d?`.${e} &`:"data"===d?`[data-${e}] &`:`${d.replace("%s",e)} &`:"&"},P.spacing=P.generateSpacing(),P.shouldSkipGeneratingVar=c,P.unstable_sxConfig={...A.Z,...p?.unstable_sxConfig},P.unstable_sx=function(e){return(0,I.Z)({sx:e,theme:this})},P.toRuntimeSource=B,P}({...u,colorSchemes:h,defaultColorScheme:c,..."boolean"!=typeof a&&a},...t)}},3126:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=(0,n(6385).Z)()},8505:function(e,t,n){"use strict";function r(e){let t;return Math.round(10*(e<1?5.11916*e**2:4.5*Math.log(e+1)+2))/1e3}n.d(t,{Z:()=>r})},2994:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r="$$material"},3037:function(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(4005);let i=e=>(0,r.Z)(e)&&"classes"!==e},4005:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=function(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}},2709:function(e,t,n){"use strict";n.d(t,{ZP:()=>s});var r=n(5315),i=n(3126),o=n(2994),a=n(3037);let s=(0,r.ZP)({themeId:o.Z,defaultTheme:i.Z,rootShouldForwardProp:a.Z})},1640:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=n(3150).Z},247:function(e,t,n){"use strict";n.d(t,{Z:()=>v});var r=n(4538),i=n(496),o=n(2267),a=n(1640),s=n(2709),l=n(2319),u=n(1751),c=n(4124),d=n(6749);function h(e){return(0,d.ZP)("MuiSvgIcon",e)}(0,c.Z)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var p=n(4246);let f=e=>{let{color:t,fontSize:n,classes:r}=e,i={root:["root","inherit"!==t&&`color${(0,a.Z)(t)}`,`fontSize${(0,a.Z)(n)}`]};return(0,o.Z)(i,h,r)},g=(0,s.ZP)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t[`color${(0,a.Z)(n.color)}`],t[`fontSize${(0,a.Z)(n.fontSize)}`]]}})((0,l.Z)(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,e])=>e&&e.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),m=r.forwardRef(function(e,t){let n=(0,u.i)({props:e,name:"MuiSvgIcon"}),{children:o,className:a,color:s="inherit",component:l="svg",fontSize:c="medium",htmlColor:d,inheritViewBox:h=!1,titleAccess:m,viewBox:v="0 0 24 24",...y}=n,b=r.isValidElement(o)&&"svg"===o.type,x={...n,color:s,component:l,fontSize:c,instanceFontSize:e.fontSize,inheritViewBox:h,viewBox:v,hasSvgAsChild:b},w={};h||(w.viewBox=v);let S=f(x);return(0,p.jsxs)(g,{as:l,className:(0,i.Z)(S.root,a),focusable:"false",color:d,"aria-hidden":!m||void 0,role:m?"img":void 0,ref:t,...w,...y,...b&&o.props,ownerState:x,children:[b?o.props.children:o,m?(0,p.jsx)("title",{children:m}):null]})});function v(e,t){function n(n,r){return(0,p.jsx)(m,{"data-testid":`${t}Icon`,ref:r,...n,children:e})}return n.muiName=m.muiName,r.memo(r.forwardRef(n))}m.muiName="SvgIcon"},7999:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=n(4384).Z},9261:function(e,t,n){"use strict";n.r(t),n.d(t,{useForkRef:()=>x.Z,mergeSlotProps:()=>w.Z,isMuiElement:()=>u.Z,unstable_memoTheme:()=>c.Z,deprecatedPropType:()=>l,setRef:()=>f,createChainedFunction:()=>o,requirePropFactory:()=>p,unstable_useEnhancedEffect:()=>g.Z,capitalize:()=>i.Z,useControlled:()=>y.Z,useEventCallback:()=>b.Z,ownerWindow:()=>h.Z,debounce:()=>s.Z,ownerDocument:()=>d.Z,unstable_useId:()=>m.Z,unstable_ClassNameGenerator:()=>S,createSvgIcon:()=>a.Z,unsupportedProp:()=>v});var r=n(544),i=n(1640);let o=n(8543).Z;var a=n(247),s=n(7999);let l=function(e,t){return()=>null};var u=n(777),c=n(2319),d=n(2444),h=n(4255);let p=function(e,t){return()=>null},f=n(5817).Z;var g=n(6758),m=n(6839);let v=function(e,t,n,r,i){return null};var y=n(8817),b=n(7151),x=n(1183),w=n(7834);let S={configure:e=>{r.Z.configure(e)}}},777:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=n(1104).Z},2319:function(e,t,n){"use strict";n.d(t,{Z:()=>o});var r=n(3606);let i={theme:void 0},o=function(e){let t,n;return function(o){let a=t;return(void 0===a||o.theme!==n)&&(i.theme=o.theme,t=a=(0,r.Z)(e(i)),n=o.theme),a}}},7834:function(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(496);function i(e,t){if(!e)return t;if("function"==typeof e||"function"==typeof t)return n=>{let i="function"==typeof t?t(n):t,o="function"==typeof e?e({...n,...i}):e,a=(0,r.Z)(n?.className,i?.className,o?.className);return{...i,...o,...!!a&&{className:a},...i?.style&&o?.style&&{style:{...i.style,...o.style}},...i?.sx&&o?.sx&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(o.sx)?o.sx:[o.sx]]}}};let n=(0,r.Z)(t?.className,e?.className);return{...t,...e,...!!n&&{className:n},...t?.style&&e?.style&&{style:{...t.style,...e.style}},...t?.sx&&e?.sx&&{sx:[...Array.isArray(t.sx)?t.sx:[t.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}},2444:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=n(668).Z},4255:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=n(3205).Z},8817:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=n(9831).Z},6758:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=n(6858).Z},7151:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=n(1925).Z},1183:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=n(7048).Z},6839:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=n(5056).Z},9966:function(e,t,n){"use strict";n.d(t,{ZP:()=>a,bu:()=>u,nf:()=>s});var r=n(5913),i=n.n(r),o=n(2747);function a(e,t){return i()(e,t)}function s(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}n(2116);let l=[];function u(e){return l[0]=e,(0,o.O)(l)}},3890:function(e,t,n){"use strict";n.d(t,{L7:()=>c,P$:()=>h,VO:()=>o,W8:()=>u,dt:()=>d,k9:()=>l});var r=n(1170),i=n(8787);let o={xs:0,sm:600,md:900,lg:1200,xl:1536},a={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${o[e]}px)`},s={containerQueries:e=>({up:t=>{let n="number"==typeof t?t:o[t]||t;return"number"==typeof n&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function l(e,t,n){let r=e.theme||{};if(Array.isArray(t)){let e=r.breakpoints||a;return t.reduce((r,i,o)=>(r[e.up(e.keys[o])]=n(t[o]),r),{})}if("object"==typeof t){let e=r.breakpoints||a;return Object.keys(t).reduce((a,l)=>{if((0,i.WX)(e.keys,l)){let e=(0,i.ue)(r.containerQueries?r:s,l);e&&(a[e]=n(t[l],l))}else Object.keys(e.values||o).includes(l)?a[e.up(l)]=n(t[l],l):a[l]=t[l];return a},{})}return n(t)}function u(e={}){return e.keys?.reduce((t,n)=>(t[e.up(n)]={},t),{})||{}}function c(e,t){return e.reduce((e,t)=>{let n=e[t];return n&&0!==Object.keys(n).length||delete e[t],e},t)}function d(e,...t){let n=u(e),i=[n,...t].reduce((e,t)=>(0,r.Z)(e,t),{});return c(Object.keys(n),i)}function h({values:e,breakpoints:t,base:n}){let r;let i=Object.keys(n||function(e,t){if("object"!=typeof e)return{};let n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((t,r)=>{r<e.length&&(n[t]=!0)}):r.forEach(t=>{null!=e[t]&&(n[t]=!0)}),n}(e,t));return 0===i.length?e:i.reduce((t,n,i)=>(Array.isArray(e)?(t[n]=null!=e[i]?e[i]:e[r],r=i):"object"==typeof e?(t[n]=null!=e[n]?e[n]:e[r],r=n):t[n]=e,t),{})}},6838:function(e,t,n){"use strict";n.d(t,{ve:()=>u,LR:()=>s,Fq:()=>h,q8:()=>g,fk:()=>y,mi:()=>d,ux:()=>v,$n:()=>m,zp:()=>p,_j:()=>f});var r=n(2220);function i(e,t=0,n=1){return function(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}(e,t,n)}function o(e){let t;if(e.type)return e;if("#"===e.charAt(0))return o(function(e){e=e.slice(1);let t=RegExp(`.{1,${e.length>=6?2:1}}`,"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map(e=>e+e)),n?`rgb${4===n.length?"a":""}(${n.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(", ")})`:""}(e));let n=e.indexOf("("),i=e.substring(0,n);if(!["rgb","rgba","hsl","hsla","color"].includes(i))throw Error((0,r.Z)(9,e));let a=e.substring(n+1,e.length-1);if("color"===i){if(t=(a=a.split(" ")).shift(),4===a.length&&"/"===a[3].charAt(0)&&(a[3]=a[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(t))throw Error((0,r.Z)(10,t))}else a=a.split(",");return{type:i,values:a=a.map(e=>parseFloat(e)),colorSpace:t}}let a=e=>{let t=o(e);return t.values.slice(0,3).map((e,n)=>t.type.includes("hsl")&&0!==n?`${e}%`:e).join(" ")},s=(e,t)=>{try{return a(e)}catch(t){return e}};function l(e){let{type:t,colorSpace:n}=e,{values:r}=e;return t.includes("rgb")?r=r.map((e,t)=>t<3?parseInt(e,10):e):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=t.includes("color")?`${n} ${r.join(" ")}`:`${r.join(", ")}`,`${t}(${r})`}function u(e){let{values:t}=e=o(e),n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),s=(e,t=(e+n/30)%12)=>i-a*Math.max(Math.min(t-3,9-t,1),-1),u="rgb",c=[Math.round(255*s(0)),Math.round(255*s(8)),Math.round(255*s(4))];return"hsla"===e.type&&(u+="a",c.push(t[3])),l({type:u,values:c})}function c(e){let t="hsl"===(e=o(e)).type||"hsla"===e.type?o(u(e)).values:e.values;return Number((.2126*(t=t.map(t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)))[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function d(e,t){let n=c(e),r=c(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function h(e,t){return e=o(e),t=i(t),("rgb"===e.type||"hsl"===e.type)&&(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,l(e)}function p(e,t,n){try{return h(e,t)}catch(t){return e}}function f(e,t){if(e=o(e),t=i(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return l(e)}function g(e,t,n){try{return f(e,t)}catch(t){return e}}function m(e,t){if(e=o(e),t=i(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return l(e)}function v(e,t,n){try{return m(e,t)}catch(t){return e}}function y(e,t,n){try{return function(e,t=.15){return c(e)>.5?f(e,t):m(e,t)}(e,t)}catch(t){return e}}},5315:function(e,t,n){"use strict";n.d(t,{ZP:()=>h,x9:()=>u});var r=n(9966),i=n(1170),o=n(6798),a=n(1652),s=n(3606);let l=(0,o.Z)();function u(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function c(e,t){let n="function"==typeof t?t(e):t;if(Array.isArray(n))return n.flatMap(t=>c(e,t));if(Array.isArray(n?.variants)){let t;if(n.isProcessed)t=n.style;else{let{variants:e,...r}=n;t=r}return d(e,n.variants,[t])}return n?.isProcessed?n.style:n}function d(e,t,n=[]){let r;e:for(let i=0;i<t.length;i+=1){let o=t[i];if("function"==typeof o.props){if(r??={...e,...e.ownerState,ownerState:e.ownerState},!o.props(r))continue}else for(let t in o.props)if(e[t]!==o.props[t]&&e.ownerState?.[t]!==o.props[t])continue e;"function"==typeof o.style?(r??={...e,...e.ownerState,ownerState:e.ownerState},n.push(o.style(r))):n.push(o.style)}return n}function h(e={}){let{themeId:t,defaultTheme:n=l,rootShouldForwardProp:o=u,slotShouldForwardProp:p=u}=e;function f(e){e.theme=!function(e){for(let t in e)return!1;return!0}(e.theme)?e.theme[t]||e.theme:n}return(e,t={})=>{var n,l,h,g,m;(0,r.nf)(e,e=>e.filter(e=>e!==a.Z));let{name:v,slot:y,skipVariantsResolver:b,skipSx:x,overridesResolver:w=(n=(l=y)?l.charAt(0).toLowerCase()+l.slice(1):l)?(e,t)=>t[n]:null,...S}=t,C=void 0!==b?b:y&&"Root"!==y&&"root"!==y||!1,k=x||!1,M=u;"Root"===y||"root"===y?M=o:y?M=p:"string"==typeof(h=e)&&h.charCodeAt(0)>96&&(M=void 0);let T=(0,r.ZP)(e,{shouldForwardProp:M,label:(g=0,m=0,void 0),...S}),A=e=>{if("function"==typeof e&&e.__emotion_real!==e)return function(t){return c(t,e)};if((0,i.P)(e)){let t=(0,s.Z)(e);return t.variants?function(e){return c(e,t)}:t.style}return e},I=(...t)=>{let n=[],r=t.map(A),i=[];if(n.push(f),v&&w&&i.push(function(e){let t=e.theme,n=t.components?.[v]?.styleOverrides;if(!n)return null;let r={};for(let t in n)r[t]=c(e,n[t]);return w(e,r)}),v&&!C&&i.push(function(e){let t=e.theme,n=t?.components?.[v]?.variants;return n?d(e,n):null}),k||i.push(a.Z),Array.isArray(r[0])){let e;let t=r.shift(),o=Array(n.length).fill(""),a=Array(i.length).fill("");(e=[...o,...t,...a]).raw=[...o,...t.raw,...a],n.unshift(e)}let o=T(...n,...r,...i);return e.muiName&&(o.muiName=e.muiName),o};return T.withConfig&&(I.withConfig=T.withConfig),I}}},4715:function(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(2664);function i(e=8,t=(0,r.hB)({spacing:e})){if(e.mui)return e;let n=(...e)=>(0===e.length?[1]:e).map(e=>{let n=t(e);return"number"==typeof n?`${n}px`:n}).join(" ");return n.mui=!0,n}},6798:function(e,t,n){"use strict";n.d(t,{Z:()=>d});var r=n(1170);let i=e=>{let t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>({...e,[t.key]:t.val}),{})};var o=n(8787);let a={borderRadius:4};var s=n(4715),l=n(1652),u=n(273);function c(e,t){if(this.vars){if(!this.colorSchemes?.[e]||"function"!=typeof this.getColorSchemeSelector)return{};let n=this.getColorSchemeSelector(e);return"&"===n?t:((n.includes("data-")||n.includes("."))&&(n=`*:where(${n.replace(/\s*&$/,"")}) &`),{[n]:t})}return this.palette.mode===e?t:{}}let d=function(e={},...t){let{breakpoints:n={},palette:d={},spacing:h,shape:p={},...f}=e,g=function(e){let{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...o}=e,a=i(t),s=Object.keys(a);function l(e){let r="number"==typeof t[e]?t[e]:e;return`@media (min-width:${r}${n})`}function u(e){let i="number"==typeof t[e]?t[e]:e;return`@media (max-width:${i-r/100}${n})`}function c(e,i){let o=s.indexOf(i);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n}) and (max-width:${(-1!==o&&"number"==typeof t[s[o]]?t[s[o]]:i)-r/100}${n})`}return{keys:s,values:a,up:l,down:u,between:c,only:function(e){return s.indexOf(e)+1<s.length?c(e,s[s.indexOf(e)+1]):l(e)},not:function(e){let t=s.indexOf(e);return 0===t?l(s[1]):t===s.length-1?u(s[t]):c(e,s[s.indexOf(e)+1]).replace("@media","@media not all and")},unit:n,...o}}(n),m=(0,s.Z)(h),v=(0,r.Z)({breakpoints:g,direction:"ltr",components:{},palette:{mode:"light",...d},spacing:m,shape:{...a,...p}},f);return(v=(0,o.ZP)(v)).applyStyles=c,(v=t.reduce((e,t)=>(0,r.Z)(e,t),v)).unstable_sxConfig={...u.Z,...f?.unstable_sxConfig},v.unstable_sx=function(e){return(0,l.Z)({sx:e,theme:this})},v}},8787:function(e,t,n){"use strict";function r(e,t){if(!e.containerQueries)return t;let n=Object.keys(t).filter(e=>e.startsWith("@container")).sort((e,t)=>{let n=/min-width:\s*([0-9.]+)/;return+(e.match(n)?.[1]||0)-+(t.match(n)?.[1]||0)});return n.length?n.reduce((e,n)=>{let r=t[n];return delete e[n],e[n]=r,e},{...t}):t}function i(e,t){return"@"===t||t.startsWith("@")&&(e.some(e=>t.startsWith(`@${e}`))||!!t.match(/^@\d/))}function o(e,t){let n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;let[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(o)}function a(e){let t=(e,t)=>e.replace("@media",t?`@container ${t}`:"@container");function n(n,r){n.up=(...n)=>t(e.breakpoints.up(...n),r),n.down=(...n)=>t(e.breakpoints.down(...n),r),n.between=(...n)=>t(e.breakpoints.between(...n),r),n.only=(...n)=>t(e.breakpoints.only(...n),r),n.not=(...n)=>{let i=t(e.breakpoints.not(...n),r);return i.includes("not all and")?i.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):i}}let r={},i=e=>(n(r,e),r);return n(i),{...e,containerQueries:i}}n.d(t,{WX:()=>i,ZP:()=>a,ar:()=>r,ue:()=>o})},6360:function(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(1170);let i=function(e,t){return t?(0,r.Z)(e,t,{clone:!1}):e}},3606:function(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(9966);function i(e){let{variants:t,...n}=e,i={variants:t,style:(0,r.bu)(n),isProcessed:!0};return i.style===n||t&&t.forEach(e=>{"function"!=typeof e.style&&(e.style=(0,r.bu)(e.style))}),i}},2664:function(e,t,n){"use strict";n.d(t,{NA:()=>g,hB:()=>f,e6:()=>v,o3:()=>y,eI:()=>p});var r=n(3890),i=n(3160),o=n(6360);let a={m:"margin",p:"padding"},s={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},l={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},u=function(e){let t={};return n=>(void 0===t[n]&&(t[n]=e(n)),t[n])}(e=>{if(e.length>2){if(!l[e])return[e];e=l[e]}let[t,n]=e.split(""),r=a[t],i=s[n]||"";return Array.isArray(i)?i.map(e=>r+e):[r+i]}),c=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],d=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],h=[...c,...d];function p(e,t,n,r){let o=(0,i.DW)(e,t,!0)??n;return"number"==typeof o||"string"==typeof o?e=>"string"==typeof e?e:"string"==typeof o?`calc(${e} * ${o})`:o*e:Array.isArray(o)?e=>{if("string"==typeof e)return e;let t=o[Math.abs(e)];return e>=0?t:"number"==typeof t?-t:`-${t}`}:"function"==typeof o?o:()=>void 0}function f(e){return p(e,"spacing",8,"spacing")}function g(e,t){return"string"==typeof t||null==t?t:e(t)}function m(e,t){let n=f(e.theme);return Object.keys(e).map(i=>(function(e,t,n,i){var o;if(!t.includes(n))return null;let a=(o=u(n),e=>o.reduce((t,n)=>(t[n]=g(i,e),t),{})),s=e[n];return(0,r.k9)(e,s,a)})(e,t,i,n)).reduce(o.Z,{})}function v(e){return m(e,c)}function y(e){return m(e,d)}function b(e){return m(e,h)}v.propTypes={},v.filterProps=c,y.propTypes={},y.filterProps=d,b.propTypes={},b.filterProps=h},3160:function(e,t,n){"use strict";n.d(t,{DW:()=>o,Jq:()=>a,ZP:()=>s});var r=n(3150),i=n(3890);function o(e,t,n=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&n){let n=`vars.${t}`.split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=n)return n}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function a(e,t,n,r=n){let i;return i="function"==typeof e?e(n):Array.isArray(e)?e[n]||r:o(e,n)||r,t&&(i=t(i,r,e)),i}let s=function(e){let{prop:t,cssProperty:n=e.prop,themeKey:s,transform:l}=e,u=e=>{if(null==e[t])return null;let u=e[t],c=o(e.theme,s)||{};return(0,i.k9)(e,u,e=>{let i=a(c,l,e);return(e===i&&"string"==typeof e&&(i=a(c,l,`${t}${"default"===e?"":(0,r.Z)(e)}`,e)),!1===n)?i:{[n]:i}})};return u.propTypes={},u.filterProps=[t],u}},273:function(e,t,n){"use strict";n.d(t,{Z:()=>$});var r=n(2664),i=n(3160),o=n(6360);let a=function(...e){let t=e.reduce((e,t)=>(t.filterProps.forEach(n=>{e[n]=t}),e),{}),n=e=>Object.keys(e).reduce((n,r)=>t[r]?(0,o.Z)(n,t[r](e)):n,{});return n.propTypes={},n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n};var s=n(3890);function l(e){return"number"!=typeof e?e:`${e}px solid`}function u(e,t){return(0,i.ZP)({prop:e,themeKey:"borders",transform:t})}let c=u("border",l),d=u("borderTop",l),h=u("borderRight",l),p=u("borderBottom",l),f=u("borderLeft",l),g=u("borderColor"),m=u("borderTopColor"),v=u("borderRightColor"),y=u("borderBottomColor"),b=u("borderLeftColor"),x=u("outline",l),w=u("outlineColor"),S=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){let t=(0,r.eI)(e.theme,"shape.borderRadius",4,"borderRadius");return(0,s.k9)(e,e.borderRadius,e=>({borderRadius:(0,r.NA)(t,e)}))}return null};S.propTypes={},S.filterProps=["borderRadius"],a(c,d,h,p,f,g,m,v,y,b,S,x,w);let C=e=>{if(void 0!==e.gap&&null!==e.gap){let t=(0,r.eI)(e.theme,"spacing",8,"gap");return(0,s.k9)(e,e.gap,e=>({gap:(0,r.NA)(t,e)}))}return null};C.propTypes={},C.filterProps=["gap"];let k=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){let t=(0,r.eI)(e.theme,"spacing",8,"columnGap");return(0,s.k9)(e,e.columnGap,e=>({columnGap:(0,r.NA)(t,e)}))}return null};k.propTypes={},k.filterProps=["columnGap"];let M=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){let t=(0,r.eI)(e.theme,"spacing",8,"rowGap");return(0,s.k9)(e,e.rowGap,e=>({rowGap:(0,r.NA)(t,e)}))}return null};M.propTypes={},M.filterProps=["rowGap"];let T=(0,i.ZP)({prop:"gridColumn"}),A=(0,i.ZP)({prop:"gridRow"}),I=(0,i.ZP)({prop:"gridAutoFlow"}),P=(0,i.ZP)({prop:"gridAutoColumns"}),R=(0,i.ZP)({prop:"gridAutoRows"}),O=(0,i.ZP)({prop:"gridTemplateColumns"}),E=(0,i.ZP)({prop:"gridTemplateRows"});function D(e,t){return"grey"===t?t:e}a(C,k,M,T,A,I,P,R,O,E,(0,i.ZP)({prop:"gridTemplateAreas"}),(0,i.ZP)({prop:"gridArea"}));let L=(0,i.ZP)({prop:"color",themeKey:"palette",transform:D});function _(e){return e<=1&&0!==e?`${100*e}%`:e}a(L,(0,i.ZP)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:D}),(0,i.ZP)({prop:"backgroundColor",themeKey:"palette",transform:D}));let N=(0,i.ZP)({prop:"width",transform:_}),Z=e=>void 0!==e.maxWidth&&null!==e.maxWidth?(0,s.k9)(e,e.maxWidth,t=>{let n=e.theme?.breakpoints?.values?.[t]||s.VO[t];return n?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:n}:{maxWidth:_(t)}}):null;Z.filterProps=["maxWidth"];let j=(0,i.ZP)({prop:"minWidth",transform:_}),B=(0,i.ZP)({prop:"height",transform:_}),F=(0,i.ZP)({prop:"maxHeight",transform:_}),z=(0,i.ZP)({prop:"minHeight",transform:_});(0,i.ZP)({prop:"size",cssProperty:"width",transform:_}),(0,i.ZP)({prop:"size",cssProperty:"height",transform:_}),a(N,Z,j,B,F,z,(0,i.ZP)({prop:"boxSizing"}));let $={border:{themeKey:"borders",transform:l},borderTop:{themeKey:"borders",transform:l},borderRight:{themeKey:"borders",transform:l},borderBottom:{themeKey:"borders",transform:l},borderLeft:{themeKey:"borders",transform:l},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:l},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:S},color:{themeKey:"palette",transform:D},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:D},backgroundColor:{themeKey:"palette",transform:D},p:{style:r.o3},pt:{style:r.o3},pr:{style:r.o3},pb:{style:r.o3},pl:{style:r.o3},px:{style:r.o3},py:{style:r.o3},padding:{style:r.o3},paddingTop:{style:r.o3},paddingRight:{style:r.o3},paddingBottom:{style:r.o3},paddingLeft:{style:r.o3},paddingX:{style:r.o3},paddingY:{style:r.o3},paddingInline:{style:r.o3},paddingInlineStart:{style:r.o3},paddingInlineEnd:{style:r.o3},paddingBlock:{style:r.o3},paddingBlockStart:{style:r.o3},paddingBlockEnd:{style:r.o3},m:{style:r.e6},mt:{style:r.e6},mr:{style:r.e6},mb:{style:r.e6},ml:{style:r.e6},mx:{style:r.e6},my:{style:r.e6},margin:{style:r.e6},marginTop:{style:r.e6},marginRight:{style:r.e6},marginBottom:{style:r.e6},marginLeft:{style:r.e6},marginX:{style:r.e6},marginY:{style:r.e6},marginInline:{style:r.e6},marginInlineStart:{style:r.e6},marginInlineEnd:{style:r.e6},marginBlock:{style:r.e6},marginBlockStart:{style:r.e6},marginBlockEnd:{style:r.e6},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:C},rowGap:{style:M},columnGap:{style:k},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:_},maxWidth:{style:Z},minWidth:{transform:_},height:{transform:_},maxHeight:{transform:_},minHeight:{transform:_},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}}},1652:function(e,t,n){"use strict";n.d(t,{Z:()=>c});var r=n(3150),i=n(6360),o=n(3160),a=n(3890),s=n(8787),l=n(273);let u=function(){function e(e,t,n,i){let s={[e]:t,theme:n},l=i[e];if(!l)return{[e]:t};let{cssProperty:u=e,themeKey:c,transform:d,style:h}=l;if(null==t)return null;if("typography"===c&&"inherit"===t)return{[e]:t};let p=(0,o.DW)(n,c)||{};return h?h(s):(0,a.k9)(s,t,t=>{let n=(0,o.Jq)(p,d,t);return(t===n&&"string"==typeof t&&(n=(0,o.Jq)(p,d,`${e}${"default"===t?"":(0,r.Z)(t)}`,t)),!1===u)?n:{[u]:n}})}return function t(n){let{sx:r,theme:o={}}=n||{};if(!r)return null;let u=o.unstable_sxConfig??l.Z;function c(n){let r=n;if("function"==typeof n)r=n(o);else if("object"!=typeof n)return n;if(!r)return null;let l=(0,a.W8)(o.breakpoints),c=Object.keys(l),d=l;return Object.keys(r).forEach(n=>{var s;let l="function"==typeof(s=r[n])?s(o):s;if(null!=l){if("object"==typeof l){if(u[n])d=(0,i.Z)(d,e(n,l,o,u));else{let e=(0,a.k9)({theme:o},l,e=>({[n]:e}));(function(...e){let t=new Set(e.reduce((e,t)=>e.concat(Object.keys(t)),[]));return e.every(e=>t.size===Object.keys(e).length)})(e,l)?d[n]=t({sx:l,theme:o}):d=(0,i.Z)(d,e)}}else d=(0,i.Z)(d,e(n,l,o,u))}}),(0,s.ar)(o,(0,a.L7)(c,d))}return Array.isArray(r)?r.map(c):c(r)}}();u.filterProps=["sx"];let c=u},544:function(e,t,n){"use strict";let r;n.d(t,{Z:()=>o});let i=e=>e,o=(r=i,{configure(e){r=e},generate:e=>r(e),reset(){r=i}})},3150:function(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(2220);function i(e){if("string"!=typeof e)throw Error((0,r.Z)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},2267:function(e,t,n){"use strict";function r(e,t,n){let r={};for(let i in e){let o=e[i],a="",s=!0;for(let e=0;e<o.length;e+=1){let r=o[e];r&&(a+=(!0===s?"":" ")+t(r),s=!1,n&&n[r]&&(a+=" "+n[r]))}r[i]=a}return r}n.d(t,{Z:()=>r})},8543:function(e,t,n){"use strict";function r(...e){return e.reduce((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}n.d(t,{Z:()=>r})},4384:function(e,t,n){"use strict";function r(e,t=166){let n;function i(...r){clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}return i.clear=()=>{clearTimeout(n)},i}n.d(t,{Z:()=>r})},1170:function(e,t,n){"use strict";n.d(t,{P:()=>o,Z:()=>function e(t,n,a={clone:!0}){let s=a.clone?{...t}:t;return o(t)&&o(n)&&Object.keys(n).forEach(l=>{r.isValidElement(n[l])||(0,i.isValidElementType)(n[l])?s[l]=n[l]:o(n[l])&&Object.prototype.hasOwnProperty.call(t,l)&&o(t[l])?s[l]=e(t[l],n[l],a):a.clone?s[l]=o(n[l])?function e(t){if(r.isValidElement(t)||(0,i.isValidElementType)(t)||!o(t))return t;let n={};return Object.keys(t).forEach(r=>{n[r]=e(t[r])}),n}(n[l]):n[l]:s[l]=n[l]}),s}});var r=n(4538),i=n(1453);function o(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}},2220:function(e,t,n){"use strict";function r(e,...t){let n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(e=>n.searchParams.append("args[]",e)),`Minified MUI error #${e}; visit ${n} for the full message.`}n.d(t,{Z:()=>r})},6749:function(e,t,n){"use strict";n.d(t,{ZP:()=>o});var r=n(544);let i={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function o(e,t,n="Mui"){let a=i[t];return a?`${n}-${a}`:`${r.Z.generate(e)}-${t}`}},4124:function(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(6749);function i(e,t,n="Mui"){let o={};return t.forEach(t=>{o[t]=(0,r.ZP)(e,t,n)}),o}},1104:function(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(4538);function i(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)}},668:function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{Z:()=>r})},3205:function(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(668);function i(e){return(0,r.Z)(e).defaultView||window}},6819:function(e,t,n){"use strict";n.d(t,{Z:()=>function e(t,n){let r={...n};for(let i in t)if(Object.prototype.hasOwnProperty.call(t,i)){if("components"===i||"slots"===i)r[i]={...t[i],...r[i]};else if("componentsProps"===i||"slotProps"===i){let o=t[i],a=n[i];if(a){if(o)for(let t in r[i]={...a},o)Object.prototype.hasOwnProperty.call(o,t)&&(r[i][t]=e(o[t],a[t]));else r[i]=a}else r[i]=o||{}}else void 0===r[i]&&(r[i]=t[i])}return r}})},5817:function(e,t,n){"use strict";function r(e,t){"function"==typeof e?e(t):e&&(e.current=t)}n.d(t,{Z:()=>r})},9831:function(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(4538);function i({controlled:e,default:t,name:n,state:i="value"}){let{current:o}=r.useRef(void 0!==e),[a,s]=r.useState(t),l=r.useCallback(e=>{o||s(e)},[]);return[o?e:a,l]}},6858:function(e,t,n){"use strict";n.d(t,{Z:()=>i});var r=n(4538);let i="undefined"!=typeof window?r.useLayoutEffect:r.useEffect},1925:function(e,t,n){"use strict";n.d(t,{Z:()=>o});var r=n(4538),i=n(6858);let o=function(e){let t=r.useRef(e);return(0,i.Z)(()=>{t.current=e}),r.useRef((...e)=>(0,t.current)(...e)).current}},7048:function(e,t,n){"use strict";n.d(t,{Z:()=>o});var r=n(4538),i=n(5817);function o(...e){return r.useMemo(()=>e.every(e=>null==e)?null:t=>{e.forEach(e=>{(0,i.Z)(e,t)})},e)}},5056:function(e,t,n){"use strict";n.d(t,{Z:()=>a});var r=n(4538);let i=0,o={...r}.useId;function a(e){if(void 0!==o){let t=o();return e??t}return function(e){let[t,n]=r.useState(e),o=e||t;return r.useEffect(()=>{null==t&&(i+=1,n(`mui-${i}`))},[t]),o}(e)}},1453:function(e,t){"use strict";var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler");Symbol.for("react.provider");var s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),g=Symbol.for("react.client.reference");t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===a||e===o||e===c||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===h||e.$$typeof===l||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||void 0!==e.getModuleId)||!1}},604:function(e,t,n){"use strict";let r,i,o,a;n.r(t),n.d(t,{ErrorAlert:()=>vf,JSONEditor:()=>PH,INCREASE_NEARBY_SERIES_MULTIPLIER:()=>DM,OptionsEditorGroup:()=>L2,DensitySelector:()=>g4,assembleTransform:()=>DL,clearHighlightedSeries:()=>Db,getColorsForValues:()=>Kq,ErrorBoundary:()=>vg.ErrorBoundary,SeriesMarker:()=>E7,TimeRangeSelector:()=>qk,testChartsTheme:()=>GW,ChartsThemeContext:()=>tY,TextOverlay:()=>_t,hexToHSL:()=>KG,DEFAULT_COLUMN_HEIGHT:()=>h0,useMousePosition:()=>E5,NoDataOverlay:()=>_n,generateChartsTheme:()=>GV,OptionsEditorGrid:()=>L1,OPTIMIZED_MODE_SERIES_LIMIT:()=>Df,TOOLTIP_ADJUST_Y_POS_MULTIPLIER:()=>EU,DiscardChangesConfirmationDialog:()=>fn,getDateRange:()=>re,EMPHASIZED_SERIES_DESCRIPTION:()=>EJ,useChartsTheme:()=>tJ,persesColumnsToTanstackColumns:()=>h2,mockChartsContext:()=>Gq,Legend:()=>pN,TOOLTIP_DATE_FORMAT:()=>E0,TOOLTIP_MAX_WIDTH:()=>EW,dateFormatOptionsWithTimeZone:()=>EN,legacyCheckforNearbySeries:()=>DP,ToolbarIconButton:()=>qT,PIN_TOOLTIP_HELP_TEXT:()=>E4,checkforNearbyTimeSeries:()=>DI,getTheme:()=>Ut,PieChart:()=>UW,TooltipHeader:()=>Dp,TOOLTIP_BG_COLOR_FALLBACK:()=>EQ,UNPIN_TOOLTIP_HELP_TEXT:()=>E6,DateTimeRangePicker:()=>qC,handleMoveUp:()=>mU,getClosestTimestamp:()=>DC,getFormattedAxis:()=>n7,formatWithTimeZone:()=>EZ,batchDispatchNearbySeriesActions:()=>Dw,useTimeZone:()=>EV,ChartsProvider:()=>tK,isWithinPercentageRange:()=>DE,TOOLTIP_MIN_WIDTH:()=>EH,StatusHistoryChart:()=>KV,TOOLTIP_LABELS_MAX_WIDTH:()=>EG,getYBuffer:()=>DD,DEFAULT_PINNED_CROSSHAIR:()=>Dm,LineChartTooltip:()=>DN,FormatControls:()=>qR,TooltipContent:()=>Dn,hslToHex:()=>KU,SHOW_FEWER_SERIES_LIMIT:()=>DA,TimeChartTooltip:()=>Bl,getClosestTimestampInFullDataset:()=>Dk,getTableCellLayout:()=>h1,EChart:()=>n6,PINNED_CROSSHAIR_SERIES_NAME:()=>Dg,SortSelector:()=>_o,SnackbarProvider:()=>GF,Drawer:()=>ve,AlignSelector:()=>eN,LinksEditor:()=>L$,ValueMappingsEditor:()=>Yl,TimeZoneContext:()=>Ez,GaugeChart:()=>vL,LineChart:()=>DZ,SeriesLabelsStack:()=>De,checkCrosshairPinnedStatus:()=>DS,StatChart:()=>_u,SeriesInfo:()=>Dt,ColorPicker:()=>a6,Table:()=>pO,useSnackbar:()=>Gz,InfoTooltip:()=>gm,TimeZoneProvider:()=>E$,LoadingOverlay:()=>_r,typography:()=>G7,Dialog:()=>ft,DropIndicator:()=>g6,TransformsEditor:()=>Uf,OptionsEditorControl:()=>gb,TOOLTIP_PADDING:()=>EK,getFormattedAxisLabel:()=>EB,SortSelectorButtons:()=>_a,getTooltipStyles:()=>D_,useChartsContext:()=>tX,RefreshIntervalPicker:()=>Ug,enableDataZoom:()=>Dv,useDragAndDropMonitor:()=>mW,combineSx:()=>c8,OptionsEditorColumn:()=>L0,getDateAndTime:()=>EF,ThresholdsEditor:()=>_A,DEFAULT_TOOLTIP_CONFIG:()=>E3,handleMoveDown:()=>mK,DragButton:()=>mY,useId:()=>fi,ContentWithLegend:()=>pj,BarChart:()=>rt,getFormattedDate:()=>Ej,NEARBY_SERIES_DESCRIPTION:()=>EX,getColorForValue:()=>KW,isLegendItemVisuallySelected:()=>dt,getPointInGrid:()=>Dx,EMPTY_TOOLTIP_DATA:()=>E2,legacyGetNearbySeriesData:()=>DO,buildRelativeTimeOption:()=>GH,SettingsAutocomplete:()=>g5,FontSizeSelector:()=>vv,defaultCursorData:()=>E1,DYNAMIC_NEARBY_SERIES_MULTIPLIER:()=>DT,FALLBACK_COLOR:()=>KH,getNearbySeriesData:()=>DR,TOOLTIP_MAX_HEIGHT:()=>Eq,YAxisLabel:()=>qO,TimeChart:()=>Bu,FALLBACK_CHART_WIDTH:()=>EY,DragAndDropElement:()=>mq,getResponsiveValueSize:()=>v_,restoreChart:()=>Dy,ModeSelector:()=>LW,TextField:()=>pB,DEFAULT_COLUMN_WIDTH:()=>hQ,FormActions:()=>vS,OptionsColorPicker:()=>a9});var s,l,u,c,d,h,p,f=n(4246),g=n(4538),m=n.n(g),v=n(496),y=n(2267),b=n(6838);function x(e){return g.Children.toArray(e).filter(e=>g.isValidElement(e))}var w=n(1640),S=n(2709),C=n(2319);function k(e=[]){return([,t])=>t&&function(e,t=[]){if("string"!=typeof e.main)return!1;for(let n of t)if(!e.hasOwnProperty(n)||"string"!=typeof e[n])return!1;return!0}(t,e)}var M=n(1751),T=n(4124),A=n(6749);function I(e){return(0,A.ZP)("MuiButtonGroup",e)}let P=(0,T.Z)("MuiButtonGroup",["root","contained","outlined","text","disableElevation","disabled","firstButton","fullWidth","horizontal","vertical","colorPrimary","colorSecondary","grouped","groupedHorizontal","groupedVertical","groupedText","groupedTextHorizontal","groupedTextVertical","groupedTextPrimary","groupedTextSecondary","groupedOutlined","groupedOutlinedHorizontal","groupedOutlinedVertical","groupedOutlinedPrimary","groupedOutlinedSecondary","groupedContained","groupedContainedHorizontal","groupedContainedVertical","groupedContainedPrimary","groupedContainedSecondary","lastButton","middleButton"]),R=g.createContext({}),O=g.createContext(void 0),E=e=>{let{classes:t,color:n,disabled:r,disableElevation:i,fullWidth:o,orientation:a,variant:s}=e,l={root:["root",s,a,o&&"fullWidth",i&&"disableElevation",`color${(0,w.Z)(n)}`],grouped:["grouped",`grouped${(0,w.Z)(a)}`,`grouped${(0,w.Z)(s)}`,`grouped${(0,w.Z)(s)}${(0,w.Z)(a)}`,`grouped${(0,w.Z)(s)}${(0,w.Z)(n)}`,r&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,y.Z)(l,I,t)},D=(0,S.ZP)("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${P.grouped}`]:t.grouped},{[`& .${P.grouped}`]:t[`grouped${(0,w.Z)(n.orientation)}`]},{[`& .${P.grouped}`]:t[`grouped${(0,w.Z)(n.variant)}`]},{[`& .${P.grouped}`]:t[`grouped${(0,w.Z)(n.variant)}${(0,w.Z)(n.orientation)}`]},{[`& .${P.grouped}`]:t[`grouped${(0,w.Z)(n.variant)}${(0,w.Z)(n.color)}`]},{[`& .${P.firstButton}`]:t.firstButton},{[`& .${P.lastButton}`]:t.lastButton},{[`& .${P.middleButton}`]:t.middleButton},t.root,t[n.variant],!0===n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,"vertical"===n.orientation&&t.vertical]}})((0,C.Z)(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{variant:"contained"},style:{boxShadow:(e.vars||e).shadows[2]}},{props:{disableElevation:!0},style:{boxShadow:"none"}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${P.lastButton},& .${P.middleButton}`]:{borderTopRightRadius:0,borderTopLeftRadius:0},[`& .${P.firstButton},& .${P.middleButton}`]:{borderBottomRightRadius:0,borderBottomLeftRadius:0}}},{props:{orientation:"horizontal"},style:{[`& .${P.firstButton},& .${P.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${P.lastButton},& .${P.middleButton}`]:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}},{props:{variant:"text",orientation:"horizontal"},style:{[`& .${P.firstButton},& .${P.middleButton}`]:{borderRight:e.vars?`1px solid rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${"light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${P.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:"text",orientation:"vertical"},style:{[`& .${P.firstButton},& .${P.middleButton}`]:{borderBottom:e.vars?`1px solid rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${"light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${P.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter(k()).flatMap(([t])=>[{props:{variant:"text",color:t},style:{[`& .${P.firstButton},& .${P.middleButton}`]:{borderColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.5)`:(0,b.Fq)(e.palette[t].main,.5)}}}]),{props:{variant:"outlined",orientation:"horizontal"},style:{[`& .${P.firstButton},& .${P.middleButton}`]:{borderRightColor:"transparent","&:hover":{borderRightColor:"currentColor"}},[`& .${P.lastButton},& .${P.middleButton}`]:{marginLeft:-1}}},{props:{variant:"outlined",orientation:"vertical"},style:{[`& .${P.firstButton},& .${P.middleButton}`]:{borderBottomColor:"transparent","&:hover":{borderBottomColor:"currentColor"}},[`& .${P.lastButton},& .${P.middleButton}`]:{marginTop:-1}}},{props:{variant:"contained",orientation:"horizontal"},style:{[`& .${P.firstButton},& .${P.middleButton}`]:{borderRight:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${P.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:"contained",orientation:"vertical"},style:{[`& .${P.firstButton},& .${P.middleButton}`]:{borderBottom:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${P.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter(k(["dark"])).map(([t])=>({props:{variant:"contained",color:t},style:{[`& .${P.firstButton},& .${P.middleButton}`]:{borderColor:(e.vars||e).palette[t].dark}}}))],[`& .${P.grouped}`]:{minWidth:40,boxShadow:"none",props:{variant:"contained"},style:{"&:hover":{boxShadow:"none"}}}}))),L=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiButtonGroup"}),{children:r,className:i,color:o="primary",component:a="div",disabled:s=!1,disableElevation:l=!1,disableFocusRipple:u=!1,disableRipple:c=!1,fullWidth:d=!1,orientation:h="horizontal",size:p="medium",variant:m="outlined",...y}=n,b={...n,color:o,component:a,disabled:s,disableElevation:l,disableFocusRipple:u,disableRipple:c,fullWidth:d,orientation:h,size:p,variant:m},w=E(b),S=g.useMemo(()=>({className:w.grouped,color:o,disabled:s,disableElevation:l,disableFocusRipple:u,disableRipple:c,fullWidth:d,size:p,variant:m}),[o,s,l,u,c,d,p,m,w.grouped]),C=x(r),k=C.length,T=e=>{let t=0===e,n=e===k-1;return t&&n?"":t?w.firstButton:n?w.lastButton:w.middleButton};return(0,f.jsx)(D,{as:a,role:"group",className:(0,v.Z)(w.root,i),ref:t,ownerState:b,...y,children:(0,f.jsx)(R.Provider,{value:S,children:C.map((e,t)=>(0,f.jsx)(O.Provider,{value:T(t),children:e},t))})})});var _=n(6819),N=n(6839),Z=n(3037);function j(e){try{return e.matches(":focus-visible")}catch(e){}return!1}var B=n(1183),F=n(7151);let z={};function $(e,t){let n=g.useRef(z);return n.current===z&&(n.current=e(t)),n}class V{static create(){return new V}static use(){let e=$(V.create).current,[t,n]=g.useState(!1);return e.shouldMount=t,e.setShouldMount=n,g.useEffect(e.mountEffect,[t]),e}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=function(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&null!==this.ref.current&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then(()=>this.ref.current?.start(...e))}stop(...e){this.mount().then(()=>this.ref.current?.stop(...e))}pulsate(...e){this.mount().then(()=>this.ref.current?.pulsate(...e))}}function H(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}var W=n(252);function q(e,t){return(q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function G(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,q(e,t)}let U=m().createContext(null);function K(e,t){var n=Object.create(null);return e&&g.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=t&&(0,g.isValidElement)(e)?t(e):e}),n}function Y(e,t,n){return null!=n[t]?n[t]:e.props[t]}var X=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},J=function(e){function t(t,n){var r,i=(r=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));return r.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},r}G(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,i=t.children,o=t.handleExited;return{children:t.firstRender?K(e.children,function(t){return(0,g.cloneElement)(t,{onExited:o.bind(null,t),in:!0,appear:Y(t,"appear",e),enter:Y(t,"enter",e),exit:Y(t,"exit",e)})}):(Object.keys(r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),o=[];for(var a in e)a in t?o.length&&(i[a]=o,o=[]):o.push(a);var s={};for(var l in t){if(i[l])for(r=0;r<i[l].length;r++){var u=i[l][r];s[i[l][r]]=n(u)}s[l]=n(l)}for(r=0;r<o.length;r++)s[o[r]]=n(o[r]);return s}(i,n=K(e.children))).forEach(function(t){var a=r[t];if((0,g.isValidElement)(a)){var s=t in i,l=t in n,u=i[t],c=(0,g.isValidElement)(u)&&!u.props.in;l&&(!s||c)?r[t]=(0,g.cloneElement)(a,{onExited:o.bind(null,a),in:!0,exit:Y(a,"exit",e),enter:Y(a,"enter",e)}):l||!s||c?l&&s&&(0,g.isValidElement)(u)&&(r[t]=(0,g.cloneElement)(a,{onExited:o.bind(null,a),in:u.props.in,exit:Y(a,"exit",e),enter:Y(a,"enter",e)})):r[t]=(0,g.cloneElement)(a,{in:!1})}}),r),firstRender:!1}},n.handleExited=function(e,t){var n=K(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=(0,W.Z)({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=H(e,["component","childFactory"]),i=this.state.contextValue,o=X(this.state.children).map(n);return(delete r.appear,delete r.enter,delete r.exit,null===t)?m().createElement(U.Provider,{value:i},o):m().createElement(U.Provider,{value:i},m().createElement(t,r,o))},t}(m().Component);J.propTypes={},J.defaultProps={component:"div",childFactory:function(e){return e}};let Q=[];class ee{static create(){return new ee}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function et(){var e;let t=$(ee.create).current;return e=t.disposeEffect,g.useEffect(e,Q),t}var en=n(2116);let er=(0,T.Z)("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),ei=(0,en.keyframes)`
11
- 0% {
12
- transform: scale(0);
13
- opacity: 0.1;
14
- }
15
-
16
- 100% {
17
- transform: scale(1);
18
- opacity: 0.3;
19
- }
20
- `,eo=(0,en.keyframes)`
21
- 0% {
22
- opacity: 1;
23
- }
24
-
25
- 100% {
26
- opacity: 0;
27
- }
28
- `,ea=(0,en.keyframes)`
29
- 0% {
30
- transform: scale(1);
31
- }
32
-
33
- 50% {
34
- transform: scale(0.92);
35
- }
36
-
37
- 100% {
38
- transform: scale(1);
39
- }
40
- `,es=(0,S.ZP)("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),el=(0,S.ZP)(function(e){let{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:u}=e,[c,d]=g.useState(!1),h=(0,v.Z)(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p=(0,v.Z)(n.child,c&&n.childLeaving,r&&n.childPulsate);return s||c||d(!0),g.useEffect(()=>{if(!s&&null!=l){let e=setTimeout(l,u);return()=>{clearTimeout(e)}}},[l,s,u]),(0,f.jsx)("span",{className:h,style:{width:a,height:a,top:-(a/2)+o,left:-(a/2)+i},children:(0,f.jsx)("span",{className:p})})},{name:"MuiTouchRipple",slot:"Ripple"})`
41
- opacity: 0;
42
- position: absolute;
43
-
44
- &.${er.rippleVisible} {
45
- opacity: 0.3;
46
- transform: scale(1);
47
- animation-name: ${ei};
48
- animation-duration: ${550}ms;
49
- animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
50
- }
51
-
52
- &.${er.ripplePulsate} {
53
- animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
54
- }
55
-
56
- & .${er.child} {
57
- opacity: 1;
58
- display: block;
59
- width: 100%;
60
- height: 100%;
61
- border-radius: 50%;
62
- background-color: currentColor;
63
- }
64
-
65
- & .${er.childLeaving} {
66
- opacity: 0;
67
- animation-name: ${eo};
68
- animation-duration: ${550}ms;
69
- animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
70
- }
71
-
72
- & .${er.childPulsate} {
73
- position: absolute;
74
- /* @noflip */
75
- left: 0px;
76
- top: 0;
77
- animation-name: ${ea};
78
- animation-duration: 2500ms;
79
- animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
80
- animation-iteration-count: infinite;
81
- animation-delay: 200ms;
82
- }
83
- `,eu=g.forwardRef(function(e,t){let{center:n=!1,classes:r={},className:i,...o}=(0,M.i)({props:e,name:"MuiTouchRipple"}),[a,s]=g.useState([]),l=g.useRef(0),u=g.useRef(null);g.useEffect(()=>{u.current&&(u.current(),u.current=null)},[a]);let c=g.useRef(!1),d=et(),h=g.useRef(null),p=g.useRef(null),m=g.useCallback(e=>{let{pulsate:t,rippleX:n,rippleY:i,rippleSize:o,cb:a}=e;s(e=>[...e,(0,f.jsx)(el,{classes:{ripple:(0,v.Z)(r.ripple,er.ripple),rippleVisible:(0,v.Z)(r.rippleVisible,er.rippleVisible),ripplePulsate:(0,v.Z)(r.ripplePulsate,er.ripplePulsate),child:(0,v.Z)(r.child,er.child),childLeaving:(0,v.Z)(r.childLeaving,er.childLeaving),childPulsate:(0,v.Z)(r.childPulsate,er.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:i,rippleSize:o},l.current)]),l.current+=1,u.current=a},[r]),y=g.useCallback((e={},t={},r=()=>{})=>{let i,o,a;let{pulsate:s=!1,center:l=n||t.pulsate,fakeElement:u=!1}=t;if(e?.type==="mousedown"&&c.current){c.current=!1;return}e?.type==="touchstart"&&(c.current=!0);let f=u?null:p.current,g=f?f.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(!l&&void 0!==e&&(0!==e.clientX||0!==e.clientY)&&(e.clientX||e.touches)){let{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;i=Math.round(t-g.left),o=Math.round(n-g.top)}else i=Math.round(g.width/2),o=Math.round(g.height/2);l?(a=Math.sqrt((2*g.width**2+g.height**2)/3))%2==0&&(a+=1):a=Math.sqrt((2*Math.max(Math.abs((f?f.clientWidth:0)-i),i)+2)**2+(2*Math.max(Math.abs((f?f.clientHeight:0)-o),o)+2)**2),e?.touches?null===h.current&&(h.current=()=>{m({pulsate:s,rippleX:i,rippleY:o,rippleSize:a,cb:r})},d.start(80,()=>{h.current&&(h.current(),h.current=null)})):m({pulsate:s,rippleX:i,rippleY:o,rippleSize:a,cb:r})},[n,m,d]),b=g.useCallback(()=>{y({},{pulsate:!0})},[y]),x=g.useCallback((e,t)=>{if(d.clear(),e?.type==="touchend"&&h.current){h.current(),h.current=null,d.start(0,()=>{x(e,t)});return}h.current=null,s(e=>e.length>0?e.slice(1):e),u.current=t},[d]);return g.useImperativeHandle(t,()=>({pulsate:b,start:y,stop:x}),[b,y,x]),(0,f.jsx)(es,{className:(0,v.Z)(er.root,r.root,i),ref:p,...o,children:(0,f.jsx)(J,{component:null,exit:!0,children:a})})});function ec(e){return(0,A.ZP)("MuiButtonBase",e)}let ed=(0,T.Z)("MuiButtonBase",["root","disabled","focusVisible"]),eh=e=>{let{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,o=(0,y.Z)({root:["root",t&&"disabled",n&&"focusVisible"]},ec,i);return n&&r&&(o.root+=` ${r}`),o},ep=(0,S.ZP)("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${ed.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ef=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiButtonBase"}),{action:r,centerRipple:i=!1,children:o,className:a,component:s="button",disabled:l=!1,disableRipple:u=!1,disableTouchRipple:c=!1,focusRipple:d=!1,focusVisibleClassName:h,LinkComponent:p="a",onBlur:m,onClick:y,onContextMenu:b,onDragLeave:x,onFocus:w,onFocusVisible:S,onKeyDown:C,onKeyUp:k,onMouseDown:T,onMouseLeave:A,onMouseUp:I,onTouchEnd:P,onTouchMove:R,onTouchStart:O,tabIndex:E=0,TouchRippleProps:D,touchRippleRef:L,type:_,...N}=n,Z=g.useRef(null),z=V.use(),$=(0,B.Z)(z.ref,L),[H,W]=g.useState(!1);l&&H&&W(!1),g.useImperativeHandle(r,()=>({focusVisible:()=>{W(!0),Z.current.focus()}}),[]);let q=z.shouldMount&&!u&&!l;g.useEffect(()=>{H&&d&&!u&&z.pulsate()},[u,d,H,z]);let G=eg(z,"start",T,c),U=eg(z,"stop",b,c),K=eg(z,"stop",x,c),Y=eg(z,"stop",I,c),X=eg(z,"stop",e=>{H&&e.preventDefault(),A&&A(e)},c),J=eg(z,"start",O,c),Q=eg(z,"stop",P,c),ee=eg(z,"stop",R,c),et=eg(z,"stop",e=>{j(e.target)||W(!1),m&&m(e)},!1),en=(0,F.Z)(e=>{Z.current||(Z.current=e.currentTarget),j(e.target)&&(W(!0),S&&S(e)),w&&w(e)}),er=()=>{let e=Z.current;return s&&"button"!==s&&!("A"===e.tagName&&e.href)},ei=(0,F.Z)(e=>{d&&!e.repeat&&H&&" "===e.key&&z.stop(e,()=>{z.start(e)}),e.target===e.currentTarget&&er()&&" "===e.key&&e.preventDefault(),C&&C(e),e.target===e.currentTarget&&er()&&"Enter"===e.key&&!l&&(e.preventDefault(),y&&y(e))}),eo=(0,F.Z)(e=>{d&&" "===e.key&&H&&!e.defaultPrevented&&z.stop(e,()=>{z.pulsate(e)}),k&&k(e),y&&e.target===e.currentTarget&&er()&&" "===e.key&&!e.defaultPrevented&&y(e)}),ea=s;"button"===ea&&(N.href||N.to)&&(ea=p);let es={};"button"===ea?(es.type=void 0===_?"button":_,es.disabled=l):(N.href||N.to||(es.role="button"),l&&(es["aria-disabled"]=l));let el=(0,B.Z)(t,Z),ec={...n,centerRipple:i,component:s,disabled:l,disableRipple:u,disableTouchRipple:c,focusRipple:d,tabIndex:E,focusVisible:H},ed=eh(ec);return(0,f.jsxs)(ep,{as:ea,className:(0,v.Z)(ed.root,a),ownerState:ec,onBlur:et,onClick:y,onContextMenu:U,onFocus:en,onKeyDown:ei,onKeyUp:eo,onMouseDown:G,onMouseLeave:X,onMouseUp:Y,onDragLeave:K,onTouchEnd:Q,onTouchMove:ee,onTouchStart:J,ref:el,tabIndex:l?-1:E,type:_,...es,...N,children:[o,q?(0,f.jsx)(eu,{ref:$,center:i,...D}):null]})});function eg(e,t,n,r=!1){return(0,F.Z)(i=>(n&&n(i),r||e[t](i),!0))}function em(e){return(0,A.ZP)("MuiCircularProgress",e)}(0,T.Z)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);let ev=(0,en.keyframes)`
84
- 0% {
85
- transform: rotate(0deg);
86
- }
87
-
88
- 100% {
89
- transform: rotate(360deg);
90
- }
91
- `,ey=(0,en.keyframes)`
92
- 0% {
93
- stroke-dasharray: 1px, 200px;
94
- stroke-dashoffset: 0;
95
- }
96
-
97
- 50% {
98
- stroke-dasharray: 100px, 200px;
99
- stroke-dashoffset: -15px;
100
- }
101
-
102
- 100% {
103
- stroke-dasharray: 1px, 200px;
104
- stroke-dashoffset: -126px;
105
- }
106
- `,eb="string"!=typeof ev?(0,en.css)`
107
- animation: ${ev} 1.4s linear infinite;
108
- `:null,ex="string"!=typeof ey?(0,en.css)`
109
- animation: ${ey} 1.4s ease-in-out infinite;
110
- `:null,ew=e=>{let{classes:t,variant:n,color:r,disableShrink:i}=e,o={root:["root",n,`color${(0,w.Z)(r)}`],svg:["svg"],circle:["circle",`circle${(0,w.Z)(n)}`,i&&"circleDisableShrink"]};return(0,y.Z)(o,em,t)},eS=(0,S.ZP)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`color${(0,w.Z)(n.color)}`]]}})((0,C.Z)(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:eb||{animation:`${ev} 1.4s linear infinite`}},...Object.entries(e.palette).filter(k()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),eC=(0,S.ZP)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),ek=(0,S.ZP)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.circle,t[`circle${(0,w.Z)(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})((0,C.Z)(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink,style:ex||{animation:`${ey} 1.4s ease-in-out infinite`}}]}))),eM=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiCircularProgress"}),{className:r,color:i="primary",disableShrink:o=!1,size:a=40,style:s,thickness:l=3.6,value:u=0,variant:c="indeterminate",...d}=n,h={...n,color:i,disableShrink:o,size:a,thickness:l,value:u,variant:c},p=ew(h),g={},m={},y={};if("determinate"===c){let e=2*Math.PI*((44-l)/2);g.strokeDasharray=e.toFixed(3),y["aria-valuenow"]=Math.round(u),g.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,m.transform="rotate(-90deg)"}return(0,f.jsx)(eS,{className:(0,v.Z)(p.root,r),style:{width:a,height:a,...m,...s},ownerState:h,ref:t,role:"progressbar",...y,...d,children:(0,f.jsx)(eC,{className:p.svg,ownerState:h,viewBox:"22 22 44 44",children:(0,f.jsx)(ek,{className:p.circle,style:g,ownerState:h,cx:44,cy:44,r:(44-l)/2,fill:"none",strokeWidth:l})})})});function eT(e){return(0,A.ZP)("MuiButton",e)}let eA=(0,T.Z)("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","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),eI=e=>{let{color:t,disableElevation:n,fullWidth:r,size:i,variant:o,loading:a,loadingPosition:s,classes:l}=e,u={root:["root",a&&"loading",o,`${o}${(0,w.Z)(t)}`,`size${(0,w.Z)(i)}`,`${o}Size${(0,w.Z)(i)}`,`color${(0,w.Z)(t)}`,n&&"disableElevation",r&&"fullWidth",a&&`loadingPosition${(0,w.Z)(s)}`],startIcon:["icon","startIcon",`iconSize${(0,w.Z)(i)}`],endIcon:["icon","endIcon",`iconSize${(0,w.Z)(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},c=(0,y.Z)(u,eT,l);return{...l,...c}},eP=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],eR=(0,S.ZP)(ef,{shouldForwardProp:e=>(0,Z.Z)(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${(0,w.Z)(n.color)}`],t[`size${(0,w.Z)(n.size)}`],t[`${n.variant}Size${(0,w.Z)(n.size)}`],"inherit"===n.color&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})((0,C.Z)(({theme:e})=>{let t="light"===e.palette.mode?e.palette.grey[300]:e.palette.grey[800],n="light"===e.palette.mode?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${eA.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${eA.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${eA.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${eA.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(k()).map(([t])=>({props:{color:t},style:{"--variant-textColor":(e.vars||e).palette[t].main,"--variant-outlinedColor":(e.vars||e).palette[t].main,"--variant-outlinedBorder":e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.5)`:(0,b.Fq)(e.palette[t].main,.5),"--variant-containedColor":(e.vars||e).palette[t].contrastText,"--variant-containedBg":(e.vars||e).palette[t].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[t].dark,"--variant-textBg":e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette[t].main,e.palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[t].main,"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette[t].main,e.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette.text.primary,e.palette.action.hoverOpacity),"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette.text.primary,e.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${eA.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${eA.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${eA.loading}`]:{color:"transparent"}}}]}})),eO=(0,S.ZP)("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${(0,w.Z)(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...eP]})),eE=(0,S.ZP)("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${(0,w.Z)(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...eP]})),eD=(0,S.ZP)("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),eL=(0,S.ZP)("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(e,t)=>t.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),e_=g.forwardRef(function(e,t){let n=g.useContext(R),r=g.useContext(O),i=(0,_.Z)(n,e),o=(0,M.i)({props:i,name:"MuiButton"}),{children:a,color:s="primary",component:l="button",className:u,disabled:c=!1,disableElevation:d=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:m,fullWidth:y=!1,id:b,loading:x=null,loadingIndicator:w,loadingPosition:S="center",size:C="medium",startIcon:k,type:T,variant:A="text",...I}=o,P=(0,N.Z)(b),E=w??(0,f.jsx)(eM,{"aria-labelledby":P,color:"inherit",size:16}),D={...o,color:s,component:l,disabled:c,disableElevation:d,disableFocusRipple:h,fullWidth:y,loading:x,loadingIndicator:E,loadingPosition:S,size:C,type:T,variant:A},L=eI(D),Z=(k||x&&"start"===S)&&(0,f.jsx)(eO,{className:L.startIcon,ownerState:D,children:k||(0,f.jsx)(eL,{className:L.loadingIconPlaceholder,ownerState:D})}),j=(p||x&&"end"===S)&&(0,f.jsx)(eE,{className:L.endIcon,ownerState:D,children:p||(0,f.jsx)(eL,{className:L.loadingIconPlaceholder,ownerState:D})}),B="boolean"==typeof x?(0,f.jsx)("span",{className:L.loadingWrapper,style:{display:"contents"},children:x&&(0,f.jsx)(eD,{className:L.loadingIndicator,ownerState:D,children:E})}):null;return(0,f.jsxs)(eR,{ownerState:D,className:(0,v.Z)(n.className,L.root,u,r||""),component:l,disabled:c||x,focusRipple:!h,focusVisibleClassName:(0,v.Z)(L.focusVisible,m),ref:t,type:T,id:x?P:b,...I,classes:L,children:[Z,"end"!==S&&B,a,"end"===S&&B,j]})});function eN({onChange:e,value:t="left",...n}){let r=t=>{e(t)};return(0,f.jsxs)(L,{"aria-label":"Alignement",...n,children:[(0,f.jsx)(e_,{onClick:()=>r("left"),variant:"left"===t?"contained":"outlined",children:"Left"},"left"),(0,f.jsx)(e_,{onClick:()=>r("center"),variant:"center"===t?"contained":"outlined",children:"Center"},"center"),(0,f.jsx)(e_,{onClick:()=>r("right"),variant:"right"===t?"contained":"outlined",children:"Right"},"right")]})}var eZ=n(4664),ej=n(6232),eB=n(7975),eF=n(8783),ez={average:function(e){for(var t=0,n=0,r=0;r<e.length;r++)!isNaN(e[r])&&(t+=e[r],n++);return 0===n?NaN:t/n},sum:function(e){for(var t=0,n=0;n<e.length;n++)t+=e[n]||0;return t},max:function(e){for(var t=-1/0,n=0;n<e.length;n++)e[n]>t&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n<e.length;n++)e[n]<t&&(t=e[n]);return isFinite(t)?t:NaN},minmax:function(e){for(var t=-1/0,n=-1/0,r=0;r<e.length;r++){var i=e[r],o=Math.abs(i);o>t&&(t=o,n=i)}return isFinite(n)?n:NaN},nearest:function(e){return e[0]}},e$=function(e){return Math.round(e.length/2)};function eV(e){return{seriesType:e,reset:function(e,t,n){var r=e.getData(),i=e.get("sampling"),o=e.coordinateSystem,a=r.count();if(a>10&&"cartesian2d"===o.type&&i){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),c=n.getDevicePixelRatio(),d=Math.round(a/(Math.abs(u[1]-u[0])*(c||1)));if(isFinite(d)&&d>1){"lttb"===i&&e.setData(r.lttbDownSample(r.mapDimension(l.dim),1/d));var h=void 0;(0,eB.HD)(i)?h=ez[i]:(0,eB.mf)(i)&&(h=i),h&&e.setData(r.downSample(r.mapDimension(l.dim),1/d,h,e$))}}}}}var eH=n(9988),eW=n(5430),eq=n(984),eG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.getInitialData=function(e,t){return(0,eq.Z)(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var r=this.coordinateSystem;if(r&&r.clampData){var i=r.clampData(e),o=r.dataToPoint(i);if(n)(0,eB.S6)(r.getAxes(),function(e,n){if("category"===e.type&&null!=t){var r=e.getTicksCoords(),a=e.getTickModel().get("alignWithLabel"),s=i[n],l="x1"===t[n]||"y1"===t[n];if(l&&!a&&(s+=1),!(r.length<2)){if(2===r.length){o[n]=e.toGlobalCoord(e.getExtent()[+!!l]);return}for(var u=void 0,c=void 0,d=1,h=0;h<r.length;h++){var p=r[h].coord,f=h===r.length-1?r[h-1].tickValue+d:r[h].tickValue;if(f===s){c=p;break}if(f<s)u=p;else if(null!=u&&f>s){c=(p+u)/2;break}1===h&&(d=f-r[0].tickValue)}null==c&&(u?u&&(c=r[r.length-1].coord):c=r[0].coord),o[n]=e.toGlobalCoord(c)}}});else{var a=this.getData(),s=a.getLayout("offset"),l=a.getLayout("size"),u=+!r.getBaseAxis().isHorizontal();o[u]+=s+l/2}return o}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(eW.Z);eW.Z.registerClass(eG);var eU=n(4587),eK=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.getInitialData=function(){return(0,eq.Z)(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},t.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=(0,eU.ZL)(eG.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(eG),eY=n(8588),eX=n(7293),eJ=n(7810),eQ=n(9858),e0=n(1969),e1=n(3511),e2=n(428),e5=n(8306),e3=n(3361),e4=n(9774),e6=n(2517);function e8(e,t,n,r,i){var o=e.getArea(),a=o.x,s=o.y,l=o.width,u=o.height,c=n.get(["lineStyle","width"])||2;a-=c/2,s-=c/2,l+=c,u+=c,l=Math.ceil(l),a!==Math.floor(a)&&(a=Math.floor(a),l++);var d=new e0.Z({shape:{x:a,y:s,width:l,height:u}});if(t){var h=e.getBaseAxis(),p=h.isHorizontal(),f=h.inverse;p?(f&&(d.shape.x+=l),d.shape.width=0):(f||(d.shape.y+=u),d.shape.height=0);var g=(0,eB.mf)(i)?function(e){i(e,d)}:null;eQ.KZ(d,{shape:{width:l,height:u,x:a,y:s}},n,null,r,g)}return d}function e9(e,t,n){var r=e.getArea(),i=(0,e6.NM)(r.r0,1),o=(0,e6.NM)(r.r,1),a=new e1.C({shape:{cx:(0,e6.NM)(e.cx,1),cy:(0,e6.NM)(e.cy,1),r0:i,r:o,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}});return t&&("angle"===e.getBaseAxis().dim?a.shape.endAngle=r.startAngle:a.shape.r=i,eQ.KZ(a,{shape:{endAngle:r.endAngle,r:o}},n)),a}function e7(e,t,n,r,i){if(e){if("polar"===e.type)return e9(e,t,n);if("cartesian2d"===e.type)return e8(e,t,n,r,i)}return null}var te=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},tt=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return(0,eH.ZT)(t,e),t.prototype.getDefaultShape=function(){return new te},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),o=Math.max(t.r,0),a=(o-i)*.5,s=i+a,l=t.startAngle,u=t.endAngle,c=t.clockwise,d=2*Math.PI,h=c?u-l<d:l-u<d;h||(l=u-(c?d:-d));var p=Math.cos(l),f=Math.sin(l),g=Math.cos(u),m=Math.sin(u);h?(e.moveTo(p*i+n,f*i+r),e.arc(p*s+n,f*s+r,a,-Math.PI+l,l,!c)):e.moveTo(p*o+n,f*o+r),e.arc(n,r,o,l,u,!c),e.arc(g*s+n,m*s+r,a,u-2*Math.PI,u-Math.PI,!c),0!==i&&e.arc(n,r,i,u,l,c)},t}(eY.ZP),tn=n(8050);function tr(e,t){return e.type===t}var ti=n(6072),to=n(2666);function ta(e,t,n){return t*Math.sin(e)*(n?-1:1)}function ts(e,t,n){return t*Math.cos(e)*(n?1:-1)}function tl(e,t,n){var r=e.get("borderRadius");if(null==r)return n?{cornerRadius:0}:null;(0,eB.kJ)(r)||(r=[r,r,r,r]);var i=Math.abs(t.r||0-t.r0||0);return{cornerRadius:(0,eB.UI)(r,function(e){return(0,to.GM)(e,i)})}}var tu=Math.max,tc=Math.min,td=function(e){function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return(0,eH.ZT)(t,e),t.prototype.render=function(e,t,n,r){this._model=e,this._removeOnRenderedListener(n),this._updateDrawMode(e);var i=e.get("coordinateSystem");("cartesian2d"===i||"polar"===i)&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,r))},t.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},t.prototype.incrementalRender=function(e,t){this._progressiveEls=[],this._incrementalRenderLarge(e,t)},t.prototype.eachRendered=function(e){(0,eJ.traverseElements)(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t!==this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e,t,n,r){var i,o=this.group,a=e.getData(),s=this._data,l=e.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?i=u.isHorizontal():"polar"===l.type&&(i="angle"===u.dim);var c=e.isAnimationEnabled()?e:null,d=function(e,t){var n=e.get("realtimeSort",!0),r=t.getBaseAxis();if(n&&"category"===r.type&&"cartesian2d"===t.type)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}(e,l);d&&this._enableRealtimeSort(d,a,n);var h=e.get("clip",!0)||d,p=function(e,t){var n=e.getArea&&e.getArea();if(tr(e,"cartesian2d")){var r=e.getBaseAxis();if("category"!==r.type||!r.onBand){var i=t.getLayout("bandWidth");r.isHorizontal()?(n.x-=i,n.width+=2*i):(n.y-=i,n.height+=2*i)}}return n}(l,a);o.removeClipPath();var f=e.get("roundCap",!0),g=e.get("showBackground",!0),m=e.getModel("backgroundStyle"),v=m.get("borderRadius")||0,y=[],b=this._backgroundEls,x=r&&r.isInitSort,w=r&&"changeAxisOrder"===r.type;function S(e){var t,n,r,o=tb[l.type](a,e),s=(t=l,n=i,r=o,new("polar"===t.type?e1.C:e0.Z)({shape:tT(n,r,t),silent:!0,z2:0}));return s.useStyle(m.getItemStyle()),"cartesian2d"===l.type?s.setShape("r",v):s.setShape("cornerRadius",v),y[e]=s,s}a.diff(s).add(function(t){var n=a.getItemModel(t),r=tb[l.type](a,t,n);if(g&&S(t),a.hasValue(t)&&ty[l.type](r)){var s=!1;h&&(s=th[l.type](p,r));var m=tp[l.type](e,a,t,r,i,c,u.model,!1,f);d&&(m.forceLabelAnimation=!0),tw(m,a,t,n,r,e,i,"polar"===l.type),x?m.attr({shape:r}):d?tf(d,c,m,r,t,i,!1,!1):(0,eQ.KZ)(m,{shape:r},e,t),a.setItemGraphicEl(t,m),o.add(m),m.ignore=s}}).update(function(t,n){var r=a.getItemModel(t),C=tb[l.type](a,t,r);if(g){var k=void 0;0===b.length?k=S(n):((k=b[n]).useStyle(m.getItemStyle()),"cartesian2d"===l.type?k.setShape("r",v):k.setShape("cornerRadius",v),y[t]=k);var M=tb[l.type](a,t),T=tT(i,M,l);(0,eQ.D)(k,{shape:T},c,t)}var A=s.getItemGraphicEl(n);if(!a.hasValue(t)||!ty[l.type](C)){o.remove(A);return}var I=!1;if(h&&(I=th[l.type](p,C))&&o.remove(A),A?(0,eQ.Zi)(A):A=tp[l.type](e,a,t,C,i,c,u.model,!!A,f),d&&(A.forceLabelAnimation=!0),w){var P=A.getTextContent();if(P){var R=(0,e3.qA)(P);null!=R.prevValue&&(R.prevValue=R.value)}}else tw(A,a,t,r,C,e,i,"polar"===l.type);x?A.attr({shape:C}):d?tf(d,c,A,C,t,i,!0,w):(0,eQ.D)(A,{shape:C},e,t,null),a.setItemGraphicEl(t,A),A.ignore=I,o.add(A)}).remove(function(t){var n=s.getItemGraphicEl(t);n&&(0,eQ.XD)(n,e,t)}).execute();var C=this._backgroundGroup||(this._backgroundGroup=new eX.Z);C.removeAll();for(var k=0;k<y.length;++k)C.add(y[k]);o.add(C),this._backgroundEls=y,this._data=a},t.prototype._renderLarge=function(e,t,n){this._clear(),tk(e,this.group),this._updateLargeClip(e)},t.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),tk(t,this.group,this._progressiveEls,!0)},t.prototype._updateLargeClip=function(e){var t=e.get("clip",!0)&&e7(e.coordinateSystem,!1,e),n=this.group;t?n.setClipPath(t):n.removeClipPath()},t.prototype._enableRealtimeSort=function(e,t,n){var r=this;if(t.count()){var i=e.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(t,e,n),this._isFirstFrame=!1;else{var o=function(e){var n=t.getItemGraphicEl(e),r=n&&n.shape;return r&&Math.abs(i.isHorizontal()?r.height:r.width)||0};this._onRendered=function(){r._updateSortWithinSameData(t,o,i,n)},n.getZr().on("rendered",this._onRendered)}}},t.prototype._dataSort=function(e,t,n){var r=[];return e.each(e.mapDimension(t.dim),function(e,t){var i=n(t);i=null==i?NaN:i,r.push({dataIndex:t,mappedValue:i,ordinalNumber:e})}),r.sort(function(e,t){return t.mappedValue-e.mappedValue}),{ordinalNumbers:(0,eB.UI)(r,function(e){return e.ordinalNumber})}},t.prototype._isOrderChangedWithinSameData=function(e,t,n){for(var r=n.scale,i=e.mapDimension(n.dim),o=Number.MAX_VALUE,a=0,s=r.getOrdinalMeta().categories.length;a<s;++a){var l=e.rawIndexOf(i,r.getRawOrdinalNumber(a)),u=l<0?Number.MIN_VALUE:t(e.indexOfRawIndex(l));if(u>o)return!0;o=u}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,r=n.getExtent(),i=Math.max(0,r[0]),o=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=o;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)});n.dispatchAction({type:"changeAxisOrder",componentType:r.dim+"Axis",isInitSort:!0,axisId:r.index,sortInfo:i})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(t){(0,eQ.XD)(t,e,(0,e2.A)(t).dataIndex)})):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(tn.Z),th={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,o=e.y+e.height,a=tu(t.x,e.x),s=tc(t.x+t.width,i),l=tu(t.y,e.y),u=tc(t.y+t.height,o),c=s<a,d=u<l;return t.x=c&&a>i?s:a,t.y=d&&l>o?u:l,t.width=c?0:s-a,t.height=d?0:u-l,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),c||d},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=tc(t.r,e.r),o=tu(t.r0,e.r0);t.r=i,t.r0=o;var a=i-o<0;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}return a}},tp={cartesian2d:function(e,t,n,r,i,o,a,s,l){var u=new e0.Z({shape:(0,eB.l7)({},r),z2:1});return u.__dataIndex=n,u.name="item",o&&(u.shape[i?"height":"width"]=0),u},polar:function(e,t,n,r,i,o,a,s,l){var u,c,d=!i&&l?tt:e1.C,h=new d({shape:r,z2:1});h.name="item";var p=tx(i);if(h.calculateTextPosition=(c=d===tt,function(e,t,n){var r=t.position;if(!r||r instanceof Array)return(0,to.wI)(e,t,n);var i=p(r),o=null!=t.distance?t.distance:5,a=this.shape,s=a.cx,l=a.cy,u=a.r,d=a.r0,h=(u+d)/2,f=a.startAngle,g=a.endAngle,m=(f+g)/2,v=c?Math.abs(u-d)/2:0,y=Math.cos,b=Math.sin,x=s+u*y(f),w=l+u*b(f),S="left",C="top";switch(i){case"startArc":x=s+(d-o)*y(m),w=l+(d-o)*b(m),S="center",C="top";break;case"insideStartArc":x=s+(d+o)*y(m),w=l+(d+o)*b(m),S="center",C="bottom";break;case"startAngle":x=s+h*y(f)+ta(f,o+v,!1),w=l+h*b(f)+ts(f,o+v,!1),S="right",C="middle";break;case"insideStartAngle":x=s+h*y(f)+ta(f,-o+v,!1),w=l+h*b(f)+ts(f,-o+v,!1),S="left",C="middle";break;case"middle":x=s+h*y(m),w=l+h*b(m),S="center",C="middle";break;case"endArc":x=s+(u+o)*y(m),w=l+(u+o)*b(m),S="center",C="bottom";break;case"insideEndArc":x=s+(u-o)*y(m),w=l+(u-o)*b(m),S="center",C="top";break;case"endAngle":x=s+h*y(g)+ta(g,o+v,!0),w=l+h*b(g)+ts(g,o+v,!0),S="left",C="middle";break;case"insideEndAngle":x=s+h*y(g)+ta(g,-o+v,!0),w=l+h*b(g)+ts(g,-o+v,!0),S="right",C="middle";break;default:return(0,to.wI)(e,t,n)}return(e=e||{}).x=x,e.y=w,e.align=S,e.verticalAlign=C,e}),o){var f=h.shape,g=i?"r":"endAngle",m={};f[g]=i?r.r0:r.startAngle,m[g]=r[g],(s?eQ.D:eQ.KZ)(h,{shape:m},o)}return h}};function tf(e,t,n,r,i,o,a,s){o?(u={x:r.x,width:r.width},l={y:r.y,height:r.height}):(u={y:r.y,height:r.height},l={x:r.x,width:r.width}),s||(a?eQ.D:eQ.KZ)(n,{shape:l},t,i,null);var l,u,c=t?e.baseAxis.model:null;(a?eQ.D:eQ.KZ)(n,{shape:u},c,i)}function tg(e,t){for(var n=0;n<t.length;n++)if(!isFinite(e[t[n]]))return!0;return!1}var tm=["x","y","width","height"],tv=["cx","cy","r","startAngle","endAngle"],ty={cartesian2d:function(e){return!tg(e,tm)},polar:function(e){return!tg(e,tv)}},tb={cartesian2d:function(e,t,n){var r,i,o,a=e.getItemLayout(t),s=n?(r=n,i=a,(o=r.get(["itemStyle","borderColor"]))&&"none"!==o?Math.min(r.get(["itemStyle","borderWidth"])||0,isNaN(i.width)?Number.MAX_VALUE:Math.abs(i.width),isNaN(i.height)?Number.MAX_VALUE:Math.abs(i.height)):0):0,l=a.width>0?1:-1,u=a.height>0?1:-1;return{x:a.x+l*s/2,y:a.y+u*s/2,width:a.width-l*s,height:a.height-u*s}},polar:function(e,t,n){var r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function tx(e){var t;return t=e?"Arc":"Angle",function(e){switch(e){case"start":case"insideStart":case"end":case"insideEnd":return e+t;default:return e}}}function tw(e,t,n,r,i,o,a,s){var l=t.getItemVisual(n,"style");if(s){if(!o.get("roundCap")){var u=e.shape,c=tl(r.getModel("itemStyle"),u,!0);(0,eB.l7)(u,c),e.setShape(u)}}else{var d=r.get(["itemStyle","borderRadius"])||0;e.setShape("r",d)}e.useStyle(l);var h=r.getShallow("cursor");h&&e.attr("cursor",h);var p=s?a?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":a?i.height>=0?"bottom":"top":i.width>=0?"right":"left",f=(0,e3.k3)(r);(0,e3.ni)(e,f,{labelFetcher:o,labelDataIndex:n,defaultText:(0,ti.H)(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var g=e.getTextContent();if(s&&g){var m=r.get(["label","position"]);e.textConfig.inside="middle"===m||null,function(e,t,n,r){if((0,eB.hj)(r)){e.setTextConfig({rotation:r});return}if((0,eB.kJ)(t)){e.setTextConfig({rotation:0});return}var i,o=e.shape,a=o.clockwise?o.startAngle:o.endAngle,s=o.clockwise?o.endAngle:o.startAngle,l=n(t);switch(l){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":i=(a+s)/2;break;case"startAngle":case"insideStartAngle":i=a;break;case"endAngle":case"insideEndAngle":i=s;break;default:e.setTextConfig({rotation:0});return}var u=1.5*Math.PI-i;"middle"===l&&u>Math.PI/2&&u<1.5*Math.PI&&(u-=Math.PI),e.setTextConfig({rotation:u})}(e,"outside"===m?p:m,tx(a),r.get(["label","rotate"]))}(0,e3.pe)(g,f,o.getRawValue(n),function(e){return(0,ti.O)(t,e)});var v=r.getModel(["emphasis"]);(0,e5.k5)(e,v.get("focus"),v.get("blurScope"),v.get("disabled")),(0,e5.WO)(e,r),null!=i.startAngle&&null!=i.endAngle&&i.startAngle===i.endAngle&&(e.style.fill="none",e.style.stroke="none",(0,eB.S6)(e.states,function(e){e.style&&(e.style.fill=e.style.stroke="none")}))}var tS=function(){},tC=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return(0,eH.ZT)(t,e),t.prototype.getDefaultShape=function(){return new tS},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l<n.length;l+=3)a[r]=s,a[i]=n[l+2],o[r]=n[l+r],o[i]=n[l+i],e.rect(o[0],o[1],a[0],a[1])},t}(eY.ZP);function tk(e,t,n,r){var i=e.getData(),o=+!!i.getLayout("valueAxisHorizontal"),a=i.getLayout("largeDataIndices"),s=i.getLayout("size"),l=e.getModel("backgroundStyle"),u=i.getLayout("largeBackgroundPoints");if(u){var c=new tC({shape:{points:u},incremental:!!r,silent:!0,z2:0});c.baseDimIdx=o,c.largeDataIndices=a,c.barWidth=s,c.useStyle(l.getItemStyle()),t.add(c),n&&n.push(c)}var d=new tC({shape:{points:i.getLayout("largePoints")},incremental:!!r,ignoreCoarsePointer:!0,z2:1});d.baseDimIdx=o,d.largeDataIndices=a,d.barWidth=s,t.add(d),d.useStyle(i.getVisual("style")),(0,e2.A)(d).seriesIndex=e.seriesIndex,e.get("silent")||(d.on("mousedown",tM),d.on("mousemove",tM)),n&&n.push(d)}var tM=(0,e4.P2)(function(e){var t=function(e,t,n){for(var r=e.baseDimIdx,i=1-r,o=e.shape.points,a=e.largeDataIndices,s=[],l=[],u=e.barWidth,c=0,d=o.length/3;c<d;c++){var h=3*c;if(l[r]=u,l[i]=o[h+2],s[r]=o[h+r],s[i]=o[h+i],l[i]<0&&(s[i]+=l[i],l[i]=-l[i]),t>=s[0]&&t<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[c]}return -1}(this,e.offsetX,e.offsetY);(0,e2.A)(this).dataIndex=t>=0?t:null},30,!1);function tT(e,t,n){if(tr(n,"cartesian2d")){var r=n.getArea();return{x:e?t.x:r.x,y:e?r.y:t.y,width:e?t.width:r.width,height:e?r.height:t.height}}var r=n.getArea();return{cx:r.cx,cy:r.cy,r0:e?r.r0:t.r0,r:e?r.r:t.r,startAngle:e?t.startAngle:0,endAngle:e?t.endAngle:2*Math.PI}}function tA(e){e.registerChartView(td),e.registerSeriesModel(eK),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,eB.WA(eF.bK,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,(0,eF.Bk)("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,eV("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)})})}var tI=n(5201),tP=n(9635),tR=n(3709),tO=n(7745),tE=n(378),tD=n(9966),tL=n(1652),t_=n(1170),tN=n(273);let tZ=e=>{let t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??tN.Z;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t};function tj(e){let t;let{sx:n,...r}=e,{systemProps:i,otherProps:o}=tZ(r);return t=Array.isArray(n)?[i,...n]:"function"==typeof n?(...e)=>{let t=n(...e);return(0,t_.P)(t)?{...i,...t}:i}:{...i,...n},{...o,sx:t}}var tB=n(6798);let tF=function(e=null){let t=g.useContext(en.ThemeContext);return t&&0!==Object.keys(t).length?t:e},tz=(0,tB.Z)(),t$=function(e=tz){return tF(e)};var tV=n(544),tH=n(6385),tW=n(2994);let tq=(0,T.Z)("MuiBox",["root"]),tG=(0,tH.Z)(),tU=function(e={}){let{themeId:t,defaultTheme:n,defaultClassName:r="MuiBox-root",generateClassName:i}=e,o=(0,tD.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(tL.Z);return g.forwardRef(function(e,a){let s=t$(n),{className:l,component:u="div",...c}=tj(e);return(0,f.jsx)(o,{as:u,ref:a,className:(0,v.Z)(l,i?i(r):r),theme:t&&s[t]||s,...c})})}({themeId:tW.Z,defaultTheme:tG,defaultClassName:tq.root,generateClassName:tV.Z.generate});function tK(e){let{children:t,chartsTheme:n,enablePinning:r=!1}=e,[i,o]=(0,g.useState)(null),a=(0,g.useMemo)(()=>({chartsTheme:n,enablePinning:r,lastTooltipPinnedCoords:i,setLastTooltipPinnedCoords:o}),[n,r,i,o]);return(0,f.jsx)(tY.Provider,{value:a,children:t})}let tY=(0,g.createContext)(void 0);function tX(){let e=(0,g.useContext)(tY);if(void 0===e)throw Error("No ChartsThemeContext found. Did you forget a Provider?");return e}function tJ(){return tX().chartsTheme}var tQ=n(9161),t0=n(6141),t1=n.n(t0),t2=n(6726),t5=n.n(t2),t3=n(8890),t4=n(6571),t6={color:"fill",borderColor:"stroke"},t8={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},t9=(0,t4.Yf)(),t7=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(e,t){return(0,eq.Z)(null,this)},t.prototype.getDataParams=function(t,n,r){var i=e.prototype.getDataParams.call(this,t,n);return r&&(i.info=t9(r).info),i},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(eW.Z),ne=n(3287),nt=n(4639),nn=n(2787);function nr(e,t){return t=t||[0,0],eB.UI(["x","y"],function(n,r){var i=this.getAxis(n),o=t[r],a=e[r]/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(o-a)-i.dataToCoord(o+a))},this)}function ni(e,t){return t=t||[0,0],eB.UI([0,1],function(n){var r=t[n],i=e[n]/2,o=[],a=[];return o[n]=r-i,a[n]=r+i,o[1-n]=a[1-n]=t[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])},this)}function no(e,t){var n=this.getAxis(),r=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(r-i)-n.dataToCoord(r+i))}function na(e,t){return t=t||[0,0],eB.UI(["Radius","Angle"],function(n,r){var i=this["get"+n+"Axis"](),o=t[r],a=e[r]/2,s="category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(o-a)-i.dataToCoord(o+a));return"Angle"===n&&(s=s*Math.PI/180),s},this)}var ns=n(2097);function nl(e,t){t&&(t.font=t.textFont||t.font,(0,eB.RI)(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),(0,eB.RI)(t,"textAlign")&&(e.align=t.textAlign),(0,eB.RI)(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),(0,eB.RI)(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),(0,eB.RI)(t,"textWidth")&&(e.width=t.textWidth),(0,eB.RI)(t,"textHeight")&&(e.height=t.textHeight),(0,eB.RI)(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),(0,eB.RI)(t,"textPadding")&&(e.padding=t.textPadding),(0,eB.RI)(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),(0,eB.RI)(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),(0,eB.RI)(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),(0,eB.RI)(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),(0,eB.RI)(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),(0,eB.RI)(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),(0,eB.RI)(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function nu(e,t,n){e.textPosition=e.textPosition||n.position||"inside",null!=n.offset&&(e.textOffset=n.offset),null!=n.rotation&&(e.textRotation=n.rotation),null!=n.distance&&(e.textDistance=n.distance);var r=e.textPosition.indexOf("inside")>=0,i=e.fill||"#000";nc(e,t);var o=null==e.textFill;return r?o&&(e.textFill=n.insideFill||"#fff",!e.textStroke&&n.insideStroke&&(e.textStroke=n.insideStroke),e.textStroke||(e.textStroke=i),null==e.textStrokeWidth&&(e.textStrokeWidth=2)):(o&&(e.textFill=e.fill||n.outsideFill||"#000"),!e.textStroke&&n.outsideStroke&&(e.textStroke=n.outsideStroke)),e.text=t.text,e.rich=t.rich,(0,eB.S6)(t.rich,function(e){nc(e,e)}),e}function nc(e,t){t&&((0,eB.RI)(t,"fill")&&(e.textFill=t.fill),(0,eB.RI)(t,"stroke")&&(e.textStroke=t.fill),(0,eB.RI)(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),(0,eB.RI)(t,"font")&&(e.font=t.font),(0,eB.RI)(t,"fontStyle")&&(e.fontStyle=t.fontStyle),(0,eB.RI)(t,"fontWeight")&&(e.fontWeight=t.fontWeight),(0,eB.RI)(t,"fontSize")&&(e.fontSize=t.fontSize),(0,eB.RI)(t,"fontFamily")&&(e.fontFamily=t.fontFamily),(0,eB.RI)(t,"align")&&(e.textAlign=t.align),(0,eB.RI)(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),(0,eB.RI)(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),(0,eB.RI)(t,"width")&&(e.textWidth=t.width),(0,eB.RI)(t,"height")&&(e.textHeight=t.height),(0,eB.RI)(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),(0,eB.RI)(t,"padding")&&(e.textPadding=t.padding),(0,eB.RI)(t,"borderColor")&&(e.textBorderColor=t.borderColor),(0,eB.RI)(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),(0,eB.RI)(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),(0,eB.RI)(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),(0,eB.RI)(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),(0,eB.RI)(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),(0,eB.RI)(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),(0,eB.RI)(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),(0,eB.RI)(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),(0,eB.RI)(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),(0,eB.RI)(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var nd=n(2159),nh=n(6151),np=n(8026),nf=n(4066),ng={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},nm=(0,eB.XP)(ng);(0,eB.u4)(nf.dN,function(e,t){return e[t]=1,e},{}),nf.dN.join(", ");var nv=["","style","shape","extra"],ny=(0,t4.Yf)();function nb(e,t,n,r,i){var o=e+"Animation",a=(0,eQ.ke)(e,r,i)||{},s=ny(t).userDuring;return a.duration>0&&(a.during=s?(0,eB.ak)(nk,{el:t,userDuring:s}):null,a.setToFinal=!0,a.scope=e),(0,eB.l7)(a,n[o]),a}function nx(e,t,n,r){if(e){var i=e.parent,o=ny(e).leaveToProps;if(o){var a=nb("update",e,t,n,0);a.done=function(){i.remove(e),r&&r()},e.animateTo(o,a)}else i.remove(e),r&&r()}}function nw(e){return"all"===e}var nS={},nC={setTransform:function(e,t){return nS.el[e]=t,this},getTransform:function(e){return nS.el[e]},setShape:function(e,t){var n=nS.el;return(n.shape||(n.shape={}))[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){var t=nS.el.shape;if(t)return t[e]},setStyle:function(e,t){var n=nS.el,r=n.style;return r&&(r[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){var t=nS.el.style;if(t)return t[e]},setExtra:function(e,t){return(nS.el.extra||(nS.el.extra={}))[e]=t,this},getExtra:function(e){var t=nS.el.extra;if(t)return t[e]}};function nk(){var e=this.el;if(e){var t=ny(e).userDuring,n=this.userDuring;if(t!==n){this.el=this.userDuring=null;return}nS.el=e,n(nC)}}function nM(e,t,n,r){var i,o=n[e];if(o){var a=t[e];if(a){var s=n.transition,l=o.transition;if(l){if(i||(i=r[e]={}),nw(l))(0,eB.l7)(i,a);else for(var u=(0,t4.kF)(l),c=0;c<u.length;c++){var d=u[c],h=a[d];i[d]=h}}else if(nw(s)||(0,eB.cq)(s,e)>=0){i||(i=r[e]={});for(var p=(0,eB.XP)(a),c=0;c<p.length;c++){var f,g,d=p[c],h=a[d];f=o[d],g=h,((0,eB.zG)(f)?f!==g:null!=f&&isFinite(f))&&(i[d]=h)}}}}}function nT(e,t,n){var r=t[e];if(r)for(var i=n[e]={},o=(0,eB.XP)(r),a=0;a<o.length;a++){var s=o[a];i[s]=(0,np.V)(r[s])}}var nA=(0,t4.Yf)(),nI=["percent","easing","shape","style","extra"],nP="emphasis",nR="normal",nO="blur",nE="select",nD=[nR,nP,nO,nE],nL={normal:["itemStyle"],emphasis:[nP,"itemStyle"],blur:[nO,"itemStyle"],select:[nE,"itemStyle"]},n_={normal:["label"],emphasis:[nP,"label"],blur:[nO,"label"],select:[nE,"label"]},nN=["x","y"],nZ={normal:{},emphasis:{},blur:{},select:{}},nj={cartesian2d:function(e){var t=e.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:eB.ak(nr,e)}}},geo:function(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:eB.ak(ni,e)}}},single:function(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:(0,eB.ak)(no,e)}}},polar:function(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),r=t.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:r[1],r0:r[0]},api:{coord:function(r){var i=t.dataToRadius(r[0]),o=n.dataToAngle(r[1]),a=e.coordToPoint([i,o]);return a.push(i,o*Math.PI/180),a},size:eB.ak(na,e)}}},calendar:function(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)}}}}};function nB(e){return e instanceof eY.ZP}function nF(e){return e instanceof ns.ZP}var nz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.render=function(e,t,n,r){this._progressiveEls=null;var i=this._data,o=e.getData(),a=this.group,s=nW(e,o,t,n);i||a.removeAll(),o.diff(i).add(function(t){nq(n,null,t,s(t,r),e,a,o)}).remove(function(t){var n=i.getItemGraphicEl(t);n&&nx(n,t9(n).option,e)}).update(function(t,l){nq(n,i.getItemGraphicEl(l),t,s(t,r),e,a,o)}).execute();var l=e.get("clip",!0)?e7(e.coordinateSystem,!1,e):null;l?a.setClipPath(l):a.removeClipPath(),this._data=o},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(e,t,n,r,i){var o=t.getData(),a=nW(t,o,n,r),s=this._progressiveEls=[];function l(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var u=e.start;u<e.end;u++){var c=nq(null,null,u,a(u,i),t,this.group,o);c&&(c.traverse(l),s.push(c))}},t.prototype.eachRendered=function(e){eJ.traverseElements(this._progressiveEls||this.group,e)},t.prototype.filterForExposedEvent=function(e,t,n,r){var i=t.element;if(null==i||n.name===i)return!0;for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===i)return!0;return!1},t.type="custom",t}(tn.Z);function n$(e){var t,n=e.type;if("path"===n){var r=e.shape,i=null!=r.width&&null!=r.height?{x:r.x||0,y:r.y||0,width:r.width,height:r.height}:null,o=n1(r);t9(t=eJ.makePath(o,null,i,r.layout||"center")).customPathData=o}else if("image"===n)t9(t=new ne.ZP({})).customImagePath=e.style.image;else if("text"===n)t=new nt.ZP({});else if("group"===n)t=new eX.Z;else if("compoundPath"===n)throw Error('"compoundPath" is not supported yet.');else{var a=eJ.getShapeClass(n);a||(0,nd._y)(""),t=new a}return t9(t).customGraphicType=n,t.name=e.name,t.z2EmphasisLift=1,t.z2SelectLift=1,t}function nV(e,t,n,r,i,o,a){t.stopAnimation("keyframe"),t.attr(nA(t));var s=i&&i.normal.cfg;s&&t.setTextConfig(s),r&&null==r.transition&&(r.transition=nN);var l=r&&r.style;if(l){"text"===t.type&&((0,eB.RI)(l,"textFill")&&(l.fill=l.textFill),(0,eB.RI)(l,"textStroke")&&(l.stroke=l.textStroke));var u=void 0,c=nB(t)?l.decal:null;e&&c&&(c.dirty=!0,u=(0,nh.I)(c,e)),l.__decalPattern=u}if(nF(t)&&l){var u=l.__decalPattern;u&&(l.decal=u)}!function(e,t,n,r){var i,o,a=(r=r||{}).dataIndex,s=r.isInit,l=r.clearStyle,u=n.isAnimationEnabled(),c=ny(e),d=t.style;c.userDuring=t.during;var h={},p={};if(function(e,t,n){for(var r=0;r<nm.length;r++){var i=nm[r],o=ng[i],a=t[i];a&&(n[o[0]]=a[0],n[o[1]]=a[1])}for(var r=0;r<nf.dN.length;r++){var s=nf.dN[r];null!=t[s]&&(n[s]=t[s])}}(0,t,p),nT("shape",t,p),nT("extra",t,p),!s&&u&&(function(e,t,n){for(var r=t.transition,i=nw(r)?nf.dN:(0,t4.kF)(r||[]),o=0;o<i.length;o++){var a=i[o];if("style"!==a&&"shape"!==a&&"extra"!==a){var s=e[a];n[a]=s}}}(e,t,h),nM("shape",e,t,h),nM("extra",e,t,h),function(e,t,n,r){if(n){var i,o=e.style;if(o){var a=n.transition,s=t.transition;if(a&&!nw(a)){var l=(0,t4.kF)(a);i||(i=r.style={});for(var u=0;u<l.length;u++){var c=l[u],d=o[c];i[c]=d}}else if(e.getAnimationStyleProps&&(nw(s)||nw(a)||(0,eB.cq)(s,"style")>=0)){var h=e.getAnimationStyleProps(),p=h?h.style:null;if(p){i||(i=r.style={});for(var f=(0,eB.XP)(n),u=0;u<f.length;u++){var c=f[u];if(p[c]){var d=o[c];i[c]=d}}}}}}}(e,t,d,h)),p.style=d,function(e,t,n){var r=t.style;if(!e.isGroup&&r){if(n){e.useStyle({});for(var i=e.animators,o=0;o<i.length;o++){var a=i[o];"style"===a.targetName&&a.changeTarget(e.style)}}e.setStyle(r)}t&&(t.style=null,t&&e.attr(t),t.style=r)}(e,p,l),i=e,o=t,(0,eB.RI)(o,"silent")&&(i.silent=o.silent),(0,eB.RI)(o,"ignore")&&(i.ignore=o.ignore),i instanceof ns.ZP&&(0,eB.RI)(o,"invisible")&&(i.invisible=o.invisible),i instanceof eY.ZP&&(0,eB.RI)(o,"autoBatch")&&(i.autoBatch=o.autoBatch),u){if(s){var f={};(0,eB.S6)(nv,function(e){var n=e?t[e]:t;n&&n.enterFrom&&(e&&(f[e]=f[e]||{}),(0,eB.l7)(e?f[e]:f,n.enterFrom))});var g=nb("enter",e,t,n,a);g.duration>0&&e.animateFrom(f,g)}else(function(e,t,n,r,i){if(i){var o=nb("update",e,t,r,n);o.duration>0&&e.animateFrom(i,o)}})(e,t,a||0,n,h)}(function(e,t){for(var n=ny(e).leaveToProps,r=0;r<nv.length;r++){var i=nv[r],o=i?t[i]:t;o&&o.leaveTo&&(n||(n=ny(e).leaveToProps={}),i&&(n[i]=n[i]||{}),(0,eB.l7)(i?n[i]:n,o.leaveTo))}})(e,t),d?e.dirty():e.markRedraw()}(t,r,o,{dataIndex:n,isInit:a,clearStyle:!0}),function e(t,n,r){if(r.isAnimationEnabled()&&n){if((0,eB.kJ)(n)){(0,eB.S6)(n,function(n){e(t,n,r)});return}var i=n.keyframes,o=n.duration;if(r&&null==o){var a=(0,eQ.ke)("enter",r,0);o=a&&a.duration}if(i&&o){var s=nA(t);(0,eB.S6)(nv,function(e){var r;if(!e||t[e])i.sort(function(e,t){return e.percent-t.percent}),(0,eB.S6)(i,function(i){var a=t.animators,l=e?i[e]:i;if(l){var u=(0,eB.XP)(l);if(e||(u=(0,eB.hX)(u,function(e){return 0>(0,eB.cq)(nI,e)})),u.length){r||((r=t.animate(e,n.loop,!0)).scope="keyframe");for(var c=0;c<a.length;c++)a[c]!==r&&a[c].targetName===r.targetName&&a[c].stopTracks(u);e&&(s[e]=s[e]||{});var d=e?s[e]:s;(0,eB.S6)(u,function(n){d[n]=((e?t[e]:t)||{})[n]}),r.whenWithKeys(o*i.percent,l,u,i.easing)}}}),r&&r.delay(n.delay||0).duration(o).start(n.easing)})}}}(t,r.keyframeAnimation,o)}function nH(e,t,n,r,i){var o=t.isGroup?null:t,a=i&&i[e].cfg;if(o){var s=o.ensureState(e);if(!1===r){var l=o.getState(e);l&&(l.style=null)}else s.style=r||null;a&&(s.textConfig=a),(0,e5.MA)(o)}}function nW(e,t,n,r){var i,o,a,s,l=e.get("renderItem"),u=e.coordinateSystem,c={};u&&(c=u.prepareCustoms?u.prepareCustoms(u):nj[u.type](u));for(var d=(0,eB.ce)({getWidth:r.getWidth,getHeight:r.getHeight,getZr:r.getZr,getDevicePixelRatio:r.getDevicePixelRatio,value:function(e,n){return null==n&&(n=a),t.getStore().get(t.getDimensionIndex(e||0),n)},style:function(n,r){null==r&&(r=a);var i=t.getItemVisual(r,"style"),o=i&&i.fill,s=i&&i.opacity,l=x(r,nR).getItemStyle();null!=o&&(l.fill=o),null!=s&&(l.opacity=s);var u={inheritColor:(0,eB.HD)(o)?o:"#000"},c=w(r,nR),d=e3.Lr(c,null,u,!1,!0);d.text=c.getShallow("show")?(0,eB.pD)(e.getFormattedLabel(r,nR),(0,ti.H)(t,r)):null;var h=e3.nC(c,u,!1);return C(n,l),l=nu(l,d,h),n&&S(l,n),l.legacy=!0,l},ordinalRawValue:function(e,n){null==n&&(n=a),e=e||0;var r=t.getDimensionInfo(e);if(!r){var i=t.getDimensionIndex(e);return i>=0?t.getStore().get(i,n):void 0}var o=t.get(r.name,n),s=r&&r.ordinalMeta;return s?s.categories[o]:o},styleEmphasis:function(n,r){null==r&&(r=a);var i=x(r,nP).getItemStyle(),o=w(r,nP),s=e3.Lr(o,null,null,!0,!0);s.text=o.getShallow("show")?(0,eB.R1)(e.getFormattedLabel(r,nP),e.getFormattedLabel(r,nR),(0,ti.H)(t,r)):null;var l=e3.nC(o,null,!0);return C(n,i),i=nu(i,s,l),n&&S(i,n),i.legacy=!0,i},visual:function(e,n){if(null==n&&(n=a),(0,eB.RI)(t6,e)){var r=t.getItemVisual(n,"style");return r?r[t6[e]]:null}if((0,eB.RI)(t8,e))return t.getItemVisual(n,e)},barLayout:function(e){if("cartesian2d"===u.type){var t=u.getBaseAxis();return(0,eF.Gk)((0,eB.ce)({axis:t},e))}},currentSeriesIndices:function(){return n.getCurrentSeriesIndices()},font:function(e){return e3.qT(e,n)}},c.api||{}),h={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:c.coordSys,dataInsideLength:t.count(),encode:(i=e.getData(),o={},(0,eB.S6)(i.dimensions,function(e){var t=i.getDimensionInfo(e);if(!t.isExtraCoord){var n=t.coordDim;(o[n]=o[n]||[])[t.coordDimIndex]=i.getDimensionIndex(e)}}),o)},p={},f={},g={},m={},v=0;v<nD.length;v++){var y=nD[v];g[y]=e.getModel(nL[y]),m[y]=e.getModel(n_[y])}function b(e){return e===a?s||(s=t.getItemModel(e)):t.getItemModel(e)}function x(e,n){return t.hasItemOption?e===a?p[n]||(p[n]=b(e).getModel(nL[n])):b(e).getModel(nL[n]):g[n]}function w(e,n){return t.hasItemOption?e===a?f[n]||(f[n]=b(e).getModel(n_[n])):b(e).getModel(n_[n]):m[n]}return function(e,n){return a=e,s=null,p={},f={},l&&l((0,eB.ce)({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:n?n.type:null},h),d)};function S(e,t){for(var n in t)(0,eB.RI)(t,n)&&(e[n]=t[n])}function C(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}}function nq(e,t,n,r,i,o,a){if(!r){o.remove(t);return}var s=nG(e,t,n,r,i,o);return s&&a.setItemGraphicEl(n,s),s&&(0,e5.k5)(s,r.focus,r.blurScope,r.emphasisDisabled),s}function nG(e,t,n,r,i,o){var a,s=-1,l=t;t&&nU(t,r,i)&&(s=(0,eB.cq)(o.childrenRef(),t),t=null);var u=!t,c=t;c?c.clearStates():(c=n$(r),l&&((a=c).copyTransform(l),nF(a)&&nF(l)&&(a.setStyle(l.style),a.z=l.z,a.z2=l.z2,a.zlevel=l.zlevel,a.invisible=l.invisible,a.ignore=l.ignore,nB(a)&&nB(l)&&a.setShape(l.shape)))),!1===r.morph?c.disableMorphing=!0:c.disableMorphing&&(c.disableMorphing=!1),nZ.normal.cfg=nZ.normal.conOpt=nZ.emphasis.cfg=nZ.emphasis.conOpt=nZ.blur.cfg=nZ.blur.conOpt=nZ.select.cfg=nZ.select.conOpt=null,nZ.isLegacy=!1,function(e,t,n,r,i,o){if(!e.isGroup){nK(n,null,o),nK(n,nP,o);var a=o.normal.conOpt,s=o.emphasis.conOpt,l=o.blur.conOpt,u=o.select.conOpt;if(null!=a||null!=s||null!=u||null!=l){var c=e.getTextContent();if(!1===a)c&&e.removeTextContent();else{a=o.normal.conOpt=a||{type:"text"},c?c.clearStates():(c=n$(a),e.setTextContent(c)),nV(null,c,t,a,null,r,i);for(var d=a&&a.style,h=0;h<nD.length;h++){var p=nD[h];if(p!==nR){var f=o[p].conOpt;nH(p,c,f,nX(a,f,p),null)}}d?c.dirty():c.markRedraw()}}}}(c,n,r,i,u,nZ),function(e,t,n,r,i){var o=n.clipPath;if(!1===o)e&&e.getClipPath()&&e.removeClipPath();else if(o){var a=e.getClipPath();a&&nU(a,o,r)&&(a=null),!a&&(a=n$(o),e.setClipPath(a)),nV(null,a,t,o,null,r,i)}}(c,n,r,i,u),nV(e,c,n,r,nZ,i,u),(0,eB.RI)(r,"info")&&(t9(c).info=r.info);for(var d=0;d<nD.length;d++){var h=nD[d];if(h!==nR){var p=nY(r,h),f=nX(r,p,h);nH(h,c,p,f,nZ)}}return!function(e,t,n){if(!e.isGroup){var r=n.currentZ,i=n.currentZLevel;e.z=r,e.zlevel=i;var o=t.z2;null!=o&&(e.z2=o||0);for(var a=0;a<nD.length;a++)(function(e,t,n){var r=n===nR,i=r?t:nY(t,n),o=i?i.z2:null;null!=o&&((r?e:e.ensureState(n)).z2=o||0)})(e,t,nD[a])}}(c,r,i),"group"===r.type&&function(e,t,n,r,i){var o=r.children,a=o?o.length:0,s=r.$mergeChildren,l="byName"===s||r.diffChildrenByName,u=!1===s;if(a||l||u){if(l){(function(e){new nn.Z(e.oldChildren,e.newChildren,nJ,nJ,e).add(nQ).update(nQ).remove(n0).execute()})({api:e,oldChildren:t.children()||[],newChildren:o||[],dataIndex:n,seriesModel:i,group:t});return}u&&t.removeAll();for(var c=0;c<a;c++){var d=o[c],h=t.childAt(c);d?(null==d.ignore&&(d.ignore=!1),nG(e,h,n,d,i,t)):h.ignore=!0}for(var p=t.childCount()-1;p>=c;p--){var f,g,m,v=t.childAt(p);f=t,g=v,m=i,g&&nx(g,t9(f).option,m)}}}(e,c,n,r,i),s>=0?o.replaceAt(c,s):o.add(c),c}function nU(e,t,n){var r,i=t9(e),o=t.type,a=t.shape,s=t.style;return n.isUniversalTransitionEnabled()||null!=o&&o!==i.customGraphicType||"path"===o&&(r=a)&&((0,eB.RI)(r,"pathData")||(0,eB.RI)(r,"d"))&&n1(a)!==i.customPathData||"image"===o&&(0,eB.RI)(s,"image")&&s.image!==i.customImagePath}function nK(e,t,n){var r,i,o=t?nY(e,t):e,a=t?nX(e,o,nP):e.style,s=e.type,l=o?o.textConfig:null,u=e.textContent,c=u?t?nY(u,t):u:null;if(a&&(n.isLegacy||(r=!!l,i=!!c,a&&(a.legacy||!1!==a.legacy&&!r&&!i&&"tspan"!==s&&("text"===s||(0,eB.RI)(a,"text")))))){n.isLegacy=!0;var d=function(e,t,n){var r,i,o;if("text"===t)o=e;else{o={},(0,eB.RI)(e,"text")&&(o.text=e.text),(0,eB.RI)(e,"rich")&&(o.rich=e.rich),(0,eB.RI)(e,"textFill")&&(o.fill=e.textFill),(0,eB.RI)(e,"textStroke")&&(o.stroke=e.textStroke),(0,eB.RI)(e,"fontFamily")&&(o.fontFamily=e.fontFamily),(0,eB.RI)(e,"fontSize")&&(o.fontSize=e.fontSize),(0,eB.RI)(e,"fontStyle")&&(o.fontStyle=e.fontStyle),(0,eB.RI)(e,"fontWeight")&&(o.fontWeight=e.fontWeight),i={type:"text",style:o,silent:!0},r={};var a=(0,eB.RI)(e,"textPosition");n?r.position=a?e.textPosition:"inside":a&&(r.position=e.textPosition),(0,eB.RI)(e,"textPosition")&&(r.position=e.textPosition),(0,eB.RI)(e,"textOffset")&&(r.offset=e.textOffset),(0,eB.RI)(e,"textRotation")&&(r.rotation=e.textRotation),(0,eB.RI)(e,"textDistance")&&(r.distance=e.textDistance)}return nl(o,e),(0,eB.S6)(o.rich,function(e){nl(e,e)}),{textConfig:r,textContent:i}}(a,s,!t);!l&&d.textConfig&&(l=d.textConfig),!c&&d.textContent&&(c=d.textContent)}if(!t&&c){var h=c;h.type||(h.type="text")}var p=t?n[t]:n.normal;p.cfg=l,p.conOpt=c}function nY(e,t){return t?e?e[t]:null:e}function nX(e,t,n){var r=t&&t.style;return null==r&&n===nP&&e&&(r=e.styleEmphasis),r}function nJ(e,t){var n=e&&e.name;return null!=n?n:"e\0\0"+t}function nQ(e,t){var n=this.context,r=null!=e?n.newChildren[e]:null,i=null!=t?n.oldChildren[t]:null;nG(n.api,i,n.dataIndex,r,n.seriesModel,n.group)}function n0(e){var t=this.context,n=t.oldChildren[e];n&&nx(n,t9(n).option,t.seriesModel)}function n1(e){return e&&(e.pathData||e.d)}var n2=n(8480),n5=n(7806);(0,ej.D)([tP.N,n2.N,n5.N,t3.N,function(e){e.registerChartView(nz),e.registerSeriesModel(t7)},tI.N,tR.N,tO.N,tE.N]);let n3=["click","dblclick","mousedown","mousemove","mouseup","mouseover","mouseout","globalout","contextmenu"],n4=["datazoom","downplay","highlight"],n6=(0,g.memo)(function({option:e,theme:t,renderer:n,sx:r,style:i,onEvents:o,_instance:a,syncGroup:s,onChartInitialized:l}){let u=(0,g.useRef)(e),c=(0,g.useRef)(e),d=(0,g.useRef)(null),h=(0,g.useRef)(null);return(0,g.useLayoutEffect)(()=>{if(null!==d.current&&null===h.current&&(h.current=(0,tQ.S1)(d.current,t,{renderer:n??"canvas"}),void 0!==h.current))return h.current.setOption(u.current,!0),l?.(h.current),void 0!==a&&(a.current=h.current),()=>{null!==h.current&&(h.current.dispose(),h.current=null)}},[a,l,t,n]),(0,g.useEffect)(()=>{h.current&&s&&(h.current.group=s,(0,tQ.$j)([h.current]))},[s,h]),(0,g.useEffect)(()=>{!(void 0===c.current||t1()(c.current,e))&&h.current&&(h.current.setOption(e,!0),c.current=e)},[e]),(0,g.useLayoutEffect)(()=>{let e=t5()(()=>{h.current&&h.current.resize()},200);return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[]),(0,g.useEffect)(()=>{let e=h.current;if(e&&void 0!==o)return function(e,t){if(void 0!==t){for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n]??null;r&&function(t,n){var r,i;"function"==typeof n&&((r=t,n3.includes(r))?e.on(t,t=>n(t,e)):(i=t,n4.includes(i))?e.on(t,e=>n(e)):e.on(t,()=>n(null,e)))}(n,r)}}}(e,o),()=>{if(void 0!==e&&!0!==e.isDisposed())for(let t in o)e.off(t)}},[o]),(0,g.useEffect)(()=>{t5()(()=>{h.current&&h.current.resize()},200,{leading:!0})()},[r,i]),(0,f.jsx)(tU,{ref:d,sx:r,style:i})});var n8=n(5409),n9=n.n(n8);function n7(e,t){return[n9()({type:"value",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>(0,eZ.Bw)(e,t)}},e)]}function re(e){if(0===e.length)return 36e5;let t=e[e.length-1];return void 0===e[0]||void 0===t?36e5:t-e[0]}function rt(e){let{width:t,height:n,data:r,format:i={unit:"decimal"},mode:o="value"}=e,a=tJ(),s=(0,g.useMemo)(()=>{if(!r||!r.length)return a.noDataOption;let e=[];return r.map(t=>{e.push([t.label,t.value])}),{title:{show:!1},dataset:[{dimensions:["label","value"],source:e}],xAxis:n7({},i),yAxis:{type:"category",splitLine:{show:!1},axisLabel:{overflow:"truncate",width:t/3}},series:{type:"bar",label:{show:!0,position:"right",formatter:e=>e.data[1]?"percentage"===o?(0,eZ.Bw)(e.data[1],{unit:"percent",decimalPlaces:i.decimalPlaces}):(0,eZ.Bw)(e.data[1],i):void 0,barMinWidth:14,barCategoryGap:6},itemStyle:{borderRadius:4,color:a.echartsTheme[0]}},tooltip:{appendToBody:!0,confine:!0,formatter:e=>e.data[1]&&`<b>${e.name}</b> &emsp; ${(0,eZ.Bw)(e.data[1],i)}`},grid:{left:"5%",right:"5%"}}},[r,a,t,o,i]);return(0,f.jsx)(tU,{style:{width:t,height:n},sx:{overflow:"auto"},children:(0,f.jsx)(n6,{sx:{minHeight:n,height:r?20*r.length:"100%"},option:s,theme:a.echartsTheme})})}(0,ej.D)([tA,tI.N,tP.N,tR.N,tO.N,tE.N]);var rn=n(5315);let rr=(0,rn.ZP)();function ri(e){let{theme:t,name:n,props:r}=e;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,_.Z)(t.components[n].defaultProps,r):r}function ro({props:e,name:t,defaultTheme:n,themeId:r}){let i=t$(n);return r&&(i=i[r]||i),ri({theme:i,name:t,props:e})}var ra=n(3890),rs=n(2664);let rl=(0,tB.Z)(),ru=rr("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function rc(e){return ro({props:e,name:"MuiStack",defaultTheme:rl})}let rd=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],rh=({ownerState:e,theme:t})=>{let n={display:"flex",flexDirection:"column",...(0,ra.k9)({theme:t},(0,ra.P$)({values:e.direction,breakpoints:t.breakpoints.values}),e=>({flexDirection:e}))};if(e.spacing){let r=(0,rs.hB)(t),i=Object.keys(t.breakpoints.values).reduce((t,n)=>(("object"==typeof e.spacing&&null!=e.spacing[n]||"object"==typeof e.direction&&null!=e.direction[n])&&(t[n]=!0),t),{}),o=(0,ra.P$)({values:e.direction,base:i}),a=(0,ra.P$)({values:e.spacing,base:i});"object"==typeof o&&Object.keys(o).forEach((e,t,n)=>{if(!o[e]){let r=t>0?o[n[t-1]]:"column";o[e]=r}}),n=(0,t_.Z)(n,(0,ra.k9)({theme:t},a,(t,n)=>e.useFlexGap?{gap:(0,rs.NA)(r,t)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${rd(n?o[n]:e.direction)}`]:(0,rs.NA)(r,t)}}))}return(0,ra.dt)(t.breakpoints,n)};function rp(e={}){let{createStyledComponent:t=ru,useThemeProps:n=rc,componentName:r="MuiStack"}=e,i=()=>(0,y.Z)({root:["root"]},e=>(0,A.ZP)(r,e),{}),o=t(rh);return g.forwardRef(function(e,t){let{component:r="div",direction:a="column",spacing:s=0,divider:l,children:u,className:c,useFlexGap:d=!1,...h}=tj(n(e)),p=i();return(0,f.jsx)(o,{as:r,ownerState:{direction:a,spacing:s,useFlexGap:d},ref:t,className:(0,v.Z)(p.root,c),...h,children:l?function(e,t){let n=g.Children.toArray(e).filter(Boolean);return n.reduce((e,r,i)=>(e.push(r),i<n.length-1&&e.push(g.cloneElement(t,{key:`separator-${i}`})),e),[])}(u,l):u})})}let rf=rp({createStyledComponent:(0,S.ZP)("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>(0,M.i)({props:e,name:"MuiStack"})});function rg(e){return(0,A.ZP)("MuiIconButton",e)}let rm=(0,T.Z)("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),rv=e=>{let{classes:t,disabled:n,color:r,edge:i,size:o,loading:a}=e,s={root:["root",a&&"loading",n&&"disabled","default"!==r&&`color${(0,w.Z)(r)}`,i&&`edge${(0,w.Z)(i)}`,`size${(0,w.Z)(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return(0,y.Z)(s,rg,t)},ry=(0,S.ZP)(ef,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.loading&&t.loading,"default"!==n.color&&t[`color${(0,w.Z)(n.color)}`],n.edge&&t[`edge${(0,w.Z)(n.edge)}`],t[`size${(0,w.Z)(n.size)}`]]}})((0,C.Z)(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette.action.active,e.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),(0,C.Z)(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(k()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(k()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)((e.vars||e).palette[t].main,e.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${rm.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${rm.loading}`]:{color:"transparent"}}))),rb=(0,S.ZP)("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),rx=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiIconButton"}),{edge:r=!1,children:i,className:o,color:a="default",disabled:s=!1,disableFocusRipple:l=!1,size:u="medium",id:c,loading:d=null,loadingIndicator:h,...p}=n,g=(0,N.Z)(c),m=h??(0,f.jsx)(eM,{"aria-labelledby":g,color:"inherit",size:16}),y={...n,edge:r,color:a,disabled:s,disableFocusRipple:l,loading:d,loadingIndicator:m,size:u},b=rv(y);return(0,f.jsxs)(ry,{id:d?g:c,className:(0,v.Z)(b.root,o),centerRipple:!0,focusRipple:!l,disabled:s||d,ref:t,...p,ownerState:y,children:["boolean"==typeof d&&(0,f.jsx)("span",{className:b.loadingWrapper,style:{display:"contents"},children:(0,f.jsx)(rb,{className:b.loadingIndicator,ownerState:y,children:d&&m})}),i]})});var rw=n(5056),rS=n(2220),rC=n(7048),rk=n(3205),rM=n(1925),rT=n(6858),rA=n(4384);function rI(e){return parseInt(e,10)||0}let rP={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};function rR(e){return function(e){for(let t in e)return!1;return!0}(e)||0===e.outerHeightStyle&&!e.overflowing}let rO=g.forwardRef(function(e,t){let{onChange:n,maxRows:r,minRows:i=1,style:o,value:a,...s}=e,{current:l}=g.useRef(null!=a),u=g.useRef(null),c=(0,rC.Z)(t,u),d=g.useRef(null),h=g.useRef(null),p=g.useCallback(()=>{let t=u.current,n=h.current;if(!t||!n)return;let o=(0,rk.Z)(t).getComputedStyle(t);if("0px"===o.width)return{outerHeightStyle:0,overflowing:!1};n.style.width=o.width,n.value=t.value||e.placeholder||"x","\n"===n.value.slice(-1)&&(n.value+=" ");let a=o.boxSizing,s=rI(o.paddingBottom)+rI(o.paddingTop),l=rI(o.borderBottomWidth)+rI(o.borderTopWidth),c=n.scrollHeight;n.value="x";let d=n.scrollHeight,p=c;return i&&(p=Math.max(Number(i)*d,p)),r&&(p=Math.min(Number(r)*d,p)),{outerHeightStyle:(p=Math.max(p,d))+("border-box"===a?s+l:0),overflowing:1>=Math.abs(p-c)}},[r,i,e.placeholder]),m=(0,rM.Z)(()=>{let e=u.current,t=p();if(!e||!t||rR(t))return!1;let n=t.outerHeightStyle;return null!=d.current&&d.current!==n}),v=g.useCallback(()=>{let e=u.current,t=p();if(!e||!t||rR(t))return;let n=t.outerHeightStyle;d.current!==n&&(d.current=n,e.style.height=`${n}px`),e.style.overflow=t.overflowing?"hidden":""},[p]),y=g.useRef(-1);return(0,rT.Z)(()=>{let e;let t=(0,rA.Z)(v),n=u?.current;if(!n)return;let r=(0,rk.Z)(n);return r.addEventListener("resize",t),"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(()=>{m()&&(e.unobserve(n),cancelAnimationFrame(y.current),v(),y.current=requestAnimationFrame(()=>{e.observe(n)}))})).observe(n),()=>{t.clear(),cancelAnimationFrame(y.current),r.removeEventListener("resize",t),e&&e.disconnect()}},[p,v,m]),(0,rT.Z)(()=>{v()}),(0,f.jsxs)(g.Fragment,{children:[(0,f.jsx)("textarea",{value:a,onChange:e=>{l||v(),n&&n(e)},ref:c,rows:i,style:o,...s}),(0,f.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:h,tabIndex:-1,style:{...rP,...o,paddingTop:0,paddingBottom:0}})]})}),rE=function(e){return"string"==typeof e};function rD({props:e,states:t,muiFormControl:n}){return t.reduce((t,r)=>(t[r]=e[r],n&&void 0===e[r]&&(t[r]=n[r]),t),{})}let rL=g.createContext(void 0);function r_(){return g.useContext(rL)}function rN(e){let{styles:t,defaultTheme:n={}}=e,r="function"==typeof t?e=>t(null==e||0===Object.keys(e).length?n:e):t;return(0,f.jsx)(en.Global,{styles:r})}let rZ=function({styles:e,themeId:t,defaultTheme:n={}}){let r=t$(n),i="function"==typeof e?e(t&&r[t]||r):e;return(0,f.jsx)(rN,{styles:i})};var rj=n(3126);let rB=function(e){return(0,f.jsx)(rZ,{...e,defaultTheme:rj.Z,themeId:tW.Z})};var rF=n(6758);function rz(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function r$(e,t=!1){return e&&(rz(e.value)&&""!==e.value||t&&rz(e.defaultValue)&&""!==e.defaultValue)}function rV(e){return(0,A.ZP)("MuiInputBase",e)}let rH=(0,T.Z)("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),rW=(e,t)=>{let{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,"small"===n.size&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${(0,w.Z)(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},rq=(e,t)=>{let{ownerState:n}=e;return[t.input,"small"===n.size&&t.inputSizeSmall,n.multiline&&t.inputMultiline,"search"===n.type&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},rG=e=>{let{classes:t,color:n,disabled:r,error:i,endAdornment:o,focused:a,formControl:s,fullWidth:l,hiddenLabel:u,multiline:c,readOnly:d,size:h,startAdornment:p,type:f}=e,g={root:["root",`color${(0,w.Z)(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",a&&"focused",s&&"formControl",h&&"medium"!==h&&`size${(0,w.Z)(h)}`,c&&"multiline",p&&"adornedStart",o&&"adornedEnd",u&&"hiddenLabel",d&&"readOnly"],input:["input",r&&"disabled","search"===f&&"inputTypeSearch",c&&"inputMultiline","small"===h&&"inputSizeSmall",u&&"inputHiddenLabel",p&&"inputAdornedStart",o&&"inputAdornedEnd",d&&"readOnly"]};return(0,y.Z)(g,rV,t)},rU=(0,S.ZP)("div",{name:"MuiInputBase",slot:"Root",overridesResolver:rW})((0,C.Z)(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${rH.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:e,size:t})=>e.multiline&&"small"===t,style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:"100%"}}]}))),rK=(0,S.ZP)("input",{name:"MuiInputBase",slot:"Input",overridesResolver:rq})((0,C.Z)(({theme:e})=>{let t="light"===e.palette.mode,n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${rH.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${rH.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:e})=>!e.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:e})=>e.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),rY=(aA={"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}},function(e){return(0,f.jsx)(rB,{styles:"function"==typeof aA?t=>aA({theme:t,...e}):aA})}),rX=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiInputBase"}),{"aria-describedby":r,autoComplete:i,autoFocus:o,className:a,color:s,components:l={},componentsProps:u={},defaultValue:c,disabled:d,disableInjectingGlobalStyles:h,endAdornment:p,error:m,fullWidth:y=!1,id:b,inputComponent:x="input",inputProps:w={},inputRef:S,margin:C,maxRows:k,minRows:T,multiline:A=!1,name:I,onBlur:P,onChange:R,onClick:O,onFocus:E,onKeyDown:D,onKeyUp:L,placeholder:_,readOnly:N,renderSuffix:Z,rows:j,size:F,slotProps:z={},slots:$={},startAdornment:V,type:H="text",value:W,...q}=n,G=null!=w.value?w.value:W,{current:U}=g.useRef(null!=G),K=g.useRef(),Y=g.useCallback(e=>{},[]),X=(0,B.Z)(K,S,w.ref,Y),[J,Q]=g.useState(!1),ee=r_(),et=rD({props:n,muiFormControl:ee,states:["color","disabled","error","hiddenLabel","size","required","filled"]});et.focused=ee?ee.focused:J,g.useEffect(()=>{!ee&&d&&J&&(Q(!1),P&&P())},[ee,d,J,P]);let en=ee&&ee.onFilled,er=ee&&ee.onEmpty,ei=g.useCallback(e=>{r$(e)?en&&en():er&&er()},[en,er]);(0,rF.Z)(()=>{U&&ei({value:G})},[G,ei,U]),g.useEffect(()=>{ei(K.current)},[]);let eo=x,ea=w;A&&"input"===eo&&(ea=j?{type:void 0,minRows:j,maxRows:j,...ea}:{type:void 0,maxRows:k,minRows:T,...ea},eo=rO),g.useEffect(()=>{ee&&ee.setAdornedStart(!!V)},[ee,V]);let es={...n,color:et.color||"primary",disabled:et.disabled,endAdornment:p,error:et.error,focused:et.focused,formControl:ee,fullWidth:y,hiddenLabel:et.hiddenLabel,multiline:A,size:et.size,startAdornment:V,type:H},el=rG(es),eu=$.root||l.Root||rU,ec=z.root||u.root||{},ed=$.input||l.Input||rK;return ea={...ea,...z.input??u.input},(0,f.jsxs)(g.Fragment,{children:[!h&&"function"==typeof rY&&(aI||(aI=(0,f.jsx)(rY,{}))),(0,f.jsxs)(eu,{...ec,ref:t,onClick:e=>{K.current&&e.currentTarget===e.target&&K.current.focus(),O&&O(e)},...q,...!rE(eu)&&{ownerState:{...es,...ec.ownerState}},className:(0,v.Z)(el.root,ec.className,a,N&&"MuiInputBase-readOnly"),children:[V,(0,f.jsx)(rL.Provider,{value:null,children:(0,f.jsx)(ed,{"aria-invalid":et.error,"aria-describedby":r,autoComplete:i,autoFocus:o,defaultValue:c,disabled:et.disabled,id:b,onAnimationStart:e=>{ei("mui-auto-fill-cancel"===e.animationName?K.current:{value:"x"})},name:I,placeholder:_,readOnly:N,required:et.required,rows:j,value:G,onKeyDown:D,onKeyUp:L,type:H,...ea,...!rE(ed)&&{as:eo,ownerState:{...es,...ea.ownerState}},ref:X,className:(0,v.Z)(el.input,ea.className,N&&"MuiInputBase-readOnly"),onBlur:e=>{P&&P(e),w.onBlur&&w.onBlur(e),ee&&ee.onBlur?ee.onBlur(e):Q(!1)},onChange:(e,...t)=>{if(!U){let t=e.target||K.current;if(null==t)throw Error((0,rS.Z)(1));ei({value:t.value})}w.onChange&&w.onChange(e,...t),R&&R(e,...t)},onFocus:e=>{E&&E(e),w.onFocus&&w.onFocus(e),ee&&ee.onFocus?ee.onFocus(e):Q(!0)}})}),p,Z?Z({...et,startAdornment:V}):null]})]})});function rJ(e){return(0,A.ZP)("MuiInput",e)}let rQ={...rH,...(0,T.Z)("MuiInput",["root","underline","input"])},r0=e=>{let{classes:t,disableUnderline:n}=e,r=(0,y.Z)({root:["root",!n&&"underline"],input:["input"]},rJ,t);return{...t,...r}},r1=(0,S.ZP)(rU,{shouldForwardProp:e=>(0,Z.Z)(e)||"classes"===e,name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...rW(e,t),!n.disableUnderline&&t.underline]}})((0,C.Z)(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:e})=>e.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:e})=>!e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${rQ.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${rQ.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${rQ.disabled}, .${rQ.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${rQ.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(k()).map(([t])=>({props:{color:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}}))]}})),r2=(0,S.ZP)(rK,{name:"MuiInput",slot:"Input",overridesResolver:rq})({}),r5=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiInput"}),{disableUnderline:r=!1,components:i={},componentsProps:o,fullWidth:a=!1,inputComponent:s="input",multiline:l=!1,slotProps:u,slots:c={},type:d="text",...h}=n,p=r0(n),g={root:{ownerState:{disableUnderline:r}}},m=u??o?(0,t_.Z)(u??o,g):g,v=c.root??i.Root??r1,y=c.input??i.Input??r2;return(0,f.jsx)(rX,{slots:{root:v,input:y},slotProps:m,fullWidth:a,inputComponent:s,multiline:l,ref:t,type:d,...h,classes:p})});function r3(e){return(0,A.ZP)("MuiFilledInput",e)}r5.muiName="Input";let r4={...rH,...(0,T.Z)("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},r6=e=>{let{classes:t,disableUnderline:n,startAdornment:r,endAdornment:i,size:o,hiddenLabel:a,multiline:s}=e,l={root:["root",!n&&"underline",r&&"adornedStart",i&&"adornedEnd","small"===o&&`size${(0,w.Z)(o)}`,a&&"hiddenLabel",s&&"multiline"],input:["input"]},u=(0,y.Z)(l,r3,t);return{...t,...u}},r8=(0,S.ZP)(rU,{shouldForwardProp:e=>(0,Z.Z)(e)||"classes"===e,name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...rW(e,t),!n.disableUnderline&&t.underline]}})((0,C.Z)(({theme:e})=>{let t="light"===e.palette.mode,n=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n}},[`&.${r4.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n},[`&.${r4.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"},variants:[{props:({ownerState:e})=>!e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${r4.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${r4.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)"}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${r4.disabled}, .${r4.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${r4.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(k()).map(([t])=>({props:{disableUnderline:!1,color:t},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.main}`}}})),{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:12}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:12}},{props:({ownerState:e})=>e.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:e,size:t})=>e.multiline&&"small"===t,style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.multiline&&e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.multiline&&e.hiddenLabel&&"small"===e.size,style:{paddingTop:8,paddingBottom:9}}]}})),r9=(0,S.ZP)(rK,{name:"MuiFilledInput",slot:"Input",overridesResolver:rq})((0,C.Z)(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.mode?null:"#fff",caretColor:"light"===e.palette.mode?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}},{props:({ownerState:e})=>e.hiddenLabel&&"small"===e.size,style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:e})=>e.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),r7=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiFilledInput"}),{disableUnderline:r=!1,components:i={},componentsProps:o,fullWidth:a=!1,hiddenLabel:s,inputComponent:l="input",multiline:u=!1,slotProps:c,slots:d={},type:h="text",...p}=n,g={...n,disableUnderline:r,fullWidth:a,inputComponent:l,multiline:u,type:h},m=r6(n),v={root:{ownerState:g},input:{ownerState:g}},y=c??o?(0,t_.Z)(v,c??o):v,b=d.root??i.Root??r8,x=d.input??i.Input??r9;return(0,f.jsx)(rX,{slots:{root:b,input:x},slotProps:y,fullWidth:a,inputComponent:l,multiline:u,ref:t,type:h,...p,classes:m})});r7.muiName="Input";let ie=(0,S.ZP)("fieldset",{shouldForwardProp:Z.Z})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),it=(0,S.ZP)("legend",{shouldForwardProp:Z.Z})((0,C.Z)(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:e})=>!e.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:e})=>e.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:e})=>e.withLabel&&e.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function ir(e){return(0,A.ZP)("MuiOutlinedInput",e)}let ii={...rH,...(0,T.Z)("MuiOutlinedInput",["root","notchedOutline","input"])},io=e=>{let{classes:t}=e,n=(0,y.Z)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},ir,t);return{...t,...n}},ia=(0,S.ZP)(rU,{shouldForwardProp:e=>(0,Z.Z)(e)||"classes"===e,name:"MuiOutlinedInput",slot:"Root",overridesResolver:rW})((0,C.Z)(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${ii.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${ii.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${ii.focused} .${ii.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(k()).map(([t])=>({props:{color:t},style:{[`&.${ii.focused} .${ii.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${ii.error} .${ii.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${ii.disabled} .${ii.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:14}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:14}},{props:({ownerState:e})=>e.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:e,size:t})=>e.multiline&&"small"===t,style:{padding:"8.5px 14px"}}]}})),is=(0,S.ZP)(function(e){let{children:t,classes:n,className:r,label:i,notched:o,...a}=e,s=null!=i&&""!==i,l={...e,notched:o,withLabel:s};return(0,f.jsx)(ie,{"aria-hidden":!0,className:r,ownerState:l,...a,children:(0,f.jsx)(it,{ownerState:l,children:s?(0,f.jsx)("span",{children:i}):aP||(aP=(0,f.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})},{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})((0,C.Z)(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}})),il=(0,S.ZP)(rK,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:rq})((0,C.Z)(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.mode?null:"#fff",caretColor:"light"===e.palette.mode?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:e})=>e.multiline,style:{padding:0}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}}]}))),iu=g.forwardRef(function(e,t){var n;let r=(0,M.i)({props:e,name:"MuiOutlinedInput"}),{components:i={},fullWidth:o=!1,inputComponent:a="input",label:s,multiline:l=!1,notched:u,slots:c={},type:d="text",...h}=r,p=io(r),m=r_(),v=rD({props:r,muiFormControl:m,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),y={...r,color:v.color||"primary",disabled:v.disabled,error:v.error,focused:v.focused,formControl:m,fullWidth:o,hiddenLabel:v.hiddenLabel,multiline:l,size:v.size,type:d},b=c.root??i.Root??ia,x=c.input??i.Input??il;return(0,f.jsx)(rX,{slots:{root:b,input:x},renderSuffix:e=>(0,f.jsx)(is,{ownerState:y,className:p.notchedOutline,label:null!=s&&""!==s&&v.required?n||(n=(0,f.jsxs)(g.Fragment,{children:[s," ","*"]})):s,notched:void 0!==u?u:!!(e.startAdornment||e.filled||e.focused)}),fullWidth:o,inputComponent:a,multiline:l,ref:t,type:d,...h,classes:{...p,notchedOutline:null}})});function ic(e){return(0,A.ZP)("MuiFormLabel",e)}iu.muiName="Input";let id=(0,T.Z)("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),ih=e=>{let{classes:t,color:n,focused:r,disabled:i,error:o,filled:a,required:s}=e,l={root:["root",`color${(0,w.Z)(n)}`,i&&"disabled",o&&"error",a&&"filled",r&&"focused",s&&"required"],asterisk:["asterisk",o&&"error"]};return(0,y.Z)(l,ic,t)},ip=(0,S.ZP)("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,"secondary"===n.color&&t.colorSecondary,n.filled&&t.filled]}})((0,C.Z)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(k()).map(([t])=>({props:{color:t},style:{[`&.${id.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${id.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${id.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),ig=(0,S.ZP)("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})((0,C.Z)(({theme:e})=>({[`&.${id.error}`]:{color:(e.vars||e).palette.error.main}}))),im=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiFormLabel"}),{children:r,className:i,color:o,component:a="label",disabled:s,error:l,filled:u,focused:c,required:d,...h}=n,p=rD({props:n,muiFormControl:r_(),states:["color","required","focused","disabled","error","filled"]}),g={...n,color:p.color||"primary",component:a,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required},m=ih(g);return(0,f.jsxs)(ip,{as:a,ownerState:g,className:(0,v.Z)(m.root,i),ref:t,...h,children:[r,p.required&&(0,f.jsxs)(ig,{ownerState:g,"aria-hidden":!0,className:m.asterisk,children:[" ","*"]})]})});function iv(e){return(0,A.ZP)("MuiInputLabel",e)}(0,T.Z)("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);let iy=e=>{let{classes:t,formControl:n,size:r,shrink:i,disableAnimation:o,variant:a,required:s}=e,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&"normal"!==r&&`size${(0,w.Z)(r)}`,a],asterisk:[s&&"asterisk"]},u=(0,y.Z)(l,iv,t);return{...t,...u}},ib=(0,S.ZP)(im,{shouldForwardProp:e=>(0,Z.Z)(e)||"classes"===e,name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${id.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,"small"===n.size&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})((0,C.Z)(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:e})=>e.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:e})=>e.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:e,ownerState:t})=>"filled"===e&&t.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:e,ownerState:t,size:n})=>"filled"===e&&t.shrink&&"small"===n,style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:e,ownerState:t})=>"outlined"===e&&t.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),ix=g.forwardRef(function(e,t){let n=(0,M.i)({name:"MuiInputLabel",props:e}),{disableAnimation:r=!1,margin:i,shrink:o,variant:a,className:s,...l}=n,u=r_(),c=o;void 0===c&&u&&(c=u.filled||u.focused||u.adornedStart);let d=rD({props:n,muiFormControl:u,states:["size","variant","required","focused"]}),h={...n,disableAnimation:r,formControl:u,shrink:c,size:d.size,variant:d.variant,required:d.required,focused:d.focused},p=iy(h);return(0,f.jsx)(ib,{"data-shrink":c,ref:t,className:(0,v.Z)(p.root,s),...l,ownerState:h,classes:p})});var iw=n(777);function iS(e){return(0,A.ZP)("MuiFormControl",e)}(0,T.Z)("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);let iC=e=>{let{classes:t,margin:n,fullWidth:r}=e,i={root:["root","none"!==n&&`margin${(0,w.Z)(n)}`,r&&"fullWidth"]};return(0,y.Z)(i,iS,t)},ik=(0,S.ZP)("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`margin${(0,w.Z)(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),iM=g.forwardRef(function(e,t){let n;let r=(0,M.i)({props:e,name:"MuiFormControl"}),{children:i,className:o,color:a="primary",component:s="div",disabled:l=!1,error:u=!1,focused:c,fullWidth:d=!1,hiddenLabel:h=!1,margin:p="none",required:m=!1,size:y="medium",variant:b="outlined",...x}=r,w={...r,color:a,component:s,disabled:l,error:u,fullWidth:d,hiddenLabel:h,margin:p,required:m,size:y,variant:b},S=iC(w),[C,k]=g.useState(()=>{let e=!1;return i&&g.Children.forEach(i,t=>{if(!(0,iw.Z)(t,["Input","Select"]))return;let n=(0,iw.Z)(t,["Select"])?t.props.input:t;n&&n.props.startAdornment&&(e=!0)}),e}),[T,A]=g.useState(()=>{let e=!1;return i&&g.Children.forEach(i,t=>{(0,iw.Z)(t,["Input","Select"])&&(r$(t.props,!0)||r$(t.props.inputProps,!0))&&(e=!0)}),e}),[I,P]=g.useState(!1);l&&I&&P(!1);let R=void 0===c||l?I:c;g.useRef(!1);let O=g.useCallback(()=>{A(!0)},[]),E=g.useCallback(()=>{A(!1)},[]),D=g.useMemo(()=>({adornedStart:C,setAdornedStart:k,color:a,disabled:l,error:u,filled:T,focused:R,fullWidth:d,hiddenLabel:h,size:y,onBlur:()=>{P(!1)},onFocus:()=>{P(!0)},onEmpty:E,onFilled:O,registerEffect:n,required:m,variant:b}),[C,a,l,u,T,R,d,h,n,E,O,m,y,b]);return(0,f.jsx)(rL.Provider,{value:D,children:(0,f.jsx)(ik,{as:s,ownerState:w,className:(0,v.Z)(S.root,o),ref:t,...x,children:i})})});function iT(e){return(0,A.ZP)("MuiFormHelperText",e)}let iA=(0,T.Z)("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),iI=e=>{let{classes:t,contained:n,size:r,disabled:i,error:o,filled:a,focused:s,required:l}=e,u={root:["root",i&&"disabled",o&&"error",r&&`size${(0,w.Z)(r)}`,n&&"contained",s&&"focused",a&&"filled",l&&"required"]};return(0,y.Z)(u,iT,t)},iP=(0,S.ZP)("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.size&&t[`size${(0,w.Z)(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})((0,C.Z)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${iA.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${iA.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),iR=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiFormHelperText"}),{children:r,className:i,component:o="p",disabled:a,error:s,filled:l,focused:u,margin:c,required:d,variant:h,...p}=n,g=rD({props:n,muiFormControl:r_(),states:["variant","size","disabled","error","filled","focused","required"]}),m={...n,component:o,contained:"filled"===g.variant||"outlined"===g.variant,variant:g.variant,size:g.size,disabled:g.disabled,error:g.error,filled:g.filled,focused:g.focused,required:g.required};delete m.ownerState;let y=iI(m);return(0,f.jsx)(iP,{as:o,className:(0,v.Z)(y.root,i),ref:t,...p,ownerState:m,children:" "===r?aR||(aR=(0,f.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"​"})):r})});function iO(e){return parseInt(g.version,10)>=19?e?.props?.ref||null:e?.ref||null}var iE=n(2444);let iD=g.createContext(),iL=()=>g.useContext(iD)??!1,i_=function(e,t,n){return void 0===e||"string"==typeof e?t:{...t,ownerState:{...t.ownerState,...n}}},iN=function(e,t=[]){if(void 0===e)return{};let n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n},iZ=function(e){if(void 0===e)return{};let t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t])).forEach(n=>{t[n]=e[n]}),t},ij=function(e){let{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){let e=(0,v.Z)(n?.className,o,i?.className,r?.className),t={...n?.style,...i?.style,...r?.style},a={...n,...i,...r};return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}let a=iN({...i,...r}),s=iZ(r),l=iZ(i),u=t(a),c=(0,v.Z)(u?.className,n?.className,o,i?.className,r?.className),d={...u?.style,...n?.style,...i?.style,...r?.style},h={...u,...n,...l,...s};return c.length>0&&(h.className=c),Object.keys(d).length>0&&(h.style=d),{props:h,internalRef:u.ref}},iB=function(e,t,n){return"function"==typeof e?e(t,n):e},iF=function(e){let{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=e,a=i?{}:iB(n,r),{props:s,internalRef:l}=ij({...o,externalSlotProps:a}),u=(0,rC.Z)(l,a?.ref,e.additionalProps?.ref);return i_(t,{...s,ref:u},r)},iz=g.createContext({});function i$(e){return(0,A.ZP)("MuiList",e)}(0,T.Z)("MuiList",["root","padding","dense","subheader"]);let iV=e=>{let{classes:t,disablePadding:n,dense:r,subheader:i}=e;return(0,y.Z)({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},i$,t)},iH=(0,S.ZP)("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),iW=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiList"}),{children:r,className:i,component:o="ul",dense:a=!1,disablePadding:s=!1,subheader:l,...u}=n,c=g.useMemo(()=>({dense:a}),[a]),d={...n,component:o,dense:a,disablePadding:s},h=iV(d);return(0,f.jsx)(iz.Provider,{value:c,children:(0,f.jsxs)(iH,{as:o,className:(0,v.Z)(h.root,i),ref:t,ownerState:d,...u,children:[l,r]})})});function iq(e=window){let t=e.document.documentElement.clientWidth;return e.innerWidth-t}var iG=n(4255);function iU(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function iK(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function iY(e,t){if(void 0===t)return!0;let n=e.innerText;return void 0===n&&(n=e.textContent),0!==(n=n.trim().toLowerCase()).length&&(t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join("")))}function iX(e,t,n,r,i,o){let a=!1,s=i(e,t,!!t&&n);for(;s;){if(s===e.firstChild){if(a)return!1;a=!0}let t=!r&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&iY(s,o)&&!t)return s.focus(),!0;s=i(e,s,n)}return!1}let iJ=g.forwardRef(function(e,t){let{actions:n,autoFocus:r=!1,autoFocusItem:i=!1,children:o,className:a,disabledItemsFocusable:s=!1,disableListWrap:l=!1,onKeyDown:u,variant:c="selectedMenu",...d}=e,h=g.useRef(null),p=g.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});(0,rF.Z)(()=>{r&&h.current.focus()},[r]),g.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(e,{direction:t})=>{let n=!h.current.style.width;if(e.clientHeight<h.current.clientHeight&&n){let n=`${iq((0,iG.Z)(e))}px`;h.current.style["rtl"===t?"paddingLeft":"paddingRight"]=n,h.current.style.width=`calc(100% + ${n})`}return h.current}}),[]);let m=(0,B.Z)(h,t),v=-1;g.Children.forEach(o,(e,t)=>{if(!g.isValidElement(e)){v===t&&(v+=1)>=o.length&&(v=-1);return}e.props.disabled||("selectedMenu"===c&&e.props.selected?v=t:-1!==v||(v=t)),v===t&&(e.props.disabled||e.props.muiSkipListHighlight||e.type.muiSkipListHighlight)&&(v+=1)>=o.length&&(v=-1)});let y=g.Children.map(o,(e,t)=>{if(t===v){let t={};return i&&(t.autoFocus=!0),void 0===e.props.tabIndex&&"selectedMenu"===c&&(t.tabIndex=0),g.cloneElement(e,t)}return e});return(0,f.jsx)(iW,{role:"menu",ref:m,className:a,onKeyDown:e=>{let t=h.current,n=e.key;if(e.ctrlKey||e.metaKey||e.altKey){u&&u(e);return}let r=(0,iE.Z)(t).activeElement;if("ArrowDown"===n)e.preventDefault(),iX(t,r,l,s,iU);else if("ArrowUp"===n)e.preventDefault(),iX(t,r,l,s,iK);else if("Home"===n)e.preventDefault(),iX(t,null,l,s,iU);else if("End"===n)e.preventDefault(),iX(t,null,l,s,iK);else if(1===n.length){let i=p.current,o=n.toLowerCase(),a=performance.now();i.keys.length>0&&(a-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&o!==i.keys[0]&&(i.repeating=!1)),i.lastTime=a,i.keys.push(o);let l=r&&!i.repeating&&iY(r,i);i.previousKeyMatched&&(l||iX(t,r,!1,s,iU,i))?e.preventDefault():i.previousKeyMatched=!1}u&&u(e)},tabIndex:r?0:-1,...d,children:y})});var iQ=n(7999),i0=n(6085),i1=n.n(i0);let i2={disabled:!1};var i5=function(e){return e.scrollTop},i3="unmounted",i4="exited",i6="entering",i8="entered",i9="exiting",i7=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=i4,r.appearStatus=i6):i=i8:i=t.unmountOnExit||t.mountOnEnter?i3:i4,r.state={status:i},r.nextCallback=null,r}G(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===i3?{status:i4}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==i6&&n!==i8&&(t=i6):(n===i6||n===i8)&&(t=i9)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){if(this.cancelNextCallback(),t===i6){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:i1().findDOMNode(this);n&&i5(n)}this.performEnter(e)}else this.performExit()}else this.props.unmountOnExit&&this.state.status===i4&&this.setState({status:i3})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[i1().findDOMNode(this),r],o=i[0],a=i[1],s=this.getTimeouts(),l=r?s.appear:s.enter;if(!e&&!n||i2.disabled){this.safeSetState({status:i8},function(){t.props.onEntered(o)});return}this.props.onEnter(o,a),this.safeSetState({status:i6},function(){t.props.onEntering(o,a),t.onTransitionEnd(l,function(){t.safeSetState({status:i8},function(){t.props.onEntered(o,a)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:i1().findDOMNode(this);if(!t||i2.disabled){this.safeSetState({status:i4},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:i9},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:i4},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:i1().findDOMNode(this),r=null==e&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],a=i[1];this.props.addEndListener(o,a)}null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===i3)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,H(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return m().createElement(U.Provider,{value:null},"function"==typeof n?n(e,r):m().cloneElement(m().Children.only(n),r))},t}(m().Component);function oe(){}function ot(){let e=t$(rj.Z);return e[tW.Z]||e}i7.contextType=U,i7.propTypes={},i7.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:oe,onEntering:oe,onEntered:oe,onExit:oe,onExiting:oe,onExited:oe},i7.UNMOUNTED=i3,i7.EXITED=i4,i7.ENTERING=i6,i7.ENTERED=i8,i7.EXITING=i9;let on=e=>e.scrollTop;function or(e,t){let{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??("number"==typeof n?n:n[t.mode]||0),easing:i.transitionTimingFunction??("object"==typeof r?r[t.mode]:r),delay:i.transitionDelay}}function oi(e){return`scale(${e}, ${e**2})`}let oo={entering:{opacity:1,transform:oi(1)},entered:{opacity:1,transform:"none"}},oa="undefined"!=typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),os=g.forwardRef(function(e,t){let{addEndListener:n,appear:r=!0,children:i,easing:o,in:a,onEnter:s,onEntered:l,onEntering:u,onExit:c,onExited:d,onExiting:h,style:p,timeout:m="auto",TransitionComponent:v=i7,...y}=e,b=et(),x=g.useRef(),w=ot(),S=g.useRef(null),C=(0,B.Z)(S,iO(i),t),k=e=>t=>{if(e){let n=S.current;void 0===t?e(n):e(n,t)}},M=k(u),T=k((e,t)=>{let n;on(e);let{duration:r,delay:i,easing:a}=or({style:p,timeout:m,easing:o},{mode:"enter"});"auto"===m?(n=w.transitions.getAutoHeightDuration(e.clientHeight),x.current=n):n=r,e.style.transition=[w.transitions.create("opacity",{duration:n,delay:i}),w.transitions.create("transform",{duration:oa?n:.666*n,delay:i,easing:a})].join(","),s&&s(e,t)}),A=k(l),I=k(h),P=k(e=>{let t;let{duration:n,delay:r,easing:i}=or({style:p,timeout:m,easing:o},{mode:"exit"});"auto"===m?(t=w.transitions.getAutoHeightDuration(e.clientHeight),x.current=t):t=n,e.style.transition=[w.transitions.create("opacity",{duration:t,delay:r}),w.transitions.create("transform",{duration:oa?t:.666*t,delay:oa?r:r||.333*t,easing:i})].join(","),e.style.opacity=0,e.style.transform=oi(.75),c&&c(e)}),R=k(d);return(0,f.jsx)(v,{appear:r,in:a,nodeRef:S,onEnter:T,onEntered:A,onEntering:M,onExit:P,onExited:R,onExiting:I,addEndListener:e=>{"auto"===m&&b.start(x.current||0,e),n&&n(S.current,e)},timeout:"auto"===m?null:m,...y,children:(e,{ownerState:t,...n})=>g.cloneElement(i,{style:{opacity:0,transform:oi(.75),visibility:"exited"!==e||a?void 0:"hidden",...oo[e],...p,...i.props.style},ref:C,...n})})});os&&(os.muiSupportAuto=!0);var ol=n(668);function ou(e){let t=[],n=[];return Array.from(e.querySelectorAll('input,select,textarea,a[href],button,[tabindex],audio[controls],video[controls],[contenteditable]:not([contenteditable="false"])')).forEach((e,r)=>{let i=function(e){let t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);!(-1===i||e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type||!e.name)return!1;let t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`),n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}(e))&&(0===i?t.push(e):n.push({documentOrder:r,tabIndex:i,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function oc(){return!0}let od=function(e){let{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=ou,isEnabled:a=oc,open:s}=e,l=g.useRef(!1),u=g.useRef(null),c=g.useRef(null),d=g.useRef(null),h=g.useRef(null),p=g.useRef(!1),m=g.useRef(null),v=(0,rC.Z)(iO(t),m),y=g.useRef(null);g.useEffect(()=>{s&&m.current&&(p.current=!n)},[n,s]),g.useEffect(()=>{if(!s||!m.current)return;let e=(0,ol.Z)(m.current);return!m.current.contains(e.activeElement)&&(m.current.hasAttribute("tabIndex")||m.current.setAttribute("tabIndex","-1"),p.current&&m.current.focus()),()=>{i||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[s]),g.useEffect(()=>{if(!s||!m.current)return;let e=(0,ol.Z)(m.current),t=t=>{y.current=t,!r&&a()&&"Tab"===t.key&&e.activeElement===m.current&&t.shiftKey&&(l.current=!0,c.current&&c.current.focus())},n=()=>{let t=m.current;if(null===t)return;if(!e.hasFocus()||!a()||l.current){l.current=!1;return}if(t.contains(e.activeElement)||r&&e.activeElement!==u.current&&e.activeElement!==c.current)return;if(e.activeElement!==h.current)h.current=null;else if(null!==h.current)return;if(!p.current)return;let n=[];if((e.activeElement===u.current||e.activeElement===c.current)&&(n=o(m.current)),n.length>0){let e=!!(y.current?.shiftKey&&y.current?.key==="Tab"),t=n[0],r=n[n.length-1];"string"!=typeof t&&"string"!=typeof r&&(e?r.focus():t.focus())}else t.focus()};e.addEventListener("focusin",n),e.addEventListener("keydown",t,!0);let i=setInterval(()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&n()},50);return()=>{clearInterval(i),e.removeEventListener("focusin",n),e.removeEventListener("keydown",t,!0)}},[n,r,i,a,s,o]);let b=e=>{null===d.current&&(d.current=e.relatedTarget),p.current=!0};return(0,f.jsxs)(g.Fragment,{children:[(0,f.jsx)("div",{tabIndex:s?0:-1,onFocus:b,ref:u,"data-testid":"sentinelStart"}),g.cloneElement(t,{ref:v,onFocus:e=>{null===d.current&&(d.current=e.relatedTarget),p.current=!0,h.current=e.target;let n=t.props.onFocus;n&&n(e)}}),(0,f.jsx)("div",{tabIndex:s?0:-1,onFocus:b,ref:c,"data-testid":"sentinelEnd"})]})};var oh=n(5817);let op=g.forwardRef(function(e,t){let{children:n,container:r,disablePortal:i=!1}=e,[o,a]=g.useState(null),s=(0,rC.Z)(g.isValidElement(n)?iO(n):null,t);return((0,rT.Z)(()=>{if(!i)a(("function"==typeof r?r():r)||document.body)},[r,i]),(0,rT.Z)(()=>{if(o&&!i)return(0,oh.Z)(t,o),()=>{(0,oh.Z)(t,null)}},[t,o,i]),i)?g.isValidElement(n)?g.cloneElement(n,{ref:s}):n:o?i0.createPortal(n,o):o});function of(e,t){let{className:n,elementType:r,ownerState:i,externalForwardedProps:o,internalForwardedProps:a,shouldForwardComponentProp:s=!1,...l}=t,{component:u,slots:c={[e]:void 0},slotProps:d={[e]:void 0},...h}=o,p=c[e]||r,f=iB(d[e],i),{props:{component:g,...m},internalRef:v}=ij({className:n,...l,externalForwardedProps:"root"===e?h:void 0,externalSlotProps:f}),y=(0,rC.Z)(v,f?.ref,t.ref),b="root"===e?g||u:g,x=i_(p,{..."root"===e&&!u&&!c[e]&&a,..."root"!==e&&!c[e]&&a,...m,...b&&!s&&{as:b},...b&&s&&{component:b},ref:y},i);return[p,x]}let og={entering:{opacity:1},entered:{opacity:1}},om=g.forwardRef(function(e,t){let n=ot(),r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:o=!0,children:a,easing:s,in:l,onEnter:u,onEntered:c,onEntering:d,onExit:h,onExited:p,onExiting:m,style:v,timeout:y=r,TransitionComponent:b=i7,...x}=e,w=g.useRef(null),S=(0,B.Z)(w,iO(a),t),C=e=>t=>{if(e){let n=w.current;void 0===t?e(n):e(n,t)}},k=C(d),M=C((e,t)=>{on(e);let r=or({style:v,timeout:y,easing:s},{mode:"enter"});e.style.webkitTransition=n.transitions.create("opacity",r),e.style.transition=n.transitions.create("opacity",r),u&&u(e,t)}),T=C(c),A=C(m),I=C(e=>{let t=or({style:v,timeout:y,easing:s},{mode:"exit"});e.style.webkitTransition=n.transitions.create("opacity",t),e.style.transition=n.transitions.create("opacity",t),h&&h(e)}),P=C(p);return(0,f.jsx)(b,{appear:o,in:l,nodeRef:w,onEnter:M,onEntered:T,onEntering:k,onExit:I,onExited:P,onExiting:A,addEndListener:e=>{i&&i(w.current,e)},timeout:y,...x,children:(e,{ownerState:t,...n})=>g.cloneElement(a,{style:{opacity:0,visibility:"exited"!==e||l?void 0:"hidden",...og[e],...v,...a.props.style},ref:S,...n})})});function ov(e){return(0,A.ZP)("MuiBackdrop",e)}(0,T.Z)("MuiBackdrop",["root","invisible"]);let oy=e=>{let{classes:t,invisible:n}=e;return(0,y.Z)({root:["root",n&&"invisible"]},ov,t)},ob=(0,S.ZP)("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),ox=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiBackdrop"}),{children:r,className:i,component:o="div",invisible:a=!1,open:s,components:l={},componentsProps:u={},slotProps:c={},slots:d={},TransitionComponent:h,transitionDuration:p,...g}=n,m={...n,component:o,invisible:a},y=oy(m),b={slots:{transition:h,root:l.Root,...d},slotProps:{...u,...c}},[x,w]=of("root",{elementType:ob,externalForwardedProps:b,className:(0,v.Z)(y.root,i),ownerState:m}),[S,C]=of("transition",{elementType:om,externalForwardedProps:b,ownerState:m});return(0,f.jsx)(S,{in:s,timeout:p,...g,...C,children:(0,f.jsx)(x,{"aria-hidden":!0,...w,classes:y,ref:t,children:r})})});var ow=n(8543);function oS(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function oC(e){return parseInt((0,rk.Z)(e).getComputedStyle(e).paddingRight,10)||0}function ok(e,t,n,r,i){let o=[t,n,...r];[].forEach.call(e.children,e=>{let t=!o.includes(e),n=!function(e){let t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||n}(e);t&&n&&oS(e,i)})}function oM(e,t){let n=-1;return e.some((e,r)=>!!t(e)&&(n=r,!0)),n}let oT=()=>{},oA=new class{constructor(){this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&oS(e.modalRef,!1);let r=function(e){let t=[];return[].forEach.call(e.children,e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)}),t}(t);ok(t,e.mount,e.modalRef,r,!0);let i=oM(this.containers,e=>e.container===t);return -1!==i?this.containers[i].modals.push(e):this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n}mount(e,t){let n=oM(this.containers,t=>t.modals.includes(e)),r=this.containers[n];r.restore||(r.restore=function(e,t){let n=[],r=e.container;if(!t.disableScrollLock){let e;if(function(e){let t=(0,ol.Z)(e);return t.body===e?(0,rk.Z)(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(r)){let e=iq((0,rk.Z)(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${oC(r)+e}px`;let t=(0,ol.Z)(r).querySelectorAll(".mui-fixed");[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${oC(t)+e}px`})}if(r.parentNode instanceof DocumentFragment)e=(0,ol.Z)(r).body;else{let t=r.parentElement,n=(0,rk.Z)(r);e=t?.nodeName==="HTML"&&"scroll"===n.getComputedStyle(t).overflowY?t:r}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach(({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)})}}(r,t))}remove(e,t=!0){let n=this.modals.indexOf(e);if(-1===n)return n;let r=oM(this.containers,t=>t.modals.includes(e)),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),0===i.modals.length)i.restore&&i.restore(),e.modalRef&&oS(e.modalRef,t),ok(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{let e=i.modals[i.modals.length-1];e.modalRef&&oS(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}},oI=function(e){let{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:i=!1,onTransitionEnter:o,onTransitionExited:a,children:s,onClose:l,open:u,rootRef:c}=e,d=g.useRef({}),h=g.useRef(null),p=g.useRef(null),f=(0,rC.Z)(p,c),[m,v]=g.useState(!u),y=!!s&&s.props.hasOwnProperty("in"),b=!0;("false"===e["aria-hidden"]||!1===e["aria-hidden"])&&(b=!1);let x=()=>(0,ol.Z)(h.current),w=()=>(d.current.modalRef=p.current,d.current.mount=h.current,d.current),S=()=>{oA.mount(w(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},C=(0,rM.Z)(()=>{let e=("function"==typeof t?t():t)||x().body;oA.add(w(),e),p.current&&S()}),k=()=>oA.isTopModal(w()),M=(0,rM.Z)(e=>{h.current=e,e&&(u&&k()?S():p.current&&oS(p.current,b))}),T=g.useCallback(()=>{oA.remove(w(),b)},[b]);g.useEffect(()=>()=>{T()},[T]),g.useEffect(()=>{u?C():y&&i||T()},[u,T,y,i,C]);let A=e=>t=>{e.onKeyDown?.(t),"Escape"===t.key&&229!==t.which&&k()&&!n&&(t.stopPropagation(),l&&l(t,"escapeKeyDown"))},I=e=>t=>{e.onClick?.(t),t.target===t.currentTarget&&l&&l(t,"backdropClick")};return{getRootProps:(t={})=>{let n=iN(e);delete n.onTransitionEnter,delete n.onTransitionExited;let r={...n,...t};return{role:"presentation",...r,onKeyDown:A(r),ref:f}},getBackdropProps:(e={})=>({"aria-hidden":!0,...e,onClick:I(e),open:u}),getTransitionProps:()=>({onEnter:(0,ow.Z)(()=>{v(!1),o&&o()},s?.props.onEnter??oT),onExited:(0,ow.Z)(()=>{v(!0),a&&a(),i&&T()},s?.props.onExited??oT)}),rootRef:f,portalRef:M,isTopModal:k,exited:m,hasTransition:y}};function oP(e){return(0,A.ZP)("MuiModal",e)}(0,T.Z)("MuiModal",["root","hidden","backdrop"]);let oR=e=>{let{open:t,exited:n,classes:r}=e;return(0,y.Z)({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},oP,r)},oO=(0,S.ZP)("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})((0,C.Z)(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:"hidden"}}]}))),oE=(0,S.ZP)(ox,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),oD=g.forwardRef(function(e,t){let n=(0,M.i)({name:"MuiModal",props:e}),{BackdropComponent:r=oE,BackdropProps:i,classes:o,className:a,closeAfterTransition:s=!1,children:l,container:u,component:c,components:d={},componentsProps:h={},disableAutoFocus:p=!1,disableEnforceFocus:m=!1,disableEscapeKeyDown:y=!1,disablePortal:b=!1,disableRestoreFocus:x=!1,disableScrollLock:w=!1,hideBackdrop:S=!1,keepMounted:C=!1,onBackdropClick:k,onClose:T,onTransitionEnter:A,onTransitionExited:I,open:P,slotProps:R={},slots:O={},theme:E,...D}=n,L={...n,closeAfterTransition:s,disableAutoFocus:p,disableEnforceFocus:m,disableEscapeKeyDown:y,disablePortal:b,disableRestoreFocus:x,disableScrollLock:w,hideBackdrop:S,keepMounted:C},{getRootProps:_,getBackdropProps:N,getTransitionProps:Z,portalRef:j,isTopModal:B,exited:F,hasTransition:z}=oI({...L,rootRef:t}),$={...L,exited:F},V=oR($),H={};if(void 0===l.props.tabIndex&&(H.tabIndex="-1"),z){let{onEnter:e,onExited:t}=Z();H.onEnter=e,H.onExited=t}let W={slots:{root:d.Root,backdrop:d.Backdrop,...O},slotProps:{...h,...R}},[q,G]=of("root",{ref:t,elementType:oO,externalForwardedProps:{...W,...D,component:c},getSlotProps:_,ownerState:$,className:(0,v.Z)(a,V?.root,!$.open&&$.exited&&V?.hidden)}),[U,K]=of("backdrop",{ref:i?.ref,elementType:r,externalForwardedProps:W,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:e=>N({...e,onClick:t=>{k&&k(t),e?.onClick&&e.onClick(t)}}),className:(0,v.Z)(i?.className,V?.backdrop),ownerState:$});return C||P||z&&!F?(0,f.jsx)(op,{ref:j,container:u,disablePortal:b,children:(0,f.jsxs)(q,{...G,children:[!S&&r?(0,f.jsx)(U,{...K}):null,(0,f.jsx)(od,{disableEnforceFocus:m,disableAutoFocus:p,disableRestoreFocus:x,isEnabled:B,open:P,children:g.cloneElement(l,H)})]})}):null});var oL=n(8505);function o_(e){return(0,A.ZP)("MuiPaper",e)}(0,T.Z)("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"]);let oN=e=>{let{square:t,elevation:n,variant:r,classes:i}=e,o={root:["root",r,!t&&"rounded","elevation"===r&&`elevation${n}`]};return(0,y.Z)(o,o_,i)},oZ=(0,S.ZP)("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,"elevation"===n.variant&&t[`elevation${n.elevation}`]]}})((0,C.Z)(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),oj=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiPaper"}),r=ot(),{className:i,component:o="div",elevation:a=1,square:s=!1,variant:l="elevation",...u}=n,c={...n,component:o,elevation:a,square:s,variant:l},d=oN(c);return(0,f.jsx)(oZ,{as:o,ownerState:c,className:(0,v.Z)(d.root,i),ref:t,...u,style:{..."elevation"===l&&{"--Paper-shadow":(r.vars||r).shadows[a],...r.vars&&{"--Paper-overlay":r.vars.overlays?.[a]},...!r.vars&&"dark"===r.palette.mode&&{"--Paper-overlay":`linear-gradient(${(0,b.Fq)("#fff",(0,oL.Z)(a))}, ${(0,b.Fq)("#fff",(0,oL.Z)(a))})`}},...u.style}})});function oB(e){return(0,A.ZP)("MuiPopover",e)}(0,T.Z)("MuiPopover",["root","paper"]);var oF=n(7834);function oz(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function o$(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function oV(e){return[e.horizontal,e.vertical].map(e=>"number"==typeof e?`${e}px`:e).join(" ")}function oH(e){return"function"==typeof e?e():e}let oW=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"],paper:["paper"]},oB,t)},oq=(0,S.ZP)(oD,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),oG=(0,S.ZP)(oj,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),oU=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiPopover"}),{action:r,anchorEl:i,anchorOrigin:o={vertical:"top",horizontal:"left"},anchorPosition:a,anchorReference:s="anchorEl",children:l,className:u,container:c,elevation:d=8,marginThreshold:h=16,open:p,PaperProps:m={},slots:y={},slotProps:b={},transformOrigin:x={vertical:"top",horizontal:"left"},TransitionComponent:w,transitionDuration:S="auto",TransitionProps:C={},disableScrollLock:k=!1,...T}=n,A=g.useRef(),I={...n,anchorOrigin:o,anchorReference:s,elevation:d,marginThreshold:h,transformOrigin:x,TransitionComponent:w,transitionDuration:S,TransitionProps:C},P=oW(I),R=g.useCallback(()=>{if("anchorPosition"===s)return a;let e=oH(i),t=(e&&1===e.nodeType?e:(0,iE.Z)(A.current).body).getBoundingClientRect();return{top:t.top+oz(t,o.vertical),left:t.left+o$(t,o.horizontal)}},[i,o.horizontal,o.vertical,a,s]),O=g.useCallback(e=>({vertical:oz(e,x.vertical),horizontal:o$(e,x.horizontal)}),[x.horizontal,x.vertical]),E=g.useCallback(e=>{let t={width:e.offsetWidth,height:e.offsetHeight},n=O(t);if("none"===s)return{top:null,left:null,transformOrigin:oV(n)};let r=R(),o=r.top-n.vertical,a=r.left-n.horizontal,l=o+t.height,u=a+t.width,c=(0,iG.Z)(oH(i)),d=c.innerHeight-h,p=c.innerWidth-h;if(null!==h&&o<h){let e=o-h;o-=e,n.vertical+=e}else if(null!==h&&l>d){let e=l-d;o-=e,n.vertical+=e}if(null!==h&&a<h){let e=a-h;a-=e,n.horizontal+=e}else if(u>p){let e=u-p;a-=e,n.horizontal+=e}return{top:`${Math.round(o)}px`,left:`${Math.round(a)}px`,transformOrigin:oV(n)}},[i,s,R,O,h]),[D,L]=g.useState(p),_=g.useCallback(()=>{let e=A.current;if(!e)return;let t=E(e);null!==t.top&&e.style.setProperty("top",t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,L(!0)},[E]);g.useEffect(()=>(k&&window.addEventListener("scroll",_),()=>window.removeEventListener("scroll",_)),[i,k,_]);let N=()=>{_()},Z=()=>{L(!1)};g.useEffect(()=>{p&&_()}),g.useImperativeHandle(r,()=>p?{updatePosition:()=>{_()}}:null,[p,_]),g.useEffect(()=>{if(!p)return;let e=(0,iQ.Z)(()=>{_()}),t=(0,iG.Z)(i);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[i,p,_]);let j=S,B={slots:{transition:w,...y},slotProps:{transition:C,paper:m,...b}},[F,z]=of("transition",{elementType:os,externalForwardedProps:B,ownerState:I,getSlotProps:e=>({...e,onEntering:(t,n)=>{e.onEntering?.(t,n),N()},onExited:t=>{e.onExited?.(t),Z()}}),additionalProps:{appear:!0,in:p}});"auto"!==S||F.muiSupportAuto||(j=void 0);let $=c||(i?(0,iE.Z)(oH(i)).body:void 0),[V,{slots:H,slotProps:W,...q}]=of("root",{ref:t,elementType:oq,externalForwardedProps:{...B,...T},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:y.backdrop},slotProps:{backdrop:(0,oF.Z)("function"==typeof b.backdrop?b.backdrop(I):b.backdrop,{invisible:!0})},container:$,open:p},ownerState:I,className:(0,v.Z)(P.root,u)}),[G,U]=of("paper",{ref:A,className:P.paper,elementType:oG,externalForwardedProps:B,shouldForwardComponentProp:!0,additionalProps:{elevation:d,style:D?void 0:{opacity:0}},ownerState:I});return(0,f.jsx)(V,{...q,...!rE(V)&&{slots:H,slotProps:W,disableScrollLock:k},children:(0,f.jsx)(F,{...z,timeout:j,children:(0,f.jsx)(G,{...U,children:l})})})});function oK(e){return(0,A.ZP)("MuiMenu",e)}(0,T.Z)("MuiMenu",["root","paper","list"]);let oY={vertical:"top",horizontal:"right"},oX={vertical:"top",horizontal:"left"},oJ=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"],paper:["paper"],list:["list"]},oK,t)},oQ=(0,S.ZP)(oU,{shouldForwardProp:e=>(0,Z.Z)(e)||"classes"===e,name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),o0=(0,S.ZP)(oG,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),o1=(0,S.ZP)(iJ,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),o2=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiMenu"}),{autoFocus:r=!0,children:i,className:o,disableAutoFocusItem:a=!1,MenuListProps:s={},onClose:l,open:u,PaperProps:c={},PopoverClasses:d,transitionDuration:h="auto",TransitionProps:{onEntering:p,...m}={},variant:y="selectedMenu",slots:b={},slotProps:x={},...w}=n,S=iL(),C={...n,autoFocus:r,disableAutoFocusItem:a,MenuListProps:s,onEntering:p,PaperProps:c,transitionDuration:h,TransitionProps:m,variant:y},k=oJ(C),T=r&&!a&&u,A=g.useRef(null),I=(e,t)=>{A.current&&A.current.adjustStyleForScrollbar(e,{direction:S?"rtl":"ltr"}),p&&p(e,t)},P=e=>{"Tab"===e.key&&(e.preventDefault(),l&&l(e,"tabKeyDown"))},R=-1;g.Children.map(i,(e,t)=>{g.isValidElement(e)&&(e.props.disabled||("selectedMenu"===y&&e.props.selected?R=t:-1!==R||(R=t)))});let O={slots:b,slotProps:{list:s,transition:m,paper:c,...x}},E=iF({elementType:b.root,externalSlotProps:x.root,ownerState:C,className:[k.root,o]}),[D,L]=of("paper",{className:k.paper,elementType:o0,externalForwardedProps:O,shouldForwardComponentProp:!0,ownerState:C}),[_,N]=of("list",{className:(0,v.Z)(k.list,s.className),elementType:o1,shouldForwardComponentProp:!0,externalForwardedProps:O,getSlotProps:e=>({...e,onKeyDown:t=>{P(t),e.onKeyDown?.(t)}}),ownerState:C}),Z="function"==typeof O.slotProps.transition?O.slotProps.transition(C):O.slotProps.transition;return(0,f.jsx)(oQ,{onClose:l,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?oY:oX,slots:{root:b.root,paper:D,backdrop:b.backdrop,...b.transition&&{transition:b.transition}},slotProps:{root:E,paper:L,backdrop:"function"==typeof x.backdrop?x.backdrop(C):x.backdrop,transition:{...Z,onEntering:(...e)=>{I(...e),Z?.onEntering?.(...e)}}},open:u,ref:t,transitionDuration:h,ownerState:C,...w,classes:d,children:(0,f.jsx)(_,{actions:A,autoFocus:r&&(-1===R||a),autoFocusItem:T,variant:y,...N,children:i})})});function o5(e){return(0,A.ZP)("MuiNativeSelect",e)}let o3=(0,T.Z)("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),o4=e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:o,error:a}=e,s={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${(0,w.Z)(n)}`,o&&"iconOpen",r&&"disabled"]};return(0,y.Z)(s,o5,t)},o6=(0,S.ZP)("select")(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${o3.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:e})=>"filled"!==e.variant&&"outlined"!==e.variant,style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),o8=(0,S.ZP)(o6,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Z.Z,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${o3.multiple}`]:t.multiple}]}})({}),o9=(0,S.ZP)("svg")(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${o3.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),o7=(0,S.ZP)(o9,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${(0,w.Z)(n.variant)}`],n.open&&t.iconOpen]}})({}),ae=g.forwardRef(function(e,t){let{className:n,disabled:r,error:i,IconComponent:o,inputRef:a,variant:s="standard",...l}=e,u={...e,disabled:r,variant:s,error:i},c=o4(u);return(0,f.jsxs)(g.Fragment,{children:[(0,f.jsx)(o8,{ownerState:u,className:(0,v.Z)(c.select,n),disabled:r,ref:a||t,...l}),e.multiple?null:(0,f.jsx)(o7,{as:o,ownerState:u,className:c.icon})]})});var at=n(4005),an=n(8817);function ar(e){return(0,A.ZP)("MuiSelect",e)}let ai=(0,T.Z)("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),ao=(0,S.ZP)(o6,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`&.${ai.select}`]:t.select},{[`&.${ai.select}`]:t[n.variant]},{[`&.${ai.error}`]:t.error},{[`&.${ai.multiple}`]:t.multiple}]}})({[`&.${ai.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),aa=(0,S.ZP)(o9,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${(0,w.Z)(n.variant)}`],n.open&&t.iconOpen]}})({}),as=(0,S.ZP)("input",{shouldForwardProp:e=>(0,at.Z)(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function al(e,t){return"object"==typeof t&&null!==t?e===t:String(e)===String(t)}let au=e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:o,error:a}=e,s={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${(0,w.Z)(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return(0,y.Z)(s,ar,t)},ac=g.forwardRef(function(e,t){var n;let r,i,o;let{"aria-describedby":a,"aria-label":s,autoFocus:l,autoWidth:u,children:c,className:d,defaultOpen:h,defaultValue:p,disabled:m,displayEmpty:y,error:b=!1,IconComponent:x,inputRef:w,labelId:S,MenuProps:C={},multiple:k,name:M,onBlur:T,onChange:A,onClose:I,onFocus:P,onOpen:R,open:O,readOnly:E,renderValue:D,required:L,SelectDisplayProps:_={},tabIndex:N,type:Z,value:j,variant:F="standard",...z}=e,[$,V]=(0,an.Z)({controlled:j,default:p,name:"Select"}),[H,W]=(0,an.Z)({controlled:O,default:h,name:"Select"}),q=g.useRef(null),G=g.useRef(null),[U,K]=g.useState(null),{current:Y}=g.useRef(null!=O),[X,J]=g.useState(),Q=(0,B.Z)(t,w),ee=g.useCallback(e=>{G.current=e,e&&K(e)},[]),et=U?.parentNode;g.useImperativeHandle(Q,()=>({focus:()=>{G.current.focus()},node:q.current,value:$}),[$]),g.useEffect(()=>{h&&H&&U&&!Y&&(J(u?null:et.clientWidth),G.current.focus())},[U,u]),g.useEffect(()=>{l&&G.current.focus()},[l]),g.useEffect(()=>{if(!S)return;let e=(0,iE.Z)(G.current).getElementById(S);if(e){let t=()=>{getSelection().isCollapsed&&G.current.focus()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}},[S]);let en=(e,t)=>{e?R&&R(t):I&&I(t),Y||(J(u?null:et.clientWidth),W(e))},er=g.Children.toArray(c),ei=e=>t=>{let n;if(t.currentTarget.hasAttribute("tabindex")){if(k){n=Array.isArray($)?$.slice():[];let t=$.indexOf(e.props.value);-1===t?n.push(e.props.value):n.splice(t,1)}else n=e.props.value;if(e.props.onClick&&e.props.onClick(t),$!==n&&(V(n),A)){let r=t.nativeEvent||t,i=new r.constructor(r.type,r);Object.defineProperty(i,"target",{writable:!0,value:{value:n,name:M}}),A(i,e)}k||en(!1,t)}},eo=null!==U&&H;delete z["aria-invalid"];let ea=[],es=!1;(r$({value:$})||y)&&(D?r=D($):es=!0);let el=er.map(e=>{let t;if(!g.isValidElement(e))return null;if(k){if(!Array.isArray($))throw Error((0,rS.Z)(2));(t=$.some(t=>al(t,e.props.value)))&&es&&ea.push(e.props.children)}else(t=al($,e.props.value))&&es&&(i=e.props.children);return g.cloneElement(e,{"aria-selected":t?"true":"false",onClick:ei(e),onKeyUp:t=>{" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})});es&&(r=k?0===ea.length?null:ea.reduce((e,t,n)=>(e.push(t),n<ea.length-1&&e.push(", "),e),[]):i);let eu=X;!u&&Y&&U&&(eu=et.clientWidth),o=void 0!==N?N:m?null:0;let ec=_.id||(M?`mui-component-select-${M}`:void 0),ed={...e,variant:F,value:$,open:eo,error:b},eh=au(ed),ep={...C.PaperProps,...C.slotProps?.paper},ef=(0,rw.Z)();return(0,f.jsxs)(g.Fragment,{children:[(0,f.jsx)(ao,{as:"div",ref:ee,tabIndex:o,role:"combobox","aria-controls":eo?ef:void 0,"aria-disabled":m?"true":void 0,"aria-expanded":eo?"true":"false","aria-haspopup":"listbox","aria-label":s,"aria-labelledby":[S,ec].filter(Boolean).join(" ")||void 0,"aria-describedby":a,"aria-required":L?"true":void 0,"aria-invalid":b?"true":void 0,onKeyDown:e=>{!E&&[" ","ArrowUp","ArrowDown","Enter"].includes(e.key)&&(e.preventDefault(),en(!0,e))},onMouseDown:m||E?null:e=>{0===e.button&&(e.preventDefault(),G.current.focus(),en(!0,e))},onBlur:e=>{!eo&&T&&(Object.defineProperty(e,"target",{writable:!0,value:{value:$,name:M}}),T(e))},onFocus:P,..._,ownerState:ed,className:(0,v.Z)(_.className,eh.select,d),id:ec,children:null!=(n=r)&&("string"!=typeof n||n.trim())?r:aO||(aO=(0,f.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"​"}))}),(0,f.jsx)(as,{"aria-invalid":b,value:Array.isArray($)?$.join(","):$,name:M,ref:q,"aria-hidden":!0,onChange:e=>{let t=er.find(t=>t.props.value===e.target.value);void 0!==t&&(V(t.props.value),A&&A(e,t))},tabIndex:-1,disabled:m,className:eh.nativeInput,autoFocus:l,required:L,...z,ownerState:ed}),(0,f.jsx)(aa,{as:x,className:eh.icon,ownerState:ed}),(0,f.jsx)(o2,{id:`menu-${M||""}`,anchorEl:et,open:eo,onClose:e=>{en(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...C,slotProps:{...C.slotProps,list:{"aria-labelledby":S,role:"listbox","aria-multiselectable":k?"true":void 0,disableListWrap:!0,id:ef,...C.MenuListProps},paper:{...ep,style:{minWidth:eu,...null!=ep?ep.style:null}}},children:el})]})});var ad=n(247);let ah=(0,ad.Z)((0,f.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),ap=e=>{let{classes:t}=e,n=(0,y.Z)({root:["root"]},ar,t);return{...t,...n}},af={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,Z.Z)(e)&&"variant"!==e,slot:"Root"},ag=(0,S.ZP)(r5,af)(""),am=(0,S.ZP)(iu,af)(""),av=(0,S.ZP)(r7,af)(""),ay=g.forwardRef(function(e,t){let n=(0,M.i)({name:"MuiSelect",props:e}),{autoWidth:r=!1,children:i,classes:o={},className:a,defaultOpen:s=!1,displayEmpty:l=!1,IconComponent:u=ah,id:c,input:d,inputProps:h,label:p,labelId:m,MenuProps:y,multiple:b=!1,native:x=!1,onClose:w,onOpen:S,open:C,renderValue:k,SelectDisplayProps:T,variant:A="outlined",...I}=n,P=rD({props:n,muiFormControl:r_(),states:["variant","error"]}),R=P.variant||A,O={...n,variant:R,classes:o},E=ap(O),{root:D,...L}=E,_=d||({standard:(0,f.jsx)(ag,{ownerState:O}),outlined:(0,f.jsx)(am,{label:p,ownerState:O}),filled:(0,f.jsx)(av,{ownerState:O})})[R],N=(0,B.Z)(t,iO(_));return(0,f.jsx)(g.Fragment,{children:g.cloneElement(_,{inputComponent:x?ae:ac,inputProps:{children:i,error:P.error,IconComponent:u,variant:R,type:void 0,multiple:b,...x?{id:c}:{autoWidth:r,defaultOpen:s,displayEmpty:l,labelId:m,MenuProps:y,onClose:w,onOpen:S,open:C,renderValue:k,SelectDisplayProps:{id:c,...T}},...h,classes:h?(0,t_.Z)(L,h.classes):L,...d?d.props.inputProps:{}},...(b&&x||l)&&"outlined"===R?{notched:!0}:{},ref:N,className:(0,v.Z)(_.props.className,a,E.root),...!d&&{variant:R},...I})})});function ab(e){return(0,A.ZP)("MuiTextField",e)}ay.muiName="Select",(0,T.Z)("MuiTextField",["root"]);let ax={standard:r5,filled:r7,outlined:iu},aw=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"]},ab,t)},aS=(0,S.ZP)(iM,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),aC=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiTextField"}),{autoComplete:r,autoFocus:i=!1,children:o,className:a,color:s="primary",defaultValue:l,disabled:u=!1,error:c=!1,FormHelperTextProps:d,fullWidth:h=!1,helperText:p,id:g,InputLabelProps:m,inputProps:y,InputProps:b,inputRef:x,label:w,maxRows:S,minRows:C,multiline:k=!1,name:T,onBlur:A,onChange:I,onFocus:P,placeholder:R,required:O=!1,rows:E,select:D=!1,SelectProps:L,slots:_={},slotProps:N={},type:Z,value:j,variant:B="outlined",...F}=n,z={...n,autoFocus:i,color:s,disabled:u,error:c,fullWidth:h,multiline:k,required:O,select:D,variant:B},$=aw(z),V=(0,rw.Z)(g),H=p&&V?`${V}-helper-text`:void 0,W=w&&V?`${V}-label`:void 0,q=ax[B],G={slots:_,slotProps:{input:b,inputLabel:m,htmlInput:y,formHelperText:d,select:L,...N}},U={},K=G.slotProps.inputLabel;"outlined"===B&&(K&&void 0!==K.shrink&&(U.notched=K.shrink),U.label=w),D&&(L&&L.native||(U.id=void 0),U["aria-describedby"]=void 0);let[Y,X]=of("input",{elementType:q,externalForwardedProps:G,additionalProps:U,ownerState:z}),[J,Q]=of("inputLabel",{elementType:ix,externalForwardedProps:G,ownerState:z}),[ee,et]=of("htmlInput",{elementType:"input",externalForwardedProps:G,ownerState:z}),[en,er]=of("formHelperText",{elementType:iR,externalForwardedProps:G,ownerState:z}),[ei,eo]=of("select",{elementType:ay,externalForwardedProps:G,ownerState:z}),ea=(0,f.jsx)(Y,{"aria-describedby":H,autoComplete:r,autoFocus:i,defaultValue:l,fullWidth:h,multiline:k,name:T,rows:E,maxRows:S,minRows:C,type:Z,value:j,id:V,inputRef:x,onBlur:A,onChange:I,onFocus:P,placeholder:R,inputProps:et,slots:{input:_.htmlInput?ee:void 0},...X});return(0,f.jsxs)(aS,{className:(0,v.Z)($.root,a),disabled:u,error:c,fullWidth:h,ref:t,required:O,color:s,variant:B,ownerState:z,...F,children:[null!=w&&""!==w&&(0,f.jsx)(J,{htmlFor:V,id:W,...Q,children:w}),D?(0,f.jsx)(ei,{"aria-describedby":H,id:V,labelId:W,value:j,input:ea,...eo,children:o}):ea,p&&(0,f.jsx)(en,{id:H,...er,children:p})]})});function ak(){return(ak=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function aM(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}function aT(e){var t=(0,g.useRef)(e),n=(0,g.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var aA,aI,aP,aR,aO,aE,aD=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},aL=function(e){return"touches"in e},a_=function(e){return e&&e.ownerDocument.defaultView||self},aN=function(e,t,n){var r=e.getBoundingClientRect(),i=aL(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:aD((i.pageX-(r.left+a_(e).pageXOffset))/r.width),top:aD((i.pageY-(r.top+a_(e).pageYOffset))/r.height)}},aZ=function(e){aL(e)||e.preventDefault()},aj=g.memo(function(e){var t=e.onMove,n=e.onKey,r=aM(e,["onMove","onKey"]),i=(0,g.useRef)(null),o=aT(t),a=aT(n),s=(0,g.useRef)(null),l=(0,g.useRef)(!1),u=(0,g.useMemo)(function(){var e=function(e){aZ(e),(aL(e)?e.touches.length>0:e.buttons>0)&&i.current?o(aN(i.current,e,s.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,o=a_(i.current),a=n?o.addEventListener:o.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=i.current;if(r&&(aZ(t),(!l.current||aL(t))&&r)){if(aL(t)){l.current=!0;var a=t.changedTouches||[];a.length&&(s.current=a[0].identifier)}r.focus(),o(aN(r,t,s.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),a({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]},[a,o]),c=u[0],d=u[1],h=u[2];return(0,g.useEffect)(function(){return h},[h]),g.createElement("div",ak({},r,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:i,onKeyDown:d,tabIndex:0,role:"slider"}))}),aB=function(e){return e.filter(Boolean).join(" ")},aF=function(e){var t=e.color,n=e.left,r=e.top,i=aB(["react-colorful__pointer",e.className]);return g.createElement("div",{className:i,style:{top:100*(void 0===r?.5:r)+"%",left:100*n+"%"}},g.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},az=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},a$=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?az(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?az(parseInt(e.substring(6,8),16)/255,2):1}},aV=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:az(e.h),s:az(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:az(i/2),a:az(r,2)}},aH=function(e){var t=aV(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},aW=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:az(255*[r,s,a,a,l,r][u]),g:az(255*[l,r,r,s,a,a][u]),b:az(255*[a,a,l,r,r,s][u]),a:az(i,2)}},aq=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},aG=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=i<1?aq(az(255*i)):"";return"#"+aq(t)+aq(n)+aq(r)+o},aU=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:az(60*(s<0?s+6:s)),s:az(o?a/o*100:0),v:az(o/255*100),a:i}},aK=g.memo(function(e){var t=e.hue,n=e.onChange,r=aB(["react-colorful__hue",e.className]);return g.createElement("div",{className:r},g.createElement(aj,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:aD(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":az(t),"aria-valuemax":"360","aria-valuemin":"0"},g.createElement(aF,{className:"react-colorful__hue-pointer",left:t/360,color:aH({h:t,s:100,v:100,a:1})})))}),aY=g.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:aH({h:t.h,s:100,v:100,a:1})};return g.createElement("div",{className:"react-colorful__saturation",style:r},g.createElement(aj,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:aD(t.s+100*e.left,0,100),v:aD(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+az(t.s)+"%, Brightness "+az(t.v)+"%"},g.createElement(aF,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:aH(t)})))}),aX=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},aJ="undefined"!=typeof window?g.useLayoutEffect:g.useEffect,aQ=new Map,a0=function(e){aJ(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!aQ.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',aQ.set(t,r);var i=aE||n.nc;i&&r.setAttribute("nonce",i),t.head.appendChild(r)}},[])},a1=function(e){var t,n,r,i,o,a=e.className,s=e.colorModel,l=e.color,u=void 0===l?s.defaultColor:l,c=e.onChange,d=aM(e,["className","colorModel","color","onChange"]),h=(0,g.useRef)(null);a0(h);var p=(t=aT(c),r=(n=(0,g.useState)(function(){return s.toHsva(u)}))[0],i=n[1],o=(0,g.useRef)({color:u,hsva:r}),(0,g.useEffect)(function(){if(!s.equal(u,o.current.color)){var e=s.toHsva(u);o.current={hsva:e,color:u},i(e)}},[u,s]),(0,g.useEffect)(function(){var e;aX(r,o.current.hsva)||s.equal(e=s.fromHsva(r),o.current.color)||(o.current={hsva:r,color:e},t(e))},[r,s,t]),[r,(0,g.useCallback)(function(e){i(function(t){return Object.assign({},t,e)})},[])]),f=p[0],m=p[1],v=aB(["react-colorful",a]);return g.createElement("div",ak({},d,{ref:h,className:v}),g.createElement(aY,{hsva:f,onChange:m}),g.createElement(aK,{hue:f.h,onChange:m,className:"react-colorful__last-control"}))},a2={defaultColor:"000",toHsva:function(e){return aU(a$(e))},fromHsva:function(e){return aG(aW({h:e.h,s:e.s,v:e.v,a:1}))},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||aX(a$(e),a$(t))}},a5=function(e){return g.createElement(a1,ak({},e,{colorModel:a2}))},a3=n(791),a4=n(354);let a6=({color:e,onChange:t,onClear:n,palette:r})=>{let[i,o]=(0,g.useState)(e),a=e=>{o(e),t?.(e)};return(0,f.jsxs)(rf,{spacing:1,children:[(0,f.jsx)(a5,{color:e,onChange:a,style:{width:"100%"}}),(0,f.jsx)(rf,{direction:"row",flexWrap:"wrap",justifyContent:"space-evenly",width:"200px",children:r&&r.map((e,t)=>(0,f.jsx)(rx,{size:"small","aria-label":`change color to ${e}`,sx:{color:e},onClick:()=>a(e),children:(0,f.jsx)(a3.default,{})},t))}),(0,f.jsxs)(rf,{direction:"row",gap:1,alignItems:"center",children:[(0,f.jsx)(aC,{inputProps:{"aria-label":"enter hex color"},fullWidth:!0,value:i,onChange:e=>{let n=e.target.value.replace(/([^0-9A-F]+)/gi,"").substring(0,8);o(`#${n}`),a8(e.target.value)&&t?.(e.target.value)}}),n&&(0,f.jsx)(rx,{onClick:n,children:(0,f.jsx)(a4.default,{})})]})]})},a8=(e,t)=>{let n=/^#?([0-9A-F]{3,8})$/i.exec(e),r=n&&n[1]?n[1].length:0;return 3===r||6===r||!!t&&4===r||!!t&&8===r};function a9({label:e,color:t,onColorChange:n,onClear:r}){let[i,o]=(0,g.useState)(null),a=!!i,{thresholds:{defaultColor:s,palette:l}}=tJ();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(a7,{size:"small","aria-label":`change ${e} color`,isSelected:a,iconColor:t,onClick:e=>{o(e.currentTarget)},children:(0,f.jsx)(a3.default,{})}),(0,f.jsx)(oU,{"data-testid":"options color picker",open:a,anchorEl:i,onClose:()=>{o(null)},slotProps:{paper:{sx:{padding:e=>e.spacing(2)}}},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,f.jsx)(a6,{color:t,palette:[s,...l],onChange:n,onClear:r})})]})}let a7=(0,S.ZP)(rx,{shouldForwardProp:e=>"isSelected"!==e&&"iconColor"!==e})(({iconColor:e,isSelected:t})=>({backgroundColor:t&&e?`${e}3F`:"undefined",color:e})),se=["list","table"],st=["small","medium"],sn={mode:"list",size:"medium"};function sr(e){return e&&se.includes(e)?e:sn.mode}var si=Symbol.for("immer-nothing"),so=Symbol.for("immer-draftable"),sa=Symbol.for("immer-state");function ss(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sl=Object.getPrototypeOf;function su(e){return!!e&&!!e[sa]}function sc(e){return!!e&&(sh(e)||Array.isArray(e)||!!e[so]||!!e.constructor?.[so]||sv(e)||sy(e))}var sd=Object.prototype.constructor.toString();function sh(e){if(!e||"object"!=typeof e)return!1;let t=sl(e);if(null===t)return!0;let n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===sd}function sp(e,t){0===sf(e)?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function sf(e){let t=e[sa];return t?t.type_:Array.isArray(e)?1:sv(e)?2:3*!!sy(e)}function sg(e,t){return 2===sf(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function sm(e,t,n){let r=sf(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function sv(e){return e instanceof Map}function sy(e){return e instanceof Set}function sb(e){return e.copy_||e.base_}function sx(e,t){if(sv(e))return new Map(e);if(sy(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=sh(e);if(!0!==t&&("class_only"!==t||n)){let t=sl(e);return null!==t&&n?{...e}:Object.assign(Object.create(t),e)}{let t=Object.getOwnPropertyDescriptors(e);delete t[sa];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(sl(e),t)}}function sw(e,t=!1){return sC(e)||su(e)||!sc(e)||(sf(e)>1&&(e.set=e.add=e.clear=e.delete=sS),Object.freeze(e),t&&Object.entries(e).forEach(([e,t])=>sw(t,!0))),e}function sS(){ss(2)}function sC(e){return Object.isFrozen(e)}var sk={};function sM(e){let t=sk[e];return t||ss(0,e),t}function sT(e,t){t&&(sM("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function sA(e){sI(e),e.drafts_.forEach(sR),e.drafts_=null}function sI(e){e===N4&&(N4=e.parent_)}function sP(e){return N4={drafts_:[],parent_:N4,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function sR(e){let t=e[sa];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function sO(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return void 0!==e&&e!==n?(n[sa].modified_&&(sA(t),ss(4)),sc(e)&&(e=sE(t,e),t.parent_||sL(t,e)),t.patches_&&sM("Patches").generateReplacementPatches_(n[sa].base_,e,t.patches_,t.inversePatches_)):e=sE(t,n,[]),sA(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==si?e:void 0}function sE(e,t,n){if(sC(t))return t;let r=t[sa];if(!r)return sp(t,(i,o)=>sD(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return sL(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;let t=r.copy_,i=t,o=!1;3===r.type_&&(i=new Set(t),t.clear(),o=!0),sp(i,(i,a)=>sD(e,r,t,i,a,n,o)),sL(e,t,!1),n&&e.patches_&&sM("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function sD(e,t,n,r,i,o,a){if(su(i)){let a=sE(e,i,o&&t&&3!==t.type_&&!sg(t.assigned_,r)?o.concat(r):void 0);if(sm(n,r,a),!su(a))return;e.canAutoFreeze_=!1}else a&&n.add(i);if(sc(i)&&!sC(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;sE(e,i),(!t||!t.scope_.parent_)&&"symbol"!=typeof r&&Object.prototype.propertyIsEnumerable.call(n,r)&&sL(e,i)}}function sL(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&sw(t,n)}var s_={get(e,t){if(t===sa)return e;let n=sb(e);if(!sg(n,t))return function(e,t,n){let r=sj(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);let r=n[t];return e.finalized_||!sc(r)?r:r===sZ(e.base_,t)?(sF(e),e.copy_[t]=sz(r,e)):r},has:(e,t)=>t in sb(e),ownKeys:e=>Reflect.ownKeys(sb(e)),set(e,t,n){let r=sj(sb(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=sZ(sb(e),t),i=r?.[sa];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if((n===r?0!==n||1/n==1/r:n!=n&&r!=r)&&(void 0!==n||sg(e.base_,t)))return!0;sF(e),sB(e)}return!!(e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t]))||(e.copy_[t]=n,e.assigned_[t]=!0,!0)},deleteProperty:(e,t)=>(void 0!==sZ(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,sF(e),sB(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let n=sb(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){ss(11)},getPrototypeOf:e=>sl(e.base_),setPrototypeOf(){ss(12)}},sN={};function sZ(e,t){let n=e[sa];return(n?sb(n):e)[t]}function sj(e,t){if(!(t in e))return;let n=sl(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=sl(n)}}function sB(e){!e.modified_&&(e.modified_=!0,e.parent_&&sB(e.parent_))}function sF(e){e.copy_||(e.copy_=sx(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function sz(e,t){let n=sv(e)?sM("MapSet").proxyMap_(e,t):sy(e)?sM("MapSet").proxySet_(e,t):function(e,t){let n=Array.isArray(e),r={type_:+!!n,scope_:t?t.scope_:N4,modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,o=s_;n&&(i=[r],o=sN);let{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,s}(e,t);return(t?t.scope_:N4).drafts_.push(n),n}sp(s_,(e,t)=>{sN[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),sN.deleteProperty=function(e,t){return sN.set.call(this,e,t,void 0)},sN.set=function(e,t,n){return s_.set.call(this,e[0],t,n,e[0])};var s$=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{let r;if("function"==typeof e&&"function"!=typeof t){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}if("function"!=typeof t&&ss(6),void 0!==n&&"function"!=typeof n&&ss(7),sc(e)){let i=sP(this),o=sz(e,void 0),a=!0;try{r=t(o),a=!1}finally{a?sA(i):sI(i)}return sT(i,n),sO(r,i)}if(e&&"object"==typeof e)ss(1,e);else{if(void 0===(r=t(e))&&(r=e),r===si&&(r=void 0),this.autoFreeze_&&sw(r,!0),n){let t=[],i=[];sM("Patches").generateReplacementPatches_(e,r,t,i),n(t,i)}return r}},this.produceWithPatches=(e,t)=>{let n,r;return"function"==typeof e?(t,...n)=>this.produceWithPatches(t,t=>e(t,...n)):[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){var t;sc(e)||ss(8),su(e)&&(su(t=e)||ss(10,t),e=function e(t){let n;if(!sc(t)||sC(t))return t;let r=t[sa];if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=sx(t,r.scope_.immer_.useStrictShallowCopy_)}else n=sx(t,!0);return sp(n,(t,r)=>{sm(n,t,e(r))}),r&&(r.finalized_=!1),n}(t));let n=sP(this),r=sz(e,void 0);return r[sa].isManual_=!0,sI(n),r}finishDraft(e,t){let n=e&&e[sa];n&&n.isManual_||ss(9);let{scope_:r}=n;return sT(r,t),sO(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=sM("Patches").applyPatches_;return su(e)?r(e,t):this.produce(e,e=>r(e,t))}},sV=s$.produce;s$.produceWithPatches.bind(s$),s$.setAutoFreeze.bind(s$),s$.setUseStrictShallowCopy.bind(s$),s$.applyPatches.bind(s$),s$.createDraft.bind(s$),s$.finishDraft.bind(s$);function sH(e){e()}function sW(e,t){return n=>e(t(n))}function sq(e){return void 0!==e}function sG(){}function sU(e,t){return t(e)}function sK(...e){return e}function sY(e,t){e(0,t)}function sX(e){e(2)}function sJ(e){return e(4)}function sQ(e,t){return e(1,e=>t(0,e))}function s0(e,t){let n=e(1,e=>{n(),t(e)});return n}function s1(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function s2(e,t){return e===t}function s5(e=s2){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function s3(e){return t=>n=>{e(n)&&t(n)}}function s4(e){return t=>sW(t,e)}function s6(e){return t=>()=>{t(e)}}function s8(e,...t){let n=function(...e){return t=>e.reduceRight(sU,t)}(...t);return(t,r)=>{switch(t){case 2:sX(e);return;case 1:return e(1,n(r))}}}function s9(e,t){return n=>r=>{n(t=e(t,r))}}function s7(e){return t=>n=>{e>0?e--:t(n)}}function le(e){let t=null,n;return r=>i=>{t=i,n||(n=setTimeout(()=>{n=void 0,r(t)},e))}}function lt(...e){let t=Array(e.length),n=0,r=null,i=Math.pow(2,e.length)-1;return e.forEach((e,o)=>{let a=Math.pow(2,o);e(1,e=>{let s=n;n|=a,t[o]=e,s!==i&&n===i&&r&&(r(),r=null)})}),e=>o=>{let a=()=>{e([o].concat(t))};n===i?a():r=a}}function ln(e){let t=e,n=li();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function lr(e,t){var n;return sQ(e,n=ln(t)),n}function li(){let e=[];return(t,n)=>{switch(t){case 0:e.slice().forEach(e=>{e(n)});return;case 2:e.splice(0,e.length);return;case 1:return e.push(n),()=>{let t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function lo(e){var t;return sQ(e,t=li()),t}function la(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:ls(),singleton:n}}let ls=()=>Symbol();function ll(...e){let t=li(),n=Array(e.length),r=0,i=Math.pow(2,e.length)-1;return e.forEach((e,o)=>{let a=Math.pow(2,o);e(1,e=>{n[o]=e,(r|=a)===i&&t(0,n)})}),function(e,o){switch(e){case 2:sX(t);return;case 1:return r===i&&o(n),t(1,o)}}}function lu(e,t=s2){return s8(e,s5(t))}function lc(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(sH)}}(...e.map(e=>e(1,n)))}}}var ld=((a=ld||{})[a.DEBUG=0]="DEBUG",a[a.INFO=1]="INFO",a[a.WARN=2]="WARN",a[a.ERROR=3]="ERROR",a);let lh={0:"debug",3:"error",1:"log",2:"warn"},lp=()=>typeof globalThis>"u"?window:globalThis,lf=la(()=>{let e=ln(3);return{log:ln((t,n,r=1)=>{var i;r>=(null!=(i=lp().VIRTUOSO_LOG_LEVEL)?i:sJ(e))&&console[lh[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function lg(e,t,n){return lm(e,t,n).callbackRef}function lm(e,t,n){let r=g.useRef(null),i=e=>{};if("u">typeof ResizeObserver){let o=g.useMemo(()=>new ResizeObserver(t=>{let r=()=>{let n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)}),[e]);i=e=>{e&&t?(o.observe(e),r.current=e):(r.current&&o.unobserve(r.current),r.current=null)}}return{callbackRef:i,ref:r}}function lv(e,t,n,r,i,o,a,s,l){return lm(g.useCallback(n=>{let l=function(e,t,n,r){let i=e.length;if(0===i)return null;let o=[];for(let a=0;a<i;a++){let i=e.item(a);if(void 0===i.dataset.index)continue;let s=parseInt(i.dataset.index),l=parseFloat(i.dataset.knownSize),u=t(i,n);if(0===u&&r("Zero-sized element, this should not happen",{child:i},ld.ERROR),u===l)continue;let c=o[o.length-1];0===o.length||c.size!==u||c.endIndex!==s-1?o.push({endIndex:s,size:u,startIndex:s}):o[o.length-1].endIndex++}return o}(n.children,t,s?"offsetWidth":"offsetHeight",i),u=n.parentElement;for(;!u.dataset.virtuosoScroller;)u=u.parentElement;let c="window"===u.lastElementChild.dataset.viewportType,d=a?s?a.scrollLeft:a.scrollTop:c?s?window.pageXOffset||document.documentElement.scrollLeft:window.pageYOffset||document.documentElement.scrollTop:s?u.scrollLeft:u.scrollTop;r({scrollHeight:a?s?a.scrollWidth:a.scrollHeight:c?s?document.documentElement.scrollWidth:document.documentElement.scrollHeight:s?u.scrollWidth:u.scrollHeight,scrollTop:Math.max(d,0),viewportHeight:a?s?a.offsetWidth:a.offsetHeight:c?s?window.innerWidth:window.innerHeight:s?u.offsetWidth:u.offsetHeight}),null==o||o(s?ly("column-gap",getComputedStyle(n).columnGap,i):ly("row-gap",getComputedStyle(n).rowGap,i)),null!==l&&e(l)},[e,t,i,o,a,r]),n,l)}function ly(e,t,n){return"normal"===t||null!=t&&t.endsWith("px")||n(`${e} was not resolved to pixel value correctly`,t,ld.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}function lb(e,t,n){let r=g.useRef(null),i=g.useCallback(n=>{let i,o;if(!(null!=n&&n.offsetParent))return;let a=n.getBoundingClientRect(),s=a.width;if(t){let e=t.getBoundingClientRect(),n=a.top-e.top;o=e.height-Math.max(0,n),i=n+t.scrollTop}else o=window.innerHeight-Math.max(0,a.top),i=a.top+window.pageYOffset;r.current={offsetTop:i,visibleHeight:o,visibleWidth:s},e(r.current)},[e,t]),{callbackRef:o,ref:a}=lm(i,!0,n),s=g.useCallback(()=>{i(a.current)},[i,a]);return g.useEffect(()=>{if(!t)return window.addEventListener("scroll",s),window.addEventListener("resize",s),()=>{window.removeEventListener("scroll",s),window.removeEventListener("resize",s)};{t.addEventListener("scroll",s);let e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>{t.removeEventListener("scroll",s),e.unobserve(t)}}},[s,t]),o}let lx=la(()=>{let e=li(),t=li(),n=ln(0),r=li(),i=ln(0),o=li(),a=li(),s=ln(0),l=ln(0),u=ln(0),c=ln(0),d=li(),h=li(),p=ln(!1),f=ln(!1),g=ln(!1);return sQ(s8(e,s4(({scrollTop:e})=>e)),t),sQ(s8(e,s4(({scrollHeight:e})=>e)),a),sQ(t,i),{deviation:n,fixedFooterHeight:u,fixedHeaderHeight:l,footerHeight:c,headerHeight:s,horizontalDirection:f,scrollBy:h,scrollContainerState:e,scrollHeight:a,scrollingInProgress:p,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:o}},[],{singleton:!0}),lw={lvl:0};function lS(e,t){let n=e.length;if(0===n)return[];let{index:r,value:i}=t(e[0]),o=[];for(let a=1;a<n;a++){let{index:n,value:s}=t(e[a]);o.push({end:n-1,start:r,value:i}),r=n,i=s}return o.push({end:1/0,start:r,value:i}),o}function lC(e){return e===lw}function lk(e,t){if(!lC(e))return t===e.k?e.v:t<e.k?lk(e.l,t):lk(e.r,t)}function lM(e,t,n="k"){if(lC(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){let r=lM(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return lM(e.l,t,n)}function lT(e,t,n){return lC(e)?lE(t,n,1):t===e.k?lR(e,{k:t,v:n}):t<e.k?lL(lD(lR(e,{l:lT(e.l,t,n)}))):lL(lD(lR(e,{r:lT(e.r,t,n)})))}function lA(e,t,n){if(lC(e))return[];let r=lM(e,t)[0];return lS(function e(t,n,r){if(lC(t))return[];let{k:i,l:o,r:a,v:s}=t,l=[];return i>n&&(l=l.concat(e(o,n,r))),i>=n&&i<=r&&l.push({k:i,v:s}),i<=r&&(l=l.concat(e(a,n,r))),l}(e,r,n),({k:e,v:t})=>({index:e,value:t}))}function lI(e){return lC(e)?[]:[...lI(e.l),{k:e.k,v:e.v},...lI(e.r)]}function lP(e){let{l:t,lvl:n,r:r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(lO(t))return lD(lR(e,{lvl:n-1}));if(!lC(t)&&!lC(t.r))return lR(t.r,{l:lR(t,{r:t.r.l}),lvl:n,r:lR(e,{l:t.r.r,lvl:n-1})});throw Error("Unexpected empty nodes")}if(lO(e))return lL(lR(e,{lvl:n-1}));if(lC(r)||lC(r.l))throw Error("Unexpected empty nodes");{let t=r.l,i=lO(t)?r.lvl-1:r.lvl;return lR(t,{l:lR(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:lL(lR(r,{l:t.r,lvl:i}))})}}function lR(e,t){return lE(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function lO(e){return lC(e)||e.lvl>e.r.lvl}function lE(e,t,n,r=lw,i=lw){return{k:e,l:r,lvl:n,r:i,v:t}}function lD(e){let{l:t}=e;return lC(t)||t.lvl!==e.lvl?e:lR(t,{r:lR(e,{l:t.r})})}function lL(e){let{lvl:t,r:n}=e;return lC(n)||lC(n.r)||n.lvl!==t||n.r.lvl!==t?e:lR(n,{l:lR(e,{r:n.l}),lvl:t+1})}function l_(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function lN(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}let lZ=la(()=>({recalcInProgress:ln(!1)}),[],{singleton:!0});function lj(e,t,n,r=0){let i=e.length-1;for(;r<=i;){let o=Math.floor((r+i)/2),a=n(e[o],t);if(0===a)return o;if(-1===a){if(i-r<2)return o-1;i=o-1}else{if(i===r)return o;r=o+1}}throw Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function lB(e,t){return Math.round(e.getBoundingClientRect()[t])}function lF(e){return!lC(e.groupOffsetTree)}function lz({index:e},t){return t===e?0:t<e?-1:1}function l$({offset:e},t){return t===e?0:t<e?-1:1}function lV(e,t,n){if(0===t.length)return 0;let{index:r,offset:i,size:o}=t[lj(t,e,lz)],a=e-r,s=o*a+(a-1)*n+i;return s>0?s+n:s}function lH(e,t){if(!lF(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function lW(e,t,n){if("u">typeof e.groupIndex)return t.groupIndices[e.groupIndex]+1;{let r=lH("LAST"===e.index?n:e.index,t);return Math.max(0,r,Math.min(n,r))}}function lq(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,ld.DEBUG);let o=e.sizeTree,a=o,s=0;if(n.length>0&&lC(o)&&2===t.length){let e=t[0].size,r=t[1].size;a=n.reduce((t,n)=>lT(lT(t,n,e),n+1,r),a)}else[a,s]=function(e,t){let n=lC(e)?0:1/0;for(let r of t){let{endIndex:t,size:i,startIndex:o}=r;if(n=Math.min(n,o),lC(e)){e=lT(e,0,i);continue}let a=lA(e,o-1,t+1);if(a.some(function(e){let{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}(r)))continue;let s=!1,l=!1;for(let{end:n,start:r,value:o}of a)s?(t>=r||i===o)&&(e=function e(t,n){if(lC(t))return lw;let{k:r,l:i,r:o}=t;if(n!==r)return n<r?lP(lR(t,{l:e(i,n)})):lP(lR(t,{r:e(o,n)}));if(lC(i))return o;if(lC(o))return i;{let[e,n]=function e(t){return lC(t.r)?[t.k,t.v]:e(t.r)}(i);return lP(lR(t,{k:e,l:function e(t){return lC(t.r)?t.l:lP(lR(t,{r:e(t.r)}))}(i),v:n}))}}(e,r)):(l=o!==i,s=!0),n>t&&t>=r&&o!==i&&(e=lT(e,t+1,o));l&&(e=lT(e,o,i))}return[e,n]}(a,t);if(a===o)return e;let{lastIndex:l,lastOffset:u,lastSize:c,offsetTree:d}=lU(e.offsetTree,s,a,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>lT(e,t,lV(t,d,i)),lw),lastIndex:l,lastOffset:u,lastSize:c,offsetTree:d,sizeTree:a}}function lG(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-+(n!==e)}function lU(e,t,n,r){let i=e,o=0,a=0,s=0,l=0;if(0!==t){l=lj(i,t-1,lz),s=i[l].offset;let e=lM(n,t-1);o=e[0],a=e[1],i.length&&i[l].size===lM(n,t)[1]&&(l-=1),i=i.slice(0,l+1)}else i=[];for(let{start:e,value:l}of lA(n,t,1/0)){let t=e-o,n=t*a+s+t*r;i.push({index:e,offset:n,size:l}),o=e,s=n,a=l}return{lastIndex:o,lastOffset:s,lastSize:a,offsetTree:i}}function lK(e){return{index:e.index,value:e}}let lY={offsetHeight:"height",offsetWidth:"width"},lX=la(([{log:e},{recalcInProgress:t}])=>{let n=li(),r=li(),i=lr(r,0),o=li(),a=li(),s=ln(0),l=ln([]),u=ln(void 0),c=ln(void 0),d=ln((e,t)=>lB(e,lY[t])),h=ln(void 0),p=ln(0),f={groupIndices:[],groupOffsetTree:lw,lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:lw},g=lr(s8(n,lt(l,e,p),s9(lq,f),s5()),f),m=lr(s8(l,s5(),s9((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),s4(({prev:e})=>e)),[]);sQ(s8(l,s3(e=>e.length>0),lt(g,p),s4(([e,t,n])=>{let r=e.reduce((e,r,i)=>lT(e,r,lV(r,t.offsetTree,n)||i),lw);return{...t,groupIndices:e,groupOffsetTree:r}})),g),sQ(s8(r,lt(g),s3(([e,{lastIndex:t}])=>e<t),s4(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),sQ(u,c);let v=lr(s8(u,s4(e=>void 0===e)),!0);sQ(s8(c,s3(e=>void 0!==e&&lC(sJ(g).sizeTree)),s4(e=>[{endIndex:0,size:e,startIndex:0}])),n);let y=lo(s8(n,lt(g),s9(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:f}),s4(e=>e.changed)));s8(s,s9((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),s4(e=>e.diff))(1,e=>{let{groupIndices:n}=sJ(g);if(e>0)t(0,!0),o(0,e+lG(e,n));else if(e<0){let t=sJ(m);t.length>0&&(e-=lG(-e,t)),a(0,e)}}),s8(s,lt(e))(1,([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},ld.ERROR)});let b=lo(o);sQ(s8(o,lt(g),s4(([e,t])=>{let n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){let n=lk(t.sizeTree,0),o=0,a=0;for(;o<e;){let e=t.groupIndices[a],s=t.groupIndices.length===a+1?1/0:t.groupIndices[a+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+s-1,size:i,startIndex:e+1}),a++,o+=s+1}let s=lI(t.sizeTree);return o!==e&&s.shift(),s.reduce((t,{k:n,v:r})=>{let i=t.ranges;return 0!==t.prevSize&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return lI(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:i,ranges:[]}).ranges})),n);let x=lo(s8(a,lt(g,p),s4(([e,{offsetTree:t},n])=>lV(-e,t,n))));return sQ(s8(a,lt(g,p),s4(([e,t,n])=>{if(t.groupIndices.length>0){if(lC(t.sizeTree))return t;let r=lw,i=sJ(m),o=0,a=0,s=0;for(;o<-e;){s=i[a];let e=i[a+1]-s-1;a++,o+=e+1}return r=lI(t.sizeTree).reduce((t,{k:n,v:r})=>lT(t,Math.max(0,n+e),r),r),o!==-e&&(r=lT(r,0,lk(t.sizeTree,s)),r=lT(r,1,lM(t.sizeTree,-e+1)[1])),{...t,sizeTree:r,...lU(t.offsetTree,0,r,n)}}{let r=lI(t.sizeTree).reduce((t,{k:n,v:r})=>lT(t,Math.max(0,n+e),r),lw);return{...t,sizeTree:r,...lU(t.offsetTree,0,r,n)}}})),g),{beforeUnshiftWith:b,data:h,defaultItemSize:c,firstItemIndex:s,fixedItemSize:u,gap:p,groupIndices:l,itemSize:d,listRefresh:y,shiftWith:a,shiftWithOffset:x,sizeRanges:n,sizes:g,statefulTotalCount:i,totalCount:r,trackItemSizes:v,unshiftWith:o}},sK(lf,lZ),{singleton:!0});function lJ(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}let lQ=la(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{let o=li(),a=li(),s=lo(s8(o,s4(lJ)));return sQ(s8(s,s4(e=>e.totalCount)),n),sQ(s8(s,s4(e=>e.groupIndices)),e),sQ(s8(ll(i,t,r),s3(([e,t])=>lF(t)),s4(([e,t,n])=>lM(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),s5(),s4(e=>[e])),a),{groupCounts:o,topItemsIndexes:a}},sK(lX,lx)),l0=la(([{log:e}])=>{let t=ln(!1),n=lo(s8(t,s3(e=>e),s5()));return t(1,t=>{t&&sJ(e)("props updated",{},ld.DEBUG)}),{didMount:n,propsReady:t}},sK(lf),{singleton:!0}),l1="u">typeof document&&"scrollBehavior"in document.documentElement.style;function l2(e){let t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),t.behavior&&l1||(t.behavior="auto"),t.offset||(t.offset=0),t}let l5=la(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:o,footerHeight:a,headerHeight:s,scrollingInProgress:l,scrollTo:u,smoothScrollTargetReached:c,viewportHeight:d},{log:h}])=>{let p=li(),f=li(),g=ln(0),m=null,v=null,y=null;function b(){m&&(m(),m=null),y&&(y(),y=null),v&&(clearTimeout(v),v=null),l(0,!1)}return sQ(s8(p,lt(n,d,r,g,s,a,h),lt(e,o,i),s4(([[e,n,r,i,o,a,s,u],d,h,g])=>{let x=l2(e),{align:w,behavior:S,offset:C}=x,k=i-1,M=lW(x,n,k),T=lV(M,n.offsetTree,d)+a;"end"===w?(T+=h+lM(n.sizeTree,M)[1]-r+g,M===k&&(T+=s)):"center"===w?T+=(h+lM(n.sizeTree,M)[1]-r+g)/2:T-=o,C&&(T+=C);let A=t=>{b(),t?(u("retrying to scroll to",{location:e},ld.DEBUG),p(0,e)):(f(0,!0),u("list did not change, scroll successful",{},ld.DEBUG))};if(b(),"smooth"===S){let e=!1;y=t(1,t=>{e=e||t}),m=s0(c,()=>{A(e)})}else m=s0(s8(t,e=>{let t=setTimeout(()=>{e(!1)},150);return n=>{n&&(e(!0),clearTimeout(t))}}),A);return v=setTimeout(()=>{b()},1200),l(0,!0),u("scrolling from index to",{behavior:S,index:M,top:T},ld.DEBUG),{behavior:S,top:T}})),u),{scrollTargetReached:f,scrollToIndex:p,topListHeight:g}},sK(lX,lx,lf),{singleton:!0});function l3(e,t){0==e?t():requestAnimationFrame(()=>{l3(e-1,t)})}function l4(e,t){return"number"==typeof e?e:"LAST"===e.index?t-1:e.index}let l6=la(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:o},{didMount:a}])=>{let s=ln(!0),l=ln(0),u=ln(!0);return sQ(s8(a,lt(l),s3(([e,t])=>!!t),s6(!1)),s),sQ(s8(a,lt(l),s3(([e,t])=>!!t),s6(!1)),u),s8(ll(t,a),lt(s,n,e,u),s3(([[,e],t,{sizeTree:n},r,i])=>e&&(!lC(n)||sq(r))&&!t&&!i),lt(l))(1,([,e])=>{s0(i,()=>{u(0,!0)}),l3(4,()=>{s0(r,()=>{s(0,!0)}),o(0,e)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:l,scrolledToInitialItem:s}},sK(lX,lx,l5,l0),{singleton:!0});function l8(e,t){return 1.01>Math.abs(e-t)}let l9="down",l7={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},ue=la(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:o}])=>{let a=ln(!1),s=ln(!0),l=li(),u=li(),c=ln(4),d=ln(0),h=lr(s8(lc(s8(lu(i),s7(1),s6(!0)),s8(lu(i),s7(1),s6(!1),s1(100))),s5()),!1),p=lr(s8(lc(s8(n,s6(!0)),s8(n,s6(!1),s1(200))),s5()),!1);sQ(s8(ll(lu(i),lu(d)),s4(([e,t])=>e<=t),s5()),s),sQ(s8(s,le(50)),u);let f=lo(s8(ll(r,lu(o),lu(t),lu(e),lu(c)),s9((e,[{scrollHeight:t,scrollTop:n},r,i,o,a])=>{let s;let l={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-a){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:l}}return{atBottom:!1,notAtBottomBecause:l.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:l}},l7),s5((e,t)=>e&&e.atBottom===t.atBottom))),g=lr(s8(r,s9((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(l8(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:n};{let i=t-(n+r)<1;return e.scrollTop!==n&&i?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),s3(e=>e.changed),s4(e=>e.jump)),0);sQ(s8(f,s4(e=>e.atBottom)),a),sQ(s8(a,le(50)),l);let m=ln(l9);sQ(s8(r,s4(({scrollTop:e})=>e),s5(),s9((e,t)=>sJ(p)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?"up":l9,prevScrollTop:t},{direction:l9,prevScrollTop:0}),s4(e=>e.direction)),m),sQ(s8(r,le(50),s6("none")),m);let v=ln(0);return sQ(s8(h,s3(e=>!e),s6(0)),v),sQ(s8(i,le(100),lt(h),s3(([e,t])=>!!t),s9(([e,t],[n])=>[t,n],[0,0]),s4(([e,t])=>t-e)),v),{atBottomState:f,atBottomStateChange:l,atBottomThreshold:c,atTopStateChange:u,atTopThreshold:d,isAtBottom:a,isAtTop:s,isScrolling:h,lastJumpDueToItemResize:g,scrollDirection:m,scrollVelocity:v}},sK(lx)),ut="bottom",un="none";function ur(e,t,n){return"number"==typeof e?"up"===n&&"top"===t||n===l9&&t===ut?e:0:"up"===n?"top"===t?e.main:e.reverse:t===ut?e.main:e.reverse}function ui(e,t){var n;return"number"==typeof e?e:null!=(n=e[t])?n:0}let uo=la(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{let o=li(),a=ln(0),s=ln(0),l=ln(0),u=lr(s8(ll(lu(r),lu(i),lu(n),lu(o,lN),lu(l),lu(a),lu(t),lu(e),lu(s)),s4(([e,t,n,[r,i],o,a,s,l,u])=>{let c=e-l,d=Math.max(n-c,0),h=un,p=ui(u,"top"),f=ui(u,ut);return r-=l,r+=n+s,i+=n+s,r>e+(a+s)-p&&(h="up"),(i-=l)<e-d+t+f&&(h=l9),h!==un?[Math.max(c-n-ur(o,"top",h)-p,0),c-d-s+t+ur(o,ut,h)+f]:null}),s3(e=>null!=e),s5(lN)),[0,0]);return{increaseViewportBy:s,listBoundary:o,overscan:l,topListHeight:a,visibleRange:u}},sK(lx),{singleton:!0}),ua={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function us(e,t,n,r,i,o){let{lastIndex:a,lastOffset:s,lastSize:l}=i,u=0,c=0;if(e.length>0){u=e[0].offset;let t=e[e.length-1];c=t.offset+t.size}let d=n-a,h=u,p=s+d*l+(d-1)*r-c;return{bottom:c,firstItemIndex:o,items:uu(e,i,o),offsetBottom:p,offsetTop:u,top:h,topItems:uu(t,i,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function ul(e,t,n,r,i,o){let a=0;if(n.groupIndices.length>0)for(let t of n.groupIndices){if(t-a>=e)break;a++}let s=e+a,l=l4(t,s);return us(Array.from({length:s}).map((e,t)=>({data:o[t+l],index:t+l,offset:0,size:0})),[],s,i,n,r)}function uu(e,t,n){if(0===e.length)return[];if(!lF(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));let r=e[0].index,i=e[e.length-1].index,o=[],a=lA(t.groupOffsetTree,r,i),s,l=0;for(let r of e){let e;(!s||s.end<r.index)&&(s=a.shift(),l=t.groupIndices.indexOf(s.start)),e=r.index===s.start?{index:l,type:"group"}:{groupIndex:l,index:r.index-(l+1)+n},o.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return o}let uc=la(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},o,{listBoundary:a,topListHeight:s,visibleRange:l},{initialTopMostItemIndex:u,scrolledToInitialItem:c},{topListHeight:d},h,{didMount:p},{recalcInProgress:f}])=>{let g=ln([]),m=ln(0),v=li();sQ(o.topItemsIndexes,g);let y=lr(s8(ll(p,f,lu(l,lN),lu(i),lu(r),lu(u),c,lu(g),lu(t),lu(n),e),s3(([e,t,,n,,,,,,,r])=>{let i=r&&r.length!==n;return e&&!t&&!i}),s4(([,,[e,t],n,r,i,o,a,s,l,u])=>{var c;let{offsetTree:d,sizeTree:h}=r,p=sJ(m);if(0===n)return{...ua,totalCount:n};if(0===e&&0===t)return 0===p?{...ua,totalCount:n}:ul(p,i,r,s,l,u||[]);if(lC(h))return p>0?null:us(function(e,t,n){if(lF(t)){let r=lH(e,t);return[{index:lM(t.groupOffsetTree,r)[0],offset:0,size:0},{data:null==n?void 0:n[0],index:r,offset:0,size:0}]}return[{data:null==n?void 0:n[0],index:e,offset:0,size:0}]}(l4(i,n),r,u),[],n,l,r,s);let f=[];if(a.length>0){let e=a[0],t=a[a.length-1],n=0;for(let r of lA(h,e,t)){let i=r.value,o=Math.max(r.start,e),a=Math.min(r.end,t);for(let e=o;e<=a;e++)f.push({data:null==u?void 0:u[e],index:e,offset:n,size:i}),n+=i}}if(!o)return us([],f,n,l,r,s);let g=a.length>0?a[a.length-1]+1:0,v=function(e,t,n,r=0){return r>0&&(t=Math.max(t,e[lj(e,r,lz)].offset)),lS(function(e,t,n,r){let i=lj(e,t,r),o=lj(e,n,r,i);return e.slice(i,o+1)}(e,t,n,l$),lK)}(d,e,t,g);if(0===v.length)return null;let y=n-1;return us(((n=>{for(let r of v){let i=r.value,o=i.offset,a=r.start,s=i.size;if(i.offset<e){let t=(a+=Math.floor((e-i.offset+l)/(s+l)))-r.start;o+=t*s+t*l}a<g&&(o+=(g-a)*s,a=g);let c=Math.min(r.end,y);for(let e=a;e<=c&&!(o>=t);e++)n.push({data:null==u?void 0:u[e],index:e,offset:o,size:s}),o+=s+l}})(c=[]),c),f,n,l,r,s)}),s3(e=>null!==e),s5()),ua);sQ(s8(e,s3(sq),s4(e=>null==e?void 0:e.length)),i),sQ(s8(y,s4(e=>e.topListHeight)),d),sQ(d,s),sQ(s8(y,s4(e=>[e.top,e.bottom])),a),sQ(s8(y,s4(e=>e.items)),v);let b=lo(s8(y,s3(({items:e})=>e.length>0),lt(i,e),s3(([{items:e},t])=>e[e.length-1].originalIndex===t-1),s4(([,e,t])=>[e-1,t]),s5(lN),s4(([e])=>e))),x=lo(s8(y,le(200),s3(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),s4(({items:e})=>e[0].index),s5())),w=lo(s8(y,s3(({items:e})=>e.length>0),s4(({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),s5(l_)));return{endReached:b,initialItemCount:m,itemsRendered:v,listState:y,rangeChanged:w,startReached:x,topItemsIndexes:g,...h}},sK(lX,lQ,uo,l6,l5,ue,l0,lZ),{singleton:!0}),ud=la(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{let o=li(),a=lr(s8(ll(n,e,r,t,i),s4(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return sQ(lu(a),o),{totalListHeight:a,totalListHeightChanged:o}},sK(lx,uc),{singleton:!0}),uh=la(([{viewportHeight:e},{totalListHeight:t}])=>{let n=ln(!1),r=lr(s8(ll(n,e,t),s3(([e])=>e),s4(([,e,t])=>Math.max(0,e-t)),le(0),s5()),0);return{alignToBottom:n,paddingTopAddition:r}},sK(lx,ud),{singleton:!0});function up(e){return!!e&&("smooth"===e?"smooth":"auto")}let uf=(e,t)=>"function"==typeof e?up(e(t)):t&&up(e),ug=la(([{listRefresh:e,totalCount:t},{atBottomState:n,isAtBottom:r},{scrollToIndex:i},{scrolledToInitialItem:o},{didMount:a,propsReady:s},{log:l},{scrollingInProgress:u}])=>{let c=ln(!1),d=li(),h=null;function p(e){i(0,{align:"end",behavior:e,index:"LAST"})}function f(e){setTimeout(s0(n,t=>{!e||t.atBottom||"SIZE_INCREASED"!==t.notAtBottomBecause||h||(sJ(l)("scrolling to bottom due to increased size",{},ld.DEBUG),p("auto"))}),100)}return s8(ll(s8(lu(t),s7(1)),a),lt(lu(c),r,o,u),s4(([[e,t],n,r,i,o])=>{let a=t&&i,s="auto";return a&&(s=uf(n,r||o),a=a&&!!s),{followOutputBehavior:s,shouldFollow:a,totalCount:e}}),s3(({shouldFollow:e})=>e))(1,({followOutputBehavior:t,totalCount:n})=>{h&&(h(),h=null),h=s0(e,()=>{sJ(l)("following output to ",{totalCount:n},ld.DEBUG),p(t),h=null})}),s8(ll(lu(c),t,s),s3(([e,,t])=>e&&t),s9(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),s3(({refreshed:e})=>e),lt(c,t))(1,([,e])=>{sJ(o)&&f(!1!==e)}),d(1,()=>{f(!1!==sJ(c))}),ll(lu(c),n)(1,([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&p("auto")}),{autoscrollToBottom:d,followOutput:c}},sK(lX,ue,l5,l6,l0,lf,lx)),um=la(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:o,listState:a},{didMount:s}])=>(sQ(s8(s,lt(o),s3(([,e])=>0!==e),lt(i,r,t,n,e),s4(([[,e],t,n,r,i,o=[]])=>ul(e,t,n,r,i,o))),a),{}),sK(lX,l6,uc,l0),{singleton:!0}),uv=la(([{didMount:e},{scrollTo:t},{listState:n}])=>{let r=ln(0);return s8(e,lt(r),s3(([,e])=>0!==e),s4(([,e])=>({top:e})))(1,e=>{s0(s8(n,s7(1),s3(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{t(0,e)})})}),{initialScrollTop:r}},sK(l0,lx,uc),{singleton:!0}),uy=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:o,viewportTop:a})=>t<a?{...i,align:null!=n?n:"start",behavior:r}:e>o?{...i,align:null!=n?n:"end",behavior:r}:null,ub=la(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:o,scrollingInProgress:a,scrollTop:s,viewportHeight:l},{scrollToIndex:u}])=>{let c=li();return sQ(s8(c,lt(t,l,n,o,i,r,s),lt(e),s4(([[e,t,n,r,i,o,s,l],u])=>{let{align:c,behavior:d,calculateViewLocation:h=uy,done:p,...f}=e,g=lW(e,t,r-1),m=lV(g,t.offsetTree,u)+i+o,v=h({itemBottom:m+lM(t.sizeTree,g)[1],itemTop:m,locationParams:{align:c,behavior:d,...f},viewportBottom:l+n-s,viewportTop:l+o});return v?p&&s0(s8(a,s3(e=>!e),s7(sJ(a)?1:2)),p):p&&p(),v}),s3(e=>null!==e)),u),{scrollIntoView:c}},sK(lX,lx,l5,uc,lf),{singleton:!0}),ux=la(([{scrollVelocity:e}])=>{let t=ln(!1),n=li(),r=ln(!1);return sQ(s8(e,lt(r,t,n),s3(([e,t])=>!!t),s4(([e,t,n,r])=>{let{enter:i,exit:o}=t;if(n){if(o(e,r))return!1}else if(i(e,r))return!0;return n}),s5()),t),s8(ll(t,e,n),lt(r))(1,([[e,t,n],r])=>{e&&r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},sK(ue),{singleton:!0}),uw=la(([{scrollContainerState:e,scrollTo:t}])=>{let n=li(),r=li(),i=li(),o=ln(!1),a=ln(void 0);return sQ(s8(ll(n,r),s4(([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n}))),e),sQ(s8(t,lt(r),s4(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:a,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},sK(lx)),uS=la(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:o},{useWindowScroll:a,windowScrollContainerState:s,windowViewportRect:l}])=>{let u=li(),c=ln(void 0),d=ln(null),h=ln(null);return sQ(s,d),sQ(l,h),s8(u,lt(t,r,a,d,h,n))(1,([e,t,n,r,i,o,a])=>{let s=lI(t.sizeTree).map(({k:e,v:t},n,r)=>{let i=r[n+1];return{endIndex:i?i.k-1:1/0,size:t,startIndex:e}});r&&null!==i&&null!==o&&(n=i.scrollTop-o.offsetTop),e({ranges:s,scrollTop:n-=a})}),sQ(s8(c,s3(sq),s4(uC)),i),sQ(s8(o,lt(c),s3(([,e])=>void 0!==e),s5(),s4(([,e])=>e.ranges)),e),{getState:u,restoreStateFrom:c}},sK(lX,lx,l6,l0,uw));function uC(e){return{align:"start",index:0,offset:e.scrollTop}}let uk=la(([{topItemsIndexes:e}])=>{let t=ln(0);return sQ(s8(t,s3(e=>e>=0),s4(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},sK(uc));function uM(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}let uT=uM(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),uA=la(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:o,lastJumpDueToItemResize:a,scrollDirection:s},{listState:l},{beforeUnshiftWith:u,gap:c,shiftWithOffset:d,sizes:h},{log:p},{recalcInProgress:f}])=>{let g=lo(s8(l,lt(a),s9(([,e,t,n],[{bottom:r,items:i,offsetBottom:o,totalCount:a},s])=>{let l=r+o,u=0;return t===a&&e.length>0&&i.length>0&&(0===i[0].originalIndex&&0===e[0].originalIndex||0!=(u=l-n)&&(u+=s)),[u,i,a,l]},[0,[],0,0]),s3(([e])=>0!==e),lt(r,s,n,i,p,f),s3(([,e,t,n,,,r])=>!r&&!n&&0!==e&&"up"===t),s4(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},ld.DEBUG),e))));function m(n){var r,i;n>0?(t(0,{behavior:"auto",top:-n}),r=0,e(0,0)):(i=0,e(0,0),t(0,{behavior:"auto",top:-n}))}return s8(g,lt(e,o))(1,([t,n,r])=>{r&&uT()?e(0,n-t):m(-t)}),s8(ll(lr(o,!1),e,f),s3(([e,t,n])=>!e&&!n&&0!==t),s4(([e,t])=>t),le(1))(1,m),sQ(s8(d,s4(e=>({top:-e}))),t),s8(u,lt(h,c),s4(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{if(0===t.length)return e*(n+i);{let o=0,a=lk(r,0),s=0,l=0;for(;s<e;){s++,o+=a;let r=t.length===l+1?1/0:t[l+1]-t[l]-1;s+r>e&&(o-=a,r=e-s+1),s+=r,o+=r*(n+i),l++}return o}}))(1,n=>{e(0,n),requestAnimationFrame(()=>{t(0,{top:n}),requestAnimationFrame(()=>{var t;t=0,e(0,0),f(0,!1)})})}),{deviation:e}},sK(lx,ue,uc,lX,lf,lZ)),uI=la(([e,t,n,r,i,o,a,s,l,u])=>({...e,...t,...n,...r,...i,...o,...a,...s,...l,...u}),sK(uo,um,l0,ux,ud,uv,uh,uw,ub,lf)),uP=la(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,gap:i,groupIndices:o,itemSize:a,sizeRanges:s,sizes:l,statefulTotalCount:u,totalCount:c,trackItemSizes:d},{initialItemFinalLocationReached:h,initialTopMostItemIndex:p,scrolledToInitialItem:f},g,m,v,{listState:y,topItemsIndexes:b,...x},{scrollToIndex:w},S,{topItemCount:C},{groupCounts:k},M])=>(sQ(x.rangeChanged,M.scrollSeekRangeChanged),sQ(s8(M.windowViewportRect,s4(e=>e.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,gap:i,groupCounts:k,initialItemFinalLocationReached:h,initialTopMostItemIndex:p,scrolledToInitialItem:f,sizeRanges:s,topItemCount:C,topItemsIndexes:b,totalCount:c,...v,groupIndices:o,itemSize:a,listState:y,scrollToIndex:w,statefulTotalCount:u,trackItemSizes:d,...x,...M,...g,sizes:l,...m}),sK(lX,l6,lx,uS,ug,uc,l5,uA,uk,lQ,uI)),uR="u">typeof document?g.useLayoutEffect:g.useEffect;function uO(e,t,n){let r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),o=Object.keys(t.methods||{}),a=Object.keys(t.events||{}),s=g.createContext({});function l(e,n){var o,a,s,l;for(let i of(e.propsReady&&(o=e.propsReady,o(0,!1)),r)){a=e[t.required[i]],a(0,n[i])}for(let r of i){r in n&&(s=e[t.optional[r]],s(0,n[r]))}e.propsReady&&(l=e.propsReady,l(0,!0))}function u(e){return a.reduce((n,r)=>(n[r]=function(e){let t,n;let r=()=>null==t?void 0:t();return function(i,o){switch(i){case 1:return o?n===o?void 0:(r(),n=o,t=e(1,o)):(r(),sG);case 2:r(),n=null;return}}}(e[t.events[r]]),n),{})}return{Component:g.forwardRef((c,d)=>{var h;let{children:p,...m}=c,[v]=g.useState(()=>{var t;return l(t=function(e){let t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:o})=>{if(o&&t.has(i))return t.get(i);let a=e(r.map(e=>n(e)));return o&&t.set(i,a),a};return n(e)}(e),m),t}),[y]=g.useState(()=>u(v));return uR(()=>{for(let e of a)e in m&&(0,y[e])(1,m[e]);return()=>{Object.values(y).map(sX)}},[m,y,v]),uR(()=>{l(v,m)}),g.useImperativeHandle(d,(h=o.reduce((e,n)=>(e[n]=e=>{var r;r=v[t.methods[n]],r(0,e)},e),{}),()=>h)),(0,f.jsx)(s.Provider,{value:v,children:n?(0,f.jsx)(n,{...function(e,t){let n={},r={},i=0,o=e.length;for(;i<o;)r[e[i]]=1,i+=1;for(let e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}([...r,...i,...a],m),children:p}):p})}),useEmitter:(e,t)=>{let n=g.useContext(s)[e];uR(()=>n(1,t),[t,n])},useEmitterValue:g.version.startsWith("18")?e=>{let t=g.useContext(s)[e],n=g.useCallback(e=>t(1,e),[t]);return g.useSyncExternalStore(n,()=>sJ(t),()=>sJ(t))}:e=>{let t=g.useContext(s)[e],[n,r]=g.useState(()=>sJ(t));return uR(()=>t(1,e=>{e!==n&&r(()=>e)}),[t,n]),n},usePublisher:e=>{var t;return g.useCallback((t=g.useContext(s)[e],e=>(function(e,t){e(0,t)})(t,e)),[e])}}}let uE=g.createContext(void 0),uD=g.createContext(void 0),uL="u">typeof document?g.useLayoutEffect:g.useEffect;function u_(e,t,n,r=sG,i,o){let a=g.useRef(null),s=g.useRef(null),l=g.useRef(null),u=g.useCallback(n=>{let r=n.target,i=r===window||r===document,a=o?i?window.pageXOffset||document.documentElement.scrollLeft:r.scrollLeft:i?window.pageYOffset||document.documentElement.scrollTop:r.scrollTop,u=o?i?document.documentElement.scrollWidth:r.scrollWidth:i?document.documentElement.scrollHeight:r.scrollHeight,c=o?i?window.innerWidth:r.offsetWidth:i?window.innerHeight:r.offsetHeight,d=()=>{e({scrollHeight:u,scrollTop:Math.max(a,0),viewportHeight:c})};n.suppressFlushSync?d():i0.flushSync(d),null!==s.current&&(a===s.current||a<=0||a===u-c)&&(s.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t]);return g.useEffect(()=>{let e=i||a.current;return r(i||a.current),u({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",u,{passive:!0}),()=>{r(null),e.removeEventListener("scroll",u)}},[a,u,n,r,i]),{scrollByCallback:function(e){o&&(e={behavior:e.behavior,left:e.top}),a.current.scrollBy(e)},scrollerRef:a,scrollToCallback:function(n){let r,i,u;let c=a.current;if(!c||(o?"offsetWidth"in c&&0===c.offsetWidth:"offsetHeight"in c&&0===c.offsetHeight))return;let d="smooth"===n.behavior;c===window?(i=Math.max(lB(document.documentElement,o?"width":"height"),o?document.documentElement.scrollWidth:document.documentElement.scrollHeight),r=o?window.innerWidth:window.innerHeight,u=o?document.documentElement.scrollLeft:document.documentElement.scrollTop):(i=c[o?"scrollWidth":"scrollHeight"],r=lB(c,o?"width":"height"),u=c[o?"scrollLeft":"scrollTop"]);let h=i-r;if(n.top=Math.ceil(Math.max(Math.min(h,n.top),0)),l8(r,i)||n.top===u){e({scrollHeight:i,scrollTop:u,viewportHeight:r}),d&&t(!0);return}d?(s.current=n.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,s.current=null,t(!0)},1e3)):s.current=null,o&&(n={behavior:n.behavior,left:n.top}),c.scrollTo(n)}}}let uN="-webkit-sticky",uZ="sticky",uj=uM(()=>{if(typeof document>"u")return uZ;let e=document.createElement("div");return e.style.position=uN,e.style.position===uN?uN:uZ});function uB(e){return e}let uF=la(()=>{let e=ln(e=>`Item ${e}`),t=ln(null),n=ln(e=>`Group ${e}`),r=ln({}),i=ln(uB),o=ln("div"),a=ln(sG),s=(e,t=null)=>lr(s8(r,s4(t=>t[e]),s5()),t);return{components:r,computeItemKey:i,context:t,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:n,HeaderComponent:s("Header"),HeaderFooterTag:o,ItemComponent:s("Item","div"),itemContent:e,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),uz=la(([e,t])=>({...e,...t}),sK(uP,uF)),u$=({height:e})=>(0,f.jsx)("div",{style:{height:e}}),uV={overflowAnchor:"none",position:uj(),zIndex:1},uH={overflowAnchor:"none"},uW={...uH,display:"inline-block",height:"100%"},uq=g.memo(function({showTopList:e=!1}){let t=u9("listState"),n=u7("sizeRanges"),r=u9("useWindowScroll"),i=u9("customScrollParent"),o=u7("windowScrollContainerState"),a=u7("scrollContainerState"),s=u9("itemContent"),l=u9("context"),u=u9("groupContent"),c=u9("trackItemSizes"),d=u9("itemSize"),h=u9("log"),p=u7("gap"),m=u9("horizontalDirection"),{callbackRef:v}=lv(n,d,c,e?sG:i||r?o:a,h,p,i,m,u9("skipAnimationFrameInResizeObserver")),[y,b]=g.useState(0);u8("deviation",e=>{y!==e&&b(e)});let x=u9("EmptyPlaceholder"),w=u9("ScrollSeekPlaceholder")||u$,S=u9("ListComponent"),C=u9("ItemComponent"),k=u9("GroupComponent"),M=u9("computeItemKey"),T=u9("isSeeking"),A=u9("groupIndices").length>0,I=u9("alignToBottom"),P=u9("initialItemFinalLocationReached"),R=e?{}:{boxSizing:"border-box",...m?{display:"inline-block",height:"100%",marginLeft:0!==y?y:I?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:0!==y?y:I?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...P?{}:{visibility:"hidden"}};return!e&&0===t.totalCount&&x?(0,f.jsx)(x,{...uX(x,l)}):(0,f.jsx)(S,{...uX(S,l),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:v,style:R,children:(e?t.topItems:t.items).map(e=>{let n=e.originalIndex,r=M(n+t.firstItemIndex,e.data,l);return T?(0,g.createElement)(w,{...uX(w,l),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?(0,g.createElement)(k,{...uX(k,l),"data-index":n,"data-item-index":e.index,"data-known-size":e.size,key:r,style:uV},u(e.index,l)):(0,g.createElement)(C,{...uX(C,l),...uJ(C,e.data),"data-index":n,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:m?uW:uH},A?s(e.index,e.groupIndex,e.data,l):s(e.index,e.data,l))})})}),uG={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},uU={outline:"none",overflowX:"auto",position:"relative"},uK=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),uY={position:uj(),top:0,width:"100%",zIndex:1};function uX(e,t){if("string"!=typeof e)return{context:t}}function uJ(e,t){return{item:"string"==typeof e?void 0:t}}let uQ=g.memo(function(){let e=u9("HeaderComponent"),t=u7("headerHeight"),n=u9("HeaderFooterTag"),r=lg(g.useMemo(()=>e=>{t(lB(e,"height"))},[t]),!0,u9("skipAnimationFrameInResizeObserver")),i=u9("context");return e?(0,f.jsx)(n,{ref:r,children:(0,f.jsx)(e,{...uX(e,i)})}):null}),u0=g.memo(function(){let e=u9("FooterComponent"),t=u7("footerHeight"),n=u9("HeaderFooterTag"),r=lg(g.useMemo(()=>e=>{t(lB(e,"height"))},[t]),!0,u9("skipAnimationFrameInResizeObserver")),i=u9("context");return e?(0,f.jsx)(n,{ref:r,children:(0,f.jsx)(e,{...uX(e,i)})}):null});function u1({useEmitter:e,useEmitterValue:t,usePublisher:n}){return g.memo(function({children:r,style:i,...o}){let a=n("scrollContainerState"),s=t("ScrollerComponent"),l=n("smoothScrollTargetReached"),u=t("scrollerRef"),c=t("context"),d=t("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:p,scrollToCallback:g}=u_(a,l,s,u,void 0,d);return e("scrollTo",g),e("scrollBy",h),(0,f.jsx)(s,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...d?uU:uG,...i},tabIndex:0,...o,...uX(s,c),children:r})})}function u2({useEmitter:e,useEmitterValue:t,usePublisher:n}){return g.memo(function({children:r,style:i,...o}){let a=n("windowScrollContainerState"),s=t("ScrollerComponent"),l=n("smoothScrollTargetReached"),u=t("totalListHeight"),c=t("deviation"),d=t("customScrollParent"),h=t("context"),{scrollByCallback:p,scrollerRef:g,scrollToCallback:m}=u_(a,l,s,sG,d);return uL(()=>(g.current=d||window,()=>{g.current=null}),[g,d]),e("windowScrollTo",m),e("scrollBy",p),(0,f.jsx)(s,{"data-virtuoso-scroller":!0,style:{position:"relative",...i,...0!==u?{height:u+c}:{}},...o,...uX(s,h),children:r})})}let u5=({children:e})=>{let t=g.useContext(uE),n=u7("viewportHeight"),r=u7("fixedItemHeight"),i=u9("alignToBottom"),o=u9("horizontalDirection"),a=lg(g.useMemo(()=>sW(n,e=>lB(e,o?"width":"height")),[n,o]),!0,u9("skipAnimationFrameInResizeObserver"));return g.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,f.jsx)("div",{"data-viewport-type":"element",ref:a,style:uK(i),children:e})},u3=({children:e})=>{let t=g.useContext(uE),n=u7("windowViewportRect"),r=u7("fixedItemHeight"),i=lb(n,u9("customScrollParent"),u9("skipAnimationFrameInResizeObserver")),o=u9("alignToBottom");return g.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,f.jsx)("div",{"data-viewport-type":"window",ref:i,style:uK(o),children:e})},u4=({children:e})=>{let t=u9("TopItemListComponent")||"div",n=u9("headerHeight"),r={...uY,marginTop:`${n}px`},i=u9("context");return(0,f.jsx)(t,{style:r,...uX(t,i),children:e})},{Component:u6,useEmitter:u8,useEmitterValue:u9,usePublisher:u7}=uO(uz,{events:{atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",endReached:"endReached",groupIndices:"groupIndices",isScrolling:"isScrolling",itemsRendered:"itemsRendered",rangeChanged:"rangeChanged",startReached:"startReached",totalListHeightChanged:"totalListHeightChanged"},methods:{autoscrollToBottom:"autoscrollToBottom",getState:"getState",scrollBy:"scrollBy",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollToIndex:"scrollToIndex"},optional:{alignToBottom:"alignToBottom",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",components:"components",computeItemKey:"computeItemKey",context:"context",customScrollParent:"customScrollParent",data:"data",defaultItemHeight:"defaultItemHeight",firstItemIndex:"firstItemIndex",fixedItemHeight:"fixedItemHeight",followOutput:"followOutput",groupContent:"groupContent",groupCounts:"groupCounts",headerFooterTag:"HeaderFooterTag",horizontalDirection:"horizontalDirection",increaseViewportBy:"increaseViewportBy",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",initialTopMostItemIndex:"initialTopMostItemIndex",itemContent:"itemContent",itemSize:"itemSize",logLevel:"logLevel",overscan:"overscan",restoreStateFrom:"restoreStateFrom",scrollerRef:"scrollerRef",scrollSeekConfiguration:"scrollSeekConfiguration",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver",topItemCount:"topItemCount",totalCount:"totalCount",useWindowScroll:"useWindowScroll"},required:{}},g.memo(function(e){let t=u9("useWindowScroll"),n=u9("topItemsIndexes").length>0,r=u9("customScrollParent"),i=u9("context"),o=r||t?ct:ce,a=r||t?u3:u5;return(0,f.jsxs)(o,{...e,...uX(o,i),children:[n&&(0,f.jsx)(u4,{children:(0,f.jsx)(uq,{showTopList:!0})}),(0,f.jsxs)(a,{children:[(0,f.jsx)(uQ,{}),(0,f.jsx)(uq,{}),(0,f.jsx)(u0,{})]})]})})),ce=u1({useEmitter:u8,useEmitterValue:u9,usePublisher:u7}),ct=u2({useEmitter:u8,useEmitterValue:u9,usePublisher:u7}),cn=la(()=>{let e=ln(e=>(0,f.jsxs)("td",{children:["Item $",e]})),t=ln(null),n=ln(null),r=ln(null),i=ln({}),o=ln(uB),a=ln(sG),s=(e,t=null)=>lr(s8(i,s4(t=>t[e]),s5()),t);return{components:i,computeItemKey:o,context:t,EmptyPlaceholder:s("EmptyPlaceholder"),FillerRow:s("FillerRow"),fixedFooterContent:r,fixedHeaderContent:n,itemContent:e,ScrollerComponent:s("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TableBodyComponent:s("TableBody","tbody"),TableComponent:s("Table","table"),TableFooterComponent:s("TableFoot","tfoot"),TableHeadComponent:s("TableHead","thead"),TableRowComponent:s("TableRow","tr")}}),cr=la(([e,t])=>({...e,...t}),sK(uP,cn)),ci=({height:e})=>(0,f.jsx)("tr",{children:(0,f.jsx)("td",{style:{height:e}})}),co=({height:e})=>(0,f.jsx)("tr",{children:(0,f.jsx)("td",{style:{border:0,height:e,padding:0}})}),ca={overflowAnchor:"none"},cs=g.memo(function({showTopList:e=!1}){let t=cp("listState"),n=cp("computeItemKey"),r=cp("firstItemIndex"),i=cp("isSeeking"),o=cp("ScrollSeekPlaceholder")||ci,a=cp("context"),s=cp("TableRowComponent"),l=cp("fixedHeaderHeight"),u=cp("itemContent"),c=(e?t.topItems:[]).reduce((e,t,n)=>(0===n?e.push(t.size):e.push(e[n-1]+t.size),e),[]),d=(e?t.topItems:t.items).map(t=>{let d=t.originalIndex,h=n(d+r,t.data,a),p=e?0===d?0:c[d-1]:0;return i?(0,g.createElement)(o,{...uX(o,a),height:t.size,index:t.index,key:h,type:t.type||"item"}):(0,g.createElement)(s,{...uX(s,a),...uJ(s,t.data),"data-index":d,"data-item-index":t.index,"data-known-size":t.size,key:h,style:e?{overflowAnchor:"none",position:"sticky",top:l+p,zIndex:2}:ca},u(t.index,t.data,a))});return(0,f.jsx)(f.Fragment,{children:d})}),cl=g.memo(function(){let e=cp("listState"),t=cp("topItemsIndexes").length>0,n=cf("sizeRanges"),r=cp("useWindowScroll"),i=cp("customScrollParent"),o=cf("windowScrollContainerState"),a=cf("scrollContainerState"),s=cp("trackItemSizes"),{callbackRef:l,ref:u}=lv(n,cp("itemSize"),s,i||r?o:a,cp("log"),void 0,i,!1,cp("skipAnimationFrameInResizeObserver")),[c,d]=g.useState(0);ch("deviation",e=>{c!==e&&(u.current.style.marginTop=`${e}px`,d(e))});let h=cp("EmptyPlaceholder"),p=cp("FillerRow")||co,m=cp("TableBodyComponent"),v=cp("paddingTopAddition"),y=cp("statefulTotalCount"),b=cp("context");if(0===y&&h)return(0,f.jsx)(h,{...uX(h,b)});let x=(t?e.topItems:[]).reduce((e,t)=>e+t.size,0),w=e.offsetTop+v+c-x,S=e.offsetBottom,C=w>0?(0,f.jsx)(p,{context:b,height:w},"padding-top"):null,k=S>0?(0,f.jsx)(p,{context:b,height:S},"padding-bottom"):null;return(0,f.jsxs)(m,{"data-testid":"virtuoso-item-list",ref:l,...uX(m,b),children:[C,t&&(0,f.jsx)(cs,{showTopList:!0}),(0,f.jsx)(cs,{}),k]})}),cu=({children:e})=>{let t=g.useContext(uE),n=cf("viewportHeight"),r=cf("fixedItemHeight"),i=lg(g.useMemo(()=>sW(n,e=>lB(e,"height")),[n]),!0,cp("skipAnimationFrameInResizeObserver"));return g.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,f.jsx)("div",{"data-viewport-type":"element",ref:i,style:uK(!1),children:e})},cc=({children:e})=>{let t=g.useContext(uE),n=cf("windowViewportRect"),r=cf("fixedItemHeight"),i=lb(n,cp("customScrollParent"),cp("skipAnimationFrameInResizeObserver"));return g.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,f.jsx)("div",{"data-viewport-type":"window",ref:i,style:uK(!1),children:e})},{Component:cd,useEmitter:ch,useEmitterValue:cp,usePublisher:cf}=uO(cr,{events:{atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",endReached:"endReached",groupIndices:"groupIndices",isScrolling:"isScrolling",itemsRendered:"itemsRendered",rangeChanged:"rangeChanged",startReached:"startReached",totalListHeightChanged:"totalListHeightChanged"},methods:{getState:"getState",scrollBy:"scrollBy",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollToIndex:"scrollToIndex"},optional:{alignToBottom:"alignToBottom",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",components:"components",computeItemKey:"computeItemKey",context:"context",customScrollParent:"customScrollParent",data:"data",defaultItemHeight:"defaultItemHeight",firstItemIndex:"firstItemIndex",fixedFooterContent:"fixedFooterContent",fixedHeaderContent:"fixedHeaderContent",fixedItemHeight:"fixedItemHeight",followOutput:"followOutput",groupCounts:"groupCounts",increaseViewportBy:"increaseViewportBy",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",initialTopMostItemIndex:"initialTopMostItemIndex",itemContent:"itemContent",itemSize:"itemSize",logLevel:"logLevel",overscan:"overscan",restoreStateFrom:"restoreStateFrom",scrollerRef:"scrollerRef",scrollSeekConfiguration:"scrollSeekConfiguration",topItemCount:"topItemCount",totalCount:"totalCount",useWindowScroll:"useWindowScroll"},required:{}},g.memo(function(e){let t=cp("useWindowScroll"),n=cp("customScrollParent"),r=cf("fixedHeaderHeight"),i=cf("fixedFooterHeight"),o=cp("fixedHeaderContent"),a=cp("fixedFooterContent"),s=cp("context"),l=lg(g.useMemo(()=>sW(r,e=>lB(e,"height")),[r]),!0,cp("skipAnimationFrameInResizeObserver")),u=lg(g.useMemo(()=>sW(i,e=>lB(e,"height")),[i]),!0,cp("skipAnimationFrameInResizeObserver")),c=n||t?cm:cg,d=n||t?cc:cu,h=cp("TableComponent"),p=cp("TableHeadComponent"),m=cp("TableFooterComponent"),v=o?(0,f.jsx)(p,{ref:l,style:{position:"sticky",top:0,zIndex:2},...uX(p,s),children:o()},"TableHead"):null,y=a?(0,f.jsx)(m,{ref:u,style:{bottom:0,position:"sticky",zIndex:1},...uX(m,s),children:a()},"TableFoot"):null;return(0,f.jsx)(c,{...e,...uX(c,s),children:(0,f.jsx)(d,{children:(0,f.jsxs)(h,{style:{borderSpacing:0,overflowAnchor:"none"},...uX(h,s),children:[v,(0,f.jsx)(cl,{},"TableBody"),y]})})})})),cg=u1({useEmitter:ch,useEmitterValue:cp,usePublisher:cf}),cm=u2({useEmitter:ch,useEmitterValue:cp,usePublisher:cf}),cv={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},cy={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:cb,floor:cx,max:cw,min:cS,round:cC}=Math;function ck(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function cM(e,t){return e&&e.width===t.width&&e.height===t.height}function cT(e,t){return e&&e.column===t.column&&e.row===t.row}let cA=la(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:o,scrollBy:a,scrollContainerState:s,scrollTo:l,scrollTop:u,smoothScrollTargetReached:c,viewportHeight:d},h,p,{didMount:f,propsReady:g},{customScrollParent:m,useWindowScroll:v,windowScrollContainerState:y,windowScrollTo:b,windowViewportRect:x},w])=>{let S=ln(0),C=ln(0),k=ln(cv),M=ln({height:0,width:0}),T=ln({height:0,width:0}),A=li(),I=li(),P=ln(0),R=ln(null),O=ln({column:0,row:0}),E=li(),D=li(),L=ln(!1),_=ln(0),N=ln(!0),Z=ln(!1),j=ln(!1);s8(f,lt(_),s3(([e,t])=>!!t))(1,()=>{N(0,!1)}),s8(ll(f,N,T,M,_,Z),s3(([e,t,n,r,,i])=>e&&!t&&0!==n.height&&0!==r.height&&!i))(1,([,,,,e])=>{Z(0,!0),l3(1,()=>{A(0,e)}),s0(s8(u),()=>{t(0,[0,0]),N(0,!0)})}),sQ(s8(D,s3(e=>null!=e&&e.scrollTop>0),s6(0)),C),s8(f,lt(D),s3(([,e])=>null!=e))(1,([,e])=>{e&&(M(0,e.viewport),T(0,e.item),O(0,e.gap),e.scrollTop>0&&(L(0,!0),s0(s8(u,s7(1)),e=>{L(0,!1)}),l(0,{top:e.scrollTop})))}),sQ(s8(M,s4(({height:e})=>e)),d),sQ(s8(ll(lu(M,cM),lu(T,cM),lu(O,(e,t)=>e&&e.column===t.column&&e.row===t.row),lu(u)),s4(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),E),sQ(s8(ll(lu(S),r,lu(O,cT),lu(T,cM),lu(M,cM),lu(R),lu(C),lu(L),lu(N),lu(_)),s3(([,,,,,,,e])=>!e),s4(([e,[t,n],r,i,o,a,s,,l,u])=>{let c,d;let{column:h,row:p}=r,{height:f,width:g}=i,{width:m}=o;if(0===s&&(0===e||0===m))return cv;if(0===g){var v;let t=l4(u,e),n=t+Math.max(s-1,0);return v=ck(t,n,a),{...cy,items:v}}let y=cI(m,g,h);l?0===t&&0===n&&s>0?(c=0,d=s-1):(c=y*cx((t+p)/(f+p)),d=cS(e-1,cw(d=y*cb((n+p)/(f+p))-1,y-1)),c=cS(d,cw(0,c))):(c=0,d=-1);let b=ck(c,d,a),{bottom:x,top:w}=cP(o,r,i,b),S=cb(e/y);return{bottom:x,itemHeight:f,items:b,itemWidth:g,offsetBottom:S*f+(S-1)*p-x,offsetTop:w,top:w}})),k),sQ(s8(R,s3(e=>null!==e),s4(e=>e.length)),S),sQ(s8(ll(M,T,k,O),s3(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),s4(([e,t,{items:n},r])=>{let{bottom:i,top:o}=cP(e,r,t,n);return[o,i]}),s5(lN)),t);let B=ln(!1);sQ(s8(u,lt(B),s4(([e,t])=>t||0!==e)),B);let F=lo(s8(ll(k,S),s3(([{items:e}])=>e.length>0),lt(B),s3(([[e,t],n])=>{let r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r}),s4(([[,e]])=>e-1),s5())),z=lo(s8(lu(k),s3(({items:e})=>e.length>0&&0===e[0].index),s6(0),s5())),$=lo(s8(lu(k),lt(L),s3(([{items:e},t])=>e.length>0&&!t),s4(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),s5(l_),le(0)));sQ($,p.scrollSeekRangeChanged),sQ(s8(A,lt(M,T,S,O),s4(([e,t,n,r,i])=>{let o=l2(e),{align:a,behavior:s,offset:l}=o,u=o.index;"LAST"===u&&(u=r-1);let c=cR(t,i,n,u=cw(0,u,cS(r-1,u)));return"end"===a?c=cC(c-t.height+n.height):"center"===a&&(c=cC(c-t.height/2+n.height/2)),l&&(c+=l),{behavior:s,top:c}})),l);let V=lr(s8(k,s4(e=>e.offsetBottom+e.bottom)),0);return sQ(s8(x,s4(e=>({height:e.visibleHeight,width:e.visibleWidth}))),M),{customScrollParent:m,data:R,deviation:P,footerHeight:i,gap:O,headerHeight:o,increaseViewportBy:e,initialItemCount:C,itemDimensions:T,overscan:n,restoreStateFrom:D,scrollBy:a,scrollContainerState:s,scrollHeight:I,scrollTo:l,scrollToIndex:A,scrollTop:u,smoothScrollTargetReached:c,totalCount:S,useWindowScroll:v,viewportDimensions:M,windowScrollContainerState:y,windowScrollTo:b,windowViewportRect:x,...p,gridState:k,horizontalDirection:j,initialTopMostItemIndex:_,totalListHeight:V,...h,endReached:F,propsReady:g,rangeChanged:$,startReached:z,stateChanged:E,stateRestoreInProgress:L,...w}},sK(uo,lx,ue,ux,l0,uw,lf));function cI(e,t,n){return cw(1,cx((e+n)/(cx(t)+n)))}function cP(e,t,n,r){let{height:i}=n;if(void 0===i||0===r.length)return{bottom:0,top:0};let o=cR(e,t,n,r[0].index);return{bottom:cR(e,t,n,r[r.length-1].index)+i,top:o}}function cR(e,t,n,r){let i=cx(r/cI(e.width,n.width,t.column)),o=i*n.height+cw(0,i-1)*t.row;return o>0?o+t.row:o}let cO=la(()=>{let e=ln(e=>`Item ${e}`),t=ln({}),n=ln(null),r=ln("virtuoso-grid-item"),i=ln("virtuoso-grid-list"),o=ln(uB),a=ln("div"),s=ln(sG),l=(e,n=null)=>lr(s8(t,s4(t=>t[e]),s5()),n),u=ln(!1),c=ln(!1);return sQ(lu(c),u),{components:t,computeItemKey:o,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:i,ListComponent:l("List","div"),readyStateChanged:u,reportReadyState:c,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),cE=la(([e,t])=>({...e,...t}),sK(cA,cO)),cD=g.memo(function(){let e=cB("gridState"),t=cB("listClassName"),n=cB("itemClassName"),r=cB("itemContent"),i=cB("computeItemKey"),o=cB("isSeeking"),a=cF("scrollHeight"),s=cB("ItemComponent"),l=cB("ListComponent"),u=cB("ScrollSeekPlaceholder"),c=cB("context"),d=cF("itemDimensions"),h=cF("gap"),p=cB("log"),m=cB("stateRestoreInProgress"),v=cF("reportReadyState"),y=lg(g.useMemo(()=>e=>{a(e.parentElement.parentElement.scrollHeight);let t=e.firstChild;if(t){let{height:e,width:n}=t.getBoundingClientRect();d({height:e,width:n})}h({column:cV("column-gap",getComputedStyle(e).columnGap,p),row:cV("row-gap",getComputedStyle(e).rowGap,p)})},[a,d,h,p]),!0,!1);return uL(()=>{e.itemHeight>0&&e.itemWidth>0&&v(!0)},[e]),m?null:(0,f.jsx)(l,{className:t,ref:y,...uX(l,c),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(t=>{let a=i(t.index,t.data,c);return o?(0,f.jsx)(u,{...uX(u,c),height:e.itemHeight,index:t.index,width:e.itemWidth},a):(0,g.createElement)(s,{...uX(s,c),className:n,"data-index":t.index,key:a},r(t.index,t.data,c))})})}),cL=g.memo(function(){let e=cB("HeaderComponent"),t=cF("headerHeight"),n=cB("headerFooterTag"),r=lg(g.useMemo(()=>e=>{t(lB(e,"height"))},[t]),!0,!1),i=cB("context");return e?(0,f.jsx)(n,{ref:r,children:(0,f.jsx)(e,{...uX(e,i)})}):null}),c_=g.memo(function(){let e=cB("FooterComponent"),t=cF("footerHeight"),n=cB("headerFooterTag"),r=lg(g.useMemo(()=>e=>{t(lB(e,"height"))},[t]),!0,!1),i=cB("context");return e?(0,f.jsx)(n,{ref:r,children:(0,f.jsx)(e,{...uX(e,i)})}):null}),cN=({children:e})=>{let t=g.useContext(uD),n=cF("itemDimensions"),r=cF("viewportDimensions"),i=lg(g.useMemo(()=>e=>{r(e.getBoundingClientRect())},[r]),!0,!1);return g.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),(0,f.jsx)("div",{ref:i,style:uK(!1),children:e})},cZ=({children:e})=>{let t=g.useContext(uD),n=cF("windowViewportRect"),r=cF("itemDimensions"),i=lb(n,cB("customScrollParent"),!1);return g.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),(0,f.jsx)("div",{ref:i,style:uK(!1),children:e})},{useEmitter:cj,useEmitterValue:cB,usePublisher:cF}=uO(cE,{events:{atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",endReached:"endReached",isScrolling:"isScrolling",rangeChanged:"rangeChanged",readyStateChanged:"readyStateChanged",startReached:"startReached",stateChanged:"stateChanged"},methods:{scrollBy:"scrollBy",scrollTo:"scrollTo",scrollToIndex:"scrollToIndex"},optional:{components:"components",computeItemKey:"computeItemKey",context:"context",customScrollParent:"customScrollParent",data:"data",headerFooterTag:"headerFooterTag",increaseViewportBy:"increaseViewportBy",initialItemCount:"initialItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",itemClassName:"itemClassName",itemContent:"itemContent",listClassName:"listClassName",logLevel:"logLevel",overscan:"overscan",restoreStateFrom:"restoreStateFrom",scrollerRef:"scrollerRef",scrollSeekConfiguration:"scrollSeekConfiguration",totalCount:"totalCount",useWindowScroll:"useWindowScroll"}},g.memo(function({...e}){let t=cB("useWindowScroll"),n=cB("customScrollParent"),r=n||t?c$:cz,i=n||t?cZ:cN,o=cB("context");return(0,f.jsx)(r,{...e,...uX(r,o),children:(0,f.jsxs)(i,{children:[(0,f.jsx)(cL,{}),(0,f.jsx)(cD,{}),(0,f.jsx)(c_,{})]})})})),cz=u1({useEmitter:cj,useEmitterValue:cB,usePublisher:cF}),c$=u2({useEmitter:cj,useEmitterValue:cB,usePublisher:cF});function cV(e,t,n){return"normal"===t||null!=t&&t.endsWith("px")||n(`${e} was not resolved to pixel value correctly`,t,ld.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}function cH(e){return(0,A.ZP)("MuiListItemButton",e)}let cW=(0,T.Z)("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),cq=e=>{let{alignItems:t,classes:n,dense:r,disabled:i,disableGutters:o,divider:a,selected:s}=e,l=(0,y.Z)({root:["root",r&&"dense",!o&&"gutters",a&&"divider",i&&"disabled","flex-start"===t&&"alignItemsFlexStart",s&&"selected"]},cH,n);return{...n,...l}},cG=(0,S.ZP)(ef,{shouldForwardProp:e=>(0,Z.Z)(e)||"classes"===e,name:"MuiListItemButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})((0,C.Z)(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${cW.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${cW.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${cW.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${cW.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${cW.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),cU=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiListItemButton"}),{alignItems:r="center",autoFocus:i=!1,component:o="div",children:a,dense:s=!1,disableGutters:l=!1,divider:u=!1,focusVisibleClassName:c,selected:d=!1,className:h,...p}=n,m=g.useContext(iz),y=g.useMemo(()=>({dense:s||m.dense||!1,alignItems:r,disableGutters:l}),[r,m.dense,s,l]),b=g.useRef(null);(0,rF.Z)(()=>{i&&b.current&&b.current.focus()},[i]);let x={...n,alignItems:r,dense:y.dense,disableGutters:l,divider:u,selected:d},w=cq(x),S=(0,B.Z)(b,t);return(0,f.jsx)(iz.Provider,{value:y,children:(0,f.jsx)(cG,{ref:S,href:p.href||p.to,component:(p.href||p.to)&&"div"===o?"button":o,focusVisibleClassName:(0,v.Z)(w.focusVisible,c),ownerState:x,className:(0,v.Z)(w.root,h),...p,classes:w,children:a})})});function cK(e){return(0,A.ZP)("MuiTypography",e)}let cY=(0,T.Z)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),cX={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},cJ=e=>{let{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:a}=e,s={root:["root",o,"inherit"!==e.align&&`align${(0,w.Z)(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return(0,y.Z)(s,cK,a)},cQ=(0,S.ZP)("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${(0,w.Z)(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})((0,C.Z)(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([e,t])=>"inherit"!==e&&t&&"object"==typeof t).map(([e,t])=>({props:{variant:e},style:t})),...Object.entries(e.palette).filter(k()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,e])=>"string"==typeof e).map(([t])=>({props:{color:`text${(0,w.Z)(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:e})=>"inherit"!==e.align,style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:e})=>e.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:e})=>e.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:e})=>e.paragraph,style:{marginBottom:16}}]}))),c0={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},c1=g.forwardRef(function(e,t){let{color:n,...r}=(0,M.i)({props:e,name:"MuiTypography"}),i=!cX[n],o=tj({...r,...i&&{color:n}}),{align:a="inherit",className:s,component:l,gutterBottom:u=!1,noWrap:c=!1,paragraph:d=!1,variant:h="body1",variantMapping:p=c0,...g}=o,m={...o,align:a,color:n,className:s,component:l,gutterBottom:u,noWrap:c,paragraph:d,variant:h,variantMapping:p},y=l||(d?"p":p[h]||c0[h])||"span",b=cJ(m);return(0,f.jsx)(cQ,{as:y,ref:t,className:(0,v.Z)(b.root,s),...g,ownerState:m,style:{..."inherit"!==a&&{"--Typography-textAlign":a},...g.style}})});function c2(e){return(0,A.ZP)("MuiListItemText",e)}let c5=(0,T.Z)("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),c3=e=>{let{classes:t,inset:n,primary:r,secondary:i,dense:o}=e;return(0,y.Z)({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},c2,t)},c4=(0,S.ZP)("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${c5.primary}`]:t.primary},{[`& .${c5.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${cY.root}:where(& .${c5.primary})`]:{display:"block"},[`.${cY.root}:where(& .${c5.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),c6=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiListItemText"}),{children:r,className:i,disableTypography:o=!1,inset:a=!1,primary:s,primaryTypographyProps:l,secondary:u,secondaryTypographyProps:c,slots:d={},slotProps:h={},...p}=n,{dense:m}=g.useContext(iz),y=null!=s?s:r,b=u,x={...n,disableTypography:o,inset:a,primary:!!y,secondary:!!b,dense:m},w=c3(x),S={slots:d,slotProps:{primary:l,secondary:c,...h}},[C,k]=of("root",{className:(0,v.Z)(w.root,i),elementType:c4,externalForwardedProps:{...S,...p},ownerState:x,ref:t}),[T,A]=of("primary",{className:w.primary,elementType:c1,externalForwardedProps:S,ownerState:x}),[I,P]=of("secondary",{className:w.secondary,elementType:c1,externalForwardedProps:S,ownerState:x});return null==y||y.type===c1||o||(y=(0,f.jsx)(T,{variant:m?"body2":"body1",component:A?.variant?void 0:"span",...A,children:y})),null==b||b.type===c1||o||(b=(0,f.jsx)(I,{variant:"body2",color:"textSecondary",...P,children:b})),(0,f.jsxs)(C,{...k,children:[y,b]})});function c8(...e){return e.flatMap(e=>void 0===e?[]:Array.isArray(e)?e:[e])}let c9=(0,g.memo)(function({color:e,sx:t,...n}){return(0,f.jsx)(tU,{...n,sx:c8({height:4,width:16,margin:e=>e.spacing(.5)},t),style:{backgroundColor:e}})}),c7=(0,g.forwardRef)(function({item:e,sx:t,truncateLabel:n,onClick:r,isVisuallySelected:i,onMouseOver:o,onMouseOut:a,index:s,...l},u){let[c,d]=(0,g.useState)(n);return(0,f.jsxs)(cU,{...l,role:"listitem",sx:c8({padding:0,cursor:"pointer"},t),dense:!0,onClick:t=>{r(t,e.id),e.onClick?.(t)},onMouseOver:t=>o?.(t,{id:e.id,index:s}),onMouseOut:t=>a?.(t,{id:e.id,index:s}),selected:i,ref:u,children:[(0,f.jsx)(tU,{sx:{display:"flex",alignItems:"center"},children:(0,f.jsx)(c9,{color:e.color})}),(0,f.jsx)(c6,{primary:e.label,primaryTypographyProps:{noWrap:c},onMouseOver:function(){n&&d(!1)},onMouseOut:function(){n&&d(!0)}})]})}),de=(0,g.memo)(c7);function dt(e,t){return"ALL"!==t&&!!t[e.id]}function dn({items:e,height:t,width:n,selectedItems:r,onLegendItemClick:i,onItemMouseOver:o,onItemMouseOut:a}){let s=e.length>5;return(0,f.jsx)(u6,{style:{height:t,width:n},data:e,itemContent:(e,t)=>(0,f.jsx)(de,{item:t,index:e,truncateLabel:s,isVisuallySelected:dt(t,r),onClick:i,onMouseOver:o,onMouseOut:a,sx:{width:"100%",wordBreak:"break-word",overflow:"hidden"}},t.id),role:"list"})}function dr({height:e,items:t,selectedItems:n,onLegendItemClick:r,onItemMouseOver:i,onItemMouseOut:o}){return(0,f.jsx)(tU,{component:"ul",sx:{width:"100%",height:e,padding:[0,1,0,0],overflowY:"scroll",margin:0},children:t.map((e,t)=>(0,f.jsx)(de,{item:e,index:t,isVisuallySelected:dt(e,n),onMouseOver:i,onMouseOut:o,onClick:r,sx:{width:"auto",float:"left",paddingRight:1.5}},e.id))})}function di(e,t){return"function"==typeof e?e(t):e}function da(e,t){return n=>{t.setState(t=>({...t,[e]:di(n,t[e])}))}}function ds(e){return e instanceof Function}function dl(e,t,n){let r,i=[];return o=>{let a,s;n.key&&n.debug&&(a=Date.now());let l=e(o);if(!(l.length!==i.length||l.some((e,t)=>i[t]!==e)))return r;if(i=l,n.key&&n.debug&&(s=Date.now()),r=t(...l),null==n||null==n.onChange||n.onChange(r),n.key&&n.debug&&null!=n&&n.debug()){let e=Math.round((Date.now()-a)*100)/100,t=Math.round((Date.now()-s)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
111
- font-size: .6rem;
112
- font-weight: bold;
113
- color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return r}}function du(e,t,n,r){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:r}}let dc="debugHeaders";function dd(e,t,n){var r;let i={id:null!=(r=n.id)?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(i),e},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(i,e)}),i}function dh(e,t,n,r){var i,o;let a=0,s=function(e,t){void 0===t&&(t=1),a=Math.max(a,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;null!=(n=e.columns)&&n.length&&s(e.columns,t+1)},0)};s(e);let l=[],u=(e,t)=>{let i={depth:t,id:[r,`${t}`].filter(Boolean).join("_"),headers:[]},o=[];e.forEach(e=>{let a;let s=[...o].reverse()[0],l=e.column.depth===i.depth,u=!1;if(l&&e.column.parent?a=e.column.parent:(a=e.column,u=!0),s&&(null==s?void 0:s.column)===a)s.subHeaders.push(e);else{let i=dd(n,a,{id:[r,t,a.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${o.filter(e=>e.column===a).length}`:void 0,depth:t,index:o.length});i.subHeaders.push(e),o.push(i)}i.headers.push(e),e.headerGroup=i}),l.push(i),t>0&&u(o,t-1)};u(t.map((e,t)=>dd(n,e,{depth:a,index:t})),a-1),l.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,r=[0];return e.subHeaders&&e.subHeaders.length?(r=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:i}=e;t+=n,r.push(i)})):t=1,n+=Math.min(...r),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(null!=(i=null==(o=l[0])?void 0:o.headers)?i:[]),l}let dp=(e,t,n,r,i,o,a)=>{let s={id:t,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];let n=e.getColumn(t);if(null!=n&&n.accessorFn)return s._valuesCache[t]=n.accessorFn(s.original,r),s._valuesCache[t]},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];let n=e.getColumn(t);return null!=n&&n.accessorFn?(n.columnDef.getUniqueValues?s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,r):s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=s.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=o?o:[],getLeafRows:()=>(function(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);null!=i&&i.length&&r(i)})};return r(e),n})(s.subRows,e=>e.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:dl(()=>[e.getAllLeafColumns()],t=>t.map(t=>(function(e,t,n,r){let i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>{var t;return null!=(t=i.getValue())?t:e.options.renderFallbackValue},getContext:dl(()=>[e,n,t,i],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),du(e.options,"debugCells","cell.getContext"))};return e._features.forEach(r=>{null==r.createCell||r.createCell(i,n,t,e)},{}),i})(e,s,t,t.id)),du(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:dl(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),du(e.options,"debugRows","getAllCellsByColumnId"))};for(let t=0;t<e._features.length;t++){let n=e._features[t];null==n||null==n.createRow||n.createRow(s,e)}return s},df=(e,t,n)=>{var r,i;let o=null==n||null==(r=n.toString())?void 0:r.toLowerCase();return!!(null==(i=e.getValue(t))||null==(i=i.toString())||null==(i=i.toLowerCase())?void 0:i.includes(o))};df.autoRemove=e=>dk(e);let dg=(e,t,n)=>{var r;return!!(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.includes(n))};dg.autoRemove=e=>dk(e);let dm=(e,t,n)=>{var r;return(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.toLowerCase())===(null==n?void 0:n.toLowerCase())};dm.autoRemove=e=>dk(e);let dv=(e,t,n)=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)};dv.autoRemove=e=>dk(e);let dy=(e,t,n)=>!n.some(n=>{var r;return!(null!=(r=e.getValue(t))&&r.includes(n))});dy.autoRemove=e=>dk(e)||!(null!=e&&e.length);let db=(e,t,n)=>n.some(n=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)});db.autoRemove=e=>dk(e)||!(null!=e&&e.length);let dx=(e,t,n)=>e.getValue(t)===n;dx.autoRemove=e=>dk(e);let dw=(e,t,n)=>e.getValue(t)==n;dw.autoRemove=e=>dk(e);let dS=(e,t,n)=>{let[r,i]=n,o=e.getValue(t);return o>=r&&o<=i};dS.resolveFilterValue=e=>{let[t,n]=e,r="number"!=typeof t?parseFloat(t):t,i="number"!=typeof n?parseFloat(n):n,o=null===t||Number.isNaN(r)?-1/0:r,a=null===n||Number.isNaN(i)?1/0:i;if(o>a){let e=o;o=a,a=e}return[o,a]},dS.autoRemove=e=>dk(e)||dk(e[0])&&dk(e[1]);let dC={includesString:df,includesStringSensitive:dg,equalsString:dm,arrIncludes:dv,arrIncludesAll:dy,arrIncludesSome:db,equals:dx,weakEquals:dw,inNumberRange:dS};function dk(e){return null==e||""===e}function dM(e,t,n){return!!e&&!!e.autoRemove&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}let dT={sum:(e,t,n)=>n.reduce((t,n)=>{let r=n.getValue(e);return t+("number"==typeof r?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(r>n||void 0===r&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(r<n||void 0===r&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(void 0===r?n>=n&&(r=i=n):(r>n&&(r=n),i<n&&(i=n)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let i=t.getValue(e);null!=i&&(i*=1)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!(Array.isArray(n)&&n.every(e=>"number"==typeof e)))return;if(1===n.length)return n[0];let r=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2!=0?i[r]:(i[r-1]+i[r])/2},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},dA=()=>({left:[],right:[]}),dI={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},dP=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),dR=null;function dO(e){return"touchstart"===e.type}function dE(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}let dD=()=>({pageIndex:0,pageSize:10}),dL=()=>({top:[],bottom:[]}),d_=(e,t,n,r,i)=>{var o;let a=i.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&null!=(o=a.subRows)&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(t=>d_(e,t.id,n,r,i))};function dN(e,t){let n=e.getState().rowSelection,r=[],i={},o=function(e,t){return e.map(e=>{var t;let a=dZ(e,n);if(a&&(r.push(e),i[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:o(e.subRows)}),a)return e}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function dZ(e,t){var n;return null!=(n=t[e.id])&&n}function dj(e,t,n){var r;if(!(null!=(r=e.subRows)&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(e=>{if((!o||i)&&(e.getCanSelect()&&(dZ(e,t)?o=!0:i=!1),e.subRows&&e.subRows.length)){let n=dj(e,t);"all"===n?o=!0:("some"===n&&(o=!0),i=!1)}}),i?"all":!!o&&"some"}let dB=/([0-9]+)/gm;function dF(e,t){return e===t?0:e>t?1:-1}function dz(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function d$(e,t){let n=e.split(dB).filter(Boolean),r=t.split(dB).filter(Boolean);for(;n.length&&r.length;){let e=n.shift(),t=r.shift(),i=parseInt(e,10),o=parseInt(t,10),a=[i,o].sort();if(isNaN(a[0])){if(e>t)return 1;if(t>e)return -1;continue}if(isNaN(a[1]))return isNaN(i)?-1:1;if(i>o)return 1;if(o>i)return -1}return n.length-r.length}let dV={alphanumeric:(e,t,n)=>d$(dz(e.getValue(n)).toLowerCase(),dz(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>d$(dz(e.getValue(n)),dz(t.getValue(n))),text:(e,t,n)=>dF(dz(e.getValue(n)).toLowerCase(),dz(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>dF(dz(e.getValue(n)),dz(t.getValue(n))),datetime:(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},basic:(e,t,n)=>dF(e.getValue(n),t.getValue(n))},dH=[{createTable:e=>{e.getHeaderGroups=dl(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,a;let s=null!=(o=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?o:[],l=null!=(a=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?a:[];return dh(t,[...s,...n.filter(e=>!(null!=r&&r.includes(e.id))&&!(null!=i&&i.includes(e.id))),...l],e)},du(e.options,dc,"getHeaderGroups")),e.getCenterHeaderGroups=dl(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>dh(t,n=n.filter(e=>!(null!=r&&r.includes(e.id))&&!(null!=i&&i.includes(e.id))),e,"center"),du(e.options,dc,"getCenterHeaderGroups")),e.getLeftHeaderGroups=dl(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;return dh(t,null!=(i=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?i:[],e,"left")},du(e.options,dc,"getLeftHeaderGroups")),e.getRightHeaderGroups=dl(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;return dh(t,null!=(i=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?i:[],e,"right")},du(e.options,dc,"getRightHeaderGroups")),e.getFooterGroups=dl(()=>[e.getHeaderGroups()],e=>[...e].reverse(),du(e.options,dc,"getFooterGroups")),e.getLeftFooterGroups=dl(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),du(e.options,dc,"getLeftFooterGroups")),e.getCenterFooterGroups=dl(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),du(e.options,dc,"getCenterFooterGroups")),e.getRightFooterGroups=dl(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),du(e.options,dc,"getRightFooterGroups")),e.getFlatHeaders=dl(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),du(e.options,dc,"getFlatHeaders")),e.getLeftFlatHeaders=dl(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),du(e.options,dc,"getLeftFlatHeaders")),e.getCenterFlatHeaders=dl(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),du(e.options,dc,"getCenterFlatHeaders")),e.getRightFlatHeaders=dl(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),du(e.options,dc,"getRightFlatHeaders")),e.getCenterLeafHeaders=dl(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),du(e.options,dc,"getCenterLeafHeaders")),e.getLeftLeafHeaders=dl(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),du(e.options,dc,"getLeftLeafHeaders")),e.getRightLeafHeaders=dl(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),du(e.options,dc,"getRightLeafHeaders")),e.getLeafHeaders=dl(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var r,i,o,a,s,l;return[...null!=(r=null==(i=e[0])?void 0:i.headers)?r:[],...null!=(o=null==(a=t[0])?void 0:a.headers)?o:[],...null!=(s=null==(l=n[0])?void 0:l.headers)?s:[]].map(e=>e.getLeafHeaders()).flat()},du(e.options,dc,"getLeafHeaders"))}},{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:da("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;let i=e.columns;return null==(n=i.length?i.some(e=>e.getIsVisible()):null==(r=t.getState().columnVisibility)?void 0:r[e.id])||n},e.getCanHide=()=>{var n,r;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(r=t.options.enableHiding)||r)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=dl(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),du(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=dl(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],du(t.options,"debugRows","getVisibleCells"))},createTable:e=>{let t=(t,n)=>dl(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),du(e.options,"debugColumns",t));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},{getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:da("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=dl(e=>[dE(t,e)],t=>t.findIndex(t=>t.id===e.id),du(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return(null==(r=dE(t,n)[0])?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;let i=dE(t,n);return(null==(r=i[i.length-1])?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=dl(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let i=[];if(null!=e&&e.length){let t=[...e],n=[...r];for(;n.length&&t.length;){let e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&i.push(n.splice(r,1)[0])}i=[...i,...n]}else i=r;return function(e,t,n){if(!(null!=t&&t.length)||!n)return e;let r=e.filter(e=>!t.includes(e.id));return"remove"===n?r:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...r]}(i,t,n)},du(e.options,"debugTable","_getOrderColumnsFn"))}},{getInitialState:e=>({columnPinning:dA(),...e}),getDefaultOptions:e=>({onColumnPinningChange:da("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{let r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,i,o,a,s,l;return"right"===n?{left:(null!=(o=null==e?void 0:e.left)?o:[]).filter(e=>!(null!=r&&r.includes(e))),right:[...(null!=(a=null==e?void 0:e.right)?a:[]).filter(e=>!(null!=r&&r.includes(e))),...r]}:"left"===n?{left:[...(null!=(s=null==e?void 0:e.left)?s:[]).filter(e=>!(null!=r&&r.includes(e))),...r],right:(null!=(l=null==e?void 0:e.right)?l:[]).filter(e=>!(null!=r&&r.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=r&&r.includes(e))),right:(null!=(i=null==e?void 0:e.right)?i:[]).filter(e=>!(null!=r&&r.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,r,i;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(r=null!=(i=t.options.enableColumnPinning)?i:t.options.enablePinning)||r)}),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(e=>null==r?void 0:r.includes(e)),a=n.some(e=>null==i?void 0:i.includes(e));return o?"left":!!a&&"right"},e.getPinnedIndex=()=>{var n,r;let i=e.getIsPinned();return i?null!=(n=null==(r=t.getState().columnPinning)||null==(r=r[i])?void 0:r.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=dl(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let r=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!r.includes(e.column.id))},du(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=dl(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"})),du(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=dl(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"})),du(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?dA():null!=(n=null==(r=e.initialState)?void 0:r.columnPinning)?n:dA())},e.getIsSomeColumnsPinned=t=>{var n,r,i;let o=e.getState().columnPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(r=o.left)?void 0:r.length)||(null==(i=o.right)?void 0:i.length))},e.getLeftLeafColumns=dl(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),du(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=dl(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),du(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=dl(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let r=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!r.includes(e.id))},du(e.options,"debugColumns","getCenterLeafColumns"))}},{createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},{getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:da("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"string"==typeof r?dC.includesString:"number"==typeof r?dC.inNumberRange:"boolean"==typeof r||null!==r&&"object"==typeof r?dC.equals:Array.isArray(r)?dC.arrIncludes:dC.weakEquals},e.getFilterFn=()=>{var n,r;return ds(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(r=t.options.filterFns)?void 0:r[e.columnDef.filterFn])?n:dC[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(r=t.options.enableColumnFilters)||r)&&(null==(i=t.options.enableFilters)||i)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find(t=>t.id===e.id))?void 0:n.value},e.getFilterIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().columnFilters)?void 0:r.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{var r,i;let o=e.getFilterFn(),a=null==t?void 0:t.find(t=>t.id===e.id),s=di(n,a?a.value:void 0);if(dM(o,s,e))return null!=(r=null==t?void 0:t.filter(t=>t.id!==e.id))?r:[];let l={id:e.id,value:s};return a?null!=(i=null==t?void 0:t.map(t=>t.id===e.id?l:t))?i:[]:null!=t&&t.length?[...t,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var r;return null==(r=di(t,e))?void 0:r.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&dM(t.getFilterFn(),e.value,t))})})},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel)?e.getPreFilteredRowModel():e._getFilteredRowModel()}},{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:da("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;let r=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof r||"number"==typeof r}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,o;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(r=t.options.enableGlobalFilter)||r)&&(null==(i=t.options.enableFilters)||i)&&(null==(o=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||o)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>dC.includesString,e.getGlobalFilterFn=()=>{var t,n;let{globalFilterFn:r}=e.options;return ds(r)?r:"auto"===r?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[r])?t:dC[r]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:da("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),r=!1;for(let t of n){let n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return dV.datetime;if("string"==typeof n&&(r=!0,n.split(dB).length>1))return dV.alphanumeric}return r?dV.text:dV.basic},e.getAutoSortDir=()=>{let n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw Error();return ds(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(r=t.options.sortingFns)?void 0:r[e.columnDef.sortingFn])?n:dV[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{let i=e.getNextSortingOrder(),o=null!=n;t.setSorting(a=>{let s;let l=null==a?void 0:a.find(t=>t.id===e.id),u=null==a?void 0:a.findIndex(t=>t.id===e.id),c=[],d=o?n:"desc"===i;if("toggle"!=(s=null!=a&&a.length&&e.getCanMultiSort()&&r?l?"toggle":"add":null!=a&&a.length&&u!==a.length-1?"replace":l?"toggle":"replace")||o||i||(s="remove"),"add"===s){var h;(c=[...a,{id:e.id,desc:d}]).splice(0,c.length-(null!=(h=t.options.maxMultiSortColCount)?h:Number.MAX_SAFE_INTEGER))}else c="toggle"===s?a.map(t=>t.id===e.id?{...t,desc:d}:t):"remove"===s?a.filter(t=>t.id!==e.id):[{id:e.id,desc:d}];return c})},e.getFirstSortDir=()=>{var n,r;return(null!=(n=null!=(r=e.columnDef.sortDescFirst)?r:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;let o=e.getFirstSortDir(),a=e.getIsSorted();return a?(a===o||null!=(r=t.options.enableSortingRemoval)&&!r||!!n&&null!=(i=t.options.enableMultiRemove)&&!i)&&("desc"===a?"asc":"desc"):o},e.getCanSort=()=>{var n,r;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(r=t.options.enableSorting)||r)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return null!=(n=null!=(r=e.columnDef.enableMultiSort)?r:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;let r=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!r&&(r.desc?"desc":"asc")},e.getSortIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().sorting)?void 0:r.findIndex(t=>t.id===e.id))?n:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return r=>{n&&(null==r.persist||r.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(r))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel)?e.getPreSortedRowModel():e._getSortedRowModel()}},{getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:da("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var n,r;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(r=t.options.enableGrouping)||r)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"number"==typeof r?dT.sum:"[object Date]"===Object.prototype.toString.call(r)?dT.extent:void 0},e.getAggregationFn=()=>{var n,r;if(!e)throw Error();return ds(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(r=t.options.aggregationFns)?void 0:r[e.columnDef.aggregationFn])?n:dT[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel)?e.getPreGroupedRowModel():e._getGroupedRowModel()},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let r=t.getColumn(n);return null!=r&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!(null!=(t=n.subRows)&&t.length)}}},{getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:da("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if(null!=(r=null!=(i=e.options.autoResetAll)?i:e.options.autoResetExpanded)?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,r;e.setExpanded(t?{}:null!=(n=null==(r=e.initialState)?void 0:r.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return"boolean"==typeof t?!0===t:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(".");t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel)?e.getPreExpandedRowModel():e._getExpandedRowModel()},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;let o=!0===r||!!(null!=r&&r[e.id]),a={};if(!0===r?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=r,n=null!=(i=n)?i:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){let{[e.id]:t,...n}=a;return n}return r})},e.getIsExpanded=()=>{var n;let r=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===r||(null==r?void 0:r[e.id]))},e.getCanExpand=()=>{var n,r,i;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(r=t.options.enableExpanding)||r)&&!!(null!=(i=e.subRows)&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)n=(r=t.getRow(r.parentId,!0)).getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{...dD(),...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:da("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if(null!=(r=null!=(i=e.options.autoResetAll)?i:e.options.autoResetPageIndex)?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>di(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?dD():null!=(n=e.initialState.pagination)?n:dD())},e.setPageIndex=t=>{e.setPagination(n=>{let r=di(t,n.pageIndex);return r=Math.max(0,Math.min(r,void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n,r;e.setPageIndex(t?0:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageIndex)?n:0)},e.resetPageSize=t=>{var n,r;e.setPageSize(t?10:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,di(t,e.pageSize)),r=Math.floor(e.pageSize*e.pageIndex/n);return{...e,pageIndex:r,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var r;let i=di(t,null!=(r=e.options.pageCount)?r:-1);return"number"==typeof i&&(i=Math.max(-1,i)),{...n,pageCount:i}}),e.getPageOptions=dl(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},du(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return -1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel)?e.getPrePaginationRowModel():e._getPaginationRowModel(),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},{getInitialState:e=>({rowPinning:dL(),...e}),getDefaultOptions:e=>({onRowPinningChange:da("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{let o=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],a=new Set([...i?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],e.id,...o]);t.setRowPinning(e=>{var t,r,i,o,s,l;return"bottom"===n?{top:(null!=(i=null==e?void 0:e.top)?i:[]).filter(e=>!(null!=a&&a.has(e))),bottom:[...(null!=(o=null==e?void 0:e.bottom)?o:[]).filter(e=>!(null!=a&&a.has(e))),...Array.from(a)]}:"top"===n?{top:[...(null!=(s=null==e?void 0:e.top)?s:[]).filter(e=>!(null!=a&&a.has(e))),...Array.from(a)],bottom:(null!=(l=null==e?void 0:e.bottom)?l:[]).filter(e=>!(null!=a&&a.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=a&&a.has(e))),bottom:(null!=(r=null==e?void 0:e.bottom)?r:[]).filter(e=>!(null!=a&&a.has(e)))}})},e.getCanPin=()=>{var n;let{enableRowPinning:r,enablePinning:i}=t.options;return"function"==typeof r?r(e):null==(n=null!=r?r:i)||n},e.getIsPinned=()=>{let n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(e=>null==r?void 0:r.includes(e)),a=n.some(e=>null==i?void 0:i.includes(e));return o?"top":!!a&&"bottom"},e.getPinnedIndex=()=>{var n,r;let i=e.getIsPinned();if(!i)return -1;let o=null==(n="top"===i?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(r=null==o?void 0:o.indexOf(e.id))?r:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?dL():null!=(n=null==(r=e.initialState)?void 0:r.rowPinning)?n:dL())},e.getIsSomeRowsPinned=t=>{var n,r,i;let o=e.getState().rowPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(r=o.top)?void 0:r.length)||(null==(i=o.bottom)?void 0:i.length))},e._getPinnedRows=(t,n,r)=>{var i;return(null==(i=e.options.keepPinnedRows)||i?(null!=n?n:[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(null!=n?n:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:r}))},e.getTopRows=dl(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),du(e.options,"debugRows","getTopRows")),e.getBottomRows=dl(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),du(e.options,"debugRows","getBottomRows")),e.getCenterRows=dl(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let r=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!r.has(e.id))},du(e.options,"debugRows","getCenterRows"))}},{getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:da("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();let r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):i.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let r=void 0!==t?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(t=>{d_(i,t.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=dl(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?dN(e,n):{rows:[],flatRows:[],rowsById:{}},du(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=dl(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?dN(e,n):{rows:[],flatRows:[],rowsById:{}},du(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=dl(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?dN(e,n):{rows:[],flatRows:[],rowsById:{}},du(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),r=!!(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;let n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{let i=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=void 0!==n?n:!i,e.getCanSelect()&&i===n)return o;let s={...o};return d_(s,e.id,n,null==(a=null==r?void 0:r.selectChildren)||a,t),s})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return dZ(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return"some"===dj(e,n)},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return"all"===dj(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{var r;t&&e.toggleSelected(null==(r=n.target)?void 0:r.checked)}}}},{getDefaultColumnDef:()=>dI,getInitialState:e=>({columnSizing:{},columnSizingInfo:dP(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:da("columnSizing",e),onColumnSizingInfoChange:da("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;let o=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:dI.minSize,null!=(r=null!=o?o:e.columnDef.size)?r:dI.size),null!=(i=e.columnDef.maxSize)?i:dI.maxSize)},e.getStart=dl(e=>[e,dE(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),du(t.options,"debugColumns","getStart")),e.getAfter=dl(e=>[e,dE(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),du(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>{var n,r;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(r=t.options.enableColumnResizing)||r)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{if(e.subHeaders.length)e.subHeaders.forEach(n);else{var r;t+=null!=(r=e.column.getSize())?r:0}};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let r=t.getColumn(e.column.id),i=null==r?void 0:r.getCanResize();return o=>{if(!r||!i||(null==o.persist||o.persist(),dO(o)&&o.touches&&o.touches.length>1))return;let a=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],l=dO(o)?Math.round(o.touches[0].clientX):o.clientX,u={},c=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var r,i;let o="rtl"===t.options.columnResizeDirection?-1:1,a=(n-(null!=(r=null==e?void 0:e.startOffset)?r:0))*o,s=Math.max(a/(null!=(i=null==e?void 0:e.startSize)?i:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;u[t]=Math.round(100*Math.max(n+n*s,0))/100}),{...e,deltaOffset:a,deltaPercentage:s}}),("onChange"===t.options.columnResizeMode||"end"===e)&&t.setColumnSizing(e=>({...e,...u})))},d=e=>c("move",e),h=e=>{c("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||"undefined"!=typeof document?document:null,f={moveHandler:e=>d(e.clientX),upHandler:e=>{null==p||p.removeEventListener("mousemove",f.moveHandler),null==p||p.removeEventListener("mouseup",f.upHandler),h(e.clientX)}},g={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{var t;null==p||p.removeEventListener("touchmove",g.moveHandler),null==p||p.removeEventListener("touchend",g.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),h(null==(t=e.touches[0])?void 0:t.clientX)}},m=!!function(){if("boolean"==typeof dR)return dR;let e=!1;try{let t=()=>{};window.addEventListener("test",t,{get passive(){return e=!0,!1}}),window.removeEventListener("test",t)}catch(t){e=!1}return dR=e}()&&{passive:!1};dO(o)?(null==p||p.addEventListener("touchmove",g.moveHandler,m),null==p||p.addEventListener("touchend",g.upHandler,m)):(null==p||p.addEventListener("mousemove",f.moveHandler,m),null==p||p.addEventListener("mouseup",f.upHandler,m)),t.setColumnSizingInfo(e=>({...e,startOffset:l,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?dP():null!=(n=e.initialState.columnSizingInfo)?n:dP())},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}}],dW=g.createContext();function dq(e){return(0,A.ZP)("MuiTableRow",e)}let dG=(0,T.Z)("MuiTableRow",["root","selected","hover","head","footer"]),dU=e=>{let{classes:t,selected:n,hover:r,head:i,footer:o}=e;return(0,y.Z)({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},dq,t)},dK=(0,S.ZP)("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})((0,C.Z)(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${dG.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${dG.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}}))),dY=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiTableRow"}),{className:r,component:i="tr",hover:o=!1,selected:a=!1,...s}=n,l=g.useContext(dW),u={...n,component:i,hover:o,selected:a,head:l&&"head"===l.variant,footer:l&&"footer"===l.variant},c=dU(u);return(0,f.jsx)(dK,{as:i,ref:t,className:(0,v.Z)(c.root,r),role:"tr"===i?null:"row",ownerState:u,...s})});function dX(e){return(0,A.ZP)("MuiDivider",e)}let dJ=(0,T.Z)("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),dQ=(0,T.Z)("MuiListItemIcon",["root","alignItemsFlexStart"]);function d0(e){return(0,A.ZP)("MuiMenuItem",e)}let d1=(0,T.Z)("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),d2=e=>{let{disabled:t,dense:n,divider:r,disableGutters:i,selected:o,classes:a}=e,s=(0,y.Z)({root:["root",n&&"dense",t&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},d0,a);return{...a,...s}},d5=(0,S.ZP)(ef,{shouldForwardProp:e=>(0,Z.Z)(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})((0,C.Z)(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${d1.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${d1.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${d1.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${d1.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${d1.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${dJ.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${dJ.inset}`]:{marginLeft:52},[`& .${c5.root}`]:{marginTop:0,marginBottom:0},[`& .${c5.inset}`]:{paddingLeft:36},[`& .${dQ.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${dQ.root} svg`]:{fontSize:"1.25rem"}}}]}))),d3=g.forwardRef(function(e,t){let n;let r=(0,M.i)({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:a=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:u,role:c="menuitem",tabIndex:d,className:h,...p}=r,m=g.useContext(iz),y=g.useMemo(()=>({dense:a||m.dense||!1,disableGutters:l}),[m.dense,a,l]),b=g.useRef(null);(0,rF.Z)(()=>{i&&b.current&&b.current.focus()},[i]);let x={...r,dense:y.dense,divider:s,disableGutters:l},w=d2(r),S=(0,B.Z)(b,t);return r.disabled||(n=void 0!==d?d:-1),(0,f.jsx)(iz.Provider,{value:y,children:(0,f.jsx)(d5,{ref:S,role:c,tabIndex:n,component:o,focusVisibleClassName:(0,v.Z)(w.focusVisible,u),className:(0,v.Z)(w.root,h),...p,ownerState:x,classes:w})})}),d4=g.createContext();function d6(e){return(0,A.ZP)("MuiTableCell",e)}let d8=(0,T.Z)("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),d9=e=>{let{classes:t,variant:n,align:r,padding:i,size:o,stickyHeader:a}=e,s={root:["root",n,a&&"stickyHeader","inherit"!==r&&`align${(0,w.Z)(r)}`,"normal"!==i&&`padding${(0,w.Z)(i)}`,`size${(0,w.Z)(o)}`]};return(0,y.Z)(s,d6,t)},d7=(0,S.ZP)("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`size${(0,w.Z)(n.size)}`],"normal"!==n.padding&&t[`padding${(0,w.Z)(n.padding)}`],"inherit"!==n.align&&t[`align${(0,w.Z)(n.align)}`],n.stickyHeader&&t.stickyHeader]}})((0,C.Z)(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid
114
- ${"light"===e.palette.mode?(0,b.$n)((0,b.Fq)(e.palette.divider,1),.88):(0,b._j)((0,b.Fq)(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${d8.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),he=g.forwardRef(function(e,t){let n;let r=(0,M.i)({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:a,padding:s,scope:l,size:u,sortDirection:c,variant:d,...h}=r,p=g.useContext(d4),m=g.useContext(dW),y=m&&"head"===m.variant,b=l;"td"===(n=a||(y?"th":"td"))?b=void 0:!b&&y&&(b="col");let x=d||m&&m.variant,w={...r,align:i,component:n,padding:s||(p&&p.padding?p.padding:"normal"),size:u||(p&&p.size?p.size:"medium"),sortDirection:c,stickyHeader:"head"===x&&p&&p.stickyHeader,variant:x},S=d9(w),C=null;return c&&(C="asc"===c?"ascending":"descending"),(0,f.jsx)(d7,{as:n,ref:t,className:(0,v.Z)(S.root,o),"aria-sort":C,scope:b,ownerState:w,...h})});function ht(e){return(0,A.ZP)("MuiToolbar",e)}(0,T.Z)("MuiToolbar",["root","gutters","regular","dense"]);let hn=e=>{let{classes:t,disableGutters:n,variant:r}=e;return(0,y.Z)({root:["root",!n&&"gutters",r]},ht,t)},hr=(0,S.ZP)("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})((0,C.Z)(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),hi=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiToolbar"}),{className:r,component:i="div",disableGutters:o=!1,variant:a="regular",...s}=n,l={...n,component:i,disableGutters:o,variant:a},u=hn(l);return(0,f.jsx)(hr,{as:i,className:(0,v.Z)(u.root,r),ref:t,ownerState:l,...s})}),ho=(0,ad.Z)((0,f.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),ha=(0,ad.Z)((0,f.jsx)("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),hs=(0,ad.Z)((0,f.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),hl=(0,ad.Z)((0,f.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),hu=g.forwardRef(function(e,t){let{backIconButtonProps:n,count:r,disabled:i=!1,getItemAriaLabel:o,nextIconButtonProps:a,onPageChange:s,page:l,rowsPerPage:u,showFirstButton:c,showLastButton:d,slots:h={},slotProps:p={},...g}=e,m=iL(),v=h.firstButton??rx,y=h.lastButton??rx,b=h.nextButton??rx,x=h.previousButton??rx,w=h.firstButtonIcon??hl,S=h.lastButtonIcon??hs,C=h.nextButtonIcon??ha,k=h.previousButtonIcon??ho,M=m?y:v,T=m?b:x,A=m?x:b,I=m?v:y,P=m?p.lastButton:p.firstButton,R=m?p.nextButton:p.previousButton,O=m?p.previousButton:p.nextButton,E=m?p.firstButton:p.lastButton;return(0,f.jsxs)("div",{ref:t,...g,children:[c&&(0,f.jsx)(M,{onClick:e=>{s(e,0)},disabled:i||0===l,"aria-label":o("first",l),title:o("first",l),...P,children:m?(0,f.jsx)(S,{...p.lastButtonIcon}):(0,f.jsx)(w,{...p.firstButtonIcon})}),(0,f.jsx)(T,{onClick:e=>{s(e,l-1)},disabled:i||0===l,color:"inherit","aria-label":o("previous",l),title:o("previous",l),...R??n,children:m?(0,f.jsx)(C,{...p.nextButtonIcon}):(0,f.jsx)(k,{...p.previousButtonIcon})}),(0,f.jsx)(A,{onClick:e=>{s(e,l+1)},disabled:i||-1!==r&&l>=Math.ceil(r/u)-1,color:"inherit","aria-label":o("next",l),title:o("next",l),...O??a,children:m?(0,f.jsx)(k,{...p.previousButtonIcon}):(0,f.jsx)(C,{...p.nextButtonIcon})}),d&&(0,f.jsx)(I,{onClick:e=>{s(e,Math.max(0,Math.ceil(r/u)-1))},disabled:i||l>=Math.ceil(r/u)-1,"aria-label":o("last",l),title:o("last",l),...E,children:m?(0,f.jsx)(w,{...p.firstButtonIcon}):(0,f.jsx)(S,{...p.lastButtonIcon})})]})});function hc(e){return(0,A.ZP)("MuiTablePagination",e)}let hd=(0,T.Z)("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]),hh=(0,S.ZP)(he,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})((0,C.Z)(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),hp=(0,S.ZP)(hi,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${hd.actions}`]:t.actions,...t.toolbar})})((0,C.Z)(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${hd.actions}`]:{flexShrink:0,marginLeft:20}}))),hf=(0,S.ZP)("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),hg=(0,S.ZP)("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})((0,C.Z)(({theme:e})=>({...e.typography.body2,flexShrink:0}))),hm=(0,S.ZP)(ay,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${hd.selectIcon}`]:t.selectIcon,[`& .${hd.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${hd.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),hv=(0,S.ZP)(d3,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),hy=(0,S.ZP)("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})((0,C.Z)(({theme:e})=>({...e.typography.body2,flexShrink:0})));function hb({from:e,to:t,count:n}){return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`}function hx(e){return`Go to ${e} page`}let hw=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},hc,t)},hS=g.forwardRef(function(e,t){let n;let r=(0,M.i)({props:e,name:"MuiTablePagination"}),{ActionsComponent:i=hu,backIconButtonProps:o,colSpan:a,component:s=he,count:l,disabled:u=!1,getItemAriaLabel:c=hx,labelDisplayedRows:d=hb,labelRowsPerPage:h="Rows per page:",nextIconButtonProps:p,onPageChange:m,onRowsPerPageChange:y,page:b,rowsPerPage:x,rowsPerPageOptions:w=[10,25,50,100],SelectProps:S={},showFirstButton:C=!1,showLastButton:k=!1,slotProps:T={},slots:A={},...I}=r,P=hw(r),R=T?.select??S,O=R.native?"option":hv;(s===he||"td"===s)&&(n=a||1e3);let E=(0,N.Z)(R.id),D=(0,N.Z)(R.labelId),L={slots:A,slotProps:T},[_,Z]=of("root",{ref:t,className:P.root,elementType:hh,externalForwardedProps:{...L,component:s,...I},ownerState:r,additionalProps:{colSpan:n}}),[j,B]=of("toolbar",{className:P.toolbar,elementType:hp,externalForwardedProps:L,ownerState:r}),[F,z]=of("spacer",{className:P.spacer,elementType:hf,externalForwardedProps:L,ownerState:r}),[$,V]=of("selectLabel",{className:P.selectLabel,elementType:hg,externalForwardedProps:L,ownerState:r,additionalProps:{id:D}}),[H,W]=of("select",{className:P.select,elementType:hm,externalForwardedProps:L,ownerState:r}),[q,G]=of("menuItem",{className:P.menuItem,elementType:O,externalForwardedProps:L,ownerState:r}),[U,K]=of("displayedRows",{className:P.displayedRows,elementType:hy,externalForwardedProps:L,ownerState:r});return(0,f.jsx)(_,{...Z,children:(0,f.jsxs)(j,{...B,children:[(0,f.jsx)(F,{...z}),w.length>1&&(0,f.jsx)($,{...V,children:h}),w.length>1&&(0,f.jsx)(H,{variant:"standard",...!R.variant&&{input:N6||(N6=(0,f.jsx)(rX,{}))},value:x,onChange:y,id:E,labelId:D,...R,classes:{...R.classes,root:(0,v.Z)(P.input,P.selectRoot,(R.classes||{}).root),select:(0,v.Z)(P.select,(R.classes||{}).select),icon:(0,v.Z)(P.selectIcon,(R.classes||{}).icon)},disabled:u,...W,children:w.map(e=>(0,g.createElement)(q,{...G,key:e.label?e.label:e,value:e.value?e.value:e},e.label?e.label:e))}),(0,f.jsx)(U,{...K,children:d({from:0===l?0:b*x+1,to:-1===l?(b+1)*x:-1===x?l:Math.min(l,(b+1)*x),count:-1===l?-1:l,page:b})}),(0,f.jsx)(i,{className:P.actions,backIconButtonProps:o,count:l,nextIconButtonProps:p,onPageChange:m,page:b,rowsPerPage:x,showFirstButton:C,showLastButton:k,slotProps:T.actions,slots:A.actions,getItemAriaLabel:c,disabled:u})]})})}),hC=(0,g.forwardRef)(function(e,t){return(0,f.jsx)(dY,{...e,ref:t,sx:{backgroundColor:e=>e.palette.background.default,"&:hover":{backgroundColor:e=>(0,b.Fq)(e.palette.primary.main,e.palette.action.hoverOpacity)}}})});function hk(e){return(0,A.ZP)("MuiTableBody",e)}(0,T.Z)("MuiTableBody",["root"]);let hM=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"]},hk,t)},hT=(0,S.ZP)("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),hA={variant:"body"},hI="tbody",hP=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiTableBody"}),{className:r,component:i=hI,...o}=n,a={...n,component:i},s=hM(a);return(0,f.jsx)(dW.Provider,{value:hA,children:(0,f.jsx)(hT,{className:(0,v.Z)(s.root,r),as:i,ref:t,role:i===hI?null:"rowgroup",ownerState:a,...o})})}),hR=(0,g.forwardRef)(function(e,t){return(0,f.jsx)(hP,{...e,ref:t})});function hO(e){return(0,A.ZP)("MuiTable",e)}(0,T.Z)("MuiTable",["root","stickyHeader"]);let hE=e=>{let{classes:t,stickyHeader:n}=e;return(0,y.Z)({root:["root",n&&"stickyHeader"]},hO,t)},hD=(0,S.ZP)("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})((0,C.Z)(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:e})=>e.stickyHeader,style:{borderCollapse:"separate"}}]}))),hL="table",h_=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiTable"}),{className:r,component:i=hL,padding:o="normal",size:a="medium",stickyHeader:s=!1,...l}=n,u={...n,component:i,padding:o,size:a,stickyHeader:s},c=hE(u),d=g.useMemo(()=>({padding:o,size:a,stickyHeader:s}),[o,a,s]);return(0,f.jsx)(d4.Provider,{value:d,children:(0,f.jsx)(hD,{as:i,role:i===hL?null:"table",ref:t,className:(0,v.Z)(c.root,r),ownerState:u,...l})})}),hN=(0,S.ZP)(h_)(({theme:e})=>({tableLayout:"fixed",borderCollapse:"separate",backgroundColor:e.palette.background.default})),hZ={compact:"small",standard:"medium",comfortable:"medium"},hj=(0,g.forwardRef)(function({density:e,...t},n){return(0,f.jsx)(hN,{...t,tabIndex:-1,size:hZ[e],ref:n,sx:{width:"100%"}})});function hB(e){return(0,A.ZP)("MuiTableHead",e)}(0,T.Z)("MuiTableHead",["root"]);let hF=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"]},hB,t)},hz=(0,S.ZP)("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),h$={variant:"head"},hV="thead",hH=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiTableHead"}),{className:r,component:i=hV,...o}=n,a={...n,component:i},s=hF(a);return(0,f.jsx)(dW.Provider,{value:h$,children:(0,f.jsx)(hz,{as:i,className:(0,v.Z)(s.root,r),ref:t,role:i===hV?null:"rowgroup",ownerState:a,...o})})}),hW=(0,g.forwardRef)(function(e,t){return(0,f.jsx)(hH,{...e,ref:t})}),hq=(0,ad.Z)((0,f.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");function hG(e){return(0,A.ZP)("MuiTableSortLabel",e)}let hU=(0,T.Z)("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc","directionDesc","directionAsc"]),hK=e=>{let{classes:t,direction:n,active:r}=e,i={root:["root",r&&"active",`direction${(0,w.Z)(n)}`],icon:["icon",`iconDirection${(0,w.Z)(n)}`]};return(0,y.Z)(i,hG,t)},hY=(0,S.ZP)(ef,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.active&&t.active]}})((0,C.Z)(({theme:e})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(e.vars||e).palette.text.secondary},"&:hover":{color:(e.vars||e).palette.text.secondary,[`& .${hU.icon}`]:{opacity:.5}},[`&.${hU.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${hU.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}}))),hX=(0,S.ZP)("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,t[`iconDirection${(0,w.Z)(n.direction)}`]]}})((0,C.Z)(({theme:e})=>({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none",variants:[{props:{direction:"desc"},style:{transform:"rotate(0deg)"}},{props:{direction:"asc"},style:{transform:"rotate(180deg)"}}]}))),hJ=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiTableSortLabel"}),{active:r=!1,children:i,className:o,direction:a="asc",hideSortIcon:s=!1,IconComponent:l=hq,slots:u={},slotProps:c={},...d}=n,h={...n,active:r,direction:a,hideSortIcon:s,IconComponent:l},p=hK(h),g={slots:u,slotProps:c},[m,y]=of("root",{elementType:hY,externalForwardedProps:g,ownerState:h,className:(0,v.Z)(p.root,o),ref:t}),[b,x]=of("icon",{elementType:hX,externalForwardedProps:g,ownerState:h,className:p.icon});return(0,f.jsxs)(m,{disableRipple:!0,component:"span",...y,...d,children:[i,s&&!r?null:(0,f.jsx)(b,{as:l,...x})]})}),hQ=150,h0=40;function h1(e,t,{isHeader:n,isLastColumn:r,isFirstColumn:i,defaultColumnHeight:o}={}){var a,s;let l=e.spacing(1),u=e.spacing(1.25),c=e.spacing(2),d=i?c:u,h=r?c:u,p=e.typography.body1.lineHeight,f=e.typography.body1.fontSize;"compact"===t&&(l=e.spacing(.5),u=e.spacing(.5),c=e.spacing(1),d=i?c:u,h=r?c:u,p=e.typography.body2.lineHeight,f=e.typography.body2.fontSize),"comfortable"===t&&(l=e.spacing(2),u=e.spacing(1.5),c=e.spacing(2),d=i?c:u,h=r?c:u,p=e.typography.body1.lineHeight,f=e.typography.body1.fontSize);let g=n||!o||"auto"===o?(a=p,s=l,("string"==typeof a?parseInt(a,10):a??0)+2*("string"==typeof s?parseInt(s,10):s)):o;return{padding:`${l} ${h} ${l} ${d}`,height:g,fontSize:f,lineHeight:p}}function h2(e){return e.map(({width:e,align:t,headerDescription:n,cellDescription:r,enableSorting:i,...o})=>({...o,..."auto"===e||void 0===e?{size:0,minSize:0,maxSize:0}:{size:e},enableSorting:!!i,meta:{align:t,headerDescription:n,cellDescription:r}}))}let h5=(0,S.ZP)(he)(({theme:e})=>({padding:0,backgroundColor:"inherit","&.MuiTableCell-head":{backgroundColor:e.palette.background.default},"&:focus-visible":{outline:`solid 1px ${e.palette.primary.main}`,outlineOffset:"-1px",borderRadius:0}}));function h3({children:e,density:t,variant:n,width:r,defaultColumnHeight:i,focusState:o="none",onFocusTrigger:a,isFirstColumn:s,isLastColumn:l,description:u,align:c,color:d,backgroundColor:h,...p}){let m=ot(),v=(0,g.useRef)(),y="head"===n;(0,g.useEffect)(()=>{"trigger-focus"===o&&v.current&&v.current.focus()},[o]);let b=e=>{a?.(e)};return(0,f.jsx)(h5,{...p,tabIndex:"none"!==o?0:-1,onFocus:e=>{let t=e.currentTarget?.querySelector('a[href], button, input, textarea, select, details,[role="button"]');t&&t.focus()},onClick:b,onKeyUp:b,style:{width:r},sx:{position:"relative",borderBottom:y?`solid 1px ${m.palette.grey[100]}`:`solid 1px ${m.palette.grey[50]}`,"&:hover #original-cell":{position:"absolute",top:0,left:0,zIndex:10,width:"fit-content",minWidth:"100%",whiteSpace:"nowrap",overflow:"visible",backgroundColor:`${h??m.palette.background.default} !important`,outline:`solid 1px ${m.palette.info.main}`,outlineOffset:"-1px"}},ref:v,children:(0,f.jsx)(tU,{id:"original-cell",sx:{...h1(m,t,{isHeader:y,isLastColumn:l,isFirstColumn:s,defaultColumnHeight:i}),position:"relative",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexDirection:"inherit"},style:{backgroundColor:h??"inherit",color:d??"inherit"},title:u,"aria-label":u,textAlign:c,children:e})})}function h4({onSort:e,sortDirection:t,nextSortDirection:n,children:r,...i}){let o=!!e,a=(0,f.jsx)(c1,{noWrap:!0,variant:"inherit",component:"div",color:"inherit",children:r}),s=!!t;return(0,f.jsx)(h3,{...i,children:o?(0,f.jsx)(hJ,{onClick:e,direction:s?t:n,active:s,sx:{verticalAlign:"unset",maxWidth:"100%","&:focus-visible":{[`& .${hU.icon}`]:{opacity:s?1:.5}}},children:a}):a})}function h6(e){return(0,A.ZP)("MuiTableContainer",e)}(0,T.Z)("MuiTableContainer",["root"]);let h8=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"]},h6,t)},h9=(0,S.ZP)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),h7=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiTableContainer"}),{className:r,component:i="div",...o}=n,a={...n,component:i},s=h8(a);return(0,f.jsx)(h9,{ref:t,as:i,className:(0,v.Z)(s.root,r),ownerState:a,...o})}),pe=(0,g.forwardRef)(function(e,t){return(0,f.jsx)(h7,{...e,tabIndex:-1,ref:t})}),pt={row:0,column:0},pn=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"];function pr(e){return(0,A.ZP)("MuiTableFooter",e)}(0,T.Z)("MuiTableFooter",["root"]);let pi=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"]},pr,t)},po=(0,S.ZP)("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-footer-group"}),pa={variant:"footer"},ps="tfoot",pl=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiTableFooter"}),{className:r,component:i=ps,...o}=n,a={...n,component:i},s=pi(a);return(0,f.jsx)(dW.Provider,{value:pa,children:(0,f.jsx)(po,{as:i,className:(0,v.Z)(s.root,r),ref:t,role:i===ps?null:"rowgroup",ownerState:a,...o})})}),pu=(0,g.forwardRef)(function(e,t){return(0,f.jsx)(pl,{...e,ref:t})});function pc({width:e,height:t,density:n,defaultColumnWidth:r,defaultColumnHeight:i,onRowClick:o,onRowMouseOver:a,onRowMouseOut:s,rows:l,columns:u,headers:c,cellConfigs:d,pagination:h,onPaginationChange:p,rowCount:m}){let v=(0,g.useRef)(null),y=(0,g.useRef)({startIndex:0,endIndex:0}),b=function({visibleRange:e,virtualTable:t,maxRows:n,maxColumns:r}){return function({maxRows:e,maxColumns:t,onActiveCellChange:n}){let[r,i]=(0,g.useState)(pt),[o,a]=(0,g.useState)(!1);return{activeCell:r,isActive:o,onTableKeyDown:(0,g.useCallback)(r=>{let o=r.key;(pn.includes(o)||"Home"===o||"End"===o||"PageDown"===o||"PageUp"===o)&&i(i=>{let a=i.row,s=i.column;"ArrowRight"===o&&s<t-1?(r.preventDefault(),s+=1):"ArrowLeft"===o&&s>0?(r.preventDefault(),s-=1):"ArrowDown"===o&&a<e-1?(r.preventDefault(),a+=1):"ArrowUp"===o&&a>0?(r.preventDefault(),a-=1):"Home"===o?(r.preventDefault(),a=0,s=0):"End"===o&&(r.preventDefault(),a=e-1,s=t-1);let l={column:s,row:a},u=n?.(r,i,l)||l;return u.row===i.row&&u.column===i.column?i:u})},[t,e,n]),onCellFocus:e=>{(e.column!==r.column||e.row!==r.row||!o)&&(a(!0),i(e))}}}({maxRows:n,maxColumns:r,onActiveCellChange:(r,i,o)=>{let a=r.key,s=o&&(i.column!==o.column||i.row!==o.row),l=o?.row??i.row;if("ArrowDown"===a&&s)(l-1<e.current.startIndex||l-1>e.current.endIndex)&&t.current?.scrollToIndex({index:l-1,align:"end"});else if("ArrowUp"===a&&s)(l-1<e.current.startIndex||l-1>e.current.endIndex)&&t.current?.scrollToIndex({index:l-1,align:"start"});else if(s&&("Home"===a||"End"===a))t.current?.scrollToIndex({index:Math.max(l-1,0),align:"start"});else if("PageDown"===a){r.preventDefault();let o=i.row;return o=Math.min(n-1,e.current.endIndex+1),t.current?.scrollToIndex({index:o-1,align:"start"}),{row:o,column:i.column}}else if("PageUp"===a){let n=i.row;return n=Math.max(0,e.current.startIndex-1),t.current?.scrollToIndex({index:n-1,align:"end"}),{row:n,column:i.column}}return o}})}({visibleRange:y,virtualTable:v,maxRows:l.length+1,maxColumns:u.length}),x=e=>e.row===b.activeCell.row&&e.column===b.activeCell.column?b.isActive?"trigger-focus":"focus-next":"none",w=(0,g.useMemo)(()=>({Scroller:pe,Table:t=>(0,f.jsx)(hj,{...t,width:e,density:n,onKeyDown:b.onTableKeyDown}),TableHead:hW,TableFoot:pu,TableRow:({item:e,...t})=>{let r=l[t["data-index"]];if(!r)return null;let i={id:r.id,index:r.index};return(0,f.jsx)(hC,{...t,onClick:e=>o(e,r.id),density:n,onMouseOver:e=>{a?.(e,i)},onMouseOut:e=>{s?.(e,i)}})},TableBody:hR}),[n,b.onTableKeyDown,o,s,a,l,e]),S=(e,t)=>{h&&p&&p({...h,pageIndex:t})},C=e=>{h&&p&&p({pageIndex:0,pageSize:parseInt(e.target.value,10)})};return(0,f.jsx)(tU,{style:{width:e,height:t},children:(0,f.jsx)(cd,{ref:v,totalCount:l.length,components:w,rangeChanged:e=>{y.current=e},fixedHeaderContent:()=>(0,f.jsx)(f.Fragment,{children:c.map(e=>(0,f.jsx)(hC,{density:n,children:e.headers.map((e,t,o)=>{var a,s,l,u,c;let d=e.column,h={row:0,column:t},p=d.getIsSorted(),m=d.getNextSortingOrder();return(0,f.jsx)(h4,{onSort:d.getCanSort()?d.getToggleSortingHandler():void 0,sortDirection:"string"==typeof p?p:void 0,nextSortDirection:"string"==typeof m?m:void 0,width:d.getSize()||r,defaultColumnHeight:i,align:d.columnDef.meta?.align,variant:"head",density:n,description:d.columnDef.meta?.headerDescription,focusState:x(h),onFocusTrigger:()=>b.onCellFocus(h),isFirstColumn:0===t,isLastColumn:t===o.length-1,children:(a=d.columnDef.header,s=e.getContext(),a?"function"==typeof(u=l=a)&&(()=>{let e=Object.getPrototypeOf(u);return e.prototype&&e.prototype.isReactComponent})()||"function"==typeof l||"object"==typeof(c=l)&&"symbol"==typeof c.$$typeof&&["react.memo","react.forward_ref"].includes(c.$$typeof.description)?g.createElement(a,s):a:null)},e.id)})},e.id))}),fixedFooterContent:h?()=>(0,f.jsx)(dY,{sx:{backgroundColor:e=>e.palette.background.default},children:(0,f.jsx)(hS,{colSpan:u.length,count:m,page:h.pageIndex,rowsPerPage:h.pageSize,onPageChange:S,onRowsPerPageChange:C})}):void 0,itemContent:e=>{let t=l[e];return t?(0,f.jsx)(f.Fragment,{children:t.getVisibleCells().map((t,o,a)=>{let s;let l={row:e+1,column:o},u=t.getContext(),c=d?.[u.cell.id],h=t.column.columnDef.cell,p="function"==typeof h?h(u):null,g=t.column.columnDef.meta?.cellDescription;return"function"==typeof g?s=g(u):g&&"string"==typeof p&&(s=p),(0,f.jsx)(h3,{"data-testid":t.id,title:s||c?.text||p,width:t.column.getSize()||r,defaultColumnHeight:i,align:t.column.columnDef.meta?.align,density:n,focusState:x(l),onFocusTrigger:()=>b.onCellFocus(l),isFirstColumn:0===o,isLastColumn:o===a.length-1,description:s,color:c?.textColor??void 0,backgroundColor:c?.backgroundColor??void 0,children:c?.text||p},t.id)})}):null}})})}function pd(e){return(0,A.ZP)("PrivateSwitchBase",e)}(0,T.Z)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);let ph=e=>{let{classes:t,checked:n,disabled:r,edge:i}=e,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${(0,w.Z)(i)}`],input:["input"]};return(0,y.Z)(o,pd,t)},pp=(0,S.ZP)(ef)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>"start"===e&&"small"!==t.size,style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>"end"===e&&"small"!==t.size,style:{marginRight:-12}}]}),pf=(0,S.ZP)("input",{shouldForwardProp:Z.Z})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),pg=g.forwardRef(function(e,t){let{autoFocus:n,checked:r,checkedIcon:i,defaultChecked:o,disabled:a,disableFocusRipple:s=!1,edge:l=!1,icon:u,id:c,inputProps:d,inputRef:h,name:p,onBlur:g,onChange:m,onFocus:v,readOnly:y,required:b=!1,tabIndex:x,type:w,value:S,slots:C={},slotProps:k={},...M}=e,[T,A]=(0,an.Z)({controlled:r,default:!!o,name:"SwitchBase",state:"checked"}),I=r_(),P=e=>{v&&v(e),I&&I.onFocus&&I.onFocus(e)},R=e=>{g&&g(e),I&&I.onBlur&&I.onBlur(e)},O=e=>{if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked;A(t),m&&m(e,t)},E=a;I&&void 0===E&&(E=I.disabled);let D="checkbox"===w||"radio"===w,L={...e,checked:T,disabled:E,disableFocusRipple:s,edge:l},_=ph(L),N={slots:C,slotProps:{input:d,...k}},[Z,j]=of("root",{ref:t,elementType:pp,className:_.root,shouldForwardComponentProp:!0,externalForwardedProps:{...N,component:"span",...M},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),P(t)},onBlur:t=>{e.onBlur?.(t),R(t)}}),ownerState:L,additionalProps:{centerRipple:!0,focusRipple:!s,disabled:E,role:void 0,tabIndex:null}}),[B,F]=of("input",{ref:h,elementType:pf,className:_.input,externalForwardedProps:N,getSlotProps:e=>({onChange:t=>{e.onChange?.(t),O(t)}}),ownerState:L,additionalProps:{autoFocus:n,checked:r,defaultChecked:o,disabled:E,id:D?c:void 0,name:p,readOnly:y,required:b,tabIndex:x,type:w,..."checkbox"===w&&void 0===S?{}:{value:S}}});return(0,f.jsxs)(Z,{...j,children:[(0,f.jsx)(B,{...F}),T?i:u]})}),pm=(0,ad.Z)((0,f.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),pv=(0,ad.Z)((0,f.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),py=(0,ad.Z)((0,f.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function pb(e){return(0,A.ZP)("MuiCheckbox",e)}let px=(0,T.Z)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),pw=e=>{let{classes:t,indeterminate:n,color:r,size:i}=e,o={root:["root",n&&"indeterminate",`color${(0,w.Z)(r)}`,`size${(0,w.Z)(i)}`]},a=(0,y.Z)(o,pb,t);return{...t,...a}},pS=(0,S.ZP)(pg,{shouldForwardProp:e=>(0,Z.Z)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${(0,w.Z)(n.size)}`],"default"!==n.color&&t[`color${(0,w.Z)(n.color)}`]]}})((0,C.Z)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(k()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(k()).map(([t])=>({props:{color:t},style:{[`&.${px.checked}, &.${px.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${px.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),pC=(0,f.jsx)(pv,{}),pk=(0,f.jsx)(pm,{}),pM=(0,f.jsx)(py,{}),pT=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiCheckbox"}),{checkedIcon:r=pC,color:i="primary",icon:o=pk,indeterminate:a=!1,indeterminateIcon:s=pM,inputProps:l,size:u="medium",disableRipple:c=!1,className:d,slots:h={},slotProps:p={},...m}=n,y=a?s:o,b=a?s:r,x={...n,disableRipple:c,color:i,indeterminate:a,size:u},w=pw(x),S=p.input??l,[C,k]=of("root",{ref:t,elementType:pS,className:(0,v.Z)(w.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:h,slotProps:p,...m},ownerState:x,additionalProps:{type:"checkbox",icon:g.cloneElement(y,{fontSize:y.props.fontSize??u}),checkedIcon:g.cloneElement(b,{fontSize:b.props.fontSize??u}),disableRipple:c,slots:h,slotProps:{input:(0,oF.Z)("function"==typeof S?S(x):S,{"data-indeterminate":a})}}});return(0,f.jsx)(C,{...k,classes:w})});function pA({color:e,density:t,...n}){let r="compact"===t;return(0,f.jsx)(pT,{size:r?"small":"medium",...n,focusRipple:!1,tabIndex:-1,sx:{color:e,padding:e=>e.spacing(r?.25:.5),position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)","&.Mui-checked":{color:e},"&.Mui-focusVisible":{background:e?(0,b.Fq)(e,.5):void 0},"& .MuiSvgIcon-root":{fontSize:r?16:18}}})}let pI=(e,t)=>`${t}`,pP={},pR=[];function pO({data:e,columns:t,cellConfigs:n,density:r="standard",defaultColumnWidth:i=hQ,defaultColumnHeight:o="auto",checkboxSelection:a,onRowSelectionChange:s,onSortingChange:l,getCheckboxColor:u,getRowId:c=pI,rowSelection:d=pP,sorting:h=pR,pagination:p,onPaginationChange:m,rowSelectionVariant:v="standard",...y}){let b=ot(),x=(0,g.useCallback)((e,t,n)=>{"standard"===v||n?t.toggleSelected():t.getIsSelected()&&!e.getIsAllRowsSelected()?e.toggleAllRowsSelected():s?.({[t.id]:!0})},[s,v]),w=(0,g.useCallback)((e,t,n)=>{let r=e.nativeEvent&&(e.nativeEvent instanceof MouseEvent||e.nativeEvent instanceof KeyboardEvent)?e.nativeEvent:void 0;x(t,n,!!r?.metaKey||!!r?.shiftKey)},[x]),S=(0,g.useMemo)(()=>({id:"checkboxRowSelect",size:28,header:({table:e})=>(0,f.jsx)(pA,{checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler(),color:b.palette.text.primary,density:r}),cell:({row:e,table:t})=>(0,f.jsx)(pA,{checked:e.getIsSelected(),indeterminate:e.getIsSomeSelected(),onChange:n=>{w(n,t,e)},color:u?.(e.original),density:r}),enableSorting:!1}),[b.palette.text.primary,r,u,w]),C=function(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=g.useState(()=>({current:function(e){var t,n;let r=[...dH,...null!=(t=e._features)?t:[]],i={_features:r},o=i._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(i)),{}),a=e=>i.options.mergeOptions?i.options.mergeOptions(o,e):{...o,...e},s={...null!=(n=e.initialState)?n:{}};i._features.forEach(e=>{var t;s=null!=(t=null==e.getInitialState?void 0:e.getInitialState(s))?t:s});let l=[],u=!1,c={_features:r,options:{...o,...e},initialState:s,_queue:e=>{l.push(e),u||(u=!0,Promise.resolve().then(()=>{for(;l.length;)l.shift()();u=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{i.setState(i.initialState)},setOptions:e=>{let t=di(e,i.options);i.options=a(t)},getState:()=>i.options.state,setState:e=>{null==i.options.onStateChange||i.options.onStateChange(e)},_getRowId:(e,t,n)=>{var r;return null!=(r=null==i.options.getRowId?void 0:i.options.getRowId(e,t,n))?r:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?i.getPrePaginationRowModel():i.getRowModel()).rowsById[e];if(!n&&!(n=i.getCoreRowModel().rowsById[e]))throw Error();return n},_getDefaultColumnDef:dl(()=>[i.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...i._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},du(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>i.options.columns,getAllColumns:dl(()=>[i._getColumnDefs()],e=>{let t=function(e,n,r){return void 0===r&&(r=0),e.map(e=>{let o=function(e,t,n,r){var i,o;let a;let s={...e._getDefaultColumnDef(),...t},l=s.accessorKey,u=null!=(i=null!=(o=s.id)?o:l?"function"==typeof String.prototype.replaceAll?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)?i:"string"==typeof s.header?s.header:void 0;if(s.accessorFn?a=s.accessorFn:l&&(a=l.includes(".")?e=>{let t=e;for(let e of l.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[s.accessorKey]),!u)throw Error();let c={id:`${String(u)}`,accessorFn:a,parent:r,depth:n,columnDef:s,columns:[],getFlatColumns:dl(()=>[!0],()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},du(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:dl(()=>[e._getOrderColumnsFn()],e=>{var t;return null!=(t=c.columns)&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},du(e.options,"debugColumns","column.getLeafColumns"))};for(let t of e._features)null==t.createColumn||t.createColumn(c,e);return c}(i,e,r,n);return o.columns=e.columns?t(e.columns,o,r+1):[],o})};return t(e)},du(e,"debugColumns","getAllColumns")),getAllFlatColumns:dl(()=>[i.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),du(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:dl(()=>[i.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),du(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:dl(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),du(e,"debugColumns","getAllLeafColumns")),getColumn:e=>i._getAllFlatColumnsById()[e]};Object.assign(i,c);for(let e=0;e<i._features.length;e++){let t=i._features[e];null==t||null==t.createTable||t.createTable(i)}return i}(t)})),[r,i]=g.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{i(t),null==e.onStateChange||e.onStateChange(t)}})),n.current}({data:e,columns:(0,g.useMemo)(()=>{let e=h2(t);return a&&e.unshift(S),e},[S,a,t]),getRowId:c,getCoreRowModel:e=>dl(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},r=function(t,i,o){void 0===i&&(i=0);let a=[];for(let l=0;l<t.length;l++){let u=dp(e,e._getRowId(t[l],l,o),t[l],l,i,void 0,null==o?void 0:o.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var s;u.originalSubRows=e.options.getSubRows(t[l],l),null!=(s=u.originalSubRows)&&s.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},du(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex())),getSortedRowModel:e=>dl(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(null!=t&&t.length))return n;let r=e.getState().sorting,i=[],o=r.filter(t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()}),a={};o.forEach(t=>{let n=e.getColumn(t.id);n&&(a[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});let s=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let r=0;r<o.length;r+=1){var n;let i=o[r],s=a[i.id],l=s.sortUndefined,u=null!=(n=null==i?void 0:i.desc)&&n,c=0;if(l){let n=e.getValue(i.id),r=t.getValue(i.id),o=void 0===n,a=void 0===r;if(o||a){if("first"===l)return o?-1:1;if("last"===l)return o?1:-1;c=o&&a?0:o?l:-l}}if(0===c&&(c=s.sortingFn(e,t,i.id)),0!==c)return u&&(c*=-1),s.invertSorting&&(c*=-1),c}return e.index-t.index}),t.forEach(e=>{var t;i.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))}),t};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}},du(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex())),getPaginationRowModel:p?e=>dl(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{let r;if(!n.rows.length)return n;let{pageSize:i,pageIndex:o}=t,{rows:a,flatRows:s,rowsById:l}=n,u=i*o;a=a.slice(u,u+i),(r=e.options.paginateExpandedRows?{rows:a,flatRows:s,rowsById:l}:function(e){let t=[],n=e=>{var r;t.push(e),null!=(r=e.subRows)&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}({rows:a,flatRows:s,rowsById:l})).flatRows=[];let c=e=>{r.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return r.rows.forEach(c),r},du(e.options,"debugTable","getPaginationRowModel")):void 0,manualPagination:!p,enableRowSelection:!!a,onRowSelectionChange:e=>{let t="function"==typeof e?e(d):e;s?.(t)},onSortingChange:e=>{let t="function"==typeof e?e(h):e;l?.(t)},sortDescFirst:!0,state:{rowSelection:d,sorting:h,...p?{pagination:p}:{}}}),k=(0,g.useCallback)((e,t)=>{let n=C.getRow(t);x(C,n,e.metaKey||e.shiftKey)},[x,C]);return(0,f.jsx)(pc,{...y,density:r,defaultColumnWidth:i,defaultColumnHeight:o,onRowClick:k,rows:C.getRowModel().rows,columns:C.getAllFlatColumns(),headers:C.getHeaderGroups(),cellConfigs:n,pagination:p,onPaginationChange:m,rowCount:C.getRowCount()})}let pE=[{accessorKey:"label",header:"Name",enableSorting:!0,cell:({getValue:e})=>(0,f.jsx)("span",{title:e(),children:e()})}],pD=e=>e.id,pL=e=>e.color;function p_({items:e,selectedItems:t,onSelectedItemsChange:n,onItemMouseOver:r,onItemMouseOut:i,height:o,width:a,columns:s=[],sorting:l,onSortingChange:u}){let c=(0,g.useMemo)(()=>"string"!=typeof t?t:e.reduce((e,t,n)=>(e[pD(t,n)]=!0,e),{}),[t,e]),d=(0,g.useMemo)(()=>[...pE,...s],[s]);return(0,f.jsx)(pO,{height:o,width:a,rowSelection:c,onRowSelectionChange:n,onRowMouseOver:r,onRowMouseOut:i,sorting:l,onSortingChange:u,data:e,columns:d,density:"compact",defaultColumnWidth:"auto",getRowId:pD,getCheckboxColor:pL,checkboxSelection:!0,rowSelectionVariant:"legend"})}function pN({width:e,height:t,options:n,data:r,selectedItems:i,onSelectedItemsChange:o,onItemMouseOver:a,onItemMouseOut:s,tableProps:l}){let u;let c=(e,t)=>{let n=e.metaKey||e.shiftKey;o(sV(i,e=>{if("ALL"===e)return{[t]:!0};let r=!!e[t];return n?(r?delete e[t]:e[t]=!0,e):r?"ALL":{[t]:!0}}))},d=sr(n.mode),h=r.length>=500,p={height:t,items:r,selectedItems:i,onLegendItemClick:c,onItemMouseOver:a,onItemMouseOut:s};return(u="table"===d?(0,f.jsx)(p_,{...p,onSelectedItemsChange:o,width:e,...l}):"right"===n.position||h?(0,f.jsx)(dn,{...p,width:e,onLegendItemClick:c}):(0,f.jsx)(dr,{...p,onLegendItemClick:c}),"right"===n.position)?(0,f.jsx)(tU,{style:{width:e,height:t},sx:{position:"absolute",top:0,right:0},children:u}):(0,f.jsx)(tU,{style:{width:e,height:t},sx:{position:"absolute",bottom:0},children:u})}let pZ={medium:{bottom:6,right:250},small:{bottom:4,right:150}};function pj({children:e,legendProps:t,width:n,height:r,spacing:i=0,legendSize:o,minChildrenWidth:a=100,minChildrenHeight:s=100}){let{content:l,legend:u,margin:c}=function({width:e,height:t,legendProps:n,legendSize:r,minChildrenHeight:i,minChildrenWidth:o,spacing:a,theme:s}){let l,u;let c=n?.options,d={legend:{show:!1,width:0,height:0},content:{width:e,height:t},margin:{right:0,bottom:0}};if(!c)return d;let{position:h}=c;if("list"===sr(c.mode))l="right"===h?200:e,u=40,"right"===h?u=t:t>=300&&(u=100);else{let i=h1(s,"compact"),o=(n?.tableProps?.columns||[]).reduce((e,t)=>("number"==typeof t.width&&(e+=t.width),e),0);l="right"===h?pZ[r].right+o:e;let a=Math.min(pZ[r].bottom,n.data.length+1);u="bottom"===h?a*i.height:t}let p="right"===h?e-l-a:e,f="bottom"===h?t-u-a:t;return"right"===h&&p<o||"bottom"===h&&f<i?d:{legend:{width:l,height:u,show:!0},content:{width:p,height:f},margin:{right:"right"===h?a:0,bottom:"bottom"===h?a:0}}}({width:n,height:r,legendProps:t,minChildrenHeight:s,minChildrenWidth:a,spacing:i,theme:ot(),legendSize:o&&st.includes(o)?o:sn.size});return(0,f.jsxs)(tU,{style:{width:n,height:r},sx:{position:"relative",overflow:"hidden"},children:[(0,f.jsx)(tU,{style:{width:l.width,height:l.height},sx:{marginRight:`${c.right}px`,marginBottom:`${c.bottom}px`,overflow:"hidden"},children:"function"==typeof e?e({width:l.width,height:l.height}):e}),t&&u.show&&(0,f.jsx)(pN,{...t,height:u.height,width:u.width})]})}let pB=(0,g.forwardRef)(function({debounceMs:e=250,value:t,onChange:n,...r},i){let[o,a]=(0,g.useState)(t),s=(0,g.useCallback)(e=>{n?.(e)},[n]),l=(0,g.useMemo)(()=>t5()(s,e),[e,s]);return(0,f.jsx)(aC,{ref:i,value:o,onChange:function(e){a(e.target.value),l(e.target.value)},...r})});function pF(e){return(0,A.ZP)("MuiDialogTitle",e)}pB.displayName="TextField";let pz=(0,T.Z)("MuiDialogTitle",["root"]),p$=g.createContext({}),pV=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"]},pF,t)},pH=(0,S.ZP)(c1,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),pW=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiDialogTitle"}),{className:r,id:i,...o}=n,a=pV(n),{titleId:s=i}=g.useContext(p$);return(0,f.jsx)(pH,{component:"h2",className:(0,v.Z)(a.root,r),ownerState:n,ref:t,variant:"h6",id:i??s,...o})});function pq(e){return(0,A.ZP)("MuiDialogContent",e)}(0,T.Z)("MuiDialogContent",["root","dividers"]);let pG=e=>{let{classes:t,dividers:n}=e;return(0,y.Z)({root:["root",n&&"dividers"]},pq,t)},pU=(0,S.ZP)("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})((0,C.Z)(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:e})=>e.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${pz.root} + &`]:{paddingTop:0}}}]}))),pK=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiDialogContent"}),{className:r,dividers:i=!1,...o}=n,a={...n,dividers:i},s=pG(a);return(0,f.jsx)(pU,{className:(0,v.Z)(s.root,r),ownerState:a,ref:t,...o})});function pY(e){return(0,A.ZP)("MuiDialog",e)}let pX=(0,T.Z)("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),pJ=(0,S.ZP)(ox,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),pQ=e=>{let{classes:t,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=e,a={root:["root"],container:["container",`scroll${(0,w.Z)(n)}`],paper:["paper",`paperScroll${(0,w.Z)(n)}`,`paperWidth${(0,w.Z)(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return(0,y.Z)(a,pY,t)},p0=(0,S.ZP)(oD,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),p1=(0,S.ZP)("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.container,t[`scroll${(0,w.Z)(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),p2=(0,S.ZP)(oj,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`scrollPaper${(0,w.Z)(n.scroll)}`],t[`paperWidth${(0,w.Z)(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})((0,C.Z)(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:"px"===e.breakpoints.unit?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${pX.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(e=>"xs"!==e).map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${pX.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${pX.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),p5=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiDialog"}),r=ot(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":o,"aria-labelledby":a,"aria-modal":s=!0,BackdropComponent:l,BackdropProps:u,children:c,className:d,disableEscapeKeyDown:h=!1,fullScreen:p=!1,fullWidth:m=!1,maxWidth:y="sm",onBackdropClick:b,onClick:x,onClose:w,open:S,PaperComponent:C=oj,PaperProps:k={},scroll:T="paper",slots:A={},slotProps:I={},TransitionComponent:P=om,transitionDuration:R=i,TransitionProps:O,...E}=n,D={...n,disableEscapeKeyDown:h,fullScreen:p,fullWidth:m,maxWidth:y,scroll:T},L=pQ(D),_=g.useRef(),N=(0,rw.Z)(a),Z=g.useMemo(()=>({titleId:N}),[N]),j={slots:{transition:P,...A},slotProps:{transition:O,paper:k,backdrop:u,...I}},[B,F]=of("root",{elementType:p0,shouldForwardComponentProp:!0,externalForwardedProps:j,ownerState:D,className:(0,v.Z)(L.root,d),ref:t}),[z,$]=of("backdrop",{elementType:pJ,shouldForwardComponentProp:!0,externalForwardedProps:j,ownerState:D}),[V,H]=of("paper",{elementType:p2,shouldForwardComponentProp:!0,externalForwardedProps:j,ownerState:D,className:(0,v.Z)(L.paper,k.className)}),[W,q]=of("container",{elementType:p1,externalForwardedProps:j,ownerState:D,className:(0,v.Z)(L.container)}),[G,U]=of("transition",{elementType:om,externalForwardedProps:j,ownerState:D,additionalProps:{appear:!0,in:S,timeout:R,role:"presentation"}});return(0,f.jsx)(B,{closeAfterTransition:!0,slots:{backdrop:z},slotProps:{backdrop:{transitionDuration:R,as:l,...$}},disableEscapeKeyDown:h,onClose:w,open:S,onClick:e=>{x&&x(e),_.current&&(_.current=null,b&&b(e),w&&w(e,"backdropClick"))},...F,...E,children:(0,f.jsx)(G,{...U,children:(0,f.jsx)(W,{onMouseDown:e=>{_.current=e.target===e.currentTarget},...q,children:(0,f.jsx)(V,{as:C,elevation:24,role:"dialog","aria-describedby":o,"aria-labelledby":N,"aria-modal":s,...H,children:(0,f.jsx)(p$.Provider,{value:Z,children:c})})})})})});function p3(e){return(0,A.ZP)("MuiDialogActions",e)}(0,T.Z)("MuiDialogActions",["root","spacing"]);let p4=e=>{let{classes:t,disableSpacing:n}=e;return(0,y.Z)({root:["root",!n&&"spacing"]},p3,t)},p6=(0,S.ZP)("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),p8=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiDialogActions"}),{className:r,disableSpacing:i=!1,...o}=n,a={...n,disableSpacing:i},s=p4(a);return(0,f.jsx)(p6,{className:(0,v.Z)(s.root,r),ownerState:a,ref:t,...o})});var p9=n(763);let p7=(0,S.ZP)("form")({overflowY:"auto",display:"flex",flexDirection:"column"}),fe=e=>({position:"absolute",top:e.spacing(.5),right:e.spacing(.5)}),ft=({children:e,...t})=>(0,f.jsx)(p5,{...t,children:e});ft.Header=({children:e,onClose:t,...n})=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(pW,{style:{textOverflow:"ellipsis",overflow:"hidden"},...n,children:e}),t&&(0,f.jsx)(rx,{"aria-label":"Close",onClick:t,sx:fe,children:(0,f.jsx)(p9.default,{})})]}),ft.Form=p7,ft.Content=({children:e,sx:t,...n})=>(0,f.jsx)(pK,{dividers:!0,...n,sx:c8({minWidth:"500px",textWrap:"balance"},t),children:e}),ft.PrimaryButton=({children:e,...t})=>(0,f.jsx)(e_,{variant:"contained",type:"submit",...t,children:e}),ft.SecondaryButton=({children:e,...t})=>(0,f.jsx)(e_,{variant:"outlined",color:"secondary",...t,children:e}),ft.Actions=p8;let fn=e=>{let{description:t,isOpen:n,onCancel:r,onDiscardChanges:i}=e;return(0,f.jsxs)(ft,{open:n,"aria-labelledby":"discard-dialog",children:[(0,f.jsx)(ft.Header,{children:"Discard Changes"}),(0,f.jsx)(ft.Content,{children:t}),(0,f.jsxs)(ft.Actions,{children:[(0,f.jsx)(e_,{variant:"contained",onClick:i,children:"Discard Changes"}),(0,f.jsx)(e_,{variant:"outlined",color:"secondary",onClick:r,children:"Cancel"})]})]})};var fr=n(9398);function fi(e){void 0===globalThis.useIdValue&&(globalThis.useIdValue=0);let t=(0,g.useRef)(void 0);return void 0===t.current&&(t.current=`${e}-${globalThis.useIdValue++}`),t.current}function fo(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function fa(e){var t=fo(e).Element;return e instanceof t||e instanceof Element}function fs(e){var t=fo(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function fl(e){if("undefined"==typeof ShadowRoot)return!1;var t=fo(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}var fu=Math.max,fc=Math.min,fd=Math.round;function fh(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function fp(){return!/^((?!chrome|android).)*safari/i.test(fh())}function ff(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&fs(e)&&(i=e.offsetWidth>0&&fd(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&fd(r.height)/e.offsetHeight||1);var a=(fa(e)?fo(e):window).visualViewport,s=!fp()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/i,u=(r.top+(s&&a?a.offsetTop:0))/o,c=r.width/i,d=r.height/o;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l,x:l,y:u}}function fg(e){var t=fo(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function fm(e){return e?(e.nodeName||"").toLowerCase():null}function fv(e){return((fa(e)?e.ownerDocument:e.document)||window.document).documentElement}function fy(e){return ff(fv(e)).left+fg(e).scrollLeft}function fb(e){return fo(e).getComputedStyle(e)}function fx(e){var t=fb(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function fw(e){var t=ff(e),n=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-r)&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function fS(e){return"html"===fm(e)?e:e.assignedSlot||e.parentNode||(fl(e)?e.host:null)||fv(e)}function fC(e,t){void 0===t&&(t=[]);var n,r=function e(t){return["html","body","#document"].indexOf(fm(t))>=0?t.ownerDocument.body:fs(t)&&fx(t)?t:e(fS(t))}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=fo(r),a=i?[o].concat(o.visualViewport||[],fx(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(fC(fS(a)))}function fk(e){return fs(e)&&"fixed"!==fb(e).position?e.offsetParent:null}function fM(e){for(var t=fo(e),n=fk(e);n&&["table","td","th"].indexOf(fm(n))>=0&&"static"===fb(n).position;)n=fk(n);return n&&("html"===fm(n)||"body"===fm(n)&&"static"===fb(n).position)?t:n||function(e){var t=/firefox/i.test(fh());if(/Trident/i.test(fh())&&fs(e)&&"fixed"===fb(e).position)return null;var n=fS(e);for(fl(n)&&(n=n.host);fs(n)&&0>["html","body"].indexOf(fm(n));){var r=fb(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var fT="bottom",fA="right",fI="left",fP="auto",fR=["top",fT,fA,fI],fO="start",fE="viewport",fD="popper",fL=fR.reduce(function(e,t){return e.concat([t+"-"+fO,t+"-end"])},[]),f_=[].concat(fR,[fP]).reduce(function(e,t){return e.concat([t,t+"-"+fO,t+"-end"])},[]),fN=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"],fZ={placement:"bottom",modifiers:[],strategy:"absolute"};function fj(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}var fB={passive:!0};function fF(e){return e.split("-")[0]}function fz(e){return e.split("-")[1]}function f$(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function fV(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?fF(i):null,a=i?fz(i):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case"top":t={x:s,y:n.y-r.height};break;case fT:t={x:s,y:n.y+n.height};break;case fA:t={x:n.x+n.width,y:l};break;case fI:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?f$(o):null;if(null!=u){var c="y"===u?"height":"width";switch(a){case fO:t[u]=t[u]-(n[c]/2-r[c]/2);break;case"end":t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}var fH={top:"auto",right:"auto",bottom:"auto",left:"auto"};function fW(e){var t,n,r,i,o,a,s,l=e.popper,u=e.popperRect,c=e.placement,d=e.variation,h=e.offsets,p=e.position,f=e.gpuAcceleration,g=e.adaptive,m=e.roundOffsets,v=e.isFixed,y=h.x,b=void 0===y?0:y,x=h.y,w=void 0===x?0:x,S="function"==typeof m?m({x:b,y:w}):{x:b,y:w};b=S.x,w=S.y;var C=h.hasOwnProperty("x"),k=h.hasOwnProperty("y"),M=fI,T="top",A=window;if(g){var I=fM(l),P="clientHeight",R="clientWidth";I===fo(l)&&"static"!==fb(I=fv(l)).position&&"absolute"===p&&(P="scrollHeight",R="scrollWidth"),("top"===c||(c===fI||c===fA)&&"end"===d)&&(T=fT,w-=(v&&I===A&&A.visualViewport?A.visualViewport.height:I[P])-u.height,w*=f?1:-1),(c===fI||("top"===c||c===fT)&&"end"===d)&&(M=fA,b-=(v&&I===A&&A.visualViewport?A.visualViewport.width:I[R])-u.width,b*=f?1:-1)}var O=Object.assign({position:p},g&&fH),E=!0===m?(t={x:b,y:w},n=fo(l),r=t.x,i=t.y,{x:fd(r*(o=n.devicePixelRatio||1))/o||0,y:fd(i*o)/o||0}):{x:b,y:w};return(b=E.x,w=E.y,f)?Object.assign({},O,((s={})[T]=k?"0":"",s[M]=C?"0":"",s.transform=1>=(A.devicePixelRatio||1)?"translate("+b+"px, "+w+"px)":"translate3d("+b+"px, "+w+"px, 0)",s)):Object.assign({},O,((a={})[T]=k?w+"px":"",a[M]=C?b+"px":"",a.transform="",a))}var fq={left:"right",right:"left",bottom:"top",top:"bottom"};function fG(e){return e.replace(/left|right|bottom|top/g,function(e){return fq[e]})}var fU={start:"end",end:"start"};function fK(e){return e.replace(/start|end/g,function(e){return fU[e]})}function fY(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&fl(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function fX(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function fJ(e,t,n){var r,i,o,a,s,l,u,c,d,h;return t===fE?fX(function(e,t){var n=fo(e),r=fv(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=fp();(u||!u&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+fy(e),y:l}}(e,n)):fa(t)?((r=ff(t,!1,"fixed"===n)).top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r):fX((i=fv(e),a=fv(i),s=fg(i),l=null==(o=i.ownerDocument)?void 0:o.body,u=fu(a.scrollWidth,a.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),c=fu(a.scrollHeight,a.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),d=-s.scrollLeft+fy(i),h=-s.scrollTop,"rtl"===fb(l||a).direction&&(d+=fu(a.clientWidth,l?l.clientWidth:0)-u),{width:u,height:c,x:d,y:h}))}function fQ(){return{top:0,right:0,bottom:0,left:0}}function f0(e){return Object.assign({},fQ(),e)}function f1(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function f2(e,t){void 0===t&&(t={});var n,r,i,o,a,s,l,u,c=t,d=c.placement,h=void 0===d?e.placement:d,p=c.strategy,f=void 0===p?e.strategy:p,g=c.boundary,m=c.rootBoundary,v=c.elementContext,y=void 0===v?fD:v,b=c.altBoundary,x=c.padding,w=void 0===x?0:x,S=f0("number"!=typeof w?w:f1(w,fR)),C=e.rects.popper,k=e.elements[void 0!==b&&b?y===fD?"reference":fD:y],M=(n=fa(k)?k:k.contextElement||fv(e.elements.popper),r=void 0===g?"clippingParents":g,i=void 0===m?fE:m,l=(s=[].concat("clippingParents"===r?(o=fC(fS(n)),fa(a=["absolute","fixed"].indexOf(fb(n).position)>=0&&fs(n)?fM(n):n)?o.filter(function(e){return fa(e)&&fY(e,a)&&"body"!==fm(e)}):[]):[].concat(r),[i]))[0],(u=s.reduce(function(e,t){var r=fJ(n,t,f);return e.top=fu(r.top,e.top),e.right=fc(r.right,e.right),e.bottom=fc(r.bottom,e.bottom),e.left=fu(r.left,e.left),e},fJ(n,l,f))).width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u),T=ff(e.elements.reference),A=fV({reference:T,element:C,strategy:"absolute",placement:h}),I=fX(Object.assign({},C,A)),P=y===fD?I:T,R={top:M.top-P.top+S.top,bottom:P.bottom-M.bottom+S.bottom,left:M.left-P.left+S.left,right:P.right-M.right+S.right},O=e.modifiersData.offset;if(y===fD&&O){var E=O[h];Object.keys(R).forEach(function(e){var t=[fA,fT].indexOf(e)>=0?1:-1,n=["top",fT].indexOf(e)>=0?"y":"x";R[e]+=E[n]*t})}return R}function f5(e,t,n){return fu(e,fc(t,n))}function f3(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function f4(e){return["top",fA,fT,fI].some(function(t){return e[t]>=0})}var f6=(NH=void 0===(NV=(N$={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,l=fo(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(e){e.addEventListener("scroll",n.update,fB)}),s&&l.addEventListener("resize",n.update,fB),function(){o&&u.forEach(function(e){e.removeEventListener("scroll",n.update,fB)}),s&&l.removeEventListener("resize",n.update,fB)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=fV({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=n.adaptive,o=n.roundOffsets,a=void 0===o||o,s={placement:fF(t.placement),variation:fz(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:void 0===r||r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,fW(Object.assign({},s,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:void 0===i||i,roundOffsets:a})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,fW(Object.assign({},s,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];fs(i)&&fm(i)&&(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});fs(r)&&fm(r)&&(Object.assign(r.style,o),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=f_.reduce(function(e,n){var r,i,a,s,l,u;return e[n]=(r=t.rects,a=[fI,"top"].indexOf(i=fF(n))>=0?-1:1,l=(s="function"==typeof o?o(Object.assign({},r,{placement:n})):o)[0],u=s[1],l=l||0,u=(u||0)*a,[fI,fA].indexOf(i)>=0?{x:u,y:l}:{x:l,y:u}),e},{}),s=a[t.placement],l=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,f=void 0===p||p,g=n.allowedAutoPlacements,m=t.options.placement,v=fF(m)===m,y=l||(v||!f?[fG(m)]:function(e){if(fF(e)===fP)return[];var t=fG(e);return[fK(e),t,fK(t)]}(m)),b=[m].concat(y).reduce(function(e,n){var r,i,o,a,s,l,h,p,m,v,y,b;return e.concat(fF(n)===fP?(i=(r={placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:g}).placement,o=r.boundary,a=r.rootBoundary,s=r.padding,l=r.flipVariations,p=void 0===(h=r.allowedAutoPlacements)?f_:h,0===(y=(v=(m=fz(i))?l?fL:fL.filter(function(e){return fz(e)===m}):fR).filter(function(e){return p.indexOf(e)>=0})).length&&(y=v),Object.keys(b=y.reduce(function(e,n){return e[n]=f2(t,{placement:n,boundary:o,rootBoundary:a,padding:s})[fF(n)],e},{})).sort(function(e,t){return b[e]-b[t]})):n)},[]),x=t.rects.reference,w=t.rects.popper,S=new Map,C=!0,k=b[0],M=0;M<b.length;M++){var T=b[M],A=fF(T),I=fz(T)===fO,P=["top",fT].indexOf(A)>=0,R=P?"width":"height",O=f2(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),E=P?I?fA:fI:I?fT:"top";x[R]>w[R]&&(E=fG(E));var D=fG(E),L=[];if(o&&L.push(O[A]<=0),s&&L.push(O[E]<=0,O[D]<=0),L.every(function(e){return e})){k=T,C=!1;break}S.set(T,L)}if(C)for(var _=f?3:1,N=function(e){var t=b.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return k=t,"break"},Z=_;Z>0&&"break"!==N(Z);Z--);t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=n.altAxis,a=n.boundary,s=n.rootBoundary,l=n.altBoundary,u=n.padding,c=n.tether,d=void 0===c||c,h=n.tetherOffset,p=void 0===h?0:h,f=f2(t,{boundary:a,rootBoundary:s,padding:u,altBoundary:l}),g=fF(t.placement),m=fz(t.placement),v=!m,y=f$(g),b="x"===y?"y":"x",x=t.modifiersData.popperOffsets,w=t.rects.reference,S=t.rects.popper,C="function"==typeof p?p(Object.assign({},t.rects,{placement:t.placement})):p,k="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),M=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,T={x:0,y:0};if(x){if(void 0===i||i){var A,I="y"===y?"top":fI,P="y"===y?fT:fA,R="y"===y?"height":"width",O=x[y],E=O+f[I],D=O-f[P],L=d?-S[R]/2:0,_=m===fO?w[R]:S[R],N=m===fO?-S[R]:-w[R],Z=t.elements.arrow,j=d&&Z?fw(Z):{width:0,height:0},B=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:fQ(),F=B[I],z=B[P],$=f5(0,w[R],j[R]),V=v?w[R]/2-L-$-F-k.mainAxis:_-$-F-k.mainAxis,H=v?-w[R]/2+L+$+z+k.mainAxis:N+$+z+k.mainAxis,W=t.elements.arrow&&fM(t.elements.arrow),q=W?"y"===y?W.clientTop||0:W.clientLeft||0:0,G=null!=(A=null==M?void 0:M[y])?A:0,U=f5(d?fc(E,O+V-G-q):E,O,d?fu(D,O+H-G):D);x[y]=U,T[y]=U-O}if(void 0!==o&&o){var K,Y,X="x"===y?"top":fI,J="x"===y?fT:fA,Q=x[b],ee="y"===b?"height":"width",et=Q+f[X],en=Q-f[J],er=-1!==["top",fI].indexOf(g),ei=null!=(Y=null==M?void 0:M[b])?Y:0,eo=er?et:Q-w[ee]-S[ee]-ei+k.altAxis,ea=er?Q+w[ee]+S[ee]-ei-k.altAxis:en,es=d&&er?(K=f5(eo,Q,ea))>ea?ea:K:f5(d?eo:et,Q,d?ea:en);x[b]=es,T[b]=es-Q}t.modifiersData[r]=T}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n,r=e.state,i=e.name,o=e.options,a=r.elements.arrow,s=r.modifiersData.popperOffsets,l=fF(r.placement),u=f$(l),c=[fI,fA].indexOf(l)>=0?"height":"width";if(a&&s){var d=f0("number"!=typeof(t="function"==typeof(t=o.padding)?t(Object.assign({},r.rects,{placement:r.placement})):t)?t:f1(t,fR)),h=fw(a),p="y"===u?"top":fI,f="y"===u?fT:fA,g=r.rects.reference[c]+r.rects.reference[u]-s[u]-r.rects.popper[c],m=s[u]-r.rects.reference[u],v=fM(a),y=v?"y"===u?v.clientHeight||0:v.clientWidth||0:0,b=d[p],x=y-h[c]-d[f],w=y/2-h[c]/2+(g/2-m/2),S=f5(b,w,x);r.modifiersData[i]=((n={})[u]=S,n.centerOffset=S-w,n)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&fY(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=f2(t,{elementContext:"reference"}),s=f2(t,{altBoundary:!0}),l=f3(a,r),u=f3(s,i,o),c=f4(l),d=f4(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]}).defaultModifiers)?[]:NV,Nq=void 0===(NW=N$.defaultOptions)?fZ:NW,function(e,t,n){void 0===n&&(n=Nq);var r,i,o={placement:"bottom",orderedModifiers:[],options:Object.assign({},fZ,Nq),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],s=!1,l={state:o,setOptions:function(n){var r,i,s,c,d,h,p="function"==typeof n?n(o.options):n;u(),o.options=Object.assign({},Nq,o.options,p),o.scrollParents={reference:fa(e)?fC(e):e.contextElement?fC(e.contextElement):[],popper:fC(t)};var f=(i=Object.keys(r=[].concat(NH,o.options.modifiers).reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{})).map(function(e){return r[e]}),s=new Map,c=new Set,d=[],i.forEach(function(e){s.set(e.name,e)}),i.forEach(function(e){c.has(e.name)||function e(t){c.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!c.has(t)){var n=s.get(t);n&&e(n)}}),d.push(t)}(e)}),h=d,fN.reduce(function(e,t){return e.concat(h.filter(function(e){return e.phase===t}))},[]));return o.orderedModifiers=f.filter(function(e){return e.enabled}),o.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=e.effect;if("function"==typeof r){var i=r({state:o,name:t,instance:l,options:void 0===n?{}:n});a.push(i||function(){})}}),l.update()},forceUpdate:function(){if(!s){var e,t,n,r,i,a,u,c,d,h,p,f=o.elements,g=f.reference,m=f.popper;if(fj(g,m)){o.rects={reference:(e=fM(m),t="fixed"===o.options.strategy,n=fs(e),u=fs(e)&&(i=fd((r=e.getBoundingClientRect()).width)/e.offsetWidth||1,a=fd(r.height)/e.offsetHeight||1,1!==i||1!==a),c=fv(e),d=ff(g,u,t),h={scrollLeft:0,scrollTop:0},p={x:0,y:0},(n||!n&&!t)&&(("body"!==fm(e)||fx(c))&&(h=function(e){return e!==fo(e)&&fs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:fg(e)}(e)),fs(e)?(p=ff(e,!0),p.x+=e.clientLeft,p.y+=e.clientTop):c&&(p.x=fy(c))),{x:d.left+h.scrollLeft-p.x,y:d.top+h.scrollTop-p.y,width:d.width,height:d.height}),popper:fw(m)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach(function(e){return o.modifiersData[e.name]=Object.assign({},e.data)});for(var v=0;v<o.orderedModifiers.length;v++){if(!0===o.reset){o.reset=!1,v=-1;continue}var y=o.orderedModifiers[v],b=y.fn,x=y.options,w=void 0===x?{}:x,S=y.name;"function"==typeof b&&(o=b({state:o,options:w,name:S,instance:l})||o)}}}},update:(r=function(){return new Promise(function(e){l.forceUpdate(),e(o)})},function(){return i||(i=new Promise(function(e){Promise.resolve().then(function(){i=void 0,e(r())})})),i}),destroy:function(){u(),s=!0}};if(!fj(e,t))return l;function u(){a.forEach(function(e){return e()}),a=[]}return l.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)}),l});function f8(e){return(0,A.ZP)("MuiPopper",e)}function f9(e){return"function"==typeof e?e():e}(0,T.Z)("MuiPopper",["root"]);let f7=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"]},f8,t)},ge={},gt=g.forwardRef(function(e,t){let{anchorEl:n,children:r,direction:i,disablePortal:o,modifiers:a,open:s,placement:l,popperOptions:u,popperRef:c,slotProps:d={},slots:h={},TransitionProps:p,ownerState:m,...v}=e,y=g.useRef(null),b=(0,rC.Z)(y,t),x=g.useRef(null),w=(0,rC.Z)(x,c),S=g.useRef(w);(0,rT.Z)(()=>{S.current=w},[w]),g.useImperativeHandle(c,()=>x.current,[]);let C=function(e,t){if("ltr"===t)return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(l,i),[k,M]=g.useState(C),[T,A]=g.useState(f9(n));g.useEffect(()=>{x.current&&x.current.forceUpdate()}),g.useEffect(()=>{n&&A(f9(n))},[n]),(0,rT.Z)(()=>{if(!T||!s)return;let e=e=>{M(e.placement)},t=[{name:"preventOverflow",options:{altBoundary:o}},{name:"flip",options:{altBoundary:o}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:t})=>{e(t)}}];null!=a&&(t=t.concat(a)),u&&null!=u.modifiers&&(t=t.concat(u.modifiers));let n=f6(T,y.current,{placement:C,...u,modifiers:t});return S.current(n),()=>{n.destroy(),S.current(null)}},[T,o,a,s,u,C]);let I={placement:k};null!==p&&(I.TransitionProps=p);let P=f7(e),R=h.root??"div",O=iF({elementType:R,externalSlotProps:d.root,externalForwardedProps:v,additionalProps:{role:"tooltip",ref:b},ownerState:e,className:P.root});return(0,f.jsx)(R,{...O,children:"function"==typeof r?r(I):r})}),gn=g.forwardRef(function(e,t){let n;let{anchorEl:r,children:i,container:o,direction:a="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:u,open:c,placement:d="bottom",popperOptions:h=ge,popperRef:p,style:m,transition:v=!1,slotProps:y={},slots:b={},...x}=e,[w,S]=g.useState(!0);if(!l&&!c&&(!v||w))return null;if(o)n=o;else if(r){let e=f9(r);n=e&&void 0!==e.nodeType?(0,ol.Z)(e).body:(0,ol.Z)(null).body}let C=!c&&l&&(!v||w)?"none":void 0,k=v?{in:c,onEnter:()=>{S(!1)},onExited:()=>{S(!0)}}:void 0;return(0,f.jsx)(op,{disablePortal:s,container:n,children:(0,f.jsx)(gt,{anchorEl:r,direction:a,disablePortal:s,modifiers:u,ref:t,open:v?!w:c,placement:d,popperOptions:h,popperRef:p,slotProps:y,slots:b,...x,style:{position:"fixed",top:0,left:0,display:C,...m},TransitionProps:k,children:i})})}),gr=(0,S.ZP)(gn,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),gi=g.forwardRef(function(e,t){let n=iL(),{anchorEl:r,component:i,components:o,componentsProps:a,container:s,disablePortal:l,keepMounted:u,modifiers:c,open:d,placement:h,popperOptions:p,popperRef:g,transition:m,slots:v,slotProps:y,...b}=(0,M.i)({props:e,name:"MuiPopper"}),x=v?.root??o?.Root,w={anchorEl:r,container:s,disablePortal:l,keepMounted:u,modifiers:c,open:d,placement:h,popperOptions:p,popperRef:g,transition:m,...b};return(0,f.jsx)(gr,{as:i,direction:n?"rtl":"ltr",slots:{root:x},slotProps:y??a,...w,ref:t})});function go(e){return(0,A.ZP)("MuiTooltip",e)}let ga=(0,T.Z)("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),gs=e=>{let{classes:t,disableInteractive:n,arrow:r,touch:i,placement:o}=e,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${(0,w.Z)(o.split("-")[0])}`],arrow:["arrow"]};return(0,y.Z)(a,go,t)},gl=(0,S.ZP)(gi,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})((0,C.Z)(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${ga.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${ga.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${ga.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${ga.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${ga.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${ga.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${ga.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${ga.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),gu=(0,S.ZP)("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${(0,w.Z)(n.placement.split("-")[0])}`]]}})((0,C.Z)(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:(0,b.Fq)(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${ga.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${ga.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${ga.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${ga.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${Math.round(16/14*1e5)/1e5}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${ga.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${ga.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${ga.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${ga.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${ga.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${ga.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${ga.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${ga.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${ga.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${ga.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),gc=(0,S.ZP)("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})((0,C.Z)(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:(0,b.Fq)(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}))),gd=!1,gh=new ee,gp={x:0,y:0};function gf(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}let gg=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiTooltip"}),{arrow:r=!1,children:i,classes:o,components:a={},componentsProps:s={},describeChild:l=!1,disableFocusListener:u=!1,disableHoverListener:c=!1,disableInteractive:d=!1,disableTouchListener:h=!1,enterDelay:p=100,enterNextDelay:m=0,enterTouchDelay:y=700,followCursor:b=!1,id:x,leaveDelay:w=0,leaveTouchDelay:S=1500,onClose:C,onOpen:k,open:T,placement:A="bottom",PopperComponent:I,PopperProps:P={},slotProps:R={},slots:O={},title:E,TransitionComponent:D,TransitionProps:L,..._}=n,Z=g.isValidElement(i)?i:(0,f.jsx)("span",{children:i}),z=ot(),$=iL(),[V,H]=g.useState(),[W,q]=g.useState(null),G=g.useRef(!1),U=d||b,K=et(),Y=et(),X=et(),J=et(),[Q,ee]=(0,an.Z)({controlled:T,default:!1,name:"Tooltip",state:"open"}),en=Q,er=(0,N.Z)(x),ei=g.useRef(),eo=(0,F.Z)(()=>{void 0!==ei.current&&(document.body.style.WebkitUserSelect=ei.current,ei.current=void 0),J.clear()});g.useEffect(()=>eo,[eo]);let ea=e=>{gh.clear(),gd=!0,ee(!0),k&&!en&&k(e)},es=(0,F.Z)(e=>{gh.start(800+w,()=>{gd=!1}),ee(!1),C&&en&&C(e),K.start(z.transitions.duration.shortest,()=>{G.current=!1})}),el=e=>{(!G.current||"touchstart"===e.type)&&(V&&V.removeAttribute("title"),Y.clear(),X.clear(),p||gd&&m?Y.start(gd?m:p,()=>{ea(e)}):ea(e))},eu=e=>{Y.clear(),X.start(w,()=>{es(e)})},[,ec]=g.useState(!1),ed=e=>{j(e.target)||(ec(!1),eu(e))},eh=e=>{V||H(e.currentTarget),j(e.target)&&(ec(!0),el(e))},ep=e=>{G.current=!0;let t=Z.props;t.onTouchStart&&t.onTouchStart(e)};g.useEffect(()=>{if(en)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"===e.key&&es(e)}},[es,en]);let ef=(0,B.Z)(iO(Z),H,t);E||0===E||(en=!1);let eg=g.useRef(),em={},ev="string"==typeof E;l?(em.title=en||!ev||c?null:E,em["aria-describedby"]=en?er:null):(em["aria-label"]=ev?E:null,em["aria-labelledby"]=en&&!ev?er:null);let ey={...em,..._,...Z.props,className:(0,v.Z)(_.className,Z.props.className),onTouchStart:ep,ref:ef,...b?{onMouseMove:e=>{let t=Z.props;t.onMouseMove&&t.onMouseMove(e),gp={x:e.clientX,y:e.clientY},eg.current&&eg.current.update()}}:{}},eb={};h||(ey.onTouchStart=e=>{ep(e),X.clear(),K.clear(),eo(),ei.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",J.start(y,()=>{document.body.style.WebkitUserSelect=ei.current,el(e)})},ey.onTouchEnd=e=>{Z.props.onTouchEnd&&Z.props.onTouchEnd(e),eo(),X.start(S,()=>{es(e)})}),c||(ey.onMouseOver=gf(el,ey.onMouseOver),ey.onMouseLeave=gf(eu,ey.onMouseLeave),U||(eb.onMouseOver=el,eb.onMouseLeave=eu)),u||(ey.onFocus=gf(eh,ey.onFocus),ey.onBlur=gf(ed,ey.onBlur),U||(eb.onFocus=eh,eb.onBlur=ed));let ex={...n,isRtl:$,arrow:r,disableInteractive:U,placement:A,PopperComponentProp:I,touch:G.current},ew="function"==typeof R.popper?R.popper(ex):R.popper,eS=g.useMemo(()=>{let e=[{name:"arrow",enabled:!!W,options:{element:W,padding:4}}];return P.popperOptions?.modifiers&&(e=e.concat(P.popperOptions.modifiers)),ew?.popperOptions?.modifiers&&(e=e.concat(ew.popperOptions.modifiers)),{...P.popperOptions,...ew?.popperOptions,modifiers:e}},[W,P.popperOptions,ew?.popperOptions]),eC=gs(ex),ek="function"==typeof R.transition?R.transition(ex):R.transition,eM={slots:{popper:a.Popper,transition:a.Transition??D,tooltip:a.Tooltip,arrow:a.Arrow,...O},slotProps:{arrow:R.arrow??s.arrow,popper:{...P,...ew??s.popper},tooltip:R.tooltip??s.tooltip,transition:{...L,...ek??s.transition}}},[eT,eA]=of("popper",{elementType:gl,externalForwardedProps:eM,ownerState:ex,className:(0,v.Z)(eC.popper,P?.className)}),[eI,eP]=of("transition",{elementType:os,externalForwardedProps:eM,ownerState:ex}),[eR,eO]=of("tooltip",{elementType:gu,className:eC.tooltip,externalForwardedProps:eM,ownerState:ex}),[eE,eD]=of("arrow",{elementType:gc,className:eC.arrow,externalForwardedProps:eM,ownerState:ex,ref:q});return(0,f.jsxs)(g.Fragment,{children:[g.cloneElement(Z,ey),(0,f.jsx)(eT,{as:I??gi,placement:A,anchorEl:b?{getBoundingClientRect:()=>({top:gp.y,left:gp.x,right:gp.x,bottom:gp.y,width:0,height:0})}:V,popperRef:eg,open:!!V&&en,id:er,transition:!0,...eb,...eA,popperOptions:eS,children:({TransitionProps:e})=>(0,f.jsx)(eI,{timeout:z.transitions.duration.shorter,...e,...eP,children:(0,f.jsxs)(eR,{...eO,children:[E,r?(0,f.jsx)(eE,{...eD}):null]})})})]})}),gm=({id:e,title:t,description:n,placement:r,children:i,enterDelay:o,enterNextDelay:a})=>{let s=(0,f.jsx)("span",{children:i});return(0,f.jsx)(gy,{arrow:!0,id:e,placement:r??"top",title:(0,f.jsx)(gv,{title:t,description:n}),enterDelay:o??500,enterNextDelay:a??500,children:s})},gv=({title:e,description:t})=>(0,f.jsxs)(f.Fragment,{children:[e&&(0,f.jsx)(c1,{variant:"body2",sx:e=>({color:e.palette.text.primary,fontWeight:e.typography.fontWeightMedium}),children:e}),(0,f.jsx)(c1,{variant:"caption",sx:e=>({color:e.palette.text.primary,whiteSpace:"pre-line"}),children:t})]}),gy=(0,S.ZP)(({className:e,...t})=>(0,f.jsx)(gg,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${ga.tooltip}`]:{backgroundColor:e.palette.background.tooltip,color:e.palette.text.primary,maxWidth:"300px",padding:e.spacing(1),boxShadow:e.shadows[1]},[`& .${ga.arrow}`]:{color:e.palette.background.tooltip}})),gb=({label:e,control:t,description:n})=>{let r=fi("EditorSectionControl"),i=`${r}-control`;return(0,f.jsx)(iM,{children:(0,f.jsxs)(rf,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,f.jsxs)(rf,{direction:"row",alignItems:"center",justifyContent:"center",children:[(0,f.jsx)(im,{htmlFor:i,children:e}),n&&(0,f.jsx)(gm,{description:n,enterDelay:100,children:(0,f.jsx)(rx,{size:"small",sx:e=>({borderRadius:e.shape.borderRadius,padding:"4x",margin:"0 2px"}),children:(0,f.jsx)(fr.default,{"aria-describedby":"info-tooltip","aria-hidden":!1,fontSize:"inherit",sx:{color:e=>e.palette.grey[700]}})})})]}),(0,f.jsxs)(tU,{sx:{width:"180px",textAlign:"right"},children:[" ",m().cloneElement(t,{id:i})]})]})})};var gx=n(9831);let gw=e=>{let t=g.useRef({});return g.useEffect(()=>{t.current=e}),t.current};function gS(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function gC(e={}){let{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:i="any",stringify:o,trim:a=!1}=e;return(e,{inputValue:s,getOptionLabel:l})=>{let u=a?s.trim():s;n&&(u=u.toLowerCase()),t&&(u=gS(u));let c=u?e.filter(e=>{let r=(o||l)(e);return n&&(r=r.toLowerCase()),t&&(r=gS(r)),"start"===i?r.startsWith(u):r.includes(u)}):e;return"number"==typeof r?c.slice(0,r):c}}let gk=gC(),gM=e=>null!==e.current&&e.current.parentElement?.contains(document.activeElement),gT=[];function gA(e,t,n){if(t||null==e)return"";let r=n(e);return"string"==typeof r?r:""}let gI=function(e){let{unstable_isActiveElementInListbox:t=gM,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:i=!1,autoSelect:o=!1,blurOnSelect:a=!1,clearOnBlur:s=!e.freeSolo,clearOnEscape:l=!1,componentName:u="useAutocomplete",defaultValue:c=e.multiple?gT:null,disableClearable:d=!1,disableCloseOnSelect:h=!1,disabled:p,disabledItemsFocusable:f=!1,disableListWrap:m=!1,filterOptions:v=gk,filterSelectedOptions:y=!1,freeSolo:b=!1,getOptionDisabled:x,getOptionKey:w,getOptionLabel:S=e=>e.label??e,groupBy:C,handleHomeEndKeys:k=!e.freeSolo,id:M,includeInputInList:T=!1,inputValue:A,isOptionEqualToValue:I=(e,t)=>e===t,multiple:P=!1,onChange:R,onClose:O,onHighlightChange:E,onInputChange:D,onOpen:L,open:_,openOnFocus:N=!1,options:Z,readOnly:j=!1,selectOnFocus:B=!e.freeSolo,value:F}=e,z=(0,rw.Z)(M),$=S;$=e=>{let t=S(e);return"string"!=typeof t?String(t):t};let V=g.useRef(!1),H=g.useRef(!0),W=g.useRef(null),q=g.useRef(null),[G,U]=g.useState(null),[K,Y]=g.useState(-1),X=i?0:-1,J=g.useRef(X),Q=g.useRef(gA(c,P,$)).current,[ee,et]=(0,gx.Z)({controlled:F,default:c,name:u}),[en,er]=(0,gx.Z)({controlled:A,default:Q,name:u,state:"inputValue"}),[ei,eo]=g.useState(!1),ea=g.useCallback((e,t,n)=>{if(!(P?ee.length<t.length:null!==t)&&!s)return;let r=gA(t,P,$);en!==r&&(er(r),D&&D(e,r,n))},[$,en,P,D,er,s,ee]),[es,el]=(0,gx.Z)({controlled:_,default:!1,name:u,state:"open"}),[eu,ec]=g.useState(!0),ed=!P&&null!=ee&&en===$(ee),eh=es&&!j,ep=eh?v(Z.filter(e=>!(y&&(P?ee:[ee]).some(t=>null!==t&&I(e,t)))),{inputValue:ed&&eu?"":en,getOptionLabel:$}):[],ef=gw({filteredOptions:ep,value:ee,inputValue:en});g.useEffect(()=>{let e=ee!==ef.value;(!ei||e)&&(!b||e)&&ea(null,ee,"reset")},[ee,ea,ei,ef.value,b]);let eg=es&&ep.length>0&&!j,em=(0,rM.Z)(e=>{-1===e?W.current.focus():G.querySelector(`[data-tag-index="${e}"]`).focus()});g.useEffect(()=>{P&&K>ee.length-1&&(Y(-1),em(-1))},[ee,P,K,em]);let ev=(0,rM.Z)(({event:e,index:t,reason:r="auto"})=>{if(J.current=t,-1===t?W.current.removeAttribute("aria-activedescendant"):W.current.setAttribute("aria-activedescendant",`${z}-option-${t}`),E&&E(e,-1===t?null:ep[t],r),!q.current)return;let i=q.current.querySelector(`[role="option"].${n}-focused`);i&&(i.classList.remove(`${n}-focused`),i.classList.remove(`${n}-focusVisible`));let o=q.current;if("listbox"!==q.current.getAttribute("role")&&(o=q.current.parentElement.querySelector('[role="listbox"]')),!o)return;if(-1===t){o.scrollTop=0;return}let a=q.current.querySelector(`[data-option-index="${t}"]`);if(a&&(a.classList.add(`${n}-focused`),"keyboard"===r&&a.classList.add(`${n}-focusVisible`),o.scrollHeight>o.clientHeight&&"mouse"!==r&&"touch"!==r)){let e=o.clientHeight+o.scrollTop,t=a.offsetTop+a.offsetHeight;t>e?o.scrollTop=t-o.clientHeight:a.offsetTop-a.offsetHeight*(1.3*!!C)<o.scrollTop&&(o.scrollTop=a.offsetTop-a.offsetHeight*(1.3*!!C))}}),ey=(0,rM.Z)(({event:e,diff:t,direction:n="next",reason:i="auto"})=>{if(!eh)return;let o=function(e,t){if(!q.current||e<0||e>=ep.length)return -1;let n=e;for(;;){let r=q.current.querySelector(`[data-option-index="${n}"]`),i=!f&&(!r||r.disabled||"true"===r.getAttribute("aria-disabled"));if(r&&r.hasAttribute("tabindex")&&!i)return n;if((n="next"===t?(n+1)%ep.length:(n-1+ep.length)%ep.length)===e)return -1}}((()=>{let e=ep.length-1;if("reset"===t)return X;if("start"===t)return 0;if("end"===t)return e;let n=J.current+t;return n<0?-1===n&&T?-1:m&&-1!==J.current||Math.abs(t)>1?0:e:n>e?n===e+1&&T?-1:m||Math.abs(t)>1?e:0:n})(),n);if(ev({index:o,reason:i,event:e}),r&&"reset"!==t){if(-1===o)W.current.value=en;else{let e=$(ep[o]);W.current.value=e,0===e.toLowerCase().indexOf(en.toLowerCase())&&en.length>0&&W.current.setSelectionRange(en.length,e.length)}}}),eb=()=>{var e,t;if(-1!==J.current&&ef.filteredOptions&&ef.filteredOptions.length!==ep.length&&ef.inputValue===en&&(P?ee.length===ef.value.length&&ef.value.every((e,t)=>$(ee[t])===$(e)):(e=ef.value,t=ee,(e?$(e):"")===(t?$(t):"")))){let e=ef.filteredOptions[J.current];if(e)return ep.findIndex(t=>$(t)===$(e))}return -1},ex=g.useCallback(()=>{if(!eh)return;let e=eb();if(-1!==e){J.current=e;return}let t=P?ee[0]:ee;if(0===ep.length||null==t){ey({diff:"reset"});return}if(q.current){if(null!=t){let e=ep[J.current];if(P&&e&&-1!==ee.findIndex(t=>I(e,t)))return;let n=ep.findIndex(e=>I(e,t));-1===n?ey({diff:"reset"}):ev({index:n});return}if(J.current>=ep.length-1){ev({index:ep.length-1});return}ev({index:J.current})}},[ep.length,!P&&ee,y,ey,ev,eh,en,P]),ew=(0,rM.Z)(e=>{(0,oh.Z)(q,e),e&&ex()});g.useEffect(()=>{ex()},[ex]);let eS=e=>{!es&&(el(!0),ec(!0),L&&L(e))},eC=(e,t)=>{es&&(el(!1),O&&O(e,t))},ek=(e,t,n,r)=>{if(P){if(ee.length===t.length&&ee.every((e,n)=>e===t[n]))return}else if(ee===t)return;R&&R(e,t,n,r),et(t)},eM=g.useRef(!1),eT=(e,t,n="selectOption",r="options")=>{let i=n,o=t;if(P){let e=(o=Array.isArray(ee)?ee.slice():[]).findIndex(e=>I(t,e));-1===e?o.push(t):"freeSolo"!==r&&(o.splice(e,1),i="removeOption")}ea(e,o,i),ek(e,o,i,{option:t}),h||e&&(e.ctrlKey||e.metaKey)||eC(e,i),(!0===a||"touch"===a&&eM.current||"mouse"===a&&!eM.current)&&W.current.blur()},eA=(e,t)=>{if(!P)return;""===en&&eC(e,"toggleInput");let n=K;-1===K?""===en&&"previous"===t&&(n=ee.length-1):((n+="next"===t?1:-1)<0&&(n=0),n===ee.length&&(n=-1)),Y(n=function(e,t){if(-1===e)return -1;let n=e;for(;;){if("next"===t&&n===ee.length||"previous"===t&&-1===n)return -1;let e=G.querySelector(`[data-tag-index="${n}"]`);if(e&&e.hasAttribute("tabindex")&&!e.disabled&&"true"!==e.getAttribute("aria-disabled"))return n;n+="next"===t?1:-1}}(n,t)),em(n)},eI=e=>{V.current=!0,er(""),D&&D(e,"","clear"),ek(e,P?[]:null,"clear")},eP=e=>t=>{if(e.onKeyDown&&e.onKeyDown(t),!t.defaultMuiPrevented&&(-1===K||["ArrowLeft","ArrowRight"].includes(t.key)||(Y(-1),em(-1)),229!==t.which))switch(t.key){case"Home":eh&&k&&(t.preventDefault(),ey({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":eh&&k&&(t.preventDefault(),ey({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),ey({diff:-5,direction:"previous",reason:"keyboard",event:t}),eS(t);break;case"PageDown":t.preventDefault(),ey({diff:5,direction:"next",reason:"keyboard",event:t}),eS(t);break;case"ArrowDown":t.preventDefault(),ey({diff:1,direction:"next",reason:"keyboard",event:t}),eS(t);break;case"ArrowUp":t.preventDefault(),ey({diff:-1,direction:"previous",reason:"keyboard",event:t}),eS(t);break;case"ArrowLeft":eA(t,"previous");break;case"ArrowRight":eA(t,"next");break;case"Enter":if(-1!==J.current&&eh){let e=ep[J.current],n=!!x&&x(e);if(t.preventDefault(),n)return;eT(t,e,"selectOption"),r&&W.current.setSelectionRange(W.current.value.length,W.current.value.length)}else b&&""!==en&&!1===ed&&(P&&t.preventDefault(),eT(t,en,"createOption","freeSolo"));break;case"Escape":eh?(t.preventDefault(),t.stopPropagation(),eC(t,"escape")):l&&(""!==en||P&&ee.length>0)&&(t.preventDefault(),t.stopPropagation(),eI(t));break;case"Backspace":if(P&&!j&&""===en&&ee.length>0){let e=-1===K?ee.length-1:K,n=ee.slice();n.splice(e,1),ek(t,n,"removeOption",{option:ee[e]})}break;case"Delete":if(P&&!j&&""===en&&ee.length>0&&-1!==K){let e=ee.slice();e.splice(K,1),ek(t,e,"removeOption",{option:ee[K]})}}},eR=e=>{eo(!0),N&&!V.current&&eS(e)},eO=e=>{if(t(q)){W.current.focus();return}eo(!1),H.current=!0,V.current=!1,o&&-1!==J.current&&eh?eT(e,ep[J.current],"blur"):o&&b&&""!==en?eT(e,en,"blur","freeSolo"):s&&ea(e,ee,"blur"),eC(e,"blur")},eE=e=>{let t=e.target.value;en!==t&&(er(t),ec(!1),D&&D(e,t,"input")),""===t?d||P||ek(e,null,"clear"):eS(e)},eD=e=>{let t=Number(e.currentTarget.getAttribute("data-option-index"));J.current!==t&&ev({event:e,index:t,reason:"mouse"})},eL=e=>{ev({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"touch"}),eM.current=!0},e_=e=>{let t=Number(e.currentTarget.getAttribute("data-option-index"));eT(e,ep[t],"selectOption"),eM.current=!1},eN=e=>t=>{let n=ee.slice();n.splice(e,1),ek(t,n,"removeOption",{option:ee[e]})},eZ=e=>{es?eC(e,"toggleInput"):eS(e)},ej=e=>{e.currentTarget.contains(e.target)&&e.target.getAttribute("id")!==z&&e.preventDefault()},eB=e=>{e.currentTarget.contains(e.target)&&(W.current.focus(),B&&H.current&&W.current.selectionEnd-W.current.selectionStart==0&&W.current.select(),H.current=!1)},eF=e=>{p||""!==en&&es||eZ(e)},ez=b&&en.length>0;ez=ez||(P?ee.length>0:null!==ee);let e$=ep;return C&&(e$=ep.reduce((e,t,n)=>{let r=C(t);return e.length>0&&e[e.length-1].group===r?e[e.length-1].options.push(t):e.push({key:n,index:n,group:r,options:[t]}),e},[])),p&&ei&&eO(),{getRootProps:(e={})=>({...e,onKeyDown:eP(e),onMouseDown:ej,onClick:eB}),getInputLabelProps:()=>({id:`${z}-label`,htmlFor:z}),getInputProps:()=>({id:z,value:en,onBlur:eO,onFocus:eR,onChange:eE,onMouseDown:eF,"aria-activedescendant":eh?"":null,"aria-autocomplete":r?"both":"list","aria-controls":eg?`${z}-listbox`:void 0,"aria-expanded":eg,autoComplete:"off",ref:W,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:p}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:eI}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:eZ}),getTagProps:({index:e})=>({key:e,"data-tag-index":e,tabIndex:-1,...!j&&{onDelete:eN(e)}}),getListboxProps:()=>({role:"listbox",id:`${z}-listbox`,"aria-labelledby":`${z}-label`,ref:ew,onMouseDown:e=>{e.preventDefault()}}),getOptionProps:({index:e,option:t})=>{let n=(P?ee:[ee]).some(e=>null!=e&&I(t,e)),r=!!x&&x(t);return{key:w?.(t)??$(t),tabIndex:-1,role:"option",id:`${z}-option-${e}`,onMouseMove:eD,onClick:e_,onTouchStart:eL,"data-option-index":e,"aria-disabled":r,"aria-selected":n}},id:z,inputValue:en,value:ee,dirty:ez,expanded:eh&&G,popupOpen:eh,focused:ei||-1!==K,anchorEl:G,setAnchorEl:U,focusedTag:K,groupedOptions:e$}};function gP(e){return(0,A.ZP)("MuiListSubheader",e)}(0,T.Z)("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);let gR=e=>{let{classes:t,color:n,disableGutters:r,inset:i,disableSticky:o}=e,a={root:["root","default"!==n&&`color${(0,w.Z)(n)}`,!r&&"gutters",i&&"inset",!o&&"sticky"]};return(0,y.Z)(a,gP,t)},gO=(0,S.ZP)("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${(0,w.Z)(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})((0,C.Z)(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:72}},{props:({ownerState:e})=>!e.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),gE=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiListSubheader"}),{className:r,color:i="default",component:o="li",disableGutters:a=!1,disableSticky:s=!1,inset:l=!1,...u}=n,c={...n,color:i,component:o,disableGutters:a,disableSticky:s,inset:l},d=gR(c);return(0,f.jsx)(gO,{as:o,className:(0,v.Z)(d.root,r),ref:t,ownerState:c,...u})});gE&&(gE.muiSkipListHighlight=!0);let gD=(0,ad.Z)((0,f.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function gL(e){return(0,A.ZP)("MuiChip",e)}let g_=(0,T.Z)("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),gN=e=>{let{classes:t,disabled:n,size:r,color:i,iconColor:o,onDelete:a,clickable:s,variant:l}=e,u={root:["root",l,n&&"disabled",`size${(0,w.Z)(r)}`,`color${(0,w.Z)(i)}`,s&&"clickable",s&&`clickableColor${(0,w.Z)(i)}`,a&&"deletable",a&&`deletableColor${(0,w.Z)(i)}`,`${l}${(0,w.Z)(i)}`],label:["label",`label${(0,w.Z)(r)}`],avatar:["avatar",`avatar${(0,w.Z)(r)}`,`avatarColor${(0,w.Z)(i)}`],icon:["icon",`icon${(0,w.Z)(r)}`,`iconColor${(0,w.Z)(o)}`],deleteIcon:["deleteIcon",`deleteIcon${(0,w.Z)(r)}`,`deleteIconColor${(0,w.Z)(i)}`,`deleteIcon${(0,w.Z)(l)}Color${(0,w.Z)(i)}`]};return(0,y.Z)(u,gL,t)},gZ=(0,S.ZP)("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e,{color:r,iconColor:i,clickable:o,onDelete:a,size:s,variant:l}=n;return[{[`& .${g_.avatar}`]:t.avatar},{[`& .${g_.avatar}`]:t[`avatar${(0,w.Z)(s)}`]},{[`& .${g_.avatar}`]:t[`avatarColor${(0,w.Z)(r)}`]},{[`& .${g_.icon}`]:t.icon},{[`& .${g_.icon}`]:t[`icon${(0,w.Z)(s)}`]},{[`& .${g_.icon}`]:t[`iconColor${(0,w.Z)(i)}`]},{[`& .${g_.deleteIcon}`]:t.deleteIcon},{[`& .${g_.deleteIcon}`]:t[`deleteIcon${(0,w.Z)(s)}`]},{[`& .${g_.deleteIcon}`]:t[`deleteIconColor${(0,w.Z)(r)}`]},{[`& .${g_.deleteIcon}`]:t[`deleteIcon${(0,w.Z)(l)}Color${(0,w.Z)(r)}`]},t.root,t[`size${(0,w.Z)(s)}`],t[`color${(0,w.Z)(r)}`],o&&t.clickable,o&&"default"!==r&&t[`clickableColor${(0,w.Z)(r)})`],a&&t.deletable,a&&"default"!==r&&t[`deletableColor${(0,w.Z)(r)}`],t[l],t[`${l}${(0,w.Z)(r)}`]]}})((0,C.Z)(({theme:e})=>{let t="light"===e.palette.mode?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:16,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${g_.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${g_.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${g_.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${g_.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${g_.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${g_.icon}`]:{marginLeft:5,marginRight:-6},[`& .${g_.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:(0,b.Fq)(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:(0,b.Fq)(e.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${g_.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${g_.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(k(["contrastText"])).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main,color:(e.vars||e).palette[t].contrastText,[`& .${g_.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t].contrastTextChannel} / 0.7)`:(0,b.Fq)(e.palette[t].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t].contrastText}}}})),{props:e=>e.iconColor===e.color,style:{[`& .${g_.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:e=>e.iconColor===e.color&&"default"!==e.color,style:{[`& .${g_.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${g_.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,b.Fq)(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}},...Object.entries(e.palette).filter(k(["dark"])).map(([t])=>({props:{color:t,onDelete:!0},style:{[`&.${g_.focusVisible}`]:{background:(e.vars||e).palette[t].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,b.Fq)(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${g_.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,b.Fq)(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(k(["dark"])).map(([t])=>({props:{color:t,clickable:!0},style:{[`&:hover, &.${g_.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${"light"===e.palette.mode?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${g_.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${g_.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${g_.avatar}`]:{marginLeft:4},[`& .${g_.avatarSmall}`]:{marginLeft:2},[`& .${g_.icon}`]:{marginLeft:4},[`& .${g_.iconSmall}`]:{marginLeft:2},[`& .${g_.deleteIcon}`]:{marginRight:5},[`& .${g_.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(k()).map(([t])=>({props:{variant:"outlined",color:t},style:{color:(e.vars||e).palette[t].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.7)`:(0,b.Fq)(e.palette[t].main,.7)}`,[`&.${g_.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette[t].main,e.palette.action.hoverOpacity)},[`&.${g_.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.focusOpacity})`:(0,b.Fq)(e.palette[t].main,e.palette.action.focusOpacity)},[`& .${g_.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.7)`:(0,b.Fq)(e.palette[t].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t].main}}}}))]}})),gj=(0,S.ZP)("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{let{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${(0,w.Z)(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function gB(e){return"Backspace"===e.key||"Delete"===e.key}let gF=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiChip"}),{avatar:r,className:i,clickable:o,color:a="default",component:s,deleteIcon:l,disabled:u=!1,icon:c,label:d,onClick:h,onDelete:p,onKeyDown:m,onKeyUp:y,size:b="medium",variant:x="filled",tabIndex:w,skipFocusWhenDisabled:S=!1,...C}=n,k=g.useRef(null),T=(0,B.Z)(k,t),A=e=>{e.stopPropagation(),p&&p(e)},I=!1!==o&&!!h||o,P=I||p?ef:s||"div",R={...n,component:P,disabled:u,size:b,color:a,iconColor:g.isValidElement(c)&&c.props.color||a,onDelete:!!p,clickable:I,variant:x},O=gN(R),E=P===ef?{component:s||"div",focusVisibleClassName:O.focusVisible,...p&&{disableRipple:!0}}:{},D=null;p&&(D=l&&g.isValidElement(l)?g.cloneElement(l,{className:(0,v.Z)(l.props.className,O.deleteIcon),onClick:A}):(0,f.jsx)(gD,{className:(0,v.Z)(O.deleteIcon),onClick:A}));let L=null;r&&g.isValidElement(r)&&(L=g.cloneElement(r,{className:(0,v.Z)(O.avatar,r.props.className)}));let _=null;return c&&g.isValidElement(c)&&(_=g.cloneElement(c,{className:(0,v.Z)(O.icon,c.props.className)})),(0,f.jsxs)(gZ,{as:P,className:(0,v.Z)(O.root,i),disabled:!!I&&!!u||void 0,onClick:h,onKeyDown:e=>{e.currentTarget===e.target&&gB(e)&&e.preventDefault(),m&&m(e)},onKeyUp:e=>{e.currentTarget===e.target&&p&&gB(e)&&p(e),y&&y(e)},ref:T,tabIndex:S&&u?-1:w,ownerState:R,...E,...C,children:[L||_,(0,f.jsx)(gj,{className:(0,v.Z)(O.label),ownerState:R,children:d}),D]})}),gz=(0,ad.Z)((0,f.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function g$(e){return(0,A.ZP)("MuiAutocomplete",e)}let gV=(0,T.Z)("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]),gH=e=>{let{classes:t,disablePortal:n,expanded:r,focused:i,fullWidth:o,hasClearIcon:a,hasPopupIcon:s,inputFocused:l,popupOpen:u,size:c}=e,d={root:["root",r&&"expanded",i&&"focused",o&&"fullWidth",a&&"hasClearIcon",s&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${(0,w.Z)(c)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return(0,y.Z)(d,g$,t)},gW=(0,S.ZP)("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e,{fullWidth:r,hasClearIcon:i,hasPopupIcon:o,inputFocused:a,size:s}=n;return[{[`& .${gV.tag}`]:t.tag},{[`& .${gV.tag}`]:t[`tagSize${(0,w.Z)(s)}`]},{[`& .${gV.inputRoot}`]:t.inputRoot},{[`& .${gV.input}`]:t.input},{[`& .${gV.input}`]:a&&t.inputFocused},t.root,r&&t.fullWidth,o&&t.hasPopupIcon,i&&t.hasClearIcon]}})({[`&.${gV.focused} .${gV.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${gV.clearIndicator}`]:{visibility:"visible"}},[`& .${gV.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${gV.inputRoot}`]:{[`.${gV.hasPopupIcon}&, .${gV.hasClearIcon}&`]:{paddingRight:30},[`.${gV.hasPopupIcon}.${gV.hasClearIcon}&`]:{paddingRight:56},[`& .${gV.input}`]:{width:0,minWidth:30}},[`& .${rQ.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${rQ.root}.${rH.sizeSmall}`]:{[`& .${rQ.input}`]:{padding:"2px 4px 3px 0"}},[`& .${ii.root}`]:{padding:9,[`.${gV.hasPopupIcon}&, .${gV.hasClearIcon}&`]:{paddingRight:39},[`.${gV.hasPopupIcon}.${gV.hasClearIcon}&`]:{paddingRight:65},[`& .${gV.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${gV.endAdornment}`]:{right:9}},[`& .${ii.root}.${rH.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${gV.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${r4.root}`]:{paddingTop:19,paddingLeft:8,[`.${gV.hasPopupIcon}&, .${gV.hasClearIcon}&`]:{paddingRight:39},[`.${gV.hasPopupIcon}.${gV.hasClearIcon}&`]:{paddingRight:65},[`& .${r4.input}`]:{padding:"7px 4px"},[`& .${gV.endAdornment}`]:{right:9}},[`& .${r4.root}.${rH.sizeSmall}`]:{paddingBottom:1,[`& .${r4.input}`]:{padding:"2.5px 4px"}},[`& .${rH.hiddenLabel}`]:{paddingTop:8},[`& .${r4.root}.${rH.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${gV.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${r4.root}.${rH.hiddenLabel}.${rH.sizeSmall}`]:{[`& .${gV.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${gV.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${gV.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${gV.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${gV.inputRoot}`]:{flexWrap:"wrap"}}}]}),gq=(0,S.ZP)("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),gG=(0,S.ZP)(rx,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),gU=(0,S.ZP)(rx,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),gK=(0,S.ZP)(gi,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${gV.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})((0,C.Z)(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),gY=(0,S.ZP)(oj,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})((0,C.Z)(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),gX=(0,S.ZP)("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})((0,C.Z)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),gJ=(0,S.ZP)("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})((0,C.Z)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),gQ=(0,S.ZP)("ul",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})((0,C.Z)(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${gV.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${gV.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${gV.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${gV.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${gV.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,b.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}}))),g0=(0,S.ZP)(gE,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})((0,C.Z)(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),g1=(0,S.ZP)("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${gV.option}`]:{paddingLeft:24}}),g2=g.forwardRef(function(e,t){let n;let r=(0,M.i)({props:e,name:"MuiAutocomplete"}),{autoComplete:i=!1,autoHighlight:o=!1,autoSelect:a=!1,blurOnSelect:s=!1,ChipProps:l,className:u,clearIcon:c=N8||(N8=(0,f.jsx)(gz,{fontSize:"small"})),clearOnBlur:d=!r.freeSolo,clearOnEscape:h=!1,clearText:p="Clear",closeText:m="Close",componentsProps:y,defaultValue:b=r.multiple?[]:null,disableClearable:x=!1,disableCloseOnSelect:w=!1,disabled:S=!1,disabledItemsFocusable:C=!1,disableListWrap:k=!1,disablePortal:T=!1,filterOptions:A,filterSelectedOptions:I=!1,forcePopupIcon:P="auto",freeSolo:R=!1,fullWidth:O=!1,getLimitTagsText:E=e=>`+${e}`,getOptionDisabled:D,getOptionKey:L,getOptionLabel:_,isOptionEqualToValue:N,groupBy:Z,handleHomeEndKeys:j=!r.freeSolo,id:B,includeInputInList:F=!1,inputValue:z,limitTags:$=-1,ListboxComponent:V,ListboxProps:H,loading:W=!1,loadingText:q="Loading…",multiple:G=!1,noOptionsText:U="No options",onChange:K,onClose:Y,onHighlightChange:X,onInputChange:J,onOpen:Q,open:ee,openOnFocus:et=!1,openText:en="Open",options:er,PaperComponent:ei,PopperComponent:eo,popupIcon:ea=N9||(N9=(0,f.jsx)(ah,{})),readOnly:es=!1,renderGroup:el,renderInput:eu,renderOption:ec,renderTags:ed,selectOnFocus:eh=!r.freeSolo,size:ep="medium",slots:ef={},slotProps:eg={},value:em,...ev}=r,{getRootProps:ey,getInputProps:eb,getInputLabelProps:ex,getPopupIndicatorProps:ew,getClearProps:eS,getTagProps:eC,getListboxProps:ek,getOptionProps:eM,value:eT,dirty:eA,expanded:eI,id:eP,popupOpen:eR,focused:eO,focusedTag:eE,anchorEl:eD,setAnchorEl:eL,inputValue:e_,groupedOptions:eN}=gI({...r,componentName:"Autocomplete"}),eZ=!x&&!S&&eA&&!es,ej=(!R||!0===P)&&!1!==P,{onMouseDown:eB}=eb(),{ref:eF,...ez}=ek(),e$=_||(e=>e.label??e),eV={...r,disablePortal:T,expanded:eI,focused:eO,fullWidth:O,getOptionLabel:e$,hasClearIcon:eZ,hasPopupIcon:ej,inputFocused:-1===eE,popupOpen:eR,size:ep},eH=gH(eV),eW={slots:{paper:ei,popper:eo,...ef},slotProps:{chip:l,listbox:H,...y,...eg}},[eq,eG]=of("listbox",{elementType:gQ,externalForwardedProps:eW,ownerState:eV,className:eH.listbox,additionalProps:ez,ref:eF}),[eU,eK]=of("paper",{elementType:oj,externalForwardedProps:eW,ownerState:eV,className:eH.paper}),[eY,eX]=of("popper",{elementType:gi,externalForwardedProps:eW,ownerState:eV,className:eH.popper,additionalProps:{disablePortal:T,style:{width:eD?eD.clientWidth:null},role:"presentation",anchorEl:eD,open:eR}});if(G&&eT.length>0){let e=e=>({className:eH.tag,disabled:S,...eC(e)});n=ed?ed(eT,e,eV):eT.map((t,n)=>{let{key:r,...i}=e({index:n});return(0,f.jsx)(gF,{label:e$(t),size:ep,...i,...eW.slotProps.chip},r)})}if($>-1&&Array.isArray(n)){let e=n.length-$;!eO&&e>0&&(n=n.splice(0,$)).push((0,f.jsx)("span",{className:eH.tag,children:E(e)},n.length))}let eJ=el||(e=>(0,f.jsxs)("li",{children:[(0,f.jsx)(g0,{className:eH.groupLabel,ownerState:eV,component:"div",children:e.group}),(0,f.jsx)(g1,{className:eH.groupUl,ownerState:eV,children:e.children})]},e.key)),eQ=ec||((e,t)=>{let{key:n,...r}=e;return(0,f.jsx)("li",{...r,children:e$(t)},n)}),e0=(e,t)=>{let n=eM({option:e,index:t});return eQ({...n,className:eH.option},e,{selected:n["aria-selected"],index:t,inputValue:e_},eV)},e1=eW.slotProps.clearIndicator,e2=eW.slotProps.popupIndicator;return(0,f.jsxs)(g.Fragment,{children:[(0,f.jsx)(gW,{ref:t,className:(0,v.Z)(eH.root,u),ownerState:eV,...ey(ev),children:eu({id:eP,disabled:S,fullWidth:!0,size:"small"===ep?"small":void 0,InputLabelProps:ex(),InputProps:{ref:eL,className:eH.inputRoot,startAdornment:n,onMouseDown:e=>{e.target===e.currentTarget&&eB(e)},...(eZ||ej)&&{endAdornment:(0,f.jsxs)(gq,{className:eH.endAdornment,ownerState:eV,children:[eZ?(0,f.jsx)(gG,{...eS(),"aria-label":p,title:p,ownerState:eV,...e1,className:(0,v.Z)(eH.clearIndicator,e1?.className),children:c}):null,ej?(0,f.jsx)(gU,{...ew(),disabled:S,"aria-label":eR?m:en,title:eR?m:en,ownerState:eV,...e2,className:(0,v.Z)(eH.popupIndicator,e2?.className),children:ea}):null]})}},inputProps:{className:eH.input,disabled:S,readOnly:es,...eb()}})}),eD?(0,f.jsx)(gK,{as:eY,...eX,children:(0,f.jsxs)(gY,{as:eU,...eK,children:[W&&0===eN.length?(0,f.jsx)(gX,{className:eH.loading,ownerState:eV,children:q}):null,0!==eN.length||R||W?null:(0,f.jsx)(gJ,{className:eH.noOptions,ownerState:eV,role:"presentation",onMouseDown:e=>{e.preventDefault()},children:U}),eN.length>0?(0,f.jsx)(eq,{as:V,...eG,children:eN.map((e,t)=>Z?eJ({key:e.key,group:e.group,children:e.options.map((t,n)=>e0(t,e.index+n))}):e0(e,t))}):null]})}):null]})});function g5({options:e,renderInput:t=e=>(0,f.jsx)(aC,{...e}),...n}){let r=e=>e.label??e.id;return(0,f.jsx)(g2,{isOptionEqualToValue:(e,t)=>e.id===t.id,getOptionDisabled:e=>!!e.disabled,getOptionLabel:r,options:e,renderInput:t,renderOption:({key:e,...t},n)=>(0,f.jsx)("li",{...t,children:(0,f.jsxs)("div",{children:[(0,f.jsx)(c1,{variant:"body1",component:"div",children:r(n)}),n.description&&(0,f.jsx)(c1,{variant:"body2",component:"div",sx:{color:e=>e.palette.text.secondary},children:n.description})]})},e),filterOptions:gC({stringify:e=>`${r(e)} ${e.description||""}`}),...n})}let g3=[{id:"compact",label:"Compact"},{id:"standard",label:"Standard"},{id:"comfortable",label:"Comfortable"}];function g4({onChange:e,value:t="standard"}){return(0,f.jsx)(gb,{label:"Density",control:(0,f.jsx)(g5,{value:g3.find(e=>e.id===t),options:g3,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function g6(){return(0,f.jsxs)(rf,{direction:"row",alignItems:"center",children:[(0,f.jsx)(tU,{sx:{content:'""',width:8,height:8,boxSizing:"border-box",position:"absolute",backgroundColor:e=>e.palette.background.default,border:e=>`2px solid ${e.palette.info.main}`,borderRadius:"50%"}}),(0,f.jsx)(tU,{sx:{content:'""',height:2,background:e=>e.palette.info.main,width:"100%"}})]})}function g8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function g9(e,t){if(e){if("string"==typeof e)return g8(e,t);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g8(e,t):void 0}}function g7(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||g9(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var me=n(501),mt="data-pdnd-honey-pot";function mn(e){return e instanceof Element&&e.hasAttribute(mt)}function mr(e){var t=g7(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?mn(n)?null!=r?r:null:n:null}function mi(e){return(mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mo(e,t,n){var r;return(r=function(e,t){if("object"!=mi(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=mi(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==mi(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ma(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ms(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ma(Object(n),!0).forEach(function(t){mo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ma(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ml(e){var t,n,r,i,o={x:Math.min((i={x:Math.max((r={x:(n={x:Math.floor((t=e.client).x),y:Math.floor(t.y)}).x-1,y:n.y-1}).x,0),y:Math.max(r.y,0)}).x,window.innerWidth-2),y:Math.min(i.y,window.innerHeight-2)};return DOMRect.fromRect({x:o.x,y:o.y,width:2,height:2})}function mu(e){var t=e.clientRect;return{left:"".concat(t.left,"px"),top:"".concat(t.top,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}}function mc(e){return function(e){if(Array.isArray(e))return g8(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g9(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function md(e){var t=null;return function(){if(!t){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];t={result:e.apply(this,r)}}return t.result}}var mh=md(function(){return navigator.userAgent.includes("Firefox")}),mp=md(function(){var e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}),mf={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};function mg(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}!function(){if("undefined"!=typeof window){if(mp()){var e=t();(0,me.bindAll)(window,[{type:"dragstart",listener:function(){e.enterCount=0,e.isOverWindow=!0}},{type:"drop",listener:n},{type:"dragend",listener:n},{type:"dragenter",listener:function(t){e.isOverWindow||0!==e.enterCount||(t[mf.isEnteringWindow]=!0),e.isOverWindow=!0,e.enterCount++}},{type:"dragleave",listener:function(t){e.enterCount--,e.isOverWindow&&0===e.enterCount&&(t[mf.isLeavingWindow]=!0,e.isOverWindow=!1)}}],{capture:!0})}}function t(){return{enterCount:0,isOverWindow:!1}}function n(){e=t()}}();var mm=(NG=function(e){return e()},NU=[],NK=null,(NY=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];NU=t,!NK&&(NK=requestAnimationFrame(function(){NK=null,NG.apply(void 0,NU)}))}).cancel=function(){NK&&(cancelAnimationFrame(NK),NK=null)},NY),mv=(NX=null,{schedule:function(e){NX={frameId:requestAnimationFrame(function(){NX=null,e()}),fn:e}},flush:function(){NX&&(cancelAnimationFrame(NX.frameId),NX.fn(),NX=null)}}),my={isActive:!1};function mb(){return!my.isActive}function mx(e){var t,n=e.event,r=null===(t=e.current[0])||void 0===t?void 0:t.dropEffect;null!=r&&n.dataTransfer&&(n.dataTransfer.dropEffect=r)}var mw=function(e){var t,n,r=e.event,i=e.dragType,o=e.getDropTargetsOver,a=e.dispatchEvent;if(mb()){var s=function(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=mg(t);if("external"===n.startedFrom)return{input:i,dropTargets:[]};var o=r({input:i,source:n.payload,target:t.target,current:[]});return{input:i,dropTargets:o}}({event:r,dragType:i,getDropTargetsOver:o});my.isActive=!0;var l={current:s};mx({event:r,current:s.dropTargets});var u=function(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function o(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,a={current:n,previous:i,initial:n};o({eventName:"onGenerateDragPreview",payload:{source:t,location:a,nativeSetDragImage:r}}),mv.schedule(function(){o({eventName:"onDragStart",payload:{source:t,location:a}})})},dragUpdate:function(e){var r=e.current;mv.flush(),mm.cancel(),o({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;mm(function(){mv.flush(),o({eventName:"onDrag",payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,a=e.updatedSourcePayload;mv.flush(),mm.cancel(),o({eventName:"onDrop",payload:{source:null!=a?a:t,location:{current:r,previous:i,initial:n}}})}}}({source:i.payload,dispatchEvent:a,initial:s}),c=(0,me.bindAll)(window,[{type:"dragover",listener:function(e){h(e),u.drag({current:l.current})}},{type:"dragenter",listener:h},{type:"dragleave",listener:function(e){(function(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return"dragleave"===n&&(mp()?!!mp()&&t.hasOwnProperty(mf.isLeavingWindow):null==r||(mh()?"nodeName"in r&&r.ownerDocument!==document:r instanceof HTMLIFrameElement))})({dragLeave:e})&&(d({input:l.current.input,dropTargets:[]}),"external"===i.startedFrom&&p())}},{type:"drop",listener:function(e){if(l.current={dropTargets:l.current.dropTargets,input:mg(e)},!l.current.dropTargets.length){p();return}e.preventDefault(),mx({event:e,current:l.current.dropTargets}),u.drop({current:l.current,updatedSourcePayload:"external"===i.type?i.getDropPayload(e):null}),f()}},{type:"dragend",listener:function(e){l.current={dropTargets:l.current.dropTargets,input:mg(e)},p()}}].concat(mc([{type:"pointermove",listener:(n=0,function(){if(n<20){n++;return}t()})},{type:"pointerdown",listener:t=p}])),{capture:!0});u.start({nativeSetDragImage:r.dataTransfer?r.dataTransfer.setDragImage.bind(r.dataTransfer):null})}function d(e){var t=function(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}({current:l.current.dropTargets,next:e.dropTargets});l.current=e,t&&u.dragUpdate({current:l.current})}function h(e){var t=mg(e),n=o({target:mn(e.target)?mr({x:t.clientX,y:t.clientY}):e.target,input:t,source:i.payload,current:l.current.dropTargets});n.length&&(e.preventDefault(),mx({event:e,current:n})),d({dropTargets:n,input:t})}function p(){l.current.dropTargets.length&&d({dropTargets:[],input:l.current.input}),u.drop({current:l.current,updatedSourcePayload:null}),f()}function f(){my.isActive=!1,c()}},mS=new Map;function mC(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){t.forEach(function(e){return e()})}}function mk(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function mM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mM(Object(n),!0).forEach(function(t){mo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mA(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return mI(e,void 0);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mI(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function mI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function mP(e){return e.slice(0).reverse()}function mR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function mO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var mE=md(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),mD="text/plain",mL=new WeakMap,m_=(NJ=null,{bindEvents:function(){return NJ=null,(0,me.bind)(window,{type:"pointermove",listener:function(e){NJ={x:e.clientX,y:e.clientY}},options:{capture:!0}})},getOnPostDispatch:function(){var e=null;return function(t){var n=t.eventName,r=t.payload;if("onDragStart"===n){var i,o,a,s,l,u=r.location.initial.input;i=({initial:null!==(l=NJ)&&void 0!==l?l:{x:u.clientX,y:u.clientY}}).initial,(o=document.createElement("div")).setAttribute(mt,"true"),a=ml({client:i}),Object.assign(o.style,ms(ms({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},mu({clientRect:a})),{},{pointerEvents:"auto",zIndex:0x7fffffff})),document.body.appendChild(o),s=(0,me.bind)(window,{type:"pointermove",listener:function(e){a=ml({client:{x:e.clientX,y:e.clientY}}),Object.assign(o.style,mu({clientRect:a}))},options:{capture:!0}}),e=function(e){var t,n,r,i=e.current;if(s(),n=(t={client:i,clientRect:a}).client,r=t.clientRect,n.x>=r.x&&n.x<=r.x+r.width&&n.y>=r.y&&n.y<=r.y+r.height){o.remove();return}function l(){u(),o.remove()}var u=(0,me.bindAll)(window,[{type:"pointerdown",listener:l},{type:"pointermove",listener:l},{type:"focusin",listener:l},{type:"focusout",listener:l},{type:"dragstart",listener:l},{type:"dragenter",listener:l},{type:"dragover",listener:l}],{capture:!0})}}if("onDrop"===n){var c,d=r.location.current.input;null===(c=e)||void 0===c||c({current:{x:d.clientX,y:d.clientY}}),e=null,NJ=null}}}}),mN=function(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,o=e.defaultDropEffect,a=function(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}return{dispatchEvent:function(r){var i=r.eventName,o=r.payload;if("onGenerateDragPreview"===i){t={canMonitorArgs:{initial:o.location.initial,source:o.source},active:new Set};var a,s=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return mR(e,void 0);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mR(e,t):void 0}}(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{for(s.s();!(a=s.n()).done;){var l=a.value;n(l)}}catch(e){s.e(e)}finally{s.f()}}if(t){for(var u=Array.from(t.active),c=0;c<u.length;c++){var d,h=u[c];t.active.has(h)&&(null===(d=h[i])||void 0===d||d.call(h,o))}"onDrop"===i&&(t.active.clear(),t=null)}},monitorForConsumers:function(r){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mO(Object(n),!0).forEach(function(t){mo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},r);return e.add(i),n(i),function(){e.delete(i),t&&t.active.delete(i)}}}}(),s=function(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i="data-drop-target-for-".concat(t),o="[".concat(i,"]");function a(e){var t,n=e.eventName,i=e.payload,o=mA(i.location.current.dropTargets);try{for(o.s();!(t=o.n()).done;){var a,s=t.value,l=r.get(s.element),u=mT(mT({},i),{},{self:s});null==l||null===(a=l[n])||void 0===a||a.call(l,u)}}catch(e){o.e(e)}finally{o.f()}}var s={onGenerateDragPreview:a,onDrag:a,onDragStart:a,onDrop:a,onDropTargetChange:function(e){var t,n=e.payload,i=new Set(n.location.current.dropTargets.map(function(e){return e.element})),o=new Set,a=mA(n.location.previous.dropTargets);try{for(a.s();!(t=a.n()).done;){var s,l,u=t.value;o.add(u.element);var c=r.get(u.element),d=i.has(u.element),h=mT(mT({},n),{},{self:u});null==c||null===(s=c.onDropTargetChange)||void 0===s||s.call(c,h),d||null==c||null===(l=c.onDragLeave)||void 0===l||l.call(c,h)}}catch(e){a.e(e)}finally{a.f()}var p,f=mA(n.location.current.dropTargets);try{for(f.s();!(p=f.n()).done;){var g,m,v=p.value;if(!o.has(v.element)){var y=mT(mT({},n),{},{self:v}),b=r.get(v.element);null==b||null===(g=b.onDropTargetChange)||void 0===g||g.call(b,y),null==b||null===(m=b.onDragEnter)||void 0===m||m.call(b,y)}}}catch(e){f.e(e)}finally{f.f()}}};return{dropTargetForConsumers:function(e){return mC(mk(e.element,{attribute:i,value:"true"}),(r.set(e.element,e),function(){return r.delete(e.element)}))},getIsOver:function(e){var t=e.source,i=e.target,a=e.input,s=e.current,l=function e(t){var i,a,s,l,u=t.source,c=t.target,d=t.input,h=t.result,p=void 0===h?[]:h;if(null==c)return p;if(!(c instanceof Element))return c instanceof Node?e({source:u,target:c.parentElement,input:d,result:p}):p;var f=c.closest(o);if(null==f)return p;var g=r.get(f);if(null==g)return p;var m={input:d,source:u,element:g.element};if(g.canDrop&&!g.canDrop(m))return e({source:u,target:g.element.parentElement,input:d,result:p});var v=null!==(i=null===(a=g.getData)||void 0===a?void 0:a.call(g,m))&&void 0!==i?i:{},y=null!==(s=null===(l=g.getDropEffect)||void 0===l?void 0:l.call(g,m))&&void 0!==s?s:n,b={data:v,element:g.element,dropEffect:y,isActiveDueToStickiness:!1};return e({source:u,target:g.element.parentElement,input:d,result:[].concat(mc(p),[b])})}({source:t,target:i,input:a});if(l.length>=s.length)return l;for(var u=mP(s),c=mP(l),d=[],h=0;h<u.length;h++){var p,f=u[h],g=c[h];if(null!=g){d.push(g);continue}var m=d[h-1],v=u[h-1];if((null==m?void 0:m.element)!==(null==v?void 0:v.element))break;var y=r.get(f.element);if(!y)break;var b={input:a,source:t,element:y.element};if(y.canDrop&&!y.canDrop(b)||!(null!==(p=y.getIsSticky)&&void 0!==p&&p.call(y,b)))break;d.push(mT(mT({},f),{},{isActiveDueToStickiness:!0}))}return mP(d)},dispatchEvent:function(e){s[e.eventName](e)}}}({typeKey:t,defaultDropEffect:o});function l(e){null==r||r(e),s.dispatchEvent(e),a.dispatchEvent(e),null==i||i(e)}function u(e){mw({event:e.event,dragType:e.dragType,getDropTargetsOver:s.getIsOver,dispatchEvent:l})}return{registerUsage:function(){var e,r;return r=function(e){var t=e.typeKey,n=e.mount,r=mS.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return mS.set(t,i),i}(e={typeKey:t,mount:function(){return n({canStart:mb,start:u})}}),function(){r.usageCount--,!(r.usageCount>0)&&(r.unmount(),mS.delete(e.typeKey))}},dropTarget:s.dropTargetForConsumers,monitor:a.monitorForConsumers}}({typeKey:"element",defaultDropEffect:"move",mount:function(e){return mC(m_.bindEvents(),(0,me.bind)(document,{type:"dragstart",listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n,r,i,o,a,s,l=t.target;if(!(l instanceof HTMLElement))return null;var u=mL.get(l);if(!u)return null;var c=mg(t),d={element:u.element,dragHandle:null!==(n=u.dragHandle)&&void 0!==n?n:null,input:c};if(u.canDrag&&!u.canDrag(d))return t.preventDefault(),null;if(u.dragHandle){var h=mr({x:c.clientX,y:c.clientY});if(!u.dragHandle.contains(h))return t.preventDefault(),null}var p=null!==(r=null===(i=u.getInitialDataForExternal)||void 0===i?void 0:i.call(u,d))&&void 0!==r?r:null;if(p)for(var f=0,g=Object.entries(p);f<g.length;f++){var m=g7(g[f],2),v=m[0],y=m[1];t.dataTransfer.setData(v,null!=y?y:"")}!mE()||t.dataTransfer.types.includes(mD)||t.dataTransfer.types.includes("text/uri-list")||t.dataTransfer.setData(mD,"pdnd:android-fallback"),t.dataTransfer.setData("application/vnd.pdnd","");var b={element:u.element,dragHandle:null!==(o=u.dragHandle)&&void 0!==o?o:null,data:null!==(a=null===(s=u.getInitialData)||void 0===s?void 0:s.call(u,d))&&void 0!==a?a:{}};e.start({event:t,dragType:{type:"element",payload:b,startedFrom:"internal"}})}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;null===(t=mL.get(i.source.element))||void 0===t||null===(n=t[r])||void 0===n||n.call(t,i)},onPostDispatch:m_.getOnPostDispatch()}),mZ=mN.dropTarget,mj=mN.monitor;function mB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mB(Object(n),!0).forEach(function(t){mo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var mz={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}},m$=Symbol("closestEdge");function mV(e){var t;return null!==(t=e[m$])&&void 0!==t?t:null}let mH={type:"idle"};function mW({elements:e,accessKey:t,axis:n="vertical",onChange:r}){return(0,g.useEffect)(()=>mj({onDrop({location:i,source:o}){var a,s;let l=i.current.dropTargets[0];if(!l)return;let u=o.data,c=l.data,d=e.findIndex(e=>e[t]===u[t]),h=e.findIndex(e=>e[t]===c[t]);!(h<0)&&!(d<0)&&r(function(e){var t=e.list,n=e.startIndex,r=e.finishIndex;if(-1===n||-1===r)return Array.from(t);var i=Array.from(t),o=g7(i.splice(n,1),1)[0];return i.splice(r,0,o),i}({list:(a={list:e,startIndex:d,indexOfTarget:h,closestEdgeOfTarget:mV(c),axis:n}).list,startIndex:s=a.startIndex,finishIndex:function(e){var t=e.startIndex,n=e.closestEdgeOfTarget,r=e.indexOfTarget,i=e.axis;if(-1===t||-1===r||t===r)return t;if(null==n)return r;var o="vertical"===i&&"bottom"===n||"horizontal"===i&&"right"===n;return t<r?o?r:r-1:o?r+1:r}({closestEdgeOfTarget:a.closestEdgeOfTarget,startIndex:s,indexOfTarget:a.indexOfTarget,axis:a.axis})}))}}),[t,n,e,r])}function mq({children:e,data:t}){let n=(0,g.useRef)(null),[r,i]=(0,g.useState)(mH);return(0,g.useEffect)(()=>{var e;let r=n.current;if(r)return mC((e={element:r,getInitialData:()=>t,onDragStart(){i({type:"is-dragging"})},onDrop(){i(mH)}},mC(mN.registerUsage(),(mL.set(e.element,e),function(){mL.delete(e.element)}),mk(e.element,{attribute:"draggable",value:"true"}))),mZ({element:r,canDrop:({source:e})=>e.element!==r,getData:({input:e})=>{var n,i,o,a,s,l,u,c,d;return a=(n={element:r,input:e,allowedEdges:["top","bottom"]}).element,s=n.input,l=n.allowedEdges,u={x:s.clientX,y:s.clientY},c=a.getBoundingClientRect(),d=null!==(i=null===(o=l.map(function(e){return{edge:e,value:mz[e](c,u)}}).sort(function(e,t){return e.value-t.value})[0])||void 0===o?void 0:o.edge)&&void 0!==i?i:null,mF(mF({},t),{},mo({},m$,d))},getIsSticky:()=>!0,onDragEnter({self:e}){i({type:"is-dragging-over",closestEdge:mV(e.data)})},onDrag({self:e}){let t=mV(e.data);i(e=>"is-dragging-over"===e.type&&e.closestEdge===t?e:{type:"is-dragging-over",closestEdge:t})},onDragLeave(){i(mH)},onDrop(){i(mH)}}))},[t]),(0,f.jsxs)(rf,{ref:n,spacing:1,style:{opacity:"is-dragging"===r.type?.5:"unset"},children:["is-dragging-over"===r.type&&"top"===r.closestEdge?(0,f.jsx)(g6,{}):null,e,"is-dragging-over"===r.type&&"bottom"===r.closestEdge?(0,f.jsx)(g6,{}):null]})}var mG=n(1682);function mU(e,t){let n=t.indexOf(e);if(0===n)return t;let r=[...t];return r.splice(n,1),r.splice(n-1,0,e),r}function mK(e,t){let n=t.indexOf(e);if(n===t.length-1)return t;let r=[...t];return r.splice(n,1),r.splice(n+1,0,e),r}let mY=(0,g.forwardRef)(function({onMoveUp:e,onMoveDown:t,onMoveLeft:n,onMoveRight:r,menuSx:i,...o},a){let[s,l]=(0,g.useState)(null),u=!!s;function c(e){l(null),e?.()}return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(rx,{...o,ref:a,"aria-label":"move","aria-haspopup":!0,"aria-expanded":u,size:"small",onClick:function(e){l(e.currentTarget)},children:(0,f.jsx)(mG.default,{})}),(e||t||n||r)&&(0,f.jsxs)(o2,{id:"drag-button-menu",MenuListProps:{"aria-labelledby":"drag-button-menu"},anchorEl:s,open:u,onClose:()=>c(void 0),sx:i,children:[e&&(0,f.jsx)(d3,{onClick:()=>c(e),children:"Move Up"}),t&&(0,f.jsx)(d3,{onClick:()=>c(t),children:"Move Down"}),n&&(0,f.jsx)(d3,{onClick:()=>c(n),children:"Move Left"}),r&&(0,f.jsx)(d3,{onClick:()=>c(r),children:"Move Right"}),r&&(0,f.jsx)(d3,{onClick:()=>c(r),children:"Move Right"})]})]})}),mX={...g}.useSyncExternalStore;function mJ(e={}){let{themeId:t}=e;return function(e,n={}){let r=tF();r&&t&&(r=r[t]||r);let i="undefined"!=typeof window&&void 0!==window.matchMedia,{defaultMatches:o=!1,matchMedia:a=i?window.matchMedia:null,ssrMatchMedia:s=null,noSsr:l=!1}=ri({name:"MuiUseMediaQuery",props:n,theme:r}),u="function"==typeof e?e(r):e;return(void 0!==mX?function(e,t,n,r,i){let o=g.useCallback(()=>t,[t]),a=g.useMemo(()=>{if(i&&n)return()=>n(e).matches;if(null!==r){let{matches:t}=r(e);return()=>t}return o},[o,e,r,i,n]),[s,l]=g.useMemo(()=>{if(null===n)return[o,()=>()=>{}];let t=n(e);return[()=>t.matches,e=>(t.addEventListener("change",e),()=>{t.removeEventListener("change",e)})]},[o,n,e]);return mX(l,s,a)}:function(e,t,n,r,i){let[o,a]=g.useState(()=>i&&n?n(e).matches:r?r(e).matches:t);return(0,rT.Z)(()=>{if(!n)return;let t=n(e),r=()=>{a(t.matches)};return r(),t.addEventListener("change",r),()=>{t.removeEventListener("change",r)}},[e,n]),o})(u=u.replace(/^@media( ?)/m,""),o,a,s,l)}}mJ();let mQ=mJ({themeId:tW.Z});function m0(e,t,n){let r=function(e,t,n){let r;let i=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),a=(0,iG.Z)(t);if(t.fakeTransform)r=t.fakeTransform;else{let e=a.getComputedStyle(t);r=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("transform")}let s=0,l=0;if(r&&"none"!==r&&"string"==typeof r){let e=r.split("(")[1].split(")")[0].split(",");s=parseInt(e[4],10),l=parseInt(e[5],10)}return"left"===e?o?`translateX(${o.right+s-i.left}px)`:`translateX(${a.innerWidth+s-i.left}px)`:"right"===e?o?`translateX(-${i.right-o.left-s}px)`:`translateX(-${i.left+i.width-s}px)`:"up"===e?o?`translateY(${o.bottom+l-i.top}px)`:`translateY(${a.innerHeight+l-i.top}px)`:o?`translateY(-${i.top-o.top+i.height-l}px)`:`translateY(-${i.top+i.height-l}px)`}(e,t,"function"==typeof n?n():n);r&&(t.style.webkitTransform=r,t.style.transform=r)}let m1=g.forwardRef(function(e,t){let n=ot(),r={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},i={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:s,container:l,direction:u="down",easing:c=r,in:d,onEnter:h,onEntered:p,onEntering:m,onExit:v,onExited:y,onExiting:b,style:x,timeout:w=i,TransitionComponent:S=i7,...C}=e,k=g.useRef(null),M=(0,B.Z)(iO(s),k,t),T=e=>t=>{e&&(void 0===t?e(k.current):e(k.current,t))},A=T((e,t)=>{m0(u,e,l),on(e),h&&h(e,t)}),I=T((e,t)=>{let r=or({timeout:w,style:x,easing:c},{mode:"enter"});e.style.webkitTransition=n.transitions.create("-webkit-transform",{...r}),e.style.transition=n.transitions.create("transform",{...r}),e.style.webkitTransform="none",e.style.transform="none",m&&m(e,t)}),P=T(p),R=T(b),O=T(e=>{let t=or({timeout:w,style:x,easing:c},{mode:"exit"});e.style.webkitTransition=n.transitions.create("-webkit-transform",t),e.style.transition=n.transitions.create("transform",t),m0(u,e,l),v&&v(e)}),E=T(e=>{e.style.webkitTransition="",e.style.transition="",y&&y(e)}),D=g.useCallback(()=>{k.current&&m0(u,k.current,l)},[u,l]);return g.useEffect(()=>{if(d||"down"===u||"right"===u)return;let e=(0,iQ.Z)(()=>{k.current&&m0(u,k.current,l)}),t=(0,iG.Z)(k.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[u,d,l]),g.useEffect(()=>{d||D()},[d,D]),(0,f.jsx)(S,{nodeRef:k,onEnter:A,onEntered:P,onEntering:I,onExit:O,onExited:E,onExiting:R,addEndListener:e=>{o&&o(k.current,e)},appear:a,in:d,timeout:w,...C,children:(e,{ownerState:t,...n})=>g.cloneElement(s,{ref:M,style:{visibility:"exited"!==e||d?void 0:"hidden",...x,...s.props.style},...n})})});function m2(e){return(0,A.ZP)("MuiDrawer",e)}(0,T.Z)("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);let m5=(e,t)=>{let{ownerState:n}=e;return[t.root,("permanent"===n.variant||"persistent"===n.variant)&&t.docked,t.modal]},m3=e=>{let{classes:t,anchor:n,variant:r}=e,i={root:["root",`anchor${(0,w.Z)(n)}`],docked:[("permanent"===r||"persistent"===r)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${(0,w.Z)(n)}`,"temporary"!==r&&`paperAnchorDocked${(0,w.Z)(n)}`]};return(0,y.Z)(i,m2,t)},m4=(0,S.ZP)(oD,{name:"MuiDrawer",slot:"Root",overridesResolver:m5})((0,C.Z)(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),m6=(0,S.ZP)("div",{shouldForwardProp:Z.Z,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:m5})({flex:"0 0 auto"}),m8=(0,S.ZP)(oj,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`paperAnchor${(0,w.Z)(n.anchor)}`],"temporary"!==n.variant&&t[`paperAnchorDocked${(0,w.Z)(n.anchor)}`]]}})((0,C.Z)(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:e})=>"left"===e.anchor&&"temporary"!==e.variant,style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"top"===e.anchor&&"temporary"!==e.variant,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"right"===e.anchor&&"temporary"!==e.variant,style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"bottom"===e.anchor&&"temporary"!==e.variant,style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),m9={left:"right",right:"left",top:"down",bottom:"up"},m7=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiDrawer"}),r=ot(),i=iL(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:s,children:l,className:u,elevation:c=16,hideBackdrop:d=!1,ModalProps:{BackdropProps:h,...p}={},onClose:m,open:y=!1,PaperProps:b={},SlideProps:x,TransitionComponent:w,transitionDuration:S=o,variant:C="temporary",slots:k={},slotProps:T={},...A}=n,I=g.useRef(!1);g.useEffect(()=>{I.current=!0},[]);let P=function({direction:e},t){return"rtl"===e&&["left","right"].includes(t)?m9[t]:t}({direction:i?"rtl":"ltr"},a),R={...n,anchor:a,elevation:c,open:y,variant:C,...A},O=m3(R),E={slots:{transition:w,...k},slotProps:{paper:b,transition:x,...T,backdrop:(0,oF.Z)(T.backdrop||{...s,...h},{transitionDuration:S})}},[D,L]=of("root",{ref:t,elementType:m4,className:(0,v.Z)(O.root,O.modal,u),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...E,...A,...p},additionalProps:{open:y,onClose:m,hideBackdrop:d,slots:{backdrop:E.slots.backdrop},slotProps:{backdrop:E.slotProps.backdrop}}}),[_,N]=of("paper",{elementType:m8,shouldForwardComponentProp:!0,className:(0,v.Z)(O.paper,b.className),ownerState:R,externalForwardedProps:E,additionalProps:{elevation:"temporary"===C?c:0,square:!0}}),[Z,j]=of("docked",{elementType:m6,ref:t,className:(0,v.Z)(O.root,O.docked,u),ownerState:R,externalForwardedProps:E,additionalProps:A}),[B,F]=of("transition",{elementType:m1,ownerState:R,externalForwardedProps:E,additionalProps:{in:y,direction:m9[P],timeout:S,appear:I.current}}),z=(0,f.jsx)(_,{...N,children:l});if("permanent"===C)return(0,f.jsx)(Z,{...j,children:z});let $=(0,f.jsx)(B,{...F,children:z});return"persistent"===C?(0,f.jsx)(Z,{...j,children:$}):(0,f.jsx)(D,{...L,children:$})}),ve=({anchor:e="right",isOpen:t,onClose:n,PaperProps:r,children:i,...o})=>{let a=mQ("(max-width:1080px)");return(0,f.jsx)(m7,{...o,open:t,onClose:n,anchor:e,PaperProps:{...r,sx:c8({width:a?"100%":"1080px",overflow:"hidden"},r?.sx)},children:i})};function vt(e){return(0,A.ZP)("MuiAlert",e)}let vn=(0,T.Z)("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),vr=(0,ad.Z)((0,f.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),vi=(0,ad.Z)((0,f.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),vo=(0,ad.Z)((0,f.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),va=(0,ad.Z)((0,f.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),vs=e=>{let{variant:t,color:n,severity:r,classes:i}=e,o={root:["root",`color${(0,w.Z)(n||r)}`,`${t}${(0,w.Z)(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return(0,y.Z)(o,vt,i)},vl=(0,S.ZP)(oj,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${(0,w.Z)(n.color||n.severity)}`]]}})((0,C.Z)(({theme:e})=>{let t="light"===e.palette.mode?b._j:b.$n,n="light"===e.palette.mode?b.$n:b._j;return{...e.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter(k(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${r}StandardBg`]:n(e.palette[r].light,.9),[`& .${vn.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(k(["light"])).map(([n])=>({props:{colorSeverity:n,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${n}Color`]:t(e.palette[n].light,.6),border:`1px solid ${(e.vars||e).palette[n].light}`,[`& .${vn.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}}})),...Object.entries(e.palette).filter(k(["dark"])).map(([t])=>({props:{colorSeverity:t,variant:"filled"},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${t}FilledColor`],backgroundColor:e.vars.palette.Alert[`${t}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[t].dark:e.palette[t].main,color:e.palette.getContrastText(e.palette[t].main)}}}))]}})),vu=(0,S.ZP)("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),vc=(0,S.ZP)("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),vd=(0,S.ZP)("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),vh={success:(0,f.jsx)(vr,{fontSize:"inherit"}),warning:(0,f.jsx)(vi,{fontSize:"inherit"}),error:(0,f.jsx)(vo,{fontSize:"inherit"}),info:(0,f.jsx)(va,{fontSize:"inherit"})},vp=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiAlert"}),{action:r,children:i,className:o,closeText:a="Close",color:s,components:l={},componentsProps:u={},icon:c,iconMapping:d=vh,onClose:h,role:p="alert",severity:g="success",slotProps:m={},slots:y={},variant:b="standard",...x}=n,w={...n,color:s,severity:g,variant:b,colorSeverity:s||g},S=vs(w),C={slots:{closeButton:l.CloseButton,closeIcon:l.CloseIcon,...y},slotProps:{...u,...m}},[k,T]=of("root",{ref:t,shouldForwardComponentProp:!0,className:(0,v.Z)(S.root,o),elementType:vl,externalForwardedProps:{...C,...x},ownerState:w,additionalProps:{role:p,elevation:0}}),[A,I]=of("icon",{className:S.icon,elementType:vu,externalForwardedProps:C,ownerState:w}),[P,R]=of("message",{className:S.message,elementType:vc,externalForwardedProps:C,ownerState:w}),[O,E]=of("action",{className:S.action,elementType:vd,externalForwardedProps:C,ownerState:w}),[D,L]=of("closeButton",{elementType:rx,externalForwardedProps:C,ownerState:w}),[_,N]=of("closeIcon",{elementType:gz,externalForwardedProps:C,ownerState:w});return(0,f.jsxs)(k,{...T,children:[!1!==c?(0,f.jsx)(A,{...I,children:c||d[g]||vh[g]}):null,(0,f.jsx)(P,{...R,children:i}),null!=r?(0,f.jsx)(O,{...E,children:r}):null,null==r&&h?(0,f.jsx)(O,{...E,children:(0,f.jsx)(D,{size:"small","aria-label":a,title:a,color:"inherit",onClick:h,...L,children:(0,f.jsx)(_,{fontSize:"small",...N})})}):null]})});function vf(e){let{error:t}=e;return(0,f.jsx)(vp,{severity:"error",children:t.message})}var vg=n(8715);let vm=[{id:"default",label:"Default",value:void 0},{id:"12",label:"12",value:12},{id:"14",label:"14",value:14},{id:"16",label:"16",value:16},{id:"20",label:"20",value:20},{id:"24",label:"24",value:24},{id:"28",label:"28",value:28},{id:"32",label:"32",value:32},{id:"36",label:"36",value:36},{id:"40",label:"40",value:40},{id:"48",label:"48",value:48},{id:"56",label:"56",value:56},{id:"64",label:"64",value:64},{id:"72",label:"72",value:72},{id:"96",label:"96",value:96},{id:"128",label:"128",value:128},{id:"160",label:"160",value:160},{id:"192",label:"192",value:192}];function vv({value:e,onChange:t}){return(0,f.jsx)(gb,{label:"Font Size",control:(0,f.jsx)(g5,{value:vm.find(t=>t.value===e),options:vm,getOptionLabel:e=>e.label,onChange:(e,{value:n})=>{t(n)},disableClearable:!0})})}let vy=e=>{let{absolute:t,children:n,classes:r,flexItem:i,light:o,orientation:a,textAlign:s,variant:l}=e;return(0,y.Z)({root:["root",t&&"absolute",l,o&&"light","vertical"===a&&"vertical",i&&"flexItem",n&&"withChildren",n&&"vertical"===a&&"withChildrenVertical","right"===s&&"vertical"!==a&&"textAlignRight","left"===s&&"vertical"!==a&&"textAlignLeft"],wrapper:["wrapper","vertical"===a&&"wrapperVertical"]},dX,r)},vb=(0,S.ZP)("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,"vertical"===n.orientation&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&"vertical"===n.orientation&&t.withChildrenVertical,"right"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignRight,"left"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignLeft]}})((0,C.Z)(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:(0,b.Fq)(e.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:e})=>!!e.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:e})=>e.children&&"vertical"!==e.orientation,style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:e})=>"vertical"===e.orientation&&e.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:e})=>"right"===e.textAlign&&"vertical"!==e.orientation,style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:e})=>"left"===e.textAlign&&"vertical"!==e.orientation,style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),vx=(0,S.ZP)("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.wrapper,"vertical"===n.orientation&&t.wrapperVertical]}})((0,C.Z)(({theme:e})=>({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),vw=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiDivider"}),{absolute:r=!1,children:i,className:o,orientation:a="horizontal",component:s=i||"vertical"===a?"div":"hr",flexItem:l=!1,light:u=!1,role:c="hr"!==s?"separator":void 0,textAlign:d="center",variant:h="fullWidth",...p}=n,g={...n,absolute:r,component:s,flexItem:l,light:u,orientation:a,role:c,textAlign:d,variant:h},m=vy(g);return(0,f.jsx)(vb,{as:s,className:(0,v.Z)(m.root,o),role:c,ref:t,ownerState:g,"aria-orientation":"separator"===c&&("hr"!==s||"vertical"===a)?a:void 0,...p,children:i?(0,f.jsx)(vx,{className:m.wrapper,ownerState:g,children:i}):null})});function vS({action:e,submitText:t="Save",cancelText:n="Cancel",isReadonly:r,isValid:i,onActionChange:o,onSubmit:a,onDelete:s,onCancel:l,...u}){return(0,f.jsx)(rf,{direction:"row",gap:1,sx:{marginLeft:"auto"},...u,children:"read"===e?(0,f.jsxs)(f.Fragment,{children:[o&&(0,f.jsx)(e_,{disabled:r,variant:"contained",onClick:()=>o("update"),children:"Edit"}),s&&(0,f.jsx)(e_,{color:"error",disabled:r,variant:"outlined",onClick:s,children:"Delete"}),l&&(a||s)&&(0,f.jsx)(vw,{orientation:"vertical",flexItem:!0,sx:{borderColor:e=>e.palette.grey["500"],"&.MuiDivider-root":{marginLeft:2,marginRight:1}}}),l&&(0,f.jsx)(e_,{color:"secondary",variant:"outlined",onClick:l,children:n})]}):(0,f.jsxs)(f.Fragment,{children:[a&&(0,f.jsx)(e_,{variant:"contained",disabled:!i,onClick:a,children:t}),l&&(0,f.jsx)(e_,{color:"secondary",variant:"outlined",onClick:l,children:n})]})})}vw&&(vw.muiSkipListHighlight=!0);var vC=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},vk=function(e){function t(t){var n=e.call(this,t)||this;return n.type="pointer",n}return(0,eH.ZT)(t,e),t.prototype.getDefaultShape=function(){return new vC},t.prototype.buildPath=function(e,t){var n=Math.cos,r=Math.sin,i=t.r,o=t.width,a=t.angle,s=t.x-n(a)*o*(o>=i/3?1:2),l=t.y-r(a)*o*(o>=i/3?1:2);a=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+n(a)*o,t.y+r(a)*o),e.lineTo(t.x+n(t.angle)*i,t.y+r(t.angle)*i),e.lineTo(t.x-n(a)*o,t.y-r(a)*o),e.lineTo(s,l)},t}(eY.ZP),vM=n(2859),vT=n(5965),vA=n(3564);function vI(e,t){var n=null==e?"":e+"";return t&&((0,eB.HD)(t)?n=t.replace("{value}",n):(0,eB.mf)(t)&&(n=t(e))),n}var vP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var r,i,o=e.get(["axisLine","lineStyle","color"]),a=(r=e.get("center"),i=Math.min(n.getWidth(),n.getHeight()),{cx:(0,e6.GM)(r[0],n.getWidth()),cy:(0,e6.GM)(r[1],n.getHeight()),r:(0,e6.GM)(e.get("radius"),i/2)});this._renderMain(e,t,n,o,a),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,r,i){var o=this.group,a=e.get("clockwise"),s=-e.get("startAngle")/180*Math.PI,l=-e.get("endAngle")/180*Math.PI,u=e.getModel("axisLine"),c=u.get("roundCap")?tt:e1.C,d=u.get("show"),h=u.getModel("lineStyle"),p=h.get("width"),f=[s,l];(0,vA.L)(f,!a),s=f[0];for(var g=(l=f[1])-s,m=s,v=[],y=0;d&&y<r.length;y++){var b=new c({shape:{startAngle:m,endAngle:l=s+g*Math.min(Math.max(r[y][0],0),1),cx:i.cx,cy:i.cy,clockwise:a,r0:i.r-p,r:i.r},silent:!0});b.setStyle({fill:r[y][1]}),b.setStyle(h.getLineStyle(["color","width"])),v.push(b),m=l}v.reverse(),(0,eB.S6)(v,function(e){return o.add(e)});var x=function(e){var t;if(e<=0)return r[0][1];for(t=0;t<r.length;t++)if(r[t][0]>=e&&(0===t?0:r[t-1][0])<e)return r[t][1];return r[t-1][1]};this._renderTicks(e,t,n,x,i,s,l,a,p),this._renderTitleAndDetail(e,t,n,x,i),this._renderAnchor(e,i),this._renderPointer(e,t,n,x,i,s,l,a,p)},t.prototype._renderTicks=function(e,t,n,r,i,o,a,s,l){for(var u,c,d=this.group,h=i.cx,p=i.cy,f=i.r,g=+e.get("min"),m=+e.get("max"),v=e.getModel("splitLine"),y=e.getModel("axisTick"),b=e.getModel("axisLabel"),x=e.get("splitNumber"),w=y.get("splitNumber"),S=(0,e6.GM)(v.get("length"),f),C=(0,e6.GM)(y.get("length"),f),k=o,M=(a-o)/x,T=M/w,A=v.getModel("lineStyle").getLineStyle(),I=y.getModel("lineStyle").getLineStyle(),P=v.get("distance"),R=0;R<=x;R++){if(u=Math.cos(k),c=Math.sin(k),v.get("show")){var O=P?P+l:l,E=new vM.Z({shape:{x1:u*(f-O)+h,y1:c*(f-O)+p,x2:u*(f-S-O)+h,y2:c*(f-S-O)+p},style:A,silent:!0});"auto"===A.stroke&&E.setStyle({stroke:r(R/x)}),d.add(E)}if(b.get("show")){var O=b.get("distance")+P,D=vI((0,e6.NM)(R/x*(m-g)+g),b.get("formatter")),L=r(R/x),_=u*(f-S-O)+h,N=c*(f-S-O)+p,Z=b.get("rotate"),j=0;"radial"===Z?(j=-k+2*Math.PI)>Math.PI/2&&(j+=Math.PI):"tangential"===Z?j=-k-Math.PI/2:(0,eB.hj)(Z)&&(j=Z*Math.PI/180),0===j?d.add(new nt.ZP({style:(0,e3.Lr)(b,{text:D,x:_,y:N,verticalAlign:c<-.8?"top":c>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:L}),silent:!0})):d.add(new nt.ZP({style:(0,e3.Lr)(b,{text:D,x:_,y:N,verticalAlign:"middle",align:"center"},{inheritColor:L}),silent:!0,originX:_,originY:N,rotation:j}))}if(y.get("show")&&R!==x){var O=y.get("distance");O=O?O+l:l;for(var B=0;B<=w;B++){u=Math.cos(k),c=Math.sin(k);var F=new vM.Z({shape:{x1:u*(f-O)+h,y1:c*(f-O)+p,x2:u*(f-C-O)+h,y2:c*(f-C-O)+p},silent:!0,style:I});"auto"===I.stroke&&F.setStyle({stroke:r((R+B/w)/x)}),d.add(F),k+=T}k-=T}else k+=M}},t.prototype._renderPointer=function(e,t,n,r,i,o,a,s,l){var u=this.group,c=this._data,d=this._progressEls,h=[],p=e.get(["pointer","show"]),f=e.getModel("progress"),g=f.get("show"),m=e.getData(),v=m.mapDimension("value"),y=+e.get("min"),b=+e.get("max"),x=[y,b],w=[o,a];function S(t,n){var r,o=m.getItemModel(t).getModel("pointer"),a=(0,e6.GM)(o.get("width"),i.r),s=(0,e6.GM)(o.get("length"),i.r),l=e.get(["pointer","icon"]),u=o.get("offsetCenter"),c=(0,e6.GM)(u[0],i.r),d=(0,e6.GM)(u[1],i.r),h=o.get("keepAspect");return(r=l?(0,vT.th)(l,c-a/2,d-s,a,s,null,h):new vk({shape:{angle:-Math.PI/2,width:a,r:s,x:c,y:d}})).rotation=-(n+Math.PI/2),r.x=i.cx,r.y=i.cy,r}function C(e,t){var n=f.get("roundCap")?tt:e1.C,r=f.get("overlap"),a=r?f.get("width"):l/m.count(),u=r?i.r-a:i.r-(e+1)*a,c=r?i.r:i.r-e*a,d=new n({shape:{startAngle:o,endAngle:t,cx:i.cx,cy:i.cy,clockwise:s,r0:u,r:c}});return r&&(d.z2=b-m.get(v,e)%b),d}(g||p)&&(m.diff(c).add(function(t){var n=m.get(v,t);if(p){var r=S(t,o);eQ.KZ(r,{rotation:-((isNaN(+n)?w[0]:(0,e6.NU)(n,x,w,!0))+Math.PI/2)},e),u.add(r),m.setItemGraphicEl(t,r)}if(g){var i=C(t,o),a=f.get("clip");eQ.KZ(i,{shape:{endAngle:(0,e6.NU)(n,x,w,a)}},e),u.add(i),(0,e2.Q)(e.seriesIndex,m.dataType,t,i),h[t]=i}}).update(function(t,n){var r=m.get(v,t);if(p){var i=c.getItemGraphicEl(n),a=i?i.rotation:o,s=S(t,a);s.rotation=a,eQ.D(s,{rotation:-((isNaN(+r)?w[0]:(0,e6.NU)(r,x,w,!0))+Math.PI/2)},e),u.add(s),m.setItemGraphicEl(t,s)}if(g){var l=d[n],y=C(t,l?l.shape.endAngle:o),b=f.get("clip");eQ.D(y,{shape:{endAngle:(0,e6.NU)(r,x,w,b)}},e),u.add(y),(0,e2.Q)(e.seriesIndex,m.dataType,t,y),h[t]=y}}).execute(),m.each(function(e){var t=m.getItemModel(e),n=t.getModel("emphasis"),i=n.get("focus"),o=n.get("blurScope"),a=n.get("disabled");if(p){var s=m.getItemGraphicEl(e),l=m.getItemVisual(e,"style"),u=l.fill;if(s instanceof ne.ZP){var c=s.style;s.useStyle((0,eB.l7)({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(u);s.setStyle(t.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",r((0,e6.NU)(m.get(v,e),x,[0,1],!0))),s.z2EmphasisLift=0,(0,e5.WO)(s,t),(0,e5.k5)(s,i,o,a)}if(g){var d=h[e];d.useStyle(m.getItemVisual(e,"style")),d.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),d.z2EmphasisLift=0,(0,e5.WO)(d,t),(0,e5.k5)(d,i,o,a)}}),this._progressEls=h)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var r=n.get("size"),i=n.get("icon"),o=n.get("offsetCenter"),a=n.get("keepAspect"),s=(0,vT.th)(i,t.cx-r/2+(0,e6.GM)(o[0],t.r),t.cy-r/2+(0,e6.GM)(o[1],t.r),r,r,null,a);s.z2=+!!n.get("showAbove"),s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,r,i){var o=this,a=e.getData(),s=a.mapDimension("value"),l=+e.get("min"),u=+e.get("max"),c=new eX.Z,d=[],h=[],p=e.isAnimationEnabled(),f=e.get(["pointer","showAbove"]);a.diff(this._data).add(function(e){d[e]=new nt.ZP({silent:!0}),h[e]=new nt.ZP({silent:!0})}).update(function(e,t){d[e]=o._titleEls[t],h[e]=o._detailEls[t]}).execute(),a.each(function(t){var n=a.getItemModel(t),o=a.get(s,t),g=new eX.Z,m=r((0,e6.NU)(o,[l,u],[0,1],!0)),v=n.getModel("title");if(v.get("show")){var y=v.get("offsetCenter"),b=i.cx+(0,e6.GM)(y[0],i.r),x=i.cy+(0,e6.GM)(y[1],i.r),w=d[t];w.attr({z2:2*!f,style:(0,e3.Lr)(v,{x:b,y:x,text:a.getName(t),align:"center",verticalAlign:"middle"},{inheritColor:m})}),g.add(w)}var S=n.getModel("detail");if(S.get("show")){var C=S.get("offsetCenter"),k=i.cx+(0,e6.GM)(C[0],i.r),M=i.cy+(0,e6.GM)(C[1],i.r),T=(0,e6.GM)(S.get("width"),i.r),A=(0,e6.GM)(S.get("height"),i.r),I=e.get(["progress","show"])?a.getItemVisual(t,"style").fill:m,w=h[t],P=S.get("formatter");w.attr({z2:2*!f,style:(0,e3.Lr)(S,{x:k,y:M,text:vI(o,P),width:isNaN(T)?null:T,height:isNaN(A)?null:A,align:"center",verticalAlign:"middle"},{inheritColor:I})}),(0,e3.pe)(w,{normal:S},o,function(e){return vI(e,P)}),p&&(0,e3.tD)(w,t,a,e,{getFormattedLabel:function(e,t,n,r,i,a){return vI(a?a.interpolatedValue:o,P)}}),g.add(w)}c.add(g)}),this.group.add(c),this._titleEls=d,this._detailEls=h},t.type="gauge",t}(tn.Z),vR=n(6904),vO=n(3208);function vE(e,t,n){t=(0,eB.kJ)(t)&&{coordDimensions:t}||(0,eB.l7)({encodeDefine:e.getEncode()},t);var r=e.getSource(),i=(0,vR.Z)(r,t).dimensions,o=new vO.Z(i,e);return o.initData(r,n),o}var vD=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="itemStyle",n}return(0,eH.ZT)(t,e),t.prototype.getInitialData=function(e,t){return vE(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(eW.Z);function vL(e){let{width:t,height:n,data:r,format:i,axisLine:o,max:a}=e,s=tJ(),l=function(e,t){let n=(0,g.useRef)();return(void 0===n.current||!1===t1()(t,n.current.deps))&&(n.current={value:e(),deps:t}),n.current.value}(()=>{if(void 0===r.value)return s.noDataOption;let e=v_(r.value,i,t,n);return{title:{show:!1},tooltip:{show:!1},series:[{type:"gauge",center:["50%","65%"],radius:"86%",startAngle:200,endAngle:-20,min:0,max:a,silent:!0,progress:{show:!0,width:16,itemStyle:{color:"auto"}},pointer:{show:!1},axisLine:{lineStyle:{color:[[1,"rgba(127,127,127,0.35)"]],width:16}},axisTick:{show:!1,distance:0},splitLine:{show:!1},axisLabel:{show:!1,distance:-18,color:"#999",fontSize:12},anchor:{show:!1},title:{show:!1},detail:{show:!1},data:[{value:r.value}]},{type:"gauge",center:["50%","65%"],radius:"100%",startAngle:200,endAngle:-20,min:0,max:a,pointer:{show:!0,icon:t>170?"path://M12.8,0.7l12,40.1H0.7L12.8,0.7z":"none",length:10,width:5,offsetCenter:[0,"-49%"],itemStyle:{color:"auto"}},axisLine:o,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},detail:{show:!0,width:"60%",borderRadius:8,offsetCenter:[0,"-9%"],color:"inherit",fontSize:e,formatter:null===r.value?()=>"null":e=>(0,eZ.Bw)(e,i)},data:[{value:r.value,name:r.label,title:{show:!0,color:s.echartsTheme.textStyle?.color??"inherit",offsetCenter:[0,"55%"],overflow:"truncate",fontSize:12,width:.8*t}}]}]}},[r,t,n,s,i,o,a]);return(0,f.jsx)(n6,{sx:{width:t,height:n,padding:`${s.container.padding.default}px`},option:l,theme:s.echartsTheme})}function v_(e,t,n,r){let i=Math.min(n,r)/(("number"==typeof e?(0,eZ.Bw)(e,t):`${e}`).length??2)*.7;return`clamp(3px, ${i}px, 24px)`}(0,ej.D)([function(e){e.registerChartView(vP),e.registerSeriesModel(vD)},tI.N,tR.N,tO.N,tE.N]);let vN=[],vZ=[];function vj(e){return e>=127462&&e<=127487}function vB(e,t,n){if(t==e.length)return t;t&&vz(e.charCodeAt(t))&&v$(e.charCodeAt(t-1))&&t--;let r=vF(e,t);for(t+=vV(r);t<e.length;){let i=vF(e,t);if(8205==r||8205==i||n&&function(e){if(e<768)return!1;for(let t=0,n=vN.length;;){let r=t+n>>1;if(e<vN[r])n=r;else{if(!(e>=vZ[r]))return!0;t=r+1}if(t==n)return!1}}(i))t+=vV(i),r=i;else if(vj(i)){let n=0,r=t-2;for(;r>=0&&vj(vF(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function vF(e,t){let n=e.charCodeAt(t);if(!v$(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return vz(r)?(n-55296<<10)+(r-56320)+65536:n}function vz(e){return e>=56320&&e<57344}function v$(e){return e>=55296&&e<56320}function vV(e){return e<65536?1:2}(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?vZ:vN).push(n+=e[t])})();class vH{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=vJ(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),vq.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=vJ(this,e,t);let n=[];return this.decompose(e,t,n,0),vq.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new vU(this),i=new vU(e);for(let e=t,o=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(o+=r.value.length,r.done||o>=n)return!0}}iter(e=1){return new vU(this,e)}iterRange(e,t=this.length){return new vK(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new vY(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new vW(e):vq.from(vW.split(e,[])):vH.empty}}class vW extends vH{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let o=this.text[i],a=r+o.length;if((t?n:a)>=e)return new vX(r,a,n,o);r=a+1,n++}}decompose(e,t,n,r){var i;let o=e<=0&&t>=this.length?this:new vW((i=this.text,vG(i,[""],e,t)),Math.min(t,this.length)-Math.max(0,e));if(1&r){let e=n.pop(),t=vG(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new vW(t,e.length+o.length));else{let e=t.length>>1;n.push(new vW(t.slice(0,e)),new vW(t.slice(e)))}}else n.push(o)}replace(e,t,n){var r,i;if(!(n instanceof vW))return super.replace(e,t,n);[e,t]=vJ(this,e,t);let o=vG(this.text,vG(n.text,(r=this.text,i=0,vG(r,[""],0,e))),t),a=this.length+n.length-(t-e);return o.length<=32?new vW(o,a):vq.from(vW.split(o,[]),a)}sliceString(e,t=this.length,n="\n"){[e,t]=vJ(this,e,t);let r="";for(let i=0,o=0;i<=t&&o<this.text.length;o++){let a=this.text[o],s=i+a.length;i>e&&o&&(r+=n),e<s&&t>i&&(r+=a.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let i of e)n.push(i),r+=i.length+1,32==n.length&&(t.push(new vW(n,r)),n=[],r=-1);return r>-1&&t.push(new vW(n,r)),t}}class vq extends vH{constructor(e,t){for(let n of(super(),this.children=e,this.length=t,this.lines=0,e))this.lines+=n.lines}lineInner(e,t,n,r){for(let i=0;;i++){let o=this.children[i],a=r+o.length,s=n+o.lines-1;if((t?s:a)>=e)return o.lineInner(e,t,n,r);r=a+1,n=s+1}}decompose(e,t,n,r){for(let i=0,o=0;o<=t&&i<this.children.length;i++){let a=this.children[i],s=o+a.length;if(e<=s&&t>=o){let i=r&(+(o<=e)|2*(s>=t));o>=e&&s<=t&&!i?n.push(a):a.decompose(e-o,t-o,n,i)}o=s+1}}replace(e,t,n){if([e,t]=vJ(this,e,t),n.lines<this.lines)for(let r=0,i=0;r<this.children.length;r++){let o=this.children[r],a=i+o.length;if(e>=i&&t<=a){let s=o.replace(e-i,t-i,n),l=this.lines-o.lines+s.lines;if(s.lines<l>>4&&s.lines>l>>6){let i=this.children.slice();return i[r]=s,new vq(i,this.length-(t-e)+n.length)}return super.replace(i,a,s)}i=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=vJ(this,e,t);let r="";for(let i=0,o=0;i<this.children.length&&o<=t;i++){let a=this.children[i],s=o+a.length;o>e&&i&&(r+=n),e<s&&t>o&&(r+=a.sliceString(e-o,t-o,n)),o=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof vq))return 0;let n=0,[r,i,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,i+=t){if(r==o||i==a)return n;let s=this.children[r],l=e.children[i];if(s!=l)return n+s.scanIdentical(l,t);n+=s.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new vW(n,t)}let r=Math.max(32,n>>5),i=r<<1,o=r>>1,a=[],s=0,l=-1,u=[];function c(){0!=s&&(a.push(1==u.length?u[0]:vq.from(u,l)),l=-1,s=u.length=0)}for(let t of e)!function e(t){let n;if(t.lines>i&&t instanceof vq)for(let n of t.children)e(n);else t.lines>o&&(s>o||!s)?(c(),a.push(t)):t instanceof vW&&s&&(n=u[u.length-1])instanceof vW&&t.lines+n.lines<=32?(s+=t.lines,l+=t.length+1,u[u.length-1]=new vW(n.text.concat(t.text),n.length+1+t.length)):(s+t.lines>r&&c(),s+=t.lines,l+=t.length+1,u.push(t))}(t);return c(),1==a.length?a[0]:new vq(a,t)}}function vG(e,t,n=0,r=1e9){for(let i=0,o=0,a=!0;o<e.length&&i<=r;o++){let s=e[o],l=i+s.length;l>=n&&(l>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),a?(t[t.length-1]+=s,a=!1):t.push(s)),i=l+1}return t}vH.empty=new vW([""],0);class vU{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof vW?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,a=r instanceof vW?r.text.length:r.children.length;if(o==(t>0?a:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&i)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof vW){let i=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=0==e?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[o+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof vW?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class vK{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new vU(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class vY{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(vH.prototype[Symbol.iterator]=function(){return this.iter()},vU.prototype[Symbol.iterator]=vK.prototype[Symbol.iterator]=vY.prototype[Symbol.iterator]=function(){return this});class vX{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function vJ(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function vQ(e,t,n=!0,r=!0){return function(e,t,n=!0,r=!0){return(n?vB:function(e,t,n){for(;t>0;){let r=vB(e,t-2,n);if(r<t)return r;t--}return 0})(e,t,r)}(e,t,n,r)}function v0(e,t){let n=e.charCodeAt(t);if(!(n>=55296&&n<56320)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return r>=56320&&r<57344?(n-55296<<10)+(r-56320)+65536:n}function v1(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function v2(e){return e<65536?1:2}let v5=/\r\n?|\n/;var v3=((NQ=v3||(v3={}))[NQ.Simple=0]="Simple",NQ[NQ.TrackDel=1]="TrackDel",NQ[NQ.TrackBefore=2]="TrackBefore",NQ[NQ.TrackAfter=3]="TrackAfter",NQ);class v4{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,i),r+=i):r+=o,n+=i}}iterChangedRanges(e,t=!1){v7(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new v4(e)}composeDesc(e){return this.empty?e:e.empty?this:yt(this,e)}mapDesc(e,t=!1){return e.empty?this:ye(this,e,t)}mapPos(e,t=-1,n=v3.Simple){let r=0,i=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],s=this.sections[o++],l=r+a;if(s<0){if(l>e)return i+(e-r);i+=a}else{if(n!=v3.Simple&&l>=e&&(n==v3.TrackDel&&r<e&&l>e||n==v3.TrackBefore&&r<e||n==v3.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!a)return e==r||t<0?i:i+s;i+=s}r=l}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],o=this.sections[n++],a=r+i;if(o>=0&&r<=t&&a>=e)return!(r<e)||!(a>t)||"cover";r=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw RangeError("Invalid JSON representation of ChangeDesc");return new v4(e)}static create(e){return new v4(e)}}class v6 extends v4{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError("Applying change set to a document with the wrong length");return v7(this,(t,n,r,i,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return ye(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,i=0;r<t.length;r+=2){let o=t[r],a=t[r+1];if(a>=0){t[r]=a,t[r+1]=o;let s=r>>1;for(;n.length<s;)n.push(vH.empty);n.push(o?e.slice(i,i+o):vH.empty)}i+=o}return new v6(t,n)}compose(e){return this.empty?e:e.empty?this:yt(this,e,!0)}map(e,t=!1){return e.empty?this:ye(this,e,t,!0)}iterChanges(e,t=!1){v7(this,e,t)}get desc(){return v4.create(this.sections)}filter(e){let t=[],n=[],r=[],i=new yn(this);t:for(let o=0,a=0;;){let s=o==e.length?1e9:e[o++];for(;a<s||a==s&&0==i.len;){if(i.done)break t;let e=Math.min(i.len,s-a);v8(r,e,-1);let o=-1==i.ins?-1:0==i.off?i.ins:0;v8(t,e,o),o>0&&v9(n,t,i.text),i.forward(e),a+=e}let l=e[o++];for(;a<l;){if(i.done)break t;let e=Math.min(i.len,l-a);v8(t,e,-1),v8(r,e,-1==i.ins?-1:0==i.off?i.ins:0),i.forward(e),a+=e}}return{changes:new v6(t,n),filtered:v4.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):0==r?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],i=[],o=0,a=null;function s(e=!1){if(!e&&!r.length)return;o<t&&v8(r,t-o,-1);let n=new v6(r,i);a=a?a.compose(n.map(a)):n,r=[],i=[],o=0}return!function e(l){if(Array.isArray(l))for(let t of l)e(t);else if(l instanceof v6){if(l.length!=t)throw RangeError(`Mismatched change set length (got ${l.length}, expected ${t})`);s(),a=a?a.compose(l.map(a)):l}else{let{from:e,to:a=e,insert:u}=l;if(e>a||e<0||a>t)throw RangeError(`Invalid change range ${e} to ${a} (in doc of length ${t})`);let c=u?"string"==typeof u?vH.of(u.split(n||v5)):u:vH.empty,d=c.length;if(e==a&&0==d)return;e<o&&s(),e>o&&v8(r,e-o,-1),v8(r,a-e,d),v9(i,r,c),o=a}}(e),s(!a),a}static empty(e){return new v6(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if("number"==typeof i)t.push(i,-1);else if(!Array.isArray(i)||"number"!=typeof i[0]||i.some((e,t)=>t&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==i.length)t.push(i[0],0);else{for(;n.length<r;)n.push(vH.empty);n[r]=vH.of(i.slice(1)),t.push(i[0],n[r].length)}}return new v6(t,n)}static createSet(e,t){return new v6(e,t)}}function v8(e,t,n,r=!1){if(0==t&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function v9(e,t,n){if(0==n.length)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(vH.empty);e.push(n)}}function v7(e,t,n){let r=e.inserted;for(let i=0,o=0,a=0;a<e.sections.length;){let s=e.sections[a++],l=e.sections[a++];if(l<0)i+=s,o+=s;else{let u=i,c=o,d=vH.empty;for(;u+=s,c+=l,l&&r&&(d=d.append(r[a-2>>1])),!n&&a!=e.sections.length&&!(e.sections[a+1]<0);)s=e.sections[a++],l=e.sections[a++];t(i,u,o,c,d),i=u,o=c}}}function ye(e,t,n,r=!1){let i=[],o=r?[]:null,a=new yn(e),s=new yn(t);for(let e=-1;;){if(a.done&&s.len||s.done&&a.len)throw Error("Mismatched change set lengths");if(-1==a.ins&&-1==s.ins){let e=Math.min(a.len,s.len);v8(i,e,-1),a.forward(e),s.forward(e)}else if(s.ins>=0&&(a.ins<0||e==a.i||0==a.off&&(s.len<a.len||s.len==a.len&&!n))){let t=s.len;for(v8(i,s.ins,-1);t;){let n=Math.min(a.len,t);a.ins>=0&&e<a.i&&a.len<=n&&(v8(i,0,a.ins),o&&v9(o,i,a.text),e=a.i),a.forward(n),t-=n}s.next()}else if(a.ins>=0){let t=0,n=a.len;for(;n;)if(-1==s.ins){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(0==s.ins&&s.len<n)n-=s.len,s.next();else break;v8(i,t,e<a.i?a.ins:0),o&&e<a.i&&v9(o,i,a.text),e=a.i,a.forward(a.len-n)}else if(a.done&&s.done)return o?v6.createSet(i,o):v4.create(i);else throw Error("Mismatched change set lengths")}}function yt(e,t,n=!1){let r=[],i=n?[]:null,o=new yn(e),a=new yn(t);for(let e=!1;;){if(o.done&&a.done)return i?v6.createSet(r,i):v4.create(r);if(0==o.ins)v8(r,o.len,0,e),o.next();else if(0!=a.len||a.done){if(o.done||a.done)throw Error("Mismatched change set lengths");{let t=Math.min(o.len2,a.len),n=r.length;if(-1==o.ins){let n=-1==a.ins?-1:a.off?0:a.ins;v8(r,t,n,e),i&&n&&v9(i,r,a.text)}else -1==a.ins?(v8(r,o.off?0:o.len,t,e),i&&v9(i,r,o.textBit(t))):(v8(r,o.off?0:o.len,a.off?0:a.ins,e),i&&!a.off&&v9(i,r,a.text));e=(o.ins>t||a.ins>=0&&a.len>t)&&(e||r.length>n),o.forward2(t),a.forward(t)}}else v8(r,0,a.ins,e),i&&v9(i,r,a.text),a.next()}}class yn{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return -2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?vH.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?vH.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class yr{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 0xffffff==e?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new yr(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return yi.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return yi.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid JSON representation for SelectionRange");return yi.range(e.anchor,e.head)}static create(e,t,n){return new yr(e,t,n)}}class yi{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:yi.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new yi([this.main],0)}addRange(e,t=!0){return yi.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,yi.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new yi(e.ranges.map(e=>yr.fromJSON(e)),e.main)}static single(e,t=e){return new yi([yi.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let i=e[r];if(i.empty?i.from<=n:i.from<n)return yi.normalized(e.slice(),t);n=i.to}return new yi(e,t)}static cursor(e,t=0,n,r){return yr.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=r?r:0xffffff)<<6)}static range(e,t,n,r){let i=(null!=n?n:0xffffff)<<6|(null==r?7:Math.min(6,r));return t<e?yr.create(t,e,48|i):yr.create(e,t,8*(t>e)|i)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let r=e[n],i=e[n-1];if(r.empty?r.from<=i.to:r.from<i.to){let o=i.from,a=Math.max(r.to,i.to);n<=t&&t--,e.splice(--n,2,r.anchor>r.head?yi.range(a,o):yi.range(o,a))}}return new yi(e,t)}}function yo(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let ya=0;class ys{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=ya++,this.default=e([]),this.extensions="function"==typeof i?i(this):i}get reader(){return this}static define(e={}){return new ys(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:yl),!!e.static,e.enables)}of(e){return new yu([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new yu(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new yu(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function yl(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class yu{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=ya++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,i=this.id,o=e[i]>>1,a=2==this.type,s=!1,l=!1,u=[];for(let n of this.dependencies)"doc"==n?s=!0:"selection"==n?l=!0:((null!==(t=e[n.id])&&void 0!==t?t:1)&1)==0&&u.push(e[n.id]);return{create:e=>(e.values[o]=n(e),1),update(e,t){if(s&&t.docChanged||l&&(t.docChanged||t.selection)||yd(e,u)){let t=n(e);if(a?!yc(t,e.values[o],r):!r(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let s,l=t.config.address[i];if(null!=l){let i=yS(t,l);if(this.dependencies.every(n=>n instanceof ys?t.facet(n)===e.facet(n):!(n instanceof yp)||t.field(n,!1)==e.field(n,!1))||(a?yc(s=n(e),i,r):r(s=n(e),i)))return e.values[o]=i,0}else s=n(e);return e.values[o]=s,1}}}}function yc(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function yd(e,t){let n=!1;for(let r of t)1&yw(e,r)&&(n=!0);return n}let yh=ys.define({static:!0});class yp{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(e){let t=new yp(ya++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(yh).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(yh),i=n.facet(yh),o;return(o=r.find(e=>e.field==this))&&o!=i.find(e=>e.field==this)?(e.values[t]=o.create(e),1):null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,yh.of({field:this,create:e})]}get extension(){return this}}let yf={lowest:4,low:3,default:2,high:1,highest:0};function yg(e){return t=>new yv(t,e)}let ym={highest:yg(yf.highest),high:yg(yf.high),default:yg(yf.default),low:yg(yf.low),lowest:yg(yf.lowest)};class yv{constructor(e,t){this.inner=e,this.prec=t}}class yy{of(e){return new yb(this,e)}reconfigure(e){return yy.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class yb{constructor(e,t){this.compartment=e,this.inner=t}}class yx{constructor(e,t,n,r,i,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){var r,i,o;let a,s,l=[],u=Object.create(null),c=new Map;for(let n of(r=e,i=t,o=c,a=[[],[],[],[],[]],s=new Map,!function e(t,n){let r=s.get(t);if(null!=r){if(r<=n)return;let e=a[r].indexOf(t);e>-1&&a[r].splice(e,1),t instanceof yb&&o.delete(t.compartment)}if(s.set(t,n),Array.isArray(t))for(let r of t)e(r,n);else if(t instanceof yb){if(o.has(t.compartment))throw RangeError("Duplicate use of compartment in extensions");let r=i.get(t.compartment)||t.inner;o.set(t.compartment,r),e(r,n)}else if(t instanceof yv)e(t.inner,t.prec);else if(t instanceof yp)a[n].push(t),t.provides&&e(t.provides,n);else if(t instanceof yu)a[n].push(t),t.facet.extensions&&e(t.facet.extensions,yf.default);else{let r=t.extension;if(!r)throw Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(r,n)}}(r,yf.default),a.reduce((e,t)=>e.concat(t))))n instanceof yp?l.push(n):(u[n.facet.id]||(u[n.facet.id]=[])).push(n);let d=Object.create(null),h=[],p=[];for(let e of l)d[e.id]=p.length<<1,p.push(t=>e.slot(t));let f=null==n?void 0:n.config.facets;for(let e in u){let t=u[e],r=t[0].facet,i=f&&f[e]||[];if(t.every(e=>0==e.type)){if(d[r.id]=h.length<<1|1,yl(i,t))h.push(n.facet(r));else{let e=r.combine(t.map(e=>e.value));h.push(n&&r.compare(e,n.facet(r))?n.facet(r):e)}}else{for(let e of t)0==e.type?(d[e.id]=h.length<<1|1,h.push(e.value)):(d[e.id]=p.length<<1,p.push(t=>e.dynamicSlot(t)));d[r.id]=p.length<<1,p.push(e=>(function(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),o=r.filter(e=>!(1&e)),a=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let o=yS(e,r[t]);if(2==i[t])for(let e of o)n.push(e);else n.push(o)}return t.combine(n)}return{create(e){for(let t of r)yw(e,t);return e.values[a]=s(e),1},update(e,n){if(!yd(e,o))return 0;let r=s(e);return t.compare(r,e.values[a])?0:(e.values[a]=r,1)},reconfigure(e,i){let o=yd(e,r),l=i.config.facets[t.id],u=i.facet(t);if(l&&!o&&yl(n,l))return e.values[a]=u,0;let c=s(e);return t.compare(c,u)?(e.values[a]=u,0):(e.values[a]=c,1)}}})(e,r,t))}}return new yx(e,c,p.map(e=>e(d)),d,h,u)}}function yw(e,t){if(1&t)return 2;let n=t>>1,r=e.status[n];if(4==r)throw Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function yS(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let yC=ys.define(),yk=ys.define({combine:e=>e.some(e=>e),static:!0}),yM=ys.define({combine:e=>e.length?e[0]:void 0,static:!0}),yT=ys.define(),yA=ys.define(),yI=ys.define(),yP=ys.define({combine:e=>!!e.length&&e[0]});class yR{constructor(e,t){this.type=e,this.value=t}static define(){return new yO}}class yO{of(e){return new yR(this,e)}}class yE{constructor(e){this.map=e}of(e){return new yD(this,e)}}class yD{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new yD(this.type,t)}is(e){return this.type==e}static define(e={}){return new yE(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}}yD.reconfigure=yD.define(),yD.appendConfig=yD.define();class yL{constructor(e,t,n,r,i,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=i,this.scrollIntoView=o,this._doc=null,this._state=null,n&&yo(n,t.newLength),i.some(e=>e.type==yL.time)||(this.annotations=i.concat(yL.time.of(Date.now())))}static create(e,t,n,r,i,o){return new yL(e,t,n,r,i,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(yL.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function y_(e,t,n){var r;let i,o,a;return n?(i=t.changes,o=v6.empty(t.changes.length),a=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(i)),{changes:a,selection:t.selection?t.selection.map(o):null===(r=e.selection)||void 0===r?void 0:r.map(i),effects:yD.mapEffects(e.effects,i).concat(yD.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function yN(e,t,n){let r=t.selection,i=yj(t.annotations);return t.userEvent&&(i=i.concat(yL.userEvent.of(t.userEvent))),{changes:t.changes instanceof v6?t.changes:v6.of(t.changes||[],n,e.facet(yM)),selection:r&&(r instanceof yi?r:yi.single(r.anchor,r.head)),effects:yj(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}yL.time=yR.define(),yL.userEvent=yR.define(),yL.addToHistory=yR.define(),yL.remote=yR.define();let yZ=[];function yj(e){return null==e?yZ:Array.isArray(e)?e:[e]}var yB=((N0=yB||(yB={}))[N0.Word=0]="Word",N0[N0.Space=1]="Space",N0[N0.Other=2]="Other",N0);let yF=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{r=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class yz{constructor(e,t,n,r,i,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,o&&(o._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)yw(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null==n){if(t)throw RangeError("Field is not present in this state");return}return yw(this,n),yS(this,n)}update(...e){return function e(t,n,r){let i=yN(t,n.length?n[0]:{},t.doc.length);n.length&&!1===n[0].filter&&(r=!1);for(let e=1;e<n.length;e++){!1===n[e].filter&&(r=!1);let o=!!n[e].sequential;i=y_(i,yN(t,n[e],o?i.changes.newLength:t.doc.length),o)}let o=yL.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(e){let t=e.startState,n=t.facet(yI),r=e;for(let i=n.length-1;i>=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=y_(r,yN(t,o,e.changes.newLength),!0))}return r==e?e:yL.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(r?function(t){let n=t.startState,r=!0;for(let e of n.facet(yT)){let n=e(t);if(!1===n){r=!1;break}Array.isArray(n)&&(r=!0===r?n:function(e,t){let n=[];for(let r=0,i=0;;){let o,a;if(r<e.length&&(i==t.length||t[i]>=e[r]))o=e[r++],a=e[r++];else{if(!(i<t.length))return n;o=t[i++],a=t[i++]}!n.length||n[n.length-1]<o?n.push(o,a):n[n.length-1]<a&&(n[n.length-1]=a)}}(r,n))}if(!0!==r){let e,i;if(!1===r)i=t.changes.invertedDesc,e=v6.empty(n.doc.length);else{let n=t.changes.filter(r);e=n.changes,i=n.filtered.mapDesc(n.changes).invertedDesc}t=yL.create(n,e,t.selection&&t.selection.map(i),yD.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let i=n.facet(yA);for(let r=i.length-1;r>=0;r--){let o=i[r](t);t=o instanceof yL?o:Array.isArray(o)&&1==o.length&&o[0]instanceof yL?o[0]:e(n,yj(o),!1)}return t}(o):o)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:r,compartments:i}=n;for(let t of e.effects)t.is(yy.reconfigure)?(n&&(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),n=null),i.set(t.value.compartment,t.value.extension)):t.is(yD.reconfigure)?(n=null,r=t.value):t.is(yD.appendConfig)&&(n=null,r=yj(r).concat(t.value));t=n?e.startState.values.slice():new yz(n=yx.resolve(r,i,this),this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values;let o=e.startState.facet(yk)?e.newSelection:e.newSelection.asSingle();new yz(n,e.newDoc,o,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:yi.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],o=yj(n.effects);for(let n=1;n<t.ranges.length;n++){let a=e(t.ranges[n]),s=this.changes(a.changes),l=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(l);let u=r.mapDesc(s,!0);i.push(a.range.map(u)),r=r.compose(l),o=yD.mapEffects(o,l).concat(yD.mapEffects(yj(a.effects),u))}return{changes:r,selection:yi.create(i,t.mainIndex),effects:o}}changes(e=[]){return e instanceof v6?e:v6.of(e,this.doc.length,this.facet(yz.lineSeparator))}toText(e){return vH.of(e.split(this.facet(yz.lineSeparator)||v5))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(yw(this,t),yS(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof yp&&null!=this.config.address[r.id]&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw RangeError("Invalid JSON representation for EditorState");let r=[];if(n){for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let i=n[t],o=e[t];r.push(i.init(e=>i.spec.fromJSON(o,e)))}}return yz.create({doc:e.doc,selection:yi.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=yx.resolve(e.extensions||[],new Map),n=e.doc instanceof vH?e.doc:vH.of((e.doc||"").split(t.staticFacet(yz.lineSeparator)||v5)),r=e.selection?e.selection instanceof yi?e.selection:yi.single(e.selection.anchor,e.selection.head):yi.single(0);return yo(r,n.length),t.staticFacet(yk)||(r=r.asSingle()),new yz(t,n,r,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(yz.tabSize)}get lineBreak(){return this.facet(yz.lineSeparator)||"\n"}get readOnly(){return this.facet(yP)}phrase(e,...t){for(let t of this.facet(yz.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let r=+(n||1);return!r||r>t.length?e:t[r-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(yC))for(let o of i(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){var t;return t=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return yB.Space;if(function(e){if(r)return r.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||yF.test(n)))return!0}return!1}(e))return yB.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return yB.Word;return yB.Other}}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),o=e-n,a=e-n;for(;o>0;){let e=vQ(t,o,!1);if(i(t.slice(e,o))!=yB.Word)break;o=e}for(;a<r;){let e=vQ(t,a);if(i(t.slice(a,e))!=yB.Word)break;a=e}return o==a?null:yi.range(o+n,a+n)}}function y$(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],o=r[e];if(void 0===o)r[e]=i;else if(o===i||void 0===i);else if(Object.hasOwnProperty.call(n,e))r[e]=n[e](o,i);else throw Error("Config merge conflict for field "+e)}for(let e in t)void 0===r[e]&&(r[e]=t[e]);return r}yz.allowMultipleSelections=yk,yz.tabSize=ys.define({combine:e=>e.length?e[0]:4}),yz.lineSeparator=yM,yz.readOnly=yP,yz.phrases=ys.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),yz.languageData=yC,yz.changeFilter=yT,yz.transactionFilter=yA,yz.transactionExtender=yI,yy.reconfigure=yD.define();class yV{eq(e){return this==e}range(e,t=e){return yH.create(e,t,this)}}yV.prototype.startSide=yV.prototype.endSide=0,yV.prototype.point=!1,yV.prototype.mapMode=v3.TrackDel;class yH{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new yH(e,t,n)}}function yW(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class yq{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let o=r,a=i.length;;){if(o==a)return o;let r=o+a>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==o)return s>=0?o:a;s>=0?a=r:o=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,i);i<o;i++)if(!1===r(this.from[i]+e,this.to[i]+e,this.value[i]))return!1}map(e,t){let n=[],r=[],i=[],o=-1,a=-1;for(let s=0;s<this.value.length;s++){let l=this.value[s],u=this.from[s]+e,c=this.to[s]+e,d,h;if(u==c){let e=t.mapPos(u,l.startSide,l.mapMode);if(null==e||(d=h=e,l.startSide!=l.endSide&&(h=t.mapPos(u,l.endSide))<d))continue}else if((d=t.mapPos(u,l.startSide))>(h=t.mapPos(c,l.endSide))||d==h&&l.startSide>0&&l.endSide<=0)continue;0>(h-d||l.endSide-l.startSide)||(o<0&&(o=d),l.point&&(a=Math.max(a,h-d)),n.push(l),r.push(d-o),i.push(h-o))}return{mapped:n.length?new yq(r,i,n,a):null,pos:o}}}class yG{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new yG(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:i=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort(yW)),this.isEmpty)return t.length?yG.of(t):this;let a=new yY(this,null,-1).goto(0),s=0,l=[],u=new yU;for(;a.value||s<t.length;)if(s<t.length&&(a.from-t[s].from||a.startSide-t[s].value.startSide)>=0){let e=t[s++];u.addInner(e.from,e.to,e.value)||l.push(e)}else 1==a.rangeIndex&&a.chunkIndex<this.chunk.length&&(s==t.length||this.chunkEnd(a.chunkIndex)<t[s].from)&&(!o||r>this.chunkEnd(a.chunkIndex)||i<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||r>a.to||i<a.from||o(a.from,a.to,a.value))&&!u.addInner(a.from,a.to,a.value)&&l.push(yH.create(a.from,a.to,a.value)),a.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?yG.empty:this.nextLayer.update({add:l,filter:o,filterFrom:r,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],a=this.chunk[i],s=e.touchesRange(o,o+a.length);if(!1===s)r=Math.max(r,a.maxPoint),t.push(a),n.push(e.mapPos(o));else if(!0===s){let{mapped:i,pos:s}=a.map(o,e);i&&(r=Math.max(r,i.maxPoint),t.push(i),n.push(s))}}let i=this.nextLayer.map(e);return 0==t.length?i:new yG(n,t,i||yG.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],o=this.chunk[r];if(t>=i&&e<=i+o.length&&!1===o.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return yX.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return yX.from(e).goto(t)}static compare(e,t,n,r,i=-1){let o=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),a=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=yK(o,a,n),l=new yQ(o,s,i),u=new yQ(a,s,i);n.iterGaps((e,t,n)=>y0(l,e,u,t,n,r)),n.empty&&0==n.length&&y0(l,0,u,0,0,r)}static eq(e,t,n=0,r){null==r&&(r=0x3b9ac9ff);let i=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),o=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(i.length!=o.length)return!1;if(!i.length)return!0;let a=yK(i,o),s=new yQ(i,a,0).goto(n),l=new yQ(o,a,0).goto(n);for(;;){if(s.to!=l.to||!y1(s.active,l.active)||s.point&&(!l.point||!s.point.eq(l.point)))return!1;if(s.to>r)return!0;s.next(),l.next()}}static spans(e,t,n,r,i=-1){let o=new yQ(e,null,i).goto(t),a=t,s=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point){let n=o.activeForPoint(o.to),i=o.pointFrom<t?n.length+1:o.point.startSide<0?n.length:Math.min(n.length,s);r.point(a,e,o.point,n,i,o.pointRank),s=Math.min(o.openEnd(e),n.length)}else e>a&&(r.span(a,e,o.active,s),s=o.openEnd(e));if(o.to>n)return s+(o.point&&o.to>n?1:0);a=o.to,o.next()}}static of(e,t=!1){let n=new yU;for(let r of e instanceof yH?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(yW(t,r)>0)return e.slice().sort(yW);t=r}return e}(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return yG.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=yG.empty;r=r.nextLayer)t=new yG(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}yG.empty=new yG([],[],null,-1),yG.empty.nextLayer=yG.empty;class yU{finishChunk(e){this.chunks.push(new yq(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new yU)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if(0>(e-this.lastTo||t.value[0].startSide-this.last.endSide))return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(yG.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=yG.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function yK(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let o=r.get(e.chunk[t]);null==o||(n?n.mapPos(o):o)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(o,o+e.chunk[t].length))||i.add(e.chunk[t])}return i}class yY{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){0>(this.to-e||this.endSide-t)&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class yX{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let i=0;i<e.length;i++)for(let o=e[i];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&r.push(new yY(o,t,n,i));return 1==r.length?r[0]:new yX(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)yJ(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)yJ(this.heap,e);0>(this.to-e||this.value.endSide-t)&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),yJ(this.heap,0)}}}function yJ(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),0>n.compare(i))break;e[r]=n,e[t]=i,t=r}}class yQ{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=yX.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&0>(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t);)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){y2(this.active,e),y2(this.activeTo,e),y2(this.activeRank,e),this.minActive=y3(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;y5(this.active,t,n),y5(this.activeTo,t,r),y5(this.activeRank,t,i),e&&y5(e,t,this.cursor.from),this.minActive=y3(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&0>(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&y2(n,r)}else if(this.cursor.value){if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else this.addActive(n),this.cursor.next()}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function y0(e,t,n,r,i,o){e.goto(t),n.goto(r);let a=r+i,s=r,l=r-t;for(;;){let t=e.to+l-n.to,r=t||e.endSide-n.endSide,i=r<0?e.to+l:n.to,u=Math.min(i,a);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&y1(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(s,u,e.point,n.point):u>s&&!y1(e.active,n.active)&&o.compareRange(s,u,e.active,n.active),i>a)break;(t||e.openEnd!=n.openEnd)&&o.boundChange&&o.boundChange(i),s=i,r<=0&&e.next(),r>=0&&n.next()}}function y1(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].eq(t[n]))return!1;return!0}function y2(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function y5(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function y3(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)0>(t[i]-r||e[i].endSide-e[n].endSide)&&(n=i,r=t[i]);return n}function y4(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)9==e.charCodeAt(i)?(r+=t-r%t,i++):(r++,i=vQ(e,i));return r}function y6(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=vQ(e,r)}return!0===r?-1:e.length}let y8="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),y9="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),y7="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class be{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let t in e)!function e(t,i,o,a){let s=[],l=/^@(\w+)\b/.exec(t[0]),u=l&&"keyframes"==l[1];if(l&&null==i)return o.push(t[0]+";");for(let n in i){let a=i[n];if(/&/.test(n))e(n.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((e,t)=>e.concat(t)),a,o);else if(a&&"object"==typeof a){if(!l)throw RangeError("The value of a property ("+n+") should be a primitive value.");e(r(n),a,s,u)}else null!=a&&s.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+a+";")}(s.length||u)&&o.push((!n||l||a?t:t.map(n)).join(", ")+" {"+s.join(" ")+"}")}(r(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=y7[y8]||1;return y7[y8]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let r=e[y9],i=n&&n.nonce;r?i&&r.setNonce(i):r=new bn(e,i),r.mount(Array.isArray(t)?t:[t],e)}}let bt=new Map;class bn{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=bt.get(n);if(t)return e[y9]=t;this.sheet=new r.CSSStyleSheet,bt.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[y9]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let o=e[t],a=this.modules.indexOf(o);if(a<i&&a>-1&&(this.modules.splice(a,1),i--,a=-1),-1==a){if(this.modules.splice(i++,0,o),n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],r++)}else{for(;i<a;)r+=this.modules[i++].rules.length;r+=o.rules.length,i++}}if(n)0>t.adoptedStyleSheets.indexOf(this.sheet)&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var br={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},bi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},bo="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),ba="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),bs=0;bs<10;bs++)br[48+bs]=br[96+bs]=String(bs);for(var bs=1;bs<=24;bs++)br[bs+111]="F"+bs;for(var bs=65;bs<=90;bs++)br[bs]=String.fromCharCode(bs+32),bi[bs]=String.fromCharCode(bs);for(var bl in br)bi.hasOwnProperty(bl)||(bi[bl]=br[bl]);function bu(e){let t;return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function bc(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function bd(e,t){if(!t.anchorNode)return!1;try{return bc(e,t.anchorNode)}catch(e){return!1}}function bh(e){return 3==e.nodeType?bC(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function bp(e,t,n,r){return!!n&&(bm(e,t,n,r,-1)||bm(e,t,n,r,1))}function bf(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function bg(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function bm(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:bv(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=bf(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType||1==(e=e.childNodes[t+(i<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=i<0?bv(e):0}}}function bv(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function by(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function bb(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||1>Math.abs(t.width-e.offsetWidth))&&(n=1),(r>.995&&r<1.005||!isFinite(r)||1>Math.abs(t.height-e.offsetHeight))&&(r=1),{scaleX:n,scaleY:r}}class bx{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?bv(t):0),n,Math.min(e.focusOffset,n?bv(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let bw=null;function bS(e){if(e.setActive)return e.setActive();if(bw)return e.focus(bw);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==bw?{get preventScroll(){return bw={preventScroll:!0},!0}}:void 0),!bw){bw=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}function bC(e,t,n=t){let r=i||(i=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function bk(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let o=new KeyboardEvent("keydown",i);o.synthetic=!0,e.dispatchEvent(o);let a=new KeyboardEvent("keyup",i);return a.synthetic=!0,e.dispatchEvent(a),o.defaultPrevented||a.defaultPrevented}function bM(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}function bT(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function bA(e,t){for(let n=e,r=t;;){if(3==n.nodeType&&r>0)return{node:n,offset:r};if(1==n.nodeType&&r>0){if("false"==n.contentEditable)return null;r=bv(n=n.childNodes[r-1])}else{if(!n.parentNode||bg(n))return null;r=bf(n),n=n.parentNode}}}function bI(e,t){for(let n=e,r=t;;){if(3==n.nodeType&&r<n.nodeValue.length)return{node:n,offset:r};if(1==n.nodeType&&r<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[r],r=0}else{if(!n.parentNode||bg(n))return null;r=bf(n)+1,n=n.parentNode}}}class bP{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new bP(e.parentNode,bf(e),t)}static after(e,t){return new bP(e.parentNode,bf(e)+1,t)}}let bR=[];class bO{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let n=this.dom,r=null,i;for(let o of this.children){if(7&o.flags){if(!o.dom&&(i=r?r.nextSibling:n.firstChild)){let e=bO.get(i);(!e||!e.parent&&e.canReuseDOM(o))&&o.reuseDOM(i)}o.sync(e,t),o.flags&=-8}if(i=r?r.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&i!=o.dom&&(t.written=!0),o.dom.parentNode==n)for(;i&&i!=o.dom;)i=bE(i);else n.insertBefore(o.dom,i);r=o.dom}for((i=r?r.nextSibling:n.firstChild)&&t&&t.node==n&&(t.written=!0);i;)i=bE(i)}else if(1&this.flags)for(let n of this.children)7&n.flags&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let r=0==bv(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==r&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}n=r<0?e:e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!bO.get(n);)n=n.nextSibling;if(!n)return this.length;for(let e=0,t=0;;e++){let r=this.children[e];if(r.dom==n)return t;t+=r.length+r.breakAfter}}domBoundsAround(e,t,n=0){let r=-1,i=-1,o=-1,a=-1;for(let s=0,l=n,u=n;s<this.children.length;s++){let n=this.children[s],c=l+n.length;if(l<e&&c>t)return n.domBoundsAround(e,t,l);if(c>=e&&-1==r&&(r=s,i=l),l>t&&n.dom.parentNode==this.dom){o=s,a=u;break}u=c,l=c+n.breakAfter}return{from:i,to:a<0?n+this.length:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=bR){this.markDirty();for(let r=e;r<t;r++){let e=this.children[r];e.parent==this&&0>n.indexOf(e)&&e.destroy()}n.length<250?this.children.splice(e,t-e,...n):this.children=[].concat(this.children.slice(0,e),n,this.children.slice(t));for(let e=0;e<n.length;e++)n[e].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new bD(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,n,r,i,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}function bE(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}bO.prototype.breakAfter=0;class bD{constructor(e,t,n){this.children=e,this.pos=t,this.i=n,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function bL(e,t,n,r,i,o,a,s,l){let{children:u}=e,c=u.length?u[t]:null,d=o.length?o[o.length-1]:null,h=d?d.breakAfter:a;if(!(t==r&&c&&!a&&!h&&o.length<2&&c.merge(n,i,o.length?d:null,0==n,s,l))){if(r<u.length){let e=u[r];e&&(i<e.length||e.breakAfter&&(null==d?void 0:d.breakAfter))?(t==r&&(e=e.split(i),i=0),!h&&d&&e.merge(0,i,d,!0,0,l)?o[o.length-1]=e:((i||e.children.length&&!e.children[0].length)&&e.merge(0,i,null,!1,0,l),o.push(e))):(null==e?void 0:e.breakAfter)&&(d?d.breakAfter=1:a=1),r++}for(c&&(c.breakAfter=a,n>0&&(!a&&o.length&&c.merge(n,c.length,o[0],!1,s,0)?c.breakAfter=o.shift().breakAfter:(n<c.length||c.children.length&&0==c.children[c.children.length-1].length)&&c.merge(n,c.length,null,!1,s,0),t++));t<r&&o.length;)if(u[r-1].become(o[o.length-1]))r--,o.pop(),l=o.length?0:s;else if(u[t].become(o[0]))t++,o.shift(),s=o.length?0:l;else break;!o.length&&t&&r<u.length&&!u[t-1].breakAfter&&u[r].merge(0,0,u[t-1],!1,s,l)&&t--,(t<r||o.length)&&e.replaceChildren(t,r,o)}}function b_(e,t,n,r,i,o){let a=e.childCursor(),{i:s,off:l}=a.findPos(n,1),{i:u,off:c}=a.findPos(t,-1),d=t-n;for(let e of r)d+=e.length;e.length+=d,bL(e,u,c,s,l,r,0,i,o)}let bN="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},bZ="undefined"!=typeof document?document:{documentElement:{style:{}}},bj=/Edge\/(\d+)/.exec(bN.userAgent),bB=/MSIE \d/.test(bN.userAgent),bF=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(bN.userAgent),bz=!!(bB||bF||bj),b$=!bz&&/gecko\/(\d+)/i.test(bN.userAgent),bV=!bz&&/Chrome\/(\d+)/.exec(bN.userAgent),bH="webkitFontSmoothing"in bZ.documentElement.style,bW=!bz&&/Apple Computer/.test(bN.vendor),bq=bW&&(/Mobile\/\w+/.test(bN.userAgent)||bN.maxTouchPoints>2);var bG={mac:bq||/Mac/.test(bN.platform),windows:/Win/.test(bN.platform),linux:/Linux|X11/.test(bN.platform),ie:bz,ie_version:bB?bZ.documentMode||6:bF?+bF[1]:bj?+bj[1]:0,gecko:b$,gecko_version:b$?+(/Firefox\/(\d+)/.exec(bN.userAgent)||[0,0])[1]:0,chrome:!!bV,chrome_version:bV?+bV[1]:0,ios:bq,android:/Android\b/.test(bN.userAgent),webkit:bH,safari:bW,webkit_version:bH?+(/\bAppleWebKit\/(\d+)/.exec(bN.userAgent)||[0,0])[1]:0,tabSize:null!=bZ.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class bU extends bO{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return!(8&this.flags)&&(!n||n instanceof bU&&!(this.length-(t-e)+n.length>256)&&!(8&n.flags))&&(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new bU(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new bP(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,n){let r=e.nodeValue.length;t>r&&(t=r);let i=t,o=t,a=0;0==t&&n<0||t==r&&n>=0?!(bG.chrome||bG.gecko)&&(t?(i--,a=1):o<r&&(o++,a=-1)):n<0?i--:o<r&&o++;let s=bC(e,i,o).getClientRects();if(!s.length)return null;let l=s[(a?a<0:n>=0)?0:s.length-1];return bG.safari&&!a&&0==l.width&&(l=Array.prototype.find.call(s,e=>e.width)||l),a?by(l,a<0):l||null}(this.dom,e,t)}}class bK extends bO{constructor(e,t=[],n=0){for(let r of(super(),this.mark=e,this.children=t,this.length=n,t))r.setParent(this)}setAttrs(e){if(bM(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,r,i,o){return(!n||!!(n instanceof bK&&n.mark.eq(this.mark))&&(!e||!(i<=0))&&(!(t<this.length)||!(o<=0)))&&(b_(this,e,t,n?n.children.slice():[],i-1,o-1),this.markDirty(),!0)}split(e){let t=[],n=0,r=-1,i=0;for(let o of this.children){let a=n+o.length;a>e&&t.push(n<e?o.split(e-n):o),r<0&&n>=e&&(r=i),n=a,i++}let o=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new bK(this.mark,t,o)}domAtPos(e){return bJ(this,e)}coordsAt(e,t){return bQ(this,e,t)}}class bY extends bO{static create(e,t,n){return new bY(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=bY.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,r,i,o){return(!n||n instanceof bY&&!!this.widget.compare(n.widget)&&(!(e>0)||!(i<=0))&&(!(t<this.length)||!(o<=0)))&&(this.length=e+(n?n.length:0)+(this.length-t),!0)}become(e){return e instanceof bY&&e.side==this.side&&this.widget.constructor==e.widget.constructor&&(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0)}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(0==this.length)return vH.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,n=t&&t.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):vH.empty}domAtPos(e){return(this.length?0==e:this.side>0)?bP.before(this.dom):bP.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let r=this.dom.getClientRects(),i=null;if(!r.length)return null;let o=this.side?this.side<0:e>0;for(let t=o?r.length-1:0;i=r[t],e>0?0!=t:t!=r.length-1&&!(i.top<i.bottom);t+=o?-1:1);return by(i,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class bX extends bO{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof bX&&e.side==this.side}split(){return new bX(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?bP.before(this.dom):bP.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return vH.empty}get isHidden(){return!0}}function bJ(e,t){let n=e.dom,{children:r}=e,i=0;for(let e=0;i<r.length;i++){let o=r[i],a=e+o.length;if(!(a==e&&0>=o.getSide())){if(t>e&&t<a&&o.dom.parentNode==n)return o.domAtPos(t-e);if(t<=e)break;e=a}}for(let e=i;e>0;e--){let t=r[e-1];if(t.dom.parentNode==n)return t.domAtPos(t.length)}for(let e=i;e<r.length;e++){let t=r[e];if(t.dom.parentNode==n)return t.domAtPos(0)}return new bP(n,0)}function bQ(e,t,n){let r=null,i=-1,o=null,a=-1;!function e(t,s){for(let l=0,u=0;l<t.children.length&&u<=s;l++){let c=t.children[l],d=u+c.length;d>=s&&(c.children.length?e(c,s-u):(!o||o.isHidden&&n>0)&&(d>s||u==d&&c.getSide()>0)?(o=c,a=s-u):(u<s||u==d&&0>c.getSide()&&!c.isHidden)&&(r=c,i=s-u)),u=d}}(e,t);let s=(n<0?r:o)||r||o;return s?s.coordsAt(Math.max(0,s==r?i:a),n):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=bh(t);return n[n.length-1]||null}(e)}function b0(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}bU.prototype.children=bY.prototype.children=bX.prototype.children=bR;let b1=Object.create(null);function b2(e,t,n){if(e==t)return!0;e||(e=b1),t||(t=b1);let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(-1==i.indexOf(o)||e[o]!==t[o]))return!1;return!0}function b5(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,"style"==i?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,"style"==i?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}class b3{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return -1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var b4=((N1=b4||(b4={}))[N1.Text=0]="Text",N1[N1.WidgetBefore=1]="WidgetBefore",N1[N1.WidgetAfter=2]="WidgetAfter",N1[N1.WidgetRange=3]="WidgetRange",N1);class b6 extends yV{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new b8(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new b7(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:o}=xe(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new b7(e,n,r,t,e.widget||null,!0)}static line(e){return new b9(e)}static set(e,t=!1){return yG.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}b6.none=yG.empty;class b8 extends b6{constructor(e){let{start:t,end:n}=xe(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof b8&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(n=e.attrs)||void 0===n?void 0:n.class))&&b2(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw RangeError("Mark decorations may not be empty");return super.range(e,t)}}b8.prototype.point=!1;class b9 extends b6{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof b9&&this.spec.class==e.spec.class&&b2(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}b9.prototype.mapMode=v3.TrackBefore,b9.prototype.point=!0;class b7 extends b6{constructor(e,t,n,r,i,o){super(t,n,i,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?v3.TrackBefore:v3.TrackAfter:v3.TrackDel}get type(){return this.startSide!=this.endSide?b4.WidgetRange:this.startSide<=0?b4.WidgetBefore:b4.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){var t,n;return e instanceof b7&&(t=this.widget,t==(n=e.widget)||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function xe(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!=n?n:t,end:null!=r?r:t}}function xt(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}b7.prototype.point=!0;class xn extends bO{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,r,i,o){if(n){if(!(n instanceof xn))return!1;this.dom||n.transferDOM(this)}return r&&this.setDeco(n?n.attrs:null),b_(this,e,t,n?n.children.slice():[],i,o),!0}split(e){let t=new xn;if(t.breakAfter=this.breakAfter,0==this.length)return t;let{i:n,off:r}=this.childPos(e);r&&(t.append(this.children[n].split(r),0),this.children[n].merge(r,this.children[n].length,null,!1,0,0),n++);for(let e=n;e<this.children.length;e++)t.append(this.children[e],0);for(;n>0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){b2(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){!function e(t,n,r){let i,{children:o}=t;r>0&&n instanceof bK&&o.length&&(i=o[o.length-1])instanceof bK&&i.mark.eq(n.mark)?e(i,n.children[0],r-1):(o.push(n),n.setParent(t)),t.length+=n.length}(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=b0(t,this.attrs||{})),n&&(this.attrs=b0({class:n},this.attrs||{}))}domAtPos(e){return bJ(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?4&this.flags&&(bM(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(b5(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&bO.get(r)instanceof bK;)r=r.lastChild;if(!r||!this.length||"BR"!=r.nodeName&&(null===(n=bO.get(r))||void 0===n?void 0:n.isEditable)==!1&&(!bG.ios||!this.children.some(e=>e instanceof bU))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof bU)||/[^ -~]/.test(n.text))return null;let r=bh(n.dom);if(1!=r.length)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=bQ(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=n.bottom-n.top;if(2>Math.abs(t-e.lineHeight)&&e.textHeight<t){let r=(t-e.textHeight)/2;return{top:n.top+r,bottom:n.bottom-r,left:n.left,right:n.left}}}return n}become(e){return e instanceof xn&&0==this.children.length&&0==e.children.length&&b2(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let n=0,r=0;n<e.children.length;n++){let i=e.children[n],o=r+i.length;if(o>=t){if(i instanceof xn)return i;if(o>t)break}r=o+i.breakAfter}return null}}class xr extends bO{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,i,o){return(!n||n instanceof xr&&!!this.widget.compare(n.widget)&&(!(e>0)||!(i<=0))&&(!(t<this.length)||!(o<=0)))&&(this.length=e+(n?n.length:0)+(this.length-t),!0)}domAtPos(e){return 0==e?bP.before(this.dom):bP.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let n=new xr(this.widget,t,this.deco);return n.breakAfter=this.breakAfter,n}get children(){return bR}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):vH.empty}domBoundsAround(){return null}become(e){return e instanceof xr&&e.widget.constructor==this.widget.constructor&&(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0)}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);return n||(this.widget instanceof xi?null:by(this.dom.getBoundingClientRect(),this.length?0==e:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:n}=this.deco;return t!=n&&(e<0?t<0:n>0)}}class xi extends b3{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class xo{constructor(e,t,n,r){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof xr&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new xn),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(xa(new bX(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||e&&this.content.length&&this.content[this.content.length-1]instanceof xr||this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skip);if(this.skip=0,r)throw Error("Ran out of text content when drawing inline views");if(n){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}this.text=t,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(xa(new bU(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,n,r,i,o){if(this.disallowBlockEffectsFor[o]&&n instanceof b7){if(n.block)throw RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=t-e;if(n instanceof b7){if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new xr(n.widget||xs.block,a,n));else{let o=bY.create(n.widget||xs.inline,a,a?0:n.startSide),s=this.atCursorPos&&!o.isEditable&&i<=r.length&&(e<t||n.startSide>0),l=!o.isEditable&&(e<t||i>r.length||n.startSide<=0),u=this.getLine();2!=this.pendingBuffer||s||o.isEditable||(this.pendingBuffer=0),this.flushBuffer(r),s&&(u.append(xa(new bX(1),r),i),i=r.length+Math.max(0,i-r.length)),u.append(xa(o,r),i),this.atCursorPos=l,this.pendingBuffer=l?e<t||i>r.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=i)}static build(e,t,n,r,i){let o=new xo(e,t,n,i);return o.openEnd=yG.spans(r,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function xa(e,t){for(let n of t)e=new bK(n,[e],e.length);return e}class xs extends b3{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}xs.inline=new xs("span"),xs.block=new xs("div");var xl=((N2=xl||(xl={}))[N2.LTR=0]="LTR",N2[N2.RTL=1]="RTL",N2);let xu=xl.LTR,xc=xl.RTL;function xd(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}let xh=xd("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),xp=xd("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),xf=Object.create(null),xg=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);xf[t]=n,xf[n]=-t}function xm(e){return e<=247?xh[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?xp[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}let xv=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class xy{get dir(){return this.level%2?xc:xu}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=t&&a.to>=t){if(a.level==n)return o;(i<0||(0!=r?r<0?a.from<t:a.to>t:e[i].level>a.level))&&(i=o)}}if(i<0)throw RangeError("Index out of range");return i}}let xb=[];function xx(e){return[new xy(0,e,0)]}let xw="",xS=ys.define(),xC=ys.define(),xk=ys.define(),xM=ys.define(),xT=ys.define(),xA=ys.define(),xI=ys.define(),xP=ys.define(),xR=ys.define(),xO=ys.define({combine:e=>e.some(e=>e)}),xE=ys.define({combine:e=>e.some(e=>e)}),xD=ys.define();class xL{constructor(e,t="nearest",n="nearest",r=5,i=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=o}map(e){return e.empty?this:new xL(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new xL(yi.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}let x_=yD.define({map:(e,t)=>e.map(t)}),xN=yD.define();function xZ(e,t,n){let r=e.facet(xM);r.length?r[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}let xj=ys.define({combine:e=>!e.length||e[0]}),xB=0,xF=ys.define();class xz{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.extension=i(this)}static define(e,t){let{eventHandlers:n,eventObservers:r,provide:i,decorations:o}=t||{};return new xz(xB++,e,n,r,e=>{let t=[xF.of(e)];return o&&t.push(xW.of(t=>{let n=t.plugin(e);return n?o(n):b6.none})),i&&t.push(i(e)),t})}static fromClass(e,t){return xz.define(t=>new e(t),t)}}class x${constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(xZ(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){xZ(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){xZ(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}let xV=ys.define(),xH=ys.define(),xW=ys.define(),xq=ys.define(),xG=ys.define(),xU=ys.define();function xK(e,t){let n=e.state.facet(xU);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return yG.spans(r,t.from,t.to,{point(){},span(e,n,r,o){let a=e-t.from,s=n-t.from,l=i;for(let e=r.length-1;e>=0;e--,o--){let n=r[e].spec.bidiIsolate,i;if(null==n&&(n=function(e,t,n){for(let r=t;r<n;r++){let t=xm(e.charCodeAt(r));if(1==t)break;if(2==t||4==t)return xc}return xu}(t.text,a,s)),o>0&&l.length&&(i=l[l.length-1]).to==a&&i.direction==n)i.to=s,l=i.inner;else{let e={from:a,to:s,direction:n,inner:[]};l.push(e),l=e.inner}}}}),i}let xY=ys.define();function xX(e){let t=0,n=0,r=0,i=0;for(let o of e.state.facet(xY)){let a=o(e);a&&(null!=a.left&&(t=Math.max(t,a.left)),null!=a.right&&(n=Math.max(n,a.right)),null!=a.top&&(r=Math.max(r,a.top)),null!=a.bottom&&(i=Math.max(i,a.bottom)))}return{left:t,right:n,top:r,bottom:i}}let xJ=ys.define();class xQ{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new xQ(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let r=0,i=0,o=0,a=0;;r++){let s=r==e.length?null:e[r],l=o-a,u=s?s.fromB:1e9;for(;i<t.length&&t[i]<u;){let e=t[i],r=t[i+1],o=Math.max(a,e),s=Math.min(u,r);if(o<=s&&new xQ(o+l,s+l,o,s).addToSet(n),r>u)break;i+=2}if(!s)return n;new xQ(s.fromA,s.toA,s.fromB,s.toB).addToSet(n),o=s.toA,a=s.toB}}}class x0{constructor(e,t,n){for(let r of(this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=v6.empty(this.startState.doc.length),n))this.changes=this.changes.compose(r.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new xQ(e,t,n,i))),this.changedRanges=r}static create(e,t,n){return new x0(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}class x1 extends bO{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=b6.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new xn],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new xQ(0,0,0,e.state.doc.length)],0,null)}update(e){var t,n,r,i,o,a;let s,l;let u=e.changedRanges;this.minWidth>0&&u.length&&(u.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let c=-1;!(this.view.inputState.composing>=0)||this.view.observer.editContext||((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?c=this.domChanged.newSel.head:(n=e.changes,r=this.hasComposition,s=!1,r&&n.iterChangedRanges((e,t)=>{e<r.to&&t>r.from&&(s=!0)}),s||e.selectionSet||(c=e.state.selection.main.head)));let d=c>-1?function(e,t,n){let r=x2(e,n);if(!r)return null;let{node:i,from:o,to:a}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let l=t.invertedDesc,u=new xQ(l.mapPos(o),l.mapPos(a),o,a),c=[];for(let t=i.parentNode;;t=t.parentNode){let n=bO.get(t);if(n instanceof bK)c.push({node:t,deco:n.mark});else{if(n instanceof xn||"DIV"==t.nodeName&&t.parentNode==e.contentDOM)return{range:u,text:i,marks:c,line:t};if(t==e.contentDOM)return null;c.push({node:t,deco:new b8({inclusive:!0,attributes:function(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}(t),tagName:t.tagName.toLowerCase()})})}}}(this.view,e.changes,c):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:n}=this.hasComposition;u=new xQ(t,n,e.changes.mapPos(t,-1),e.changes.mapPos(n,1)).addToSet(u.slice())}this.hasComposition=d?{from:d.range.fromB,to:d.range.toB}:null,(bG.ie||bG.chrome)&&!d&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let h=(i=this.decorations,o=this.updateDeco(),a=e.changes,l=new x5,yG.compare(i,o,a,l),l.changes);return u=xQ.extendWithRanges(u,h),(!!(7&this.flags)||0!=u.length)&&(this.updateInner(u,e.startState.doc.length,d),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=bG.chrome||bG.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||r.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(e=>e.flags&=-9);let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.children)e instanceof xr&&e.widget instanceof xi&&i.push(e.dom);r.updateGaps(i)}updateChildren(e,t,n){let r=n?n.range.addToSet(e.slice()):e,i=this.childCursor(t);for(let e=r.length-1;;e--){let t=e>=0?r[e]:null;if(!t)break;let{fromA:o,toA:a,fromB:s,toB:l}=t,u,c,d,h;if(n&&n.range.fromB<l&&n.range.toB>s){let e=xo.build(this.view.state.doc,s,n.range.fromB,this.decorations,this.dynamicDecorationMap),t=xo.build(this.view.state.doc,n.range.toB,l,this.decorations,this.dynamicDecorationMap);c=e.breakAtStart,d=e.openStart,h=t.openEnd;let r=this.compositionView(n);t.breakAtStart?r.breakAfter=1:t.content.length&&r.merge(r.length,r.length,t.content[0],!1,t.openStart,0)&&(r.breakAfter=t.content[0].breakAfter,t.content.shift()),e.content.length&&r.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),u=e.content.concat(r).concat(t.content)}else({content:u,breakAtStart:c,openStart:d,openEnd:h}=xo.build(this.view.state.doc,s,l,this.decorations,this.dynamicDecorationMap));let{i:p,off:f}=i.findPos(a,1),{i:g,off:m}=i.findPos(o,-1);bL(this,g,m,p,f,u,c,d,h)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){for(let t of(this.editContextFormatting=this.editContextFormatting.map(e.changes),e.transactions))for(let e of t.effects)e.is(xN)&&(this.editContextFormatting=e.value)}compositionView(e){let t=new bU(e.text.nodeValue);for(let{deco:n}of(t.flags|=8,e.marks))t=new bK(n,[t],t.length);let n=new xn;return n.append(t,0),n}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|+!!t.children.some(e=>7&e.flags),this.markedForComposition.add(t);let n=bO.get(e);n&&n!=t&&(n.dom=null),t.setDOM(e)},n=this.childPos(e.range.fromB,1),r=this.children[n.i];t(e.line,r);for(let i=e.marks.length-1;i>=-1;i--)n=r.childPos(n.off,1),r=r.children[n.i],t(i>=0?e.marks[i].node:e.text,r)}updateSelection(e=!1,t=!1){var n;(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&!(this.view.state.facet(xj)||this.dom.tabIndex>-1)&&bd(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||t||o))return;let a=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(s.anchor)),u=s.empty?l:this.moveToLine(this.domAtPos(s.head));if(bG.gecko&&s.empty&&!this.hasComposition&&1==(n=l).node.nodeType&&n.node.firstChild&&(0==n.offset||"false"==n.node.childNodes[n.offset-1].contentEditable)&&(n.offset==n.node.childNodes.length||"false"==n.node.childNodes[n.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(e,l.node.childNodes[l.offset]||null)),l=u=new bP(e,0),a=!0}let c=this.view.observer.selectionRange;!a&&c.focusNode&&(bp(l.node,l.offset,c.anchorNode,c.anchorOffset)&&bp(u.node,u.offset,c.focusNode,c.focusOffset)||this.suppressWidgetCursorChange(c,s))||(this.view.observer.ignore(()=>{bG.android&&bG.chrome&&this.dom.contains(c.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=bu(this.view.root);if(e){if(s.empty){if(bG.gecko){var t,n;let e=(t=l.node,n=l.offset,1!=t.nodeType?0:(n&&"false"==t.childNodes[n-1].contentEditable?1:0)|2*(n<t.childNodes.length&&"false"==t.childNodes[n].contentEditable));if(e&&3!=e){let t=(1==e?bA:bI)(l.node,l.offset);t&&(l=new bP(t.node,t.offset))}}e.collapse(l.node,l.offset),null!=s.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(l.node,l.offset);try{e.extend(u.node,u.offset)}catch(e){}}else{let t=document.createRange();s.anchor>s.head&&([l,u]=[u,l]),t.setEnd(u.node,u.offset),t.setStart(l.node,l.offset),e.removeAllRanges(),e.addRange(t)}}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,u)),this.impreciseAnchor=l.precise?null:new bP(c.anchorNode,c.anchorOffset),this.impreciseHead=u.precise?null:new bP(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&bp(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=bu(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=xn.find(this,t.head);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let s=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!s||!l||s.bottom>l.top)return;let u=this.domAtPos(t.head+t.assoc);n.collapse(u.node,u.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(r,i)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let r=e.offset;!n&&r<t.childNodes.length;r++){let e=bO.get(t.childNodes[r]);e instanceof xn&&(n=e.domAtPos(0))}for(let r=e.offset-1;!n&&r>=0;r--){let e=bO.get(t.childNodes[r]);e instanceof xn&&(n=e.domAtPos(e.length))}return n?new bP(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let e=bO.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let e=this.children[t];if(n<e.length||e instanceof xn)break;t++,n=0}return this.children[t].domAtPos(n)}coordsAt(e,t){let n=null,r=0;for(let i=this.length,o=this.children.length-1;o>=0;o--){let a=this.children[o],s=i-a.breakAfter,l=s-a.length;if(s<e)break;if(l<=e&&(l<e||a.covers(-1))&&(s>e||a.covers(1))&&(!n||a instanceof xn&&!(n instanceof xn&&t>=0)))n=a,r=l;else if(n&&l==e&&s==e&&a instanceof xr&&2>Math.abs(t)){if(a.deco.startSide<0)break;o&&(n=null)}i=l}return n?n.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),r=this.children[t];if(!(r instanceof xn))return null;for(;r.children.length;){let{i:e,off:t}=r.childPos(n,1);for(;;e++){if(e==r.children.length)return null;if((r=r.children[e]).length)break}n=t}if(!(r instanceof bU))return null;let i=vQ(r.text,n);if(i==n)return null;let o=bC(r.dom,n,i).getClientRects();for(let e=0;e<o.length;e++){let t=o[e];if(e==o.length-1||t.top<t.bottom&&t.left<t.right)return t}return null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,o=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,s=this.view.textDirection==xl.LTR;for(let e=0,l=0;l<this.children.length;l++){let u=this.children[l],c=e+u.length;if(c>r)break;if(e>=n){let n=u.dom.getBoundingClientRect();if(t.push(n.height),o){let t=u.dom.lastChild,r=t?bh(t):[];if(r.length){let t=r[r.length-1],o=s?t.right-n.left:n.right-t.left;o>a&&(a=o,this.minWidth=i,this.minWidthFrom=e,this.minWidthTo=c)}}}e=c+u.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?xl.RTL:xl.LTR}measureTextSize(){for(let e of this.children)if(e instanceof xn){let t=e.measureTextSize();if(t)return t}let e=document.createElement("div"),t,n,r;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let i=bh(e.firstChild)[0];t=e.getBoundingClientRect().height,n=i?i.width/27:7,r=i?i.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new bD(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],o=i?i.from-1:this.length;if(o>n){let r=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(b6.replace({widget:new xi(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!i)break;n=i.to+1}return b6.set(e)}updateDeco(){let e=1,t=this.view.state.facet(xW).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,r=this.view.state.facet(xq).map((e,t)=>{let r="function"==typeof e;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(yG.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(xD))try{if(t(this.view,e.range,e))return!0}catch(e){xZ(this.view.state,e,"scroll handler")}let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=xX(this.view),o={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:a,offsetHeight:s}=this.view.scrollDOM;!function(e,t,n,r,i,o,a,s){let l=e.ownerDocument,u=l.defaultView||window;for(let c=e,d=!1;c&&!d;)if(1==c.nodeType){let e,h=c==l.body,p=1,f=1;if(h)e=function(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(d=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let t=c.getBoundingClientRect();({scaleX:p,scaleY:f}=bb(c,t)),e={left:t.left,right:t.left+c.clientWidth*p,top:t.top,bottom:t.top+c.clientHeight*f}}let g=0,m=0;if("nearest"==i)t.top<e.top?(m=t.top-(e.top+a),n>0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+a)):t.bottom>e.bottom&&(m=t.bottom-e.bottom+a,n<0&&t.top-m<e.top&&(m=t.top-(e.top+a)));else{let r=t.bottom-t.top,o=e.bottom-e.top;m=("center"==i&&r<=o?t.top+r/2-o/2:"start"==i||"center"==i&&n<0?t.top-a:t.bottom-o+a)-e.top}if("nearest"==r?t.left<e.left?(g=t.left-(e.left+o),n>0&&t.right>e.right+g&&(g=t.right-e.right+o)):t.right>e.right&&(g=t.right-e.right+o,n<0&&t.left<e.left+g&&(g=t.left-(e.left+o))):g=("center"==r?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==r==s?t.left-o:t.right-(e.right-e.left)+o)-e.left,g||m){if(h)u.scrollBy(g,m);else{let e=0,n=0;if(m){let e=c.scrollTop;c.scrollTop+=m/f,n=(c.scrollTop-e)*f}if(g){let t=c.scrollLeft;c.scrollLeft+=g/p,e=(c.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&1>Math.abs(e-g)&&(r="nearest"),n&&1>Math.abs(n-m)&&(i="nearest")}}if(h)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),c=c.assignedSlot||c.parentNode}else if(11==c.nodeType)c=c.host;else break}(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==xl.LTR)}}function x2(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=bA(n.focusNode,n.focusOffset),i=bI(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let t=bO.get(i.node);if(!t||t instanceof bU&&t.text!=i.node.nodeValue)o=i;else if(e.docView.lastCompositionAfterCursor){let e=bO.get(r.node);!e||e instanceof bU&&e.text!=r.node.nodeValue||(o=i)}}if(e.docView.lastCompositionAfterCursor=o!=r,!o)return null;let a=t-o.offset;return{from:a,to:a+o.node.nodeValue.length,node:o.node}}let x5=class{constructor(){this.changes=[]}compareRange(e,t){xt(e,t,this.changes)}comparePoint(e,t){xt(e,t,this.changes)}boundChange(e){xt(e,e,this.changes)}};function x3(e,t){return e.top<t.bottom-1&&e.bottom>t.top+1}function x4(e,t){return t<e.top?{top:t,left:e.left,right:e.right,bottom:e.bottom}:e}function x6(e,t){return t>e.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function x8(e,t,n){let r=e.nodeValue.length,i=-1,o=1e9,a=0;for(let s=0;s<r;s++){let r=bC(e,s,s+1).getClientRects();for(let l=0;l<r.length;l++){let u=r[l];if(u.top==u.bottom)continue;a||(a=t-u.left);let c=(u.top>n?u.top-n:n-u.bottom)-1;if(u.left-1<=t&&u.right+1>=t&&c<o){let n=t>=(u.left+u.right)/2,r=n;if((bG.chrome||bG.gecko)&&bC(e,s).getBoundingClientRect().left==u.right&&(r=!n),c<=0)return{node:e,offset:s+ +!!r};i=s+ +!!r,o=c}}}return{node:e,offset:i>-1?i:a>0?e.nodeValue.length:0}}function x9(e,t,n,r=-1){var i,o;let a=e.contentDOM.getBoundingClientRect(),s=a.top+e.viewState.paddingTop,l,{docHeight:u}=e.viewState,{x:c,y:d}=t,h=d-s;if(h<0)return 0;if(h>u)return e.state.doc.length;for(let t=e.viewState.heightOracle.textHeight/2,i=!1;(l=e.elementAtHeight(h)).type!=b4.Text;)for(;!((h=r>0?l.bottom+t:l.top-t)>=0)||!(h<=u);){if(i)return n?null:0;i=!0,r=-r}d=s+h;let p=l.from;if(p<e.viewport.from)return 0==e.viewport.from?0:n?null:x7(e,a,l,c,d);if(p>e.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:x7(e,a,l,c,d);let f=e.dom.ownerDocument,g=e.root.elementFromPoint?e.root:f,m=g.elementFromPoint(c,d);m&&!e.contentDOM.contains(m)&&(m=null),!m&&(c=Math.max(a.left+1,Math.min(a.right-1,c)),(m=g.elementFromPoint(c,d))&&!e.contentDOM.contains(m)&&(m=null));let v,y=-1;if(m&&(null===(i=e.docView.nearest(m))||void 0===i?void 0:i.isEditable)!=!1){if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(c,d);e&&({offsetNode:v,offset:y}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(c,d);t&&({startContainer:v,startOffset:y}=t,(!e.contentDOM.contains(v)||bG.safari&&function(e,t,n){let r;if(3!=e.nodeType||t!=(r=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=t.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return bC(e,r-1,r).getBoundingClientRect().left>n}(v,y,c)||bG.chrome&&function(e,t,n){if(0!=t)return!1;for(let t=e;;){let e=t.parentNode;if(!e||1!=e.nodeType||e.firstChild!=t)return!1;if(e.classList.contains("cm-line"))break;t=e}return n-(1==e.nodeType?e.getBoundingClientRect():bC(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect()).left>5}(v,y,c))&&(v=void 0))}v&&(y=Math.min(bv(v),y))}if(!v||!e.docView.dom.contains(v)){let t=xn.find(e.docView,p);if(!t)return h>l.top+l.height/2?l.to:l.from;({node:v,offset:y}=function e(t,n,r){let i,o,a,s,l,u,c,d,h=!1;for(let g=t.firstChild;g;g=g.nextSibling){let t=bh(g);for(let m=0;m<t.length;m++){var p,f;let v=t[m];u&&x3(u,v)&&(v=x4(x6(v,u.bottom),u.top));let y=(p=v).left>n?p.left-n:Math.max(0,n-p.right),b=(f=v).top>r?f.top-r:Math.max(0,r-f.bottom);if(0==y&&0==b)return 3==g.nodeType?x8(g,n,r):e(g,n,r);if(!l||d>b||d==b&&c>y){l=g,u=v,c=y,d=b;let e=b?r<v.top?-1:1:y?n<v.left?-1:1:0;h=!e||(e>0?m<t.length-1:m>0)}0==y?r>v.bottom&&(!a||a.bottom<v.bottom)?(i=g,a=v):r<v.top&&(!s||s.top>v.top)&&(o=g,s=v):a&&x3(a,v)?a=x6(a,v.bottom):s&&x3(s,v)&&(s=x4(s,v.top))}}if(a&&a.bottom>=r?(l=i,u=a):s&&s.top<=r&&(l=o,u=s),!l)return{node:t,offset:0};let g=Math.max(u.left,Math.min(u.right,n));if(3==l.nodeType)return x8(l,g,r);if(h&&"false"!=l.contentEditable)return e(l,g,r);let m=Array.prototype.indexOf.call(t.childNodes,l)+ +(n>=(u.left+u.right)/2);return{node:t,offset:m}}(t.dom,c,d))}let b=e.docView.nearest(v);if(!b)return null;if(!b.isWidget||(null===(o=b.dom)||void 0===o?void 0:o.nodeType)!=1)return b.localPosFromDOM(v,y)+b.posAtStart;{let e=b.dom.getBoundingClientRect();return t.y<e.top||t.y<=e.bottom&&t.x<=(e.left+e.right)/2?b.posAtStart:b.posAtEnd}}function x7(e,t,n,r,i){let o=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t)*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(n.from,n.to);return n.from+y6(a,o,e.state.tabSize)}function we(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type)){for(let e of n.type)if(e.to>t||e.to==t&&(e.to==n.to||e.type==b4.Text))return e}return n}function wt(e,t,n,r){let i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),a=e.textDirectionAt(i.from);for(let s=t,l=null;;){let t=function(e,t,n,r,i){var o;let a=r.head-e.from,s=xy.find(t,a,null!==(o=r.bidiLevel)&&void 0!==o?o:-1,r.assoc),l=t[s],u=l.side(i,n);if(a==u){let e=s+=i?1:-1;if(e<0||e>=t.length)return null;a=(l=t[s=e]).side(!i,n),u=l.side(i,n)}let c=vQ(e.text,a,l.forward(i,n));(c<l.from||c>l.to)&&(c=u),xw=e.text.slice(Math.min(a,c),Math.max(a,c));let d=s==(i?t.length-1:0)?null:t[s+(i?1:-1)];return d&&c==u&&d.level+ +!i<l.level?yi.cursor(d.side(!i,n)+e.from,d.forward(i,n)?1:-1,d.level):yi.cursor(c+e.from,l.forward(i,n)?-1:1,l.level)}(i,o,a,s,n),u=xw;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;u="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(l){if(!l(u))return s}else{if(!r)return t;l=r(u)}s=t}}function wn(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,o)=>{if(t>e&&t<i){let o=r||n||(t-e<i-t?-1:1);t=o<0?e:i,r=o}});if(!r)return t}}function wr(e,t,n){let r=wn(e.state.facet(xG).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:yi.cursor(r,r<n.from?1:-1)}class wi{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(yz.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+="￿"}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=r.nextSibling;if(i==t)break;let o=bO.get(r),a=bO.get(i);(o&&a?o.breakAfter:(o?o.breakAfter:bg(r))||bg(i)&&("BR"!=r.nodeName||r.cmIgnore)&&this.text.length>e)&&this.lineBreak(),r=i}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,o=1,a;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(a=r.exec(t))&&(i=a.index,o=a[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),o>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=o-1);n=i+o}}readNode(e){if(e.cmIgnore)return;let t=bO.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(!function(e,t,n){for(;;){if(!t||n<bv(t))return!1;if(t==e)return!0;n=bf(t)+1,t=t.parentNode}}(e,n.node,n.offset)?0:t))}}class wo{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class wa{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let t=i||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new wo(n,r)),(i!=n||o!=r)&&t.push(new wo(i,o))),t}(e),n=new wi(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?yi.single(n+t,r+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!bc(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!bc(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),a=e.viewport;if((bG.ios||bG.chrome)&&e.state.selection.main.empty&&n!=r&&(a.from>0||a.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),o=a.from-t,s=a.to-i;(0==o||1==o||0==t)&&(0==s||-1==s||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}this.newSel=yi.single(r,n)}}}function ws(e,t){let n;let{newSel:r}=t,i=e.state.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:a}=t.bounds,s=i.from,l=null;(8===o||bG.android&&t.text.length<a-r)&&(s=i.to,l="end");let u=function(e,t,n,r){let i=Math.min(e.length,t.length),o=0;for(;o<i&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==i&&e.length==t.length)return null;let a=e.length,s=t.length;for(;a>0&&s>0&&e.charCodeAt(a-1)==t.charCodeAt(s-1);)a--,s--;if("end"==r){let e=Math.max(0,o-Math.min(a,s));n-=a+e-o}if(a<o&&e.length<t.length){let e=n<=o&&n>=a?o-n:0;o-=e,s=o+(s-a),a=o}else if(s<o){let e=n<=o&&n>=s?o-n:0;o-=e,a=o+(a-s),s=o}return{from:o,toA:a,toB:s}}(e.state.doc.sliceString(r,a,"￿"),t.text,s-r,l);u&&(bG.chrome&&13==o&&u.toB==u.from+2&&"￿￿"==t.text.slice(u.from,u.toB)&&u.toB--,n={from:r+u.from,to:r+u.toA,insert:vH.of(t.text.slice(u.from,u.toB).split("￿"))})}else r&&(!e.hasFocus&&e.state.facet(xj)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:(bG.mac||bG.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(r&&2==n.insert.length&&(r=yi.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:vH.of([n.insert.toString().replace("."," ")])}):n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:bG.chrome&&n&&n.from==n.to&&n.from==i.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(r&&(r=yi.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:vH.of([" "])}),n)return wl(e,n,r,o);if(!r||r.main.eq(i))return!1;{let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}}function wl(e,t,n,r=-1){let i;if(bG.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(bG.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&bk(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==r&&t.insert.length<t.to-t.from&&t.to>o.head)&&bk(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&bk(e.contentDOM,"Delete",46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let s=()=>i||(i=function(e,t,n){let r,i=e.state,o=i.selection.main;if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=o.from<t.from?i.sliceDoc(o.from,t.from):"",a=o.to>t.to?i.sliceDoc(t.to,o.to):"";r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+a))}else{let a=i.changes(t),s=n&&n.main.to<=a.newLength?n.main:void 0;if(i.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=o.to&&t.to>=o.to-10){let l=e.state.sliceDoc(t.from,t.to),u,c=n&&x2(e,n.main.head);if(c){let e=t.insert.length-(t.to-t.from);u={from:c.from,to:c.to-e}}else u=e.state.doc.lineAt(o.head);let d=o.to-t.to,h=o.to-o.from;r=i.changeByRange(n=>{if(n.from==o.from&&n.to==o.to)return{changes:a,range:s||n.map(a)};let r=n.to-d,c=r-l.length;if(n.to-n.from!=h||e.state.sliceDoc(c,r)!=l||n.to>=u.from&&n.from<=u.to)return{range:n};let p=i.changes({from:c,to:r,insert:t.insert}),f=n.to-o.to;return{changes:p,range:s?yi.range(Math.max(0,s.anchor+f),Math.max(0,s.head+f)):n.map(p)}})}else r={changes:a,selection:s&&i.selection.replaceRange(s)}}let a="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}(e,t,n));return e.state.facet(xA).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}class wu{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){var t;this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,bG.safari&&e.contentDOM.addEventListener("input",()=>null),bG.gecko&&(t=e.contentDOM.ownerDocument,wL.has(t)||(wL.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{})))}handleEvent(e){!(!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(r=bO.get(n))&&r.ignoreEvent(t))return!1;return!0}(this.view,e)||this.ignoreDuringComposition(e))&&("keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec;if(e&&e.domEventHandlers)for(let r in e.domEventHandlers){let i=e.domEventHandlers[r];i&&n(r).handlers.push(wc(t.value,i))}if(e&&e.domEventObservers)for(let r in e.domEventObservers){let i=e.domEventObservers[r];i&&n(r).observers.push(wc(t.value,i))}}for(let e in wm)n(e).handlers.push(wm[e]);for(let e in wv)n(e).observers.push(wv[e]);return t}(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if("scroll"!=e){let i=!t[e].handlers.length,o=n[e];o&&!o.handlers.length!=i&&(r.removeEventListener(e,this.handleEvent),o=null),o||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)"scroll"==e||t[e]||r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){let t;return this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),!!(9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))||((this.tabFocusMode>0&&27!=e.keyCode&&0>wp.indexOf(e.keyCode)&&(this.tabFocusMode=-1),bG.android&&bG.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))?(this.view.observer.delayAndroidKey(e.key,e.keyCode),!0):bG.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=wd.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||wh.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(229!=e.keyCode&&this.view.observer.forceFlush(),!1))}flushIOSKey(e){let t=this.pendingIOSKey;return!(!t||"Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,bk(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(bG.safari&&!bG.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function wc(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){xZ(n.state,e)}}}let wd=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],wh="dthko",wp=[16,17,18,20,91,92,224,225];function wf(e){return .7*Math.max(0,e)+8}class wg{constructor(e,t,n,r){var i,o;let a;this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=function(e){let t=e.ownerDocument,n,r;for(let i=e.parentNode;i&&i!=t.body&&(!n||!r);)if(1==i.nodeType)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(11==i.nodeType)i=i.host;else break;return{x:n,y:r}}(e.contentDOM),this.atoms=e.state.facet(xG).map(t=>t(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(yz.allowMultipleSelections)&&(i=e,o=t,(a=i.state.facet(xS)).length?a[0](o):bG.mac?o.metaKey:o.ctrlKey),this.dragging=!!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=bu(e.root);if(!r||0==r.rangeCount)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)&&1==wI(t)&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&10>Math.max(Math.abs((t=this.startEvent).clientX-e.clientX),Math.abs(t.clientY-e.clientY)))return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,a=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:s}=this.scrollParents.y.getBoundingClientRect());let l=xX(this.view);e.clientX-l.left<=i+6?n=-wf(i-e.clientX):e.clientX+l.right>=a-6&&(n=wf(e.clientX-a)),e.clientY-l.top<=o+6?r=-wf(o-e.clientY):e.clientY+l.bottom>=s-6&&(r=wf(e.clientY-s)),this.setScrollSpeed(n,r)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],i=null;if(r.empty){let e=wn(this.atoms,r.from,0);e!=r.from&&(i=yi.cursor(e,-1))}else{let e=wn(this.atoms,r.from,-1),t=wn(this.atoms,r.to,1);(e!=r.from||t!=r.to)&&(i=yi.range(r.from==r.anchor?e:t,r.from==r.head?e:t))}i&&(t||(t=e.ranges.slice()),t[n]=i)}return t?yi.create(t,e.mainIndex):e}select(e){let{view:t}=this,n=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,!1===this.dragging))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}let wm=Object.create(null),wv=Object.create(null),wy=bG.ie&&bG.ie_version<15||bG.ios&&bG.webkit_version<604;function wb(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function wx(e,t){t=wb(e.state,xP,t);let{state:n}=e,r,i=1,o=n.toText(t),a=o.lines==n.selection.ranges.length;if(null!=wR&&n.selection.ranges.every(e=>e.empty)&&wR==o.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let l=n.toText((a?o.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:l},range:yi.cursor(r.from+l.length)}})}else r=a?n.changeByRange(e=>{let t=o.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:yi.cursor(e.from+t.length)}}):n.replaceSelection(o);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}function ww(e,t,n,r){if(1==r)return yi.cursor(t,n);if(2==r)return function(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(0==i.length)return yi.cursor(t);0==o?n=1:o==i.length&&(n=-1);let a=o,s=o;n<0?a=vQ(i.text,o,!1):s=vQ(i.text,o);let l=r(i.text.slice(a,s));for(;a>0;){let e=vQ(i.text,a,!1);if(r(i.text.slice(e,a))!=l)break;a=e}for(;s<i.length;){let e=vQ(i.text,s);if(r(i.text.slice(s,e))!=l)break;s=e}return yi.range(a+i.from,s+i.from)}(e.state,t,n);{let n=xn.find(e.docView,t),r=e.state.doc.lineAt(n?n.posAtEnd:t),i=n?n.posAtStart:r.from,o=n?n.posAtEnd:r.to;return o<e.state.doc.length&&o==r.to&&o++,yi.range(i,o)}}wv.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},wm.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),wv.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},wv.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},wm.mousedown=(e,t)=>{var n,r;let i,o,a;if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let s=null;for(let n of e.state.facet(xk))if(s=n(e,t))break;if(s||0!=t.button||(i=wC(n=e,r=t),o=wI(r),a=n.state.selection,s={update(e){e.docChanged&&(i.pos=e.changes.mapPos(i.pos),a=a.map(e.changes))},get(e,t,r){let s=wC(n,e),l,u=ww(n,s.pos,s.bias,o);if(i.pos!=s.pos&&!t){let e=ww(n,i.pos,i.bias,o),t=Math.min(e.from,u.from),r=Math.max(e.to,u.to);u=t<u.from?yi.range(t,r):yi.range(r,t)}return t?a.replaceRange(a.main.extend(u.from,u.to)):r&&1==o&&a.ranges.length>1&&(l=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return yi.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}(a,s.pos))?l:r?a.addRange(u):yi.create([u])}}),s){let n=!e.hasFocus;e.inputState.startMouseSelection(new wg(e,t,s,n)),n&&e.observer.ignore(()=>{bS(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}return!1};let wS=(e,t,n)=>t>=n.top&&t<=n.bottom&&e>=n.left&&e<=n.right;function wC(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:function(e,t,n,r){let i=xn.find(e.docView,t);if(!i)return 1;let o=t-i.posAtStart;if(0==o)return 1;if(o==i.length)return -1;let a=i.coordsAt(o,-1);if(a&&wS(n,r,a))return -1;let s=i.coordsAt(o,1);return s&&wS(n,r,s)?1:a&&a.bottom>=r?-1:1}(e,n,t.clientX,t.clientY)}}let wk=bG.ie&&bG.ie_version<=11,wM=null,wT=0,wA=0;function wI(e){if(!wk)return e.detail;let t=wM,n=wA;return wM=e,wA=Date.now(),wT=!t||n>Date.now()-400&&2>Math.abs(t.clientX-e.clientX)&&2>Math.abs(t.clientY-e.clientY)?(wT+1)%3:1}function wP(e,t,n,r){let i;if(!(n=wb(e.state,xP,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,s=r&&a&&((i=e.state.facet(xC)).length?i[0](t):bG.mac?!t.altKey:!t.ctrlKey)?{from:a.from,to:a.to}:null,l={from:o,insert:n},u=e.state.changes(s?[s,l]:l);e.focus(),e.dispatch({changes:u,selection:{anchor:u.mapPos(o,-1),head:u.mapPos(o,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}wm.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.nearest(t.target);if(r&&r.isWidget){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=yi.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",wb(e.state,xR,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},wm.dragend=e=>(e.inputState.draggedContent=null,!1),wm.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&wP(e,t,r.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=o,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),o()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return wP(e,t,n,!0),!0}return!1},wm.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=wy?null:t.clipboardData;return n?(wx(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),wx(e,n.value)},50)}(e),!1)};let wR=null;wm.copy=wm.cut=(e,t)=>{let{text:n,ranges:r,linewise:i}=function(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let o=e.doc.lineAt(r);o.number>i&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),i=o.number}r=!0}return{text:wb(e,xR,t.join(e.lineBreak)),ranges:n,linewise:r}}(e.state);if(!n&&!i)return!1;wR=i?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=wy?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(!function(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}(e,n),!1)};let wO=yR.define();function wE(e,t){let n=[];for(let r of e.facet(xI)){let i=r(e,t);i&&n.push(i)}return n?e.update({effects:n,annotations:wO.of(!0)}):null}function wD(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=wE(e.state,t);n?e.dispatch(n):e.update([])}},10)}wv.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),wD(e)},wv.blur=e=>{e.observer.clearSelectionRange(),wD(e)},wv.compositionstart=wv.compositionupdate=e=>{!e.observer.editContext&&(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},wv.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,bG.chrome&&bG.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},wv.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},wm.beforeinput=(e,t)=>{var n,r;let i;if("insertReplacementText"==t.inputType&&e.observer.editContext){let r=null===(n=t.dataTransfer)||void 0===n?void 0:n.getData("text/plain"),i=t.getTargetRanges();if(r&&i.length){let t=i[0],n=e.posAtDOM(t.startContainer,t.startOffset),o=e.posAtDOM(t.endContainer,t.endOffset);return wl(e,{from:n,to:o,insert:e.state.toText(r)},null),!0}}if(bG.chrome&&bG.android&&(i=wd.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),"Backspace"==i.key||"Delete"==i.key)){let t=(null===(r=window.visualViewport)||void 0===r?void 0:r.height)||0;setTimeout(()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return bG.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),bG.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>wv.compositionend(e,t),20),!1};let wL=new Set,w_=["pre-wrap","normal","pre-line","break-spaces"],wN=!1;class wZ{constructor(e){this.lineWrapping=e,this.doc=vH.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return w_.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(10*r)]||(t=!0,this.heightSamples[Math.floor(10*r)]=!0)}return t}refresh(e,t,n,r,i,o){let a=w_.indexOf(e)>-1,s=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<o.length;e++){let t=o[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return s}}class wj{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class wB{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return"number"==typeof this._content?b4.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof b7?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new wB(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var wF=((N5=wF||(wF={}))[N5.ByPos=0]="ByPos",N5[N5.ByHeight=1]="ByHeight",N5[N5.ByPosNoHeight=2]="ByPosNoHeight",N5);class wz{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=2*!!e|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>.001&&(wN=!0),this.height=e)}replace(e,t,n){return wz.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,o=n.doc;for(let a=r.length-1;a>=0;a--){let{fromA:s,toA:l,fromB:u,toB:c}=r[a],d=i.lineAt(s,wF.ByPosNoHeight,n.setDoc(t),0,0),h=d.to>=l?d:i.lineAt(l,wF.ByPosNoHeight,n,0,0);for(c+=h.to-l,l=h.to;a>0&&d.from<=r[a-1].toA;)s=r[a-1].fromA,u=r[a-1].fromB,a--,s<d.from&&(d=i.lineAt(s,wF.ByPosNoHeight,n,0,0));u+=d.from-s,s=d.from;let p=wU.build(n.setDoc(o),e,u,c);i=w$(i,i.replace(s,l,p))}return i.updateHeight(n,0)}static empty(){return new wH(0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,r=0,i=0;for(;;)if(t==n){if(r>2*i){let i=e[t-1];i.break?e.splice(--t,1,i.left,null,i.right):e.splice(--t,1,i.left,i.right),n+=1+i.break,r-=i.size}else if(i>2*r){let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,i-=t.size}else break}else if(r<i){let n=e[t++];n&&(r+=n.size)}else{let t=e[--n];t&&(i+=t.size)}let o=0;return null==e[t-1]?(o=1,t--):null==e[t]&&(o=1,n++),new wq(wz.of(e.slice(0,t)),o,wz.of(e.slice(n)))}}function w$(e,t){return e==t?e:(e.constructor!=t.constructor&&(wN=!0),t)}wz.prototype.size=1;class wV extends wz{constructor(e,t,n){super(e,t),this.deco=n}blockAt(e,t,n,r){return new wB(r,this.length,n,this.height,this.deco||0)}lineAt(e,t,n,r,i){return this.blockAt(0,n,r,i)}forEachLine(e,t,n,r,i,o){e<=i+this.length&&t>=i&&o(this.blockAt(0,n,r,i))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class wH extends wV{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new wB(r,this.length,n,this.height,this.breaks)}replace(e,t,n){let r=n[0];return 1==n.length&&(r instanceof wH||r instanceof wW&&4&r.flags)&&10>Math.abs(this.length-r.length)?(r instanceof wW?r=new wH(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):wz.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(r.heights[r.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class wW extends wz{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,o,a=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);o=t/i,this.length>i+1&&(a=(this.height-t)/(this.length-i-1))}else o=this.height/i;return{firstLine:n,lastLine:r,perLine:o,perChar:a}}blockAt(e,t,n,r){let{firstLine:i,lastLine:o,perLine:a,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),o=t.doc.lineAt(i),l=a+o.length*s,u=Math.max(n,e-l/2);return new wB(o.from,o.length,u,l,0)}{let r=Math.max(0,Math.min(o-i,Math.floor((e-n)/a))),{from:s,length:l}=t.doc.line(i+r);return new wB(s,l,n+a*r,a,0)}}lineAt(e,t,n,r,i){if(t==wF.ByHeight)return this.blockAt(e,n,r,i);if(t==wF.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new wB(t,r-t,0,0,0)}let{firstLine:o,perLine:a,perChar:s}=this.heightMetrics(n,i),l=n.doc.lineAt(e),u=a+l.length*s,c=l.number-o,d=r+a*c+s*(l.from-i-c);return new wB(l.from,l.length,Math.max(r,Math.min(d,r+this.height-u)),u,0)}forEachLine(e,t,n,r,i,o){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:a,perLine:s,perChar:l}=this.heightMetrics(n,i);for(let u=e,c=r;u<=t;){let t=n.doc.lineAt(u);if(u==e){let n=t.number-a;c+=s*n+l*(e-i-n)}let r=s+l*t.length;o(new wB(t.from,t.length,c,r,0)),c+=r,u=t.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let e=n[n.length-1];e instanceof wW?n[n.length-1]=new wW(e.length+r):n.push(null,new wW(r-1))}if(e>0){let t=n[0];t instanceof wW?n[0]=new wW(e+t.length):n.unshift(new wW(e-1),null)}return wz.of(n)}decomposeLeft(e,t){t.push(new wW(e-1),null)}decomposeRight(e,t){t.push(null,new wW(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let i=t+this.length;if(r&&r.from<=t+this.length&&r.more){let n=[],o=Math.max(t,r.from),a=-1;for(r.from>t&&n.push(new wW(r.from-t-1).updateHeight(e,t));o<=i&&r.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let i=r.heights[r.index++];-1==a?a=i:Math.abs(i-a)>=.001&&(a=-2);let s=new wH(t,i);s.outdated=!1,n.push(s),o+=t+1}o<=i&&n.push(null,new wW(i-o).updateHeight(e,o));let s=wz.of(n);return(a<0||Math.abs(s.height-this.height)>=.001||Math.abs(a-this.heightMetrics(e,t).perLine)>=.001)&&(wN=!0),w$(this,s)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class wq extends wz{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let o=r+this.left.height,a=i+this.left.length+this.break,s=t==wF.ByHeight?e<o:e<a,l=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,o,a);if(this.break||(s?l.to<a:l.from>a))return l;let u=t==wF.ByPosNoHeight?wF.ByPosNoHeight:wF.ByPos;return s?l.join(this.right.lineAt(a,u,n,o,a)):this.left.lineAt(a,u,n,r,i).join(l)}forEachLine(e,t,n,r,i,o){let a=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,o),t>=s&&this.right.forEachLine(e,t,n,a,s,o);else{let l=this.lineAt(s,wF.ByPos,n,r,i);e<l.from&&this.left.forEachLine(e,l.from-1,n,r,i,o),l.to>=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,a,s,o)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let o=i.length;for(let e of n)i.push(e);if(e>0&&wG(i,o-1),t<this.length){let e=i.length;this.decomposeRight(t,i),wG(i,e)}return wz.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&e>=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?wz.of(this.break?[e,null,t]:[e,t]):(this.left=w$(this.left,e),this.right=w$(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:o}=this,a=t+i.length+this.break,s=null;return(r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=a+o.length&&r.more?s=o=o.updateHeight(e,a,n,r):o.updateHeight(e,a,n),s)?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function wG(e,t){let n,r;null==e[t]&&(n=e[t-1])instanceof wW&&(r=e[t+1])instanceof wW&&e.splice(t-1,3,new wW(n.length+1+r.length))}class wU{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof wH?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new wH(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new wV(o,r,n)):(o||i||r>=5)&&this.addLineDeco(r,i,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new wH(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new wW(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof wH)return e;let t=new wH(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof wH||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new wH(0,-1));let n=e;for(let e of this.nodes)e instanceof wH&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,r){let i=new wU(n,e);return yG.spans(t,n,r,i,0),i.finish(n)}}class wK{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&xt(e,t,this.changes,5)}}class wY{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return b6.replace({widget:new wX(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class wX extends b3{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class wJ{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=w2,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=xl.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(xH).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new wZ(t),this.stateDeco=e.facet(xW).filter(e=>"function"!=typeof e),this.heightMap=wz.empty().applyChanges(this.stateDeco,vH.empty,this.heightOracle.setDoc(e.doc),[new xQ(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=b6.set(this.lineGaps.map(e=>e.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new wQ(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?w2:new w5(this.heightOracle,this.heightMap,this.viewports),2*!e.eq(this.scaler)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(w3(e,this.scaler))})}update(e,t=null){var n,r;let i;this.state=e.state;let o=this.stateDeco;this.stateDeco=this.state.facet(xW).filter(e=>"function"!=typeof e);let a=e.changedRanges,s=xQ.extendWithRanges(a,(n=this.stateDeco,r=e?e.changes:v6.empty(this.state.doc.length),i=new wK,yG.compare(o,n,r,i,0),i.changes)),l=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);wN=!1,this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=l||wN)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let c=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<c.from||t.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let d=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(d||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(xE)&&(this.mustEnforceCursorAssoc=!0)}measure(e){var t;let n,r,i=e.contentDOM,o=window.getComputedStyle(i),a=this.heightOracle,s=o.whiteSpace;this.defaultTextDirection="rtl"==o.direction?xl.RTL:xl.LTR;let l=this.heightOracle.mustRefreshForWrapping(s),u=i.getBoundingClientRect(),c=l||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let d=0,h=0;if(u.width&&u.height){let{scaleX:e,scaleY:t}=bb(i,u);(e>.005&&Math.abs(this.scaleX-e)>.005||t>.005&&Math.abs(this.scaleY-t)>.005)&&(this.scaleX=e,this.scaleY=t,d|=16,l=c=!0)}let p=(parseInt(o.paddingTop)||0)*this.scaleY,f=(parseInt(o.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=f)&&(this.paddingTop=p,this.paddingBottom=f,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(a.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=bT(e.scrollDOM);let m=(this.printing?function(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}:function(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),a=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(1==t.nodeType){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=r.overflow){let r=n.getBoundingClientRect();o=Math.max(o,r.left),a=Math.min(a,r.right),s=Math.max(s,r.top),l=Math.min(t==e.parentNode?i.innerHeight:l,r.bottom)}t="absolute"==r.position||"fixed"==r.position?n.offsetParent:n.parentNode}else if(11==t.nodeType)t=t.host;else break;return{left:o-n.left,right:Math.max(o,a)-n.left,top:s-(n.top+t),bottom:Math.max(s,l)-(n.top+t)}})(i,this.paddingTop),v=m.top-this.pixelViewport.top,y=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(c=!0)),!this.inView&&!this.scrollTarget&&(n=(t=e.dom).getBoundingClientRect(),r=t.ownerDocument.defaultView||window,!(n.left<r.innerWidth)||!(n.right>0)||!(n.top<r.innerHeight)||!(n.bottom>0)))return 0;let x=u.width;if((this.contentDOMWidth!=x||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),c){let t=e.docView.measureVisibleLineHeights(this.viewport);if(a.mustRefreshForHeights(t)&&(l=!0),l||a.lineWrapping&&Math.abs(x-this.contentDOMWidth)>a.charWidth){let{lineHeight:n,charWidth:r,textHeight:i}=e.docView.measureTextSize();(l=n>0&&a.refresh(s,n,r,i,x/r,t))&&(e.docView.minWidth=0,d|=16)}for(let n of(v>0&&y>0?h=Math.max(v,y):v<0&&y<0&&(h=Math.min(v,y)),wN=!1,this.viewports)){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(l?wz.empty().applyChanges(this.stateDeco,vH.empty,this.heightOracle,[new xQ(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(a,0,l,new wj(n.from,r))}wN&&(d|=2)}let w=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return w&&(2&d&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(2&d||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,s=new wQ(r.lineAt(o-1e3*n,wF.ByHeight,i,0,0).from,r.lineAt(a+(1-n)*1e3,wF.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=r.lineAt(e,wF.ByPos,i,0,0),a;a="center"==t.y?(o.top+o.bottom)/2-n/2:"start"==t.y||"nearest"==t.y&&e<s.from?o.top:o.bottom-n,s=new wQ(r.lineAt(a-500,wF.ByHeight,i,0,0).from,r.lineAt(a+n+500,wF.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new wQ(this.heightMap.lineAt(n,wF.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,wF.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,wF.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,wF.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(0==e||r<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=a+Math.max(10,Math.min(n,250)))&&r>o-2e3&&i<a+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new wY(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,o=r<<1;if(this.defaultTextDirection!=xl.LTR&&!n)return[];let a=[],s=(r,o,l,u)=>{if(o-r<i)return;let c=this.state.selection.main,d=[c.from];for(let e of(c.empty||d.push(c.to),d))if(e>r&&e<o){s(r,e-10,l,u),s(e+10,o,l,u);return}let h=function(e,t){for(let n of e)if(t(n))return n}(e,e=>e.from>=l.from&&e.to<=l.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-o)<i&&!d.some(t=>e.from<t&&e.to>t));if(!h){if(o<l.to&&t&&n&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(yi.cursor(o),!1,!0).head;e>r&&(o=e)}let e=this.gapSize(l,r,o,u),i=n||e<2e6?e:2e6;h=new wY(r,o,e,i)}a.push(h)},l=t=>{var i,a,l;let u,c,d,h,p;if(t.length<o||t.type!=b4.Text)return;let f=(i=t.from,a=t.to,l=this.stateDeco,d=[],h=i,p=0,yG.spans(l,i,a,{span(){},point(e,t){e>h&&(d.push({from:h,to:e}),p+=e-h),h=t}},20),h<a&&(d.push({from:h,to:a}),p+=a-h),{total:p,ranges:d});if(f.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,i=r/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=g){let r=w1(f,g),o=((this.visibleBottom-this.visibleTop)/2+i)/t.height;e=r-o,n=r+o}else e=(this.visibleTop-t.top-i)/t.height,n=(this.visibleBottom-t.top+i)/t.height;u=w0(f,e),c=w0(f,n)}else{let n,i,o=f.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(o>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let l=this.pixelViewport.left+s,d=this.pixelViewport.right+s;if(null!=g){let e=w1(f,g),t=((d-l)/2+a)/o;n=e-t,i=e+t}else n=(l-a)/o,i=(d+a)/o;u=w0(f,n),c=w0(f,i)}u>t.from&&s(t.from,u,t,f),c<t.to&&s(c,t.to,t,f)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(l):l(e);return a}gapSize(e,t,n,r){let i=w1(r,n)-w1(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){wY.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=b6.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];yG.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(8&r);t++){let i=this.visibleRanges[t],o=n[t];i.from==o.from&&i.to==o.to||(r|=4,e&&e.mapPos(i.from,-1)==o.from&&e.mapPos(i.to,1)==o.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||w3(this.heightMap.lineAt(e,wF.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||w3(this.heightMap.lineAt(this.scaler.fromDOM(e),wF.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return w3(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class wQ{constructor(e,t){this.from=e,this.to=t}}function w0({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],o=i-n;if(r<=o)return n+r;r-=o}}function w1(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}let w2={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};class w5{constructor(e,t,n){let r=0,i=0,o=0;for(let a of(this.viewports=n.map(({from:n,to:i})=>{let o=t.lineAt(n,wF.ByPos,e,0,0).top,a=t.lineAt(i,wF.ByPos,e,0,0).bottom;return r+=a-o,{from:n,to:i,top:o,bottom:a,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r),this.viewports))a.domTop=o+(a.top-i)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),i=a.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(e){return e instanceof w5&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)}}function w3(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new wB(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>w3(e,t)):e._content)}let w4=ys.define({combine:e=>e.join(" ")}),w6=ys.define({combine:e=>e.indexOf(!0)>-1}),w8=be.newName(),w9=be.newName(),w7=be.newName(),Se={"&light":"."+w9,"&dark":"."+w7};function St(e,t,n){return new be(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+" "+t})}let Sn=St("."+w8,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Se),Sr={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Si=bG.ie&&bG.ie_version<=11;class So{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new bx,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(bG.ie&&bG.ie_version<=11||bG.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&!1!==e.constructor.EDIT_CONTEXT&&!(bG.chrome&&bG.chrome_version<126)&&(this.editContext=new Sl(e),e.state.facet(xj)&&(e.contentDOM.editContext=this.editContext.editContext)),Si&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){for(let t of(this.gapIntersection.disconnect(),e))this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(xj)?n.root.activeElement!=this.dom:!bd(this.dom,r))return;let i=r.anchorNode&&n.docView.nearest(r.anchorNode);if(i&&i.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(bG.ie&&bG.ie_version<=11||bG.android&&bG.chrome)&&!n.state.selection.main.empty&&r.focusNode&&bp(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=bu(e.root);if(!t)return!1;let n=bG.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Ss(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?Ss(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=bd(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,bv(n));;)if(r){if(1!=n.nodeType)return!1;let e=n.childNodes[r-1];"false"==e.contentEditable?r--:r=bv(n=e)}else{if(n==e)return!0;r=bf(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(11==n.nodeType)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,Sr),Si&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Si&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;this.delayedAndroidKey||(this.flushingAndroidKey=this.view.win.requestAnimationFrame(()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&bk(this.dom,e.key,e.keyCode))})),this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null===(n=this.delayedAndroidKey)||void 0===n?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),-1==t?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&bd(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new wa(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=ws(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let n=Sa(t,e.previousSibling||e.target.previousSibling,-1),r=Sa(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(xj)!=e.state.facet(xj)&&(e.view.contentDOM.editContext=e.state.facet(xj)?this.editContext.editContext:null))}destroy(){var e,t,n;for(let r of(this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect(),this.scrollTargets))r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Sa(e,t,n){for(;t;){let r=bO.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function Ss(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor);return bp(a.node,a.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}class Sl{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});for(let n in this.handlers.textupdate=t=>{let n=e.state.selection.main,{anchor:r,head:i}=n,o=this.toEditorPos(t.updateRangeStart),a=this.toEditorPos(t.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:t.updateRangeStart,editorBase:o,drifted:!1});let s={from:o,to:a,insert:vH.of(t.text.split("\n"))};if(s.from==this.from&&r<this.from?s.from=r:s.to==this.to&&r>this.to&&(s.to=r),s.from==s.to&&!s.insert.length){let r=yi.single(this.toEditorPos(t.selectionStart),this.toEditorPos(t.selectionEnd));r.main.eq(n)||e.dispatch({selection:r,userEvent:"select"});return}if((bG.mac||bG.android)&&s.from==i-1&&/^\. ?$/.test(t.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(s={from:o,to:a,insert:vH.of([t.text.replace("."," ")])}),this.pendingContextChange=s,!e.state.readOnly){let n=this.to-this.from+(s.to-s.from+s.insert.length);wl(e,s,yi.single(this.toEditorPos(t.selectionStart,n),this.toEditorPos(t.selectionEnd,n)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);t<o;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if("None"!=t&&"None"!=r){let i=this.toEditorPos(e.rangeStart),o=this.toEditorPos(e.rangeEnd);if(i<o){let e=`text-decoration: underline ${"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${"Thin"==r?1:2}px`;n.push(b6.mark({attributes:{style:e}}).range(i,o))}}}e.dispatch({effects:xN.of(b6.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}},this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=bu(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,o,a,s,l)=>{if(n)return;let u=l.length-(o-i);if(r&&o>=r.to){if(r.from==i&&r.to==o&&r.insert.eq(l)){r=this.pendingContextChange=null,t+=u,this.to+=u;return}r=null,this.revertPending(e.state)}if(i+=t,(o+=t)<=this.from)this.from+=u,this.to+=u;else if(i<this.to){if(i<this.from||o>this.to||this.to-this.from+l.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(o),l.toString()),this.to+=u}t+=u}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent("input.type")&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Su{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;for(let t of(this.dispatchTransactions=e.dispatchTransactions||n&&(e=>e.forEach(e=>n(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new wJ(e.state||yz.create(e)),e.scrollTo&&e.scrollTo.is(x_)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(xF).map(e=>new x$(e)),this.plugins))t.update(this);this.observer=new So(this),this.inputState=new wu(this),this.inputState.ensureHandlers(this.plugins),this.docView=new x1(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(t=document.fonts)||void 0===t?void 0:t.ready)&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=1==e.length&&e[0]instanceof yL?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,i=this.state;for(let t of e){if(t.startState!=i)throw RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=t.state}if(this.destroyed){this.viewState.state=i;return}let o=this.hasFocus,a=0,s=null;e.some(e=>e.annotation(wO))?(this.inputState.notifiedFocused=o,a=1):o==this.inputState.notifiedFocused||(this.inputState.notifiedFocused=o,(s=wE(i,o))||(a=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),((u=this.observer.readChange())&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(u=null)):this.observer.clear(),i.facet(yz.phrases)!=this.state.facet(yz.phrases))return this.setState(i);r=x0.create(this,i,e),r.flags|=a;let c=this.viewState.scrollTarget;try{for(let t of(this.updateState=2,e)){if(c&&(c=c.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;c=new xL(e.empty?e:yi.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(x_)&&(c=e.value.clip(this.state))}this.viewState.update(r,c),this.bidiCache=Sh.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(xJ)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(w4)!=r.state.facet(w4)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let e of this.state.facet(xT))try{e(r)}catch(e){xZ(this.state,e,"update listener")}(s||u)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),u&&!ws(this,u)&&l.force&&bk(this.contentDOM,l.key,l.keyCode)})}setState(e){if(0!=this.updateState)throw Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);for(let t of(this.viewState=new wJ(e),this.plugins=e.facet(xF).map(e=>new x$(e)),this.pluginMap.clear(),this.plugins))t.update(this);this.docView.destroy(),this.docView=new x1(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(xF),n=e.state.facet(xF);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new x$(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){xZ(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(o<0){if(bT(n))i=-1,o=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,o=e.top}}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let s=[];4&a||([this.measureRequests,s]=[s,this.measureRequests]);let l=s.map(e=>{try{return e.read(this)}catch(e){return xZ(this.state,e),Sd}}),u=x0.create(this,this.state,[]),c=!1;u.flags|=a,t?t.flags|=a:t=u,this.updateState=2,!u.empty&&(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),(c=this.docView.update(u))&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(l[e]!=Sd)try{let t=s[e];t.write&&t.write(l[e],this)}catch(e){xZ(this.state,e)}if(c&&this.docView.updateSelection(!0),!u.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}{let e=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-o;if(e>1||e<-1){r+=e,n.scrollTop=r/this.scaleY,o=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(xT))e(t)}get themeClasses(){return w8+" "+(this.state.facet(w6)?w7:w9)+" "+this.state.facet(w4)}updateAttrs(){let e=Sp(this,xV,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(xj)?"true":"false",class:"cm-content",style:`${bG.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Sp(this,xH,t);let n=this.observer.ignore(()=>{let n=b5(this.contentDOM,this.contentAttrs,t),r=b5(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(Su.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(xJ);let e=this.state.facet(Su.cspNonce);be.mount(this.root,this.styleModules.concat(Sn).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e&&!(this.measureRequests.indexOf(e)>-1)){if(null!=e.key){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return wr(this,e,wt(this,e,t,n))}moveByGroup(e,t){return wr(this,e,wt(this,e,t,t=>{var n;let r,i;return n=e.head,i=(r=this.state.charCategorizer(n))(t),e=>{let t=r(e);return i==yB.Space&&(i=t),i==t}}))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return yi.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,r){let i=we(e,t.head),o=r&&i.type==b4.Text&&(e.lineWrapping||i.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),a=e.posAtCoords({x:n==(r==xl.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=a)return yi.cursor(a,n?-1:1)}return yi.cursor(n?i.to:i.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return wr(this,e,function(e,t,n,r){let i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return yi.cursor(i,t.assoc);let a=t.goalColumn,s,l=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(i,t.assoc||-1),c=e.documentTop;if(u)null==a&&(a=u.left-l.left),s=o<0?u.top:u.bottom;else{let t=e.viewState.lineBlockAt(i);null==a&&(a=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-t.from))),s=(o<0?t.top:t.bottom)+c}let d=l.left+a,h=null!=r?r:e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let n=s+(h+t)*o,r=x9(e,{x:d,y:n},!1,o);if(n<l.top||n>l.bottom||(o<0?r<i:r>i)){let t=e.docView.coordsForChar(r),i=!t||n<t.top?-1:1;return yi.cursor(r,i,void 0,a)}}}(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),x9(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r);return by(n,i[xy.find(i,e-r.from,-1,t)].dir==xl.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(xO)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Sc)return xx(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||function e(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.direction!=o.direction||!e(i.inner,o.inner))return!1}return!0}(r.isolates,n=xK(this,e))))return r.order;n||(n=xK(this,e));let r=function(e,t,n){if(!e)return[new xy(0,0,+(t==xc))];if(t==xu&&!n.length&&!xv.test(e))return xx(e.length);if(n.length)for(;e.length>xb.length;)xb[xb.length]=256;let r=[],i=+(t!=xu);return function e(t,n,r,i,o,a,s){let l=n%2?2:1;!function(e,t,n,r,i){for(let o=0;o<=r.length;o++){let a=o?r[o-1].to:t,s=o<r.length?r[o].from:n,l=o?256:i;for(let t=a,n=l,r=l;t<s;t++){let i=xm(e.charCodeAt(t));512==i?i=n:8==i&&4==r&&(i=16),xb[t]=4==i?2:i,7&i&&(r=i),n=i}for(let e=a,t=l,r=l;e<s;e++){let i=xb[e];if(128==i)e<s-1&&t==xb[e+1]&&24&t?i=xb[e]=t:xb[e]=256;else if(64==i){let i=e+1;for(;i<s&&64==xb[i];)i++;let o=e&&8==t||i<n&&8==xb[i]?1==r?1:8:256;for(let t=e;t<i;t++)xb[t]=o;e=i-1}else 8==i&&1==r&&(xb[e]=1);t=i,7&i&&(r=i)}}}(t,o,a,i,l),function(e,t,n,r,i){let o=1==i?2:1;for(let a=0,s=0,l=0;a<=r.length;a++){let u=a?r[a-1].to:t,c=a<r.length?r[a].from:n;for(let t=u,n,r,a;t<c;t++)if(r=xf[n=e.charCodeAt(t)]){if(r<0){for(let e=s-3;e>=0;e-=3)if(xg[e+1]==-r){let n=xg[e+2],r=2&n?i:4&n?1&n?o:i:0;r&&(xb[t]=xb[xg[e]]=r),s=e;break}}else if(189==xg.length)break;else xg[s++]=t,xg[s++]=n,xg[s++]=l}else if(2==(a=xb[t])||1==a){let e=a==i;l=+!e;for(let t=s-3;t>=0;t-=3){let n=xg[t+2];if(2&n)break;if(e)xg[t+2]|=2;else{if(4&n)break;xg[t+2]|=4}}}}}(t,o,a,i,l),function(e,t,n,r){for(let i=0,o=r;i<=n.length;i++){let a=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let l=a;l<s;){let a=xb[l];if(256==a){let a=l+1;for(;;)if(a==s){if(i==n.length)break;a=n[i++].to,s=i<n.length?n[i].from:t}else if(256==xb[a])a++;else break;let u=1==o,c=u==((a<t?xb[a]:r)==1)?u?1:2:r;for(let t=a,r=i,o=r?n[r-1].to:e;t>l;)t==o&&(t=n[--r].from,o=r?n[r-1].to:e),xb[--t]=c;l=a}else o=a,l++}}}(o,a,i,l),function t(n,r,i,o,a,s,l){let u=o%2?2:1;if(o%2==a%2)for(let c=r,d=0;c<i;){let r=!0,h=!1;if(d==s.length||c<s[d].from){let e=xb[c];e!=u&&(r=!1,h=16==e)}let p=r||1!=u?null:[],f=r?o:o+1,g=c;n:for(;;)if(d<s.length&&g==s[d].from){if(h)break;let t=s[d];if(!r)for(let e=t.to,n=d+1;;){if(e==i)break n;if(n<s.length&&s[n].from==e)e=s[n++].to;else if(xb[e]==u)break n;else break}d++,p?p.push(t):(t.from>c&&l.push(new xy(c,t.from,f)),e(n,t.direction==xu!=!(f%2)?o+1:o,a,t.inner,t.from,t.to,l),c=t.to),g=t.to}else if(g==i||(r?xb[g]!=u:xb[g]==u))break;else g++;p?t(n,c,g,o+1,a,p,l):c<g&&l.push(new xy(c,g,f)),c=g}else for(let c=i,d=s.length;c>r;){let i=!0,h=!1;if(!d||c>s[d-1].to){let e=xb[c-1];e!=u&&(i=!1,h=16==e)}let p=i||1!=u?null:[],f=i?o:o+1,g=c;n:for(;;)if(d&&g==s[d-1].to){if(h)break;let t=s[--d];if(!i)for(let e=t.from,n=d;;){if(e==r)break n;if(n&&s[n-1].to==e)e=s[--n].from;else if(xb[e-1]==u)break n;else break}p?p.push(t):(t.to<c&&l.push(new xy(t.to,c,f)),e(n,t.direction==xu!=!(f%2)?o+1:o,a,t.inner,t.from,t.to,l),c=t.from),g=t.from}else if(g==r||(i?xb[g-1]!=u:xb[g-1]==u))break;else g--;p?t(n,g,c,o+1,a,p,l):g<c&&l.push(new xy(g,c,f)),c=g}}(t,o,a,n,r,i,s)}(e,i,i,n,0,e.length,r),r}(e.text,t,n);return this.bidiCache.push(new Sh(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||bG.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{bS(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of(this.root.activeElement==this.contentDOM&&this.contentDOM.blur(),this.plugins))e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return x_.of(new xL("number"==typeof e?yi.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return x_.of(new xL(yi.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return xz.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return xz.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=be.newName(),r=[w4.of(n),xJ.of(St(`.${n}`,e))];return t&&t.dark&&r.push(w6.of(!0)),r}static baseTheme(e){return ym.lowest(xJ.of(St("."+w8,e,Se)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&bO.get(n)||bO.get(e);return(null===(t=null==r?void 0:r.rootView)||void 0===t?void 0:t.view)||null}}Su.styleModule=xJ,Su.inputHandler=xA,Su.clipboardInputFilter=xP,Su.clipboardOutputFilter=xR,Su.scrollHandler=xD,Su.focusChangeEffect=xI,Su.perLineTextDirection=xO,Su.exceptionSink=xM,Su.updateListener=xT,Su.editable=xj,Su.mouseSelectionStyle=xk,Su.dragMovesSelection=xC,Su.clickAddsSelectionRange=xS,Su.decorations=xW,Su.outerDecorations=xq,Su.atomicRanges=xG,Su.bidiIsolatedRanges=xU,Su.scrollMargins=xY,Su.darkTheme=w6,Su.cspNonce=ys.define({combine:e=>e.length?e[0]:""}),Su.contentAttributes=xH,Su.editorAttributes=xV,Su.lineWrapping=Su.contentAttributes.of({class:"cm-lineWrapping"}),Su.announce=yD.define();let Sc=4096,Sd={};class Sh{constructor(e,t,n,r,i,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=o}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:xl.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let o=e[i];o.dir!=r||t.touchesRange(o.from,o.to)||n.push(new Sh(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function Sp(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],o="function"==typeof t?t(e):t;o&&b0(o,n)}return n}let Sf=bG.mac?"mac":bG.windows?"win":bG.linux?"linux":"key";function Sg(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}let Sm=ym.default(Su.domEventHandlers({keydown:(e,t)=>SS(Sb(t.state),e,t,"editor")})),Sv=ys.define({enables:Sm}),Sy=new WeakMap;function Sb(e){let t=e.facet(Sv),n=Sy.get(t);return n||Sy.set(t,n=function(e,t=Sf){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(null==n)r[e]=t;else if(n!=t)throw Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=(e,r,o,a,s)=>{var l,u;let c=n[e]||(n[e]=Object.create(null)),d=r.split(/ (?!$)/).map(e=>(function(e,t){let n,r,i,o;let a=e.split(/-(?!$)/),s=a[a.length-1];"Space"==s&&(s=" ");for(let e=0;e<a.length-1;++e){let s=a[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else if(/^mod$/i.test(s))"mac"==t?o=!0:r=!0;else throw Error("Unrecognized modifier name: "+s)}return n&&(s="Alt-"+s),r&&(s="Ctrl-"+s),o&&(s="Meta-"+s),i&&(s="Shift-"+s),s})(e,t));for(let t=1;t<d.length;t++){let n=d.slice(0,t).join(" ");i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=Sx={view:t,prefix:n,scope:e};return setTimeout(()=>{Sx==r&&(Sx=null)},4e3),!0}]})}let h=d.join(" ");i(h,!1);let p=c[h]||(c[h]={preventDefault:!1,stopPropagation:!1,run:(null===(u=null===(l=c._any)||void 0===l?void 0:l.run)||void 0===u?void 0:u.slice())||[]});o&&p.run.push(o),a&&(p.preventDefault=!0),s&&(p.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,Sw))}let i=r[t]||r.key;if(i)for(let t of e)o(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&o(t,"Shift-"+i,r.shift,r.preventDefault,r.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}let Sx=null,Sw=null;function SS(e,t,n,r){var i;Sw=t;let o=("Esc"==(i=!(bo&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||ba&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?bi:br)[t.keyCode]||t.key||"Unidentified")&&(i="Escape"),"Del"==i&&(i="Delete"),"Left"==i&&(i="ArrowLeft"),"Up"==i&&(i="ArrowUp"),"Right"==i&&(i="ArrowRight"),"Down"==i&&(i="ArrowDown"),i),a=v2(v0(o,0))==o.length&&" "!=o,s="",l=!1,u=!1,c=!1;Sx&&Sx.view==n&&Sx.scope==r&&(s=Sx.prefix+" ",0>wp.indexOf(t.keyCode)&&(u=!0,Sx=null));let d=new Set,h=e=>{if(e){for(let t of e.run)if(!d.has(t)&&(d.add(t),t(n)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),u=!0)}return!1},p=e[r],f,g;return p&&(h(p[s+Sg(o,t,!a)])?l=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(bG.windows&&t.ctrlKey&&t.altKey)&&(f=br[t.keyCode])&&f!=o?h(p[s+Sg(f,t,!0)])?l=!0:t.shiftKey&&(g=bi[t.keyCode])!=o&&g!=f&&h(p[s+Sg(g,t,!1)])&&(l=!0):a&&t.shiftKey&&h(p[s+Sg(o,t,!0)])&&(l=!0),!l&&h(p._any)&&(l=!0)),u&&(l=!0),l&&c&&t.stopPropagation(),Sw=null,l}class SC{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(!n.empty)return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==xl.LTR,a=e.contentDOM,s=a.getBoundingClientRect(),l=Sk(e),u=a.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),d=s.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),h=s.right-(c?parseInt(c.paddingRight):0),p=we(e,r),f=we(e,i),g=p.type==b4.Text?p:null,m=f.type==b4.Text?f:null;if(g&&(e.lineWrapping||p.widgetLineBreaks)&&(g=SM(e,r,1,g)),m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=SM(e,i,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(b(n.from,n.to,g));{let t=g?b(n.from,null,g):x(p,!1),r=m?b(null,n.to,m):x(f,!0),i=[];return(g||p).to<(m||f).from-(g&&m?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(v(d,t.bottom,h,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==b4.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),y(t).concat(i).concat(y(r))}function v(e,n,r,i){return new SC(t,e-l.left,n-l.top,r-e,i-n)}function y({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(v(n[i],e,n[i+1],t));return r}function b(t,n,r){let i=1e9,a=-1e9,s=[];function l(t,n,l,u,c){let p=e.coordsAtPos(t,t==r.to?-2:2),f=e.coordsAtPos(l,l==r.from?2:-2);p&&f&&(i=Math.min(p.top,f.top,i),a=Math.max(p.bottom,f.bottom,a),c==xl.LTR?s.push(o&&n?d:p.left,o&&u?h:f.right):s.push(!o&&u?d:f.left,!o&&n?h:p.right))}let u=null!=t?t:r.from,c=null!=n?n:r.to;for(let r of e.visibleRanges)if(r.to>u&&r.from<c)for(let i=Math.max(r.from,u),o=Math.min(r.to,c);;){let r=e.state.doc.lineAt(i);for(let a of e.bidiSpans(r)){let e=a.from+r.from,s=a.to+r.from;if(e>=o)break;s>i&&l(Math.max(e,i),null==t&&e<=u,Math.min(s,o),null==n&&s>=c,a.dir)}if((i=r.to+1)>=o)break}return 0==s.length&&l(u,null==t,c,null==n,e.textDirection),{top:i,bottom:a,horizontal:s}}function x(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n);{let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let i=Sk(e);return[new SC(t,r.left-i.left,r.top-i.top,null,r.bottom-r.top)]}}}function Sk(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==xl.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function SM(e,t,n,r){let i=e.coordsAtPos(t,2*n);if(!i)return r;let o=e.dom.getBoundingClientRect(),a=(i.top+i.bottom)/2,s=e.posAtCoords({x:o.left+1,y:a}),l=e.posAtCoords({x:o.right-1,y:a});return null==s||null==l?r:{from:Math.max(r.from,Math.min(s,l)),to:Math.min(r.to,Math.max(s,l))}}class ST{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(SA)!=e.state.facet(SA)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(SA);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>{var n;return n=this.drawn[t],!(e.constructor==n.constructor&&e.eq(n))})){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}let SA=ys.define();function SI(e){return[xz.define(t=>new ST(t,e)),SA.of(e)]}let SP=!(bG.ios&&bG.webkit&&bG.webkit_version<534),SR=ys.define({combine:e=>y$(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function SO(e){return e.startState.facet(SR)!=e.state.facet(SR)}let SE=SI({above:!0,markers(e){let{state:t}=e,n=t.facet(SR),r=[];for(let i of t.selection.ranges){let o=i==t.selection.main;if(i.empty?!o||SP:n.drawRangeCursor){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=i.empty?i:yi.cursor(i.head,i.head>i.anchor?-1:1);for(let i of SC.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=SO(e);return n&&SD(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){SD(t.state,e)},class:"cm-cursorLayer"});function SD(e,t){t.style.animationDuration=e.facet(SR).cursorBlinkRate+"ms"}let SL=SI({above:!1,markers:e=>e.state.selection.ranges.map(t=>t.empty?[]:SC.forRange(e,"cm-selectionBackground",t)).reduce((e,t)=>e.concat(t)),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||SO(e),class:"cm-selectionLayer"}),S_={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};SP&&(S_[".cm-line"].caretColor=S_[".cm-content"].caretColor="transparent !important");let SN=ym.highest(Su.theme(S_)),SZ=yD.define({map:(e,t)=>null==e?null:t.mapPos(e)}),Sj=yp.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(SZ)?t.value:e,e))}),SB=xz.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Sj);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Sj)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Sj),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Sj)!=e&&this.view.dispatch({effects:SZ.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function SF(e,t,n,r,i){t.lastIndex=0;for(let o=e.iterRange(n,r),a=n,s;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;s=t.exec(o.value);)i(a+s.index,s)}class Sz{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:o=1e3}=e;if(!t.global)throw RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,r,i)=>{let o=n(e,t,r);o&&i(r,r+e[0].length,o)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=o}createDeco(e){let t=new yU,n=t.add.bind(t);for(let{from:t,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}(e,this.maxLength))SF(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return(e.docChanged&&e.changes.iterChanges((t,i,o,a)=>{a>=e.view.viewport.from&&o<=e.view.viewport.to&&(n=Math.min(o,n),r=Math.max(a,r))}),e.viewportMoved||r-n>1e3)?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let o=Math.max(i.from,n),a=Math.min(i.to,r);if(a>o){let n=e.state.doc.lineAt(o),r=n.to<a?e.state.doc.lineAt(a):n,s=Math.max(i.from,n.from),l=Math.min(i.to,r.to);if(this.boundary){for(;o>n.from;o--)if(this.boundary.test(n.text[o-1-n.from])){s=o;break}for(;a<r.to;a++)if(this.boundary.test(r.text[a-r.from])){l=a;break}}let u=[],c,d=(e,t,n)=>u.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=s-n.from;(c=this.regexp.exec(n.text))&&c.index<l-n.from;)this.addMatch(c,e,c.index+n.from,d);else SF(e.state.doc,this.regexp,s,l,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:s,filterTo:l,filter:(e,t)=>e<s||t>l,add:u})}}return t}}let S$=null!=/x/.unicode?"gu":"g",SV=RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]",S$),SH={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},SW=null,Sq=ys.define({combine(e){let t=y$(e,{render:null,specialChars:SV,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==SW&&"undefined"!=typeof document&&document.body){let t=document.body.style;SW=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)!=null}return SW||!1}())&&(t.specialChars=RegExp(" |"+t.specialChars.source,S$)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,S$)),t}}),SG=null;class SU extends b3{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){var t;let n=(t=this.code)>=32?"•":10==t?"␤":String.fromCharCode(9216+t),r=e.state.phrase("Control character")+" "+(SH[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class SK extends b3{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}let SY=b6.line({class:"cm-activeLine"}),SX=xz.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(SY.range(i.from)),t=i.from)}return b6.set(n)}},{decorations:e=>e.decorations});class SJ extends b3{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),"string"==typeof this.content?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?bh(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=by(t[0],"rtl"!=n.direction),i=parseInt(n.lineHeight);return r.bottom-r.top>1.5*i?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}}function SQ(e,t){var n;let r,i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(i),a=i-o.from,s=a>2e3?-1:a==o.length?(n=t.clientX,(r=e.coordsAtPos(e.viewport.from))?Math.round(Math.abs((r.left-n)/e.defaultCharacterWidth)):-1):y4(o.text,e.state.tabSize,i-o.from);return{line:o.number,col:s,off:a}}let S0={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},S1={style:"cursor: crosshair"},S2="-10000px";class S5{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let o=[],a=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)o[n]=this.createTooltipView(r,n?o[n-1]:null),a&&(a[n]=!!r.above);else{let r=o[n]=this.tooltipViews[s];a&&(a[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)0>o.indexOf(e)&&(this.removeTooltipView(e),null===(n=e.destroy)||void 0===n||n.call(e));return t&&(a.forEach((e,n)=>t[n]=e),t.length=a.length),this.input=r,this.tooltips=i,this.tooltipViews=o,!0}}function S3(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}let S4=ys.define({combine:e=>{var t,n,r;return{position:bG.ios?"absolute":(null===(t=e.find(e=>e.position))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find(e=>e.parent))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(r=e.find(e=>e.tooltipSpace))||void 0===r?void 0:r.tooltipSpace)||S3}}}),S6=new WeakMap,S8=xz.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(S4);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new S5(e,Ct,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver)for(let e of(this.intersectionObserver.disconnect(),this.manager.tooltipViews))this.intersectionObserver.observe(e.dom)}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(S4);if(r.position!=this.position&&!this.madeAbsolute){for(let e of(this.position=r.position,this.manager.tooltipViews))e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){for(let e of(this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer(),this.manager.tooltipViews))this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=S2,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;for(let t of(this.view.win.removeEventListener("resize",this.measureSoon),this.manager.tooltipViews))t.dom.remove(),null===(e=t.destroy)||void 0===e||e.call(t);this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(n=this.intersectionObserver)||void 0===n||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(bG.gecko)n=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==S2&&"0px"==e.style.left){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(n||"absolute"==this.position){if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState)}let r=this.view.scrollDOM.getBoundingClientRect(),i=xX(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(S4).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute)for(let e of(this.madeAbsolute=!0,this.position="absolute",this.manager.tooltipViews))e.dom.style.position="absolute";let{visible:n,space:r,scaleX:i,scaleY:o}=e,a=[];for(let s=0;s<this.manager.tooltips.length;s++){let l=this.manager.tooltips[s],u=this.manager.tooltipViews[s],{dom:c}=u,d=e.pos[s],h=e.size[s];if(!d||!1!==l.clip&&(d.bottom<=Math.max(n.top,r.top)||d.top>=Math.min(n.bottom,r.bottom)||d.right<Math.max(n.left,r.left)-.1||d.left>Math.min(n.right,r.right)+.1)){c.style.top=S2;continue}let p=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,f=7*!!p,g=h.right-h.left,m=null!==(t=S6.get(u))&&void 0!==t?t:h.bottom-h.top,v=u.offset||Ce,y=this.view.textDirection==xl.LTR,b=h.width>r.right-r.left?y?r.left:r.right-h.width:y?Math.max(r.left,Math.min(d.left-14*!!p+v.x,r.right-g)):Math.min(Math.max(r.left,d.left-g+14*!!p-v.x),r.right-g),x=this.above[s];!l.strictSide&&(x?d.top-m-f-v.y<r.top:d.bottom+m+f+v.y>r.bottom)&&x==r.bottom-d.bottom>d.top-r.top&&(x=this.above[s]=!x);let w=(x?d.top-r.top:r.bottom-d.bottom)-f;if(w<m&&!1!==u.resize){if(w<this.view.defaultLineHeight){c.style.top=S2;continue}S6.set(u,m),c.style.height=(m=w)/o+"px"}else c.style.height&&(c.style.height="");let S=x?d.top-m-f-v.y:d.bottom+f+v.y,C=b+g;if(!0!==u.overlap)for(let e of a)e.left<C&&e.right>b&&e.top<S+m&&e.bottom>S&&(S=x?e.top-m-2-f:e.bottom+f+2);if("absolute"==this.position?(c.style.top=(S-e.parent.top)/o+"px",S9(c,(b-e.parent.left)/i)):(c.style.top=S/o+"px",S9(c,b/i)),p){let e=d.left+(y?v.x:-v.x)-(b+14-7);p.style.left=e/i+"px"}!0!==u.overlap&&a.push({left:b,top:S,right:C,bottom:S+m}),c.classList.toggle("cm-tooltip-above",x),c.classList.toggle("cm-tooltip-below",!x),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=S2}},{eventObservers:{scroll(){this.maybeMeasure()}}});function S9(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}let S7=Su.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Ce={x:0,y:0},Ct=ys.define({enables:[S8,S7]}),Cn=ys.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class Cr{static create(e){return new Cr(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new S5(e,Cn,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(void 0!==r){if(void 0===t)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}let Ci=Ct.compute([Cn],e=>{let t=e.facet(Cn);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos})),create:Cr.create,above:t[0].above,arrow:t.some(e=>e.arrow)}});class Co{constructor(e,t,n,r,i){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.nearest(t.target);if(!n)return;let r,i=1;if(n instanceof bY)r=n.posAtStart;else{if(null==(r=e.posAtCoords(t)))return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),a=o&&o.dir==xl.RTL?-1:1;i=t.x<n.left?-a:a}let o=this.source(e,r,i);if(null==o?void 0:o.then){let t=this.pending={pos:r};o.then(n=>{this.pending==t&&(this.pending=null,n&&!(Array.isArray(n)&&!n.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>xZ(e.state,t,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(S8),t=e?e.manager.tooltips.findIndex(e=>e.create==Cr.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:i}=this;if(r.length&&i&&!function(e,t){let{left:n,right:r,top:i,bottom:o}=e.getBoundingClientRect(),a;if(a=e.querySelector(".cm-tooltip-arrow")){let e=a.getBoundingClientRect();i=Math.min(e.top,i),o=Math.max(e.bottom,o)}return t.clientX>=n-4&&t.clientX<=r+4&&t.clientY>=i-4&&t.clientY<=o+4}(i.dom,e)||this.pending){let{pos:i}=r[0]||this.pending,o=null!==(n=null===(t=r[0])||void 0===t?void 0:t.end)&&void 0!==n?n:i;(i==o?this.view.posAtCoords(this.lastMove)!=i:!function(e,t,n,r,i,o){let a=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(a.left>r||a.right<r||a.top>i||Math.min(a.bottom,s)<i)return!1;let l=e.posAtCoords({x:r,y:i},!1);return l>=t&&l<=n}(this.view,i,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function Ca(e,t){let n=e.plugin(S8);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}let Cs=yD.define(),Cl=ys.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function Cu(e,t){let n=e.plugin(Cc),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}let Cc=xz.fromClass(class{constructor(e){this.input=e.state.facet(Cp),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(Cl);for(let n of(this.top=new Cd(e,!0,t.topContainer),this.bottom=new Cd(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top)),this.panels))n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(Cl);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Cd(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Cd(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(Cp);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],o=[],a=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),a.push(s)):(s=this.panels[t]).update&&s.update(e),r.push(s),(s.top?i:o).push(s)}for(let e of(this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(o),a))e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Su.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Cd{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&0>e.indexOf(t)&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Ch(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Ch(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Ch(e){let t=e.nextSibling;return e.remove(),t}let Cp=ys.define({enables:Cc});class Cf extends yV{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Cf.prototype.elementClass="",Cf.prototype.toDOM=void 0,Cf.prototype.mapMode=v3.TrackBefore,Cf.prototype.startSide=Cf.prototype.endSide=-1,Cf.prototype.point=!0;let Cg=ys.define(),Cm=ys.define(),Cv={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>yG.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Cy=ys.define();function Cb(e){return[Cw(),Cy.of(Object.assign(Object.assign({},Cv),e))]}let Cx=ys.define({combine:e=>e.some(e=>e)});function Cw(e){let t=[CS];return e&&!1===e.fixed&&t.push(Cx.of(!0)),t}let CS=xz.fromClass(class{constructor(e){for(let t of(this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(Cy).map(t=>new CT(e,t)),this.gutters))this.dom.appendChild(t.dom);this.fixed=!e.state.facet(Cx),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Cx)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let n=yG.iter(this.view.state.facet(Cg),this.view.viewport.from),r=[],i=this.gutters.map(e=>new CM(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let o of e.type)if(o.type==b4.Text&&t){for(let e of(Ck(n,r,o.from),i))e.line(this.view,o,r);t=!1}else if(o.widget)for(let e of i)e.widget(this.view,o)}else if(e.type==b4.Text)for(let t of(Ck(n,r,e.from),i))t.line(this.view,e,r);else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(Cy),n=e.state.facet(Cy),r=e.docChanged||e.heightChanged||e.viewportChanged||!yG.eq(e.startState.facet(Cg),e.state.facet(Cg),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new CT(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),0>i.indexOf(e)&&e.destroy();for(let e of i)this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>Su.scrollMargins.of(t=>{let n=t.plugin(e);return n&&0!=n.gutters.length&&n.fixed?t.textDirection==xl.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}:null})});function CC(e){return Array.isArray(e)?e:[e]}function Ck(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class CM{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=yG.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let t=new CA(e,o,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,o,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];Ck(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let o=this.gutter;(0!=r.length||o.config.renderEmptyElements)&&this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(Cm)){let i=n(e,t.widget,t);i&&(r||(r=[])).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class CT{constructor(e,t){for(let n in this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:""),t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,o;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();o=(e.top+e.bottom)/2}else o=r.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,a,r)&&r.preventDefault()});this.markers=CC(t.markers(e)),t.initialSpacer&&(this.spacer=new CA(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=CC(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!yG.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class CA{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),!function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,r)&&this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let i=0,o=0;;){let a=o,s=i<t.length?t[i++]:null,l=!1;if(s){let e=s.elementClass;e&&(n+=" "+e);for(let e=o;e<this.markers.length;e++)if(this.markers[e].compare(s)){a=e,l=!0;break}}else a=this.markers.length;for(;o<a;){let e=this.markers[o++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(l?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),l&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}let CI=ys.define(),CP=ys.define(),CR=ys.define({combine:e=>y$(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})});class CO extends Cf{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function CE(e,t){return e.state.facet(CR).formatNumber(t,e.state)}let CD=Cy.compute([CR],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(CI),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new CO(CE(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let r of e.state.facet(CP)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(CR)!=e.state.facet(CR),initialSpacer:e=>new CO(CE(e,CL(e.state.doc.lines))),updateSpacer(e,t){let n=CE(t.view,CL(t.view.state.doc.lines));return n==e.number?e:new CO(n)},domEventHandlers:e.facet(CR).domEventHandlers}));function CL(e){let t=9;for(;t<e;)t=10*t+9;return t}let C_=new class extends Cf{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},CN=Cg.compute(["selection"],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(C_.range(i)))}return yG.of(t)}),CZ=0;class Cj{constructor(e,t){this.from=e,this.to=t}}class CB{constructor(e={}){this.id=CZ++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=C$.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}CB.closedBy=new CB({deserialize:e=>e.split(" ")}),CB.openedBy=new CB({deserialize:e=>e.split(" ")}),CB.group=new CB({deserialize:e=>e.split(" ")}),CB.isolate=new CB({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw RangeError("Invalid value for isolate: "+e);return e||"auto"}}),CB.contextHash=new CB({perNode:!0}),CB.lookAhead=new CB({perNode:!0}),CB.mounted=new CB({perNode:!0});class CF{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[CB.mounted.id]}}let Cz=Object.create(null);class C${constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Cz,n=+!!e.top|2*!!e.skipped|4*!!e.error|8*(null==e.name),r=new C$(e.name||"",t,e.id,n);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(CB.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return e=>{for(let n=e.prop(CB.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}}C$.none=new C$("",Object.create(null),0,8);class CV{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let r=null;for(let t of e){let e=t(n);e&&(r||(r=Object.assign({},n.props)),r[e[0].id]=e[1])}t.push(r?new C$(n.name,r,n.id,n.flags):n)}return new CV(t)}}let CH=new WeakMap,CW=new WeakMap;(N3=N7||(N7={}))[N3.ExcludeBuffers=1]="ExcludeBuffers",N3[N3.IncludeAnonymous=2]="IncludeAnonymous",N3[N3.IgnoreMounts=4]="IgnoreMounts",N3[N3.IgnoreOverlays=8]="IgnoreOverlays";class Cq{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length)for(let[e,t]of(this.props=Object.create(null),i))this.props["number"==typeof e?e:e.id]=t}toString(){let e=CF.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new C4(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new C4(CH.get(this)||this.topNode);return r.moveTo(e,t),CH.set(this,r._tree),r}get topNode(){return new CJ(this,0,0,null)}resolve(e,t=0){let n=CY(CH.get(this)||this.topNode,e,t,!1);return CH.set(this,n),n}resolveInner(e,t=0){let n=CY(CW.get(this)||this.topNode,e,t,!0);return CW.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof CJ?r:r.context.parent;e;e=e.parent)if(e.index<0){let o=e.parent;(i||(i=[r])).push(o.resolve(t,n)),e=o}else{let o=CF.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let a=new CJ(o.tree,o.overlay[0].from+e.from,-1,e);(i||(i=[r])).push(CY(a,t,n,!1))}}return i?C5(i):r}(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,o=e.mode||0,a=(o&N7.IncludeAnonymous)>0;for(let e=this.cursor(o|N7.IncludeAnonymous);;){let o=!1;if(e.from<=i&&e.to>=r&&(!a&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;o=!0}for(;o&&n&&(a||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;o=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:C7(C$.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new Cq(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new Cq(C$.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=1024,reused:o=[],minRepeatType:a=r.types.length}=e,s=Array.isArray(n)?new CG(n,n.length):n,l=r.types,u=0,c=0;function d(e,t,n,i,o,a,s,l,u){let c=[],d=[];for(;e.length>i;)c.push(e.pop()),d.push(t.pop()+n-o);e.push(h(r.types[s],c,d,a-o,l-a,u)),t.push(o-n)}function h(e,t,n,r,i,o,a){if(o){let e=[CB.contextHash,o];a=a?[e].concat(a):[e]}if(i>25){let e=[CB.lookAhead,i];a=a?[e].concat(a):[e]}return new Cq(e,t,n,r,a)}let p=[],f=[];for(;s.pos>0;)!function e(t,n,p,f,g,m){let{id:v,start:y,end:b,size:x}=s,w=c,S=u;for(;x<0;){if(s.next(),-1==x){let e=o[v];p.push(e),f.push(y-t);return}if(-3==x){u=v;return}if(-4==x){c=v;return}else throw RangeError(`Unrecognized record size: ${x}`)}let C=l[v],k,M,T=y-t;if(b-y<=i&&(M=function(e,t){let n=s.fork(),r=0,o=0,l=0,u=n.end-i,c={size:0,start:0,skip:0};r:for(let i=n.pos-e;n.pos>i;){let e=n.size;if(n.id==t&&e>=0){c.size=r,c.start=o,c.skip=l,l+=4,r+=4,n.next();continue}let s=n.pos-e;if(e<0||s<i||n.start<u)break;let d=4*(n.id>=a),h=n.start;for(n.next();n.pos>s;){if(n.size<0){if(-3==n.size)d+=4;else break r}else n.id>=a&&(d+=4);n.next()}o=h,r+=e,l+=d}return(t<0||r==e)&&(c.size=r,c.start=o,c.skip=l),c.size>4?c:void 0}(s.pos-n,g))){let e=new Uint16Array(M.size-M.skip),n=s.pos-M.size,i=e.length;for(;s.pos>n;)i=function e(t,n,r){let{id:i,start:o,end:l,size:d}=s;if(s.next(),d>=0&&i<a){let a=r;if(d>4){let i=s.pos-(d-4);for(;s.pos>i;)r=e(t,n,r)}n[--r]=a,n[--r]=l-t,n[--r]=o-t,n[--r]=i}else -3==d?u=i:-4==d&&(c=i);return r}(M.start,e,i);k=new CU(e,b-M.start,r),T=M.start-t}else{let t=s.pos-x;s.next();let n=[],o=[],l=v>=a?v:-1,u=0,c=b;for(;s.pos>t;)l>=0&&s.id==l&&s.size>=0?(s.end<=c-i&&(d(n,o,y,u,s.end,c,l,w,S),u=n.length,c=s.end),s.next()):m>2500?function(e,t,n,o){let a=[],l=0,u=-1;for(;s.pos>t;){let{id:e,start:t,end:n,size:r}=s;if(r>4)s.next();else if(u>-1&&t<u)break;else u<0&&(u=n-i),a.push(e,t,n),l++,s.next()}if(l){let t=new Uint16Array(4*l),i=a[a.length-2];for(let e=a.length-3,n=0;e>=0;e-=3)t[n++]=a[e],t[n++]=a[e+1]-i,t[n++]=a[e+2]-i,t[n++]=n;n.push(new CU(t,a[2]-i,r)),o.push(i-e)}}(y,t,n,o):e(y,t,n,o,l,m+1);if(l>=0&&u>0&&u<n.length&&d(n,o,y,u,y,c,l,w,S),n.reverse(),o.reverse(),l>-1&&u>0){let e=function(e,t){return(n,r,i)=>{let o=0,a=n.length-1,s,l;if(a>=0&&(s=n[a])instanceof Cq){if(!a&&s.type==e&&s.length==i)return s;(l=s.prop(CB.lookAhead))&&(o=r[a]+s.length+l)}return h(e,n,r,i,o,t)}}(C,S);k=C7(C,n,o,0,n.length,0,b-y,e,e)}else k=h(C,n,o,b-y,w-b,S)}p.push(k),f.push(T)}(e.start||0,e.bufferStart||0,p,f,-1,0);let g=null!==(t=e.length)&&void 0!==t?t:p.length?f[0]+p[0].length:0;return new Cq(l[e.topID],p.reverse(),f.reverse(),g)}(e)}}Cq.empty=new Cq(C$.none,[],[],0);class CG{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new CG(this.buffer,this.index)}}class CU{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return C$.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),n==(e+=4))return i;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return i+"("+o.join(",")+")"}findChild(e,t,n,r,i){let{buffer:o}=this,a=-1;for(let s=e;s!=t&&(!CK(i,r,o[s+1],o[s+2])||(a=s,!(n>0)));s=o[s+3]);return a}slice(e,t,n){let r=this.buffer,i=new Uint16Array(t-e),o=0;for(let a=e,s=0;a<t;){i[s++]=r[a++],i[s++]=r[a++]-n;let t=i[s++]=r[a++]-n;i[s++]=r[a++]-e,o=Math.max(o,t)}return new CU(i,o,this.set)}}function CK(e,t,n,r){switch(e){case -2:return n<t;case -1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function CY(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof CJ&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=r?0:N7.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;a=(r=a).parent)r instanceof CJ&&r.index<0&&(null===(i=a.enter(t,n,o))||void 0===i?void 0:i.from)!=r.from&&(e=a);for(;;){let r=e.enter(t,n,o);if(!r)return e;e=r}}class CX{cursor(e=0){return new C4(this,e)}getChild(e,t=null,n=null){let r=CQ(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return CQ(this,e,t,n)}resolve(e,t=0){return CY(this,e,t,!1)}resolveInner(e,t=0){return CY(this,e,t,!0)}matchContext(e){return C0(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class CJ extends CX{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,r,i=0){for(let o=this;;){for(let{children:a,positions:s}=o._tree,l=t>0?a.length:-1;e!=l;e+=t){let l=a[e],u=s[e]+o.from;if(CK(r,n,u,u+l.length)){if(l instanceof CU){if(i&N7.ExcludeBuffers)continue;let a=l.findChild(0,l.buffer.length,t,n-u,r);if(a>-1)return new C2(new C1(o,l,e,u),null,a)}else if(i&N7.IncludeAnonymous||!l.type.isAnonymous||C6(l)){let a;if(!(i&N7.IgnoreMounts)&&(a=CF.get(l))&&!a.overlay)return new CJ(a.tree,u,e,o);let s=new CJ(l,u,e,o);return i&N7.IncludeAnonymous||!s.type.isAnonymous?s:s.nextChild(t<0?l.children.length-1:0,t,n,r)}}}if(i&N7.IncludeAnonymous||!o.type.isAnonymous||(e=o.index>=0?o.index+t:t<0?-1:o._parent._tree.children.length,!(o=o._parent)))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let r;if(!(n&N7.IgnoreOverlays)&&(r=CF.get(this._tree))&&r.overlay){let n=e-this.from;for(let{from:e,to:i}of r.overlay)if((t>0?e<=n:e<n)&&(t<0?i>=n:i>n))return new CJ(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function CQ(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(null!=n){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return o}for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}function C0(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class C1{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class C2 extends CX{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return i<0?null:new C2(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&N7.ExcludeBuffers)return null;let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return i<0?null:new C2(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new C2(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new C2(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let o=n.buffer[this.index+1];e.push(n.slice(r,i,o)),t.push(0)}return new Cq(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function C5(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof CJ&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new C3(i,n)}class C3{constructor(e,t){this.heads=e,this.node=t}get next(){return C5(this.heads)}}class C4{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof CJ)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return!!e&&(e instanceof CJ?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&N7.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&N7.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&N7.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&N7.IncludeAnonymous||e instanceof CU||!e.type.isAnonymous||C6(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)r:for(let r=this.index,i=this.stack.length;i>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=i+1;break r}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new C2(this.buffer,t,this.stack[e]);return this.bufferNode=new C2(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return C0(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return C0(this._tree,e,r);let o=n[t.buffer[this.stack[i]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function C6(e){return e.children.some(e=>e instanceof CU||!e.type.isAnonymous||C6(e))}let C8=new WeakMap;function C9(e,t){if(!e.isAnonymous||t instanceof CU||t.type!=e)return 1;let n=C8.get(t);if(null==n){for(let r of(n=1,t.children)){if(r.type!=e||!(r instanceof Cq)){n=1;break}n+=C9(e,r)}C8.set(t,n)}return n}function C7(e,t,n,r,i,o,a,s,l){let u=0;for(let n=r;n<i;n++)u+=C9(e,t[n]);let c=Math.ceil(1.5*u/8),d=[],h=[];return!function t(n,r,i,a,s){for(let u=i;u<a;){let i=u,p=r[u],f=C9(e,n[u]);for(u++;u<a;u++){let t=C9(e,n[u]);if(f+t>=c)break;f+=t}if(u==i+1){if(f>c){let e=n[i];t(e.children,e.positions,0,e.children.length,r[i]+s);continue}d.push(n[i])}else{let t=r[u-1]+n[u-1].length-p;d.push(C7(e,n,r,i,u,p,t,null,l))}h.push(p+s-o)}}(t,n,r,i,0),(s||l)(d,h,a)}class ke{constructor(e,t,n,r,i=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=+!!i|2*!!o}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let r=[new ke(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&r.push(n);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],i=1,o=e.length?e[0]:null;for(let a=0,s=0,l=0;;a++){let u=a<t.length?t[a]:null,c=u?u.fromA:1e9;if(c-s>=n)for(;o&&o.from<c;){let t=o;if(s>=t.from||c<=t.to||l){let e=Math.max(t.from,s)-l,n=Math.min(t.to,c)-l;t=e>=n?null:new ke(e,n,t.tree,t.offset+l,a>0,!!u)}if(t&&r.push(t),o.to>c)break;o=i<e.length?e[i++]:null}if(!u)break;s=u.toA,l=u.toA-u.toB}return r}}class kt{startParse(e,t,n){return"string"==typeof e&&(e=new kn(e)),n=n?n.length?n.map(e=>new Cj(e.from,e.to)):[new Cj(0,0)]:[new Cj(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}}class kn{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new CB({perNode:!0});let kr=0;class ki{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=kr++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){if(e instanceof ki&&(t=e),null==t?void 0:t.base)throw Error("Can not derive from a modified tag");let n=new ki("string"==typeof e?e:"?",[],null,[]);if(n.set.push(n),t)for(let e of t.set)n.set.push(e);return n}static defineModifier(e){let t=new ka(e);return e=>e.modified.indexOf(t)>-1?e:ka.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let ko=0;class ka{constructor(e){this.name=e,this.instances=[],this.id=ko++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var r,i;return n.base==e&&(r=t,i=n.modified,r.length==i.length&&r.every((e,t)=>e==i[t]))});if(n)return n;let r=[],i=new ki(e.name,r,e,t);for(let e of t)e.instances.push(i);let o=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of o)r.push(ka.get(t,e));return i}}function ks(e){let t=Object.create(null);for(let n in e){let r=e[n];for(let e of(Array.isArray(r)||(r=[r]),n.split(" ")))if(e){let n=[],i=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!r)throw RangeError("Invalid path: "+e);if(n.push("*"==r[0]?"":'"'==r[0][0]?JSON.parse(r[0]):r[0]),(t+=r[0].length)==e.length)break;let a=e[t++];if(t==e.length&&"!"==a){i=0;break}if("/"!=a)throw RangeError("Invalid path: "+e);o=e.slice(t)}let a=n.length-1,s=n[a];if(!s)throw RangeError("Invalid path: "+e);let l=new ku(r,i,a>0?n.slice(0,a):null);t[s]=l.sort(t[s])}}return kl.add(t)}let kl=new CB;class ku{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function kc(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+" "+r:r;break}}return t},scope:r}}ku.empty=new ku([],2,null);class kd{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:o,from:a,to:s}=e;if(a>=n||s<=t)return;o.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(o)));let l=r,u=function(e){let t=e.type.prop(kl);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||ku.empty,c=function(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+" "+e:e)}return n}(i,u.tags);if(c&&(l&&(l+=" "),l+=c,1==u.mode&&(r+=(r?" ":"")+c)),this.startSpan(Math.max(t,a),l),u.opaque)return;let d=e.tree&&e.tree.prop(CB.mounted);if(d&&d.overlay){let o=e.node.enter(d.overlay[0].from+a,1),u=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),c=e.firstChild();for(let h=0,p=a;;h++){let f=h<d.overlay.length?d.overlay[h]:null,g=f?f.from+a:s,m=Math.max(t,p),v=Math.min(n,g);if(m<v&&c)for(;e.from<v&&(this.highlightRange(e,m,v,r,i),this.startSpan(Math.min(v,e.to),l),!(e.to>=g)&&e.nextSibling()););if(!f||g>n)break;(p=f.to+a)>t&&(this.highlightRange(o.cursor(),Math.max(t,f.from+a),Math.min(n,p),"",u),this.startSpan(Math.min(n,p),l))}c&&e.parent()}else if(e.firstChild()){d&&(r="");do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),l)}while(e.nextSibling());e.parent()}}}let kh=ki.define,kp=kh(),kf=kh(),kg=kh(kf),km=kh(kf),kv=kh(),ky=kh(kv),kb=kh(kv),kx=kh(),kw=kh(kx),kS=kh(),kC=kh(),kk=kh(),kM=kh(kk),kT=kh(),kA={comment:kp,lineComment:kh(kp),blockComment:kh(kp),docComment:kh(kp),name:kf,variableName:kh(kf),typeName:kg,tagName:kh(kg),propertyName:km,attributeName:kh(km),className:kh(kf),labelName:kh(kf),namespace:kh(kf),macroName:kh(kf),literal:kv,string:ky,docString:kh(ky),character:kh(ky),attributeValue:kh(ky),number:kb,integer:kh(kb),float:kh(kb),bool:kh(kv),regexp:kh(kv),escape:kh(kv),color:kh(kv),url:kh(kv),keyword:kS,self:kh(kS),null:kh(kS),atom:kh(kS),unit:kh(kS),modifier:kh(kS),operatorKeyword:kh(kS),controlKeyword:kh(kS),definitionKeyword:kh(kS),moduleKeyword:kh(kS),operator:kC,derefOperator:kh(kC),arithmeticOperator:kh(kC),logicOperator:kh(kC),bitwiseOperator:kh(kC),compareOperator:kh(kC),updateOperator:kh(kC),definitionOperator:kh(kC),typeOperator:kh(kC),controlOperator:kh(kC),punctuation:kk,separator:kh(kk),bracket:kM,angleBracket:kh(kM),squareBracket:kh(kM),paren:kh(kM),brace:kh(kM),content:kx,heading:kw,heading1:kh(kw),heading2:kh(kw),heading3:kh(kw),heading4:kh(kw),heading5:kh(kw),heading6:kh(kw),contentSeparator:kh(kx),list:kh(kx),quote:kh(kx),emphasis:kh(kx),strong:kh(kx),link:kh(kx),monospace:kh(kx),strikethrough:kh(kx),inserted:kh(),deleted:kh(),changed:kh(),invalid:kh(),meta:kT,documentMeta:kh(kT),annotation:kh(kT),processingInstruction:kh(kT),definition:ki.defineModifier("definition"),constant:ki.defineModifier("constant"),function:ki.defineModifier("function"),standard:ki.defineModifier("standard"),local:ki.defineModifier("local"),special:ki.defineModifier("special")};for(let e in kA){let t=kA[e];t instanceof ki&&(t.name=e)}kc([{tag:kA.link,class:"tok-link"},{tag:kA.heading,class:"tok-heading"},{tag:kA.emphasis,class:"tok-emphasis"},{tag:kA.strong,class:"tok-strong"},{tag:kA.keyword,class:"tok-keyword"},{tag:kA.atom,class:"tok-atom"},{tag:kA.bool,class:"tok-bool"},{tag:kA.url,class:"tok-url"},{tag:kA.labelName,class:"tok-labelName"},{tag:kA.inserted,class:"tok-inserted"},{tag:kA.deleted,class:"tok-deleted"},{tag:kA.literal,class:"tok-literal"},{tag:kA.string,class:"tok-string"},{tag:kA.number,class:"tok-number"},{tag:[kA.regexp,kA.escape,kA.special(kA.string)],class:"tok-string2"},{tag:kA.variableName,class:"tok-variableName"},{tag:kA.local(kA.variableName),class:"tok-variableName tok-local"},{tag:kA.definition(kA.variableName),class:"tok-variableName tok-definition"},{tag:kA.special(kA.variableName),class:"tok-variableName2"},{tag:kA.definition(kA.propertyName),class:"tok-propertyName tok-definition"},{tag:kA.typeName,class:"tok-typeName"},{tag:kA.namespace,class:"tok-namespace"},{tag:kA.className,class:"tok-className"},{tag:kA.macroName,class:"tok-macroName"},{tag:kA.propertyName,class:"tok-propertyName"},{tag:kA.operator,class:"tok-operator"},{tag:kA.comment,class:"tok-comment"},{tag:kA.meta,class:"tok-meta"},{tag:kA.invalid,class:"tok-invalid"},{tag:kA.punctuation,class:"tok-punctuation"}]);let kI=new CB,kP=new CB;class kR{constructor(e,t,n=[],r=""){this.data=e,this.name=r,yz.prototype.hasOwnProperty("tree")||Object.defineProperty(yz.prototype,"tree",{get(){return kD(this)}}),this.parser=t,this.extension=[k$.of(this),yz.languageData.of((e,t,n)=>{let r=kO(e,t,n),i=r.type.prop(kI);if(!i)return[];let o=e.facet(i),a=r.type.prop(kP);if(a){let i=r.resolve(t-r.from,n);for(let t of a)if(t.test(i,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(o)}}return o})].concat(n)}isActiveAt(e,t,n=-1){return kO(e,t,n).type.prop(kI)==this.data}findRegions(e){let t=e.facet(k$);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(kI)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(CB.mounted);if(i){if(i.tree.prop(kI)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof Cq&&r(i,e.positions[n]+t)}};return r(kD(e),0),n}get allowsNesting(){return!0}}function kO(e,t,n){let r=e.facet(k$),i=kD(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,N7.ExcludeBuffers))e.type.isTop&&(i=e);return i}kR.setState=yD.define();class kE extends kR{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){var t;let n=(t=e.languageData,ys.define({combine:t?e=>e.concat(t):void 0}));return new kE(n,e.parser.configure({props:[kI.add(e=>e.isTop?n:void 0)]}),e.name)}configure(e,t){return new kE(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function kD(e){let t=e.field(kR.state,!1);return t?t.tree:Cq.empty}class kL{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let k_=null;class kN{constructor(e,t,n=[],r,i,o,a,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=o,this.skipped=a,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new kN(e,t,[],Cq.empty,0,n,[],null)}startParse(){return this.parser.startParse(new kL(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=Cq.empty&&this.isDone(null!=t?t:this.state.doc.length))?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(ke.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=r,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(ke.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=k_;k_=this;try{return e()}finally{k_=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=kZ(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:i,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,r,i)=>t.push({fromA:e,toA:n,fromB:r,toB:i})),n=ke.applyChanges(n,t),r=Cq.empty,i=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length)for(let t of(a=[],this.skipped)){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);n<r&&a.push({from:n,to:r})}}return new kN(this.parser,t,n,r,i,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=kZ(this.fragments,n,r),this.skipped.splice(t--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends kt{createParse(t,n,r){let i=r[0].from,o=r[r.length-1].to;return{parsedPos:i,advance(){let t=k_;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new Cq(C$.none,[],[],o-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return k_}}function kZ(e,t,n){return ke.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class kj{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new kj(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=kN.create(e.facet(k$).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new kj(n)}}kR.state=yp.define({create:kj.init,update(e,t){for(let e of t.effects)if(e.is(kR.setState))return e.value;return t.startState.facet(k$)!=t.state.facet(k$)?kj.init(t.state):e.apply(t)}});let kB=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(kB=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let kF="undefined"!=typeof navigator&&(null===(Ze=navigator.scheduling)||void 0===Ze?void 0:Ze.isInputPending)?()=>navigator.scheduling.isInputPending():null,kz=xz.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(kR.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(kR.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=kB(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(kR.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!kF?Math.max(25,e.timeRemaining()-5):1e9),a=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>kF&&kF()||Date.now()>o,r+1e5*!a);this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:kR.setState.of(new kj(i.context))})),this.chunkBudget>0&&!(s&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>xZ(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),k$=ys.define({combine:e=>e.length?e[0]:null,enables:e=>[kR.state,kz,Su.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class kV{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}let kH=ys.define(),kW=ys.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function kq(e){let t=e.facet(kW);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function kG(e,t){let n="",r=e.tabSize,i=e.facet(kW)[0];if(" "==i){for(;t>=r;)n+=" ",t-=r;i=" "}for(let e=0;e<t;e++)n+=i;return n}function kU(e,t){for(let n of(e instanceof yz&&(e=new kK(e)),e.state.facet(kH))){let r=n(e,t);if(void 0!==r)return r}let n=kD(e.state);return n.length>=t?function(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&(t.from!=r.node.from||t.type!=r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return kX(r,e,n)}(e,n,t):null}class kK{constructor(e,t={}){this.state=e,this.options=t,this.unit=kq(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return null!=r&&r>=n.from&&r<=n.to?i&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(i+=o-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return y4(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let kY=new CB;function kX(e,t,n){for(let r=e;r;r=r.next){let e=function(e){let t=e.type.prop(kY);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(CB.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>(function(e,t,n,r,i){let o=e.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==e.pos+a,l=t?function(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),a=null==i||i<=o.from?o.to:Math.min(o.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=a)return null;let e=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}(e):null;return l?s?e.column(l.from):e.column(l.to):e.baseIndent+(s?0:+e.unit)})(e,!0,1,void 0,n&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?t.from:void 0)}return null==e.parent?kJ:null}(r.node);if(e)return e(kQ.create(t,n,r))}return 0}function kJ(){return 0}class kQ extends kK{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new kQ(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(function(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return kX(this.context.next,this.base,this.pos)}}function k0({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}let k1=ys.define(),k2=new CB;function k5(e,t,n){for(let r of e.facet(k1)){let i=r(e,t,n);if(i)return i}return function(e,t,n){let r=kD(e);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let a=i;a;a=a.next){let i=a.node;if(i.to<=n||i.from>n)continue;if(o&&i.from<t)break;let s=i.type.prop(k2);if(s&&(i.to<r.length-50||r.length==e.doc.length||!function(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(o=r)}}return o}(e,t,n)}function k3(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}let k4=yD.define({map:k3}),k6=yD.define({map:k3});function k8(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}let k9=yp.define({create:()=>b6.none,update(e,t){for(let n of(e=e.map(t.changes),t.effects))if(n.is(k4)&&!function(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(Mi),i=r?b6.replace({widget:new Ml(r(t.state,n.value))}):Ms;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(k6)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:r}=t.selection.main;e.between(r,r,(e,t)=>{e<r&&t>r&&(n=!0)}),n&&(e=e.update({filterFrom:r,filterTo:r,filter:(e,t)=>t<=r||e>=r}))}return e},provide:e=>Su.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid JSON for fold state");t.push(Ms.range(r,i))}return b6.set(t,!0)}});function k7(e,t,n){var r;let i=null;return null===(r=e.field(k9,!1))||void 0===r||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function Me(e,t){return e.field(k9,!1)?t:t.concat(yD.appendConfig.of(Mo()))}function Mt(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return Su.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}let Mn=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of k8(e)){let n=k5(e.state,t.from,t.to);if(n)return e.dispatch({effects:Me(e.state,[k4.of(n),Mt(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(k9,!1))return!1;let t=[];for(let n of k8(e)){let r=k7(e.state,n.from,n.to);r&&t.push(k6.of(r),Mt(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),o=k5(t,i.from,i.to);o&&n.push(k4.of(o)),r=(o?e.lineBlockAt(o.to):i).to+1}return n.length&&e.dispatch({effects:Me(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(k9,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(k6.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],Mr={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Mi=ys.define({combine:e=>y$(e,Mr)});function Mo(e){let t=[k9,Md];return e&&t.push(Mi.of(e)),t}function Ma(e,t){let{state:n}=e,r=n.facet(Mi),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=k7(e.state,n.from,n.to);r&&e.dispatch({effects:k6.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}let Ms=b6.replace({widget:new class extends b3{toDOM(e){return Ma(e,null)}}});class Ml extends b3{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Ma(e,this.value)}}let Mu={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Mc extends Cf{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}let Md=Su.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Mh{constructor(e,t){let n;function r(e){let t=be.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;let i="string"==typeof t.all?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof kR?e=>e.prop(kI)==o.data:o?e=>e==o:void 0,this.style=kc(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new be(n):null,this.themeType=t.themeType}static define(e,t){return new Mh(e,t||{})}}let Mp=ys.define(),Mf=ys.define({combine:e=>e.length?[e[0]]:null});function Mg(e){let t=e.facet(Mp);return t.length?t:e.facet(Mf)}function Mm(e,t){let n=[Mv],r;return e instanceof Mh&&(e.module&&n.push(Su.styleModule.of(e.module)),r=e.themeType),(null==t?void 0:t.fallback)?n.push(Mf.of(e)):r?n.push(Mp.computeN([Su.darkTheme],t=>t.facet(Su.darkTheme)==("dark"==r)?[e]:[])):n.push(Mp.of(e)),n}let Mv=ym.high(xz.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=kD(e.state),this.decorations=this.buildDeco(e,Mg(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=kD(e.state),n=Mg(e.state),r=n!=Mg(e.startState),{viewport:i}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&o>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return b6.none;let n=new yU;for(let{from:r,to:i}of e.visibleRanges)!function(e,t,n,r=0,i=e.length){let o=new kd(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=b6.mark({class:r})))},r,i);return n.finish()}},{decorations:e=>e.decorations})),My=Mh.define([{tag:kA.meta,color:"#404740"},{tag:kA.link,textDecoration:"underline"},{tag:kA.heading,textDecoration:"underline",fontWeight:"bold"},{tag:kA.emphasis,fontStyle:"italic"},{tag:kA.strong,fontWeight:"bold"},{tag:kA.strikethrough,textDecoration:"line-through"},{tag:kA.keyword,color:"#708"},{tag:[kA.atom,kA.bool,kA.url,kA.contentSeparator,kA.labelName],color:"#219"},{tag:[kA.literal,kA.inserted],color:"#164"},{tag:[kA.string,kA.deleted],color:"#a11"},{tag:[kA.regexp,kA.escape,kA.special(kA.string)],color:"#e40"},{tag:kA.definition(kA.variableName),color:"#00f"},{tag:kA.local(kA.variableName),color:"#30a"},{tag:[kA.typeName,kA.namespace],color:"#085"},{tag:kA.className,color:"#167"},{tag:[kA.special(kA.variableName),kA.macroName],color:"#256"},{tag:kA.definition(kA.propertyName),color:"#00c"},{tag:kA.comment,color:"#940"},{tag:kA.invalid,color:"#f00"}]),Mb=Su.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Mx="()[]{}",Mw=ys.define({combine:e=>y$(e,{afterCursor:!0,brackets:Mx,maxScanDistance:1e4,renderMatch:Mk})}),MS=b6.mark({class:"cm-matchingBracket"}),MC=b6.mark({class:"cm-nonmatchingBracket"});function Mk(e){let t=[],n=e.matched?MS:MC;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}let MM=[yp.define({create:()=>b6.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(Mw);for(let e of t.state.selection.ranges){if(!e.empty)continue;let i=MP(t.state,e.head,-1,r)||e.head>0&&MP(t.state,e.head-1,1,r)||r.afterCursor&&(MP(t.state,e.head,1,r)||e.head<t.state.doc.length&&MP(t.state,e.head+1,-1,r));i&&(n=n.concat(r.renderMatch(i,t.state)))}return b6.set(n,!0)},provide:e=>Su.decorations.from(e)}),Mb],MT=new CB;function MA(e,t,n){let r=e.prop(t<0?CB.openedBy:CB.closedBy);if(r)return r;if(1==e.name.length){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function MI(e){let t=e.type.prop(MT);return t?t(e.node):e}function MP(e,t,n,r={}){let i=r.maxScanDistance||1e4,o=r.brackets||Mx,a=kD(e),s=a.resolveInner(t,n);for(let e=s;e;e=e.parent){let r=MA(e.type,n,o);if(r&&e.from<e.to){let i=MI(e);if(i&&(n>0?t>=i.from&&t<i.to:t>i.from&&t<=i.to))return function(e,t,n,r,i,o,a){let s=r.parent,l={from:i.from,to:i.to},u=0,c=null==s?void 0:s.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do if(n<0?c.to<=r.from:c.from>=r.to){if(0==u&&o.indexOf(c.type.name)>-1&&c.from<c.to){let e=MI(c);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(MA(c.type,n,a))u++;else if(MA(c.type,-n,a)){if(0==u){let e=MI(c);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}u--}}while(n<0?c.prevSibling():c.nextSibling());return{start:l,matched:!1}}(0,0,n,e,i,r,o)}}return function(e,t,n,r,i,o,a){let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=a.indexOf(s);if(l<0||l%2==0!=n>0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!c.next().done&&e<=o;){let o=c.value;n<0&&(e+=o.length);let s=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=a.indexOf(o[e]);if(!(t<0)&&r.resolveInner(s+e,1).type==i){if(t%2==0==n>0)d++;else{if(1==d)return{start:u,end:{from:s+e,to:s+e+1},matched:t>>1==l>>1};d--}}}n>0&&(e+=o.length)}return c.done?{start:u,matched:!1}:null}(e,t,n,a,s.type,i,o)}let MR=Object.create(null),MO=[C$.none],ME=[],MD=Object.create(null),ML=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])ML[e]=function(e,t){let n=[];for(let r of t.split(" ")){let t=[];for(let n of r.split(".")){let r=e[n]||kA[n];r?"function"==typeof r?t.length?t=t.map(r):M_(n,`Modifier ${n} used at start of tag`):t.length?M_(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:M_(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(e=>e.id),o=MD[i];if(o)return o.id;let a=MD[i]=C$.define({id:MO.length,name:r,props:[ks({[r]:n})]});return MO.push(a),a.id}(MR,t);function M_(e,t){ME.indexOf(e)>-1||(ME.push(e),console.warn(t))}function MN(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return!!i&&(r(n.update(i)),!0)}}xl.RTL,xl.LTR;let MZ=MN(function(e,t,n=t.selection.ranges){let r=[],i=-1;for(let{from:e,to:o}of n){let n=r.length,a=1e9,s=MF(t,e).line;if(s){for(let n=e;n<=o;){let l=t.doc.lineAt(n);if(l.from>i&&(e==o||o>l.from)){i=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,n=l.text.slice(e,e+s.length)==s?e:-1;e<l.text.length&&e<a&&(a=e),r.push({line:l,comment:n,token:s,indent:e,empty:t,single:!1})}n=l.to+1}if(a<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=a);r.length==n+1&&(r[n].single=!0)}}if(2!=e&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:o,single:a}of r)(a||!o)&&e.push({from:t.from+i,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,o=r+i.length;" "==t.text[o-t.from]&&o++,e.push({from:r,to:o})}return{changes:e}}return null},0),Mj=MN(Mz,0),MB=MN((e,t)=>Mz(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}(t)),0);function MF(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function Mz(e,t,n=t.selection.ranges){let r=n.map(e=>MF(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>(function(e,{open:t,close:n},r,i){let o,a,s=e.sliceDoc(r-50,r),l=e.sliceDoc(i,i+50),u=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(l)[0].length,d=s.length-u;if(s.slice(d-t.length,d)==t&&l.slice(c,c+n.length)==n)return{open:{pos:r-u,margin:u&&1},close:{pos:i+c,margin:c&&1}};i-r<=100?o=a=e.sliceDoc(r,i):(o=e.sliceDoc(r,r+50),a=e.sliceDoc(i-50,i));let h=/^\s*/.exec(o)[0].length,p=/\s*$/.exec(a)[0].length,f=a.length-p-n.length;return o.slice(h,h+t.length)==t&&a.slice(f,f+n.length)==n?{open:{pos:r+h+t.length,margin:+!!/\s/.test(o.charAt(h+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(a.charAt(f-1))}}:null})(t,r[n],e.from,e.to));if(2!=e&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]))};if(1!=e&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:o,close:a}=n;e.push({from:o.pos-i.open.length,to:o.pos+o.margin},{from:a.pos-a.margin,to:a.pos+i.close.length})}return{changes:e}}return null}let M$=yR.define(),MV=yR.define(),MH=ys.define(),MW=ys.define({combine:e=>y$(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}),Mq=yp.define({create:()=>M4.empty,update(e,t){let n=t.state.facet(MW),r=t.annotation(M$);if(r){let i=MJ.fromTransaction(t,r.selection),o=r.side,a=0==o?e.undone:e.done;return a=i?MQ(a,a.length,n.minDepth,i):M2(a,t.startState.selection),new M4(0==o?r.rest:a,0==o?a:r.rest)}let i=t.annotation(MV);if(("full"==i||"before"==i)&&(e=e.isolate()),!1===t.annotation(yL.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=MJ.fromTransaction(t),a=t.annotation(yL.time),s=t.annotation(yL.userEvent);return o?e=e.addChanges(o,a,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,s,n.newGroupDelay)),("full"==i||"after"==i)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new M4(e.done.map(MJ.fromJSON),e.undone.map(MJ.fromJSON))});function MG(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(Mq,!1);if(!i)return!1;let o=i.pop(e,n,t);return!!o&&(r(o),!0)}}let MU=MG(0,!1),MK=MG(1,!1),MY=MG(0,!0),MX=MG(1,!0);class MJ{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new MJ(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new MJ(e.changes&&v6.fromJSON(e.changes),[],e.mapped&&v4.fromJSON(e.mapped),e.startSelection&&yi.fromJSON(e.startSelection),e.selectionsAfter.map(yi.fromJSON))}static fromTransaction(e,t){let n=M1;for(let t of e.startState.facet(MH)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new MJ(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,M1)}static selection(e){return new MJ(void 0,M1,void 0,void 0,e)}}function MQ(e,t,n,r){let i=e.slice(t+1>n+20?t-n-1:0,t);return i.push(r),i}function M0(e,t){return e.length?t.length?e.concat(t):e:t}let M1=[];function M2(e,t){if(!e.length)return[MJ.selection([t])];{let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),MQ(e,e.length-1,1e9,n.setSelAfter(r)))}}function M5(e,t){if(!e.length)return e;let n=e.length,r=M1;for(;n;){let i=function(e,t,n){let r=M0(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):M1,n);if(!e.changes)return MJ.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(o):o;return new MJ(i,yD.mapEffects(e.effects,t),a,e.startSelection.map(o),r)}(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[MJ.selection(r)]:M1}let M3=/^(input\.type|delete)($|\.)/;class M4{constructor(e,t,n=0,r){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new M4(this.done,this.undone):this}addChanges(e,t,n,r,i){var o,a;let s,l,u=this.done,c=u[u.length-1];return new M4(u=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||M3.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,(o=c.changes,a=e.changes,s=[],l=!1,o.iterChangedRanges((e,t)=>s.push(e,t)),a.iterChangedRanges((e,t,n,r)=>{for(let e=0;e<s.length;){let t=s[e++],i=s[e++];r>=t&&n<=i&&(l=!0)}}),l))||"input.type.compose"==n)?MQ(u,u.length-1,r.minDepth,new MJ(e.changes.compose(c.changes),M0(yD.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,M1)):MQ(u,u.length,r.minDepth,e),M1,t,n)}addSelection(e,t,n,r){var i;let o=this.done.length?this.done[this.done.length-1].selectionsAfter:M1;return o.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=o[o.length-1]).ranges.length==e.ranges.length&&0===i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length?this:new M4(M2(this.done,e),this.undone,t,n)}addMapping(e){return new M4(M5(this.done,e),M5(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let i=r[r.length-1],o=i.selectionsAfter[0]||t.selection;if(n&&i.selectionsAfter.length){let n,a;return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:M$.of({side:e,rest:(n=r[r.length-1],(a=r.slice())[r.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),a),selection:o}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}if(!i.changes)return null;{let n=1==r.length?M1:r.slice(0,r.length-1);return i.mapped&&(n=M5(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:M$.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}M4.empty=new M4(M1,M1);let M6=[{key:"Mod-z",run:MU,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:MK,preventDefault:!0},{linux:"Ctrl-Shift-z",run:MK,preventDefault:!0},{key:"Mod-u",run:MY,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:MX,preventDefault:!0}];function M8(e,t){return yi.create(e.ranges.map(t),e.mainIndex)}function M9(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function M7({state:e,dispatch:t},n){let r=M8(e.selection,n);return!r.eq(e.selection,!0)&&(t(M9(e,r)),!0)}function Te(e,t){return yi.cursor(t?e.to:e.from)}function Tt(e,t){return M7(e,n=>n.empty?e.moveByChar(n,t):Te(n,t))}function Tn(e){return e.textDirectionAt(e.state.selection.main.head)==xl.LTR}let Tr=e=>Tt(e,!Tn(e)),Ti=e=>Tt(e,Tn(e));function To(e,t){return M7(e,n=>n.empty?e.moveByGroup(n,t):Te(n,t))}function Ta(e,t,n){let r,i,o=kD(e).resolveInner(t.head),a=n?CB.closedBy:CB.openedBy;for(let r=t.head;;){let t=n?o.childAfter(r):o.childBefore(r);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,a)?r=n?t.to:t.from:o=t}return i=o.type.prop(a)&&(r=n?MP(e,o.from,1):MP(e,o.to,-1))&&r.matched?n?r.end.to:r.end.from:n?o.to:o.from,yi.cursor(i,n?-1:1)}function Ts(e,t){return M7(e,n=>{if(!n.empty)return Te(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}"undefined"!=typeof Intl&&Intl.Segmenter;let Tl=e=>Ts(e,!1),Tu=e=>Ts(e,!0);function Tc(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(Su.scrollMargins)){let i=t(e);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(r=Math.max(null==i?void 0:i.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function Td(e,t){let n,r=Tc(e),{state:i}=e,o=M8(i.selection,n=>n.empty?e.moveVertically(n,t,r.height):Te(n,t));if(o.eq(i.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(i.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),s=a.top+r.marginTop,l=a.bottom-r.marginBottom;t&&t.top>s&&t.bottom<l&&(n=Su.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-s}))}return e.dispatch(M9(i,o),{effects:n}),!0}let Th=e=>Td(e,!1),Tp=e=>Td(e,!0);function Tf(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=yi.cursor(r.from+n))}return i}function Tg(e,t){let n=M8(e.state.selection,e=>{let n=t(e);return yi.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(M9(e.state,n)),!0)}function Tm(e,t){return Tg(e,n=>e.moveByChar(n,t))}let Tv=e=>Tm(e,!Tn(e)),Ty=e=>Tm(e,Tn(e));function Tb(e,t){return Tg(e,n=>e.moveByGroup(n,t))}function Tx(e,t){return Tg(e,n=>e.moveVertically(n,t))}let Tw=e=>Tx(e,!1),TS=e=>Tx(e,!0);function TC(e,t){return Tg(e,n=>e.moveVertically(n,t,Tc(e).height))}let Tk=e=>TC(e,!1),TM=e=>TC(e,!0),TT=({state:e,dispatch:t})=>(t(M9(e,{anchor:0})),!0),TA=({state:e,dispatch:t})=>(t(M9(e,{anchor:e.doc.length})),!0),TI=({state:e,dispatch:t})=>(t(M9(e,{anchor:e.selection.main.anchor,head:0})),!0),TP=({state:e,dispatch:t})=>(t(M9(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function TR(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:o}=r;if(i==o){let a=t(r);a<i?(n="delete.backward",a=TO(e,a,!1)):a>i&&(n="delete.forward",a=TO(e,a,!0)),i=Math.min(i,a),o=Math.max(o,a)}else i=TO(e,i,!1),o=TO(e,o,!0);return i==o?{range:r}:{changes:{from:i,to:o},range:yi.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?Su.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function TO(e,t,n){if(e instanceof Su)for(let r of e.state.facet(Su.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}let TE=(e,t,n)=>TR(e,r=>{let i=r.from,{state:o}=e,a=o.doc.lineAt(i),s,l;if(n&&!t&&i>a.from&&i<a.from+200&&!/[^ \t]/.test(s=a.text.slice(0,i-a.from))){if(" "==s[s.length-1])return i-1;let e=y4(s,o.tabSize)%kq(o)||kq(o);for(let t=0;t<e&&" "==s[s.length-1-t];t++)i--;l=i}else(l=vQ(a.text,i-a.from,t,t)+a.from)==i&&a.number!=(t?o.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(a.text.slice(l-a.from,i-a.from))&&(l=vQ(a.text,l-a.from,!1,!1)+a.from);return l}),TD=e=>TE(e,!1,!0),TL=e=>TE(e,!0,!1),T_=(e,t)=>TR(e,n=>{let r=n.head,{state:i}=e,o=i.doc.lineAt(r),a=i.charCategorizer(r);for(let e=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=vQ(o.text,r-o.from,t)+o.from,l=o.text.slice(Math.min(r,s)-o.from,Math.max(r,s)-o.from),u=a(l);if(null!=e&&u!=e)break;(" "!=l||r!=n.head)&&(e=u),r=s}return r}),TN=e=>T_(e,!1);function TZ(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(r.empty||r.to!=o.from||(o=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function Tj(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of TZ(e)){if(n?t.to==e.doc.length:0==t.from)continue;let o=e.doc.lineAt(n?t.to+1:t.from-1),a=o.length+1;if(n)for(let n of(r.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak}),t.ranges))i.push(yi.range(Math.min(e.doc.length,n.anchor+a),Math.min(e.doc.length,n.head+a)));else for(let n of(r.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text}),t.ranges))i.push(yi.range(n.anchor-a,n.head-a))}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:yi.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0)}function TB(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of TZ(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}let TF=T$(!1),Tz=T$(!0);function T$(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,o=t.doc.lineAt(r),a=!e&&r==i&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=kD(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(CB.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,r);e&&(r=i=(i<=o.to?o:t.doc.lineAt(i)).to);let s=new kK(t,{simulateBreak:r,simulateDoubleBreak:!!a}),l=kU(s,r);for(null==l&&(l=y4(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;a?{from:r,to:i}=a:r>o.from&&r<o.from+100&&!/\S/.test(o.text.slice(0,r))&&(r=o.from);let u=["",kG(t,l)];return a&&u.push(kG(t,s.lineIndent(o.from,-1))),{changes:{from:r,to:i,insert:vH.of(u)},range:yi.cursor(r+1+u[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function TV(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let a=e.doc.lineAt(o);a.number>n&&(r.empty||r.to>a.from)&&(t(a,i,r),n=a.number),o=a.to+1}let o=e.changes(i);return{changes:i,range:yi.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}let TH=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(TV(e,(t,n)=>{n.push({from:t.from,insert:e.facet(kW)})}),{userEvent:"input.indent"})),!0),TW=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(TV(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=y4(r,e.tabSize),o=0,a=kG(e,Math.max(0,i-kq(e)));for(;o<r.length&&o<a.length&&r.charCodeAt(o)==a.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+r.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),Tq=[{key:"Ctrl-b",run:Tr,shift:Tv,preventDefault:!0},{key:"Ctrl-f",run:Ti,shift:Ty},{key:"Ctrl-p",run:Tl,shift:Tw},{key:"Ctrl-n",run:Tu,shift:TS},{key:"Ctrl-a",run:e=>M7(e,t=>yi.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>Tg(e,t=>yi.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>M7(e,t=>yi.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>Tg(e,t=>yi.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:TL},{key:"Ctrl-h",run:TD},{key:"Ctrl-k",run:e=>TR(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:TN},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:vH.of(["",""])},range:yi.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:vQ(r.text,n-r.from,!1)+r.from,o=n==r.to?n+1:vQ(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(i,n))},range:yi.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Tp}],TG=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>M7(e,t=>Ta(e.state,t,!Tn(e))),shift:e=>Tg(e,t=>Ta(e.state,t,!Tn(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>M7(e,t=>Ta(e.state,t,Tn(e))),shift:e=>Tg(e,t=>Ta(e.state,t,Tn(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>Tj(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>TB(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>Tj(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>TB(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=yi.create([n.main]):n.main.empty||(r=yi.create([yi.cursor(n.main.head)])),!!r&&(t(M9(e,r)),!0)}},{key:"Mod-Enter",run:Tz},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=TZ(e).map(({from:t,to:n})=>yi.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:yi.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=M8(e.selection,t=>{let n=kD(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return yi.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(M9(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:TW},{key:"Mod-]",run:TH},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new kK(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),i=TV(e,(t,i,o)=>{let a=kU(r,t.from);if(null==a)return;/\S/.test(t.text)||(a=0);let s=/^\s*/.exec(t.text)[0],l=kG(e,a);(s!=l||o.from<t.from+s.length)&&(n[t.from]=a,i.push({from:t.from,to:t.from+s.length,insert:l}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(TZ(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=M8(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,r;return n=!1,r=M8(e.selection,t=>{let r=MP(e,t.head,-1)||MP(e,t.head,1)||t.head>0&&MP(e,t.head-1,1)||t.head<e.doc.length&&MP(e,t.head+1,-1);if(!r||!r.end)return t;n=!0;let i=r.start.from==t.head?r.end.to:r.end.from;return yi.cursor(i)}),!!n&&(t(M9(e,r)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=MF(e.state,n.from);return r.line?MZ(e):!!r.block&&MB(e)}},{key:"Alt-A",run:Mj},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:Tr,shift:Tv,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>To(e,!Tn(e)),shift:e=>Tb(e,!Tn(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>M7(e,t=>Tf(e,t,!Tn(e))),shift:e=>Tg(e,t=>Tf(e,t,!Tn(e))),preventDefault:!0},{key:"ArrowRight",run:Ti,shift:Ty,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>To(e,Tn(e)),shift:e=>Tb(e,Tn(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>M7(e,t=>Tf(e,t,Tn(e))),shift:e=>Tg(e,t=>Tf(e,t,Tn(e))),preventDefault:!0},{key:"ArrowUp",run:Tl,shift:Tw,preventDefault:!0},{mac:"Cmd-ArrowUp",run:TT,shift:TI},{mac:"Ctrl-ArrowUp",run:Th,shift:Tk},{key:"ArrowDown",run:Tu,shift:TS,preventDefault:!0},{mac:"Cmd-ArrowDown",run:TA,shift:TP},{mac:"Ctrl-ArrowDown",run:Tp,shift:TM},{key:"PageUp",run:Th,shift:Tk},{key:"PageDown",run:Tp,shift:TM},{key:"Home",run:e=>M7(e,t=>Tf(e,t,!1)),shift:e=>Tg(e,t=>Tf(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:TT,shift:TI},{key:"End",run:e=>M7(e,t=>Tf(e,t,!0)),shift:e=>Tg(e,t=>Tf(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:TA,shift:TP},{key:"Enter",run:TF,shift:TF},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:TD,shift:TD},{key:"Delete",run:TL},{key:"Mod-Backspace",mac:"Alt-Backspace",run:TN},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>T_(e,!0)},{mac:"Mod-Backspace",run:e=>TR(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)})},{mac:"Mod-Delete",run:e=>TR(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})}].concat(Tq.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),TU={key:"Tab",run:TH,shift:TW};function TK(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];"string"==typeof i?e.setAttribute(r,i):null!=i&&(e[r]=i)}t++}for(;t<arguments.length;t++)!function e(t,n){if("string"==typeof n)t.appendChild(document.createTextNode(n));else if(null==n);else if(null!=n.nodeType)t.appendChild(n);else if(Array.isArray(n))for(var r=0;r<n.length;r++)e(t,n[r]);else throw RangeError("Unsupported child node: "+n)}(e,arguments[t]);return e}let TY="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class TX{constructor(e,t,n=0,r=e.length,i,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(TY(e)):TY,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return -1;this.bufferPos=0,this.buffer=this.iter.value}return v0(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=v1(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=v2(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let o=r.charCodeAt(e),a=this.match(o,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(a)return this.value=a,this;break}i==n&&e<t.length&&t.charCodeAt(e)==o&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],o=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,o=!0)),o||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}"undefined"!=typeof Symbol&&(TX.prototype[Symbol.iterator]=function(){return this});let TJ={from:-1,to:-1,match:/.*/.exec("")},TQ="gm"+(null==/x/.unicode?"":"u");class T0{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=TJ,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new T5(e,t,n,r,i);this.re=new RegExp(t,TQ+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=T3(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=T3(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}let T1=new WeakMap;class T2{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=T1.get(e);if(!r||r.from>=n||r.to<=t){let r=new T2(t,e.sliceString(t,n));return T1.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:i,from:o}=r;return o>t&&(i=e.sliceString(t,o)+i,o=t),r.to<n&&(i+=e.sliceString(r.to,n)),T1.set(e,new T2(o,i)),new T2(t,i.slice(t-o,n-o))}}class T5{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=TJ,this.matchPos=T3(e,r),this.re=new RegExp(t,TQ+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=T2.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=T3(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=T2.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function T3(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function T4(e){let t=TK("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,i=r.doc.lineAt(r.selection.main.head),[,o,a,s,l]=n,u=s?+s.slice(1):0,c=a?+a:i.number;if(a&&l){let e=c/100;o&&(e=e*("-"==o?-1:1)+i.number/r.doc.lines),c=Math.round(r.doc.lines*e)}else a&&o&&(c=c*("-"==o?-1:1)+i.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,c))),h=yi.cursor(d.from+Math.max(0,Math.min(u,d.length)));e.dispatch({effects:[T6.of(!1),Su.scrollIntoView(h.from,{y:"center"})],selection:h}),e.focus()}return{dom:TK("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:T6.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},TK("label",e.state.phrase("Go to line"),": ",t)," ",TK("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),TK("button",{name:"close",onclick:()=>{e.dispatch({effects:T6.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["\xd7"]))}}"undefined"!=typeof Symbol&&(T0.prototype[Symbol.iterator]=T5.prototype[Symbol.iterator]=function(){return this});let T6=yD.define(),T8=yp.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(T6)&&(e=n.value);return e},provide:e=>Cp.from(e,e=>e?T4:null)}),T9=Su.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),T7={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ae=ys.define({combine:e=>y$(e,T7,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),At=b6.mark({class:"cm-selectionMatch"}),An=b6.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Ar(e,t,n,r){return(0==n||e(t.sliceDoc(n-1,n))!=yB.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=yB.Word)}let Ai=xz.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Ae),{state:n}=e,r=n.selection;if(r.ranges.length>1)return b6.none;let i=r.main,o,a=null;if(i.empty){if(!t.highlightWordAroundCursor)return b6.none;let e=n.wordAt(i.head);if(!e)return b6.none;a=n.charCategorizer(i.head),o=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return b6.none;if(t.wholeWords){var s,l,u;if(o=n.sliceDoc(i.from,i.to),!(Ar(a=n.charCategorizer(i.head),n,i.from,i.to)&&(s=a,l=i.from,u=i.to,s(n.sliceDoc(l,l+1))==yB.Word&&s(n.sliceDoc(u-1,u))==yB.Word)))return b6.none}else if(!(o=n.sliceDoc(i.from,i.to)))return b6.none}let c=[];for(let r of e.visibleRanges){let e=new TX(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!a||Ar(a,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?c.push(An.range(r,o)):(r>=i.to||o<=i.from)&&c.push(At.range(r,o)),c.length>t.maxMatches))return b6.none}}return b6.set(c)}},{decorations:e=>e.decorations}),Ao=Su.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Aa=({state:e,dispatch:t})=>{let{selection:n}=e,r=yi.create(n.ranges.map(t=>e.wordAt(t.head)||yi.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)},As=ys.define({combine:e=>y$(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new AN(e),scrollToMatch:e=>Su.scrollIntoView(e)})});class Al{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,TQ),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Ag(this):new Ad(this)}getCursor(e,t=0,n){let r=e.doc?e:yz.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?Ah(this,r,t,n):Ac(this,r,t,n)}}class Au{constructor(e){this.spec=e}}function Ac(e,t,n,r){var i,o;return new TX(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(i=t.doc,o=t.charCategorizer(t.selection.main.head),(e,t,n,r)=>((r>e||r+n.length<t)&&(r=Math.max(0,e-2),n=i.sliceString(r,Math.min(i.length,t+2))),(o(Ap(n,e-r))!=yB.Word||o(Af(n,e-r))!=yB.Word)&&(o(Af(n,t-r))!=yB.Word||o(Ap(n,t-r))!=yB.Word))):void 0)}class Ad extends Au{constructor(e){super(e)}nextMatch(e,t,n){let r=Ac(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Ac(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=Ac(this.spec,e,n,r),o=null;for(;!i.nextOverlapping().done;)o=i.value;if(o)return o;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Ac(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=Ac(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}function Ah(e,t,n,r){var i;return new T0(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(i=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(i(Ap(n.input,n.index))!=yB.Word||i(Af(n.input,n.index))!=yB.Word)&&(i(Af(n.input,n.index+n[0].length))!=yB.Word||i(Ap(n.input,n.index+n[0].length))!=yB.Word)):void 0},n,r)}function Ap(e,t){return e.slice(vQ(e,t,!1),t)}function Af(e,t){return e.slice(t,vQ(e,t))}class Ag extends Au{nextMatch(e,t,n){let r=Ah(this.spec,e,n,e.doc.length).next();return r.done&&(r=Ah(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-1e4*r),o=Ah(this.spec,e,i,n),a=null;for(;!o.next().done;)a=o.value;if(a&&(i==t||a.from>i+10))return a;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=Ah(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=Ah(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}let Am=yD.define(),Av=yD.define(),Ay=yp.define({create:e=>new Ab(AR(e).create(),null),update(e,t){for(let n of t.effects)n.is(Am)?e=new Ab(n.value.create(),e.panel):n.is(Av)&&(e=new Ab(e.query,n.value?AP:null));return e},provide:e=>Cp.from(e,e=>e.panel)});class Ab{constructor(e,t){this.query=e,this.panel=t}}let Ax=b6.mark({class:"cm-searchMatch"}),Aw=b6.mark({class:"cm-searchMatch cm-searchMatch-selected"}),AS=xz.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Ay))}update(e){let t=e.state.field(Ay);(t!=e.startState.field(Ay)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return b6.none;let{view:n}=this,r=new yU;for(let t=0,i=n.visibleRanges,o=i.length;t<o;t++){let{from:a,to:s}=i[t];for(;t<o-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,a,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Aw:Ax)})}return r.finish()}},{decorations:e=>e.decorations});function AC(e){return t=>{let n=t.state.field(Ay,!1);return n&&n.query.spec.valid?e(t,n):AD(t)}}let Ak=AC((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=yi.single(r.from,r.to),o=e.state.facet(As);return e.dispatch({selection:i,effects:[AB(e,r),o.scrollToMatch(i.main,e)],userEvent:"select.search"}),AE(e),!0}),AM=AC((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let o=yi.single(i.from,i.to),a=e.state.facet(As);return e.dispatch({selection:o,effects:[AB(e,i),a.scrollToMatch(o.main,e)],userEvent:"select.search"}),AE(e),!0}),AT=AC((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:yi.create(n.map(e=>yi.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),AA=AC((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,r,r);if(!o)return!1;let a=o,s=[],l,u,c=[];if(a.from==r&&a.to==i&&(u=n.toText(t.getReplacement(a)),s.push({from:a.from,to:a.to,insert:u}),a=t.nextMatch(n,a.from,a.to),c.push(Su.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),a){let t=0==s.length||s[0].from>=o.to?0:o.to-o.from-u.length;l=yi.single(a.from-t,a.to-t),c.push(AB(e,a)),c.push(n.facet(As).scrollToMatch(l.main,e))}return e.dispatch({changes:s,selection:l,effects:c,userEvent:"input.replace"}),!0}),AI=AC((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Su.announce.of(r),userEvent:"input.replace.all"}),!0});function AP(e){return e.state.facet(As).createPanel(e)}function AR(e,t){var n,r,i,o,a;let s=e.selection.main,l=s.empty||s.to>s.from+100?"":e.sliceDoc(s.from,s.to);if(t&&!l)return t;let u=e.facet(As);return new Al({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(r=null==t?void 0:t.caseSensitive)&&void 0!==r?r:u.caseSensitive,literal:null!==(i=null==t?void 0:t.literal)&&void 0!==i?i:u.literal,regexp:null!==(o=null==t?void 0:t.regexp)&&void 0!==o?o:u.regexp,wholeWord:null!==(a=null==t?void 0:t.wholeWord)&&void 0!==a?a:u.wholeWord})}function AO(e){let t=Cu(e,AP);return t&&t.dom.querySelector("[main-field]")}function AE(e){let t=AO(e);t&&t==e.root.activeElement&&t.select()}let AD=e=>{let t=e.state.field(Ay,!1);if(t&&t.panel){let n=AO(e);if(n&&n!=e.root.activeElement){let r=AR(e.state,t.query.spec);r.valid&&e.dispatch({effects:Am.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Av.of(!0),t?Am.of(AR(e.state,t.query.spec)):yD.appendConfig.of(Az)]});return!0},AL=e=>{let t=e.state.field(Ay,!1);if(!t||!t.panel)return!1;let n=Cu(e,AP);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Av.of(!1)}),!0},A_=[{key:"Mod-f",run:AD,scope:"editor search-panel"},{key:"F3",run:Ak,shift:AM,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Ak,shift:AM,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:AL,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],a=0;for(let t=new TX(e.doc,e.sliceDoc(r,i));!t.next().done;){if(o.length>1e3)return!1;t.value.from==r&&(a=o.length),o.push(yi.range(t.value.from,t.value.to))}return t(e.update({selection:yi.create(o,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=Cu(e,T4);if(!t){let n=[T6.of(!0)];null==e.state.field(T8,!1)&&n.push(yD.appendConfig.of([T8,T9])),e.dispatch({effects:n}),t=Cu(e,T4)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Aa({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=function(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new TX(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new TX(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(o){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}(e,r);return!!i&&(t(e.update({selection:e.selection.addRange(yi.range(i.from,i.to),!1),effects:Su.scrollIntoView(i.to)})),!0)},preventDefault:!0}];class AN{constructor(e){this.view=e;let t=this.query=e.state.field(Ay).query.spec;function n(e,t,n){return TK("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=TK("input",{value:t.search,placeholder:AZ(e,"Find"),"aria-label":AZ(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=TK("input",{value:t.replace,placeholder:AZ(e,"Replace"),"aria-label":AZ(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=TK("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=TK("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=TK("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=TK("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>Ak(e),[AZ(e,"next")]),n("prev",()=>AM(e),[AZ(e,"previous")]),n("select",()=>AT(e),[AZ(e,"all")]),TK("label",null,[this.caseField,AZ(e,"match case")]),TK("label",null,[this.reField,AZ(e,"regexp")]),TK("label",null,[this.wordField,AZ(e,"by word")]),...e.state.readOnly?[]:[TK("br"),this.replaceField,n("replace",()=>AA(e),[AZ(e,"replace")]),n("replaceAll",()=>AI(e),[AZ(e,"replace all")])],TK("button",{name:"close",onclick:()=>AL(e),"aria-label":AZ(e,"close"),type:"button"},["\xd7"])])}commit(){let e=new Al({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Am.of(e)}))}keydown(e){var t,n;(t=this.view,n="search-panel",SS(Sb(t.state),e,t,n))?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?AM:Ak)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),AA(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Am)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(As).top}}function AZ(e,t){return e.state.phrase(t)}let Aj=/[\s\.,:;?!]/;function AB(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,o=Math.max(r.from,t-30),a=Math.min(i,n+30),s=e.state.sliceDoc(o,a);if(o!=r.from){for(let e=0;e<30;e++)if(!Aj.test(s[e+1])&&Aj.test(s[e])){s=s.slice(e);break}}if(a!=i){for(let e=s.length-1;e>s.length-30;e--)if(!Aj.test(s[e-1])&&Aj.test(s[e])){s=s.slice(0,e);break}}return Su.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`)}let AF=Su.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Az=[Ay,ym.low(AS),AF];class A${constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=kD(this.state).resolveInner(this.pos,-1);for(;t&&0>e.indexOf(t.name);)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(Aq(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function AV(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}class AH{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function AW(e){return e.selection.main.from}function Aq(e,t){var n;let{source:r}=e,i=t&&"^"!=r[0],o="$"!=r[r.length-1];return i||o?RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}let AG=yR.define(),AU=new WeakMap;function AK(e){if(!Array.isArray(e))return e;let t=AU.get(e);return t||AU.set(e,t=function(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=AV(t)+AV(n)+"*$";return[RegExp("^"+r),new RegExp(r)]}(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}(e)),t}let AY=yD.define(),AX=yD.define();class AJ{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=v0(e,t),r=v2(n);this.chars.push(n);let i=e.slice(t,t+r),o=i.toUpperCase();this.folded.push(v0(o==i?i.toLowerCase():o,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:o}=this;if(1==t.length){let r=v0(e,0),i=v2(r),o=i==e.length?0:-100;if(r==t[0]);else{if(r!=n[0])return null;o+=-200}return this.ret(o,[0,i])}let a=e.indexOf(this.pattern);if(0==a)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,l=0;if(a<0){for(let i=0,o=Math.min(e.length,200);i<o&&l<s;){let o=v0(e,i);(o==t[l]||o==n[l])&&(r[l++]=i),i+=v2(o)}if(l<s)return null}let u=0,c=0,d=!1,h=0,p=-1,f=-1,g=/[a-z]/.test(e),m=!0;for(let r=0,l=Math.min(e.length,200),v=0;r<l&&c<s;){let l=v0(e,r);a<0&&(u<s&&l==t[u]&&(i[u++]=r),h<s&&(l==t[h]||l==n[h]?(0==h&&(p=r),f=r+1,h++):h=0));let y,b=l<255?l>=48&&l<=57||l>=97&&l<=122?2:+(l>=65&&l<=90):(y=v1(l))!=y.toLowerCase()?1:2*(y!=y.toUpperCase());(!r||1==b&&g||0==v&&0!=b)&&(t[c]==l||n[c]==l&&(d=!0)?o[c++]=r:o.length&&(m=!1)),v=b,r+=v2(l)}return c==s&&0==o[0]&&m?this.result(-100+(d?-200:0),o,e):h==s&&0==p?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):h==s?this.ret(-900-e.length,[p,f]):c==s?this.result(-100+(d?-200:0)+-700+(m?0:-1100),o,e):2==t.length?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?v2(v0(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}}class AQ{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}let A0=ys.define({combine:e=>y$(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:A2,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>A1(e(n),t(n)),optionClass:(e,t)=>n=>A1(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function A1(e,t){return e?t?e+" "+t:e:t}function A2(e,t,n,r,i,o){let a=e.textDirection==xl.RTL,s=a,l=!1,u="top",c,d,h=t.left-i.left,p=i.right-t.right,f=r.right-r.left,g=r.bottom-r.top;if(s&&h<Math.min(f,p)?s=!1:!s&&p<Math.min(f,h)&&(s=!0),f<=(s?h:p))c=Math.max(i.top,Math.min(n.top,i.bottom-g))-t.top,d=Math.min(400,s?h:p);else{l=!0,d=Math.min(400,(a?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=g||e>t.top?c=n.bottom-t.top:(u="bottom",c=t.bottom-n.top)}let m=(t.bottom-t.top)/o.offsetHeight,v=(t.right-t.left)/o.offsetWidth;return{style:`${u}: ${c/m}px; max-width: ${d/v}px`,class:"cm-completionInfo-"+(l?a?"left-narrow":"right-narrow":s?"left":"right")}}function A5(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class A3{constructor(e,t,n){let r;this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:o,selected:a}=i.open,s=e.state.facet(A0);this.optionContent=(r=s.addToOptions.slice(),s.icons&&r.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),r.push({render(e,t,n,r){let i=document.createElement("span");i.className="cm-completionLabel";let o=e.displayLabel||e.label,a=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>a&&i.appendChild(document.createTextNode(o.slice(a,t)));let s=i.appendChild(document.createElement("span"));s.appendChild(document.createTextNode(o.slice(t,n))),s.className="cm-completionMatchedText",a=n}return a<o.length&&i.appendChild(document.createTextNode(o.slice(a))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),r.sort((e,t)=>e.position-t.position).map(e=>e.render)),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=A5(o.length,a,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(A0).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:AX.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:i,selected:o,disabled:a}=n.open;r.open&&r.open.options==i||(this.range=A5(i.length,o,e.state.facet(A0).maxRenderedOptions),this.showOptions(i,n.id)),this.updateSel(),a!=(null===(t=r.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=A5(t.options.length,t.selected,this.view.state.facet(A0).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:r}=n;if(!r)return;let i="string"==typeof r?document.createTextNode(r):r(n);if(!i)return;"then"in i?i.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)}).catch(e=>xZ(this.view.state,e,"completion info")):this.addInfoPane(i,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let r,i,o,a=null;for(let t=this.list.firstChild,n=this.range.from;t;t=t.nextSibling,n++)"LI"==t.nodeName&&t.id?n==e?t.hasAttribute("aria-selected")||(t.setAttribute("aria-selected","true"),a=t):t.hasAttribute("aria-selected")&&t.removeAttribute("aria-selected"):n--;return a&&(t=this.list,n=a,r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),o=r.height/t.offsetHeight,i.top<r.top?t.scrollTop-=(r.top-i.top)/o:i.bottom>r.bottom&&(t.scrollTop+=(i.bottom-r.bottom)/o)),a}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(A0).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){let r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",e=>{e.target==r&&e.preventDefault()});let i=null;for(let o=n.from;o<n.to;o++){let{completion:a,match:s}=e[o],{section:l}=a;if(l){let e="string"==typeof l?l:l.name;e!=i&&(o>n.from||0==n.from)&&(i=e,"string"!=typeof l&&l.header?r.appendChild(l.header(l)):r.appendChild(document.createElement("completion-section")).textContent=e)}let u=r.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let c=this.optionClass(a);for(let e of(c&&(u.className=c),this.optionContent)){let t=e(a,this.view.state,this.view,s);t&&u.appendChild(t)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function A4(e){return 100*(e.boost||0)+10*!!e.apply+5*!!e.info+ +!!e.type}class A6{constructor(e,t,n,r,i,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new A6(this.options,Ie(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,i,o){if(r&&!o&&e.some(e=>e.isPending))return r.setDisabled();let a=function(e,t){let n=[],r=null,i=e=>{n.push(e);let{section:t}=e.completion;if(t){r||(r=[]);let e="string"==typeof t?t:t.name;r.some(t=>t.name==e)||r.push("string"==typeof t?{name:e}:t)}},o=t.facet(A0);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(!1===r.result.filter)for(let t of r.result.options)i(new AH(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),a,s=o.filterStrict?new AQ(n):new AJ(n);for(let t of r.result.options)if(a=s.match(t.label)){let n=t.displayLabel?e?e(t,a.matched):[]:a.matched;i(new AH(t,r.source,n,a.score+(t.boost||0)))}}}if(r){let e=Object.create(null),t=0;for(let n of r.sort((e,t)=>{var n,r;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(r=t.rank)&&void 0!==r?r:1e9)||(e.name<t.name?-1:1)}))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let a=[],s=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;s&&s.label==t.label&&s.detail==t.detail&&(null==s.type||null==t.type||s.type==t.type)&&s.apply==t.apply&&s.boost==t.boost?A4(e.completion)>A4(s)&&(a[a.length-1]=e):a.push(e),s=e.completion}return a}(e,t);if(!a.length)return r&&e.some(e=>e.isPending)?r.setDisabled():null;let s=t.facet(A0).selectOnOpen?0:-1;if(r&&r.selected!=s&&-1!=r.selected){let e=r.options[r.selected].completion;for(let t=0;t<a.length;t++)if(a[t].completion==e){s=t;break}}return new A6(a,Ie(n,s),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:Iu,above:i.aboveCursor},r?r.timestamp:Date.now(),s,!1)}map(e){return new A6(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new A6(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class A8{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new A8(It,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(A0),r=(n.override||t.languageDataAt("autocomplete",AW(t)).map(AK)).map(t=>(this.active.find(e=>e.source==t)||new Ir(t,+!!this.active.some(e=>0!=e.state))).update(e,n));r.length==this.active.length&&r.every((e,t)=>e==this.active[t])&&(r=this.active);let i=this.open,o=e.effects.some(e=>e.is(Io));for(let a of(i&&e.docChanged&&(i=i.map(e.changes)),e.selection||r.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,o=r==t.length;if(i||o)return i==o;if(e[n++].result!=t[r++].result)return!1}}(r,this.active)||o?i=A6.build(r,t,this.id,i,n,o):i&&i.disabled&&!r.some(e=>e.isPending)&&(i=null),!i&&r.every(e=>!e.isPending)&&r.some(e=>e.hasResult())&&(r=r.map(e=>e.hasResult()?new Ir(e.source,0):e)),e.effects))a.is(Ia)&&(i=i&&i.setSelected(a.value,this.id));return r==this.active&&i==this.open?this:new A8(r,this.id,i)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?A9:A7}}let A9={"aria-autocomplete":"list"},A7={};function Ie(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let It=[];function In(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(AG);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:16*!!e.docChanged}class Ir{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=In(e,t),r=this;for(let t of((8&n||16&n&&this.touches(e))&&(r=new Ir(r.source,0)),4&n&&0==r.state&&(r=new Ir(this.source,1)),r=r.updateFor(e,n),e.effects))if(t.is(AY))r=new Ir(r.source,1,t.value);else if(t.is(AX))r=new Ir(r.source,0);else if(t.is(Io))for(let e of t.value)e.source==r.source&&(r=e);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(AW(e.state))}}class Ii extends Ir{constructor(e,t,n,r,i,o){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let i=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=AW(e.state);if(a>o||!r||2&t&&(AW(e.startState)==this.from||a<this.limit))return new Ir(this.source,4&t?1:0);let s=e.changes.mapPos(this.limit);return!function(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return"function"==typeof e?e(i,n,r,t):Aq(e,!0).test(i)}(r.validFor,e.state,i,o)?r.update&&(r=r.update(r,i,o,new A$(e.state,a,!1)))?new Ii(this.source,this.explicit,s,r,r.from,null!==(n=r.to)&&void 0!==n?n:AW(e.state)):new Ir(this.source,1,this.explicit):new Ii(this.source,this.explicit,s,r,i,o)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Ii(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ir(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}let Io=yD.define({map:(e,t)=>e.map(e=>e.map(t))}),Ia=yD.define(),Is=yp.define({create:()=>A8.start(),update:(e,t)=>e.update(t),provide:e=>[Ct.from(e,e=>e.tooltip),Su.contentAttributes.from(e,e=>e.attrs)]});function Il(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(Is).active.find(e=>e.source==t.source);return r instanceof Ii&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,r){let{main:i}=e.selection,o=n-i.from,a=r-i.from;return Object.assign(Object.assign({},e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+o,s.from+a)!=e.sliceDoc(n,r))return{range:s};let l=e.toText(t);return{changes:{from:s.from+o,to:r==i.from?s.to:s.from+a,insert:l},range:yi.cursor(s.from+o+l.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,r.from,r.to)),{annotations:AG.of(t.completion)})):n(e,t.completion,r.from,r.to),!0)}let Iu=e=>new A3(e,Is,Il);function Ic(e,t="option"){return n=>{let r=n.state.field(Is,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(A0).interactionDelay)return!1;let i=1,o;"page"==t&&(o=Ca(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:a-1;return s<0?s="page"==t?0:a-1:s>=a&&(s="page"==t?a-1:0),n.dispatch({effects:Ia.of(s)}),!0}}let Id=e=>!!e.state.field(Is,!1)&&(e.dispatch({effects:AY.of(!0)}),!0);class Ih{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let Ip=xz.fromClass(class{constructor(e){for(let t of(this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0,e.state.field(Is).active))t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Is),n=e.state.facet(A0);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Is)==t)return;let r=e.transactions.some(e=>{let t=In(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){xZ(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(AY)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(Is);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(A0).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=AW(t),r=new A$(t,n,e.explicit,this.view),i=new Ih(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(e=>{i.context.aborted||(i.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:AX.of(null)}),xZ(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(A0).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(A0),r=this.view.state.field(Is);for(let i=0;i<this.running.length;i++){let o=this.running[i];if(void 0===o.done)continue;if(this.running.splice(i--,1),o.done){let r=AW(o.updates.length?o.updates[0].startState:this.view.state),i=Math.min(r,o.done.from+ +!o.active.explicit),a=new Ii(o.active.source,o.active.explicit,i,o.done,o.done.from,null!==(e=o.done.to)&&void 0!==e?e:r);for(let e of o.updates)a=a.update(e,n);if(a.hasResult()){t.push(a);continue}}let a=r.active.find(e=>e.source==o.active.source);if(a&&a.isPending){if(null==o.done){let e=new Ir(o.active.source,0);for(let t of o.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(a)}}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Io.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Is,!1);if(t&&t.tooltip&&this.view.state.facet(A0).closeOnBlur){let n=t.open&&Ca(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:AX.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:AY.of(!1)}),20),this.composing=0}}}),If="object"==typeof navigator&&/Win/.test(navigator.platform),Ig=ym.highest(Su.domEventHandlers({keydown(e,t){let n=t.state.field(Is,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(If&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&Il(t,r),!1}})),Im=Su.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Iv={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Iy=yD.define({map(e,t){let n=t.mapPos(e,-1,v3.TrackAfter);return null==n?void 0:n}}),Ib=new class extends yV{};Ib.startSide=1,Ib.endSide=-1;let Ix=yp.define({create:()=>yG.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Iy)&&(e=e.update({add:[Ib.range(n.value,n.value+1)]}));return e}}),Iw="()[]{}<>\xab\xbb\xbb\xab[]{}";function IS(e){for(let t=0;t<Iw.length;t+=2)if(Iw.charCodeAt(t)==e)return Iw.charAt(t+1);return v1(e<128?e:e+1)}function IC(e,t){return e.languageDataAt("closeBrackets",t)[0]||Iv}let Ik="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),IM=Su.inputHandler.of((e,t,n,r)=>{if((Ik?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||2==r.length&&1==v2(v0(r,0))||t!=i.from||n!=i.to)return!1;let o=function(e,t){let n=IC(e,e.selection.main.head),r=n.brackets||Iv.brackets;for(let i of r){let o=IS(v0(i,0));if(t==i)return o==i?function(e,t,n,r){let i=r.stringPrefixes||Iv.stringPrefixes,o=null,a=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:Iy.of(r.to+t.length),range:yi.range(r.anchor+t.length,r.head+t.length)};let a=r.head,s=II(e.doc,a),l;if(s==t){if(IP(e,a))return{changes:{insert:t+t,from:a},effects:Iy.of(a+t.length),range:yi.cursor(a+t.length)};if(IA(e,a)){let r=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+r.length,insert:r},range:yi.cursor(a+r.length)}}}else if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(l=IR(e,a-2*t.length,i))>-1&&IP(e,l))return{changes:{insert:t+t+t+t,from:a},effects:Iy.of(a+t.length),range:yi.cursor(a+t.length)};else if(e.charCategorizer(a)(s)!=yB.Word&&IR(e,a,i)>-1&&!function(e,t,n,r){let i=kD(e).resolveInner(t,-1),o=r.reduce((e,t)=>Math.max(e,t.length),0);for(let a=0;a<5;a++){let a=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),s=a.indexOf(n);if(!s||s>-1&&r.indexOf(a.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let l=i.to==t&&i.parent;if(!l)break;i=l}return!1}(e,a,t,i))return{changes:{insert:t+t,from:a},effects:Iy.of(a+t.length),range:yi.cursor(a+t.length)};return{range:o=r}});return o?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}(e,i,r.indexOf(i+i+i)>-1,n):function(e,t,n,r){let i=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:Iy.of(o.to+t.length),range:yi.range(o.anchor+t.length,o.head+t.length)};let a=II(e.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:o.head},effects:Iy.of(o.head+t.length),range:yi.cursor(o.head+t.length)}:{range:i=o}});return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,i,o,n.before||Iv.before);if(t==o&&IA(e,e.selection.main.from))return function(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&II(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:yi.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}(e,0,o)}return null}(e.state,r);return!!o&&(e.dispatch(o),!0)}),IT=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=IC(e,e.selection.main.head).brackets||Iv.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){var i,o;let r;let a=(i=e.doc,o=t.head,v2(v0(r=i.sliceString(o-2,o),0))==r.length?r:r.slice(1));for(let r of n)if(r==a&&II(e.doc,t.head)==IS(v0(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:yi.cursor(t.head-r.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function IA(e,t){let n=!1;return e.field(Ix).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function II(e,t){let n=e.sliceString(t,t+2);return n.slice(0,v2(v0(n,0)))}function IP(e,t){let n=kD(e).resolveInner(t+1);return n.parent&&n.from==t}function IR(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=yB.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=yB.Word)return n}return -1}let IO=[{key:"Ctrl-Space",run:Id},{mac:"Alt-`",run:Id},{key:"Escape",run:e=>{let t=e.state.field(Is,!1);return!!(t&&t.active.some(e=>0!=e.state))&&(e.dispatch({effects:AX.of(null)}),!0)}},{key:"ArrowDown",run:Ic(!0)},{key:"ArrowUp",run:Ic(!1)},{key:"PageDown",run:Ic(!0,"page")},{key:"PageUp",run:Ic(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(Is,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(A0).interactionDelay)&&Il(e,t.open.options[t.open.selected])}}],IE=ym.highest(Sv.computeN([A0],e=>e.facet(A0).defaultKeymap?[IO]:[]));class ID{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class IL{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=e,i=n.facet(IG).markerFilter;i&&(r=i(r,n));let o=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),a=new yU,s=[],l=0;for(let e=0;;){let t,r,i=e==o.length?null:o[e];if(!i&&!s.length)break;for(s.length?(t=l,r=s.reduce((e,t)=>Math.min(e,t.to),i&&i.from>t?i.from:1e8)):(t=i.from,r=i.to,s.push(i),e++);e<o.length;){let n=o[e];if(n.from==t&&(n.to>n.from||n.to==t))s.push(n),e++,r=Math.min(n.to,r);else{r=Math.min(n.from,r);break}}let u=I2(s);if(s.some(e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from))a.add(t,t,b6.widget({widget:new IY(u),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");a.add(t,r,b6.mark({class:"cm-lintRange cm-lintRange-"+u+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}l=r;for(let e=0;e<s.length;e++)s[e].to<=l&&s.splice(e--,1)}let u=a.finish();return new IL(u,t,I_(u))}}function I_(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&0>i.diagnostics.indexOf(t))){if(r){if(0>i.diagnostics.indexOf(r.diagnostic))return!1;r=new ID(r.from,n,r.diagnostic)}else r=new ID(e,n,t||i.diagnostics[0])}}),r}function IN(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(IG).hideOn(e,n,r);if(null!=i)return i;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(Ij))||e.changes.touchesRange(o.from,Math.max(o.to,r)))}function IZ(e,t){return e.field(Iz,!1)?t:t.concat(yD.appendConfig.of(I7))}let Ij=yD.define(),IB=yD.define(),IF=yD.define(),Iz=yp.define({create:()=>new IL(b6.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=I_(n,e.selected.diagnostic,i)||I_(n,null,i)}!n.size&&i&&t.state.facet(IG).autoPanel&&(i=null),e=new IL(n,i,r)}for(let n of t.effects)if(n.is(Ij)){let r=t.state.facet(IG).autoPanel?n.value.length?IJ.open:null:e.panel;e=IL.init(n.value,r,t.state)}else n.is(IB)?e=new IL(e.diagnostics,n.value?IJ.open:null,e.selected):n.is(IF)&&(e=new IL(e.diagnostics,e.panel,n.value));return e},provide:e=>[Cp.from(e,e=>e.panel),Su.decorations.from(e,e=>e.diagnostics)]}),I$=b6.mark({class:"cm-lintRange cm-lintRange-active"});function IV(e,t){return TK("ul",{class:"cm-tooltip-lint"},t.map(t=>IK(e,t,!1)))}let IH=e=>{let t=e.state.field(Iz,!1);return!!t&&!!t.panel&&(e.dispatch({effects:IB.of(!1)}),!0)},IW=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(Iz,!1);t&&t.panel||e.dispatch({effects:IZ(e.state,[IB.of(!0)])});let n=Cu(e,IJ.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(Iz,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return(!!r.value||!!(r=t.diagnostics.iter(0)).value&&(r.from!=n.from||r.to!=n.to))&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],Iq=xz.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(IG);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(IG);t.length&&function(e,t,n){let r=[],i=-1;for(let o of e)o.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}(t.map(e=>Promise.resolve(e(this.view))),t=>{if(this.view.state.doc==e.doc){var n,r;this.view.dispatch((n=this.view.state,r=t.reduce((e,t)=>e.concat(t)),{effects:IZ(n,[Ij.of(r)])}))}},e=>{xZ(this.view.state,e)})}}update(e){let t=e.state.facet(IG);(e.docChanged||t!=e.startState.facet(IG)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),IG=ys.define({combine:e=>Object.assign({sources:e.map(e=>e.source).filter(e=>null!=e)},y$(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function IU(e){let t=[];if(e)i:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue i}}t.push("")}return t}function IK(e,t,n){var r;let i=n?IU(t.actions):[];return TK("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},TK("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(r=t.actions)||void 0===r?void 0:r.map((n,r)=>{let o=!1,a=r=>{if(r.preventDefault(),o)return;o=!0;let i=I_(e.state.field(Iz).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,l=i[r]?s.indexOf(i[r]):-1,u=l<0?s:[s.slice(0,l),TK("u",s.slice(l,l+1)),s.slice(l+1)];return TK("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${s}${l<0?"":` (access key "${i[r]})"`}.`},u)}),t.source&&TK("div",{class:"cm-diagnosticSource"},t.source))}class IY extends b3{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return TK("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class IX{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(0xffffffff*Math.random()).toString(16),this.dom=IK(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class IJ{constructor(e){this.view=e,this.items=[],this.list=TK("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)IH(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65)||!(t.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],r=IU(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=I_(this.view.state.field(Iz).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}t.preventDefault()},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=TK("div",{class:"cm-panel-lint"},this.list,TK("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>IH(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(Iz).selected;if(!e)return -1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return -1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Iz),n=0,r=!1,i=null,o=new Set;for(e.between(0,this.view.state.doc.length,(e,a,{spec:s})=>{for(let e of s.diagnostics){if(o.has(e))continue;o.add(e);let a=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){a=t;break}a<0?(s=new IX(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[a],a>n&&(this.items.splice(n,a-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute("aria-selected")||(s.dom.setAttribute("aria-selected","true"),i=s):s.dom.hasAttribute("aria-selected")&&s.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new IX(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=I_(this.view.state.field(Iz).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:IF.of(t)})}static open(e){return new IJ(e)}}function IQ(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function I0(e){return IQ(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}let I1=Su.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:I0("#d11")},".cm-lintRange-warning":{backgroundImage:I0("orange")},".cm-lintRange-info":{backgroundImage:I0("#999")},".cm-lintRange-hint":{backgroundImage:I0("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function I2(e){let t="hint",n=1;for(let i of e){var r;let e="error"==(r=i.severity)?4:"warning"==r?3:"info"==r?2:1;e>n&&(n=e,t=i.severity)}return t}class I5 extends Cf{constructor(e){super(),this.diagnostics=e,this.severity=I2(e)}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let n=this.diagnostics,r=e.state.facet(Pe).tooltipFilter;return r&&(n=r(n,e.state)),n.length&&(t.onmouseover=()=>(function(e,t,n){function r(){let r,i=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(i.from)&&e.dispatch({effects:I6.of({pos:i.from,above:!1,clip:!1,create:()=>({dom:IV(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,r=n=>{let i=t.getBoundingClientRect();if(!(n.clientX>i.left-10)||!(n.clientX<i.right+10)||!(n.clientY>i.top-10)||!(n.clientY<i.bottom+10)){for(let e=n.target;e;e=e.parentNode)if(1==e.nodeType&&e.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",r),e.state.field(I8)&&e.dispatch({effects:I6.of(null)})}},window.addEventListener("mousemove",r)}let{hoverTime:i}=e.state.facet(Pe),o=setTimeout(r,i);t.onmouseout=()=>{clearTimeout(o),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(o),o=setTimeout(r,i)}})(e,t,n)),t}}let I3=Cb({class:"cm-gutter-lint",markers:e=>e.state.field(I4),widgetMarker:(e,t,n)=>{let r=[];return e.state.field(I4).between(n.from,n.to,(e,t,i)=>{e>n.from&&e<n.to&&r.push(...i.diagnostics)}),r.length?new I5(r):null}}),I4=yp.define({create:()=>yG.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(Pe).markerFilter;for(let r of t.effects)if(r.is(Ij)){let i=r.value;n&&(i=n(i||[],t.state)),e=function(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let r=[];for(let e in n)r.push(new I5(n[e]).range(+e));return yG.of(r,!0)}(t.state.doc,i.slice(0))}return e}}),I6=yD.define(),I8=yp.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=IN(t,e)?null:Object.assign(Object.assign({},e),{pos:t.changes.mapPos(e.pos)})),t.effects.reduce((e,t)=>t.is(I6)?t.value:e,e)),provide:e=>Ct.from(e)}),I9=Su.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:IQ('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:IQ('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:IQ('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),I7=[Iz,Su.decorations.compute([Iz],e=>{let{selected:t,panel:n}=e.field(Iz);return t&&n&&t.from!=t.to?b6.set([I$.range(t.from,t.to)]):b6.none}),function(e,t={}){let n=yD.define(),r=yp.define({create:()=>[],update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,v3.TrackDel);if(null!=e){let i=Object.assign(Object.create(null),n);i.pos=e,null!=i.end&&(i.end=r.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(Cs)&&(e=[]);return e},provide:e=>Cn.from(e)});return{active:r,extension:[r,xz.define(i=>new Co(i,e,r,n,t.hoverTime||300)),Ci]}}(function(e,t,n){let{diagnostics:r}=e.state.field(Iz),i,o=-1,a=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,o=e,a=r,!1});let s=e.state.facet(IG).tooltipFilter;return(i&&s&&(i=s(i,e.state)),i)?{pos:o,end:a,above:e.state.doc.lineAt(o).to<a,create:()=>({dom:IV(e,i)})}:null},{hideOn:IN}),I1],Pe=ys.define({combine:e=>y$(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});var Pt=function(e){void 0===e&&(e={});var{crosshairCursor:t=!1}=e,n=[];!1!==e.closeBracketsKeymap&&(n=n.concat(IT)),!1!==e.defaultKeymap&&(n=n.concat(TG)),!1!==e.searchKeymap&&(n=n.concat(A_)),!1!==e.historyKeymap&&(n=n.concat(M6)),!1!==e.foldKeymap&&(n=n.concat(Mn)),!1!==e.completionKeymap&&(n=n.concat(IO)),!1!==e.lintKeymap&&(n=n.concat(IW));var r=[];if(!1!==e.lineNumbers&&r.push(function(e={}){return[CR.of(e),Cw(),CD]}()),!1!==e.highlightActiveLineGutter&&r.push(CN),!1!==e.highlightSpecialChars&&r.push(function(e={}){return[Sq.of(e),SG||(SG=xz.fromClass(class{constructor(e){this.view=e,this.decorations=b6.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Sq)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new Sz({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,o=v0(t[0],0);if(9==o){let e=i.lineAt(r),t=n.state.tabSize,o=y4(e.text,t,r-e.from);return b6.replace({widget:new SK((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=b6.replace({widget:new SU(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Sq);e.startState.facet(Sq)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}()),!1!==e.history&&r.push(function(e={}){return[Mq,MW.of(e),Su.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?MU:"historyRedo"==e.inputType?MK:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&r.push(function(e={}){let t=Object.assign(Object.assign({},Mu),e),n=new Mc(t,!0),r=new Mc(t,!1),i=xz.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(k$)!=e.state.facet(k$)||e.startState.field(k9,!1)!=e.state.field(k9,!1)||kD(e.startState)!=kD(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new yU;for(let i of e.viewportLineBlocks){let o=k7(e.state,i.from,i.to)?r:k5(e.state,i.from,i.to)?n:null;o&&t.add(i.from,i.from,o)}return t.finish()}}),{domEventHandlers:o}=t;return[i,Cb({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(i))||void 0===t?void 0:t.markers)||yG.empty},initialSpacer:()=>new Mc(t,!1),domEventHandlers:Object.assign(Object.assign({},o),{click:(e,t,n)=>{if(o.click&&o.click(e,t,n))return!0;let r=k7(e.state,t.from,t.to);if(r)return e.dispatch({effects:k6.of(r)}),!0;let i=k5(e.state,t.from,t.to);return!!i&&(e.dispatch({effects:k4.of(i)}),!0)}})}),Mo()]}()),!1!==e.drawSelection&&r.push(function(e={}){return[SR.of(e),SE,SL,SN,xE.of(!0)]}()),!1!==e.dropCursor&&r.push([Sj,SB]),!1!==e.allowMultipleSelections&&r.push(yz.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&r.push(yz.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+200)return e;let o=n.sliceString(i.from,r);if(!t.some(e=>e.test(o)))return e;let{state:a}=e,s=-1,l=[];for(let{head:e}of a.selection.ranges){let t=a.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=kU(a,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],i=kG(a,n);r!=i&&l.push({from:t.from,to:t.from+r.length,insert:i})}return l.length?[e,{changes:l,sequential:!0}]:e})),!1!==e.syntaxHighlighting&&r.push(Mm(My,{fallback:!0})),!1!==e.bracketMatching&&r.push(function(e={}){return[Mw.of(e),MM]}()),!1!==e.closeBrackets&&r.push([IM,Ix]),!1!==e.autocompletion&&r.push(function(e={}){return[Ig,Is,A0.of(e),Ip,IE,Im]}()),!1!==e.rectangularSelection){let e;r.push((e=e=>e.altKey&&0==e.button,Su.mouseSelectionStyle.of((t,n)=>{let r,i;return e(n)?(r=SQ(t,n),i=t.state.selection,r?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(r.line).from),n=e.state.doc.lineAt(t);r={line:n.number,col:r.col,off:Math.min(r.off,n.length)},i=i.map(e.changes)}},get(e,n,o){let a=SQ(t,e);if(!a)return i;let s=function(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),o=[];if(t.off>2e3||n.off>2e3||t.col<0||n.col<0){let a=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&o.push(yi.range(n.from+a,n.to+s))}}else{let a=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=y6(n.text,a,e.tabSize,!0);if(r<0)o.push(yi.cursor(n.to));else{let t=y6(n.text,s,e.tabSize);o.push(yi.range(n.from+r,n.from+t))}}}return o}(t.state,r,a);return s.length?o?yi.create(s.concat(i.ranges)):yi.create(s):i}}:null):null})))}if(!1!==t&&r.push(function(e={}){let[t,n]=S0[e.key||"Alt"],r=xz.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,Su.contentAttributes.of(e=>{var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.isDown)?S1:null})]}()),!1!==e.highlightActiveLine&&r.push(SX),!1!==e.highlightSelectionMatches){let e;r.push(e=[Ao,Ai])}return e.tabSize&&"number"==typeof e.tabSize&&r.push(kW.of(" ".repeat(e.tabSize))),r.concat([Sv.of(n.flat())]).filter(Boolean)};let Pn="#e06c75",Pr="#abb2bf",Pi="#7d8799",Po="#d19a66",Pa="#2c313a",Ps="#282c34",Pl="#353a42",Pu="#528bff",Pc=[Su.theme({"&":{color:Pr,backgroundColor:Ps},".cm-content":{caretColor:Pu},".cm-cursor, .cm-dropCursor":{borderLeftColor:Pu},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:Pr},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Ps,color:Pi,border:"none"},".cm-activeLineGutter":{backgroundColor:Pa},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Pl},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Pl,borderBottomColor:Pl},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Pa,color:Pr}}},{dark:!0}),Mm(Mh.define([{tag:kA.keyword,color:"#c678dd"},{tag:[kA.name,kA.deleted,kA.character,kA.propertyName,kA.macroName],color:Pn},{tag:[kA.function(kA.variableName),kA.labelName],color:"#61afef"},{tag:[kA.color,kA.constant(kA.name),kA.standard(kA.name)],color:Po},{tag:[kA.definition(kA.name),kA.separator],color:Pr},{tag:[kA.typeName,kA.className,kA.number,kA.changed,kA.annotation,kA.modifier,kA.self,kA.namespace],color:"#e5c07b"},{tag:[kA.operator,kA.operatorKeyword,kA.url,kA.escape,kA.regexp,kA.link,kA.special(kA.string)],color:"#56b6c2"},{tag:[kA.meta,kA.comment],color:Pi},{tag:kA.strong,fontWeight:"bold"},{tag:kA.emphasis,fontStyle:"italic"},{tag:kA.strikethrough,textDecoration:"line-through"},{tag:kA.link,color:Pi,textDecoration:"underline"},{tag:kA.heading,fontWeight:"bold",color:Pn},{tag:[kA.atom,kA.bool,kA.special(kA.variableName)],color:Po},{tag:[kA.processingInstruction,kA.string,kA.inserted],color:"#98c379"},{tag:kA.invalid,color:"#ffffff"}]))];var Pd=Su.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Ph=function(e){void 0===e&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:r=!1,theme:i="light",placeholder:o="",basicSetup:a=!0}=e,s=[];switch(t&&s.unshift(Sv.of([TU])),a&&("boolean"==typeof a?s.unshift(Pt()):s.unshift(Pt(a))),o&&s.unshift(xz.fromClass(class{constructor(e){this.view=e,this.placeholder=o?b6.set([b6.widget({widget:new SJ(o),side:1}).range(0)]):b6.none}get decorations(){return this.view.state.doc.length?b6.none:this.placeholder}},{decorations:e=>e.decorations})),i){case"light":s.push(Pd);break;case"dark":s.push(Pc);break;case"none":break;default:s.push(i)}return!1===n&&s.push(Su.editable.of(!1)),r&&s.push(yz.readOnly.of(!0)),[...s]},Pp=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),Pf=yR.define(),Pg=[],Pm=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Pv=(0,g.forwardRef)((e,t)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:a,onStatistics:s,onCreateEditor:l,onUpdate:u,autoFocus:c,theme:d="light",height:h,minHeight:p,maxHeight:m,width:v,minWidth:y,maxWidth:b,basicSetup:x,placeholder:w,indentWithTab:S,editable:C,readOnly:k,root:M,initialState:T}=e,A=H(e,Pm),I=(0,g.useRef)(null),{state:P,view:R,container:O,setContainer:E}=function(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:a,extensions:s=Pg,autoFocus:l,theme:u="light",height:c=null,minHeight:d=null,maxHeight:h=null,width:p=null,minWidth:f=null,maxWidth:m=null,placeholder:v="",editable:y=!0,readOnly:b=!1,indentWithTab:x=!0,basicSetup:w=!0,root:S,initialState:C}=e,[k,M]=(0,g.useState)(),[T,A]=(0,g.useState)(),[I,P]=(0,g.useState)(),R=Su.theme({"&":{height:c,minHeight:d,maxHeight:h,width:p,minWidth:f,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),O=[Su.updateListener.of(e=>{e.docChanged&&"function"==typeof r&&!e.transactions.some(e=>e.annotation(Pf))&&r(e.state.doc.toString(),e),i&&i(Pp(e))}),R,...Ph({theme:u,editable:y,readOnly:b,placeholder:v,indentWithTab:x,basicSetup:w})];return a&&"function"==typeof a&&O.push(Su.updateListener.of(a)),O=O.concat(s),(0,g.useLayoutEffect)(()=>{if(k&&!I){var e={doc:t,selection:n,extensions:O},r=C?yz.fromJSON(C.json,e,C.fields):yz.create(e);if(P(r),!T){var i=new Su({state:r,parent:k,root:S});A(i),o&&o(i,r)}}return()=>{T&&(P(void 0),A(void 0))}},[k,I]),(0,g.useEffect)(()=>{e.container&&M(e.container)},[e.container]),(0,g.useEffect)(()=>()=>{T&&(T.destroy(),A(void 0))},[T]),(0,g.useEffect)(()=>{l&&T&&T.focus()},[l,T]),(0,g.useEffect)(()=>{T&&T.dispatch({effects:yD.reconfigure.of(O)})},[u,s,c,d,h,p,f,m,v,y,b,x,w,r,a]),(0,g.useEffect)(()=>{if(void 0!==t){var e=T?T.state.doc.toString():"";T&&t!==e&&T.dispatch({changes:{from:0,to:e.length,insert:t||""},annotations:[Pf.of(!0)]})}},[t,T]),{state:I,setState:P,view:T,setView:A,container:k,setContainer:M}}({root:M,value:r,autoFocus:c,theme:d,height:h,minHeight:p,maxHeight:m,width:v,minWidth:y,maxWidth:b,basicSetup:x,placeholder:w,indentWithTab:S,editable:C,readOnly:k,selection:i,onChange:a,onStatistics:s,onCreateEditor:l,onUpdate:u,extensions:o,initialState:T});(0,g.useImperativeHandle)(t,()=>({editor:I.current,state:P,view:R}),[I,O,P,R]);var D=(0,g.useCallback)(e=>{I.current=e,E(e)},[E]);if("string"!=typeof r)throw Error("value must be typeof string but got "+typeof r);var L="string"==typeof d?"cm-theme-"+d:"cm-theme";return(0,f.jsx)("div",(0,W.Z)({ref:D,className:""+L+(n?" "+n:"")},A))});Pv.displayName="CodeMirror";class Py{constructor(e,t,n,r,i,o,a,s,l,u=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=o,this.buffer=a,this.bufferBase=s,this.curContext=l,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new Py(e,[],t,n,n,0,[],0,r?new Pb(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=65535&e,{parser:i}=this.p,o=this.reducePos<this.pos-25;o&&this.setLookAhead(this.pos);let a=i.dynamicPrecedence(r);if(a&&(this.score+=a),0==n){this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r<i.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let s=this.stack.length-(n-1)*3-(262144&e?6:0),l=s?this.stack[s-2]:this.p.ranges[0].from,u=this.reducePos-l;u>=2e3&&!(null===(t=this.p.parser.nodeSet.types[r])||void 0===t?void 0:t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=u));let c=s?this.stack[s-1]:0,d=this.bufferBase+this.buffer.length-c;if(r<i.minRepeatTerm||131072&e){let e=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,l,e,d+4,!0)}if(262144&e)this.state=this.stack[s];else{let e=this.stack[s-3];this.state=i.getGoto(e,r,!0)}for(;this.stack.length>s;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,t,n,r=4,i=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,r=this.buffer.length;if(0==r&&e.parent&&(r=e.bufferBase-e.parent.bufferBase,e=e.parent),r>0&&0==e.buffer[r-4]&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t){e.buffer[r-2]=n;return}}}if(i&&this.pos!=n){let i=this.buffer.length;if(i>0&&0!=this.buffer[i-4]){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}else this.buffer.push(e,t,n,r)}shift(e,t,n,r){if(131072&e)this.pushState(65535&e,this.pos);else if((262144&e)==0){let{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(e,1)||(this.reducePos=r)),this.pushState(e,n),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,r,4)}else this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4)}apply(e,t,n,r){65536&e?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new Py(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Px(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if((65536&n)==0)return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>1&t&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((65536&t)==0)return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=65535&t,i=this.stack.length-3*n;if(i<0||0>e.getGoto(this.stack[i],r,!1)){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-i;if(n>1){let r=65535&t,i=this.stack.length-3*n;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(null!=e)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new Pb(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Pb{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Px{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e>>19;0==t?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],65535&e,!0);this.state=n}}class Pw{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Pw(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new Pw(this.stack,this.pos,this.index)}}function PS(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let r=0,i=0;r<e.length;){let o=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(126==t){o=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),o+=i,n)break;o*=46}n?n[i++]=o:n=new t(o)}return n}class PC{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let Pk=new PC;class PM{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Pk,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(null==t)return -1;if((n=t)>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Pk,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class PT{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;PA(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}function PA(e,t,n,r,i,o){let a=0,s=1<<r,{dialect:l}=n.p.parser;r:for(;(s&e[a])!=0;){let n=e[a+1];for(let r=a+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(l.allows(n)&&(-1==t.token.value||t.token.value==n||function(e,t,n,r){let i=PI(n,r,t);return i<0||PI(n,r,e)<i}(n,t.token.value,i,o))){t.acceptToken(n);break}}let r=t.next,u=0,c=e[a+2];if(t.next<0&&c>u&&65535==e[n+3*c-3]){a=e[n+3*c-1];continue}for(;u<c;){let i=u+c>>1,o=n+i+(i<<1),s=e[o],l=e[o+1]||65536;if(r<s)c=i;else if(r>=l)u=i+1;else{a=e[o+2],t.advance();continue r}}break}}function PI(e,t,n){for(let r=t,i;65535!=(i=e[r]);r++)if(i==n)return r-t;return -1}PT.prototype.contextual=PT.prototype.fallback=PT.prototype.extend=!1,(class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?PS(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(PA(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(!n&&r++,null==i)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}).prototype.contextual=PT.prototype.fallback=PT.prototype.extend=!1;let PP="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG),PR=null;function PO(e,t,n){let r=e.cursor(N7.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class PE{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?PO(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?PO(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],o=this.start[t]+n.positions[r];if(o>e)return this.nextStart=o,null;if(i instanceof Cq){if(o==e){if(o<this.safeFrom)return null;let e=o+i.length;if(e<=this.safeTo){let t=i.prop(CB.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,o+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+i.length}}}class PD{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new PC)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,o=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if((1<<r&o)==0)continue;let l=i[r],u=this.tokens[r];if((!n||l.fallback)&&((l.contextual||u.start!=e.pos||u.mask!=o||u.context!=a)&&(this.updateCachedToken(u,l,e),u.mask=o,u.context=a),u.lookAhead>u.end+25&&(s=Math.max(u.lookAhead,s)),0!=u.value)){let r=t;if(u.extended>-1&&(t=this.addActions(e,u.extended,u.end,t)),t=this.addActions(e,u.value,u.end,t),!l.extend&&(n=u,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),n||e.pos!=this.stream.end||((n=new PC).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new PC,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){(1&i)==0?e.value=i>>1:e.extended=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:o}=e.p,{data:a}=o;for(let e=0;e<2;e++)for(let s=o.stateSlot(i,e?2:1);;s+=3){if(65535==a[s]){if(1==a[s+1])s=Pj(a,s+2);else{0==r&&2==a[s+1]&&(r=this.putAction(Pj(a,s+2),t,n,r));break}}a[s]==t&&(r=this.putAction(Pj(a,s+1),t,n,r))}return r}}class PL{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new PM(t,r),this.tokens=new PD(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[Py.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>4*e.bufferLength?new PE(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,r=this.minStackPos,i=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<n.length;o++){let a=n[o];for(;;){if(this.tokens.mainToken=null,a.pos>r)i.push(a);else{if(this.advanceStack(a,i,n))continue;e||(e=[],t=[]),e.push(a);let r=this.tokens.getMainToken(a);t.push(r.value,r.end)}break}}if(!i.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return PP&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw PP&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),SyntaxError("No parse at "+r);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,i);if(n)return PP&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(i.length>e)for(i.sort((e,t)=>t.score-e.score);i.length>e;)i.pop();i.some(e=>e.reducePos>r)&&this.recovering--}else if(i.length>1){o:for(let e=0;e<i.length-1;e++){let t=i[e];for(let n=e+1;n<i.length;n++){let r=i[n];if(t.sameState(r)||t.buffer.length>500&&r.buffer.length>500){if((t.score-r.score||t.buffer.length-r.buffer.length)>0)i.splice(n--,1);else{i.splice(e--,1);continue o}}}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(let e=1;e<i.length;e++)i[e].pos<this.minStackPos&&(this.minStackPos=i[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,o=PP?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let a=this.fragments.nodeAt(r);a;){let r=this.parser.nodeSet.types[a.type.id]==a.type?i.getGoto(e.state,a.type.id):-1;if(r>-1&&a.length&&(!t||(a.prop(CB.contextHash)||0)==n))return e.useNode(a,r),PP&&console.log(o+this.stackID(e)+` (via reuse of ${i.getName(a.type.id)})`),!0;if(!(a instanceof Cq)||0==a.children.length||a.positions[0]>0)break;let s=a.children[0];if(s instanceof Cq&&0==a.positions[0])a=s;else break}}let a=i.stateSlot(e.state,4);if(a>0)return e.reduce(a),PP&&console.log(o+this.stackID(e)+` (via always-reduce ${i.getName(65535&a)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let a=0;a<s.length;){let l=s[a++],u=s[a++],c=s[a++],d=a==s.length||!n,h=d?e:e.split(),p=this.tokens.mainToken;if(h.apply(l,u,p?p.start:h.pos,c),PP&&console.log(o+this.stackID(h)+` (via ${(65536&l)==0?"shift":`reduce of ${i.getName(65535&l)}`} for ${i.getName(u)} @ ${r}${h==e?"":", split"})`),d)return!0;h.pos>r?t.push(h):n.push(h)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return P_(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let o=0;o<e.length;o++){let a=e[o],s=t[o<<1],l=t[(o<<1)+1],u=PP?this.stackID(a)+" -> ":"";if(a.deadEnd&&(i||(i=!0,a.restart(),PP&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let c=a.split(),d=u;for(let e=0;c.forceReduce()&&e<10&&(PP&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));e++)PP&&(d=this.stackID(c)+" -> ");for(let e of a.recoverByInsert(s))PP&&console.log(u+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>a.pos?(l==a.pos&&(l++,s=0),a.recoverByDelete(s,l),PP&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(s)})`),P_(a,n)):(!r||r.score<a.score)&&(r=a)}return r}stackToTree(e){return e.close(),Cq.build({buffer:Pw.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(PR||(PR=new WeakMap)).get(e);return t||PR.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function P_(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class PN{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}class PZ extends kt{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=CB[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let o=t[n+-r];for(let a=-r;a>0;a--)i(t[n++],e,o);n++}}}this.nodeSet=new CV(t.map((t,i)=>C$.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:0==i,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=PS(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(PB),this.states=PS(e.states,Uint32Array),this.data=PS(e.stateData),this.goto=PS(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new PT(o,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new PL(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return -1;for(let i=r[t+1];;){let t=r[i++],o=1&t,a=r[i++];if(o&&n)return a;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return a;if(o)return -1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),o;;i+=3){if(65535==(o=n[i])){if(1==n[i+1])o=n[i=Pj(n,i+2)];else if(2==n[i+1])return Pj(n,i+2);else break}if(o==t||0==o)return Pj(n,i+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==r;n+=3){if(65535==this.data[n]){if(1==this.data[n+1])n=Pj(this.data,n+2);else break}r=t(Pj(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1==this.data[n+1])n=Pj(this.data,n+2);else break}if((1&this.data[n+2])==0){let e=this.data[n+1];t.some((t,n)=>1&n&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(PZ.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let i=e.specializers.find(e=>e.from==n.external);if(!i)return n;let o=Object.assign(Object.assign({},n),{external:i.to});return t.specializers[r]=PB(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;65535!=(i=this.data[n++]);)(r||(r=new Uint8Array(this.maxTerm+1)))[i]=1;return new PN(e,n,r)}static deserialize(e){return new PZ(e)}}function Pj(e,t){return e[t]|e[t+1]<<16}function PB(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}let PF=ks({String:kA.string,Number:kA.number,"True False":kA.bool,PropertyName:kA.propertyName,Null:kA.null,", :":kA.separator,"[ ]":kA.squareBracket,"{ }":kA.brace}),Pz=PZ.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[PF],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),P$=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(o){var t,n;let r;if(!(o instanceof SyntaxError))throw o;let i=(t=o,n=e.state.doc,(r=t.message.match(/at position (\d+)/))?Math.min(+r[1],n.length):(r=t.message.match(/at line (\d+) column (\d+)/))?Math.min(n.line(+r[1]).from+ +r[2]-1,n.length):0);return[{from:i,message:o.message,severity:"error",to:i}]}return[]},PV=kE.define({name:"json",parser:Pz.configure({props:[kY.add({Object:k0({except:/^\s*\}/}),Array:k0({except:/^\s*\]/})}),k2.add({"Object Array":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function PH(e){let t=ot(),n="dark"===t.palette.mode,[r,i]=(0,g.useState)(()=>JSON.stringify(e.value,null,2)),[o,a]=(0,g.useState)(r);return(0,f.jsx)(Pv,{...e,style:{border:`1px solid ${t.palette.divider}`},theme:n?"dark":"light",extensions:[new kV(PV),function(e,t={}){return[IG.of({source:e,config:t}),Iq,I7]}(P$()),function(e={}){return[Pe.of(e),I4,I3,I9,I8]}()],value:r,onChange:t=>{i(t),e.onChange&&e.onChange(t)},onBlur:()=>{o!==r&&void 0!==e.onChange&&(e.onChange(r),a(r))},placeholder:e.placeholder})}var PW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return(0,eH.ZT)(t,e),t.prototype.getInitialData=function(e){return(0,eq.Z)(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new eX.Z,n=(0,vT.th)("line",0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var r=this.getData().getVisual("symbol"),i=this.getData().getVisual("symbolRotate"),o="none"===r?"circle":r,a=.8*e.itemHeight,s=(0,vT.th)(o,(e.itemWidth-a)/2,(e.itemHeight-a)/2,a,a,e.itemStyle.fill);t.add(s),s.setStyle(e.itemStyle);var l="inherit"===e.iconRotate?i:e.iconRotate||0;return s.rotation=l*Math.PI/180,s.setOrigin([e.itemWidth/2,e.itemHeight/2]),o.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),t},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(eW.Z),Pq=n(5434),PG=n(3802),PU=n(7384);function PK(e,t,n){var r,i,o,a,s=e.getBaseAxis(),l=e.getOtherAxis(s),u=(r=l,i=n,o=0,a=r.scale.getExtent(),"start"===i?o=a[0]:"end"===i?o=a[1]:(0,eB.hj)(i)&&!isNaN(i)?o=i:a[0]>0?o=a[0]:a[1]<0&&(o=a[1]),o),c=s.dim,d=l.dim,h=t.mapDimension(d),p=t.mapDimension(c),f=+("x"===d||"radius"===d),g=(0,eB.UI)(e.dimensions,function(e){return t.mapDimension(e)}),m=!1,v=t.getCalculationInfo("stackResultDimension");return(0,PU.M)(t,g[0])&&(m=!0,g[0]=v),(0,PU.M)(t,g[1])&&(m=!0,g[1]=v),{dataDimsForPoint:g,valueStart:u,valueAxisDim:d,baseAxisDim:c,stacked:!!m,valueDim:h,baseDim:p,baseDataOffset:f,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}}function PY(e,t,n,r){var i=NaN;e.stacked&&(i=n.get(n.getCalculationInfo("stackedOverDimension"),r)),isNaN(i)&&(i=e.valueStart);var o=e.baseDataOffset,a=[];return a[o]=n.get(e.baseDim,r),a[1-o]=i,t.dataToPoint(a)}var PX=n(8845),PJ=n(4235),PQ=n(9101),P0=Math.min,P1=Math.max;function P2(e,t){return isNaN(e)||isNaN(t)}function P5(e,t,n,r,i,o,a,s,l){for(var u,c,d,h,p,f,g=n,m=0;m<r;m++){var v=t[2*g],y=t[2*g+1];if(g>=i||g<0)break;if(P2(v,y)){if(l){g+=o;continue}break}if(g===n)e[o>0?"moveTo":"lineTo"](v,y),d=v,h=y;else{var b=v-u,x=y-c;if(b*b+x*x<.5){g+=o;continue}if(a>0){for(var w=g+o,S=t[2*w],C=t[2*w+1];S===v&&C===y&&m<r;)m++,w+=o,g+=o,S=t[2*w],C=t[2*w+1],v=t[2*g],y=t[2*g+1],b=v-u,x=y-c;var k=m+1;if(l)for(;P2(S,C)&&k<r;)k++,w+=o,S=t[2*w],C=t[2*w+1];var M=.5,T=0,A=0,I=void 0,P=void 0;if(k>=r||P2(S,C))p=v,f=y;else{T=S-u,A=C-c;var R=v-u,O=S-v,E=y-c,D=C-y,L=void 0,_=void 0;if("x"===s){L=Math.abs(R),_=Math.abs(O);var N=T>0?1:-1;p=v-N*L*a,f=y,I=v+N*_*a,P=y}else if("y"===s){L=Math.abs(E),_=Math.abs(D);var Z=A>0?1:-1;p=v,f=y-Z*L*a,I=v,P=y+Z*_*a}else L=Math.sqrt(R*R+E*E),p=v-T*a*(1-(M=(_=Math.sqrt(O*O+D*D))/(_+L))),f=y-A*a*(1-M),I=v+T*a*M,P=y+A*a*M,I=P0(I,P1(S,v)),P=P0(P,P1(C,y)),I=P1(I,P0(S,v)),P=P1(P,P0(C,y)),T=I-v,A=P-y,p=v-T*L/_,f=y-A*L/_,p=P0(p,P1(u,v)),f=P0(f,P1(c,y)),p=P1(p,P0(u,v)),f=P1(f,P0(c,y)),T=v-p,A=y-f,I=v+T*_/L,P=y+A*_/L}e.bezierCurveTo(d,h,p,f,v,y),d=I,h=P}else e.lineTo(v,y)}u=v,c=y,g+=o}return m}var P3=function(){this.smooth=0,this.smoothConstraint=!0},P4=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return(0,eH.ZT)(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new P3},t.prototype.buildPath=function(e,t){var n=t.points,r=0,i=n.length/2;if(t.connectNulls){for(;i>0&&P2(n[2*i-2],n[2*i-1]);i--);for(;r<i&&P2(n[2*r],n[2*r+1]);r++);}for(;r<i;)r+=P5(e,n,r,i,i,1,t.smooth,t.smoothMonotone,t.connectNulls)+1},t.prototype.getPointOn=function(e,t){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n,r,i=this.path.data,o=vA.Z.CMD,a="x"===t,s=[],l=0;l<i.length;){var u=i[l++],c=void 0,d=void 0,h=void 0,p=void 0,f=void 0,g=void 0,m=void 0;switch(u){case o.M:n=i[l++],r=i[l++];break;case o.L:if(c=i[l++],d=i[l++],(m=a?(e-n)/(c-n):(e-r)/(d-r))<=1&&m>=0){var v=a?(d-r)*m+r:(c-n)*m+n;return a?[e,v]:[v,e]}n=c,r=d;break;case o.C:c=i[l++],d=i[l++],h=i[l++],p=i[l++],f=i[l++],g=i[l++];var y=a?(0,PQ.kD)(n,c,h,f,e,s):(0,PQ.kD)(r,d,p,g,e,s);if(y>0)for(var b=0;b<y;b++){var x=s[b];if(x<=1&&x>=0){var v=a?(0,PQ.af)(r,d,p,g,x):(0,PQ.af)(n,c,h,f,x);return a?[e,v]:[v,e]}}n=f,r=g}}},t}(eY.ZP),P6=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,eH.ZT)(t,e),t}(P3),P8=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return(0,eH.ZT)(t,e),t.prototype.getDefaultShape=function(){return new P6},t.prototype.buildPath=function(e,t){var n=t.points,r=t.stackedOnPoints,i=0,o=n.length/2,a=t.smoothMonotone;if(t.connectNulls){for(;o>0&&P2(n[2*o-2],n[2*o-1]);o--);for(;i<o&&P2(n[2*i],n[2*i+1]);i++);}for(;i<o;){var s=P5(e,n,i,o,o,1,t.smooth,a,t.connectNulls);P5(e,r,i+s-1,s,o,-1,t.stackedOnSmooth,a,t.connectNulls),i+=s+1,e.closePath()}},t}(eY.ZP),P9=n(814),P7=n(4411);function Re(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return;return!0}}function Rt(e){for(var t=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<e.length;){var a=e[o++],s=e[o++];isNaN(a)||(t=Math.min(a,t),r=Math.max(a,r)),isNaN(s)||(n=Math.min(s,n),i=Math.max(s,i))}return[[t,n],[r,i]]}function Rn(e,t){var n=Rt(e),r=n[0],i=n[1],o=Rt(t),a=o[0],s=o[1];return Math.max(Math.abs(r[0]-a[0]),Math.abs(r[1]-a[1]),Math.abs(i[0]-s[0]),Math.abs(i[1]-s[1]))}function Rr(e){return eB.hj(e)?e:.5*!!e}function Ri(e,t,n,r){var i=t.getBaseAxis(),o=+("x"!==i.dim&&"radius"!==i.dim),a=[],s=0,l=[],u=[],c=[],d=[];if(r){for(s=0;s<e.length;s+=2)isNaN(e[s])||isNaN(e[s+1])||d.push(e[s],e[s+1]);e=d}for(s=0;s<e.length-2;s+=2)switch(c[0]=e[s+2],c[1]=e[s+3],u[0]=e[s],u[1]=e[s+1],a.push(u[0],u[1]),n){case"end":l[o]=c[o],l[1-o]=u[1-o],a.push(l[0],l[1]);break;case"middle":var h=(u[o]+c[o])/2,p=[];l[o]=p[o]=h,l[1-o]=u[1-o],p[1-o]=c[1-o],a.push(l[0],l[1]),a.push(p[0],p[1]);break;default:l[o]=u[o],l[1-o]=c[1-o],a.push(l[0],l[1])}return a.push(e[s++],e[s++]),a}function Ro(e,t){return[e[2*t],e[2*t+1]]}function Ra(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t<e5.L1.length;t++)if(e.get([e5.L1[t],"endLabel","show"]))return!0;return!1}function Rs(e,t,n,r){if(!tr(t,"cartesian2d"))return e9(t,n,r);var i=r.getModel("endLabel"),o=i.get("valueAnimation"),a=r.getData(),s={lastFrameIndex:0},l=Ra(r)?function(n,r){e._endLabelOnDuring(n,r,a,s,o,i,t)}:null,u=t.getBaseAxis().isHorizontal(),c=e8(t,n,r,function(){var t=e._endLabel;t&&n&&null!=s.originalX&&t.attr({x:s.originalX,y:s.originalY})},l);if(!r.get("clip",!0)){var d=c.shape,h=Math.max(d.width,d.height);u?(d.y-=h,d.height+=2*h):(d.x-=h,d.width+=2*h)}return l&&l(1,c),c}var Rl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,eH.ZT)(t,e),t.prototype.init=function(){var e=new eX.Z,t=new Pq.Z;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},t.prototype.render=function(e,t,n){var r,i=this,o=e.coordinateSystem,a=this.group,s=e.getData(),l=e.getModel("lineStyle"),u=e.getModel("areaStyle"),c=s.getLayout("points")||[],d="polar"===o.type,h=this._coordSys,p=this._symbolDraw,f=this._polyline,g=this._polygon,m=this._lineGroup,v=!t.ssr&&e.get("animation"),y=!u.isEmpty(),b=u.get("origin"),x=PK(o,s,b),w=y&&function(e,t,n){if(!n.valueDim)return[];for(var r=t.count(),i=(0,PX.o)(2*r),o=0;o<r;o++){var a=PY(n,e,t,o);i[2*o]=a[0],i[2*o+1]=a[1]}return i}(o,s,x),S=e.get("showSymbol"),C=e.get("connectNulls"),k=S&&!d&&function(e,t,n){var r=e.get("showAllSymbol"),i="auto"===r;if(!r||i){var o=n.getAxesByScale("ordinal")[0];if(!(!o||i&&function(e,t){var n=e.getExtent(),r=Math.abs(n[1]-n[0])/e.scale.count();isNaN(r)&&(r=0);for(var i=t.count(),o=Math.max(1,Math.round(i/5)),a=0;a<i;a+=o)if(1.5*PG.Z.getSymbolSize(t,a)[+!!e.isHorizontal()]>r)return!1;return!0}(o,t))){var a=t.mapDimension(o.dim),s={};return eB.S6(o.getViewLabels(),function(e){s[o.scale.getRawOrdinalNumber(e.tickValue)]=1}),function(e){return!s.hasOwnProperty(t.get(a,e))}}}}(e,s,o),M=this._data;M&&M.eachItemGraphicEl(function(e,t){e.__temp&&(a.remove(e),M.setItemGraphicEl(t,null))}),S||p.remove(),a.add(m);var T=!d&&e.get("step");o&&o.getArea&&e.get("clip",!0)&&(null!=(r=o.getArea()).width?(r.x-=.1,r.y-=.1,r.width+=.2,r.height+=.2):r.r0&&(r.r0-=.5,r.r+=.5)),this._clipShapeForSymbol=r;var A=function(e,t,n){var r,i,o=e.getVisual("visualMeta");if(o&&o.length&&e.count()&&"cartesian2d"===t.type){for(var a=o.length-1;a>=0;a--){var s=e.getDimensionInfo(o[a].dimension);if("x"===(r=s&&s.coordDim)||"y"===r){i=o[a];break}}if(i){var l=t.getAxis(r),u=eB.UI(i.stops,function(e){return{coord:l.toGlobalCoord(l.dataToCoord(e.value)),color:e.color}}),c=u.length,d=i.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),d.reverse());var h=function(e,t){var n,r,i=[],o=e.length;function a(e,t,n){var r=e.coord,i=(n-r)/(t.coord-r);return{coord:n,color:(0,P7.t7)(i,[e.color,t.color])}}for(var s=0;s<o;s++){var l=e[s],u=l.coord;if(u<0)n=l;else if(u>t){r?i.push(a(r,l,t)):n&&i.push(a(n,l,0),a(n,l,t));break}else n&&(i.push(a(n,l,0)),n=null),i.push(l),r=l}return i}(u,"x"===r?n.getWidth():n.getHeight()),p=h.length;if(!p&&c)return u[0].coord<0?d[1]?d[1]:u[c-1].color:d[0]?d[0]:u[0].color;var f=h[0].coord-10,g=h[p-1].coord+10,m=g-f;if(m<.001)return"transparent";eB.S6(h,function(e){e.offset=(e.coord-f)/m}),h.push({offset:p?h[p-1].offset:.5,color:d[1]||"transparent"}),h.unshift({offset:p?h[0].offset:.5,color:d[0]||"transparent"});var v=new PJ.Z(0,0,0,0,h,!0);return v[r]=f,v[r+"2"]=g,v}}}(s,o,n)||s.getVisual("style")[s.getVisual("drawType")];if(f&&h.type===o.type&&T===this._step){y&&!g?g=this._newPolygon(c,w):g&&!y&&(m.remove(g),g=this._polygon=null),d||this._initOrUpdateEndLabel(e,o,(0,P9.Lz)(A));var I=m.getClipPath();if(I){var P=Rs(this,o,!1,e);eQ.KZ(I,{shape:P.shape},e)}else m.setClipPath(Rs(this,o,!0,e));S&&p.updateData(s,{isIgnore:k,clipShape:r,disableAnimation:!0,getSymbolPoint:function(e){return[c[2*e],c[2*e+1]]}}),Re(this._stackedOnPoints,w)&&Re(this._points,c)||(v?this._doUpdateAnimation(s,w,o,n,T,b,C):(T&&(c=Ri(c,o,T,C),w&&(w=Ri(w,o,T,C))),f.setShape({points:c}),g&&g.setShape({points:c,stackedOnPoints:w})))}else S&&p.updateData(s,{isIgnore:k,clipShape:r,disableAnimation:!0,getSymbolPoint:function(e){return[c[2*e],c[2*e+1]]}}),v&&this._initSymbolLabelAnimation(s,o,r),T&&(c=Ri(c,o,T,C),w&&(w=Ri(w,o,T,C))),f=this._newPolyline(c),y?g=this._newPolygon(c,w):g&&(m.remove(g),g=this._polygon=null),d||this._initOrUpdateEndLabel(e,o,(0,P9.Lz)(A)),m.setClipPath(Rs(this,o,!0,e));var R=e.getModel("emphasis"),O=R.get("focus"),E=R.get("blurScope"),D=R.get("disabled");f.useStyle(eB.ce(l.getLineStyle(),{fill:"none",stroke:A,lineJoin:"bevel"})),(0,e5.WO)(f,e,"lineStyle"),f.style.lineWidth>0&&"bolder"===e.get(["emphasis","lineStyle","width"])&&(f.getState("emphasis").style.lineWidth=+f.style.lineWidth+1),(0,e2.A)(f).seriesIndex=e.seriesIndex,(0,e5.k5)(f,O,E,D);var L=Rr(e.get("smooth")),_=e.get("smoothMonotone");if(f.setShape({smooth:L,smoothMonotone:_,connectNulls:C}),g){var N=s.getCalculationInfo("stackedOnSeries"),Z=0;g.useStyle(eB.ce(u.getAreaStyle(),{fill:A,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),N&&(Z=Rr(N.get("smooth"))),g.setShape({smooth:L,stackedOnSmooth:Z,smoothMonotone:_,connectNulls:C}),(0,e5.WO)(g,e,"areaStyle"),(0,e2.A)(g).seriesIndex=e.seriesIndex,(0,e5.k5)(g,O,E,D)}var j=function(e){i._changePolyState(e)};s.eachItemGraphicEl(function(e){e&&(e.onHoverStateChange=j)}),this._polyline.onHoverStateChange=j,this._data=s,this._coordSys=o,this._stackedOnPoints=w,this._points=c,this._step=T,this._valueOrigin=b,e.get("triggerLineEvent")&&(this.packEventData(e,f),g&&this.packEventData(e,g))},t.prototype.packEventData=function(e,t){(0,e2.A)(t).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,t,n,r){var i=e.getData(),o=t4.gO(i,r);if(this._changePolyState("emphasis"),o instanceof Array||null==o||!(o>=0))tn.Z.prototype.highlight.call(this,e,t,n,r);else{var a=i.getLayout("points"),s=i.getItemGraphicEl(o);if(!s){var l=a[2*o],u=a[2*o+1];if(isNaN(l)||isNaN(u)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var c=e.get("zlevel")||0,d=e.get("z")||0;(s=new PG.Z(i,o)).x=l,s.y=u,s.setZ(c,d);var h=s.getSymbolPath().getTextContent();h&&(h.zlevel=c,h.z=d,h.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}},t.prototype.downplay=function(e,t,n,r){var i=e.getData(),o=t4.gO(i,r);if(this._changePolyState("normal"),null!=o&&o>=0){var a=i.getItemGraphicEl(o);a&&(a.__temp?(i.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else tn.Z.prototype.downplay.call(this,e,t,n,r)},t.prototype._changePolyState=function(e){var t=this._polygon;(0,e5.Gl)(this._polyline,e),t&&(0,e5.Gl)(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new P4({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new P8({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var r,i,o=t.getBaseAxis(),a=o.inverse;"cartesian2d"===t.type?(r=o.isHorizontal(),i=!1):"polar"===t.type&&(r="angle"===o.dim,i=!0);var s=e.hostModel,l=s.get("animationDuration");eB.mf(l)&&(l=l(null));var u=s.get("animationDelay")||0,c=eB.mf(u)?u(null):u;e.eachItemGraphicEl(function(e,o){if(e){var s=[e.x,e.y],d=void 0,h=void 0,p=void 0;if(n){if(i){var f=t.pointToCoord(s);r?(d=n.startAngle,h=n.endAngle,p=-f[1]/180*Math.PI):(d=n.r0,h=n.r,p=f[0])}else r?(d=n.x,h=n.x+n.width,p=e.x):(d=n.y+n.height,h=n.y,p=e.y)}var g=h===d?0:(p-d)/(h-d);a&&(g=1-g);var m=eB.mf(u)?u(o):l*g+c,v=e.getSymbolPath(),y=v.getTextContent();e.attr({scaleX:0,scaleY:0}),e.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:m}),y&&y.animateFrom({style:{opacity:0}},{duration:300,delay:m}),v.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,t,n){var r=e.getModel("endLabel");if(Ra(e)){var i,o,a,s=e.getData(),l=this._polyline,u=s.getLayout("points");if(!u){l.removeTextContent(),this._endLabel=null;return}var c=this._endLabel;c||((c=this._endLabel=new nt.ZP({z2:200})).ignoreClip=!0,l.setTextContent(this._endLabel),l.disableLabelAnimation=!0);var d=function(e){for(var t,n,r=e.length/2;r>0&&(t=e[2*r-2],n=e[2*r-1],isNaN(t)||isNaN(n));r--);return r-1}(u);d>=0&&((0,e3.ni)(l,(0,e3.k3)(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:d,defaultText:function(e,t,n){return null!=n?(0,ti.O)(s,n):(0,ti.H)(s,e)},enableTextSetter:!0},(o=(i=t.getBaseAxis()).isHorizontal(),a=i.inverse,{normal:{align:r.get("align")||(o?a?"right":"left":"center"),verticalAlign:r.get("verticalAlign")||(o?"middle":a?"top":"bottom")}})),l.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,t,n,r,i,o,a){var s=this._endLabel,l=this._polyline;if(s){e<1&&null==r.originalX&&(r.originalX=s.x,r.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,d=c.get("connectNulls"),h=o.get("precision"),p=o.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),m=f.inverse,v=t.shape,y=m?g?v.x:v.y+v.height:g?v.x+v.width:v.y,b=(g?p:0)*(m?-1:1),x=(g?0:-p)*(m?-1:1),w=g?"x":"y",S=function(e,t,n){for(var r,i,o=e.length/2,a=+("x"!==n),s=0,l=-1,u=0;u<o;u++)if(!(isNaN(i=e[2*u+a])||isNaN(e[2*u+1-a]))){if(0===u){r=i;continue}if(r<=t&&i>=t||r>=t&&i<=t){l=u;break}s=u,r=i}return{range:[s,l],t:(t-r)/(i-r)}}(u,y,w),C=S.range,k=C[1]-C[0],M=void 0;if(k>=1){if(k>1&&!d){var T=Ro(u,C[0]);s.attr({x:T[0]+b,y:T[1]+x}),i&&(M=c.getRawValue(C[0]))}else{var T=l.getPointOn(y,w);T&&s.attr({x:T[0]+b,y:T[1]+x});var A=c.getRawValue(C[0]),I=c.getRawValue(C[1]);i&&(M=t4.pk(n,h,A,I,S.t))}r.lastFrameIndex=C[0]}else{var P=1===e||r.lastFrameIndex>0?C[0]:0,T=Ro(u,P);i&&(M=c.getRawValue(P)),s.attr({x:T[0]+b,y:T[1]+x})}if(i){var R=(0,e3.qA)(s);"function"==typeof R.setLabelText&&R.setLabelText(M)}}},t.prototype._doUpdateAnimation=function(e,t,n,r,i,o,a){var s=this._polyline,l=this._polygon,u=e.hostModel,c=function(e,t,n,r,i,o,a,s){for(var l,u=(l=[],t.diff(e).add(function(e){l.push({cmd:"+",idx:e})}).update(function(e,t){l.push({cmd:"=",idx:t,idx1:e})}).remove(function(e){l.push({cmd:"-",idx:e})}).execute(),l),c=[],d=[],h=[],p=[],f=[],g=[],m=[],v=PK(i,t,a),y=e.getLayout("points")||[],b=t.getLayout("points")||[],x=0;x<u.length;x++){var w=u[x],S=!0,C=void 0,k=void 0;switch(w.cmd){case"=":C=2*w.idx,k=2*w.idx1;var M=y[C],T=y[C+1],A=b[k],I=b[k+1];(isNaN(M)||isNaN(T))&&(M=A,T=I),c.push(M,T),d.push(A,I),h.push(n[C],n[C+1]),p.push(r[k],r[k+1]),m.push(t.getRawIndex(w.idx1));break;case"+":var P=w.idx,R=v.dataDimsForPoint,O=i.dataToPoint([t.get(R[0],P),t.get(R[1],P)]);k=2*P,c.push(O[0],O[1]),d.push(b[k],b[k+1]);var E=PY(v,i,t,P);h.push(E[0],E[1]),p.push(r[k],r[k+1]),m.push(t.getRawIndex(P));break;case"-":S=!1}S&&(f.push(w),g.push(g.length))}g.sort(function(e,t){return m[e]-m[t]});for(var D=c.length,L=(0,PX.o)(D),_=(0,PX.o)(D),N=(0,PX.o)(D),Z=(0,PX.o)(D),j=[],x=0;x<g.length;x++){var B=g[x],F=2*x,z=2*B;L[F]=c[z],L[F+1]=c[z+1],_[F]=d[z],_[F+1]=d[z+1],N[F]=h[z],N[F+1]=h[z+1],Z[F]=p[z],Z[F+1]=p[z+1],j[x]=f[B]}return{current:L,next:_,stackedOnCurrent:N,stackedOnNext:Z,status:j}}(this._data,e,this._stackedOnPoints,t,this._coordSys,0,this._valueOrigin,0),d=c.current,h=c.stackedOnCurrent,p=c.next,f=c.stackedOnNext;if(i&&(d=Ri(c.current,n,i,a),h=Ri(c.stackedOnCurrent,n,i,a),p=Ri(c.next,n,i,a),f=Ri(c.stackedOnNext,n,i,a)),Rn(d,p)>3e3||l&&Rn(h,f)>3e3){s.stopAnimation(),s.setShape({points:p}),l&&(l.stopAnimation(),l.setShape({points:p,stackedOnPoints:f}));return}s.shape.__points=c.current,s.shape.points=d;var g={shape:{points:p}};c.current!==d&&(g.shape.__points=c.next),s.stopAnimation(),eQ.D(s,g,u),l&&(l.setShape({points:d,stackedOnPoints:h}),l.stopAnimation(),eQ.D(l,{shape:{stackedOnPoints:f}},u),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var m=[],v=c.status,y=0;y<v.length;y++)if("="===v[y].cmd){var b=e.getItemGraphicEl(v[y].idx1);b&&m.push({el:b,ptIdx:y})}s.animators&&s.animators.length&&s.animators[0].during(function(){l&&l.dirtyShape();for(var e=s.shape.__points,t=0;t<m.length;t++){var n=m[t].el,r=2*m[t].ptIdx;n.x=e[r],n.y=e[r+1],n.markRedraw()}})},t.prototype.remove=function(e){var t=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl(function(e,r){e.__temp&&(t.remove(e),n.setItemGraphicEl(r,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},t.type="line",t}(tn.Z),Ru=n(3706);function Rc(e){e.registerChartView(Rl),e.registerSeriesModel(PW),e.registerLayout((0,Ru.Z)("line",!0)),e.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,eV("line"))}function Rd(e,t){if(!e)return!1;for(var n=(0,eB.kJ)(e)?e:[e],r=0;r<n.length;r++)if(n[r]&&n[r][t])return!0;return!1}var Rh=n(4647),Rp=n(8780),Rf=n(5352),Rg=n(1481);function Rm(e){(0,t4.Cc)(e,"label",["show"])}var Rv=(0,t4.Yf)(),Ry=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n}return(0,eH.ZT)(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(Rh.Z.node)return!1;var e=this.__hostSeries;return this.getShallow("animation")&&e&&e.isAnimationEnabled()},t.prototype.mergeOption=function(e,t){this._mergeOption(e,t,!1,!1)},t.prototype._mergeOption=function(e,t,n,r){var i=this.mainType;n||t.eachSeries(function(e){var n=e.get(this.mainType,!0),o=Rv(e)[i];if(!n||!n.data){Rv(e)[i]=null;return}o?o._mergeOption(n,t,!0):(r&&Rm(n),eB.S6(n.data,function(e){e instanceof Array?(Rm(e[0]),Rm(e[1])):Rm(e)}),o=this.createMarkerModelFromSeries(n,this,t),eB.l7(o,{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),Rv(e)[i]=o},this)},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e),o=r.getName(e);return(0,Rg.TX)("section",{header:this.name,blocks:[(0,Rg.TX)("nameValue",{name:o,value:i,noName:!o,noValue:null==i})]})},t.prototype.getData=function(){return this._data},t.prototype.setData=function(e){this._data=e},t.getMarkerModelFromSeries=function(e,t){return Rv(e)[t]},t.type="marker",t.dependencies=["series","grid","polar","geo"],t}(Rf.Z);eB.jB(Ry,Rp.X.prototype);var Rb=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(Ry),Rx=n(4484),Rw=n(4503);function RS(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function RC(e,t,n,r,i,o){var a=[],s=(0,PU.M)(t,r)?t.getCalculationInfo("stackResultDimension"):r,l=RP(t,s,e),u=t.indicesOfNearest(s,l)[0];a[i]=t.get(n,u),a[o]=t.get(s,u);var c=t.get(r,u),d=e6.p8(t.get(r,u));return(d=Math.min(d,20))>=0&&(a[o]=+a[o].toFixed(d)),[a,c]}var Rk={min:(0,eB.WA)(RC,"min"),max:(0,eB.WA)(RC,"max"),average:(0,eB.WA)(RC,"average"),median:(0,eB.WA)(RC,"median")};function RM(e,t){if(t){var n,r=e.getData(),i=e.coordinateSystem,o=i&&i.dimensions;if(!(!isNaN(parseFloat((n=t).x))&&!isNaN(parseFloat(n.y)))&&!(0,eB.kJ)(t.coord)&&(0,eB.kJ)(o)){var a=RT(t,r,i,e);if((t=(0,eB.d9)(t)).type&&Rk[t.type]&&a.baseAxis&&a.valueAxis){var s=(0,eB.cq)(o,a.baseAxis.dim),l=(0,eB.cq)(o,a.valueAxis.dim),u=Rk[t.type](r,a.baseDataDim,a.valueDataDim,s,l);t.coord=u[0],t.value=u[1]}else t.coord=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis]}if(null!=t.coord&&(0,eB.kJ)(o))for(var c=t.coord,d=0;d<2;d++)Rk[c[d]]&&(c[d]=RP(r,r.mapDimension(o[d]),c[d]));else t.coord=[];return t}}function RT(e,t,n,r){var i,o,a,s={};return null!=e.valueIndex||null!=e.valueDim?(s.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,s.valueAxis=n.getAxis((i=r,o=s.valueDataDim,(a=i.getData().getDimensionInfo(o))&&a.coordDim)),s.baseAxis=n.getOtherAxis(s.valueAxis),s.baseDataDim=t.mapDimension(s.baseAxis.dim)):(s.baseAxis=r.getBaseAxis(),s.valueAxis=n.getOtherAxis(s.baseAxis),s.baseDataDim=t.mapDimension(s.baseAxis.dim),s.valueDataDim=t.mapDimension(s.valueAxis.dim)),s}function RA(e,t){return!e||!e.containData||!t.coord||!!RS(t)||e.containData(t.coord)}function RI(e,t){return e?function(e,n,r,i){var o=i<2?e.coord&&e.coord[i]:e.value;return(0,Rw.yQ)(o,t[i])}:function(e,n,r,i){return(0,Rw.yQ)(e.value,t[i])}}function RP(e,t,n){if("average"===n){var r=0,i=0;return e.each(t,function(e,t){!isNaN(e)&&(r+=e,i++)}),r/i}return"median"===n?e.getMedian(t):e.getDataExtent(t)[+("max"===n)]}var RR=n(4292),RO=(0,t4.Yf)(),RE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.init=function(){this.markerGroupMap=(0,eB.kW)()},t.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each(function(e){RO(e).keep=!1}),t.eachSeries(function(e){var i=Ry.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)}),i.each(function(e){RO(e).keep||r.group.remove(e.group)})},t.prototype.markKeep=function(e){RO(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;(0,eB.S6)(e,function(e){var r=Ry.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl(function(e){e&&(t?(0,e5.SX)(e):(0,e5.VP)(e))})})},t.type="marker",t}(RR.Z),RD=n(3928),RL=(0,t4.Yf)(),R_=function(e,t,n,r){var i=r[0],o=r[1];if(i&&o){var a=RM(e,i),s=RM(e,o),l=a.coord,u=s.coord;l[0]=(0,eB.Jv)(l[0],-1/0),l[1]=(0,eB.Jv)(l[1],-1/0),u[0]=(0,eB.Jv)(u[0],1/0),u[1]=(0,eB.Jv)(u[1],1/0);var c=(0,eB.Jn)([{},a,s]);return c.coord=[a.coord,s.coord],c.x0=a.x,c.y0=a.y,c.x1=s.x,c.y1=s.y,c}};function RN(e){return!isNaN(e)&&!isFinite(e)}function RZ(e,t,n,r){var i=1-e;return RN(t[i])&&RN(n[i])}function Rj(e,t){var n=t.coord[0],r=t.coord[1],i={coord:n,x:t.x0,y:t.y0},o={coord:r,x:t.x1,y:t.y1};if(tr(e,"cartesian2d"))return!!(n&&r&&(RZ(1,n,r,e)||RZ(0,n,r,e)))||!e||!e.containZone||!i.coord||!o.coord||!!RS(i)||!!RS(o)||e.containZone(i.coord,o.coord);return RA(e,i)||RA(e,o)}function RB(e,t,n,r,i){var o,a=r.coordinateSystem,s=e.getItemModel(t),l=e6.GM(s.get(n[0]),i.getWidth()),u=e6.GM(s.get(n[1]),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition){var c=e.getValues(["x0","y0"],t),d=e.getValues(["x1","y1"],t),h=a.clampData(c),p=a.clampData(d),f=[];"x0"===n[0]?f[0]=h[0]>p[0]?d[0]:c[0]:f[0]=h[0]>p[0]?c[0]:d[0],"y0"===n[1]?f[1]=h[1]>p[1]?d[1]:c[1]:f[1]=h[1]>p[1]?c[1]:d[1],o=r.getMarkerPosition(f,n,!0)}else{var g=e.get(n[0],t),m=e.get(n[1],t),v=[g,m];a.clampData&&a.clampData(v,v),o=a.dataToPoint(v,!0)}if(tr(a,"cartesian2d")){var y=a.getAxis("x"),b=a.getAxis("y"),g=e.get(n[0],t),m=e.get(n[1],t);RN(g)?o[0]=y.toGlobalCoord(y.getExtent()[+("x0"!==n[0])]):RN(m)&&(o[1]=b.toGlobalCoord(b.getExtent()[+("y0"!==n[1])]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var RF=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],Rz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=Ry.getMarkerModelFromSeries(e,"markArea");if(t){var r=t.getData();r.each(function(t){var i=(0,eB.UI)(RF,function(i){return RB(r,t,i,e,n)});r.setItemLayout(t,i),r.getItemGraphicEl(t).setShape("points",i)})}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new eX.Z});this.group.add(l.group),this.markKeep(l);var u=function(e,t,n){if(e){var r,i,o=(0,eB.UI)(e&&e.dimensions,function(e){var n=t.getData(),r=n.getDimensionInfo(n.mapDimension(e))||{};return(0,eB.l7)((0,eB.l7)({},r),{name:e,ordinalMeta:null})});i=(0,eB.UI)(["x0","y0","x1","y1"],function(e,t){return{name:e,type:o[t%2].type}}),r=new vO.Z(i,n)}else i=[{name:"value",type:"float"}],r=new vO.Z(i,n);var a=(0,eB.UI)(n.get("data"),(0,eB.WA)(R_,t,e,n));e&&(a=(0,eB.hX)(a,(0,eB.WA)(Rj,e)));var s=e?function(e,t,n,r){var o=e.coord[Math.floor(r/2)][r%2];return(0,Rw.yQ)(o,i[r])}:function(e,t,n,r){return(0,Rw.yQ)(e.value,i[r])};return r.initData(a,null,s),r.hasItemOption=!0,r}(i,e,t);t.setData(u),u.each(function(t){var n=(0,eB.UI)(RF,function(n){return RB(u,t,n,e,r)}),o=i.getAxis("x").scale,s=i.getAxis("y").scale,l=o.getExtent(),c=s.getExtent(),d=[o.parse(u.get("x0",t)),o.parse(u.get("x1",t))],h=[s.parse(u.get("y0",t)),s.parse(u.get("y1",t))];e6.dt(d),e6.dt(h);var p=!(l[0]>d[1]||l[1]<d[0]||c[0]>h[1]||c[1]<h[0]);u.setItemLayout(t,{points:n,allClipped:!p});var f=u.getItemModel(t).getModel("itemStyle").getItemStyle(),g=(0,RD.UL)(a,"color");!f.fill&&(f.fill=g,(0,eB.HD)(f.fill)&&(f.fill=P7.m8(f.fill,.4))),f.stroke||(f.stroke=g),u.setItemVisual(t,"style",f)}),u.diff(RL(l).data).add(function(e){var t=u.getItemLayout(e);if(!t.allClipped){var n=new Rx.Z({shape:{points:t.points}});u.setItemGraphicEl(e,n),l.group.add(n)}}).update(function(e,n){var r=RL(l).data.getItemGraphicEl(n),i=u.getItemLayout(e);i.allClipped?r&&l.group.remove(r):(r?eQ.D(r,{shape:{points:i.points}},t,e):r=new Rx.Z({shape:{points:i.points}}),u.setItemGraphicEl(e,r),l.group.add(r))}).remove(function(e){var t=RL(l).data.getItemGraphicEl(e);l.group.remove(t)}).execute(),u.eachItemGraphicEl(function(e,n){var r=u.getItemModel(n),i=u.getItemVisual(n,"style");e.useStyle(u.getItemVisual(n,"style")),(0,e3.ni)(e,(0,e3.k3)(r),{labelFetcher:t,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:(0,eB.HD)(i.fill)?P7.m8(i.fill,1):"#000"}),(0,e5.WO)(e,r),(0,e5.k5)(e,null,null,r.get(["emphasis","disabled"])),(0,e2.A)(e).dataModel=t}),RL(l).data=u,l.group.silent=t.get("silent")||e.get("silent")},t.type="markArea",t}(RE);function R$(e){e.registerComponentModel(Rb),e.registerComponentView(Rz),e.registerPreprocessor(function(e){Rd(e.series,"markArea")&&(e.markArea=e.markArea||{})})}var RV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(Ry),RH=n(7605),RW=n(121),Rq=vM.Z.prototype,RG=RW.Z.prototype,RU=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function RK(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}(0,eH.ZT)(function(){return null!==RU&&RU.apply(this,arguments)||this},RU);var RY=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-line",n}return(0,eH.ZT)(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new RU},t.prototype.buildPath=function(e,t){RK(t)?Rq.buildPath.call(this,e,t):RG.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return RK(this.shape)?Rq.pointAt.call(this,e):RG.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=RK(t)?[t.x2-t.x1,t.y2-t.y1]:RG.tangentAt.call(this,e);return RH.Fv(n,n)},t}(eY.ZP),RX=["fromSymbol","toSymbol"];function RJ(e){return"_"+e+"Type"}function RQ(e,t,n){var r=t.getItemVisual(n,e);if(!r||"none"===r)return r;var i=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=vT.zp(i),u=vT.Cq(a||0,l);return r+l+u+(o||"")+(s||"")}function R0(e,t,n){var r=t.getItemVisual(n,e);if(r&&"none"!==r){var i=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=vT.zp(i),u=vT.Cq(a||0,l),c=vT.th(r,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return c.__specifiedRotation=null==o||isNaN(o)?void 0:+o*Math.PI/180||0,c.name=e,c}}function R1(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var n=t[2];n?(e.cpx1=n[0],e.cpy1=n[1]):(e.cpx1=NaN,e.cpy1=NaN)}var R2=function(e){function t(t,n,r){var i=e.call(this)||this;return i._createLine(t,n,r),i}return(0,eH.ZT)(t,e),t.prototype._createLine=function(e,t,n){var r,i,o=e.hostModel,a=(r=e.getItemLayout(t),R1((i=new RY({name:"line",subPixelOptimize:!0})).shape,r),i);a.shape.percent=0,eQ.KZ(a,{shape:{percent:1}},o,t),this.add(a),(0,eB.S6)(RX,function(n){var r=R0(n,e,t);this.add(r),this[RJ(n)]=RQ(n,e,t)},this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel,i=this.childOfName("line"),o=e.getItemLayout(t),a={shape:{}};R1(a.shape,o),eQ.D(i,a,r,t),(0,eB.S6)(RX,function(n){var r=RQ(n,e,t),i=RJ(n);if(this[i]!==r){this.remove(this.childOfName(n));var o=R0(n,e,t);this.add(o)}this[i]=r},this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var r=e.hostModel,i=this.childOfName("line"),o=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,c=n&&n.focus,d=n&&n.blurScope;if(!n||e.hasItemOption){var h=e.getItemModel(t),p=h.getModel("emphasis");o=p.getModel("lineStyle").getLineStyle(),a=h.getModel(["blur","lineStyle"]).getLineStyle(),s=h.getModel(["select","lineStyle"]).getLineStyle(),u=p.get("disabled"),c=p.get("focus"),d=p.get("blurScope"),l=(0,e3.k3)(h)}var f=e.getItemVisual(t,"style"),g=f.stroke;i.useStyle(f),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState("emphasis").style=o,i.ensureState("blur").style=a,i.ensureState("select").style=s,(0,eB.S6)(RX,function(e){var t=this.childOfName(e);if(t){t.setColor(g),t.style.opacity=f.opacity;for(var n=0;n<e5.L1.length;n++){var r=e5.L1[n],o=i.getState(r);if(o){var a=o.style||{},s=t.ensureState(r),l=s.style||(s.style={});null!=a.stroke&&(l[t.__isEmptyBrush?"stroke":"fill"]=a.stroke),null!=a.opacity&&(l.opacity=a.opacity)}}t.markRedraw()}},this);var m=r.getRawValue(t);(0,e3.ni)(this,l,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,n){return r.getFormattedLabel(t,n,e.dataType)}},inheritColor:g||"#000",defaultOpacity:f.opacity,defaultText:(null==m?e.getName(t):isFinite(m)?(0,e6.NM)(m):m)+""});var v=this.getTextContent();if(v){var y=l.normal;v.__align=v.style.align,v.__verticalAlign=v.style.verticalAlign,v.__position=y.get("position")||"middle";var b=y.get("distance");(0,eB.kJ)(b)||(b=[b,b]),v.__labelDistance=b}this.setTextConfig({position:null,local:!0,inside:!1}),(0,e5.k5)(this,c,d,u)},t.prototype.highlight=function(){(0,e5.fD)(this)},t.prototype.downplay=function(){(0,e5.Mh)(this)},t.prototype.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName("line");R1(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this.childOfName("fromSymbol"),t=this.childOfName("toSymbol"),n=this.getTextContent();if(e||t||n&&!n.ignore){for(var r=1,i=this.parent;i;)i.scaleX&&(r/=i.scaleX),i=i.parent;var o=this.childOfName("line");if(this.__dirty||o.__dirty){var a=o.shape.percent,s=o.pointAt(0),l=o.pointAt(a),u=RH.lu([],l,s);if(RH.Fv(u,u),e&&(e.setPosition(s),S(e,0),e.scaleX=e.scaleY=r*a,e.markRedraw()),t&&(t.setPosition(l),S(t,1),t.scaleX=t.scaleY=r*a,t.markRedraw()),n&&!n.ignore){n.x=n.y=0,n.originX=n.originY=0;var c=void 0,d=void 0,h=n.__labelDistance,p=h[0]*r,f=h[1]*r,g=a/2,m=o.tangentAt(g),v=[m[1],-m[0]],y=o.pointAt(g);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]);var b=m[0]<0?-1:1;if("start"!==n.__position&&"end"!==n.__position){var x=-Math.atan2(m[1],m[0]);l[0]<s[0]&&(x=Math.PI+x),n.rotation=x}var w=void 0;switch(n.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":w=-f,d="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=f,d="top";break;default:w=0,d="middle"}switch(n.__position){case"end":n.x=u[0]*p+l[0],n.y=u[1]*f+l[1],c=u[0]>.8?"left":u[0]<-.8?"right":"center",d=u[1]>.8?"top":u[1]<-.8?"bottom":"middle";break;case"start":n.x=-u[0]*p+s[0],n.y=-u[1]*f+s[1],c=u[0]>.8?"right":u[0]<-.8?"left":"center",d=u[1]>.8?"bottom":u[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":n.x=p*b+s[0],n.y=s[1]+w,c=m[0]<0?"right":"left",n.originX=-p*b,n.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":n.x=y[0],n.y=y[1]+w,c="center",n.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":n.x=-p*b+l[0],n.y=l[1]+w,c=m[0]>=0?"right":"left",n.originX=p*b,n.originY=-w}n.scaleX=n.scaleY=r,n.setStyle({verticalAlign:n.__verticalAlign||d,align:n.__align||c})}}}function S(e,t){var n=e.__specifiedRotation;if(null==n){var r=o.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(r[1],r[0]))}else e.attr("rotation",n)}},t}(eX.Z),R5=function(){function e(e){this.group=new eX.Z,this._LineCtor=e||R2}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this.group,r=this._lineData;this._lineData=e,r||n.removeAll();var i=R3(e);e.diff(r).add(function(n){t._doAdd(e,n,i)}).update(function(n,o){t._doUpdate(r,e,o,n,i)}).remove(function(e){n.remove(r.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=R3(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){function n(e){var t;e.isGroup||(t=e).animators&&t.animators.length>0||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var r=e.start;r<e.end;r++)if(R6(t.getItemLayout(r))){var i=new this._LineCtor(t,r,this._seriesScope);i.traverse(n),this.group.add(i),t.setItemGraphicEl(r,i),this._progressiveEls.push(i)}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){eJ.traverseElements(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,n){if(R6(e.getItemLayout(t))){var r=new this._LineCtor(e,t,n);e.setItemGraphicEl(t,r),this.group.add(r)}},e.prototype._doUpdate=function(e,t,n,r,i){var o=e.getItemGraphicEl(n);if(!R6(t.getItemLayout(r))){this.group.remove(o);return}o?o.updateData(t,r,i):o=new this._LineCtor(t,r,i),t.setItemGraphicEl(r,o),this.group.add(o)},e}();function R3(e){var t=e.hostModel,n=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:(0,e3.k3)(t)}}function R4(e){return isNaN(e[0])||isNaN(e[1])}function R6(e){return e&&!R4(e[0])&&!R4(e[1])}var R8=(0,t4.Yf)(),R9=function(e,t,n,r){var i,o=e.getData();if((0,eB.kJ)(r))i=r;else{var a=r.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=r.xAxis||null!=r.yAxis){var s=void 0,l=void 0;if(null!=r.yAxis||null!=r.xAxis)s=t.getAxis(null!=r.yAxis?"y":"x"),l=(0,eB.Jv)(r.yAxis,r.xAxis);else{var u=RT(r,o,t,e);s=u.valueAxis;var c=(0,PU.IR)(o,u.valueDataDim);l=RP(o,c,a)}var d=+("x"!==s.dim),h=1-d,p=(0,eB.d9)(r),f={coord:[]};p.type=null,p.coord=[],p.coord[h]=-1/0,f.coord[h]=1/0;var g=n.get("precision");g>=0&&(0,eB.hj)(l)&&(l=+l.toFixed(Math.min(g,20))),p.coord[d]=f.coord[d]=l,i=[p,f,{type:a,valueIndex:r.valueIndex,value:l}]}else i=[]}var m=[RM(e,i[0]),RM(e,i[1]),(0,eB.l7)({},i[2])];return m[2].type=m[2].type||null,(0,eB.TS)(m[2],m[0]),(0,eB.TS)(m[2],m[1]),m};function R7(e){return!isNaN(e)&&!isFinite(e)}function Oe(e,t,n,r){var i=1-e,o=r.dimensions[e];return R7(t[i])&&R7(n[i])&&t[e]===n[e]&&r.getAxis(o).containData(t[e])}function Ot(e,t){if("cartesian2d"===e.type){var n=t[0].coord,r=t[1].coord;if(n&&r&&(Oe(1,n,r,e)||Oe(0,n,r,e)))return!0}return RA(e,t[0])&&RA(e,t[1])}function On(e,t,n,r,i){var o,a=r.coordinateSystem,s=e.getItemModel(t),l=e6.GM(s.get("x"),i.getWidth()),u=e6.GM(s.get("y"),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition)o=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=a.dimensions,d=e.get(c[0],t),h=e.get(c[1],t);o=a.dataToPoint([d,h])}if(tr(a,"cartesian2d")){var p=a.getAxis("x"),f=a.getAxis("y"),c=a.dimensions;R7(e.get(c[0],t))?o[0]=p.toGlobalCoord(p.getExtent()[+!n]):R7(e.get(c[1],t))&&(o[1]=f.toGlobalCoord(f.getExtent()[+!n]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];e.setItemLayout(t,o)}var Or=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=Ry.getMarkerModelFromSeries(e,"markLine");if(t){var r=t.getData(),i=R8(t).from,o=R8(t).to;i.each(function(t){On(i,t,!0,e,n),On(o,t,!1,e,n)}),r.each(function(e){r.setItemLayout(e,[i.getItemLayout(e),o.getItemLayout(e)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},t.prototype.renderSeries=function(e,t,n,r){var i,o,a,s,l,u,c,d,h,p=e.coordinateSystem,f=e.id,g=e.getData(),m=this.markerGroupMap,v=m.get(f)||m.set(f,new R5);this.group.add(v.group);var y=(i=p,o=e,a=t,s=i?(0,eB.UI)(i&&i.dimensions,function(e){var t=o.getData().getDimensionInfo(o.getData().mapDimension(e))||{};return(0,eB.l7)((0,eB.l7)({},t),{name:e,ordinalMeta:null})}):[{name:"value",type:"float"}],l=new vO.Z(s,a),u=new vO.Z(s,a),c=new vO.Z([],a),d=(0,eB.UI)(a.get("data"),(0,eB.WA)(R9,o,i,a)),i&&(d=(0,eB.hX)(d,(0,eB.WA)(Ot,i))),h=RI(!!i,s),l.initData((0,eB.UI)(d,function(e){return e[0]}),null,h),u.initData((0,eB.UI)(d,function(e){return e[1]}),null,h),c.initData((0,eB.UI)(d,function(e){return e[2]})),c.hasItemOption=!0,{from:l,to:u,line:c}),b=y.from,x=y.to,w=y.line;R8(t).from=b,R8(t).to=x,t.setData(w);var S=t.get("symbol"),C=t.get("symbolSize"),k=t.get("symbolRotate"),M=t.get("symbolOffset");function T(t,n,i){var o=t.getItemModel(n);On(t,n,i,e,r);var a=o.getModel("itemStyle").getItemStyle();null==a.fill&&(a.fill=(0,RD.UL)(g,"color")),t.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:(0,eB.pD)(o.get("symbolOffset",!0),M[+!i]),symbolRotate:(0,eB.pD)(o.get("symbolRotate",!0),k[+!i]),symbolSize:(0,eB.pD)(o.get("symbolSize"),C[+!i]),symbol:(0,eB.pD)(o.get("symbol",!0),S[+!i]),style:a})}(0,eB.kJ)(S)||(S=[S,S]),(0,eB.kJ)(C)||(C=[C,C]),(0,eB.kJ)(k)||(k=[k,k]),(0,eB.kJ)(M)||(M=[M,M]),y.from.each(function(e){T(b,e,!0),T(x,e,!1)}),w.each(function(e){var t=w.getItemModel(e).getModel("lineStyle").getLineStyle();w.setItemLayout(e,[b.getItemLayout(e),x.getItemLayout(e)]),null==t.stroke&&(t.stroke=b.getItemVisual(e,"style").fill),w.setItemVisual(e,{fromSymbolKeepAspect:b.getItemVisual(e,"symbolKeepAspect"),fromSymbolOffset:b.getItemVisual(e,"symbolOffset"),fromSymbolRotate:b.getItemVisual(e,"symbolRotate"),fromSymbolSize:b.getItemVisual(e,"symbolSize"),fromSymbol:b.getItemVisual(e,"symbol"),toSymbolKeepAspect:x.getItemVisual(e,"symbolKeepAspect"),toSymbolOffset:x.getItemVisual(e,"symbolOffset"),toSymbolRotate:x.getItemVisual(e,"symbolRotate"),toSymbolSize:x.getItemVisual(e,"symbolSize"),toSymbol:x.getItemVisual(e,"symbol"),style:t})}),v.updateData(w),y.line.eachItemGraphicEl(function(e){(0,e2.A)(e).dataModel=t,e.traverse(function(e){(0,e2.A)(e).dataModel=t})}),this.markKeep(v),v.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(RE);function Oi(e){e.registerComponentModel(RV),e.registerComponentView(Or),e.registerPreprocessor(function(e){Rd(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var Oo=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markPoint",t.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},t}(Ry);function Oa(e,t,n){var r=t.coordinateSystem;e.each(function(i){var o,a=e.getItemModel(i),s=e6.GM(a.get("x"),n.getWidth()),l=e6.GM(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)o=t.getMarkerPosition(e.getValues(e.dimensions,i));else if(r){var u=e.get(r.dimensions[0],i),c=e.get(r.dimensions[1],i);o=r.dataToPoint([u,c])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),e.setItemLayout(i,o)})}var Os=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=Ry.getMarkerModelFromSeries(e,"markPoint");t&&(Oa(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())},this)},t.prototype.renderSeries=function(e,t,n,r){var i,o,a,s,l,u,c,d=e.coordinateSystem,h=e.id,p=e.getData(),f=this.markerGroupMap,g=f.get(h)||f.set(h,new Pq.Z),m=(i=d,o=e,a=t,s=i?(0,eB.UI)(i&&i.dimensions,function(e){var t=o.getData().getDimensionInfo(o.getData().mapDimension(e))||{};return(0,eB.l7)((0,eB.l7)({},t),{name:e,ordinalMeta:null})}):[{name:"value",type:"float"}],l=new vO.Z(s,a),u=(0,eB.UI)(a.get("data"),(0,eB.WA)(RM,o)),i&&(u=(0,eB.hX)(u,(0,eB.WA)(RA,i))),c=RI(!!i,s),l.initData(u,null,c),l);t.setData(m),Oa(t.getData(),e,r),m.each(function(e){var n=m.getItemModel(e),r=n.getShallow("symbol"),i=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),a=n.getShallow("symbolOffset"),s=n.getShallow("symbolKeepAspect");if((0,eB.mf)(r)||(0,eB.mf)(i)||(0,eB.mf)(o)||(0,eB.mf)(a)){var l=t.getRawValue(e),u=t.getDataParams(e);(0,eB.mf)(r)&&(r=r(l,u)),(0,eB.mf)(i)&&(i=i(l,u)),(0,eB.mf)(o)&&(o=o(l,u)),(0,eB.mf)(a)&&(a=a(l,u))}var c=n.getModel("itemStyle").getItemStyle(),d=(0,RD.UL)(p,"color");c.fill||(c.fill=d),m.setItemVisual(e,{symbol:r,symbolSize:i,symbolRotate:o,symbolOffset:a,symbolKeepAspect:s,style:c})}),g.updateData(m),this.group.add(g.group),m.eachItemGraphicEl(function(e){e.traverse(function(e){(0,e2.A)(e).dataModel=t})}),this.markKeep(g),g.group.silent=t.get("silent")||e.get("silent")},t.type="markPoint",t}(RE);function Ol(e){e.registerComponentModel(Oo),e.registerComponentView(Os),e.registerPreprocessor(function(e){Rd(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var Ou=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.type="dataZoom.select",t}(n(4677).Z),Oc=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.type="dataZoom.select",t}(n(2877).Z),Od=n(8526);function Oh(e){e.registerComponentModel(Ou),e.registerComponentView(Oc),(0,Od.Z)(e)}var Op=function(){},Of={},Og=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;eB.S6(this.option.feature,function(e,n){var r=Of[n];r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(t)),eB.TS(e,r.defaultOption))})},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},t}(Rf.Z),Om=n(6505),Ov=n(630),Oy=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,eH.ZT)(t,e),t.prototype.render=function(e,t,n,r){var i=this.group;if(i.removeAll(),e.get("show")){var o=+e.get("itemSize"),a="vertical"===e.get("orient"),s=e.get("feature")||{},l=this._features||(this._features={}),u=[];eB.S6(s,function(e,t){u.push(t)}),new nn.Z(this._featureNames||[],u).add(c).update(c).remove(eB.WA(c,null)).execute(),this._featureNames=u,Ov.b(i,e,n),i.add(Ov.l(i.getBoundingRect(),e)),a||i.eachChild(function(e){var t=e.__title,r=e.ensureState("emphasis"),a=r.textConfig||(r.textConfig={}),s=e.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!eB.mf(l)&&t){var u=l.style||(l.style={}),c=to.lP(t,nt.ZP.makeFont(u)),d=e.x+i.x,h=e.y+i.y+o,p=!1;h+c.height>n.getHeight()&&(a.position="top",p=!0);var f=p?-5-c.height:o+10;d+c.width/2>n.getWidth()?(a.position=["100%",f],u.align="right"):d-c.width/2<0&&(a.position=[0,f],u.align="left")}})}function c(c,d){var h,p,f,g,m,v,y,b,x,w,S,C=u[c],k=u[d],M=s[C],T=new Om.Z(M,e,e.ecModel);if(r&&null!=r.newTitle&&r.featureName===C&&(M.title=r.newTitle),C&&!k){if(0===C.indexOf("my"))S={onclick:T.option.onclick,featureName:C};else{var A=Of[C];if(!A)return;S=new A}l[C]=S}else if(!(S=l[k]))return;S.uid=(0,eU.Kr)("toolbox-feature"),S.model=T,S.ecModel=t,S.api=n;var I=S instanceof Op;if(!C&&k){I&&S.dispose&&S.dispose(t,n);return}if(!T.get("show")||I&&S.unusable){I&&S.remove&&S.remove(t,n);return}h=T,p=S,f=C,v=h.getModel("iconStyle"),y=h.getModel(["emphasis","iconStyle"]),b=p instanceof Op&&p.getIcons?p.getIcons():h.get("icon"),x=h.get("title")||{},eB.HD(b)?(g={})[f]=b:g=b,eB.HD(x)?(m={})[f]=x:m=x,w=h.iconPaths={},eB.S6(g,function(r,s){var l=eJ.createIcon(r,{},{x:-o/2,y:-o/2,width:o,height:o});l.setStyle(v.getItemStyle()),l.ensureState("emphasis").style=y.getItemStyle();var u=new nt.ZP({style:{text:m[s],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null,font:(0,e3.qT)({fontStyle:y.get("textFontStyle"),fontFamily:y.get("textFontFamily"),fontSize:y.get("textFontSize"),fontWeight:y.get("textFontWeight")},t)},ignore:!0});l.setTextContent(u),eJ.setTooltipConfig({el:l,componentModel:e,itemName:s,formatterParamsExtra:{title:m[s]}}),l.__title=m[s],l.on("mouseover",function(){var t=y.getItemStyle(),r=a?null==e.get("right")&&"right"!==e.get("left")?"right":"left":null==e.get("bottom")&&"bottom"!==e.get("top")?"bottom":"top";u.setStyle({fill:y.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:y.get("textBackgroundColor")}),l.setTextConfig({position:y.get("textPosition")||r}),u.ignore=!e.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){"emphasis"!==h.get(["iconStatus",s])&&n.leaveEmphasis(this),u.hide()}),("emphasis"===h.get(["iconStatus",s])?e5.fD:e5.Mh)(l),i.add(l),l.on("click",eB.ak(p.onclick,p,t,n,s)),w[s]=l}),T.setIconStatus=function(e,t){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,r[e]&&("emphasis"===t?e5.fD:e5.Mh)(r[e])},S instanceof Op&&S.render&&S.render(T,t,n,r)}},t.prototype.updateView=function(e,t,n,r){eB.S6(this._features,function(e){e instanceof Op&&e.updateView&&e.updateView(e.model,t,n,r)})},t.prototype.remove=function(e,t){eB.S6(this._features,function(n){n instanceof Op&&n.remove&&n.remove(e,t)}),this.group.removeAll()},t.prototype.dispose=function(e,t){eB.S6(this._features,function(n){n instanceof Op&&n.dispose&&n.dispose(e,t)})},t.type="toolbox",t}(RR.Z),Ob=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,eH.ZT)(t,e),t.prototype.onclick=function(e,t){var n=this.model,r=n.get("name")||e.get("title.0.text")||"echarts",i="svg"===t.getZr().painter.getType(),o=i?"svg":n.get("type",!0)||"png",a=t.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=Rh.Z.browser;if((0,eB.mf)(MouseEvent)&&(s.newEdge||!s.ie&&!s.edge)){var l=document.createElement("a");l.download=r+"."+o,l.target="_blank",l.href=a;var u=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(u)}else if(window.navigator.msSaveOrOpenBlob||i){var c=a.split(","),d=c[0].indexOf("base64")>-1,h=i?decodeURIComponent(c[1]):c[1];d&&(h=window.atob(h));var p=r+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var f=h.length,g=new Uint8Array(f);f--;)g[f]=h.charCodeAt(f);var m=new Blob([g]);window.navigator.msSaveOrOpenBlob(m,p)}else{var v=document.createElement("iframe");document.body.appendChild(v);var y=v.contentWindow,b=y.document;b.open("image/svg+xml","replace"),b.write(h),b.close(),y.focus(),b.execCommand("SaveAs",!0,p),document.body.removeChild(v)}}else{var x=n.get("lang"),w='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(x&&x[0]||"")+'" /></body>',S=window.open();S.document.write(w),S.document.title=r}},t.getDefaultOption=function(e){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:e.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},t}(Op),Ox="__ec_magicType_stack__",Ow=[["line","bar"],["stack"]],OS=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,eH.ZT)(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return eB.S6(e.get("type"),function(e){t[e]&&(n[e]=t[e])}),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var r,i=this.model,o=i.get(["seriesIndex",n]);if(OC[n]){var a={series:[]};eB.S6(Ow,function(e){eB.cq(e,n)>=0&&eB.S6(e,function(e){i.setIconStatus(e,"normal")})}),i.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(e){var t=e.subType,r=e.id,o=OC[n](t,r,e,i);o&&(eB.ce(o,e.option),a.series.push(o));var s=e.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",c=e.getReferringComponents(u,t4.C6).models[0].componentIndex;a[u]=a[u]||[];for(var d=0;d<=c;d++)a[u][c]=a[u][c]||{};a[u][c].boundaryGap="bar"===n}}});var s=n;"stack"===n&&(r=eB.TS({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(s="tiled")),t.dispatchAction({type:"changeMagicType",currentType:s,newOption:a,newTitle:r,featureName:"magicType"})}},t}(Op),OC={line:function(e,t,n,r){if("bar"===e)return eB.TS({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","line"])||{},!0)},bar:function(e,t,n,r){if("line"===e)return eB.TS({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","bar"])||{},!0)},stack:function(e,t,n,r){var i=n.get("stack")===Ox;if("line"===e||"bar"===e)return r.setIconStatus("stack",i?"normal":"emphasis"),eB.TS({id:t,stack:i?"":Ox},r.get(["option","stack"])||{},!0)}};tQ.zl({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var Ok=n(9474),OM=Array(60).join("-");function OT(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var OA=RegExp("[ ]+","g"),OI=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,eH.ZT)(t,e),t.prototype.onclick=function(e,t){setTimeout(function(){t.dispatchAction({type:"hideTip"})});var n,r,i,o,a,s,l,u=t.getDom(),c=this.model;this._dom&&u.removeChild(this._dom);var d=document.createElement("div");d.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",d.style.backgroundColor=c.get("backgroundColor")||"#fff";var h=document.createElement("h4"),p=c.get("lang")||[];h.innerHTML=p[0]||c.get("title"),h.style.cssText="margin:10px 20px",h.style.color=c.get("textColor");var f=document.createElement("div"),g=document.createElement("textarea");f.style.cssText="overflow:auto";var m=c.get("optionToContent"),v=c.get("contentToOption"),y=(n={},r=[],i=[],e.eachRawSeries(function(e){var t=e.coordinateSystem;if(t&&("cartesian2d"===t.type||"polar"===t.type)){var o=t.getBaseAxis();if("category"===o.type){var a=o.dim+"_"+o.index;n[a]||(n[a]={categoryAxis:o,valueAxis:t.getOtherAxis(o),series:[]},i.push({axisDim:o.dim,axisIndex:o.index})),n[a].series.push(e)}else r.push(e)}else r.push(e)}),o={seriesGroupByCategoryAxis:n,other:r,meta:i},{value:eB.hX([(a=o.seriesGroupByCategoryAxis,s=[],eB.S6(a,function(e,t){var n=e.categoryAxis,r=e.valueAxis.dim,i=[" "].concat(eB.UI(e.series,function(e){return e.name})),o=[n.model.getCategories()];eB.S6(e.series,function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(r),function(e){return e}))});for(var a=[i.join(" ")],l=0;l<o[0].length;l++){for(var u=[],c=0;c<o.length;c++)u.push(o[c][l]);a.push(u.join(" "))}s.push(a.join("\n"))}),s.join("\n\n"+OM+"\n\n")),(l=o.other,eB.UI(l,function(e){var t=e.getRawData(),n=[e.name],r=[];return t.each(t.dimensions,function(){for(var e=arguments.length,i=arguments[e-1],o=t.getName(i),a=0;a<e-1;a++)r[a]=arguments[a];n.push((o?o+" ":"")+r.join(" "))}),n.join("\n")}).join("\n\n"+OM+"\n\n"))],function(e){return!!e.replace(/[\n\t\s]/g,"")}).join("\n\n"+OM+"\n\n"),meta:o.meta});if(eB.mf(m)){var b=m(t.getOption());eB.HD(b)?f.innerHTML=b:eB.Mh(b)&&f.appendChild(b)}else{g.readOnly=c.get("readOnly");var x=g.style;x.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",x.color=c.get("textColor"),x.borderColor=c.get("textareaBorderColor"),x.backgroundColor=c.get("textareaColor"),g.value=y.value,f.appendChild(g)}var w=y.meta,S=document.createElement("div");S.style.cssText="position:absolute;bottom:5px;left:0;right:0";var C="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",k=document.createElement("div"),M=document.createElement("div");C+=";background-color:"+c.get("buttonColor")+";color:"+c.get("buttonTextColor");var T=this;function A(){u.removeChild(d),T._dom=null}(0,Ok.Oo)(k,"click",A),(0,Ok.Oo)(M,"click",function(){var e,n,r;if(null==v&&null!=m||null!=v&&null==m){A();return}try{eB.mf(v)?e=v(f,t.getOption()):(n=g.value.split(RegExp("\n*"+OM+"\n*","g")),r={series:[]},eB.S6(n,function(e,t){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(" ")>=0)return!0}(e)){var n=function(e){for(var t=e.split(/\n+/g),n=OT(t.shift()).split(OA),r=[],i=eB.UI(n,function(e){return{name:e,data:[]}}),o=0;o<t.length;o++){var a=OT(t[o]).split(OA);r.push(a.shift());for(var s=0;s<a.length;s++)i[s]&&(i[s].data[o]=a[s])}return{series:i,categories:r}}(e),i=w[t],o=i.axisDim+"Axis";i&&(r[o]=r[o]||[],r[o][i.axisIndex]={data:n.categories},r.series=r.series.concat(n.series))}else{var n=function(e){for(var t=e.split(/\n+/g),n=OT(t.shift()),r=[],i=0;i<t.length;i++){var o=OT(t[i]);if(o){var a=o.split(OA),s="",l=void 0,u=!1;isNaN(a[0])?(u=!0,s=a[0],a=a.slice(1),r[i]={name:s,value:[]},l=r[i].value):l=r[i]=[];for(var c=0;c<a.length;c++)l.push(+a[c]);1===l.length&&(u?r[i].value=l[0]:r[i]=l[0])}}return{name:n,data:r}}(e);r.series.push(n)}}),e=r)}catch(e){throw A(),Error("Data view format error "+e)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),A()}),k.innerHTML=p[1],M.innerHTML=p[2],M.style.cssText=k.style.cssText=C,c.get("readOnly")||S.appendChild(M),S.appendChild(k),d.appendChild(h),d.appendChild(f),d.appendChild(S),f.style.height=u.clientHeight-80+"px",u.appendChild(d),this._dom=d},t.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.getDefaultOption=function(e){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:e.getLocaleModel().get(["toolbox","dataView","title"]),lang:e.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},t}(Op);tQ.zl({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(e,t){var n=[];eB.S6(e.newOption.series,function(e){var r=t.getSeriesByName(e.name)[0];if(r){var i,o=r.get("data");n.push({name:e.name,data:(i=e.data,eB.UI(i,function(e,t){var n=o&&o[t];if(!eB.Kn(n)||eB.kJ(n))return e;eB.Kn(e)&&!eB.kJ(e)||(e={value:e});var r=null!=n.name&&null==e.name;return e=eB.ce(e,n),r&&delete e.name,e}))})}else n.push(eB.l7({type:"scatter"},e))}),t.mergeOption(eB.ce({series:n},e.newOption))});var OP=eB.S6,OR=(0,t4.Yf)();function OO(e){var t=OR(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var OE=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,eH.ZT)(t,e),t.prototype.onclick=function(e,t){OR(e).snapshots=null,t.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(e){return{show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:e.getLocaleModel().get(["toolbox","restore","title"])}},t}(Op);tQ.zl({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var OD=n(7654),OL=n(1099),O_=n(619),ON=Math.min,OZ=Math.max,Oj=Math.pow,OB="globalPan",OF={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},Oz={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},O$={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},OV=0,OH=function(e){function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},n._zr=t,n.group=new eX.Z,n._uid="brushController_"+OV++,(0,eB.S6)(Es,function(e,t){this._handlers[t]=(0,eB.ak)(e,this)},n),n}return(0,eH.ZT)(t,e),t.prototype.enableBrush=function(e){return this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var t=this._zr;this._enableGlobalPan||O_.qn(t,OB,this._uid),(0,eB.S6)(this._handlers,function(e,n){t.on(n,e)}),this._brushType=e.brushType,this._brushOption=(0,eB.TS)((0,eB.d9)(O$),e,!0)},t.prototype._doDisableBrush=function(){var e=this._zr;O_.Ar(e,OB,this._uid),(0,eB.S6)(this._handlers,function(t,n){e.off(n,t)}),this._brushType=this._brushOption=null},t.prototype.setPanels=function(e){if(e&&e.length){var t=this._panels={};(0,eB.S6)(e,function(e){t[e.panelId]=(0,eB.d9)(e)})}else this._panels=null;return this},t.prototype.mount=function(e){e=e||{},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({x:e.x||0,y:e.y||0,rotation:e.rotation||0,scaleX:e.scaleX||1,scaleY:e.scaleY||1}),this._transform=t.getLocalTransform(),this},t.prototype.updateCovers=function(e){e=(0,eB.UI)(e,function(e){return(0,eB.TS)((0,eB.d9)(O$),e,!0)});var t=this._covers,n=this._covers=[],r=this,i=this._creatingCover;return new nn.Z(t,e,function(e,t){return o(e.__brushOption,t)},o).add(a).update(a).remove(function(e){t[e]!==i&&r.group.remove(t[e])}).execute(),this;function o(e,t){return(null!=e.id?e.id:"\0-brush-index-"+t)+"-"+e.brushType}function a(o,a){var s=e[o];if(null!=a&&t[a]===i)n[o]=t[a];else{var l=n[o]=null!=a?(t[a].__brushOption=s,t[a]):Oq(r,OW(r,s));OK(r,l)}}},t.prototype.unmount=function(){return this.enableBrush(!1),OQ(this),this._zr.remove(this.group),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(OD.Z);function OW(e,t){var n=Eu[t.brushType].createCover(e,t);return n.__brushOption=t,OU(n,t),e.group.add(n),n}function Oq(e,t){var n=OY(t);return n.endCreating&&(n.endCreating(e,t),OU(t,t.__brushOption)),t}function OG(e,t){var n=t.__brushOption;OY(t).updateCoverShape(e,t,n.range,n)}function OU(e,t){var n=t.z;null==n&&(n=1e4),e.traverse(function(e){e.z=n,e.z2=n})}function OK(e,t){OY(t).updateCommon(e,t),OG(e,t)}function OY(e){return Eu[e.__brushOption.brushType]}function OX(e,t,n){var r,i=e._panels;if(!i)return!0;var o=e._transform;return(0,eB.S6)(i,function(e){e.isTargetByCursor(t,n,o)&&(r=e)}),r}function OJ(e,t){var n=e._panels;if(!n)return!0;var r=t.__brushOption.panelId;return null==r||n[r]}function OQ(e){var t=e._covers,n=t.length;return(0,eB.S6)(t,function(t){e.group.remove(t)},e),t.length=0,!!n}function O0(e,t){var n=(0,eB.UI)(e._covers,function(e){var t=e.__brushOption,n=(0,eB.d9)(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}});e.trigger("brush",{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function O1(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function O2(e,t,n,r){var i=new eX.Z;return i.add(new e0.Z({name:"main",style:O6(n),silent:!0,draggable:!0,cursor:"move",drift:(0,eB.WA)(O7,e,t,i,["n","s","w","e"]),ondragend:(0,eB.WA)(O0,t,{isEnd:!0})})),(0,eB.S6)(r,function(n){i.add(new e0.Z({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:(0,eB.WA)(O7,e,t,i,n),ondragend:(0,eB.WA)(O0,t,{isEnd:!0})}))}),i}function O5(e,t,n,r){var i=r.brushStyle.lineWidth||0,o=OZ(i,6),a=n[0][0],s=n[1][0],l=a-i/2,u=s-i/2,c=n[0][1],d=n[1][1],h=c-o+i/2,p=d-o+i/2,f=c-a,g=d-s,m=f+i,v=g+i;O4(e,t,"main",a,s,f,g),r.transformable&&(O4(e,t,"w",l,u,o,v),O4(e,t,"e",h,u,o,v),O4(e,t,"n",l,u,m,o),O4(e,t,"s",l,p,m,o),O4(e,t,"nw",l,u,o,o),O4(e,t,"ne",h,u,o,o),O4(e,t,"sw",l,p,o,o),O4(e,t,"se",h,p,o,o))}function O3(e,t){var n=t.__brushOption,r=n.transformable,i=t.childAt(0);i.useStyle(O6(n)),i.attr({silent:!r,cursor:r?"move":"default"}),(0,eB.S6)([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(n){var i,o,a,s=t.childOfName(n.join("")),l=1===n.length?O9(e,n[0]):(("e"===(a=[O9(i=e,(o=n)[0]),O9(i,o[1])])[0]||"w"===a[0])&&a.reverse(),a.join(""));s&&s.attr({silent:!r,invisible:!r,cursor:r?Oz[l]+"-resize":null})})}function O4(e,t,n,r,i,o,a){var s,l,u,c=t.childOfName(n);c&&c.setShape((l=ON((s=En(e,t,[[r,i],[r+o,i+a]]))[0][0],s[1][0]),{x:l,y:u=ON(s[0][1],s[1][1]),width:OZ(s[0][0],s[1][0])-l,height:OZ(s[0][1],s[1][1])-u}))}function O6(e){return(0,eB.ce)({strokeNoScale:!0},e.brushStyle)}function O8(e,t,n,r){var i=[ON(e,n),ON(t,r)],o=[OZ(e,n),OZ(t,r)];return[[i[0],o[0]],[i[1],o[1]]]}function O9(e,t){return({left:"w",right:"e",top:"n",bottom:"s"})[eJ.transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[t],eJ.getTransform(e.group))]}function O7(e,t,n,r,i,o){var a=n.__brushOption,s=e.toRectRange(a.range),l=Et(t,i,o);(0,eB.S6)(r,function(e){var t=OF[e];s[t[0]][t[1]]+=l[t[0]]}),a.range=e.fromRectRange(O8(s[0][0],s[1][0],s[0][1],s[1][1])),OK(t,n),O0(t,{isEnd:!1})}function Ee(e,t,n,r){var i=t.__brushOption.range,o=Et(e,n,r);(0,eB.S6)(i,function(e){e[0]+=o[0],e[1]+=o[1]}),OK(e,t),O0(e,{isEnd:!1})}function Et(e,t,n){var r=e.group,i=r.transformCoordToLocal(t,n),o=r.transformCoordToLocal(0,0);return[i[0]-o[0],i[1]-o[1]]}function En(e,t,n){var r=OJ(e,t);return r&&!0!==r?r.clipPath(n,e._transform):(0,eB.d9)(n)}function Er(e){var t=e.event;t.preventDefault&&t.preventDefault()}function Ei(e,t,n){return e.childOfName("main").contain(t,n)}function Eo(e,t,n,r){var i,o=e._creatingCover,a=e._creatingPanel,s=e._brushOption;if(e._track.push(n.slice()),function(e){var t=e._track;if(!t.length)return!1;var n=t[t.length-1],r=t[0],i=n[0]-r[0],o=n[1]-r[1];return Oj(i*i+o*o,.5)>6}(e)||o){if(a&&!o){"single"===s.brushMode&&OQ(e);var l=(0,eB.d9)(s);l.brushType=Ea(l.brushType,a),l.panelId=!0===a?null:a.panelId,o=e._creatingCover=OW(e,l),e._covers.push(o)}if(o){var u=Eu[Ea(e._brushType,a)];o.__brushOption.range=u.getCreatingRange(En(e,o,e._track)),r&&(Oq(e,o),u.updateCommon(e,o)),OG(e,o),i={isEnd:r}}}else r&&"single"===s.brushMode&&s.removeOnClick&&OX(e,t,n)&&OQ(e)&&(i={isEnd:r,removeOnClick:!0});return i}function Ea(e,t){return"auto"===e?t.defaultBrushType:e}var Es={mousedown:function(e){if(this._dragging)El(this,e);else if(!e.target||!e.target.draggable){Er(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=OX(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,r=this.group.transformCoordToLocal(t,n);if(!function(e,t,n){if(!(!e._brushType||(r=e,i=t.offsetX,o=t.offsetY,a=r._zr,i<0||i>a.getWidth()||o<0||o>a.getHeight()))){var r,i,o,a,s=e._zr,l=e._covers,u=OX(e,t,n);if(!e._dragging)for(var c=0;c<l.length;c++){var d=l[c].__brushOption;if(u&&(!0===u||d.panelId===u.panelId)&&Eu[d.brushType].contain(l[c],n[0],n[1]))return}u&&s.setCursorStyle("crosshair")}}(this,e,r),this._dragging){Er(e);var i=Eo(this,e,r,!1);i&&O0(this,i)}},mouseup:function(e){El(this,e)}};function El(e,t){if(e._dragging){Er(t);var n=t.offsetX,r=t.offsetY,i=e.group.transformCoordToLocal(n,r),o=Eo(e,t,i,!0);e._dragging=!1,e._track=[],e._creatingCover=null,o&&O0(e,o)}}var Eu={lineX:Ec(0),lineY:Ec(1),rect:{createCover:function(e,t){function n(e){return e}return O2({toRectRange:n,fromRectRange:n},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=O1(e);return O8(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,r){O5(e,t,n,r)},updateCommon:O3,contain:Ei},polygon:{createCover:function(e,t){var n=new eX.Z;return n.add(new OL.Z({name:"main",style:O6(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new Rx.Z({name:"main",draggable:!0,drift:(0,eB.WA)(Ee,e,t),ondragend:(0,eB.WA)(O0,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,r){t.childAt(0).setShape({points:En(e,t,n)})},updateCommon:O3,contain:Ei}};function Ec(e){return{createCover:function(t,n){return O2({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var n=O1(t);return[ON(n[0][e],n[1][e]),OZ(n[0][e],n[1][e])]},updateCoverShape:function(t,n,r,i){var o,a=OJ(t,n);if(!0!==a&&a.getLinearBrushOtherExtent)o=a.getLinearBrushOtherExtent(e);else{var s=t._zr;o=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[r,o];e&&l.reverse(),O5(t,n,l,i)},updateCommon:O3,contain:Ei}}var Ed=n(9495),Eh={axisPointer:1,tooltip:1,brush:1};function Ep(e){return Ed.Z.create(e)}var Ef=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],Eg=function(){function e(e,t,n){var r=this;this._targetInfoList=[];var i=Ev(t,e);(0,eB.S6)(Ey,function(e,t){(!n||!n.include||(0,eB.cq)(n.include,t)>=0)&&e(i,r._targetInfoList)})}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(e,t,n){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var r=Ew[e.brushType](0,n,t);e.__rangeOffset={offset:EC[e.brushType](r.values,e.range,[1,1]),xyMinMax:r.xyMinMax}}}),e},e.prototype.matchOutputRanges=function(e,t,n){(0,eB.S6)(e,function(e){var r=this.findTargetInfo(e,t);r&&!0!==r&&(0,eB.S6)(r.coordSyses,function(r){var i=Ew[e.brushType](1,r,e.range,!0);n(e,i.values,r,t)})},this)},e.prototype.setInputRanges=function(e,t){(0,eB.S6)(e,function(e){var n=this.findTargetInfo(e,t);if(e.range=e.range||[],n&&!0!==n){e.panelId=n.panelId;var r,i,o,a,s,l=Ew[e.brushType](0,n.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?EC[e.brushType](l.values,u.offset,(r=l.xyMinMax,i=u.xyMinMax,o=EM(r),a=EM(i),isNaN((s=[o[0]/a[0],o[1]/a[1]])[0])&&(s[0]=1),isNaN(s[1])&&(s[1]=1),s)):l.values}},this)},e.prototype.makePanelOpts=function(e,t){return(0,eB.UI)(this._targetInfoList,function(n){var r,i,o,a,s=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:(r=Ep(r=s),function(e){return eJ.clipPointsByRect(e,r)}),isTargetByCursor:(i=n.coordSysModel,o=Ep(s),function(t,n){var r,a;return o.contain(n[0],n[1])&&(a=(r=e.getComponentByElement(t.topTarget))&&r.coordinateSystem,!r||r===i||!!Eh.hasOwnProperty(r.mainType)||!a||a.model===i)}),getLinearBrushOtherExtent:(a=Ep(a=s),function(e){var t=e?a.width:a.height,n=e?a.x:a.y;return[n,n+(t||0)]})}})},e.prototype.controlSeries=function(e,t,n){var r=this.findTargetInfo(e,n);return!0===r||r&&(0,eB.cq)(r.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,r=Ev(t,e),i=0;i<n.length;i++){var o=n[i],a=e.panelId;if(a){if(o.panelId===a)return o}else for(var s=0;s<Eb.length;s++)if(Eb[s](r,o))return o}return!0},e}();function Em(e){return e[0]>e[1]&&e.reverse(),e}function Ev(e,t){return(0,t4.pm)(e,t,{includeMainTypes:Ef})}var Ey={grid:function(e,t){var n=e.xAxisModels,r=e.yAxisModels,i=e.gridModels,o=(0,eB.kW)(),a={},s={};(n||r||i)&&((0,eB.S6)(n,function(e){var t=e.axis.grid.model;o.set(t.id,t),a[t.id]=!0}),(0,eB.S6)(r,function(e){var t=e.axis.grid.model;o.set(t.id,t),s[t.id]=!0}),(0,eB.S6)(i,function(e){o.set(e.id,e),a[e.id]=!0,s[e.id]=!0}),o.each(function(e){var i=e.coordinateSystem,o=[];(0,eB.S6)(i.getCartesians(),function(e,t){((0,eB.cq)(n,e.getAxis("x").model)>=0||(0,eB.cq)(r,e.getAxis("y").model)>=0)&&o.push(e)}),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:o[0],coordSyses:o,getPanelRect:Ex.grid,xAxisDeclared:a[e.id],yAxisDeclared:s[e.id]})}))},geo:function(e,t){(0,eB.S6)(e.geoModels,function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:Ex.geo})})}},Eb=[function(e,t){var n=e.xAxisModel,r=e.yAxisModel,i=e.gridModel;return!i&&n&&(i=n.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],Ex={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(eJ.getTransform(e)),t}},Ew={lineX:(0,eB.WA)(ES,0),lineY:(0,eB.WA)(ES,1),rect:function(e,t,n,r){var i=e?t.pointToData([n[0][0],n[1][0]],r):t.dataToPoint([n[0][0],n[1][0]],r),o=e?t.pointToData([n[0][1],n[1][1]],r):t.dataToPoint([n[0][1],n[1][1]],r),a=[Em([i[0],o[0]]),Em([i[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,n,r){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:(0,eB.UI)(n,function(n){var o=e?t.pointToData(n,r):t.dataToPoint(n,r);return i[0][0]=Math.min(i[0][0],o[0]),i[1][0]=Math.min(i[1][0],o[1]),i[0][1]=Math.max(i[0][1],o[0]),i[1][1]=Math.max(i[1][1],o[1]),o}),xyMinMax:i}}};function ES(e,t,n,r){var i=n.getAxis(["x","y"][e]),o=Em((0,eB.UI)([0,1],function(e){return t?i.coordToData(i.toLocalCoord(r[e]),!0):i.toGlobalCoord(i.dataToCoord(r[e]))})),a=[];return a[e]=o,a[1-e]=[NaN,NaN],{values:o,xyMinMax:a}}var EC={lineX:(0,eB.WA)(Ek,0),lineY:(0,eB.WA)(Ek,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return(0,eB.UI)(e,function(e,r){return[e[0]-n[0]*t[r][0],e[1]-n[1]*t[r][1]]})}};function Ek(e,t,n,r){return[t[0]-r[e]*n[0],t[1]-r[e]*n[1]]}function EM(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var ET=n(2920),EA=n(3886),EI=eB.S6,EP=(0,t4.g0)("toolbox-dataZoom_"),ER=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,eH.ZT)(t,e),t.prototype.render=function(e,t,n,r){this._brushController||(this._brushController=new OH(n.getZr()),this._brushController.on("brush",eB.ak(this._onBrush,this)).mount()),function(e,t,n,r,i){var o=n._isZoomActive;r&&"takeGlobalCursor"===r.type&&(o="dataZoomSelect"===r.key&&r.dataZoomSelectActive),n._isZoomActive=o,e.setIconStatus("zoom",o?"emphasis":"normal");var a=new Eg(EE(e),t,{include:["grid"]}).makePanelOpts(i,function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"});n._brushController.setPanels(a).enableBrush(!!o&&!!a.length&&{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()})}(e,t,this,r,n),function(e,t){e.setIconStatus("back",OO(t).length>1?"emphasis":"normal")}(e,t)},t.prototype.onclick=function(e,t,n){EO[n].call(this)},t.prototype.remove=function(e,t){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,t){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var t,n,r,i=e.areas;if(e.isEnd&&i.length){var o={},a=this.ecModel;this._brushController.updateCovers([]),new Eg(EE(this.model),a,{include:["grid"]}).matchOutputRanges(i,a,function(e,t,n){if("cartesian2d"===n.type){var r=e.brushType;"rect"===r?(s("x",n,t[0]),s("y",n,t[1])):s({lineX:"x",lineY:"y"}[r],n,t)}}),t=a,n=o,r=OO(t),OP(n,function(e,n){for(var i=r.length-1;i>=0&&!r[i][n];i--);if(i<0){var o=t.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(o){var a=o.getPercentRange();r[0][n]={dataZoomId:n,start:a[0],end:a[1]}}}}),r.push(n),this._dispatchZoomAction(o)}function s(e,t,n){var r,i,s,l=t.getAxis(e),u=l.model,c=(r=e,i=u,a.eachComponent({mainType:"dataZoom",subType:"select"},function(e){e.getAxisModel(r,i.componentIndex)&&(s=e)}),s),d=c.findRepresentativeAxisProxy(u).getMinMaxSpan();(null!=d.minValueSpan||null!=d.maxValueSpan)&&(n=(0,ET.Z)(0,n.slice(),l.scale.getExtent(),0,d.minValueSpan,d.maxValueSpan)),c&&(o[c.id]={dataZoomId:c.id,startValue:n[0],endValue:n[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];EI(e,function(e,n){t.push(eB.d9(e))}),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},t}(Op),EO={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){var e,t,n;this._dispatchZoomAction((t=(e=OO(this.ecModel))[e.length-1],e.length>1&&e.pop(),n={},OP(t,function(t,r){for(var i=e.length-1;i>=0;i--)if(t=e[i][r]){n[r]=t;break}}),n))}};function EE(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return null==t.xAxisIndex&&null==t.xAxisId&&(t.xAxisIndex="all"),null==t.yAxisIndex&&null==t.yAxisId&&(t.yAxisIndex="all"),t}function ED(e){e.registerComponentModel(Og),e.registerComponentView(Oy),Of.saveAsImage=Ob,Of.magicType=OS,Of.dataView=OI,Of.dataZoom=ER,Of.restore=OE,(0,ej.D)(Oh)}(0,EA.f)("dataZoom",function(e){var t=e.getComponent("toolbox",0),n=["feature","dataZoom"];if(t&&null!=t.get(n)){var r=t.getModel(n),i=[],o=EE(r),a=(0,t4.pm)(e,o);return EI(a.xAxisModels,function(e){return s(e,"xAxis","xAxisIndex")}),EI(a.yAxisModels,function(e){return s(e,"yAxis","yAxisIndex")}),i}function s(e,t,n){var o=e.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:r.get("filterMode",!0)||"filter",id:EP+t+o};a[n]=o,i.push(a)}});var EL=n(4665),E_=n(461);function EN(e,t){if(t){let n=t.toLowerCase();if("local"!==n&&"browser"!==n)return{...e,timeZone:"utc"===n?"UTC":t}}return e}function EZ(e,t,n){let r=n?.toLowerCase();return n&&"local"!==r&&"browser"!==r?(0,EL.formatInTimeZone)(e,"utc"===r?"UTC":n,t):(0,E_.format)(e,t)}function Ej(e,t,n){let r=EN({hour:"numeric",minute:"numeric",hourCycle:"h23"},n);return t<=18e5?r.second="numeric":t>=864e5&&(r.month="numeric",r.day="numeric"),new Intl.DateTimeFormat(void 0,r).format(e).replace(/, /g," ")}function EB(e){return e>15768e7?"{yyyy}":e>63072e6?"{MMM} {yyyy}":e>432e6&&e<1577664e4?"{MM}/{dd}":e>1728e5&&e<=432e6?"{MM}/{dd} {HH}:{mm}":{year:"{yearStyle|{yyyy}}\n{monthStyle|{MMM}}",month:"{MMM}",day:"{MM}/{dd}"}}let EF=e=>{if(!e)return{formattedDate:"",formattedTime:""};let t=new Date(e);return{formattedDate:(0,E_.format)(t,"MMM dd, yyyy - "),formattedTime:(0,E_.format)(t,"HH:mm:ss")}},Ez=(0,g.createContext)(void 0);function E$(e){let{children:t,timeZone:n}=e;return(0,f.jsx)(Ez.Provider,{value:n,children:t})}function EV(){let e=(0,g.useContext)(Ez);return{timeZone:e??"local",formatWithUserTimeZone:(t,n)=>EZ(t,n,e),dateFormatOptionsWithUserTimeZone:t=>EN(t,e)}}let EH=375,EW=650,Eq=650,EG=500,EU=.75,EK=8,EY=750,EX="nearby series showing in tooltip",EJ="emphasized series showing as bold in tooltip",EQ="#2E313E",E0=new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}),E1={coords:{plotCanvas:{x:0,y:0},zrender:{x:0,y:0},target:null},chartWidth:0},E2=[],E5=()=>{let[e,t]=(0,g.useState)(null);return(0,g.useEffect)(()=>{let e=e=>t({page:{x:e.pageX,y:e.pageY},client:{x:e.clientX,y:e.clientY},plotCanvas:{x:e.zrX??e.offsetX,y:e.zrY??e.offsetY},target:e.target});return window.addEventListener("mousemove",e),()=>{window.removeEventListener("mousemove",e)}},[]),e},E3={wrapLabels:!0,enablePinning:!0},E4="Click chart to pin",E6="Click chart to unpin";function E8(e,t,n){return e[t]?e[t][0]?e[t][0][n]:e[t][n]:"contentBoxSize"===t?e.contentRect["inlineSize"===n?"width":"height"]:void 0}function E9(e){void 0===e&&(e={});var t,n,r,i,o,a,s=e.onResize,l=(0,g.useRef)(void 0);l.current=s;var u=e.round||Math.round,c=(0,g.useRef)(),d=(0,g.useState)({width:void 0,height:void 0}),h=d[0],p=d[1],f=(0,g.useRef)(!1);(0,g.useEffect)(function(){return f.current=!1,function(){f.current=!0}},[]);var m=(0,g.useRef)({width:void 0,height:void 0}),v=(t=(0,g.useCallback)(function(t){return c.current&&c.current.box===e.box&&c.current.round===u||(c.current={box:e.box,round:u,instance:new ResizeObserver(function(t){var n=t[0],r="border-box"===e.box?"borderBoxSize":"device-pixel-content-box"===e.box?"devicePixelContentBoxSize":"contentBoxSize",i=E8(n,r,"inlineSize"),o=E8(n,r,"blockSize"),a=i?u(i):void 0,s=o?u(o):void 0;if(m.current.width!==a||m.current.height!==s){var c={width:a,height:s};m.current.width=a,m.current.height=s,l.current?l.current(c):f.current||p(c)}})}),c.current.instance.observe(t,{box:e.box}),function(){c.current&&c.current.instance.unobserve(t)}},[e.box,u]),n=e.ref,r=(0,g.useRef)(null),(i=(0,g.useRef)(null)).current=n,o=(0,g.useRef)(null),(0,g.useEffect)(function(){a()}),a=(0,g.useCallback)(function(){var e=o.current,n=i.current,a=e||(n?n instanceof Element?n:n.current:null);(!r.current||r.current.element!==a||r.current.subscriber!==t)&&(r.current&&r.current.cleanup&&r.current.cleanup(),r.current={element:a,subscriber:t,cleanup:a?t(a):void 0})},[t]),(0,g.useEffect)(function(){return function(){r.current&&r.current.cleanup&&(r.current.cleanup(),r.current=null)}},[]),(0,g.useCallback)(function(e){o.current=e,a()},[a]));return(0,g.useMemo)(function(){return{ref:v,width:h.width,height:h.height}},[v,h.width,h.height])}function E7(e){let{markerColor:t,sx:n}=e;return(0,f.jsx)(tU,{sx:c8({display:"inline-block",width:"11px",height:"11px",borderRadius:"2px",marginRight:1,verticalAlign:"top"},n),style:{backgroundColor:t}})}function De(e){let{formattedY:t,markerColor:n,metricName:r,metricLabels:i}=e;return(0,f.jsxs)(rf,{spacing:.5,children:[(0,f.jsxs)(tU,{sx:e=>({display:"flex",height:"16px",flexDirection:"row",alignItems:"center",justifyContent:"left",color:e.palette.common.white,fontSize:"11px"}),children:[(0,f.jsx)(E7,{markerColor:n,sx:{marginTop:.25}}),(0,f.jsxs)(tU,{component:"span",children:[r,(0,f.jsx)(tU,{component:"span",sx:e=>({color:e.palette.common.white,fontWeight:700,paddingLeft:"2px"}),children:t})]})]}),(0,f.jsx)(vw,{sx:e=>({borderColor:e.palette.grey["500"]})}),(0,f.jsx)(tU,{sx:e=>({color:e.palette.common.white}),children:i.map(e=>{if(e){let[t,n]=e.split("="),r=void 0!==n?`${t}: `:t,i=void 0!==n?n.replace(/(^"|"$)/g,""):n;return(0,f.jsxs)(tU,{sx:{display:"flex",gap:"4px"},children:[(0,f.jsx)(c1,{sx:{fontSize:"11px"},children:r}),(0,f.jsx)(c1,{sx:e=>({color:e.palette.common.white,fontWeight:700,fontSize:"11px"}),children:i})]},e)}})})]})}function Dt(e){let{seriesName:t,formattedY:n,markerColor:r,totalSeries:i,emphasizeText:o=!1,wrapLabels:a=!0}=e,s=t.split("{"),l=(s[1]??t).replace(/[{}]/g,"").split(",");if(1===i&&l.length>1){let e=s[0]?`${s[0]}:`:"value:";return(0,f.jsx)(De,{formattedY:n,metricName:e,metricLabels:l,markerColor:r})}let u=t.replace(/[,]/g,", ");return(0,f.jsxs)(tU,{sx:{display:"table-row",paddingTop:.5},children:[(0,f.jsxs)(tU,{sx:{display:"table-cell",maxWidth:"520px"},children:[(0,f.jsx)(E7,{markerColor:r,sx:{marginTop:.5}}),(0,f.jsx)(tU,{component:"span",sx:e=>({display:"inline-block",width:"calc(100% - 20px)",minWidth:150,maxWidth:EG,overflow:"hidden",color:e.palette.common.white,fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular,textOverflow:"ellipsis",whiteSpace:a?"normal":"nowrap"}),"aria-label":o?EJ:EX,children:u})]}),(0,f.jsx)(tU,{sx:e=>({display:"table-cell",paddingLeft:1.5,textAlign:"right",verticalAlign:"top",fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular}),children:n})]})}function Dn(e){let{series:t,wrapLabels:n}=e,r=(0,g.useMemo)(()=>null===t?null:t.sort((e,t)=>e.y>t.y?-1:1),[t]);return null===t||null===r?null:(0,f.jsx)(tU,{sx:e=>({display:"table",padding:e.spacing(.5,2)}),children:r.map(({datumIdx:e,seriesIdx:t,seriesName:i,y:o,formattedY:a,markerColor:s,isClosestToCursor:l})=>{if(null===e||null===t)return null;let u=t.toString()+e.toString();return(0,f.jsx)(Dt,{seriesName:i,y:o,formattedY:a,markerColor:s,totalSeries:r.length,wrapLabels:n,emphasizeText:l},u)})})}function Dr(e){return(0,A.ZP)("MuiSwitch",e)}let Di=(0,T.Z)("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),Do=e=>{let{classes:t,edge:n,size:r,color:i,checked:o,disabled:a}=e,s={root:["root",n&&`edge${(0,w.Z)(n)}`,`size${(0,w.Z)(r)}`],switchBase:["switchBase",`color${(0,w.Z)(i)}`,o&&"checked",a&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=(0,y.Z)(s,Dr,t);return{...t,...l}},Da=(0,S.ZP)("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.edge&&t[`edge${(0,w.Z)(n.edge)}`],t[`size${(0,w.Z)(n.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${Di.thumb}`]:{width:16,height:16},[`& .${Di.switchBase}`]:{padding:4,[`&.${Di.checked}`]:{transform:"translateX(16px)"}}}}]}),Ds=(0,S.ZP)(pg,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.switchBase,{[`& .${Di.input}`]:t.input},"default"!==n.color&&t[`color${(0,w.Z)(n.color)}`]]}})((0,C.Z)(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${"light"===e.palette.mode?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${Di.checked}`]:{transform:"translateX(20px)"},[`&.${Di.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${"light"===e.palette.mode?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${Di.checked} + .${Di.track}`]:{opacity:.5},[`&.${Di.disabled} + .${Di.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${"light"===e.palette.mode?.12:.2}`},[`& .${Di.input}`]:{left:"-100%",width:"300%"}})),(0,C.Z)(({theme:e})=>({"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(k(["light"])).map(([t])=>({props:{color:t},style:{[`&.${Di.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette[t].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Di.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${"light"===e.palette.mode?(0,b.$n)(e.palette[t].main,.62):(0,b._j)(e.palette[t].main,.55)}`}},[`&.${Di.checked} + .${Di.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),Dl=(0,S.ZP)("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(e,t)=>t.track})((0,C.Z)(({theme:e})=>({height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${"light"===e.palette.mode?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${"light"===e.palette.mode?.38:.3}`}))),Du=(0,S.ZP)("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})((0,C.Z)(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),Dc=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiSwitch"}),{className:r,color:i="primary",edge:o=!1,size:a="medium",sx:s,...l}=n,u={...n,color:i,edge:o,size:a},c=Do(u),d=(0,f.jsx)(Du,{className:c.thumb,ownerState:u});return(0,f.jsxs)(Da,{className:(0,v.Z)(c.root,r),sx:s,ownerState:u,children:[(0,f.jsx)(Ds,{type:"checkbox",icon:d,checkedIcon:d,ref:t,ownerState:u,...l,classes:{...c,root:c.switchBase}}),(0,f.jsx)(Dl,{className:c.track,ownerState:u})]})});var Dd=n(1889),Dh=n(5186);let Dp=(0,g.memo)(function({nearbySeries:e,totalSeries:t,isTooltipPinned:n,showAllSeries:r,enablePinning:i=!0,onShowAllClick:o,onUnpinClick:a}){let s=e[0]?.date??null;if(null===s)return null;let l=i&&t>5;return(0,f.jsxs)(tU,{sx:e=>({width:"100%",maxWidth:EW,padding:e.spacing(1.5,2,.5,2),backgroundColor:e.palette.designSystem?.grey[800]??EQ,position:"sticky",top:0,left:0}),children:[(0,f.jsxs)(tU,{sx:{width:"100%",display:"flex",justifyContent:"start",alignItems:"center",paddingBottom:.5},children:[(e=>{let{formattedTime:t,formattedDate:n}=EF(e);return(0,f.jsxs)(tU,{children:[(0,f.jsx)(c1,{variant:"caption",sx:e=>({color:e.palette.common.white}),children:n}),(0,f.jsx)(c1,{variant:"caption",children:(0,f.jsx)("strong",{children:t})})]})})(s),(0,f.jsxs)(rf,{direction:"row",gap:1,sx:{marginLeft:"auto"},children:[l&&(0,f.jsxs)(rf,{direction:"row",gap:.5,alignItems:"center",sx:{textAlign:"right"},children:[(0,f.jsx)(c1,{sx:{fontSize:11},children:"Show All"}),(0,f.jsx)(Dc,{checked:r,size:"small",onChange:(e,t)=>{if(void 0!==o)return o(t)},sx:e=>({"& .MuiSwitch-switchBase":{color:e.palette.common.white},"& .MuiSwitch-track":{backgroundColor:e.palette.common.white}})})]}),i&&(0,f.jsxs)(rf,{direction:"row",alignItems:"center",children:[(0,f.jsx)(c1,{sx:{marginRight:.5,fontSize:11,verticalAlign:"middle"},children:n?E6:E4}),n?(0,f.jsx)(Dd.default,{onClick:()=>{void 0!==a&&a()},sx:{fontSize:16,cursor:"pointer"}}):(0,f.jsx)(Dh.default,{sx:{fontSize:16}})]})]})]}),(0,f.jsx)(vw,{sx:e=>({width:"100%",borderColor:e.palette.grey["500"]})})]})}),Df=1e3,Dg="Pinned Crosshair",Dm={name:Dg,type:"line",markLine:{data:[],lineStyle:{type:"dashed",width:2},emphasis:{lineStyle:{width:2,opacity:1}},blur:{lineStyle:{width:2,opacity:1}}}};function Dv(e){let t=e._model;void 0!==t&&void 0!==t.option.toolbox&&t.option.toolbox.length>0&&"normal"===t.option.toolbox[0].feature.dataZoom.iconStatus.zoom&&e.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:!0})}function Dy(e){e.dispatchAction({type:"restore"})}function Db(e){void 0!==e.dispatchAction&&(e.dispatchAction({type:"unselect"}),e.dispatchAction({type:"downplay"}))}function Dx(e,t,n){if(void 0===n)return null;let r=[e,t];return n.containPixel("grid",r)?n.convertFromPixel("grid",r):null}function Dw(e,t,n,r,i,o){let a=o.length>0?o[o.length-1]:i[i.length-1];void 0!==a&&e.dispatchAction({type:"select",seriesIndex:a.seriesIndex,dataIndex:a.dataIndex,escapeConnect:!0}),e.dispatchAction({type:"downplay",seriesIndex:r}),n.length>0?e.dispatchAction({type:"highlight",seriesIndex:n,notBlur:!1,escapeConnect:!0}):(e.dispatchAction({type:"highlight",seriesIndex:t,notBlur:!0,escapeConnect:!0}),e.dispatchAction({type:"toggleSelect"}))}function DS(e){return e[e.length-1]?.name===Dg}function DC(e,t){if(void 0===e||void 0===t)return null;let n=null,r=1/0;for(let[i]of e){let e=Math.abs(i-t);e<r&&(n=i,r=e)}return n}function Dk(e,t){if(void 0===t)return null;let n=e.length,r=null;for(let i=0;i<n;i++){let o=n>0?e[i]:null;if(!o)break;r=DC(o.values,t)}return r}let DM=5.5,DT=30,DA=5;function DI(e,t,n,r,i,o){let a=[],s=n[0]??null,l=n[1]??null;if(null===s||null===l||void 0===i.dispatchAction||!Array.isArray(e))return a;let u=[],c=[],d=[],h=[],p=[],f=e.length,g=new Map,m=DC(e[0]?.values,s);if(null===m)return E2;for(let n=0;n<f;n++){let s=t[n];if(!s)break;let v=f>0?e[n]:null;if(!v)break;let y=v.values;if(void 0===y||!Array.isArray(y))break;let b=s.name?s.name.toString():"",x=s.color??"#000";if(Array.isArray(e))for(let e=0;e<y.length;e++){let t=y[e];if(void 0===t||!Array.isArray(t))break;let s=t[0],v=t[1];if(null!=v&&m===s&&l<=v+r&&l>=v-r){let t=DE({valueToCheck:l,baseValue:v,percentage:Math.max(f>DA?2:5,100/f)});if(t){c.push(n);let t=g.get(v)??0;g.set(v,t+1),t>0&&p.push({seriesIndex:n,dataIndex:e,seriesName:b,yValue:v}),h.push({seriesIndex:n,dataIndex:e,seriesName:b,yValue:v})}else d.push(n),i.dispatchAction({type:"downplay",seriesIndex:n});let r=(0,eZ.Bw)(v,o);a.push({seriesIdx:n,datumIdx:e,seriesName:b,date:m,x:s,y:v,formattedY:r,markerColor:x.toString(),isClosestToCursor:t}),u.push(n)}}}return Dw(i,u,c,d,h,p),a}function DP(e,t,n,r,i){let o=[],a=t[0]??null,s=t[1]??null;if(null===a||null===s)return o;let l=[],u=[],c=[],d=e.timeSeries.length;if(Array.isArray(e.xAxis)&&Array.isArray(e.timeSeries))for(let t=0;t<d;t++){let h=e.timeSeries[t];if(void 0===h||o.length>=Df)break;let p=h.name?h.name.toString():"",f=h.color??"#000";if(Array.isArray(h.data))for(let g=0;g<h.data.length;g++){let m=e.xAxis[g]??0,v=h.data[g];if(null!=v&&a===g&&"-"!==v&&s<=v+n&&s>=v-n){let e=DE({valueToCheck:s,baseValue:v,percentage:Math.max(d>DA?2:5,100/d)});e?u.push(t):(c.push(t),r?.dispatchAction!==void 0&&r.dispatchAction({type:"downplay",seriesIndex:t}));let n=m>0x174876e7ff?m:1e3*m,a=(0,eZ.Bw)(v,i);o.push({seriesIdx:t,datumIdx:g,seriesName:p,date:n,x:m,y:v,formattedY:a,markerColor:f.toString(),isClosestToCursor:e}),l.push(t)}}}return r?.dispatchAction!==void 0&&(r.dispatchAction({type:"downplay",seriesIndex:c}),u.length>0?r.dispatchAction({type:"highlight",seriesIndex:u,notBlur:!1,escapeConnect:!0}):r.dispatchAction({type:"highlight",seriesIndex:l,notBlur:!0,escapeConnect:!0})),o}function DR({mousePos:e,pinnedPos:t,data:n,seriesMapping:r,chart:i,format:o,showAllSeries:a=!1}){if(void 0===i||null===e)return E2;let s=!1;if(null!==e.target){let t=e.target.parentElement;if(null!==t){let e=t.parentElement;null!==e&&i.getDom()===e&&(s=!0)}}if(null!==t&&(e=t,s=!0),!1===s||null===n||void 0===i._model||void 0===e.plotCanvas.x||void 0===e.plotCanvas.y)return E2;let l=Dx(e.plotCanvas.x,e.plotCanvas.y,i);if(null!==l){let e=DD({yInterval:i._model.getComponent("yAxis").axis.scale._interval,totalSeries:n.length,showAllSeries:a});return DI(n,r,l,e,i,o)}return E2}function DO({mousePos:e,pinnedPos:t,chartData:n,chart:r,format:i,showAllSeries:o=!1}){if(void 0===r||null===e)return[];let a=!1;if(null!==e.target){let t=e.target.parentElement;if(null!==t){let e=t.parentElement;null!==e&&r.getDom()===e&&(a=!0)}}if(null!==t&&(e=t,a=!0),!1===a||void 0===r._model)return[];let s=DD({yInterval:r._model.getComponent("yAxis").axis.scale._interval,totalSeries:n.timeSeries.length,showAllSeries:o}),l=[e.plotCanvas.x??0,e.plotCanvas.y??0];if(r.containPixel("grid",l)){let e=r.convertFromPixel("grid",l);if(void 0!==e[0]&&void 0!==e[1])return DP(n,e,s,r,i)}return[]}function DE({valueToCheck:e,baseValue:t,percentage:n}){let r=n/100*t;return e>=t-r&&e<=t+r}function DD({yInterval:e,totalSeries:t,showAllSeries:n=!1}){if(n)return 10*e;let r=.3*e;return t>DA?Math.max(r,e*DT/t):Math.max(r,e*DM)}function DL(e,t,n,r,i){if(null===e||(null!==t&&(e=t),void 0===e.plotCanvas.x))return;let o=e.page.x+32,a=e.page.y+16;if(i){let e=i.getBoundingClientRect();o=o-e.left+i.scrollLeft,a=a-e.top+i.scrollTop;let t=e.top+i.scrollHeight;a+n>t&&(a=Math.max(t-n-16,EK/2))}else a+n>window.innerHeight+window.scrollY&&(a=Math.max(window.innerHeight+window.scrollY-n-16,EK/2));return o+r>window.innerWidth&&(o=e.page.x-r-32),o<32&&(o=32),a<EK/2&&(a=EK/2),`translate3d(${o}px, ${a}px, 0)`}function D_(e,t,n){return{minWidth:EH,maxWidth:EW,maxHeight:(n?n-EK:void 0)??Eq,padding:0,position:"absolute",top:0,left:0,backgroundColor:e.palette.designSystem?.grey[800]??EQ,borderRadius:"6px",color:"#fff",fontSize:"11px",visibility:"visible",opacity:1,transition:"all 0.1s ease-out",zIndex:null!==t?"auto":e.zIndex.tooltip,overflow:"hidden","&:hover":{overflowY:"auto"}}}let DN=(0,g.memo)(function({chartRef:e,chartData:t,enablePinning:n=!0,wrapLabels:r,format:i,onUnpinClick:o,pinnedPos:a,containerId:s}){let[l,u]=(0,g.useState)(!1),c=E5(),{height:d,width:h,ref:p}=E9(),m=(0,g.useRef)(),v=null!==a&&n;if(null===c||null===c.target||null===a&&"CANVAS"!==c.target.tagName)return null;let y=DO({mousePos:c,chartData:t,pinnedPos:a,chart:e.current,format:i,showAllSeries:l});if(0===y.length)return null;let b=t.timeSeries.length,x=s?document.querySelector(s):void 0,w=x?x.getBoundingClientRect().height:void 0;return m.current=DL(c,a,d??0,h??0,x),(0,f.jsx)(op,{container:x,children:(0,f.jsx)(tU,{ref:p,sx:e=>({minWidth:EH,maxWidth:EW,maxHeight:w??Eq,padding:0,position:"absolute",top:0,left:0,backgroundColor:e.palette.designSystem?.grey[800]??EQ,borderRadius:"6px",color:"#fff",fontSize:"11px",visibility:"visible",opacity:1,transition:"all 0.1s ease-out",zIndex:null!==a?"auto":e.zIndex.tooltip,overflow:"hidden","&:hover":{overflowY:"auto"}}),style:{transform:m.current,display:m.current?"block":"none"},children:(0,f.jsxs)(rf,{spacing:.5,children:[(0,f.jsx)(Dp,{nearbySeries:y,totalSeries:b,enablePinning:n,isTooltipPinned:v,showAllSeries:l,onShowAllClick:e=>u(e),onUnpinClick:o}),(0,f.jsx)(Dn,{series:y,wrapLabels:r})]})})})});(0,ej.D)([Rc,tI.N,n2.N,R$,Oi,Ol,tR.N,ED,tO.N,n5.N,tE.N]);let DZ=(0,g.forwardRef)(function({height:e,data:t,yAxis:n,format:r,grid:i,legend:o,tooltipConfig:a=E3,noDataVariant:s="message",syncGroup:l,onDataZoom:u,onDoubleClick:c,__experimentalEChartsOptionsOverride:d},h){let p=tJ(),m=(0,g.useRef)(),[v,y]=(0,g.useState)(!0),[b,x]=(0,g.useState)(null),{timeZone:w}=EV(),[S,C]=(0,g.useState)(!1),[k,M]=(0,g.useState)(0);(0,g.useImperativeHandle)(h,()=>({highlightSeries({id:e}){m.current&&m.current.dispatchAction({type:"highlight",seriesId:e})},clearHighlightedSeries:()=>{m.current&&Db(m.current)}}),[]);let T=(0,g.useMemo)(()=>({datazoom:e=>{if(void 0===u&&setTimeout(()=>{x(null)},10),void 0===u||void 0===e.batch[0])return;let n=e.batch[0].startValue??0,r=e.batch[0].endValue??t.xAxis.length-1,i=t.xAxis[n],o=t.xAxis[r];void 0!==i&&void 0!==o&&u({start:i,end:o,startIndex:n,endIndex:r})}}),[t,u,x]);void 0!==m.current&&Dv(m.current);let{noDataOption:A}=p,I=(0,g.useMemo)(()=>{if(void 0===t.timeSeries)return{};if(null===t.timeSeries||0===t.timeSeries.length&&"message"===s)return A;let e=t.rangeMs??re(t.xAxis),a={series:t.timeSeries,xAxis:{type:"category",data:t.xAxis,max:t.xAxisMax,axisLabel:{formatter:t=>Ej(t,e,w)}},yAxis:n7(n,r),animation:!1,tooltip:{show:!0,trigger:"axis",showContent:!1},axisPointer:{type:"line",z:0,triggerEmphasis:!1,triggerTooltip:!1,snap:!0},toolbox:{feature:{dataZoom:{icon:null,yAxisIndex:"none"}}},grid:i,legend:o};return d?d(a):a},[t,n,r,i,o,A,w,d,s]);return(0,f.jsxs)(tU,{style:{height:e},onClick:e=>{a.enablePinning&&e.target instanceof HTMLCanvasElement&&x(t=>null===t?{page:{x:e.pageX,y:e.pageY},client:{x:e.clientX,y:e.clientY},plotCanvas:{x:e.nativeEvent.offsetX,y:e.nativeEvent.offsetY},target:e.target}:null)},onMouseDown:e=>{let{clientX:t}=e;C(!0),M(t)},onMouseMove:e=>{if(!(e.target instanceof HTMLCanvasElement))return;let{clientX:t}=e;S&&t-k>0&&y(!1)},onMouseUp:()=>{C(!1),M(0),y(!0)},onMouseLeave:()=>{null===b&&y(!1),void 0!==m.current&&Db(m.current)},onMouseEnter:()=>{y(!0),void 0!==m.current&&Dv(m.current)},onDoubleClick:e=>{x(null),void 0===c?void 0!==m.current&&Dy(m.current):c(e)},children:[!0===v&&I.tooltip?.showContent===!1&&!0!==a.hidden&&(0,f.jsx)(DN,{chartRef:m,chartData:t,wrapLabels:a.wrapLabels,enablePinning:a.enablePinning,pinnedPos:b,format:r,onUnpinClick:()=>{x(null)},containerId:p.tooltipPortalContainerId}),(0,f.jsx)(n6,{sx:{width:"100%",height:"100%"},option:I,theme:p.echartsTheme,onEvents:T,_instance:m,syncGroup:l})]})});function Dj(e){return(0,A.ZP)("MuiFormControlLabel",e)}let DB=(0,T.Z)("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),DF=e=>{let{classes:t,disabled:n,labelPlacement:r,error:i,required:o}=e,a={root:["root",n&&"disabled",`labelPlacement${(0,w.Z)(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return(0,y.Z)(a,Dj,t)},Dz=(0,S.ZP)("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${DB.label}`]:t.label},t.root,t[`labelPlacement${(0,w.Z)(n.labelPlacement)}`]]}})((0,C.Z)(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${DB.disabled}`]:{cursor:"default"},[`& .${DB.label}`]:{[`&.${DB.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>"start"===e||"top"===e||"bottom"===e,style:{marginLeft:16}}]}))),D$=(0,S.ZP)("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})((0,C.Z)(({theme:e})=>({[`&.${DB.error}`]:{color:(e.vars||e).palette.error.main}}))),DV=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiFormControlLabel"}),{checked:r,className:i,componentsProps:o={},control:a,disabled:s,disableTypography:l,inputRef:u,label:c,labelPlacement:d="end",name:h,onChange:p,required:m,slots:y={},slotProps:b={},value:x,...w}=n,S=r_(),C=s??a.props.disabled??S?.disabled,k=m??a.props.required,T={disabled:C,required:k};["checked","name","onChange","value","inputRef"].forEach(e=>{void 0===a.props[e]&&void 0!==n[e]&&(T[e]=n[e])});let A=rD({props:n,muiFormControl:S,states:["error"]}),I={...n,disabled:C,labelPlacement:d,required:k,error:A.error},P=DF(I),[R,O]=of("typography",{elementType:c1,externalForwardedProps:{slots:y,slotProps:{...o,...b}},ownerState:I}),E=c;return null==E||E.type===c1||l||(E=(0,f.jsx)(R,{component:"span",...O,className:(0,v.Z)(P.label,O?.className),children:E})),(0,f.jsxs)(Dz,{className:(0,v.Z)(P.root,i),ownerState:I,ref:t,...w,children:[g.cloneElement(a,T),k?(0,f.jsxs)("div",{children:[E,(0,f.jsxs)(D$,{ownerState:I,"aria-hidden":!0,className:P.asterisk,children:[" ","*"]})]}):E]})});var DH=e=>"checkbox"===e.type,DW=e=>e instanceof Date,Dq=e=>null==e;let DG=e=>"object"==typeof e;var DU=e=>!Dq(e)&&!Array.isArray(e)&&DG(e)&&!DW(e),DK=e=>DU(e)&&e.target?DH(e.target)?e.target.checked:e.target.value:e,DY=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,DX=(e,t)=>e.has(DY(t)),DJ=e=>{let t=e.constructor&&e.constructor.prototype;return DU(t)&&t.hasOwnProperty("isPrototypeOf")},DQ="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function D0(e){let t;let n=Array.isArray(e),r="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(!(DQ&&(e instanceof Blob||r))&&(n||DU(e))))return e;else if(t=n?[]:{},n||DJ(e))for(let n in e)e.hasOwnProperty(n)&&(t[n]=D0(e[n]));else t=e;return t}var D1=e=>Array.isArray(e)?e.filter(Boolean):[],D2=e=>void 0===e,D5=(e,t,n)=>{if(!t||!DU(e))return n;let r=D1(t.split(/[,[\].]+?/)).reduce((e,t)=>Dq(e)?e:e[t],e);return D2(r)||r===e?D2(e[t])?n:e[t]:r},D3=e=>"boolean"==typeof e,D4=e=>/^\w*$/.test(e),D6=e=>D1(e.replace(/["|']|\]/g,"").split(/\.|\[/)),D8=(e,t,n)=>{let r=-1,i=D4(t)?[t]:D6(t),o=i.length,a=o-1;for(;++r<o;){let t=i[r],o=n;if(r!==a){let n=e[t];o=DU(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=o,e=e[t]}return e};let D9={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},D7={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Le=g.createContext(null),Lt=()=>g.useContext(Le);var Ln=(e,t,n,r=!0)=>{let i={defaultValues:t._defaultValues};for(let o in e)Object.defineProperty(i,o,{get:()=>(t._proxyFormState[o]!==D9.all&&(t._proxyFormState[o]=!r||D9.all),n&&(n[o]=!0),e[o])});return i},Lr=e=>DU(e)&&!Object.keys(e).length,Li=(e,t,n,r)=>{n(e);let{name:i,...o}=e;return Lr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(e=>t[e]===(!r||D9.all))},Lo=e=>Array.isArray(e)?e:[e],La=(e,t,n)=>!e||!t||e===t||Lo(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e)));function Ls(e){let t=g.useRef(e);t.current=e,g.useEffect(()=>{let n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var Ll=e=>"string"==typeof e,Lu=(e,t,n,r,i)=>Ll(e)?(r&&t.watch.add(e),D5(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),D5(n,e))):(r&&(t.watchAll=!0),n);let Lc=e=>e.render(function(e){let t=Lt(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o}=e,a=DX(i._names.array,n),s=function(e){let t=Lt(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a}=e||{},s=g.useRef(r);s.current=r,Ls({disabled:o,subject:n._subjects.values,next:e=>{La(s.current,e.name,a)&&u(D0(Lu(s.current,n._names,e.values||n._formValues,!1,i)))}});let[l,u]=g.useState(n._getWatch(r,i));return g.useEffect(()=>n._removeUnmounted()),l}({control:i,name:n,defaultValue:D5(i._formValues,n,D5(i._defaultValues,n,e.defaultValue)),exact:!0}),l=function(e){let t=Lt(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[a,s]=g.useState(n._formState),l=g.useRef(!0),u=g.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=g.useRef(i);return c.current=i,Ls({disabled:r,next:e=>l.current&&La(c.current,e.name,o)&&Li(e,u.current,n._updateFormState)&&s({...n._formState,...e}),subject:n._subjects.state}),g.useEffect(()=>(l.current=!0,u.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),g.useMemo(()=>Ln(a,n,u.current,!1),[a,n])}({control:i,name:n,exact:!0}),u=g.useRef(i.register(n,{...e.rules,value:s,...D3(e.disabled)?{disabled:e.disabled}:{}})),c=g.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!D5(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!D5(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!D5(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!D5(l.validatingFields,n)},error:{enumerable:!0,get:()=>D5(l.errors,n)}}),[l,n]),d=g.useMemo(()=>({name:n,value:s,...D3(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:e=>u.current.onChange({target:{value:DK(e),name:n},type:"change"}),onBlur:()=>u.current.onBlur({target:{value:D5(i._formValues,n),name:n},type:"blur"}),ref:e=>{let t=D5(i._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}}),[n,i._formValues,r,l.disabled,s,i._fields]);return g.useEffect(()=>{let e=i._options.shouldUnregister||o,t=(e,t)=>{let n=D5(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){let e=D0(D5(i._options.defaultValues,n));D8(i._defaultValues,n,e),D2(D5(i._formValues,n))&&D8(i._formValues,n,e)}return a||i.register(n),()=>{(a?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,a,o]),g.useEffect(()=>{i._updateDisabledField({disabled:r,fields:i._fields,name:n})},[r,n,i]),g.useMemo(()=>({field:d,formState:l,fieldState:c}),[d,l,c])}(e));var Ld=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Lh=()=>{let e="undefined"==typeof performance?Date.now():1e3*performance.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let n=(16*Math.random()+e)%16|0;return("x"==t?n:3&n|8).toString(16)})},Lp=(e,t,n={})=>n.shouldFocus||D2(n.shouldFocus)?n.focusName||`${e}.${D2(n.focusIndex)?t:n.focusIndex}.`:"",Lf=e=>({isOnSubmit:!e||e===D9.onSubmit,isOnBlur:e===D9.onBlur,isOnChange:e===D9.onChange,isOnAll:e===D9.all,isOnTouch:e===D9.onTouched}),Lg=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));let Lm=(e,t,n,r)=>{for(let i of n||Object.keys(e)){let n=D5(e,i);if(n){let{_f:e,...o}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r)return!0;if(e.ref&&t(e.ref,e.name)&&!r)return!0;if(Lm(o,t))break}else if(DU(o)&&Lm(o,t))break}}};var Lv=(e,t,n)=>{let r=Lo(D5(e,n));return D8(r,"root",t[n]),D8(e,n,r),e},Ly=e=>"file"===e.type,Lb=e=>"function"==typeof e,Lx=e=>{if(!DQ)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Lw=e=>Ll(e),LS=e=>"radio"===e.type,LC=e=>e instanceof RegExp;let Lk={value:!1,isValid:!1},LM={value:!0,isValid:!0};var LT=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!D2(e[0].attributes.value)?D2(e[0].value)||""===e[0].value?LM:{value:e[0].value,isValid:!0}:LM:Lk}return Lk};let LA={isValid:!1,value:null};var LI=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,LA):LA;function LP(e,t,n="validate"){if(Lw(e)||Array.isArray(e)&&e.every(Lw)||D3(e)&&!e)return{type:n,message:Lw(e)?e:"",ref:t}}var LR=e=>DU(e)&&!LC(e)?e:{value:e,message:""},LO=async(e,t,n,r,i,o)=>{let{ref:a,refs:s,required:l,maxLength:u,minLength:c,min:d,max:h,pattern:p,validate:f,name:g,valueAsNumber:m,mount:v}=e._f,y=D5(n,g);if(!v||t.has(g))return{};let b=s?s[0]:a,x=e=>{i&&b.reportValidity&&(b.setCustomValidity(D3(e)?"":e||""),b.reportValidity())},w={},S=LS(a),C=DH(a),k=(m||Ly(a))&&D2(a.value)&&D2(y)||Lx(a)&&""===a.value||""===y||Array.isArray(y)&&!y.length,M=Ld.bind(null,g,r,w),T=(e,t,n,r=D7.maxLength,i=D7.minLength)=>{let o=e?t:n;w[g]={type:e?r:i,message:o,ref:a,...M(e?r:i,o)}};if(o?!Array.isArray(y)||!y.length:l&&(!(S||C)&&(k||Dq(y))||D3(y)&&!y||C&&!LT(s).isValid||S&&!LI(s).isValid)){let{value:e,message:t}=Lw(l)?{value:!!l,message:l}:LR(l);if(e&&(w[g]={type:D7.required,message:t,ref:b,...M(D7.required,t)},!r))return x(t),w}if(!k&&(!Dq(d)||!Dq(h))){let e,t;let n=LR(h),i=LR(d);if(Dq(y)||isNaN(y)){let r=a.valueAsDate||new Date(y),o=e=>new Date(new Date().toDateString()+" "+e),s="time"==a.type,l="week"==a.type;Ll(n.value)&&y&&(e=s?o(y)>o(n.value):l?y>n.value:r>new Date(n.value)),Ll(i.value)&&y&&(t=s?o(y)<o(i.value):l?y<i.value:r<new Date(i.value))}else{let r=a.valueAsNumber||(y?+y:y);Dq(n.value)||(e=r>n.value),Dq(i.value)||(t=r<i.value)}if((e||t)&&(T(!!e,n.message,i.message,D7.max,D7.min),!r))return x(w[g].message),w}if((u||c)&&!k&&(Ll(y)||o&&Array.isArray(y))){let e=LR(u),t=LR(c),n=!Dq(e.value)&&y.length>+e.value,i=!Dq(t.value)&&y.length<+t.value;if((n||i)&&(T(n,e.message,t.message),!r))return x(w[g].message),w}if(p&&!k&&Ll(y)){let{value:e,message:t}=LR(p);if(LC(e)&&!y.match(e)&&(w[g]={type:D7.pattern,message:t,ref:a,...M(D7.pattern,t)},!r))return x(t),w}if(f){if(Lb(f)){let e=LP(await f(y,n),b);if(e&&(w[g]={...e,...M(D7.validate,e.message)},!r))return x(e.message),w}else if(DU(f)){let e={};for(let t in f){if(!Lr(e)&&!r)break;let i=LP(await f[t](y,n),b,t);i&&(e={...i,...M(t,i.message)},x(i.message),r&&(w[g]=e))}if(!Lr(e)&&(w[g]={ref:b,...e},!r))return w}}return x(!0),w},LE=(e,t)=>[...e,...Lo(t)],LD=e=>Array.isArray(e)?e.map(()=>void 0):void 0;function LL(e,t,n){return[...e.slice(0,t),...Lo(n),...e.slice(t)]}var L_=(e,t,n)=>Array.isArray(e)?(D2(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],LN=(e,t)=>[...Lo(t),...Lo(e)],LZ=(e,t)=>D2(t)?[]:function(e,t){let n=0,r=[...e];for(let e of t)r.splice(e-n,1),n++;return D1(r).length?r:[]}(e,Lo(t).sort((e,t)=>e-t)),Lj=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},LB=(e,t,n)=>(e[t]=n,e);D9.onSubmit,D9.onChange;var LF=n(3755),Lz=n(6396);function L$({control:e,...t}){let{fields:n,append:r,remove:i}=function(e){let t=Lt(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:a}=e,[s,l]=g.useState(n._getFieldArray(r)),u=g.useRef(n._getFieldArray(r).map(Lh)),c=g.useRef(s),d=g.useRef(r),h=g.useRef(!1);d.current=r,c.current=s,n._names.array.add(r),a&&n.register(r,a),Ls({next:({values:e,name:t})=>{if(t===d.current||!t){let t=D5(e,d.current);Array.isArray(t)&&(l(t),u.current=t.map(Lh))}},subject:n._subjects.array});let p=g.useCallback(e=>{h.current=!0,n._updateFieldArray(r,e)},[n,r]);return g.useEffect(()=>{if(n._state.action=!1,Lg(r,n._names)&&n._subjects.state.next({...n._formState}),h.current&&(!Lf(n._options.mode).isOnSubmit||n._formState.isSubmitted)){if(n._options.resolver)n._executeSchema([r]).then(e=>{let t=D5(e.errors,r),i=D5(n._formState.errors,r);(i?!t&&i.type||t&&(i.type!==t.type||i.message!==t.message):t&&t.type)&&(t?D8(n._formState.errors,r,t):function e(t,n){let r=Array.isArray(n)?n:D4(n)?[n]:D6(n),i=1===r.length?t:function(e,t){let n=t.slice(0,-1).length,r=0;for(;r<n;)e=D2(e)?r++:e[t[r++]];return e}(t,r),o=r.length-1,a=r[o];return i&&delete i[a],0!==o&&(DU(i)&&Lr(i)||Array.isArray(i)&&function(e){for(let t in e)if(e.hasOwnProperty(t)&&!D2(e[t]))return!1;return!0}(i))&&e(t,r.slice(0,-1)),t}(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{let e=D5(n._fields,r);e&&e._f&&!(Lf(n._options.reValidateMode).isOnSubmit&&Lf(n._options.mode).isOnSubmit)&&LO(e,n._names.disabled,n._formValues,n._options.criteriaMode===D9.all,n._options.shouldUseNativeValidation,!0).then(e=>!Lr(e)&&n._subjects.state.next({errors:Lv(n._formState.errors,e,r)}))}}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&Lm(n._fields,(e,t)=>{if(n._names.focus&&t.startsWith(n._names.focus)&&e.focus)return e.focus(),1}),n._names.focus="",n._updateValid(),h.current=!1},[s,r,n]),g.useEffect(()=>(D5(n._formValues,r)||n._updateFieldArray(r),()=>{(n._options.shouldUnregister||o)&&n.unregister(r)}),[r,n,i,o]),{swap:g.useCallback((e,t)=>{let i=n._getFieldArray(r);Lj(i,e,t),Lj(u.current,e,t),p(i),l(i),n._updateFieldArray(r,i,Lj,{argA:e,argB:t},!1)},[p,r,n]),move:g.useCallback((e,t)=>{let i=n._getFieldArray(r);L_(i,e,t),L_(u.current,e,t),p(i),l(i),n._updateFieldArray(r,i,L_,{argA:e,argB:t},!1)},[p,r,n]),prepend:g.useCallback((e,t)=>{let i=Lo(D0(e)),o=LN(n._getFieldArray(r),i);n._names.focus=Lp(r,0,t),u.current=LN(u.current,i.map(Lh)),p(o),l(o),n._updateFieldArray(r,o,LN,{argA:LD(e)})},[p,r,n]),append:g.useCallback((e,t)=>{let i=Lo(D0(e)),o=LE(n._getFieldArray(r),i);n._names.focus=Lp(r,o.length-1,t),u.current=LE(u.current,i.map(Lh)),p(o),l(o),n._updateFieldArray(r,o,LE,{argA:LD(e)})},[p,r,n]),remove:g.useCallback(e=>{let t=LZ(n._getFieldArray(r),e);u.current=LZ(u.current,e),p(t),l(t),Array.isArray(D5(n._fields,r))||D8(n._fields,r,void 0),n._updateFieldArray(r,t,LZ,{argA:e})},[p,r,n]),insert:g.useCallback((e,t,i)=>{let o=Lo(D0(t)),a=LL(n._getFieldArray(r),e,o);n._names.focus=Lp(r,e,i),u.current=LL(u.current,e,o.map(Lh)),p(a),l(a),n._updateFieldArray(r,a,LL,{argA:e,argB:LD(t)})},[p,r,n]),update:g.useCallback((e,t)=>{let i=D0(t),o=LB(n._getFieldArray(r),e,i);u.current=[...o].map((t,n)=>t&&n!==e?u.current[n]:Lh()),p(o),l([...o]),n._updateFieldArray(r,o,LB,{argA:e,argB:i},!0,!1)},[p,r,n]),replace:g.useCallback(e=>{let t=Lo(D0(e));u.current=t.map(Lh),p([...t]),l([...t]),n._updateFieldArray(r,[...t],e=>e,{},!0,!1)},[p,r,n]),fields:g.useMemo(()=>s.map((e,t)=>({...e,[i]:u.current[t]||Lh()})),[s,i])}}({control:e,name:"panelDefinition.spec.links"});return(0,f.jsxs)(rf,{...t,gap:3,children:[n&&n.length>0?n.map((t,n)=>(0,f.jsxs)(g.Fragment,{children:[(0,f.jsxs)(rf,{direction:"row",gap:1,alignItems:"center",children:[(0,f.jsx)(LV,{control:e,index:n}),(0,f.jsx)(rx,{style:{width:"fit-content",height:"fit-content"},onClick:()=>i(n),children:(0,f.jsx)(Lz.default,{})})]}),(0,f.jsx)(vw,{})]},t.id)):(0,f.jsx)(c1,{variant:"subtitle1",mb:2,fontStyle:"italic",children:"No links defined"}),(0,f.jsx)(rx,{style:{width:"fit-content",height:"fit-content"},onClick:()=>r({url:""}),children:(0,f.jsx)(LF.default,{})})]})}function LV({control:e,index:t}){return(0,f.jsxs)(rf,{gap:2,flexGrow:1,children:[(0,f.jsxs)(rf,{direction:"row",gap:2,children:[(0,f.jsx)(Lc,{control:e,name:`panelDefinition.spec.links.${t}.url`,render:({field:e,fieldState:t})=>(0,f.jsx)(aC,{...e,required:!0,fullWidth:!0,label:"URL",error:!!t.error,helperText:t.error?.message,onChange:t=>{e.onChange(t)}})}),(0,f.jsx)(Lc,{control:e,name:`panelDefinition.spec.links.${t}.name`,render:({field:e,fieldState:t})=>(0,f.jsx)(aC,{...e,fullWidth:!0,label:"Name",defaultValue:"",error:!!t.error,helperText:t.error?.message,onChange:t=>{e.onChange(t)}})}),(0,f.jsx)(Lc,{control:e,name:`panelDefinition.spec.links.${t}.tooltip`,render:({field:e,fieldState:t})=>(0,f.jsx)(aC,{...e,fullWidth:!0,label:"Tooltip",defaultValue:"",error:!!t.error,helperText:t.error?.message,onChange:t=>{e.onChange(t)}})})]}),(0,f.jsxs)(rf,{gap:2,direction:"row",alignItems:"center",children:[(0,f.jsx)(Lc,{control:e,name:`panelDefinition.spec.links.${t}.renderVariables`,render:({field:e})=>(0,f.jsx)(DV,{label:"Render Variables",control:(0,f.jsx)(pT,{...e,checked:e.value,onChange:t=>e.onChange(t.target.checked)})})}),(0,f.jsx)(Lc,{control:e,name:`panelDefinition.spec.links.${t}.targetBlank`,render:({field:e})=>(0,f.jsx)(DV,{label:"Open in new tab",control:(0,f.jsx)(pT,{...e,checked:e.value,onChange:t=>e.onChange(t.target.checked)})})})]})]})}let LH=[{id:"value",label:"Value"},{id:"percentage",label:"Percentage"}];function LW({disablePercentageMode:e,onChange:t,value:n="value"}){return(0,f.jsx)(gb,{label:"Mode",control:(0,f.jsx)(g5,{value:LH.find(e=>e.id===n),options:LH,getOptionLabel:e=>e.label,getOptionDisabled:t=>"percentage"===t.id&&e,onChange:(e,{id:n})=>{t(n)},disableClearable:!0})})}let Lq=g.createContext();function LG(e){return(0,A.ZP)("MuiGrid",e)}let LU=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],LK=(0,T.Z)("MuiGrid",["root","container","item","zeroMinWidth",...[0,1,2,3,4,5,6,7,8,9,10].map(e=>`spacing-xs-${e}`),...["column-reverse","column","row-reverse","row"].map(e=>`direction-xs-${e}`),...["nowrap","wrap-reverse","wrap"].map(e=>`wrap-xs-${e}`),...LU.map(e=>`grid-xs-${e}`),...LU.map(e=>`grid-sm-${e}`),...LU.map(e=>`grid-md-${e}`),...LU.map(e=>`grid-lg-${e}`),...LU.map(e=>`grid-xl-${e}`)]);function LY({breakpoints:e,values:t}){let n="";Object.keys(t).forEach(e=>{""===n&&0!==t[e]&&(n=e)});let r=Object.keys(e).sort((t,n)=>e[t]-e[n]);return r.slice(0,r.indexOf(n))}let LX=(0,S.ZP)("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e,{container:r,direction:i,item:o,spacing:a,wrap:s,zeroMinWidth:l,breakpoints:u}=n,c=[];r&&(c=function(e,t,n={}){if(!e||e<=0)return[];if("string"==typeof e&&!Number.isNaN(Number(e))||"number"==typeof e)return[n[`spacing-xs-${String(e)}`]];let r=[];return t.forEach(t=>{let i=e[t];Number(i)>0&&r.push(n[`spacing-${t}-${String(i)}`])}),r}(a,u,t));let d=[];return u.forEach(e=>{let r=n[e];r&&d.push(t[`grid-${e}-${String(r)}`])}),[t.root,r&&t.container,o&&t.item,l&&t.zeroMinWidth,...c,"row"!==i&&t[`direction-xs-${String(i)}`],"wrap"!==s&&t[`wrap-xs-${String(s)}`],...d]}})(({ownerState:e})=>({boxSizing:"border-box",...e.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...e.item&&{margin:0},...e.zeroMinWidth&&{minWidth:0},..."wrap"!==e.wrap&&{flexWrap:e.wrap}}),function({theme:e,ownerState:t}){let n=(0,ra.P$)({values:t.direction,breakpoints:e.breakpoints.values});return(0,ra.k9)({theme:e},n,e=>{let t={flexDirection:e};return e.startsWith("column")&&(t[`& > .${LK.item}`]={maxWidth:"none"}),t})},function({theme:e,ownerState:t}){let{container:n,rowSpacing:r}=t,i={};if(n&&0!==r){let t;let n=(0,ra.P$)({values:r,breakpoints:e.breakpoints.values});"object"==typeof n&&(t=LY({breakpoints:e.breakpoints.values,values:n})),i=(0,ra.k9)({theme:e},n,(n,r)=>{let i=e.spacing(n);return"0px"!==i?{marginTop:`calc(-1 * ${i})`,[`& > .${LK.item}`]:{paddingTop:i}}:t?.includes(r)?{}:{marginTop:0,[`& > .${LK.item}`]:{paddingTop:0}}})}return i},function({theme:e,ownerState:t}){let{container:n,columnSpacing:r}=t,i={};if(n&&0!==r){let t;let n=(0,ra.P$)({values:r,breakpoints:e.breakpoints.values});"object"==typeof n&&(t=LY({breakpoints:e.breakpoints.values,values:n})),i=(0,ra.k9)({theme:e},n,(n,r)=>{let i=e.spacing(n);if("0px"!==i){let e=`calc(-1 * ${i})`;return{width:`calc(100% + ${i})`,marginLeft:e,[`& > .${LK.item}`]:{paddingLeft:i}}}return t?.includes(r)?{}:{width:"100%",marginLeft:0,[`& > .${LK.item}`]:{paddingLeft:0}}})}return i},function({theme:e,ownerState:t}){let n;return e.breakpoints.keys.reduce((r,i)=>{let o={};if(t[i]&&(n=t[i]),!n)return r;if(!0===n)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if("auto"===n)o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{let a=(0,ra.P$)({values:t.columns,breakpoints:e.breakpoints.values}),s="object"==typeof a?a[i]:a;if(null==s)return r;let l=`${Math.round(n/s*1e8)/1e6}%`,u={};if(t.container&&t.item&&0!==t.columnSpacing){let n=e.spacing(t.columnSpacing);if("0px"!==n){let e=`calc(${l} + ${n})`;u={flexBasis:e,maxWidth:e}}}o={flexBasis:l,flexGrow:0,maxWidth:l,...u}}return 0===e.breakpoints.values[i]?Object.assign(r,o):r[e.breakpoints.up(i)]=o,r},{})}),LJ=e=>{let{classes:t,container:n,direction:r,item:i,spacing:o,wrap:a,zeroMinWidth:s,breakpoints:l}=e,u=[];n&&(u=function(e,t){if(!e||e<=0)return[];if("string"==typeof e&&!Number.isNaN(Number(e))||"number"==typeof e)return[`spacing-xs-${String(e)}`];let n=[];return t.forEach(t=>{let r=e[t];if(Number(r)>0){let e=`spacing-${t}-${String(r)}`;n.push(e)}}),n}(o,l));let c=[];l.forEach(t=>{let n=e[t];n&&c.push(`grid-${t}-${String(n)}`)});let d={root:["root",n&&"container",i&&"item",s&&"zeroMinWidth",...u,"row"!==r&&`direction-xs-${String(r)}`,"wrap"!==a&&`wrap-xs-${String(a)}`,...c]};return(0,y.Z)(d,LG,t)},LQ=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiGrid"}),{breakpoints:r}=ot(),i=tj(n),{className:o,columns:a,columnSpacing:s,component:l="div",container:u=!1,direction:c="row",item:d=!1,rowSpacing:h,spacing:p=0,wrap:m="wrap",zeroMinWidth:y=!1,...b}=i,x=g.useContext(Lq),w=u?a||12:x,S={},C={...b};r.keys.forEach(e=>{null!=b[e]&&(S[e]=b[e],delete C[e])});let k={...i,columns:w,container:u,direction:c,item:d,rowSpacing:h||p,columnSpacing:s||p,wrap:m,zeroMinWidth:y,spacing:p,...S,breakpoints:r.keys},T=LJ(k);return(0,f.jsx)(Lq.Provider,{value:w,children:(0,f.jsx)(LX,{ownerState:k,className:(0,v.Z)(T.root,o),as:l,ref:t,...C})})}),L0=({children:e})=>(0,f.jsx)(LQ,{item:!0,xs:4,children:(0,f.jsx)(rf,{spacing:3,children:e})}),L1=({children:e})=>(0,f.jsx)(LQ,{container:!0,spacing:8,children:e}),L2=({title:e,children:t,icon:n})=>(0,f.jsxs)(tU,{children:[(0,f.jsxs)(tU,{display:"flex",borderBottom:1,borderColor:"grey.300",marginBottom:e=>e.spacing(1),children:[(0,f.jsx)(c1,{variant:"overline",component:"h4",children:e}),n&&(0,f.jsx)(tU,{sx:{marginLeft:"auto"},children:n})]}),(0,f.jsx)(rf,{spacing:1,children:t})]});function L5(e){return(0,A.ZP)("MuiSkeleton",e)}(0,T.Z)("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);let L3=e=>{let{classes:t,variant:n,animation:r,hasChildren:i,width:o,height:a}=e;return(0,y.Z)({root:["root",n,r,i&&"withChildren",i&&!o&&"fitContent",i&&!a&&"heightAuto"]},L5,t)},L4=(0,en.keyframes)`
115
- 0% {
116
- opacity: 1;
117
- }
118
-
119
- 50% {
120
- opacity: 0.4;
121
- }
122
-
123
- 100% {
124
- opacity: 1;
125
- }
126
- `,L6=(0,en.keyframes)`
127
- 0% {
128
- transform: translateX(-100%);
129
- }
130
-
131
- 50% {
132
- /* +0.5s of delay between each loop */
133
- transform: translateX(100%);
134
- }
135
-
136
- 100% {
137
- transform: translateX(100%);
138
- }
139
- `,L8="string"!=typeof L4?(0,en.css)`
140
- animation: ${L4} 2s ease-in-out 0.5s infinite;
141
- `:null,L9="string"!=typeof L6?(0,en.css)`
142
- &::after {
143
- animation: ${L6} 2s linear 0.5s infinite;
144
- }
145
- `:null,L7=(0,S.ZP)("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],!1!==n.animation&&t[n.animation],n.hasChildren&&t.withChildren,n.hasChildren&&!n.width&&t.fitContent,n.hasChildren&&!n.height&&t.heightAuto]}})((0,C.Z)(({theme:e})=>{let t=String(e.shape.borderRadius).match(/[\d.\-+]*\s*(.*)/)[1]||"px",n=parseFloat(e.shape.borderRadius);return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:(0,b.Fq)(e.palette.text.primary,"light"===e.palette.mode?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${n}${t}/${Math.round(n/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:e})=>e.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:e})=>e.hasChildren&&!e.width,style:{maxWidth:"fit-content"}},{props:({ownerState:e})=>e.hasChildren&&!e.height,style:{height:"auto"}},{props:{animation:"pulse"},style:L8||{animation:`${L4} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient(
146
- 90deg,
147
- transparent,
148
- ${(e.vars||e).palette.action.hover},
149
- transparent
150
- )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:L9||{"&::after":{animation:`${L6} 2s linear 0.5s infinite`}}}]}})),_e=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiSkeleton"}),{animation:r="pulse",className:i,component:o="span",height:a,style:s,variant:l="text",width:u,...c}=n,d={...n,animation:r,component:o,variant:l,hasChildren:!!c.children},h=L3(d);return(0,f.jsx)(L7,{as:o,ref:t,className:(0,v.Z)(h.root,i),ownerState:d,...c,style:{width:u,height:a,...s}})});function _t(e){let{message:t}=e;return(0,f.jsx)(rf,{sx:{height:"100%",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(c1,{children:t})})}function _n(e){let{resource:t}=e;return(0,f.jsx)(_t,{message:`No ${t}`})}function _r(e){let{variant:t="rounded"}=e;return(0,f.jsx)(rf,{sx:{height:"100%",alignItems:"center",justifyContent:"center",px:1},children:(0,f.jsx)(_e,{variant:t,width:"100%",height:"30%","aria-label":"Loading..."})})}let _i=[{id:"asc",label:"Ascending"},{id:"desc",label:"Descending"}];function _o({onChange:e,value:t="desc"}){return(0,f.jsx)(gb,{label:"Sort",control:(0,f.jsx)(g5,{value:_i.find(e=>e.id===t),options:_i,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function _a({onChange:e,value:t,...n}){let r=t=>{e(t)};return(0,f.jsxs)(L,{"aria-label":"Sort",...n,children:[(0,f.jsx)(e_,{onClick:()=>r(void 0),variant:void 0===t?"contained":"outlined",children:"None"}),(0,f.jsx)(e_,{onClick:()=>r("asc"),variant:"asc"===t?"contained":"outlined",children:"Asc"}),(0,f.jsx)(e_,{onClick:()=>r("desc"),variant:"desc"===t?"contained":"outlined",children:"Desc"})]})}function _s({text:e,fontWeight:t,width:n,height:r,lineHeight:i,maxSize:a,fontSizeOverride:s}){let l=function(){if(!o&&null===(o=document.createElement("canvas").getContext("2d")))throw Error("Canvas context is null.");return o}(),{echartsTheme:u}=tJ();if(void 0!==s)return Number(s);let c=u.textStyle,d=Number(c?.fontSize)??12,h=c?.fontFamily??"Lato",p=`${t} ${d}px ${h}`;l.font=p;let f=Math.min(r/i,n/l.measureText(e).width*d);return a?Math.min(f,a):f}let _l=(e,t)=>null===e?"null":"number"==typeof e?(0,eZ.Bw)(e,t):void 0===e?"":e;(0,ej.D)([Rc,tI.N,tP.N,tR.N,tO.N,tE.N]);let _u=e=>{let{width:t,height:n,data:r,sparkline:i,showSeriesName:o,format:a,valueFontSize:s}=e,l=tJ(),u=r.color,c=_l(r.calculatedValue,a),d=l.container.padding.default,h=_s({text:r?.seriesData?.name??"",fontWeight:400,width:t,height:.125*n,lineHeight:1.2,maxSize:30}),p=o?1.2*h+d:0,m=t-2*d,v=n-p,y=_s({text:c,fontSizeOverride:s,fontWeight:700,width:i?m:.5*m,height:i?.25*v:.9*v,lineHeight:1.2}),b=1.2*y;h=Math.min(.7*y,h);let x=(0,g.useMemo)(()=>{if(void 0===r.seriesData)return l.noDataOption;let e=r.seriesData,t=[];if(void 0!==i){let n={type:"line",name:e.name,data:e.values,zlevel:1,symbol:"none",animation:!1,silent:!0},r=n9()(n,i);t.push(r)}return{title:{show:!1},grid:{show:!1,top:"35%",right:0,bottom:0,left:0,containLabel:!1},xAxis:{type:"time",show:!1,boundaryGap:!1},yAxis:{type:"value",show:!1,min:e=>e.min>=0&&e.min<=1?0:e.min},tooltip:{show:!1},series:t}},[r,l,i]),w=i?"auto":"center";return(0,f.jsxs)(tU,{sx:{height:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:w,alignItems:w},children:[o&&(0,f.jsx)(_c,{padding:d,fontSize:h,children:r.seriesData?.name}),(0,f.jsx)(_d,{variant:"h3",color:u,fontSize:y,padding:d,children:c}),void 0!==i&&(0,f.jsx)(n6,{sx:{width:"100%"},style:{height:Math.floor(n-p-b)},option:x,theme:l.echartsTheme,renderer:"svg"})]})},_c=(0,S.ZP)(c1,{shouldForwardProp:e=>"padding"!==e&&"fontSize"!==e})(({theme:e,padding:t,fontSize:n})=>({color:e.palette.text.secondary,padding:`${t}px`,fontSize:`${n}px`,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),_d=(0,S.ZP)(c1,{shouldForwardProp:e=>"color"!==e&&"padding"!==e&&"fontSize"!==e&&"sparkline"!==e})(({theme:e,color:t,padding:n,fontSize:r,sparkline:i})=>({color:t??e.palette.text.primary,fontSize:`${r}px`,padding:i?`${n}px ${n}px 0 ${n}px`:` 0 ${n}px`,whiteSpace:"nowrap",lineHeight:1.2}));function _h(e){return(0,A.ZP)("MuiToggleButtonGroup",e)}let _p=(0,T.Z)("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),_f=g.createContext({}),_g=g.createContext(void 0);function _m(e){return(0,A.ZP)("MuiToggleButton",e)}let _v=(0,T.Z)("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),_y=e=>{let{classes:t,orientation:n,fullWidth:r,disabled:i}=e,o={root:["root",n,r&&"fullWidth"],grouped:["grouped",`grouped${(0,w.Z)(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,y.Z)(o,_h,t)},_b=(0,S.ZP)("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${_p.grouped}`]:t.grouped},{[`& .${_p.grouped}`]:t[`grouped${(0,w.Z)(n.orientation)}`]},{[`& .${_p.firstButton}`]:t.firstButton},{[`& .${_p.lastButton}`]:t.lastButton},{[`& .${_p.middleButton}`]:t.middleButton},t.root,"vertical"===n.orientation&&t.vertical,n.fullWidth&&t.fullWidth]}})((0,C.Z)(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${_p.grouped}`]:{[`&.${_p.selected} + .${_p.grouped}.${_p.selected}`]:{borderTop:0,marginTop:0}},[`& .${_p.firstButton},& .${_p.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${_p.lastButton},& .${_p.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${_p.lastButton}.${_v.disabled},& .${_p.middleButton}.${_v.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${_p.grouped}`]:{[`&.${_p.selected} + .${_p.grouped}.${_p.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${_p.firstButton},& .${_p.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${_p.lastButton},& .${_p.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${_p.lastButton}.${_v.disabled},& .${_p.middleButton}.${_v.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),_x=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiToggleButtonGroup"}),{children:r,className:i,color:o="standard",disabled:a=!1,exclusive:s=!1,fullWidth:l=!1,onChange:u,orientation:c="horizontal",size:d="medium",value:h,...p}=n,m={...n,disabled:a,fullWidth:l,orientation:c,size:d},y=_y(m),b=g.useCallback((e,t)=>{let n;if(!u)return;let r=h&&h.indexOf(t);h&&r>=0?(n=h.slice()).splice(r,1):n=h?h.concat(t):[t],u(e,n)},[u,h]),w=g.useCallback((e,t)=>{u&&u(e,h===t?null:t)},[u,h]),S=g.useMemo(()=>({className:y.grouped,onChange:s?w:b,value:h,size:d,fullWidth:l,color:o,disabled:a}),[y.grouped,s,w,b,h,d,l,o,a]),C=x(r),k=C.length,T=e=>{let t=0===e,n=e===k-1;return t&&n?"":t?y.firstButton:n?y.lastButton:y.middleButton};return(0,f.jsx)(_b,{role:"group",className:(0,v.Z)(y.root,i),ref:t,ownerState:m,...p,children:(0,f.jsx)(_f.Provider,{value:S,children:C.map((e,t)=>(0,f.jsx)(_g.Provider,{value:T(t),children:e},t))})})}),_w=e=>{let{classes:t,fullWidth:n,selected:r,disabled:i,size:o,color:a}=e,s={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth",`size${(0,w.Z)(o)}`,a]};return(0,y.Z)(s,_m,t)},_S=(0,S.ZP)(ef,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`size${(0,w.Z)(n.size)}`]]}})((0,C.Z)(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${_v.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${_v.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,b.Fq)(e.palette.text.primary,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,b.Fq)(e.palette.text.primary,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,b.Fq)(e.palette.text.primary,e.palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter(k()).map(([t])=>({props:{color:t},style:{[`&.${_v.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,b.Fq)(e.palette[t].main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,b.Fq)(e.palette[t].main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,b.Fq)(e.palette[t].main,e.palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),_C=g.forwardRef(function(e,t){var n;let{value:r,...i}=g.useContext(_f),o=g.useContext(_g),a=(0,_.Z)({...i,selected:(n=e.value,void 0!==r&&void 0!==n&&(Array.isArray(r)?r.includes(n):n===r))},e),s=(0,M.i)({props:a,name:"MuiToggleButton"}),{children:l,className:u,color:c="standard",disabled:d=!1,disableFocusRipple:h=!1,fullWidth:p=!1,onChange:m,onClick:y,selected:b,size:x="medium",value:w,...S}=s,C={...s,color:c,disabled:d,disableFocusRipple:h,fullWidth:p,size:x},k=_w(C);return(0,f.jsx)(_S,{className:(0,v.Z)(i.className,k.root,u,o||""),disabled:d,focusRipple:!h,ref:t,onClick:e=>{(!y||(y(e,w),!e.defaultPrevented))&&m&&m(e,w)},onChange:m,value:w,ownerState:C,"aria-pressed":b,...S,children:l})}),_k=rp();var _M=n(2446);function _T({inputRef:e,label:t,color:n,value:r,mode:i,onChange:o,onColorChange:a,onBlur:s,onDelete:l}){let[u,c]=(0,g.useState)(0);return(0,f.jsxs)(rf,{flex:1,direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,f.jsx)(a9,{label:t,color:n,onColorChange:a}),(0,f.jsx)(im,{htmlFor:t,children:t}),(0,f.jsx)(aC,{id:t,inputRef:e,type:"number",value:0===r?"":r,placeholder:"0",onChange:o,onBlur:s,onKeyDown:e=>{"Enter"===e.key&&(s(),c(u+1))},InputProps:{endAdornment:"percent"===i?(0,f.jsx)(tU,{paddingX:1,children:"%"}):void 0}},u),(0,f.jsx)(rx,{"aria-label":`delete threshold ${t}`,size:"small",onClick:l,children:(0,f.jsx)(_M.default,{})})]})}function _A({thresholds:e,onChange:t,hideDefault:n,disablePercentMode:r}){let{thresholds:{defaultColor:i,palette:o}}=tJ(),a=e?.defaultColor??i,[s,l]=(0,g.useState)(e?.steps);(0,g.useEffect)(()=>{l(e?.steps)},[e?.steps]);let u=(0,g.useRef)(null),c=(0,g.useRef)(!1);(0,g.useEffect)(()=>{u.current&&c.current&&(u.current?.focus(),c.current=!1)},[s?.length]);let d=(e,t)=>{l(sV(s,n=>{let r=n?.[t];r&&(r.value=Number(e.target.value))}))},h=(n,r)=>{void 0!==e&&t(sV(e,e=>{if(void 0!==e.steps){let t=e.steps[r];t&&(t.color=n)}}))},p=()=>{if(void 0!==s){let n=[...s];n.sort((e,t)=>e.value-t.value),void 0!==e&&t(sV(e,e=>{e.steps=n}))}},m=n=>{void 0!==e&&t(sV(e,e=>{e.steps&&e.steps.splice(n,1)}))};return(0,f.jsxs)(L2,{title:"Thresholds",icon:(0,f.jsx)(gm,{description:"Add threshold",children:(0,f.jsx)(rx,{size:"small","aria-label":"add threshold",onClick:()=>{c.current=!0,void 0===e?t({steps:[{value:10}]}):e&&void 0===e.steps?t(sV(e,e=>{e.steps=[{value:10}]})):t(sV(e,e=>{let t=e.steps;if(t?.length){let e=t[t.length-1],n=o[t.length]??_I();t.push({color:n,value:(e?.value??0)+10})}else t&&t.push({value:10})}))},children:(0,f.jsx)(LF.default,{})})}),children:[(0,f.jsx)(gb,{label:"Mode",description:"Percentage means thresholds relative to min & max",control:(0,f.jsxs)(_x,{exclusive:!0,disabled:r,value:e?.mode??"absolute",onChange:(n,r)=>{let i="percent"===r?"percent":void 0;void 0!==e?t(sV(e,e=>{e.mode=i})):t({mode:i})},sx:{height:"36px",marginLeft:"auto"},children:[(0,f.jsx)(_C,{"aria-label":"absolute",value:"absolute",sx:{fontWeight:500},children:"Absolute"}),(0,f.jsx)(_C,{"aria-label":"percent",value:"percent",sx:{fontWeight:500},children:"Percent"})]})}),s&&s.map((t,n)=>(0,f.jsx)(_T,{inputRef:n===s.length-1?u:void 0,label:`T${n+1}`,color:t.color??o[n]??a,value:t.value,mode:e?.mode,onColorChange:e=>h(e,n),onChange:e=>{d(e,n)},onDelete:()=>{m(n)},onBlur:p},n)).reverse(),!n&&(0,f.jsxs)(_k,{flex:1,direction:"row",alignItems:"center",spacing:1,children:[(0,f.jsx)(a9,{label:"default",color:a,onColorChange:n=>{void 0!==e?t(sV(e,e=>{e.defaultColor=n})):t({defaultColor:n})}}),(0,f.jsx)(c1,{children:"Default"})]})]})}let _I=()=>"#"+Math.floor(0x1000000*Math.random()).toString(16).padStart(6,"0");function _P(e){return"number"==typeof e}function _R(e){return!!e&&"object"==typeof e&&"function"==typeof e.constructor&&(!0===e.isBigNumber&&"object"==typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function _O(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function _E(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function _D(e){return e&&!0===e.constructor.prototype.isUnit||!1}function _L(e){return"string"==typeof e}var __=Array.isArray;function _N(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function _Z(e){return Array.isArray(e)||_N(e)}function _j(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function _B(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function _F(e){return e&&!0===e.constructor.prototype.isRange||!1}function _z(e){return e&&!0===e.constructor.prototype.isIndex||!1}function _$(e){return"boolean"==typeof e}function _V(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function _H(e){return e&&!0===e.constructor.prototype.isHelp||!1}function _W(e){return"function"==typeof e}function _q(e){return e instanceof Date}function _G(e){return e instanceof RegExp}function _U(e){return!!(e&&"object"==typeof e&&e.constructor===Object&&!_O(e)&&!_E(e))}function _K(e){return null===e}function _Y(e){return void 0===e}function _X(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function _J(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function _Q(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function _0(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function _1(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function _2(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function _5(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function _3(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function _4(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function _6(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function _8(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function _9(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function _7(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function Ne(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function Nt(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function Nn(e){return e&&!0===e.constructor.prototype.isChain||!1}function Nr(e){var t=typeof e;return"object"===t?null===e?"null":Array.isArray(e)?"Array":e instanceof Date?"Date":e instanceof RegExp?"RegExp":_R(e)?"BigNumber":_O(e)?"Complex":_E(e)?"Fraction":_N(e)?"Matrix":_D(e)?"Unit":_z(e)?"Index":_F(e)?"Range":_V(e)?"ResultSet":_6(e)?e.type:Nn(e)?"Chain":_H(e)?"Help":"Object":"function"===t?"Function":t}function Ni(e){var t=typeof e;if("number"===t||"string"===t||"boolean"===t||null==e)return e;if("function"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map(function(e){return Ni(e)});if(e instanceof Date)return new Date(e.valueOf());if(_R(e))return e;if(e instanceof RegExp)throw TypeError("Cannot clone "+e);return No(e,Ni)}function No(e,t){var n={};for(var r in e)Nl(e,r)&&(n[r]=t(e[r]));return n}function Na(e,t){var n,r,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(r=0,i=e.length;r<i;r++)if(!Na(e[r],t[r]))return!1;return!0}if("function"==typeof e)return e===t;if(!(e instanceof Object))return e===t;if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!Na(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}function Ns(e,t,n){var r,i=!0;Object.defineProperty(e,t,{get:function(){return i&&(r=n(),i=!1),r},set:function(e){r=e,i=!1},configurable:!0,enumerable:!0})}function Nl(e,t){return e&&Object.hasOwnProperty.call(e,t)}function Nu(e){return Object.keys(e).map(t=>e[t])}var Nc=n(8317);function Nd(e,t,n,r){function i(r){var i=function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r],o=e[i];void 0!==o&&(n[i]=o)}return n}(r,t.map(Np));return function(e,t,n){if(!t.filter(e=>{var t;return!((t=e)&&"?"===t[0])}).every(e=>void 0!==n[e])){var r=t.filter(e=>void 0===n[e]);throw Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(r.map(e=>'"'.concat(e,'"')).join(", "),"."))}}(e,t,r),n(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function Nh(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function Np(e){return e&&"?"===e[0]?e.slice(1):e}function Nf(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}function Ng(e,t,n){var r="";if(n){if(n<1)throw Error("size must be in greater than 0");if(!Nf(n))throw Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!Nf(e))throw Error("Value must be an integer");e<0&&(e+=2**n),r="i".concat(n)}var i="";return e<0&&(e=-e,i="-"),"".concat(i).concat({2:"0b",8:"0o",16:"0x"}[t]).concat(e.toString(t)).concat(r)}function Nm(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var n,r,i="auto";if(t&&(t.notation&&(i=t.notation),_P(t)?n=t:_P(t.precision)&&(n=t.precision),t.wordSize&&"number"!=typeof(r=t.wordSize)))throw Error('Option "wordSize" must be a number');switch(i){case"fixed":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Nv(e),r="number"==typeof t?Nb(n,n.exponent+1+t):n,i=r.coefficients,o=r.exponent+1,a=o+(t||0);return i.length<a&&(i=i.concat(Nx(a-i.length))),o<0&&(i=Nx(-o+1).concat(i),o=1),o<i.length&&i.splice(o,0,0===o?"0.":"."),r.sign+i.join("")}(e,n);case"exponential":return Ny(e,n);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Nb(Nv(e),t),r=n.exponent,i=n.coefficients,o=r%3==0?r:r<0?r-3-r%3:r-r%3;if(_P(t))for(;t>i.length||r-o+1>i.length;)i.push(0);else for(var a=Math.abs(r-o)-(i.length-1),s=0;s<a;s++)i.push(0);for(var l=Math.abs(r-o),u=1;l>0;)u++,l--;var c=i.slice(u).join(""),d=_P(t)&&c.length||c.match(/[1-9]/)?"."+c:"",h=i.slice(0,u).join("")+d+"e"+(r>=0?"+":"")+o.toString();return n.sign+h}(e,n);case"bin":return Ng(e,2,r);case"oct":return Ng(e,8,r);case"hex":return Ng(e,16,r);case"auto":return(function(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&void 0!==n.lowerExp?n.lowerExp:-3,i=n&&void 0!==n.upperExp?n.upperExp:5,o=Nv(e),a=t?Nb(o,t):o;if(a.exponent<r||a.exponent>=i)return Ny(e,t);var s=a.coefficients,l=a.exponent;s.length<t&&(s=s.concat(Nx(t-s.length))),s=s.concat(Nx(l-s.length+1+(s.length<t?t-s.length:0))),s=Nx(-l).concat(s);var u=l>0?l:0;return u<s.length-1&&s.splice(u+1,0,"."),a.sign+s.join("")})(e,n,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw Error('Unknown notation "'+i+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Nv(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw SyntaxError("Invalid number "+e);var n=t[1],r=t[2],i=parseFloat(t[4]||"0"),o=r.indexOf(".");i+=-1!==o?o-1:r.length-1;var a=r.replace(".","").replace(/^0*/,function(e){return i-=e.length,""}).replace(/0*$/,"").split("").map(function(e){return parseInt(e)});return 0===a.length&&(a.push(0),i++),{sign:n,coefficients:a,exponent:i}}function Ny(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Nv(e),r=t?Nb(n,t):n,i=r.coefficients,o=r.exponent;i.length<t&&(i=i.concat(Nx(t-i.length)));var a=i.shift();return r.sign+a+(i.length>0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function Nb(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){var i=t-1;for(r[i]++;10===r[i];)r.pop(),0===i&&(r.unshift(0),n.exponent++,i++),i--,r[i]++}return n}function Nx(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}var Nw=Number.EPSILON||2220446049250313e-31;function NS(e,t,n){if(null==n)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var r=Math.abs(e-t);return r<Nw||r<=Math.max(Math.abs(e),Math.abs(t))*n}return!1}function NC(e,t,n){var r=new e.constructor(2),i="";if(n){if(n<1)throw Error("size must be in greater than 0");if(!Nf(n))throw Error("size must be an integer");if(e.greaterThan(r.pow(n-1).sub(1))||e.lessThan(r.pow(n-1).mul(-1)))throw Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw Error("Value must be an integer");e.lessThan(0)&&(e=e.add(r.pow(n))),i="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw Error("Base ".concat(t," not supported "))}}function Nk(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function NM(e,t){var n=function(e,t){var n;if("number"==typeof e)return Nm(e,t);if(_R(e))return function(e,t){if("function"==typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var n="auto";if(void 0!==t&&(t.notation&&(n=t.notation),"number"==typeof t?d=t:t.precision&&(d=t.precision),t.wordSize&&"number"!=typeof(h=t.wordSize)))throw Error('Option "wordSize" must be a number');switch(n){case"fixed":return r=e,i=d,r.toFixed(i);case"exponential":return Nk(e,d);case"engineering":return o=e,a=d,l=(s=o.e)%3==0?s:s<0?s-3-s%3:s-s%3,-1!==(c=(u=o.mul(Math.pow(10,-l))).toPrecision(a)).indexOf("e")&&(c=u.toString()),c+"e"+(s>=0?"+":"")+l.toString();case"bin":return NC(e,2,h);case"oct":return NC(e,8,h);case"hex":return NC(e,16,h);case"auto":var r,i,o,a,s,l,u,c,d,h,p,f=t&&void 0!==t.lowerExp?t.lowerExp:-3,g=t&&void 0!==t.upperExp?t.upperExp:5;if(e.isZero())return"0";var m=e.toSignificantDigits(d),v=m.e;return(v>=f&&v<g?m.toFixed():Nk(e,d)).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}(e,t);return(n=e)&&"object"==typeof n&&"number"==typeof n.s&&"number"==typeof n.n&&"number"==typeof n.d?t&&"decimal"===t.fraction?e.toString():e.s*e.n+"/"+e.d:Array.isArray(e)?function e(t,n){if(!Array.isArray(t))return NM(t,n);for(var r="[",i=t.length,o=0;o<i;o++)0!==o&&(r+=", "),r+=e(t[o],n);return r+"]"}(e,t):_L(e)?'"'+e+'"':"function"==typeof e?e.syntax?String(e.syntax):"function":e&&"object"==typeof e?"function"==typeof e.format?e.format(t):e&&e.toString(t)!==({}).toString()?e.toString(t):"{"+Object.keys(e).map(n=>'"'+n+'": '+NM(e[n],t)).join(", ")+"}":String(e)}(e,t);return t&&"object"==typeof t&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function NT(e,t,n){if(!(this instanceof NT))throw SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=Error().stack}function NA(e,t,n){if(!(this instanceof NA))throw SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=Error().stack}function NI(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function NP(e,t){if(0===t.length){if(Array.isArray(e))throw new NT(e.length,0)}else!function e(t,n,r){var i,o=t.length;if(o!==n[r])throw new NT(o,n[r]);if(r<n.length-1){var a=r+1;for(i=0;i<o;i++){if(!Array.isArray(t[i]))throw new NT(n.length-1,n.length,"<");e(t[i],n,a)}}else for(i=0;i<o;i++)if(Array.isArray(t[i]))throw new NT(n.length+1,n.length,">")}(e,t,0)}function NR(e,t){if(!_P(e)||!Nf(e))throw TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new NA(e,t)}function NO(e,t,n){if(!Array.isArray(e)||!Array.isArray(t))throw TypeError("Array expected");if(0===t.length)throw Error("Resizing to scalar is not supported");return t.forEach(function(e){if(!_P(e)||!Nf(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+NM(t)+")")}),function e(t,n,r,i){var o,a,s=t.length,l=n[r],u=Math.min(s,l);if(t.length=l,r<n.length-1){var c=r+1;for(o=0;o<u;o++)Array.isArray(a=t[o])||(a=[a],t[o]=a),e(a,n,c,i);for(o=u;o<l;o++)a=[],t[o]=a,e(a,n,c,i)}else{for(o=0;o<u;o++)for(;Array.isArray(t[o]);)t[o]=t[o][0];for(o=u;o<l;o++)t[o]=i}}(e,t,0,void 0!==n?n:0),e}function NE(e,t){var n=ND(e),r=e.slice(),i=e.indexOf(-1);if(e.indexOf(-1,i+1)>=0)throw Error("More than one wildcard in sizes");if(i>=0){if(t%n==0)r[i]=-t/n;else throw Error("Could not replace wildcard, since "+t+" is no multiple of "+-n)}return r}function ND(e){return e.reduce((e,t)=>e*t,1)}function NL(e,t,n,r){var i=r||NI(e);if(n)for(var o=0;o<n;o++)e=[e],i.unshift(1);for(e=function e(t,n,r){var i,o;if(Array.isArray(t)){var a=r+1;for(i=0,o=t.length;i<o;i++)t[i]=e(t[i],n,a)}else for(var s=r;s<n;s++)t=[t];return t}(e,t,0);i.length<t;)i.push(1);return e}function N_(e,t){for(var n,r=0,i=0;i<e.length;i++){var o=e[i],a=Array.isArray(o);if(0===i&&a&&(r=o.length),a&&o.length!==r)return;var s=a?N_(o,t):t(o);if(void 0===n)n=s;else if(n!==s)return"mixed"}return n}function NN(e,t){return -1!==e.indexOf(t)}function NZ(e,t,n,r){if(!(this instanceof NZ))throw SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(null!=r?"-"+r:"")+" expected)",this.stack=Error().stack}NT.prototype=RangeError(),NT.prototype.constructor=RangeError,NT.prototype.name="DimensionError",NT.prototype.isDimensionError=!0,NA.prototype=RangeError(),NA.prototype.constructor=RangeError,NA.prototype.name="IndexError",NA.prototype.isIndexError=!0,NZ.prototype=Error(),NZ.prototype.constructor=Error,NZ.prototype.name="ArgumentsError",NZ.prototype.isArgumentsError=!0;var Nj={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null},NB=["Matrix","Array"],NF=["number","BigNumber","Fraction"];function Nz(e,t,n){var r;void 0!==e[t]&&(r=e[t],-1===n.indexOf(r))&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+n.map(e=>JSON.stringify(e)).join(", ")+".")}var N$,NV,NH,NW,Nq,NG,NU,NK,NY,NX,NJ,NQ,N0,N1,N2,N5,N3,N4,N6,N8,N9,N7,Ze,Zt,Zn,Zr="0123456789abcdef",Zi="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Zo="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Za={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},Zs=!0,Zl="[DecimalError] ",Zu=Zl+"Invalid argument: ",Zc=Zl+"Precision limit exceeded",Zd=Zl+"crypto unavailable",Zh="[object Decimal]",Zp=Math.floor,Zf=Math.pow,Zg=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Zm=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Zv=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Zy=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Zb=Zi.length-1,Zx=Zo.length-1,Zw={toStringTag:Zh};function ZS(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;t<i;t++)(n=7-(r=e[t]+"").length)&&(o+=ZD(n)),o+=r;(n=7-(r=(a=e[t])+"").length)&&(o+=ZD(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function ZC(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Zu+e)}function Zk(e,t,n,r){var i,o,a,s;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),o=Zf(10,7-t),s=e[i]%o|0,null==r?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),a=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):a=(n<4&&s+1==o||n>3&&s+1==o/2)&&(e[i+1]/o/100|0)==Zf(10,t-2)-1||(s==o/2||0==s)&&(e[i+1]/o/100|0)==0:t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),a=(r||n<4)&&9999==s||!r&&n>3&&4999==s):a=((r||n<4)&&s+1==o||!r&&n>3&&s+1==o/2)&&(e[i+1]/o/1e3|0)==Zf(10,t-3)-1,a}function ZM(e,t,n){for(var r,i,o=[0],a=0,s=e.length;a<s;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=Zr.indexOf(e.charAt(a++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}Zw.absoluteValue=Zw.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),ZA(e)},Zw.ceil=function(){return ZA(new this.constructor(this),this.e+1,2)},Zw.clampedTo=Zw.clamp=function(e,t){var n=this.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(Zu+t);return 0>this.cmp(e)?e:this.cmp(t)>0?t:new n(this)},Zw.comparedTo=Zw.cmp=function(e){var t,n,r,i,o=this.d,a=(e=new this.constructor(e)).d,s=this.s,l=e.s;if(!o||!a)return s&&l?s!==l?s:o===a?0:!o^s<0?1:-1:NaN;if(!o[0]||!a[0])return o[0]?s:a[0]?-l:0;if(s!==l)return s;if(this.e!==e.e)return this.e>e.e^s<0?1:-1;for(t=0,n=(r=o.length)<(i=a.length)?r:i;t<n;++t)if(o[t]!==a[t])return o[t]>a[t]^s<0?1:-1;return r===i?0:r>i^s<0?1:-1},Zw.cosine=Zw.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,i;if(t.isZero())return t;(r=t.d.length)<32?i=(1/Z$(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10"),e.precision+=n,t=Zz(e,1,t.times(i),new e(1));for(var o=n;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=n,t}(r,ZV(r,n)),r.precision=e,r.rounding=t,ZA(2==Zn||3==Zn?n.neg():n,e,t,!0)):new r(1):new r(NaN)},Zw.cubeRoot=Zw.cbrt=function(){var e,t,n,r,i,o,a,s,l,u,c=this.constructor;if(!this.isFinite()||this.isZero())return new c(this);for(Zs=!1,(o=this.s*Zf(this.s*this,1/3))&&Math.abs(o)!=1/0?r=new c(o.toString()):(n=ZS(this.d),(o=((e=this.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=Zf(n,1/3),e=Zp((e+1)/3)-(e%3==(e<0?-1:2)),(r=new c(n=o==1/0?"5e"+e:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=this.s),a=(e=c.precision)+3;;)if(r=ZT((u=(l=(s=r).times(s).times(s)).plus(this)).plus(this).times(s),u.plus(l),a+2,1),ZS(s.d).slice(0,a)===(n=ZS(r.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(ZA(r,e+1,1),t=!r.times(r).times(r).eq(this));break}if(!i&&(ZA(s,e+1,0),s.times(s).times(s).eq(this))){r=s;break}a+=4,i=1}return Zs=!0,ZA(r,e,c.rounding,t)},Zw.decimalPlaces=Zw.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=((e=t.length-1)-Zp(this.e/7))*7,e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},Zw.dividedBy=Zw.div=function(e){return ZT(this,new this.constructor(e))},Zw.dividedToIntegerBy=Zw.divToInt=function(e){var t=this.constructor;return ZA(ZT(this,new t(e),0,1,1),t.precision,t.rounding)},Zw.equals=Zw.eq=function(e){return 0===this.cmp(e)},Zw.floor=function(){return ZA(new this.constructor(this),this.e+1,3)},Zw.greaterThan=Zw.gt=function(e){return this.cmp(e)>0},Zw.greaterThanOrEqualTo=Zw.gte=function(e){var t=this.cmp(e);return 1==t||0===t},Zw.hyperbolicCosine=Zw.cosh=function(){var e,t,n,r,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;n=a.precision,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?t=(1/Z$(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=Zz(a,1,o.times(t),new a(1),!0);for(var l,u=e,c=new a(8);u--;)l=o.times(o),o=s.minus(l.times(c.minus(l.times(c))));return ZA(o,a.precision=n,a.rounding=r,!0)},Zw.hyperbolicSine=Zw.sinh=function(){var e,t,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=Zz(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=Zz(o,2,i=i.times(1/Z$(5,e)),i,!0);for(var a,s=new o(5),l=new o(16),u=new o(20);e--;)a=i.times(i),i=i.times(s.plus(a.times(l.times(a).plus(u))))}return o.precision=t,o.rounding=n,ZA(i,t,n,!0)},Zw.hyperbolicTangent=Zw.tanh=function(){var e,t,n=this.constructor;return this.isFinite()?this.isZero()?new n(this):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,ZT(this.sinh(),this.cosh(),n.precision=e,n.rounding=t)):new n(this.s)},Zw.inverseCosine=Zw.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return -1!==n?0===n?e.isNeg()?ZO(t,r,i):new t(0):new t(NaN):e.isZero()?ZO(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2))},Zw.inverseHyperbolicCosine=Zw.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,Zs=!1,n=n.times(n).minus(1).sqrt().plus(n),Zs=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},Zw.inverseHyperbolicSine=Zw.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,Zs=!1,n=n.times(n).plus(1).sqrt().plus(n),Zs=!0,r.precision=e,r.rounding=t,n.ln())},Zw.inverseHyperbolicTangent=Zw.atanh=function(){var e,t,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,Math.max(r=i.sd(),e)<-(2*i.e)-1)?ZA(new o(i),e,t,!0):(o.precision=n=r-i.e,i=ZT(i.plus(1),new o(1).minus(i),n+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5)):new o(NaN)},Zw.inverseSine=Zw.asin=function(){var e,t,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==t)?0===t?((e=ZO(o,n+4,r).times(.5)).s=i.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2))},Zw.inverseTangent=Zw.atan=function(){var e,t,n,r,i,o,a,s,l,u=this,c=u.constructor,d=c.precision,h=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&d+4<=Zx)return(a=ZO(c,d+4,h).times(.25)).s=u.s,a}else{if(!u.s)return new c(NaN);if(d+4<=Zx)return(a=ZO(c,d+4,h).times(.5)).s=u.s,a}for(c.precision=s=d+10,c.rounding=1,e=n=Math.min(28,s/7+2|0);e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(Zs=!1,t=Math.ceil(s/7),r=1,l=u.times(u),a=new c(u),i=u;-1!==e;)if(i=i.times(l),o=a.minus(i.div(r+=2)),i=i.times(l),void 0!==(a=o.plus(i.div(r+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return n&&(a=a.times(2<<n-1)),Zs=!0,ZA(a,c.precision=d,c.rounding=h,!0)},Zw.isFinite=function(){return!!this.d},Zw.isInteger=Zw.isInt=function(){return!!this.d&&Zp(this.e/7)>this.d.length-2},Zw.isNaN=function(){return!this.s},Zw.isNegative=Zw.isNeg=function(){return this.s<0},Zw.isPositive=Zw.isPos=function(){return this.s>0},Zw.isZero=function(){return!!this.d&&0===this.d[0]},Zw.lessThan=Zw.lt=function(e){return 0>this.cmp(e)},Zw.lessThanOrEqualTo=Zw.lte=function(e){return 1>this.cmp(e)},Zw.logarithm=Zw.log=function(e){var t,n,r,i,o,a,s,l,u=this.constructor,c=u.precision,d=u.rounding;if(null==e)e=new u(10),t=!0;else{if(n=(e=new u(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=this.d,this.s<0||!n||!n[0]||this.eq(1))return new u(n&&!n[0]?-1/0:1!=this.s?NaN:n?0:1/0);if(t){if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}}if(Zs=!1,Zk((l=ZT(a=Zj(this,s=c+5),t?ZR(u,s+10):Zj(e,s),s,1)).d,i=c,d))do if(s+=10,l=ZT(a=Zj(this,s),t?ZR(u,s+10):Zj(e,s),s,1),!o){+ZS(l.d).slice(i+1,i+15)+1==1e14&&(l=ZA(l,c+1,0));break}while(Zk(l.d,i+=10,d));return Zs=!0,ZA(l,c,d)},Zw.minus=Zw.sub=function(e){var t,n,r,i,o,a,s,l,u,c,d,h,p=this.constructor;if(e=new p(e),!this.d||!e.d)return this.s&&e.s?this.d?e.s=-e.s:e=new p(e.d||this.s!==e.s?this:NaN):e=new p(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.plus(e);if(u=this.d,h=e.d,s=p.precision,l=p.rounding,!u[0]||!h[0]){if(h[0])e.s=-e.s;else{if(!u[0])return new p(3===l?-0:0);e=new p(this)}return Zs?ZA(e,s,l):e}if(n=Zp(e.e/7),c=Zp(this.e/7),u=u.slice(),o=c-n){for((d=o<0)?(t=u,o=-o,a=h.length):(t=h,n=c,a=u.length),o>(r=Math.max(Math.ceil(s/7),a)+2)&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for((d=(r=u.length)<(a=h.length))&&(a=r),r=0;r<a;r++)if(u[r]!=h[r]){d=u[r]<h[r];break}o=0}for(d&&(t=u,u=h,h=t,e.s=-e.s),a=u.length,r=h.length-a;r>0;--r)u[a++]=0;for(r=h.length;r>o;){if(u[--r]<h[r]){for(i=r;i&&0===u[--i];)u[i]=1e7-1;--u[i],u[r]+=1e7}u[r]-=h[r]}for(;0===u[--a];)u.pop();for(;0===u[0];u.shift())--n;return u[0]?(e.d=u,e.e=ZP(u,n),Zs?ZA(e,s,l):e):new p(3===l?-0:0)},Zw.modulo=Zw.mod=function(e){var t,n=this.constructor;return(e=new n(e),this.d&&e.s&&(!e.d||e.d[0]))?e.d&&(!this.d||this.d[0])?(Zs=!1,9==n.modulo?(t=ZT(this,e.abs(),0,3,1),t.s*=e.s):t=ZT(this,e,0,n.modulo,1),t=t.times(e),Zs=!0,this.minus(t)):ZA(new n(this),n.precision,n.rounding):new n(NaN)},Zw.naturalExponential=Zw.exp=function(){return ZZ(this)},Zw.naturalLogarithm=Zw.ln=function(){return Zj(this)},Zw.negated=Zw.neg=function(){var e=new this.constructor(this);return e.s=-e.s,ZA(e)},Zw.plus=Zw.add=function(e){var t,n,r,i,o,a,s,l,u,c,d=this.constructor;if(e=new d(e),!this.d||!e.d)return this.s&&e.s?this.d||(e=new d(e.d||this.s===e.s?this:NaN)):e=new d(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.minus(e);if(u=this.d,c=e.d,s=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(e=new d(this)),Zs?ZA(e,s,l):e;if(o=Zp(this.e/7),r=Zp(e.e/7),u=u.slice(),i=o-r){for(i<0?(n=u,i=-i,a=c.length):(n=c,r=o,a=u.length),i>(a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((a=u.length)-(i=c.length)<0&&(i=a,n=c,c=u,u=n),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/1e7|0,u[i]%=1e7;for(t&&(u.unshift(t),++r),a=u.length;0==u[--a];)u.pop();return e.d=u,e.e=ZP(u,r),Zs?ZA(e,s,l):e},Zw.precision=Zw.sd=function(e){var t;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(Zu+e);return this.d?(t=ZE(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},Zw.round=function(){var e=this.constructor;return ZA(new e(this),this.e+1,e.rounding)},Zw.sine=Zw.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:Zz(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=Zz(e,2,t=t.times(1/Z$(5,n)),t);for(var i,o=new e(5),a=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(s))));return t}(r,ZV(r,n)),r.precision=e,r.rounding=t,ZA(Zn>2?n.neg():n,e,t,!0)):new r(NaN)},Zw.squareRoot=Zw.sqrt=function(){var e,t,n,r,i,o,a=this.d,s=this.e,l=this.s,u=this.constructor;if(1!==l||!a||!a[0])return new u(!l||l<0&&(!a||a[0])?NaN:a?this:1/0);for(Zs=!1,0==(l=Math.sqrt(+this))||l==1/0?(((t=ZS(a)).length+s)%2==0&&(t+="0"),l=Math.sqrt(t),s=Zp((s+1)/2)-(s<0||s%2),r=new u(t=l==1/0?"5e"+s:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+s)):r=new u(l.toString()),n=(s=u.precision)+3;;)if(r=(o=r).plus(ZT(this,o,n+2,1)).times(.5),ZS(o.d).slice(0,n)===(t=ZS(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(ZA(r,s+1,1),e=!r.times(r).eq(this));break}if(!i&&(ZA(o,s+1,0),o.times(o).eq(this))){r=o;break}n+=4,i=1}return Zs=!0,ZA(r,s,u.rounding,e)},Zw.tangent=Zw.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=ZT(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,ZA(2==Zn||4==Zn?n.neg():n,e,t,!0)):new r(NaN)},Zw.times=Zw.mul=function(e){var t,n,r,i,o,a,s,l,u,c=this.constructor,d=this.d,h=(e=new c(e)).d;if(e.s*=this.s,!d||!d[0]||!h||!h[0])return new c(e.s&&(!d||d[0]||h)&&(!h||h[0]||d)?d&&h?0*e.s:e.s/0:NaN);for(n=Zp(this.e/7)+Zp(e.e/7),(l=d.length)<(u=h.length)&&(o=d,d=h,h=o,a=l,l=u,u=a),o=[],r=a=l+u;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,i=l+r;i>r;)s=o[i]+h[r]*d[i-r-1]+t,o[i--]=s%1e7|0,t=s/1e7|0;o[i]=(o[i]+t)%1e7|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=ZP(o,n),Zs?ZA(e,c.precision,c.rounding):e},Zw.toBinary=function(e,t){return ZH(this,2,e,t)},Zw.toDecimalPlaces=Zw.toDP=function(e,t){var n=this,r=n.constructor;return(n=new r(n),void 0===e)?n:(ZC(e,0,1e9),void 0===t?t=r.rounding:ZC(t,0,8),ZA(n,e+n.e+1,t))},Zw.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=ZI(r,!0):(ZC(e,0,1e9),void 0===t?t=i.rounding:ZC(t,0,8),n=ZI(r=ZA(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},Zw.toFixed=function(e,t){var n,r,i=this.constructor;return void 0===e?n=ZI(this):(ZC(e,0,1e9),void 0===t?t=i.rounding:ZC(t,0,8),n=ZI(r=ZA(new i(this),e+this.e+1,t),!1,e+r.e+1)),this.isNeg()&&!this.isZero()?"-"+n:n},Zw.toFraction=function(e){var t,n,r,i,o,a,s,l,u,c,d,h,p=this.d,f=this.constructor;if(!p)return new f(this);if(u=n=new f(1),r=l=new f(0),a=(o=(t=new f(r)).e=ZE(p)-this.e-1)%7,t.d[0]=Zf(10,a<0?7+a:a),null==e)e=o>0?t:u;else{if(!(s=new f(e)).isInt()||s.lt(u))throw Error(Zu+s);e=s.gt(t)?o>0?t:u:s}for(Zs=!1,s=new f(ZS(p)),c=f.precision,f.precision=o=14*p.length;d=ZT(s,t,0,1,1),1!=(i=n.plus(d.times(r))).cmp(e);)n=r,r=i,i=u,u=l.plus(d.times(i)),l=i,i=t,t=s.minus(d.times(i)),s=i;return i=ZT(e.minus(n),r,0,1,1),l=l.plus(i.times(u)),n=n.plus(i.times(r)),l.s=u.s=this.s,h=1>ZT(u,r,o,1).minus(this).abs().cmp(ZT(l,n,o,1).minus(this).abs())?[u,r]:[l,n],f.precision=c,Zs=!0,h},Zw.toHexadecimal=Zw.toHex=function(e,t){return ZH(this,16,e,t)},Zw.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:ZC(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(Zs=!1,n=ZT(n,e,0,t,1).times(e),Zs=!0,ZA(n)):(e.s=n.s,n=e),n},Zw.toNumber=function(){return+this},Zw.toOctal=function(e,t){return ZH(this,8,e,t)},Zw.toPower=Zw.pow=function(e){var t,n,r,i,o,a,s=this,l=s.constructor,u=+(e=new l(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new l(Zf(+s,u));if((s=new l(s)).eq(1))return s;if(r=l.precision,o=l.rounding,e.eq(1))return ZA(s,r,o);if((t=Zp(e.e/7))>=e.d.length-1&&(n=u<0?-u:u)<=0x1fffffffffffff)return i=ZL(l,s,n,r),e.s<0?new l(1).div(i):ZA(i,r,o);if((a=s.s)<0){if(t<e.d.length-1)return new l(NaN);if((1&e.d[t])==0&&(a=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=a,s}return(t=0!=(n=Zf(+s,u))&&isFinite(n)?new l(n+"").e:Zp(u*(Math.log("0."+ZS(s.d))/Math.LN10+s.e+1)))>l.maxE+1||t<l.minE-1?new l(t>0?a/0:0):(Zs=!1,l.rounding=s.s=1,n=Math.min(12,(t+"").length),(i=ZZ(e.times(Zj(s,r+n)),r)).d&&Zk((i=ZA(i,r+5,1)).d,r,o)&&(t=r+10,+ZS((i=ZA(ZZ(e.times(Zj(s,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=ZA(i,r+1,0))),i.s=a,Zs=!0,l.rounding=o,ZA(i,r,o))},Zw.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=ZI(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(ZC(e,1,1e9),void 0===t?t=i.rounding:ZC(t,0,8),n=ZI(r=ZA(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},Zw.toSignificantDigits=Zw.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(ZC(e,1,1e9),void 0===t?t=n.rounding:ZC(t,0,8)),ZA(new n(this),e,t)},Zw.toString=function(){var e=this.constructor,t=ZI(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()&&!this.isZero()?"-"+t:t},Zw.truncated=Zw.trunc=function(){return ZA(new this.constructor(this),this.e+1,1)},Zw.valueOf=Zw.toJSON=function(){var e=this.constructor,t=ZI(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()?"-"+t:t};var ZT=function(){function e(e,t,n){var r,i=0,o=e.length;for(e=e.slice();o--;)r=e[o]*t+i,e[o]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=+(e[n]<t[n]),e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,a,s,l){var u,c,d,h,p,f,g,m,v,y,b,x,w,S,C,k,M,T,A,I,P=r.constructor,R=r.s==i.s?1:-1,O=r.d,E=i.d;if(!O||!O[0]||!E||!E[0])return new P(r.s&&i.s&&(O?!E||O[0]!=E[0]:E)?O&&0==O[0]||!E?0*R:R/0:NaN);for(l?(p=1,c=r.e-i.e):(l=1e7,p=7,c=Zp(r.e/p)-Zp(i.e/p)),A=E.length,M=O.length,y=(v=new P(R)).d=[],d=0;E[d]==(O[d]||0);d++);if(E[d]>(O[d]||0)&&c--,null==o?(S=o=P.precision,a=P.rounding):S=s?o+(r.e-i.e)+1:o,S<0)y.push(1),f=!0;else{if(S=S/p+2|0,d=0,1==A){for(h=0,E=E[0],S++;(d<M||h)&&S--;d++)C=h*l+(O[d]||0),y[d]=C/E|0,h=C%E|0;f=h||d<M}else{for((h=l/(E[0]+1)|0)>1&&(E=e(E,h,l),O=e(O,h,l),A=E.length,M=O.length),k=A,x=(b=O.slice(0,A)).length;x<A;)b[x++]=0;(I=E.slice()).unshift(0),T=E[0],E[1]>=l/2&&++T;do h=0,(u=t(E,b,A,x))<0?(w=b[0],A!=x&&(w=w*l+(b[1]||0)),(h=w/T|0)>1?(h>=l&&(h=l-1),m=(g=e(E,h,l)).length,x=b.length,1==(u=t(g,b,m,x))&&(h--,n(g,A<m?I:E,m,l))):(0==h&&(u=h=1),g=E.slice()),(m=g.length)<x&&g.unshift(0),n(b,g,x,l),-1==u&&(x=b.length,(u=t(E,b,A,x))<1&&(h++,n(b,A<x?I:E,x,l))),x=b.length):0===u&&(h++,b=[0]),y[d++]=h,u&&b[0]?b[x++]=O[k]||0:(b=[O[k]],x=1);while((k++<M||void 0!==b[0])&&S--);f=void 0!==b[0]}y[0]||y.shift()}if(1==p)v.e=c,Zt=f;else{for(d=1,h=y[0];h>=10;h/=10)d++;v.e=d+c*p-1,ZA(v,s?o+v.e+1:o,a,f)}return v}}();function ZA(e,t,n,r){var i,o,a,s,l,u,c,d,h,p=e.constructor;a:if(null!=t){if(!(d=e.d))return e;for(i=1,s=d[0];s>=10;s/=10)i++;if((o=t-i)<0)o+=7,a=t,l=(c=d[h=0])/Zf(10,i-a-1)%10|0;else if((h=Math.ceil((o+1)/7))>=(s=d.length)){if(r){for(;s++<=h;)d.push(0);c=l=0,i=1,o%=7,a=o-7+1}else break a}else{for(i=1,c=s=d[h];s>=10;s/=10)i++;o%=7,l=(a=o-7+i)<0?0:c/Zf(10,i-a-1)%10|0}if(r=r||t<0||void 0!==d[h+1]||(a<0?c:c%Zf(10,i-a-1)),u=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?a>0?c/Zf(10,i-a):0:d[h-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,u?(t-=e.e+1,d[0]=Zf(10,(7-t%7)%7),e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=h,s=1,h--):(d.length=h+1,s=Zf(10,7-o),d[h]=a>0?(c/Zf(10,i-a)%Zf(10,a)|0)*s:0),u)for(;;){if(0==h){for(o=1,a=d[0];a>=10;a/=10)o++;for(a=d[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(e.e++,1e7==d[0]&&(d[0]=1));break}if(d[h]+=s,1e7!=d[h])break;d[h--]=0,s=1}for(o=d.length;0===d[--o];)d.pop()}return Zs&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function ZI(e,t,n){if(!e.isFinite())return ZB(e);var r,i=e.e,o=ZS(e.d),a=o.length;return t?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+ZD(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+ZD(-i-1)+o,n&&(r=n-a)>0&&(o+=ZD(r))):i>=a?(o+=ZD(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+ZD(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=ZD(r))),o}function ZP(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function ZR(e,t,n){if(t>Zb)throw Zs=!0,n&&(e.precision=n),Error(Zc);return ZA(new e(Zi),t,1,!0)}function ZO(e,t,n){if(t>Zx)throw Error(Zc);return ZA(new e(Zo),t,n,!0)}function ZE(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function ZD(e){for(var t="";e--;)t+="0";return t}function ZL(e,t,n,r){var i,o=new e(1),a=Math.ceil(r/7+4);for(Zs=!1;;){if(n%2&&ZW((o=o.times(t)).d,a)&&(i=!0),0===(n=Zp(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}ZW((t=t.times(t)).d,a)}return Zs=!0,o}function Z_(e){return 1&e.d[e.d.length-1]}function ZN(e,t,n){for(var r,i,o=new e(t[0]),a=0;++a<t.length;){if(!(i=new e(t[a])).s){o=i;break}((r=o.cmp(i))===n||0===r&&o.s===n)&&(o=i)}return o}function ZZ(e,t){var n,r,i,o,a,s,l,u=0,c=0,d=0,h=e.constructor,p=h.rounding,f=h.precision;if(!e.d||!e.d[0]||e.e>17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(null==t?(Zs=!1,l=f):l=t,s=new h(.03125);e.e>-2;)e=e.times(s),d+=5;for(l+=r=Math.log(Zf(2,d))/Math.LN10*2+5|0,n=o=a=new h(1),h.precision=l;;){if(o=ZA(o.times(e),l,1),n=n.times(++c),ZS((s=a.plus(ZT(o,n,l,1))).d).slice(0,l)===ZS(a.d).slice(0,l)){for(i=d;i--;)a=ZA(a.times(a),l,1);if(null!=t)return h.precision=f,a;if(!(u<3&&Zk(a.d,l-r,p,u)))return ZA(a,h.precision=f,p,Zs=!0);h.precision=l+=10,n=o=s=new h(1),c=0,u++}a=s}}function Zj(e,t){var n,r,i,o,a,s,l,u,c,d,h,p=1,f=e,g=f.d,m=f.constructor,v=m.rounding,y=m.precision;if(f.s<0||!g||!g[0]||!f.e&&1==g[0]&&1==g.length)return new m(g&&!g[0]?-1/0:1!=f.s?NaN:g?0:f);if(null==t?(Zs=!1,c=y):c=t,m.precision=c+=10,r=(n=ZS(g)).charAt(0),!(15e14>Math.abs(o=f.e)))return u=ZR(m,c+2,y).times(o+""),f=Zj(new m(r+"."+n.slice(1)),c-10).plus(u),m.precision=y,null==t?ZA(f,y,v,Zs=!0):f;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=ZS((f=f.times(e)).d)).charAt(0),p++;for(o=f.e,r>1?(f=new m("0."+n),o++):f=new m(r+"."+n.slice(1)),d=f,l=a=f=ZT(f.minus(1),f.plus(1),c,1),h=ZA(f.times(f),c,1),i=3;;){if(a=ZA(a.times(h),c,1),ZS((u=l.plus(ZT(a,new m(i),c,1))).d).slice(0,c)===ZS(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(ZR(m,c+2,y).times(o+""))),l=ZT(l,new m(p),c,1),null!=t)return m.precision=y,l;if(!Zk(l.d,c-10,v,s))return ZA(l,m.precision=y,v,Zs=!0);m.precision=c+=10,u=a=f=ZT(d.minus(1),d.plus(1),c,1),h=ZA(f.times(f),c,1),i=s=1}l=u,i+=2}}function ZB(e){return String(e.s*e.s/0)}function ZF(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=7;r<i;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=i;for(;r--;)t+="0";e.d.push(+t),Zs&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Zz(e,t,n,r,i){var o,a,s,l,u=e.precision,c=Math.ceil(u/7);for(Zs=!1,l=n.times(n),s=new e(r);;){if(a=ZT(s.times(l),new e(t++*t++),u,1),s=i?r.plus(a):r.minus(a),r=ZT(a.times(l),new e(t++*t++),u,1),void 0!==(a=s.plus(r)).d[c]){for(o=c;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=r,r=a,a=o}return Zs=!0,a.d.length=c+1,a}function Z$(e,t){for(var n=e;--t;)n*=e;return n}function ZV(e,t){var n,r=t.s<0,i=ZO(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return Zn=r?4:1,t;if((n=t.divToInt(i)).isZero())Zn=r?3:2;else{if((t=t.minus(n.times(i))).lte(o))return Zn=Z_(n)?r?2:3:r?4:1,t;Zn=Z_(n)?r?1:4:r?3:2}return t.minus(i).abs()}function ZH(e,t,n,r){var i,o,a,s,l,u,c,d,h,p=e.constructor,f=void 0!==n;if(f?(ZC(n,1,1e9),void 0===r?r=p.rounding:ZC(r,0,8)):(n=p.precision,r=p.rounding),e.isFinite()){for(a=(c=ZI(e)).indexOf("."),f?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,a>=0&&(c=c.replace(".",""),(h=new p(1)).e=c.length-a,h.d=ZM(ZI(h),10,i),h.e=h.d.length),o=l=(d=ZM(c,10,i)).length;0==d[--l];)d.pop();if(d[0]){if(a<0?o--:((e=new p(e)).d=d,e.e=o,d=(e=ZT(e,h,n,r,0,i)).d,o=e.e,u=Zt),a=d[n],s=i/2,u=u||void 0!==d[n+1],u=r<4?(void 0!==a||u)&&(0===r||r===(e.s<0?3:2)):a>s||a===s&&(4===r||u||6===r&&1&d[n-1]||r===(e.s<0?8:7)),d.length=n,u)for(;++d[--n]>i-1;)d[n]=0,n||(++o,d.unshift(1));for(l=d.length;!d[l-1];--l);for(a=0,c="";a<l;a++)c+=Zr.charAt(d[a]);if(f){if(l>1){if(16==t||8==t){for(a=16==t?4:3,--l;l%a;l++)c+="0";for(l=(d=ZM(c,i,t)).length;!d[l-1];--l);for(a=1,c="1.";a<l;a++)c+=Zr.charAt(d[a])}else c=c.charAt(0)+"."+c.slice(1)}c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}else c=f?"0p+0":"0";c=(16==t?"0x":2==t?"0b":8==t?"0o":"")+c}else c=ZB(e);return e.s<0?"-"+c:c}function ZW(e,t){if(e.length>t)return e.length=t,!0}function Zq(e){return new this(e).abs()}function ZG(e){return new this(e).acos()}function ZU(e){return new this(e).acosh()}function ZK(e,t){return new this(e).plus(t)}function ZY(e){return new this(e).asin()}function ZX(e){return new this(e).asinh()}function ZJ(e){return new this(e).atan()}function ZQ(e){return new this(e).atanh()}function Z0(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?ZO(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=ZO(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(ZT(e,t,o,1)),t=ZO(this,o,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(ZT(e,t,o,1)):(n=ZO(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function Z1(e){return new this(e).cbrt()}function Z2(e){return ZA(e=new this(e),e.e+1,2)}function Z5(e,t,n){return new this(e).clamp(t,n)}function Z3(e){if(!e||"object"!=typeof e)throw Error(Zl+"Object expected");var t,n,r,i=!0===e.defaults,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,9e15,"maxE",0,9e15,"minE",-9e15,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(n=o[t],i&&(this[n]=Za[n]),void 0!==(r=e[n])){if(Zp(r)===r&&r>=o[t+1]&&r<=o[t+2])this[n]=r;else throw Error(Zu+n+": "+r)}if(n="crypto",i&&(this[n]=Za[n]),void 0!==(r=e[n])){if(!0===r||!1===r||0===r||1===r){if(r){if("undefined"!=typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(Zd)}else this[n]=!1}else throw Error(Zu+n+": "+r)}return this}function Z4(e){return new this(e).cos()}function Z6(e){return new this(e).cosh()}function Z8(e,t){return new this(e).div(t)}function Z9(e){return new this(e).exp()}function Z7(e){return ZA(e=new this(e),e.e+1,3)}function je(){var e,t,n=new this(0);for(e=0,Zs=!1;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return Zs=!0,new this(1/0);n=t}return Zs=!0,n.sqrt()}function jt(e){return e instanceof jS||e&&e.toStringTag===Zh||!1}function jn(e){return new this(e).ln()}function jr(e,t){return new this(e).log(t)}function ji(e){return new this(e).log(2)}function jo(e){return new this(e).log(10)}function ja(){return ZN(this,arguments,-1)}function js(){return ZN(this,arguments,1)}function jl(e,t){return new this(e).mod(t)}function ju(e,t){return new this(e).mul(t)}function jc(e,t){return new this(e).pow(t)}function jd(e){var t,n,r,i,o=0,a=new this(1),s=[];if(void 0===e?e=this.precision:ZC(e,1,1e9),r=Math.ceil(e/7),this.crypto){if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=t[o])>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);o<r;)(i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,o):(s.push(i%1e7),o+=4);o=r/4}else throw Error(Zd)}else for(;o<r;)s[o++]=1e7*Math.random()|0;for(r=s[--o],e%=7,r&&e&&(i=Zf(10,7-e),s[o]=(r/i|0)*i);0===s[o];o--)s.pop();if(o<0)n=0,s=[0];else{for(n=-1;0===s[0];n-=7)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<7&&(n-=7-r)}return a.e=n,a.d=s,a}function jh(e){return ZA(e=new this(e),e.e+1,this.rounding)}function jp(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function jf(e){return new this(e).sin()}function jg(e){return new this(e).sinh()}function jm(e){return new this(e).sqrt()}function jv(e,t){return new this(e).sub(t)}function jy(){var e=0,t=arguments,n=new this(t[0]);for(Zs=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return Zs=!0,ZA(n,this.precision,this.rounding)}function jb(e){return new this(e).tan()}function jx(e){return new this(e).tanh()}function jw(e){return ZA(e=new this(e),e.e+1,1)}Zw[Symbol.for("nodejs.util.inspect.custom")]=Zw.toString,Zw[Symbol.toStringTag]="Decimal";var jS=Zw.constructor=function e(t){var n,r,i;function o(e){var t,n,r;if(!(this instanceof o))return new o(e);if(this.constructor=o,jt(e)){this.s=e.s,Zs?!e.d||e.e>o.maxE?(this.e=NaN,this.d=null):e.e<o.minE?(this.e=0,this.d=[0]):(this.e=e.e,this.d=e.d.slice()):(this.e=e.e,this.d=e.d?e.d.slice():e.d);return}if("number"==(r=typeof e)){if(0===e){this.s=1/e<0?-1:1,this.e=0,this.d=[0];return}if(e<0?(e=-e,this.s=-1):this.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;Zs?t>o.maxE?(this.e=NaN,this.d=null):t<o.minE?(this.e=0,this.d=[0]):(this.e=t,this.d=[e]):(this.e=t,this.d=[e]);return}if(0*e!=0){e||(this.s=NaN),this.e=NaN,this.d=null;return}return ZF(this,e.toString())}if("string"===r)return 45===(n=e.charCodeAt(0))?(e=e.slice(1),this.s=-1):(43===n&&(e=e.slice(1)),this.s=1),Zy.test(e)?ZF(this,e):function(e,t){var n,r,i,o,a,s,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Zy.test(t))return ZF(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Zm.test(t))n=16,t=t.toLowerCase();else if(Zg.test(t))n=2;else if(Zv.test(t))n=8;else throw Error(Zu+t);for((o=t.search(/p/i))>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),a=(o=t.indexOf("."))>=0,r=e.constructor,a&&(o=(s=(t=t.replace(".","")).length)-o,i=ZL(r,new r(n),o,2*o)),o=c=(u=ZM(t,n,1e7)).length-1;0===u[o];--o)u.pop();return o<0?new r(0*e.s):(e.e=ZP(u,c),e.d=u,Zs=!1,a&&(e=ZT(e,i,4*s)),l&&(e=e.times(54>Math.abs(l)?Zf(2,l):jS.pow(2,l))),Zs=!0,e)}(this,e);if("bigint"===r)return e<0?(e=-e,this.s=-1):this.s=1,ZF(this,e.toString());throw Error(Zu+e)}if(o.prototype=Zw,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=Z3,o.clone=e,o.isDecimal=jt,o.abs=Zq,o.acos=ZG,o.acosh=ZU,o.add=ZK,o.asin=ZY,o.asinh=ZX,o.atan=ZJ,o.atanh=ZQ,o.atan2=Z0,o.cbrt=Z1,o.ceil=Z2,o.clamp=Z5,o.cos=Z4,o.cosh=Z6,o.div=Z8,o.exp=Z9,o.floor=Z7,o.hypot=je,o.ln=jn,o.log=jr,o.log10=jo,o.log2=ji,o.max=ja,o.min=js,o.mod=jl,o.mul=ju,o.pow=jc,o.random=jd,o.round=jh,o.sign=jp,o.sin=jf,o.sinh=jg,o.sqrt=jm,o.sub=jv,o.sum=jy,o.tan=jb,o.tanh=jx,o.trunc=jw,void 0===t&&(t={}),t&&!0!==t.defaults)for(n=0,i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"];n<i.length;)t.hasOwnProperty(r=i[n++])||(t[r]=this[r]);return o.config(t),o}(Za);Zi=new jS(Zi),Zo=new jS(Zo);var jC={createBigNumberClass:Nd("BigNumber",["?on","config"],e=>{var{on:t,config:n}=e,r=jS.clone({precision:n.precision,modulo:jS.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t("config",function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})}),r},{isClass:!0})},jk={createMatrixClass:Nd("Matrix",[],()=>{function e(){if(!(this instanceof e))throw SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,n){throw Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,n){throw Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0})},jM={MatrixDependencies:jk,createDenseMatrixClass:Nd("DenseMatrix",["Matrix"],e=>{var{Matrix:t}=e;function n(e,t){if(!(this instanceof n))throw SyntaxError("Constructor must be called with the new operator");if(t&&!_L(t))throw Error("Invalid datatype: "+t);if(_N(e))"DenseMatrix"===e.type?(this._data=Ni(e._data),this._size=Ni(e._size)):(this._data=e.toArray(),this._size=e.size()),this._datatype=t||e._datatype;else if(e&&__(e.data)&&__(e.size))this._data=e.data,this._size=e.size,NP(this._data,this._size),this._datatype=t||e.datatype;else if(__(e))this._data=function e(t){for(var n=0,r=t.length;n<r;n++){var i=t[n];__(i)?t[n]=e(i):i&&!0===i.isMatrix&&(t[n]=e(i.valueOf()))}return t}(e),this._size=NI(this._data),NP(this._data,this._size),this._datatype=t;else if(e)throw TypeError("Unsupported type of data ("+Nr(e)+")");else this._data=[],this._size=[0],this._datatype=t}function r(e,t,n){if(0===t.length){for(var r=e._data;__(r);)r=r[0];return r}return e._size=t.slice(0),e._data=NO(e._data,e._size,n),e}function i(e,t,n){for(var i=e._size.slice(0),o=!1;i.length<t.length;)i.push(0),o=!0;for(var a=0,s=t.length;a<s;a++)t[a]>i[a]&&(i[a]=t[a],o=!0);o&&r(e,i,n)}return n.prototype=new t,n.prototype.createDenseMatrix=function(e,t){return new n(e,t)},n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return N_(this._data,Nr)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(e,t){return new n(e,t)},n.prototype.subset=function(e,t,r){switch(arguments.length){case 1:return function(e,t){if(!_z(t))throw TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var r=t.size();if(r.length!==e._size.length)throw new NT(r.length,e._size.length);for(var i=t.min(),o=t.max(),a=0,s=e._size.length;a<s;a++)NR(i[a],e._size[a]),NR(o[a],e._size[a]);return new n(function e(t,n,r,i){var o=i===r-1,a=n.dimension(i);return o?a.map(function(e){return NR(e,t.length),t[e]}).valueOf():a.map(function(o){return NR(o,t.length),e(t[o],n,r,i+1)}).valueOf()}(e._data,t,r.length,0),e._datatype)}(this,e);case 2:case 3:return function(e,t,n,r){if(!t||!0!==t.isIndex)throw TypeError("Invalid index");var o,a=t.size(),s=t.isScalar();if(_N(n)?(o=n.size(),n=n.valueOf()):o=NI(n),s){if(0!==o.length)throw TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(a.length<e._size.length)throw new NT(a.length,e._size.length,"<");if(o.length<a.length){for(var l=0,u=0;1===a[l]&&1===o[l];)l++;for(;1===a[l];)u++,l++;n=NL(n,a.length,u,o)}if(!Na(a,o))throw new NT(a,o,">");i(e,t.max().map(function(e){return e+1}),r);var c=a.length;(function e(t,n,r,i,o){var a=o===i-1,s=n.dimension(o);a?s.forEach(function(e,n){NR(e),t[e]=r[n[0]]}):s.forEach(function(a,s){NR(a),e(t[a],n,r[s[0]],i,o+1)})})(e._data,t,n,c,0)}return e}(this,e,t,r);default:throw SyntaxError("Wrong number of arguments")}},n.prototype.get=function(e){if(!__(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new NT(e.length,this._size.length);for(var t=0;t<e.length;t++)NR(e[t],this._size[t]);for(var n=this._data,r=0,i=e.length;r<i;r++){var o=e[r];NR(o,n.length),n=n[o]}return n},n.prototype.set=function(e,t,n){if(!__(e))throw TypeError("Array expected");if(e.length<this._size.length)throw new NT(e.length,this._size.length,"<");i(this,e.map(function(e){return e+1}),n);var r,o,a,s=this._data;for(r=0,o=e.length-1;r<o;r++)NR(a=e[r],s.length),s=s[a];return NR(a=e[e.length-1],s.length),s[a]=t,this},n.prototype.resize=function(e,t,n){if(!_Z(e))throw TypeError("Array or Matrix expected");var i=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);return r(n?this.clone():this,i,t)},n.prototype.reshape=function(e,t){var n=t?this.clone():this;n._data=function(e,t){var n=function(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function e(n){Array.isArray(n)?n.forEach(e):t.push(n)}),t}(e),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw TypeError("Array expected");if(0===t.length)throw new NT(0,r,"!=");var i=ND(t=NE(t,r));if(r!==i)throw new NT(i,r,"!=");try{return function(e,t){for(var n,r=e,i=t.length-1;i>0;i--){var o=t[i];n=[];for(var a=r.length/o,s=0;s<a;s++)n.push(r.slice(s*o,(s+1)*o));r=n}return r}(n,t)}catch(e){if(e instanceof NT)throw new NT(i,r,"!=");throw e}}(n._data,e);var r=n._size.reduce((e,t)=>e*t);return n._size=NE(e,r),n},n.prototype.clone=function(){return new n({data:Ni(this._data),size:Ni(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(e){var t=this,r=function n(r,i){return __(r)?r.map(function(e,t){return n(e,i.concat(t))}):e(r,i,t)}(this._data,[]),i=void 0!==this._datatype?N_(r,Nr):void 0;return new n(r,i)},n.prototype.forEach=function(e){var t=this;!function n(r,i){__(r)?r.forEach(function(e,t){n(e,i.concat(t))}):e(r,i,t)}(this._data,[])},n.prototype[Symbol.iterator]=function*(){var e=function* e(t,n){if(__(t))for(var r=0;r<t.length;r++)yield*e(t[r],n.concat(r));else yield{value:t,index:n}};yield*e(this._data,[])},n.prototype.rows=function(){var e=[];if(2!==this.size().length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var t of this._data)e.push(new n([t],this._datatype));return e},n.prototype.columns=function(){var e=this,t=[],r=this.size();if(2!==r.length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,o=function(r){var o=i.map(e=>[e[r]]);t.push(new n(o,e._datatype))},a=0;a<r[1];a++)o(a);return t},n.prototype.toArray=function(){return Ni(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return NM(this._data,e)},n.prototype.toString=function(){return NM(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(e){if(e){if(_R(e)&&(e=e.toNumber()),!_P(e)||!Nf(e))throw TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,r=e<0?-e:0,i=Math.min(this._size[0]-r,this._size[1]-t),o=[],a=0;a<i;a++)o[a]=this._data[a+r][a+t];return new n({data:o,size:[i],datatype:this._datatype})},n.diagonal=function(e,t,r,i){if(!__(e))throw TypeError("Array expected, size parameter");if(2!==e.length)throw Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(_R(e)&&(e=e.toNumber()),!_P(e)||!Nf(e)||e<1)throw Error("Size values must be positive integers");return e}),r){if(_R(r)&&(r=r.toNumber()),!_P(r)||!Nf(r))throw TypeError("The parameter k must be an integer number")}else r=0;var o,a=r>0?r:0,s=r<0?-r:0,l=e[0],u=e[1],c=Math.min(l-s,u-a);if(__(t)){if(t.length!==c)throw Error("Invalid value array length");o=function(e){return t[e]}}else if(_N(t)){var d=t.size();if(1!==d.length||d[0]!==c)throw Error("Invalid matrix length");o=function(e){return t.get([e])}}else o=function(){return t};i||(i=_R(o(0))?o(0).mul(0):0);var h=[];if(e.length>0){h=NO(h,e,i);for(var p=0;p<c;p++)h[p+s][p+a]=o(p)}return new n({data:h,size:[l,u]})},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(e,t){if(!_P(e)||!Nf(e)||!_P(t)||!Nf(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return NR(e,this._size[0]),NR(t,this._size[0]),n._swapRows(e,t,this._data),this},n._swapRows=function(e,t,n){var r=n[e];n[e]=n[t],n[t]=r},n},{isClass:!0})};let jT=Math.cosh||function(e){return 1e-9>Math.abs(e)?1-e:(Math.exp(e)+Math.exp(-e))*.5},jA=Math.sinh||function(e){return 1e-9>Math.abs(e)?e:(Math.exp(e)-Math.exp(-e))*.5},jI=function(e){let t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;let n=e*e;return n*(n*(n*(n*(n*(n*(n*(n/20922789888e3-1/0x144c3b2800)+1/0x1c8cfc00)-1/3628800)+1/40320)-1/720)+1/24)-.5)},jP=function(e,t){return((e=Math.abs(e))<(t=Math.abs(t))&&([e,t]=[t,e]),e<1e8)?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},jR=function(){throw SyntaxError("Invalid Param")};function jO(e,t){let n=Math.abs(e),r=Math.abs(t);return 0===e?Math.log(r):0===t?Math.log(n):n<3e3&&r<3e3?.5*Math.log(e*e+t*t):.5*Math.log((e*=.5)*e+(t*=.5)*t)+Math.LN2}let jE={re:0,im:0},jD=function(e,t){if(null==e)jE.re=jE.im=0;else if(void 0!==t)jE.re=e,jE.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)jE.re=e.re,jE.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return jL.INFINITY;jE.re=e.abs*Math.cos(e.arg),jE.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return jL.INFINITY;jE.re=e.r*Math.cos(e.phi),jE.im=e.r*Math.sin(e.phi)}else 2===e.length?(jE.re=e[0],jE.im=e[1]):jR();break;case"string":jE.im=jE.re=0;let n=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),r=1,i=0;null===n&&jR();for(let e=0;e<n.length;e++){let t=n[e];" "===t||" "===t||"\n"===t||("+"===t?r++:"-"===t?i++:("i"===t||"I"===t?(r+i===0&&jR()," "===n[e+1]||isNaN(n[e+1])?jE.im+=parseFloat((i%2?"-":"")+"1"):(jE.im+=parseFloat((i%2?"-":"")+n[e+1]),e++)):((r+i===0||isNaN(t))&&jR(),"i"===n[e+1]||"I"===n[e+1]?(jE.im+=parseFloat((i%2?"-":"")+t),e++):jE.re+=parseFloat((i%2?"-":"")+t)),r=i=0))}r+i>0&&jR();break;case"number":jE.im=0,jE.re=e;break;default:jR()}return isNaN(jE.re)||isNaN(jE.im),jE};function jL(e,t){if(!(this instanceof jL))return new jL(e,t);let n=jD(e,t);this.re=n.re,this.im=n.im}jL.prototype={re:0,im:0,sign:function(){let e=jP(this.re,this.im);return new jL(this.re/e,this.im/e)},add:function(e,t){let n=jD(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?jL.NAN:jL.INFINITY:new jL(this.re+n.re,this.im+n.im)},sub:function(e,t){let n=jD(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?jL.NAN:jL.INFINITY:new jL(this.re-n.re,this.im-n.im)},mul:function(e,t){let n=jD(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,a=0===n.re&&0===n.im;return r&&a||i&&o?jL.NAN:r||i?jL.INFINITY:0===n.im&&0===this.im?new jL(this.re*n.re,0):new jL(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){let n=jD(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,a=0===n.re&&0===n.im;if(o&&a||r&&i)return jL.NAN;if(a||r)return jL.INFINITY;if(o||i)return jL.ZERO;if(0===n.im)return new jL(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){let e=n.re/n.im,t=n.re*e+n.im;return new jL((this.re*e+this.im)/t,(this.im*e-this.re)/t)}{let e=n.im/n.re,t=n.im*e+n.re;return new jL((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){let n=jD(e,t),r=0===this.re&&0===this.im;if(0===n.re&&0===n.im)return jL.ONE;if(0===n.im){if(0===this.im&&this.re>0)return new jL(Math.pow(this.re,n.re),0);if(0===this.re)switch((n.re%4+4)%4){case 0:return new jL(Math.pow(this.im,n.re),0);case 1:return new jL(0,Math.pow(this.im,n.re));case 2:return new jL(-Math.pow(this.im,n.re),0);case 3:return new jL(0,-Math.pow(this.im,n.re))}}if(r&&n.re>0)return jL.ZERO;let i=Math.atan2(this.im,this.re),o=jO(this.re,this.im),a=Math.exp(n.re*o-n.im*i),s=n.im*o+n.re*i;return new jL(a*Math.cos(s),a*Math.sin(s))},sqrt:function(){let e=this.re,t=this.im;if(0===t)return e>=0?new jL(Math.sqrt(e),0):new jL(0,Math.sqrt(-e));let n=Math.sqrt(.5*(jP(e,t)+Math.abs(e))),r=Math.abs(t)/(2*n);return e>=0?new jL(n,t<0?-r:r):new jL(r,t<0?-n:n)},exp:function(){let e=Math.exp(this.re);return 0===this.im?new jL(e,0):new jL(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e=this.re,t=this.im;return new jL(Math.expm1(e)*Math.cos(t)+jI(t),Math.exp(e)*Math.sin(t))},log:function(){let e=this.re,t=this.im;return 0===t&&e>0?new jL(Math.log(e),0):new jL(jO(e,t),Math.atan2(t,e))},abs:function(){return jP(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,t=this.im;return new jL(Math.sin(e)*jT(t),Math.cos(e)*jA(t))},cos:function(){let e=this.re,t=this.im;return new jL(Math.cos(e)*jT(t),-Math.sin(e)*jA(t))},tan:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)+jT(t);return new jL(Math.sin(e)/n,jA(t)/n)},cot:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)-jT(t);return new jL(-Math.sin(e)/n,jA(t)/n)},sec:function(){let e=this.re,t=this.im,n=.5*jT(2*t)+.5*Math.cos(2*e);return new jL(Math.cos(e)*jT(t)/n,Math.sin(e)*jA(t)/n)},csc:function(){let e=this.re,t=this.im,n=.5*jT(2*t)-.5*Math.cos(2*e);return new jL(Math.sin(e)*jT(t)/n,-Math.cos(e)*jA(t)/n)},asin:function(){let e=this.re,t=this.im,n=new jL(t*t-e*e+1,-2*e*t).sqrt(),r=new jL(n.re-t,n.im+e).log();return new jL(r.im,-r.re)},acos:function(){let e=this.re,t=this.im,n=new jL(t*t-e*e+1,-2*e*t).sqrt(),r=new jL(n.re-t,n.im+e).log();return new jL(Math.PI/2-r.im,r.re)},atan:function(){let e=this.re,t=this.im;if(0===e){if(1===t)return new jL(0,1/0);if(-1===t)return new jL(0,-1/0)}let n=e*e+(1-t)*(1-t),r=new jL((1-t*t-e*e)/n,-2*e/n).log();return new jL(-.5*r.im,.5*r.re)},acot:function(){let e=this.re,t=this.im;if(0===t)return new jL(Math.atan2(1,e),0);let n=e*e+t*t;return 0!==n?new jL(e/n,-t/n).atan():new jL(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new jL(0,1/0);let n=e*e+t*t;return 0!==n?new jL(e/n,-t/n).acos():new jL(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new jL(Math.PI/2,1/0);let n=e*e+t*t;return 0!==n?new jL(e/n,-t/n).asin():new jL(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){let e=this.re,t=this.im;return new jL(jA(e)*Math.cos(t),jT(e)*Math.sin(t))},cosh:function(){let e=this.re,t=this.im;return new jL(jT(e)*Math.cos(t),jA(e)*Math.sin(t))},tanh:function(){let e=2*this.re,t=2*this.im,n=jT(e)+Math.cos(t);return new jL(jA(e)/n,Math.sin(t)/n)},coth:function(){let e=2*this.re,t=2*this.im,n=jT(e)-Math.cos(t);return new jL(jA(e)/n,-Math.sin(t)/n)},csch:function(){let e=this.re,t=this.im,n=Math.cos(2*t)-jT(2*e);return new jL(-2*jA(e)*Math.cos(t)/n,2*jT(e)*Math.sin(t)/n)},sech:function(){let e=this.re,t=this.im,n=Math.cos(2*t)+jT(2*e);return new jL(2*jT(e)*Math.cos(t)/n,-2*jA(e)*Math.sin(t)/n)},asinh:function(){let e=this.im;this.im=-this.re,this.re=e;let t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){let e=this.acos();if(e.im<=0){let t=e.re;e.re=-e.im,e.im=t}else{let t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){let e=this.re,t=this.im,n=1-e,r=1+e,i=n*n+t*t,o=0!==i?new jL((r*n-t*t)/i,(t*n+r*t)/i):new jL(-1!==e?e/0:0,0!==t?t/0:0),a=o.re;return o.re=jO(o.re,o.im)/2,o.im=Math.atan2(o.im,a)/2,e>1&&0===t&&(o.im=-o.im),o},acoth:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new jL(0,Math.PI/2);let n=e*e+t*t;return 0!==n?new jL(e/n,-t/n).atanh():new jL(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){let e=this.re,t=this.im;if(0===t)return new jL(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);let n=e*e+t*t;return 0!==n?new jL(e/n,-t/n).asinh():new jL(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){let e=this.re,t=this.im;if(this.isZero())return jL.INFINITY;let n=e*e+t*t;return 0!==n?new jL(e/n,-t/n).acosh():new jL(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return jL.INFINITY;if(this.isInfinite())return jL.ZERO;let e=this.re,t=this.im,n=e*e+t*t;return new jL(e/n,-t/n)},conjugate:function(){return new jL(this.re,-this.im)},neg:function(){return new jL(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new jL(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new jL(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new jL(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){let n=jD(e,t);return Math.abs(n.re-this.re)<=jL.EPSILON&&Math.abs(n.im-this.im)<=jL.EPSILON},clone:function(){return new jL(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<jL.EPSILON&&(e=0),Math.abs(t)<jL.EPSILON&&(t=0),0===t)?n+e:(0!==e?(n+=e,n+=" ",t<0?(t=-t,n+="-"):n+="+",n+=" "):t<0&&(t=-t,n+="-"),1!==t&&(n+=t),n+"i")},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},jL.ZERO=new jL(0,0),jL.ONE=new jL(1,0),jL.I=new jL(0,1),jL.PI=new jL(Math.PI,0),jL.E=new jL(Math.E,0),jL.INFINITY=new jL(1/0,1/0),jL.NAN=new jL(NaN,NaN),jL.EPSILON=1e-15;var j_=Nd("Complex",[],()=>(jL.prototype.type="Complex",jL.prototype.isComplex=!0,jL.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},jL.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},jL.prototype.format=function(e){var t="",n=this.im,r=this.re,i=Nm(this.re,e),o=Nm(this.im,e),a=_P(e)?e:e?e.precision:null;if(null!==a){var s=Math.pow(10,-a);Math.abs(r/n)<s&&(r=0),Math.abs(n/r)<s&&(n=0)}return 0===n?i:0===r?1===n?"i":-1===n?"-i":o+"i":n<0?-1===n?i+" - i":i+" - "+o.substring(1)+"i":1===n?i+" + i":i+" + "+o+"i"},jL.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if("object"==typeof t)return jL(t);throw TypeError("Input has to be an object with r and phi keys.");case 2:var n=arguments[0],r=arguments[1];if(_P(n)){if(_D(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),_P(r))return new jL({r:n,phi:r});throw TypeError("Phi is not a number nor an angle unit.")}throw TypeError("Radius r is not a number.");default:throw SyntaxError("Wrong number of arguments in function fromPolar")}},jL.prototype.valueOf=jL.prototype.toString,jL.fromJSON=function(e){return new jL(e)},jL.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},jL),{isClass:!0}),jN={s:1,n:0,d:1};function jZ(e,t){if(isNaN(e=parseInt(e,10)))throw jH();return e*t}function jj(e,t){if(0===t)throw jV();var n=Object.create(j$.prototype);n.s=e<0?-1:1;var r=jz(e=e<0?-e:e,t);return n.n=e/r,n.d=t/r,n}function jB(e){for(var t={},n=e,r=2,i=4;i<=n;){for(;n%r==0;)n/=r,t[r]=(t[r]||0)+1;i+=1+2*r++}return n!==e?n>1&&(t[n]=(t[n]||0)+1):t[e]=(t[e]||0)+1,t}var jF=function(e,t){var n,r=0,i=1,o=1,a=0,s=0,l=0,u=1,c=1,d=0,h=1,p=1,f=1;if(null==e);else if(void 0!==t){if(o=(r=e)*(i=t),r%1!=0||i%1!=0)throw jW()}else switch(typeof e){case"object":if("d"in e&&"n"in e)r=e.n,i=e.d,"s"in e&&(r*=e.s);else if(0 in e)r=e[0],1 in e&&(i=e[1]);else throw jH();o=r*i;break;case"number":if(e<0&&(o=e,e=-e),e%1==0)r=e;else if(e>0){for(e>=1&&(c=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=c);h<=1e7&&f<=1e7;){if(e===(n=(d+p)/(h+f))){h+f<=1e7?(r=d+p,i=h+f):f>h?(r=p,i=f):(r=d,i=h);break}e>n?(d+=p,h+=f):(p+=d,f+=h),h>1e7?(r=p,i=f):(r=d,i=h)}r*=c}else(isNaN(e)||isNaN(t))&&(i=r=NaN);break;case"string":if(null===(h=e.match(/\d+|./g)))throw jH();if("-"===h[d]?(o=-1,d++):"+"===h[d]&&d++,h.length===d+1?s=jZ(h[d++],o):"."===h[d+1]||"."===h[d]?("."!==h[d]&&(a=jZ(h[d++],o)),(++d+1===h.length||"("===h[d+1]&&")"===h[d+3]||"'"===h[d+1]&&"'"===h[d+3])&&(s=jZ(h[d],o),u=Math.pow(10,h[d].length),d++),("("===h[d]&&")"===h[d+2]||"'"===h[d]&&"'"===h[d+2])&&(l=jZ(h[d+1],o),c=Math.pow(10,h[d+1].length)-1,d+=3)):"/"===h[d+1]||":"===h[d+1]?(s=jZ(h[d],o),u=jZ(h[d+2],1),d+=3):"/"===h[d+3]&&" "===h[d+1]&&(a=jZ(h[d],o),s=jZ(h[d+2],o),u=jZ(h[d+4],1),d+=5),h.length<=d){o=r=l+(i=u*c)*a+c*s;break}default:throw jH()}if(0===i)throw jV();jN.s=o<0?-1:1,jN.n=Math.abs(r),jN.d=Math.abs(i)};function jz(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function j$(e,t){if(jF(e,t),!(this instanceof j$))return jj(jN.s*jN.n,jN.d);e=jz(jN.d,jN.n),this.s=jN.s,this.n=jN.n/e,this.d=jN.d/e}var jV=function(){return Error("Division by Zero")},jH=function(){return Error("Invalid argument")},jW=function(){return Error("Parameters must be integer")};j$.prototype={s:1,n:0,d:1,abs:function(){return jj(this.n,this.d)},neg:function(){return jj(-this.s*this.n,this.d)},add:function(e,t){return jF(e,t),jj(this.s*this.n*jN.d+jN.s*this.d*jN.n,this.d*jN.d)},sub:function(e,t){return jF(e,t),jj(this.s*this.n*jN.d-jN.s*this.d*jN.n,this.d*jN.d)},mul:function(e,t){return jF(e,t),jj(this.s*jN.s*this.n*jN.n,this.d*jN.d)},div:function(e,t){return jF(e,t),jj(this.s*jN.s*this.n*jN.d,this.d*jN.n)},clone:function(){return jj(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new j$(NaN);if(void 0===e)return jj(this.s*this.n%this.d,1);if(jF(e,t),0===jN.n&&0===this.d)throw jV();return jj(this.s*(jN.d*this.n)%(jN.n*this.d),jN.d*this.d)},gcd:function(e,t){return jF(e,t),jj(jz(jN.n,this.n)*jz(jN.d,this.d),jN.d*this.d)},lcm:function(e,t){return(jF(e,t),0===jN.n&&0===this.n)?jj(0,1):jj(jN.n*this.n,jz(jN.n,this.n)*jz(jN.d,this.d))},ceil:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new j$(NaN):jj(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new j$(NaN):jj(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new j$(NaN):jj(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return jF(e,t),jj(this.s*Math.round(this.n*jN.d/(this.d*jN.n))*jN.n,jN.d)},inverse:function(){return jj(this.s*this.d,this.n)},pow:function(e,t){if(jF(e,t),1===jN.d)return jN.s<0?jj(Math.pow(this.s*this.d,jN.n),Math.pow(this.n,jN.n)):jj(Math.pow(this.s*this.n,jN.n),Math.pow(this.d,jN.n));if(this.s<0)return null;var n=jB(this.n),r=jB(this.d),i=1,o=1;for(var a in n)if("1"!==a){if("0"===a){i=0;break}if(n[a]*=jN.n,n[a]%jN.d!=0)return null;n[a]/=jN.d,i*=Math.pow(a,n[a])}for(var a in r)if("1"!==a){if(r[a]*=jN.n,r[a]%jN.d!=0)return null;r[a]/=jN.d,o*=Math.pow(a,r[a])}return jN.s<0?jj(o,i):jj(i,o)},equals:function(e,t){return jF(e,t),this.s*this.n*jN.d==jN.s*jN.n*this.d},compare:function(e,t){jF(e,t);var n=this.s*this.n*jN.d-jN.s*jN.n*this.d;return(0<n)-(n<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;e=e||.001;for(var t=this.abs(),n=t.toContinued(),r=1;r<n.length;r++){for(var i=jj(n[r-1],1),o=r-2;o>=0;o--)i=i.inverse().add(n[o]);if(Math.abs(i.sub(t).valueOf())<e)return i.mul(this.s)}return this},divisible:function(e,t){return jF(e,t),!(!(jN.n*this.d)||this.n*jN.d%(jN.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,n="",r=this.n,i=this.d;return this.s<0&&(n+="-"),1===i?n+=r:(e&&(t=Math.floor(r/i))>0&&(n+=t,n+=" ",r%=i),n+=r,n+="/",n+=i),n},toLatex:function(e){var t,n="",r=this.n,i=this.d;return this.s<0&&(n+="-"),1===i?n+=r:(e&&(t=Math.floor(r/i))>0&&(n+=t,r%=i),n+="\\frac{",n+=r,n+="}{",n+=i,n+="}"),n},toContinued:function(){var e,t=this.n,n=this.d,r=[];if(isNaN(t)||isNaN(n))return r;do r.push(Math.floor(t/n)),e=t%n,t=n,n=e;while(1!==t);return r},toString:function(e){var t=this.n,n=this.d;if(isNaN(t)||isNaN(n))return"NaN";e=e||15;var r=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var n=10%t,r=1;1!==n;r++)if(n=10*n%t,r>2e3)return 0;return r}(0,n),i=function(e,t,n){for(var r=1,i=function(e,t,n){for(var r=1;t>0;e=e*e%n,t>>=1)1&t&&(r=r*e%n);return r}(10,n,t),o=0;o<300;o++){if(r===i)return o;r=10*r%t,i=10*i%t}return 0}(0,n,r),o=this.s<0?"-":"";if(o+=t/n|0,t%=n,(t*=10)&&(o+="."),r){for(var a=i;a--;)o+=t/n|0,t%=n,t*=10;o+="(";for(var a=r;a--;)o+=t/n|0,t%=n,t*=10;o+=")"}else for(var a=e;t&&a--;)o+=t/n|0,t%=n,t*=10;return o}};var jq=Nd("Fraction",[],()=>(j$.prototype.type="Fraction",j$.prototype.isFraction=!0,j$.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},j$.fromJSON=function(e){return new j$(e)},j$),{isClass:!0}),jG=n(7554);function jU(e,t){return!!e&&"object"==typeof e&&(!!Nl(jY,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function jK(e){return"object"==typeof e&&e&&e.constructor===Object}var jY={length:!0,name:!0},jX={toString:!0,valueOf:!0,toLocaleString:!0};class jJ{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){return function(e,t){var n,r;if(jK(e)&&jU(e,t))return e[t];if("function"==typeof e[t]&&(n=e,r=t,!(null==n||"function"!=typeof n[r]||Nl(n,r)&&Object.getPrototypeOf&&r in Object.getPrototypeOf(n))&&(Nl(jX,r)||!(r in Object.prototype)&&!(r in Function.prototype))))throw Error('Cannot access method "'+t+'" as a property');throw Error('No access to property "'+t+'"')}(this.wrappedObject,e)}set(e,t){return!function(e,t,n){if(jK(e)&&jU(e,t))return e[t]=n;throw Error('No access to property "'+t+'"')}(this.wrappedObject,e,t),this}has(e){return e in this.wrappedObject}}function jQ(e){return!!e&&(e instanceof Map||e instanceof jJ||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}var j0=function(){return j0=jG.create,jG};function j1(e){throw Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function j2(e){throw Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function j5(e){throw Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var j3={BigNumberDependencies:jC,ComplexDependencies:{createComplexClass:j_},DenseMatrixDependencies:jM,FractionDependencies:{createFractionClass:jq},createTyped:Nd("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:i}=e,o=j0();return o.types=[{name:"number",test:_P},{name:"Complex",test:_O},{name:"BigNumber",test:_R},{name:"Fraction",test:_E},{name:"Unit",test:_D},{name:"string",test:_L},{name:"Chain",test:Nn},{name:"Array",test:__},{name:"Matrix",test:_N},{name:"DenseMatrix",test:_j},{name:"SparseMatrix",test:_B},{name:"Range",test:_F},{name:"Index",test:_z},{name:"boolean",test:_$},{name:"ResultSet",test:_V},{name:"Help",test:_H},{name:"function",test:_W},{name:"Date",test:_q},{name:"RegExp",test:_G},{name:"null",test:_K},{name:"undefined",test:_Y},{name:"AccessorNode",test:_X},{name:"ArrayNode",test:_J},{name:"AssignmentNode",test:_Q},{name:"BlockNode",test:_0},{name:"ConditionalNode",test:_1},{name:"ConstantNode",test:_2},{name:"FunctionNode",test:_3},{name:"FunctionAssignmentNode",test:_5},{name:"IndexNode",test:_4},{name:"Node",test:_6},{name:"ObjectNode",test:_8},{name:"OperatorNode",test:_9},{name:"ParenthesisNode",test:_7},{name:"RangeNode",test:Ne},{name:"SymbolNode",test:Nt},{name:"Map",test:jQ},{name:"Object",test:_U}],o.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(t||j1(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return n||j2(e),new n(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return n||j2(e),new n(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return n||j2(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||j5(e);var t=new i(e);if(t.valueOf()!==e)throw TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||j1(e);try{return new t(e)}catch(t){throw Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){i||j5(e);try{return new i(e)}catch(t){throw Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||j2(e);try{return new n(e)}catch(t){throw Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||j1(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||j5(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return r||function(){throw Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}],o})},j4="equalScalar",j6=Nd(j4,["typed","config"],e=>{var{typed:t,config:n}=e;return t(j4,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return NS(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||function(e,t,n){if(null==n)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var r=e.minus(t).abs();if(r.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return r.lte(i.times(n))}return!1}(e,t,n.epsilon)},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){var r;return r=n.epsilon,NS(e.re,t.re,r)&&NS(e.im,t.im,r)},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw Error("Cannot compare units with different base");return this(e.value,t.value)}})});Nd(j4,["typed","config"],e=>{var{typed:t,config:n}=e;return t(j4,{"number, number":function(e,t){return NS(e,t,n.epsilon)}})});var j8={typedDependencies:j3,createEqualScalar:j6},j9=Nd("SparseMatrix",["typed","equalScalar","Matrix"],e=>{var{typed:t,equalScalar:n,Matrix:r}=e;function i(e,t){if(!(this instanceof i))throw SyntaxError("Constructor must be called with the new operator");if(t&&!_L(t))throw Error("Invalid datatype: "+t);if(_N(e)){var n,r,a;n=this,r=e,a=t,"SparseMatrix"===r.type?(n._values=r._values?Ni(r._values):void 0,n._index=Ni(r._index),n._ptr=Ni(r._ptr),n._size=Ni(r._size),n._datatype=a||r._datatype):o(n,r.valueOf(),a||r._datatype)}else if(e&&__(e.index)&&__(e.ptr)&&__(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(__(e))o(this,e,t);else if(e)throw TypeError("Unsupported type of data ("+Nr(e)+")");else this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}function o(e,r,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;var o=r.length,a=0,s=n,l=0;if(_L(i)&&(s=t.find(n,[i,i])||n,l=t.convert(0,i)),o>0){var u=0;do{e._ptr.push(e._index.length);for(var c=0;c<o;c++){var d=r[c];if(__(d)){if(0===u&&a<d.length&&(a=d.length),u<d.length){var h=d[u];s(h,l)||(e._values.push(h),e._index.push(c))}}else 0===u&&a<1&&(a=1),s(d,l)||(e._values.push(d),e._index.push(c))}u++}while(u<a)}e._ptr.push(e._index.length),e._size=[o,a]}function a(e,t,n,r){if(n-t==0)return n;for(var i=t;i<n;i++)if(r[i]===e)return i;return t}function s(e,t,n,r,i,o,a){i.splice(e,0,r),o.splice(e,0,t);for(var s=n+1;s<a.length;s++)a[s]++}function l(e,r,i,o){var a,s,l,u=o||0,c=n,d=0;_L(e._datatype)&&(c=t.find(n,[e._datatype,e._datatype])||n,d=t.convert(0,e._datatype),u=t.convert(u,e._datatype));var h=!c(u,d),p=e._size[0],f=e._size[1];if(i>f){for(s=f;s<i;s++)if(e._ptr[s]=e._values.length,h)for(a=0;a<p;a++)e._values.push(u),e._index.push(a);e._ptr[i]=e._values.length}else i<f&&(e._ptr.splice(i+1,f-i),e._values.splice(e._ptr[i],e._values.length),e._index.splice(e._ptr[i],e._index.length));if(f=i,r>p){if(h){var g=0;for(s=0;s<f;s++){e._ptr[s]=e._ptr[s]+g,l=e._ptr[s+1]+g;var m=0;for(a=p;a<r;a++,m++)e._values.splice(l+m,0,u),e._index.splice(l+m,0,a),g++}e._ptr[f]=e._values.length}}else if(r<p){var v=0;for(s=0;s<f;s++){e._ptr[s]=e._ptr[s]-v;var y=e._ptr[s],b=e._ptr[s+1]-v;for(l=y;l<b;l++)(a=e._index[l])>r-1&&(e._values.splice(l,1),e._index.splice(l,1),v++)}e._ptr[s]=e._values.length}return e._size[0]=r,e._size[1]=i,e}function u(e,t,n,r,i){var o,a,s=r[0],l=r[1],u=[];for(o=0;o<s;o++)for(a=0,u[o]=[];a<l;a++)u[o][a]=0;for(a=0;a<l;a++)for(var c=n[a],d=n[a+1],h=c;h<d;h++)u[o=t[h]][a]=e?i?Ni(e[h]):e[h]:1;return u}return i.prototype=new r,i.prototype.createSparseMatrix=function(e,t){return new i(e,t)},i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return N_(this._values,Nr)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(e,t){return new i(e,t)},i.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},i.prototype.subset=function(e,t,n){if(!this._values)throw Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!_z(t))throw TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var n,r,o,a,s=t.size();if(s.length!==e._size.length)throw new NT(s.length,e._size.length);var l=t.min(),u=t.max();for(n=0,r=e._size.length;n<r;n++)NR(l[n],e._size[n]),NR(u[n],e._size[n]);var c=e._values,d=e._index,h=e._ptr,p=t.dimension(0),f=t.dimension(1),g=[],m=[];p.forEach(function(e,t){m[e]=t[0],g[e]=!0});var v=c?[]:void 0,y=[],b=[];return f.forEach(function(e){for(b.push(y.length),o=h[e],a=h[e+1];o<a;o++)!0===g[n=d[o]]&&(y.push(m[n]),v&&v.push(c[o]))}),b.push(y.length),new i({values:v,index:y,ptr:b,size:s,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,n,r){if(!t||!0!==t.isIndex)throw TypeError("Invalid index");var i,o=t.size(),a=t.isScalar();if(_N(n)?(i=n.size(),n=n.toArray()):i=NI(n),a){if(0!==i.length)throw TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(1!==o.length&&2!==o.length)throw new NT(o.length,e._size.length,"<");if(i.length<o.length){for(var s=0,l=0;1===o[s]&&1===i[s];)s++;for(;1===o[s];)l++,s++;n=NL(n,o.length,l,i)}if(!Na(o,i))throw new NT(o,i,">");if(1===o.length)t.dimension(0).forEach(function(t,i){NR(t),e.set([t,0],n[i[0]],r)});else{var u=t.dimension(0),c=t.dimension(1);u.forEach(function(t,i){NR(t),c.forEach(function(o,a){NR(o),e.set([t,o],n[i[0]][a[0]],r)})})}}return e}(this,e,t,n);default:throw SyntaxError("Wrong number of arguments")}},i.prototype.get=function(e){if(!__(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new NT(e.length,this._size.length);if(!this._values)throw Error("Cannot invoke get on a Pattern only matrix");var t=e[0],n=e[1];NR(t,this._size[0]),NR(n,this._size[1]);var r=a(t,this._ptr[n],this._ptr[n+1],this._index);return r<this._ptr[n+1]&&this._index[r]===t?this._values[r]:0},i.prototype.set=function(e,r,i){if(!__(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new NT(e.length,this._size.length);if(!this._values)throw Error("Cannot invoke set on a Pattern only matrix");var o=e[0],u=e[1],c=this._size[0],d=this._size[1],h=n,p=0;_L(this._datatype)&&(h=t.find(n,[this._datatype,this._datatype])||n,p=t.convert(0,this._datatype)),(o>c-1||u>d-1)&&(l(this,Math.max(o+1,c),Math.max(u+1,d),i),c=this._size[0],d=this._size[1]),NR(o,c),NR(u,d);var f=a(o,this._ptr[u],this._ptr[u+1],this._index);return f<this._ptr[u+1]&&this._index[f]===o?h(r,p)?function(e,t,n,r,i){n.splice(e,1),r.splice(e,1);for(var o=t+1;o<i.length;o++)i[o]--}(f,u,this._values,this._index,this._ptr):this._values[f]=r:s(f,o,u,r,this._values,this._index,this._ptr),this},i.prototype.resize=function(e,t,n){if(!_Z(e))throw TypeError("Array or Matrix expected");var r=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);if(2!==r.length)throw Error("Only two dimensions matrix are supported");return r.forEach(function(e){if(!_P(e)||!Nf(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+NM(r)+")")}),l(n?this.clone():this,r[0],r[1],t)},i.prototype.reshape=function(e,t){if(!__(e))throw TypeError("Array expected");if(2!==e.length)throw Error("Sparse matrices can only be reshaped in two dimensions");e.forEach(function(t){if(!_P(t)||!Nf(t)||t<=-2||0===t)throw TypeError("Invalid size, must contain positive integers or -1 (size: "+NM(e)+")")});var n=this._size[0]*this._size[1],r=(e=NE(e,n))[0]*e[1];if(n!==r)throw Error("Reshaping sparse matrix will result in the wrong number of elements");var i=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return i;for(var o=[],l=0;l<i._ptr.length;l++)for(var u=0;u<i._ptr[l+1]-i._ptr[l];u++)o.push(l);for(var c=i._values.slice(),d=i._index.slice(),h=0;h<i._index.length;h++){var p=d[h],f=o[h],g=p*i._size[1]+f;o[h]=g%e[1],d[h]=Math.floor(g/e[1])}i._values.length=0,i._index.length=0,i._ptr.length=e[1]+1,i._size=e.slice();for(var m=0;m<i._ptr.length;m++)i._ptr[m]=0;for(var v=0;v<c.length;v++){var y=d[v],b=o[v],x=c[v];s(a(y,i._ptr[b],i._ptr[b+1],i._index),y,b,x,i._values,i._index,i._ptr)}return i},i.prototype.clone=function(){return new i({values:this._values?Ni(this._values):void 0,index:Ni(this._index),ptr:Ni(this._ptr),size:Ni(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(e,r){if(!this._values)throw Error("Cannot invoke map on a Pattern only matrix");var o=this;return function(e,r,o,a,s,l,u){var c=[],d=[],h=[],p=n,f=0;_L(e._datatype)&&(p=t.find(n,[e._datatype,e._datatype])||n,f=t.convert(0,e._datatype));for(var g=function(e,t,n){e=l(e,t,n),p(e,f)||(c.push(e),d.push(t))},m=0;m<=s;m++){h.push(c.length);var v=e._ptr[m],y=e._ptr[m+1];if(u)for(var b=v;b<y;b++){var x=e._index[b];x>=0&&x<=o&&g(e._values[b],x-r,m-a)}else{for(var w={},S=v;S<y;S++)w[e._index[S]]=e._values[S];for(var C=r;C<=o;C++)g(C in w?w[C]:0,C-r,m-a)}}return h.push(c.length),new i({values:c,index:d,ptr:h,size:[o-r+1,s-a+1]})}(this,0,this._size[0]-1,0,this._size[1]-1,function(t,n,r){return e(t,[n,r],o)},r)},i.prototype.forEach=function(e,t){if(!this._values)throw Error("Cannot invoke forEach on a Pattern only matrix");for(var n=this._size[0],r=this._size[1],i=0;i<r;i++){var o=this._ptr[i],a=this._ptr[i+1];if(t)for(var s=o;s<a;s++){var l=this._index[s];e(this._values[s],[l,i],this)}else{for(var u={},c=o;c<a;c++)u[this._index[c]]=this._values[c];for(var d=0;d<n;d++)e(d in u?u[d]:0,[d,i],this)}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw Error("Cannot iterate a Pattern only matrix");for(var e=this._size[1],t=0;t<e;t++)for(var n=this._ptr[t],r=this._ptr[t+1],i=n;i<r;i++){var o=this._index[i];yield{value:this._values[i],index:[o,t]}}},i.prototype.toArray=function(){return u(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return u(this._values,this._index,this._ptr,this._size,!1)},i.prototype.format=function(e){for(var t=this._size[0],n=this._size[1],r=this.density(),i="Sparse Matrix ["+NM(t,e)+" x "+NM(n,e)+"] density: "+NM(r,e)+"\n",o=0;o<n;o++)for(var a=this._ptr[o],s=this._ptr[o+1],l=a;l<s;l++)i+="\n ("+NM(this._index[l],e)+", "+NM(o,e)+") ==> "+(this._values?NM(this._values[l],e):"X");return i},i.prototype.toString=function(){return NM(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(e){if(e){if(_R(e)&&(e=e.toNumber()),!_P(e)||!Nf(e))throw TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,n=e<0?-e:0,r=this._size[0],o=this._size[1],a=Math.min(r-n,o-t),s=[],l=[],u=[];u[0]=0;for(var c=t;c<o&&s.length<a;c++)for(var d=this._ptr[c],h=this._ptr[c+1],p=d;p<h;p++){var f=this._index[p];if(f===c-t+n){s.push(this._values[p]),l[s.length-1]=f-n;break}}return u.push(s.length),new i({values:s,index:l,ptr:u,size:[a,1]})},i.fromJSON=function(e){return new i(e)},i.diagonal=function(e,r,o,a,s){if(!__(e))throw TypeError("Array expected, size parameter");if(2!==e.length)throw Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(_R(e)&&(e=e.toNumber()),!_P(e)||!Nf(e)||e<1)throw Error("Size values must be positive integers");return e}),o){if(_R(o)&&(o=o.toNumber()),!_P(o)||!Nf(o))throw TypeError("The parameter k must be an integer number")}else o=0;var l,u=n,c=0;_L(s)&&(u=t.find(n,[s,s])||n,c=t.convert(0,s));var d=o>0?o:0,h=o<0?-o:0,p=e[0],f=e[1],g=Math.min(p-h,f-d);if(__(r)){if(r.length!==g)throw Error("Invalid value array length");l=function(e){return r[e]}}else if(_N(r)){var m=r.size();if(1!==m.length||m[0]!==g)throw Error("Invalid matrix length");l=function(e){return r.get([e])}}else l=function(){return r};for(var v=[],y=[],b=[],x=0;x<f;x++){b.push(v.length);var w=x-d;if(w>=0&&w<g){var S=l(w);u(S,c)||(y.push(w+h),v.push(S))}}return b.push(v.length),new i({values:v,index:y,ptr:b,size:[p,f]})},i.prototype.swapRows=function(e,t){if(!_P(e)||!Nf(e)||!_P(t)||!Nf(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return NR(e,this._size[0]),NR(t,this._size[0]),i._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(e,t,n,r,i){for(var o=r[e],a=r[e+1],s=o;s<a;s++)i(n[s],t[s])},i._swapRows=function(e,t,n,r,i,o){for(var s=0;s<n;s++){var l=o[s],u=o[s+1],c=a(e,l,u,i),d=a(t,l,u,i);if(c<u&&d<u&&i[c]===e&&i[d]===t){if(r){var h=r[c];r[c]=r[d],r[d]=h}continue}if(c<u&&i[c]===e&&(d>=u||i[d]!==t)){var p=r?r[c]:void 0;i.splice(d,0,t),r&&r.splice(d,0,p),i.splice(d<=c?c+1:c,1),r&&r.splice(d<=c?c+1:c,1);continue}if(d<u&&i[d]===t&&(c>=u||i[c]!==e)){var f=r?r[d]:void 0;i.splice(c,0,e),r&&r.splice(c,0,f),i.splice(c<=d?d+1:d,1),r&&r.splice(c<=d?d+1:d,1)}}},i},{isClass:!0}),j7="matrix",Be=Nd(j7,["typed","Matrix","DenseMatrix","SparseMatrix"],e=>{var{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(j7,{"":function(){return o([])},string:function(e){return o([],e)},"string, string":function(e,t){return o([],e,t)},Array:function(e){return o(e)},Matrix:function(e){return o(e,e.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(e,t,n){if("dense"===t||"default"===t||void 0===t)return new r(e,n);if("sparse"===t)return new i(e,n);throw TypeError("Unknown matrix type "+JSON.stringify(t)+".")}}),Bt=Nd("algorithm01",["typed"],e=>{var{typed:t}=e;return function(e,n,r,i){var o,a,s=e._data,l=e._size,u=e._datatype,c=n._values,d=n._index,h=n._ptr,p=n._size,f=n._datatype;if(l.length!==p.length)throw new NT(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!c)throw Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=l[0],m=l[1],v="string"==typeof u&&u===f?u:void 0,y=v?t.find(r,[v,v]):r,b=[];for(o=0;o<g;o++)b[o]=[];var x=[],w=[];for(a=0;a<m;a++){for(var S=a+1,C=h[a],k=h[a+1],M=C;M<k;M++)x[o=d[M]]=i?y(c[M],s[o][a]):y(s[o][a],c[M]),w[o]=S;for(o=0;o<g;o++)w[o]===S?b[o][a]=x[o]:b[o][a]=s[o][a]}return e.createDenseMatrix({data:b,size:[g,m],datatype:v})}}),Bn=Nd("algorithm04",["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i){var o,a,s,l,u,c,d=e._values,h=e._index,p=e._ptr,f=e._size,g=e._datatype,m=r._values,v=r._index,y=r._ptr,b=r._size,x=r._datatype;if(f.length!==b.length)throw new NT(f.length,b.length);if(f[0]!==b[0]||f[1]!==b[1])throw RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+b+")");var w=f[0],S=f[1],C=n,k=0,M=i;"string"==typeof g&&g===x&&(o=g,C=t.find(n,[o,o]),k=t.convert(0,o),M=t.find(i,[o,o]));var T=d&&m?[]:void 0,A=[],I=[],P=d&&m?[]:void 0,R=d&&m?[]:void 0,O=[],E=[];for(s=0;s<S;s++){I[s]=A.length;var D=s+1;for(u=p[s],c=p[s+1],l=u;l<c;l++)a=h[l],A.push(a),O[a]=D,P&&(P[a]=d[l]);for(u=y[s],c=y[s+1],l=u;l<c;l++)if(O[a=v[l]]===D){if(P){var L=M(P[a],m[l]);C(L,k)?O[a]=null:P[a]=L}}else A.push(a),E[a]=D,R&&(R[a]=m[l]);if(P&&R)for(l=I[s];l<A.length;)O[a=A[l]]===D?(T[l]=P[a],l++):E[a]===D?(T[l]=R[a],l++):A.splice(l,1)}return I[S]=A.length,e.createSparseMatrix({values:T,index:A,ptr:I,size:[w,S],datatype:o})}}),Br=Nd("algorithm10",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:n}=e;return function(e,r,i,o){var a,s=e._values,l=e._index,u=e._ptr,c=e._size,d=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=c[0],p=c[1],f=i;"string"==typeof d&&(a=d,r=t.convert(r,a),f=t.find(i,[a,a]));for(var g=[],m=[],v=[],y=0;y<p;y++){for(var b=y+1,x=u[y],w=u[y+1],S=x;S<w;S++){var C=l[S];m[C]=s[S],v[C]=b}for(var k=0;k<h;k++)0===y&&(g[k]=[]),v[k]===b?g[k][y]=o?f(r,m[k]):f(m[k],r):g[k][y]=r}return new n({data:g,size:[h,p],datatype:a})}}),Bi=Nd("algorithm13",["typed"],e=>{var{typed:t}=e;return function(e,n,r){var i,o=e._data,a=e._size,s=e._datatype,l=n._data,u=n._size,c=n._datatype,d=[];if(a.length!==u.length)throw new NT(a.length,u.length);for(var h=0;h<a.length;h++){if(a[h]!==u[h])throw RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+u+")");d[h]=a[h]}var p=r;"string"==typeof s&&s===c&&(i=s,p=t.find(r,[i,i]));var f=d.length>0?function e(t,n,r,i,o,a){var s=[];if(n===r.length-1)for(var l=0;l<i;l++)s[l]=t(o[l],a[l]);else for(var u=0;u<i;u++)s[u]=e(t,n+1,r,r[n+1],o[u],a[u]);return s}(p,0,d,d[0],o,l):[];return e.createDenseMatrix({data:f,size:d,datatype:i})}}),Bo=Nd("algorithm14",["typed"],e=>{var{typed:t}=e;return function(e,n,r,i){var o,a=e._data,s=e._size,l=e._datatype,u=r;"string"==typeof l&&(o=l,n=t.convert(n,o),u=t.find(r,[o,o]));var c=s.length>0?function e(t,n,r,i,o,a,s){var l=[];if(n===r.length-1)for(var u=0;u<i;u++)l[u]=s?t(a,o[u]):t(o[u],a);else for(var c=0;c<i;c++)l[c]=e(t,n+1,r,r[n+1],o[c],a,s);return l}(u,0,s,s[0],a,n,i):[];return e.createDenseMatrix({data:c,size:Ni(s),datatype:o})}});function Ba(e,t){var n;if(!Nf(e)||!Nf(t))throw Error("Parameters in function gcd must be integer numbers");for(;0!==t;)n=e%t,e=t,t=n;return e<0?-e:e}Ba.signature="number, number";let{gcd:Bs}=function e(t,n){var r,i,o,a=(0,W.Z)({},Nj,n);if("function"!=typeof Object.create)throw Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var s=(r={isNumber:_P,isComplex:_O,isBigNumber:_R,isFraction:_E,isUnit:_D,isString:_L,isArray:__,isMatrix:_N,isCollection:_Z,isDenseMatrix:_j,isSparseMatrix:_B,isRange:_F,isIndex:_z,isBoolean:_$,isResultSet:_V,isHelp:_H,isFunction:_W,isDate:_q,isRegExp:_G,isObject:_U,isNull:_K,isUndefined:_Y,isAccessorNode:_X,isArrayNode:_J,isAssignmentNode:_Q,isBlockNode:_0,isConditionalNode:_1,isConstantNode:_2,isFunctionAssignmentNode:_5,isFunctionNode:_3,isIndexNode:_4,isNode:_6,isObjectNode:_8,isOperatorNode:_9,isParenthesisNode:_7,isRangeNode:Ne,isSymbolNode:Nt,isChain:Nn},i=new Nc,r.on=i.on.bind(i),r.off=i.off.bind(i),r.once=i.once.bind(i),r.emit=i.emit.bind(i),r);s.config=function(e,t){function n(n){if(!n)return No(e,Ni);var r=No(e,Ni);Nz(n,"matrix",NB),Nz(n,"number",NF),function e(t,n){if(Array.isArray(n))throw TypeError("Arrays are not supported by deepExtend");for(var r in n)if(Nl(n,r)&&!(r in Object.prototype)&&!(r in Function.prototype)){if(n[r]&&n[r].constructor===Object)void 0===t[r]&&(t[r]={}),t[r]&&t[r].constructor===Object?e(t[r],n[r]):t[r]=n[r];else if(Array.isArray(n[r]))throw TypeError("Arrays are not supported by deepExtend");else t[r]=n[r]}return t}(e,n);var i=No(e,Ni);return t("config",i,r,No(n,Ni)),i}return n.MATRIX_OPTIONS=NB,n.NUMBER_OPTIONS=NF,Object.keys(Nj).forEach(t=>{Object.defineProperty(n,t,{get:()=>e[t],enumerable:!0,configurable:!0})}),n}(a,s.emit),s.expression={transform:{},mathWithTransform:{config:s.config}};var l={},u=function(e,t,n,r){function i(e,t){t&&"function"==typeof t.transform?(n.expression.transform[e]=t.transform,Nl(s,e)||(n.expression.mathWithTransform[e]=t.transform)):(delete n.expression.transform[e],Nl(s,e)||(n.expression.mathWithTransform[e]=t))}function o(e){return"function"==typeof e&&"object"==typeof e.signatures}function a(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction}var s={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(t,l){var u=arguments.length;if(1!==u&&2!==u)throw new NZ("import",u,1,2);l||(l={});var c={};for(var d in!function e(t,n,r){if(Array.isArray(n))n.forEach(n=>e(t,n));else if("object"==typeof n)for(var i in n)Nl(n,i)&&e(t,n[i],i);else if(Nh(n)||void 0!==r){var o=Nh(n)?a(n)?n.fn+".transform":n.fn:r;if(Nl(t,o)&&t[o]!==n&&!l.silent)throw Error('Cannot import "'+o+'" twice');t[o]=n}else if(!l.silent)throw TypeError("Factory, Object, or Array expected")}(c,t),c)if(Nl(c,d)){var h,p=c[d];if(Nh(p))!function(t,i){var l,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.fn;if(NN(u,"."))throw Error("Factory name should not contain a nested path. Name: "+JSON.stringify(u));var c=a(t)?n.expression.transform:n,d=u in n.expression.transform,h=Nl(c,u)?c[u]:void 0,p=function(){var r={};t.dependencies.map(Np).forEach(e=>{if(NN(e,"."))throw Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?r.math=n:"mathWithTransform"===e?r.mathWithTransform=n.expression.mathWithTransform:"classes"===e?r.classes=n:r[e]=n[e]});var a=t(r);if(a&&"function"==typeof a.transform)throw Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===h||i.override)return a;if(o(h)&&o(a))return e(h,a);if(i.silent)return h;throw Error('Cannot import "'+u+'": already exists')};t.meta&&!1===t.meta.lazy?c[u]=p():Ns(c,u,p),h&&d?function(e){delete n.expression.transform[e],Nl(s,e)?delete n.expression.mathWithTransform[e]:n.expression.mathWithTransform[e]=n[e]}(u):!a(t)&&(-1!==(l=t).fn.indexOf(".")||Nl(s,l.fn)||l.meta&&l.meta.isClass)||Ns(n.expression.mathWithTransform,u,()=>c[u]),r[u]=t,n.emit("import",u,p)}(p,l);else{if("function"==typeof(h=p)||"number"==typeof h||"string"==typeof h||"boolean"==typeof h||null===h||_D(h)||_O(h)||_R(h)||_E(h)||_N(h)||Array.isArray(h))!function(t,a,s){var l;if(s.wrap&&"function"==typeof a&&(a=function(e){var t=function(){for(var t=[],r=0,i=arguments.length;r<i;r++){var o=arguments[r];t[r]=o&&o.valueOf()}return e.apply(n,t)};return e.transform&&(t.transform=e.transform),t}(a)),"function"==typeof(l=a)&&"string"==typeof l.signature&&(a=e(t,{[a.signature]:a})),o(n[t])&&o(a)){a=s.override?e(t,a.signatures):e(n[t],a),n[t]=a,delete r[t],i(t,a),n.emit("import",t,function(){return a});return}if(void 0===n[t]||s.override){n[t]=a,delete r[t],i(t,a),n.emit("import",t,function(){return a});return}if(!s.silent)throw Error('Cannot import "'+t+'": already exists')}(d,p,l);else if(!l.silent)throw TypeError("Factory, Object, or Array expected")}}}}(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.typed.apply(s.typed,t)},0,s,l);return s.import=u,s.on("config",()=>{Nu(l).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&u(e,{override:!0})})}),s.create=e.bind(null,t),s.factory=Nd,s.import(Nu((function e(t,n){for(var r in t)if(Nl(t,r)){var i=t[r];"object"==typeof i&&null!==i?e(i,n):n[r]=i}}(t,o={}),o))),s.ArgumentsError=NZ,s.DimensionError=NT,s.IndexError=NA,s}({gcdDependencies:{BigNumberDependencies:jC,DenseMatrixDependencies:jM,equalScalarDependencies:j8,matrixDependencies:{DenseMatrixDependencies:jM,MatrixDependencies:jk,SparseMatrixDependencies:{MatrixDependencies:jk,equalScalarDependencies:j8,typedDependencies:j3,createSparseMatrixClass:j9},typedDependencies:j3,createMatrix:Be},typedDependencies:j3,createGcd:Nd("gcd",["typed","matrix","equalScalar","BigNumber","DenseMatrix"],e=>{var{typed:t,matrix:n,equalScalar:r,BigNumber:i,DenseMatrix:o}=e,a=Bt({typed:t}),s=Bn({typed:t,equalScalar:r}),l=Br({typed:t,DenseMatrix:o}),u=Bi({typed:t}),c=Bo({typed:t});return t("gcd",{"number, number":Ba,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw Error("Parameters in function gcd must be integer numbers");for(var n=new i(0);!t.isZero();){var r=e.mod(t);e=t,t=r}return e.lt(n)?e.neg():e},"Fraction, Fraction":function(e,t){return e.gcd(t)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return l(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return l(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return c(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return c(n(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return c(n(t),e,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,n){for(var r=this(e,t),i=0;i<n.length;i++)r=this(r,n[i]);return r}})})}}),Bl=(0,g.memo)(function({containerId:e,chartRef:t,data:n,seriesMapping:r,enablePinning:i=!0,wrapLabels:o,format:a,onUnpinClick:s,pinnedPos:l}){let[u,c]=(0,g.useState)(!1),d=(0,g.useRef)(),h=E5(),{height:p,width:m,ref:v}=E9(),y=null!==l&&i;if(null===h||null===h.target||null===n||null===l&&"CANVAS"!==h.target.tagName)return null;let b=t.current,x=e?document.querySelector(e):void 0,w=x?x.getBoundingClientRect().height:void 0;d.current=DL(h,l,p??0,m??0,x);let S=DR({mousePos:h,data:n,seriesMapping:r,pinnedPos:l,chart:b,format:a,showAllSeries:u});if(0===S.length)return null;let C=n.length;return(0,f.jsx)(op,{container:x,children:(0,f.jsx)(tU,{ref:v,sx:e=>D_(e,l,w),style:{transform:d.current},children:(0,f.jsxs)(rf,{spacing:.5,children:[(0,f.jsx)(Dp,{nearbySeries:S,totalSeries:C,enablePinning:i,isTooltipPinned:y,showAllSeries:u,onShowAllClick:e=>c(e),onUnpinClick:s}),(0,f.jsx)(Dn,{series:S,wrapLabels:o})]})})})});(0,ej.D)([Rc,tA,tI.N,tP.N,n2.N,R$,Oi,Ol,tR.N,ED,tO.N,tE.N]);let Bu=(0,g.forwardRef)(function({height:e,data:t,seriesMapping:n,timeScale:r,yAxis:i,format:o,grid:a,isStackedBar:s=!1,tooltipConfig:l=E3,noDataVariant:u="message",syncGroup:c,onDataZoom:d,onDoubleClick:h,__experimentalEChartsOptionsOverride:p},m){let v;let{chartsTheme:y,enablePinning:b,lastTooltipPinnedCoords:x,setLastTooltipPinnedCoords:w}=tX(),S=l.enablePinning&&b,C=(0,g.useRef)(),[k,M]=(0,g.useState)(!0),[T,A]=(0,g.useState)(null),[I,P]=(0,g.useState)(null),[R,O]=(0,g.useState)(!1),[E,D]=(0,g.useState)(0),{timeZone:L}=EV();if(void 0===r){let e=function(e){let t,n;let r=[];for(let t of e)if(t&&"timeRange"in t){if(void 0===t||void 0===t.timeRange||void 0===t.stepMs)continue;if(r.push(t.stepMs),void 0===n){n=t.timeRange;continue}t.timeRange.start<n.start&&(n.start=t.timeRange.start),t.timeRange.end>n.end&&(n.end=t.timeRange.end)}else if(t&&"values"in t){for(let e=0;e<t.values.length;e++){let r=t.values[e];if(void 0===r)continue;let[i]=r,o=new Date(i),a=new Date(i);if(void 0===n){n={start:o,end:a};continue}o<n.start&&(n.start=o),a>n.end&&(n.end=a)}if(void 0===n)return;let e=n.start.valueOf(),r=n.end.valueOf(),i=r-e;return{startMs:e,endMs:r,rangeMs:i,stepMs:10}}if(void 0===n)return;if(1===r.length)t=r[0];else{let e=Bs(...r);t=e<10?10:e}let i=n.start.valueOf(),o=n.end.valueOf();return{startMs:i,endMs:o,stepMs:t,rangeMs:o-i}}(t);if(void 0===e){let e=new Date,t=new Date(e);t.setFullYear(e.getFullYear()-5);let n=e.getTime(),r=t.getTime();v={startMs:r,endMs:n,stepMs:1,rangeMs:n-r}}else v=e}else v=r;(0,g.useImperativeHandle)(m,()=>({highlightSeries({name:e}){C.current&&C.current.dispatchAction({type:"highlight",seriesId:e})},clearHighlightedSeries:()=>{C.current&&Db(C.current)}}),[]);let _=(0,g.useMemo)(()=>({datazoom:e=>{if(void 0===d&&setTimeout(()=>{A(null)},10),void 0===d||void 0===e.batch[0])return;let t=e.batch[0].startValue,n=e.batch[0].endValue;void 0!==t&&void 0!==n&&d({start:t,end:n})},finished:()=>{void 0!==C.current&&Dv(C.current)}}),[d,A]),{noDataOption:N}=y,Z=(0,g.useMemo)(()=>{if(null===t||0===t.length&&"message"===u)return N;let e=[],r="local"===L;t.map((t,n)=>{let i=t.values.map(([e,t])=>[r?e:(0,EL.toZonedTime)(e,L),null===t?"-":t]);e.push({id:n,source:[...i],dimensions:["time","value"]})});let l={dataset:e,series:b&&null!==I?[...n,I]:n,xAxis:{type:"time",min:r?v.startMs:(0,EL.toZonedTime)(v.startMs,L),max:r?v.endMs:(0,EL.toZonedTime)(v.endMs,L),axisLabel:{hideOverlap:!0,formatter:EB(v.rangeMs??0)},axisPointer:{snap:!1}},yAxis:n7(i,o),animation:!1,tooltip:{show:!0,showContent:s,trigger:s?"item":"axis",appendToBody:s},axisPointer:{type:"line",z:0,triggerEmphasis:!1,triggerTooltip:!1,snap:!1},toolbox:{feature:{dataZoom:{icon:null,yAxisIndex:"none"}}},grid:a};return p?p(l):l},[t,n,v,i,o,a,N,p,u,L,s,b,I]);return(0,g.useEffect)(()=>{null===T||null===x||t1()(x,T)||(A(null),null!==T&&null!==I&&P(null))},[x,n]),(0,f.jsxs)(tU,{style:{height:e},onClick:e=>{let n=e.ctrlKey||e.metaKey;n&&e.preventDefault();let r=Dx(e.nativeEvent.offsetX,e.nativeEvent.offsetY,C.current);if(null!==r&&S&&e.target instanceof HTMLCanvasElement){let i={page:{x:e.pageX,y:e.pageY},client:{x:e.clientX,y:e.clientY},plotCanvas:{x:e.nativeEvent.offsetX,y:e.nativeEvent.offsetY},target:e.target};A(e=>null===e?i:(P(null),null)),P(e=>{if(null!==e)return null;{let e=r[0],n=DC(t[0]?.values,e);return n9()({},Dm,{markLine:{data:[{xAxis:n}]}})}}),n||w(i)}},onMouseDown:e=>{let{clientX:t}=e;O(!0),D(t)},onMouseMove:e=>{if(!(e.target instanceof HTMLCanvasElement))return;let{clientX:t}=e;R&&t-E>0&&M(!1)},onMouseUp:()=>{O(!1),D(0),M(!0)},onMouseLeave:()=>{null===T&&M(!1),void 0!==C.current&&Db(C.current)},onMouseEnter:()=>{M(!0),void 0!==C.current&&Dv(C.current)},onDoubleClick:e=>{A(null),void 0===h?void 0!==C.current&&Dy(C.current):h(e)},children:[!0===k&&Z.tooltip?.showContent===!1&&!0!==l.hidden&&(0,f.jsx)(Bl,{containerId:y.tooltipPortalContainerId,chartRef:C,data:t,seriesMapping:n,wrapLabels:l.wrapLabels,enablePinning:S,pinnedPos:T,format:o,onUnpinClick:()=>{A(null),P(null)}}),(0,f.jsx)(n6,{sx:{width:"100%",height:"100%"},option:Z,theme:y.echartsTheme,onEvents:_,_instance:C,syncGroup:c})]})});var Bc=n(9986);function Bd(e){return void 0!==e.pastDuration}let Bh=/^(?:(\d+)y)?(?:(\d+)w)?(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?(?:(\d+)ms)?$/;function Bp(e){let t=Bh.exec(e);if(null===t)throw Error(`Invalid duration string '${e}'`);return{years:parseInt(t[1]??"0"),months:0,weeks:parseInt(t[2]??"0"),days:parseInt(t[3]??"0"),hours:parseInt(t[4]??"0"),minutes:parseInt(t[5]??"0"),seconds:parseInt(t[6]??"0")+parseInt(t[7]??"0")/1e3}}function Bf({props:e,name:t}){return ro({props:e,name:t,defaultTheme:rj.Z,themeId:tW.Z})}let Bg=["localeText"],Bm=g.createContext(null),Bv=function(e){let{localeText:t}=e,n=H(e,Bg),{utils:r,localeText:i}=g.useContext(Bm)??{utils:void 0,localeText:void 0},{children:o,dateAdapter:a,dateFormats:s,dateLibInstance:l,adapterLocale:u,localeText:c}=Bf({props:n,name:"MuiLocalizationProvider"}),d=g.useMemo(()=>(0,W.Z)({},c,i,t),[c,i,t]),h=g.useMemo(()=>{if(!a)return r||null;let e=new a({locale:u,formats:s,instance:l});if(!e.isMUIAdapter)throw Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(`
151
- `));return e},[a,u,s,l,r]),p=g.useMemo(()=>h?{minDate:h.date("1900-01-01T00:00:00.000"),maxDate:h.date("2099-12-31T00:00:00.000")}:null,[h]),m=g.useMemo(()=>({utils:h,defaultDates:p,localeText:d}),[p,h,d]);return(0,f.jsx)(Bm.Provider,{value:m,children:o})};var By=n(3615),Bb=n.n(By);let Bx={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>"year"===e?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(e,t,n,r)=>`Select ${e}. ${r||null!==t&&n.isValid(t)?`Selected time is ${r??n.format(t,"fullTime")}`:"No time selected"}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t,n)=>n||null!==e&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||null!==e&&t.isValid(e)?`Choose time, selected time is ${n??t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>"letter"===e.contentType?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>"letter"===e.contentType?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"};(0,W.Z)({},Bx);let Bw=()=>{let e=g.useContext(Bm);if(null===e)throw Error("MUI X: Can not find the date and time pickers localization context.\nIt looks like you forgot to wrap your component in LocalizationProvider.\nThis can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package");if(null===e.utils)throw Error("MUI X: Can not find the date and time pickers adapter from its localization context.\nIt looks like you forgot to pass a `dateAdapter` to your LocalizationProvider.");let t=g.useMemo(()=>(0,W.Z)({},Bx,e.localeText),[e.localeText]);return g.useMemo(()=>(0,W.Z)({},e,{localeText:t}),[e,t])},BS=()=>Bw().utils,BC=()=>Bw().defaultDates,Bk=e=>{let t=BS(),n=g.useRef(void 0);return void 0===n.current&&(n.current=t.date(void 0,e)),n.current},BM=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n))},BT=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:a,timezone:s})=>{let l=BM(a,a.date(void 0,s),e);n&&a.isBefore(i,l)&&(i=l),t&&a.isAfter(r,l)&&(r=l);let u=e,c=e;for(a.isBefore(e,i)&&(u=i,c=null),a.isAfter(e,r)&&(c&&(c=r),u=null);u||c;){if(u&&a.isAfter(u,r)&&(u=null),c&&a.isBefore(c,i)&&(c=null),u){if(!o(u))return u;u=a.addDays(u,1)}if(c){if(!o(c))return c;c=a.addDays(c,-1)}}return null},BA=(e,t,n)=>null!=t&&e.isValid(t)?t:n,BI=(e,t)=>{let n=[e.startOfYear(t)];for(;n.length<12;){let t=n[n.length-1];n.push(e.addMonths(t,1))}return n},BP=(e,t,n)=>"date"===n?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),BR=(e,t)=>{let n=e.setHours(e.date(),"am"===t?2:14);return e.format(n,"meridiem")},BO=["year","month","day"],BE=e=>BO.includes(e),BD=(e,t)=>{let n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(t=>e.addDays(n,t))};function BL(e){return(0,A.ZP)("MuiTab",e)}let B_=(0,T.Z)("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),BN=e=>{let{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:o,label:a,selected:s,disabled:l}=e,u={root:["root",o&&a&&"labelIcon",`textColor${(0,w.Z)(n)}`,r&&"fullWidth",i&&"wrapped",s&&"selected",l&&"disabled"],icon:["iconWrapper","icon"]};return(0,y.Z)(u,BL,t)},BZ=(0,S.ZP)(ef,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${(0,w.Z)(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${B_.iconWrapper}`]:t.iconWrapper},{[`& .${B_.icon}`]:t.icon}]}})((0,C.Z)(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&("top"===e.iconPosition||"bottom"===e.iconPosition),style:{flexDirection:"column"}},{props:({ownerState:e})=>e.label&&"top"!==e.iconPosition&&"bottom"!==e.iconPosition,style:{flexDirection:"row"}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"top"===t,style:{[`& > .${B_.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"bottom"===t,style:{[`& > .${B_.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"start"===t,style:{[`& > .${B_.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"end"===t,style:{[`& > .${B_.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${B_.selected}`]:{opacity:1},[`&.${B_.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${B_.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${B_.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${B_.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${B_.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),Bj=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiTab"}),{className:r,disabled:i=!1,disableFocusRipple:o=!1,fullWidth:a,icon:s,iconPosition:l="top",indicator:u,label:c,onChange:d,onClick:h,onFocus:p,selected:m,selectionFollowsFocus:y,textColor:b="inherit",value:x,wrapped:w=!1,...S}=n,C={...n,disabled:i,disableFocusRipple:o,selected:m,icon:!!s,iconPosition:l,label:!!c,fullWidth:a,textColor:b,wrapped:w},k=BN(C),T=s&&c&&g.isValidElement(s)?g.cloneElement(s,{className:(0,v.Z)(k.icon,s.props.className)}):s;return(0,f.jsxs)(BZ,{focusRipple:!o,className:(0,v.Z)(k.root,r),ref:t,role:"tab","aria-selected":m,disabled:i,onClick:e=>{!m&&d&&d(e,x),h&&h(e)},onFocus:e=>{y&&!m&&d&&d(e,x),p&&p(e)},ownerState:C,tabIndex:m?0:-1,...S,children:["top"===l||"start"===l?(0,f.jsxs)(g.Fragment,{children:[T,c]}):(0,f.jsxs)(g.Fragment,{children:[c,T]}),u]})});function BB(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}let BF={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function Bz(e){return(0,A.ZP)("MuiTabScrollButton",e)}let B$=(0,T.Z)("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),BV=e=>{let{classes:t,orientation:n,disabled:r}=e;return(0,y.Z)({root:["root",n,r&&"disabled"]},Bz,t)},BH=(0,S.ZP)(ef,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${B$.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),BW=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiTabScrollButton"}),{className:r,slots:i={},slotProps:o={},direction:a,orientation:s,disabled:l,...u}=n,c=iL(),d={isRtl:c,...n},h=BV(d),p=i.StartScrollButtonIcon??ho,g=i.EndScrollButtonIcon??ha,m=iF({elementType:p,externalSlotProps:o.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),y=iF({elementType:g,externalSlotProps:o.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return(0,f.jsx)(BH,{component:"div",className:(0,v.Z)(h.root,r),ref:t,role:null,ownerState:d,tabIndex:null,...u,style:{...u.style,..."vertical"===s&&{"--TabScrollButton-svgRotate":`rotate(${c?-90:90}deg)`}},children:"left"===a?(0,f.jsx)(p,{...m}):(0,f.jsx)(g,{...y})})});function Bq(e){return(0,A.ZP)("MuiTabs",e)}let BG=(0,T.Z)("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),BU=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,BK=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,BY=(e,t,n)=>{let r=!1,i=n(e,t);for(;i;){if(i===e.firstChild){if(r)return;r=!0}let t=i.disabled||"true"===i.getAttribute("aria-disabled");if(!i.hasAttribute("tabindex")||t)i=n(e,i);else{i.focus();return}}},BX=e=>{let{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:a,scrollButtonsHideMobile:s,classes:l}=e;return(0,y.Z)({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},Bq,l)},BJ=(0,S.ZP)("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${BG.scrollButtons}`]:t.scrollButtons},{[`& .${BG.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})((0,C.Z)(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${BG.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),BQ=(0,S.ZP)("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),B0=(0,S.ZP)("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),B1=(0,S.ZP)("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})((0,C.Z)(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:"100%",width:2,right:0}}]}))),B2=(0,S.ZP)(function(e){let{onChange:t,...n}=e,r=g.useRef(),i=g.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return(0,rF.Z)(()=>{let e=(0,iQ.Z)(()=>{let e=r.current;o(),e!==r.current&&t(r.current)}),n=(0,iG.Z)(i.current);return n.addEventListener("resize",e),()=>{e.clear(),n.removeEventListener("resize",e)}},[t]),g.useEffect(()=>{o(),t(r.current)},[t]),(0,f.jsx)("div",{style:BF,...n,ref:i})})({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),B5={},B3=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiTabs"}),r=ot(),i=iL(),{"aria-label":o,"aria-labelledby":a,action:s,centered:l=!1,children:u,className:c,component:d="div",allowScrollButtonsMobile:h=!1,indicatorColor:p="primary",onChange:m,orientation:y="horizontal",ScrollButtonComponent:b,scrollButtons:x="auto",selectionFollowsFocus:w,slots:S={},slotProps:C={},TabIndicatorProps:k={},TabScrollButtonProps:T={},textColor:A="primary",value:I,variant:P="standard",visibleScrollbar:R=!1,...O}=n,E="scrollable"===P,D="vertical"===y,L=D?"scrollTop":"scrollLeft",_=D?"top":"left",N=D?"bottom":"right",Z=D?"clientHeight":"clientWidth",j=D?"height":"width",B={...n,component:d,allowScrollButtonsMobile:h,indicatorColor:p,orientation:y,vertical:D,scrollButtons:x,textColor:A,variant:P,visibleScrollbar:R,fixed:!E,hideScrollbar:E&&!R,scrollableX:E&&!D,scrollableY:E&&D,centered:l&&!E,scrollButtonsHideMobile:!h},z=BX(B),$=iF({elementType:S.StartScrollButtonIcon,externalSlotProps:C.startScrollButtonIcon,ownerState:B}),V=iF({elementType:S.EndScrollButtonIcon,externalSlotProps:C.endScrollButtonIcon,ownerState:B}),[H,W]=g.useState(!1),[q,G]=g.useState(B5),[U,K]=g.useState(!1),[Y,X]=g.useState(!1),[J,Q]=g.useState(!1),[ee,et]=g.useState({overflow:"hidden",scrollbarWidth:0}),en=new Map,er=g.useRef(null),ei=g.useRef(null),eo={slots:S,slotProps:{indicator:k,scrollButton:T,...C}},ea=()=>{let e,t;let n=er.current;if(n){let t=n.getBoundingClientRect();e={clientWidth:n.clientWidth,scrollLeft:n.scrollLeft,scrollTop:n.scrollTop,scrollWidth:n.scrollWidth,top:t.top,bottom:t.bottom,left:t.left,right:t.right}}if(n&&!1!==I){let e=ei.current.children;if(e.length>0){let n=e[en.get(I)];t=n?n.getBoundingClientRect():null}}return{tabsMeta:e,tabMeta:t}},es=(0,F.Z)(()=>{let e;let{tabsMeta:t,tabMeta:n}=ea(),r=0;D?(e="top",n&&t&&(r=n.top-t.top+t.scrollTop)):(e=i?"right":"left",n&&t&&(r=(i?-1:1)*(n[e]-t[e]+t.scrollLeft)));let o={[e]:r,[j]:n?n[j]:0};if("number"!=typeof q[e]||"number"!=typeof q[j])G(o);else{let t=Math.abs(q[e]-o[e]),n=Math.abs(q[j]-o[j]);(t>=1||n>=1)&&G(o)}}),el=(e,{animation:t=!0}={})=>{t?function(e,t,n,r={},i=()=>{}){let{ease:o=BB,duration:a=300}=r,s=null,l=t[e],u=!1,c=()=>{u=!0},d=r=>{if(u){i(Error("Animation cancelled"));return}null===s&&(s=r);let c=Math.min(1,(r-s)/a);if(t[e]=o(c)*(n-l)+l,c>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(d)};return l===n?i(Error("Element already at target position")):requestAnimationFrame(d),c}(L,er.current,e,{duration:r.transitions.duration.standard}):er.current[L]=e},eu=e=>{let t=er.current[L];D?t+=e:t+=e*(i?-1:1),el(t)},ec=()=>{let e=er.current[Z],t=0,n=Array.from(ei.current.children);for(let r=0;r<n.length;r+=1){let i=n[r];if(t+i[Z]>e){0===r&&(t=e);break}t+=i[Z]}return t},ed=()=>{eu(-1*ec())},eh=()=>{eu(ec())},[ep,{onChange:ef,...eg}]=of("scrollbar",{className:(0,v.Z)(z.scrollableX,z.hideScrollbar),elementType:B2,shouldForwardComponentProp:!0,externalForwardedProps:eo,ownerState:B}),em=g.useCallback(e=>{ef?.(e),et({overflow:null,scrollbarWidth:e})},[ef]),[ev,ey]=of("scrollButtons",{className:(0,v.Z)(z.scrollButtons,T.className),elementType:BW,externalForwardedProps:eo,ownerState:B,additionalProps:{orientation:y,slots:{StartScrollButtonIcon:S.startScrollButtonIcon||S.StartScrollButtonIcon,EndScrollButtonIcon:S.endScrollButtonIcon||S.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:$,endScrollButtonIcon:V}}}),eb=(0,F.Z)(e=>{let{tabsMeta:t,tabMeta:n}=ea();n&&t&&(n[_]<t[_]?el(t[L]+(n[_]-t[_]),{animation:e}):n[N]>t[N]&&el(t[L]+(n[N]-t[N]),{animation:e}))}),ex=(0,F.Z)(()=>{E&&!1!==x&&Q(!J)});g.useEffect(()=>{let e,t;let n=(0,iQ.Z)(()=>{er.current&&es()}),r=(0,iG.Z)(er.current);return r.addEventListener("resize",n),"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(n),Array.from(ei.current.children).forEach(t=>{e.observe(t)})),"undefined"!=typeof MutationObserver&&(t=new MutationObserver(t=>{t.forEach(t=>{t.removedNodes.forEach(t=>{e?.unobserve(t)}),t.addedNodes.forEach(t=>{e?.observe(t)})}),n(),ex()})).observe(ei.current,{childList:!0}),()=>{n.clear(),r.removeEventListener("resize",n),t?.disconnect(),e?.disconnect()}},[es,ex]),g.useEffect(()=>{let e=Array.from(ei.current.children),t=e.length;if("undefined"!=typeof IntersectionObserver&&t>0&&E&&!1!==x){let n=e[0],r=e[t-1],i={root:er.current,threshold:.99},o=new IntersectionObserver(e=>{K(!e[0].isIntersecting)},i);o.observe(n);let a=new IntersectionObserver(e=>{X(!e[0].isIntersecting)},i);return a.observe(r),()=>{o.disconnect(),a.disconnect()}}},[E,x,J,u?.length]),g.useEffect(()=>{W(!0)},[]),g.useEffect(()=>{es()}),g.useEffect(()=>{eb(B5!==q)},[eb,q]),g.useImperativeHandle(s,()=>({updateIndicator:es,updateScrollButtons:ex}),[es,ex]);let[ew,eS]=of("indicator",{className:(0,v.Z)(z.indicator,k.className),elementType:B1,externalForwardedProps:eo,ownerState:B,additionalProps:{style:q}}),eC=(0,f.jsx)(ew,{...eS}),ek=0,eM=g.Children.map(u,e=>{if(!g.isValidElement(e))return null;let t=void 0===e.props.value?ek:e.props.value;en.set(t,ek);let n=t===I;return ek+=1,g.cloneElement(e,{fullWidth:"fullWidth"===P,indicator:n&&!H&&eC,selected:n,selectionFollowsFocus:w,onChange:m,textColor:A,value:t,...1!==ek||!1!==I||e.props.tabIndex?{}:{tabIndex:0}})}),eT=e=>{let t=ei.current,n=(0,iE.Z)(t).activeElement;if("tab"!==n.getAttribute("role"))return;let r="horizontal"===y?"ArrowLeft":"ArrowUp",o="horizontal"===y?"ArrowRight":"ArrowDown";switch("horizontal"===y&&i&&(r="ArrowRight",o="ArrowLeft"),e.key){case r:e.preventDefault(),BY(t,n,BK);break;case o:e.preventDefault(),BY(t,n,BU);break;case"Home":e.preventDefault(),BY(t,null,BU);break;case"End":e.preventDefault(),BY(t,null,BK)}},eA=(()=>{let e={};e.scrollbarSizeListener=E?(0,f.jsx)(ep,{...eg,onChange:em}):null;let t=E&&("auto"===x&&(U||Y)||!0===x);return e.scrollButtonStart=t?(0,f.jsx)(ev,{direction:i?"right":"left",onClick:ed,disabled:!U,...ey}):null,e.scrollButtonEnd=t?(0,f.jsx)(ev,{direction:i?"left":"right",onClick:eh,disabled:!Y,...ey}):null,e})(),[eI,eP]=of("root",{ref:t,className:(0,v.Z)(z.root,c),elementType:BJ,externalForwardedProps:{...eo,...O,component:d},ownerState:B}),[eR,eO]=of("scroller",{ref:er,className:z.scroller,elementType:BQ,externalForwardedProps:eo,ownerState:B,additionalProps:{style:{overflow:ee.overflow,[D?`margin${i?"Left":"Right"}`:"marginBottom"]:R?void 0:-ee.scrollbarWidth}}}),[eE,eD]=of("list",{ref:ei,className:(0,v.Z)(z.list,z.flexContainer),elementType:B0,externalForwardedProps:eo,ownerState:B,getSlotProps:e=>({...e,onKeyDown:t=>{eT(t),e.onKeyDown?.(t)}})});return(0,f.jsxs)(eI,{...eP,children:[eA.scrollButtonStart,eA.scrollbarSizeListener,(0,f.jsxs)(eR,{...eO,children:[(0,f.jsx)(eE,{"aria-label":o,"aria-labelledby":a,"aria-orientation":"vertical"===y?"vertical":null,role:"tablist",...eD,children:eM}),H&&eC]}),eA.scrollButtonEnd]})}),B4=(0,ad.Z)((0,f.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),B6=(0,ad.Z)((0,f.jsx)("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),B8=(0,ad.Z)((0,f.jsx)("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight");(0,ad.Z)((0,f.jsx)("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),(0,ad.Z)((0,f.jsxs)(g.Fragment,{children:[(0,f.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),(0,f.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");let B9=(0,ad.Z)((0,f.jsx)("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange"),B7=(0,ad.Z)((0,f.jsxs)(g.Fragment,{children:[(0,f.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),(0,f.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),Fe=(0,ad.Z)((0,f.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear"),Ft=()=>Bw().localeText;function Fn(e){return(0,A.ZP)("MuiDateTimePickerTabs",e)}(0,T.Z)("MuiDateTimePickerTabs",["root"]);let Fr=e=>BE(e)?"date":"time",Fi=e=>"date"===e?"day":"hours",Fo=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"]},Fn,t)},Fa=(0,S.ZP)(B3,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({boxShadow:`0 -1px 0 0 inset ${(e.vars||e).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(e.vars||e).palette.divider}`,[`& .${BG.indicator}`]:{bottom:"auto",top:0}}})),Fs=function(e){let t=Bf({props:e,name:"MuiDateTimePickerTabs"}),{dateIcon:n=(0,f.jsx)(B9,{}),onViewChange:r,timeIcon:i=(0,f.jsx)(B7,{}),view:o,hidden:a="undefined"==typeof window||window.innerHeight<667,className:s,sx:l}=t,u=Ft(),c=Fo(t);return a?null:(0,f.jsxs)(Fa,{ownerState:t,variant:"fullWidth",value:Fr(o),onChange:(e,t)=>{r(Fi(t))},className:(0,v.Z)(s,c.root),sx:l,children:[(0,f.jsx)(Bj,{value:"date","aria-label":u.dateTableLabel,icon:(0,f.jsx)(g.Fragment,{children:n})}),(0,f.jsx)(Bj,{value:"time","aria-label":u.timeTableLabel,icon:(0,f.jsx)(g.Fragment,{children:i})})]})};function Fl(e){return(0,A.ZP)("MuiPickersToolbarText",e)}let Fu=(0,T.Z)("MuiPickersToolbarText",["root","selected"]),Fc=["className","selected","value"],Fd=e=>{let{classes:t,selected:n}=e;return(0,y.Z)({root:["root",n&&"selected"]},Fl,t)},Fh=(0,S.ZP)(c1,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${Fu.selected}`]:t.selected}]})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,[`&.${Fu.selected}`]:{color:(e.vars||e).palette.text.primary}})),Fp=g.forwardRef(function(e,t){let n=Bf({props:e,name:"MuiPickersToolbarText"}),{className:r,value:i}=n,o=H(n,Fc),a=Fd(n);return(0,f.jsx)(Fh,(0,W.Z)({ref:t,className:(0,v.Z)(a.root,r),component:"span"},o,{children:i}))});function Ff(e){return(0,A.ZP)("MuiPickersToolbar",e)}let Fg=(0,T.Z)("MuiPickersToolbar",["root","content"]),Fm=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Fv=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"],content:["content"]},Ff,t)},Fy=(0,S.ZP)("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),Fb=(0,S.ZP)("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),Fx=g.forwardRef(function(e,t){let n=Bf({props:e,name:"MuiPickersToolbar"}),{children:r,className:i,toolbarTitle:o,hidden:a,titleId:s}=n,l=H(n,Fm),u=Fv(n);return a?null:(0,f.jsxs)(Fy,(0,W.Z)({ref:t,className:(0,v.Z)(u.root,i),ownerState:n},l,{children:[(0,f.jsx)(c1,{color:"text.secondary",variant:"overline",id:s,children:o}),(0,f.jsx)(Fb,{className:u.content,ownerState:n,children:r})]}))}),Fw=["align","className","selected","typographyClassName","value","variant","width"],FS=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"]},Ff,t)},FC=(0,S.ZP)(e_,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,minWidth:16,textTransform:"none"}),Fk=g.forwardRef(function(e,t){let n=Bf({props:e,name:"MuiPickersToolbarButton"}),{align:r,className:i,selected:o,typographyClassName:a,value:s,variant:l,width:u}=n,c=H(n,Fw),d=FS(n);return(0,f.jsx)(FC,(0,W.Z)({variant:"text",ref:t,className:(0,v.Z)(d.root,i)},u?{sx:{width:u}}:{},c,{children:(0,f.jsx)(Fp,{align:r,className:a,variant:l,value:s,selected:o})}))});function FM(e){return(0,A.ZP)("MuiDateTimePickerToolbar",e)}let FT=(0,T.Z)("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),FA=["hours","minutes","seconds"],FI=e=>FA.includes(e),FP=(e,t)=>e?t.getHours(e)>=12?"pm":"am":null,FR=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?"am"===t?e-12:e+12:e,FO=(e,t,n,r)=>{let i=FR(r.getHours(e),t,n);return r.setHours(e,i)},FE=(e,t)=>3600*t.getHours(e)+60*t.getMinutes(e)+t.getSeconds(e),FD=(e,t)=>(n,r)=>e?t.isAfter(n,r):FE(n,t)>FE(r,t);function FL(e,t,n,r){let i=BS();return{meridiemMode:FP(e,i),handleMeridiemChange:g.useCallback(o=>{n(null==e?null:FO(e,o,!!t,i),r??"partial")},[t,e,n,r,i])}}let F_=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],FN=e=>{let{classes:t,isLandscape:n,isRtl:r}=e;return(0,y.Z)({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",r&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",r&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},FM,t)},FZ=(0,S.ZP)(Fx,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,[`& .${Fg.content} .${Fu.selected}`]:{color:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),Fj=(0,S.ZP)("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(e,t)=>t.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),FB=(0,S.ZP)("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(e,t)=>t.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:e,toolbarVariant:t})=>e&&"desktop"!==t,style:{flexDirection:"column"}},{props:({isLandscape:e,toolbarVariant:t,isRtl:n})=>e&&"desktop"!==t&&n,style:{flexDirection:"column-reverse"}}]}),FF=(0,S.ZP)("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(e,t)=>t.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),Fz=(0,S.ZP)(Fp,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),F$=(0,S.ZP)("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${FT.ampmLabel}`]:t.ampmLabel},{[`&.${FT.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${FT.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function FV(e){let t=Bf({props:e,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:i,onChange:o,view:a,isLandscape:s,onViewChange:l,toolbarFormat:u,toolbarPlaceholder:c="––",views:d,disabled:h,readOnly:p,toolbarVariant:m="mobile",toolbarTitle:y,className:b}=t,x=H(t,F_),w=iL(),S=(0,W.Z)({},t,{isRtl:w}),C=BS(),{meridiemMode:k,handleMeridiemChange:M}=FL(i,n,o),T=!!(n&&!r),A="desktop"===m,I=Ft(),P=FN(S),R=y??I.dateTimePickerToolbarTitle,O=g.useMemo(()=>i?u?C.formatByString(i,u):C.format(i,"shortDate"):c,[i,u,c,C]);return(0,f.jsxs)(FZ,(0,W.Z)({isLandscape:s,className:(0,v.Z)(P.root,b),toolbarTitle:R},x,{ownerState:S,children:[(0,f.jsxs)(Fj,{className:P.dateContainer,ownerState:S,children:[d.includes("year")&&(0,f.jsx)(Fk,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:"year"===a,value:i?C.format(i,"year"):"–"}),d.includes("day")&&(0,f.jsx)(Fk,{tabIndex:-1,variant:A?"h5":"h4",onClick:()=>l("day"),selected:"day"===a,value:O})]}),(0,f.jsxs)(FB,{className:P.timeContainer,ownerState:S,children:[(0,f.jsxs)(FF,{className:P.timeDigitsContainer,ownerState:S,children:[d.includes("hours")&&(0,f.jsxs)(g.Fragment,{children:[(0,f.jsx)(Fk,{variant:A?"h5":"h3",width:A&&!s?48:void 0,onClick:()=>l("hours"),selected:"hours"===a,value:i?n?C.format(i,"hours12h"):C.format(i,"hours24h"):"--"}),(0,f.jsx)(Fz,{variant:A?"h5":"h3",value:":",className:P.separator,ownerState:S}),(0,f.jsx)(Fk,{variant:A?"h5":"h3",width:A&&!s?48:void 0,onClick:()=>l("minutes"),selected:"minutes"===a||!d.includes("minutes")&&"hours"===a,value:i?C.format(i,"minutes"):"--",disabled:!d.includes("minutes")})]}),d.includes("seconds")&&(0,f.jsxs)(g.Fragment,{children:[(0,f.jsx)(Fz,{variant:A?"h5":"h3",value:":",className:P.separator,ownerState:S}),(0,f.jsx)(Fk,{variant:A?"h5":"h3",width:A&&!s?48:void 0,onClick:()=>l("seconds"),selected:"seconds"===a,value:i?C.format(i,"seconds"):"--"})]})]}),T&&!A&&(0,f.jsxs)(F$,{className:P.ampmSelection,ownerState:S,children:[(0,f.jsx)(Fk,{variant:"subtitle2",selected:"am"===k,typographyClassName:P.ampmLabel,value:BR(C,"am"),onClick:p?void 0:()=>M("am"),disabled:h}),(0,f.jsx)(Fk,{variant:"subtitle2",selected:"pm"===k,typographyClassName:P.ampmLabel,value:BR(C,"pm"),onClick:p?void 0:()=>M("pm"),disabled:h})]}),n&&A&&(0,f.jsx)(Fk,{variant:"h5",onClick:()=>l("meridiem"),selected:"meridiem"===a,value:i&&k?BR(C,k):"--",width:48})]})]}))}let FH=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{let i;let o=n??r;if(null!=e)i=e;else if(o.includes(t))i=t;else if(o.length>0)i=o[0];else throw Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:i}};function FW(e){return(0,A.ZP)("MuiPickersArrowSwitcher",e)}(0,T.Z)("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);let Fq=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],FG=["ownerState"],FU=["ownerState"],FK=(0,S.ZP)("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),FY=(0,S.ZP)("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),FX=(0,S.ZP)(rx,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),FJ=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},FW,t)},FQ=g.forwardRef(function(e,t){let n=iL(),r=Bf({props:e,name:"MuiPickersArrowSwitcher"}),{children:i,className:o,slots:a,slotProps:s,isNextDisabled:l,isNextHidden:u,onGoToNext:c,nextLabel:d,isPreviousDisabled:h,isPreviousHidden:p,onGoToPrevious:g,previousLabel:m,labelId:y}=r,b=H(r,Fq),x=FJ(r),w=a?.previousIconButton??FX,S=iF({elementType:w,externalSlotProps:s?.previousIconButton,additionalProps:{size:"medium",title:m,"aria-label":m,disabled:h,edge:"end",onClick:g},ownerState:(0,W.Z)({},r,{hidden:p}),className:(0,v.Z)(x.button,x.previousIconButton)}),C=a?.nextIconButton??FX,k=iF({elementType:C,externalSlotProps:s?.nextIconButton,additionalProps:{size:"medium",title:d,"aria-label":d,disabled:l,edge:"start",onClick:c},ownerState:(0,W.Z)({},r,{hidden:u}),className:(0,v.Z)(x.button,x.nextIconButton)}),M=a?.leftArrowIcon??B6,T=H(iF({elementType:M,externalSlotProps:s?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:r,className:x.leftArrowIcon}),FG),A=a?.rightArrowIcon??B8,I=H(iF({elementType:A,externalSlotProps:s?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:r,className:x.rightArrowIcon}),FU);return(0,f.jsxs)(FK,(0,W.Z)({ref:t,className:(0,v.Z)(x.root,o),ownerState:r},b,{children:[(0,f.jsx)(w,(0,W.Z)({},S,{children:n?(0,f.jsx)(A,(0,W.Z)({},I)):(0,f.jsx)(M,(0,W.Z)({},T))})),i?(0,f.jsx)(c1,{variant:"subtitle1",component:"span",id:y,children:i}):(0,f.jsx)(FY,{className:x.spacer,ownerState:r}),(0,f.jsx)(C,(0,W.Z)({},k,{children:n?(0,f.jsx)(M,(0,W.Z)({},T)):(0,f.jsx)(A,(0,W.Z)({},I))}))]}))});function F0({onChange:e,onViewChange:t,openTo:n,view:r,views:i,autoFocus:o,focusedView:a,onFocusedViewChange:s}){let l=g.useRef(n),u=g.useRef(i),c=g.useRef(i.includes(n)?n:i[0]),[d,h]=(0,gx.Z)({name:"useViews",state:"view",controlled:r,default:c.current}),p=g.useRef(o?d:null),[f,m]=(0,gx.Z)({name:"useViews",state:"focusedView",controlled:a,default:p.current});g.useEffect(()=>{(l.current&&l.current!==n||u.current&&u.current.some(e=>!i.includes(e)))&&(h(i.includes(n)?n:i[0]),u.current=i,l.current=n)},[n,h,d,i]);let v=i.indexOf(d),y=i[v-1]??null,b=i[v+1]??null,x=(0,rM.Z)((e,t)=>{t?m(e):m(t=>e===t?null:t),s?.(e,t)}),w=(0,rM.Z)(e=>{x(e,!0),e!==d&&(h(e),t&&t(e))}),S=(0,rM.Z)(()=>{b&&w(b)}),C=(0,rM.Z)((t,n,r)=>{let o="finish"===n,a=r?i.indexOf(r)<i.length-1:!!b;if(e(t,o&&a?"partial":n,r),r&&r!==d){let e=i[i.indexOf(r)+1];e&&w(e)}else o&&S()});return{view:d,setView:w,focusedView:f,setFocusedView:x,nextView:b,previousView:y,defaultView:i.includes(n)?n:i[0],goToNextView:S,setValueAndGoToNextView:C}}let F1=(0,S.ZP)("div")({overflow:"hidden",width:320,maxHeight:336,display:"flex",flexDirection:"column",margin:"0 auto"});function F2(e){return(0,A.ZP)("MuiTimeClock",e)}(0,T.Z)("MuiTimeClock",["root","arrowSwitcher"]);let F5=110,F3=110,F4=F5,F6=0,F8=F4-F5,F9=F6-F3,F7=e=>180/Math.PI*e,ze=(e,t,n)=>{let r=t-F5,i=n-F3,o=F7(Math.atan2(F8,F9)-Math.atan2(r,i));return{value:Math.floor((o=Math.round(o/e)*e%360)/e)||0,distance:Math.sqrt(r**2+i**2)}},zt=(e,t,n=1)=>{let{value:r}=ze(6*n,e,t);return r*n%60},zn=(e,t,n)=>{let{value:r,distance:i}=ze(30,e,t),o=r||12;return n?o%=12:i<74&&(o+=12,o%=24),o};function zr(e){return(0,A.ZP)("MuiClockPointer",e)}(0,T.Z)("MuiClockPointer",["root","thumb"]);let zi=["className","hasSelected","isInner","type","viewValue"],zo=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"],thumb:["thumb"]},zr,t)},za=(0,S.ZP)("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:2,backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:e.transitions.create(["transform","height"])}}]})),zs=(0,S.ZP)("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(({theme:e})=>({width:4,height:4,backgroundColor:(e.vars||e).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:"calc(50% - 18px)",border:`16px solid ${(e.vars||e).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(e.vars||e).palette.primary.main}}]}));function zl(e){let t;let n=Bf({props:e,name:"MuiClockPointer"}),{className:r,isInner:i,type:o,viewValue:a}=n,s=H(n,zi),l=g.useRef(o);g.useEffect(()=>{l.current=o},[o]);let u=(0,W.Z)({},n,{shouldAnimate:l.current!==o}),c=zo(u);return(0,f.jsx)(za,(0,W.Z)({style:(t=360/("hours"===o?12:60)*a,"hours"===o&&a>12&&(t-=360),{height:Math.round((i?.26:.4)*220),transform:`rotateZ(${t}deg)`}),className:(0,v.Z)(c.root,r),ownerState:u},s,{children:(0,f.jsx)(zs,{ownerState:u,className:c.thumb})}))}function zu(e){return(0,A.ZP)("MuiClock",e)}(0,T.Z)("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);let zc=e=>{let{classes:t,meridiemMode:n}=e;return(0,y.Z)({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton","am"===n&&"selected"],pmButton:["pmButton","pm"===n&&"selected"],meridiemText:["meridiemText"]},zu,t)},zd=(0,S.ZP)("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)})),zh=(0,S.ZP)("div",{name:"MuiClock",slot:"Clock",overridesResolver:(e,t)=>t.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),zp=(0,S.ZP)("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),zf=(0,S.ZP)("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(e,t)=>t.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),zg=(0,S.ZP)("div",{name:"MuiClock",slot:"Pin",overridesResolver:(e,t)=>t.pin})(({theme:e})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),zm=(e,t)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:36,variants:[{props:{meridiemMode:t},style:{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:hover":{backgroundColor:(e.vars||e).palette.primary.light}}}]}),zv=(0,S.ZP)(rx,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})(({theme:e})=>(0,W.Z)({},zm(e,"am"),{position:"absolute",left:8})),zy=(0,S.ZP)(rx,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})(({theme:e})=>(0,W.Z)({},zm(e,"pm"),{position:"absolute",right:8})),zb=(0,S.ZP)(c1,{name:"MuiClock",slot:"meridiemText",overridesResolver:(e,t)=>t.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function zx(e){let t=Bf({props:e,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:i,children:o,value:a,handleMeridiemChange:s,isTimeDisabled:l,meridiemMode:u,minutesStep:c=1,onChange:d,selectedId:h,type:p,viewValue:m,viewRange:[y,b],disabled:x=!1,readOnly:w,className:S}=t,C=BS(),k=Ft(),M=g.useRef(!1),T=zc(t),A=l(m,p),I=!n&&"hours"===p&&(m<1||m>12),P=(e,t)=>{!(x||w||l(e,p))&&d(e,t)},R=(e,t)=>{let{offsetX:r,offsetY:i}=e;if(void 0===r){let t=e.target.getBoundingClientRect();r=e.changedTouches[0].clientX-t.left,i=e.changedTouches[0].clientY-t.top}P("seconds"===p||"minutes"===p?zt(r,i,c):zn(r,i,!!n),t)},O=e=>{M.current=!0,R(e,"shallow")},E=g.useMemo(()=>"hours"===p||m%5==0,[p,m]),D="minutes"===p?c:1,L=g.useRef(null);(0,rT.Z)(()=>{i&&L.current.focus()},[i]);let _=e=>Math.max(y,Math.min(b,e)),N=e=>(e+(b+1))%(b+1);return(0,f.jsxs)(zd,{className:(0,v.Z)(T.root,S),children:[(0,f.jsxs)(zh,{className:T.clock,children:[(0,f.jsx)(zf,{onTouchMove:O,onTouchStart:O,onTouchEnd:e=>{M.current&&(R(e,"finish"),M.current=!1),e.preventDefault()},onMouseUp:e=>{M.current&&(M.current=!1),R(e.nativeEvent,"finish")},onMouseMove:e=>{e.buttons>0&&R(e.nativeEvent,"shallow")},ownerState:{disabled:x},className:T.squareMask}),!A&&(0,f.jsxs)(g.Fragment,{children:[(0,f.jsx)(zg,{className:T.pin}),null!=a&&(0,f.jsx)(zl,{type:p,viewValue:m,isInner:I,hasSelected:E})]}),(0,f.jsx)(zp,{"aria-activedescendant":h,"aria-label":k.clockLabelText(p,a,C,null==a?null:C.format(a,"fullTime")),ref:L,role:"listbox",onKeyDown:e=>{if(!M.current)switch(e.key){case"Home":P(y,"partial"),e.preventDefault();break;case"End":P(b,"partial"),e.preventDefault();break;case"ArrowUp":P(N(m+D),"partial"),e.preventDefault();break;case"ArrowDown":P(N(m-D),"partial"),e.preventDefault();break;case"PageUp":P(_(m+5),"partial"),e.preventDefault();break;case"PageDown":P(_(m-5),"partial"),e.preventDefault();break;case"Enter":case" ":P(m,"finish"),e.preventDefault()}},tabIndex:0,className:T.wrapper,children:o})]}),n&&r&&(0,f.jsxs)(g.Fragment,{children:[(0,f.jsx)(zv,{onClick:w?void 0:()=>s("am"),disabled:x||null===u,ownerState:t,className:T.amButton,title:BR(C,"am"),children:(0,f.jsx)(zb,{variant:"caption",className:T.meridiemText,children:BR(C,"am")})}),(0,f.jsx)(zy,{disabled:x||null===u,onClick:w?void 0:()=>s("pm"),ownerState:t,className:T.pmButton,title:BR(C,"pm"),children:(0,f.jsx)(zb,{variant:"caption",className:T.meridiemText,children:BR(C,"pm")})})]})]})}function zw(e){return(0,A.ZP)("MuiClockNumber",e)}let zS=(0,T.Z)("MuiClockNumber",["root","selected","disabled"]),zC=["className","disabled","index","inner","label","selected"],zk=e=>{let{classes:t,selected:n,disabled:r}=e;return(0,y.Z)({root:["root",n&&"selected",r&&"disabled"]},zw,t)},zM=(0,S.ZP)("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${zS.disabled}`]:t.disabled},{[`&.${zS.selected}`]:t.selected}]})(({theme:e})=>({height:36,width:36,position:"absolute",left:"calc((100% - 36px) / 2)",display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(e.vars||e).palette.text.primary,fontFamily:e.typography.fontFamily,"&:focused":{backgroundColor:(e.vars||e).palette.background.paper},[`&.${zS.selected}`]:{color:(e.vars||e).palette.primary.contrastText},[`&.${zS.disabled}`]:{pointerEvents:"none",color:(e.vars||e).palette.text.disabled},variants:[{props:{inner:!0},style:(0,W.Z)({},e.typography.body2,{color:(e.vars||e).palette.text.secondary})}]}));function zT(e){let t=Bf({props:e,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:a,selected:s}=t,l=H(t,zC),u=zk(t),c=i%12/12*Math.PI*2-Math.PI/2,d=91*(o?.65:1),h=Math.round(Math.cos(c)*d),p=Math.round(Math.sin(c)*d);return(0,f.jsx)(zM,(0,W.Z)({className:(0,v.Z)(u.root,n),"aria-disabled":!!r||void 0,"aria-selected":!!s||void 0,role:"option",style:{transform:`translate(${h}px, ${p+92}px`},ownerState:t},l,{children:a}))}let zA=({ampm:e,value:t,getClockNumberText:n,isDisabled:r,selectedId:i,utils:o})=>{let a=t?o.getHours(t):null,s=[],l=+!!e,u=e?12:23,c=t=>null!==a&&(e?12===t?12===a||0===a:a===t||a-12===t:a===t);for(let t=l;t<=u;t+=1){let a=t.toString();0===t&&(a="00");let l=!e&&(0===t||t>12);a=o.formatNumber(a);let u=c(t);s.push((0,f.jsx)(zT,{id:u?i:void 0,index:t,inner:l,selected:u,disabled:r(t),label:a,"aria-label":n(a)},t))}return s},zI=({utils:e,value:t,isDisabled:n,getClockNumberText:r,selectedId:i})=>{let o=e.formatNumber;return[[5,o("05")],[10,o("10")],[15,o("15")],[20,o("20")],[25,o("25")],[30,o("30")],[35,o("35")],[40,o("40")],[45,o("45")],[50,o("50")],[55,o("55")],[0,o("00")]].map(([e,o],a)=>{let s=e===t;return(0,f.jsx)(zT,{label:o,id:s?i:void 0,index:a+1,inner:!1,disabled:n(e),selected:s,"aria-label":r(o)},e)})},zP=({timezone:e,value:t,defaultValue:n,referenceDate:r,onChange:i,valueManager:o})=>{let a;let s=BS(),l=g.useRef(n),u=t??l.current??o.emptyValue,c=g.useMemo(()=>o.getTimezone(s,u),[s,o,u]),d=(0,rM.Z)(e=>null==c?e:o.setTimezone(s,c,e));return a=e||c||(r?s.getTimezone(r):"default"),{value:g.useMemo(()=>o.setTimezone(s,a,u),[o,s,a,u]),handleValueChange:(0,rM.Z)((e,...t)=>{let n=d(e);i?.(n,...t)}),timezone:a}},zR=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:i,onChange:o,valueManager:a})=>{let[s,l]=(0,gx.Z)({name:e,state:"value",controlled:n,default:r??a.emptyValue});return zP({timezone:t,value:s,defaultValue:void 0,referenceDate:i,onChange:(0,rM.Z)((e,...t)=>{l(e),o?.(e,...t)}),valueManager:a})},zO={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},zE=e=>Math.max(...e.map(e=>zO[e.type]??1)),zD=(e,t,n)=>{if(t===zO.year)return e.startOfYear(n);if(t===zO.month)return e.startOfMonth(n);if(t===zO.day)return e.startOfDay(n);let r=n;return t<zO.minutes&&(r=e.setMinutes(r,0)),t<zO.seconds&&(r=e.setSeconds(r,0)),t<zO.milliseconds&&(r=e.setMilliseconds(r,0)),r},zL=({props:e,utils:t,granularity:n,timezone:r,getTodayDate:i})=>{let o=i?i():zD(t,n,BP(t,r));null!=e.minDate&&t.isAfterDay(e.minDate,o)&&(o=zD(t,n,e.minDate)),null!=e.maxDate&&t.isBeforeDay(e.maxDate,o)&&(o=zD(t,n,e.maxDate));let a=FD(e.disableIgnoringDatePartForTimeValidation??!1,t);return null!=e.minTime&&a(e.minTime,o)&&(o=zD(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:BM(t,o,e.minTime))),null!=e.maxTime&&a(o,e.maxTime)&&(o=zD(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:BM(t,o,e.maxTime))),o},z_=(e,t)=>{let n=e.formatTokenMap[t];if(null==n)throw Error(`MUI X: The token "${t}" is not supported by the Date and Time Pickers.
152
- Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported.`);return"string"==typeof n?{type:n,contentType:"meridiem"===n?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},zN=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return -1;case"PageUp":return 5;case"PageDown":return -5;default:return 0}},zZ=(e,t)=>{let n=[],r=e.date(void 0,"default"),i=e.startOfWeek(r),o=e.endOfWeek(r),a=i;for(;e.isBefore(a,o);)n.push(a),a=e.addDays(a,1);return n.map(n=>e.formatByString(n,t))},zj=(e,t,n,r)=>{switch(n){case"month":return BI(e,e.date(void 0,t)).map(t=>e.formatByString(t,r));case"weekDay":return zZ(e,r);case"meridiem":{let n=e.date(void 0,t);return[e.startOfDay(n),e.endOfDay(n)].map(t=>e.formatByString(t,r))}default:return[]}},zB=["0","1","2","3","4","5","6","7","8","9"],zF=e=>{let t=e.date(void 0);return"0"===e.formatByString(e.setSeconds(t,0),"s")?zB:Array.from({length:10}).map((n,r)=>e.formatByString(e.setSeconds(t,r),"s"))},zz=(e,t)=>{if("0"===t[0])return e;let n=[],r="";for(let i=0;i<e.length;i+=1){r+=e[i];let o=t.indexOf(r);o>-1&&(n.push(o.toString()),r="")}return n.join("")},z$=(e,t)=>"0"===t[0]?e:e.split("").map(e=>t[Number(e)]).join(""),zV=(e,t)=>{let n=zz(e,t);return" "!==n&&!Number.isNaN(Number(n))},zH=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},zW=(e,t,n,r,i)=>{if("day"===i.type&&"digit-with-letter"===i.contentType){let r=e.setDate(n.longestMonth,t);return e.formatByString(r,i.format)}let o=t.toString();return i.hasLeadingZerosInInput&&(o=zH(o,i.maxLength)),z$(o,r)},zq=(e,t,n,r,i,o,a,s)=>{let l=zN(r),u="Home"===r,c="End"===r,d=""===n.value||u||c;return"digit"===n.contentType||"digit-with-letter"===n.contentType?(()=>{let r=i[n.type]({currentDate:a,format:n.format,contentType:n.contentType}),h=t=>zW(e,t,r,o,n),p="minutes"===n.type&&s?.minutesStep?s.minutesStep:1,f=parseInt(zz(n.value,o),10)+l*p;if(d){if("year"===n.type&&!c&&!u)return e.formatByString(e.date(void 0,t),n.format);f=l>0||u?r.minimum:r.maximum}return h((f%p!=0&&((l<0||u)&&(f+=p-(p+f)%p),(l>0||c)&&(f-=f%p)),f>r.maximum)?r.minimum+(f-r.maximum-1)%(r.maximum-r.minimum+1):f<r.minimum?r.maximum-(r.minimum-f-1)%(r.maximum-r.minimum+1):f)})():(()=>{let r=zj(e,t,n.type,n.format);if(0===r.length)return n.value;if(d)return l>0||u?r[0]:r[r.length-1];let i=((r.indexOf(n.value)+l)%r.length+r.length)%r.length;return r[i]})()},zG=(e,t,n)=>{let r=e.value||e.placeholder,i="non-input"===t?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return"non-input"===t&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(zz(r,n)).toString()),["input-rtl","input-ltr"].includes(t)&&"digit"===e.contentType&&!i&&1===r.length&&(r=`${r}\u200e`),"input-rtl"===t&&(r=`\u2068${r}\u2069`),r},zU=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),zK=(e,t)=>4===e.formatByString(e.date(void 0,"system"),t).length,zY=(e,t,n,r)=>{if("digit"!==t)return!1;let i=e.date(void 0,"default");switch(n){case"year":if(zK(e,r))return"0001"===e.formatByString(e.setYear(i,1),r);return"01"===e.formatByString(e.setYear(i,2001),r);case"month":return e.formatByString(e.startOfYear(i),r).length>1;case"day":return e.formatByString(e.startOfMonth(i),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(i),r).length>1;case"hours":return e.formatByString(e.setHours(i,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(i,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(i,1),r).length>1;default:throw Error("Invalid section type")}},zX=(e,t,n)=>{let r=t.some(e=>"day"===e.type),i=[],o=[];for(let e=0;e<t.length;e+=1){let a=t[e];r&&"weekDay"===a.type||(i.push(a.format),o.push(zG(a,"non-input",n)))}let a=i.join(" "),s=o.join(" ");return e.parse(s,a)},zJ=(e,t,n)=>{let r=e.date(void 0,n),i=e.endOfYear(r),o=e.endOfDay(r),{maxDaysInMonth:a,longestMonth:s}=BI(e,r).reduce((t,n)=>{let r=e.getDaysInMonth(n);return r>t.maxDaysInMonth?{maxDaysInMonth:r,longestMonth:n}:t},{maxDaysInMonth:0,longestMonth:null});return{year:({format:t})=>({minimum:0,maximum:zK(e,t)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(i)+1}),day:({currentDate:t})=>({minimum:1,maximum:null!=t&&e.isValid(t)?e.getDaysInMonth(t):a,longestMonth:s}),weekDay:({format:t,contentType:n})=>{if("digit"===n){let n=zZ(e,t).map(Number);return{minimum:Math.min(...n),maximum:Math.max(...n)}}return{minimum:1,maximum:7}},hours:({format:n})=>{let i=e.getHours(o);return zz(e.formatByString(e.endOfDay(r),n),t)!==i.toString()?{minimum:1,maximum:Number(zz(e.formatByString(e.startOfDay(r),n),t))}:{minimum:0,maximum:i}},minutes:()=>({minimum:0,maximum:e.getMinutes(o)}),seconds:()=>({minimum:0,maximum:e.getSeconds(o)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},zQ=(e,t)=>{},z0=(e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{let r=zZ(e,t.format),i=e.formatByString(n,t.format),o=r.indexOf(i),a=r.indexOf(t.value);return e.addDays(n,a-o)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{let t=12>e.getHours(n),i=e.getHours(r);if(t&&i>=12)return e.addHours(r,-12);if(!t&&i<12)return e.addHours(r,12);return r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}},z1={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},z2=(e,t,n,r,i)=>[...n].sort((e,t)=>z1[e.type]-z1[t.type]).reduce((n,r)=>!i||r.modified?z0(e,r,t,n):n,r),z5=()=>navigator.userAgent.toLowerCase().includes("android"),z3=(e,t)=>{let n={};if(!t)return e.forEach((t,r)=>{let i=r===e.length-1?null:r+1;n[r]={leftIndex:0===r?null:r-1,rightIndex:i}}),{neighbors:n,startIndex:0,endIndex:e.length-1};let r={},i={},o=0,a=0,s=e.length-1;for(;s>=0;){-1===(a=e.findIndex((e,t)=>t>=o&&e.endSeparator?.includes(" ")&&" / "!==e.endSeparator))&&(a=e.length-1);for(let e=a;e>=o;e-=1)i[e]=s,r[s]=e,s-=1;o=a+1}return e.forEach((t,o)=>{let a=i[o],s=0===a?null:r[a-1],l=a===e.length-1?null:r[a+1];n[o]={leftIndex:s,rightIndex:l}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}},z4=(e,t)=>{if(null==e)return null;if("all"===e)return"all";if("string"==typeof e){let n=t.findIndex(t=>t.type===e);return -1===n?null:n}return e},z6=(e,t)=>{if(e.value)switch(e.type){case"month":{if("digit"===e.contentType)return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");let n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return"digit"===e.contentType?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;default:return}},z8=(e,t)=>{if(e.value)switch(e.type){case"weekDay":if("letter"===e.contentType)return;return Number(e.value);case"meridiem":{let n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);if(n)return+(t.getHours(n)>=12);return}case"day":return"digit-with-letter"===e.contentType?parseInt(e.value,10):Number(e.value);case"month":{if("digit"===e.contentType)return Number(e.value);let n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return"letter"!==e.contentType?Number(e.value):void 0}},z9=["value","referenceDate"],z7={emptyValue:null,getTodayValue:BP,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=H(e,z9);return null!=t&&r.utils.isValid(t)?t:null!=n?n:zL(r)},cleanValue:(e,t)=>null!=t&&e.isValid(t)?t:null,areValuesEqual:(e,t,n)=>!(e.isValid(t)||null==t||e.isValid(n))&&null!=n||e.isEqual(t,n),isSameError:(e,t)=>e===t,hasError:e=>null!=e,defaultErrorState:null,getTimezone:(e,t)=>null!=t&&e.isValid(t)?e.getTimezone(t):null,setTimezone:(e,t,n)=>null==n?null:e.setTimezone(n,t)},$e={updateReferenceValue:(e,t,n)=>null!=t&&e.isValid(t)?t:n,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&n?n:r(t),getV7HiddenInputValueFromSections:e=>e.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),getV6InputValueFromSections:(e,t,n)=>{let r=e.map(e=>{let r=zG(e,n?"input-rtl":"input-ltr",t);return`${e.startSeparator}${r}${e.endSeparator}`}).join("");return n?`\u2066${r}\u2069`:r},getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:e=>e,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:null!=n&&e.isValid(n)?n:t.referenceValue})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},$t=({value:e,referenceDate:t,utils:n,props:r,timezone:i})=>{let o=g.useMemo(()=>z7.getInitialReferenceValue({value:e,utils:n,props:r,referenceDate:t,granularity:zO.day,timezone:i,getTodayDate:()=>BP(n,i,"date")}),[]);return e??o},$n=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],$r=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"],arrowSwitcher:["arrowSwitcher"]},F2,t)},$i=(0,S.ZP)(F1,{name:"MuiTimeClock",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",position:"relative"}),$o=(0,S.ZP)(FQ,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),$a=["hours","minutes"],$s=g.forwardRef(function(e,t){let n=BS(),r=Bf({props:e,name:"MuiTimeClock"}),{ampm:i=n.is12HourCycleInCurrentLocale(),ampmInClock:o=!1,autoFocus:a,slots:s,slotProps:l,value:u,defaultValue:c,referenceDate:d,disableIgnoringDatePartForTimeValidation:h=!1,maxTime:p,minTime:m,disableFuture:y,disablePast:b,minutesStep:x=1,shouldDisableTime:w,showViewSwitcher:S,onChange:C,view:k,views:M=$a,openTo:T,onViewChange:A,focusedView:I,onFocusedViewChange:P,className:R,disabled:O,readOnly:E,timezone:D}=r,L=H(r,$n),{value:_,handleValueChange:N,timezone:Z}=zR({name:"TimeClock",timezone:D,value:u,defaultValue:c,referenceDate:d,onChange:C,valueManager:z7}),j=$t({value:_,referenceDate:d,utils:n,props:r,timezone:Z}),B=Ft(),F=Bk(Z),{view:z,setView:$,previousView:V,nextView:q,setValueAndGoToNextView:G}=F0({view:k,views:M,openTo:T,onViewChange:A,onChange:N,focusedView:I,onFocusedViewChange:P}),{meridiemMode:U,handleMeridiemChange:K}=FL(j,i,G),Y=g.useCallback((e,t)=>{let r=FD(h,n),o="hours"===t||"minutes"===t&&M.includes("seconds"),a=({start:e,end:t})=>!(m&&r(m,t)||p&&r(e,p)||y&&r(e,F)||b&&r(F,o?t:e)),s=(e,r=1)=>{if(e%r!=0)return!1;if(w)switch(t){case"hours":return!w(n.setHours(j,e),"hours");case"minutes":return!w(n.setMinutes(j,e),"minutes");case"seconds":return!w(n.setSeconds(j,e),"seconds");default:return!1}return!0};switch(t){case"hours":{let t=FR(e,U,i),r=n.setHours(j,t);if(n.getHours(r)!==t)return!0;return!a({start:n.setSeconds(n.setMinutes(r,0),0),end:n.setSeconds(n.setMinutes(r,59),59)})||!s(t)}case"minutes":{let t=n.setMinutes(j,e);return!a({start:n.setSeconds(t,0),end:n.setSeconds(t,59)})||!s(e,x)}case"seconds":{let t=n.setSeconds(j,e);return!a({start:t,end:t})||!s(e)}default:throw Error("not supported")}},[i,j,h,p,U,m,x,w,n,y,b,F,M]),X=(0,rw.Z)(),J=g.useMemo(()=>{switch(z){case"hours":{let e;let t=(e,t)=>{let r=FR(e,U,i);G(n.setHours(j,r),t,"hours")},r=n.getHours(j);return e=i?r>12?[12,23]:[0,11]:[0,23],{onChange:t,viewValue:r,children:zA({value:_,utils:n,ampm:i,onChange:t,getClockNumberText:B.hoursClockNumberText,isDisabled:e=>O||Y(e,"hours"),selectedId:X}),viewRange:e}}case"minutes":{let e=n.getMinutes(j),t=(e,t)=>{G(n.setMinutes(j,e),t,"minutes")};return{viewValue:e,onChange:t,children:zI({utils:n,value:e,onChange:t,getClockNumberText:B.minutesClockNumberText,isDisabled:e=>O||Y(e,"minutes"),selectedId:X}),viewRange:[0,59]}}case"seconds":{let e=n.getSeconds(j),t=(e,t)=>{G(n.setSeconds(j,e),t,"seconds")};return{viewValue:e,onChange:t,children:zI({utils:n,value:e,onChange:t,getClockNumberText:B.secondsClockNumberText,isDisabled:e=>O||Y(e,"seconds"),selectedId:X}),viewRange:[0,59]}}default:throw Error("You must provide the type for ClockView")}},[z,n,_,i,B.hoursClockNumberText,B.minutesClockNumberText,B.secondsClockNumberText,U,G,j,Y,X,O]),Q=$r(r);return(0,f.jsxs)($i,(0,W.Z)({ref:t,className:(0,v.Z)(Q.root,R),ownerState:r},L,{children:[(0,f.jsx)(zx,(0,W.Z)({autoFocus:a??!!I,ampmInClock:o&&M.includes("hours"),value:_,type:z,ampm:i,minutesStep:x,isTimeDisabled:Y,meridiemMode:U,handleMeridiemChange:K,selectedId:X,disabled:O,readOnly:E},J)),S&&(0,f.jsx)($o,{className:Q.arrowSwitcher,slots:s,slotProps:l,onGoToPrevious:()=>$(V),isPreviousDisabled:!V,previousLabel:B.openPreviousView,onGoToNext:()=>$(q),isNextDisabled:!q,nextLabel:B.openNextView,ownerState:r})]}))}),$l=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:d,disablePast:h,minTime:p,maxTime:g,shouldDisableTime:m,minutesStep:v,ampm:y,ampmInClock:b,slots:x,slotProps:w,readOnly:S,disabled:C,sx:k,autoFocus:M,showViewSwitcher:T,disableIgnoringDatePartForTimeValidation:A,timezone:I})=>(0,f.jsx)($s,{view:e,onViewChange:t,focusedView:n&&FI(n)?n:null,onFocusedViewChange:r,views:i.filter(FI),value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:d,disablePast:h,minTime:p,maxTime:g,shouldDisableTime:m,minutesStep:v,ampm:y,ampmInClock:b,slots:x,slotProps:w,readOnly:S,disabled:C,sx:k,autoFocus:M,showViewSwitcher:T,disableIgnoringDatePartForTimeValidation:A,timezone:I}),$u=({props:e,value:t,timezone:n,adapter:r})=>{if(null===t)return null;let{shouldDisableDate:i,shouldDisableMonth:o,shouldDisableYear:a,disablePast:s,disableFuture:l}=e,u=r.utils.date(void 0,n),c=BA(r.utils,e.minDate,r.defaultDates.minDate),d=BA(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(i&&i(t)):return"shouldDisableDate";case!!(o&&o(t)):return"shouldDisableMonth";case!!(a&&a(t)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(t,u)):return"disableFuture";case!!(s&&r.utils.isBeforeDay(t,u)):return"disablePast";case!!(c&&r.utils.isBeforeDay(t,c)):return"minDate";case!!(d&&r.utils.isAfterDay(t,d)):return"maxDate";default:return null}};$u.valueManager=z7;let $c=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:a,timezone:s})=>{let l=Bw();return g.useCallback(u=>null!==$u({adapter:l,value:u,timezone:s,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:a}}),[l,e,t,n,r,i,o,a,s])},$d=(e,t,n)=>(r,i)=>{switch(i.type){case"changeMonth":return(0,W.Z)({},r,{slideDirection:i.direction,currentMonth:i.newMonth,isMonthSwitchingAnimating:!e});case"changeMonthTimezone":{let e=i.newTimezone;if(n.getTimezone(r.currentMonth)===e)return r;let t=n.setTimezone(r.currentMonth,e);return n.getMonth(t)!==n.getMonth(r.currentMonth)&&(t=n.setMonth(t,n.getMonth(r.currentMonth))),(0,W.Z)({},r,{currentMonth:t})}case"finishMonthSwitchingAnimation":return(0,W.Z)({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(null!=r.focusedDay&&null!=i.focusedDay&&n.isSameDay(i.focusedDay,r.focusedDay))return r;let o=null!=i.focusedDay&&!t&&!n.isSameMonth(r.currentMonth,i.focusedDay);return(0,W.Z)({},r,{focusedDay:i.focusedDay,isMonthSwitchingAnimating:o&&!e&&!i.withoutMonthSwitchingAnimation,currentMonth:o?n.startOfMonth(i.focusedDay):r.currentMonth,slideDirection:null!=i.focusedDay&&n.isAfterDay(i.focusedDay,r.currentMonth)?"left":"right"})}default:throw Error("missing support")}},$h=e=>{let{value:t,referenceDate:n,disableFuture:r,disablePast:i,disableSwitchToMonthOnDayFocus:o=!1,maxDate:a,minDate:s,onMonthChange:l,reduceAnimations:u,shouldDisableDate:c,timezone:d}=e,h=BS(),p=g.useRef($d(!!u,o,h)).current,f=g.useMemo(()=>z7.getInitialReferenceValue({value:t,utils:h,timezone:d,props:e,referenceDate:n,granularity:zO.day}),[n,d]),[m,v]=g.useReducer(p,{isMonthSwitchingAnimating:!1,focusedDay:f,currentMonth:h.startOfMonth(f),slideDirection:"left"});g.useEffect(()=>{v({type:"changeMonthTimezone",newTimezone:h.getTimezone(f)})},[f,h]);let y=g.useCallback(e=>{v((0,W.Z)({type:"changeMonth"},e)),l&&l(e.newMonth)},[l]),b=g.useCallback(e=>{!h.isSameMonth(e,m.currentMonth)&&y({newMonth:h.startOfMonth(e),direction:h.isAfterDay(e,m.currentMonth)?"left":"right"})},[m.currentMonth,y,h]),x=$c({shouldDisableDate:c,minDate:s,maxDate:a,disableFuture:r,disablePast:i,timezone:d}),w=g.useCallback(()=>{v({type:"finishMonthSwitchingAnimation"})},[]);return{referenceDate:f,calendarState:m,changeMonth:b,changeFocusedDay:(0,rM.Z)((e,t)=>{x(e)||v({type:"changeFocusedDay",focusedDay:e,withoutMonthSwitchingAnimation:t})}),isDateDisabled:x,onMonthSwitchingAnimationEnd:w,handleChangeMonth:y}},$p=e=>(0,A.ZP)("MuiPickersFadeTransitionGroup",e);(0,T.Z)("MuiPickersFadeTransitionGroup",["root"]);let $f=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"]},$p,t)},$g=(0,S.ZP)(J,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function $m(e){let t=Bf({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=t,a=$f(t),s=ot();return i?n:(0,f.jsx)($g,{className:(0,v.Z)(a.root,r),children:(0,f.jsx)(om,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:s.transitions.duration.enteringScreen,enter:s.transitions.duration.enteringScreen,exit:0},children:n},o)})}function $v(e){return(0,A.ZP)("MuiPickersDay",e)}let $y=(0,T.Z)("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),$b=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],$x=e=>{let{selected:t,disableMargin:n,disableHighlightToday:r,today:i,disabled:o,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:s,classes:l}=e,u=a&&!s;return(0,y.Z)({root:["root",t&&!u&&"selected",o&&"disabled",!n&&"dayWithMargin",!r&&i&&"today",a&&s&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},$v,l)},$w=({theme:e})=>(0,W.Z)({},e.typography.caption,{width:36,height:36,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:(0,b.Fq)(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${$y.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${$y.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${$y.disabled}:not(.${$y.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${$y.disabled}&.${$y.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:"0 2px"}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${$y.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),$S=(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},$C=(0,S.ZP)(ef,{name:"MuiPickersDay",slot:"Root",overridesResolver:$S})($w),$k=(0,S.ZP)("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:$S})(({theme:e})=>(0,W.Z)({},$w({theme:e}),{opacity:0,pointerEvents:"none"})),$M=()=>{},$T=g.forwardRef(function(e,t){let n=Bf({props:e,name:"MuiPickersDay"}),{autoFocus:r=!1,className:i,day:o,disabled:a=!1,disableHighlightToday:s=!1,disableMargin:l=!1,isAnimating:u,onClick:c,onDaySelect:d,onFocus:h=$M,onBlur:p=$M,onKeyDown:m=$M,onMouseDown:y=$M,onMouseEnter:b=$M,outsideCurrentMonth:x,selected:w=!1,showDaysOutsideCurrentMonth:S=!1,children:C,today:k=!1}=n,M=H(n,$b),T=(0,W.Z)({},n,{autoFocus:r,disabled:a,disableHighlightToday:s,disableMargin:l,selected:w,showDaysOutsideCurrentMonth:S,today:k}),A=$x(T),I=BS(),P=g.useRef(null),R=(0,rC.Z)(P,t);return((0,rT.Z)(()=>{!r||a||u||x||P.current.focus()},[r,a,u,x]),x&&!S)?(0,f.jsx)($k,{className:(0,v.Z)(A.root,A.hiddenDaySpacingFiller,i),ownerState:T,role:M.role}):(0,f.jsx)($C,(0,W.Z)({className:(0,v.Z)(A.root,i),ref:R,centerRipple:!0,disabled:a,tabIndex:w?0:-1,onKeyDown:e=>m(e,o),onFocus:e=>h(e,o),onBlur:e=>p(e,o),onMouseEnter:e=>b(e,o),onClick:e=>{a||d(o),x&&e.currentTarget.focus(),c&&c(e)},onMouseDown:e=>{y(e),x&&e.preventDefault()}},M,{ownerState:T,children:C||I.format(o,"dayOfMonth")}))}),$A=g.memo($T);function $I(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var $P=function(e,t){return e&&t&&t.split(" ").forEach(function(t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=$I(e.className,t):e.setAttribute("class",$I(e.className&&e.className.baseVal||"",t))})},$R=function(e){function t(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1];t.removeClasses(i,"exit"),t.addClass(i,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1];t.addClass(i,o?"appear":"enter","active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.removeClasses(i,o),t.addClass(i,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,i=r&&n?n+"-":"",o=r?""+i+e:n[e],a=r?o+"-active":n[e+"Active"],s=r?o+"-done":n[e+"Done"];return{baseClassName:o,activeClassName:a,doneClassName:s}},t}G(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r,i=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(i+=" "+o),"active"===n&&e&&i5(e),i&&(this.appliedClasses[t][n]=i,r=i,e&&r&&r.split(" ").forEach(function(t){return function(e,t){if(e.classList)e.classList.add(t);else(e.classList?!(t&&e.classList.contains(t)):-1===(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" "))&&("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}(e,t)}))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,i=n.active,o=n.done;this.appliedClasses[t]={},r&&$P(e,r),i&&$P(e,i),o&&$P(e,o)},n.render=function(){var e=this.props,t=(e.classNames,H(e,["classNames"]));return m().createElement(i7,(0,W.Z)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(m().Component);$R.defaultProps={classNames:""},$R.propTypes={};let $O=e=>(0,A.ZP)("MuiPickersSlideTransition",e),$E=(0,T.Z)("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),$D=["children","className","reduceAnimations","slideDirection","transKey","classes"],$L=e=>{let{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return(0,y.Z)(r,$O,t)},$_=(0,S.ZP)(J,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${$E["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${$E["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${$E.slideEnterActive}`]:t.slideEnterActive},{[`.${$E.slideExit}`]:t.slideExit},{[`.${$E["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${$E["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{let t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${$E["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${$E["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${$E.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${$E.slideExit}`]:{transform:"translate(0%)"},[`& .${$E["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${$E["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}}),$N=e=>(0,A.ZP)("MuiDayCalendar",e);(0,T.Z)("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);let $Z=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],$j=["ownerState"],$B=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},$N,t)},$F=(0,S.ZP)("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),$z=(0,S.ZP)("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),$$=(0,S.ZP)(c1,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),$V=(0,S.ZP)(c1,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),$H=(0,S.ZP)(c1,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>(0,W.Z)({},e.typography.caption,{width:36,height:36,padding:0,margin:"0 2px",color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),$W=(0,S.ZP)("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:240}),$q=(0,S.ZP)(function(e){let t=Bf({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:i,transKey:o}=t,a=H(t,$D),s=$L(t),l=ot();if(i)return(0,f.jsx)("div",{className:(0,v.Z)(s.root,r),children:n});let u={exit:s.exit,enterActive:s.enterActive,enter:s.enter,exitActive:s.exitActive};return(0,f.jsx)($_,{className:(0,v.Z)(s.root,r),childFactory:e=>g.cloneElement(e,{classNames:u}),role:"presentation",children:(0,f.jsx)($R,(0,W.Z)({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:u},a,{children:n}),o)})},{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:240}),$G=(0,S.ZP)("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),$U=(0,S.ZP)("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:"2px 0",display:"flex",justifyContent:"center"});function $K(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:i,isDateDisabled:o,currentMonthNumber:a,isViewFocused:s}=e,l=H(e,$Z),{disabled:u,disableHighlightToday:c,isMonthSwitchingAnimating:d,showDaysOutsideCurrentMonth:h,slots:p,slotProps:m,timezone:v}=t,y=BS(),b=Bk(v),x=null!==r&&y.isSameDay(n,r),w=i.some(e=>y.isSameDay(e,n)),S=y.isSameDay(n,b),C=p?.day??$A,k=H(iF({elementType:C,externalSlotProps:m?.day,additionalProps:(0,W.Z)({disableHighlightToday:c,showDaysOutsideCurrentMonth:h,role:"gridcell",isAnimating:d,"data-timestamp":y.toJsDate(n).valueOf()},l),ownerState:(0,W.Z)({},t,{day:n,selected:w})}),$j),M=g.useMemo(()=>u||o(n),[u,o,n]),T=g.useMemo(()=>y.getMonth(n)!==a,[y,n,a]),A=g.useMemo(()=>{let e=y.startOfMonth(y.setMonth(n,a));return h?y.isSameDay(n,y.startOfWeek(e)):y.isSameDay(n,e)},[a,n,h,y]),I=g.useMemo(()=>{let e=y.endOfMonth(y.setMonth(n,a));return h?y.isSameDay(n,y.endOfWeek(e)):y.isSameDay(n,e)},[a,n,h,y]);return(0,f.jsx)(C,(0,W.Z)({},k,{day:n,disabled:M,autoFocus:s&&x,today:S,outsideCurrentMonth:T,isFirstVisibleCell:A,isLastVisibleCell:I,selected:w,tabIndex:x?0:-1,"aria-selected":w,"aria-current":S?"date":void 0}))}function $Y(e){let t=Bf({props:e,name:"MuiDayCalendar"}),n=BS(),{onFocusedDayChange:r,className:i,currentMonth:o,selectedDays:a,focusedDay:s,loading:l,onSelectedDaysChange:u,onMonthSwitchingAnimationEnd:c,readOnly:d,reduceAnimations:h,renderLoading:p=()=>(0,f.jsx)("span",{children:"..."}),slideDirection:m,TransitionProps:y,disablePast:b,disableFuture:x,minDate:w,maxDate:S,shouldDisableDate:C,shouldDisableMonth:k,shouldDisableYear:M,dayOfWeekFormatter:T=e=>n.format(e,"weekdayShort").charAt(0).toUpperCase(),hasFocus:A,onFocusedViewChange:I,gridLabelId:P,displayWeekNumber:R,fixedWeekNumber:O,autoFocus:E,timezone:D}=t,L=Bk(D),_=$B(t),N=iL(),Z=$c({shouldDisableDate:C,shouldDisableMonth:k,shouldDisableYear:M,minDate:w,maxDate:S,disablePast:b,disableFuture:x,timezone:D}),j=Ft(),[B,F]=(0,gx.Z)({name:"DayCalendar",state:"hasFocus",controlled:A,default:E??!1}),[z,$]=g.useState(()=>s||L),V=(0,rM.Z)(e=>{!d&&u(e)}),H=e=>{Z(e)||(r(e),$(e),I?.(!0),F(!0))},q=(0,rM.Z)((e,t)=>{switch(e.key){case"ArrowUp":H(n.addDays(t,-7)),e.preventDefault();break;case"ArrowDown":H(n.addDays(t,7)),e.preventDefault();break;case"ArrowLeft":{let r=n.addDays(t,N?1:-1),i=n.addMonths(t,N?1:-1);H(BT({utils:n,date:r,minDate:N?r:n.startOfMonth(i),maxDate:N?n.endOfMonth(i):r,isDateDisabled:Z,timezone:D})||r),e.preventDefault();break}case"ArrowRight":{let r=n.addDays(t,N?-1:1),i=n.addMonths(t,N?-1:1);H(BT({utils:n,date:r,minDate:N?n.startOfMonth(i):r,maxDate:N?r:n.endOfMonth(i),isDateDisabled:Z,timezone:D})||r),e.preventDefault();break}case"Home":H(n.startOfWeek(t)),e.preventDefault();break;case"End":H(n.endOfWeek(t)),e.preventDefault();break;case"PageUp":H(n.addMonths(t,1)),e.preventDefault();break;case"PageDown":H(n.addMonths(t,-1)),e.preventDefault()}}),G=(0,rM.Z)((e,t)=>H(t)),U=(0,rM.Z)((e,t)=>{B&&n.isSameDay(z,t)&&I?.(!1)}),K=n.getMonth(o),Y=n.getYear(o),X=g.useMemo(()=>a.filter(e=>!!e).map(e=>n.startOfDay(e)),[n,a]),J=`${Y}-${K}`,Q=g.useMemo(()=>g.createRef(),[J]),ee=g.useMemo(()=>{let e=n.startOfMonth(o),t=n.endOfMonth(o);return Z(z)||n.isAfterDay(z,t)||n.isBeforeDay(z,e)?BT({utils:n,date:z,minDate:e,maxDate:t,disablePast:b,disableFuture:x,isDateDisabled:Z,timezone:D}):z},[o,x,b,z,Z,n,D]),et=g.useMemo(()=>{let e=n.getWeekArray(o),t=n.addMonths(o,1);for(;O&&e.length<O;){let r=n.getWeekArray(t),i=n.isSameDay(e[e.length-1][0],r[0][0]);r.slice(+!!i).forEach(t=>{e.length<O&&e.push(t)}),t=n.addMonths(t,1)}return e},[o,O,n]);return(0,f.jsxs)($F,{role:"grid","aria-labelledby":P,className:_.root,children:[(0,f.jsxs)($z,{role:"row",className:_.header,children:[R&&(0,f.jsx)($V,{variant:"caption",role:"columnheader","aria-label":j.calendarWeekNumberHeaderLabel,className:_.weekNumberLabel,children:j.calendarWeekNumberHeaderText}),BD(n,L).map((e,t)=>(0,f.jsx)($$,{variant:"caption",role:"columnheader","aria-label":n.format(e,"weekday"),className:_.weekDayLabel,children:T(e)},t.toString()))]}),l?(0,f.jsx)($W,{className:_.loadingContainer,children:p()}):(0,f.jsx)($q,(0,W.Z)({transKey:J,onExited:c,reduceAnimations:h,slideDirection:m,className:(0,v.Z)(i,_.slideTransition)},y,{nodeRef:Q,children:(0,f.jsx)($G,{ref:Q,role:"rowgroup",className:_.monthContainer,children:et.map((e,r)=>(0,f.jsxs)($U,{role:"row",className:_.weekContainer,"aria-rowindex":r+1,children:[R&&(0,f.jsx)($H,{className:_.weekNumber,role:"rowheader","aria-label":j.calendarWeekNumberAriaLabelText(n.getWeekNumber(e[0])),children:j.calendarWeekNumberText(n.getWeekNumber(e[0]))}),e.map((e,n)=>(0,f.jsx)($K,{parentProps:t,day:e,selectedDays:X,focusableDay:ee,onKeyDown:q,onFocus:G,onBlur:U,onDaySelect:V,isDateDisabled:Z,currentMonthNumber:K,isViewFocused:B,"aria-colindex":n+1},e.toString()))]},`week-${e[0]}`))})}))]})}function $X(e){return(0,A.ZP)("MuiPickersMonth",e)}let $J=(0,T.Z)("MuiPickersMonth",["root","monthButton","disabled","selected"]),$Q=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],$0=e=>{let{disabled:t,selected:n,classes:r}=e;return(0,y.Z)({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},$X,r)},$1=(0,S.ZP)("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),$2=(0,S.ZP)("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${$J.disabled}`]:t.disabled},{[`&.${$J.selected}`]:t.selected}]})(({theme:e})=>(0,W.Z)({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${$J.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${$J.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),$5=g.memo(function(e){let t=Bf({props:e,name:"MuiPickersMonth"}),{autoFocus:n,className:r,children:i,disabled:o,selected:a,value:s,tabIndex:l,onClick:u,onKeyDown:c,onFocus:d,onBlur:h,"aria-current":p,"aria-label":m,slots:y,slotProps:b}=t,x=H(t,$Q),w=g.useRef(null),S=$0(t);(0,rT.Z)(()=>{n&&w.current?.focus()},[n]);let C=y?.monthButton??$2,k=iF({elementType:C,externalSlotProps:b?.monthButton,additionalProps:{children:i,disabled:o,tabIndex:l,ref:w,type:"button",role:"radio","aria-current":p,"aria-checked":a,"aria-label":m,onClick:e=>u(e,s),onKeyDown:e=>c(e,s),onFocus:e=>d(e,s),onBlur:e=>h(e,s)},ownerState:t,className:S.monthButton});return(0,f.jsx)($1,(0,W.Z)({className:(0,v.Z)(S.root,r),ownerState:t},x,{children:(0,f.jsx)(C,(0,W.Z)({},k))}))});function $3(e){return(0,A.ZP)("MuiMonthCalendar",e)}(0,T.Z)("MuiMonthCalendar",["root"]);let $4=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],$6=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"]},$3,t)},$8=(0,S.ZP)("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:320,boxSizing:"border-box"}),$9=g.forwardRef(function(e,t){let n=function(e,t){let n=BS(),r=BC(),i=Bf({props:e,name:t});return(0,W.Z)({disableFuture:!1,disablePast:!1},i,{minDate:BA(n,i.minDate,r.minDate),maxDate:BA(n,i.maxDate,r.maxDate)})}(e,"MuiMonthCalendar"),{className:r,value:i,defaultValue:o,referenceDate:a,disabled:s,disableFuture:l,disablePast:u,maxDate:c,minDate:d,onChange:h,shouldDisableMonth:p,readOnly:m,autoFocus:y=!1,onMonthFocus:b,hasFocus:x,onFocusedViewChange:w,monthsPerRow:S=3,timezone:C,gridLabelId:k,slots:M,slotProps:T}=n,A=H(n,$4),{value:I,handleValueChange:P,timezone:R}=zR({name:"MonthCalendar",timezone:C,value:i,defaultValue:o,referenceDate:a,onChange:h,valueManager:z7}),O=Bk(R),E=iL(),D=BS(),L=g.useMemo(()=>z7.getInitialReferenceValue({value:I,utils:D,props:n,timezone:R,referenceDate:a,granularity:zO.month}),[]),_=$6(n),N=g.useMemo(()=>D.getMonth(O),[D,O]),Z=g.useMemo(()=>null!=I?D.getMonth(I):null,[I,D]),[j,B]=g.useState(()=>Z||D.getMonth(L)),[F,z]=(0,gx.Z)({name:"MonthCalendar",state:"hasFocus",controlled:x,default:y??!1}),$=(0,rM.Z)(e=>{z(e),w&&w(e)}),V=g.useCallback(e=>{let t=D.startOfMonth(u&&D.isAfter(O,d)?O:d),n=D.startOfMonth(l&&D.isBefore(O,c)?O:c),r=D.startOfMonth(e);return!!(D.isBefore(r,t)||D.isAfter(r,n))||!!p&&p(r)},[l,u,c,d,O,p,D]),q=(0,rM.Z)((e,t)=>{!m&&P(D.setMonth(I??L,t))}),G=(0,rM.Z)(e=>{!V(D.setMonth(I??L,e))&&(B(e),$(!0),b&&b(e))});g.useEffect(()=>{B(e=>null!==Z&&e!==Z?Z:e)},[Z]);let U=(0,rM.Z)((e,t)=>{switch(e.key){case"ArrowUp":G((12+t-3)%12),e.preventDefault();break;case"ArrowDown":G((12+t+3)%12),e.preventDefault();break;case"ArrowLeft":G((12+t+(E?1:-1))%12),e.preventDefault();break;case"ArrowRight":G((12+t+(E?-1:1))%12),e.preventDefault()}}),K=(0,rM.Z)((e,t)=>{G(t)}),Y=(0,rM.Z)((e,t)=>{j===t&&$(!1)});return(0,f.jsx)($8,(0,W.Z)({ref:t,className:(0,v.Z)(_.root,r),ownerState:n,role:"radiogroup","aria-labelledby":k},A,{children:BI(D,I??L).map(e=>{let t=D.getMonth(e),n=D.format(e,"monthShort"),r=D.format(e,"month"),i=s||V(e);return(0,f.jsx)($5,{selected:t===Z,value:t,onClick:q,onKeyDown:U,autoFocus:F&&t===j,disabled:i,tabIndex:t!==j||i?-1:0,onFocus:K,onBlur:Y,"aria-current":N===t?"date":void 0,"aria-label":r,monthsPerRow:S,slots:M,slotProps:T,children:n},n)})}))});function $7(e){return(0,A.ZP)("MuiPickersYear",e)}let Ve=(0,T.Z)("MuiPickersYear",["root","yearButton","selected","disabled"]),Vt=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],Vn=e=>{let{disabled:t,selected:n,classes:r}=e;return(0,y.Z)({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},$7,r)},Vr=(0,S.ZP)("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),Vi=(0,S.ZP)("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${Ve.disabled}`]:t.disabled},{[`&.${Ve.selected}`]:t.selected}]})(({theme:e})=>(0,W.Z)({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:(0,b.Fq)(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Ve.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${Ve.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),Vo=g.memo(function(e){let t=Bf({props:e,name:"MuiPickersYear"}),{autoFocus:n,className:r,children:i,disabled:o,selected:a,value:s,tabIndex:l,onClick:u,onKeyDown:c,onFocus:d,onBlur:h,"aria-current":p,slots:m,slotProps:y}=t,b=H(t,Vt),x=g.useRef(null),w=Vn(t);(0,rT.Z)(()=>{n&&x.current?.focus()},[n]);let S=m?.yearButton??Vi,C=iF({elementType:S,externalSlotProps:y?.yearButton,additionalProps:{children:i,disabled:o,tabIndex:l,ref:x,type:"button",role:"radio","aria-current":p,"aria-checked":a,onClick:e=>u(e,s),onKeyDown:e=>c(e,s),onFocus:e=>d(e,s),onBlur:e=>h(e,s)},ownerState:t,className:w.yearButton});return(0,f.jsx)(Vr,(0,W.Z)({className:(0,v.Z)(w.root,r),ownerState:t},b,{children:(0,f.jsx)(S,(0,W.Z)({},C))}))});function Va(e){return(0,A.ZP)("MuiYearCalendar",e)}(0,T.Z)("MuiYearCalendar",["root"]);let Vs=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],Vl=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"]},Va,t)},Vu=(0,S.ZP)("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:320,maxHeight:280,boxSizing:"border-box",position:"relative"}),Vc=g.forwardRef(function(e,t){let n=function(e,t){let n=BS(),r=BC(),i=Bf({props:e,name:t});return(0,W.Z)({disablePast:!1,disableFuture:!1},i,{yearsPerRow:i.yearsPerRow??3,minDate:BA(n,i.minDate,r.minDate),maxDate:BA(n,i.maxDate,r.maxDate)})}(e,"MuiYearCalendar"),{autoFocus:r,className:i,value:o,defaultValue:a,referenceDate:s,disabled:l,disableFuture:u,disablePast:c,maxDate:d,minDate:h,onChange:p,readOnly:m,shouldDisableYear:y,onYearFocus:b,hasFocus:x,onFocusedViewChange:w,yearsOrder:S="asc",yearsPerRow:C,timezone:k,gridLabelId:M,slots:T,slotProps:A}=n,I=H(n,Vs),{value:P,handleValueChange:R,timezone:O}=zR({name:"YearCalendar",timezone:k,value:o,defaultValue:a,referenceDate:s,onChange:p,valueManager:z7}),E=Bk(O),D=iL(),L=BS(),_=g.useMemo(()=>z7.getInitialReferenceValue({value:P,utils:L,props:n,timezone:O,referenceDate:s,granularity:zO.year}),[]),N=Vl(n),Z=g.useMemo(()=>L.getYear(E),[L,E]),j=g.useMemo(()=>null!=P?L.getYear(P):null,[P,L]),[B,F]=g.useState(()=>j||L.getYear(_)),[z,$]=(0,gx.Z)({name:"YearCalendar",state:"hasFocus",controlled:x,default:r??!1}),V=(0,rM.Z)(e=>{$(e),w&&w(e)}),q=g.useCallback(e=>!!(c&&L.isBeforeYear(e,E)||u&&L.isAfterYear(e,E)||h&&L.isBeforeYear(e,h)||d&&L.isAfterYear(e,d))||!!y&&y(L.startOfYear(e)),[u,c,d,h,E,y,L]),G=(0,rM.Z)((e,t)=>{!m&&R(L.setYear(P??_,t))}),U=(0,rM.Z)(e=>{q(L.setYear(P??_,e))||(F(e),V(!0),b?.(e))});g.useEffect(()=>{F(e=>null!==j&&e!==j?j:e)},[j]);let K="desc"!==S?+C:-1*C,Y=D&&"asc"===S||!D&&"desc"===S?-1:1,X=(0,rM.Z)((e,t)=>{switch(e.key){case"ArrowUp":U(t-K),e.preventDefault();break;case"ArrowDown":U(t+K),e.preventDefault();break;case"ArrowLeft":U(t-Y),e.preventDefault();break;case"ArrowRight":U(t+Y),e.preventDefault()}}),J=(0,rM.Z)((e,t)=>{U(t)}),Q=(0,rM.Z)((e,t)=>{B===t&&V(!1)}),ee=g.useRef(null),et=(0,rC.Z)(t,ee);g.useEffect(()=>{if(r||null===ee.current)return;let e=ee.current.querySelector('[tabindex="0"]');if(!e)return;let t=e.offsetHeight,n=e.offsetTop,i=ee.current.clientHeight,o=ee.current.scrollTop;!(t>i)&&!(n<o)&&(ee.current.scrollTop=n+t-i/2-t/2)},[r]);let en=L.getYearRange([h,d]);return"desc"===S&&en.reverse(),(0,f.jsx)(Vu,(0,W.Z)({ref:et,className:(0,v.Z)(N.root,i),ownerState:n,role:"radiogroup","aria-labelledby":M},I,{children:en.map(e=>{let t=L.getYear(e),n=l||q(e);return(0,f.jsx)(Vo,{selected:t===j,value:t,onClick:G,onKeyDown:X,autoFocus:z&&t===B,disabled:n,tabIndex:t!==B||n?-1:0,onFocus:J,onBlur:Q,"aria-current":Z===t?"date":void 0,yearsPerRow:C,slots:T,slotProps:A,children:L.format(e,"year")},L.format(e,"year"))})}))}),Vd=e=>(0,A.ZP)("MuiPickersCalendarHeader",e),Vh=(0,T.Z)("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),Vp=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],Vf=["ownerState"],Vg=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},Vd,t)},Vm=(0,S.ZP)("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),Vv=(0,S.ZP)("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>(0,W.Z)({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),Vy=(0,S.ZP)("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),Vb=(0,S.ZP)(rx,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${Vh.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),Vx=(0,S.ZP)(B4,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),Vw=g.forwardRef(function(e,t){let n=Ft(),r=BS(),i=Bf({props:e,name:"MuiPickersCalendarHeader"}),{slots:o,slotProps:a,currentMonth:s,disabled:l,disableFuture:u,disablePast:c,maxDate:d,minDate:h,onMonthChange:p,onViewChange:m,view:y,reduceAnimations:b,views:x,labelId:w,className:S,timezone:C,format:k=`${r.formats.month} ${r.formats.year}`}=i,M=H(i,Vp),T=Vg(i),A=o?.switchViewButton??Vb,I=iF({elementType:A,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(y)},ownerState:i,className:T.switchViewButton}),P=o?.switchViewIcon??Vx,R=H(iF({elementType:P,externalSlotProps:a?.switchViewIcon,ownerState:i,className:T.switchViewIcon}),Vf),O=function(e,{disableFuture:t,maxDate:n,timezone:r}){let i=BS();return g.useMemo(()=>{let o=i.date(void 0,r),a=i.startOfMonth(t&&i.isBefore(o,n)?o:n);return!i.isAfter(a,e)},[t,n,e,i,r])}(s,{disableFuture:u,maxDate:d,timezone:C}),E=function(e,{disablePast:t,minDate:n,timezone:r}){let i=BS();return g.useMemo(()=>{let o=i.date(void 0,r),a=i.startOfMonth(t&&i.isAfter(o,n)?o:n);return!i.isBefore(a,e)},[t,n,e,i,r])}(s,{disablePast:c,minDate:h,timezone:C});if(1===x.length&&"year"===x[0])return null;let D=r.formatByString(s,k);return(0,f.jsxs)(Vm,(0,W.Z)({},M,{ownerState:i,className:(0,v.Z)(T.root,S),ref:t,children:[(0,f.jsxs)(Vv,{role:"presentation",onClick:()=>{if(1!==x.length&&m&&!l){if(2===x.length)m(x.find(e=>e!==y)||x[0]);else{let e=+(0===x.indexOf(y));m(x[e])}}},ownerState:i,"aria-live":"polite",className:T.labelContainer,children:[(0,f.jsx)($m,{reduceAnimations:b,transKey:D,children:(0,f.jsx)(Vy,{id:w,ownerState:i,className:T.label,children:D})}),x.length>1&&!l&&(0,f.jsx)(A,(0,W.Z)({},I,{children:(0,f.jsx)(P,(0,W.Z)({},R))}))]}),(0,f.jsx)(om,{in:"day"===y,appear:!b,enter:!b,children:(0,f.jsx)(FQ,{slots:o,slotProps:a,onGoToPrevious:()=>p(r.addMonths(s,-1),"right"),isPreviousDisabled:E,previousLabel:n.previousMonth,onGoToNext:()=>p(r.addMonths(s,1),"left"),isNextDisabled:O,nextLabel:n.nextMonth})})]}))}),VS="undefined"!=typeof navigator&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),VC=VS&&VS[1]?parseInt(VS[1],10):null,Vk=VS&&VS[2]?parseInt(VS[2],10):null,VM=VC&&VC<10||Vk&&Vk<13||!1,VT=()=>mQ("@media (prefers-reduced-motion: reduce)",{defaultMatches:!1})||VM,VA=e=>(0,A.ZP)("MuiDateCalendar",e);(0,T.Z)("MuiDateCalendar",["root","viewTransitionContainer"]);let VI=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],VP=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},VA,t)},VR=(0,S.ZP)(F1,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:336}),VO=(0,S.ZP)($m,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),VE=g.forwardRef(function(e,t){let n=BS(),r=(0,rw.Z)(),i=function(e,t){let n=BS(),r=BC(),i=VT(),o=Bf({props:e,name:t});return(0,W.Z)({},o,{loading:o.loading??!1,disablePast:o.disablePast??!1,disableFuture:o.disableFuture??!1,openTo:o.openTo??"day",views:o.views??["year","day"],reduceAnimations:o.reduceAnimations??i,renderLoading:o.renderLoading??(()=>(0,f.jsx)("span",{children:"..."})),minDate:BA(n,o.minDate,r.minDate),maxDate:BA(n,o.maxDate,r.maxDate)})}(e,"MuiDateCalendar"),{autoFocus:o,onViewChange:a,value:s,defaultValue:l,referenceDate:u,disableFuture:c,disablePast:d,onChange:h,onYearChange:p,onMonthChange:m,reduceAnimations:y,shouldDisableDate:b,shouldDisableMonth:x,shouldDisableYear:w,view:S,views:C,openTo:k,className:M,disabled:T,readOnly:A,minDate:I,maxDate:P,disableHighlightToday:R,focusedView:O,onFocusedViewChange:E,showDaysOutsideCurrentMonth:D,fixedWeekNumber:L,dayOfWeekFormatter:_,slots:N,slotProps:Z,loading:j,renderLoading:B,displayWeekNumber:F,yearsOrder:z,yearsPerRow:$,monthsPerRow:V,timezone:q}=i,G=H(i,VI),{value:U,handleValueChange:K,timezone:Y}=zR({name:"DateCalendar",timezone:q,value:s,defaultValue:l,referenceDate:u,onChange:h,valueManager:z7}),{view:X,setView:J,focusedView:Q,setFocusedView:ee,goToNextView:et,setValueAndGoToNextView:en}=F0({view:S,views:C,openTo:k,onChange:K,onViewChange:a,autoFocus:o,focusedView:O,onFocusedViewChange:E}),{referenceDate:er,calendarState:ei,changeFocusedDay:eo,changeMonth:ea,handleChangeMonth:es,isDateDisabled:el,onMonthSwitchingAnimationEnd:eu}=$h({value:U,referenceDate:u,reduceAnimations:y,onMonthChange:m,minDate:I,maxDate:P,shouldDisableDate:b,disablePast:d,disableFuture:c,timezone:Y}),ec=T&&U||I,ed=T&&U||P,eh=`${r}-grid-label`,ep=null!==Q,ef=N?.calendarHeader??Vw,eg=iF({elementType:ef,externalSlotProps:Z?.calendarHeader,additionalProps:{views:C,view:X,currentMonth:ei.currentMonth,onViewChange:J,onMonthChange:(e,t)=>es({newMonth:e,direction:t}),minDate:ec,maxDate:ed,disabled:T,disablePast:d,disableFuture:c,reduceAnimations:y,timezone:Y,labelId:eh},ownerState:i}),em=(0,rM.Z)(e=>{let t=n.startOfMonth(e),r=n.endOfMonth(e),i=el(e)?BT({utils:n,date:e,minDate:n.isBefore(I,t)?t:I,maxDate:n.isAfter(P,r)?r:P,disablePast:d,disableFuture:c,isDateDisabled:el,timezone:Y}):e;i?(en(i,"finish"),m?.(t)):(et(),ea(t)),eo(i,!0)}),ev=(0,rM.Z)(e=>{let t=n.startOfYear(e),r=n.endOfYear(e),i=el(e)?BT({utils:n,date:e,minDate:n.isBefore(I,t)?t:I,maxDate:n.isAfter(P,r)?r:P,disablePast:d,disableFuture:c,isDateDisabled:el,timezone:Y}):e;i?(en(i,"finish"),p?.(i)):(et(),ea(t)),eo(i,!0)}),ey=(0,rM.Z)(e=>e?K(BM(n,e,U??er),"finish",X):K(e,"finish",X));g.useEffect(()=>{null!=U&&n.isValid(U)&&ea(U)},[U]);let eb=VP(i),ex={disablePast:d,disableFuture:c,maxDate:P,minDate:I},ew={disableHighlightToday:R,readOnly:A,disabled:T,timezone:Y,gridLabelId:eh,slots:N,slotProps:Z},eS=g.useRef(X);g.useEffect(()=>{eS.current!==X&&(Q===eS.current&&ee(X,!0),eS.current=X)},[Q,ee,X]);let eC=g.useMemo(()=>[U],[U]);return(0,f.jsxs)(VR,(0,W.Z)({ref:t,className:(0,v.Z)(eb.root,M),ownerState:i},G,{children:[(0,f.jsx)(ef,(0,W.Z)({},eg,{slots:N,slotProps:Z})),(0,f.jsx)(VO,{reduceAnimations:y,className:eb.viewTransitionContainer,transKey:X,ownerState:i,children:(0,f.jsxs)("div",{children:["year"===X&&(0,f.jsx)(Vc,(0,W.Z)({},ex,ew,{value:U,onChange:ev,shouldDisableYear:w,hasFocus:ep,onFocusedViewChange:e=>ee("year",e),yearsOrder:z,yearsPerRow:$,referenceDate:er})),"month"===X&&(0,f.jsx)($9,(0,W.Z)({},ex,ew,{hasFocus:ep,className:M,value:U,onChange:em,shouldDisableMonth:x,onFocusedViewChange:e=>ee("month",e),monthsPerRow:V,referenceDate:er})),"day"===X&&(0,f.jsx)($Y,(0,W.Z)({},ei,ex,ew,{onMonthSwitchingAnimationEnd:eu,onFocusedDayChange:eo,reduceAnimations:y,selectedDays:eC,onSelectedDaysChange:ey,shouldDisableDate:b,shouldDisableMonth:x,shouldDisableYear:w,hasFocus:ep,onFocusedViewChange:e=>ee("day",e),showDaysOutsideCurrentMonth:D,fixedWeekNumber:L,dayOfWeekFormatter:_,displayWeekNumber:F,loading:j,renderLoading:B}))]})})]}))}),VD=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:i,value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:d,disablePast:h,minDate:p,maxDate:g,shouldDisableDate:m,shouldDisableMonth:v,shouldDisableYear:y,reduceAnimations:b,onMonthChange:x,monthsPerRow:w,onYearChange:S,yearsOrder:C,yearsPerRow:k,slots:M,slotProps:T,loading:A,renderLoading:I,disableHighlightToday:P,readOnly:R,disabled:O,showDaysOutsideCurrentMonth:E,dayOfWeekFormatter:D,sx:L,autoFocus:_,fixedWeekNumber:N,displayWeekNumber:Z,timezone:j})=>(0,f.jsx)(VE,{view:e,onViewChange:t,views:n.filter(BE),focusedView:r&&BE(r)?r:null,onFocusedViewChange:i,value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:d,disablePast:h,minDate:p,maxDate:g,shouldDisableDate:m,shouldDisableMonth:v,shouldDisableYear:y,reduceAnimations:b,onMonthChange:x,monthsPerRow:w,onYearChange:S,yearsOrder:C,yearsPerRow:k,slots:M,slotProps:T,loading:A,renderLoading:I,disableHighlightToday:P,readOnly:R,disabled:O,showDaysOutsideCurrentMonth:E,dayOfWeekFormatter:D,sx:L,autoFocus:_,fixedWeekNumber:N,displayWeekNumber:Z,timezone:j}),VL=({open:e,onOpen:t,onClose:n})=>{let r=g.useRef("boolean"==typeof e).current,[i,o]=g.useState(!1);return g.useEffect(()=>{if(r){if("boolean"!=typeof e)throw Error("You must not mix controlling and uncontrolled mode for `open` prop");o(e)}},[r,e]),{isOpen:i,setIsOpen:g.useCallback(e=>{r||o(e),e&&t&&t(),!e&&n&&n()},[r,t,n])}};function V_(e){let{props:t,validator:n,value:r,timezone:i,onError:o}=e,a=Bw(),s=g.useRef(n.valueManager.defaultErrorState),l=n({adapter:a,value:r,timezone:i,props:t}),u=n.valueManager.hasError(l);return g.useEffect(()=>{o&&!n.valueManager.isSameError(l,s.current)&&o(l,r),s.current=l},[n,o,l,r]),{validationError:l,hasValidationError:u,getValidationErrorForNewValue:(0,rM.Z)(e=>n({adapter:a,value:e,timezone:i,props:t}))}}let VN=e=>{let{action:t,hasChanged:n,dateState:r,isControlled:i}=e,o=!i&&!r.hasBeenModifiedSinceMount;return"setValueFromField"===t.name||("setValueFromAction"===t.name?!!(o&&["accept","today","clear"].includes(t.pickerAction))||n(r.lastPublishedValue):("setValueFromView"===t.name&&"shallow"!==t.selectionState||"setValueFromShortcut"===t.name)&&(!!o||n(r.lastPublishedValue)))},VZ=e=>{let{action:t,hasChanged:n,dateState:r,isControlled:i,closeOnSelect:o}=e,a=!i&&!r.hasBeenModifiedSinceMount;return"setValueFromAction"===t.name?!!(a&&["accept","today","clear"].includes(t.pickerAction))||n(r.lastCommittedValue):"setValueFromView"===t.name&&"finish"===t.selectionState&&o?!!a||n(r.lastCommittedValue):"setValueFromShortcut"===t.name&&"accept"===t.changeImportance&&n(r.lastCommittedValue)},Vj=e=>{let{action:t,closeOnSelect:n}=e;return"setValueFromAction"===t.name||("setValueFromView"===t.name?"finish"===t.selectionState&&n:"setValueFromShortcut"===t.name&&"accept"===t.changeImportance)},VB=({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:i})=>{let{onAccept:o,onChange:a,value:s,defaultValue:l,closeOnSelect:u="desktop"===r,timezone:c,referenceDate:d}=e,{current:h}=g.useRef(l),{current:p}=g.useRef(void 0!==s),[f,m]=g.useState(c),v=BS(),y=Bw(),{isOpen:b,setIsOpen:x}=VL(e),{timezone:w,value:S,handleValueChange:C}=zP({timezone:c,value:s,defaultValue:h,referenceDate:d,onChange:a,valueManager:t}),[k,M]=g.useState(()=>{let e;return{draft:e=void 0!==S?S:void 0!==h?h:t.emptyValue,lastPublishedValue:e,lastCommittedValue:e,lastControlledValue:s,hasBeenModifiedSinceMount:!1}}),T=t.getTimezone(v,k.draft);f!==c&&(m(c),c&&T&&c!==T&&M(e=>(0,W.Z)({},e,{draft:t.setTimezone(v,c,e.draft)})));let{getValidationErrorForNewValue:A}=V_({props:e,validator:i,timezone:w,value:k.draft,onError:e.onError}),I=(0,rM.Z)(e=>{let n={action:e,dateState:k,hasChanged:n=>!t.areValuesEqual(v,e.value,n),isControlled:p,closeOnSelect:u},r=VN(n),i=VZ(n),a=Vj(n);M(t=>(0,W.Z)({},t,{draft:e.value,lastPublishedValue:r?e.value:t.lastPublishedValue,lastCommittedValue:i?e.value:t.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let s=null,l=()=>(s||(s={validationError:"setValueFromField"===e.name?e.context.validationError:A(e.value)},"setValueFromShortcut"!==e.name||(s.shortcut=e.shortcut)),s);r&&C(e.value,l()),i&&o&&o(e.value,l()),a&&x(!1)});if(k.lastControlledValue!==s){let e=t.areValuesEqual(v,k.draft,S);M(t=>(0,W.Z)({},t,{lastControlledValue:s},e?{}:{lastCommittedValue:S,lastPublishedValue:S,draft:S,hasBeenModifiedSinceMount:!0}))}let P=(0,rM.Z)(()=>{I({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),R=(0,rM.Z)(()=>{I({value:k.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),O=(0,rM.Z)(()=>{I({value:k.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),E=(0,rM.Z)(()=>{I({value:k.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),D=(0,rM.Z)(()=>{I({value:t.getTodayValue(v,w,n),name:"setValueFromAction",pickerAction:"today"})}),L=(0,rM.Z)(e=>{e.preventDefault(),x(!0)}),_=(0,rM.Z)(e=>{e?.preventDefault(),x(!1)}),N=(0,rM.Z)((e,t="partial")=>I({name:"setValueFromView",value:e,selectionState:t})),Z=(0,rM.Z)((e,t,n)=>I({name:"setValueFromShortcut",value:e,changeImportance:t,shortcut:n})),j=(0,rM.Z)((e,t)=>I({name:"setValueFromField",value:e,context:t})),B={onClear:P,onAccept:R,onDismiss:O,onCancel:E,onSetToday:D,onOpen:L,onClose:_},F={value:k.draft,onChange:j},z=g.useMemo(()=>t.cleanValue(v,k.draft),[v,t,k.draft]),$=(0,W.Z)({},B,{value:z,onChange:N,onSelectShortcut:Z,isValid:n=>{let r=i({adapter:y,value:n,timezone:w,props:e});return!t.hasError(r)}}),V=g.useMemo(()=>({onOpen:L,onClose:_,open:b}),[b,_,L]);return{open:b,fieldProps:F,viewProps:{value:z,onChange:N,onClose:_,open:b},layoutProps:$,actions:B,contextValue:V}},VF=["className","sx"],Vz=({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:r,rendererInterceptor:i,fieldRef:o})=>{let{onChange:a,open:s,onClose:l}=t,{view:u,views:c,openTo:d,onViewChange:h,viewRenderers:p,timezone:f}=e,m=H(e,VF),{view:v,setView:y,defaultView:b,focusedView:x,setFocusedView:w,setValueAndGoToNextView:S}=F0({view:u,views:c,openTo:d,onChange:a,onViewChange:h,autoFocus:r}),{hasUIView:C,viewModeLookup:k}=g.useMemo(()=>c.reduce((e,t)=>{let n;return n=null!=p[t]?"UI":"field",e.viewModeLookup[t]=n,"UI"===n&&(e.hasUIView=!0),e},{hasUIView:!1,viewModeLookup:{}}),[p,c]),M=g.useMemo(()=>c.reduce((e,t)=>null!=p[t]&&FI(t)?e+1:e,0),[p,c]),T=k[v],A=(0,rM.Z)(()=>"UI"===T),[I,P]=g.useState("UI"===T?v:null);return I!==v&&"UI"===k[v]&&P(v),(0,rT.Z)(()=>{"field"===T&&s&&(l(),setTimeout(()=>{o?.current?.setSelectedSections(v),o?.current?.focusField(v)}))},[v]),(0,rT.Z)(()=>{if(!s)return;let e=v;"field"===T&&null!=I&&(e=I),e!==b&&"UI"===k[e]&&"UI"===k[b]&&(e=b),e!==v&&y(e),w(e,!0)},[s]),{hasUIView:C,shouldRestoreFocus:A,layoutProps:{views:c,view:I,onViewChange:y},renderCurrentView:()=>{if(null==I)return null;let e=p[I];if(null==e)return null;let r=(0,W.Z)({},m,n,t,{views:c,timezone:f,onChange:S,view:I,onViewChange:y,focusedView:x,onFocusedViewChange:w,showViewSwitcher:M>1,timeViewsCount:M});return i?i(p,I,r):e(r)}}},V$=(e=document)=>{let t=e.activeElement;return t?t.shadowRoot?V$(t.shadowRoot):t:null};function VV(){return"undefined"==typeof window?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?90===Math.abs(window.screen.orientation.angle)?"landscape":"portrait":window.orientation&&90===Math.abs(Number(window.orientation))?"landscape":"portrait"}let VH=(e,t)=>{var n;let[r,i]=g.useState(VV);return(0,rT.Z)(()=>{let e=()=>{i(VV())};return window.addEventListener("orientationchange",e),()=>{window.removeEventListener("orientationchange",e)}},[]),(Array.isArray(n=["hours","minutes","seconds"])?!n.every(t=>-1!==e.indexOf(t)):-1===e.indexOf(n))&&"landscape"===(t||r)},VW=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{let{orientation:i}=e,o=VH(n.views,i),a=iL();return{layoutProps:(0,W.Z)({},n,t,{isLandscape:o,isRtl:a,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}},Vq=({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:i,validator:o,autoFocusView:a,rendererInterceptor:s,fieldRef:l})=>{let u=VB({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o}),c=Vz({props:e,additionalViewProps:i,autoFocusView:a,fieldRef:l,propsFromPickerValue:u.viewProps,rendererInterceptor:s}),d=VW({props:e,wrapperVariant:r,propsFromPickerValue:u.layoutProps,propsFromPickerViews:c.layoutProps}),h=function(e){let{props:t,pickerValueResponse:n}=e;return g.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}({props:e,pickerValueResponse:u});return{open:u.open,actions:u.actions,fieldProps:u.fieldProps,renderCurrentView:c.renderCurrentView,hasUIView:c.hasUIView,shouldRestoreFocus:c.shouldRestoreFocus,layoutProps:d.layoutProps,contextValue:u.contextValue,ownerState:h}};function VG(e){return(0,A.ZP)("MuiPickersLayout",e)}let VU=(0,T.Z)("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),VK=["onAccept","onClear","onCancel","onSetToday","actions"];function VY(e){let{onAccept:t,onClear:n,onCancel:r,onSetToday:i,actions:o}=e,a=H(e,VK),s=Ft();if(null==o||0===o.length)return null;let l=o?.map(e=>{switch(e){case"clear":return f.jsx(e_,{onClick:n,children:s.clearButtonLabel},e);case"cancel":return f.jsx(e_,{onClick:r,children:s.cancelButtonLabel},e);case"accept":return f.jsx(e_,{onClick:t,children:s.okButtonLabel},e);case"today":return f.jsx(e_,{onClick:i,children:s.todayButtonLabel},e);default:return null}});return(0,f.jsx)(p8,(0,W.Z)({},a,{children:l}))}function VX(e){return(0,A.ZP)("MuiListItem",e)}function VJ(e){return(0,A.ZP)("MuiListItemSecondaryAction",e)}(0,T.Z)("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]),(0,T.Z)("MuiListItemSecondaryAction",["root","disableGutters"]);let VQ=e=>{let{disableGutters:t,classes:n}=e;return(0,y.Z)({root:["root",t&&"disableGutters"]},VJ,n)},V0=(0,S.ZP)("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),V1=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiListItemSecondaryAction"}),{className:r,...i}=n,o=g.useContext(iz),a={...n,disableGutters:o.disableGutters},s=VQ(a);return(0,f.jsx)(V0,{className:(0,v.Z)(s.root,r),ownerState:a,ref:t,...i})});V1.muiName="ListItemSecondaryAction";let V2=e=>{let{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:o,divider:a,hasSecondaryAction:s}=e;return(0,y.Z)({root:["root",r&&"dense",!i&&"gutters",!o&&"padding",a&&"divider","flex-start"===t&&"alignItemsFlexStart",s&&"secondaryAction"],container:["container"]},VX,n)},V5=(0,S.ZP)("div",{name:"MuiListItem",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]}})((0,C.Z)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${cW.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>e.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),V3=(0,S.ZP)("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),V4=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiListItem"}),{alignItems:r="center",children:i,className:o,component:a,components:s={},componentsProps:l={},ContainerComponent:u="li",ContainerProps:{className:c,...d}={},dense:h=!1,disableGutters:p=!1,disablePadding:m=!1,divider:y=!1,secondaryAction:b,slotProps:x={},slots:w={},...S}=n,C=g.useContext(iz),k=g.useMemo(()=>({dense:h||C.dense||!1,alignItems:r,disableGutters:p}),[r,C.dense,h,p]),T=g.useRef(null),A=g.Children.toArray(i),I=A.length&&(0,iw.Z)(A[A.length-1],["ListItemSecondaryAction"]),P={...n,alignItems:r,dense:k.dense,disableGutters:p,disablePadding:m,divider:y,hasSecondaryAction:I},R=V2(P),O=(0,B.Z)(T,t),E=w.root||s.Root||V5,D=x.root||l.root||{},L={className:(0,v.Z)(R.root,D.className,o),...S},_=a||"li";return I?(_=L.component||a?_:"div","li"===u&&("li"===_?_="div":"li"===L.component&&(L.component="div")),(0,f.jsx)(iz.Provider,{value:k,children:(0,f.jsxs)(V3,{as:u,className:(0,v.Z)(R.container,c),ref:O,ownerState:P,...d,children:[(0,f.jsx)(E,{...D,...!rE(E)&&{as:_,ownerState:{...P,...D.ownerState}},...L,children:A}),A.pop()]})})):(0,f.jsx)(iz.Provider,{value:k,children:(0,f.jsxs)(E,{...D,as:_,ref:O,...!rE(E)&&{ownerState:{...P,...D.ownerState}},...L,children:[A,b&&(0,f.jsx)(V1,{children:b})]})})}),V6=["items","changeImportance","isLandscape","onChange","isValid"],V8=["getValue"];function V9(e){let{items:t,changeImportance:n="accept",onChange:r,isValid:i}=e,o=H(e,V6);if(null==t||0===t.length)return null;let a=t.map(e=>{let{getValue:t}=e,o=H(e,V8),a=t({isValid:i});return(0,W.Z)({},o,{label:o.label,onClick:()=>{r(a,n,o)},disabled:!i(a)})});return(0,f.jsx)(iW,(0,W.Z)({dense:!0,sx:[{maxHeight:336,maxWidth:200,overflow:"auto"},...Array.isArray(o.sx)?o.sx:[o.sx]]},o,{children:a.map(e=>(0,f.jsx)(V4,{children:(0,f.jsx)(gF,(0,W.Z)({},e))},e.id??e.label))}))}let V7=e=>{let{classes:t,isLandscape:n}=e;return(0,y.Z)({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},VG,t)},He=e=>{let{wrapperVariant:t,onAccept:n,onClear:r,onCancel:i,onSetToday:o,view:a,views:s,onViewChange:l,value:u,onChange:c,onSelectShortcut:d,isValid:h,isLandscape:p,disabled:g,readOnly:m,children:v,slots:y,slotProps:b}=e,x=V7(e),w=y?.actionBar??VY,S=iF({elementType:w,externalSlotProps:b?.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:i,onSetToday:o,actions:"desktop"===t?[]:["cancel","accept"]},className:x.actionBar,ownerState:(0,W.Z)({},e,{wrapperVariant:t})}),C=(0,f.jsx)(w,(0,W.Z)({},S)),k=y?.toolbar,M=iF({elementType:k,externalSlotProps:b?.toolbar,additionalProps:{isLandscape:p,onChange:c,value:u,view:a,onViewChange:l,views:s,disabled:g,readOnly:m},className:x.toolbar,ownerState:(0,W.Z)({},e,{wrapperVariant:t})}),T=null!==M.view&&k?(0,f.jsx)(k,(0,W.Z)({},M)):null,A=y?.tabs,I=a&&A?(0,f.jsx)(A,(0,W.Z)({view:a,onViewChange:l,className:x.tabs},b?.tabs)):null,P=y?.shortcuts??V9,R=iF({elementType:P,externalSlotProps:b?.shortcuts,additionalProps:{isValid:h,isLandscape:p,onChange:d},className:x.shortcuts,ownerState:{isValid:h,isLandscape:p,onChange:d,wrapperVariant:t}});return{toolbar:T,content:v,tabs:I,actionBar:C,shortcuts:a&&P?(0,f.jsx)(P,(0,W.Z)({},R)):null}},Ht=e=>{let{isLandscape:t,classes:n}=e;return(0,y.Z)({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},VG,n)},Hn=(0,S.ZP)("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${VU.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${VU.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${VU.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${VU.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${VU.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${VU.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${VU.shortcuts}`]:{gridColumn:3}}}]}),Hr=(0,S.ZP)("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),Hi=g.forwardRef(function(e,t){let n=Bf({props:e,name:"MuiPickersLayout"}),{toolbar:r,content:i,tabs:o,actionBar:a,shortcuts:s}=He(n),{sx:l,className:u,isLandscape:c,wrapperVariant:d}=n,h=Ht(n);return(0,f.jsxs)(Hn,{ref:t,sx:l,className:(0,v.Z)(h.root,u),ownerState:n,children:[c?s:r,c?r:s,(0,f.jsx)(Hr,{className:h.contentWrapper,children:"desktop"===d?(0,f.jsxs)(g.Fragment,{children:[i,o]}):(0,f.jsxs)(g.Fragment,{children:[o,i]})}),a]})}),Ho=["props","ref"],Ha=(0,S.ZP)(Hi)(({theme:e})=>({overflow:"hidden",minWidth:320,backgroundColor:(e.vars||e).palette.background.paper})),Hs=e=>{let{props:t,ref:n}=e,r=H(e,Ho),{localeText:i,slots:o,slotProps:a,className:s,sx:l,displayStaticWrapperAs:u,autoFocus:c}=t,{layoutProps:d,renderCurrentView:h}=Vq((0,W.Z)({},r,{props:t,autoFocusView:c??!1,additionalViewProps:{},wrapperVariant:u})),p=o?.layout??Ha;return{renderPicker:()=>(0,f.jsx)(Bv,{localeText:i,children:(0,f.jsx)(p,(0,W.Z)({},d,a?.layout,{slots:o,slotProps:a,sx:[...Array.isArray(l)?l:[l],...Array.isArray(a?.layout?.sx)?a.layout.sx:[a?.layout?.sx]],className:(0,v.Z)(s,a?.layout?.className),ref:n,children:h()}))})}},Hl=({adapter:e,value:t,timezone:n,props:r})=>{if(null===t)return null;let{minTime:i,maxTime:o,minutesStep:a,shouldDisableTime:s,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:u,disableFuture:c}=r,d=e.utils.date(void 0,n),h=FD(l,e.utils);switch(!0){case!e.utils.isValid(t):return"invalidDate";case!!(i&&h(i,t)):return"minTime";case!!(o&&h(t,o)):return"maxTime";case!!(c&&e.utils.isAfter(t,d)):return"disableFuture";case!!(u&&e.utils.isBefore(t,d)):return"disablePast";case!!(s&&s(t,"hours")):return"shouldDisableTime-hours";case!!(s&&s(t,"minutes")):return"shouldDisableTime-minutes";case!!(s&&s(t,"seconds")):return"shouldDisableTime-seconds";case!!(a&&e.utils.getMinutes(t)%a!=0):return"minutesStep";default:return null}};Hl.valueManager=z7;let Hu=({adapter:e,value:t,timezone:n,props:r})=>{let i=$u({adapter:e,value:t,timezone:n,props:r});return null!==i?i:Hl({adapter:e,value:t,timezone:n,props:r})};Hu.valueManager=z7;let Hc=g.forwardRef(function(e,t){let n=function(e,t){let n=BS(),r=BC(),i=Bf({props:e,name:t}),o=i.ampm??n.is12HourCycleInCurrentLocale(),a=g.useMemo(()=>i.localeText?.toolbarTitle==null?i.localeText:(0,W.Z)({},i.localeText,{dateTimePickerToolbarTitle:i.localeText.toolbarTitle}),[i.localeText]);return(0,W.Z)({},i,FH({views:i.views,openTo:i.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:o,localeText:a,orientation:i.orientation??"portrait",disableIgnoringDatePartForTimeValidation:i.disableIgnoringDatePartForTimeValidation??!!(i.minDateTime||i.maxDateTime||i.disablePast||i.disableFuture),disableFuture:i.disableFuture??!1,disablePast:i.disablePast??!1,minDate:BA(n,i.minDateTime??i.minDate,r.minDate),maxDate:BA(n,i.maxDateTime??i.maxDate,r.maxDate),minTime:i.minDateTime??i.minTime,maxTime:i.maxDateTime??i.maxTime,slots:(0,W.Z)({toolbar:FV,tabs:Fs},i.slots),slotProps:(0,W.Z)({},i.slotProps,{toolbar:(0,W.Z)({ampm:o},i.slotProps?.toolbar)})})}(e,"MuiStaticDateTimePicker"),r=n.displayStaticWrapperAs??"mobile",i=n.ampmInClock??"desktop"===r,o=(0,W.Z)({day:VD,month:VD,year:VD,hours:$l,minutes:$l,seconds:$l},n.viewRenderers),{renderPicker:a}=Hs({props:(0,W.Z)({},n,{viewRenderers:o,displayStaticWrapperAs:r,ampmInClock:i,yearsPerRow:n.yearsPerRow??("mobile"===r?3:4),slotProps:(0,W.Z)({},n.slotProps,{tabs:(0,W.Z)({hidden:"desktop"===r},n.slotProps?.tabs),toolbar:(0,W.Z)({hidden:"desktop"===r,ampmInClock:i},n.slotProps?.toolbar)})}),valueManager:z7,valueType:"date-time",validator:Hu,ref:t});return a()});Hc.propTypes={ampm:Bb().bool,ampmInClock:Bb().bool,autoFocus:Bb().bool,className:Bb().string,dayOfWeekFormatter:Bb().func,defaultValue:Bb().object,disabled:Bb().bool,disableFuture:Bb().bool,disableHighlightToday:Bb().bool,disableIgnoringDatePartForTimeValidation:Bb().bool,disablePast:Bb().bool,displayStaticWrapperAs:Bb().oneOf(["desktop","mobile"]),displayWeekNumber:Bb().bool,fixedWeekNumber:Bb().number,loading:Bb().bool,localeText:Bb().object,maxDate:Bb().object,maxDateTime:Bb().object,maxTime:Bb().object,minDate:Bb().object,minDateTime:Bb().object,minTime:Bb().object,minutesStep:Bb().number,monthsPerRow:Bb().oneOf([3,4]),onAccept:Bb().func,onChange:Bb().func,onClose:Bb().func,onError:Bb().func,onMonthChange:Bb().func,onViewChange:Bb().func,onYearChange:Bb().func,openTo:Bb().oneOf(["day","hours","minutes","month","seconds","year"]),orientation:Bb().oneOf(["landscape","portrait"]),readOnly:Bb().bool,reduceAnimations:Bb().bool,referenceDate:Bb().object,renderLoading:Bb().func,shouldDisableDate:Bb().func,shouldDisableMonth:Bb().func,shouldDisableTime:Bb().func,shouldDisableYear:Bb().func,showDaysOutsideCurrentMonth:Bb().bool,slotProps:Bb().object,slots:Bb().object,sx:Bb().oneOfType([Bb().arrayOf(Bb().oneOfType([Bb().func,Bb().object,Bb().bool])),Bb().func,Bb().object]),timezone:Bb().string,value:Bb().object,view:Bb().oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:Bb().shape({day:Bb().func,hours:Bb().func,minutes:Bb().func,month:Bb().func,seconds:Bb().func,year:Bb().func}),views:Bb().arrayOf(Bb().oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:Bb().oneOf(["asc","desc"]),yearsPerRow:Bb().oneOf([3,4])};let Hd=({utils:e,format:t})=>{let n=10,r=t,i=e.expandFormat(t);for(;i!==r;)if(r=i,i=e.expandFormat(r),(n-=1)<0)throw Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return i},Hh=({utils:e,expandedFormat:t})=>{let n=[],{start:r,end:i}=e.escapedCharacters,o=RegExp(`(\\${r}[^\\${i}]*\\${i})+`,"g"),a=null;for(;a=o.exec(t);)n.push({start:a.index,end:o.lastIndex-1});return n},Hp=(e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}},Hf=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:i,now:o,token:a,startSeparator:s})=>{if(""===a)throw Error("MUI X: Should not call `commitToken` with an empty token");let l=z_(e,a),u=zY(e,l.contentType,l.type,a),c=n?u:"digit"===l.contentType,d=null!=t&&e.isValid(t),h=d?e.formatByString(t,a):"",p=null;if(c){if(u)p=""===h?e.formatByString(o,a).length:h.length;else{if(null==l.maxLength)throw Error(`MUI X: The token ${a} should have a 'maxDigitNumber' property on it's adapter`);p=l.maxLength,d&&(h=z$(zH(zz(h,i),p),i))}}return(0,W.Z)({},l,{format:a,maxLength:p,value:h,placeholder:Hp(e,r,l,a),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:c,startSeparator:s,endSeparator:"",modified:!1})},Hg=e=>{let{utils:t,expandedFormat:n,escapedParts:r}=e,i=t.date(void 0),o=[],a="",s=Object.keys(t.formatTokenMap).sort((e,t)=>t.length-e.length),l=/^([a-zA-Z]+)/,u=RegExp(`^(${s.join("|")})*$`),c=RegExp(`^(${s.join("|")})`),d=e=>r.find(t=>t.start<=e&&t.end>=e),h=0;for(;h<n.length;){let t=d(h),r=null!=t,s=l.exec(n.slice(h))?.[1];if(!r&&null!=s&&u.test(s)){let t=s;for(;t.length>0;){let n=c.exec(t)[1];t=t.slice(n.length),o.push(Hf((0,W.Z)({},e,{now:i,token:n,startSeparator:a}))),a=""}h+=s.length}else{let e=n[h];r&&t?.start===h||t?.end===h||(0===o.length?a+=e:o[o.length-1].endSeparator+=e),h+=1}}return 0===o.length&&a.length>0&&o.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:a,endSeparator:"",modified:!1}),o},Hm=({isRtl:e,formatDensity:t,sections:n})=>n.map(n=>{let r=n=>{let r=n;return e&&null!==r&&r.includes(" ")&&(r=`\u2069${r}\u2066`),"spacious"===t&&["/",".","-"].includes(r)&&(r=` ${r} `),r};return n.startSeparator=r(n.startSeparator),n.endSeparator=r(n.endSeparator),n}),Hv=e=>{let t=Hd(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));let n=Hh((0,W.Z)({},e,{expandedFormat:t})),r=Hg((0,W.Z)({},e,{expandedFormat:t,escapedParts:n}));return Hm((0,W.Z)({},e,{sections:r}))},Hy=e=>{let t=BS(),n=Ft(),r=Bw(),i=iL(),{valueManager:o,fieldValueManager:a,valueType:s,validator:l,internalProps:u,internalProps:{value:c,defaultValue:d,referenceDate:h,onChange:p,format:f,formatDensity:m="dense",selectedSections:v,onSelectedSectionsChange:y,shouldRespectLeadingZeros:b=!1,timezone:x,enableAccessibleFieldDOMStructure:w=!1}}=e,{timezone:S,value:C,handleValueChange:k}=zP({timezone:x,value:c,defaultValue:d,referenceDate:h,onChange:p,valueManager:o}),M=g.useMemo(()=>zF(t),[t]),T=g.useMemo(()=>zJ(t,M,S),[t,M,S]),A=g.useCallback((e,r=null)=>a.getSectionsFromValue(t,e,r,e=>Hv({utils:t,localeText:n,localizedDigits:M,format:f,date:e,formatDensity:m,shouldRespectLeadingZeros:b,enableAccessibleFieldDOMStructure:w,isRtl:i})),[a,f,n,M,i,b,t,m,w]),[I,P]=g.useState(()=>{let e=A(C);zQ(e,s);let n={sections:e,value:C,referenceValue:o.emptyValue,tempValueStrAndroid:null},r=zE(e),i=o.getInitialReferenceValue({referenceDate:h,value:C,utils:t,props:u,granularity:r,timezone:S});return(0,W.Z)({},n,{referenceValue:i})}),[R,O]=(0,gx.Z)({controlled:v,default:null,name:"useField",state:"selectedSections"}),E=e=>{O(e),y?.(e)},D=g.useMemo(()=>z4(R,I.sections),[R,I.sections]),L="all"===D?0:D,_=({value:e,referenceValue:n,sections:i})=>{if(P(t=>(0,W.Z)({},t,{sections:i,value:e,referenceValue:n,tempValueStrAndroid:null})),o.areValuesEqual(t,I.value,e))return;let a={validationError:l({adapter:r,value:e,timezone:S,props:u})};k(e,a)},N=(e,t)=>{let n=[...I.sections];return n[e]=(0,W.Z)({},n[e],{value:t,modified:!0}),n};return g.useEffect(()=>{let e=A(I.value);zQ(e,s),P(t=>(0,W.Z)({},t,{sections:e}))},[f,t.locale,i]),g.useEffect(()=>{let e;o.areValuesEqual(t,I.value,C)&&o.getTimezone(t,I.value)===o.getTimezone(t,C)||P(e=>(0,W.Z)({},e,{value:C,referenceValue:a.updateReferenceValue(t,C,e.referenceValue),sections:A(C)}))},[C]),{state:I,activeSectionIndex:L,parsedSelectedSections:D,setSelectedSections:E,clearValue:()=>{_({value:o.emptyValue,referenceValue:I.referenceValue,sections:A(o.emptyValue)})},clearActiveSection:()=>{if(null==L)return;let e=I.sections[L],n=a.getActiveDateManager(t,I,e),r=n.getSections(I.sections).filter(e=>""!==e.value).length===+(""!==e.value),i=N(L,""),o=r?null:t.getInvalidDate(),s=n.getNewValuesFromNewActiveDate(o);_((0,W.Z)({},s,{sections:i}))},updateSectionValue:({activeSection:e,newSectionValue:n,shouldGoToNextSection:r})=>{let i,o;r&&L<I.sections.length-1&&E(L+1);let s=a.getActiveDateManager(t,I,e),l=N(L,n),u=s.getSections(l),c=zX(t,u,M);if(null!=c&&t.isValid(c)){let e=z2(t,c,u,s.referenceDate,!0);i=s.getNewValuesFromNewActiveDate(e),o=!0}else i=s.getNewValuesFromNewActiveDate(c),o=(null!=c&&!t.isValid(c))!=(null!=s.date&&!t.isValid(s.date));return o?_((0,W.Z)({},i,{sections:l})):P(e=>(0,W.Z)({},e,i,{sections:l,tempValueStrAndroid:null}))},updateValueFromValueStr:e=>{let r=a.parseValueStr(e,I.referenceValue,(e,r)=>{let o=t.parse(e,f);if(null==o||!t.isValid(o))return null;let a=Hv({utils:t,localeText:n,localizedDigits:M,format:f,date:o,formatDensity:m,shouldRespectLeadingZeros:b,enableAccessibleFieldDOMStructure:w,isRtl:i});return z2(t,o,a,r,!1)}),o=a.updateReferenceValue(t,r,I.referenceValue);_({value:r,referenceValue:o,sections:A(r,I.sections)})},setTempAndroidValueStr:e=>P(t=>(0,W.Z)({},t,{tempValueStrAndroid:e})),getSectionsFromValue:A,sectionsValueBoundaries:T,localizedDigits:M,timezone:S}},Hb=e=>null!=e.saveQuery,Hx=({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:i,timezone:o})=>{let a=BS(),[s,l]=g.useState(null),u=(0,rM.Z)(()=>l(null));g.useEffect(()=>{null!=s&&e[s.sectionIndex]?.type!==s.sectionType&&u()},[e,s,u]),g.useEffect(()=>{if(null!=s){let e=setTimeout(()=>u(),5e3);return()=>{clearTimeout(e)}}return()=>{}},[s,u]);let c=({keyPressed:t,sectionIndex:n},r,i)=>{let o=t.toLowerCase(),a=e[n];if(null!=s&&(!i||i(s.value))&&s.sectionIndex===n){let e=`${s.value}${o}`,t=r(e,a);if(!Hb(t))return l({sectionIndex:n,value:e,sectionType:a.type}),t}let c=r(o,a);return Hb(c)&&!c.saveQuery?(u(),null):(l({sectionIndex:n,value:o,sectionType:a.type}),Hb(c))?null:c},d=e=>{let t=(e,t,n)=>{let r=t.filter(e=>e.toLowerCase().startsWith(n));return 0===r.length?{saveQuery:!1}:{sectionValue:r[0],shouldGoToNextSection:1===r.length}},n=(e,n,r,i)=>{let s=e=>zj(a,o,n.type,e);if("letter"===n.contentType)return t(n.format,s(n.format),e);if(r&&null!=i&&"letter"===z_(a,r).contentType){let n=s(r),o=t(r,n,e);return Hb(o)?{saveQuery:!1}:(0,W.Z)({},o,{sectionValue:i(o.sectionValue,n)})}return{saveQuery:!1}};return c(e,(e,t)=>{switch(t.type){case"month":return n(e,t,a.formats.month,e=>zU(a,e,a.formats.month,t.format));case"weekDay":return n(e,t,a.formats.weekday,(e,t)=>t.indexOf(e).toString());case"meridiem":return n(e,t);default:return{saveQuery:!1}}})},h=e=>{let t=(e,t)=>{let i=zz(e,r),o=Number(i),s=n[t.type]({currentDate:null,format:t.format,contentType:t.contentType});if(o>s.maximum)return{saveQuery:!1};if(o<s.minimum)return{saveQuery:!0};let l=10*o>s.maximum||i.length===s.maximum.toString().length;return{sectionValue:zW(a,o,s,r,t),shouldGoToNextSection:l}};return c(e,(e,n)=>{if("digit"===n.contentType||"digit-with-letter"===n.contentType)return t(e,n);if("month"===n.type){let r=zY(a,"digit","month","MM"),i=t(e,{type:n.type,format:"MM",hasLeadingZerosInFormat:r,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(Hb(i))return i;let o=zU(a,i.sectionValue,"MM",n.format);return(0,W.Z)({},i,{sectionValue:o})}if("weekDay"===n.type){let r=t(e,n);if(Hb(r))return r;let i=zZ(a,n.format)[Number(r.sectionValue)-1];return(0,W.Z)({},r,{sectionValue:i})}return{saveQuery:!1}},e=>zV(e,r))};return{applyCharacterEditing:(0,rM.Z)(n=>{let o=e[n.sectionIndex],a=zV(n.keyPressed,r)?h((0,W.Z)({},n,{keyPressed:z$(n.keyPressed,r)})):d(n);if(null==a){i(null);return}t({activeSection:o,newSectionValue:a.sectionValue,shouldGoToNextSection:a.shouldGoToNextSection})}),resetCharacterQuery:u}},Hw=e=>{let{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:i,onClick:o,onFocus:a,onInput:s,onPaste:l,focused:u,autoFocus:c=!1},fieldValueManager:d,applyCharacterEditing:h,resetCharacterQuery:p,setSelectedSections:f,parsedSelectedSections:m,state:v,clearActiveSection:y,clearValue:b,updateSectionValue:x,updateValueFromValueStr:w,sectionOrder:S,areAllSectionsEmpty:C,sectionsValueBoundaries:k}=e,M=g.useRef(null),T=(0,rC.Z)(r,M),A=Ft(),I=BS(),P=(0,rw.Z)(),[R,O]=g.useState(!1),E=g.useMemo(()=>({syncSelectionToDOM:()=>{let e;if(!M.current)return;let t=document.getSelection();if(!t)return;if(null==m){t.rangeCount>0&&M.current.getRoot().contains(t.getRangeAt(0).startContainer)&&t.removeAllRanges(),R&&M.current.getRoot().blur();return}if(!M.current.getRoot().contains(V$(document)))return;let n=new window.Range;e="all"===m?M.current.getRoot():"empty"===v.sections[m].type?M.current.getSectionContainer(m):M.current.getSectionContent(m),n.selectNodeContents(e),e.focus(),t.removeAllRanges(),t.addRange(n)},getActiveSectionIndexFromDOM:()=>{let e=V$(document);return e&&M.current&&M.current.getRoot().contains(e)?M.current.getSectionIndexFromDOMElement(e):null},focusField:(e=0)=>{if(!M.current||null!=E.getActiveSectionIndexFromDOM())return;let t=z4(e,v.sections);O(!0),M.current.getSectionContent(t).focus()},setSelectedSections:e=>{if(!M.current)return;let t=z4(e,v.sections);O(null!==("all"===t?0:t)),f(e)},isFieldFocused:()=>{let e=V$(document);return!!M.current&&M.current.getRoot().contains(e)}}),[m,f,v.sections,R]),D=(0,rM.Z)(e=>{if(!M.current)return;let t=v.sections[e];M.current.getSectionContent(e).innerHTML=t.value||t.placeholder,E.syncSelectionToDOM()}),L=(0,rM.Z)((e,...t)=>{!e.isDefaultPrevented()&&M.current&&(O(!0),o?.(e,...t),"all"===m?setTimeout(()=>{let e=document.getSelection().getRangeAt(0).startOffset;if(0===e){f(S.startIndex);return}let t=0,n=0;for(;n<e&&t<v.sections.length;){let e=v.sections[t];t+=1,n+=`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`.length}f(t-1)}):R?M.current.getRoot().contains(e.target)||f(S.startIndex):(O(!0),f(S.startIndex)))}),_=(0,rM.Z)(e=>{if(s?.(e),!M.current||"all"!==m)return;let t=e.target.textContent??"";M.current.getRoot().innerHTML=v.sections.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),E.syncSelectionToDOM(),0===t.length||10===t.charCodeAt(0)?(p(),b(),f("all")):t.length>1?w(t):("all"===m&&f(0),h({keyPressed:t,sectionIndex:0}))}),N=(0,rM.Z)(e=>{if(l?.(e),n||"all"!==m){e.preventDefault();return}let t=e.clipboardData.getData("text");e.preventDefault(),p(),w(t)}),Z=(0,rM.Z)((...e)=>{a?.(...e),!R&&M.current&&(O(!0),null==M.current.getSectionIndexFromDOMElement(V$(document))&&f(S.startIndex))}),j=(0,rM.Z)((...e)=>{i?.(...e),setTimeout(()=>{if(!M.current)return;let e=V$(document);M.current.getRoot().contains(e)||(O(!1),f(null))})}),B=(0,rM.Z)(e=>t=>{!t.isDefaultPrevented()&&f(e)}),F=(0,rM.Z)(e=>{e.preventDefault()}),z=(0,rM.Z)(e=>()=>{f(e)}),$=(0,rM.Z)(e=>{if(e.preventDefault(),n||t||"number"!=typeof m)return;let r=v.sections[m],i=e.clipboardData.getData("text"),o=/^[a-zA-Z]+$/.test(i),a=/^[0-9]+$/.test(i),s=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(i);"letter"===r.contentType&&o||"digit"===r.contentType&&a||"digit-with-letter"===r.contentType&&s?(p(),x({activeSection:r,newSectionValue:i,shouldGoToNextSection:!0})):o||a||(p(),w(i))}),V=(0,rM.Z)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="none"}),H=(0,rM.Z)(e=>{if(!M.current)return;let t=e.target,r=t.textContent??"",i=M.current.getSectionIndexFromDOMElement(t),o=v.sections[i];if(n||!M.current){D(i);return}if(0===r.length){if(""===o.value){D(i);return}let t=e.nativeEvent.inputType;if("insertParagraph"===t||"insertLineBreak"===t){D(i);return}p(),y();return}h({keyPressed:r,sectionIndex:i}),D(i)});(0,rT.Z)(()=>{if(R&&M.current){if("all"===m)M.current.getRoot().focus();else if("number"==typeof m){let e=M.current.getSectionContent(m);e&&e.focus()}}},[m,R]);let W=g.useMemo(()=>v.sections.reduce((e,t)=>(e[t.type]=k[t.type]({currentDate:null,contentType:t.contentType,format:t.format}),e),{}),[k,v.sections]),q="all"===m,G=g.useMemo(()=>v.sections.map((e,r)=>{let i=!q&&!t&&!n;return{container:{"data-sectionindex":r,onClick:B(r)},content:{tabIndex:q||r>0?-1:0,contentEditable:!q&&!t&&!n,role:"spinbutton",id:`${P}-${e.type}`,"aria-labelledby":`${P}-${e.type}`,"aria-readonly":n,"aria-valuenow":z8(e,I),"aria-valuemin":W[e.type].minimum,"aria-valuemax":W[e.type].maximum,"aria-valuetext":e.value?z6(e,I):A.empty,"aria-label":A[e.type],"aria-disabled":t,spellCheck:!i&&void 0,autoCapitalize:i?"off":void 0,autoCorrect:i?"off":void 0,[parseInt(g.version,10)>=17?"enterKeyHint":"enterkeyhint"]:i?"next":void 0,children:e.value||e.placeholder,onInput:H,onPaste:$,onFocus:z(r),onDragOver:V,onMouseUp:F,inputMode:"letter"===e.contentType?"text":"numeric"},before:{children:e.startSeparator},after:{children:e.endSeparator}}}),[v.sections,z,$,V,H,B,F,t,n,q,A,I,W,P]),U=(0,rM.Z)(e=>{w(e.target.value)}),K=g.useMemo(()=>C?"":d.getV7HiddenInputValueFromSections(v.sections),[C,v.sections,d]);return g.useEffect(()=>{if(null==M.current)throw Error("MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`\nYou probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.\n\nIf you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:\n\n<DatePicker slots={{ textField: MyCustomTextField }} />\n\nLearn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element");c&&M.current&&M.current.getSectionContent(S.startIndex).focus()},[]),{interactions:E,returnedValue:{autoFocus:c,readOnly:n,focused:u??R,sectionListRef:T,onBlur:j,onClick:L,onFocus:Z,onInput:_,onPaste:N,enableAccessibleFieldDOMStructure:!0,elements:G,tabIndex:0===m?-1:0,contentEditable:q,value:K,onChange:U,areAllSectionsEmpty:C}}},HS=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),HC=(e,t,n)=>{let r=0,i=+!!n,o=[];for(let a=0;a<e.length;a+=1){let s=e[a],l=zG(s,n?"input-rtl":"input-ltr",t),u=`${s.startSeparator}${l}${s.endSeparator}`,c=HS(u).length,d=u.length,h=HS(l),p=i+(""===h?0:l.indexOf(h[0]))+s.startSeparator.length,f=p+h.length;o.push((0,W.Z)({},s,{start:r,end:r+c,startInInput:p,endInInput:f})),r+=c,i+=d}return o},Hk=e=>{let t=iL(),n=g.useRef(void 0),r=g.useRef(void 0),{forwardedProps:{onFocus:i,onClick:o,onPaste:a,onBlur:s,inputRef:l,placeholder:u},internalProps:{readOnly:c=!1,disabled:d=!1},parsedSelectedSections:h,activeSectionIndex:p,state:f,fieldValueManager:m,valueManager:v,applyCharacterEditing:y,resetCharacterQuery:b,updateSectionValue:x,updateValueFromValueStr:w,clearActiveSection:S,clearValue:C,setTempAndroidValueStr:k,setSelectedSections:M,getSectionsFromValue:T,areAllSectionsEmpty:A,localizedDigits:I}=e,P=g.useRef(null),R=(0,rC.Z)(l,P),O=g.useMemo(()=>HC(f.sections,I,t),[f.sections,I,t]),E=g.useMemo(()=>({syncSelectionToDOM:()=>{if(!P.current)return;if(null==h){P.current.scrollLeft&&(P.current.scrollLeft=0);return}if(P.current!==V$(document))return;let e=P.current.scrollTop;if("all"===h)P.current.select();else{let e=O[h],t="empty"===e.type?e.startInInput-e.startSeparator.length:e.startInInput,n="empty"===e.type?e.endInInput+e.endSeparator.length:e.endInInput;(t!==P.current.selectionStart||n!==P.current.selectionEnd)&&P.current===V$(document)&&P.current.setSelectionRange(t,n),clearTimeout(r.current),r.current=setTimeout(()=>{P.current&&P.current===V$(document)&&P.current.selectionStart===P.current.selectionEnd&&(P.current.selectionStart!==t||P.current.selectionEnd!==n)&&E.syncSelectionToDOM()})}P.current.scrollTop=e},getActiveSectionIndexFromDOM:()=>{let e=P.current.selectionStart??0,t=P.current.selectionEnd??0;if(0===e&&0===t)return null;let n=e<=O[0].startInInput?1:O.findIndex(t=>t.startInInput-t.startSeparator.length>e);return -1===n?O.length-1:n-1},focusField:(e=0)=>{V$(document)!==P.current&&(P.current?.focus(),M(e))},setSelectedSections:e=>M(e),isFieldFocused:()=>P.current===V$(document)}),[P,h,O,M]),D=()=>{let e;let t=P.current.selectionStart??0;M(-1===(e=t<=O[0].startInInput?1:t>=O[O.length-1].endInInput?1:O.findIndex(e=>e.startInInput-e.startSeparator.length>t))?O.length-1:e-1)},L=(0,rM.Z)((...e)=>{i?.(...e);let t=P.current;clearTimeout(n.current),n.current=setTimeout(()=>{t&&t===P.current&&null==p&&(t.value.length&&Number(t.selectionEnd)-Number(t.selectionStart)===t.value.length?M("all"):D())})}),_=(0,rM.Z)((e,...t)=>{!e.isDefaultPrevented()&&(o?.(e,...t),D())}),N=(0,rM.Z)(e=>{if(a?.(e),e.preventDefault(),c||d)return;let t=e.clipboardData.getData("text");if("number"==typeof h){let e=f.sections[h],n=/^[a-zA-Z]+$/.test(t),r=/^[0-9]+$/.test(t),i=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(t);if("letter"===e.contentType&&n||"digit"===e.contentType&&r||"digit-with-letter"===e.contentType&&i){b(),x({activeSection:e,newSectionValue:t,shouldGoToNextSection:!0});return}if(n||r)return}b(),w(t)}),Z=(0,rM.Z)((...e)=>{s?.(...e),M(null)}),j=(0,rM.Z)(e=>{let n;if(c)return;let r=e.target.value;if(""===r){b(),C();return}let i=e.nativeEvent.data,o=i&&i.length>1,a=o?i:r,s=HS(a);if("all"===h&&M(p),null==p||o){w(o?i:s);return}if("all"===h&&1===s.length)n=s;else{let e=HS(m.getV6InputValueFromSections(O,I,t)),r=-1,i=-1;for(let t=0;t<e.length;t+=1)-1===r&&e[t]!==s[t]&&(r=t),-1===i&&e[e.length-t-1]!==s[s.length-t-1]&&(i=t);let o=O[p];if(r<o.start||e.length-i-1>o.end)return;let a=s.length-e.length+o.end-HS(o.endSeparator||"").length;n=s.slice(o.start+HS(o.startSeparator||"").length,a)}if(0===n.length){z5()&&k(a),b(),S();return}y({keyPressed:n,sectionIndex:p})}),B=g.useMemo(()=>void 0!==u?u:m.getV6InputValueFromSections(T(v.emptyValue),I,t),[u,m,T,v.emptyValue,I,t]),F=g.useMemo(()=>f.tempValueStrAndroid??m.getV6InputValueFromSections(f.sections,I,t),[f.sections,m,f.tempValueStrAndroid,I,t]);g.useEffect(()=>(P.current&&P.current===V$(document)&&M("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);let z=g.useMemo(()=>null==p||"letter"===f.sections[p].contentType?"text":"numeric",[p,f.sections]);return{interactions:E,returnedValue:{readOnly:c,onBlur:Z,onClick:_,onFocus:L,onPaste:N,inputRef:R,enableAccessibleFieldDOMStructure:!1,placeholder:B,inputMode:z,autoComplete:"off",value:!(P.current&&P.current===V$(document))&&A?"":F,onChange:j}}},HM=e=>{let t=BS(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:i,enableAccessibleFieldDOMStructure:o=!1,disabled:a=!1,readOnly:s=!1},forwardedProps:{onKeyDown:l,error:u,clearable:c,onClear:d},fieldValueManager:h,valueManager:p,validator:f}=e,m=iL(),v=Hy(e),{state:y,activeSectionIndex:b,parsedSelectedSections:x,setSelectedSections:w,clearValue:S,clearActiveSection:C,updateSectionValue:k,setTempAndroidValueStr:M,sectionsValueBoundaries:T,localizedDigits:A,timezone:I}=v,P=Hx({sections:y.sections,updateSectionValue:k,sectionsValueBoundaries:T,localizedDigits:A,setTempAndroidValueStr:M,timezone:I}),{resetCharacterQuery:R}=P,O=p.areValuesEqual(t,y.value,p.emptyValue),E=o?Hw:Hk,D=g.useMemo(()=>z3(y.sections,m&&!o),[y.sections,m,o]),{returnedValue:L,interactions:_}=E((0,W.Z)({},e,v,P,{areAllSectionsEmpty:O,sectionOrder:D})),N=(0,rM.Z)(e=>{if(l?.(e),!a)switch(!0){case(e.ctrlKey||e.metaKey)&&"A"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey:e.preventDefault(),w("all");break;case"ArrowRight"===e.key:if(e.preventDefault(),null==x)w(D.startIndex);else if("all"===x)w(D.endIndex);else{let e=D.neighbors[x].rightIndex;null!==e&&w(e)}break;case"ArrowLeft"===e.key:if(e.preventDefault(),null==x)w(D.endIndex);else if("all"===x)w(D.startIndex);else{let e=D.neighbors[x].leftIndex;null!==e&&w(e)}break;case"Delete"===e.key:if(e.preventDefault(),s)break;null==x||"all"===x?S():C(),R();break;case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e.key):{if(e.preventDefault(),s||null==b)break;"all"===x&&w(b);let n=y.sections[b],r=h.getActiveDateManager(t,y,n),o=zq(t,I,n,e.key,T,A,r.date,{minutesStep:i});k({activeSection:n,newSectionValue:o,shouldGoToNextSection:!1})}}});(0,rT.Z)(()=>{_.syncSelectionToDOM()});let{hasValidationError:Z}=V_({props:n,validator:f,timezone:I,value:y.value,onError:n.onError}),j=g.useMemo(()=>void 0!==u?u:Z,[Z,u]);g.useEffect(()=>{j||null!=b||R()},[y.referenceValue,b,j]),g.useEffect(()=>{null!=y.tempValueStrAndroid&&null!=b&&(R(),C())},[y.sections]),g.useImperativeHandle(r,()=>({getSections:()=>y.sections,getActiveSectionIndex:_.getActiveSectionIndexFromDOM,setSelectedSections:_.setSelectedSections,focusField:_.focusField,isFieldFocused:_.isFieldFocused}));let B={onKeyDown:N,onClear:(0,rM.Z)((e,...t)=>{e.preventDefault(),d?.(e,...t),S(),_.isFieldFocused()?w(D.startIndex):_.focusField(0)}),error:j,clearable:!!(c&&!O&&!s&&!a)};return(0,W.Z)({},e.forwardedProps,B,{disabled:a,readOnly:s},L)},HT=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],HA=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],HI=["minDateTime","maxDateTime"];[...HT,...HA,...HI];let HP=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],HR=(e,t)=>g.useMemo(()=>{let n=(0,W.Z)({},e),r={},i=e=>{n.hasOwnProperty(e)&&(r[e]=n[e],delete n[e])};return HP.forEach(i),"date"===t?HT.forEach(i):"time"===t?HA.forEach(i):"date-time"===t&&(HT.forEach(i),HA.forEach(i),HI.forEach(i)),{forwardedProps:n,internalProps:r}},[e,t]),HO=e=>{let t=BS(),n=BC(),r=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.keyboardDateTime12h:t.formats.keyboardDateTime24h;return(0,W.Z)({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??r,disableIgnoringDatePartForTimeValidation:!!(e.minDateTime||e.maxDateTime),minDate:BA(t,e.minDateTime??e.minDate,n.minDate),maxDate:BA(t,e.maxDateTime??e.maxDate,n.maxDate),minTime:e.minDateTime??e.minTime,maxTime:e.maxDateTime??e.maxTime})},HE=e=>{let{forwardedProps:t,internalProps:n}=HR(HO(e),"date-time");return HM({forwardedProps:t,internalProps:n,valueManager:z7,fieldValueManager:$e,validator:Hu,valueType:"date-time"})};function HD(e){return(0,A.ZP)("MuiInputAdornment",e)}let HL=(0,T.Z)("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]),H_=e=>{let{classes:t,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:a}=e,s={root:["root",n&&"disablePointerEvents",i&&`position${(0,w.Z)(i)}`,a,r&&"hiddenLabel",o&&`size${(0,w.Z)(o)}`]};return(0,y.Z)(s,HD,t)},HN=(0,S.ZP)("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`position${(0,w.Z)(n.position)}`],!0===n.disablePointerEvents&&t.disablePointerEvents,t[n.variant]]}})((0,C.Z)(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${HL.positionStart}&:not(.${HL.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),HZ=g.forwardRef(function(e,t){let n=(0,M.i)({props:e,name:"MuiInputAdornment"}),{children:r,className:i,component:o="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:u,variant:c,...d}=n,h=r_()||{},p=c;c&&h.variant,h&&!p&&(p=h.variant);let m={...n,hiddenLabel:h.hiddenLabel,size:h.size,disablePointerEvents:a,position:u,variant:p},y=H_(m);return(0,f.jsx)(rL.Provider,{value:null,children:(0,f.jsx)(HN,{as:o,ownerState:m,className:(0,v.Z)(y.root,i),ref:t,...d,children:"string"!=typeof r||l?(0,f.jsxs)(g.Fragment,{children:["start"===u?s||(s=(0,f.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,r]}):(0,f.jsx)(c1,{color:"textSecondary",children:r})})})}),Hj=["clearable","onClear","InputProps","sx","slots","slotProps"],HB=["ownerState"],HF=e=>{let t=Ft(),{clearable:n,onClear:r,InputProps:i,sx:o,slots:a,slotProps:s}=e,l=H(e,Hj),u=a?.clearButton??rx,c=H(iF({elementType:u,externalSlotProps:s?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),HB),d=a?.clearIcon??Fe,h=iF({elementType:d,externalSlotProps:s?.clearIcon,ownerState:{}});return(0,W.Z)({},l,{InputProps:(0,W.Z)({},i,{endAdornment:(0,f.jsxs)(g.Fragment,{children:[n&&(0,f.jsx)(HZ,{position:"end",sx:{marginRight:i?.endAdornment?-1:-1.5},children:(0,f.jsx)(u,(0,W.Z)({},c,{onClick:r,children:(0,f.jsx)(d,(0,W.Z)({fontSize:"small"},h))}))}),i?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(o)?o:[o]]})};function Hz(e){return(0,A.ZP)("MuiPickersTextField",e)}function H$(e){return(0,A.ZP)("MuiPickersInputBase",e)}(0,T.Z)("MuiPickersTextField",["root","focused","disabled","error","required"]);let HV=(0,T.Z)("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function HH(e){return(0,A.ZP)("MuiPickersOutlinedInput",e)}let HW=(0,W.Z)({},HV,(0,T.Z)("MuiPickersOutlinedInput",["root","notchedOutline","input"])),Hq=["children","className","label","notched","shrink"],HG=(0,S.ZP)("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),HU=(0,S.ZP)("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),HK=(0,S.ZP)("legend")(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function HY(e){let{className:t,label:n}=e,r=H(e,Hq),i=null!=n&&""!==n,o=(0,W.Z)({},e,{withLabel:i});return(0,f.jsx)(HG,(0,W.Z)({"aria-hidden":!0,className:t},r,{ownerState:o,children:(0,f.jsx)(HK,{ownerState:o,children:i?(0,f.jsx)(HU,{children:n}):(0,f.jsx)(HU,{className:"notranslate",children:"​"})})}))}var HX=n(3150);function HJ(e){return(0,A.ZP)("MuiPickersSectionList",e)}let HQ=(0,T.Z)("MuiPickersSectionList",["root","section","sectionContent"]),H0=["slots","slotProps","elements","sectionListRef"],H1=(0,S.ZP)("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),H2=(0,S.ZP)("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),H5=(0,S.ZP)("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),H3=(0,S.ZP)("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),H4=e=>{let{classes:t}=e;return(0,y.Z)({root:["root"],section:["section"],sectionContent:["sectionContent"]},HJ,t)};function H6(e){let{slots:t,slotProps:n,element:r,classes:i}=e,o=t?.section??H2,a=iF({elementType:o,externalSlotProps:n?.section,externalForwardedProps:r.container,className:i.section,ownerState:{}}),s=t?.sectionContent??H3,l=iF({elementType:s,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:i.sectionContent,ownerState:{}}),u=t?.sectionSeparator??H5,c=iF({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),d=iF({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return(0,f.jsxs)(o,(0,W.Z)({},a,{children:[(0,f.jsx)(u,(0,W.Z)({},c)),(0,f.jsx)(s,(0,W.Z)({},l)),(0,f.jsx)(u,(0,W.Z)({},d))]}))}let H8=g.forwardRef(function(e,t){let n=Bf({props:e,name:"MuiPickersSectionList"}),{slots:r,slotProps:i,elements:o,sectionListRef:a}=n,s=H(n,H0),l=H4(n),u=g.useRef(null),c=(0,rC.Z)(t,u),d=e=>{if(!u.current)throw Error(`MUI X: Cannot call sectionListRef.${e} before the mount of the component.`);return u.current};g.useImperativeHandle(a,()=>({getRoot:()=>d("getRoot"),getSectionContainer:e=>d("getSectionContainer").querySelector(`.${HQ.section}[data-sectionindex="${e}"]`),getSectionContent:e=>d("getSectionContent").querySelector(`.${HQ.section}[data-sectionindex="${e}"] .${HQ.sectionContent}`),getSectionIndexFromDOMElement(e){let t=d("getSectionIndexFromDOMElement");if(null==e||!t.contains(e))return null;let n=null;return(e.classList.contains(HQ.section)?n=e:e.classList.contains(HQ.sectionContent)&&(n=e.parentElement),null==n)?null:Number(n.dataset.sectionindex)}}));let h=r?.root??H1,p=iF({elementType:h,externalSlotProps:i?.root,externalForwardedProps:s,additionalProps:{ref:c,suppressContentEditableWarning:!0},className:l.root,ownerState:{}});return(0,f.jsx)(h,(0,W.Z)({},p,{children:p.contentEditable?o.map(({content:e,before:t,after:n})=>`${t.children}${e.children}${n.children}`).join(""):(0,f.jsx)(g.Fragment,{children:o.map((e,t)=>(0,f.jsx)(H6,{slots:r,slotProps:i,element:e,classes:l},t))})}))}),H9=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],H7=e=>Math.round(1e5*e)/1e5,We=(0,S.ZP)("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>(0,W.Z)({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${H7(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),Wt=(0,S.ZP)(H1,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:e,focused:t,filled:n,label:r})=>!e&&!t&&!n&&null==r,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:"light"===e.palette.mode?.42:.5}}]})),Wn=(0,S.ZP)(H2,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(e,t)=>t.section})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),Wr=(0,S.ZP)(H3,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),Wi=(0,S.ZP)(H5,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),Wo=(0,S.ZP)("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})((0,W.Z)({},{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"})),Wa=e=>{let{focused:t,disabled:n,error:r,classes:i,fullWidth:o,readOnly:a,color:s,size:l,endAdornment:u,startAdornment:c}=e,d={root:["root",t&&!n&&"focused",n&&"disabled",a&&"readOnly",r&&"error",o&&"fullWidth",`color${(0,HX.Z)(s)}`,"small"===l&&"inputSizeSmall",!!c&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return(0,y.Z)(d,H$,i)},Ws=g.forwardRef(function(e,t){let n=Bf({props:e,name:"MuiPickersInputBase"}),{elements:r,areAllSectionsEmpty:i,value:o,onChange:a,id:s,endAdornment:l,startAdornment:u,renderSuffix:c,slots:d,slotProps:h,contentEditable:p,tabIndex:m,onInput:v,onPaste:y,onKeyDown:b,name:x,readOnly:w,inputProps:S,inputRef:C,sectionListRef:k}=n,M=H(n,H9),T=g.useRef(null),A=(0,rC.Z)(t,T),I=(0,rC.Z)(S?.ref,C),P=iL(),R=r_();if(!R)throw Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");g.useEffect(()=>{R&&R.setAdornedStart(!!u)},[R,u]),g.useEffect(()=>{R&&(i?R.onEmpty():R.onFilled())},[R,i]);let O=(0,W.Z)({},n,R,{isRtl:P}),E=Wa(O),D=d?.root||We,L=iF({elementType:D,externalSlotProps:h?.root,externalForwardedProps:M,additionalProps:{"aria-invalid":R.error,ref:A},className:E.root,ownerState:O}),_=d?.input||Wt;return(0,f.jsxs)(D,(0,W.Z)({},L,{children:[u,(0,f.jsx)(H8,{sectionListRef:k,elements:r,contentEditable:p,tabIndex:m,className:E.sectionsContainer,onFocus:e=>{if(R.disabled){e.stopPropagation();return}R.onFocus?.(e)},onBlur:R.onBlur,onInput:v,onPaste:y,onKeyDown:b,slots:{root:_,section:Wn,sectionContent:Wr,sectionSeparator:Wi},slotProps:{root:{ownerState:O},sectionContent:{className:HV.sectionContent},sectionSeparator:({position:e})=>({className:"before"===e?HV.sectionBefore:HV.sectionAfter})}}),l,c?c((0,W.Z)({},R)):null,(0,f.jsx)(Wo,(0,W.Z)({name:x,className:E.input,value:o,onChange:a,id:s,"aria-hidden":"true",tabIndex:-1,readOnly:w,required:R.required,disabled:R.disabled},S,{ref:I}))]}))}),Wl=["label","autoFocus","ownerState","notched"],Wu=(0,S.ZP)(We,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${HW.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${HW.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${HW.focused} .${HW.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${HW.disabled}`]:{[`& .${HW.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${HW.error} .${HW.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t]?.main??!1).map(t=>({props:{color:t},style:{[`&.${HW.focused}:not(.${HW.error}) .${HW.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}}))}}),Wc=(0,S.ZP)(Wt,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),Wd=e=>{let{classes:t}=e,n=(0,y.Z)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},HH,t);return(0,W.Z)({},t,n)},Wh=g.forwardRef(function(e,t){let n=Bf({props:e,name:"MuiPickersOutlinedInput"}),{label:r,ownerState:i,notched:o}=n,a=H(n,Wl),s=r_(),l=(0,W.Z)({},n,i,s,{color:s?.color||"primary"}),u=Wd(l);return(0,f.jsx)(Ws,(0,W.Z)({slots:{root:Wu,input:Wc},renderSuffix:e=>(0,f.jsx)(HY,{shrink:!!(o||e.adornedStart||e.focused||e.filled),notched:!!(o||e.adornedStart||e.focused||e.filled),className:u.notchedOutline,label:null!=r&&""!==r&&s?.required?(0,f.jsxs)(g.Fragment,{children:[r," ","*"]}):r,ownerState:l})},a,{label:r,classes:u,ref:t}))});function Wp(e){return(0,A.ZP)("MuiPickersFilledInput",e)}Wh.muiName="Input";let Wf=(0,W.Z)({},HV,(0,T.Z)("MuiPickersFilledInput",["root","underline","input"])),Wg=["label","autoFocus","disableUnderline","ownerState"],Wm=(0,S.ZP)(We,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,rn.x9)(e)&&"disableUnderline"!==e})(({theme:e})=>{let t="light"===e.palette.mode,n=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n}},[`&.${Wf.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n},[`&.${Wf.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{color:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Wf.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Wf.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)"}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Wf.disabled}, .${Wf.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Wf.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:12}},{props:({endAdornment:e})=>!!e,style:{paddingRight:12}}]}}),Wv=(0,S.ZP)(Wt,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:0}},{props:({endAdornment:e})=>!!e,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),Wy=e=>{let{classes:t,disableUnderline:n}=e,r=(0,y.Z)({root:["root",!n&&"underline"],input:["input"]},Wp,t);return(0,W.Z)({},t,r)},Wb=g.forwardRef(function(e,t){let n=Bf({props:e,name:"MuiPickersFilledInput"}),{label:r,disableUnderline:i=!1,ownerState:o}=n,a=H(n,Wg),s=r_(),l=Wy((0,W.Z)({},n,o,s,{color:s?.color||"primary"}));return(0,f.jsx)(Ws,(0,W.Z)({slots:{root:Wm,input:Wv},slotProps:{root:{disableUnderline:i}}},a,{label:r,classes:l,ref:t}))});function Wx(e){return(0,A.ZP)("MuiPickersFilledInput",e)}Wb.muiName="Input";let Ww=(0,W.Z)({},HV,(0,T.Z)("MuiPickersInput",["root","input"])),WS=["label","autoFocus","disableUnderline","ownerState"],WC=(0,S.ZP)(We,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{color:t},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Ww.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Ww.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Ww.disabled}, .${Ww.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${Ww.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),Wk=e=>{let{classes:t,disableUnderline:n}=e,r=(0,y.Z)({root:["root",!n&&"underline"],input:["input"]},Wx,t);return(0,W.Z)({},t,r)},WM=g.forwardRef(function(e,t){let n=Bf({props:e,name:"MuiPickersInput"}),{label:r,disableUnderline:i=!1,ownerState:o}=n,a=H(n,WS),s=r_(),l=Wk((0,W.Z)({},n,o,s,{disableUnderline:i,color:s?.color||"primary"}));return(0,f.jsx)(Ws,(0,W.Z)({slots:{root:WC}},a,{label:r,classes:l,ref:t}))});WM.muiName="Input";let WT=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],WA={standard:WM,filled:Wb,outlined:Wh},WI=(0,S.ZP)(iM,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),WP=e=>{let{focused:t,disabled:n,classes:r,required:i}=e;return(0,y.Z)({root:["root",t&&!n&&"focused",n&&"disabled",i&&"required"]},Hz,r)},WR=g.forwardRef(function(e,t){let n=Bf({props:e,name:"MuiPickersTextField"}),{onFocus:r,onBlur:i,className:o,color:a="primary",disabled:s=!1,error:l=!1,variant:u="outlined",required:c=!1,InputProps:d,inputProps:h,inputRef:p,sectionListRef:m,elements:y,areAllSectionsEmpty:b,onClick:x,onKeyDown:w,onKeyUp:S,onPaste:C,onInput:k,endAdornment:M,startAdornment:T,tabIndex:A,contentEditable:I,focused:P,value:R,onChange:O,fullWidth:E,id:D,name:L,helperText:_,FormHelperTextProps:N,label:Z,InputLabelProps:j}=n,B=H(n,WT),F=g.useRef(null),z=(0,rC.Z)(t,F),$=(0,rw.Z)(D),V=_&&$?`${$}-helper-text`:void 0,q=Z&&$?`${$}-label`:void 0,G=(0,W.Z)({},n,{color:a,disabled:s,error:l,focused:P,required:c,variant:u}),U=WP(G),K=WA[u];return(0,f.jsxs)(WI,(0,W.Z)({className:(0,v.Z)(U.root,o),ref:z,focused:P,onFocus:r,onBlur:i,disabled:s,variant:u,error:l,color:a,fullWidth:E,required:c,ownerState:G},B,{children:[(0,f.jsx)(ix,(0,W.Z)({htmlFor:$,id:q},j,{children:Z})),(0,f.jsx)(K,(0,W.Z)({elements:y,areAllSectionsEmpty:b,onClick:x,onKeyDown:w,onKeyUp:S,onInput:k,onPaste:C,endAdornment:M,startAdornment:T,tabIndex:A,contentEditable:I,value:R,onChange:O,id:$,fullWidth:E,inputProps:h,inputRef:p,sectionListRef:m,label:Z,name:L,role:"group","aria-labelledby":q,"aria-describedby":V,"aria-live":V?"polite":void 0},d)),_&&(0,f.jsx)(iR,(0,W.Z)({id:V},N,{children:_}))]}))}),WO=["enableAccessibleFieldDOMStructure"],WE=["InputProps","readOnly"],WD=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],WL=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=H(e,WO);if(t){let{InputProps:e,readOnly:t}=n,r=H(n,WE);return(0,W.Z)({},r,{InputProps:(0,W.Z)({},e??{},{readOnly:t})})}let{onPaste:r,onKeyDown:i,inputMode:o,readOnly:a,InputProps:s,inputProps:l,inputRef:u}=n,c=H(n,WD);return(0,W.Z)({},c,{InputProps:(0,W.Z)({},s??{},{readOnly:a}),inputProps:(0,W.Z)({},l??{},{inputMode:o,onPaste:r,onKeyDown:i,ref:u})})},W_=["slots","slotProps","InputProps","inputProps"],WN=g.forwardRef(function(e,t){let n=Bf({props:e,name:"MuiDateTimeField"}),{slots:r,slotProps:i,InputProps:o,inputProps:a}=n,s=H(n,W_),l=r?.textField??(e.enableAccessibleFieldDOMStructure?WR:aC),u=iF({elementType:l,externalSlotProps:i?.textField,externalForwardedProps:s,ownerState:n,additionalProps:{ref:t}});u.inputProps=(0,W.Z)({},a,u.inputProps),u.InputProps=(0,W.Z)({},o,u.InputProps);let c=WL(HE(u)),d=HF((0,W.Z)({},c,{slots:r,slotProps:i}));return(0,f.jsx)(l,(0,W.Z)({},d))});var WZ=n(9435),Wj=n(2791),WB=n(4336),WF=n(2694),Wz=n(5154),W$=n(9489),WV=n(6341),WH=n(3189),WW=n(5918),Wq=n(9880),WG=n(8006),WU=n(6332),WK=n(1721),WY=n(1267),WX=n(8904),WJ=n(7785),WQ=n(8364),W0=n(8340),W1=n(506),W2=n(4265),W5=n(6635),W3=n(1275),W4=n(4107),W6=n(436),W8=n(7912),W9=n(9250),W7=n(3303),qe=n(8374),qt=n(3743),qn=n(8070),qr=n(282),qi=n(3200),qo=n(6292),qa=n(1136),qs=n(3518),ql=n(4138),qu=n(8140),qc=n(3033),qd=n(7),qh=n(4575),qp=n(5149),qf=n(8874),qg=n(2511),qm=n(4257);let qv={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},qy={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class qb{constructor(e){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=qv,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=e=>void 0===e?new Date:null===e?null:new Date(e),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=e=>e,this.toJsDate=e=>e,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=e=>e.match(/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,this.longFormatters[t])(e,this.locale.formatLong):e}).join(""),this.formatNumber=e=>e,this.getDayOfWeek=e=>e.getDay()+1;let{locale:t,formats:n,longFormatters:r,lib:i}=e;this.locale=t,this.formats=(0,W.Z)({},qy,n),this.longFormatters=r,this.lib=i||"date-fns"}}class qx extends qb{constructor({locale:e,formats:t}={}){super({locale:e??qm._,formats:t,longFormatters:WG.G}),this.parse=(e,t)=>""===e?null:(0,qn.Qc)(e,t,new Date,{locale:this.locale}),this.isValid=e=>null!=e&&(0,qt.J)(e),this.format=(e,t)=>this.formatByString(e,this.formats[t]),this.formatByString=(e,t)=>(0,WU.WU)(e,t,{locale:this.locale}),this.isEqual=(e,t)=>null===e&&null===t||null!==e&&null!==t&&(0,W6.X)(e,t),this.isSameYear=(e,t)=>(0,W9.F)(e,t),this.isSameMonth=(e,t)=>(0,W7.x)(e,t),this.isSameDay=(e,t)=>(0,W8.K)(e,t),this.isSameHour=(e,t)=>(0,qe.f)(e,t),this.isAfter=(e,t)=>(0,W3.A)(e,t),this.isAfterYear=(e,t)=>(0,W3.A)(e,(0,Wq.w)(t)),this.isAfterDay=(e,t)=>(0,W3.A)(e,(0,WH.i)(t)),this.isBefore=(e,t)=>(0,W4.R)(e,t),this.isBeforeYear=(e,t)=>(0,W4.R)(e,this.startOfYear(t)),this.isBeforeDay=(e,t)=>(0,W4.R)(e,this.startOfDay(t)),this.isWithinRange=(e,[t,n])=>(0,qg._)(e,{start:t,end:n}),this.startOfYear=e=>(0,qf.e)(e),this.startOfMonth=e=>(0,qd.N)(e),this.startOfWeek=e=>(0,qp.z)(e,{locale:this.locale}),this.startOfDay=e=>(0,qc.b)(e),this.endOfYear=e=>(0,Wq.w)(e),this.endOfMonth=e=>(0,qh.V)(e),this.endOfWeek=e=>(0,WW.v)(e,{locale:this.locale}),this.endOfDay=e=>(0,WH.i)(e),this.addYears=(e,t)=>(0,WV.B)(e,t),this.addMonths=(e,t)=>(0,W$.z)(e,t),this.addWeeks=(e,t)=>(0,Wz.j)(e,t),this.addDays=(e,t)=>(0,WZ.E)(e,t),this.addHours=(e,t)=>(0,WF.T)(e,t),this.addMinutes=(e,t)=>(0,WB.m)(e,t),this.addSeconds=(e,t)=>(0,Wj.v)(e,t),this.getYear=e=>(0,W5.S)(e),this.getMonth=e=>(0,WQ.j)(e),this.getDate=e=>(0,WK._)(e),this.getHours=e=>(0,WX.p)(e),this.getMinutes=e=>(0,WJ.q)(e),this.getSeconds=e=>(0,W0.C)(e),this.getMilliseconds=e=>(0,W1.p)(e),this.setYear=(e,t)=>(0,qu.M)(e,t),this.setMonth=(e,t)=>(0,qa.q)(e,t),this.setDate=(e,t)=>(0,qr.G)(e,t),this.setHours=(e,t)=>(0,qi.B)(e,t),this.setMinutes=(e,t)=>(0,qo.H)(e,t),this.setSeconds=(e,t)=>(0,qs.O)(e,t),this.setMilliseconds=(e,t)=>(0,ql.I)(e,t),this.getDaysInMonth=e=>(0,WY.N)(e),this.getWeekArray=e=>{let t=this.startOfWeek(this.startOfMonth(e)),n=this.endOfWeek(this.endOfMonth(e)),r=0,i=t,o=[];for(;this.isBefore(i,n);){let e=Math.floor(r/7);o[e]=o[e]||[],o[e].push(i),i=this.addDays(i,1),r+=1}return o},this.getWeekNumber=e=>(0,W2.Q)(e,{locale:this.locale}),this.getYearRange=([e,t])=>{let n=this.startOfYear(e),r=this.endOfYear(t),i=[],o=n;for(;this.isBefore(o,r);)i.push(o),o=this.addYears(o,1);return i}}}let qw="yyyy-MM-dd HH:mm:ss";function qS(e,t){return e?Bd(e)?e.pastDuration:function(e,t,n){let r=EZ(e.start,t,n),i=EZ(e.end,t,n);return`${r} - ${i}`}(e,qw,t):"Custom Time Range"}let qC=({initialTimeRange:e,onChange:t,onCancel:n})=>{let{formatWithUserTimeZone:r}=EV(),[i,o]=(0,g.useState)(e),[a,s]=(0,g.useState)({start:r(e.start,qw),end:r(e.end,qw)}),[l,u]=(0,g.useState)(!0),c=(e,t)=>{let n="string"==typeof e,i=n?e:r(e,qw);s(e=>({...e,[t]:i})),n||o(n=>({...n,[t]:e}))},d=e=>{c(e,"start")},h=e=>{c(e,"end")},p=()=>{var e,t;let n={start:new Date(a.start),end:new Date(a.end)};if(e=n.start,t=n.end,(0,E_.isValid)(e)&&(0,E_.isValid)(t)?!!(0,E_.isBefore)(e,t)||(console.error("End Time is before Start Time"),!1):(console.error("Invalid Date"),!1))return o(n),n},m=()=>{let e=p();e&&t(e)};return(0,f.jsx)(Bv,{dateAdapter:qx,children:(0,f.jsxs)(rf,{spacing:2,sx:e=>({padding:e.spacing(1,0,2)}),children:[l&&(0,f.jsxs)(tU,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,f.jsx)(c1,{variant:"h3",padding:1,paddingLeft:2,children:"Select Start Time"}),(0,f.jsx)(Hc,{displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:e.start,onChange:e=>{null!==e&&d(e)},onAccept:()=>{u(!1)}})]}),!l&&(0,f.jsxs)(tU,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,f.jsx)(c1,{variant:"h3",padding:1,paddingLeft:2,children:"Select End Time"}),(0,f.jsx)(Hc,{displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:e.end,minDateTime:i.start,onChange:e=>{null!==e&&h(e)},onAccept:e=>{null!==e&&(u(!0),h(e))}})]}),(0,f.jsxs)(rf,{direction:"row",alignItems:"center",gap:1,pl:1,pr:1,children:[(0,f.jsx)(vg.ErrorBoundary,{FallbackComponent:vf,children:(0,f.jsx)(WN,{label:"Start Time",value:new Date(a.start),onChange:e=>{e&&d(e)},onBlur:()=>p(),format:qw})}),(0,f.jsx)(vg.ErrorBoundary,{FallbackComponent:vf,children:(0,f.jsx)(WN,{label:"End Time",value:new Date(a.end),onChange:e=>{e&&h(e)},onBlur:()=>p(),format:qw})})]}),(0,f.jsxs)(rf,{direction:"row",sx:{padding:e=>e.spacing(0,1)},gap:1,children:[(0,f.jsx)(e_,{variant:"contained",onClick:()=>m(),fullWidth:!0,children:"Apply"}),(0,f.jsx)(e_,{variant:"outlined",onClick:()=>n(),fullWidth:!0,children:"Cancel"})]})]})})};function qk({value:e,timeOptions:t,onChange:n,height:r,showCustomTimeRange:i=!0}){let{timeZone:o}=EV(),a=(0,g.useRef)(),[s,l]=(0,g.useState)(!1),u=(0,g.useMemo)(()=>Bd(e)?function(e){let t=e.end??new Date;return{start:(0,E_.sub)(t,Bp(e.pastDuration)),end:t}}(e):e,[e]),c=(0,g.useMemo)(()=>{var t;return{value:t=Bd(e)?void 0:e,display:qS(t,o)}},[e,o]),[d,h]=(0,g.useState)(!1);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(oU,{anchorEl:a.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},open:s,onClose:()=>l(!1),sx:e=>({padding:e.spacing(2)}),children:(0,f.jsx)(qC,{initialTimeRange:u,onChange:e=>{n(e),l(!1),h(!1)},onCancel:()=>l(!1)})}),(0,f.jsx)(tU,{ref:a,children:(0,f.jsxs)(ay,{open:d,value:qS(e,o),onClick:()=>h(!d),IconComponent:Bc.default,inputProps:{"aria-label":`Select time range. Currently set to ${e}`},sx:{".MuiSelect-icon":{marginTop:"1px",transform:"none"},".MuiSelect-select.MuiSelect-outlined.MuiInputBase-input":{paddingRight:"36px"},".MuiSelect-select":r?{lineHeight:r,paddingY:0}:{}},children:[t.map((e,t)=>(0,f.jsx)(d3,{value:qS(e.value,o),onClick:()=>{n(e.value)},children:e.display},t)),i&&(0,f.jsx)(d3,{value:qS(c.value,o),onClick:()=>l(!0),children:c.display})]})})]})}let qM=(0,S.ZP)(e_)(({theme:e})=>({padding:e.spacing(.5),minWidth:"auto"})),qT=(0,g.forwardRef)(function(e,t){return(0,f.jsx)(qM,{ref:t,variant:"outlined",color:"secondary",...e})});var qA=n(5418);let qI=Object.entries(eZ.Bl).map(([e,t])=>({id:e,...t})).filter(e=>!e.disableSelectorOption),qP=[{id:"default",label:"Default",decimalPlaces:void 0},{id:"0",label:"0",decimalPlaces:0},{id:"1",label:"1",decimalPlaces:1},{id:"2",label:"2",decimalPlaces:2},{id:"3",label:"3",decimalPlaces:3},{id:"4",label:"4",decimalPlaces:4}];function qR({value:e,onChange:t,disabled:n=!1}){var r;let i=(0,eZ.__)(e),o=(0,eZ.Fp)(e),a=({decimalPlaces:n})=>{i&&t({...e,decimalPlaces:n})},s=eZ.Bl[e.unit];return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(gb,{label:"Short values",control:(0,f.jsx)(Dc,{checked:!!o&&(0,qA.lk)(e.shortValues),onChange:(n,r)=>{o&&t({...e,shortValues:r})},disabled:!o})}),(0,f.jsx)(gb,{label:"Unit",control:(0,f.jsx)(g5,{value:{id:e.unit,...s},options:qI,groupBy:e=>e.group,onChange:(e,n)=>{t({unit:n.id})},disableClearable:!0,disabled:n})}),(0,f.jsx)(gb,{label:"Decimals",control:(0,f.jsx)(g5,{value:(r=e.decimalPlaces,qP.find(e=>e.decimalPlaces===r)),options:qP,getOptionLabel:e=>e.label,onChange:(e,t)=>a(t),disabled:!i,disableClearable:!0})})]})}function qO({name:e,height:t}){return(0,f.jsx)(tU,{style:{maxWidth:t,top:`calc(${t}px / 2)`},sx:{display:"inline-block",position:"absolute",transform:"translateX(-50%) rotate(-90deg)",transformOrigin:"top",textAlign:"center",zIndex:1},children:(0,f.jsx)(c1,{variant:"body1","aria-label":"y axis label",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})}let qE=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=function e(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t){if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=" "),i+=r);else for(n in t)t[n]&&(i&&(i+=" "),i+=n)}return i}(e))&&(r&&(r+=" "),r+=t);return r},qD={data:""},qL=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||qD,q_=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,qN=/\/\*[^]*?\*\/| +/g,qZ=/\n+/g,qj=(e,t)=>{let n="",r="",i="";for(let o in e){let a=e[o];"@"==o[0]?"i"==o[1]?n=o+" "+a+";":r+="f"==o[1]?qj(a,o):o+"{"+qj(a,"k"==o[1]?"":t)+"}":"object"==typeof a?r+=qj(a,t?t.replace(/([^,])+/g,e=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):o):null!=a&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=qj.p?qj.p(o,a):o+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},qB={},qF=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+qF(e[n]);return t}return e},qz=(e,t,n,r,i)=>{var o;let a=qF(e),s=qB[a]||(qB[a]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(a));if(!qB[s]){let t=a!==e?e:(e=>{let t,n,r=[{}];for(;t=q_.exec(e.replace(qN,""));)t[4]?r.shift():t[3]?(n=t[3].replace(qZ," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(qZ," ").trim();return r[0]})(e);qB[s]=qj(i?{["@keyframes "+s]:t}:t,n?"":"."+s)}let l=n&&qB.g?qB.g:null;return n&&(qB.g=qB[s]),o=qB[s],l?t.data=t.data.replace(l,o):-1===t.data.indexOf(o)&&(t.data=r?o+t.data:t.data+o),s},q$=(e,t,n)=>e.reduce((e,r,i)=>{let o=t[i];if(o&&o.call){let e=o(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":qj(e,""):!1===e?"":e}return e+r+(null==o?"":o)},"");function qV(e){let t=this||{},n=e.call?e(t.p):e;return qz(n.unshift?n.raw?q$(n,[].slice.call(arguments,1),t.p):n.reduce((e,n)=>Object.assign(e,n&&n.call?n(t.p):n),{}):n,qL(t.target),t.g,t.o,t.k)}function qH(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qW(e,t,n){return t&&qH(e.prototype,t),n&&qH(e,n),e}function qq(){return(qq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function qG(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function qU(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function qK(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}qV.bind({g:1}),qV.bind({k:1});var qY=function(){return""},qX=m().createContext({enqueueSnackbar:qY,closeSnackbar:qY}),qJ="@media (max-width:599.95px)",qQ="@media (min-width:600px)",q0=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},q1=function(e){return""+q0(e.vertical)+q0(e.horizontal)},q2=function(e){return!!e||0===e},q5="unmounted",q3="exited",q4="entering",q6="entered",q8="exiting",q9=function(e){function t(t){n=e.call(this,t)||this;var n,r,i=t.appear;return n.appearStatus=null,t.in?i?(r=q3,n.appearStatus=q4):r=q6:r=t.unmountOnExit||t.mountOnEnter?q5:q3,n.state={status:r},n.nextCallback=null,n}qG(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===q5?{status:q3}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==q4&&n!==q6&&(t=q4):(n===q4||n===q6)&&(t=q8)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=e,n=e;return null!=e&&"number"!=typeof e&&"string"!=typeof e&&(n=e.exit,t=e.enter),{exit:n,enter:t}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===q4?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===q3&&this.setState({status:q5})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.getTimeouts();if(!e&&!n){this.safeSetState({status:q6},function(){t.props.onEntered&&t.props.onEntered(t.node,e)});return}this.props.onEnter&&this.props.onEnter(this.node,e),this.safeSetState({status:q4},function(){t.props.onEntering&&t.props.onEntering(t.node,e),t.onTransitionEnd(r.enter,function(){t.safeSetState({status:q6},function(){t.props.onEntered&&t.props.onEntered(t.node,e)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts();if(!t){this.safeSetState({status:q3},function(){e.props.onExited&&e.props.onExited(e.node)});return}this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:q8},function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:q3},function(){e.props.onExited&&e.props.onExited(e.node)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(){n&&(n=!1,t.nextCallback=null,e())},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=null==e&&!this.props.addEndListener;if(!this.node||n){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===q5)return null;var t=this.props;return(0,t.children)(e,qU(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},qW(t,[{key:"node",get:function(){var e,t=null===(e=this.props.nodeRef)||void 0===e?void 0:e.current;if(!t)throw Error("notistack - Custom snackbar is not refForwarding");return t}}]),t}(m().Component);function q7(){}function Ge(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function Gt(e,t){return(0,g.useMemo)(function(){return null==e&&null==t?null:function(n){Ge(e,n),Ge(t,n)}},[e,t])}function Gn(e){var t=e.timeout,n=e.style,r=void 0===n?{}:n,i=e.mode;return{duration:"object"==typeof t?t[i]||0:t,easing:r.transitionTimingFunction,delay:r.transitionDelay}}q9.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:q7,onEntering:q7,onEntered:q7,onExit:q7,onExiting:q7,onExited:q7};var Gr={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Gi=function(e){e.scrollTop=e.scrollTop},Go=function(e){return Math.round(e)+"ms"};function Ga(e,t){void 0===e&&(e=["all"]);var n=t||{},r=n.duration,i=void 0===r?300:r,o=n.easing,a=void 0===o?Gr.easeInOut:o,s=n.delay,l=void 0===s?0:s;return(Array.isArray(e)?e:[e]).map(function(e){return e+" "+("string"==typeof i?i:Go(i))+" "+a+" "+("string"==typeof l?l:Go(l))}).join(",")}function Gs(e){return(e&&e.ownerDocument||document).defaultView||window}function Gl(e,t){if(t){var n=function(e,t){var n,r=t.getBoundingClientRect(),i=Gs(t);if(t.fakeTransform)n=t.fakeTransform;else{var o=i.getComputedStyle(t);n=o.getPropertyValue("-webkit-transform")||o.getPropertyValue("transform")}var a=0,s=0;if(n&&"none"!==n&&"string"==typeof n){var l=n.split("(")[1].split(")")[0].split(",");a=parseInt(l[4],10),s=parseInt(l[5],10)}switch(e){case"left":return"translateX("+(i.innerWidth+a-r.left)+"px)";case"right":return"translateX(-"+(r.left+r.width-a)+"px)";case"up":return"translateY("+(i.innerHeight+s-r.top)+"px)";default:return"translateY(-"+(r.top+r.height-s)+"px)"}}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var Gu=(0,g.forwardRef)(function(e,t){var n=e.children,r=e.direction,i=void 0===r?"down":r,o=e.in,a=e.style,s=e.timeout,l=void 0===s?0:s,u=e.onEnter,c=e.onEntered,d=e.onExit,h=e.onExited,p=qU(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),f=(0,g.useRef)(null),m=Gt(n.ref,f),v=Gt(m,t),y=(0,g.useCallback)(function(){f.current&&Gl(i,f.current)},[i]);return(0,g.useEffect)(function(){if(!o&&"down"!==i&&"right"!==i){var e=function(e,t){var n;function r(){for(var r=this,i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(n),n=setTimeout(function(){e.apply(r,o)},t)}return void 0===t&&(t=166),r.clear=function(){clearTimeout(n)},r}(function(){f.current&&Gl(i,f.current)}),t=Gs(f.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}},[i,o]),(0,g.useEffect)(function(){o||y()},[o,y]),(0,g.createElement)(q9,Object.assign({appear:!0,nodeRef:f,onEnter:function(e,t){Gl(i,e),Gi(e),u&&u(e,t)},onEntered:c,onEntering:function(e){var t=(null==a?void 0:a.transitionTimingFunction)||Gr.easeOut,n=Gn({timeout:l,mode:"enter",style:qq({},a,{transitionTimingFunction:t})});e.style.webkitTransition=Ga("-webkit-transform",n),e.style.transition=Ga("transform",n),e.style.webkitTransform="none",e.style.transform="none"},onExit:function(e){var t=(null==a?void 0:a.transitionTimingFunction)||Gr.sharp,n=Gn({timeout:l,mode:"exit",style:qq({},a,{transitionTimingFunction:t})});e.style.webkitTransition=Ga("-webkit-transform",n),e.style.transition=Ga("transform",n),Gl(i,e),d&&d(e)},onExited:function(e){e.style.webkitTransition="",e.style.transition="",h&&h(e)},in:o,timeout:l},p),function(e,t){return(0,g.cloneElement)(n,qq({ref:v,style:qq({visibility:"exited"!==e||o?void 0:"hidden"},a,{},n.props.style)},t))})});Gu.displayName="Slide";var Gc=function(e){return m().createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},e))},Gd={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:m().createElement(function(){return m().createElement(Gc,null,m().createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41\n 10.59L10 14.17L17.59 6.58L19 8L10 17Z"}))},null),warning:m().createElement(function(){return m().createElement(Gc,null,m().createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},null),error:m().createElement(function(){return m().createElement(Gc,null,m().createElement("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,\n 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,\n 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"}))},null),info:m().createElement(function(){return m().createElement(Gc,null,m().createElement("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,\n 0 22,12A10,10 0 0,0 12,2Z"}))},null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:Gu,transitionDuration:{enter:225,exit:195}},Gh=function(e,t){var n=function(e){return"number"==typeof e||null===e};return n(e)?e:n(t)?t:Gd.autoHideDuration},Gp=function(e,t){var n=function(e,t){return t.some(function(t){return typeof e===t})};return n(e,["string","number"])?e:n(e,["object"])?qq({},Gd.transitionDuration,{},n(t,["object"])&&t,{},e):n(t,["string","number"])?t:n(t,["object"])?qq({},Gd.transitionDuration,{},t):Gd.transitionDuration};function Gf(e){return Object.entries(e).reduce(function(e,t){var n,r=t[0],i=t[1];return qq({},e,((n={})[r]=qV(i),n))},{})}var Gg="notistack-CollapseWrapper",Gm=Gf({root:{height:0},entered:{height:"auto"}}),Gv=(0,g.forwardRef)(function(e,t){var n=e.children,r=e.in,i=e.onExited,o=(0,g.useRef)(null),a=(0,g.useRef)(null),s=Gt(t,a),l=function(){return o.current?o.current.clientHeight:0};return(0,g.createElement)(q9,{in:r,unmountOnExit:!0,onEnter:function(e){e.style.height="0px"},onEntered:function(e){e.style.height="auto"},onEntering:function(e){var t=l(),n=Gn({timeout:175,mode:"enter"}),r=n.duration,i=n.easing;e.style.transitionDuration="string"==typeof r?r:r+"ms",e.style.height=t+"px",e.style.transitionTimingFunction=i||""},onExit:function(e){e.style.height=l()+"px"},onExited:i,onExiting:function(e){Gi(e);var t=Gn({timeout:175,mode:"exit"}),n=t.duration,r=t.easing;e.style.transitionDuration="string"==typeof n?n:n+"ms",e.style.height="0px",e.style.transitionTimingFunction=r||""},nodeRef:a,timeout:175},function(e,t){return(0,g.createElement)("div",Object.assign({ref:s,className:qE(Gm.root,"entered"===e&&Gm.entered),style:qq({pointerEvents:"all",overflow:"hidden",minHeight:"0px",transition:Ga("height")},"entered"===e&&{overflow:"visible"},{},"exited"===e&&!r&&{visibility:"hidden"})},t),(0,g.createElement)("div",{ref:o,className:Gg,style:{display:"flex",width:"100%"}},n))})});Gv.displayName="Collapse";var Gy={right:"left",left:"right",bottom:"up",top:"down"},Gb=function(e){void 0===e&&(e={});var t={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(e).filter(function(e){return!t[e]}).reduce(function(t,n){var r;return qq({},t,((r={})[n]=e[n],r))},{})},Gx=function(){};function Gw(e,t){return e.reduce(function(e,n){return null==n?e:function(){for(var r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=[].concat(i);t&&-1===a.indexOf(t)&&a.push(t),e.apply(this,a),n.apply(this,a)}},Gx)}var GS="undefined"!=typeof window?g.useLayoutEffect:g.useEffect;function GC(e){var t=(0,g.useRef)(e);return GS(function(){t.current=e}),(0,g.useCallback)(function(){return t.current.apply(void 0,arguments)},[])}var Gk=(0,g.forwardRef)(function(e,t){var n=e.children,r=e.className,i=e.autoHideDuration,o=e.disableWindowBlurListener,a=void 0!==o&&o,s=e.onClose,l=e.id,u=e.open,c=e.SnackbarProps,d=void 0===c?{}:c,h=(0,g.useRef)(),p=GC(function(){s&&s.apply(void 0,arguments)}),f=GC(function(e){s&&null!=e&&(h.current&&clearTimeout(h.current),h.current=setTimeout(function(){p(null,"timeout",l)},e))});(0,g.useEffect)(function(){return u&&f(i),function(){h.current&&clearTimeout(h.current)}},[u,i,f]);var m=function(){h.current&&clearTimeout(h.current)},v=(0,g.useCallback)(function(){null!=i&&f(.5*i)},[i,f]);return(0,g.useEffect)(function(){if(!a&&u)return window.addEventListener("focus",v),window.addEventListener("blur",m),function(){window.removeEventListener("focus",v),window.removeEventListener("blur",m)}},[a,v,u]),(0,g.createElement)("div",Object.assign({ref:t},d,{className:qE("notistack-Snackbar",r),onMouseEnter:function(e){d.onMouseEnter&&d.onMouseEnter(e),m()},onMouseLeave:function(e){d.onMouseLeave&&d.onMouseLeave(e),v()}}),n)});Gk.displayName="Snackbar";var GM=Gf({root:((l={display:"flex",flexWrap:"wrap",flexGrow:1})[qQ]={flexGrow:"initial",minWidth:"288px"},l)}),GT=(0,g.forwardRef)(function(e,t){var n=e.className,r=qU(e,["className"]);return m().createElement("div",Object.assign({ref:t,className:qE(GM.root,n)},r))});GT.displayName="SnackbarContent";var GA=Gf({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},lessPadding:{paddingLeft:"20px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),GI="notistack-snackbar",GP=(0,g.forwardRef)(function(e,t){var n=e.id,r=e.message,i=e.action,o=e.iconVariant,a=e.variant,s=e.hideIconVariant,l=e.style,u=e.className,c=o[a],d=i;return"function"==typeof d&&(d=d(n)),m().createElement(GT,{ref:t,role:"alert","aria-describedby":GI,style:l,className:qE("notistack-MuiContent","notistack-MuiContent-"+a,GA.root,GA[a],u,!s&&c&&GA.lessPadding)},m().createElement("div",{id:GI,className:GA.message},s?null:c,r),d&&m().createElement("div",{className:GA.action},d))});GP.displayName="MaterialDesignContent";var GR=(0,g.memo)(GP),GO=Gf({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),GE=function(e){var t,n=(0,g.useRef)(),r=(0,g.useState)(!0),i=r[0],o=r[1],a=Gw([e.snack.onClose,e.onClose]),s=(0,g.useCallback)(function(){n.current=setTimeout(function(){o(function(e){return!e})},125)},[]);(0,g.useEffect)(function(){return function(){n.current&&clearTimeout(n.current)}},[]);var l=e.snack,u=e.classes,c=e.Component,d=(0,g.useMemo)(function(){return Gb(u)},[u]),h=l.open,p=l.SnackbarProps,f=l.TransitionComponent,v=l.TransitionProps,y=l.transitionDuration,b=l.disableWindowBlurListener,x=l.content,w=qU(l,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),S=qq({direction:"center"!==(t=w.anchorOrigin).horizontal?Gy[t.horizontal]:Gy[t.vertical],timeout:y},v),C=x;"function"==typeof C&&(C=C(w.id,w.message));var k=["onEnter","onEntered","onExit","onExited"].reduce(function(t,n){var r;return qq({},t,((r={})[n]=Gw([e.snack[n],e[n]],w.id),r))},{});return m().createElement(Gv,{in:i,onExited:k.onExited},m().createElement(Gk,{open:h,id:w.id,disableWindowBlurListener:b,autoHideDuration:w.autoHideDuration,className:qE(GO.wrappedRoot,d.root,d["anchorOrigin"+q1(w.anchorOrigin)]),SnackbarProps:p,onClose:a},m().createElement(f,Object.assign({},S,{appear:!0,in:h,onExit:k.onExit,onExited:s,onEnter:k.onEnter,onEntered:Gw([k.onEntered,function(){e.snack.requestClose&&a(null,"instructed",e.snack.id)}],w.id)}),C||m().createElement(void 0===c?GR:c,Object.assign({},w)))))},GD=20,GL=6,G_=2,GN="."+Gg,GZ=Gf({root:((u={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:Ga(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"})[GN]={padding:GL+"px 0px",transition:"padding 300ms ease 0ms"},u.maxWidth="calc(100% - "+2*GD+"px)",u[qJ]={width:"100%",maxWidth:"calc(100% - 32px)"},u),rootDense:((c={})[GN]={padding:G_+"px 0px"},c),top:{top:GD-GL+"px",flexDirection:"column"},bottom:{bottom:GD-GL+"px",flexDirection:"column-reverse"},left:((d={left:GD+"px"})[qQ]={alignItems:"flex-start"},d[qJ]={left:"16px"},d),right:((h={right:GD+"px"})[qQ]={alignItems:"flex-end"},h[qJ]={right:"16px"},h),center:((p={left:"50%",transform:"translateX(-50%)"})[qQ]={alignItems:"center"},p)}),Gj=(0,g.memo)(function(e){var t=e.classes,n=void 0===t?{}:t,r=e.anchorOrigin,i=e.dense,o=e.children,a=qE("notistack-SnackbarContainer",GZ[r.vertical],GZ[r.horizontal],GZ.root,n.containerRoot,n["containerAnchorOrigin"+q1(r)],i&&GZ.rootDense);return m().createElement("div",{className:a},o)}),GB=function(e){return!("string"==typeof e||(0,g.isValidElement)(e))},GF=function(e){function t(t){var n;return(n=e.call(this,t)||this).enqueueSnackbar=function(e,t){if(void 0===t&&(t={}),null==e)throw Error("enqueueSnackbar called with invalid argument");var r,i=GB(e)?e:t,o=GB(e)?e.message:e,a=i.key,s=i.preventDuplicate,l=qU(i,["key","preventDuplicate"]),u=q2(a),c=u?a:new Date().getTime()+Math.random(),d=(r=n.props,function(e,t){return(void 0===t&&(t=!1),t)?qq({},Gd[e],{},r[e],{},l[e]):"autoHideDuration"===e?Gh(l.autoHideDuration,r.autoHideDuration):"transitionDuration"===e?Gp(l.transitionDuration,r.transitionDuration):l[e]||r[e]||Gd[e]}),h=qq({id:c},l,{message:o,open:!0,entered:!1,requestClose:!1,persist:d("persist"),action:d("action"),content:d("content"),variant:d("variant"),anchorOrigin:d("anchorOrigin"),disableWindowBlurListener:d("disableWindowBlurListener"),autoHideDuration:d("autoHideDuration"),hideIconVariant:d("hideIconVariant"),TransitionComponent:d("TransitionComponent"),transitionDuration:d("transitionDuration"),TransitionProps:d("TransitionProps",!0),iconVariant:d("iconVariant",!0),style:d("style",!0),SnackbarProps:d("SnackbarProps",!0),className:qE(n.props.className,l.className)});return h.persist&&(h.autoHideDuration=void 0),n.setState(function(e){if(void 0===s&&n.props.preventDuplicate||s){var t=function(e){return u?e.id===c:e.message===o},r=e.queue.findIndex(t)>-1,i=e.snacks.findIndex(t)>-1;if(r||i)return e}return n.handleDisplaySnack(qq({},e,{queue:[].concat(e.queue,[h])}))}),c},n.handleDisplaySnack=function(e){return e.snacks.length>=n.maxSnack?n.handleDismissOldest(e):n.processQueue(e)},n.processQueue=function(e){var t=e.queue,n=e.snacks;return t.length>0?qq({},e,{snacks:[].concat(n,[t[0]]),queue:t.slice(1,t.length)}):e},n.handleDismissOldest=function(e){if(e.snacks.some(function(e){return!e.open||e.requestClose}))return e;var t=!1,r=!1;e.snacks.reduce(function(e,t){return e+(t.open&&t.persist?1:0)},0)===n.maxSnack&&(r=!0);var i=e.snacks.map(function(e){return t||e.persist&&!r?qq({},e):(t=!0,e.entered)?(e.onClose&&e.onClose(null,"maxsnack",e.id),n.props.onClose&&n.props.onClose(null,"maxsnack",e.id),qq({},e,{open:!1})):qq({},e,{requestClose:!0})});return qq({},e,{snacks:i})},n.handleEnteredSnack=function(e,t,r){if(!q2(r))throw Error("handleEnteredSnack Cannot be called with undefined key");n.setState(function(e){return{snacks:e.snacks.map(function(e){return e.id===r?qq({},e,{entered:!0}):qq({},e)})}})},n.handleCloseSnack=function(e,t,r){n.props.onClose&&n.props.onClose(e,t,r);var i=void 0===r;n.setState(function(e){var t=e.snacks,n=e.queue;return{snacks:t.map(function(e){return i||e.id===r?e.entered?qq({},e,{open:!1}):qq({},e,{requestClose:!0}):qq({},e)}),queue:n.filter(function(e){return e.id!==r})}})},n.closeSnackbar=function(e){var t=n.state.snacks.find(function(t){return t.id===e});q2(e)&&t&&t.onClose&&t.onClose(null,"instructed",e),n.handleCloseSnack(null,"instructed",e)},n.handleExitedSnack=function(e,t){if(!q2(t))throw Error("handleExitedSnack Cannot be called with undefined key");n.setState(function(e){var r=n.processQueue(qq({},e,{snacks:e.snacks.filter(function(e){return e.id!==t})}));return 0===r.queue.length?r:n.handleDismissOldest(r)})},n.enqueueSnackbar,n.closeSnackbar,n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar.bind(qK(n)),closeSnackbar:n.closeSnackbar.bind(qK(n))}},n}return qG(t,e),t.prototype.render=function(){var e=this,t=this.state.contextValue,n=this.props,r=n.domRoot,i=n.children,o=n.dense,a=void 0!==o&&o,s=n.Components,l=void 0===s?{}:s,u=n.classes,c=this.state.snacks.reduce(function(e,t){var n,r=q1(t.anchorOrigin),i=e[r]||[];return qq({},e,((n={})[r]=[].concat(i,[t]),n))},{}),d=Object.keys(c).map(function(t){var n=c[t],r=n[0];return m().createElement(Gj,{key:t,dense:a,anchorOrigin:r.anchorOrigin,classes:u},n.map(function(t){return m().createElement(GE,{key:t.id,snack:t,classes:u,Component:l[t.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:Gw([e.handleExitedSnack,e.props.onExited],t.id),onEntered:Gw([e.handleEnteredSnack,e.props.onEntered],t.id)})}))});return m().createElement(qX.Provider,{value:t},i,r?(0,i0.createPortal)(d,r):d)},qW(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||Gd.maxSnack}}]),t}(g.Component);function Gz(){let{enqueueSnackbar:e,closeSnackbar:t}=(0,g.useContext)(qX),n=G$(e,"error"),r=G$(e,"info"),i=G$(e,"warning"),o=G$(e,"success"),a=(0,g.useCallback)((e,t)=>n(e instanceof Error?e.message:`An unexpected error occurred: ${e}`,t),[n]);return{enqueueSnackbar:e,closeSnackbar:t,errorSnackbar:n,infoSnackbar:r,warningSnackbar:i,successSnackbar:o,exceptionSnackbar:a}}function G$(e,t){return(0,g.useCallback)((n,r)=>e(n,{...r,variant:t}),[e,t])}function GV(e,t){let n=e.palette.text?.primary??"#222",r={title:{show:!1},textStyle:{color:n,fontFamily:e.typography.fontFamily,fontSize:12},grid:{top:5,right:20,bottom:0,left:20,containLabel:!0},color:["#56B4E9","#009E73","#0072B2","#CC79A7","#F0E442","#E69F00","#D55E00"],categoryAxis:{show:!0,axisLabel:{show:!0,color:n,margin:15},axisTick:{show:!1,length:6,lineStyle:{color:e.palette.grey[600]}},axisLine:{show:!0,lineStyle:{color:e.palette.grey[600]}},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.4}},splitArea:{show:!1,areaStyle:{color:[e.palette.grey[300]]}}},timeAxis:{show:!0,axisLabel:{show:!0,color:n,margin:15},axisTick:{show:!1,length:6,lineStyle:{color:e.palette.grey[600]}},axisLine:{show:!0,lineStyle:{color:e.palette.grey[600]}},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.4}},splitArea:{show:!1,areaStyle:{color:[e.palette.grey[300]]}}},valueAxis:{show:!0,axisLabel:{color:n,margin:12},axisLine:{show:!1},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.6}}},legend:{orient:"horizontal",textStyle:{color:n},pageTextStyle:{color:e.palette.grey[600]},pageIconColor:e?.palette?.action?.active,pageIconInactiveColor:e?.palette?.action?.disabled},toolbox:{show:!0,top:10,right:10,iconStyle:{borderColor:n}},tooltip:{backgroundColor:e.palette.designSystem?.grey[800],borderColor:e.palette.designSystem?.grey[800],textStyle:{color:"#fff",fontSize:11}},axisPointer:{lineStyle:{color:e.palette.grey[500]}},markLine:{symbol:"none",symbolSize:0,itemStyle:{color:e.palette.grey[500]},lineStyle:{type:"dashed",width:1}},line:{showSymbol:!1,symbol:"circle",symbolSize:4,smooth:!1,lineStyle:{width:1},emphasis:{lineStyle:{width:1.5}}},bar:{barMaxWidth:150,itemStyle:{borderWidth:0,borderRadius:0,borderColor:e.palette.grey[300]},label:{show:!1,color:n}},gauge:{detail:{fontSize:18,fontWeight:600,valueAnimation:!1},splitLine:{distance:0,length:4,lineStyle:{width:1}},splitNumber:12}};return n9()({echartsTheme:r,noDataOption:{title:{show:!0,textStyle:{color:n,fontSize:16,fontWeight:400},text:"No data",left:"center",top:"center"},xAxis:{show:!1},yAxis:{show:!1}},sparkline:{width:2,color:"#1976d2"},container:{padding:{default:parseInt(e.spacing(1.5),10)}},thresholds:{defaultColor:e.palette.success.main,palette:["#FFCC00",e.palette.warning.main,e.palette.error.main]}},t)}function GH(e){return{value:{pastDuration:e},display:`Last ${(0,E_.formatDuration)(Bp(e),{delimiter:", "})}`}}let GW=GV((0,tH.Z)({}),{echartsTheme:{textStyle:{fontFamily:"Lato"},categoryAxis:{splitLine:{show:!1}},timeAxis:{splitLine:{show:!1}},bar:{barCategoryGap:2}}}),Gq={chartsTheme:GW,enablePinning:!1,lastTooltipPinnedCoords:null,setLastTooltipPinnedCoords:()=>null},GG={defaultProps:{variant:"standard",severity:"success"},styleOverrides:{standardError:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.error.dark,color:e.palette.error.light,[`& .${vn.icon}`]:{color:e.palette.error.main}}:{...e.typography.body1,backgroundColor:e.palette.error.light,color:e.palette.error.dark,[`& .${vn.icon}`]:{color:e.palette.error.main}},standardInfo:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.info.dark,color:e.palette.info.light,[`& .${vn.icon}`]:{color:e.palette.info.main}}:{...e.typography.body1,backgroundColor:e.palette.info.light,color:e.palette.info.dark,[`& .${vn.icon}`]:{color:e.palette.info.main}},standardSuccess:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.success.dark,color:e.palette.success.light,[`& .${vn.icon}`]:{color:e.palette.success.main}}:{...e.typography.body1,backgroundColor:e.palette.success.light,color:e.palette.success.dark,[`& .${vn.icon}`]:{color:e.palette.success.main}},standardWarning:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.warning.dark,color:e.palette.warning.light,[`& .${vn.icon}`]:{color:e.palette.warning.main}}:{...e.typography.body1,backgroundColor:e.palette.warning.light,color:e.palette.warning.dark,[`& .${vn.icon}`]:{color:e.palette.warning.main}},root:{["& ."+(0,T.Z)("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]).root]:{textDecoration:"underline"}}}},GU={50:"#F0F1F6",100:"#E1E3ED",150:"#D2D5E4",200:"#C3C7DB",300:"#A4ACC8",400:"#8690B6",500:"#717CA4",600:"#535D83",700:"#3E4662",800:"#2A2E42",850:"#1F2331",900:"#151721",950:"#0A0C10"},GK={50:"#E7F1FC",100:"#D0E3FA",150:"#B8D5F7",200:"#A1C7F5",300:"#72ABF0",400:"#438FEB",500:"#1473E6",600:"#105CB8",700:"#0C458A",800:"#082E5C",850:"#062345",900:"#04172E",950:"#020C17"},GY="#FFFFFF",GX=e=>{let t=GU["800"],n=GU["300"];return"light"===e?{navigation:t,accent:n,primary:GU["800"],secondary:GU["700"],disabled:GU["300"],link:GK["500"],linkHover:GK["600"]}:{navigation:t,accent:n,primary:GY,secondary:GU["50"],disabled:GU["600"],link:GK["400"],linkHover:GK["500"]}},GJ=e=>{let t=GK["150"],n="rgba(21, 23, 33, 0.75)";return"light"===e?{navigation:t,overlay:n,default:GY,paper:GU["50"],code:GU["50"],tooltip:GU["100"],lighter:GU["50"],border:GU["100"]}:{navigation:t,overlay:n,default:GU["900"],paper:GU["850"],code:GU["800"],tooltip:GU["600"],lighter:GU["700"],border:GU["600"]}},GQ=e=>"light"===e?{50:GU["50"],100:GU["100"],200:GU["200"],300:GU["300"],400:GU["400"],500:GU["500"],600:GU["600"],700:GU["700"],800:GU["800"],900:GU["900"],950:GU["950"]}:{50:GU["950"],100:GU["900"],200:GU["800"],300:GU["700"],400:GU["600"],500:GU["500"],600:GU["400"],700:GU["300"],800:GU["200"],900:GU["100"],950:GU["50"]},G0=e=>"light"===e?{main:GK["500"],dark:GK["600"],light:GK["50"]}:{main:GK["400"],dark:GK["800"],light:GK["200"]},G1=e=>"light"===e?{main:GU["600"],dark:GU["900"],light:GU["100"]}:{main:GY,dark:GY,light:GY},G2={50:"#EAF9F1",100:"#D5F2E3",150:"#C1ECD4",200:"#ACE5C6",300:"#82D9AA",400:"#59CC8D",500:"#2FBF71",600:"#26995A",700:"#1C7344",800:"#134C2D",850:"#0E3922",900:"#092617",950:"#05130B"},G5={50:"#FFF5E8",100:"#FFECD2",150:"#FFE2BB",200:"#FFD9A4",300:"#FFC577",400:"#FFB249",500:"#FF9F1C",600:"#CC7F16",700:"#995F11",800:"#66400B",850:"#4D3008",900:"#332006",950:"#1A1003"},G3={50:"#EFE9FD",100:"#E0D2FC",150:"#D0BCFA",200:"#C1A6F8",300:"#A179F5",400:"#824DF1",500:"#6320EE",600:"#4F1ABE",700:"#3B138F",800:"#280D5F",850:"#1E0A47",900:"#140630",950:"#0A0318"},G4={50:"#FDEDED",100:"#FBDADA",150:"#F9C8C8",200:"#F7B5B5",300:"#F29191",400:"#EE6C6C",500:"#EA4747",600:"#BD3939",700:"#902B2B",800:"#621D1D",850:"#4C1616",900:"#350F0F",950:"#1F0808"},G6=e=>"light"===e?{main:G4["500"],dark:G4["600"],light:G4["50"]}:{main:G4["400"],dark:G4["800"],light:G4["300"]},G8=e=>"light"===e?{main:G2["500"],dark:G2["700"],light:G2["50"]}:{main:G2["400"],dark:G2["800"],light:G2["300"]},G9=e=>"light"===e?{main:G5["500"],dark:G5["700"],light:G5["50"]}:{main:G5["400"],dark:G5["800"],light:G5["300"]},G7={fontFamily:'"Lato", sans-serif',fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:700,fontWeightBold:900,h1:{fontSize:"1.5rem",fontWeight:700,lineHeight:"32px"},h2:{fontSize:"1.25rem",fontWeight:700,lineHeight:"28px"},h3:{fontSize:"1rem",fontWeight:700,lineHeight:"24px"},h4:{fontSize:"0.875rem",fontWeight:700,lineHeight:"22px"},h5:void 0,h6:void 0,body1:{fontSize:"0.875rem",fontWeight:400,lineHeight:"20px"},body2:{fontSize:"0.75rem",fontWeight:400,lineHeight:"18px"},subtitle1:{fontSize:"1rem",fontWeight:400,lineHeight:"24px",letterSpacing:"0.02rem"},subtitle2:{fontSize:"0.875rem",fontWeight:700,lineHeight:"22px",letterSpacing:"0.03rem",textTransform:"uppercase"},button:{fontSize:"0.875rem",fontWeight:700,lineHeight:"1.25rem",textTransform:"none",letterSpacing:"0.03rem"},caption:{fontSize:"0.6875rem",fontWeight:400,lineHeight:"16px"}},Ue=({theme:e})=>({..."light"===e.palette.mode?{}:{backgroundImage:"unset",backgroundColor:e.palette.designSystem.grey[800]}});function Ut(e,t={}){return(0,tH.Z)({palette:{mode:e,primary:G0(e),secondary:G1(e),grey:GQ(e),background:GJ(e),text:GX(e),error:G6(e),warning:G9(e),info:G0(e),success:G8(e),common:{white:GY,black:"#000000"},designSystem:{blue:GK,green:G2,grey:GU,orange:G5,purple:G3,red:G4}},typography:G7,mixins:{},components:Un,...t})}let Un={MuiAlert:GG,MuiFormControl:{defaultProps:{size:"small"}},MuiPaper:{styleOverrides:{root:({theme:e})=>({backgroundColor:e.palette.background.default})}},MuiTextField:{defaultProps:{size:"small"}},MuiDrawer:{styleOverrides:{paper:Ue}},MuiDialog:{styleOverrides:{paper:Ue}},MuiPopover:{styleOverrides:{paper:Ue}}};var Ur=n(4974),Ui=n(2449),Uo=n(8418),Ua=n(7689);let Us={JoinByColumnValue:"Join by column value",MergeColumns:"Merge columns",MergeIndexedColumns:"Merge indexed columns",MergeSeries:"Merge series"};function Ul({value:e,onChange:t}){return(0,f.jsxs)(rf,{direction:"row",children:[(0,f.jsx)(g2,{freeSolo:!0,multiple:!0,id:"join-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,f.jsx)(aC,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,r)=>{t({...e,spec:{...e.spec,columns:r}})}}),(0,f.jsx)(DV,{label:"Enabled",labelPlacement:"start",control:(0,f.jsx)(Dc,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function Uu({value:e,onChange:t}){return(0,f.jsxs)(rf,{direction:"row",gap:1,alignItems:"center",children:[(0,f.jsx)(g2,{freeSolo:!0,multiple:!0,id:"merge-columns-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,f.jsx)(aC,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,r)=>{t({...e,spec:{...e.spec,columns:r}})}}),(0,f.jsx)(pB,{id:"merge-columns-name",variant:"outlined",label:"Output Name",value:e.spec.name??"",sx:{width:"100%"},onChange:n=>{t({...e,spec:{...e.spec,name:n}})},required:!0}),(0,f.jsx)(DV,{label:"Enabled",labelPlacement:"start",control:(0,f.jsx)(Dc,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function Uc({value:e,onChange:t}){return(0,f.jsxs)(rf,{direction:"row",children:[(0,f.jsx)(pB,{id:"merge-indexed-columns",variant:"outlined",label:"Column",placeholder:"Example: 'value' for merging 'value #1', 'value #2' and 'value #...'",value:e.spec.column??"",sx:{width:"100%"},onChange:n=>{t({...e,spec:{...e.spec,column:n}})},required:!0}),(0,f.jsx)(DV,{label:"Enabled",labelPlacement:"start",control:(0,f.jsx)(Dc,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function Ud({value:e,onChange:t}){return(0,f.jsx)(rf,{direction:"row",children:(0,f.jsx)(DV,{label:"Enabled",labelPlacement:"start",control:(0,f.jsx)(Dc,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})})}function Uh({value:e,onChange:t,...n}){return(0,f.jsxs)(rf,{gap:2,sx:{width:"100%"},mt:1,...n,children:[(0,f.jsxs)(pB,{select:!0,label:"Kind",value:e.kind,onChange:n=>t({...e,kind:n}),children:[(0,f.jsx)(d3,{value:"JoinByColumnValue",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"Join by column value"}),(0,f.jsx)(c1,{variant:"caption",children:"Regroup rows with equal cell value in a column"})]})}),(0,f.jsx)(d3,{value:"MergeColumns",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"Merge columns"}),(0,f.jsx)(c1,{variant:"caption",children:"Multiple columns are merged to one column"})]})}),(0,f.jsx)(d3,{value:"MergeIndexedColumns",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"Merge indexed columns"}),(0,f.jsx)(c1,{variant:"caption",children:"Indexed columns are merged to one column"})]})}),(0,f.jsx)(d3,{value:"MergeSeries",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"Merge series"}),(0,f.jsx)(c1,{variant:"caption",children:"Series will be merged by their labels"})]})})]}),"JoinByColumnValue"===e.kind&&(0,f.jsx)(Ul,{value:e,onChange:t}),"MergeColumns"===e.kind&&(0,f.jsx)(Uu,{value:e,onChange:t}),"MergeIndexedColumns"===e.kind&&(0,f.jsx)(Uc,{value:e,onChange:t}),"MergeSeries"===e.kind&&(0,f.jsx)(Ud,{value:e,onChange:t})]})}function Up({index:e,value:t,isCollapsed:n,onChange:r,onCollapse:i,onDelete:o,...a}){return(0,f.jsxs)(rf,{...a,children:[(0,f.jsxs)(rf,{direction:"row",alignItems:"center",borderBottom:1,borderColor:e=>e.palette.divider,justifyContent:"space-between",gap:4,children:[(0,f.jsxs)(rf,{direction:"row",gap:1,children:[(0,f.jsx)(rx,{"data-testid":`transform-toggle#${e}`,size:"small",onClick:()=>i(!n),children:n?(0,f.jsx)(Ur.default,{}):(0,f.jsx)(Ui.default,{})}),(0,f.jsx)(c1,{variant:"overline",component:"h4",sx:{textTransform:"none"},children:t.kind?(0,f.jsx)("span",{children:(0,f.jsx)("strong",{children:Us[t.kind]})}):(0,f.jsx)("strong",{children:"Select a transformation kind"})})]}),(0,f.jsxs)(rf,{direction:"row",gap:1,children:[n&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(gg,{title:t.spec?.disabled?"Enable transformation":"Disable transformation",placement:"top",children:(0,f.jsx)(rx,{size:"small",sx:{marginLeft:"auto"},onClick:function(){r({...t,spec:{...t.spec,disabled:!t.spec?.disabled}})},children:t.spec?.disabled?(0,f.jsx)(Uo.default,{}):(0,f.jsx)(Ua.default,{})})}),(0,f.jsx)(vw,{flexItem:!0,orientation:"vertical",variant:"middle"})]}),(0,f.jsx)(gg,{title:"Remove transformation",placement:"top",children:(0,f.jsx)(rx,{size:"small",sx:{marginLeft:"auto"},onClick:o,children:(0,f.jsx)(_M.default,{})})})]})]}),!n&&(0,f.jsx)(Uh,{value:t,onChange:r})]})}function Uf({value:e,onChange:t,...n}){let[r,i]=(0,g.useState)(e.map(()=>!0));return(0,f.jsxs)(rf,{gap:1,...n,children:[e.map((n,o)=>(0,f.jsx)(Up,{index:o,value:n,isCollapsed:r[o]??!0,onChange:n=>(function(n,r){let i=[...e];i[n]=r,t(i)})(o,n),onDelete:()=>(function(n){let r=[...e];r.splice(n,1),t(r),i(e=>(e.splice(n,1),[...e]))})(o),onCollapse:e=>{i(t=>(t[o]=e,[...t]))}},o)),(0,f.jsx)(e_,{variant:"contained",startIcon:(0,f.jsx)(LF.default,{}),sx:{marginTop:1},onClick:function(){let n=[...e];n.push({kind:"",spec:{}}),t(n),i(e=>(e.push(!1),[...e]))},children:"Add Transformation"})]})}function Ug(e){let{value:t,onChange:n,timeOptions:r,height:i}=e,o=(0,g.useMemo)(()=>{if(t&&!r.some(e=>e.value.pastDuration===t))return(0,f.jsx)(d3,{value:t,children:t})},[r,t]);return(0,f.jsx)(iM,{children:(0,f.jsx)(tU,{children:(0,f.jsxs)(ay,{id:"refreshInterval",value:t,onChange:e=>{n(e.target.value)},inputProps:{"aria-label":`Select refresh interval. Currently set to ${t}`},sx:{".MuiSelect-select":i?{lineHeight:i,paddingY:0}:{}},children:[r.map((e,t)=>(0,f.jsx)(d3,{value:e.value.pastDuration,children:e.display},t)),o]})})})}var Um=n(2914),Uv=n(651),Uy=2*Math.PI,Ub=Math.PI/180;function Ux(e,t){return Uv.ME(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function Uw(e,t){var n,r,i=Ux(e,t),o=e.get("center"),a=e.get("radius");eB.kJ(a)||(a=[0,a]);var s=(0,e6.GM)(i.width,t.getWidth()),l=(0,e6.GM)(i.height,t.getHeight()),u=Math.min(s,l),c=(0,e6.GM)(a[0],u/2),d=(0,e6.GM)(a[1],u/2),h=e.coordinateSystem;if(h){var p=h.dataToPoint(o);n=p[0]||0,r=p[1]||0}else eB.kJ(o)||(o=[o,o]),n=(0,e6.GM)(o[0],s)+i.x,r=(0,e6.GM)(o[1],l)+i.y;return{cx:n,cy:r,r0:c,r:d}}function US(e,t,n){t.eachSeriesByType(e,function(e){var t=e.getData(),r=t.mapDimension("value"),i=Ux(e,n),o=Uw(e,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,c=-e.get("startAngle")*Ub,d=e.get("endAngle"),h=e.get("padAngle")*Ub;d="auto"===d?c-Uy:-d*Ub;var p=e.get("minAngle")*Ub+h,f=0;t.each(r,function(e){!isNaN(e)&&f++});var g=t.getSum(r),m=Math.PI/(g||f)*2,v=e.get("clockwise"),y=e.get("roseType"),b=e.get("stillShowZeroSum"),x=t.getDataExtent(r);x[0]=0;var w=v?1:-1,S=[c,d],C=w*h/2;(0,vA.L)(S,!v),c=S[0];var k=Math.abs((d=S[1])-c),M=k,T=0,A=c;if(t.setLayout({viewRect:i,r:l}),t.each(r,function(e,n){if(isNaN(e)){t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:a,cy:s,r0:u,r:y?NaN:l});return}(r="area"!==y?0===g&&b?m:e*m:k/f)<p?(r=p,M-=p):T+=e;var r,i=A+w*r,o=0,c=0;h>r?c=o=A+w*r/2:(o=A+C,c=i-C),t.setItemLayout(n,{angle:r,startAngle:o,endAngle:c,clockwise:v,cx:a,cy:s,r0:u,r:y?(0,e6.NU)(e,x,[u,l]):l}),A=i}),M<Uy&&f){if(M<=.001){var I=k/f;t.each(r,function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n);r.angle=I;var i=0,o=0;I<h?o=i=c+w*(n+.5)*I:(i=c+w*n*I+C,o=c+w*(n+1)*I-C),r.startAngle=i,r.endAngle=o}})}else m=M/T,A=c,t.each(r,function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n),i=r.angle===p?p:e*m,o=0,a=0;i<h?a=o=A+w*i/2:(o=A+C,a=A+w*i-C),r.startAngle=o,r.endAngle=a,A+=w*i}})}})}var UC=n(1145);function Uk(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=Math.sqrt(l*l+u*u),d=((i-e)*(l/=c)+(o-t)*(u/=c))/c;s&&(d=Math.min(Math.max(d,0),1)),d*=c;var h=a[0]=e+d*l,p=a[1]=t+d*u;return Math.sqrt((h-i)*(h-i)+(p-o)*(p-o))}vA.Z.CMD;var UM=new UC.Z,UT=new UC.Z,UA=new UC.Z,UI=new UC.Z,UP=new UC.Z,UR=[],UO=new UC.Z;function UE(e,t,n,r){var i="normal"===n,o=i?e:e.ensureState(n);o.ignore=t;var a=r.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=r.getModel("lineStyle").getLineStyle();i?e.useStyle(s):o.style=s}function UD(e,t){var n=t.smooth,r=t.points;if(r){if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=RH.TK(r[0],r[1]),o=RH.TK(r[1],r[2]);if(!i||!o){e.lineTo(r[1][0],r[1][1]),e.lineTo(r[2][0],r[2][1]);return}var a=Math.min(i,o)*n,s=RH.t7([],r[1],r[0],a/i),l=RH.t7([],r[1],r[2],a/o),u=RH.t7([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],r[2][0],r[2][1])}else for(var c=1;c<r.length;c++)e.lineTo(r[c][0],r[c][1])}}var UL=n(7285),U_=Math.PI/180;function UN(e,t,n,r,i,o,a,s,l,u){if(!(e.length<2)){for(var c=e.length,d=0;d<c;d++)if("outer"===e[d].position&&"labelLine"===e[d].labelAlignTo){var h=e[d].label.x-u;e[d].linePoints[1][0]+=h,e[d].label.x=u}(0,UL.GI)(e,l,l+a)&&function(e){for(var o={list:[],maxY:0},a={list:[],maxY:0},s=0;s<e.length;s++)if("none"===e[s].labelAlignTo){var l=e[s],u=l.label.y>n?a:o,c=Math.abs(l.label.y-n);if(c>=u.maxY){var d=l.label.x-t-l.len2*i,h=r+l.len,f=Math.abs(d)<h?Math.sqrt(c*c/(1-d*d/h/h)):h;u.rB=f,u.maxY=c}u.list.push(l)}p(o),p(a)}(e)}function p(e){for(var o=e.rB,a=o*o,s=0;s<e.list.length;s++){var l=e.list[s],u=Math.abs(l.label.y-n),c=r+l.len,d=t+(Math.sqrt(c*c*(1-Math.abs(u*u/a)))+l.len2)*i,h=d-l.label.x,p=l.targetTextWidth-h*i;UZ(l,p,!0),l.label.x=d}}}function UZ(e,t,n){if(void 0===n&&(n=!1),null==e.labelStyleWidth){var r=e.label,i=r.style,o=e.rect,a=i.backgroundColor,s=i.padding,l=s?s[1]+s[3]:0,u=i.overflow,c=o.width+(a?0:l);if(t<c||n){var d=o.height;if(u&&u.match("break")){r.setStyle("backgroundColor",null),r.setStyle("width",t-l);var h=r.getBoundingRect();r.setStyle("width",Math.ceil(h.width)),r.setStyle("backgroundColor",a)}else{var p=t-l,f=t<c?p:n?p>e.unconstrainedWidth?null:p:null;r.setStyle("width",f)}var g=r.getBoundingRect();o.width=g.width;var m=(r.style.margin||0)+2.1;o.height=g.height+m,o.y-=(o.height-d)/2}}}function Uj(e){return"center"===e.position}var UB=function(e){function t(t,n,r){var i=e.call(this)||this;i.z2=2;var o=new nt.ZP;return i.setTextContent(o),i.updateData(t,n,r,!0),i}return(0,eH.ZT)(t,e),t.prototype.updateData=function(e,t,n,r){var i=e.hostModel,o=e.getItemModel(t),a=o.getModel("emphasis"),s=e.getItemLayout(t),l=(0,eB.l7)(tl(o.getModel("itemStyle"),s,!0),s);if(isNaN(l.startAngle)){this.setShape(l);return}if(r){this.setShape(l);var u=i.getShallow("animationType");i.ecModel.ssr?(eQ.KZ(this,{scaleX:0,scaleY:0},i,{dataIndex:t,isFrom:!0}),this.originX=l.cx,this.originY=l.cy):"scale"===u?(this.shape.r=s.r0,eQ.KZ(this,{shape:{r:s.r}},i,t)):null!=n?(this.setShape({startAngle:n,endAngle:n}),eQ.KZ(this,{shape:{startAngle:s.startAngle,endAngle:s.endAngle}},i,t)):(this.shape.endAngle=s.startAngle,eQ.D(this,{shape:{endAngle:s.endAngle}},i,t))}else(0,eQ.Zi)(this),eQ.D(this,{shape:l},i,t);this.useStyle(e.getItemVisual(t,"style")),(0,e5.WO)(this,o);var c=(s.startAngle+s.endAngle)/2,d=i.get("selectedOffset"),h=Math.cos(c)*d,p=Math.sin(c)*d,f=o.getShallow("cursor");f&&this.attr("cursor",f),this._updateLabel(i,e,t),this.ensureState("emphasis").shape=(0,eB.l7)({r:s.r+(a.get("scale")&&a.get("scaleSize")||0)},tl(a.getModel("itemStyle"),s)),(0,eB.l7)(this.ensureState("select"),{x:h,y:p,shape:tl(o.getModel(["select","itemStyle"]),s)}),(0,eB.l7)(this.ensureState("blur"),{shape:tl(o.getModel(["blur","itemStyle"]),s)});var g=this.getTextGuideLine(),m=this.getTextContent();g&&(0,eB.l7)(g.ensureState("select"),{x:h,y:p}),(0,eB.l7)(m.ensureState("select"),{x:h,y:p}),(0,e5.k5)(this,a.get("focus"),a.get("blurScope"),a.get("disabled"))},t.prototype._updateLabel=function(e,t,n){var r=t.getItemModel(n),i=r.getModel("labelLine"),o=t.getItemVisual(n,"style"),a=o&&o.fill,s=o&&o.opacity;(0,e3.ni)(this,(0,e3.k3)(r),{labelFetcher:t.hostModel,labelDataIndex:n,inheritColor:a,defaultOpacity:s,defaultText:e.getFormattedLabel(n,"normal")||t.getName(n)});var l=this.getTextContent();this.setTextConfig({position:null,rotation:null}),l.attr({z2:10});var u=e.get(["label","position"]);if("outside"!==u&&"outer"!==u)this.removeTextGuideLine();else{var c=this.getTextGuideLine();c||(c=new OL.Z,this.setTextGuideLine(c)),function(e,t,n){var r=e.getTextGuideLine(),i=e.getTextContent();if(!i){r&&e.removeTextGuideLine();return}for(var o=t.normal,a=o.get("show"),s=i.ignore,l=0;l<e5.qc.length;l++){var u=e5.qc[l],c=t[u],d="normal"===u;if(c){var h=c.get("show");if((d?s:(0,eB.pD)(i.states[u]&&i.states[u].ignore,s))||!(0,eB.pD)(h,a)){var p=d?r:r&&r.states[u];p&&(p.ignore=!0),r&&UE(r,!0,u,c);continue}!r&&(r=new OL.Z,e.setTextGuideLine(r),d||!s&&a||UE(r,!0,"normal",t.normal),e.stateProxy&&(r.stateProxy=e.stateProxy)),UE(r,!1,u,c)}}if(r){(0,eB.ce)(r.style,n),r.style.fill=null;var f=o.get("showAbove");(e.textGuideLineConfig=e.textGuideLineConfig||{}).showAbove=f||!1,r.buildPath=UD}}(this,function(e,t){t=t||"labelLine";for(var n={normal:e.getModel(t)},r=0;r<e5.L1.length;r++){var i=e5.L1[r];n[i]=e.getModel([i,t])}return n}(r),{stroke:a,opacity:(0,eB.R1)(i.get(["lineStyle","opacity"]),s,1)})}},t}(e1.C),UF=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return(0,eH.ZT)(t,e),t.prototype.render=function(e,t,n,r){var i,o=e.getData(),a=this._data,s=this.group;if(!a&&o.count()>0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u<o.count();++u)l=o.getItemLayout(u);l&&(i=l.startAngle)}if(this._emptyCircleSector&&s.remove(this._emptyCircleSector),0===o.count()&&e.get("showEmptyCircle")){var c=new e1.C({shape:Uw(e,n)});c.useStyle(e.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=c,s.add(c)}o.diff(a).add(function(e){var t=new UB(o,e,i);o.setItemGraphicEl(e,t),s.add(t)}).update(function(e,t){var n=a.getItemGraphicEl(t);n.updateData(o,e,i),n.off("click"),s.add(n),o.setItemGraphicEl(e,n)}).remove(function(t){var n=a.getItemGraphicEl(t);eQ.XD(n,e,t)}).execute(),function(e){var t,n,r=e.getData(),i=[],o=!1,a=(e.get("minShowLabelAngle")||0)*U_,s=r.getLayout("viewRect"),l=r.getLayout("r"),u=s.width,c=s.x,d=s.y,h=s.height;function p(e){e.ignore=!0}r.each(function(e){var s,d,h,f,g=r.getItemGraphicEl(e),m=g.shape,v=g.getTextContent(),y=g.getTextGuideLine(),b=r.getItemModel(e),x=b.getModel("label"),w=x.get("position")||b.get(["emphasis","label","position"]),S=x.get("distanceToLabelLine"),C=x.get("alignTo"),k=(0,e6.GM)(x.get("edgeDistance"),u),M=x.get("bleedMargin"),T=b.getModel("labelLine"),A=T.get("length");A=(0,e6.GM)(A,u);var I=T.get("length2");if(I=(0,e6.GM)(I,u),Math.abs(m.endAngle-m.startAngle)<a){(0,eB.S6)(v.states,p),v.ignore=!0,y&&((0,eB.S6)(y.states,p),y.ignore=!0);return}if(function(e){if(!e.ignore)return!0;for(var t in e.states)if(!1===e.states[t].ignore)return!0;return!1}(v)){var P=(m.startAngle+m.endAngle)/2,R=Math.cos(P),O=Math.sin(P);t=m.cx,n=m.cy;var E="inside"===w||"inner"===w;if("center"===w)s=m.cx,d=m.cy,f="center";else{var D=(E?(m.r+m.r0)/2*R:m.r*R)+t,L=(E?(m.r+m.r0)/2*O:m.r*O)+n;if(s=D+3*R,d=L+3*O,!E){var _=D+R*(A+l-m.r),N=L+O*(A+l-m.r),Z=_+(R<0?-1:1)*I;s="edge"===C?R<0?c+k:c+u-k:Z+(R<0?-S:S),d=N,h=[[D,L],[_,N],[Z,N]]}f=E?"center":"edge"===C?R>0?"right":"left":R>0?"left":"right"}var j=Math.PI,B=0,F=x.get("rotate");if((0,eB.hj)(F))B=j/180*F;else if("center"===w)B=0;else if("radial"===F||!0===F)B=R<0?-P+j:-P;else if("tangential"===F&&"outside"!==w&&"outer"!==w){var z=Math.atan2(R,O);z<0&&(z=2*j+z),O>0&&(z=j+z),B=z-j}if(o=!!B,v.x=s,v.y=d,v.rotation=B,v.setStyle({verticalAlign:"middle"}),E){v.setStyle({align:f});var $=v.states.select;$&&($.x+=v.x,$.y+=v.y)}else{var V=v.getBoundingRect().clone();V.applyTransform(v.getComputedTransform());var H=(v.style.margin||0)+2.1;V.y-=H/2,V.height+=H,i.push({label:v,labelLine:y,position:w,len:A,len2:I,minTurnAngle:T.get("minTurnAngle"),maxSurfaceAngle:T.get("maxSurfaceAngle"),surfaceNormal:new UC.Z(R,O),linePoints:h,textAlign:f,labelDistance:S,labelAlignTo:C,edgeDistance:k,bleedMargin:M,rect:V,unconstrainedWidth:V.width,labelStyleWidth:v.style.width})}g.setTextConfig({inside:E})}}),!o&&e.get("avoidLabelOverlap")&&function(e,t,n,r,i,o,a,s){for(var l=[],u=[],c=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=0;h<e.length;h++){var p=e[h].label;!Uj(e[h])&&(p.x<t?(c=Math.min(c,p.x),l.push(e[h])):(d=Math.max(d,p.x),u.push(e[h])))}for(var h=0;h<e.length;h++){var f=e[h];if(!Uj(f)&&f.linePoints){if(null!=f.labelStyleWidth)continue;var p=f.label,g=f.linePoints,m=void 0;m="edge"===f.labelAlignTo?p.x<t?g[2][0]-f.labelDistance-a-f.edgeDistance:a+i-f.edgeDistance-g[2][0]-f.labelDistance:"labelLine"===f.labelAlignTo?p.x<t?c-a-f.bleedMargin:a+i-d-f.bleedMargin:p.x<t?p.x-a-f.bleedMargin:a+i-p.x-f.bleedMargin,f.targetTextWidth=m,UZ(f,m)}}UN(u,t,n,r,1,i,o,a,s,d),UN(l,t,n,r,-1,i,o,a,s,c);for(var h=0;h<e.length;h++){var f=e[h];if(!Uj(f)&&f.linePoints){var p=f.label,g=f.linePoints,v="edge"===f.labelAlignTo,y=p.style.padding,b=y?y[1]+y[3]:0,x=p.style.backgroundColor?0:b,w=f.rect.width+x,S=g[1][0]-g[2][0];v?p.x<t?g[2][0]=a+f.edgeDistance+w+f.labelDistance:g[2][0]=a+i-f.edgeDistance-w-f.labelDistance:(p.x<t?g[2][0]=p.x+f.labelDistance:g[2][0]=p.x-f.labelDistance,g[1][0]=g[2][0]+S),g[1][1]=g[2][1]=p.y}}}(i,t,n,l,u,h,c,d);for(var f=0;f<i.length;f++){var g=i[f],m=g.label,v=g.labelLine,y=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:g.textAlign}),y&&((0,eB.S6)(m.states,p),m.ignore=!0);var b=m.states.select;b&&(b.x+=m.x,b.y+=m.y)}if(v){var x=g.linePoints;y||!x?((0,eB.S6)(v.states,p),v.ignore=!0):(function(e,t){if(t<=180&&t>0){t=t/180*Math.PI,UM.fromArray(e[0]),UT.fromArray(e[1]),UA.fromArray(e[2]),UC.Z.sub(UI,UM,UT),UC.Z.sub(UP,UA,UT);var n=UI.len(),r=UP.len();if(!(n<.001)&&!(r<.001)&&(UI.scale(1/n),UP.scale(1/r),Math.cos(t)<UI.dot(UP))){var i=Uk(UT.x,UT.y,UA.x,UA.y,UM.x,UM.y,UR,!1);UO.fromArray(UR),UO.scaleAndAdd(UP,i/Math.tan(Math.PI-t));var o=UA.x!==UT.x?(UO.x-UT.x)/(UA.x-UT.x):(UO.y-UT.y)/(UA.y-UT.y);if(isNaN(o))return;o<0?UC.Z.copy(UO,UT):o>1&&UC.Z.copy(UO,UA),UO.toArray(e[1])}}}(x,g.minTurnAngle),function(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,UM.fromArray(e[0]),UT.fromArray(e[1]),UA.fromArray(e[2]),UC.Z.sub(UI,UT,UM),UC.Z.sub(UP,UA,UT);var r=UI.len(),i=UP.len();if(!(r<.001)&&!(i<.001)&&(UI.scale(1/r),UP.scale(1/i),UI.dot(t)<Math.cos(n))){var o=Uk(UT.x,UT.y,UA.x,UA.y,UM.x,UM.y,UR,!1);UO.fromArray(UR);var a=Math.PI/2,s=a+Math.acos(UP.dot(t))-n;if(s>=a)UC.Z.copy(UO,UA);else{UO.scaleAndAdd(UP,o/Math.tan(Math.PI/2-s));var l=UA.x!==UT.x?(UO.x-UT.x)/(UA.x-UT.x):(UO.y-UT.y)/(UA.y-UT.y);if(isNaN(l))return;l<0?UC.Z.copy(UO,UT):l>1&&UC.Z.copy(UO,UA)}UO.toArray(e[1])}}}(x,g.surfaceNormal,g.maxSurfaceAngle),v.setShape({points:x}),m.__hostTarget.textGuideLineConfig={anchor:new UC.Z(x[0][0],x[0][1])})}}}(e),"expansion"!==e.get("animationTypeUpdate")&&(this._data=o)},t.prototype.dispose=function(){},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var r=e[0]-n.cx,i=e[1]-n.cy,o=Math.sqrt(r*r+i*i);return o<=n.r&&o>=n.r0}},t.type="pie",t}(tn.Z),Uz=n(6451),U$=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),UV=t4.Yf(),UH=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,eH.ZT)(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new U$(eB.ak(this.getData,this),eB.ak(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return vE(this,{coordDimensions:["value"],encodeDefaulter:eB.WA(Uz.Ss,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),r=UV(n),i=r.seats;if(!i){var o=[];n.each(n.mapDimension("value"),function(e){o.push(e)}),i=r.seats=(0,e6.HD)(o,n.hostModel.get("percentPrecision"))}var a=e.prototype.getDataParams.call(this,t);return a.percent=i[t]||0,a.$vars.push("percent"),a},t.prototype._defaultLabelLine=function(e){t4.Cc(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(eW.Z);function UW(e){let{width:t,height:n,data:r}=e,i=tJ(),o={title:{text:"Referer of a Website",subtext:"Fake Data",left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},axisLabel:{overflow:"truncate",width:t/3},series:[{name:"Access From",type:"pie",radius:"55%",label:!1,center:["40%","50%"],data:r,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],itemStyle:{borderRadius:2,color:i.echartsTheme[0]}};return(0,f.jsx)(tU,{style:{width:t,height:n},sx:{overflow:"auto"},children:(0,f.jsx)(n6,{sx:{minHeight:n,height:r?16*r.length:"100%"},option:o,theme:i.echartsTheme})})}(0,ej.D)([function(e){e.registerChartView(UF),e.registerSeriesModel(UH),(0,Um.y)("pie",e.registerAction),e.registerLayout((0,eB.WA)(US,"pie")),e.registerProcessor({seriesType:"pie",reset:function(e,t){var n=t.findComponents({mainType:"legend"});if(n&&n.length){var r=e.getData();r.filterSelf(function(e){for(var t=r.getName(e),i=0;i<n.length;i++)if(!n[i].isSelected(t))return!1;return!0})}}}),e.registerProcessor({seriesType:"pie",reset:function(e,t){var n=e.getData();n.filterSelf(function(e){var t=n.mapDimension("value"),r=n.get(t,e);return!(0,eB.hj)(r)||!!isNaN(r)||!(r<0)})}})},tI.N,tP.N,tR.N,tO.N,tE.N]);var Uq=n(9906),UG=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=Uq.qW.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,r,i,o){var a=this._getBrush(),s=this._getGradient(i,"inRange"),l=this._getGradient(i,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,d=c.getContext("2d"),h=e.length;c.width=t,c.height=n;for(var p=0;p<h;++p){var f=e[p],g=f[0],m=f[1],v=r(f[2]);d.globalAlpha=v,d.drawImage(a,g-u,m-u)}if(!c.width||!c.height)return c;for(var y=d.getImageData(0,0,c.width,c.height),b=y.data,x=0,w=b.length,S=this.minOpacity,C=this.maxOpacity-S;x<w;){var v=b[x+3]/256,k=4*Math.floor(255*v);if(v>0){var M=o(v)?s:l;v>0&&(v=v*C+S),b[x++]=M[k],b[x++]=M[k+1],b[x++]=M[k+2],b[x++]=M[k+3]*v*256}else x+=4}return d.putImageData(y,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=Uq.qW.createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var r=e.getContext("2d");return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor="#000",r.beginPath(),r.arc(-t,t,this.pointSize,0,2*Math.PI,!0),r.closePath(),r.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,r=n[t]||(n[t]=new Uint8ClampedArray(1024)),i=[0,0,0,0],o=0,a=0;a<256;a++)e[t](a/255,!0,i),r[o++]=i[0],r[o++]=i[1],r[o++]=i[2],r[o++]=i[3];return r},e}();function UU(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}var UK=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.render=function(e,t,n){t.eachComponent("visualMap",function(t){t.eachTargetSeries(function(n){n===e&&(r=t)})}),this._progressiveEls=null,this.group.removeAll();var r,i=e.coordinateSystem;"cartesian2d"===i.type||"calendar"===i.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):UU(i)&&this._renderOnGeo(i,e,r,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,r){var i=t.coordinateSystem;i&&(UU(i)?this.render(t,n,r):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(t,r,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){eJ.traverseElements(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,r,i){var o,a,s,l,u=e.coordinateSystem,c=tr(u,"cartesian2d");if(c){var d=u.getAxis("x"),h=u.getAxis("y");o=d.getBandWidth()+.5,a=h.getBandWidth()+.5,s=d.scale.getExtent(),l=h.scale.getExtent()}for(var p=this.group,f=e.getData(),g=e.getModel(["emphasis","itemStyle"]).getItemStyle(),m=e.getModel(["blur","itemStyle"]).getItemStyle(),v=e.getModel(["select","itemStyle"]).getItemStyle(),y=e.get(["itemStyle","borderRadius"]),b=(0,e3.k3)(e),x=e.getModel("emphasis"),w=x.get("focus"),S=x.get("blurScope"),C=x.get("disabled"),k=c?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],M=n;M<r;M++){var T=void 0,A=f.getItemVisual(M,"style");if(c){var I=f.get(k[0],M),P=f.get(k[1],M);if(isNaN(f.get(k[2],M))||isNaN(I)||isNaN(P)||I<s[0]||I>s[1]||P<l[0]||P>l[1])continue;var R=u.dataToPoint([I,P]);T=new e0.Z({shape:{x:R[0]-o/2,y:R[1]-a/2,width:o,height:a},style:A})}else{if(isNaN(f.get(k[1],M)))continue;T=new e0.Z({z2:1,shape:u.dataToRect([f.get(k[0],M)]).contentShape,style:A})}if(f.hasItemOption){var O=f.getItemModel(M),E=O.getModel("emphasis");g=E.getModel("itemStyle").getItemStyle(),m=O.getModel(["blur","itemStyle"]).getItemStyle(),v=O.getModel(["select","itemStyle"]).getItemStyle(),y=O.get(["itemStyle","borderRadius"]),w=E.get("focus"),S=E.get("blurScope"),C=E.get("disabled"),b=(0,e3.k3)(O)}T.shape.r=y;var D=e.getRawValue(M),L="-";D&&null!=D[2]&&(L=D[2]+""),(0,e3.ni)(T,b,{labelFetcher:e,labelDataIndex:M,defaultOpacity:A.opacity,defaultText:L}),T.ensureState("emphasis").style=g,T.ensureState("blur").style=m,T.ensureState("select").style=v,(0,e5.k5)(T,w,S,C),T.incremental=i,i&&(T.states.emphasis.hoverLayer=!0),p.add(T),f.setItemGraphicEl(M,T),this._progressiveEls&&this._progressiveEls.push(T)}},t.prototype._renderOnGeo=function(e,t,n,r){var i,o,a,s,l,u,c,d=n.targetVisuals.inRange,h=n.targetVisuals.outOfRange,p=t.getData(),f=this._hmLayer||this._hmLayer||new UG;f.blurSize=t.get("blurSize"),f.pointSize=t.get("pointSize"),f.minOpacity=t.get("minOpacity"),f.maxOpacity=t.get("maxOpacity");var g=e.getViewRect().clone(),m=e.getRoamTransform();g.applyTransform(m);var v=Math.max(g.x,0),y=Math.max(g.y,0),b=Math.min(g.width+g.x,r.getWidth()),x=Math.min(g.height+g.y,r.getHeight()),w=b-v,S=x-y,C=[p.mapDimension("lng"),p.mapDimension("lat"),p.mapDimension("value")],k=p.mapArray(C,function(t,n,r){var i=e.dataToPoint([t,n]);return i[0]-=v,i[1]-=y,i.push(r),i}),M=n.getExtent(),T="visualMap.continuous"===n.type?(i=n.option.range,o=M[1]-M[0],i=[(i[0]-M[0])/o,(i[1]-M[0])/o],function(e){return e>=i[0]&&e<=i[1]}):(a=n.getPieceList(),s=n.option.selected,l=M[1]-M[0],u=(a=eB.UI(a,function(e){return{interval:[(e.interval[0]-M[0])/l,(e.interval[1]-M[0])/l]}})).length,c=0,function(e){var t;for(t=c;t<u;t++){var n=a[t].interval;if(n[0]<=e&&e<=n[1]){c=t;break}}if(t===u)for(t=c-1;t>=0;t--){var n=a[t].interval;if(n[0]<=e&&e<=n[1]){c=t;break}}return t>=0&&t<u&&s[t]});f.update(k,w,S,d.color.getNormalizer(),{inRange:d.color.getColorMapper(),outOfRange:h.color.getColorMapper()},T);var A=new ne.ZP({style:{width:w,height:S,x:v,y:y,image:f.canvas},silent:!0});this.group.add(A)},t.type="heatmap",t}(tn.Z),UY=n(9801),UX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.getInitialData=function(e,t){return(0,eq.Z)(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var e=UY.Z.get(this.get("coordinateSystem"));if(e&&e.dimensions)return"lng"===e.dimensions[0]&&"lat"===e.dimensions[1]},t.type="series.heatmap",t.dependencies=["grid","geo","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},t}(eW.Z),UJ={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};let UQ={get:function(e,t,n){var r=eB.d9((UJ[e]||{})[t]);return n&&eB.kJ(r)?r[r.length-1]:r}};var U0=eB.S6,U1=eB.Kn,U2=function(){function e(t){var n,r,i=t.mappingMethod,o=t.type,a=this.option=eB.d9(t);this.type=o,this.mappingMethod=i,this._normalizeData=Kn[i];var s=e.visualHandlers[o];this.applyVisual=s.applyVisual,this.getColorMapper=s.getColorMapper,this._normalizedToVisual=s._normalizedToVisual[i],"piecewise"===i?(U5(a),r=(n=a).pieceList,n.hasSpecialVisual=!1,eB.S6(r,function(e,t){e.originIndex=t,null!=e.visual&&(n.hasSpecialVisual=!0)})):"category"===i?a.categories?function(e){var t=e.categories,n=e.categoryMap={},r=e.visual;if(U0(t,function(e,t){n[e]=t}),!eB.kJ(r)){var i=[];eB.Kn(r)?U0(r,function(e,t){var r=n[t];i[null!=r?r:-1]=e}):i[-1]=r,r=Kt(e,i)}for(var o=t.length-1;o>=0;o--)null==r[o]&&(delete n[t[o]],t.pop())}(a):U5(a,!0):(eB.hu("linear"!==i||a.dataExtent),U5(a))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return eB.ak(this._normalizeData,this)},e.listVisualTypes=function(){return eB.XP(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){eB.Kn(e)?eB.S6(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,r){var i,o=eB.kJ(t)?[]:eB.Kn(t)?{}:(i=!0,null);return e.eachVisual(t,function(e,t){var a=n.call(r,e,t);i?o=a:o[t]=a}),o},e.retrieveVisuals=function(t){var n,r={};return t&&U0(e.visualHandlers,function(e,i){t.hasOwnProperty(i)&&(r[i]=t[i],n=!0)}),n?r:null},e.prepareVisualTypes=function(e){if(eB.kJ(e))e=e.slice();else{if(!U1(e))return[];var t=[];U0(e,function(e,n){t.push(n)}),e=t}return e.sort(function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1}),e},e.dependsOn=function(e,t){return"color"===t?!!(e&&0===e.indexOf(t)):e===t},e.findPieceIndex=function(e,t,n){for(var r,i=1/0,o=0,a=t.length;o<a;o++){var s=t[o].value;if(null!=s){if(s===e||eB.HD(s)&&s===e+"")return o;n&&C(s,o)}}for(var o=0,a=t.length;o<a;o++){var l,u,c,d,h,p,f,g,m,v,y,b,x=t[o],w=x.interval,S=x.close;if(w){if(w[0]===-1/0){if(l=S[1],u=e,c=w[1],l?u<=c:u<c)return o}else if(w[1]===1/0){if(d=S[0],h=w[0],p=e,d?h<=p:h<p)return o}else{if(f=S[0],g=w[0],m=e,(f?g<=m:g<m)&&(v=S[1],y=e,b=w[1],v?y<=b:y<b))return o}n&&C(w[0],o),n&&C(w[1],o)}}if(n)return e===1/0?t.length-1:e===-1/0?0:r;function C(t,n){var o=Math.abs(t-e);o<i&&(i=o,r=n)}},e.visualHandlers={color:{applyVisual:U6("color"),getColorMapper:function(){var e=this.option;return eB.ak("category"===e.mappingMethod?function(e,t){return t||(e=this._normalizeData(e)),U8.call(this,e)}:function(t,n,r){var i=!!r;return n||(t=this._normalizeData(t)),r=P7.Uu(t,e.parsedVisual,r),i?r:P7.Pz(r,"rgba")},this)},_normalizedToVisual:{linear:function(e){return P7.Pz(P7.Uu(e,this.option.parsedVisual),"rgba")},category:U8,piecewise:function(e,t){var n=Ke.call(this,t);return null==n&&(n=P7.Pz(P7.Uu(e,this.option.parsedVisual),"rgba")),n},fixed:U9}},colorHue:U3(function(e,t){return P7.ox(e,t)}),colorSaturation:U3(function(e,t){return P7.ox(e,null,t)}),colorLightness:U3(function(e,t){return P7.ox(e,null,null,t)}),colorAlpha:U3(function(e,t){return P7.m8(e,t)}),decal:{applyVisual:U6("decal"),_normalizedToVisual:{linear:null,category:U8,piecewise:null,fixed:null}},opacity:{applyVisual:U6("opacity"),_normalizedToVisual:U7([0,1])},liftZ:{applyVisual:U6("liftZ"),_normalizedToVisual:{linear:U9,category:U9,piecewise:U9,fixed:U9}},symbol:{applyVisual:function(e,t,n){n("symbol",this.mapValueToVisual(e))},_normalizedToVisual:{linear:U4,category:U8,piecewise:function(e,t){var n=Ke.call(this,t);return null==n&&(n=U4.call(this,e)),n},fixed:U9}},symbolSize:{applyVisual:U6("symbolSize"),_normalizedToVisual:U7([0,1])}},e}();function U5(e,t){var n=e.visual,r=[];eB.Kn(n)?U0(n,function(e){r.push(e)}):null!=n&&r.push(n),t||1!==r.length||({color:1,symbol:1}).hasOwnProperty(e.type)||(r[1]=r[0]),Kt(e,r)}function U3(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r("color",e(n("color"),i))},_normalizedToVisual:U7([0,1])}}function U4(e){var t=this.option.visual;return t[Math.round((0,e6.NU)(e,[0,1],[0,t.length-1],!0))]||{}}function U6(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function U8(e){var t=this.option.visual;return t[this.option.loop&&-1!==e?e%t.length:e]}function U9(){return this.option.visual[0]}function U7(e){return{linear:function(t){return(0,e6.NU)(t,e,this.option.visual,!0)},category:U8,piecewise:function(t,n){var r=Ke.call(this,n);return null==r&&(r=(0,e6.NU)(t,e,this.option.visual,!0)),r},fixed:U9}}function Ke(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=U2.findPieceIndex(e,n),i=n[r];if(i&&i.visual)return i.visual[this.type]}}function Kt(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=eB.UI(t,function(e){return P7.Qc(e)||[0,0,0,1]})),t}var Kn={linear:function(e){return(0,e6.NU)(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=U2.findPieceIndex(e,t,!0);if(null!=n)return(0,e6.NU)(n,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?-1:t},fixed:eB.ZT},Kr=eB.S6;function Ki(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function Ko(e,t,n){var r={};return Kr(t,function(t){var i,o=r[t]=((i=function(){}).prototype.__hidden=i.prototype,new i);Kr(e[t],function(e,r){if(U2.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),o[r]=new U2(i),"opacity"===r&&((i=eB.d9(i)).type="colorAlpha",o.__hidden.__alphaForOpacity=new U2(i))}})}),r}var Ka=U2.mapVisual,Ks=U2.eachVisual,Kl=eB.kJ,Ku=eB.S6,Kc=e6.dt,Kd=e6.NU,Kh=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return(0,eH.ZT)(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n,r,i=this.option;t||(n=this.replacableOptionKeys,eB.S6(n,function(t){e.hasOwnProperty(t)&&Ki(e[t])&&(r=!0)}),r&&eB.S6(n,function(t){e.hasOwnProperty(t)&&Ki(e[t])?i[t]=eB.d9(e[t]):delete i[t]})),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=eB.ak(e,this),this.controllerVisuals=Ko(this.option.controller,t,e),this.targetVisuals=Ko(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries(function(e,n){t.push(n)}):t=t4.kF(e),t},t.prototype.eachTargetSeries=function(e,t){eB.S6(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r,i=this.option,o=i.precision,a=this.dataBound,s=i.formatter;n=n||["<",">"],eB.kJ(e)&&(e=e.slice(),r=!0);var l=t?e:r?[u(e[0]),u(e[1])]:u(e);if(eB.HD(s))return s.replace("{value}",r?l[0]:l).replace("{value2}",r?l[1]:l);if(eB.mf(s))return r?s(e[0],e[1]):s(e);if(!r)return l;return e[0]===a[0]?n[0]+" "+l[1]:e[1]===a[1]?n[1]+" "+l[0]:l[0]+" - "+l[1];function u(e){return e===a[0]?"min":e===a[1]?"max":(+e).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var e=this.option,t=Kc([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimensionIndex=function(e){var t=this.option.dimension;if(null!=t)return e.getDimensionIndex(t);for(var n=e.dimensions,r=n.length-1;r>=0;r--){var i=n[r],o=e.getDimensionInfo(i);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||(t.target={}),i=t.controller||(t.controller={});eB.TS(r,n),eB.TS(i,n);var o=this.isCategory();function a(n){Kl(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}a.call(this,r),a.call(this,i),(function(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},Ku(r,function(e,t){if(U2.isValidType(t)){var n=UQ.get(t,"inactive",o);null==n||(i[t]=n,"color"!==t||i.hasOwnProperty("opacity")||i.hasOwnProperty("colorAlpha")||(i.opacity=[0,0]))}}))}).call(this,r,"inRange","outOfRange"),(function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get("inactiveColor"),i=this.getItemSymbol()||"roundRect";Ku(this.stateList,function(a){var s=this.itemSize,l=e[a];l||(l=e[a]={color:o?r:[r]}),null==l.symbol&&(l.symbol=t&&eB.d9(t)||(o?i:[i])),null==l.symbolSize&&(l.symbolSize=n&&eB.d9(n)||(o?s[0]:[s[0],s[0]])),l.symbol=Ka(l.symbol,function(e){return"none"===e?i:e});var u=l.symbolSize;if(null!=u){var c=-1/0;Ks(u,function(e){e>c&&(c=e)}),l.symbolSize=Ka(u,function(e){return Kd(e,[0,c],[0,s[0]],!0)})}},this)}).call(this,i)},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(Rf.Z),Kp=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(null==t[0]||isNaN(t[0]))&&(t[0]=20),(null==t[1]||isNaN(t[1]))&&(t[1]=140)},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):eB.kJ(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),eB.S6(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=e6.dt((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]<e[0]&&(t[0]=e[0]),t[1]<e[0]&&(t[1]=e[0]),t},t.prototype.getValueState=function(e){var t=this.option.range,n=this.getExtent();return(t[0]<=n[0]||t[0]<=e)&&(t[1]>=n[1]||e<=t[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries(function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)},this),t.push({seriesId:n.id,dataIndex:r})},this),t},t.prototype.getVisualMeta=function(e){var t=Kf(this,"outOfRange",this.getExtent()),n=Kf(this,"inRange",this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var o=0,a=0,s=n.length,l=t.length;a<l&&(!n.length||t[a]<=n[0]);a++)t[a]<n[o]&&i(t[a],"outOfRange");for(var u=1;o<s;o++,u=0)u&&r.length&&i(n[o],"outOfRange"),i(n[o],"inRange");for(var u=1;a<l;a++)(!n.length||n[n.length-1]<t[a])&&(u&&(r.length&&i(r[r.length-1].value,"outOfRange"),u=0),i(t[a],"outOfRange"));var c=r.length;return{stops:r,outerColors:[c?r[0].color:"transparent",c?r[c-1].color:"transparent"]}},t.type="visualMap.continuous",t.defaultOption=(0,eU.ZL)(Kh.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),t}(Kh);function Kf(e,t,n){if(n[0]===n[1])return n.slice();for(var r=(n[1]-n[0])/200,i=n[0],o=[],a=0;a<=200&&i<n[1];a++)o.push(i),i+=r;return o.push(n[1]),o}var Kg=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return(0,eH.ZT)(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,r){if(this.visualMapModel=e,!1===e.get("show")){this.group.removeAll();return}this.doRender(e,t,n,r)},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=P9.MY(t.get("padding")||0),r=e.getBoundingRect();e.add(new e0.Z({z2:-1,silent:!0,shape:{x:r.x-n[3],y:r.y-n[0],width:r.width+n[3]+n[1],height:r.height+n[0]+n[2]},style:{fill:t.get("backgroundColor"),stroke:t.get("borderColor"),lineWidth:t.get("borderWidth")}}))},t.prototype.getControllerVisual=function(e,t,n){var r=(n=n||{}).forceState,i=this.visualMapModel,o={};if("color"===t){var a=i.get("contentColor");o.color=a}function s(e){return o[e]}function l(e,t){o[e]=t}var u=i.controllerVisuals[r||i.getValueState(e)],c=U2.prepareVisualTypes(u);return eB.S6(c,function(r){var i=u[r];n.convertOpacityToAlpha&&"opacity"===r&&(r="colorAlpha",i=u.__alphaForOpacity),U2.dependsOn(r,t)&&i&&i.applyVisual(e,s,l)}),o[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api;Uv.p$(e,t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},t.prototype.doRender=function(e,t,n,r){},t.type="visualMap",t}(RR.Z),Km=[["left","right","width"],["top","bottom","height"]];function Kv(e,t,n){var r=e.option,i=r.align;if(null!=i&&"auto"!==i)return i;for(var o={width:t.getWidth(),height:t.getHeight()},a=+("horizontal"===r.orient),s=Km[a],l=[0,null,10],u={},c=0;c<3;c++)u[Km[1-a][c]]=l[c],u[s[c]]=2===c?n[0]:r[s[c]];var d=[["x","width",3],["y","height",0]][a],h=(0,Uv.ME)(u,o,r.padding);return s[(h.margin[d[2]]||0)+h[d[0]]+.5*h[d[1]]<.5*o[d[1]]?0:1]}function Ky(e,t){return eB.S6(e||[],function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")}),e}var Kb=n(6501),Kx=e6.NU,Kw=eB.S6,KS=Math.min,KC=Math.max,Kk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._shapes={},n._dataInterval=[],n._handleEnds=[],n._hoverLinkDataIndices=[],n}return(0,eH.ZT)(t,e),t.prototype.init=function(t,n){e.prototype.init.call(this,t,n),this._hoverLinkFromSeriesMouseOver=eB.ak(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=eB.ak(this._hideIndicator,this)},t.prototype.doRender=function(e,t,n,r){r&&"selectDataRange"===r.type&&r.from===this.uid||this._buildView()},t.prototype._buildView=function(){this.group.removeAll();var e=this.visualMapModel,t=this.group;this._orient=e.get("orient"),this._useHandle=e.get("calculable"),this._resetInterval(),this._renderBar(t);var n=e.get("text");this._renderEndsText(t,n,0),this._renderEndsText(t,n,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},t.prototype._renderEndsText=function(e,t,n){if(t){var r=t[1-n];r=null!=r?r+"":"";var i=this.visualMapModel,o=i.get("textGap"),a=i.itemSize,s=this._shapes.mainGroup,l=this._applyTransform([a[0]/2,0===n?-o:a[1]+o],s),u=this._applyTransform(0===n?"bottom":"top",s),c=this._orient,d=this.visualMapModel.textStyleModel;this.group.add(new nt.ZP({style:(0,e3.Lr)(d,{x:l[0],y:l[1],verticalAlign:"horizontal"===c?"middle":u,align:"horizontal"===c?u:"center",text:r})}))}},t.prototype._renderBar=function(e){var t=this.visualMapModel,n=this._shapes,r=t.itemSize,i=this._orient,o=this._useHandle,a=Kv(t,this.api,r),s=n.mainGroup=this._createBarGroup(a),l=new eX.Z;s.add(l),l.add(n.outOfRange=KM()),l.add(n.inRange=KM(null,o?KA(this._orient):null,eB.ak(this._dragHandle,this,"all",!1),eB.ak(this._dragHandle,this,"all",!0))),l.setClipPath(new e0.Z({shape:{x:0,y:0,width:r[0],height:r[1],r:3}}));var u=t.textStyleModel.getTextRect("国"),c=KC(u.width,u.height);o&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(t,s,0,r,c,i),this._createHandle(t,s,1,r,c,i)),this._createIndicator(t,s,r,c,i),e.add(s)},t.prototype._createHandle=function(e,t,n,r,i,o){var a=eB.ak(this._dragHandle,this,n,!1),s=eB.ak(this._dragHandle,this,n,!0),l=(0,to.GM)(e.get("handleSize"),r[0]),u=(0,vT.th)(e.get("handleIcon"),-l/2,-l/2,l,l,null,!0),c=KA(this._orient);u.attr({cursor:c,draggable:!0,drift:a,ondragend:s,onmousemove:function(e){Ok.sT(e.event)}}),u.x=r[0]/2,u.useStyle(e.getModel("handleStyle").getItemStyle()),u.setStyle({strokeNoScale:!0,strokeFirst:!0}),u.style.lineWidth*=2,u.ensureState("emphasis").style=e.getModel(["emphasis","handleStyle"]).getItemStyle(),(0,e5.Nj)(u,!0),t.add(u);var d=this.visualMapModel.textStyleModel,h=new nt.ZP({cursor:c,draggable:!0,drift:a,onmousemove:function(e){Ok.sT(e.event)},ondragend:s,style:(0,e3.Lr)(d,{x:0,y:0,text:""})});h.ensureState("blur").style={opacity:.1},h.stateTransition={duration:200},this.group.add(h);var p=[l,0],f=this._shapes;f.handleThumbs[n]=u,f.handleLabelPoints[n]=p,f.handleLabels[n]=h},t.prototype._createIndicator=function(e,t,n,r,i){var o=(0,to.GM)(e.get("indicatorSize"),n[0]),a=(0,vT.th)(e.get("indicatorIcon"),-o/2,-o/2,o,o,null,!0);a.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var s=e.getModel("indicatorStyle").getItemStyle();if(a instanceof ne.ZP){var l=a.style;a.useStyle(eB.l7({image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},s))}else a.useStyle(s);t.add(a);var u=this.visualMapModel.textStyleModel,c=new nt.ZP({silent:!0,invisible:!0,style:(0,e3.Lr)(u,{x:0,y:0,text:""})});this.group.add(c);var d=[("horizontal"===i?r/2:6)+n[0]/2,0],h=this._shapes;h.indicator=a,h.indicatorLabel=c,h.indicatorLabelPoint=d,this._firstShowIndicator=!0},t.prototype._dragHandle=function(e,t,n,r){if(this._useHandle){if(this._dragging=!t,!t){var i=this._applyTransform([n,r],this._shapes.mainGroup,!0);this._updateInterval(e,i[1]),this._hideIndicator(),this._updateView()}!this.visualMapModel.get("realtime")===t&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),t?this._hovering||this._clearHoverLinkToSeries():KT(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},t.prototype._resetInterval=function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),n=e.getExtent(),r=[0,e.itemSize[1]];this._handleEnds=[Kx(t[0],n,r,!0),Kx(t[1],n,r,!0)]},t.prototype._updateInterval=function(e,t){t=t||0;var n=this.visualMapModel,r=this._handleEnds,i=[0,n.itemSize[1]];(0,ET.Z)(t,r,i,e,0);var o=n.getExtent();this._dataInterval=[Kx(r[0],i,o,!0),Kx(r[1],i,o,!0)]},t.prototype._updateView=function(e){var t=this.visualMapModel,n=t.getExtent(),r=this._shapes,i=[0,t.itemSize[1]],o=e?i:this._handleEnds,a=this._createBarVisual(this._dataInterval,n,o,"inRange"),s=this._createBarVisual(n,n,i,"outOfRange");r.inRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),r.outOfRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),this._updateHandle(o,a)},t.prototype._createBarVisual=function(e,t,n,r){var i={forceState:r,convertOpacityToAlpha:!0},o=this._makeColorGradient(e,i),a=[this.getControllerVisual(e[0],"symbolSize",i),this.getControllerVisual(e[1],"symbolSize",i)],s=this._createBarPoints(n,a);return{barColor:new PJ.Z(0,0,0,1,o),barPoints:s,handlesColor:[o[0].color,o[o.length-1].color]}},t.prototype._makeColorGradient=function(e,t){var n=[],r=(e[1]-e[0])/100;n.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var i=1;i<100;i++){var o=e[0]+r*i;if(o>e[1])break;n.push({color:this.getControllerVisual(o,"color",t),offset:i/100})}return n.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),n},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get("inverse");return new eX.Z("horizontal"!==t||n?"horizontal"===t&&n?{scaleX:"bottom"===e?-1:1,rotation:-Math.PI/2}:"vertical"!==t||n?{scaleX:"left"===e?1:-1}:{scaleX:"left"===e?1:-1,scaleY:-1}:{scaleX:"bottom"===e?1:-1,rotation:Math.PI/2})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,o=n.handleLabels,a=r.itemSize,s=r.getExtent();Kw([0,1],function(l){var u=i[l];u.setStyle("fill",t.handlesColor[l]),u.y=e[l];var c=Kx(e[l],[0,a[1]],s,!0),d=this.getControllerVisual(c,"symbolSize");u.scaleX=u.scaleY=d/a[0],u.x=a[0]-d/2;var h=eJ.applyTransform(n.handleLabelPoints[l],eJ.getTransform(u,this.group));o[l].setStyle({x:h[0],y:h[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})},this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,o=i.getExtent(),a=i.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0}),d=this.getControllerVisual(e,"symbolSize"),h=Kx(e,o,s,!0),p=a[0]-d/2,f={x:u.x,y:u.y};u.y=h,u.x=p;var g=eJ.applyTransform(l.indicatorLabelPoint,eJ.getTransform(u,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var v=this._applyTransform("left",l.mainGroup),y="horizontal"===this._orient;m.setStyle({text:(n||"")+i.formatValueText(t),verticalAlign:y?v:"middle",align:y?"center":v});var b={x:p,y:h,style:{fill:c}},x={style:{x:g[0],y:g[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var w={duration:100,easing:"cubicInOut",additive:!0};u.x=f.x,u.y=f.y,u.animateTo(b,w),m.animateTo(x,w)}else u.attr(b),m.attr(x);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var C=0;C<S.length;C++)this.api.enterBlur(S[C])}},t.prototype._enableHoverLinkToSeries=function(){var e=this;this._shapes.mainGroup.on("mousemove",function(t){if(e._hovering=!0,!e._dragging){var n=e.visualMapModel.itemSize,r=e._applyTransform([t.offsetX,t.offsetY],e._shapes.mainGroup,!0,!0);r[1]=KS(KC(0,r[1]),n[1]),e._doHoverLinkToSeries(r[1],0<=r[0]&&r[0]<=n[0])}}).on("mouseout",function(){e._hovering=!1,e._dragging||e._clearHoverLinkToSeries()})},t.prototype._enableHoverLinkFromSeries=function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),e.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},t.prototype._doHoverLinkToSeries=function(e,t){var n=this.visualMapModel,r=n.itemSize;if(n.option.hoverLink){var i,o,a,s,l,u=[0,r[1]],c=n.getExtent();e=KS(KC(u[0],e),u[1]);var d=(i=n,o=c,a=u,s=6,(l=i.get("hoverLinkDataSize"))&&(s=Kx(l,o,a,!0)/2),s),h=[e-d,e+d],p=Kx(e,u,c,!0),f=[Kx(h[0],u,c,!0),Kx(h[1],u,c,!0)];h[0]<u[0]&&(f[0]=-1/0),h[1]>u[1]&&(f[1]=1/0),t&&(f[0]===-1/0?this._showIndicator(p,f[1],"< ",d):f[1]===1/0?this._showIndicator(p,f[0],"> ",d):this._showIndicator(p,p,"≈ ",d));var g=this._hoverLinkDataIndices,m=[];(t||KT(n))&&(m=this._hoverLinkDataIndices=n.findTargetDataIndices(f));var v=t4.XI(g,m);this._dispatchHighDown("downplay",Ky(v[0],n)),this._dispatchHighDown("highlight",Ky(v[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){if((0,Kb.o)(e.target,function(e){var n=(0,e2.A)(e);if(null!=n.dataIndex)return t=n,!0},!0),t){var t,n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),o=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n<t.length;n++)this.api.leaveBlur(t[n])},t.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",Ky(e,this.visualMapModel)),e.length=0},t.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var e=this.api.getZr();e.off("mouseover",this._hoverLinkFromSeriesMouseOver),e.off("mouseout",this._hideIndicator)},t.prototype._applyTransform=function(e,t,n,r){var i=eJ.getTransform(t,r?null:this.group);return eB.kJ(e)?eJ.applyTransform(e,i,n):eJ.transformDirection(e,i,n)},t.prototype._dispatchHighDown=function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},t.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},t.type="visualMap.continuous",t}(Kg);function KM(e,t,n,r){return new Rx.Z({shape:{points:e},draggable:!!n,cursor:t,drift:n,onmousemove:function(e){Ok.sT(e.event)},ondragend:r})}function KT(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function KA(e){return"vertical"===e?"ns-resize":"ew-resize"}var KI={type:"selectDataRange",event:"dataRangeSelected",update:"update"},KP=function(e,t){t.eachComponent({mainType:"visualMap",query:e},function(t){t.setSelected(e.selected)})},KR=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent("visualMap",function(t){var r,i,o,a,s,l=e.pipelineContext;t.isTargetSeries(e)&&(!l||!l.large)&&n.push((r=t.stateList,i=t.targetVisuals,o=eB.ak(t.getValueState,t),a=t.getDataDimensionIndex(e.getData()),s={},eB.S6(r,function(e){var t=U2.prepareVisualTypes(i[e]);s[e]=t}),{progress:function(e,t){function n(e){return(0,RD.Or)(t,u,e)}function r(e,n){(0,RD.LZ)(t,u,e,n)}null!=a&&(l=t.getDimensionIndex(a));for(var l,u,c=t.getStore();null!=(u=e.next());){var d=t.getRawDataItem(u);if(!d||!1!==d.visualMap)for(var h=null!=a?c.get(l,u):u,p=o(h),f=i[p],g=s[p],m=0,v=g.length;m<v;m++){var y=g[m];f[y]&&f[y].applyVisual(h,n,r)}}}}))}),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),r=[];t.eachComponent("visualMap",function(t){if(t.isTargetSeries(e)){var i=t.getVisualMeta(eB.ak(KO,null,e,t))||{stops:[],outerColors:[]},o=t.getDataDimensionIndex(n);o>=0&&(i.dimension=o,r.push(i))}}),e.getData().setVisual("visualMeta",r)}}];function KO(e,t,n,r){for(var i=t.targetVisuals[r],o=U2.prepareVisualTypes(i),a={color:(0,RD.UL)(e.getData(),"color")},s=0,l=o.length;s<l;s++){var u=o[s],c=i["opacity"===u?"__alphaForOpacity":u];c&&c.applyVisual(n,d,h)}return a.color;function d(e){return a[e]}function h(e,t){a[e]=t}}var KE=eB.S6;function KD(e){var t=e&&e.visualMap;eB.kJ(t)||(t=t?[t]:[]),KE(t,function(e){if(e){KL(e,"splitList")&&!KL(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&eB.kJ(t)&&KE(t,function(e){eB.Kn(e)&&(KL(e,"start")&&!KL(e,"min")&&(e.min=e.start),KL(e,"end")&&!KL(e,"max")&&(e.max=e.end))})}})}function KL(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var K_=!1;function KN(e){!K_&&(K_=!0,e.registerSubTypeDefaulter("visualMap",function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}),e.registerAction(KI,KP),(0,eB.S6)(KR,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(KD))}function KZ(e){e.registerComponentModel(Kp),e.registerComponentView(Kk),KN(e)}var Kj=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return(0,eH.ZT)(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],KB[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){"categories"===r?(e.mappingMethod="category",e.categories=eB.d9(i)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=eB.UI(this._pieceList,function(e){return e=eB.d9(e),"inRange"!==t&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=U2.listVisualTypes(),i=this.isCategory();function o(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}eB.S6(t.pieces,function(e){eB.S6(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),eB.S6(n,function(e,n){var r=!1;eB.S6(this.stateList,function(e){r=r||o(t,e,n)||o(t.target,e,n)},this),r||eB.S6(this.stateList,function(e){(t[e]||(t[e]={}))[n]=UQ.get(n,"inRange"===e?"active":"inactive",i)})},this),e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,eB.S6(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),"single"===n.selectedMode){var o=!1;eB.S6(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(o?i[n]=!1:o=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(e){return"categories"===this._mode?e.value+"":e.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=eB.d9(e)},t.prototype.getValueState=function(e){var t=U2.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],o=r.getData();o.each(this.getDataDimensionIndex(o),function(t,r){U2.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(!this.isCategory()){var t=[],n=["",""],r=this,i=this._pieceList.slice();if(i.length){var o=i[0].interval[0];o!==-1/0&&i.unshift({interval:[-1/0,o]}),(o=i[i.length-1].interval[1])!==1/0&&i.push({interval:[o,1/0]})}else i.push({interval:[-1/0,1/0]});var a=-1/0;return eB.S6(i,function(e){var t=e.interval;t&&(t[0]>a&&s([a,t[0]],"outOfRange"),s(t.slice()),a=t[1])},this),{stops:t,outerColors:n}}function s(i,o){var a=r.getRepresentValue({interval:i});o||(o=r.getValueState(a));var s=e(a,o);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}},t.type="visualMap.piecewise",t.defaultOption=(0,eU.ZL)(Kh.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(Kh),KB={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var o=(r[1]-r[0])/i;+o.toFixed(n)!==o&&n<5;)n++;t.precision=n,o=+o.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var a=0,s=r[0];a<i;s+=o,a++){var l=a===i-1?r[1]:s+o;e.push({interval:[s,l],close:[1,1]})}t.maxOpen&&e.push({interval:[r[1],1/0],close:[0,0]}),(0,e6.nR)(e),eB.S6(e,function(e,t){e.index=t,e.text=this.formatValueText(e.interval)},this)},categories:function(e){var t=this.option;eB.S6(t.categories,function(t){e.push({text:this.formatValueText(t,!0),value:t})},this),KF(t,e)},pieces:function(e){var t=this.option;eB.S6(t.pieces,function(t,n){eB.Kn(t)||(t={value:t});var r={text:"",index:n};if(null!=t.label&&(r.text=t.label),t.hasOwnProperty("value")){var i=r.value=t.value;r.interval=[i,i],r.close=[1,1]}else{for(var o=r.interval=[],a=r.close=[0,0],s=[1,0,1],l=[-1/0,1/0],u=[],c=0;c<2;c++){for(var d=[["gte","gt","min"],["lte","lt","max"]][c],h=0;h<3&&null==o[c];h++)o[c]=t[d[h]],a[c]=s[h],u[c]=2===h;null==o[c]&&(o[c]=l[c])}u[0]&&o[1]===1/0&&(a[0]=0),u[1]&&o[0]===-1/0&&(a[1]=0),o[0]===o[1]&&a[0]&&a[1]&&(r.value=o[0])}r.visual=U2.retrieveVisuals(t),e.push(r)},this),KF(t,e),(0,e6.nR)(e),eB.S6(e,function(e){var t=e.close,n=[["<","≤"][t[1]],[">","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,n)},this)}};function KF(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}var Kz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,eH.ZT)(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),r=t.textStyleModel,i=r.getFont(),o=r.getTextColor(),a=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,c=eB.Jv(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,c,a),eB.S6(l.viewPieceList,function(r){var l=r.piece,u=new eX.Z;u.onclick=eB.ak(this._onItemClick,this,l),this._enableHoverLink(u,r.indexInModelPieceList);var d=t.getRepresentValue(l);if(this._createItemSymbol(u,d,[0,0,s[0],s[1]]),c){var h=this.visualMapModel.getValueState(d);u.add(new nt.ZP({style:{x:"right"===a?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:a,font:i,fill:o,opacity:"outOfRange"===h?.5:1}}))}e.add(u)},this),u&&this._renderEndsText(e,u[1],s,c,a),Uv.BZ(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on("mouseover",function(){return r("highlight")}).on("mouseout",function(){return r("downplay")});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:Ky(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return Kv(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var o=new eX.Z,a=this.visualMapModel.textStyleModel;o.add(new nt.ZP({style:(0,e3.Lr)(a,{x:r?"right"===i?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:r?i:"center",text:t})})),e.add(o)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=eB.UI(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get("text"),r=e.get("orient"),i=e.get("inverse");return("horizontal"===r?i:!i)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n){e.add((0,vT.th)(this.getControllerVisual(t,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(t,"color")))},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=eB.d9(n.selected),o=t.getSelectedMapKey(e);"single"===r||!0===r?(i[o]=!0,eB.S6(i,function(e,t){i[t]=t===o})):i[o]=!i[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type="visualMap.piecewise",t}(Kg);function K$(e){e.registerComponentModel(Kj),e.registerComponentView(Kz),KN(e)}(0,ej.D)([function(e){e.registerChartView(UK),e.registerSeriesModel(UX)},function(e){(0,ej.D)(KZ),(0,ej.D)(K$)},tI.N,tP.N,tR.N,tO.N,tE.N]);let KV=e=>{var t;let{height:n,data:r,xAxisCategories:i,yAxisCategories:o,timeScale:a,colors:s}=e,{timeZone:l}=EV(),u=tJ(),c=ot(),d={tooltip:{appendToBody:!0,formatter:e=>(function({data:e,label:t,marker:n,xAxisCategories:r,yAxisCategories:i,theme:o}){let[a,s]=e,{formattedDate:l,formattedTime:u}=EF(r[a]),c=(0,en.css)`
153
- border-bottom: 1px solid ${o.palette.grey[500]};
154
- padding-bottom: 8px;
155
- `,d=(0,en.css)`
156
- display: flex;
157
- justify-content: space-between;
158
- padding-top: 8px;
159
- `,h=(0,en.css)`
160
- margin-right: 16px;
161
- `;return`
162
- <div>
163
- <div style="${c.styles}">${l} ${u}</div>
164
- <div style="${d.styles}">
165
- <div style="${h.styles}">
166
- ${n}
167
- <strong>${i[s]}</strong>
168
- </div>
169
- <div>
170
- ${t}
171
- </div>
172
- </div>
173
- </div>
174
- `})({data:e.data.value,label:e.data.label,marker:e.marker,xAxisCategories:i,yAxisCategories:o,theme:c})},grid:{top:"5%",bottom:"5%"},xAxis:{type:"category",data:i,axisLine:{show:!1},splitArea:{show:!1},axisLabel:{hideOverlap:!0,formatter:(t=a?.rangeMs??0,function(e){let n=new Date(Number(e));return t>15768e7?EZ(n,"yyy",l):t>63072e6?EZ(n,"MMM yyy",l):t>864e6&&t<1577664e4?EZ(n,"dd.MM",l):t>1728e5&&t<=864e6?EZ(n,"dd.MM HH:mm",l):EZ(n,"HH:mm",l)})}},yAxis:{type:"category",data:o,axisLine:{show:!1},splitArea:{show:!1,interval:0},splitLine:{show:!1},axisLabel:{interval:0}},visualMap:{show:!1,type:"piecewise",pieces:s},series:[{name:"Status history",type:"heatmap",coordinateSystem:"cartesian2d",data:r,label:{show:!1},itemStyle:{borderWidth:1,borderType:"solid",borderColor:"#ffffff"},emphasis:{itemStyle:{opacity:.5}}}]};return(0,f.jsx)(tU,{style:{height:n},sx:{overflow:"auto"},children:(0,f.jsx)(n6,{sx:{width:"100%",height:n},option:d,theme:u.echartsTheme})})},KH="#1f77b4";function KW(e,t){t.match(/^#[0-9A-Fa-f]{6}$/)||(t=KH);try{let[n,r,i]=KG(t);if(isNaN(n)||isNaN(r)||isNaN(i))throw Error("Invalid HSL values");let o=String(e).split("").reduce((e,t)=>e+t.charCodeAt(0),0),a=Math.min(r+10,90),s=KU(Math.abs((n+o%6*60)%360),Math.min(Math.max(a,50),90),Math.min(Math.max(i+(o%2?15:-15),30),70));if(!s.match(/^#[0-9A-Fa-f]{6}$/))throw Error("Invalid generated color");return s}catch(e){return KH}}function Kq(e,t){return t.length>=e.length?t.slice(0,e.length):e.map((e,n)=>n<t.length?t[n]||KH:KW(e,t[0]||KH))}function KG(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),o=Math.min(t,n,r),a=0,s=0,l=(i+o)/2;if(i!==o){let e=i-o;switch(s=l>.5?e/(2-i-o):e/(i+o),i){case t:a=(n-r)/e+6*(n<r);break;case n:a=(r-t)/e+2;break;case r:a=(t-n)/e+4}a/=6}return[360*a,100*s,100*l]}function KU(e,t,n){let r=t*Math.min(n/=100,1-n)/100,i=t=>{let i=(t+e/30)%12;return Math.round(255*(n-r*Math.max(Math.min(i-3,9-i,1),-1))).toString(16).padStart(2,"0")};return`#${i(0)}${i(8)}${i(4)}`}var KK=n(1104);let KY=(e,t)=>e.filter(e=>t.includes(e)),KX=(e,t,n)=>{let r=e.keys[0];Array.isArray(t)?t.forEach((t,r)=>{n((t,n)=>{r<=e.keys.length-1&&(0===r?Object.assign(t,n):t[e.up(e.keys[r])]=n)},t)}):t&&"object"==typeof t?(Object.keys(t).length>e.keys.length?e.keys:KY(e.keys,Object.keys(t))).forEach(i=>{if(e.keys.includes(i)){let o=t[i];void 0!==o&&n((t,n)=>{r===i?Object.assign(t,n):t[e.up(i)]=n},o)}}):("number"==typeof t||"string"==typeof t)&&n((e,t)=>{Object.assign(e,t)},t)};function KJ(e){return`--Grid-${e}Spacing`}function KQ(e){return`--Grid-parent-${e}Spacing`}let K0="--Grid-columns",K1="--Grid-parent-columns",K2=({theme:e,ownerState:t})=>{let n={};return KX(e.breakpoints,t.size,(e,t)=>{let r={};"grow"===t&&(r={flexBasis:0,flexGrow:1,maxWidth:"100%"}),"auto"===t&&(r={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"}),"number"==typeof t&&(r={flexGrow:0,flexBasis:"auto",width:`calc(100% * ${t} / var(${K1}) - (var(${K1}) - ${t}) * (var(${KQ("column")}) / var(${K1})))`}),e(n,r)}),n},K5=({theme:e,ownerState:t})=>{let n={};return KX(e.breakpoints,t.offset,(e,t)=>{let r={};"auto"===t&&(r={marginLeft:"auto"}),"number"==typeof t&&(r={marginLeft:0===t?"0px":`calc(100% * ${t} / var(${K1}) + var(${KQ("column")}) * ${t} / var(${K1}))`}),e(n,r)}),n},K3=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={[K0]:12};return KX(e.breakpoints,t.columns,(e,t)=>{let r=t??12;e(n,{[K0]:r,"> *":{[K1]:r}})}),n},K4=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={};return KX(e.breakpoints,t.rowSpacing,(t,r)=>{let i="string"==typeof r?r:e.spacing?.(r);t(n,{[KJ("row")]:i,"> *":{[KQ("row")]:i}})}),n},K6=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={};return KX(e.breakpoints,t.columnSpacing,(t,r)=>{let i="string"==typeof r?r:e.spacing?.(r);t(n,{[KJ("column")]:i,"> *":{[KQ("column")]:i}})}),n},K8=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={};return KX(e.breakpoints,t.direction,(e,t)=>{e(n,{flexDirection:t})}),n},K9=({ownerState:e})=>({minWidth:0,boxSizing:"border-box",...e.container&&{display:"flex",flexWrap:"wrap",...e.wrap&&"wrap"!==e.wrap&&{flexWrap:e.wrap},gap:`var(${KJ("row")}) var(${KJ("column")})`}}),K7=e=>{let t=[];return Object.entries(e).forEach(([e,n])=>{!1!==n&&void 0!==n&&t.push(`grid-${e}-${String(n)}`)}),t},Ye=(e,t="xs")=>{function n(e){return void 0!==e&&("string"==typeof e&&!Number.isNaN(Number(e))||"number"==typeof e&&e>0)}if(n(e))return[`spacing-${t}-${String(e)}`];if("object"==typeof e&&!Array.isArray(e)){let t=[];return Object.entries(e).forEach(([e,r])=>{n(r)&&t.push(`spacing-${e}-${String(r)}`)}),t}return[]},Yt=e=>void 0===e?[]:"object"==typeof e?Object.entries(e).map(([e,t])=>`direction-${e}-${t}`):[`direction-xs-${String(e)}`],Yn=(0,tB.Z)(),Yr=rr("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>t.root});function Yi(e){return ro({props:e,name:"MuiGrid",defaultTheme:Yn})}let Yo=function(e={}){let{createStyledComponent:t=Yr,useThemeProps:n=Yi,useTheme:r=t$,componentName:i="MuiGrid"}=e,o=(e,t)=>{let{container:n,direction:r,spacing:o,wrap:a,size:s}=e,l={root:["root",n&&"container","wrap"!==a&&`wrap-xs-${String(a)}`,...Yt(r),...K7(s),...n?Ye(o,t.breakpoints.keys[0]):[]]};return(0,y.Z)(l,e=>(0,A.ZP)(i,e),{})};function a(e,t,n=()=>!0){let r={};return null===e||(Array.isArray(e)?e.forEach((e,i)=>{null!==e&&n(e)&&t.keys[i]&&(r[t.keys[i]]=e)}):"object"==typeof e?Object.keys(e).forEach(t=>{let i=e[t];null!=i&&n(i)&&(r[t]=i)}):r[t.keys[0]]=e),r}let s=t(K3,K6,K4,K2,K8,K9,K5),l=g.forwardRef(function(e,t){let i=r(),l=tj(n(e));!function(e,t){let n=[];void 0!==e.item&&(delete e.item,n.push("item")),void 0!==e.zeroMinWidth&&(delete e.zeroMinWidth,n.push("zeroMinWidth")),t.keys.forEach(t=>{void 0!==e[t]&&(n.push(t),delete e[t])})}(l,i.breakpoints);let{className:u,children:c,columns:d=12,container:h=!1,component:p="div",direction:m="row",wrap:y="wrap",size:b={},offset:x={},spacing:w=0,rowSpacing:S=w,columnSpacing:C=w,unstable_level:k=0,...M}=l,T=a(b,i.breakpoints,e=>!1!==e),A=a(x,i.breakpoints),I=e.columns??(k?void 0:d),P=e.spacing??(k?void 0:w),R=e.rowSpacing??e.spacing??(k?void 0:S),O=e.columnSpacing??e.spacing??(k?void 0:C),E={...l,level:k,columns:I,container:h,direction:m,wrap:y,spacing:P,rowSpacing:R,columnSpacing:O,size:T,offset:A},D=o(E,i);return(0,f.jsx)(s,{ref:t,as:p,ownerState:E,className:(0,v.Z)(D.root,u),...M,children:g.Children.map(c,e=>g.isValidElement(e)&&(0,KK.Z)(e,["Grid"])&&h&&e.props.container?g.cloneElement(e,{unstable_level:e.props?.unstable_level??k+1}):e)})});return l.muiName="Grid",l}({createStyledComponent:(0,S.ZP)("div",{name:"MuiGrid2",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.container&&t.container]}}),componentName:"MuiGrid2",useThemeProps:e=>(0,M.i)({props:e,name:"MuiGrid2"}),useTheme:ot}),Ya=({mapping:e,onChange:t,...n})=>{switch(e.kind){case"Value":return(0,f.jsx)(rf,{gap:1,direction:"row",...n,children:(0,f.jsx)(aC,{label:"Value",placeholder:"Exact value",value:e.spec?.value??"",onChange:n=>t({...e,spec:{...e.spec,value:n.target.value}}),fullWidth:!0})});case"Range":return(0,f.jsxs)(rf,{gap:1,direction:"row",...n,children:[(0,f.jsx)(aC,{label:"From",placeholder:"Start of range",value:e.spec?.from??"",onChange:n=>t({...e,spec:{...e.spec,from:""===n.target.value?void 0:+n.target.value}}),fullWidth:!0}),(0,f.jsx)(aC,{label:"To",placeholder:"End of range (inclusive)",value:e.spec?.to??"",onChange:n=>t({...e,spec:{...e.spec,to:""===n.target.value?void 0:+n.target.value}}),fullWidth:!0})]});case"Regex":return(0,f.jsx)(rf,{gap:1,direction:"row",...n,children:(0,f.jsx)(aC,{label:"Regular Expression",placeholder:"JavaScript regular expression",value:e.spec?.pattern??"",onChange:n=>t({...e,spec:{...e.spec,pattern:n.target.value}}),fullWidth:!0})});case"Misc":return(0,f.jsx)(rf,{gap:1,direction:"row",...n,children:(0,f.jsxs)(aC,{select:!0,label:"Value",value:e.spec?.value??"",onChange:n=>t({...e,spec:{value:n.target.value}}),SelectProps:{renderValue:e=>{switch(e){case"empty":return"Empty";case"null":return"Null";case"NaN":return"NaN";case"true":return"True";case"false":return"False";default:return String(e)}}},fullWidth:!0,children:[(0,f.jsx)(d3,{value:"empty",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"Empty"}),(0,f.jsx)(c1,{variant:"caption",children:"Matches empty string"})]})}),(0,f.jsx)(d3,{value:"null",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"Null"}),(0,f.jsx)(c1,{variant:"caption",children:"Matches null or undefined"})]})}),(0,f.jsx)(d3,{value:"NaN",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"NaN"}),(0,f.jsx)(c1,{variant:"caption",children:"Matches Not a Number value"})]})}),(0,f.jsx)(d3,{value:"true",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"True"}),(0,f.jsx)(c1,{variant:"caption",children:"Matches true boolean"})]})}),(0,f.jsx)(d3,{value:"false",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"False"}),(0,f.jsx)(c1,{variant:"caption",children:"Matches false boolean"})]})})]})});default:return null}},Ys=({mapping:e,onChange:t,onDelete:n,...r})=>{let i=n=>{t({...e,spec:{...e.spec,result:{...e.spec.result,color:n}}})};return(0,f.jsxs)(Yo,{container:!0,spacing:2,...r,children:[(0,f.jsx)(Yo,{size:{xs:5},children:(0,f.jsxs)(rf,{direction:"row",gap:1,width:"100%",children:[(0,f.jsxs)(aC,{select:!0,label:"Type",value:e.kind,onChange:n=>t({...e,kind:n.target.value}),required:!0,sx:{width:"120px"},children:[(0,f.jsx)(d3,{value:"Value",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"Value"}),"Value"!==e.kind&&(0,f.jsx)(c1,{variant:"caption",children:"Matches an exact text value"})]})}),(0,f.jsx)(d3,{value:"Range",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"Range"}),"Range"!==e.kind&&(0,f.jsx)(c1,{variant:"caption",children:"Matches against a numerical range"})]})}),(0,f.jsx)(d3,{value:"Regex",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"Regex"}),"Regex"!==e.kind&&(0,f.jsx)(c1,{variant:"caption",children:"Matches against a regular expression"})]})}),(0,f.jsx)(d3,{value:"Misc",children:(0,f.jsxs)(rf,{children:[(0,f.jsx)(c1,{children:"Misc"}),"Misc"!==e.kind&&(0,f.jsx)(c1,{variant:"caption",children:"Matches against empty, null and NaN values"})]})})]}),(0,f.jsx)(Ya,{width:"100%",mapping:e,onChange:n=>t({...e,...n})})]})}),(0,f.jsx)(Yo,{size:{xs:4},children:(0,f.jsx)(aC,{label:"Display text",value:e.spec?.result?.value??"",onChange:n=>t({...e,spec:{...e.spec,result:{...e.spec?.result,value:n.target.value}}}),fullWidth:!0})}),(0,f.jsx)(Yo,{size:{xs:1},children:(0,f.jsx)(rf,{direction:"row",justifyContent:"center",gap:1,children:e.spec?.result?.color?(0,f.jsx)(a9,{label:"Color",color:e.spec.result.color??"#000",onColorChange:i,onClear:()=>i(void 0)}):(0,f.jsx)(rx,{onClick:()=>i("#000"),children:(0,f.jsx)(LF.default,{})})})}),(0,f.jsx)(Yo,{size:{xs:1},textAlign:"end",children:(0,f.jsx)(gg,{title:"Remove mapping settings",placement:"top",children:(0,f.jsx)(rx,{size:"small",sx:{marginLeft:"auto"},onClick:n,children:(0,f.jsx)(_M.default,{})})})})]})},Yl=({mappings:e,onChange:t})=>{let[n,r]=(0,g.useState)(e);return(0,f.jsxs)(rf,{spacing:1,children:[(0,f.jsxs)(Yo,{container:!0,spacing:2,children:[(0,f.jsx)(Yo,{size:{xs:5},children:(0,f.jsx)(c1,{variant:"subtitle1",children:"Condition"})}),(0,f.jsx)(Yo,{size:{xs:4},children:(0,f.jsx)(c1,{variant:"subtitle1",children:"Display Text"})}),(0,f.jsx)(Yo,{size:{xs:1},textAlign:"center",children:(0,f.jsx)(c1,{variant:"subtitle1",children:"Color"})}),(0,f.jsx)(Yo,{size:{xs:1}})]}),(0,f.jsx)(rf,{gap:1.5,divider:(0,f.jsx)(vw,{flexItem:!0,orientation:"horizontal"}),children:n.map((e,i)=>(0,f.jsx)(Ys,{mapping:e,onChange:e=>(function(e,i){let o=[...n];o[e]=i,r(o),t(o)})(i,e),onDelete:()=>(function(e){let i=[...n];i.splice(e,1),r(i),t(i)})(i)},i))}),(0,f.jsx)(e_,{variant:"contained",startIcon:(0,f.jsx)(LF.default,{}),sx:{marginTop:1},onClick:function(){let e=[...n];e.push({kind:"Value",spec:{result:{value:""}}}),r(e),t(e)},children:"Add value mappings"})]})}},8118:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.bindAll=void 0;var i=n(3778);function o(e){return void 0===e?void 0:"boolean"==typeof e?{capture:e}:e}t.bindAll=function(e,t,n){var a=t.map(function(t){var a=null==n?t:r(r({},t),{options:r(r({},o(n)),o(t.options))});return(0,i.bind)(e,a)});return function(){a.forEach(function(e){return e()})}}},3778:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bind=void 0,t.bind=function(e,t){var n=t.type,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}},501:function(e,t,n){"use strict";t.bindAll=t.bind=void 0;var r=n(3778);Object.defineProperty(t,"bind",{enumerable:!0,get:function(){return r.bind}});var i=n(8118);Object.defineProperty(t,"bindAll",{enumerable:!0,get:function(){return i.bindAll}})},2545:function(e,t,n){var r=n(1822)(n(7400),"DataView");e.exports=r},6586:function(e,t,n){var r=n(7753),i=n(2452),o=n(2115),a=n(8256),s=n(7426);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},6301:function(e,t,n){var r=n(3663),i=n(2470),o=n(6165),a=n(1873),s=n(2556);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},7836:function(e,t,n){var r=n(1822)(n(7400),"Map");e.exports=r},4554:function(e,t,n){var r=n(9448),i=n(7738),o=n(6575),a=n(7238),s=n(8738);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},4825:function(e,t,n){var r=n(1822)(n(7400),"Promise");e.exports=r},8697:function(e,t,n){var r=n(1822)(n(7400),"Set");e.exports=r},2485:function(e,t,n){var r=n(4554),i=n(8639),o=n(8379);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},3694:function(e,t,n){var r=n(6301),i=n(7354),o=n(5863),a=n(2367),s=n(748),l=n(7569);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=l,e.exports=u},6539:function(e,t,n){var r=n(7400).Symbol;e.exports=r},9942:function(e,t,n){var r=n(7400).Uint8Array;e.exports=r},6902:function(e,t,n){var r=n(1822)(n(7400),"WeakMap");e.exports=r},9349:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},263:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},8213:function(e,t,n){var r=n(4701),i=n(2900),o=n(9785),a=n(3854),s=n(2383),l=n(8519),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&a(e),h=!n&&!c&&!d&&l(e),p=n||c||d||h,f=p?r(e.length,String):[],g=f.length;for(var m in e)(t||u.call(e,m))&&!(p&&("length"==m||d&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,g)))&&f.push(m);return f}},7141:function(e){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},756:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},3140:function(e,t,n){var r=n(8799),i=n(5638);e.exports=function(e,t,n){(void 0===n||i(e[t],n))&&(void 0!==n||t in e)||r(e,t,n)}},1928:function(e,t,n){var r=n(8799),i=n(5638),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},3382:function(e,t,n){var r=n(5638);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return -1}},8799:function(e,t,n){var r=n(2630);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},158:function(e,t,n){var r=n(1611),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},9819:function(e,t,n){var r=n(8361)();e.exports=r},1324:function(e,t,n){var r=n(7141),i=n(9785);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},9736:function(e,t,n){var r=n(6539),i=n(4840),o=n(1258),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},5829:function(e,t,n){var r=n(9736),i=n(2360);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},2866:function(e,t,n){var r=n(2772),i=n(2360);e.exports=function e(t,n,o,a,s){return t===n||(null!=t&&null!=n&&(i(t)||i(n))?r(t,n,o,a,e,s):t!=t&&n!=n)}},2772:function(e,t,n){var r=n(3694),i=n(7042),o=n(370),a=n(9584),s=n(3533),l=n(9785),u=n(3854),c=n(8519),d="[object Arguments]",h="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,v){var y=l(e),b=l(t),x=y?h:s(e),w=b?h:s(t);x=x==d?p:x,w=w==d?p:w;var S=x==p,C=w==p,k=x==w;if(k&&u(e)){if(!u(t))return!1;y=!0,S=!1}if(k&&!S)return v||(v=new r),y||c(e)?i(e,t,n,g,m,v):o(e,t,x,n,g,m,v);if(!(1&n)){var M=S&&f.call(e,"__wrapped__"),T=C&&f.call(t,"__wrapped__");if(M||T){var A=M?e.value():e,I=T?t.value():t;return v||(v=new r),m(A,I,n,g,v)}}return!!k&&(v||(v=new r),a(e,t,n,g,m,v))}},6729:function(e,t,n){var r=n(8338),i=n(9678),o=n(1611),a=n(6532),s=/^\[object .+?Constructor\]$/,l=Object.prototype,u=Function.prototype.toString,c=l.hasOwnProperty,d=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:s).test(a(e))}},6972:function(e,t,n){var r=n(9736),i=n(4194),o=n(2360),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},186:function(e,t,n){var r=n(6016),i=n(962),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},9464:function(e,t,n){var r=n(1611),i=n(6016),o=n(1586),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)"constructor"==s&&(t||!a.call(e,s))||n.push(s);return n}},15:function(e,t,n){var r=n(3694),i=n(3140),o=n(9819),a=n(8867),s=n(1611),l=n(3893),u=n(7494);e.exports=function e(t,n,c,d,h){t!==n&&o(n,function(o,l){if(h||(h=new r),s(o))a(t,n,l,c,e,d,h);else{var p=d?d(u(t,l),o,l+"",t,n,h):void 0;void 0===p&&(p=o),i(t,l,p)}},l)}},8867:function(e,t,n){var r=n(3140),i=n(2734),o=n(3428),a=n(7561),s=n(7635),l=n(2900),u=n(9785),c=n(6468),d=n(3854),h=n(8338),p=n(1611),f=n(861),g=n(8519),m=n(7494),v=n(9328);e.exports=function(e,t,n,y,b,x,w){var S=m(e,n),C=m(t,n),k=w.get(C);if(k){r(e,n,k);return}var M=x?x(S,C,n+"",e,t,w):void 0,T=void 0===M;if(T){var A=u(C),I=!A&&d(C),P=!A&&!I&&g(C);M=C,A||I||P?u(S)?M=S:c(S)?M=a(S):I?(T=!1,M=i(C,!0)):P?(T=!1,M=o(C,!0)):M=[]:f(C)||l(C)?(M=S,l(S)?M=v(S):(!p(S)||h(S))&&(M=s(C))):T=!1}T&&(w.set(C,M),b(M,C,y,x,w),w.delete(C)),r(e,n,M)}},1197:function(e,t,n){var r=n(1137),i=n(1871),o=n(3132);e.exports=function(e,t){return o(i(e,t,r),e+"")}},4459:function(e,t,n){var r=n(551),i=n(2630),o=n(1137),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},4701:function(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},4833:function(e,t,n){var r=n(6127),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},9334:function(e){e.exports=function(e){return function(t){return e(t)}}},2471:function(e){e.exports=function(e,t){return e.has(t)}},5825:function(e,t,n){var r=n(9942);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},2734:function(e,t,n){e=n.nmd(e);var r=n(7400),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},3428:function(e,t,n){var r=n(5825);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},7561:function(e){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},5159:function(e,t,n){var r=n(1928),i=n(8799);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var u=t[s],c=o?o(n[u],e[u],u,n,e):void 0;void 0===c&&(c=e[u]),a?i(n,u,c):r(n,u,c)}return n}},4937:function(e,t,n){var r=n(7400)["__core-js_shared__"];e.exports=r},7270:function(e,t,n){var r=n(1197),i=n(7535);e.exports=function(e){return r(function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r<o;){var l=n[r];l&&e(t,l,r,a)}return t})}},8361:function(e){e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},2630:function(e,t,n){var r=n(1822),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},7042:function(e,t,n){var r=n(2485),i=n(756),o=n(2471);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var h=l.get(e),p=l.get(t);if(h&&p)return h==t&&p==e;var f=-1,g=!0,m=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++f<c;){var v=e[f],y=t[f];if(a)var b=u?a(y,v,f,t,e,l):a(v,y,f,e,t,l);if(void 0!==b){if(b)continue;g=!1;break}if(m){if(!i(t,function(e,t){if(!o(m,t)&&(v===e||s(v,e,n,a,l)))return m.push(t)})){g=!1;break}}else if(!(v===y||s(v,y,n,a,l))){g=!1;break}}return l.delete(e),l.delete(t),g}},370:function(e,t,n){var r=n(6539),i=n(9942),o=n(5638),a=n(7042),s=n(9383),l=n(3735),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!d(new i(e),new i(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var f=1&r;if(p||(p=l),e.size!=t.size&&!f)break;var g=h.get(e);if(g)return g==t;r|=2,h.set(e,t);var m=a(p(e),p(t),r,u,d,h);return h.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},9584:function(e,t,n){var r=n(1385),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var d=c;d--;){var h=u[d];if(!(l?h in t:i.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=l;++d<c;){var v=e[h=u[d]],y=t[h];if(o)var b=l?o(y,v,h,t,e,s):o(v,y,h,e,t,s);if(!(void 0===b?v===y||a(v,y,n,o,s):b)){g=!1;break}m||(m="constructor"==h)}if(g&&!m){var x=e.constructor,w=t.constructor;x!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w)&&(g=!1)}return s.delete(e),s.delete(t),g}},9120:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},1385:function(e,t,n){var r=n(1324),i=n(3080),o=n(98);e.exports=function(e){return r(e,o,i)}},5899:function(e,t,n){var r=n(4479);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},1822:function(e,t,n){var r=n(6729),i=n(5371);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},2173:function(e,t,n){var r=n(8023)(Object.getPrototypeOf,Object);e.exports=r},4840:function(e,t,n){var r=n(6539),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},3080:function(e,t,n){var r=n(263),i=n(5937),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:r(a(e=Object(e)),function(t){return o.call(e,t)})}:i;e.exports=s},3533:function(e,t,n){var r=n(2545),i=n(7836),o=n(4825),a=n(8697),s=n(6902),l=n(9736),u=n(6532),c="[object Map]",d="[object Promise]",h="[object Set]",p="[object WeakMap]",f="[object DataView]",g=u(r),m=u(i),v=u(o),y=u(a),b=u(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=f||i&&x(new i)!=c||o&&x(o.resolve())!=d||a&&x(new a)!=h||s&&x(new s)!=p)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return f;case m:return c;case v:return d;case y:return h;case b:return p}return t}),e.exports=x},5371:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},7753:function(e,t,n){var r=n(5718);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},2452:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}},2115:function(e,t,n){var r=n(5718),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},8256:function(e,t,n){var r=n(5718),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},7426:function(e,t,n){var r=n(5718);e.exports=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},7635:function(e,t,n){var r=n(158),i=n(2173),o=n(6016);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},2383:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?0x1fffffffffffff:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},7535:function(e,t,n){var r=n(5638),i=n(68),o=n(2383),a=n(1611);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return("number"==s?!!(i(n)&&o(t,n.length)):"string"==s&&t in n)&&r(n[t],e)}},4479:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},9678:function(e,t,n){var r,i=n(4937),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},6016:function(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},3663:function(e){e.exports=function(){this.__data__=[],this.size=0}},2470:function(e,t,n){var r=n(3382),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},6165:function(e,t,n){var r=n(3382);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},1873:function(e,t,n){var r=n(3382);e.exports=function(e){return r(this.__data__,e)>-1}},2556:function(e,t,n){var r=n(3382);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},9448:function(e,t,n){var r=n(6586),i=n(6301),o=n(7836);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},7738:function(e,t,n){var r=n(5899);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=+!!t,t}},6575:function(e,t,n){var r=n(5899);e.exports=function(e){return r(this,e).get(e)}},7238:function(e,t,n){var r=n(5899);e.exports=function(e){return r(this,e).has(e)}},8738:function(e,t,n){var r=n(5899);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=+(n.size!=i),this}},9383:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},5718:function(e,t,n){var r=n(1822)(Object,"create");e.exports=r},962:function(e,t,n){var r=n(8023)(Object.keys,Object);e.exports=r},1586:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},8125:function(e,t,n){e=n.nmd(e);var r=n(9120),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{var e=o&&o.require&&o.require("util").types;if(e)return e;return a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},1258:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},8023:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},1871:function(e,t,n){var r=n(9349),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a<s;)l[a]=o[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=o[a];return u[t]=n(l),r(e,this,u)}}},7400:function(e,t,n){var r=n(9120),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},7494:function(e){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},8639:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},8379:function(e){e.exports=function(e){return this.__data__.has(e)}},3735:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},3132:function(e,t,n){var r=n(4459),i=n(9591)(r);e.exports=i},9591:function(e){var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},7354:function(e,t,n){var r=n(6301);e.exports=function(){this.__data__=new r,this.size=0}},5863:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},2367:function(e){e.exports=function(e){return this.__data__.get(e)}},748:function(e){e.exports=function(e){return this.__data__.has(e)}},7569:function(e,t,n){var r=n(6301),i=n(7836),o=n(4554);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},6532:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},6127:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},551:function(e){e.exports=function(e){return function(){return e}}},6726:function(e,t,n){var r=n(1611),i=n(2846),o=n(1936),a=Math.max,s=Math.min;e.exports=function(e,t,n){var l,u,c,d,h,p,f=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=l,r=u;return l=u=void 0,f=t,d=e.apply(r,n)}function b(e){var n=e-p,r=e-f;return void 0===p||n>=t||n<0||m&&r>=c}function x(){var e,n,r,o=i();if(b(o))return w(o);h=setTimeout(x,(e=o-p,n=o-f,r=t-e,m?s(r,c-n):r))}function w(e){return(h=void 0,v&&l)?y(e):(l=u=void 0,d)}function S(){var e,n=i(),r=b(n);if(l=arguments,u=this,p=n,r){if(void 0===h)return f=e=p,h=setTimeout(x,t),g?y(e):d;if(m)return clearTimeout(h),h=setTimeout(x,t),y(p)}return void 0===h&&(h=setTimeout(x,t)),d}return t=o(t)||0,r(n)&&(g=!!n.leading,c=(m="maxWait"in n)?a(o(n.maxWait)||0,t):c,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==h&&clearTimeout(h),f=0,l=p=u=h=void 0},S.flush=function(){return void 0===h?d:w(i())},S}},5638:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},1137:function(e){e.exports=function(e){return e}},2900:function(e,t,n){var r=n(5829),i=n(2360),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},9785:function(e){var t=Array.isArray;e.exports=t},68:function(e,t,n){var r=n(8338),i=n(4194);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},6468:function(e,t,n){var r=n(68),i=n(2360);e.exports=function(e){return i(e)&&r(e)}},3854:function(e,t,n){e=n.nmd(e);var r=n(7400),i=n(7714),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=s?s.isBuffer:void 0;e.exports=l||i},6141:function(e,t,n){var r=n(2866);e.exports=function(e,t){return r(e,t)}},8338:function(e,t,n){var r=n(9736),i=n(1611);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},4194:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}},1611:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},2360:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},861:function(e,t,n){var r=n(9736),i=n(2173),o=n(2360),a=Object.prototype,s=Function.prototype.toString,l=a.hasOwnProperty,u=s.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==u}},5193:function(e,t,n){var r=n(9736),i=n(2360);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},8519:function(e,t,n){var r=n(6972),i=n(9334),o=n(8125),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},98:function(e,t,n){var r=n(8213),i=n(186),o=n(68);e.exports=function(e){return o(e)?r(e):i(e)}},3893:function(e,t,n){var r=n(8213),i=n(9464),o=n(68);e.exports=function(e){return o(e)?r(e,!0):i(e)}},5409:function(e,t,n){var r=n(15),i=n(7270)(function(e,t,n){r(e,t,n)});e.exports=i},2846:function(e,t,n){var r=n(7400);e.exports=function(){return r.Date.now()}},5937:function(e){e.exports=function(){return[]}},7714:function(e){e.exports=function(){return!1}},1936:function(e,t,n){var r=n(4833),i=n(1611),o=n(5193),a=0/0,s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return a;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):s.test(e)?a:+e}},9328:function(e,t,n){var r=n(5159),i=n(3893);e.exports=function(e){return r(e,i(e))}},9986:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z","Calendar")},2449:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z","ChevronDown")},4974:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z","ChevronRight")},791:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","Circle")},763:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z","Close")},354:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z","Delete")},2446:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z","DeleteOutline")},1682:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z","Drag")},8418:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z","EyeOffOutline")},7689:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z","EyeOutline")},9398:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z","InformationOutline")},6396:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M19,13H5V11H19V13Z","Minus")},1889:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z","Pin")},5186:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12M8.8,14L10,12.8V4H14V12.8L15.2,14H8.8Z","PinOutline")},3755:function(e,t,n){"use strict";t.default=void 0;var r,i=(r=n(265))&&r.__esModule?r:{default:r};t.default=(0,i.default)("M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z","Plus")},265:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(9261),i=n(4246);t.default=function(e,t){return(0,r.createSvgIcon)((0,i.jsx)("path",{d:e}),t)}},8772:function(e,t,n){"use strict";var r=n(331);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},3615:function(e,t,n){e.exports=n(8772)()},331:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},8715:function(e,t,n){!function(e,t){"use strict";var n=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(t);function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var i={error:null},o=function(e){function t(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=i,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var o=t.prototype;return o.reset=function(){this.setState(i)},o.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},o.componentDidUpdate=function(e,t){var n,r,i,o,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(n=e.resetKeys)&&(n=[]),void 0===(r=s)&&(r=[]),n.length!==r.length||n.some(function(e,t){return!Object.is(e,r[t])}))&&(null==(i=(o=this.props).onResetKeysChange)||i.call(o,e.resetKeys,s),this.reset())},o.render=function(){var e=this.state.error,t=this.props,r=t.fallbackRender,i=t.FallbackComponent,o=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(n.isValidElement(o))return o;if("function"==typeof r)return r(a);if(i)return n.createElement(i,a);else throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(n.Component);e.ErrorBoundary=o,e.useErrorHandler=function(e){var t=n.useState(null),r=t[0],i=t[1];if(null!=e)throw e;if(null!=r)throw r;return i},e.withErrorBoundary=function(e,t){var r=function(r){return n.createElement(o,t,n.createElement(e,r))},i=e.displayName||e.name||"Unknown";return r.displayName="withErrorBoundary("+i+")",r},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(4538))},8317:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function i(){r.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;r<i;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],i=[];if(r&&t)for(var o=0,a=r.length;o<a;o++)r[o].fn!==t&&r[o].fn._!==t&&i.push(r[o]);return i.length?n[e]=i:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t},7554:function(e){"use strict";var t;t=function(){function e(){return!0}function t(){return!1}function n(){}return function r(){var i=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:function(e){return"object"==typeof e&&null!==e&&e.constructor===Object}},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],o={name:"any",test:e},a=[],s=[],l={types:i,conversions:s,ignore:a};function u(e){var t=N(l.types,function(t){return t.name===e});if(t)return t;if("any"===e)return o;var n=N(l.types,function(t){return t.name.toLowerCase()===e.toLowerCase()});throw TypeError('Unknown type "'+e+'"'+(n?'. Did you mean "'+n.name+'"?':""))}function c(e){return e===o?999:l.types.indexOf(e)}function d(e){var t=N(l.types,function(t){return t.test(e)});if(t)return t.name;throw TypeError("Value has unknown type. Value: "+e)}function h(e){return e.map(function(e){var t=e.types.map(y);return(e.restParam?"...":"")+t.join("|")}).join(",")}function p(e){var t=L(e);return!!t&&t.restParam}function f(e){return e.types.some(function(e){return null!=e.conversion})}function g(t){if(!t||0===t.types.length)return e;if(1===t.types.length)return u(t.types[0].name).test;if(2===t.types.length){var n=u(t.types[0].name).test,r=u(t.types[1].name).test;return function(e){return n(e)||r(e)}}var i=t.types.map(function(e){return u(e.name).test});return function(e){for(var t=0;t<i.length;t++)if(i[t](e))return!0;return!1}}function m(e,t){return t<e.params.length?e.params[t]:p(e.params)?L(e.params):null}function v(e,t,n){var r=m(e,t);return(r?n?r.types.filter(b):r.types:[]).map(y)}function y(e){return e.name}function b(e){return null===e.conversion||void 0===e.conversion}function x(e,t){var n=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return Object.keys(t)}(Z(e,function(e){return v(e,t,!1)}));return -1!==n.indexOf("any")?["any"]:n}function w(e,t,n){var r,i,o,a=e||"unnamed",s=n;for(o=0;o<t.length;o++){var l=s.filter(function(e){var n=g(m(e,o));return(o<e.params.length||p(e.params))&&n(t[o])});if(0===l.length){if((i=x(s,o)).length>0){var u=d(t[o]);return(r=TypeError("Unexpected type of argument in function "+a+" (expected: "+i.join(" or ")+", actual: "+u+", index: "+o+")")).data={category:"wrongType",fn:a,index:o,actual:u,expected:i},r}}else s=l}var c=s.map(function(e){return p(e.params)?1/0:e.params.length});if(t.length<Math.min.apply(null,c))return(r=TypeError("Too few arguments in function "+a+" (expected: "+(i=x(s,o)).join(" or ")+", index: "+t.length+")")).data={category:"tooFewArgs",fn:a,index:t.length,expected:i},r;var h=Math.max.apply(null,c);return t.length>h?(r=TypeError("Too many arguments in function "+a+" (expected: "+h+", actual: "+t.length+")")).data={category:"tooManyArgs",fn:a,index:t.length,expectedLength:h}:(r=TypeError('Arguments of type "'+t.join(", ")+'" do not match any of the defined signatures of function '+a+".")).data={category:"mismatch",actual:t.map(d)},r}function S(e){for(var t=999,n=0;n<e.types.length;n++)b(e.types[n])&&(t=Math.min(t,e.types[n].typeIndex));return t}function C(e){for(var t=999,n=0;n<e.types.length;n++)b(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function k(e,t){var n,r,i=Math.min(e.params.length,t.params.length);if(0!=(r=e.params.some(f)-t.params.some(f)))return r;for(n=0;n<i;n++)if(0!=(r=f(e.params[n])-f(t.params[n])))return r;for(n=0;n<i;n++)if(0!==(r=function(e,t){var n;return 0!=(n=e.restParam-t.restParam)||0!=(n=f(e)-f(t))||0!=(n=S(e)-S(t))?n:C(e)-C(t)}(e.params[n],t.params[n])))return r;return e.params.length-t.params.length}function M(e){var t,n,r,i,o=[],a=[];switch(e.types.forEach(function(e){e.conversion&&(o.push(u(e.conversion.from).test),a.push(e.conversion.convert))}),a.length){case 0:return function(e){return e};case 1:return t=o[0],r=a[0],function(e){return t(e)?r(e):e};case 2:return t=o[0],n=o[1],r=a[0],i=a[1],function(e){return t(e)?r(e):n(e)?i(e):e};default:return function(e){for(var t=0;t<a.length;t++)if(o[t](e))return a[t](e);return e}}}function T(e,t){return function e(n,r,i){if(!(r<n.length))return[i.map(function(e,t){return{types:e,restParam:t===n.length-1&&p(n)}})];var o,a=n[r],s=t?a.types.filter(b):a.types;if(a.restParam){var l=s.filter(b);o=l.length<s.length?[l,s]:[s]}else o=s.map(function(e){return[e]});return Z(o,function(t){return e(n,r+1,i.concat([t]))})}(e,0,[])}function A(e,r){if(0===Object.keys(r).length)throw SyntaxError("No signatures provided");var i,o=[];Object.keys(r).map(function(e){var t,n,i;return t=r[e],n=l.conversions,i=[],(""!==e.trim()&&(i=e.split(",").map(R).map(function(e,t,r){var i,o,a,s,l,d,h,p,f=(i=n,o=l=((s=0===e.indexOf("..."))?e.length>3?e.slice(3):"any":e).split("|").map(R).filter(O).filter(P),a={},i.forEach(function(e){-1!==o.indexOf(e.from)||-1===o.indexOf(e.to)||a[e.from]||(a[e.from]=e)}),d=Object.keys(a).map(function(e){return a[e]}),h=l.map(function(e){var t=u(e);return{name:e,typeIndex:c(t),test:t.test,conversion:null,conversionIndex:-1}}),p=d.map(function(e){var t=u(e.from);return{name:e.from,typeIndex:c(t),test:t.test,conversion:e,conversionIndex:n.indexOf(e)}}),{types:h.concat(p),restParam:s});if(f.restParam&&t!==r.length-1)throw SyntaxError('Unexpected rest parameter "'+e+'": only allowed for the last parameter');return f})),i.some(D))?null:{params:i,fn:t}}).filter(E).forEach(function(e){var t=N(o,function(t){return function(e,t){for(var n=Math.max(e.params.length,t.params.length),r=0;r<n;r++)if(!function(e,t){for(var n,r=0;r<e.length;r++)if(n=e[r],-1!==t.indexOf(n))return!0;return!1}(v(e,r,!0),v(t,r,!0)))return!1;var i=e.params.length,o=t.params.length,a=p(e.params),s=p(t.params);return a?s?i===o:o>=i:s?i>=o:i===o}(t,e)});if(t)throw TypeError('Conflicting signatures "'+h(t.params)+'" and "'+h(e.params)+'".');o.push(e)});var a=Z(o,function(e){return(e?T(e.params,!1):[]).map(function(t){return{params:t,fn:e.fn}})}).filter(E);a.sort(k);var s=a[0]&&a[0].params.length<=2&&!p(a[0].params),d=a[1]&&a[1].params.length<=2&&!p(a[1].params),m=a[2]&&a[2].params.length<=2&&!p(a[2].params),y=a[3]&&a[3].params.length<=2&&!p(a[3].params),b=a[4]&&a[4].params.length<=2&&!p(a[4].params),x=a[5]&&a[5].params.length<=2&&!p(a[5].params),w=a.map(function(e){return function(e){var t,n,r;if(p(e)){var i,o=(t=(i=e).slice(0,i.length-1).map(g)).length,a=g(L(e)),s=function(e){for(var t=o;t<e.length;t++)if(!a(e[t]))return!1;return!0};return function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return s(e)&&e.length>=o+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=g(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=g(e[0]),r=g(e[1]),function(e){return n(e[0])&&r(e[1])&&2===e.length}):(t=e.map(g),function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length})}(e.params)}),S=s?g(a[0].params[0]):t,C=d?g(a[1].params[0]):t,A=m?g(a[2].params[0]):t,I=y?g(a[3].params[0]):t,j=b?g(a[4].params[0]):t,B=x?g(a[5].params[0]):t,F=s?g(a[0].params[1]):t,z=d?g(a[1].params[1]):t,$=m?g(a[2].params[1]):t,V=y?g(a[3].params[1]):t,H=b?g(a[4].params[1]):t,W=x?g(a[5].params[1]):t,q=a.map(function(e){return function(e,t){var n=t;if(e.some(f)){var r=p(e),i=e.map(M);n=function(){for(var e=[],n=r?arguments.length-1:arguments.length,o=0;o<n;o++)e[o]=i[o](arguments[o]);return r&&(e[n]=arguments[n].map(i[n])),t.apply(this,e)}}var o=n;if(p(e)){var a=e.length-1;o=function(){return n.apply(this,_(arguments,0,a).concat([_(arguments,a)]))}}return o}(e.params,e.fn)}),G=s?q[0]:n,U=d?q[1]:n,K=m?q[2]:n,Y=y?q[3]:n,X=b?q[4]:n,J=x?q[5]:n,Q=s?a[0].params.length:-1,ee=d?a[1].params.length:-1,et=m?a[2].params.length:-1,en=y?a[3].params.length:-1,er=b?a[4].params.length:-1,ei=x?a[5].params.length:-1,eo=6*!!(s&&d&&m&&y&&b&&x),ea=a.length,es=function(){for(var t=eo;t<ea;t++)if(w[t](arguments))return q[t].apply(this,arguments);return l.onMismatch(e,arguments,a)},el=function e(t,n){return arguments.length===Q&&S(t)&&F(n)?G.apply(e,arguments):arguments.length===ee&&C(t)&&z(n)?U.apply(e,arguments):arguments.length===et&&A(t)&&$(n)?K.apply(e,arguments):arguments.length===en&&I(t)&&V(n)?Y.apply(e,arguments):arguments.length===er&&j(t)&&H(n)?X.apply(e,arguments):arguments.length===ei&&B(t)&&W(n)?J.apply(e,arguments):es.apply(e,arguments)};try{Object.defineProperty(el,"name",{value:e})}catch(e){}return el.signatures=(i={},a.forEach(function(e){e.params.some(f)||T(e.params,!0).forEach(function(t){i[h(t)]=e.fn})}),i),el}function I(e,t,n){throw w(e,t,n)}function P(e){return -1===l.ignore.indexOf(e)}function R(e){return e.trim()}function O(e){return!!e}function E(e){return null!==e}function D(e){return 0===e.types.length}function L(e){return e[e.length-1]}function _(e,t,n){return Array.prototype.slice.call(e,t,n)}function N(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Z(e,t){return Array.prototype.concat.apply([],e.map(t))}function j(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(("object"==typeof r.signatures||"string"==typeof r.signature)&&""!==r.name){if(""===t)t=r.name;else if(t!==r.name){var i=Error("Function names do not match (expected: "+t+", actual: "+r.name+")");throw i.data={actual:r.name,expected:t},i}}}return t}function B(e){var t,n={};function r(e,r){if(n.hasOwnProperty(e)&&r!==n[e])throw(t=Error('Signature "'+e+'" is defined twice')).data={signature:e},t}for(var i=0;i<e.length;i++){var o=e[i];if("object"==typeof o.signatures)for(var a in o.signatures)o.signatures.hasOwnProperty(a)&&(r(a,o.signatures[a]),n[a]=o.signatures[a]);else if("string"==typeof o.signature)r(o.signature,o),n[o.signature]=o;else throw(t=TypeError("Function is no typed-function (index: "+i+")")).data={index:i},t}return n}return(l=A("typed",{"string, Object":A,Object:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return A(j(t),e)},"...Function":function(e){return A(j(e),B(e))},"string, ...Function":function(e,t){return A(e,B(t))}})).create=r,l.types=i,l.conversions=s,l.ignore=a,l.onMismatch=I,l.throwMismatchError=I,l.createError=w,l.convert=function(e,t){var n=d(e);if(t===n)return e;for(var r=0;r<l.conversions.length;r++){var i=l.conversions[r];if(i.from===n&&i.to===t)return i.convert(e)}throw Error("Cannot convert from "+n+" to "+t)},l.find=function(e,t){if(!e.signatures)throw TypeError("Function is no typed-function");if("string"==typeof t){n=t.split(",");for(var n,r=0;r<n.length;r++)n[r]=n[r].trim()}else if(Array.isArray(t))n=t;else throw TypeError("String array or a comma separated string expected");var i=n.join(","),o=e.signatures[i];if(o)return o;throw TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+n.join(", ")+"))")},l.addType=function(e,t){if(!e||"string"!=typeof e.name||"function"!=typeof e.test)throw TypeError("Object with properties {name: string, test: function} expected");if(!1!==t){for(var n=0;n<l.types.length;n++)if("Object"===l.types[n].name){l.types.splice(n,0,e);return}}l.types.push(e)},l.addConversion=function(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw TypeError("Object with properties {from: string, to: string, convert: function} expected");l.conversions.push(e)},l}()},"function"==typeof define&&define.amd?define([],t):e.exports=t()},252:function(e,t,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}n.d(t,{Z:()=>r})},496:function(e,t,n){"use strict";n.d(t,{Z:()=>r});let r=function(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=function e(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t){if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=" "),i+=r)}else for(r in t)t[r]&&(i&&(i+=" "),i+=r)}return i}(e))&&(r&&(r+=" "),r+=t);return r}}}]);