=m,O=y+k>=g;s.style.display="grid",s.style.top="".concat(l.top+y+10-(O?k+10:0),"px"),s.style.left="".concat(l.left+b+10-(S?w+20:0),"px");var C=hn()(new Date(1e3*d)).format("YYYY-MM-DD HH:mm:ss:SSS (Z)"),M=Object.keys(h).filter((function(e){return"__name__"!==e})).map((function(e){return"".concat(e,": ").concat(h[e],"
")})).join(""),P='');s.innerHTML="".concat(C,'
\n \n ').concat(P).concat(h.__name__||"",': ').concat(f,'\n
\n ').concat(M,"
")}},as=n(2061),ss=n.n(as),ls=function(t){var n=(0,e.useState)({width:0,height:0}),i=(0,r.Z)(n,2),o=i[0],a=i[1];return(0,e.useEffect)((function(){if(t){var e=function(){a({width:t.offsetWidth,height:t.offsetHeight})};return window.addEventListener("resize",e),e(),function(){return window.removeEventListener("resize",e)}}}),[]),o};!function(e){e.xRange="xRange",e.yRange="yRange",e.data="data"}(qa||(qa={}));var us=function(t){var n=t.data,i=t.series,o=t.metrics,a=void 0===o?[]:o,s=Kn(),l=Gn().time.period,u=Qa().yaxis,c=(0,e.useRef)(null),f=(0,e.useState)(!1),d=(0,r.Z)(f,2),h=d[0],v=d[1],m=(0,e.useState)({min:l.start,max:l.end}),g=(0,r.Z)(m,2),y=g[0],b=g[1],x=(0,e.useState)(),w=(0,r.Z)(x,2),k=w[0],S=w[1],O=ls(document.getElementById("homeLayout")),C=document.createElement("div");C.className="u-tooltip";var M={seriesIdx:null,dataIdx:void 0},P={left:0,top:0},T=(0,e.useCallback)(ss()((function(e){var t=e.min,n=e.max;s({type:"SET_PERIOD",payload:{from:new Date(1e3*t),to:new Date(1e3*n)}})}),500),[]),E=function(e){var t=e.u,n=e.min,r=e.max,i=1e3*(r-n);iSn||(t.setScale("x",{min:n,max:r}),b({min:n,max:r}),T({min:n,max:r}))},Z=function(){return[y.min,y.max]},A=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0;return u.limits.enable?u.limits.range[r]:t&&n?[t-.25*t,n+.25*n]:[-1,1]},R=fn(fn({},Ka),{},{series:i,axes:is(i),scales:fn({},function(){var e={x:{range:Z}};return Object.keys(u.limits.range).forEach((function(t){e[t]={range:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return A(e,n,r,t)}}})),e}()),width:O.width?O.width-64:400,plugins:[{hooks:{ready:function(e){var t,n=.85;P.left=parseFloat(e.over.style.left),P.top=parseFloat(e.over.style.top),null===(t=e.root.querySelector(".u-wrap"))||void 0===t||t.appendChild(C),e.over.addEventListener("mousedown",(function(t){return function(e){var t=e.e,n=e.factor,r=void 0===n?.85:n,i=e.u,o=e.setPanning,a=e.setPlotScale;if(0===t.button){t.preventDefault(),o(!0);var s=t.clientX,l=i.posToVal(1,"x")-i.posToVal(0,"x"),u=i.scales.x.min||0,c=i.scales.x.max||0,f=function(e){e.preventDefault();var t=l*((e.clientX-s)*r);a({u:i,min:u-t,max:c-t})};document.addEventListener("mousemove",f),document.addEventListener("mouseup",(function e(){o(!1),document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",e)}))}}({u:e,e:t,setPanning:v,setPlotScale:E,factor:n})})),e.over.addEventListener("wheel",(function(t){if(t.ctrlKey||t.metaKey){t.preventDefault();var r=e.over.getBoundingClientRect().width,i=e.cursor.left&&e.cursor.left>0?e.cursor.left:0,o=e.posToVal(i,"x"),a=(e.scales.x.max||0)-(e.scales.x.min||0),s=t.deltaY<0?a*n:a/n,l=o-i/r*s,u=l+s;e.batch((function(){return E({u:e,min:l,max:u})}))}}))},setCursor:function(e){M.dataIdx!==e.cursor.idx&&(M.dataIdx=e.cursor.idx||0,null!==M.seriesIdx&&void 0!==M.dataIdx&&os({u:e,tooltipIdx:M,metrics:a,series:i,tooltip:C,tooltipOffset:P}))},setSeries:function(e,t){M.seriesIdx!==t&&(M.seriesIdx=t,t&&void 0!==M.dataIdx?os({u:e,tooltipIdx:M,metrics:a,series:i,tooltip:C,tooltipOffset:P}):C.style.display="none")}}}]}),D=function(e){if(k){switch(e){case qa.xRange:k.scales.x.range=Z;break;case qa.yRange:Object.keys(u.limits.range).forEach((function(e){k.scales[e]&&(k.scales[e].range=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return A(t,n,r,e)})}));break;case qa.data:k.setData(n)}k.redraw()}};return(0,e.useEffect)((function(){return b({min:l.start,max:l.end})}),[l]),(0,e.useEffect)((function(){if(c.current){var e=new $a(R,n,c.current);return S(e),b({min:l.start,max:l.end}),e.destroy}}),[c.current,i,O]),(0,e.useEffect)((function(){return D(qa.data)}),[n]),(0,e.useEffect)((function(){return D(qa.xRange)}),[y]),(0,e.useEffect)((function(){return D(qa.yRange)}),[u]),(0,p.jsx)("div",{style:{pointerEvents:h?"none":"auto",height:"500px"},children:(0,p.jsx)("div",{ref:c})})},cs=function(t){var n=t.labels,r=t.onChange,i=Gn().query,o=(0,e.useMemo)((function(){return Array.from(new Set(n.map((function(e){return e.group}))))}),[n]);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:"legendWrapper",children:o.map((function(e){return(0,p.jsxs)("div",{className:"legendGroup",children:[(0,p.jsxs)("div",{className:"legendGroupTitle",children:[(0,p.jsxs)("span",{className:"legendGroupQuery",children:["Query ",e]}),(0,p.jsx)("svg",{className:"legendGroupLine",width:"33",height:"3",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:(0,p.jsx)("line",{strokeWidth:"3",x1:"0",y1:"0",x2:"33",y2:"0",stroke:"#363636",strokeDasharray:ts(e).join(",")})}),(0,p.jsxs)("b",{children:['"',i[e-1],'":']})]}),(0,p.jsx)("div",{children:n.filter((function(t){return t.group===e})).map((function(e){return(0,p.jsxs)("div",{className:e.checked?"legendItem":"legendItem legendItemHide",onClick:function(t){return r(e,t.ctrlKey||t.metaKey)},children:[(0,p.jsx)("div",{className:"legendMarker",style:{borderColor:e.color,backgroundColor:"rgba(".concat(Ga(e.color),", 0.1)")}}),(0,p.jsx)("div",{className:"legendLabel",children:e.label})]},"".concat(e.group,".").concat(e.label))}))})]},e)}))}),(0,p.jsxs)("div",{className:"legendWrapperHotkey",children:[(0,p.jsxs)("p",{children:[(0,p.jsx)("code",{children:"Left click"})," - select series"]}),(0,p.jsxs)("p",{children:[(0,p.jsx)("code",{children:"Ctrl"})," + ",(0,p.jsx)("code",{children:"Left click"})," - toggle multiple series"]})]})]})};function fs(e,t){if(null==e)return{};var n,r,i=(0,o.Z)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var ds=["__name__"],hs=function(e,t){var n=function(e){if(0===Object.keys(e.metric).length)return"Query ".concat(e.group," result");var t=e.metric,n=t.__name__,r=fs(t,ds);return"".concat(n||""," {").concat(Object.entries(r).map((function(e){return"".concat(e[0],": ").concat(e[1])})).join(", "),"}")}(e);return{label:n,dash:ts(e.group),width:1.4,stroke:es(e.group,n),show:!vs(n,e.group,t),scale:String(e.group),points:{size:4.2,width:1.4}}},ps=function(e,t){return{group:t,label:e.label||"",color:e.stroke,checked:e.show||!1}},vs=function(e,t,n){return n.includes("".concat(t,".").concat(e))},ms=n(2495);var gs=e.createContext();function ys(){return e.useContext(gs)}function bs(e){return(0,q.Z)("MuiTypography",e)}(0,U.Z)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);var xs=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],ws=(0,g.ZP)("span",{name:"MuiTypography",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t["align".concat((0,O.Z)(n.align))],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({margin:0},n.variant&&t.typography[n.variant],"inherit"!==n.align&&{textAlign:n.align},n.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n.gutterBottom&&{marginBottom:"0.35em"},n.paragraph&&{marginBottom:16})})),ks={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Ss={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Os=e.forwardRef((function(e,t){var n=(0,w.Z)({props:e,name:"MuiTypography"}),r=function(e){return Ss[e]||e}(n.color),i=jt((0,a.Z)({},n,{color:r})),s=i.align,l=void 0===s?"inherit":s,f=i.className,d=i.component,h=i.gutterBottom,v=void 0!==h&&h,m=i.noWrap,g=void 0!==m&&m,y=i.paragraph,b=void 0!==y&&y,x=i.variant,k=void 0===x?"body1":x,S=i.variantMapping,C=void 0===S?ks:S,M=(0,o.Z)(i,xs),P=(0,a.Z)({},i,{align:l,color:r,className:f,component:d,gutterBottom:v,noWrap:g,paragraph:b,variant:k,variantMapping:C}),T=d||(b?"p":C[k]||ks[k])||"span",E=function(e){var t=e.align,n=e.gutterBottom,r=e.noWrap,i=e.paragraph,o=e.variant,a=e.classes,s={root:["root",o,"inherit"!==e.align&&"align".concat((0,O.Z)(t)),n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return(0,c.Z)(s,bs,a)}(P);return(0,p.jsx)(ws,(0,a.Z)({as:T,ref:t,ownerState:P,className:(0,u.default)(E.root,f)},M))})),Cs=Os;function Ms(e){return(0,q.Z)("MuiFormControlLabel",e)}var Ps=(0,U.Z)("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label"]),Ts=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","value"],Es=(0,g.ZP)("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[(0,i.Z)({},"& .".concat(Ps.label),t.label),t.root,t["labelPlacement".concat((0,O.Z)(n.labelPlacement))]]}})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)((0,i.Z)({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16},"&.".concat(Ps.disabled),{cursor:"default"}),"start"===n.labelPlacement&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},"top"===n.labelPlacement&&{flexDirection:"column-reverse",marginLeft:16},"bottom"===n.labelPlacement&&{flexDirection:"column",marginLeft:16},(0,i.Z)({},"& .".concat(Ps.label),(0,i.Z)({},"&.".concat(Ps.disabled),{color:t.palette.text.disabled})))})),Zs=e.forwardRef((function(t,n){var r=(0,w.Z)({props:t,name:"MuiFormControlLabel"}),i=r.className,s=r.componentsProps,l=void 0===s?{}:s,f=r.control,d=r.disabled,h=r.disableTypography,v=r.label,m=r.labelPlacement,g=void 0===m?"end":m,y=(0,o.Z)(r,Ts),b=ys(),x=d;"undefined"===typeof x&&"undefined"!==typeof f.props.disabled&&(x=f.props.disabled),"undefined"===typeof x&&b&&(x=b.disabled);var k={disabled:x};["checked","name","onChange","value","inputRef"].forEach((function(e){"undefined"===typeof f.props[e]&&"undefined"!==typeof r[e]&&(k[e]=r[e])}));var S=(0,a.Z)({},r,{disabled:x,label:v,labelPlacement:g}),C=function(e){var t=e.classes,n=e.disabled,r=e.labelPlacement,i={root:["root",n&&"disabled","labelPlacement".concat((0,O.Z)(r))],label:["label",n&&"disabled"]};return(0,c.Z)(i,Ms,t)}(S);return(0,p.jsxs)(Es,(0,a.Z)({className:(0,u.default)(C.root,i),ownerState:S,ref:n},y,{children:[e.cloneElement(f,k),v.type===Cs||h?v:(0,p.jsx)(Cs,(0,a.Z)({component:"span",className:C.label},l.typography,{children:v}))]}))})),As=Zs,Rs=n(3362),Ds=n(7219),js=n(3282),_s=n(4312),Ns=n(2678),Ls=["onChange","maxRows","minRows","style","value"];function Is(e,t){return parseInt(e[t],10)||0}var zs={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"},Bs=e.forwardRef((function(t,n){var i=t.onChange,s=t.maxRows,l=t.minRows,u=void 0===l?1:l,c=t.style,d=t.value,h=(0,o.Z)(t,Ls),v=e.useRef(null!=d).current,m=e.useRef(null),g=(0,f.Z)(n,m),y=e.useRef(null),b=e.useRef(0),x=e.useState({}),w=(0,r.Z)(x,2),k=w[0],S=w[1],O=e.useCallback((function(){var e=m.current,n=(0,js.Z)(e).getComputedStyle(e);if("0px"!==n.width){var r=y.current;r.style.width=n.width,r.value=e.value||t.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");var i=n["box-sizing"],o=Is(n,"padding-bottom")+Is(n,"padding-top"),a=Is(n,"border-bottom-width")+Is(n,"border-top-width"),l=r.scrollHeight;r.value="x";var c=r.scrollHeight,f=l;u&&(f=Math.max(Number(u)*c,f)),s&&(f=Math.min(Number(s)*c,f));var d=(f=Math.max(f,c))+("border-box"===i?o+a:0),h=Math.abs(f-l)<=1;S((function(e){return b.current<20&&(d>0&&Math.abs((e.outerHeightStyle||0)-d)>1||e.overflow!==h)?(b.current+=1,{overflow:h,outerHeightStyle:d}):e}))}}),[s,u,t.placeholder]);e.useEffect((function(){var e,t=(0,_s.Z)((function(){b.current=0,O()})),n=(0,js.Z)(m.current);return n.addEventListener("resize",t),"undefined"!==typeof ResizeObserver&&(e=new ResizeObserver(t)).observe(m.current),function(){t.clear(),n.removeEventListener("resize",t),e&&e.disconnect()}}),[O]),(0,Ns.Z)((function(){O()})),e.useEffect((function(){b.current=0}),[d]);return(0,p.jsxs)(e.Fragment,{children:[(0,p.jsx)("textarea",(0,a.Z)({value:d,onChange:function(e){b.current=0,v||O(),i&&i(e)},ref:g,rows:u,style:(0,a.Z)({height:k.outerHeightStyle,overflow:k.overflow?"hidden":null},c)},h)),(0,p.jsx)("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:y,tabIndex:-1,style:(0,a.Z)({},zs,c,{padding:0})})]})})),Fs=Bs;var $s=function(e){return"string"===typeof e};function Ws(e){var t=e.props,n=e.states,r=e.muiFormControl;return n.reduce((function(e,n){return e[n]=t[n],r&&"undefined"===typeof t[n]&&(e[n]=r[n]),e}),{})}var Hs=n(4993);function Vs(e){var t=e.styles,n=e.defaultTheme,r=void 0===n?{}:n,i="function"===typeof t?function(e){return t(void 0===(n=e)||null===n||0===Object.keys(n).length?r:e);var n}:t;return(0,p.jsx)(Re,{styles:i})}var qs=function(e){return(0,p.jsx)(Vs,(0,a.Z)({},e,{defaultTheme:b.Z}))};function Us(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function Qs(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(Us(e.value)&&""!==e.value||t&&Us(e.defaultValue)&&""!==e.defaultValue)}function Xs(e){return(0,q.Z)("MuiInputBase",e)}var Ys=(0,U.Z)("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Gs=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","startAdornment","type","value"],Ks=function(e,t){var n=e.ownerState;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".concat((0,O.Z)(n.color))],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},Js=function(e,t){var n=e.ownerState;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]},el=(0,g.ZP)("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Ks})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({},t.typography.body1,(0,i.Z)({color:t.palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center"},"&.".concat(Ys.disabled),{color:t.palette.text.disabled,cursor:"default"}),n.multiline&&(0,a.Z)({padding:"4px 0 5px"},"small"===n.size&&{paddingTop:1}),n.fullWidth&&{width:"100%"})})),tl=(0,g.ZP)("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Js})((function(e){var t,n=e.theme,r=e.ownerState,o="light"===n.palette.mode,s={color:"currentColor",opacity:o?.42:.5,transition:n.transitions.create("opacity",{duration:n.transitions.duration.shorter})},l={opacity:"0 !important"},u={opacity:o?.42:.5};return(0,a.Z)((t={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%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":s,"&::-moz-placeholder":s,"&:-ms-input-placeholder":s,"&::-ms-input-placeholder":s,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"}},(0,i.Z)(t,"label[data-shrink=false] + .".concat(Ys.formControl," &"),{"&::-webkit-input-placeholder":l,"&::-moz-placeholder":l,"&:-ms-input-placeholder":l,"&::-ms-input-placeholder":l,"&:focus::-webkit-input-placeholder":u,"&:focus::-moz-placeholder":u,"&:focus:-ms-input-placeholder":u,"&:focus::-ms-input-placeholder":u}),(0,i.Z)(t,"&.".concat(Ys.disabled),{opacity:1,WebkitTextFillColor:n.palette.text.disabled}),(0,i.Z)(t,"&:-webkit-autofill",{animationDuration:"5000s",animationName:"mui-auto-fill"}),t),"small"===r.size&&{paddingTop:1},r.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},"search"===r.type&&{MozAppearance:"textfield"})})),nl=(0,p.jsx)(qs,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),rl=e.forwardRef((function(t,n){var i=(0,w.Z)({props:t,name:"MuiInputBase"}),s=i["aria-describedby"],l=i.autoComplete,f=i.autoFocus,d=i.className,h=i.components,v=void 0===h?{}:h,m=i.componentsProps,g=void 0===m?{}:m,y=i.defaultValue,b=i.disabled,x=i.disableInjectingGlobalStyles,k=i.endAdornment,S=i.fullWidth,C=void 0!==S&&S,M=i.id,P=i.inputComponent,T=void 0===P?"input":P,E=i.inputProps,Z=void 0===E?{}:E,A=i.inputRef,R=i.maxRows,D=i.minRows,j=i.multiline,_=void 0!==j&&j,N=i.name,L=i.onBlur,I=i.onChange,B=i.onClick,F=i.onFocus,$=i.onKeyDown,W=i.onKeyUp,H=i.placeholder,V=i.readOnly,q=i.renderSuffix,U=i.rows,Q=i.startAdornment,X=i.type,Y=void 0===X?"text":X,G=i.value,K=(0,o.Z)(i,Gs),J=null!=Z.value?Z.value:G,ee=e.useRef(null!=J).current,te=e.useRef(),ne=e.useCallback((function(e){0}),[]),re=(0,z.Z)(Z.ref,ne),ie=(0,z.Z)(A,re),oe=(0,z.Z)(te,ie),ae=e.useState(!1),se=(0,r.Z)(ae,2),le=se[0],ue=se[1],ce=ys();var fe=Ws({props:i,muiFormControl:ce,states:["color","disabled","error","hiddenLabel","size","required","filled"]});fe.focused=ce?ce.focused:le,e.useEffect((function(){!ce&&b&&le&&(ue(!1),L&&L())}),[ce,b,le,L]);var de=ce&&ce.onFilled,he=ce&&ce.onEmpty,pe=e.useCallback((function(e){Qs(e)?de&&de():he&&he()}),[de,he]);(0,Hs.Z)((function(){ee&&pe({value:J})}),[J,pe,ee]);e.useEffect((function(){pe(te.current)}),[]);var ve=T,me=Z;_&&"input"===ve&&(me=U?(0,a.Z)({type:void 0,minRows:U,maxRows:U},me):(0,a.Z)({type:void 0,maxRows:R,minRows:D},me),ve=Fs);e.useEffect((function(){ce&&ce.setAdornedStart(Boolean(Q))}),[ce,Q]);var ge=(0,a.Z)({},i,{color:fe.color||"primary",disabled:fe.disabled,endAdornment:k,error:fe.error,focused:fe.focused,formControl:ce,fullWidth:C,hiddenLabel:fe.hiddenLabel,multiline:_,size:fe.size,startAdornment:Q,type:Y}),ye=function(e){var t=e.classes,n=e.color,r=e.disabled,i=e.error,o=e.endAdornment,a=e.focused,s=e.formControl,l=e.fullWidth,u=e.hiddenLabel,f=e.multiline,d=e.size,h=e.startAdornment,p=e.type,v={root:["root","color".concat((0,O.Z)(n)),r&&"disabled",i&&"error",l&&"fullWidth",a&&"focused",s&&"formControl","small"===d&&"sizeSmall",f&&"multiline",h&&"adornedStart",o&&"adornedEnd",u&&"hiddenLabel"],input:["input",r&&"disabled","search"===p&&"inputTypeSearch",f&&"inputMultiline","small"===d&&"inputSizeSmall",u&&"inputHiddenLabel",h&&"inputAdornedStart",o&&"inputAdornedEnd"]};return(0,c.Z)(v,Xs,t)}(ge),be=v.Root||el,xe=g.root||{},we=v.Input||tl;return me=(0,a.Z)({},me,g.input),(0,p.jsxs)(e.Fragment,{children:[!x&&nl,(0,p.jsxs)(be,(0,a.Z)({},xe,!$s(be)&&{ownerState:(0,a.Z)({},ge,xe.ownerState)},{ref:n,onClick:function(e){te.current&&e.currentTarget===e.target&&te.current.focus(),B&&B(e)}},K,{className:(0,u.default)(ye.root,xe.className,d),children:[Q,(0,p.jsx)(gs.Provider,{value:null,children:(0,p.jsx)(we,(0,a.Z)({ownerState:ge,"aria-invalid":fe.error,"aria-describedby":s,autoComplete:l,autoFocus:f,defaultValue:y,disabled:fe.disabled,id:M,onAnimationStart:function(e){pe("mui-auto-fill-cancel"===e.animationName?te.current:{value:"x"})},name:N,placeholder:H,readOnly:V,required:fe.required,rows:U,value:J,onKeyDown:$,onKeyUp:W,type:Y},me,!$s(we)&&{as:ve,ownerState:(0,a.Z)({},ge,me.ownerState)},{ref:oe,className:(0,u.default)(ye.input,me.className),onBlur:function(e){L&&L(e),Z.onBlur&&Z.onBlur(e),ce&&ce.onBlur?ce.onBlur(e):ue(!1)},onChange:function(e){if(!ee){var t=e.target||te.current;if(null==t)throw new Error((0,Ds.Z)(1));pe({value:t.value})}for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i span":{paddingLeft:5,paddingRight:5,display:"inline-block"}},t.notched&&{maxWidth:"100%",transition:n.transitions.create("max-width",{duration:100,easing:n.transitions.easing.easeOut,delay:50})}))}));function kl(e){return(0,q.Z)("MuiOutlinedInput",e)}var Sl=(0,U.Z)("MuiOutlinedInput",["root","colorSecondary","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","notchedOutline","input","inputSizeSmall","inputMultiline","inputAdornedStart","inputAdornedEnd"]),Ol=["components","fullWidth","inputComponent","label","multiline","notched","type"],Cl=(0,g.ZP)(el,{shouldForwardProp:function(e){return(0,g.FO)(e)||"classes"===e},name:"MuiOutlinedInput",slot:"Root",overridesResolver:Ks})((function(e){var t,n=e.theme,r=e.ownerState,o="light"===n.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return(0,a.Z)((t={position:"relative",borderRadius:n.shape.borderRadius},(0,i.Z)(t,"&:hover .".concat(Sl.notchedOutline),{borderColor:n.palette.text.primary}),(0,i.Z)(t,"@media (hover: none)",(0,i.Z)({},"&:hover .".concat(Sl.notchedOutline),{borderColor:o})),(0,i.Z)(t,"&.".concat(Sl.focused," .").concat(Sl.notchedOutline),{borderColor:n.palette[r.color].main,borderWidth:2}),(0,i.Z)(t,"&.".concat(Sl.error," .").concat(Sl.notchedOutline),{borderColor:n.palette.error.main}),(0,i.Z)(t,"&.".concat(Sl.disabled," .").concat(Sl.notchedOutline),{borderColor:n.palette.action.disabled}),t),r.startAdornment&&{paddingLeft:14},r.endAdornment&&{paddingRight:14},r.multiline&&(0,a.Z)({padding:"16.5px 14px"},"small"===r.size&&{padding:"8.5px 14px"}))})),Ml=(0,g.ZP)((function(e){var t=e.className,n=e.label,r=e.notched,i=(0,o.Z)(e,bl),s=(0,a.Z)({},e,{notched:r,label:n});return(0,p.jsx)(xl,(0,a.Z)({"aria-hidden":!0,className:t,ownerState:s},i,{children:(0,p.jsx)(wl,{ownerState:s,children:n?(0,p.jsx)("span",{children:n}):(0,p.jsx)("span",{className:"notranslate",dangerouslySetInnerHTML:{__html:""}})})}))}),{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:function(e,t){return t.notchedOutline}})((function(e){return{borderColor:"light"===e.theme.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}})),Pl=(0,g.ZP)(tl,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Js})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({padding:"16.5px 14px","&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderRadius:"inherit"}},"small"===n.size&&{padding:"8.5px 14px"},n.multiline&&{padding:0},n.startAdornment&&{paddingLeft:0},n.endAdornment&&{paddingRight:0})})),Tl=e.forwardRef((function(t,n){var r,i=(0,w.Z)({props:t,name:"MuiOutlinedInput"}),s=i.components,l=void 0===s?{}:s,u=i.fullWidth,f=void 0!==u&&u,d=i.inputComponent,h=void 0===d?"input":d,v=i.label,m=i.multiline,g=void 0!==m&&m,y=i.notched,b=i.type,x=void 0===b?"text":b,k=(0,o.Z)(i,Ol),S=function(e){var t=e.classes,n=(0,c.Z)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},kl,t);return(0,a.Z)({},t,n)}(i),O=Ws({props:i,muiFormControl:ys(),states:["required"]});return(0,p.jsx)(il,(0,a.Z)({components:(0,a.Z)({Root:Cl,Input:Pl},l),renderSuffix:function(t){return(0,p.jsx)(Ml,{className:S.notchedOutline,label:v&&O.required?r||(r=(0,p.jsxs)(e.Fragment,{children:[v,"\xa0","*"]})):v,notched:"undefined"!==typeof y?y:Boolean(t.startAdornment||t.filled||t.focused)})},fullWidth:f,inputComponent:h,multiline:g,ref:n,type:x},k,{classes:(0,a.Z)({},S,{notchedOutline:null})}))}));Tl.muiName="Input";var El=Tl;function Zl(e){return(0,q.Z)("MuiFormLabel",e)}var Al=(0,U.Z)("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Rl=["children","className","color","component","disabled","error","filled","focused","required"],Dl=(0,g.ZP)("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return(0,a.Z)({},t.root,"secondary"===n.color&&t.colorSecondary,n.filled&&t.filled)}})((function(e){var t,n=e.theme,r=e.ownerState;return(0,a.Z)({color:n.palette.text.secondary},n.typography.body1,(t={lineHeight:"1.4375em",padding:0,position:"relative"},(0,i.Z)(t,"&.".concat(Al.focused),{color:n.palette[r.color].main}),(0,i.Z)(t,"&.".concat(Al.disabled),{color:n.palette.text.disabled}),(0,i.Z)(t,"&.".concat(Al.error),{color:n.palette.error.main}),t))})),jl=(0,g.ZP)("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:function(e,t){return t.asterisk}})((function(e){var t=e.theme;return(0,i.Z)({},"&.".concat(Al.error),{color:t.palette.error.main})})),_l=e.forwardRef((function(e,t){var n=(0,w.Z)({props:e,name:"MuiFormLabel"}),r=n.children,i=n.className,s=n.component,l=void 0===s?"label":s,f=(0,o.Z)(n,Rl),d=Ws({props:n,muiFormControl:ys(),states:["color","required","focused","disabled","error","filled"]}),h=(0,a.Z)({},n,{color:d.color||"primary",component:l,disabled:d.disabled,error:d.error,filled:d.filled,focused:d.focused,required:d.required}),v=function(e){var t=e.classes,n=e.color,r=e.focused,i=e.disabled,o=e.error,a=e.filled,s=e.required,l={root:["root","color".concat((0,O.Z)(n)),i&&"disabled",o&&"error",a&&"filled",r&&"focused",s&&"required"],asterisk:["asterisk",o&&"error"]};return(0,c.Z)(l,Zl,t)}(h);return(0,p.jsxs)(Dl,(0,a.Z)({as:l,ownerState:h,className:(0,u.default)(v.root,i),ref:t},f,{children:[r,d.required&&(0,p.jsxs)(jl,{ownerState:h,"aria-hidden":!0,className:v.asterisk,children:["\u2009","*"]})]}))})),Nl=_l;function Ll(e){return(0,q.Z)("MuiInputLabel",e)}(0,U.Z)("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);var Il=["disableAnimation","margin","shrink","variant"],zl=(0,g.ZP)(Nl,{shouldForwardProp:function(e){return(0,g.FO)(e)||"classes"===e},name:"MuiInputLabel",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[(0,i.Z)({},"& .".concat(Al.asterisk),t.asterisk),t.root,n.formControl&&t.formControl,"small"===n.size&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,t[n.variant]]}})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},n.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},"small"===n.size&&{transform:"translate(0, 17px) scale(1)"},n.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!n.disableAnimation&&{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},"filled"===n.variant&&(0,a.Z)({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===n.size&&{transform:"translate(12px, 13px) scale(1)"},n.shrink&&(0,a.Z)({transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},"small"===n.size&&{transform:"translate(12px, 4px) scale(0.75)"})),"outlined"===n.variant&&(0,a.Z)({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===n.size&&{transform:"translate(14px, 9px) scale(1)"},n.shrink&&{maxWidth:"calc(133% - 24px)",transform:"translate(14px, -9px) scale(0.75)"}))})),Bl=e.forwardRef((function(e,t){var n=(0,w.Z)({name:"MuiInputLabel",props:e}),r=n.disableAnimation,i=void 0!==r&&r,s=n.shrink,l=(0,o.Z)(n,Il),u=ys(),f=s;"undefined"===typeof f&&u&&(f=u.filled||u.focused||u.adornedStart);var d=Ws({props:n,muiFormControl:u,states:["size","variant","required"]}),h=(0,a.Z)({},n,{disableAnimation:i,formControl:u,shrink:f,size:d.size,variant:d.variant,required:d.required}),v=function(e){var t=e.classes,n=e.formControl,r=e.size,i=e.shrink,o={root:["root",n&&"formControl",!e.disableAnimation&&"animated",i&&"shrink","small"===r&&"sizeSmall",e.variant],asterisk:[e.required&&"asterisk"]},s=(0,c.Z)(o,Ll,t);return(0,a.Z)({},t,s)}(h);return(0,p.jsx)(zl,(0,a.Z)({"data-shrink":f,ownerState:h,ref:t},l,{classes:v}))})),Fl=Bl,$l=n(7816);function Wl(e){return(0,q.Z)("MuiFormControl",e)}(0,U.Z)("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);var Hl=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Vl=(0,g.ZP)("div",{name:"MuiFormControl",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return(0,a.Z)({},t.root,t["margin".concat((0,O.Z)(n.margin))],n.fullWidth&&t.fullWidth)}})((function(e){var t=e.ownerState;return(0,a.Z)({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},"normal"===t.margin&&{marginTop:16,marginBottom:8},"dense"===t.margin&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})})),ql=e.forwardRef((function(t,n){var i=(0,w.Z)({props:t,name:"MuiFormControl"}),s=i.children,l=i.className,f=i.color,d=void 0===f?"primary":f,h=i.component,v=void 0===h?"div":h,m=i.disabled,g=void 0!==m&&m,y=i.error,b=void 0!==y&&y,x=i.focused,k=i.fullWidth,S=void 0!==k&&k,C=i.hiddenLabel,M=void 0!==C&&C,P=i.margin,T=void 0===P?"none":P,E=i.required,Z=void 0!==E&&E,A=i.size,R=void 0===A?"medium":A,D=i.variant,j=void 0===D?"outlined":D,_=(0,o.Z)(i,Hl),N=(0,a.Z)({},i,{color:d,component:v,disabled:g,error:b,fullWidth:S,hiddenLabel:M,margin:T,required:Z,size:R,variant:j}),L=function(e){var t=e.classes,n=e.margin,r=e.fullWidth,i={root:["root","none"!==n&&"margin".concat((0,O.Z)(n)),r&&"fullWidth"]};return(0,c.Z)(i,Wl,t)}(N),I=e.useState((function(){var t=!1;return s&&e.Children.forEach(s,(function(e){if((0,$l.Z)(e,["Input","Select"])){var n=(0,$l.Z)(e,["Select"])?e.props.input:e;n&&n.props.startAdornment&&(t=!0)}})),t})),z=(0,r.Z)(I,2),B=z[0],F=z[1],$=e.useState((function(){var t=!1;return s&&e.Children.forEach(s,(function(e){(0,$l.Z)(e,["Input","Select"])&&Qs(e.props,!0)&&(t=!0)})),t})),W=(0,r.Z)($,2),H=W[0],V=W[1],q=e.useState(!1),U=(0,r.Z)(q,2),Q=U[0],X=U[1];g&&Q&&X(!1);var Y=void 0===x||g?Q:x,G=e.useCallback((function(){V(!0)}),[]),K={adornedStart:B,setAdornedStart:F,color:d,disabled:g,error:b,filled:H,focused:Y,fullWidth:S,hiddenLabel:M,size:R,onBlur:function(){X(!1)},onEmpty:e.useCallback((function(){V(!1)}),[]),onFilled:G,onFocus:function(){X(!0)},registerEffect:undefined,required:Z,variant:j};return(0,p.jsx)(gs.Provider,{value:K,children:(0,p.jsx)(Vl,(0,a.Z)({as:v,ownerState:N,className:(0,u.default)(L.root,l),ref:n},_,{children:s}))})})),Ul=ql;function Ql(e){return(0,q.Z)("MuiFormHelperText",e)}var Xl=(0,U.Z)("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),Yl=["children","className","component","disabled","error","filled","focused","margin","required","variant"],Gl=(0,g.ZP)("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,n.size&&t["size".concat((0,O.Z)(n.size))],n.contained&&t.contained,n.filled&&t.filled]}})((function(e){var t,n=e.theme,r=e.ownerState;return(0,a.Z)({color:n.palette.text.secondary},n.typography.caption,(t={textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0},(0,i.Z)(t,"&.".concat(Xl.disabled),{color:n.palette.text.disabled}),(0,i.Z)(t,"&.".concat(Xl.error),{color:n.palette.error.main}),t),"small"===r.size&&{marginTop:4},r.contained&&{marginLeft:14,marginRight:14})})),Kl=e.forwardRef((function(e,t){var n=(0,w.Z)({props:e,name:"MuiFormHelperText"}),r=n.children,i=n.className,s=n.component,l=void 0===s?"p":s,f=(0,o.Z)(n,Yl),d=Ws({props:n,muiFormControl:ys(),states:["variant","size","disabled","error","filled","focused","required"]}),h=(0,a.Z)({},n,{component:l,contained:"filled"===d.variant||"outlined"===d.variant,variant:d.variant,size:d.size,disabled:d.disabled,error:d.error,filled:d.filled,focused:d.focused,required:d.required}),v=function(e){var t=e.classes,n=e.contained,r=e.size,i=e.disabled,o=e.error,a=e.filled,s=e.focused,l=e.required,u={root:["root",i&&"disabled",o&&"error",r&&"size".concat((0,O.Z)(r)),n&&"contained",s&&"focused",a&&"filled",l&&"required"]};return(0,c.Z)(u,Ql,t)}(h);return(0,p.jsx)(Gl,(0,a.Z)({as:l,ownerState:h,className:(0,u.default)(v.root,i),ref:t},f,{children:" "===r?(0,p.jsx)("span",{className:"notranslate",dangerouslySetInnerHTML:{__html:""}}):r}))})),Jl=Kl,eu=(n(6214),n(6106));var tu=e.createContext({});function nu(e){return(0,q.Z)("MuiList",e)}(0,U.Z)("MuiList",["root","padding","dense","subheader"]);var ru=["children","className","component","dense","disablePadding","subheader"],iu=(0,g.ZP)("ul",{name:"MuiList",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})((function(e){var t=e.ownerState;return(0,a.Z)({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})})),ou=e.forwardRef((function(t,n){var r=(0,w.Z)({props:t,name:"MuiList"}),i=r.children,s=r.className,l=r.component,f=void 0===l?"ul":l,d=r.dense,h=void 0!==d&&d,v=r.disablePadding,m=void 0!==v&&v,g=r.subheader,y=(0,o.Z)(r,ru),b=e.useMemo((function(){return{dense:h}}),[h]),x=(0,a.Z)({},r,{component:f,dense:h,disablePadding:m}),k=function(e){var t=e.classes,n={root:["root",!e.disablePadding&&"padding",e.dense&&"dense",e.subheader&&"subheader"]};return(0,c.Z)(n,nu,t)}(x);return(0,p.jsx)(tu.Provider,{value:b,children:(0,p.jsxs)(iu,(0,a.Z)({as:f,className:(0,u.default)(k.root,s),ref:n,ownerState:x},y,{children:[g,i]}))})})),au=ou;function su(e){var t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}var lu=su,uu=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function cu(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function fu(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function du(e,t){if(void 0===t)return!0;var n=e.innerText;return void 0===n&&(n=e.textContent),0!==(n=n.trim().toLowerCase()).length&&(t.repeating?n[0]===t.keys[0]:0===n.indexOf(t.keys.join("")))}function hu(e,t,n,r,i,o){for(var a=!1,s=i(e,t,!!t&&n);s;){if(s===e.firstChild){if(a)return!1;a=!0}var l=!r&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&du(s,o)&&!l)return s.focus(),!0;s=i(e,s,n)}return!1}var pu=e.forwardRef((function(t,n){var r=t.actions,i=t.autoFocus,s=void 0!==i&&i,l=t.autoFocusItem,u=void 0!==l&&l,c=t.children,f=t.className,d=t.disabledItemsFocusable,h=void 0!==d&&d,v=t.disableListWrap,m=void 0!==v&&v,g=t.onKeyDown,y=t.variant,b=void 0===y?"selectedMenu":y,x=(0,o.Z)(t,uu),w=e.useRef(null),k=e.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});(0,Hs.Z)((function(){s&&w.current.focus()}),[s]),e.useImperativeHandle(r,(function(){return{adjustStyleForScrollbar:function(e,t){var n=!w.current.style.width;if(e.clientHeight0&&(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);var s=r&&!i.repeating&&du(r,i);i.previousKeyMatched&&(s||hu(t,r,!1,h,cu,i))?e.preventDefault():i.previousKeyMatched=!1}g&&g(e)},tabIndex:s?0:-1},x,{children:C}))})),vu=pu,mu=n(8706),gu=n(3533),yu=n(4246),bu=n(9265);var xu=e.forwardRef((function(n,i){var o=n.children,a=n.container,s=n.disablePortal,l=void 0!==s&&s,u=e.useState(null),c=(0,r.Z)(u,2),d=c[0],h=c[1],p=(0,f.Z)(e.isValidElement(o)?o.ref:null,i);return(0,Ns.Z)((function(){l||h(function(e){return"function"===typeof e?e():e}(a)||document.body)}),[a,l]),(0,Ns.Z)((function(){if(d&&!l)return(0,bu.Z)(i,d),function(){(0,bu.Z)(i,null)}}),[i,d,l]),l?e.isValidElement(o)?e.cloneElement(o,{ref:p}):o:d?t.createPortal(o,d):d}));function wu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ku(e,t){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0,o=[t,n].concat((0,me.Z)(r)),a=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(e.children,(function(e){-1===o.indexOf(e)&&-1===a.indexOf(e.tagName)&&Ou(e,i)}))}function Pu(e,t){var n=-1;return e.some((function(e,r){return!!t(e)&&(n=r,!0)})),n}function Tu(e,t){var n=[],r=e.container;if(!t.disableScrollLock){if(function(e){var t=(0,h.Z)(e);return t.body===e?(0,js.Z)(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(r)){var i=su((0,h.Z)(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight="".concat(Cu(r)+i,"px");var o=(0,h.Z)(r).querySelectorAll(".mui-fixed");[].forEach.call(o,(function(e){n.push({value:e.style.paddingRight,property:"padding-right",el:e}),e.style.paddingRight="".concat(Cu(e)+i,"px")}))}var a=r.parentElement,s=(0,js.Z)(r),l="HTML"===(null==a?void 0:a.nodeName)&&"scroll"===s.getComputedStyle(a).overflowY?a:r;n.push({value:l.style.overflow,property:"overflow",el:l},{value:l.style.overflowX,property:"overflow-x",el:l},{value:l.style.overflowY,property:"overflow-y",el:l}),l.style.overflow="hidden"}return function(){n.forEach((function(e){var t=e.value,n=e.el,r=e.property;t?n.style.setProperty(r,t):n.style.removeProperty(r)}))}}var Eu=function(){function e(){wu(this,e),this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}return Su(e,[{key:"add",value:function(e,t){var n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&Ou(e.modalRef,!1);var r=function(e){var t=[];return[].forEach.call(e.children,(function(e){"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);Mu(t,e.mount,e.modalRef,r,!0);var i=Pu(this.containers,(function(e){return e.container===t}));return-1!==i?(this.containers[i].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n)}},{key:"mount",value:function(e,t){var n=Pu(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];r.restore||(r.restore=Tu(r,t))}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var n=Pu(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)r.restore&&r.restore(),e.modalRef&&Ou(e.modalRef,!0),Mu(r.container,e.mount,e.modalRef,r.hiddenSiblings,!1),this.containers.splice(n,1);else{var i=r.modals[r.modals.length-1];i.modalRef&&Ou(i.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}]),e}(),Zu=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Au(e){var t=[],n=[];return Array.from(e.querySelectorAll(Zu)).forEach((function(e,r){var i=function(e){var 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&&function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type)return!1;if(!e.name)return!1;var t=function(t){return e.ownerDocument.querySelector('input[type="radio"]'.concat(t))},n=t('[name="'.concat(e.name,'"]:checked'));return n||(n=t('[name="'.concat(e.name,'"]'))),n!==e}(e))}(e)&&(0===i?t.push(e):n.push({documentOrder:r,tabIndex:i,node:e}))})),n.sort((function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex})).map((function(e){return e.node})).concat(t)}function Ru(){return!0}var Du=function(t){var n=t.children,r=t.disableAutoFocus,i=void 0!==r&&r,o=t.disableEnforceFocus,a=void 0!==o&&o,s=t.disableRestoreFocus,l=void 0!==s&&s,u=t.getTabbable,c=void 0===u?Au:u,d=t.isEnabled,v=void 0===d?Ru:d,m=t.open,g=e.useRef(),y=e.useRef(null),b=e.useRef(null),x=e.useRef(null),w=e.useRef(null),k=e.useRef(!1),S=e.useRef(null),O=(0,f.Z)(n.ref,S),C=e.useRef(null);e.useEffect((function(){m&&S.current&&(k.current=!i)}),[i,m]),e.useEffect((function(){if(m&&S.current){var e=(0,h.Z)(S.current);return S.current.contains(e.activeElement)||(S.current.hasAttribute("tabIndex")||S.current.setAttribute("tabIndex",-1),k.current&&S.current.focus()),function(){l||(x.current&&x.current.focus&&(g.current=!0,x.current.focus()),x.current=null)}}}),[m]),e.useEffect((function(){if(m&&S.current){var e=(0,h.Z)(S.current),t=function(t){var n=S.current;if(null!==n)if(e.hasFocus()&&!a&&v()&&!g.current){if(!n.contains(e.activeElement)){if(t&&w.current!==t.target||e.activeElement!==w.current)w.current=null;else if(null!==w.current)return;if(!k.current)return;var r=[];if(e.activeElement!==y.current&&e.activeElement!==b.current||(r=c(S.current)),r.length>0){var i,o,s=Boolean((null==(i=C.current)?void 0:i.shiftKey)&&"Tab"===(null==(o=C.current)?void 0:o.key)),l=r[0],u=r[r.length-1];s?u.focus():l.focus()}else n.focus()}}else g.current=!1},n=function(t){C.current=t,!a&&v()&&"Tab"===t.key&&e.activeElement===S.current&&t.shiftKey&&(g.current=!0,b.current.focus())};e.addEventListener("focusin",t),e.addEventListener("keydown",n,!0);var r=setInterval((function(){"BODY"===e.activeElement.tagName&&t()}),50);return function(){clearInterval(r),e.removeEventListener("focusin",t),e.removeEventListener("keydown",n,!0)}}}),[i,a,l,v,m,c]);var M=function(e){null===x.current&&(x.current=e.relatedTarget),k.current=!0};return(0,p.jsxs)(e.Fragment,{children:[(0,p.jsx)("div",{tabIndex:0,onFocus:M,ref:y,"data-test":"sentinelStart"}),e.cloneElement(n,{ref:O,onFocus:function(e){null===x.current&&(x.current=e.relatedTarget),k.current=!0,w.current=e.target;var t=n.props.onFocus;t&&t(e)}}),(0,p.jsx)("div",{tabIndex:0,onFocus:M,ref:b,"data-test":"sentinelEnd"})]})};function ju(e){return(0,q.Z)("MuiModal",e)}(0,U.Z)("MuiModal",["root","hidden"]);var _u=["BackdropComponent","BackdropProps","children","classes","className","closeAfterTransition","component","components","componentsProps","container","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","manager","onBackdropClick","onClose","onKeyDown","open","theme","onTransitionEnter","onTransitionExited"];var Nu=new Eu,Lu=e.forwardRef((function(t,n){var i=t.BackdropComponent,s=t.BackdropProps,l=t.children,v=t.classes,m=t.className,g=t.closeAfterTransition,y=void 0!==g&&g,b=t.component,x=void 0===b?"div":b,w=t.components,k=void 0===w?{}:w,S=t.componentsProps,O=void 0===S?{}:S,C=t.container,M=t.disableAutoFocus,P=void 0!==M&&M,T=t.disableEnforceFocus,E=void 0!==T&&T,Z=t.disableEscapeKeyDown,A=void 0!==Z&&Z,R=t.disablePortal,D=void 0!==R&&R,j=t.disableRestoreFocus,_=void 0!==j&&j,N=t.disableScrollLock,L=void 0!==N&&N,I=t.hideBackdrop,z=void 0!==I&&I,B=t.keepMounted,F=void 0!==B&&B,$=t.manager,W=void 0===$?Nu:$,H=t.onBackdropClick,V=t.onClose,q=t.onKeyDown,U=t.open,Q=t.theme,X=t.onTransitionEnter,Y=t.onTransitionExited,G=(0,o.Z)(t,_u),K=e.useState(!0),J=(0,r.Z)(K,2),ee=J[0],te=J[1],ne=e.useRef({}),re=e.useRef(null),ie=e.useRef(null),oe=(0,f.Z)(ie,n),ae=function(e){return!!e.children&&e.children.props.hasOwnProperty("in")}(t),se=function(){return ne.current.modalRef=ie.current,ne.current.mountNode=re.current,ne.current},le=function(){W.mount(se(),{disableScrollLock:L}),ie.current.scrollTop=0},ue=(0,d.Z)((function(){var e=function(e){return"function"===typeof e?e():e}(C)||(0,h.Z)(re.current).body;W.add(se(),e),ie.current&&le()})),ce=e.useCallback((function(){return W.isTopModal(se())}),[W]),fe=(0,d.Z)((function(e){re.current=e,e&&(U&&ce()?le():Ou(ie.current,!0))})),de=e.useCallback((function(){W.remove(se())}),[W]);e.useEffect((function(){return function(){de()}}),[de]),e.useEffect((function(){U?ue():ae&&y||de()}),[U,de,ae,y,ue]);var he=(0,a.Z)({},t,{classes:v,closeAfterTransition:y,disableAutoFocus:P,disableEnforceFocus:E,disableEscapeKeyDown:A,disablePortal:D,disableRestoreFocus:_,disableScrollLock:L,exited:ee,hideBackdrop:z,keepMounted:F}),pe=function(e){var t=e.open,n=e.exited,r=e.classes,i={root:["root",!t&&n&&"hidden"]};return(0,c.Z)(i,ju,r)}(he);if(!F&&!U&&(!ae||ee))return null;var ve={};void 0===l.props.tabIndex&&(ve.tabIndex="-1"),ae&&(ve.onEnter=(0,yu.Z)((function(){te(!1),X&&X()}),l.props.onEnter),ve.onExited=(0,yu.Z)((function(){te(!0),Y&&Y(),y&&de()}),l.props.onExited));var me=k.Root||x,ge=O.root||{};return(0,p.jsx)(xu,{ref:fe,container:C,disablePortal:D,children:(0,p.jsxs)(me,(0,a.Z)({role:"presentation"},ge,!$s(me)&&{as:x,ownerState:(0,a.Z)({},he,ge.ownerState),theme:Q},G,{ref:oe,onKeyDown:function(e){q&&q(e),"Escape"===e.key&&ce()&&(A||(e.stopPropagation(),V&&V(e,"escapeKeyDown")))},className:(0,u.default)(pe.root,ge.className,m),children:[!z&&i?(0,p.jsx)(i,(0,a.Z)({open:U,onClick:function(e){e.target===e.currentTarget&&(H&&H(e),V&&V(e,"backdropClick"))}},s)):null,(0,p.jsx)(Du,{disableEnforceFocus:E,disableAutoFocus:P,disableRestoreFocus:_,isEnabled:ce,open:U,children:e.cloneElement(l,ve)})]}))})})),Iu=Lu;function zu(e){return(0,q.Z)("MuiBackdrop",e)}(0,U.Z)("MuiBackdrop",["root","invisible"]);var Bu=["classes","className","invisible","component","components","componentsProps","theme"],Fu=e.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.invisible,s=void 0!==i&&i,l=e.component,f=void 0===l?"div":l,d=e.components,h=void 0===d?{}:d,v=e.componentsProps,m=void 0===v?{}:v,g=e.theme,y=(0,o.Z)(e,Bu),b=(0,a.Z)({},e,{classes:n,invisible:s}),x=function(e){var t=e.classes,n={root:["root",e.invisible&&"invisible"]};return(0,c.Z)(n,zu,t)}(b),w=h.Root||f,k=m.root||{};return(0,p.jsx)(w,(0,a.Z)({"aria-hidden":!0},k,!$s(w)&&{as:f,ownerState:(0,a.Z)({},b,k.ownerState),theme:g},{ref:t},y,{className:(0,u.default)(x.root,k.className,r)}))})),$u=Fu,Wu=["children","components","componentsProps","className","invisible","open","transitionDuration","TransitionComponent"],Hu=(0,g.ZP)("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,n.invisible&&t.invisible]}})((function(e){var t=e.ownerState;return(0,a.Z)({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"},t.invisible&&{backgroundColor:"transparent"})})),Vu=e.forwardRef((function(e,t){var n,r=(0,w.Z)({props:e,name:"MuiBackdrop"}),i=r.children,s=r.components,l=void 0===s?{}:s,u=r.componentsProps,c=void 0===u?{}:u,f=r.className,d=r.invisible,h=void 0!==d&&d,v=r.open,m=r.transitionDuration,g=r.TransitionComponent,y=void 0===g?Ht:g,b=(0,o.Z)(r,Wu),x=function(e){return e.classes}((0,a.Z)({},r,{invisible:h}));return(0,p.jsx)(y,(0,a.Z)({in:v,timeout:m},b,{children:(0,p.jsx)($u,{className:f,invisible:h,components:(0,a.Z)({Root:Hu},l),componentsProps:{root:(0,a.Z)({},c.root,(!l.Root||!$s(l.Root))&&{ownerState:(0,a.Z)({},null==(n=c.root)?void 0:n.ownerState)})},classes:x,ref:t,children:i})}))})),qu=Vu,Uu=["BackdropComponent","closeAfterTransition","children","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted"],Qu=(0,g.ZP)("div",{name:"MuiModal",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,!n.open&&n.exited&&t.hidden]}})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({position:"fixed",zIndex:t.zIndex.modal,right:0,bottom:0,top:0,left:0},!n.open&&n.exited&&{visibility:"hidden"})})),Xu=(0,g.ZP)(qu,{name:"MuiModal",slot:"Backdrop",overridesResolver:function(e,t){return t.backdrop}})({zIndex:-1}),Yu=e.forwardRef((function(t,n){var i,s=(0,w.Z)({name:"MuiModal",props:t}),l=s.BackdropComponent,u=void 0===l?Xu:l,c=s.closeAfterTransition,f=void 0!==c&&c,d=s.children,h=s.components,v=void 0===h?{}:h,m=s.componentsProps,g=void 0===m?{}:m,y=s.disableAutoFocus,b=void 0!==y&&y,x=s.disableEnforceFocus,k=void 0!==x&&x,S=s.disableEscapeKeyDown,O=void 0!==S&&S,C=s.disablePortal,M=void 0!==C&&C,P=s.disableRestoreFocus,T=void 0!==P&&P,E=s.disableScrollLock,Z=void 0!==E&&E,A=s.hideBackdrop,R=void 0!==A&&A,D=s.keepMounted,j=void 0!==D&&D,_=(0,o.Z)(s,Uu),N=e.useState(!0),L=(0,r.Z)(N,2),I=L[0],z=L[1],B={closeAfterTransition:f,disableAutoFocus:b,disableEnforceFocus:k,disableEscapeKeyDown:O,disablePortal:M,disableRestoreFocus:T,disableScrollLock:Z,hideBackdrop:R,keepMounted:j},F=function(e){return e.classes}((0,a.Z)({},s,B,{exited:I}));return(0,p.jsx)(Iu,(0,a.Z)({components:(0,a.Z)({Root:Qu},v),componentsProps:{root:(0,a.Z)({},g.root,(!v.Root||!$s(v.Root))&&{ownerState:(0,a.Z)({},null==(i=g.root)?void 0:i.ownerState)})},BackdropComponent:u,onTransitionEnter:function(){return z(!1)},onTransitionExited:function(){return z(!0)},ref:n},_,{classes:F},B,{children:d}))})),Gu=Yu;function Ku(e){return(0,q.Z)("MuiPopover",e)}(0,U.Z)("MuiPopover",["root","paper"]);var Ju=["onEntering"],ec=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"];function tc(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function nc(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function rc(e){return[e.horizontal,e.vertical].map((function(e){return"number"===typeof e?"".concat(e,"px"):e})).join(" ")}function ic(e){return"function"===typeof e?e():e}var oc=(0,g.ZP)(Gu,{name:"MuiPopover",slot:"Root",overridesResolver:function(e,t){return t.root}})({}),ac=(0,g.ZP)(J,{name:"MuiPopover",slot:"Paper",overridesResolver:function(e,t){return t.paper}})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),sc=e.forwardRef((function(t,n){var r=(0,w.Z)({props:t,name:"MuiPopover"}),i=r.action,s=r.anchorEl,l=r.anchorOrigin,f=void 0===l?{vertical:"top",horizontal:"left"}:l,d=r.anchorPosition,h=r.anchorReference,v=void 0===h?"anchorEl":h,m=r.children,g=r.className,y=r.container,b=r.elevation,x=void 0===b?8:b,k=r.marginThreshold,S=void 0===k?16:k,O=r.open,C=r.PaperProps,M=void 0===C?{}:C,P=r.transformOrigin,T=void 0===P?{vertical:"top",horizontal:"left"}:P,E=r.TransitionComponent,Z=void 0===E?H:E,A=r.transitionDuration,R=void 0===A?"auto":A,D=r.TransitionProps,j=(D=void 0===D?{}:D).onEntering,_=(0,o.Z)(r.TransitionProps,Ju),N=(0,o.Z)(r,ec),L=e.useRef(),I=(0,z.Z)(L,M.ref),B=(0,a.Z)({},r,{anchorOrigin:f,anchorReference:v,elevation:x,marginThreshold:S,PaperProps:M,transformOrigin:T,TransitionComponent:Z,transitionDuration:R,TransitionProps:_}),F=function(e){var t=e.classes;return(0,c.Z)({root:["root"],paper:["paper"]},Ku,t)}(B),$=e.useCallback((function(){if("anchorPosition"===v)return d;var e=ic(s),t=(e&&1===e.nodeType?e:(0,eu.Z)(L.current).body).getBoundingClientRect();return{top:t.top+tc(t,f.vertical),left:t.left+nc(t,f.horizontal)}}),[s,f.horizontal,f.vertical,d,v]),W=e.useCallback((function(e){return{vertical:tc(e,T.vertical),horizontal:nc(e,T.horizontal)}}),[T.horizontal,T.vertical]),V=e.useCallback((function(e){var t={width:e.offsetWidth,height:e.offsetHeight},n=W(t);if("none"===v)return{top:null,left:null,transformOrigin:rc(n)};var r=$(),i=r.top-n.vertical,o=r.left-n.horizontal,a=i+t.height,l=o+t.width,u=(0,gu.Z)(ic(s)),c=u.innerHeight-S,f=u.innerWidth-S;if(ic){var h=a-c;i-=h,n.vertical+=h}if(of){var m=l-f;o-=m,n.horizontal+=m}return{top:"".concat(Math.round(i),"px"),left:"".concat(Math.round(o),"px"),transformOrigin:rc(n)}}),[s,v,$,W,S]),q=e.useCallback((function(){var e=L.current;if(e){var t=V(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin}}),[V]);e.useEffect((function(){O&&q()})),e.useImperativeHandle(i,(function(){return O?{updatePosition:function(){q()}}:null}),[O,q]),e.useEffect((function(){if(O){var e=(0,mu.Z)((function(){q()})),t=(0,gu.Z)(s);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}}),[s,O,q]);var U=R;"auto"!==R||Z.muiSupportAuto||(U=void 0);var Q=y||(s?(0,eu.Z)(ic(s)).body:void 0);return(0,p.jsx)(oc,(0,a.Z)({BackdropProps:{invisible:!0},className:(0,u.default)(F.root,g),container:Q,open:O,ref:n,ownerState:B},N,{children:(0,p.jsx)(Z,(0,a.Z)({appear:!0,in:O,onEntering:function(e,t){j&&j(e,t),q()},timeout:U},_,{children:(0,p.jsx)(ac,(0,a.Z)({elevation:x},M,{ref:I,className:(0,u.default)(F.paper,M.className),children:m}))}))}))})),lc=sc;function uc(e){return(0,q.Z)("MuiMenu",e)}(0,U.Z)("MuiMenu",["root","paper","list"]);var cc=["onEntering"],fc=["autoFocus","children","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant"],dc={vertical:"top",horizontal:"right"},hc={vertical:"top",horizontal:"left"},pc=(0,g.ZP)(lc,{shouldForwardProp:function(e){return(0,g.FO)(e)||"classes"===e},name:"MuiMenu",slot:"Root",overridesResolver:function(e,t){return t.root}})({}),vc=(0,g.ZP)(J,{name:"MuiMenu",slot:"Paper",overridesResolver:function(e,t){return t.paper}})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),mc=(0,g.ZP)(vu,{name:"MuiMenu",slot:"List",overridesResolver:function(e,t){return t.list}})({outline:0}),gc=e.forwardRef((function(t,n){var r=(0,w.Z)({props:t,name:"MuiMenu"}),i=r.autoFocus,s=void 0===i||i,l=r.children,f=r.disableAutoFocusItem,d=void 0!==f&&f,h=r.MenuListProps,v=void 0===h?{}:h,m=r.onClose,g=r.open,y=r.PaperProps,b=void 0===y?{}:y,k=r.PopoverClasses,S=r.transitionDuration,O=void 0===S?"auto":S,C=r.TransitionProps,M=(C=void 0===C?{}:C).onEntering,P=r.variant,T=void 0===P?"selectedMenu":P,E=(0,o.Z)(r.TransitionProps,cc),Z=(0,o.Z)(r,fc),A=x(),R="rtl"===A.direction,D=(0,a.Z)({},r,{autoFocus:s,disableAutoFocusItem:d,MenuListProps:v,onEntering:M,PaperProps:b,transitionDuration:O,TransitionProps:E,variant:T}),j=function(e){var t=e.classes;return(0,c.Z)({root:["root"],paper:["paper"],list:["list"]},uc,t)}(D),_=s&&!d&&g,N=e.useRef(null),L=-1;return e.Children.map(l,(function(t,n){e.isValidElement(t)&&(t.props.disabled||("selectedMenu"===T&&t.props.selected||-1===L)&&(L=n))})),(0,p.jsx)(pc,(0,a.Z)({classes:k,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:R?"right":"left"},transformOrigin:R?dc:hc,PaperProps:(0,a.Z)({component:vc},b,{classes:(0,a.Z)({},b.classes,{root:j.paper})}),className:j.root,open:g,ref:n,transitionDuration:O,TransitionProps:(0,a.Z)({onEntering:function(e,t){N.current&&N.current.adjustStyleForScrollbar(e,A),M&&M(e,t)}},E),ownerState:D},Z,{children:(0,p.jsx)(mc,(0,a.Z)({onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),m&&m(e,"tabKeyDown"))},actions:N,autoFocus:s&&(-1===L||d),autoFocusItem:_,variant:T},v,{className:(0,u.default)(j.list,v.className),children:l}))}))})),yc=gc;function bc(e){return(0,q.Z)("MuiNativeSelect",e)}var xc=(0,U.Z)("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput"]),wc=["className","disabled","IconComponent","inputRef","variant"],kc=function(e){var t,n=e.ownerState,r=e.theme;return(0,a.Z)((t={MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{backgroundColor:"light"===r.palette.mode?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)",borderRadius:0},"&::-ms-expand":{display:"none"}},(0,i.Z)(t,"&.".concat(xc.disabled),{cursor:"default"}),(0,i.Z)(t,"&[multiple]",{height:"auto"}),(0,i.Z)(t,"&:not([multiple]) option, &:not([multiple]) optgroup",{backgroundColor:r.palette.background.paper}),(0,i.Z)(t,"&&&",{paddingRight:24,minWidth:16}),t),"filled"===n.variant&&{"&&&":{paddingRight:32}},"outlined"===n.variant&&{borderRadius:r.shape.borderRadius,"&:focus":{borderRadius:r.shape.borderRadius},"&&&":{paddingRight:32}})},Sc=(0,g.ZP)("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:g.FO,overridesResolver:function(e,t){var n=e.ownerState;return[t.select,t[n.variant],(0,i.Z)({},"&.".concat(xc.multiple),t.multiple)]}})(kc),Oc=function(e){var t=e.ownerState,n=e.theme;return(0,a.Z)((0,i.Z)({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:n.palette.action.active},"&.".concat(xc.disabled),{color:n.palette.action.disabled}),t.open&&{transform:"rotate(180deg)"},"filled"===t.variant&&{right:7},"outlined"===t.variant&&{right:7})},Cc=(0,g.ZP)("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:function(e,t){var n=e.ownerState;return[t.icon,n.variant&&t["icon".concat((0,O.Z)(n.variant))],n.open&&t.iconOpen]}})(Oc),Mc=e.forwardRef((function(t,n){var r=t.className,i=t.disabled,s=t.IconComponent,l=t.inputRef,f=t.variant,d=void 0===f?"standard":f,h=(0,o.Z)(t,wc),v=(0,a.Z)({},t,{disabled:i,variant:d}),m=function(e){var t=e.classes,n=e.variant,r=e.disabled,i=e.multiple,o=e.open,a={select:["select",n,r&&"disabled",i&&"multiple"],icon:["icon","icon".concat((0,O.Z)(n)),o&&"iconOpen",r&&"disabled"]};return(0,c.Z)(a,bc,t)}(v);return(0,p.jsxs)(e.Fragment,{children:[(0,p.jsx)(Sc,(0,a.Z)({ownerState:v,className:(0,u.default)(m.select,r),disabled:i,ref:l||n},h)),t.multiple?null:(0,p.jsx)(Cc,{as:s,ownerState:v,className:m.icon})]})})),Pc=Mc,Tc=n(522);function Ec(e){return(0,q.Z)("MuiSelect",e)}var Zc=(0,U.Z)("MuiSelect",["select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput"]),Ac=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],Rc=(0,g.ZP)("div",{name:"MuiSelect",slot:"Select",overridesResolver:function(e,t){var n=e.ownerState;return[(0,i.Z)({},"&.".concat(Zc.select),t.select),(0,i.Z)({},"&.".concat(Zc.select),t[n.variant]),(0,i.Z)({},"&.".concat(Zc.multiple),t.multiple)]}})(kc,(0,i.Z)({},"&.".concat(Zc.select),{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"})),Dc=(0,g.ZP)("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:function(e,t){var n=e.ownerState;return[t.icon,n.variant&&t["icon".concat((0,O.Z)(n.variant))],n.open&&t.iconOpen]}})(Oc),jc=(0,g.ZP)("input",{shouldForwardProp:function(e){return(0,g.Dz)(e)&&"classes"!==e},name:"MuiSelect",slot:"NativeInput",overridesResolver:function(e,t){return t.nativeInput}})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function _c(e,t){return"object"===typeof t&&null!==t?e===t:String(e)===String(t)}function Nc(e){return null==e||"string"===typeof e&&!e.trim()}var Lc,Ic,zc=e.forwardRef((function(t,n){var i=t["aria-describedby"],s=t["aria-label"],l=t.autoFocus,f=t.autoWidth,d=t.children,h=t.className,v=t.defaultValue,m=t.disabled,g=t.displayEmpty,y=t.IconComponent,b=t.inputRef,x=t.labelId,w=t.MenuProps,k=void 0===w?{}:w,S=t.multiple,C=t.name,M=t.onBlur,P=t.onChange,T=t.onClose,E=t.onFocus,Z=t.onOpen,A=t.open,R=t.readOnly,D=t.renderValue,j=t.SelectDisplayProps,_=void 0===j?{}:j,N=t.tabIndex,L=t.value,I=t.variant,B=void 0===I?"standard":I,F=(0,o.Z)(t,Ac),$=(0,Tc.Z)({controlled:L,default:v,name:"Select"}),W=(0,r.Z)($,2),H=W[0],V=W[1],q=e.useRef(null),U=e.useRef(null),Q=e.useState(null),X=(0,r.Z)(Q,2),Y=X[0],G=X[1],K=e.useRef(null!=A).current,J=e.useState(),ee=(0,r.Z)(J,2),te=ee[0],ne=ee[1],re=e.useState(!1),ie=(0,r.Z)(re,2),oe=ie[0],ae=ie[1],se=(0,z.Z)(n,b),le=e.useCallback((function(e){U.current=e,e&&G(e)}),[]);e.useImperativeHandle(se,(function(){return{focus:function(){U.current.focus()},node:q.current,value:H}}),[H]),e.useEffect((function(){l&&U.current.focus()}),[l]),e.useEffect((function(){var e=(0,eu.Z)(U.current).getElementById(x);if(e){var t=function(){getSelection().isCollapsed&&U.current.focus()};return e.addEventListener("click",t),function(){e.removeEventListener("click",t)}}}),[x]);var ue,ce,fe=function(e,t){e?Z&&Z(t):T&&T(t),K||(ne(f?null:Y.clientWidth),ae(e))},de=e.Children.toArray(d),he=function(e){return function(t){var n;if(t.currentTarget.hasAttribute("tabindex")){if(S){n=Array.isArray(H)?H.slice():[];var r=H.indexOf(e.props.value);-1===r?n.push(e.props.value):n.splice(r,1)}else n=e.props.value;if(e.props.onClick&&e.props.onClick(t),H!==n&&(V(n),P)){var i=t.nativeEvent||t,o=new i.constructor(i.type,i);Object.defineProperty(o,"target",{writable:!0,value:{value:n,name:C}}),P(o,e)}S||fe(!1,t)}}},pe=null!==Y&&(K?A:oe);delete F["aria-invalid"];var ve=[],me=!1;(Qs({value:H})||g)&&(D?ue=D(H):me=!0);var ge=de.map((function(t){if(!e.isValidElement(t))return null;var n;if(S){if(!Array.isArray(H))throw new Error((0,Ds.Z)(2));(n=H.some((function(e){return _c(e,t.props.value)})))&&me&&ve.push(t.props.children)}else(n=_c(H,t.props.value))&&me&&(ce=t.props.children);return n&&!0,e.cloneElement(t,{"aria-selected":n?"true":"false",onClick:he(t),onKeyUp:function(e){" "===e.key&&e.preventDefault(),t.props.onKeyUp&&t.props.onKeyUp(e)},role:"option",selected:n,value:void 0,"data-value":t.props.value})}));me&&(ue=S?0===ve.length?null:ve.reduce((function(e,t,n){return e.push(t),no[r][1]||n({type:"SET_YAXIS_LIMITS",payload:o})}),500),[t.limits.range]);return(0,p.jsxs)(zt,{display:"grid",alignItems:"center",gap:2,children:[(0,p.jsx)(As,{control:(0,p.jsx)(vf,{checked:t.limits.enable,onChange:function(){n({type:"TOGGLE_ENABLE_YAXIS_LIMITS"})}}),label:"Fix the limits for y-axis"}),(0,p.jsx)(zt,{display:"grid",alignItems:"center",gap:2,children:r.map((function(e){return(0,p.jsxs)(zt,{display:"grid",gridTemplateColumns:"120px 120px",gap:1,children:[(0,p.jsx)(Yc,{label:"Min ".concat(e),type:"number",size:"small",variant:"outlined",disabled:!t.limits.enable,defaultValue:t.limits.range[e][0],onChange:function(t){return i(t,e,0)}}),(0,p.jsx)(Yc,{label:"Max ".concat(e),type:"number",size:"small",variant:"outlined",disabled:!t.limits.enable,defaultValue:t.limits.range[e][1],onChange:function(t){return i(t,e,1)}})]},e)}))})]})},gf=n(9023);function yf(e){return(0,q.Z)("MuiButton",e)}var bf=(0,U.Z)("MuiButton",["root","text","textInherit","textPrimary","textSecondary","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","contained","containedInherit","containedPrimary","containedSecondary","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]);var xf=e.createContext({}),wf=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],kf=function(e){return(0,a.Z)({},"small"===e.size&&{"& > *:nth-of-type(1)":{fontSize:18}},"medium"===e.size&&{"& > *:nth-of-type(1)":{fontSize:20}},"large"===e.size&&{"& > *:nth-of-type(1)":{fontSize:22}})},Sf=(0,g.ZP)(ot,{shouldForwardProp:function(e){return(0,g.FO)(e)||"classes"===e},name:"MuiButton",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,t[n.variant],t["".concat(n.variant).concat((0,O.Z)(n.color))],t["size".concat((0,O.Z)(n.size))],t["".concat(n.variant,"Size").concat((0,O.Z)(n.size))],"inherit"===n.color&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})((function(e){var t,n=e.theme,r=e.ownerState;return(0,a.Z)({},n.typography.button,(t={minWidth:64,padding:"6px 16px",borderRadius:n.shape.borderRadius,transition:n.transitions.create(["background-color","box-shadow","border-color","color"],{duration:n.transitions.duration.short}),"&:hover":(0,a.Z)({textDecoration:"none",backgroundColor:(0,V.Fq)(n.palette.text.primary,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"text"===r.variant&&"inherit"!==r.color&&{backgroundColor:(0,V.Fq)(n.palette[r.color].main,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"outlined"===r.variant&&"inherit"!==r.color&&{border:"1px solid ".concat(n.palette[r.color].main),backgroundColor:(0,V.Fq)(n.palette[r.color].main,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"contained"===r.variant&&{backgroundColor:n.palette.grey.A100,boxShadow:n.shadows[4],"@media (hover: none)":{boxShadow:n.shadows[2],backgroundColor:n.palette.grey[300]}},"contained"===r.variant&&"inherit"!==r.color&&{backgroundColor:n.palette[r.color].dark,"@media (hover: none)":{backgroundColor:n.palette[r.color].main}}),"&:active":(0,a.Z)({},"contained"===r.variant&&{boxShadow:n.shadows[8]})},(0,i.Z)(t,"&.".concat(bf.focusVisible),(0,a.Z)({},"contained"===r.variant&&{boxShadow:n.shadows[6]})),(0,i.Z)(t,"&.".concat(bf.disabled),(0,a.Z)({color:n.palette.action.disabled},"outlined"===r.variant&&{border:"1px solid ".concat(n.palette.action.disabledBackground)},"outlined"===r.variant&&"secondary"===r.color&&{border:"1px solid ".concat(n.palette.action.disabled)},"contained"===r.variant&&{color:n.palette.action.disabled,boxShadow:n.shadows[0],backgroundColor:n.palette.action.disabledBackground})),t),"text"===r.variant&&{padding:"6px 8px"},"text"===r.variant&&"inherit"!==r.color&&{color:n.palette[r.color].main},"outlined"===r.variant&&{padding:"5px 15px",border:"1px solid ".concat("light"===n.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")},"outlined"===r.variant&&"inherit"!==r.color&&{color:n.palette[r.color].main,border:"1px solid ".concat((0,V.Fq)(n.palette[r.color].main,.5))},"contained"===r.variant&&{color:n.palette.getContrastText(n.palette.grey[300]),backgroundColor:n.palette.grey[300],boxShadow:n.shadows[2]},"contained"===r.variant&&"inherit"!==r.color&&{color:n.palette[r.color].contrastText,backgroundColor:n.palette[r.color].main},"inherit"===r.color&&{color:"inherit",borderColor:"currentColor"},"small"===r.size&&"text"===r.variant&&{padding:"4px 5px",fontSize:n.typography.pxToRem(13)},"large"===r.size&&"text"===r.variant&&{padding:"8px 11px",fontSize:n.typography.pxToRem(15)},"small"===r.size&&"outlined"===r.variant&&{padding:"3px 9px",fontSize:n.typography.pxToRem(13)},"large"===r.size&&"outlined"===r.variant&&{padding:"7px 21px",fontSize:n.typography.pxToRem(15)},"small"===r.size&&"contained"===r.variant&&{padding:"4px 10px",fontSize:n.typography.pxToRem(13)},"large"===r.size&&"contained"===r.variant&&{padding:"8px 22px",fontSize:n.typography.pxToRem(15)},r.fullWidth&&{width:"100%"})}),(function(e){var t;return e.ownerState.disableElevation&&(t={boxShadow:"none","&:hover":{boxShadow:"none"}},(0,i.Z)(t,"&.".concat(bf.focusVisible),{boxShadow:"none"}),(0,i.Z)(t,"&:active",{boxShadow:"none"}),(0,i.Z)(t,"&.".concat(bf.disabled),{boxShadow:"none"}),t)})),Of=(0,g.ZP)("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:function(e,t){var n=e.ownerState;return[t.startIcon,t["iconSize".concat((0,O.Z)(n.size))]]}})((function(e){var t=e.ownerState;return(0,a.Z)({display:"inherit",marginRight:8,marginLeft:-4},"small"===t.size&&{marginLeft:-2},kf(t))})),Cf=(0,g.ZP)("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:function(e,t){var n=e.ownerState;return[t.endIcon,t["iconSize".concat((0,O.Z)(n.size))]]}})((function(e){var t=e.ownerState;return(0,a.Z)({display:"inherit",marginRight:-4,marginLeft:8},"small"===t.size&&{marginRight:-2},kf(t))})),Mf=e.forwardRef((function(t,n){var r=e.useContext(xf),i=(0,gf.Z)(r,t),s=(0,w.Z)({props:i,name:"MuiButton"}),l=s.children,f=s.color,d=void 0===f?"primary":f,h=s.component,v=void 0===h?"button":h,m=s.className,g=s.disabled,y=void 0!==g&&g,b=s.disableElevation,x=void 0!==b&&b,k=s.disableFocusRipple,S=void 0!==k&&k,C=s.endIcon,M=s.focusVisibleClassName,P=s.fullWidth,T=void 0!==P&&P,E=s.size,Z=void 0===E?"medium":E,A=s.startIcon,R=s.type,D=s.variant,j=void 0===D?"text":D,_=(0,o.Z)(s,wf),N=(0,a.Z)({},s,{color:d,component:v,disabled:y,disableElevation:x,disableFocusRipple:S,fullWidth:T,size:Z,type:R,variant:j}),L=function(e){var t=e.color,n=e.disableElevation,r=e.fullWidth,i=e.size,o=e.variant,s=e.classes,l={root:["root",o,"".concat(o).concat((0,O.Z)(t)),"size".concat((0,O.Z)(i)),"".concat(o,"Size").concat((0,O.Z)(i)),"inherit"===t&&"colorInherit",n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["startIcon","iconSize".concat((0,O.Z)(i))],endIcon:["endIcon","iconSize".concat((0,O.Z)(i))]},u=(0,c.Z)(l,yf,s);return(0,a.Z)({},s,u)}(N),I=A&&(0,p.jsx)(Of,{className:L.startIcon,ownerState:N,children:A}),z=C&&(0,p.jsx)(Cf,{className:L.endIcon,ownerState:N,children:C});return(0,p.jsxs)(Sf,(0,a.Z)({ownerState:N,className:(0,u.default)(m,r.className),component:v,disabled:y,focusRipple:!S,focusVisibleClassName:(0,u.default)(L.focusVisible,M),ref:n,type:R},_,{classes:L,children:[I,l,z]}))})),Pf=Mf,Tf=n(9461),Ef=n.n(Tf),Zf="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},Af="object"===("undefined"===typeof window?"undefined":Zf(window))&&"object"===("undefined"===typeof document?"undefined":Zf(document))&&9===document.nodeType,Rf={}.constructor;function Df(e){if(null==e||"object"!==typeof e)return e;if(Array.isArray(e))return e.map(Df);if(e.constructor!==Rf)return e;var t={};for(var n in e)t[n]=Df(e[n]);return t}function jf(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,i=Df(t),o=r.plugins.onCreateRule(e,i,n);return o||(e[0],null)}var _f=function(e,t){for(var n="",r=0;r<+~=|^:(),"'`\s])/g,Ff="undefined"!==typeof CSS&&CSS.escape,$f=function(e){return Ff?Ff(e):e.replace(Bf,"\\$1")},Wf=function(){function e(e,t,n){this.type="style",this.isProcessed=!1;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var o=null==i||!1===i,a=e in this.style;if(o&&!a&&!r)return this;var s=o&&a;if(s?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var l=this.options.sheet;return l&&l.attached,this},e}(),Hf=function(e){function t(t,n,r){var i;i=e.call(this,t,n,r)||this;var o=r.selector,a=r.scoped,s=r.sheet,l=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=l(ye(ye(i)),s),i.selectorText="."+$f(i.id)),i}M(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!==typeof n?e[t]=n:Array.isArray(n)&&(e[t]=Nf(n))}return e},n.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?(0,a.Z)({},e,{allowEmpty:!0}):e;return zf(this.selectorText,this.style,n)},Su(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function(){return this.selectorText}}]),t}(Wf),Vf={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new Hf(e,t,n)}},qf={indent:1,children:!0},Uf=/@([\w-]+)/,Qf=function(){function e(e,t,n){this.type="conditional",this.isProcessed=!1,this.key=e;var r=e.match(Uf);for(var i in this.at=r?r[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new yd((0,a.Z)({},n,{parent:this})),t)this.rules.add(i,t[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.replaceRule=function(e,t,n){var r=this.rules.replace(e,t,n);return r&&this.options.jss.plugins.onProcessRule(r),r},t.toString=function(e){void 0===e&&(e=qf);var t=Lf(e).linebreak;if(null==e.indent&&(e.indent=qf.indent),null==e.children&&(e.children=qf.children),!1===e.children)return this.query+" {}";var n=this.rules.toString(e);return n?this.query+" {"+t+n+t+"}":""},e}(),Xf=/@media|@supports\s+/,Yf={onCreateRule:function(e,t,n){return Xf.test(e)?new Qf(e,t,n):null}},Gf={indent:1,children:!0},Kf=/@keyframes\s+([\w-]+)/,Jf=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var r=e.match(Kf);r&&r[1]?this.name=r[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var i=n.scoped,o=n.sheet,s=n.generateId;for(var l in this.id=!1===i?this.name:$f(s(this,o)),this.rules=new yd((0,a.Z)({},n,{parent:this})),t)this.rules.add(l,t[l],(0,a.Z)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){void 0===e&&(e=Gf);var t=Lf(e).linebreak;if(null==e.indent&&(e.indent=Gf.indent),null==e.children&&(e.children=Gf.children),!1===e.children)return this.at+" "+this.id+" {}";var n=this.rules.toString(e);return n&&(n=""+t+n+t),this.at+" "+this.id+" {"+n+"}"},e}(),ed=/@keyframes\s+/,td=/\$([\w-]+)/g,nd=function(e,t){return"string"===typeof e?e.replace(td,(function(e,n){return n in t?t[n]:e})):e},rd=function(e,t,n){var r=e[t],i=nd(r,n);i!==r&&(e[t]=i)},id={onCreateRule:function(e,t,n){return"string"===typeof e&&ed.test(e)?new Jf(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&rd(e,"animation-name",n.keyframes),"animation"in e&&rd(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return nd(e,r.keyframes);default:return e}}},od=function(e){function t(){return e.apply(this,arguments)||this}return M(t,e),t.prototype.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?(0,a.Z)({},e,{allowEmpty:!0}):e;return zf(this.key,this.style,n)},t}(Wf),ad={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new od(e,t,n):null}},sd=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){var t=Lf(e).linebreak;if(Array.isArray(this.style)){for(var n="",r=0;r=this.index)t.push(e);else for(var r=0;rn)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=(0,o.Z)(t,["attached"]),i=Lf(r).linebreak,a="",s=0;s0){var n=function(e,t){for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"===typeof r){var i=function(e){for(var t=Rd(),n=0;nn?n:t},Ld=function(){function e(e){this.getPropertyValue=Td,this.setProperty=Ed,this.removeProperty=Zd,this.setSelector=Ad,this.hasInsertedRules=!1,this.cssRules=[],e&&kd.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},n=t.media,r=t.meta,i=t.element;this.element=i||function(){var e=document.createElement("style");return e.textContent="\n",e}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var o=jd();o&&this.element.setAttribute("nonce",o)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=Dd(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"===typeof n.nodeType){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling)}else Rd().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.baseClasses,n=e.newClasses;e.Component;if(!n)return t;var r=(0,a.Z)({},t);return Object.keys(n).forEach((function(e){n[e]&&(r[e]="".concat(t[e]," ").concat(n[e]))})),r}var Hd={set:function(e,t,n,r){var i=e.get(t);i||(i=new Map,e.set(t,i)),i.set(n,r)},get:function(e,t,n){var r=e.get(t);return r?r.get(n):void 0},delete:function(e,t,n){e.get(t).delete(n)}},Vd=Hd,qd=n(201),Ud="function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__",Qd=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];var Xd=Date.now(),Yd="fnValues"+Xd,Gd="fnStyle"+ ++Xd,Kd=function(){return{onCreateRule:function(e,t,n){if("function"!==typeof t)return null;var r=jf(e,{},n);return r[Gd]=t,r},onProcessStyle:function(e,t){if(Yd in t||Gd in t)return e;var n={};for(var r in e){var i=e[r];"function"===typeof i&&(delete e[r],n[r]=i)}return t[Yd]=n,e},onUpdate:function(e,t,n,r){var i=t,o=i[Gd];o&&(i.style=o(e)||{});var a=i[Yd];if(a)for(var s in a)i.prop(s,a[s](e),r)}}},Jd="@global",eh="@global ",th=function(){function e(e,t,n){for(var r in this.type="global",this.at=Jd,this.isProcessed=!1,this.key=e,this.options=n,this.rules=new yd((0,a.Z)({},n,{parent:this})),t)this.rules.add(r,t[r]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r&&this.options.jss.plugins.onProcessRule(r),r},t.replaceRule=function(e,t,n){var r=this.rules.replace(e,t,n);return r&&this.options.jss.plugins.onProcessRule(r),r},t.indexOf=function(e){return this.rules.indexOf(e)},t.toString=function(e){return this.rules.toString(e)},e}(),nh=function(){function e(e,t,n){this.type="global",this.at=Jd,this.isProcessed=!1,this.key=e,this.options=n;var r=e.substr(eh.length);this.rule=n.jss.createRule(r,t,(0,a.Z)({},n,{parent:this}))}return e.prototype.toString=function(e){return this.rule?this.rule.toString(e):""},e}(),rh=/\s*,\s*/g;function ih(e,t){for(var n=e.split(rh),r="",i=0;i-1){var i=ip[e];if(!Array.isArray(i))return Rh+$h(i)in t&&Dh+i;if(!r)return!1;for(var o=0;ot?1:-1:e.length-t.length};return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r={},i=Object.keys(t).sort(e),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},t=e.disableGlobal,n=void 0!==t&&t,r=e.productionPrefix,i=void 0===r?"jss":r,o=e.seed,a=void 0===o?"":o,s=""===a?"":"".concat(a,"-"),l=0,u=function(){return l+=1};return function(e,t){var r=t.options.name;if(r&&0===r.indexOf("Mui")&&!t.options.link&&!n){if(-1!==Qd.indexOf(e.key))return"Mui-".concat(e.key);var o="".concat(s).concat(r,"-").concat(e.key);return t.options.theme[Ud]&&""===a?"".concat(o,"-").concat(u()):o}return"".concat(s).concat(i).concat(u())}}(),Cp={disableGeneration:!1,generateClassName:Op,jss:Sp,sheetsCache:null,sheetsManager:new Map,sheetsRegistry:null},Mp=e.createContext(Cp);var Pp=-1e9;function Tp(){return Pp+=1}var Ep=n(114),Zp=["variant"];function Ap(e){return 0===e.length}function Rp(e){var t="function"===typeof e;return{create:function(n,r){var i;try{i=t?e(n):e}catch(c){throw c}if(!r||!n.components||!n.components[r]||!n.components[r].styleOverrides&&!n.components[r].variants)return i;var s=n.components[r].styleOverrides||{},l=n.components[r].variants||[],u=(0,a.Z)({},i);return Object.keys(s).forEach((function(e){u[e]=(0,At.Z)(u[e]||{},s[e])})),l.forEach((function(e){var t=function(e){var t=e.variant,n=(0,o.Z)(e,Zp),r=t||"";return Object.keys(n).sort().forEach((function(t){r+="color"===t?Ap(r)?e[t]:(0,Ep.Z)(e[t]):"".concat(Ap(r)?t:(0,Ep.Z)(t)).concat((0,Ep.Z)(e[t].toString()))})),r}(e.props);u[t]=(0,At.Z)(u[t]||{},e.style)})),u},options:{}}}var Dp={},jp=["name","classNamePrefix","Component","defaultTheme"];function _p(e,t,n){var r=e.state;if(e.stylesOptions.disableGeneration)return t||{};r.cacheClasses||(r.cacheClasses={value:null,lastProp:null,lastJSS:{}});var i=!1;return r.classes!==r.cacheClasses.lastJSS&&(r.cacheClasses.lastJSS=r.classes,i=!0),t!==r.cacheClasses.lastProp&&(r.cacheClasses.lastProp=t,i=!0),i&&(r.cacheClasses.value=Wd({baseClasses:r.cacheClasses.lastJSS,newClasses:t,Component:n})),r.cacheClasses.value}function Np(e,t){var n=e.state,r=e.theme,i=e.stylesOptions,o=e.stylesCreator,s=e.name;if(!i.disableGeneration){var l=Vd.get(i.sheetsManager,o,r);l||(l={refs:0,staticSheet:null,dynamicStyles:null},Vd.set(i.sheetsManager,o,r,l));var u=(0,a.Z)({},o.options,i,{theme:r,flip:"boolean"===typeof i.flip?i.flip:"rtl"===r.direction});u.generateId=u.serverGenerateClassName||u.generateClassName;var c=i.sheetsRegistry;if(0===l.refs){var f;i.sheetsCache&&(f=Vd.get(i.sheetsCache,o,r));var d=o.create(r,s);f||((f=i.jss.createStyleSheet(d,(0,a.Z)({link:!1},u))).attach(),i.sheetsCache&&Vd.set(i.sheetsCache,o,r,f)),c&&c.add(f),l.staticSheet=f,l.dynamicStyles=$d(d)}if(l.dynamicStyles){var h=i.jss.createStyleSheet(l.dynamicStyles,(0,a.Z)({link:!0},u));h.update(t),h.attach(),n.dynamicSheet=h,n.classes=Wd({baseClasses:l.staticSheet.classes,newClasses:h.classes}),c&&c.add(h)}else n.classes=l.staticSheet.classes;l.refs+=1}}function Lp(e,t){var n=e.state;n.dynamicSheet&&n.dynamicSheet.update(t)}function Ip(e){var t=e.state,n=e.theme,r=e.stylesOptions,i=e.stylesCreator;if(!r.disableGeneration){var o=Vd.get(r.sheetsManager,i,n);o.refs-=1;var a=r.sheetsRegistry;0===o.refs&&(Vd.delete(r.sheetsManager,i,n),r.jss.removeStyleSheet(o.staticSheet),a&&a.remove(o.staticSheet)),t.dynamicSheet&&(r.jss.removeStyleSheet(t.dynamicSheet),a&&a.remove(t.dynamicSheet))}}function zp(t,n){var r,i=e.useRef([]),o=e.useMemo((function(){return{}}),n);i.current!==o&&(i.current=o,r=t()),e.useEffect((function(){return function(){r&&r()}}),[o])}function Bp(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.name,i=n.classNamePrefix,s=n.Component,l=n.defaultTheme,u=void 0===l?Dp:l,c=(0,o.Z)(n,jp),f=Rp(t),d=r||i||"makeStyles";f.options={index:Tp(),name:r,meta:d,classNamePrefix:d};var h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,qd.Z)()||u,i=(0,a.Z)({},e.useContext(Mp),c),o=e.useRef(),l=e.useRef();zp((function(){var e={name:r,state:{},stylesCreator:f,stylesOptions:i,theme:n};return Np(e,t),l.current=!1,o.current=e,function(){Ip(e)}}),[n,f]),e.useEffect((function(){l.current&&Lp(o.current,t),l.current=!0}));var d=_p(o.current,t.classes,s);return d};return h}var Fp=n(1198),$p=Bp({popover:{position:"absolute",display:"grid",gridGap:"16px",padding:"0 0 25px",zIndex:2},popoverHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"#3F51B5",padding:"6px 6px 6px 12px",borderRadius:"4px 4px 0 0",color:"#FFF",cursor:"move"},popoverBody:{display:"grid",gridGap:"6px",padding:"0 14px"}}),Wp=function(){var t=(0,e.useState)(!1),n=(0,r.Z)(t,2),i=n[0],o=n[1],a=(0,e.useRef)(null),s=$p();return(0,p.jsxs)(zt,{display:"flex",px:2,children:[(0,p.jsxs)(Pf,{onClick:function(){return o((function(e){return!e}))},variant:"outlined",children:[(0,p.jsx)(ms.Z,{sx:{fontSize:16,marginRight:"4px"}}),(0,p.jsxs)("span",{style:{lineHeight:1,paddingTop:"1px"},children:[i?"Hide":"Show"," graph settings"]})]}),i&&(0,p.jsx)(Ef(),{nodeRef:a,defaultPosition:{x:173,y:0},handle:"#handle",children:(0,p.jsxs)(J,{elevation:3,className:s.popover,ref:a,children:[(0,p.jsxs)("div",{id:"handle",className:s.popoverHeader,children:[(0,p.jsx)(Cs,{variant:"body1",children:(0,p.jsx)("b",{children:"Graph Settings"})}),(0,p.jsx)(dt,{size:"small",onClick:function(){return o(!1)},children:(0,p.jsx)(Fp.Z,{style:{color:"white"}})})]}),(0,p.jsx)(zt,{className:s.popoverBody,children:(0,p.jsx)(mf,{})})]})})]})},Hp=function(t){var n=t.data,i=void 0===n?[]:n,o=Xa(),a=Gn().time.period,s=Qa().customStep,l=(0,e.useMemo)((function(){return s.enable?s.value:a.step||1}),[a.step,s]),u=(0,e.useState)([[]]),c=(0,r.Z)(u,2),f=c[0],d=c[1],h=(0,e.useState)([]),v=(0,r.Z)(h,2),m=v[0],g=v[1],y=(0,e.useState)([]),b=(0,r.Z)(y,2),x=b[0],w=b[1],k=(0,e.useState)([]),S=(0,r.Z)(k,2),O=S[0],C=S[1],M=function(e){var t=function(e){var t={};for(var n in e){var r=e[n],i=rs(r),o=ns(r);t[n]=i&&o?[i-.25*i,o+.25*o]:[-1,1]}return t}(e);o({type:"SET_YAXIS_LIMITS",payload:t})};return(0,e.useEffect)((function(){var e=[],t={},n=[],r=[];null===i||void 0===i||i.forEach((function(i){var o=hs(i,O);r.push(o),n.push(ps(o,i.group)),i.values.forEach((function(n){e.push(n[0]),t[i.group]?t[i.group].push(+n[1]):t[i.group]=[+n[1]]}))}));var o=function(e,t,n){var r=Array.from(new Set(e)).sort((function(e,t){return e-t})),i=Math.ceil((n.end-n.start)/t),o=r[0]||0;return new Array(2*i).fill(o).map((function(e,n){return Pn(e+t*n)}))}(e,l,a);d([o].concat((0,me.Z)(i.map((function(e){return o.map((function(t){var n=e.values.find((function(e){return e[0]===t}));return n?+n[1]:null}))}))))),M(t);var s=[{}].concat(r);JSON.stringify(s)!==JSON.stringify(m)&&(g(s),w(n))}),[i]),(0,e.useEffect)((function(){var e=[],t=[];null===i||void 0===i||i.forEach((function(n){var r=hs(n,O);t.push(r),e.push(ps(r,n.group))})),g([{}].concat(t)),w(e)}),[O]),(0,p.jsx)(p.Fragment,{children:i.length>0?(0,p.jsxs)("div",{children:[(0,p.jsx)(Wp,{}),(0,p.jsx)(us,{data:f,series:m,metrics:i}),(0,p.jsx)(cs,{labels:x,onChange:function(e,t){C(function(e){var t=e.hideSeries,n=e.legend,r=e.metaKey,i=e.series,o="".concat(n.group,".").concat(n.label),a=vs(n.label,n.group,t),s=i.map((function(e){return"".concat(e.scale,".").concat(e.label)}));return r?a?t.filter((function(e){return e!==o})):[].concat((0,me.Z)(t),[o]):t.length?a?(0,me.Z)(s.filter((function(e){return e!==o}))):[]:(0,me.Z)(s.filter((function(e){return e!==o})))}({hideSeries:O,legend:e,metaKey:t,series:m}))}})]}):(0,p.jsx)("div",{style:{textAlign:"center"},children:"No data to show"})})};function Vp(e){return(0,q.Z)("MuiTableContainer",e)}(0,U.Z)("MuiTableContainer",["root"]);var qp=["className","component"],Up=(0,g.ZP)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:function(e,t){return t.root}})({width:"100%",overflowX:"auto"}),Qp=e.forwardRef((function(e,t){var n=(0,w.Z)({props:e,name:"MuiTableContainer"}),r=n.className,i=n.component,s=void 0===i?"div":i,l=(0,o.Z)(n,qp),f=(0,a.Z)({},n,{component:s}),d=function(e){var t=e.classes;return(0,c.Z)({root:["root"]},Vp,t)}(f);return(0,p.jsx)(Up,(0,a.Z)({ref:t,as:s,className:(0,u.default)(d.root,r),ownerState:f},l))})),Xp=Qp;var Yp=e.createContext();function Gp(e){return(0,q.Z)("MuiTable",e)}(0,U.Z)("MuiTable",["root","stickyHeader"]);var Kp=["className","component","padding","size","stickyHeader"],Jp=(0,g.ZP)("table",{name:"MuiTable",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,n.stickyHeader&&t.stickyHeader]}})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":(0,a.Z)({},t.typography.body2,{padding:t.spacing(2),color:t.palette.text.secondary,textAlign:"left",captionSide:"bottom"})},n.stickyHeader&&{borderCollapse:"separate"})})),ev="table",tv=e.forwardRef((function(t,n){var r=(0,w.Z)({props:t,name:"MuiTable"}),i=r.className,s=r.component,l=void 0===s?ev:s,f=r.padding,d=void 0===f?"normal":f,h=r.size,v=void 0===h?"medium":h,m=r.stickyHeader,g=void 0!==m&&m,y=(0,o.Z)(r,Kp),b=(0,a.Z)({},r,{component:l,padding:d,size:v,stickyHeader:g}),x=function(e){var t=e.classes,n={root:["root",e.stickyHeader&&"stickyHeader"]};return(0,c.Z)(n,Gp,t)}(b),k=e.useMemo((function(){return{padding:d,size:v,stickyHeader:g}}),[d,v,g]);return(0,p.jsx)(Yp.Provider,{value:k,children:(0,p.jsx)(Jp,(0,a.Z)({as:l,role:l===ev?null:"table",ref:n,className:(0,u.default)(x.root,i),ownerState:b},y))})})),nv=tv;var rv=e.createContext();function iv(e){return(0,q.Z)("MuiTableHead",e)}(0,U.Z)("MuiTableHead",["root"]);var ov=["className","component"],av=(0,g.ZP)("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:function(e,t){return t.root}})({display:"table-header-group"}),sv={variant:"head"},lv="thead",uv=e.forwardRef((function(e,t){var n=(0,w.Z)({props:e,name:"MuiTableHead"}),r=n.className,i=n.component,s=void 0===i?lv:i,l=(0,o.Z)(n,ov),f=(0,a.Z)({},n,{component:s}),d=function(e){var t=e.classes;return(0,c.Z)({root:["root"]},iv,t)}(f);return(0,p.jsx)(rv.Provider,{value:sv,children:(0,p.jsx)(av,(0,a.Z)({as:s,className:(0,u.default)(d.root,r),ref:t,role:s===lv?null:"rowgroup",ownerState:f},l))})})),cv=uv;function fv(e){return(0,q.Z)("MuiTableRow",e)}var dv=(0,U.Z)("MuiTableRow",["root","selected","hover","head","footer"]),hv=["className","component","hover","selected"],pv=(0,g.ZP)("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,n.head&&t.head,n.footer&&t.footer]}})((function(e){var t,n=e.theme;return t={color:"inherit",display:"table-row",verticalAlign:"middle",outline:0},(0,i.Z)(t,"&.".concat(dv.hover,":hover"),{backgroundColor:n.palette.action.hover}),(0,i.Z)(t,"&.".concat(dv.selected),{backgroundColor:(0,V.Fq)(n.palette.primary.main,n.palette.action.selectedOpacity),"&:hover":{backgroundColor:(0,V.Fq)(n.palette.primary.main,n.palette.action.selectedOpacity+n.palette.action.hoverOpacity)}}),t})),vv=e.forwardRef((function(t,n){var r=(0,w.Z)({props:t,name:"MuiTableRow"}),i=r.className,s=r.component,l=void 0===s?"tr":s,f=r.hover,d=void 0!==f&&f,h=r.selected,v=void 0!==h&&h,m=(0,o.Z)(r,hv),g=e.useContext(rv),y=(0,a.Z)({},r,{component:l,hover:d,selected:v,head:g&&"head"===g.variant,footer:g&&"footer"===g.variant}),b=function(e){var t=e.classes,n={root:["root",e.selected&&"selected",e.hover&&"hover",e.head&&"head",e.footer&&"footer"]};return(0,c.Z)(n,fv,t)}(y);return(0,p.jsx)(pv,(0,a.Z)({as:l,ref:n,className:(0,u.default)(b.root,i),role:"tr"===l?null:"row",ownerState:y},m))})),mv=vv;function gv(e){return(0,q.Z)("MuiTableCell",e)}var yv=(0,U.Z)("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),bv=["align","className","component","padding","scope","size","sortDirection","variant"],xv=(0,g.ZP)("td",{name:"MuiTableCell",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,t[n.variant],t["size".concat((0,O.Z)(n.size))],"normal"!==n.padding&&t["padding".concat((0,O.Z)(n.padding))],"inherit"!==n.align&&t["align".concat((0,O.Z)(n.align))],n.stickyHeader&&t.stickyHeader]}})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:"1px solid\n ".concat("light"===t.palette.mode?(0,V.$n)((0,V.Fq)(t.palette.divider,1),.88):(0,V._j)((0,V.Fq)(t.palette.divider,1),.68)),textAlign:"left",padding:16},"head"===n.variant&&{color:t.palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},"body"===n.variant&&{color:t.palette.text.primary},"footer"===n.variant&&{color:t.palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},"small"===n.size&&(0,i.Z)({padding:"6px 16px"},"&.".concat(yv.paddingCheckbox),{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}),"checkbox"===n.padding&&{width:48,padding:"0 0 0 4px"},"none"===n.padding&&{padding:0},"left"===n.align&&{textAlign:"left"},"center"===n.align&&{textAlign:"center"},"right"===n.align&&{textAlign:"right",flexDirection:"row-reverse"},"justify"===n.align&&{textAlign:"justify"},n.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:t.palette.background.default})})),wv=e.forwardRef((function(t,n){var r,i=(0,w.Z)({props:t,name:"MuiTableCell"}),s=i.align,l=void 0===s?"inherit":s,f=i.className,d=i.component,h=i.padding,v=i.scope,m=i.size,g=i.sortDirection,y=i.variant,b=(0,o.Z)(i,bv),x=e.useContext(Yp),k=e.useContext(rv),S=k&&"head"===k.variant;r=d||(S?"th":"td");var C=v;!C&&S&&(C="col");var M=y||k&&k.variant,P=(0,a.Z)({},i,{align:l,component:r,padding:h||(x&&x.padding?x.padding:"normal"),size:m||(x&&x.size?x.size:"medium"),sortDirection:g,stickyHeader:"head"===M&&x&&x.stickyHeader,variant:M}),T=function(e){var t=e.classes,n=e.variant,r=e.align,i=e.padding,o=e.size,a={root:["root",n,e.stickyHeader&&"stickyHeader","inherit"!==r&&"align".concat((0,O.Z)(r)),"normal"!==i&&"padding".concat((0,O.Z)(i)),"size".concat((0,O.Z)(o))]};return(0,c.Z)(a,gv,t)}(P),E=null;return g&&(E="asc"===g?"ascending":"descending"),(0,p.jsx)(xv,(0,a.Z)({as:r,ref:n,className:(0,u.default)(T.root,f),"aria-sort":E,scope:C,ownerState:P},b))})),kv=wv;function Sv(e){return(0,q.Z)("MuiTableBody",e)}(0,U.Z)("MuiTableBody",["root"]);var Ov=["className","component"],Cv=(0,g.ZP)("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:function(e,t){return t.root}})({display:"table-row-group"}),Mv={variant:"body"},Pv="tbody",Tv=e.forwardRef((function(e,t){var n=(0,w.Z)({props:e,name:"MuiTableBody"}),r=n.className,i=n.component,s=void 0===i?Pv:i,l=(0,o.Z)(n,Ov),f=(0,a.Z)({},n,{component:s}),d=function(e){var t=e.classes;return(0,c.Z)({root:["root"]},Sv,t)}(f);return(0,p.jsx)(rv.Provider,{value:Mv,children:(0,p.jsx)(Cv,(0,a.Z)({className:(0,u.default)(d.root,r),as:s,ref:t,role:s===Pv?null:"rowgroup",ownerState:f},l))})})),Ev=Tv,Zv=Bp({deemphasized:{opacity:.4}}),Av=function(t){var n=t.data,r=Zv(),i=function(t){return(0,e.useMemo)((function(){var e={};return t.forEach((function(t){return Object.entries(t.metric).forEach((function(t){return e[t[0]]?e[t[0]].options.add(t[1]):e[t[0]]={options:new Set([t[1]])}}))})),Object.entries(e).map((function(e){return{key:e[0],variations:e[1].options.size}})).sort((function(e,t){return e.variations-t.variations}))}),[t])}(n),o=(0,e.useMemo)((function(){return null===n||void 0===n?void 0:n.map((function(e){return{metadata:i.map((function(t){return e.metric[t.key]||"-"})),value:e.value?e.value[1]:"-"}}))}),[i,n]);return(0,p.jsx)(p.Fragment,{children:o.length>0?(0,p.jsx)(Xp,{component:J,children:(0,p.jsxs)(nv,{"aria-label":"simple table",children:[(0,p.jsx)(cv,{children:(0,p.jsxs)(mv,{children:[i.map((function(e,t){return(0,p.jsx)(kv,{style:{textTransform:"capitalize"},children:e.key},t)})),(0,p.jsx)(kv,{align:"right",children:"Value"})]})}),(0,p.jsx)(Ev,{children:o.map((function(e,t){return(0,p.jsxs)(mv,{children:[e.metadata.map((function(e,n){var i=o[t-1]&&o[t-1].metadata[n];return(0,p.jsx)(kv,{className:i===e?r.deemphasized:void 0,children:e},n)})),(0,p.jsx)(kv,{align:"right",children:e.value})]},t)}))})]})}):(0,p.jsx)("div",{style:{textAlign:"center"},children:"No data to show"})})},Rv=n(3878),Dv=n(9199),jv=n(181),_v=n(5267);function Nv(e){return(0,q.Z)("MuiCollapse",e)}(0,U.Z)("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);var Lv=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],Iv=(0,g.ZP)("div",{name:"MuiCollapse",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,t[n.orientation],"entered"===n.state&&t.entered,"exited"===n.state&&!n.in&&"0px"===n.collapsedSize&&t.hidden]}})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({height:0,overflow:"hidden",transition:t.transitions.create("height")},"horizontal"===n.orientation&&{height:"auto",width:0,transition:t.transitions.create("width")},"entered"===n.state&&(0,a.Z)({height:"auto",overflow:"visible"},"horizontal"===n.orientation&&{width:"auto"}),"exited"===n.state&&!n.in&&"0px"===n.collapsedSize&&{visibility:"hidden"})})),zv=(0,g.ZP)("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:function(e,t){return t.wrapper}})((function(e){var t=e.ownerState;return(0,a.Z)({display:"flex",width:"100%"},"horizontal"===t.orientation&&{width:"auto",height:"100%"})})),Bv=(0,g.ZP)("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:function(e,t){return t.wrapperInner}})((function(e){var t=e.ownerState;return(0,a.Z)({width:"100%"},"horizontal"===t.orientation&&{width:"auto",height:"100%"})})),Fv=e.forwardRef((function(t,n){var r=(0,w.Z)({props:t,name:"MuiCollapse"}),s=r.addEndListener,l=r.children,f=r.className,d=r.collapsedSize,h=void 0===d?"0px":d,v=r.component,m=r.easing,g=r.in,y=r.onEnter,b=r.onEntered,S=r.onEntering,O=r.onExit,C=r.onExited,M=r.onExiting,P=r.orientation,T=void 0===P?"vertical":P,E=r.style,Z=r.timeout,A=void 0===Z?k.x9.standard:Z,R=r.TransitionComponent,D=void 0===R?N:R,j=(0,o.Z)(r,Lv),_=(0,a.Z)({},r,{orientation:T,collapsedSize:h}),L=function(e){var t=e.orientation,n=e.classes,r={root:["root","".concat(t)],entered:["entered"],hidden:["hidden"],wrapper:["wrapper","".concat(t)],wrapperInner:["wrapperInner","".concat(t)]};return(0,c.Z)(r,Nv,n)}(_),B=x(),F=e.useRef(),$=e.useRef(null),W=e.useRef(),H="number"===typeof h?"".concat(h,"px"):h,V="horizontal"===T,q=V?"width":"height";e.useEffect((function(){return function(){clearTimeout(F.current)}}),[]);var U=e.useRef(null),Q=(0,z.Z)(n,U),X=function(e){return function(t){if(e){var n=U.current;void 0===t?e(n):e(n,t)}}},Y=function(){return $.current?$.current[V?"clientWidth":"clientHeight"]:0},G=X((function(e,t){$.current&&V&&($.current.style.position="absolute"),e.style[q]=H,y&&y(e,t)})),K=X((function(e,t){var n=Y();$.current&&V&&($.current.style.position="");var r=I({style:E,timeout:A,easing:m},{mode:"enter"}),i=r.duration,o=r.easing;if("auto"===A){var a=B.transitions.getAutoHeightDuration(n);e.style.transitionDuration="".concat(a,"ms"),W.current=a}else e.style.transitionDuration="string"===typeof i?i:"".concat(i,"ms");e.style[q]="".concat(n,"px"),e.style.transitionTimingFunction=o,S&&S(e,t)})),J=X((function(e,t){e.style[q]="auto",b&&b(e,t)})),ee=X((function(e){e.style[q]="".concat(Y(),"px"),O&&O(e)})),te=X(C),ne=X((function(e){var t=Y(),n=I({style:E,timeout:A,easing:m},{mode:"exit"}),r=n.duration,i=n.easing;if("auto"===A){var o=B.transitions.getAutoHeightDuration(t);e.style.transitionDuration="".concat(o,"ms"),W.current=o}else e.style.transitionDuration="string"===typeof r?r:"".concat(r,"ms");e.style[q]=H,e.style.transitionTimingFunction=i,M&&M(e)}));return(0,p.jsx)(D,(0,a.Z)({in:g,onEnter:G,onEntered:J,onEntering:K,onExit:ee,onExited:te,onExiting:ne,addEndListener:function(e){"auto"===A&&(F.current=setTimeout(e,W.current||0)),s&&s(U.current,e)},nodeRef:U,timeout:"auto"===A?null:A},j,{children:function(e,t){return(0,p.jsx)(Iv,(0,a.Z)({as:v,className:(0,u.default)(L.root,f,{entered:L.entered,exited:!g&&"0px"===H&&L.hidden}[e]),style:(0,a.Z)((0,i.Z)({},V?"minWidth":"minHeight",H),E),ownerState:(0,a.Z)({},_,{state:e}),ref:Q},t,{children:(0,p.jsx)(zv,{ownerState:(0,a.Z)({},_,{state:e}),className:L.wrapper,ref:$,children:(0,p.jsx)(Bv,{ownerState:(0,a.Z)({},_,{state:e}),className:L.wrapperInner,children:l})})}))}}))}));Fv.muiSupportAuto=!0;var $v=Fv;var Wv=e.createContext({});function Hv(e){return(0,q.Z)("MuiAccordion",e)}var Vv=(0,U.Z)("MuiAccordion",["root","rounded","expanded","disabled","gutters","region"]),qv=["children","className","defaultExpanded","disabled","disableGutters","expanded","onChange","square","TransitionComponent","TransitionProps"],Uv=(0,g.ZP)(J,{name:"MuiAccordion",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[(0,i.Z)({},"& .".concat(Vv.region),t.region),t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})((function(e){var t,n=e.theme,r={duration:n.transitions.duration.shortest};return t={position:"relative",transition:n.transitions.create(["margin"],r),overflowAnchor:"none","&:before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:n.palette.divider,transition:n.transitions.create(["opacity","background-color"],r)},"&:first-of-type":{"&:before":{display:"none"}}},(0,i.Z)(t,"&.".concat(Vv.expanded),{"&:before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&:before":{display:"none"}}}),(0,i.Z)(t,"&.".concat(Vv.disabled),{backgroundColor:n.palette.action.disabledBackground}),t}),(function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({},!n.square&&{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:t.shape.borderRadius,borderTopRightRadius:t.shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:t.shape.borderRadius,borderBottomRightRadius:t.shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},!n.disableGutters&&(0,i.Z)({},"&.".concat(Vv.expanded),{margin:"16px 0"}))})),Qv=e.forwardRef((function(t,n){var i,s=(0,w.Z)({props:t,name:"MuiAccordion"}),l=s.children,f=s.className,d=s.defaultExpanded,h=void 0!==d&&d,v=s.disabled,m=void 0!==v&&v,g=s.disableGutters,y=void 0!==g&&g,b=s.expanded,x=s.onChange,k=s.square,S=void 0!==k&&k,O=s.TransitionComponent,C=void 0===O?$v:O,M=s.TransitionProps,P=(0,o.Z)(s,qv),T=(0,Tc.Z)({controlled:b,default:h,name:"Accordion",state:"expanded"}),E=(0,r.Z)(T,2),Z=E[0],A=E[1],R=e.useCallback((function(e){A(!Z),x&&x(e,!Z)}),[Z,x,A]),D=e.Children.toArray(l),j=(i=D,(0,Rv.Z)(i)||(0,Dv.Z)(i)||(0,jv.Z)(i)||(0,_v.Z)()),_=j[0],N=j.slice(1),L=e.useMemo((function(){return{expanded:Z,disabled:m,disableGutters:y,toggle:R}}),[Z,m,y,R]),I=(0,a.Z)({},s,{square:S,disabled:m,disableGutters:y,expanded:Z}),z=function(e){var t=e.classes,n={root:["root",!e.square&&"rounded",e.expanded&&"expanded",e.disabled&&"disabled",!e.disableGutters&&"gutters"],region:["region"]};return(0,c.Z)(n,Hv,t)}(I);return(0,p.jsxs)(Uv,(0,a.Z)({className:(0,u.default)(z.root,f),ref:n,ownerState:I,square:S},P,{children:[(0,p.jsx)(Wv.Provider,{value:L,children:_}),(0,p.jsx)(C,(0,a.Z)({in:Z,timeout:"auto"},M,{children:(0,p.jsx)("div",{"aria-labelledby":_.props.id,id:_.props["aria-controls"],role:"region",className:z.region,children:N})}))]}))})),Xv=Qv;function Yv(e){return(0,q.Z)("MuiAccordionSummary",e)}var Gv=(0,U.Z)("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),Kv=["children","className","expandIcon","focusVisibleClassName","onClick"],Jv=(0,g.ZP)(ot,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:function(e,t){return t.root}})((function(e){var t,n=e.theme,r=e.ownerState,o={duration:n.transitions.duration.shortest};return(0,a.Z)((t={display:"flex",minHeight:48,padding:n.spacing(0,2),transition:n.transitions.create(["min-height","background-color"],o)},(0,i.Z)(t,"&.".concat(Gv.focusVisible),{backgroundColor:n.palette.action.focus}),(0,i.Z)(t,"&.".concat(Gv.disabled),{opacity:n.palette.action.disabledOpacity}),(0,i.Z)(t,"&:hover:not(.".concat(Gv.disabled,")"),{cursor:"pointer"}),t),!r.disableGutters&&(0,i.Z)({},"&.".concat(Gv.expanded),{minHeight:64}))})),em=(0,g.ZP)("div",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:function(e,t){return t.content}})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({display:"flex",flexGrow:1,margin:"12px 0"},!n.disableGutters&&(0,i.Z)({transition:t.transitions.create(["margin"],{duration:t.transitions.duration.shortest})},"&.".concat(Gv.expanded),{margin:"20px 0"}))})),tm=(0,g.ZP)("div",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:function(e,t){return t.expandIconWrapper}})((function(e){var t=e.theme;return(0,i.Z)({display:"flex",color:t.palette.action.active,transform:"rotate(0deg)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest})},"&.".concat(Gv.expanded),{transform:"rotate(180deg)"})})),nm=e.forwardRef((function(t,n){var r=(0,w.Z)({props:t,name:"MuiAccordionSummary"}),i=r.children,s=r.className,l=r.expandIcon,f=r.focusVisibleClassName,d=r.onClick,h=(0,o.Z)(r,Kv),v=e.useContext(Wv),m=v.disabled,g=void 0!==m&&m,y=v.disableGutters,b=v.expanded,x=v.toggle,k=(0,a.Z)({},r,{expanded:b,disabled:g,disableGutters:y}),S=function(e){var t=e.classes,n=e.expanded,r=e.disabled,i=e.disableGutters,o={root:["root",n&&"expanded",r&&"disabled",!i&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!i&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]};return(0,c.Z)(o,Yv,t)}(k);return(0,p.jsxs)(Jv,(0,a.Z)({focusRipple:!1,disableRipple:!0,disabled:g,component:"div","aria-expanded":b,className:(0,u.default)(S.root,s),focusVisibleClassName:(0,u.default)(S.focusVisible,f),onClick:function(e){x&&x(e),d&&d(e)},ref:n,ownerState:k},h,{children:[(0,p.jsx)(em,{className:S.content,ownerState:k,children:i}),l&&(0,p.jsx)(tm,{className:S.expandIconWrapper,ownerState:k,children:l})]}))})),rm=nm;function im(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return $s(e)?t:(0,a.Z)({},t,{ownerState:(0,a.Z)({},t.ownerState,n)})}function om(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function am(e){return e instanceof om(e).Element||e instanceof Element}function sm(e){return e instanceof om(e).HTMLElement||e instanceof HTMLElement}function lm(e){return"undefined"!==typeof ShadowRoot&&(e instanceof om(e).ShadowRoot||e instanceof ShadowRoot)}var um=Math.max,cm=Math.min,fm=Math.round;function dm(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(sm(e)&&t){var o=e.offsetHeight,a=e.offsetWidth;a>0&&(r=fm(n.width)/a||1),o>0&&(i=fm(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function hm(e){var t=om(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function pm(e){return e?(e.nodeName||"").toLowerCase():null}function vm(e){return((am(e)?e.ownerDocument:e.document)||window.document).documentElement}function mm(e){return dm(vm(e)).left+hm(e).scrollLeft}function gm(e){return om(e).getComputedStyle(e)}function ym(e){var t=gm(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function bm(e,t,n){void 0===n&&(n=!1);var r=sm(t),i=sm(t)&&function(e){var t=e.getBoundingClientRect(),n=fm(t.width)/e.offsetWidth||1,r=fm(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),o=vm(t),a=dm(e,i),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(("body"!==pm(t)||ym(o))&&(s=function(e){return e!==om(e)&&sm(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:hm(e);var t}(t)),sm(t)?((l=dm(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=mm(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function xm(e){var t=dm(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function wm(e){return"html"===pm(e)?e:e.assignedSlot||e.parentNode||(lm(e)?e.host:null)||vm(e)}function km(e){return["html","body","#document"].indexOf(pm(e))>=0?e.ownerDocument.body:sm(e)&&ym(e)?e:km(wm(e))}function Sm(e,t){var n;void 0===t&&(t=[]);var r=km(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=om(r),a=i?[o].concat(o.visualViewport||[],ym(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Sm(wm(a)))}function Om(e){return["table","td","th"].indexOf(pm(e))>=0}function Cm(e){return sm(e)&&"fixed"!==gm(e).position?e.offsetParent:null}function Mm(e){for(var t=om(e),n=Cm(e);n&&Om(n)&&"static"===gm(n).position;)n=Cm(n);return n&&("html"===pm(n)||"body"===pm(n)&&"static"===gm(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&sm(e)&&"fixed"===gm(e).position)return null;for(var n=wm(e);sm(n)&&["html","body"].indexOf(pm(n))<0;){var r=gm(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 Pm="top",Tm="bottom",Em="right",Zm="left",Am="auto",Rm=[Pm,Tm,Em,Zm],Dm="start",jm="end",_m="viewport",Nm="popper",Lm=Rm.reduce((function(e,t){return e.concat([t+"-"+Dm,t+"-"+jm])}),[]),Im=[].concat(Rm,[Am]).reduce((function(e,t){return e.concat([t,t+"-"+Dm,t+"-"+jm])}),[]),zm=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Bm(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}function Fm(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var $m={placement:"bottom",modifiers:[],strategy:"absolute"};function Wm(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function Ym(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Um(i):null,a=i?Qm(i):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case Pm:t={x:s,y:n.y-r.height};break;case Tm:t={x:s,y:n.y+n.height};break;case Em:t={x:n.x+n.width,y:l};break;case Zm:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?Xm(o):null;if(null!=u){var c="y"===u?"height":"width";switch(a){case Dm:t[u]=t[u]-(n[c]/2-r[c]/2);break;case jm:t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}var Gm={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Ym({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},Km={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Jm(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,f=e.isFixed,d=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:fm(t*r)/r||0,y:fm(n*r)/r||0}}(a):"function"===typeof c?c(a):a,h=d.x,p=void 0===h?0:h,v=d.y,m=void 0===v?0:v,g=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=Zm,x=Pm,w=window;if(u){var k=Mm(n),S="clientHeight",O="clientWidth";if(k===om(n)&&"static"!==gm(k=vm(n)).position&&"absolute"===s&&(S="scrollHeight",O="scrollWidth"),k=k,i===Pm||(i===Zm||i===Em)&&o===jm)x=Tm,m-=(f&&w.visualViewport?w.visualViewport.height:k[S])-r.height,m*=l?1:-1;if(i===Zm||(i===Pm||i===Tm)&&o===jm)b=Em,p-=(f&&w.visualViewport?w.visualViewport.width:k[O])-r.width,p*=l?1:-1}var C,M=Object.assign({position:s},u&&Km);return l?Object.assign({},M,((C={})[x]=y?"0":"",C[b]=g?"0":"",C.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",C)):Object.assign({},M,((t={})[x]=y?m+"px":"",t[b]=g?p+"px":"",t.transform="",t))}var eg={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];sm(i)&&pm(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}),{});sm(r)&&pm(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var tg={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=Im.reduce((function(e,n){return e[n]=function(e,t,n){var r=Um(e),i=[Zm,Pm].indexOf(r)>=0?-1:1,o="function"===typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Zm,Em].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),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}},ng={left:"right",right:"left",bottom:"top",top:"bottom"};function rg(e){return e.replace(/left|right|bottom|top/g,(function(e){return ng[e]}))}var ig={start:"end",end:"start"};function og(e){return e.replace(/start|end/g,(function(e){return ig[e]}))}function ag(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&lm(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function sg(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function lg(e,t){return t===_m?sg(function(e){var t=om(e),n=vm(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+mm(e),y:s}}(e)):am(t)?function(e){var t=dm(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):sg(function(e){var t,n=vm(e),r=hm(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=um(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=um(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+mm(e),l=-r.scrollTop;return"rtl"===gm(i||n).direction&&(s+=um(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(vm(e)))}function ug(e,t,n){var r="clippingParents"===t?function(e){var t=Sm(wm(e)),n=["absolute","fixed"].indexOf(gm(e).position)>=0,r=n&&sm(e)?Mm(e):e;return am(r)?t.filter((function(e){return am(e)&&ag(e,r)&&"body"!==pm(e)&&(!n||"static"!==gm(e).position)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=lg(e,n);return t.top=um(r.top,t.top),t.right=cm(r.right,t.right),t.bottom=cm(r.bottom,t.bottom),t.left=um(r.left,t.left),t}),lg(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function cg(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function fg(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function dg(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,l=void 0===s?_m:s,u=n.elementContext,c=void 0===u?Nm:u,f=n.altBoundary,d=void 0!==f&&f,h=n.padding,p=void 0===h?0:h,v=cg("number"!==typeof p?p:fg(p,Rm)),m=c===Nm?"reference":Nm,g=e.rects.popper,y=e.elements[d?m:c],b=ug(am(y)?y:y.contextElement||vm(e.elements.popper),a,l),x=dm(e.elements.reference),w=Ym({reference:x,element:g,strategy:"absolute",placement:i}),k=sg(Object.assign({},g,w)),S=c===Nm?k:x,O={top:b.top-S.top+v.top,bottom:S.bottom-b.bottom+v.bottom,left:b.left-S.left+v.left,right:S.right-b.right+v.right},C=e.modifiersData.offset;if(c===Nm&&C){var M=C[i];Object.keys(O).forEach((function(e){var t=[Em,Tm].indexOf(e)>=0?1:-1,n=[Pm,Tm].indexOf(e)>=0?"y":"x";O[e]+=M[n]*t}))}return O}var hg={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,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=void 0===h||h,v=n.allowedAutoPlacements,m=t.options.placement,g=Um(m),y=l||(g===m||!p?[rg(m)]:function(e){if(Um(e)===Am)return[];var t=rg(e);return[og(e),t,og(t)]}(m)),b=[m].concat(y).reduce((function(e,n){return e.concat(Um(n)===Am?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?Im:l,c=Qm(r),f=c?s?Lm:Lm.filter((function(e){return Qm(e)===c})):Rm,d=f.filter((function(e){return u.indexOf(e)>=0}));0===d.length&&(d=f);var h=d.reduce((function(t,n){return t[n]=dg(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[Um(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:c,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:v}):n)}),[]),x=t.rects.reference,w=t.rects.popper,k=new Map,S=!0,O=b[0],C=0;C=0,Z=E?"width":"height",A=dg(t,{placement:M,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),R=E?T?Em:Zm:T?Tm:Pm;x[Z]>w[Z]&&(R=rg(R));var D=rg(R),j=[];if(o&&j.push(A[P]<=0),s&&j.push(A[R]<=0,A[D]<=0),j.every((function(e){return e}))){O=M,S=!1;break}k.set(M,j)}if(S)for(var _=function(e){var t=b.find((function(t){var n=k.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return O=t,"break"},N=p?3:1;N>0;N--){if("break"===_(N))break}t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function pg(e,t,n){return um(e,cm(t,n))}var vg={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,h=void 0===d||d,p=n.tetherOffset,v=void 0===p?0:p,m=dg(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),g=Um(t.placement),y=Qm(t.placement),b=!y,x=Xm(g),w="x"===x?"y":"x",k=t.modifiersData.popperOffsets,S=t.rects.reference,O=t.rects.popper,C="function"===typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,M="number"===typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,T={x:0,y:0};if(k){if(o){var E,Z="y"===x?Pm:Zm,A="y"===x?Tm:Em,R="y"===x?"height":"width",D=k[x],j=D+m[Z],_=D-m[A],N=h?-O[R]/2:0,L=y===Dm?S[R]:O[R],I=y===Dm?-O[R]:-S[R],z=t.elements.arrow,B=h&&z?xm(z):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=F[Z],W=F[A],H=pg(0,S[R],B[R]),V=b?S[R]/2-N-H-$-M.mainAxis:L-H-$-M.mainAxis,q=b?-S[R]/2+N+H+W+M.mainAxis:I+H+W+M.mainAxis,U=t.elements.arrow&&Mm(t.elements.arrow),Q=U?"y"===x?U.clientTop||0:U.clientLeft||0:0,X=null!=(E=null==P?void 0:P[x])?E:0,Y=D+q-X,G=pg(h?cm(j,D+V-X-Q):j,D,h?um(_,Y):_);k[x]=G,T[x]=G-D}if(s){var K,J="x"===x?Pm:Zm,ee="x"===x?Tm:Em,te=k[w],ne="y"===w?"height":"width",re=te+m[J],ie=te-m[ee],oe=-1!==[Pm,Zm].indexOf(g),ae=null!=(K=null==P?void 0:P[w])?K:0,se=oe?re:te-S[ne]-O[ne]-ae+M.altAxis,le=oe?te+S[ne]+O[ne]-ae-M.altAxis:ie,ue=h&&oe?function(e,t,n){var r=pg(e,t,n);return r>n?n:r}(se,te,le):pg(h?se:re,te,h?le:ie);k[w]=ue,T[w]=ue-te}t.modifiersData[r]=T}},requiresIfExists:["offset"]};var mg={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Um(n.placement),l=Xm(s),u=[Zm,Em].indexOf(s)>=0?"height":"width";if(o&&a){var c=function(e,t){return cg("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:fg(e,Rm))}(i.padding,n),f=xm(o),d="y"===l?Pm:Zm,h="y"===l?Tm:Em,p=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],v=a[l]-n.rects.reference[l],m=Mm(o),g=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,y=p/2-v/2,b=c[d],x=g-f[u]-c[h],w=g/2-f[u]/2+y,k=pg(b,w,x),S=l;n.modifiersData[r]=((t={})[S]=k,t.centerOffset=k-w,t)}},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)))&&ag(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gg(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 yg(e){return[Pm,Em,Tm,Zm].some((function(t){return e[t]>=0}))}var bg={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=dg(t,{elementContext:"reference"}),s=dg(t,{altBoundary:!0}),l=gg(a,r),u=gg(s,i,o),c=yg(l),f=yg(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}},xg=Hm({defaultModifiers:[qm,Gm,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,u={placement:Um(t.placement),variation:Qm(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Jm(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Jm(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},eg,tg,hg,vg,mg,bg]}),wg=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","TransitionProps"],kg=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"];function Sg(e){return"function"===typeof e?e():e}var Og={},Cg=e.forwardRef((function(t,n){var i=t.anchorEl,s=t.children,l=t.direction,u=t.disablePortal,c=t.modifiers,d=t.open,h=t.placement,v=t.popperOptions,m=t.popperRef,g=t.TransitionProps,y=(0,o.Z)(t,wg),b=e.useRef(null),x=(0,f.Z)(b,n),w=e.useRef(null),k=(0,f.Z)(w,m),S=e.useRef(k);(0,Ns.Z)((function(){S.current=k}),[k]),e.useImperativeHandle(m,(function(){return w.current}),[]);var O=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}}(h,l),C=e.useState(O),M=(0,r.Z)(C,2),P=M[0],T=M[1];e.useEffect((function(){w.current&&w.current.forceUpdate()})),(0,Ns.Z)((function(){if(i&&d){Sg(i);var e=[{name:"preventOverflow",options:{altBoundary:u}},{name:"flip",options:{altBoundary:u}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:function(e){var t=e.state;T(t.placement)}}];null!=c&&(e=e.concat(c)),v&&null!=v.modifiers&&(e=e.concat(v.modifiers));var t=xg(Sg(i),b.current,(0,a.Z)({placement:O},v,{modifiers:e}));return S.current(t),function(){t.destroy(),S.current(null)}}}),[i,u,c,d,v,O]);var E={placement:P};return null!==g&&(E.TransitionProps=g),(0,p.jsx)("div",(0,a.Z)({ref:x,role:"tooltip"},y,{children:"function"===typeof s?s(E):s}))})),Mg=e.forwardRef((function(t,n){var i=t.anchorEl,s=t.children,l=t.container,u=t.direction,c=void 0===u?"ltr":u,f=t.disablePortal,d=void 0!==f&&f,v=t.keepMounted,m=void 0!==v&&v,g=t.modifiers,y=t.open,b=t.placement,x=void 0===b?"bottom":b,w=t.popperOptions,k=void 0===w?Og:w,S=t.popperRef,O=t.style,C=t.transition,M=void 0!==C&&C,P=(0,o.Z)(t,kg),T=e.useState(!0),E=(0,r.Z)(T,2),Z=E[0],A=E[1];if(!m&&!y&&(!M||Z))return null;var R=l||(i?(0,h.Z)(Sg(i)).body:void 0);return(0,p.jsx)(xu,{disablePortal:d,container:R,children:(0,p.jsx)(Cg,(0,a.Z)({anchorEl:i,direction:c,disablePortal:d,modifiers:g,ref:n,open:M?!Z:y,placement:x,popperOptions:k,popperRef:S},P,{style:(0,a.Z)({position:"fixed",top:0,left:0,display:y||!m||M&&!Z?null:"none"},O),TransitionProps:M?{in:y,onEnter:function(){A(!1)},onExited:function(){A(!0)}}:null,children:s}))})})),Pg=Mg,Tg=n(4976),Eg=e.forwardRef((function(e,t){var n=(0,Tg.Z)();return(0,p.jsx)(Pg,(0,a.Z)({direction:null==n?void 0:n.direction},e,{ref:t}))})),Zg=Eg,Ag=n(7677);function Rg(e){return(0,q.Z)("MuiTooltip",e)}var Dg=(0,U.Z)("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),jg=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","title","TransitionComponent","TransitionProps"];var _g=(0,g.ZP)(Zg,{name:"MuiTooltip",slot:"Popper",overridesResolver:function(e,t){var n=e.ownerState;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})((function(e){var t,n=e.theme,r=e.ownerState,o=e.open;return(0,a.Z)({zIndex:n.zIndex.tooltip,pointerEvents:"none"},!r.disableInteractive&&{pointerEvents:"auto"},!o&&{pointerEvents:"none"},r.arrow&&(t={},(0,i.Z)(t,'&[data-popper-placement*="bottom"] .'.concat(Dg.arrow),{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}}),(0,i.Z)(t,'&[data-popper-placement*="top"] .'.concat(Dg.arrow),{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}}),(0,i.Z)(t,'&[data-popper-placement*="right"] .'.concat(Dg.arrow),(0,a.Z)({},r.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}})),(0,i.Z)(t,'&[data-popper-placement*="left"] .'.concat(Dg.arrow),(0,a.Z)({},r.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})),t))})),Ng=(0,g.ZP)("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:function(e,t){var n=e.ownerState;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t["tooltipPlacement".concat((0,O.Z)(n.placement.split("-")[0]))]]}})((function(e){var t,n,r=e.theme,o=e.ownerState;return(0,a.Z)({backgroundColor:(0,V.Fq)(r.palette.grey[700],.92),borderRadius:r.shape.borderRadius,color:r.palette.common.white,fontFamily:r.typography.fontFamily,padding:"4px 8px",fontSize:r.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:r.typography.fontWeightMedium},o.arrow&&{position:"relative",margin:0},o.touch&&{padding:"8px 16px",fontSize:r.typography.pxToRem(14),lineHeight:"".concat((n=16/14,Math.round(1e5*n)/1e5),"em"),fontWeight:r.typography.fontWeightRegular},(t={},(0,i.Z)(t,".".concat(Dg.popper,'[data-popper-placement*="left"] &'),(0,a.Z)({transformOrigin:"right center"},o.isRtl?(0,a.Z)({marginLeft:"14px"},o.touch&&{marginLeft:"24px"}):(0,a.Z)({marginRight:"14px"},o.touch&&{marginRight:"24px"}))),(0,i.Z)(t,".".concat(Dg.popper,'[data-popper-placement*="right"] &'),(0,a.Z)({transformOrigin:"left center"},o.isRtl?(0,a.Z)({marginRight:"14px"},o.touch&&{marginRight:"24px"}):(0,a.Z)({marginLeft:"14px"},o.touch&&{marginLeft:"24px"}))),(0,i.Z)(t,".".concat(Dg.popper,'[data-popper-placement*="top"] &'),(0,a.Z)({transformOrigin:"center bottom",marginBottom:"14px"},o.touch&&{marginBottom:"24px"})),(0,i.Z)(t,".".concat(Dg.popper,'[data-popper-placement*="bottom"] &'),(0,a.Z)({transformOrigin:"center top",marginTop:"14px"},o.touch&&{marginTop:"24px"})),t))})),Lg=(0,g.ZP)("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:function(e,t){return t.arrow}})((function(e){var t=e.theme;return{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:(0,V.Fq)(t.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}})),Ig=!1,zg=null;function Bg(e,t){return function(n){t&&t(n),e(n)}}var Fg=e.forwardRef((function(t,n){var i,s,l,f,d,h,v=(0,w.Z)({props:t,name:"MuiTooltip"}),m=v.arrow,g=void 0!==m&&m,y=v.children,b=v.components,k=void 0===b?{}:b,C=v.componentsProps,M=void 0===C?{}:C,P=v.describeChild,T=void 0!==P&&P,E=v.disableFocusListener,Z=void 0!==E&&E,A=v.disableHoverListener,R=void 0!==A&&A,D=v.disableInteractive,j=void 0!==D&&D,_=v.disableTouchListener,N=void 0!==_&&_,L=v.enterDelay,I=void 0===L?100:L,B=v.enterNextDelay,F=void 0===B?0:B,$=v.enterTouchDelay,W=void 0===$?700:$,V=v.followCursor,q=void 0!==V&&V,U=v.id,Q=v.leaveDelay,X=void 0===Q?0:Q,Y=v.leaveTouchDelay,G=void 0===Y?1500:Y,K=v.onClose,J=v.onOpen,ee=v.open,te=v.placement,ne=void 0===te?"bottom":te,re=v.PopperComponent,ie=v.PopperProps,oe=void 0===ie?{}:ie,ae=v.title,se=v.TransitionComponent,le=void 0===se?H:se,ue=v.TransitionProps,ce=(0,o.Z)(v,jg),fe=x(),de="rtl"===fe.direction,he=e.useState(),pe=(0,r.Z)(he,2),me=pe[0],ge=pe[1],ye=e.useState(null),be=(0,r.Z)(ye,2),xe=be[0],we=be[1],ke=e.useRef(!1),Se=j||q,Oe=e.useRef(),Ce=e.useRef(),Me=e.useRef(),Pe=e.useRef(),Te=(0,Tc.Z)({controlled:ee,default:!1,name:"Tooltip",state:"open"}),Ee=(0,r.Z)(Te,2),Ze=Ee[0],Ae=Ee[1],Re=Ze,De=(0,Ag.Z)(U),je=e.useRef(),_e=e.useCallback((function(){void 0!==je.current&&(document.body.style.WebkitUserSelect=je.current,je.current=void 0),clearTimeout(Pe.current)}),[]);e.useEffect((function(){return function(){clearTimeout(Oe.current),clearTimeout(Ce.current),clearTimeout(Me.current),_e()}}),[_e]);var Ne=function(e){clearTimeout(zg),Ig=!0,Ae(!0),J&&!Re&&J(e)},Le=(0,S.Z)((function(e){clearTimeout(zg),zg=setTimeout((function(){Ig=!1}),800+X),Ae(!1),K&&Re&&K(e),clearTimeout(Oe.current),Oe.current=setTimeout((function(){ke.current=!1}),fe.transitions.duration.shortest)})),Ie=function(e){ke.current&&"touchstart"!==e.type||(me&&me.removeAttribute("title"),clearTimeout(Ce.current),clearTimeout(Me.current),I||Ig&&F?Ce.current=setTimeout((function(){Ne(e)}),Ig?F:I):Ne(e))},ze=function(e){clearTimeout(Ce.current),clearTimeout(Me.current),Me.current=setTimeout((function(){Le(e)}),X)},Be=(0,ve.Z)(),Fe=Be.isFocusVisibleRef,$e=Be.onBlur,We=Be.onFocus,He=Be.ref,Ve=e.useState(!1),qe=(0,r.Z)(Ve,2)[1],Ue=function(e){$e(e),!1===Fe.current&&(qe(!1),ze(e))},Qe=function(e){me||ge(e.currentTarget),We(e),!0===Fe.current&&(qe(!0),Ie(e))},Xe=function(e){ke.current=!0;var t=y.props;t.onTouchStart&&t.onTouchStart(e)},Ye=Ie,Ge=ze;e.useEffect((function(){if(Re)return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)};function e(e){"Escape"!==e.key&&"Esc"!==e.key||Le(e)}}),[Le,Re]);var Ke=(0,z.Z)(ge,n),Je=(0,z.Z)(He,Ke),et=(0,z.Z)(y.ref,Je);""===ae&&(Re=!1);var tt=e.useRef({x:0,y:0}),nt=e.useRef(),rt={},it="string"===typeof ae;T?(rt.title=Re||!it||R?null:ae,rt["aria-describedby"]=Re?De:null):(rt["aria-label"]=it?ae:null,rt["aria-labelledby"]=Re&&!it?De:null);var ot=(0,a.Z)({},rt,ce,y.props,{className:(0,u.default)(ce.className,y.props.className),onTouchStart:Xe,ref:et},q?{onMouseMove:function(e){var t=y.props;t.onMouseMove&&t.onMouseMove(e),tt.current={x:e.clientX,y:e.clientY},nt.current&&nt.current.update()}}:{});var at={};N||(ot.onTouchStart=function(e){Xe(e),clearTimeout(Me.current),clearTimeout(Oe.current),_e(),je.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",Pe.current=setTimeout((function(){document.body.style.WebkitUserSelect=je.current,Ie(e)}),W)},ot.onTouchEnd=function(e){y.props.onTouchEnd&&y.props.onTouchEnd(e),_e(),clearTimeout(Me.current),Me.current=setTimeout((function(){Le(e)}),G)}),R||(ot.onMouseOver=Bg(Ye,ot.onMouseOver),ot.onMouseLeave=Bg(Ge,ot.onMouseLeave),Se||(at.onMouseOver=Ye,at.onMouseLeave=Ge)),Z||(ot.onFocus=Bg(Qe,ot.onFocus),ot.onBlur=Bg(Ue,ot.onBlur),Se||(at.onFocus=Qe,at.onBlur=Ue));var st=e.useMemo((function(){var e,t=[{name:"arrow",enabled:Boolean(xe),options:{element:xe,padding:4}}];return null!=(e=oe.popperOptions)&&e.modifiers&&(t=t.concat(oe.popperOptions.modifiers)),(0,a.Z)({},oe.popperOptions,{modifiers:t})}),[xe,oe]),lt=(0,a.Z)({},v,{isRtl:de,arrow:g,disableInteractive:Se,placement:ne,PopperComponentProp:re,touch:ke.current}),ut=function(e){var t=e.classes,n=e.disableInteractive,r=e.arrow,i=e.touch,o=e.placement,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch","tooltipPlacement".concat((0,O.Z)(o.split("-")[0]))],arrow:["arrow"]};return(0,c.Z)(a,Rg,t)}(lt),ct=null!=(i=k.Popper)?i:_g,ft=null!=(s=null!=(l=k.Transition)?l:le)?s:H,dt=null!=(f=k.Tooltip)?f:Ng,ht=null!=(d=k.Arrow)?d:Lg,pt=im(ct,(0,a.Z)({},oe,M.popper),lt),vt=im(ft,(0,a.Z)({},ue,M.transition),lt),mt=im(dt,(0,a.Z)({},M.tooltip),lt),gt=im(ht,(0,a.Z)({},M.arrow),lt);return(0,p.jsxs)(e.Fragment,{children:[e.cloneElement(y,ot),(0,p.jsx)(ct,(0,a.Z)({as:null!=re?re:Zg,placement:ne,anchorEl:q?{getBoundingClientRect:function(){return{top:tt.current.y,left:tt.current.x,right:tt.current.x,bottom:tt.current.y,width:0,height:0}}}:me,popperRef:nt,open:!!me&&Re,id:De,transition:!0},at,pt,{className:(0,u.default)(ut.popper,null==oe?void 0:oe.className,null==(h=M.popper)?void 0:h.className),popperOptions:st,children:function(e){var t,n,r=e.TransitionProps;return(0,p.jsx)(ft,(0,a.Z)({timeout:fe.transitions.duration.shorter},r,vt,{children:(0,p.jsxs)(dt,(0,a.Z)({},mt,{className:(0,u.default)(ut.tooltip,null==(t=M.tooltip)?void 0:t.className),children:[ae,g?(0,p.jsx)(ht,(0,a.Z)({},gt,{className:(0,u.default)(ut.arrow,null==(n=M.arrow)?void 0:n.className),ref:we})):null]}))}))}}))]})})),$g=Fg;function Wg(e){return(0,q.Z)("MuiAccordionDetails",e)}(0,U.Z)("MuiAccordionDetails",["root"]);var Hg=["className"],Vg=(0,g.ZP)("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:function(e,t){return t.root}})((function(e){return{padding:e.theme.spacing(1,2,2)}})),qg=e.forwardRef((function(e,t){var n=(0,w.Z)({props:e,name:"MuiAccordionDetails"}),r=n.className,i=(0,o.Z)(n,Hg),s=n,l=function(e){var t=e.classes;return(0,c.Z)({root:["root"]},Wg,t)}(s);return(0,p.jsx)(Vg,(0,a.Z)({className:(0,u.default)(l.root,r),ref:t,ownerState:s},i))})),Ug=qg,Qg=n(4929);var Xg=e.createContext();function Yg(e){return(0,q.Z)("MuiGrid",e)}var Gg=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],Kg=(0,U.Z)("MuiGrid",["root","container","item","zeroMinWidth"].concat((0,me.Z)([0,1,2,3,4,5,6,7,8,9,10].map((function(e){return"spacing-xs-".concat(e)}))),(0,me.Z)(["column-reverse","column","row-reverse","row"].map((function(e){return"direction-xs-".concat(e)}))),(0,me.Z)(["nowrap","wrap-reverse","wrap"].map((function(e){return"wrap-xs-".concat(e)}))),(0,me.Z)(Gg.map((function(e){return"grid-xs-".concat(e)}))),(0,me.Z)(Gg.map((function(e){return"grid-sm-".concat(e)}))),(0,me.Z)(Gg.map((function(e){return"grid-md-".concat(e)}))),(0,me.Z)(Gg.map((function(e){return"grid-lg-".concat(e)}))),(0,me.Z)(Gg.map((function(e){return"grid-xl-".concat(e)}))))),Jg=["className","columns","columnSpacing","component","container","direction","item","lg","md","rowSpacing","sm","spacing","wrap","xl","xs","zeroMinWidth"];function ey(e){var t=parseFloat(e);return"".concat(t).concat(String(e).replace(String(t),"")||"px")}function ty(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t||!e||e<=0)return[];if("string"===typeof e&&!Number.isNaN(Number(e))||"number"===typeof e)return[n["spacing-xs-".concat(String(e))]||"spacing-xs-".concat(String(e))];var r=e.xs,i=e.sm,o=e.md,a=e.lg,s=e.xl;return[Number(r)>0&&(n["spacing-xs-".concat(String(r))]||"spacing-xs-".concat(String(r))),Number(i)>0&&(n["spacing-sm-".concat(String(i))]||"spacing-sm-".concat(String(i))),Number(o)>0&&(n["spacing-md-".concat(String(o))]||"spacing-md-".concat(String(o))),Number(a)>0&&(n["spacing-lg-".concat(String(a))]||"spacing-lg-".concat(String(a))),Number(s)>0&&(n["spacing-xl-".concat(String(s))]||"spacing-xl-".concat(String(s)))]}var ny=(0,g.ZP)("div",{name:"MuiGrid",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState,r=n.container,i=n.direction,o=n.item,a=n.lg,s=n.md,l=n.sm,u=n.spacing,c=n.wrap,f=n.xl,d=n.xs,h=n.zeroMinWidth;return[t.root,r&&t.container,o&&t.item,h&&t.zeroMinWidth].concat((0,me.Z)(ty(u,r,t)),["row"!==i&&t["direction-xs-".concat(String(i))],"wrap"!==c&&t["wrap-xs-".concat(String(c))],!1!==d&&t["grid-xs-".concat(String(d))],!1!==l&&t["grid-sm-".concat(String(l))],!1!==s&&t["grid-md-".concat(String(s))],!1!==a&&t["grid-lg-".concat(String(a))],!1!==f&&t["grid-xl-".concat(String(f))]])}})((function(e){var t=e.ownerState;return(0,a.Z)({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},"nowrap"===t.wrap&&{flexWrap:"nowrap"},"reverse"===t.wrap&&{flexWrap:"wrap-reverse"})}),(function(e){var t=e.theme,n=e.ownerState,r=(0,Qg.P$)({values:n.direction,breakpoints:t.breakpoints.values});return(0,Qg.k9)({theme:t},r,(function(e){var t={flexDirection:e};return 0===e.indexOf("column")&&(t["& > .".concat(Kg.item)]={maxWidth:"none"}),t}))}),(function(e){var t=e.theme,n=e.ownerState,r=n.container,o=n.rowSpacing,a={};if(r&&0!==o){var s=(0,Qg.P$)({values:o,breakpoints:t.breakpoints.values});a=(0,Qg.k9)({theme:t},s,(function(e){var n=t.spacing(e);return"0px"!==n?(0,i.Z)({marginTop:"-".concat(ey(n))},"& > .".concat(Kg.item),{paddingTop:ey(n)}):{}}))}return a}),(function(e){var t=e.theme,n=e.ownerState,r=n.container,o=n.columnSpacing,a={};if(r&&0!==o){var s=(0,Qg.P$)({values:o,breakpoints:t.breakpoints.values});a=(0,Qg.k9)({theme:t},s,(function(e){var n=t.spacing(e);return"0px"!==n?(0,i.Z)({width:"calc(100% + ".concat(ey(n),")"),marginLeft:"-".concat(ey(n))},"& > .".concat(Kg.item),{paddingLeft:ey(n)}):{}}))}return a}),(function(e){var t,n=e.theme,r=e.ownerState;return n.breakpoints.keys.reduce((function(e,i){var o={};if(r[i]&&(t=r[i]),!t)return e;if(!0===t)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if("auto"===t)o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{var s=(0,Qg.P$)({values:r.columns,breakpoints:n.breakpoints.values}),l="object"===typeof s?s[i]:s;if(void 0===l||null===l)return e;var u="".concat(Math.round(t/l*1e8)/1e6,"%"),c={};if(r.container&&r.item&&0!==r.columnSpacing){var f=n.spacing(r.columnSpacing);if("0px"!==f){var d="calc(".concat(u," + ").concat(ey(f),")");c={flexBasis:d,maxWidth:d}}}o=(0,a.Z)({flexBasis:u,flexGrow:0,maxWidth:u},c)}return 0===n.breakpoints.values[i]?Object.assign(e,o):e[n.breakpoints.up(i)]=o,e}),{})})),ry=e.forwardRef((function(t,n){var r,i=jt((0,w.Z)({props:t,name:"MuiGrid"})),s=i.className,l=i.columns,f=i.columnSpacing,d=i.component,h=void 0===d?"div":d,v=i.container,m=void 0!==v&&v,g=i.direction,y=void 0===g?"row":g,b=i.item,x=void 0!==b&&b,k=i.lg,S=void 0!==k&&k,O=i.md,C=void 0!==O&&O,M=i.rowSpacing,P=i.sm,T=void 0!==P&&P,E=i.spacing,Z=void 0===E?0:E,A=i.wrap,R=void 0===A?"wrap":A,D=i.xl,j=void 0!==D&&D,_=i.xs,N=void 0!==_&&_,L=i.zeroMinWidth,I=void 0!==L&&L,z=(0,o.Z)(i,Jg),B=M||Z,F=f||Z,$=e.useContext(Xg),W=l||$||12,H=(0,a.Z)({},i,{columns:W,container:m,direction:y,item:x,lg:S,md:C,sm:T,rowSpacing:B,columnSpacing:F,wrap:R,xl:j,xs:N,zeroMinWidth:I}),V=function(e){var t=e.classes,n=e.container,r=e.direction,i=e.item,o=e.lg,a=e.md,s=e.sm,l=e.spacing,u=e.wrap,f=e.xl,d=e.xs,h={root:["root",n&&"container",i&&"item",e.zeroMinWidth&&"zeroMinWidth"].concat((0,me.Z)(ty(l,n)),["row"!==r&&"direction-xs-".concat(String(r)),"wrap"!==u&&"wrap-xs-".concat(String(u)),!1!==d&&"grid-xs-".concat(String(d)),!1!==s&&"grid-sm-".concat(String(s)),!1!==a&&"grid-md-".concat(String(a)),!1!==o&&"grid-lg-".concat(String(o)),!1!==f&&"grid-xl-".concat(String(f))])};return(0,c.Z)(h,Yg,t)}(H);return r=(0,p.jsx)(ny,(0,a.Z)({ownerState:H,className:(0,u.default)(V.root,s),as:h,ref:n},z)),12!==W?(0,p.jsx)(Xg.Provider,{value:W,children:r}):r})),iy=ry;function oy(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=(0,jv.Z)(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 new 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 ay(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&C(e,t)}function sy(e){return sy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},sy(e)}function ly(e){return ly="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},ly(e)}function uy(e,t){if(t&&("object"===ly(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ye(e)}function cy(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=sy(e);if(t){var i=sy(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return uy(this,n)}}function fy(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=sy(e)););return e}function dy(){return dy="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=fy(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},dy.apply(this,arguments)}for(var hy="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((function(e){return e?parseInt(e,36):1})),py=1;pye)return hy[t-1]<=e;return!1}function my(e){return e>=127462&&e<=127487}function gy(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(n?yy:by)(e,t)}function yy(e,t){if(t==e.length)return t;t&&xy(e.charCodeAt(t))&&wy(e.charCodeAt(t-1))&&t--;var n=ky(e,t);for(t+=Oy(n);t=0&&my(ky(e,o));)i++,o-=2;if(i%2==0)break;t+=2}}return t}function by(e,t){for(;t>0;){var n=yy(e,t-2);if(n=56320&&e<57344}function wy(e){return e>=55296&&e<56320}function ky(e,t){var n=e.charCodeAt(t);if(!wy(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return xy(r)?r-56320+(n-55296<<10)+65536:n}function Sy(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function Oy(e){return e<65536?1:2}function Cy(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0;i=t)return i;if(i==e.length)break;o+=9==e.charCodeAt(i)?n-o%n:1,i=gy(e,i)}return!0===r?-1:e.length}var Py=function(){function e(){wu(this,e)}return Su(e,[{key:"lineAt",value:function(e){if(e<0||e>this.length)throw new RangeError("Invalid position ".concat(e," in document of length ").concat(this.length));return this.lineInner(e,!1,1,0)}},{key:"line",value:function(e){if(e<1||e>this.lines)throw new RangeError("Invalid line number ".concat(e," in ").concat(this.lines,"-line document"));return this.lineInner(e,!0,1,0)}},{key:"replace",value:function(e,t,n){var r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Ey.from(r,this.length-(t-e)+n.length)}},{key:"append",value:function(e){return this.replace(this.length,this.length,e)}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=[];return this.decompose(e,t,n,0),Ey.from(n,t-e)}},{key:"eq",value:function(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;for(var t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new Dy(this),i=new Dy(e),o=t,a=t;;){if(r.next(o),i.next(o),o=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new Dy(this,e)}},{key:"iterRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new jy(this,e,t)}},{key:"iterLines",value:function(e,t){var n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);var 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 _y(n)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){var e=[];return this.flatten(e),e}}],[{key:"of",value:function(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new Ty(t):Ey.from(Ty.split(t,[])):e.empty}}]),e}(),Ty=function(e){ay(n,e);var t=cy(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zy(e);return wu(this,n),(r=t.call(this)).text=e,r.length=i,r}return Su(n,[{key:"lines",get:function(){return this.text.length}},{key:"children",get:function(){return null}},{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.text[i],a=r+o.length;if((t?n:a)>=e)return new Ny(r,a,n,o);r=a+1,n++}}},{key:"decompose",value:function(e,t,r,i){var o=e<=0&&t>=this.length?this:new n(Ry(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){var a=r.pop(),s=Ay(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new n(s,a.length+o.length));else{var l=s.length>>1;r.push(new n(s.slice(0,l)),new n(s.slice(l)))}}else r.push(o)}},{key:"replace",value:function(e,t,r){if(!(r instanceof n))return dy(sy(n.prototype),"replace",this).call(this,e,t,r);var i=Ay(this.text,Ay(r.text,Ry(this.text,0,e)),t),o=this.length+r.length-(t-e);return i.length<=32?new n(i,o):Ey.from(n.split(i,[]),o)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;i<=t&&oe&&o&&(r+=n),ei&&(r+=a.slice(Math.max(0,e-i),t-i)),i=s+1}return r}},{key:"flatten",value:function(e){var t,n=oy(this.text);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.push(r)}}catch(i){n.e(i)}finally{n.f()}}},{key:"scanIdentical",value:function(){return 0}}],[{key:"split",value:function(e,t){var r,i=[],o=-1,a=oy(e);try{for(a.s();!(r=a.n()).done;){var s=r.value;i.push(s),o+=s.length+1,32==i.length&&(t.push(new n(i,o)),i=[],o=-1)}}catch(l){a.e(l)}finally{a.f()}return o>-1&&t.push(new n(i,o)),t}}]),n}(Py),Ey=function(e){ay(n,e);var t=cy(n);function n(e,r){var i;wu(this,n),(i=t.call(this)).children=e,i.length=r,i.lines=0;var o,a=oy(e);try{for(a.s();!(o=a.n()).done;){var s=o.value;i.lines+=s.lines}}catch(l){a.e(l)}finally{a.f()}return i}return Su(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var 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}}},{key:"decompose",value:function(e,t,n,r){for(var i=0,o=0;o<=t&&i=o){var l=r&((o<=e?1:0)|(s>=t?2:0));o>=e&&s<=t&&!l?n.push(a):a.decompose(e-o,t-o,n,l)}o=s+1}}},{key:"replace",value:function(e,t,r){if(r.lines=o&&t<=s){var l=a.replace(e-o,t-o,r),u=this.lines-a.lines+l.lines;if(l.lines>4&&l.lines>u>>6){var c=this.children.slice();return c[i]=l,new n(c,this.length-(t-e)+r.length)}return dy(sy(n.prototype),"replace",this).call(this,o,s,l)}o=s+1}return dy(sy(n.prototype),"replace",this).call(this,e,t,r)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;ie&&i&&(r+=n),eo&&(r+=a.sliceString(e-o,t-o,n)),o=s+1}return r}},{key:"flatten",value:function(e){var t,n=oy(this.children);try{for(n.s();!(t=n.n()).done;){t.value.flatten(e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"scanIdentical",value:function(e,t){if(!(e instanceof n))return 0;for(var i=0,o=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1],a=(0,r.Z)(o,4),s=a[0],l=a[1],u=a[2],c=a[3];;s+=t,l+=t){if(s==u||l==c)return i;var f=this.children[s],d=e.children[l];if(f!=d)return i+f.scanIdentical(d,t);i+=f.length+1}}}],[{key:"from",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.reduce((function(e,t){return e+t.length+1}),-1),i=0,o=oy(e);try{for(o.s();!(t=o.n()).done;){var a=t.value;i+=a.lines}}catch(S){o.e(S)}finally{o.f()}if(i<32){var s,l=[],u=oy(e);try{for(u.s();!(s=u.n()).done;){var c=s.value;c.flatten(l)}}catch(S){u.e(S)}finally{u.f()}return new Ty(l,r)}var f=Math.max(32,i>>5),d=f<<1,h=f>>1,p=[],v=0,m=-1,g=[];function y(e){var t;if(e.lines>d&&e instanceof n){var r,i=oy(e.children);try{for(i.s();!(r=i.n()).done;){y(r.value)}}catch(S){i.e(S)}finally{i.f()}}else e.lines>h&&(v>h||!v)?(b(),p.push(e)):e instanceof Ty&&v&&(t=g[g.length-1])instanceof Ty&&e.lines+t.lines<=32?(v+=e.lines,m+=e.length+1,g[g.length-1]=new Ty(t.text.concat(e.text),t.length+1+e.length)):(v+e.lines>f&&b(),v+=e.lines,m+=e.length+1,g.push(e))}function b(){0!=v&&(p.push(1==g.length?g[0]:n.from(g,m)),m=-1,v=g.length=0)}var x,w=oy(e);try{for(w.s();!(x=w.n()).done;){var k=x.value;y(k)}}catch(S){w.e(S)}finally{w.f()}return b(),1==p.length?p[0]:new n(p,r)}}]),n}(Py);function Zy(e){var t,n=-1,r=oy(e);try{for(r.s();!(t=r.n()).done;){n+=t.value.length+1}}catch(i){r.e(i)}finally{r.f()}return n}function Ay(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e9,i=0,o=0,a=!0;o=n&&(l>r&&(s=s.slice(0,r-i)),i1&&void 0!==arguments[1]?arguments[1]:1;wu(this,e),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof Ty?t.text.length:t.children.length)<<1]}return Su(e,[{key:"nextInner",value:function(e,t){for(this.done=this.lineBreak=!1;;){var n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,a=r instanceof Ty?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 Ty){var s=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,s.length>Math.max(0,e))return this.value=0==e?s:t>0?s.slice(e):s.slice(0,s.length-e),this;e-=s.length}else{var l=r.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof Ty?l.text.length:l.children.length)<<1))}}}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}]),e}(),jy=function(){function e(t,n,r){wu(this,e),this.value="",this.done=!1,this.cursor=new Dy(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}return Su(e,[{key:"nextInner",value:function(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);var n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;var r=this.cursor.next(e).value;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}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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)}},{key:"lineBreak",get:function(){return this.cursor.lineBreak&&""!=this.value}}]),e}(),_y=function(){function e(t){wu(this,e),this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}return Su(e,[{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.inner.next(e),n=t.done,r=t.lineBreak,i=t.value;return n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}},{key:"lineBreak",get:function(){return!1}}]),e}();"undefined"!=typeof Symbol&&(Py.prototype[Symbol.iterator]=function(){return this.iter()},Dy.prototype[Symbol.iterator]=jy.prototype[Symbol.iterator]=_y.prototype[Symbol.iterator]=function(){return this});var Ny=function(){function e(t,n,r,i){wu(this,e),this.from=t,this.to=n,this.number=r,this.text=i}return Su(e,[{key:"length",get:function(){return this.to-this.from}}]),e}(),Ly=/\r\n?|\n/,Iy=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(Iy||(Iy={})),zy=function(){function e(t){wu(this,e),this.sections=t}return Su(e,[{key:"length",get:function(){for(var e=0,t=0;t1&&void 0!==arguments[1]&&arguments[1];Wy(this,e,t)}},{key:"invertedDesc",get:function(){for(var t=[],n=0;n1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:Hy(this,e,t)}},{key:"mapPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Iy.Simple,r=0,i=0,o=0;oe)return i+(e-r);i+=a}else{if(n!=Iy.Simple&&l>=e&&(n==Iy.TrackDel&&re||n==Iy.TrackBefore&&re))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 new RangeError("Position ".concat(e," is out of range for changeset of length ").concat(r));return i}},{key:"touchesRange",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=0,r=0;n=0&&r<=t&&a>=e)return!(rt)||"cover";r=a}return!1}},{key:"toString",value:function(){for(var e="",t=0;t=0?":"+r:"")}return e}},{key:"toJSON",value:function(){return this.sections}}],[{key:"fromJSON",value:function(t){if(!Array.isArray(t)||t.length%2||t.some((function(e){return"number"!=typeof e})))throw new RangeError("Invalid JSON representation of ChangeDesc");return new e(t)}}]),e}(),By=function(e){ay(n,e);var t=cy(n);function n(e,r){var i;return wu(this,n),(i=t.call(this,e)).inserted=r,i}return Su(n,[{key:"apply",value:function(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Wy(this,(function(t,n,r,i,o){return e=e.replace(r,r+(n-t),o)}),!1),e}},{key:"mapDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Hy(this,e,t,!0)}},{key:"invert",value:function(e){for(var t=this.sections.slice(),r=[],i=0,o=0;i=0){t[i]=s,t[i+1]=a;for(var l=i>>1;r.length1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:Hy(this,e,t,!0)}},{key:"iterChanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Wy(this,e,t)}},{key:"desc",get:function(){return new zy(this.sections)}},{key:"filter",value:function(e){var t=[],r=[],i=[],o=new qy(this);e:for(var a=0,s=0;;){for(var l=a==e.length?1e9:e[a++];s0&&$y(r,t,o.text),o.forward(u),s+=u}for(var f=e[a++];s>1].toJSON()))}return e}}],[{key:"of",value:function(e,t,r){var i=[],o=[],a=0,s=null;function l(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||i.length){ap||d<0||p>t)throw new RangeError("Invalid change range ".concat(d," to ").concat(p," (in doc of length ").concat(t,")"));var m=v?"string"==typeof v?Py.of(v.split(r||Ly)):v:Py.empty,g=m.length;if(d==p&&0==g)return;da&&Fy(i,d-a,-1),Fy(i,p-d,g),$y(o,i,m),a=p}}(e),l(!s),s}},{key:"empty",value:function(e){return new n(e?[e,-1]:[],[])}},{key:"fromJSON",value:function(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");for(var t=[],r=[],i=0;i3&&void 0!==arguments[3]&&arguments[3];if(!(0==t&&n<=0)){var i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}}function $y(e,t,n){if(0!=n.length){var r=t.length-2>>1;if(r>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)s=e.sections[a++],l=e.sections[a++];t(i,u,o,c,f),i=u,o=c}}}function Hy(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=r?[]:null,a=new qy(e),s=new qy(t),l=0,u=0;;)if(-1==a.ins)l+=a.len,a.next();else if(-1==s.ins&&u=0&&(a.done||uu&&!a.done&&l+a.len=0)){if(a.done&&s.done)return o?new By(i,o):new zy(i);throw new Error("Mismatched change set lengths")}for(var f=0,d=l+a.len;;)if(s.ins>=0&&u>l&&u+s.len2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,o=new qy(e),a=new qy(t),s=!1;;){if(o.done&&a.done)return i?new By(r,i):new zy(r);if(0==o.ins)Fy(r,o.len,0,s),o.next();else if(0!=a.len||a.done){if(o.done||a.done)throw new Error("Mismatched change set lengths");var l=Math.min(o.len2,a.len),u=r.length;if(-1==o.ins){var c=-1==a.ins?-1:a.off?0:a.ins;Fy(r,l,c,s),i&&c&&$y(i,r,a.text)}else-1==a.ins?(Fy(r,o.off?0:o.len,l,s),i&&$y(i,r,o.textBit(l))):(Fy(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&$y(i,r,a.text));s=(o.ins>l||a.ins>=0&&a.len>l)&&(s||r.length>u),o.forward2(l),a.forward(l)}else Fy(r,0,a.ins,s),i&&$y(i,r,a.text),a.next()}}var qy=function(){function e(t){wu(this,e),this.set=t,this.i=0,this.next()}return Su(e,[{key:"next",value:function(){var e=this.set.sections;this.i>1;return t>=e.length?Py.empty:e[t]}},{key:"textBit",value:function(e){var t=this.set.inserted,n=this.i-2>>1;return n>=t.length&&!e?Py.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}},{key:"forward",value:function(e){e==this.len?this.next():(this.len-=e,this.off+=e)}},{key:"forward2",value:function(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}]),e}(),Uy=function(){function e(t,n,r){wu(this,e),this.from=t,this.to=n,this.flags=r}return Su(e,[{key:"anchor",get:function(){return 16&this.flags?this.to:this.from}},{key:"head",get:function(){return 16&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 4&this.flags?-1:8&this.flags?1:0}},{key:"bidiLevel",get:function(){var e=3&this.flags;return 3==e?null:e}},{key:"goalColumn",get:function(){var e=this.flags>>5;return 33554431==e?void 0:e}},{key:"map",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=t.mapPos(this.from,n),i=t.mapPos(this.to,n);return r==this.from&&i==this.to?this:new e(r,i,this.flags)}},{key:"extend",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e<=this.anchor&&t>=this.anchor)return Qy.range(e,t);var n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Qy.range(this.anchor,n)}},{key:"eq",value:function(e){return this.anchor==e.anchor&&this.head==e.head}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return Qy.range(e.anchor,e.head)}}]),e}(),Qy=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;wu(this,e),this.ranges=t,this.mainIndex=n}return Su(e,[{key:"map",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t.empty?this:e.create(this.ranges.map((function(e){return e.map(t,n)})),this.mainIndex)}},{key:"eq",value:function(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(var t=0;t1&&void 0!==arguments[1])||arguments[1];return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}},{key:"replaceRange",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mainIndex,r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(e){return e.toJSON()})),main:this.mainIndex}}}],[{key:"fromJSON",value:function(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new e(t.ranges.map((function(e){return Uy.fromJSON(e)})),t.main)}},{key:"single",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return new e([e.range(t,n)],0)}},{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0==t.length)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return new Uy(e,e,(0==t?0:t<0?4:8)|(null==n?3:Math.min(2,n))|(null!==r&&void 0!==r?r:33554431)<<5)}},{key:"range",value:function(e,t,n){var r=(null!==n&&void 0!==n?n:33554431)<<5;return t1&&void 0!==arguments[1]?arguments[1]:0,n=e[t];e.sort((function(e,t){return e.from-t.from})),t=e.indexOf(n);for(var r=1;ri.head?Qy.range(s,a):Qy.range(a,s))}}return new Qy(e,t)}function Yy(e,t){var n,r=oy(e.ranges);try{for(r.s();!(n=r.n()).done;){if(n.value.to>t)throw new RangeError("Selection points outside of document")}}catch(i){r.e(i)}finally{r.f()}}var Gy=0,Ky=function(){function e(t,n,r,i,o){wu(this,e),this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.extensions=o,this.id=Gy++,this.default=t([])}return Su(e,[{key:"of",value:function(e){return new eb([],this,0,e)}},{key:"compute",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new eb(e,this,1,t)}},{key:"computeN",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new eb(e,this,2,t)}},{key:"from",value:function(e,t){return t||(t=function(e){return e}),this.compute([e],(function(n){return t(n.field(e))}))}}],[{key:"define",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t.combine||function(e){return e},t.compareInput||function(e,t){return e===t},t.compare||(t.combine?function(e,t){return e===t}:Jy),!!t.static,t.enables)}}]),e}();function Jy(e,t){return e==t||e.length==t.length&&e.every((function(e,n){return e===t[n]}))}var eb=function(){function e(t,n,r,i){wu(this,e),this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=Gy++}return Su(e,[{key:"dynamicSlot",value:function(e){var t,n,r=this.value,i=this.facet.compareInput,o=e[this.id]>>1,a=2==this.type,s=!1,l=!1,u=[],c=oy(this.dependencies);try{for(c.s();!(n=c.n()).done;){var f=n.value;"doc"==f?s=!0:"selection"==f?l=!0:0==(1&(null!==(t=e[f.id])&&void 0!==t?t:1))&&u.push(e[f.id])}}catch(d){c.e(d)}finally{c.f()}return function(e,t){var n=e.values[o];if(n===pb)return e.values[o]=r(e),1;if(t&&(s&&t.docChanged||l&&(t.docChanged||t.selection)||u.some((function(t){return(1&vb(e,t))>0})))){var c=r(e);if(a?!function(e,t,n){if(e.length!=t.length)return!1;for(var r=0;r>1;return function(e,r){var i=e.values[n];if(i===pb)return e.values[n]=t.create(e),1;if(r){var o=t.updateF(i,r);if(!t.compareF(i,o))return e.values[n]=o,1}return 0}}},{key:"init",value:function(e){return[this,tb.of({field:this,create:e})]}},{key:"extension",get:function(){return this}}],[{key:"define",value:function(t){var n=new e(Gy++,t.create,t.update,t.compare||function(e,t){return e===t},t);return t.provide&&(n.provides=t.provide(n)),n}}]),e}(),rb=4,ib=3,ob=2,ab=1,sb=0;function lb(e){return function(t){return new cb(t,e)}}var ub={lowest:lb(rb),low:lb(ib),default:lb(ob),high:lb(ab),highest:lb(sb),fallback:lb(rb),extend:lb(ab),override:lb(sb)},cb=Su((function e(t,n){wu(this,e),this.inner=t,this.prec=n})),fb=function(){function e(){wu(this,e)}return Su(e,[{key:"of",value:function(e){return new db(this,e)}},{key:"reconfigure",value:function(t){return e.reconfigure.of({compartment:this,extension:t})}},{key:"get",value:function(e){return e.config.compartments.get(this)}}]),e}(),db=Su((function e(t,n){wu(this,e),this.compartment=t,this.inner=n})),hb=function(){function e(t,n,r,i,o){for(wu(this,e),this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(t,n,r){var i,o=[],a=Object.create(null),s=new Map,l=oy(function(e,t,n){var r=[[],[],[],[],[]],i=new Map;function o(e,a){var s=i.get(e);if(null!=s){if(s>=a)return;var l=r[s].indexOf(e);l>-1&&r[s].splice(l,1),e instanceof db&&n.delete(e.compartment)}if(i.set(e,a),Array.isArray(e)){var u,c=oy(e);try{for(c.s();!(u=c.n()).done;){o(u.value,a)}}catch(h){c.e(h)}finally{c.f()}}else if(e instanceof db){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");var f=t.get(e.compartment)||e.inner;n.set(e.compartment,f),o(f,a)}else if(e instanceof cb)o(e.inner,e.prec);else if(e instanceof nb)r[a].push(e),e.provides&&o(e.provides,a);else if(e instanceof eb)r[a].push(e),e.facet.extensions&&o(e.facet.extensions,a);else{var d=e.extension;if(!d)throw new Error("Unrecognized extension value in extension set (".concat(e,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));o(d,a)}}return o(e,ob),r.reduce((function(e,t){return e.concat(t)}))}(t,n,s));try{for(l.s();!(i=l.n()).done;){var u=i.value;u instanceof nb?o.push(u):(a[u.facet.id]||(a[u.facet.id]=[])).push(u)}}catch(O){l.e(O)}finally{l.f()}for(var c=Object.create(null),f=[],d=[],h=[],p=function(){var e=m[v];c[e.id]=d.length<<1,d.push((function(t){return e.slot(t)})),h.push([])},v=0,m=o;v>1;return function(e,n){var s,l=e.values[a],u=l===pb||!n,c=oy(o);try{for(c.s();!(s=c.n()).done;)1&vb(e,s.value)&&(u=!0)}catch(O){c.e(O)}finally{c.f()}if(!u)return 0;for(var f=[],d=0;d7)return!1;var i=c[t];if(!(1&i))return h[i>>1].every((function(t){return e(t,n+1)}));var o=r.config.address[t];return null!=o&&mb(r,o)==f[i>>1]};for(var w in c){var k=c[w],S=r.config.address[w];null!=S&&0==(1&k)&&x(+w,0)&&(b[k>>1]=mb(r,S))}}return{configuration:new e(t,s,d.map((function(e){return e(c)})),c,f),values:b}}}]),e}();var pb={};function vb(e,t){if(1&t)return 2;var n=t>>1,r=e.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;var i=e.config.dynamicSlots[n](e,e.applying);return e.status[n]=2|i}function mb(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}var gb=Ky.define(),yb=Ky.define({combine:function(e){return e.some((function(e){return e}))},static:!0}),bb=Ky.define({combine:function(e){return e.length?e[0]:void 0},static:!0}),xb=Ky.define(),wb=Ky.define(),kb=Ky.define(),Sb=Ky.define({combine:function(e){return!!e.length&&e[0]}}),Ob=function(){function e(t,n){wu(this,e),this.type=t,this.value=n}return Su(e,null,[{key:"define",value:function(){return new Cb}}]),e}(),Cb=function(){function e(){wu(this,e)}return Su(e,[{key:"of",value:function(e){return new Ob(this,e)}}]),e}(),Mb=function(){function e(t){wu(this,e),this.map=t}return Su(e,[{key:"of",value:function(e){return new Pb(this,e)}}]),e}(),Pb=function(){function e(t,n){wu(this,e),this.type=t,this.value=n}return Su(e,[{key:"map",value:function(t){var n=this.type.map(this.value,t);return void 0===n?void 0:n==this.value?this:new e(this.type,n)}},{key:"is",value:function(e){return this.type==e}}],[{key:"define",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Mb(e.map||function(e){return e})}},{key:"mapEffects",value:function(e,t){if(!e.length)return e;var n,r=[],i=oy(e);try{for(i.s();!(n=i.n()).done;){var o=n.value.map(t);o&&r.push(o)}}catch(a){i.e(a)}finally{i.f()}return r}}]),e}();Pb.reconfigure=Pb.define(),Pb.appendConfig=Pb.define();var Tb=function(){function e(t,n,r,i,o,a){wu(this,e),this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,r&&Yy(r,n.newLength),o.some((function(t){return t.type==e.time}))||(this.annotations=o.concat(e.time.of(Date.now())))}return Su(e,[{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"annotation",value:function(e){var t,n=oy(this.annotations);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.type==e)return r.value}}catch(i){n.e(i)}finally{n.f()}}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"reconfigured",get:function(){return this.startState.config!=this.state.config}},{key:"isUserEvent",value:function(t){var n=this.annotation(e.userEvent);return!(!n||!(n==t||n.length>t.length&&n.slice(0,t.length)==t&&"."==n[t.length]))}}]),e}();function Eb(e,t){for(var n=[],r=0,i=0;;){var o=void 0,a=void 0;if(r=e[r]))o=e[r++],a=e[r++];else{if(!(i=0;i--){var o=n[i](e);o&&Object.keys(o).length&&(r=Zb(e,Ab(t,o,e.changes.newLength),!0))}return r==e?e:new Tb(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(e){var t,n=e.startState,r=!0,i=oy(n.facet(xb));try{for(i.s();!(t=i.n()).done;){var o=(0,t.value)(e);if(!1===o){r=!1;break}Array.isArray(o)&&(r=!0===r?o:Eb(r,o))}}catch(d){i.e(d)}finally{i.f()}if(!0!==r){var a,s;if(!1===r)s=e.changes.invertedDesc,a=By.empty(n.doc.length);else{var l=e.changes.filter(r);a=l.changes,s=l.filtered.invertedDesc}e=new Tb(n,a,e.selection&&e.selection.map(s),Pb.mapEffects(e.effects,s),e.annotations,e.scrollIntoView)}for(var u=n.facet(wb),c=u.length-1;c>=0;c--){var f=u[c](e);e=f instanceof Tb?f:Array.isArray(f)&&1==f.length&&f[0]instanceof Tb?f[0]:Rb(n,jb(f),!1)}return e}(a):a)}Tb.time=Ob.define(),Tb.userEvent=Ob.define(),Tb.addToHistory=Ob.define(),Tb.remote=Ob.define();var Db=[];function jb(e){return null==e?Db:Array.isArray(e)?e:[e]}var _b,Nb=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Nb||(Nb={})),Lb=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{_b=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(lF){}function Ib(e){return function(t){if(!/\S/.test(t))return Nb.Space;if(function(e){if(_b)return _b.test(e);for(var t=0;t"\x80"&&(n.toUpperCase()!=n.toLowerCase()||Lb.test(n)))return!0}return!1}(t))return Nb.Word;for(var n=0;n-1)return Nb.Word;return Nb.Other}}var zb=function(){function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;wu(this,e),this.config=t,this.doc=n,this.selection=r,this.values=i,this.applying=null,this.status=t.statusTemplate.slice(),this.applying=o,o&&(o._state=this);for(var a=0;a1&&void 0!==arguments[1])||arguments[1],n=this.config.address[e.id];if(null!=n)return vb(this,n),mb(this,n);if(t)throw new RangeError("Field is not present in this state")}},{key:"update",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:[];return t instanceof By?t:By.of(t,this.doc.length,this.facet(e.lineSeparator))}},{key:"toText",value:function(t){return Py.of(t.split(this.facet(e.lineSeparator)||Ly))}},{key:"sliceDoc",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.doc.length;return this.doc.sliceString(e,t,this.lineBreak)}},{key:"facet",value:function(e){var t=this.config.address[e.id];return null==t?e.default:(vb(this,t),mb(this,t))}},{key:"toJSON",value:function(e){var t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(var n in e){var r=e[n];r instanceof nb&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}},{key:"tabSize",get:function(){return this.facet(e.tabSize)}},{key:"lineBreak",get:function(){return this.facet(e.lineSeparator)||"\n"}},{key:"readOnly",get:function(){return this.facet(Sb)}},{key:"phrase",value:function(t){var n,r=oy(this.facet(e.phrases));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(Object.prototype.hasOwnProperty.call(i,t))return i[t]}}catch(o){r.e(o)}finally{r.f()}return t}},{key:"languageDataAt",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],o=oy(this.facet(gb));try{for(o.s();!(n=o.n()).done;){var a,s=n.value,l=oy(s(this,t,r));try{for(l.s();!(a=l.n()).done;){var u=a.value;Object.prototype.hasOwnProperty.call(u,e)&&i.push(u[e])}}catch(c){l.e(c)}finally{l.f()}}}catch(c){o.e(c)}finally{o.f()}return i}},{key:"charCategorizer",value:function(e){return Ib(this.languageDataAt("wordChars",e).join(""))}},{key:"wordAt",value:function(e){for(var t=this.doc.lineAt(e),n=t.text,r=t.from,i=t.length,o=this.charCategorizer(e),a=e-r,s=e-r;a>0;){var l=gy(n,a,!1);if(o(n.slice(l,a))!=Nb.Word)break;a=l}for(;s1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");var i=[];if(r){var o=function(e){var n=r[e],o=t[e];i.push(n.init((function(e){return n.spec.fromJSON(o,e)})))};for(var a in r)o(a)}return e.create({doc:t.doc,selection:Qy.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=hb.resolve(t.extensions||[],new Map),r=n.configuration,i=n.values,o=t.doc instanceof Py?t.doc:Py.of((t.doc||"").split(r.staticFacet(e.lineSeparator)||Ly)),a=t.selection?t.selection instanceof Qy?t.selection:Qy.single(t.selection.anchor,t.selection.head):Qy.single(0);return Yy(a,o.length),r.staticFacet(yb)||(a=a.asSingle()),new e(r,o,a,i)}}]),e}();function Bb(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={},o=oy(e);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,s=0,l=Object.keys(a);s-1&&(this.modules.splice(a,1),r--,a=-1),-1==a){if(this.modules.splice(r++,0,o),t)for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:e;return new Qb(e,t,this)}}]),e}();Ub.prototype.startSide=Ub.prototype.endSide=0,Ub.prototype.point=!1,Ub.prototype.mapMode=Iy.TrackDel;var Qb=Su((function e(t,n,r){wu(this,e),this.from=t,this.to=n,this.value=r}));function Xb(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var Yb=function(){function e(t,n,r,i){wu(this,e),this.from=t,this.to=n,this.value=r,this.maxPoint=i}return Su(e,[{key:"length",get:function(){return this.to[this.to.length-1]}},{key:"findIndex",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n?this.to:this.from,o=r,a=i.length;;){if(o==a)return o;var s=o+a>>1,l=i[s]-e||(n?this.value[s].endSide:this.value[s].startSide)-t;if(s==o)return l>=0?o:a;l>=0?a=s:o=s+1}}},{key:"between",value:function(e,t,n,r){for(var i=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,i);i(h=n.mapPos(f,u.endSide))||d==h&&u.startSide>0&&u.endSide<=0)continue;(h-d||u.endSide-u.startSide)<0||(a<0&&(a=d),u.point&&(s=Math.max(s,h-d)),r.push(u),i.push(d-a),o.push(h-a))}return{mapped:r.length?new e(i,o,r,s):null,pos:a}}}]),e}(),Gb=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.empty,i=arguments.length>3?arguments[3]:void 0;wu(this,e),this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}return Su(e,[{key:"length",get:function(){var e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}},{key:"size",get:function(){if(this.isEmpty)return 0;var e,t=this.nextLayer.size,n=oy(this.chunk);try{for(n.s();!(e=n.n()).done;){t+=e.value.value.length}}catch(r){n.e(r)}finally{n.f()}return t}},{key:"chunkEnd",value:function(e){return this.chunkPos[e]+this.chunk[e].length}},{key:"update",value:function(t){var n=t.add,r=void 0===n?[]:n,i=t.sort,o=void 0!==i&&i,a=t.filterFrom,s=void 0===a?0:a,l=t.filterTo,u=void 0===l?this.length:l,c=t.filter;if(0==r.length&&!c)return this;if(o&&r.slice().sort(Xb),this.isEmpty)return r.length?e.of(r):this;for(var f=new tx(this,null,-1).goto(0),d=0,h=[],p=new Jb;f.value||d=0){var v=r[d++];p.addInner(v.from,v.to,v.value)||h.push(v)}else 1==f.rangeIndex&&f.chunkIndexthis.chunkEnd(f.chunkIndex)||uf.to||u=i&&e<=i+o.length&&!1===o.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return nx.from([this]).goto(e)}},{key:"isEmpty",get:function(){return this.nextLayer==this}}],[{key:"iter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return nx.from(e).goto(t)}},{key:"compare",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=e.filter((function(e){return e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i})),a=t.filter((function(e){return e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i})),s=ex(o,a,n),l=new ix(o,s,i),u=new ix(a,s,i);n.iterGaps((function(e,t,n){return ox(l,e,u,t,n,r)})),n.empty&&0==n.length&&ox(l,0,u,0,0,r)}},{key:"eq",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;null==r&&(r=1e9);var i=e.filter((function(e){return!e.isEmpty&&t.indexOf(e)<0})),o=t.filter((function(t){return!t.isEmpty&&e.indexOf(t)<0}));if(i.length!=o.length)return!1;if(!i.length)return!0;for(var a=ex(i,o),s=new ix(i,a,0).goto(n),l=new ix(o,a,0).goto(n);;){if(s.to!=l.to||!ax(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()}}},{key:"spans",value:function(e,t,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=new ix(e,null,i).goto(t),a=t,s=o.openStart;;){var l=Math.min(o.to,n);if(o.point?(r.point(a,l,o.point,o.activeForPoint(o.to),s),s=o.openEnd(l)+(o.to>l?1:0)):l>a&&(r.span(a,l,o.active,s),s=o.openEnd(l)),o.to>n)break;a=o.to,o.next()}return s}},{key:"of",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=new Jb,i=oy(e instanceof Qb?[e]:n?Kb(e):e);try{for(i.s();!(t=i.n()).done;){var o=t.value;r.add(o.from,o.to,o.value)}}catch(a){i.e(a)}finally{i.f()}return r.finish()}}]),e}();function Kb(e){if(e.length>1)for(var t=e[0],n=1;n0)return e.slice().sort(Xb);t=r}return e}Gb.empty=new Gb([],[],null,-1),Gb.empty.nextLayer=Gb.empty;var Jb=function(){function e(){wu(this,e),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}return Su(e,[{key:"finishChunk",value:function(e){this.chunks.push(new Yb(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=[])}},{key:"add",value:function(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new e)).add(t,n,r)}},{key:"addInner",value:function(e,t,n){var r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new 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)}},{key:"addChunk",value:function(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);var n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}},{key:"finish",value:function(){return this.finishInner(Gb.empty)}},{key:"finishInner",value:function(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;var t=new Gb(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}]),e}();function ex(e,t,n){var r,i=new Map,o=oy(e);try{for(o.s();!(r=o.n()).done;)for(var a=r.value,s=0;s3&&void 0!==arguments[3]?arguments[3]:0;wu(this,e),this.layer=t,this.skip=n,this.minPoint=r,this.rank=i}return Su(e,[{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}},{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}},{key:"gotoInner",value:function(e,t,n){for(;this.chunkIndex=this.minPoint)break}}},{key:"setRangeIndex",value:function(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex1&&void 0!==arguments[1]?arguments[1]:-1e9,r=oy(this.heap);try{for(r.s();!(t=r.n()).done;){var i=t.value;i.goto(e,n)}}catch(a){r.e(a)}finally{r.f()}for(var o=this.heap.length>>1;o>=0;o--)rx(this.heap,o);return this.next(),this}},{key:"forward",value:function(e,t){var n,r=oy(this.heap);try{for(r.s();!(n=r.n()).done;){n.value.forward(e,t)}}catch(o){r.e(o)}finally{r.f()}for(var i=this.heap.length>>1;i>=0;i--)rx(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}},{key:"next",value:function(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{var e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),rx(this.heap,0)}}}],[{key:"from",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],o=0;o=r&&i.push(new tx(a,n,r,o));return 1==i.length?i[0]:new e(i)}}]),e}();function rx(e,t){for(var n=e[t];;){var r=1+(t<<1);if(r>=e.length)break;var i=e[r];if(r+1=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var ix=function(){function e(t,n,r){wu(this,e),this.minPoint=r,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=nx.from(t,n,r)}return Su(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-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}},{key:"forward",value:function(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}},{key:"removeActive",value:function(e){sx(this.active,e),sx(this.activeTo,e),sx(this.activeRank,e),this.minActive=ux(this.active,this.activeTo)}},{key:"addActive",value:function(e){for(var t=0,n=this.cursor,r=n.value,i=n.to,o=n.rank;t-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&sx(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var o=this.cursor.value;if(o.point){if(!(t&&this.cursor.to==this.to&&this.cursor.frome&&this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}if(n){for(var a=0;a=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}},{key:"openEnd",value:function(e){for(var t=0,n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}]),e}();function ox(e,t,n,r,i,o){e.goto(t),n.goto(r);for(var a=r+i,s=r,l=r-t;;){var u=e.to+l-n.to||e.endSide-n.endSide,c=u<0?e.to+l:n.to,f=Math.min(c,a);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&ax(e.activeForPoint(e.to+l),n.activeForPoint(n.to))||o.comparePoint(s,f,e.point,n.point):f>s&&!ax(e.active,n.active)&&o.compareRange(s,f,e.active,n.active),c>a)break;s=c,u<=0&&e.next(),u>=0&&n.next()}}function ax(e,t){if(e.length!=t.length)return!1;for(var n=0;n=t;r--)e[r+1]=e[r];e[t]=n}function ux(e,t){for(var n=-1,r=1e9,i=0;i",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},dx="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),hx="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),px="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),vx="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),mx="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),gx=dx&&(vx||+dx[1]<57)||px&&vx,yx=0;yx<10;yx++)cx[48+yx]=cx[96+yx]=String(yx);for(yx=1;yx<=24;yx++)cx[yx+111]="F"+yx;for(yx=65;yx<=90;yx++)cx[yx]=String.fromCharCode(yx+32),fx[yx]=String.fromCharCode(yx);for(var bx in cx)fx.hasOwnProperty(bx)||(fx[bx]=cx[bx]);function xx(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function wx(e,t){return!!t&&e.contains(1!=t.nodeType?t.parentNode:t)}function kx(e,t){if(!t.anchorNode)return!1;try{return wx(e,t.anchorNode)}catch(lF){return!1}}function Sx(e){return 3==e.nodeType?_x(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function Ox(e,t,n,r){return!!n&&(Mx(e,t,n,r,-1)||Mx(e,t,n,r,1))}function Cx(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function Mx(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Px(e))){if("DIV"==e.nodeName)return!1;var o=e.parentNode;if(!o||1!=o.nodeType)return!1;t=Cx(e)+(i<0?0:1),e=o}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(i<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=i<0?Px(e):0}}}function Px(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}var Tx={left:0,right:0,top:0,bottom:0};function Ex(e,t){var n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Zx(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}var Ax,Rx=function(){function e(){wu(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return Su(e,[{key:"eq",value:function(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}},{key:"setRange",value:function(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}},{key:"set",value:function(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}]),e}(),Dx=null;function jx(e){if(e.setActive)return e.setActive();if(Dx)return e.focus(Dx);for(var t=[],n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==Dx?{get preventScroll(){return Dx={preventScroll:!0},!0}}:void 0),!Dx){Dx=!1;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:t,r=Ax||(Ax=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function Nx(e,t,n){var r={key:t,code:t,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);i.synthetic=!0,e.dispatchEvent(i);var o=new KeyboardEvent("keyup",r);return o.synthetic=!0,e.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}function Lx(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function Ix(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}var zx=function(){function e(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];wu(this,e),this.node=t,this.offset=n,this.precise=r}return Su(e,null,[{key:"before",value:function(t,n){return new e(t.parentNode,Cx(t),n)}},{key:"after",value:function(t,n){return new e(t.parentNode,Cx(t)+1,n)}}]),e}(),Bx=[],Fx=function(){function e(){wu(this,e),this.parent=null,this.dom=null,this.dirty=2}return Su(e,[{key:"editorView",get:function(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView}},{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"posBefore",value:function(e){var t,n=this.posAtStart,r=oy(this.children);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i==e)return n;n+=i.length+i.breakAfter}}catch(o){r.e(o)}finally{r.f()}throw new RangeError("Invalid child in posBefore")}},{key:"posAfter",value:function(e){return this.posBefore(e)+e.length}},{key:"coordsAt",value:function(e,t){return null}},{key:"sync",value:function(t){if(2&this.dirty){var n,r=this.dom,i=r.firstChild,o=oy(this.children);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.dirty){if(!a.dom&&i){var s=e.get(i);s&&(s.parent||s.constructor!=a.constructor)||a.reuseDOM(i)}a.sync(t),a.dirty=0}if(t&&!t.written&&t.node==r&&i!=a.dom&&(t.written=!0),a.dom.parentNode==r){for(;i&&i!=a.dom;)i=$x(i);i=a.dom.nextSibling}else r.insertBefore(a.dom,i)}}catch(f){o.e(f)}finally{o.f()}for(i&&t&&t.node==r&&(t.written=!0);i;)i=$x(i)}else if(1&this.dirty){var l,u=oy(this.children);try{for(u.s();!(l=u.n()).done;){var c=l.value;c.dirty&&(c.sync(t),c.dirty=0)}}catch(f){u.e(f)}finally{u.f()}}}},{key:"reuseDOM",value:function(e){}},{key:"localPosFromDOM",value:function(t,n){var r;if(t==this.dom)r=this.dom.childNodes[n];else{for(var i=0==Px(t)?0:0==n?-1:1;;){var o=t.parentNode;if(o==this.dom)break;0==i&&o.firstChild!=o.lastChild&&(i=t==o.firstChild?-1:1),t=o}r=i<0?t:t.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!e.get(r);)r=r.nextSibling;if(!r)return this.length;for(var a=0,s=0;;a++){var l=this.children[a];if(l.dom==r)return s;s+=l.length+l.breakAfter}}},{key:"domBoundsAround",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,o=-1,a=-1,s=0,l=n,u=n;st)return c.domBoundsAround(e,t,l);if(f>=e&&-1==r&&(r=s,i=l),l>t&&c.dom.parentNode==this.dom){o=s,a=u;break}u=f,l=f+c.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=0?this.children[o].dom:null}}},{key:"markDirty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.dirty|=2,this.markParentsDirty(e)}},{key:"markParentsDirty",value:function(e){for(var t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),1&t.dirty)return;t.dirty|=1,e=!1}}},{key:"setParent",value:function(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}},{key:"rootView",get:function(){for(var e=this;;){var t=e.parent;if(!t)return e;e=t}}},{key:"replaceChildren",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bx;this.markDirty();for(var i=e;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new Wx(this.children,e,this.children.length)}},{key:"childPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(e,t)}},{key:"toString",value:function(){var e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}},{key:"isEditable",get:function(){return!0}},{key:"merge",value:function(e,t,n,r,i,o){return!1}},{key:"become",value:function(e){return!1}},{key:"getSide",value:function(){return 0}},{key:"destroy",value:function(){this.parent=null}}],[{key:"get",value:function(e){return e.cmView}}]),e}();function $x(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}Fx.prototype.breakAfter=0;var Wx=function(){function e(t,n,r){wu(this,e),this.children=t,this.pos=n,this.i=r,this.off=0}return Su(e,[{key:"findPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;;){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;var n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}]),e}();function Hx(e,t,n,r,i,o,a,s,l){var u=e.children,c=u.length?u[t]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:a;if(!(t==r&&c&&!a&&!d&&o.length<2&&c.merge(n,i,o.length?f:null,0==n,s,l))){if(r0&&(!a&&o.length&&c.merge(n,c.length,o[0],!1,s,0)?c.breakAfter=o.shift().breakAfter:(n2),ow={mac:iw||/Mac/.test(Qx.platform),windows:/Win/.test(Qx.platform),linux:/Linux|X11/.test(Qx.platform),ie:Jx,ie_version:Gx?Xx.documentMode||6:Kx?+Kx[1]:Yx?+Yx[1]:0,gecko:ew,gecko_version:ew?+(/Firefox\/(\d+)/.exec(Qx.userAgent)||[0,0])[1]:0,chrome:!!tw,chrome_version:tw?+tw[1]:0,ios:iw,android:/Android\b/.test(Qx.userAgent),webkit:nw,safari:rw,webkit_version:nw?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=Xx.documentElement.style.tabSize?"tab-size":"-moz-tab-size"},aw=function(e){ay(n,e);var t=cy(n);function n(e){var r;return wu(this,n),(r=t.call(this)).text=e,r}return Su(n,[{key:"length",get:function(){return this.text.length}},{key:"createDOM",value:function(e){this.setDOM(e||document.createTextNode(this.text))}},{key:"sync",value:function(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(e){3==e.nodeType&&this.createDOM(e)}},{key:"merge",value:function(e,t,r){return(!r||r instanceof n&&!(this.length-(t-e)+r.length>256))&&(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}},{key:"split",value:function(e){var t=new n(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t}},{key:"localPosFromDOM",value:function(e,t){return e==this.dom?t:t?this.text.length:0}},{key:"domAtPos",value:function(e){return new zx(this.dom,e)}},{key:"domBoundsAround",value:function(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}},{key:"coordsAt",value:function(e,t){return lw(this.dom,e,t)}}]),n}(Fx),sw=function(e){ay(n,e);var t=cy(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;wu(this,n),(r=t.call(this)).mark=e,r.children=i,r.length=o;var a,s=oy(i);try{for(s.s();!(a=s.n()).done;){var l=a.value;l.setParent(ye(r))}}catch(u){s.e(u)}finally{s.f()}return r}return Su(n,[{key:"setAttrs",value:function(e){if(Ix(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(var t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}},{key:"reuseDOM",value:function(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}},{key:"sync",value:function(e){this.dom?4&this.dirty&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),dy(sy(n.prototype),"sync",this).call(this,e)}},{key:"merge",value:function(e,t,r,i,o,a){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||e&&o<=0||te&&r.push(i=e&&(o=a),i=u,a++}}catch(f){s.e(f)}finally{s.f()}var c=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new n(this.mark,r,c)}},{key:"domAtPos",value:function(e){return hw(this.dom,this.children,e)}},{key:"coordsAt",value:function(e,t){return vw(this,e,t)}}]),n}(Fx);function lw(e,t,n){var r=e.nodeValue.length;t>r&&(t=r);var i=t,o=t,a=0;0==t&&n<0||t==r&&n>=0?ow.chrome||ow.gecko||(t?(i--,a=1):(o++,a=-1)):n<0?i--:o++;var s=_x(e,i,o).getClientRects();if(!s.length)return Tx;var l=s[(a?a<0:n>=0)?0:s.length-1];return ow.safari&&!a&&0==l.width&&(l=Array.prototype.find.call(s,(function(e){return e.width}))||l),a?Ex(l,a<0):l||null}var uw=function(e){ay(n,e);var t=cy(n);function n(e,r,i){var o;return wu(this,n),(o=t.call(this)).widget=e,o.length=r,o.side=i,o}return Su(n,[{key:"split",value:function(e){var t=n.create(this.widget,this.length-e,this.side);return this.length-=e,t}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(e,t,r,i,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&o<=0||t0?n.length-1:0;r=n[i],!(e>0?0==i:i==n.length-1||r.top0?-1:1);return 0==e&&t>0||e==this.length&&t<=0?r:Ex(r,0==e)}},{key:"isEditable",get:function(){return!1}},{key:"destroy",value:function(){dy(sy(n.prototype),"destroy",this).call(this),this.dom&&this.widget.destroy(this.dom)}}],[{key:"create",value:function(e,t,r){return new(e.customView||n)(e,t,r)}}]),n}(Fx),cw=function(e){ay(n,e);var t=cy(n);function n(){return wu(this,n),t.apply(this,arguments)}return Su(n,[{key:"domAtPos",value:function(e){return new zx(this.widget.text,e)}},{key:"sync",value:function(){this.setDOM(this.widget.toDOM())}},{key:"localPosFromDOM",value:function(e,t){return t?3==e.nodeType?Math.min(t,this.length):this.length:0}},{key:"ignoreMutation",value:function(){return!1}},{key:"overrideDOMText",get:function(){return null}},{key:"coordsAt",value:function(e,t){return lw(this.widget.text,e,t)}},{key:"isEditable",get:function(){return!0}}]),n}(uw),fw=ow.android?"\u200b\u200b":"\u200b",dw=function(e){ay(n,e);var t=cy(n);function n(e){var r;return wu(this,n),(r=t.call(this)).side=e,r}return Su(n,[{key:"length",get:function(){return 0}},{key:"merge",value:function(){return!1}},{key:"become",value:function(e){return e instanceof n&&e.side==this.side}},{key:"split",value:function(){return new n(this.side)}},{key:"sync",value:function(){this.dom?this.dirty&&this.dom.nodeValue!=fw&&(this.dom.nodeValue=fw):this.setDOM(document.createTextNode(fw))}},{key:"getSide",value:function(){return this.side}},{key:"domAtPos",value:function(e){return zx.before(this.dom)}},{key:"localPosFromDOM",value:function(){return 0}},{key:"domBoundsAround",value:function(){return null}},{key:"coordsAt",value:function(e){var t=Sx(this.dom);return t[t.length-1]||null}},{key:"overrideDOMText",get:function(){return Py.of([this.dom.nodeValue.replace(/\u200b/g,"")])}}]),n}(Fx);function hw(e,t,n){for(var r=0,i=0;ri&&n0;r--){var s=t[r-1].dom;if(s.parentNode==e)return zx.after(s)}return new zx(e,0)}function pw(e,t,n){var r,i=e.children;n>0&&t instanceof sw&&i.length&&(r=i[i.length-1])instanceof sw&&r.mark.eq(t.mark)?pw(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function vw(e,t,n){for(var r=0,i=0;i0?a>=t:a>t)&&(t0)){var l=0;if(a==r){if(o.getSide()<=0)continue;l=n=-o.getSide()}var u=o.coordsAt(t-r,n);return l&&u?Ex(u,n<0):u}r=a}var c=e.dom.lastChild;if(!c)return e.dom.getBoundingClientRect();var f=Sx(c);return f[f.length-1]||null}function mw(e,t){for(var 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}function gw(e,t){if(e==t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(var i=0,o=n;i-1}}],[{key:"mark",value:function(e){return new kw(e)}},{key:"widget",value:function(e){var t=e.side||0,n=!!e.block;return new Ow(e,t+=n?t>0?3e8:-4e8:t>0?1e8:-1e8,t,n,e.widget||null,!1)}},{key:"replace",value:function(e){var t=!!e.block,n=Cw(e,t),r=n.start,i=n.end;return new Ow(e,t?r?-3e8:-1:4e8,t?i?2e8:1:-5e8,t,e.widget||null,!0)}},{key:"line",value:function(e){return new Sw(e)}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Gb.of(e,t)}}]),n}(Ub);ww.none=Gb.empty;var kw=function(e){ay(n,e);var t=cy(n);function n(e){var r;wu(this,n);var i=Cw(e),o=i.start,a=i.end;return(r=t.call(this,o?-1:4e8,a?1:-5e8,null,e)).tagName=e.tagName||"span",r.class=e.class||"",r.attrs=e.attributes||null,r}return Su(n,[{key:"eq",value:function(e){return this==e||e instanceof n&&this.tagName==e.tagName&&this.class==e.class&&gw(this.attrs,e.attrs)}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e>=t)throw new RangeError("Mark decorations may not be empty");return dy(sy(n.prototype),"range",this).call(this,e,t)}}]),n}(ww);kw.prototype.point=!1;var Sw=function(e){ay(n,e);var t=cy(n);function n(e){return wu(this,n),t.call(this,-2e8,-2e8,null,e)}return Su(n,[{key:"eq",value:function(e){return e instanceof n&&gw(this.spec.attributes,e.spec.attributes)}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return dy(sy(n.prototype),"range",this).call(this,e,t)}}]),n}(ww);Sw.prototype.mapMode=Iy.TrackBefore,Sw.prototype.point=!0;var Ow=function(e){ay(n,e);var t=cy(n);function n(e,r,i,o,a,s){var l;return wu(this,n),(l=t.call(this,r,i,a,e)).block=o,l.isReplace=s,l.mapMode=o?r<=0?Iy.TrackBefore:Iy.TrackAfter:Iy.TrackDel,l}return Su(n,[{key:"type",get:function(){return this.startSide=5}},{key:"eq",value:function(e){return e instanceof n&&(t=this.widget,r=e.widget,t==r||!!(t&&r&&t.compare(r)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,r}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return dy(sy(n.prototype),"range",this).call(this,e,t)}}]),n}(ww);function Cw(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.inclusiveStart,r=e.inclusiveEnd;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!==n&&void 0!==n?n:t,end:null!==r&&void 0!==r?r:t}}function Mw(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n.length-1;i>=0&&n[i]+r>e?n[i]=Math.max(n[i],t):n.push(e,t)}Ow.prototype.point=!0;var Pw=function(e){ay(n,e);var t=cy(n);function n(){var e;return wu(this,n),(e=t.apply(this,arguments)).children=[],e.length=0,e.prevAttrs=void 0,e.attrs=null,e.breakAfter=0,e}return Su(n,[{key:"merge",value:function(e,t,r,i,o,a){if(r){if(!(r instanceof n))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),Vx(this,e,t,r?r.children:[],o,a),!0}},{key:"split",value:function(e){var t=new n;if(t.breakAfter=this.breakAfter,0==this.length)return t;var r=this.childPos(e),i=r.i,o=r.off;o&&(t.append(this.children[i].split(o),0),this.children[i].merge(o,this.children[i].length,null,!1,0,0),i++);for(var a=i;a0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}},{key:"transferDOM",value:function(e){this.dom&&(e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(e){gw(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}},{key:"append",value:function(e,t){pw(this,e,t)}},{key:"addLineDeco",value:function(e){var t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=mw(t,this.attrs||{})),n&&(this.attrs=mw(t,{class:n}))}},{key:"domAtPos",value:function(e){return hw(this.dom,this.children,e)}},{key:"reuseDOM",value:function(e){"DIV"==e.nodeName&&(this.setDOM(e),this.dirty|=6)}},{key:"sync",value:function(e){var t;this.dom?4&this.dirty&&(Ix(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&&(yw(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),dy(sy(n.prototype),"sync",this).call(this,e);for(var r=this.dom.lastChild;r&&Fx.get(r)instanceof sw;)r=r.lastChild;if(!r||"BR"!=r.nodeName&&0==(null===(t=Fx.get(r))||void 0===t?void 0:t.isEditable)&&(!ow.ios||!this.children.some((function(e){return e instanceof aw})))){var i=document.createElement("BR");i.cmIgnore=!0,this.dom.appendChild(i)}}},{key:"measureTextSize",value:function(){if(0==this.children.length||this.length>20)return null;var e,t=0,n=oy(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(!(r instanceof aw))return null;var i=Sx(r.dom);if(1!=i.length)return null;t+=i[0].width}}catch(o){n.e(o)}finally{n.f()}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length}}},{key:"coordsAt",value:function(e,t){return vw(this,e,t)}},{key:"become",value:function(e){return!1}},{key:"type",get:function(){return xw.Text}}],[{key:"find",value:function(e,t){for(var r=0,i=0;;r++){var o=e.children[r],a=i+o.length;if(a>=t){if(o instanceof n)return o;if(o.length)return null}i=a+o.breakAfter}}}]),n}(Fx),Tw=function(e){ay(n,e);var t=cy(n);function n(e,r,i){var o;return wu(this,n),(o=t.call(this)).widget=e,o.length=r,o.type=i,o.breakAfter=0,o}return Su(n,[{key:"merge",value:function(e,t,r,i,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&o<=0||t0;){if(this.textOff==this.text.length){var r=this.cursor.next(this.skip),i=r.value,o=r.lineBreak,a=r.done;if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer([]),this.curLine=null,e--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t),this.getLine().append(Zw(new aw(this.text.slice(this.textOff,this.textOff+s)),t),n),this.atCursorPos=!0,this.textOff+=s,e-=s,n=0}}},{key:"span",value:function(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}},{key:"point",value:function(e,t,n,r,i){var o=t-e;if(n instanceof Ow)if(n.block){var a=n.type;a!=xw.WidgetAfter||this.posCovered()||this.getLine(),this.addBlockWidget(new Tw(n.widget||new Aw("div"),o,a))}else{var s=uw.create(n.widget||new Aw("span"),o,n.startSide),l=this.atCursorPos&&!s.isEditable&&i<=r.length&&(e0),u=!s.isEditable&&(e1&&void 0!==arguments[1]?arguments[1]:"nearest",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"nearest",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5;wu(this,e),this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o}return Su(e,[{key:"map",value:function(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin)}}]),e}(),$w=Pb.define({map:function(e,t){return e.map(t)}});function Ww(e,t,n){var r=e.facet(Nw);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)}var Hw=Ky.define({combine:function(e){return!e.length||e[0]}}),Vw=Su((function e(t,n){wu(this,e),this.field=t,this.get=n})),qw=function(){function e(){wu(this,e)}return Su(e,[{key:"from",value:function(e){return new Vw(this,e)}}],[{key:"define",value:function(){return new e}}]),e}();qw.decorations=qw.define(),qw.atomicRanges=qw.define(),qw.scrollMargins=qw.define();var Uw=0,Qw=Ky.define(),Xw=function(){function e(t,n,r){wu(this,e),this.id=t,this.create=n,this.fields=r,this.extension=Qw.of(this)}return Su(e,null,[{key:"define",value:function(t,n){var r=n||{},i=r.eventHandlers,o=r.provide,a=r.decorations,s=[];if(o){var l,u=oy(Array.isArray(o)?o:[o]);try{for(u.s();!(l=u.n()).done;){var c=l.value;s.push(c)}}catch(f){u.e(f)}finally{u.f()}}return i&&s.push(Yw.from((function(e){return{plugin:e,handlers:i}}))),a&&s.push(qw.decorations.from(a)),new e(Uw++,t,s)}},{key:"fromClass",value:function(t,n){return e.define((function(e){return new t(e)}),n)}}]),e}(),Yw=qw.define(),Gw=function(){function e(t){wu(this,e),this.spec=t,this.mustUpdate=null,this.value=null}return Su(e,[{key:"takeField",value:function(e,t){if(this.spec){var n,r=oy(this.spec.fields);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.field,a=i.get;o==e&&t.push(a(this.value))}}catch(s){r.e(s)}finally{r.f()}}}},{key:"update",value:function(e){if(this.value){if(this.mustUpdate){var t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(Ww(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(lF){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(n){Ww(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}},{key:"destroy",value:function(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(n){Ww(e.state,n,"CodeMirror plugin crashed")}}},{key:"deactivate",value:function(){this.spec=this.value=null}}]),e}(),Kw=Ky.define(),Jw=Ky.define(),ek=Ky.define(),tk=Ky.define(),nk=function(){function e(t,n,r,i){wu(this,e),this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}return Su(e,[{key:"join",value:function(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}},{key:"addToSet",value:function(e){for(var t=e.length,n=this;t>0;t--){var r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAc)break;o+=2}if(!l)return r;new e(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),a=l.toA,s=l.toB}}}]),e}(),rk=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Rw;wu(this,e),this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=By.empty(this.startState.doc.length);var i,o=oy(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.changes=this.changes.compose(a.changes)}}catch(u){o.e(u)}finally{o.f()}var s=[];this.changes.iterChangedRanges((function(e,t,n,r){return s.push(new nk(e,t,n,r))})),this.changedRanges=s;var l=t.hasFocus;l!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=l,this.flags|=1),this.docChanged&&(this.flags|=2)}return Su(e,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(10&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"selectionSet",get:function(){return this.transactions.some((function(e){return e.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}]),e}(),ik=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(ik||(ik={})),ok=ik.LTR,ak=ik.RTL;function sk(e){for(var t=[],n=0;n=t){if(a.level==n)return o;(i<0||(0!=r?r<0?a.fromt:e[i].level>a.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}]),e}(),xk=[];function wk(e,t){var n=e.length,r=t==ok?1:2,i=t==ok?2:1;if(!e||1==r&&!yk.test(e))return kk(n);for(var o=0,a=r,s=r;o=0;k-=3)if(fk[k+1]==-g){var S=fk[k+2],O=2&S?r:4&S?1&S?i:r:0;O&&(xk[b]=xk[fk[k]]=O),x=k;break}}else{if(189==fk.length)break;fk[x++]=b,fk[x++]=m,fk[x++]=w}else if(2==(y=xk[b])||1==y){var C=y==r;w=C?0:1;for(var M=x-3;M>=0;M-=3){var P=fk[M+2];if(2&P)break;if(C)fk[M+2]|=2;else{if(4&P)break;fk[M+2]|=4}}}for(var T=0;T_;){for(var I=L,z=2!=xk[--L];L>_&&z==(2!=xk[L-1]);)L--;D.push(new bk(L,I,z?2:1))}else D.push(new bk(_,j,0))}else for(var B=0;B0&&n.length&&(n.every((function(e){var n=e.fromA;return e.toAt.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.view.inputState.composing<0?this.compositionDeco=ww.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=function(e,t){var n=e.observer.selectionRange,r=n.focusNode&&Rk(n.focusNode,n.focusOffset,0);if(!r)return ww.none;var i=e.docView.nearest(r);if(!i)return ww.none;var o,a,s=r;if(i instanceof Pw){for(;s.parentNode!=i.dom;)s=s.parentNode;for(var l=s.previousSibling;l&&!Fx.get(l);)l=l.previousSibling;o=a=l?Fx.get(l).posAtEnd:i.posAtStart}else{for(;;){var u=i.parent;if(!u)return ww.none;if(u instanceof Pw)break;i=u}a=(o=i.posAtStart)+i.length,s=i.dom}var c=t.mapPos(o,1),f=Math.max(c,t.mapPos(a,-1)),d=e.state,h=3==s.nodeType?s.nodeValue:new Ck([],e).readRange(s.firstChild,null).text;if(f-c=0?e[i]:null;if(!o)break;var a=o.fromA,s=o.toA,l=o.fromB,u=o.toB,c=Ew.build(this.view.state.doc,l,u,t),f=c.content,d=c.breakAtStart,h=c.openStart,p=c.openEnd,v=r.findPos(s,1),m=v.i,g=v.off,y=r.findPos(a,-1);Hx(this,y.i,y.off,m,g,f,d,h,p)}}},{key:"updateSelection",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t&&this.view.observer.readSelectionRange(),!(!n&&!this.mayControlSelection()||ow.ios&&this.view.inputState.rapidCompositionStart)){var r=this.forceSelection;this.forceSelection=!1;var i=this.view.state.selection.main,o=this.domAtPos(i.anchor),a=i.empty?o:this.domAtPos(i.head);if(ow.gecko&&i.empty&&Ek(o)){var s=document.createTextNode("");this.view.observer.ignore((function(){return o.node.insertBefore(s,o.node.childNodes[o.offset]||null)})),o=a=new zx(s,0),r=!0}var l=this.view.observer.selectionRange;!r&&l.focusNode&&Ox(o.node,o.offset,l.anchorNode,l.anchorOffset)&&Ox(a.node,a.offset,l.focusNode,l.focusOffset)||(this.view.observer.ignore((function(){ow.android&&ow.chrome&&e.dom.contains(l.focusNode)&&_k(l.focusNode,e.dom)&&(e.dom.blur(),e.dom.focus({preventScroll:!0}));var t=xx(e.root);if(i.empty){if(ow.gecko){var n=Dk(o.node,o.offset);if(n&&3!=n){var r=Rk(o.node,o.offset,1==n?1:-1);r&&(o=new zx(r,1==n?0:r.nodeValue.length))}}t.collapse(o.node,o.offset),null!=i.bidiLevel&&null!=l.cursorBidiLevel&&(l.cursorBidiLevel=i.bidiLevel)}else if(t.extend)t.collapse(o.node,o.offset),t.extend(a.node,a.offset);else{var s=document.createRange();if(i.anchor>i.head){var u=[a,o];o=u[0],a=u[1]}s.setEnd(a.node,a.offset),s.setStart(o.node,o.offset),t.removeAllRanges(),t.addRange(s)}})),this.view.observer.setSelectionRange(o,a)),this.impreciseAnchor=o.precise?null:new zx(l.anchorNode,l.anchorOffset),this.impreciseHead=a.precise?null:new zx(l.focusNode,l.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){if(!this.compositionDeco.size){var e=this.view.state.selection.main,t=xx(this.root);if(e.empty&&e.assoc&&t.modify){var n=Pw.find(this,e.head);if(n){var r=n.posAtStart;if(e.head!=r&&e.head!=r+n.length){var i=this.coordsAt(e.head,-1),o=this.coordsAt(e.head,1);if(i&&o&&!(i.bottom>o.top)){var a=this.domAtPos(e.head+e.assoc);t.collapse(a.node,a.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}}}}}}},{key:"mayControlSelection",value:function(){return this.view.state.facet(Hw)?this.root.activeElement==this.dom:kx(this.dom,this.view.observer.selectionRange)}},{key:"nearest",value:function(e){for(var t=e;t;){var n=Fx.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}},{key:"posFromDOM",value:function(e,t){var n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}},{key:"domAtPos",value:function(e){for(var t=this.childCursor().findPos(e,-1),n=t.i,r=t.off;no||e==o&&i.type!=xw.WidgetBefore&&i.type!=xw.WidgetAfter&&(!r||2==t||this.children[r-1].breakAfter||this.children[r-1].type==xw.WidgetBefore&&t>-2))return i.coordsAt(e-o,t);n=o}}},{key:"measureVisibleLineHeights",value:function(){for(var e=[],t=this.view.viewState.viewport,n=t.from,r=t.to,i=this.view.contentDOM.clientWidth,o=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,s=0,l=0;lr)break;if(s>=n){var f=u.dom.getBoundingClientRect();if(e.push(f.height),o){var d=u.dom.lastChild,h=d?Sx(d):[];if(h.length){var p=h[h.length-1],v=this.view.textDirection==ik.LTR?p.right-f.left:f.right-p.left;v>a&&(a=v,this.minWidth=i,this.minWidthFrom=s,this.minWidthTo=c)}}}s=c+u.breakAfter}return e}},{key:"measureTextSize",value:function(){var e,t=this,n=oy(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r instanceof Pw){var i=r.measureTextSize();if(i)return i}}}catch(l){n.e(l)}finally{n.f()}var o,a,s=document.createElement("div");return s.className="cm-line",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((function(){t.dom.appendChild(s);var e=Sx(s.firstChild)[0];o=s.getBoundingClientRect().height,a=e?e.width/27:7,s.remove()})),{lineHeight:o,charWidth:a}}},{key:"childCursor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length,t=this.children.length;return t&&(e-=this.children[--t].length),new Wx(this.children,e,t)}},{key:"computeBlockGapDeco",value:function(){for(var e=[],t=this.view.viewState,n=0,r=0;;r++){var i=r==t.viewports.length?null:t.viewports[r],o=i?i.from-1:this.length;if(o>n){var a=t.lineBlockAt(o).bottom-t.lineBlockAt(n).top;e.push(ww.replace({widget:new Zk(a),block:!0,inclusive:!0}).range(n,o))}if(!i)break;n=i.to+1}return ww.set(e)}},{key:"updateDeco",value:function(){return this.decorations=[].concat((0,me.Z)(this.view.pluginField(qw.decorations)),(0,me.Z)(this.view.state.facet(ek)),[this.compositionDeco,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco])}},{key:"scrollIntoView",value:function(e){var t,n=e.range,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1);if(r){!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,t.left),top:Math.min(r.top,t.top),right:Math.max(r.right,t.right),bottom:Math.max(r.bottom,t.bottom)});var i,o=0,a=0,s=0,l=0,u=oy(this.view.pluginField(qw.scrollMargins));try{for(u.s();!(i=u.n()).done;){var c=i.value;if(c){var f=c.left,d=c.right,h=c.top,p=c.bottom;null!=f&&(o=Math.max(o,f)),null!=d&&(a=Math.max(a,d)),null!=h&&(s=Math.max(s,h)),null!=p&&(l=Math.max(l,p))}}}catch(m){u.e(m)}finally{u.f()}var v={left:r.left-o,top:r.top-s,right:r.right+a,bottom:r.bottom+l};!function(e,t,n,r,i,o,a,s){for(var l=e.ownerDocument,u=l.defaultView,c=e;c;)if(1==c.nodeType){var f=void 0,d=c==l.body;if(d)f=Zx(u);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.parentNode;continue}var h=c.getBoundingClientRect();f={left:h.left,right:h.left+c.clientWidth,top:h.top,bottom:h.top+c.clientHeight}}var p=0,v=0;if("nearest"==i)t.top0&&t.bottom>f.bottom+v&&(v=t.bottom-f.bottom+v+a)):t.bottom>f.bottom&&(v=t.bottom-f.bottom+a,n<0&&t.top-v0&&t.right>f.right+p&&(p=t.right-f.right+p+o)):t.right>f.right&&(p=t.right-f.right+o,n<0&&t.left0&&n<=0)t=Px(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t=0))return null;e=e.childNodes[t],t=0}}}function Dk(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(te?t.left-e:Math.max(0,e-t.right)}function Lk(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function Ik(e,t){return e.topt.top+1}function zk(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function Fk(e,t,n){for(var r,i,o,a,s,l,u,c,f=e.firstChild;f;f=f.nextSibling)for(var d=Sx(f),h=0;hm||a==m&&o>v)&&(r=f,i=p,o=v,a=m),0==v?n>p.bottom&&(!u||u.bottomp.top)&&(l=f,c=p):u&&Ik(u,p)?u=Bk(u,p.bottom):c&&Ik(c,p)&&(c=zk(c,p.top))}if(u&&u.bottom>=n?(r=s,i=u):c&&c.top<=n&&(r=l,i=c),!r)return{node:e,offset:0};var g=Math.max(i.left,Math.min(i.right,t));return 3==r.nodeType?$k(r,g,n):o||"true"!=r.contentEditable?{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0)}:Fk(r,g,n)}function $k(e,t,n){for(var r=e.nodeValue.length,i=-1,o=1e9,a=0,s=0;sn?c.top-n:n-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&f=(c.left+c.right)/2,h=d;if(ow.chrome||ow.gecko)_x(e,s).getBoundingClientRect().left==c.right&&(h=!d);if(f<=0)return{node:e,offset:s+(h?1:0)};i=s+(h?1:0),o=f}}}return{node:e,offset:i>-1?i:a>0?e.nodeValue.length:0}}function Wk(e,t,n){for(var r,i,o=t.x,a=t.y,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,l=e.contentDOM.getBoundingClientRect(),u=l.top+e.viewState.paddingTop,c=e.viewState.docHeight,f=Math.max(0,Math.min(a-u,c)),d=e.defaultLineHeight/2,h=!1;(i=e.elementAtHeight(f)).type!=xw.Text;)for(;!((f=s>0?i.bottom+d:i.top-d)>=0&&f<=c);){if(h)return n?null:0;h=!0,s=-s}a=u+f;var p=i.from;if(pe.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?Hk(e,l,i,o,a):null;var v=e.dom.ownerDocument,m=e.root.elementFromPoint?e.root:v,g=m.elementFromPoint(o,a);g&&!e.contentDOM.contains(g)&&(g=null),g||(o=Math.max(l.left+1,Math.min(l.right-1,o)),(g=m.elementFromPoint(o,a))&&!e.contentDOM.contains(g)&&(g=null));var y,b=-1;if(g&&0!=(null===(r=e.docView.nearest(g))||void 0===r?void 0:r.isEditable))if(v.caretPositionFromPoint){var x=v.caretPositionFromPoint(o,a);x&&(y=x.offsetNode,b=x.offset)}else if(v.caretRangeFromPoint){var w=v.caretRangeFromPoint(o,a);w&&(y=w.startContainer,b=w.startOffset,ow.safari&&Vk(y,b,o)&&(y=void 0))}if(!y||!e.docView.dom.contains(y)){var k=Pw.find(e.docView,p),S=Fk(k.dom,o,a);y=S.node,b=S.offset}return e.docView.posFromDOM(y,b)}function Hk(e,t,n,r,i){var o=Math.round((r-t.left)*e.defaultCharacterWidth);e.lineWrapping&&n.height>1.5*e.defaultLineHeight&&(o+=Math.floor((i-n.top)/e.defaultLineHeight)*e.viewState.heightOracle.lineLength);var a=e.state.sliceDoc(n.from,n.to);return n.from+My(a,o,e.state.tabSize)}function Vk(e,t,n){var r;if(3!=e.nodeType||t!=(r=e.nodeValue.length))return!1;for(var i=e.nextSibling;i;i=i.nextSibling)if(1!=i.nodeType||"BR"!=i.nodeName)return!1;return _x(e,r-1,r).getBoundingClientRect().left>n}function qk(e,t,n,r){var i=e.state.doc.lineAt(t.head),o=r&&e.lineWrapping?e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head):null;if(o){var a=e.dom.getBoundingClientRect(),s=e.posAtCoords({x:n==(e.textDirection==ik.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(null!=s)return Qy.cursor(s,n?-1:1)}var l=Pw.find(e.docView,t.head),u=l?n?l.posAtEnd:l.posAtStart:n?i.to:i.from;return Qy.cursor(u,n?-1:1)}function Uk(e,t,n,r){for(var i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),a=t,s=null;;){var l=Ok(i,o,e.textDirection,a,n),u=Sk;if(!l){if(i.number==(n?e.state.doc.lines:1))return a;u="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),l=Qy.cursor(n?i.from:i.to)}if(s){if(!s(u))return a}else{if(!r)return l;s=r(u)}a=l}}function Qk(e,t,n){for(var r=e.pluginField(qw.atomicRanges);;){var i,o=!1,a=oy(r);try{for(a.s();!(i=a.n()).done;){i.value.between(n.from-1,n.from+1,(function(e,r,i){n.from>e&&n.fromn.from?Qy.cursor(e,1):Qy.cursor(r,-1),o=!0)}))}}catch(s){a.e(s)}finally{a.f()}if(!o)return n}}var Xk=function(){function e(t){var n=this;wu(this,e),this.lastKeyCode=0,this.lastKeyTime=0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;var r=function(e){var r=eS[e];t.contentDOM.addEventListener(e,(function(i){"keydown"==e&&n.keydown(t,i)||Jk(t,i)&&!n.ignoreDuringComposition(i)&&(n.mustFlushObserver(i)&&t.observer.forceFlush(),n.runCustomHandlers(e,t,i)?i.preventDefault():r(t,i))})),n.registeredEvents.push(e)};for(var i in eS)r(i);this.notifiedFocused=t.hasFocus,this.ensureHandlers(t),ow.safari&&t.contentDOM.addEventListener("input",(function(){return null}))}return Su(e,[{key:"setSelectionOrigin",value:function(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(e){var t,n=this,r=oy(this.customHandlers=e.pluginField(Yw));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=function(t){n.registeredEvents.indexOf(t)<0&&"scroll"!=t&&(n.registeredEvents.push(t),e.contentDOM.addEventListener(t,(function(r){Jk(e,r)&&n.runCustomHandlers(t,e,r)&&r.preventDefault()})))};for(var a in i.handlers)o(a)}}catch(s){r.e(s)}finally{r.f()}}},{key:"runCustomHandlers",value:function(e,t,n){var r,i=oy(this.customHandlers);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.handlers[e];if(a)try{if(a.call(o.plugin,n,t)||n.defaultPrevented)return!0}catch(s){Ww(t.state,s)}}}catch(l){i.e(l)}finally{i.f()}return!1}},{key:"runScrollHandlers",value:function(e,t){var n,r=oy(this.customHandlers);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.handlers.scroll;if(o)try{o.call(i.plugin,t,e)}catch(a){Ww(e.state,a)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"keydown",value:function(e,t){var n,r=this;return this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),!!this.screenKeyEvent(e,t)||(!ow.android||!ow.chrome||t.synthetic||13!=t.keyCode&&8!=t.keyCode?!(!ow.ios||!(n=Yk.find((function(e){return e.keyCode==t.keyCode})))||t.ctrlKey||t.altKey||t.metaKey||t.synthetic)&&(this.pendingIOSKey=n,setTimeout((function(){return r.flushIOSKey(e)}),250),!0):(e.observer.delayAndroidKey(t.key,t.keyCode),!0))}},{key:"flushIOSKey",value:function(e){var t=this.pendingIOSKey;return!!t&&(this.pendingIOSKey=void 0,Nx(e.contentDOM,t.key,t.keyCode))}},{key:"ignoreDuringComposition",value:function(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(ow.safari&&Date.now()-this.compositionEndedAt<500)&&(this.compositionEndedAt=0,!0))}},{key:"screenKeyEvent",value:function(e,t){var n=9==t.keyCode&&Date.now()=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}(t,n)||1!=hS(n))&&null,!1===this.dragging&&(n.preventDefault(),this.select(n))}return Su(e,[{key:"move",value:function(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(this.lastEvent=e)}},{key:"up",value:function(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}},{key:"destroy",value:function(){var e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}},{key:"select",value:function(e){var t=this.style.get(e,this.extend,this.multiple);!this.mustSelect&&t.eq(this.view.state.selection)&&t.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:t,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}},{key:"update",value:function(e){var t=this;e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout((function(){return t.select(t.lastEvent)}),20)}}]),e}();function Jk(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n,r=t.target;r!=e.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=Fx.get(r))&&n.ignoreEvent(t))return!1;return!0}var eS=Object.create(null),tS=ow.ie&&ow.ie_version<15||ow.ios&&ow.webkit_version<604;function nS(e,t){var n,r=e.state,i=1,o=r.toText(t),a=o.lines==r.selection.ranges.length,s=null!=vS&&r.selection.ranges.every((function(e){return e.empty}))&&vS==o.toString();if(s){var l=-1;n=r.changeByRange((function(e){var n=r.doc.lineAt(e.from);if(n.from==l)return{range:e};l=n.from;var s=r.toText((a?o.line(i++).text:t)+r.lineBreak);return{changes:{from:n.from,insert:s},range:Qy.cursor(e.from+s.length)}}))}else n=a?r.changeByRange((function(e){var t=o.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Qy.cursor(e.from+t.length)}})):r.replaceSelection(o);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}eS.keydown=function(e,t){e.inputState.setSelectionOrigin("select")};var rS=0;function iS(e,t,n,r){if(1==r)return Qy.cursor(t,n);if(2==r)return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(0==i.length)return Qy.cursor(t);0==o?n=1:o==i.length&&(n=-1);var a=o,s=o;n<0?a=gy(i.text,o,!1):s=gy(i.text,o);for(var l=r(i.text.slice(a,s));a>0;){var u=gy(i.text,a,!1);if(r(i.text.slice(u,a))!=l)break;a=u}for(;sDate.now()-2e3&&1==hS(t))){var n,r=null,i=oy(e.state.facet(_w));try{for(i.s();!(n=i.n()).done;){if(r=(0,n.value)(e,t))break}}catch(a){i.e(a)}finally{i.f()}if(r||0!=t.button||(r=function(e,t){var n=lS(e,t),r=hS(t),i=e.state.selection,o=n,a=t;return{update:function(e){e.docChanged&&(n&&(n.pos=e.changes.mapPos(n.pos)),i=i.map(e.changes),a=null)},get:function(t,s,l){var u;if(a&&t.clientX==a.clientX&&t.clientY==a.clientY?u=o:(u=o=lS(e,t),a=t),!u||!n)return i;var c=iS(e,u.pos,u.bias,r);if(n.pos!=u.pos&&!s){var f=iS(e,n.pos,n.bias,r),d=Math.min(f.from,c.from),h=Math.max(f.to,c.to);c=d=t.top&&e<=t.bottom},aS=function(e,t,n){return oS(t,n)&&e>=n.left&&e<=n.right};function sS(e,t,n,r){var i=Pw.find(e.docView,t);if(!i)return 1;var o=t-i.posAtStart;if(0==o)return 1;if(o==i.length)return-1;var a=i.coordsAt(o,-1);if(a&&aS(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&aS(n,r,s)?1:a&&oS(r,a)?-1:1}function lS(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:sS(e,n,t.clientX,t.clientY)}}var uS=ow.ie&&ow.ie_version<=11,cS=null,fS=0,dS=0;function hS(e){if(!uS)return e.detail;var t=cS,n=dS;return cS=e,dS=Date.now(),fS=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(fS+1)%3:1}function pS(e,t,n,r){if(n){var i=e.posAtCoords({x:t.clientX,y:t.clientY},!1);t.preventDefault();var o=e.inputState.mouseSelection,a=r&&o&&o.dragging&&o.dragMove?{from:o.dragging.from,to:o.dragging.to}:null,s={from:i,insert:n},l=e.state.changes(a?[a,s]:s);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"})}}eS.dragstart=function(e,t){var n=e.state.selection.main,r=e.inputState.mouseSelection;r&&(r.dragging=n),t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove")},eS.drop=function(e,t){if(t.dataTransfer){if(e.state.readOnly)return t.preventDefault();var n=t.dataTransfer.files;n&&n.length?function(){t.preventDefault();for(var r=Array(n.length),i=0,o=function(){++i==n.length&&pS(e,t,r.filter((function(e){return null!=e})).join(e.state.lineBreak),!1)},a=function(e){var t=new FileReader;t.onerror=o,t.onload=function(){/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),o()},t.readAsText(n[e])},s=0;sl&&(n.push(f.text),r.push({from:f.from,to:Math.min(e.doc.length,f.to+1)})),l=f.number}}catch(d){u.e(d)}finally{u.f()}i=!0}return{text:n.join(e.lineBreak),ranges:r,linewise:i}}(e.state),r=n.text,i=n.ranges,o=n.linewise;if(r||o){vS=o?r:null;var a=tS?null:t.clipboardData;a?(t.preventDefault(),a.clearData(),a.setData("text/plain",r)):function(e,t){var n=e.dom.parentNode;if(n){var 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((function(){r.remove(),e.focus()}),50)}}(e,r),"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})}},eS.focus=eS.blur=function(e){setTimeout((function(){e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)},eS.beforeprint=function(e){e.viewState.printing=!0,e.requestMeasure(),setTimeout((function(){e.viewState.printing=!1,e.requestMeasure()}),2e3)},eS.compositionstart=eS.compositionupdate=function(e){null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0,e.docView.compositionDeco.size&&(e.observer.flush(),mS(e,!0)))},eS.compositionend=function(e){e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionFirstChange=null,setTimeout((function(){e.inputState.composing<0&&mS(e,!1)}),50)},eS.contextmenu=function(e){e.inputState.lastContextMenu=Date.now()},eS.beforeinput=function(e,t){var n,r;if(ow.chrome&&ow.android&&(r=Yk.find((function(e){return e.inputType==t.inputType})))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){var i=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((function(){var t;((null===(t=window.visualViewport)||void 0===t?void 0:t.height)||0)>i+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}};var gS=["pre-wrap","normal","pre-line","break-spaces"],yS=function(){function e(){wu(this,e),this.doc=Py.empty,this.lineWrapping=!1,this.direction=ik.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}return Su(e,[{key:"heightForGap",value:function(e,t){var n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength)),this.lineHeight*n}},{key:"heightForLine",value:function(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}},{key:"setDoc",value:function(e){return this.doc=e,this}},{key:"mustRefreshForStyle",value:function(e,t){return gS.indexOf(e)>-1!=this.lineWrapping||this.direction!=t}},{key:"mustRefreshForHeights",value:function(e){for(var t=!1,n=0;n-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a||this.direction!=t;if(this.lineWrapping=a,this.direction=t,this.lineHeight=n,this.charWidth=r,this.lineLength=i,s){this.heightSamples={};for(var l=0;l2&&void 0!==arguments[2]?arguments[2]:2;wu(this,e),this.length=t,this.height=n,this.flags=r}return Su(e,[{key:"outdated",get:function(){return(2&this.flags)>0},set:function(e){this.flags=(e?2:0)|-3&this.flags}},{key:"setHeight",value:function(e,t){this.height!=t&&(Math.abs(this.height-t)>kS&&(e.heightChanged=!0),this.height=t)}},{key:"replace",value:function(t,n,r){return e.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(this)}},{key:"decomposeRight",value:function(e,t){t.push(this)}},{key:"applyChanges",value:function(e,t,n,r){for(var i=this,o=r.length-1;o>=0;o--){var a=r[o],s=a.fromA,l=a.toA,u=a.fromB,c=a.toB,f=i.lineAt(s,wS.ByPosNoHeight,t,0,0),d=f.to>=l?f:i.lineAt(l,wS.ByPosNoHeight,t,0,0);for(c+=d.to-l,l=d.to;o>0&&f.from<=r[o-1].toA;)s=r[o-1].fromA,u=r[o-1].fromB,o--,s2*o){var a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else{if(!(o>2*i))break;var s=t[r];s.break?t.splice(r,1,s.left,null,s.right):t.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else if(i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>3?arguments[3]:void 0;return n&&n.from<=t&&n.more&&this.setHeight(e,n.heights[n.index++]),this.outdated=!1,this}},{key:"toString",value:function(){return"block(".concat(this.length,")")}}]),n}(SS),CS=function(e){ay(n,e);var t=cy(n);function n(e,r){var i;return wu(this,n),(i=t.call(this,e,r,xw.Text)).collapsed=0,i.widgetHeight=0,i}return Su(n,[{key:"replace",value:function(e,t,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof MS&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof MS?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):SS.of(r)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}},{key:"toString",value:function(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}]),n}(OS),MS=function(e){ay(n,e);var t=cy(n);function n(e){return wu(this,n),t.call(this,e,0)}return Su(n,[{key:"lines",value:function(e,t){var n=e.lineAt(t).number,r=e.lineAt(t+this.length).number;return{firstLine:n,lastLine:r,lineHeight:this.height/(r-n+1)}}},{key:"blockAt",value:function(e,t,n,r){var i=this.lines(t,r),o=i.firstLine,a=i.lastLine,s=i.lineHeight,l=Math.max(0,Math.min(a-o,Math.floor((e-n)/s))),u=t.line(o+l),c=u.from,f=u.length;return new xS(c,f,n+s*l,s,xw.Text)}},{key:"lineAt",value:function(e,t,n,r,i){if(t==wS.ByHeight)return this.blockAt(e,n,r,i);if(t==wS.ByPosNoHeight){var o=n.lineAt(e),a=o.from,s=o.to;return new xS(a,s-a,0,0,xw.Text)}var l=this.lines(n,i),u=l.firstLine,c=l.lineHeight,f=n.lineAt(e),d=f.from,h=f.length,p=f.number;return new xS(d,h,r+c*(p-u),c,xw.Text)}},{key:"forEachLine",value:function(e,t,n,r,i,o){for(var a=this.lines(n,i),s=a.firstLine,l=a.lineHeight,u=Math.max(e,i),c=Math.min(i+this.length,t);u<=c;){var f=n.lineAt(u);u==e&&(r+=l*(f.number-s)),o(new xS(f.from,f.length,r,l,xw.Text)),r+=l,u=f.to+1}}},{key:"replace",value:function(e,t,r){var i=this.length-t;if(i>0){var o=r[r.length-1];o instanceof n?r[r.length-1]=new n(o.length+i):r.push(null,new n(i-1))}if(e>0){var a=r[0];a instanceof n?r[0]=new n(e+a.length):r.unshift(new n(e-1),null)}return SS.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(new n(e-1),null)}},{key:"decomposeRight",value:function(e,t){t.push(null,new n(this.length-e-1))}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,o=t+this.length;if(i&&i.from<=t+this.length&&i.more){var a=[],s=Math.max(t,i.from),l=-1,u=e.heightChanged;for(i.from>t&&a.push(new n(i.from-t-1).updateHeight(e,t));s<=o&&i.more;){var c=e.doc.lineAt(s).length;a.length&&a.push(null);var f=i.heights[i.index++];-1==l?l=f:Math.abs(f-l)>=kS&&(l=-2);var d=new CS(c,f);d.outdated=!1,a.push(d),s+=c+1}s<=o&&a.push(null,new n(o-s).updateHeight(e,s));var h=SS.of(a);return e.heightChanged=u||l<0||Math.abs(h.height-this.height)>=kS||Math.abs(l-this.lines(e.doc,t).lineHeight)>=kS,h}return(r||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}},{key:"toString",value:function(){return"gap(".concat(this.length,")")}}]),n}(SS),PS=function(e){ay(n,e);var t=cy(n);function n(e,r,i){var o;return wu(this,n),(o=t.call(this,e.length+r+i.length,e.height+i.height,r|(e.outdated||i.outdated?2:0))).left=e,o.right=i,o.size=e.size+i.size,o}return Su(n,[{key:"break",get:function(){return 1&this.flags}},{key:"blockAt",value:function(e,t,n,r){var i=n+this.left.height;return ea))return l;var u=t==wS.ByPosNoHeight?wS.ByPosNoHeight:wS.ByPos;return s?l.join(this.right.lineAt(a,u,n,o,a)):this.left.lineAt(a,u,n,r,i).join(l)}},{key:"forEachLine",value:function(e,t,n,r,i,o){var a=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e=s&&this.right.forEachLine(e,t,n,a,s,o);else{var l=this.lineAt(s,wS.ByPos,n,r,i);e=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,a,s,o)}}},{key:"replace",value:function(e,t,n){var r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));var i=[];e>0&&this.decomposeLeft(e,i);var o,a=i.length,s=oy(n);try{for(s.s();!(o=s.n()).done;){var l=o.value;i.push(l)}}catch(c){s.e(c)}finally{s.f()}if(e>0&&TS(i,a-1),t=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}},{key:"decomposeRight",value:function(e,t){var n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?SS.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=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)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=this.left,o=this.right,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)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}}]),n}(SS);function TS(e,t){var n,r;null==e[t]&&(n=e[t-1])instanceof MS&&(r=e[t+1])instanceof MS&&e.splice(t-1,3,new MS(n.length+1+r.length))}var ES=function(){function e(t,n){wu(this,e),this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}return Su(e,[{key:"isCovered",get:function(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}},{key:"span",value:function(e,t){if(this.lineStart>-1){var n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof CS?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new CS(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}},{key:"point",value:function(e,t,n){if(e=5)&&this.addLineDeco(r,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)){var e=this.oracle.doc.lineAt(this.pos),t=e.from,n=e.to;this.lineStart=t,this.lineEnd=n,this.writtenTo