=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?x+20:0),"px");var C=Li()(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,"
")}},Zh=n(2061),Ah=n.n(Zh),Rh=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"}(mh||(mh={}));var Dh=function(t){var n=t.data,i=t.series,o=t.metrics,a=void 0===o?[]:o,s=ko(),l=xo().time.period,u=yh().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],w=(0,e.useState)(),x=(0,r.Z)(w,2),k=x[0],S=x[1],O=Rh(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)(Ah()((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);iUi||(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=_i(_i({},kh),{},{series:i,axes:Th(i),scales:_i({},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&&Eh({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?Eh({u:e,tooltipIdx:M,metrics:a,series:i,tooltip:C,tooltipOffset:P}):C.style.display="none")}}}]}),D=function(e){if(k){switch(e){case mh.xRange:k.scales.x.range=Z;break;case mh.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 mh.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 dh(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(mh.data)}),[n]),(0,e.useEffect)((function(){return D(mh.xRange)}),[y]),(0,e.useEffect)((function(){return D(mh.yRange)}),[u]),(0,p.jsx)("div",{style:{pointerEvents:h?"none":"auto",height:"500px"},children:(0,p.jsx)("div",{ref:c})})},jh=function(t){var n=t.labels,r=t.onChange,i=xo().query,o=(0,e.useMemo)((function(){return Array.from(new Set(n.map((function(e){return e.group}))))}),[n]);return(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.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:Ch(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(xh(e.color),", 0.1)")}}),(0,p.jsx)("div",{className:"legendLabel",children:e.label})]},"".concat(e.group,".").concat(e.label))}))})]},e)}))})};function _h(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 Nh=["__name__"],Lh=function(e,t){var n=function(e){if(0===Object.keys(e.metric).length)return"Query result";var t=e.metric,n=t.__name__,r=_h(t,Nh);return"".concat(n||""," {").concat(Object.entries(r).map((function(e){return"".concat(e[0],": ").concat(e[1])})).join(", "),"}")}(e);return{label:n,dash:Ch(e.group),width:1.4,stroke:Oh(e.group,n),show:!zh(n,e.group,t),scale:String(e.group),points:{size:4.2,width:1.4}}},Ih=function(e,t){return{group:t,label:e.label||"",color:e.stroke,checked:e.show||!1}},zh=function(e,t,n){return n.includes("".concat(t,".").concat(e))},Bh=n(2495),Fh=n(3362),$h=n(7219),Wh=n(3282),Hh=n(4312),Vh=["onChange","maxRows","minRows","style","value"];function qh(e,t){return parseInt(e[t],10)||0}var Uh={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"},Qh=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,Vh),v=e.useRef(null!=d).current,m=e.useRef(null),g=(0,f.Z)(n,m),y=e.useRef(null),b=e.useRef(0),w=e.useState({}),x=(0,r.Z)(w,2),k=x[0],S=x[1],O=e.useCallback((function(){var e=m.current,n=(0,Wh.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=qh(n,"padding-bottom")+qh(n,"padding-top"),a=qh(n,"border-bottom-width")+qh(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,Hh.Z)((function(){b.current=0,O()})),n=(0,Wh.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,Vn.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)({},Uh,c,{padding:0})})]})})),Xh=Qh;function Yh(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 Gh=n(4993);function Kh(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 Jh=function(e){return(0,p.jsx)(Kh,(0,a.Z)({},e,{defaultTheme:b.Z}))};function ep(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function tp(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(ep(e.value)&&""!==e.value||t&&ep(e.defaultValue)&&""!==e.defaultValue)}function np(e){return(0,q.Z)("MuiInputBase",e)}var rp=(0,U.Z)("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),ip=["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"],op=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]},ap=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]},sp=(0,g.ZP)("div",{name:"MuiInputBase",slot:"Root",overridesResolver:op})((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(rp.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%"})})),lp=(0,g.ZP)("input",{name:"MuiInputBase",slot:"Input",overridesResolver:ap})((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(rp.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(rp.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"})})),up=(0,p.jsx)(Jh,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),cp=e.forwardRef((function(t,n){var i=(0,x.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,w=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,ip),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=Nn();var fe=Yh({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){tp(e)?de&&de():he&&he()}),[de,he]);(0,Gh.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=Xh);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,np,t)}(ge),be=v.Root||sp,we=g.root||{},xe=v.Input||lp;return me=(0,a.Z)({},me,g.input),(0,p.jsxs)(e.Fragment,{children:[!w&&up,(0,p.jsxs)(be,(0,a.Z)({},we,!Wn(be)&&{ownerState:(0,a.Z)({},ge,we.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,we.className,d),children:[Q,(0,p.jsx)(_n.Provider,{value:null,children:(0,p.jsx)(xe,(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,!Wn(xe)&&{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,$h.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 Ep(e){return(0,q.Z)("MuiOutlinedInput",e)}var Zp=(0,U.Z)("MuiOutlinedInput",["root","colorSecondary","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","notchedOutline","input","inputSizeSmall","inputMultiline","inputAdornedStart","inputAdornedEnd"]),Ap=["components","fullWidth","inputComponent","label","multiline","notched","type"],Rp=(0,g.ZP)(sp,{shouldForwardProp:function(e){return(0,g.FO)(e)||"classes"===e},name:"MuiOutlinedInput",slot:"Root",overridesResolver:op})((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(Zp.notchedOutline),{borderColor:n.palette.text.primary}),(0,i.Z)(t,"@media (hover: none)",(0,i.Z)({},"&:hover .".concat(Zp.notchedOutline),{borderColor:o})),(0,i.Z)(t,"&.".concat(Zp.focused," .").concat(Zp.notchedOutline),{borderColor:n.palette[r.color].main,borderWidth:2}),(0,i.Z)(t,"&.".concat(Zp.error," .").concat(Zp.notchedOutline),{borderColor:n.palette.error.main}),(0,i.Z)(t,"&.".concat(Zp.disabled," .").concat(Zp.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"}))})),Dp=(0,g.ZP)((function(e){var t=e.className,n=e.label,r=e.notched,i=(0,o.Z)(e,Mp),s=(0,a.Z)({},e,{notched:r,label:n});return(0,p.jsx)(Pp,(0,a.Z)({"aria-hidden":!0,className:t,ownerState:s},i,{children:(0,p.jsx)(Tp,{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)"}})),jp=(0,g.ZP)(lp,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:ap})((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})})),_p=e.forwardRef((function(t,n){var r,i=(0,x.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,w=void 0===b?"text":b,k=(0,o.Z)(i,Ap),S=function(e){var t=e.classes,n=(0,c.Z)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Ep,t);return(0,a.Z)({},t,n)}(i),O=Yh({props:i,muiFormControl:Nn(),states:["required"]});return(0,p.jsx)(fp,(0,a.Z)({components:(0,a.Z)({Root:Rp,Input:jp},l),renderSuffix:function(t){return(0,p.jsx)(Dp,{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:w},k,{classes:(0,a.Z)({},S,{notchedOutline:null})}))}));_p.muiName="Input";var Np=_p;function Lp(e){return(0,q.Z)("MuiFormLabel",e)}var Ip=(0,U.Z)("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),zp=["children","className","color","component","disabled","error","filled","focused","required"],Bp=(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(Ip.focused),{color:n.palette[r.color].main}),(0,i.Z)(t,"&.".concat(Ip.disabled),{color:n.palette.text.disabled}),(0,i.Z)(t,"&.".concat(Ip.error),{color:n.palette.error.main}),t))})),Fp=(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(Ip.error),{color:t.palette.error.main})})),$p=e.forwardRef((function(e,t){var n=(0,x.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,zp),d=Yh({props:n,muiFormControl:Nn(),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,Lp,t)}(h);return(0,p.jsxs)(Bp,(0,a.Z)({as:l,ownerState:h,className:(0,u.default)(v.root,i),ref:t},f,{children:[r,d.required&&(0,p.jsxs)(Fp,{ownerState:h,"aria-hidden":!0,className:v.asterisk,children:["\u2009","*"]})]}))})),Wp=$p;function Hp(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 Vp=["disableAnimation","margin","shrink","variant"],qp=(0,g.ZP)(Wp,{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(Ip.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)"}))})),Up=e.forwardRef((function(e,t){var n=(0,x.Z)({name:"MuiInputLabel",props:e}),r=n.disableAnimation,i=void 0!==r&&r,s=n.shrink,l=(0,o.Z)(n,Vp),u=Nn(),f=s;"undefined"===typeof f&&u&&(f=u.filled||u.focused||u.adornedStart);var d=Yh({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,Hp,t);return(0,a.Z)({},t,s)}(h);return(0,p.jsx)(qp,(0,a.Z)({"data-shrink":f,ownerState:h,ref:t},l,{classes:v}))})),Qp=Up,Xp=n(7816);function Yp(e){return(0,q.Z)("MuiFormControl",e)}(0,U.Z)("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);var Gp=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Kp=(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%"})})),Jp=e.forwardRef((function(t,n){var i=(0,x.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,w=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,Gp),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,Yp,t)}(N),I=e.useState((function(){var t=!1;return s&&e.Children.forEach(s,(function(e){if((0,Xp.Z)(e,["Input","Select"])){var n=(0,Xp.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,Xp.Z)(e,["Input","Select"])&&tp(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===w||g?Q:w,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)(_n.Provider,{value:K,children:(0,p.jsx)(Kp,(0,a.Z)({as:v,ownerState:N,className:(0,u.default)(L.root,l),ref:n},_,{children:s}))})})),ev=Jp;function tv(e){return(0,q.Z)("MuiFormHelperText",e)}var nv=(0,U.Z)("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),rv=["children","className","component","disabled","error","filled","focused","margin","required","variant"],iv=(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(nv.disabled),{color:n.palette.text.disabled}),(0,i.Z)(t,"&.".concat(nv.error),{color:n.palette.error.main}),t),"small"===r.size&&{marginTop:4},r.contained&&{marginLeft:14,marginRight:14})})),ov=e.forwardRef((function(e,t){var n=(0,x.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,rv),d=Yh({props:n,muiFormControl:Nn(),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,tv,t)}(h);return(0,p.jsx)(iv,(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}))})),av=ov,sv=n(6106);var lv=e.createContext({});function uv(e){return(0,q.Z)("MuiList",e)}(0,U.Z)("MuiList",["root","padding","dense","subheader"]);var cv=["children","className","component","dense","disablePadding","subheader"],fv=(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})})),dv=e.forwardRef((function(t,n){var r=(0,x.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,cv),b=e.useMemo((function(){return{dense:h}}),[h]),w=(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,uv,t)}(w);return(0,p.jsx)(lv.Provider,{value:b,children:(0,p.jsxs)(fv,(0,a.Z)({as:f,className:(0,u.default)(k.root,s),ref:n,ownerState:w},y,{children:[g,i]}))})})),hv=dv;function pv(e){var t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}var vv=pv,mv=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function gv(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function yv(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function bv(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 wv(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")&&bv(s,o)&&!l)return s.focus(),!0;s=i(e,s,n)}return!1}var xv=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,w=(0,o.Z)(t,mv),x=e.useRef(null),k=e.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});(0,Gh.Z)((function(){s&&x.current.focus()}),[s]),e.useImperativeHandle(r,(function(){return{adjustStyleForScrollbar:function(e,t){var n=!x.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&&bv(r,i);i.previousKeyMatched&&(s||wv(t,r,!1,h,gv,i))?e.preventDefault():i.previousKeyMatched=!1}g&&g(e)},tabIndex:s?0:-1},w,{children:C}))})),kv=xv,Sv=n(8706),Ov=n(3533),Cv=n(4246);function Mv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pv(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function Tv(e){return parseInt((0,Wh.Z)(e).getComputedStyle(e).paddingRight,10)||0}function Ev(e,t,n){var r=arguments.length>3&&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)&&Pv(e,i)}))}function Zv(e,t){var n=-1;return e.some((function(e,r){return!!t(e)&&(n=r,!0)})),n}function Av(e,t){var n=[],r=e.container;if(!t.disableScrollLock){if(function(e){var t=(0,h.Z)(e);return t.body===e?(0,Wh.Z)(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(r)){var i=pv((0,h.Z)(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight="".concat(Tv(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(Tv(e)+i,"px")}))}var a=r.parentElement,s=(0,Wh.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 Rv=function(){function e(){Mv(this,e),this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}return Eo(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&&Pv(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);Ev(t,e.mount,e.modalRef,r,!0);var i=Zv(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=Zv(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];r.restore||(r.restore=Av(r,t))}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var n=Zv(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&&Pv(e.modalRef,!0),Ev(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&&Pv(i.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}]),e}(),Dv=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function jv(e){var t=[],n=[];return Array.from(e.querySelectorAll(Dv)).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 _v(){return!0}var Nv=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?jv:u,d=t.isEnabled,v=void 0===d?_v:d,m=t.open,g=e.useRef(),y=e.useRef(null),b=e.useRef(null),w=e.useRef(null),x=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||(w.current&&w.current.focus&&(g.current=!0,w.current.focus()),w.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&&x.current!==t.target||e.activeElement!==x.current)x.current=null;else if(null!==x.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===w.current&&(w.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===w.current&&(w.current=e.relatedTarget),k.current=!0,x.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 Lv(e){return(0,q.Z)("MuiModal",e)}(0,U.Z)("MuiModal",["root","hidden"]);var Iv=["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 zv=new Rv,Bv=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,w=void 0===b?"div":b,x=t.components,k=void 0===x?{}:x,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===$?zv:$,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,Iv),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():Pv(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,Lv,r)}(he);if(!F&&!U&&(!ae||ee))return null;var ve={};void 0===l.props.tabIndex&&(ve.tabIndex="-1"),ae&&(ve.onEnter=(0,Cv.Z)((function(){te(!1),X&&X()}),l.props.onEnter),ve.onExited=(0,Cv.Z)((function(){te(!0),Y&&Y(),y&&de()}),l.props.onExited));var me=k.Root||w,ge=O.root||{};return(0,p.jsx)(ui,{ref:fe,container:C,disablePortal:D,children:(0,p.jsxs)(me,(0,a.Z)({role:"presentation"},ge,!Wn(me)&&{as:w,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)(Nv,{disableEnforceFocus:E,disableAutoFocus:P,disableRestoreFocus:_,isEnabled:ce,open:U,children:e.cloneElement(l,ve)})]}))})})),Fv=Bv;function $v(e){return(0,q.Z)("MuiBackdrop",e)}(0,U.Z)("MuiBackdrop",["root","invisible"]);var Wv=["classes","className","invisible","component","components","componentsProps","theme"],Hv=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,Wv),b=(0,a.Z)({},e,{classes:n,invisible:s}),w=function(e){var t=e.classes,n={root:["root",e.invisible&&"invisible"]};return(0,c.Z)(n,$v,t)}(b),x=h.Root||f,k=m.root||{};return(0,p.jsx)(x,(0,a.Z)({"aria-hidden":!0},k,!Wn(x)&&{as:f,ownerState:(0,a.Z)({},b,k.ownerState),theme:g},{ref:t},y,{className:(0,u.default)(w.root,k.className,r)}))})),Vv=Hv,qv=["children","components","componentsProps","className","invisible","open","transitionDuration","TransitionComponent"],Uv=(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"})})),Qv=e.forwardRef((function(e,t){var n,r=(0,x.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?mn:g,b=(0,o.Z)(r,qv),w=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)(Vv,{className:f,invisible:h,components:(0,a.Z)({Root:Uv},l),componentsProps:{root:(0,a.Z)({},c.root,(!l.Root||!Wn(l.Root))&&{ownerState:(0,a.Z)({},null==(n=c.root)?void 0:n.ownerState)})},classes:w,ref:t,children:i})}))})),Xv=Qv,Yv=["BackdropComponent","closeAfterTransition","children","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted"],Gv=(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"})})),Kv=(0,g.ZP)(Xv,{name:"MuiModal",slot:"Backdrop",overridesResolver:function(e,t){return t.backdrop}})({zIndex:-1}),Jv=e.forwardRef((function(t,n){var i,s=(0,x.Z)({name:"MuiModal",props:t}),l=s.BackdropComponent,u=void 0===l?Kv: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,w=s.disableEnforceFocus,k=void 0!==w&&w,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,Yv),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)(Fv,(0,a.Z)({components:(0,a.Z)({Root:Gv},v),componentsProps:{root:(0,a.Z)({},g.root,(!v.Root||!Wn(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}))})),em=Jv;function tm(e){return(0,q.Z)("MuiPopover",e)}(0,U.Z)("MuiPopover",["root","paper"]);var nm=["onEntering"],rm=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"];function im(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function om(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function am(e){return[e.horizontal,e.vertical].map((function(e){return"number"===typeof e?"".concat(e,"px"):e})).join(" ")}function sm(e){return"function"===typeof e?e():e}var lm=(0,g.ZP)(em,{name:"MuiPopover",slot:"Root",overridesResolver:function(e,t){return t.root}})({}),um=(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}),cm=e.forwardRef((function(t,n){var r=(0,x.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,w=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,nm),N=(0,o.Z)(r,rm),L=e.useRef(),I=(0,z.Z)(L,M.ref),B=(0,a.Z)({},r,{anchorOrigin:f,anchorReference:v,elevation:w,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"]},tm,t)}(B),$=e.useCallback((function(){if("anchorPosition"===v)return d;var e=sm(s),t=(e&&1===e.nodeType?e:(0,sv.Z)(L.current).body).getBoundingClientRect();return{top:t.top+im(t,f.vertical),left:t.left+om(t,f.horizontal)}}),[s,f.horizontal,f.vertical,d,v]),W=e.useCallback((function(e){return{vertical:im(e,T.vertical),horizontal:om(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:am(n)};var r=$(),i=r.top-n.vertical,o=r.left-n.horizontal,a=i+t.height,l=o+t.width,u=(0,Ov.Z)(sm(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:am(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,Sv.Z)((function(){q()})),t=(0,Ov.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,sv.Z)(sm(s)).body:void 0);return(0,p.jsx)(lm,(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)(um,(0,a.Z)({elevation:w},M,{ref:I,className:(0,u.default)(F.paper,M.className),children:m}))}))}))})),fm=cm;function dm(e){return(0,q.Z)("MuiMenu",e)}(0,U.Z)("MuiMenu",["root","paper","list"]);var hm=["onEntering"],pm=["autoFocus","children","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant"],vm={vertical:"top",horizontal:"right"},mm={vertical:"top",horizontal:"left"},gm=(0,g.ZP)(fm,{shouldForwardProp:function(e){return(0,g.FO)(e)||"classes"===e},name:"MuiMenu",slot:"Root",overridesResolver:function(e,t){return t.root}})({}),ym=(0,g.ZP)(J,{name:"MuiMenu",slot:"Paper",overridesResolver:function(e,t){return t.paper}})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),bm=(0,g.ZP)(kv,{name:"MuiMenu",slot:"List",overridesResolver:function(e,t){return t.list}})({outline:0}),wm=e.forwardRef((function(t,n){var r=(0,x.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,hm),Z=(0,o.Z)(r,pm),A=w(),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"]},dm,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)(gm,(0,a.Z)({classes:k,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:R?"right":"left"},transformOrigin:R?vm:mm,PaperProps:(0,a.Z)({component:ym},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)(bm,(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}))}))})),xm=wm;function km(e){return(0,q.Z)("MuiNativeSelect",e)}var Sm=(0,U.Z)("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput"]),Om=["className","disabled","IconComponent","inputRef","variant"],Cm=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(Sm.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}})},Mm=(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(Sm.multiple),t.multiple)]}})(Cm),Pm=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(Sm.disabled),{color:n.palette.action.disabled}),t.open&&{transform:"rotate(180deg)"},"filled"===t.variant&&{right:7},"outlined"===t.variant&&{right:7})},Tm=(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]}})(Pm),Em=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,Om),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,km,t)}(v);return(0,p.jsxs)(e.Fragment,{children:[(0,p.jsx)(Mm,(0,a.Z)({ownerState:v,className:(0,u.default)(m.select,r),disabled:i,ref:l||n},h)),t.multiple?null:(0,p.jsx)(Tm,{as:s,ownerState:v,className:m.icon})]})})),Zm=Em;function Am(e){return(0,q.Z)("MuiSelect",e)}var Rm=(0,U.Z)("MuiSelect",["select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput"]),Dm=["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"],jm=(0,g.ZP)("div",{name:"MuiSelect",slot:"Select",overridesResolver:function(e,t){var n=e.ownerState;return[(0,i.Z)({},"&.".concat(Rm.select),t.select),(0,i.Z)({},"&.".concat(Rm.select),t[n.variant]),(0,i.Z)({},"&.".concat(Rm.multiple),t.multiple)]}})(Cm,(0,i.Z)({},"&.".concat(Rm.select),{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"})),_m=(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]}})(Pm),Nm=(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 Lm(e,t){return"object"===typeof t&&null!==t?e===t:String(e)===String(t)}function Im(e){return null==e||"string"===typeof e&&!e.trim()}var zm,Bm,Fm=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,w=t.labelId,x=t.MenuProps,k=void 0===x?{}:x,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,Dm),$=(0,xi.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,sv.Z)(U.current).getElementById(w);if(e){var t=function(){getSelection().isCollapsed&&U.current.focus()};return e.addEventListener("click",t),function(){e.removeEventListener("click",t)}}}),[w]);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;(tp({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,$h.Z)(2));(n=H.some((function(e){return Lm(e,t.props.value)})))&&me&&ve.push(t.props.children)}else(n=Lm(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)($n,{control:(0,p.jsx)(eu,{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)(Km,{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)(Km,{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)}))})]})},ng=n(9023);function rg(e){return(0,q.Z)("MuiButton",e)}var ig=(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 og=e.createContext({}),ag=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],sg=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}})},lg=(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(ig.focusVisible),(0,a.Z)({},"contained"===r.variant&&{boxShadow:n.shadows[6]})),(0,i.Z)(t,"&.".concat(ig.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(ig.focusVisible),{boxShadow:"none"}),(0,i.Z)(t,"&:active",{boxShadow:"none"}),(0,i.Z)(t,"&.".concat(ig.disabled),{boxShadow:"none"}),t)})),ug=(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},sg(t))})),cg=(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},sg(t))})),fg=e.forwardRef((function(t,n){var r=e.useContext(og),i=(0,ng.Z)(r,t),s=(0,x.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,w=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,ag),N=(0,a.Z)({},s,{color:d,component:v,disabled:y,disableElevation:w,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,rg,s);return(0,a.Z)({},s,u)}(N),I=A&&(0,p.jsx)(ug,{className:L.startIcon,ownerState:N,children:A}),z=C&&(0,p.jsx)(cg,{className:L.endIcon,ownerState:N,children:C});return(0,p.jsxs)(lg,(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]}))})),dg=fg,hg=n(9461),pg=n.n(hg),vg=n(1198),mg=Il({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"}}),gg=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=mg();return(0,p.jsxs)(zt,{display:"flex",px:2,children:[(0,p.jsxs)(dg,{onClick:function(){return o((function(e){return!e}))},variant:"outlined",children:[(0,p.jsx)(Bh.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)(pg(),{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)(nn,{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)(vg.Z,{style:{color:"white"}})})]}),(0,p.jsx)(zt,{className:s.popoverBody,children:(0,p.jsx)(tg,{})})]})})]})},yg=function(t){var n=t.data,i=void 0===n?[]:n,o=bh(),a=xo().time.period,s=yh().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),w=b[0],x=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=Ph(r),o=Mh(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=Lh(i,O);r.push(o),n.push(Ih(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 Gi(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),x(n))}),[i]),(0,e.useEffect)((function(){var e=[],t=[];null===i||void 0===i||i.forEach((function(n){var r=Lh(n,O);t.push(r),e.push(Ih(r,n.group))})),g([{}].concat(t)),x(e)}),[O]),(0,p.jsx)(p.Fragment,{children:i.length>0?(0,p.jsxs)("div",{children:[(0,p.jsx)(gg,{}),(0,p.jsx)(Dh,{data:f,series:m,metrics:i}),(0,p.jsx)(jh,{labels:w,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=zh(n.label,n.group,t),s=i.map((function(e){return"".concat(e.scale,".").concat(e.label)}));return r&&a?(0,me.Z)(s.filter((function(e){return e!==o}))):r&&!a?t.length>=i.length-1?[]:(0,me.Z)(s.filter((function(e){return e!==o}))):a?t.filter((function(e){return e!==o})):[].concat((0,me.Z)(t),[o])}({hideSeries:O,legend:e,metaKey:t,series:m}))}})]}):(0,p.jsx)("div",{style:{textAlign:"center"},children:"No data to show"})})};function bg(e){return(0,q.Z)("MuiTableContainer",e)}(0,U.Z)("MuiTableContainer",["root"]);var wg=["className","component"],xg=(0,g.ZP)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:function(e,t){return t.root}})({width:"100%",overflowX:"auto"}),kg=e.forwardRef((function(e,t){var n=(0,x.Z)({props:e,name:"MuiTableContainer"}),r=n.className,i=n.component,s=void 0===i?"div":i,l=(0,o.Z)(n,wg),f=(0,a.Z)({},n,{component:s}),d=function(e){var t=e.classes;return(0,c.Z)({root:["root"]},bg,t)}(f);return(0,p.jsx)(xg,(0,a.Z)({ref:t,as:s,className:(0,u.default)(d.root,r),ownerState:f},l))})),Sg=kg;var Og=e.createContext();function Cg(e){return(0,q.Z)("MuiTable",e)}(0,U.Z)("MuiTable",["root","stickyHeader"]);var Mg=["className","component","padding","size","stickyHeader"],Pg=(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"})})),Tg="table",Eg=e.forwardRef((function(t,n){var r=(0,x.Z)({props:t,name:"MuiTable"}),i=r.className,s=r.component,l=void 0===s?Tg: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,Mg),b=(0,a.Z)({},r,{component:l,padding:d,size:v,stickyHeader:g}),w=function(e){var t=e.classes,n={root:["root",e.stickyHeader&&"stickyHeader"]};return(0,c.Z)(n,Cg,t)}(b),k=e.useMemo((function(){return{padding:d,size:v,stickyHeader:g}}),[d,v,g]);return(0,p.jsx)(Og.Provider,{value:k,children:(0,p.jsx)(Pg,(0,a.Z)({as:l,role:l===Tg?null:"table",ref:n,className:(0,u.default)(w.root,i),ownerState:b},y))})})),Zg=Eg;var Ag=e.createContext();function Rg(e){return(0,q.Z)("MuiTableHead",e)}(0,U.Z)("MuiTableHead",["root"]);var Dg=["className","component"],jg=(0,g.ZP)("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:function(e,t){return t.root}})({display:"table-header-group"}),_g={variant:"head"},Ng="thead",Lg=e.forwardRef((function(e,t){var n=(0,x.Z)({props:e,name:"MuiTableHead"}),r=n.className,i=n.component,s=void 0===i?Ng:i,l=(0,o.Z)(n,Dg),f=(0,a.Z)({},n,{component:s}),d=function(e){var t=e.classes;return(0,c.Z)({root:["root"]},Rg,t)}(f);return(0,p.jsx)(Ag.Provider,{value:_g,children:(0,p.jsx)(jg,(0,a.Z)({as:s,className:(0,u.default)(d.root,r),ref:t,role:s===Ng?null:"rowgroup",ownerState:f},l))})})),Ig=Lg;function zg(e){return(0,q.Z)("MuiTableRow",e)}var Bg=(0,U.Z)("MuiTableRow",["root","selected","hover","head","footer"]),Fg=["className","component","hover","selected"],$g=(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(Bg.hover,":hover"),{backgroundColor:n.palette.action.hover}),(0,i.Z)(t,"&.".concat(Bg.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})),Wg=e.forwardRef((function(t,n){var r=(0,x.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,Fg),g=e.useContext(Ag),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,zg,t)}(y);return(0,p.jsx)($g,(0,a.Z)({as:l,ref:n,className:(0,u.default)(b.root,i),role:"tr"===l?null:"row",ownerState:y},m))})),Hg=Wg;function Vg(e){return(0,q.Z)("MuiTableCell",e)}var qg=(0,U.Z)("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Ug=["align","className","component","padding","scope","size","sortDirection","variant"],Qg=(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(qg.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})})),Xg=e.forwardRef((function(t,n){var r,i=(0,x.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,Ug),w=e.useContext(Og),k=e.useContext(Ag),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||(w&&w.padding?w.padding:"normal"),size:m||(w&&w.size?w.size:"medium"),sortDirection:g,stickyHeader:"head"===M&&w&&w.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,Vg,t)}(P),E=null;return g&&(E="asc"===g?"ascending":"descending"),(0,p.jsx)(Qg,(0,a.Z)({as:r,ref:n,className:(0,u.default)(T.root,f),"aria-sort":E,scope:C,ownerState:P},b))})),Yg=Xg;function Gg(e){return(0,q.Z)("MuiTableBody",e)}(0,U.Z)("MuiTableBody",["root"]);var Kg=["className","component"],Jg=(0,g.ZP)("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:function(e,t){return t.root}})({display:"table-row-group"}),ey={variant:"body"},ty="tbody",ny=e.forwardRef((function(e,t){var n=(0,x.Z)({props:e,name:"MuiTableBody"}),r=n.className,i=n.component,s=void 0===i?ty:i,l=(0,o.Z)(n,Kg),f=(0,a.Z)({},n,{component:s}),d=function(e){var t=e.classes;return(0,c.Z)({root:["root"]},Gg,t)}(f);return(0,p.jsx)(Ag.Provider,{value:ey,children:(0,p.jsx)(Jg,(0,a.Z)({className:(0,u.default)(d.root,r),as:s,ref:t,role:s===ty?null:"rowgroup",ownerState:f},l))})})),ry=ny,iy=Il({deemphasized:{opacity:.4}}),oy=function(t){var n=t.data,r=iy(),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)(Sg,{component:J,children:(0,p.jsxs)(Zg,{"aria-label":"simple table",children:[(0,p.jsx)(Ig,{children:(0,p.jsxs)(Hg,{children:[i.map((function(e,t){return(0,p.jsx)(Yg,{style:{textTransform:"capitalize"},children:e.key},t)})),(0,p.jsx)(Yg,{align:"right",children:"Value"})]})}),(0,p.jsx)(ry,{children:o.map((function(e,t){return(0,p.jsxs)(Hg,{children:[e.metadata.map((function(e,n){var i=o[t-1]&&o[t-1].metadata[n];return(0,p.jsx)(Yg,{className:i===e?r.deemphasized:void 0,children:e},n)})),(0,p.jsx)(Yg,{align:"right",children:e.value})]},t)}))})]})}):(0,p.jsx)("div",{style:{textAlign:"center"},children:"No data to show"})})},ay=n(3878),sy=n(9199),ly=n(181),uy=n(5267);function cy(e){return(0,q.Z)("MuiCollapse",e)}(0,U.Z)("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);var fy=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],dy=(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"})})),hy=(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%"})})),py=(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%"})})),vy=e.forwardRef((function(t,n){var r=(0,x.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,fy),_=(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,cy,n)}(_),B=w(),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)(dy,(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)(hy,{ownerState:(0,a.Z)({},_,{state:e}),className:L.wrapper,ref:$,children:(0,p.jsx)(py,{ownerState:(0,a.Z)({},_,{state:e}),className:L.wrapperInner,children:l})})}))}}))}));vy.muiSupportAuto=!0;var my=vy;var gy=e.createContext({});function yy(e){return(0,q.Z)("MuiAccordion",e)}var by=(0,U.Z)("MuiAccordion",["root","rounded","expanded","disabled","gutters","region"]),wy=["children","className","defaultExpanded","disabled","disableGutters","expanded","onChange","square","TransitionComponent","TransitionProps"],xy=(0,g.ZP)(J,{name:"MuiAccordion",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[(0,i.Z)({},"& .".concat(by.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(by.expanded),{"&:before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&:before":{display:"none"}}}),(0,i.Z)(t,"&.".concat(by.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(by.expanded),{margin:"16px 0"}))})),ky=e.forwardRef((function(t,n){var i,s=(0,x.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,w=s.onChange,k=s.square,S=void 0!==k&&k,O=s.TransitionComponent,C=void 0===O?my:O,M=s.TransitionProps,P=(0,o.Z)(s,wy),T=(0,xi.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),w&&w(e,!Z)}),[Z,w,A]),D=e.Children.toArray(l),j=(i=D,(0,ay.Z)(i)||(0,sy.Z)(i)||(0,ly.Z)(i)||(0,uy.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,yy,t)}(I);return(0,p.jsxs)(xy,(0,a.Z)({className:(0,u.default)(z.root,f),ref:n,ownerState:I,square:S},P,{children:[(0,p.jsx)(gy.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})}))]}))})),Sy=ky;function Oy(e){return(0,q.Z)("MuiAccordionSummary",e)}var Cy=(0,U.Z)("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),My=["children","className","expandIcon","focusVisibleClassName","onClick"],Py=(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(Cy.focusVisible),{backgroundColor:n.palette.action.focus}),(0,i.Z)(t,"&.".concat(Cy.disabled),{opacity:n.palette.action.disabledOpacity}),(0,i.Z)(t,"&:hover:not(.".concat(Cy.disabled,")"),{cursor:"pointer"}),t),!r.disableGutters&&(0,i.Z)({},"&.".concat(Cy.expanded),{minHeight:64}))})),Ty=(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(Cy.expanded),{margin:"20px 0"}))})),Ey=(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(Cy.expanded),{transform:"rotate(180deg)"})})),Zy=e.forwardRef((function(t,n){var r=(0,x.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,My),v=e.useContext(gy),m=v.disabled,g=void 0!==m&&m,y=v.disableGutters,b=v.expanded,w=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,Oy,t)}(k);return(0,p.jsxs)(Py,(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){w&&w(e),d&&d(e)},ref:n,ownerState:k},h,{children:[(0,p.jsx)(Ty,{className:S.content,ownerState:k,children:i}),l&&(0,p.jsx)(Ey,{className:S.expandIconWrapper,ownerState:k,children:l})]}))})),Ay=Zy;function Ry(e){return(0,q.Z)("MuiAccordionDetails",e)}(0,U.Z)("MuiAccordionDetails",["root"]);var Dy=["className"],jy=(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)}})),_y=e.forwardRef((function(e,t){var n=(0,x.Z)({props:e,name:"MuiAccordionDetails"}),r=n.className,i=(0,o.Z)(n,Dy),s=n,l=function(e){var t=e.classes;return(0,c.Z)({root:["root"]},Ry,t)}(s);return(0,p.jsx)(jy,(0,a.Z)({className:(0,u.default)(l.root,r),ref:t,ownerState:s},i))})),Ny=_y,Ly=n(4929);var Iy=e.createContext();function zy(e){return(0,q.Z)("MuiGrid",e)}var By=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],Fy=(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)(By.map((function(e){return"grid-xs-".concat(e)}))),(0,me.Z)(By.map((function(e){return"grid-sm-".concat(e)}))),(0,me.Z)(By.map((function(e){return"grid-md-".concat(e)}))),(0,me.Z)(By.map((function(e){return"grid-lg-".concat(e)}))),(0,me.Z)(By.map((function(e){return"grid-xl-".concat(e)}))))),$y=["className","columns","columnSpacing","component","container","direction","item","lg","md","rowSpacing","sm","spacing","wrap","xl","xs","zeroMinWidth"];function Wy(e){var t=parseFloat(e);return"".concat(t).concat(String(e).replace(String(t),"")||"px")}function Hy(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 Vy=(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)(Hy(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,Ly.P$)({values:n.direction,breakpoints:t.breakpoints.values});return(0,Ly.k9)({theme:t},r,(function(e){var t={flexDirection:e};return 0===e.indexOf("column")&&(t["& > .".concat(Fy.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,Ly.P$)({values:o,breakpoints:t.breakpoints.values});a=(0,Ly.k9)({theme:t},s,(function(e){var n=t.spacing(e);return"0px"!==n?(0,i.Z)({marginTop:"-".concat(Wy(n))},"& > .".concat(Fy.item),{paddingTop:Wy(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,Ly.P$)({values:o,breakpoints:t.breakpoints.values});a=(0,Ly.k9)({theme:t},s,(function(e){var n=t.spacing(e);return"0px"!==n?(0,i.Z)({width:"calc(100% + ".concat(Wy(n),")"),marginLeft:"-".concat(Wy(n))},"& > .".concat(Fy.item),{paddingLeft:Wy(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,Ly.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(Wy(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}),{})})),qy=e.forwardRef((function(t,n){var r,i=jt((0,x.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,w=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,$y),B=M||Z,F=f||Z,$=e.useContext(Iy),W=l||$||12,H=(0,a.Z)({},i,{columns:W,container:m,direction:y,item:w,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)(Hy(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,zy,t)}(H);return r=(0,p.jsx)(Vy,(0,a.Z)({ownerState:H,className:(0,u.default)(V.root,s),as:h,ref:n},z)),12!==W?(0,p.jsx)(Iy.Provider,{value:W,children:r}):r})),Uy=qy;function Qy(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=(0,ly.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 Xy(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 Yy(e){return Yy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Yy(e)}function Gy(e){return Gy="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},Gy(e)}function Ky(e,t){if(t&&("object"===Gy(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 Jy(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=Yy(e);if(t){var i=Yy(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ky(this,n)}}function eb(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Yy(e)););return e}function tb(){return tb="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=eb(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},tb.apply(this,arguments)}for(var nb="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})),rb=1;rbe)return nb[t-1]<=e;return!1}function ob(e){return e>=127462&&e<=127487}function ab(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(n?sb:lb)(e,t)}function sb(e,t){if(t==e.length)return t;t&&ub(e.charCodeAt(t))&&cb(e.charCodeAt(t-1))&&t--;var n=fb(e,t);for(t+=hb(n);t=0&&ob(fb(e,o));)i++,o-=2;if(i%2==0)break;t+=2}}return t}function lb(e,t){for(;t>0;){var n=sb(e,t-2);if(n=56320&&e<57344}function cb(e){return e>=55296&&e<56320}function fb(e,t){var n=e.charCodeAt(t);if(!cb(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return ub(r)?r-56320+(n-55296<<10)+65536:n}function db(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function hb(e){return e<65536?1:2}function pb(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=ab(e,i)}return!0===r?-1:e.length}var mb=function(){function e(){Mv(this,e)}return Eo(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),yb.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),yb.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 kb(this),i=new kb(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 kb(this,e)}},{key:"iterRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new Sb(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 Ob(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 gb(t):yb.from(gb.split(t,[])):e.empty}}]),e}(),gb=function(e){Xy(n,e);var t=Jy(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bb(e);return Mv(this,n),(r=t.call(this)).text=e,r.length=i,r}return Eo(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 Cb(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(xb(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){var a=r.pop(),s=wb(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 tb(Yy(n.prototype),"replace",this).call(this,e,t,r);var i=wb(this.text,wb(r.text,xb(this.text,0,e)),t),o=this.length+r.length-(t-e);return i.length<=32?new n(i,o):yb.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=Qy(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=Qy(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}(mb),yb=function(e){Xy(n,e);var t=Jy(n);function n(e,r){var i;Mv(this,n),(i=t.call(this)).children=e,i.length=r,i.lines=0;var o,a=Qy(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 Eo(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 tb(Yy(n.prototype),"replace",this).call(this,o,s,l)}o=s+1}return tb(Yy(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=Qy(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=Qy(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=Qy(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 gb(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=Qy(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 gb&&v&&(t=g[g.length-1])instanceof gb&&e.lines+t.lines<=32?(v+=e.lines,m+=e.length+1,g[g.length-1]=new gb(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 w,x=Qy(e);try{for(x.s();!(w=x.n()).done;){var k=w.value;y(k)}}catch(S){x.e(S)}finally{x.f()}return b(),1==p.length?p[0]:new n(p,r)}}]),n}(mb);function bb(e){var t,n=-1,r=Qy(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 wb(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;Mv(this,e),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof gb?t.text.length:t.children.length)<<1]}return Eo(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 gb?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 gb){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 gb?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}(),Sb=function(){function e(t,n,r){Mv(this,e),this.value="",this.done=!1,this.cursor=new kb(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 Eo(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}(),Ob=function(){function e(t){Mv(this,e),this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}return Eo(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&&(mb.prototype[Symbol.iterator]=function(){return this.iter()},kb.prototype[Symbol.iterator]=Sb.prototype[Symbol.iterator]=Ob.prototype[Symbol.iterator]=function(){return this});var Cb=function(){function e(t,n,r,i){Mv(this,e),this.from=t,this.to=n,this.number=r,this.text=i}return Eo(e,[{key:"length",get:function(){return this.to-this.from}}]),e}(),Mb=/\r\n?|\n/,Pb=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(Pb||(Pb={})),Tb=function(){function e(t){Mv(this,e),this.sections=t}return Eo(e,[{key:"length",get:function(){for(var e=0,t=0;t1&&void 0!==arguments[1]&&arguments[1];Rb(this,e,t)}},{key:"invertedDesc",get:function(){for(var t=[],n=0;n1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:Db(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]:Pb.Simple,r=0,i=0,o=0;oe)return i+(e-r);i+=a}else{if(n!=Pb.Simple&&l>=e&&(n==Pb.TrackDel&&re||n==Pb.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}(),Eb=function(e){Xy(n,e);var t=Jy(n);function n(e,r){var i;return Mv(this,n),(i=t.call(this,e)).inserted=r,i}return Eo(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 Rb(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 Db(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:Db(this,e,t,!0)}},{key:"iterChanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Rb(this,e,t)}},{key:"desc",get:function(){return new Tb(this.sections)}},{key:"filter",value:function(e){var t=[],r=[],i=[],o=new _b(this);e:for(var a=0,s=0;;){for(var l=a==e.length?1e9:e[a++];s0&&Ab(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?mb.of(v.split(r||Mb)):v:mb.empty,g=m.length;if(d==p&&0==g)return;da&&Zb(i,d-a,-1),Zb(i,p-d,g),Ab(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 Ab(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 Db(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=r?[]:null,a=new _b(e),s=new _b(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 Eb(i,o):new Tb(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 _b(e),a=new _b(t),s=!1;;){if(o.done&&a.done)return i?new Eb(r,i):new Tb(r);if(0==o.ins)Zb(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;Zb(r,l,c,s),i&&c&&Ab(i,r,a.text)}else-1==a.ins?(Zb(r,o.off?0:o.len,l,s),i&&Ab(i,r,o.textBit(l))):(Zb(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&Ab(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 Zb(r,0,a.ins,s),i&&Ab(i,r,a.text),a.next()}}var _b=function(){function e(t){Mv(this,e),this.set=t,this.i=0,this.next()}return Eo(e,[{key:"next",value:function(){var e=this.set.sections;this.i>1;return t>=e.length?mb.empty:e[t]}},{key:"textBit",value:function(e){var t=this.set.inserted,n=this.i-2>>1;return n>=t.length&&!e?mb.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}(),Nb=function(){function e(t,n,r){Mv(this,e),this.from=t,this.to=n,this.flags=r}return Eo(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 Lb.range(e,t);var n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Lb.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 Lb.range(e.anchor,e.head)}}]),e}(),Lb=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Mv(this,e),this.ranges=t,this.mainIndex=n}return Eo(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 Nb.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 Nb(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?Lb.range(s,a):Lb.range(a,s))}}return new Lb(e,t)}function zb(e,t){var n,r=Qy(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 Bb=0,Fb=function(){function e(t,n,r,i,o){Mv(this,e),this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.extensions=o,this.id=Bb++,this.default=t([])}return Eo(e,[{key:"of",value:function(e){return new Wb([],this,0,e)}},{key:"compute",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Wb(e,this,1,t)}},{key:"computeN",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Wb(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}:$b),!!t.static,t.enables)}}]),e}();function $b(e,t){return e==t||e.length==t.length&&e.every((function(e,n){return e===t[n]}))}var Wb=function(){function e(t,n,r,i){Mv(this,e),this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=Bb++}return Eo(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=Qy(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===rw)return e.values[o]=r(e),1;if(t&&(s&&t.docChanged||l&&(t.docChanged||t.selection)||u.some((function(t){return(1&iw(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===rw)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,Hb.of({field:this,create:e})]}},{key:"extension",get:function(){return this}}],[{key:"define",value:function(t){var n=new e(Bb++,t.create,t.update,t.compare||function(e,t){return e===t},t);return t.provide&&(n.provides=t.provide(n)),n}}]),e}(),qb=4,Ub=3,Qb=2,Xb=1,Yb=0;function Gb(e){return function(t){return new Jb(t,e)}}var Kb={lowest:Gb(qb),low:Gb(Ub),default:Gb(Qb),high:Gb(Xb),highest:Gb(Yb),fallback:Gb(qb),extend:Gb(Xb),override:Gb(Yb)},Jb=Eo((function e(t,n){Mv(this,e),this.inner=t,this.prec=n})),ew=function(){function e(){Mv(this,e)}return Eo(e,[{key:"of",value:function(e){return new tw(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}(),tw=Eo((function e(t,n){Mv(this,e),this.compartment=t,this.inner=n})),nw=function(){function e(t,n,r,i,o){for(Mv(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=Qy(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 tw&&n.delete(e.compartment)}if(i.set(e,a),Array.isArray(e)){var u,c=Qy(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 tw){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 Jb)o(e.inner,e.prec);else if(e instanceof Vb)r[a].push(e),e.provides&&o(e.provides,a);else if(e instanceof Wb)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,Qb),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 Vb?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===rw||!n,c=Qy(o);try{for(c.s();!(s=c.n()).done;)1&iw(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&&ow(r,o)==f[i>>1]};for(var x in c){var k=c[x],S=r.config.address[x];null!=S&&0==(1&k)&&w(+x,0)&&(b[k>>1]=ow(r,S))}}return{configuration:new e(t,s,d.map((function(e){return e(c)})),c,f),values:b}}}]),e}();var rw={};function iw(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 ow(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}var aw=Fb.define(),sw=Fb.define({combine:function(e){return e.some((function(e){return e}))},static:!0}),lw=Fb.define({combine:function(e){return e.length?e[0]:void 0},static:!0}),uw=Fb.define(),cw=Fb.define(),fw=Fb.define(),dw=Fb.define({combine:function(e){return!!e.length&&e[0]}}),hw=function(){function e(t,n){Mv(this,e),this.type=t,this.value=n}return Eo(e,null,[{key:"define",value:function(){return new pw}}]),e}(),pw=function(){function e(){Mv(this,e)}return Eo(e,[{key:"of",value:function(e){return new hw(this,e)}}]),e}(),vw=function(){function e(t){Mv(this,e),this.map=t}return Eo(e,[{key:"of",value:function(e){return new mw(this,e)}}]),e}(),mw=function(){function e(t,n){Mv(this,e),this.type=t,this.value=n}return Eo(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 vw(e.map||function(e){return e})}},{key:"mapEffects",value:function(e,t){if(!e.length)return e;var n,r=[],i=Qy(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}();mw.reconfigure=mw.define(),mw.appendConfig=mw.define();var gw=function(){function e(t,n,r,i,o,a){Mv(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&&zb(r,n.newLength),o.some((function(t){return t.type==e.time}))||(this.annotations=o.concat(e.time.of(Date.now())))}return Eo(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=Qy(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 yw(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=bw(e,ww(t,o,e.changes.newLength),!0))}return r==e?e:new gw(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(e){var t,n=e.startState,r=!0,i=Qy(n.facet(uw));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:yw(r,o))}}catch(d){i.e(d)}finally{i.f()}if(!0!==r){var a,s;if(!1===r)s=e.changes.invertedDesc,a=Eb.empty(n.doc.length);else{var l=e.changes.filter(r);a=l.changes,s=l.filtered.invertedDesc}e=new gw(n,a,e.selection&&e.selection.map(s),mw.mapEffects(e.effects,s),e.annotations,e.scrollIntoView)}for(var u=n.facet(cw),c=u.length-1;c>=0;c--){var f=u[c](e);e=f instanceof gw?f:Array.isArray(f)&&1==f.length&&f[0]instanceof gw?f[0]:xw(n,Sw(f),!1)}return e}(a):a)}gw.time=hw.define(),gw.userEvent=hw.define(),gw.addToHistory=hw.define(),gw.remote=hw.define();var kw=[];function Sw(e){return null==e?kw:Array.isArray(e)?e:[e]}var Ow,Cw=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Cw||(Cw={})),Mw=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{Ow=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(nF){}function Pw(e){return function(t){if(!/\S/.test(t))return Cw.Space;if(function(e){if(Ow)return Ow.test(e);for(var t=0;t"\x80"&&(n.toUpperCase()!=n.toLowerCase()||Mw.test(n)))return!0}return!1}(t))return Cw.Word;for(var n=0;n-1)return Cw.Word;return Cw.Other}}var Tw=function(){function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;Mv(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 iw(this,n),ow(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 Eb?t:Eb.of(t,this.doc.length,this.facet(e.lineSeparator))}},{key:"toText",value:function(t){return mb.of(t.split(this.facet(e.lineSeparator)||Mb))}},{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:(iw(this,t),ow(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 Vb&&(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(dw)}},{key:"phrase",value:function(t){var n,r=Qy(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=Qy(this.facet(aw));try{for(o.s();!(n=o.n()).done;){var a,s=n.value,l=Qy(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 Pw(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=ab(n,a,!1);if(o(n.slice(l,a))!=Cw.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:Lb.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=nw.resolve(t.extensions||[],new Map),r=n.configuration,i=n.values,o=t.doc instanceof mb?t.doc:mb.of((t.doc||"").split(r.staticFacet(e.lineSeparator)||Mb)),a=t.selection?t.selection instanceof Lb?t.selection:Lb.single(t.selection.anchor,t.selection.head):Lb.single(0);return zb(a,o.length),r.staticFacet(sw)||(a=a.asSingle()),new e(r,o,a,i)}}]),e}();function Ew(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={},o=Qy(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 Lw(e,t,this)}}]),e}();Nw.prototype.startSide=Nw.prototype.endSide=0,Nw.prototype.point=!1,Nw.prototype.mapMode=Pb.TrackDel;var Lw=Eo((function e(t,n,r){Mv(this,e),this.from=t,this.to=n,this.value=r}));function Iw(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var zw=function(){function e(t,n,r,i){Mv(this,e),this.from=t,this.to=n,this.value=r,this.maxPoint=i}return Eo(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}(),Bw=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;Mv(this,e),this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}return Eo(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=Qy(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(Iw),this.isEmpty)return r.length?e.of(r):this;for(var f=new Hw(this,null,-1).goto(0),d=0,h=[],p=new $w;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 Vw.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 Vw.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=Ww(o,a,n),l=new Uw(o,s,i),u=new Uw(a,s,i);n.iterGaps((function(e,t,n){return Qw(l,e,u,t,n,r)})),n.empty&&0==n.length&&Qw(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=Ww(i,o),s=new Uw(i,a,0).goto(n),l=new Uw(o,a,0).goto(n);;){if(s.to!=l.to||!Xw(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 Uw(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 $w,i=Qy(e instanceof Lw?[e]:n?Fw(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 Fw(e){if(e.length>1)for(var t=e[0],n=1;n0)return e.slice().sort(Iw);t=r}return e}Bw.empty=new Bw([],[],null,-1),Bw.empty.nextLayer=Bw.empty;var $w=function(){function e(){Mv(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 Eo(e,[{key:"finishChunk",value:function(e){this.chunks.push(new zw(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(Bw.empty)}},{key:"finishInner",value:function(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;var t=new Bw(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}]),e}();function Ww(e,t,n){var r,i=new Map,o=Qy(e);try{for(o.s();!(r=o.n()).done;)for(var a=r.value,s=0;s3&&void 0!==arguments[3]?arguments[3]:0;Mv(this,e),this.layer=t,this.skip=n,this.minPoint=r,this.rank=i}return Eo(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=Qy(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--)qw(this.heap,o);return this.next(),this}},{key:"forward",value:function(e,t){var n,r=Qy(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--)qw(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(),qw(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 Hw(a,n,r,o));return 1==i.length?i[0]:new e(i)}}]),e}();function qw(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 Uw=function(){function e(t,n,r){Mv(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=Vw.from(t,n,r)}return Eo(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){Yw(this.active,e),Yw(this.activeTo,e),Yw(this.activeRank,e),this.minActive=Kw(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&&Yw(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 Qw(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))&&Xw(e.activeForPoint(e.to+l),n.activeForPoint(n.to))||o.comparePoint(s,f,e.point,n.point):f>s&&!Xw(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 Xw(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 Kw(e,t){for(var n=-1,r=1e9,i=0;i",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},tx="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),nx="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),rx="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),ix="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),ox="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ax=tx&&(ix||+tx[1]<57)||rx&&ix,sx=0;sx<10;sx++)Jw[48+sx]=Jw[96+sx]=String(sx);for(sx=1;sx<=24;sx++)Jw[sx+111]="F"+sx;for(sx=65;sx<=90;sx++)Jw[sx]=String.fromCharCode(sx+32),ex[sx]=String.fromCharCode(sx);for(var lx in Jw)ex.hasOwnProperty(lx)||(ex[lx]=Jw[lx]);function ux(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function cx(e,t){return!!t&&e.contains(1!=t.nodeType?t.parentNode:t)}function fx(e,t){if(!t.anchorNode)return!1;try{return cx(e,t.anchorNode)}catch(nF){return!1}}function dx(e){return 3==e.nodeType?Ox(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function hx(e,t,n,r){return!!n&&(vx(e,t,n,r,-1)||vx(e,t,n,r,1))}function px(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function vx(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:mx(e))){if("DIV"==e.nodeName)return!1;var o=e.parentNode;if(!o||1!=o.nodeType)return!1;t=px(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?mx(e):0}}}function mx(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}var gx={left:0,right:0,top:0,bottom:0};function yx(e,t){var n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function bx(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}var wx,xx=function(){function e(){Mv(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return Eo(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}(),kx=null;function Sx(e){if(e.setActive)return e.setActive();if(kx)return e.focus(kx);for(var t=[],n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==kx?{get preventScroll(){return kx={preventScroll:!0},!0}}:void 0),!kx){kx=!1;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:t,r=wx||(wx=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function Cx(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 Mx(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function Px(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}var Tx=function(){function e(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Mv(this,e),this.node=t,this.offset=n,this.precise=r}return Eo(e,null,[{key:"before",value:function(t,n){return new e(t.parentNode,px(t),n)}},{key:"after",value:function(t,n){return new e(t.parentNode,px(t)+1,n)}}]),e}(),Ex=[],Zx=function(){function e(){Mv(this,e),this.parent=null,this.dom=null,this.dirty=2}return Eo(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=Qy(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=Qy(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=Ax(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=Ax(i)}else if(1&this.dirty){var l,u=Qy(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==mx(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]:Ex;this.markDirty();for(var i=e;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new Rx(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 Ax(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}Zx.prototype.breakAfter=0;var Rx=function(){function e(t,n,r){Mv(this,e),this.children=t,this.pos=n,this.i=r,this.off=0}return Eo(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 Dx(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),Qx={mac:Ux||/Mac/.test(Lx.platform),windows:/Win/.test(Lx.platform),linux:/Linux|X11/.test(Lx.platform),ie:$x,ie_version:Bx?Ix.documentMode||6:Fx?+Fx[1]:zx?+zx[1]:0,gecko:Wx,gecko_version:Wx?+(/Firefox\/(\d+)/.exec(Lx.userAgent)||[0,0])[1]:0,chrome:!!Hx,chrome_version:Hx?+Hx[1]:0,ios:Ux,android:/Android\b/.test(Lx.userAgent),webkit:Vx,safari:qx,webkit_version:Vx?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=Ix.documentElement.style.tabSize?"tab-size":"-moz-tab-size"},Xx=function(e){Xy(n,e);var t=Jy(n);function n(e){var r;return Mv(this,n),(r=t.call(this)).text=e,r}return Eo(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 Tx(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 Gx(this.dom,e,t)}}]),n}(Zx),Yx=function(e){Xy(n,e);var t=Jy(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;Mv(this,n),(r=t.call(this)).mark=e,r.children=i,r.length=o;var a,s=Qy(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 Eo(n,[{key:"setAttrs",value:function(e){if(Px(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))),tb(Yy(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 nk(this.dom,this.children,e)}},{key:"coordsAt",value:function(e,t){return ik(this,e,t)}}]),n}(Zx);function Gx(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?Qx.chrome||Qx.gecko||(t?(i--,a=1):(o++,a=-1)):n<0?i--:o++;var s=Ox(e,i,o).getClientRects();if(!s.length)return gx;var l=s[(a?a<0:n>=0)?0:s.length-1];return Qx.safari&&!a&&0==l.width&&(l=Array.prototype.find.call(s,(function(e){return e.width}))||l),a?yx(l,a<0):l||null}var Kx=function(e){Xy(n,e);var t=Jy(n);function n(e,r,i){var o;return Mv(this,n),(o=t.call(this)).widget=e,o.length=r,o.side=i,o}return Eo(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:yx(r,0==e)}},{key:"isEditable",get:function(){return!1}},{key:"destroy",value:function(){tb(Yy(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}(Zx),Jx=function(e){Xy(n,e);var t=Jy(n);function n(){return Mv(this,n),t.apply(this,arguments)}return Eo(n,[{key:"domAtPos",value:function(e){return new Tx(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 Gx(this.widget.text,e,t)}},{key:"isEditable",get:function(){return!0}}]),n}(Kx),ek=Qx.android?"\u200b\u200b":"\u200b",tk=function(e){Xy(n,e);var t=Jy(n);function n(e){var r;return Mv(this,n),(r=t.call(this)).side=e,r}return Eo(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!=ek&&(this.dom.nodeValue=ek):this.setDOM(document.createTextNode(ek))}},{key:"getSide",value:function(){return this.side}},{key:"domAtPos",value:function(e){return Tx.before(this.dom)}},{key:"localPosFromDOM",value:function(){return 0}},{key:"domBoundsAround",value:function(){return null}},{key:"coordsAt",value:function(e){var t=dx(this.dom);return t[t.length-1]||null}},{key:"overrideDOMText",get:function(){return mb.of([this.dom.nodeValue.replace(/\u200b/g,"")])}}]),n}(Zx);function nk(e,t,n){for(var r=0,i=0;ri&&n0;r--){var s=t[r-1].dom;if(s.parentNode==e)return Tx.after(s)}return new Tx(e,0)}function rk(e,t,n){var r,i=e.children;n>0&&t instanceof Yx&&i.length&&(r=i[i.length-1])instanceof Yx&&r.mark.eq(t.mark)?rk(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function ik(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?yx(u,n<0):u}r=a}var c=e.dom.lastChild;if(!c)return e.dom.getBoundingClientRect();var f=dx(c);return f[f.length-1]||null}function ok(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 ak(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 fk(e)}},{key:"widget",value:function(e){var t=e.side||0,n=!!e.block;return new hk(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=pk(e,t),r=n.start,i=n.end;return new hk(e,t?r?-3e8:-1:4e8,t?i?2e8:1:-5e8,t,e.widget||null,!0)}},{key:"line",value:function(e){return new dk(e)}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Bw.of(e,t)}}]),n}(Nw);ck.none=Bw.empty;var fk=function(e){Xy(n,e);var t=Jy(n);function n(e){var r;Mv(this,n);var i=pk(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 Eo(n,[{key:"eq",value:function(e){return this==e||e instanceof n&&this.tagName==e.tagName&&this.class==e.class&&ak(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 tb(Yy(n.prototype),"range",this).call(this,e,t)}}]),n}(ck);fk.prototype.point=!1;var dk=function(e){Xy(n,e);var t=Jy(n);function n(e){return Mv(this,n),t.call(this,-2e8,-2e8,null,e)}return Eo(n,[{key:"eq",value:function(e){return e instanceof n&&ak(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 tb(Yy(n.prototype),"range",this).call(this,e,t)}}]),n}(ck);dk.prototype.mapMode=Pb.TrackBefore,dk.prototype.point=!0;var hk=function(e){Xy(n,e);var t=Jy(n);function n(e,r,i,o,a,s){var l;return Mv(this,n),(l=t.call(this,r,i,a,e)).block=o,l.isReplace=s,l.mapMode=o?r<=0?Pb.TrackBefore:Pb.TrackAfter:Pb.TrackDel,l}return Eo(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 tb(Yy(n.prototype),"range",this).call(this,e,t)}}]),n}(ck);function pk(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 vk(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)}hk.prototype.point=!0;var mk=function(e){Xy(n,e);var t=Jy(n);function n(){var e;return Mv(this,n),(e=t.apply(this,arguments)).children=[],e.length=0,e.prevAttrs=void 0,e.attrs=null,e.breakAfter=0,e}return Eo(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),jx(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){ak(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}},{key:"append",value:function(e,t){rk(this,e,t)}},{key:"addLineDeco",value:function(e){var t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=ok(t,this.attrs||{})),n&&(this.attrs=ok(t,{class:n}))}},{key:"domAtPos",value:function(e){return nk(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&&(Px(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&&(sk(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),tb(Yy(n.prototype),"sync",this).call(this,e);for(var r=this.dom.lastChild;r&&Zx.get(r)instanceof Yx;)r=r.lastChild;if(!r||"BR"!=r.nodeName&&0==(null===(t=Zx.get(r))||void 0===t?void 0:t.isEditable)&&(!Qx.ios||!this.children.some((function(e){return e instanceof Xx})))){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=Qy(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(!(r instanceof Xx))return null;var i=dx(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 ik(this,e,t)}},{key:"become",value:function(e){return!1}},{key:"type",get:function(){return uk.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}(Zx),gk=function(e){Xy(n,e);var t=Jy(n);function n(e,r,i){var o;return Mv(this,n),(o=t.call(this)).widget=e,o.length=r,o.type=i,o.breakAfter=0,o}return Eo(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(bk(new Xx(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 hk)if(n.block){var a=n.type;a!=uk.WidgetAfter||this.posCovered()||this.getLine(),this.addBlockWidget(new gk(n.widget||new wk("div"),o,a))}else{var s=Kx.create(n.widget||new wk("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;Mv(this,e),this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o}return Eo(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}(),Ak=mw.define({map:function(e,t){return e.map(t)}});function Rk(e,t,n){var r=e.facet(Ck);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 Dk=Fb.define({combine:function(e){return!e.length||e[0]}}),jk=Eo((function e(t,n){Mv(this,e),this.field=t,this.get=n})),_k=function(){function e(){Mv(this,e)}return Eo(e,[{key:"from",value:function(e){return new jk(this,e)}}],[{key:"define",value:function(){return new e}}]),e}();_k.decorations=_k.define(),_k.atomicRanges=_k.define(),_k.scrollMargins=_k.define();var Nk=0,Lk=Fb.define(),Ik=function(){function e(t,n,r){Mv(this,e),this.id=t,this.create=n,this.fields=r,this.extension=Lk.of(this)}return Eo(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=Qy(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(zk.from((function(e){return{plugin:e,handlers:i}}))),a&&s.push(_k.decorations.from(a)),new e(Nk++,t,s)}},{key:"fromClass",value:function(t,n){return e.define((function(e){return new t(e)}),n)}}]),e}(),zk=_k.define(),Bk=function(){function e(t){Mv(this,e),this.spec=t,this.mustUpdate=null,this.value=null}return Eo(e,[{key:"takeField",value:function(e,t){if(this.spec){var n,r=Qy(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(Rk(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(nF){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(n){Rk(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){Rk(e.state,n,"CodeMirror plugin crashed")}}},{key:"deactivate",value:function(){this.spec=this.value=null}}]),e}(),Fk=Fb.define(),$k=Fb.define(),Wk=Fb.define(),Hk=Fb.define(),Vk=function(){function e(t,n,r,i){Mv(this,e),this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}return Eo(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}(),qk=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:xk;Mv(this,e),this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=Eb.empty(this.startState.doc.length);var i,o=Qy(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 Vk(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 Eo(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}(),Uk=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(Uk||(Uk={})),Qk=Uk.LTR,Xk=Uk.RTL;function Yk(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}(),uS=[];function cS(e,t){var n=e.length,r=t==Qk?1:2,i=t==Qk?2:1;if(!e||1==r&&!sS.test(e))return fS(n);for(var o=0,a=r,s=r;o=0;k-=3)if(eS[k+1]==-g){var S=eS[k+2],O=2&S?r:4&S?1&S?i:r:0;O&&(uS[b]=uS[eS[k]]=O),w=k;break}}else{if(189==eS.length)break;eS[w++]=b,eS[w++]=m,eS[w++]=x}else if(2==(y=uS[b])||1==y){var C=y==r;x=C?0:1;for(var M=w-3;M>=0;M-=3){var P=eS[M+2];if(2&P)break;if(C)eS[M+2]|=2;else{if(4&P)break;eS[M+2]|=4}}}for(var T=0;T_;){for(var I=L,z=2!=uS[--L];L>_&&z==(2!=uS[L-1]);)L--;D.push(new lS(L,I,z?2:1))}else D.push(new lS(_,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=ck.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=function(e,t){var n=e.observer.selectionRange,r=n.focusNode&&xS(n.focusNode,n.focusOffset,0);if(!r)return ck.none;var i=e.docView.nearest(r);if(!i)return ck.none;var o,a,s=r;if(i instanceof mk){for(;s.parentNode!=i.dom;)s=s.parentNode;for(var l=s.previousSibling;l&&!Zx.get(l);)l=l.previousSibling;o=a=l?Zx.get(l).posAtEnd:i.posAtStart}else{for(;;){var u=i.parent;if(!u)return ck.none;if(u instanceof mk)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 pS([],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=yk.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);Dx(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()||Qx.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(Qx.gecko&&i.empty&&yS(o)){var s=document.createTextNode("");this.view.observer.ignore((function(){return o.node.insertBefore(s,o.node.childNodes[o.offset]||null)})),o=a=new Tx(s,0),r=!0}var l=this.view.observer.selectionRange;!r&&l.focusNode&&hx(o.node,o.offset,l.anchorNode,l.anchorOffset)&&hx(a.node,a.offset,l.focusNode,l.focusOffset)||(this.view.observer.ignore((function(){Qx.android&&Qx.chrome&&e.dom.contains(l.focusNode)&&OS(l.focusNode,e.dom)&&(e.dom.blur(),e.dom.focus({preventScroll:!0}));var t=ux(e.root);if(i.empty){if(Qx.gecko){var n=kS(o.node,o.offset);if(n&&3!=n){var r=xS(o.node,o.offset,1==n?1:-1);r&&(o=new Tx(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 Tx(l.anchorNode,l.anchorOffset),this.impreciseHead=a.precise?null:new Tx(l.focusNode,l.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){if(!this.compositionDeco.size){var e=this.view.state.selection.main,t=ux(this.root);if(e.empty&&e.assoc&&t.modify){var n=mk.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(Dk)?this.root.activeElement==this.dom:fx(this.dom,this.view.observer.selectionRange)}},{key:"nearest",value:function(e){for(var t=e;t;){var n=Zx.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!=uk.WidgetBefore&&i.type!=uk.WidgetAfter&&(!r||2==t||this.children[r-1].breakAfter||this.children[r-1].type==uk.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?dx(d):[];if(h.length){var p=h[h.length-1],v=this.view.textDirection==Uk.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=Qy(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r instanceof mk){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=dx(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 Rx(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(ck.replace({widget:new bS(a),block:!0,inclusive:!0}).range(n,o))}if(!i)break;n=i.to+1}return ck.set(e)}},{key:"updateDeco",value:function(){return this.decorations=[].concat((0,me.Z)(this.view.pluginField(_k.decorations)),(0,me.Z)(this.view.state.facet(Wk)),[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=Qy(this.view.pluginField(_k.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=bx(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=mx(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t=0))return null;e=e.childNodes[t],t=0}}}function kS(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 MS(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function PS(e,t){return e.topt.top+1}function TS(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function ZS(e,t,n){for(var r,i,o,a,s,l,u,c,f=e.firstChild;f;f=f.nextSibling)for(var d=dx(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&&PS(u,p)?u=ES(u,p.bottom):c&&PS(c,p)&&(c=TS(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?AS(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)}:ZS(r,g,n)}function AS(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(Qx.chrome||Qx.gecko)Ox(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 RS(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!=uk.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?DS(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 w=v.caretPositionFromPoint(o,a);w&&(y=w.offsetNode,b=w.offset)}else if(v.caretRangeFromPoint){var x=v.caretRangeFromPoint(o,a);x&&(y=x.startContainer,b=x.startOffset,Qx.safari&&jS(y,b,o)&&(y=void 0))}if(!y||!e.docView.dom.contains(y)){var k=mk.find(e.docView,p),S=ZS(k.dom,o,a);y=S.node,b=S.offset}return e.docView.posFromDOM(y,b)}function DS(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+vb(a,o,e.state.tabSize)}function jS(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 Ox(e,r-1,r).getBoundingClientRect().left>n}function _S(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==Uk.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(null!=s)return Lb.cursor(s,n?-1:1)}var l=mk.find(e.docView,t.head),u=l?n?l.posAtEnd:l.posAtStart:n?i.to:i.from;return Lb.cursor(u,n?-1:1)}function NS(e,t,n,r){for(var i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),a=t,s=null;;){var l=hS(i,o,e.textDirection,a,n),u=dS;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=Lb.cursor(n?i.from:i.to)}if(s){if(!s(u))return a}else{if(!r)return l;s=r(u)}a=l}}function LS(e,t,n){for(var r=e.pluginField(_k.atomicRanges);;){var i,o=!1,a=Qy(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?Lb.cursor(e,1):Lb.cursor(r,-1),o=!0)}))}}catch(s){a.e(s)}finally{a.f()}if(!o)return n}}var IS=function(){function e(t){var n=this;Mv(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=WS[e];t.contentDOM.addEventListener(e,(function(i){"keydown"==e&&n.keydown(t,i)||$S(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 WS)r(i);this.notifiedFocused=t.hasFocus,this.ensureHandlers(t),Qx.safari&&t.contentDOM.addEventListener("input",(function(){return null}))}return Eo(e,[{key:"setSelectionOrigin",value:function(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(e){var t,n=this,r=Qy(this.customHandlers=e.pluginField(zk));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){$S(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=Qy(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){Rk(t.state,s)}}}catch(l){i.e(l)}finally{i.f()}return!1}},{key:"runScrollHandlers",value:function(e,t){var n,r=Qy(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){Rk(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)||(!Qx.android||!Qx.chrome||t.synthetic||13!=t.keyCode&&8!=t.keyCode?!(!Qx.ios||!(n=zS.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,Cx(e.contentDOM,t.key,t.keyCode))}},{key:"ignoreDuringComposition",value:function(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(Qx.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!=nO(n))&&null,!1===this.dragging&&(n.preventDefault(),this.select(n))}return Eo(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 $S(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=Zx.get(r))&&n.ignoreEvent(t))return!1;return!0}var WS=Object.create(null),HS=Qx.ie&&Qx.ie_version<15||Qx.ios&&Qx.webkit_version<604;function VS(e,t){var n,r=e.state,i=1,o=r.toText(t),a=o.lines==r.selection.ranges.length,s=null!=iO&&r.selection.ranges.every((function(e){return e.empty}))&&iO==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:Lb.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:Lb.cursor(e.from+t.length)}})):r.replaceSelection(o);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}WS.keydown=function(e,t){e.inputState.setSelectionOrigin("select")};var qS=0;function US(e,t,n,r){if(1==r)return Lb.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 Lb.cursor(t);0==o?n=1:o==i.length&&(n=-1);var a=o,s=o;n<0?a=ab(i.text,o,!1):s=ab(i.text,o);for(var l=r(i.text.slice(a,s));a>0;){var u=ab(i.text,a,!1);if(r(i.text.slice(u,a))!=l)break;a=u}for(;sDate.now()-2e3&&1==nO(t))){var n,r=null,i=Qy(e.state.facet(Ok));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=GS(e,t),r=nO(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=GS(e,t),a=t),!u||!n)return i;var c=US(e,u.pos,u.bias,r);if(n.pos!=u.pos&&!s){var f=US(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},XS=function(e,t,n){return QS(t,n)&&e>=n.left&&e<=n.right};function YS(e,t,n,r){var i=mk.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&&XS(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&XS(n,r,s)?1:a&&QS(r,a)?-1:1}function GS(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:YS(e,n,t.clientX,t.clientY)}}var KS=Qx.ie&&Qx.ie_version<=11,JS=null,eO=0,tO=0;function nO(e){if(!KS)return e.detail;var t=JS,n=tO;return JS=e,tO=Date.now(),eO=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(eO+1)%3:1}function rO(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"})}}WS.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")},WS.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&&rO(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){iO=o?r:null;var a=HS?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"})}},WS.focus=WS.blur=function(e){setTimeout((function(){e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)},WS.beforeprint=function(e){e.viewState.printing=!0,e.requestMeasure(),setTimeout((function(){e.viewState.printing=!1,e.requestMeasure()}),2e3)},WS.compositionstart=WS.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(),oO(e,!0)))},WS.compositionend=function(e){e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionFirstChange=null,setTimeout((function(){e.inputState.composing<0&&oO(e,!1)}),50)},WS.contextmenu=function(e){e.inputState.lastContextMenu=Date.now()},WS.beforeinput=function(e,t){var n,r;if(Qx.chrome&&Qx.android&&(r=zS.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 aO=["pre-wrap","normal","pre-line","break-spaces"],sO=function(){function e(){Mv(this,e),this.doc=mb.empty,this.lineWrapping=!1,this.direction=Uk.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}return Eo(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 aO.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;Mv(this,e),this.length=t,this.height=n,this.flags=r}return Eo(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)>fO&&(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,cO.ByPosNoHeight,t,0,0),d=f.to>=l?f:i.lineAt(l,cO.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}(dO),pO=function(e){Xy(n,e);var t=Jy(n);function n(e,r){var i;return Mv(this,n),(i=t.call(this,e,r,uk.Text)).collapsed=0,i.widgetHeight=0,i}return Eo(n,[{key:"replace",value:function(e,t,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof vO&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof vO?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):dO.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}(hO),vO=function(e){Xy(n,e);var t=Jy(n);function n(e){return Mv(this,n),t.call(this,e,0)}return Eo(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 uO(c,f,n+s*l,s,uk.Text)}},{key:"lineAt",value:function(e,t,n,r,i){if(t==cO.ByHeight)return this.blockAt(e,n,r,i);if(t==cO.ByPosNoHeight){var o=n.lineAt(e),a=o.from,s=o.to;return new uO(a,s-a,0,0,uk.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 uO(d,h,r+c*(p-u),c,uk.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 uO(f.from,f.length,r,l,uk.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 dO.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)>=fO&&(l=-2);var d=new pO(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=dO.of(a);return e.heightChanged=u||l<0||Math.abs(h.height-this.height)>=fO||Math.abs(l-this.lines(e.doc,t).lineHeight)>=fO,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}(dO),mO=function(e){Xy(n,e);var t=Jy(n);function n(e,r,i){var o;return Mv(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 Eo(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==cO.ByPosNoHeight?cO.ByPosNoHeight:cO.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,cO.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=Qy(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&&gO(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?dO.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}(dO);function gO(e,t){var n,r;null==e[t]&&(n=e[t-1])instanceof vO&&(r=e[t+1])instanceof vO&&e.splice(t-1,3,new vO(n.length+1+r.length))}var yO=function(){function e(t,n){Mv(this,e),this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}return Eo(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 pO?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new pO(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.writtenTot&&this.nodes.push(new pO(this.pos-t,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(e,t){var n=new vO(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}},{key:"ensureLine",value:function(){this.enterLine();var e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof pO)return e;var t=new pO(0,-1);return this.nodes.push(t),t}},{key:"addBlock",value:function(e){this.enterLine(),e.type!=uk.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=uk.WidgetBefore&&(this.covering=e)}},{key:"addLineDeco",value:function(e,t){var n=this.ensureLine();n.length+=t,n.collapsed+=t,n.widgetHeight=Math.max(n.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}},{key:"finish",value:function(e){var t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof pO||this.isCovered?(this.writtenTo