figpack-spike-sorting 0.1.2__py3-none-any.whl → 0.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- figpack_spike_sorting/__init__.py +1 -1
- figpack_spike_sorting/figpack_spike_sorting.js +41 -53
- figpack_spike_sorting/views/Autocorrelograms.py +2 -2
- figpack_spike_sorting/views/AverageWaveforms.py +2 -2
- figpack_spike_sorting/views/CrossCorrelograms.py +2 -2
- figpack_spike_sorting/views/RasterPlot.py +2 -2
- figpack_spike_sorting/views/SortingCuration.py +2 -2
- figpack_spike_sorting/views/SpikeAmplitudes.py +6 -5
- figpack_spike_sorting/views/UnitLocations.py +2 -2
- figpack_spike_sorting/views/UnitMetricsGraph.py +2 -2
- figpack_spike_sorting/views/UnitsTable.py +2 -2
- {figpack_spike_sorting-0.1.2.dist-info → figpack_spike_sorting-0.1.4.dist-info}/METADATA +1 -1
- figpack_spike_sorting-0.1.4.dist-info/RECORD +25 -0
- figpack_spike_sorting-0.1.2.dist-info/RECORD +0 -25
- {figpack_spike_sorting-0.1.2.dist-info → figpack_spike_sorting-0.1.4.dist-info}/WHEEL +0 -0
- {figpack_spike_sorting-0.1.2.dist-info → figpack_spike_sorting-0.1.4.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".VerticalToolbar{overflow:hidden;position:absolute}.HorizontalToolbar{display:flex;justify-content:center;align-items:center;overflow:hidden;margin:auto}.compact-table-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,sans-serif;font-size:12px;line-height:1;overflow:auto;background:#fff}.compact-table{width:100%;border-collapse:collapse;border-spacing:0;font-size:12px;table-layout:auto;background:#fff}.compact-table-header{background:linear-gradient(135deg,#f8f9fa,#e9ecef);border:1px solid #d1d5db;border-bottom:2px solid #9ca3af;padding:4px 6px;font-size:12px;font-weight:600;text-align:left;height:20px;line-height:1;white-space:nowrap;position:sticky;top:0;z-index:10;color:#374151;text-transform:uppercase;letter-spacing:.025em;user-select:none;transition:all .15s ease}.compact-table-header:hover{background:linear-gradient(135deg,#e9ecef,#dee2e6);transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.compact-table-cell{border-right:1px solid #e5e7eb;border-bottom:1px solid #f3f4f6;padding:2px 6px;font-size:12px;height:18px;line-height:1;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100px;color:#1f2937;transition:background-color .1s ease}.compact-table-row{height:18px;transition:all .1s ease}.compact-table-row:nth-child(2n){background-color:#fafafa}.compact-table-row:hover{background-color:#f0f9ff!important;transform:scale(1.002);box-shadow:0 1px 3px #0000000d}.compact-table-row.selected{background:linear-gradient(135deg,#dbeafe,#bfdbfe)!important;border-left:3px solid #3b82f6}.compact-table-row.current{background:linear-gradient(135deg,#fef3c7,#fde68a)!important;border-left:3px solid #f59e0b;font-weight:600}.sort-indicator{font-size:12px;margin-left:1px;color:#6b7280;font-weight:700;text-shadow:0 1px 1px rgba(255,255,255,.8)}.compact-table input[type=checkbox]{transform:scale(1);margin:0;padding:0;accent-color:#3b82f6;cursor:pointer}.compact-table-cell>span{font-size:12px!important;line-height:1!important}.compact-table-cell>div{font-size:12px!important;line-height:1!important}.compact-table .unitLabel{width:6px;height:6px;display:inline-block;margin-right:2px;border-radius:1px;box-shadow:0 1px 2px #0000001a}.compact-table *{font-size:12px!important;line-height:1!important}.compact-table-cell:last-child{border-right:none}.compact-table-container{box-shadow:0 1px 3px #0000001a;border-radius:4px;overflow:hidden}.compact-table input[type=checkbox]:checked{background-color:#3b82f6;border-color:#3b82f6}.SortableTableWidget .MuiTableCell-root,.SortableTableWidget .MuiTableRow-root,.SortableTableWidget .MuiTable-root,.SortableTableWidget *{font-size:12px!important;line-height:1!important;padding:2px 6px!important;height:18px!important;min-height:18px!important;max-height:18px!important}.compact-table-container::-webkit-scrollbar{width:8px;height:8px}.compact-table-container::-webkit-scrollbar-track{background:#f1f5f9;border-radius:4px}.compact-table-container::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}.compact-table-container::-webkit-scrollbar-thumb:hover{background:#94a3b8}.NiceTable .MuiTableCell-root{padding:5px}.NiceTable .MuiIconButton-root{padding:1px}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
(function(){"use strict";function
|
|
2
|
+
(function(){"use strict";function nx(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function rx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gm={exports:{}},vl={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var
|
|
10
|
+
*/var ix=Symbol.for("react.transitional.element"),ax=Symbol.for("react.fragment");function Ym(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:ix,type:e,key:r,ref:t!==void 0?t:null,props:n}}vl.Fragment=ax,vl.jsx=Ym,vl.jsxs=Ym,Gm.exports=vl;var B=Gm.exports,Xm={exports:{}},Te={};/**
|
|
11
11
|
* @license React
|
|
12
12
|
* react.production.js
|
|
13
13
|
*
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var
|
|
18
|
+
*/var Of=Symbol.for("react.transitional.element"),ox=Symbol.for("react.portal"),ux=Symbol.for("react.fragment"),lx=Symbol.for("react.strict_mode"),sx=Symbol.for("react.profiler"),cx=Symbol.for("react.consumer"),fx=Symbol.for("react.context"),dx=Symbol.for("react.forward_ref"),hx=Symbol.for("react.suspense"),mx=Symbol.for("react.memo"),Zm=Symbol.for("react.lazy"),Qm=Symbol.iterator;function px(e){return e===null||typeof e!="object"?null:(e=Qm&&e[Qm]||e["@@iterator"],typeof e=="function"?e:null)}var Km={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wm=Object.assign,Jm={};function pa(e,t,n){this.props=e,this.context=t,this.refs=Jm,this.updater=n||Km}pa.prototype.isReactComponent={},pa.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},pa.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ep(){}ep.prototype=pa.prototype;function zf(e,t,n){this.props=e,this.context=t,this.refs=Jm,this.updater=n||Km}var Uf=zf.prototype=new ep;Uf.constructor=zf,Wm(Uf,pa.prototype),Uf.isPureReactComponent=!0;var tp=Array.isArray,ct={H:null,A:null,T:null,S:null,V:null},np=Object.prototype.hasOwnProperty;function If(e,t,n,r,i,a){return n=a.ref,{$$typeof:Of,type:e,key:t,ref:n!==void 0?n:null,props:a}}function gx(e,t){return If(e.type,t,void 0,void 0,void 0,e.props)}function $f(e){return typeof e=="object"&&e!==null&&e.$$typeof===Of}function vx(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var rp=/\/+/g;function kf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?vx(""+e.key):t.toString(36)}function ip(){}function yx(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(ip,ip):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function ga(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Of:case ox:o=!0;break;case Zm:return o=e._init,ga(o(e._payload),t,n,r,i)}}if(o)return i=i(e),o=r===""?"."+kf(e,0):r,tp(i)?(n="",o!=null&&(n=o.replace(rp,"$&/")+"/"),ga(i,t,n,"",function(s){return s})):i!=null&&($f(i)&&(i=gx(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(rp,"$&/")+"/")+o)),t.push(i)),1;o=0;var u=r===""?".":r+":";if(tp(e))for(var l=0;l<e.length;l++)r=e[l],a=u+kf(r,l),o+=ga(r,t,n,a,i);else if(l=px(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,a=u+kf(r,l++),o+=ga(r,t,n,a,i);else if(a==="object"){if(typeof e.then=="function")return ga(yx(e),t,n,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function yl(e,t,n){if(e==null)return e;var r=[],i=0;return ga(e,r,"","",function(a){return t.call(n,a,i++)}),r}function bx(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ap=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Dx(){}Te.Children={map:yl,forEach:function(e,t,n){yl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return yl(e,function(){t++}),t},toArray:function(e){return yl(e,function(t){return t})||[]},only:function(e){if(!$f(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},Te.Component=pa,Te.Fragment=ux,Te.Profiler=sx,Te.PureComponent=zf,Te.StrictMode=lx,Te.Suspense=hx,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ct,Te.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ct.H.useMemoCache(e)}},Te.cache=function(e){return function(){return e.apply(null,arguments)}},Te.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=Wm({},e.props),i=e.key,a=void 0;if(t!=null)for(o in t.ref!==void 0&&(a=void 0),t.key!==void 0&&(i=""+t.key),t)!np.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(r[o]=t[o]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var u=Array(o),l=0;l<o;l++)u[l]=arguments[l+2];r.children=u}return If(e.type,i,void 0,void 0,a,r)},Te.createContext=function(e){return e={$$typeof:fx,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:cx,_context:e},e},Te.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=""+t.key),t)np.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var u=Array(o),l=0;l<o;l++)u[l]=arguments[l+2];i.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return If(e,a,void 0,void 0,null,i)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(e){return{$$typeof:dx,render:e}},Te.isValidElement=$f,Te.lazy=function(e){return{$$typeof:Zm,_payload:{_status:-1,_result:e},_init:bx}},Te.memo=function(e,t){return{$$typeof:mx,type:e,compare:t===void 0?null:t}},Te.startTransition=function(e){var t=ct.T,n={};ct.T=n;try{var r=e(),i=ct.S;i!==null&&i(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Dx,ap)}catch(a){ap(a)}finally{ct.T=t}},Te.unstable_useCacheRefresh=function(){return ct.H.useCacheRefresh()},Te.use=function(e){return ct.H.use(e)},Te.useActionState=function(e,t,n){return ct.H.useActionState(e,t,n)},Te.useCallback=function(e,t){return ct.H.useCallback(e,t)},Te.useContext=function(e){return ct.H.useContext(e)},Te.useDebugValue=function(){},Te.useDeferredValue=function(e,t){return ct.H.useDeferredValue(e,t)},Te.useEffect=function(e,t,n){var r=ct.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return r.useEffect(e,t)},Te.useId=function(){return ct.H.useId()},Te.useImperativeHandle=function(e,t,n){return ct.H.useImperativeHandle(e,t,n)},Te.useInsertionEffect=function(e,t){return ct.H.useInsertionEffect(e,t)},Te.useLayoutEffect=function(e,t){return ct.H.useLayoutEffect(e,t)},Te.useMemo=function(e,t){return ct.H.useMemo(e,t)},Te.useOptimistic=function(e,t){return ct.H.useOptimistic(e,t)},Te.useReducer=function(e,t,n){return ct.H.useReducer(e,t,n)},Te.useRef=function(e){return ct.H.useRef(e)},Te.useState=function(e){return ct.H.useState(e)},Te.useSyncExternalStore=function(e,t,n){return ct.H.useSyncExternalStore(e,t,n)},Te.useTransition=function(){return ct.H.useTransition()},Te.version="19.1.1",Xm.exports=Te;var M=Xm.exports;const Nt=rx(M),Lf=nx({__proto__:null,default:Nt},[M]);var op={exports:{}},bl={},up={exports:{}},lp={};/**
|
|
19
19
|
* @license React
|
|
20
20
|
* scheduler.production.js
|
|
21
21
|
*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the MIT license found in the
|
|
25
25
|
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/(function(e){function t(
|
|
26
|
+
*/(function(e){function t(N,U){var I=N.length;N.push(U);e:for(;0<I;){var L=I-1>>>1,G=N[L];if(0<i(G,U))N[L]=U,N[I]=G,I=L;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var U=N[0],I=N.pop();if(I!==U){N[0]=I;e:for(var L=0,G=N.length,X=G>>>1;L<X;){var P=2*(L+1)-1,j=N[P],H=P+1,k=N[H];if(0>i(j,I))H<G&&0>i(k,j)?(N[L]=k,N[H]=I,L=H):(N[L]=j,N[P]=I,L=P);else if(H<G&&0>i(k,I))N[L]=k,N[H]=I,L=H;else break e}}return U}function i(N,U){var I=N.sortIndex-U.sortIndex;return I!==0?I:N.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var l=[],s=[],c=1,f=null,d=3,h=!1,v=!1,m=!1,D=!1,p=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function S(N){for(var U=n(s);U!==null;){if(U.callback===null)r(s);else if(U.startTime<=N)r(s),U.sortIndex=U.expirationTime,t(l,U);else break;U=n(s)}}function w(N){if(m=!1,S(N),!v)if(n(l)!==null)v=!0,b||(b=!0,x());else{var U=n(s);U!==null&&z(w,U.startTime-N)}}var b=!1,E=-1,C=5,A=-1;function T(){return D?!0:!(e.unstable_now()-A<C)}function _(){if(D=!1,b){var N=e.unstable_now();A=N;var U=!0;try{e:{v=!1,m&&(m=!1,g(E),E=-1),h=!0;var I=d;try{t:{for(S(N),f=n(l);f!==null&&!(f.expirationTime>N&&T());){var L=f.callback;if(typeof L=="function"){f.callback=null,d=f.priorityLevel;var G=L(f.expirationTime<=N);if(N=e.unstable_now(),typeof G=="function"){f.callback=G,S(N),U=!0;break t}f===n(l)&&r(l),S(N)}else r(l);f=n(l)}if(f!==null)U=!0;else{var X=n(s);X!==null&&z(w,X.startTime-N),U=!1}}break e}finally{f=null,d=I,h=!1}U=void 0}}finally{U?x():b=!1}}}var x;if(typeof y=="function")x=function(){y(_)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,R=F.port2;F.port1.onmessage=_,x=function(){R.postMessage(null)}}else x=function(){p(_,0)};function z(N,U){E=p(function(){N(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(N){N.callback=null},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_next=function(N){switch(d){case 1:case 2:case 3:var U=3;break;default:U=d}var I=d;d=U;try{return N()}finally{d=I}},e.unstable_requestPaint=function(){D=!0},e.unstable_runWithPriority=function(N,U){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var I=d;d=N;try{return U()}finally{d=I}},e.unstable_scheduleCallback=function(N,U,I){var L=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?L+I:L):I=L,N){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=I+G,N={id:c++,callback:U,priorityLevel:N,startTime:I,expirationTime:G,sortIndex:-1},I>L?(N.sortIndex=I,t(s,N),n(l)===null&&N===n(s)&&(m?(g(E),E=-1):m=!0,z(w,I-L))):(N.sortIndex=G,t(l,N),v||h||(v=!0,b||(b=!0,x()))),N},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(N){var U=d;return function(){var I=d;d=U;try{return N.apply(this,arguments)}finally{d=I}}}})(lp),up.exports=lp;var Sx=up.exports,sp={exports:{}},nn={};/**
|
|
27
27
|
* @license React
|
|
28
28
|
* react-dom.production.js
|
|
29
29
|
*
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the MIT license found in the
|
|
33
33
|
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var
|
|
34
|
+
*/var xx=M;function cp(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ei(){}var rn={d:{f:ei,r:function(){throw Error(cp(522))},D:ei,C:ei,L:ei,m:ei,X:ei,S:ei,M:ei},p:0,findDOMNode:null},wx=Symbol.for("react.portal");function Ex(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wx,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var Io=xx.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Dl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=rn,nn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(cp(299));return Ex(e,t,null,n)},nn.flushSync=function(e){var t=Io.T,n=rn.p;try{if(Io.T=null,rn.p=2,e)return e()}finally{Io.T=t,rn.p=n,rn.d.f()}},nn.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,rn.d.C(e,t))},nn.prefetchDNS=function(e){typeof e=="string"&&rn.d.D(e)},nn.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=Dl(n,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,a=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?rn.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:a}):n==="script"&&rn.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:a,nonce:typeof t.nonce=="string"?t.nonce:void 0})}},nn.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Dl(t.as,t.crossOrigin);rn.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&rn.d.M(e)},nn.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=Dl(n,t.crossOrigin);rn.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}},nn.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Dl(t.as,t.crossOrigin);rn.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else rn.d.m(e)},nn.requestFormReset=function(e){rn.d.r(e)},nn.unstable_batchedUpdates=function(e,t){return e(t)},nn.useFormState=function(e,t,n){return Io.H.useFormState(e,t,n)},nn.useFormStatus=function(){return Io.H.useHostTransitionStatus()},nn.version="19.1.1";function fp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fp)}catch(e){console.error(e)}}fp(),sp.exports=nn;var Ax=sp.exports;/**
|
|
35
35
|
* @license React
|
|
36
36
|
* react-dom-client.production.js
|
|
37
37
|
*
|
|
@@ -39,51 +39,39 @@
|
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the MIT license found in the
|
|
41
41
|
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var Lt=gE,Sg=_,SE=DE;function re(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function wg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function mu(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function xg(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Eg(e){if(mu(e)!==e)throw Error(re(188))}function wE(e){var t=e.alternate;if(!t){if(t=mu(e),t===null)throw Error(re(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return Eg(i),e;if(a===r)return Eg(i),t;a=a.sibling}throw Error(re(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,u=i.child;u;){if(u===n){o=!0,n=i,r=a;break}if(u===r){o=!0,r=i,n=a;break}u=u.sibling}if(!o){for(u=a.child;u;){if(u===n){o=!0,n=a,r=i;break}if(u===r){o=!0,r=a,n=i;break}u=u.sibling}if(!o)throw Error(re(189))}}if(n.alternate!==r)throw Error(re(190))}if(n.tag!==3)throw Error(re(188));return n.stateNode.current===n?e:t}function Ag(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Ag(e),t!==null)return t;e=e.sibling}return null}var dt=Object.assign,xE=Symbol.for("react.element"),Wl=Symbol.for("react.transitional.element"),pu=Symbol.for("react.portal"),$a=Symbol.for("react.fragment"),Cg=Symbol.for("react.strict_mode"),Cd=Symbol.for("react.profiler"),EE=Symbol.for("react.provider"),Mg=Symbol.for("react.consumer"),Pr=Symbol.for("react.context"),Md=Symbol.for("react.forward_ref"),Td=Symbol.for("react.suspense"),_d=Symbol.for("react.suspense_list"),Bd=Symbol.for("react.memo"),bi=Symbol.for("react.lazy"),Nd=Symbol.for("react.activity"),AE=Symbol.for("react.memo_cache_sentinel"),Tg=Symbol.iterator;function gu(e){return e===null||typeof e!="object"?null:(e=Tg&&e[Tg]||e["@@iterator"],typeof e=="function"?e:null)}var CE=Symbol.for("react.client.reference");function Fd(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===CE?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $a:return"Fragment";case Cd:return"Profiler";case Cg:return"StrictMode";case Td:return"Suspense";case _d:return"SuspenseList";case Nd:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case pu:return"Portal";case Pr:return(e.displayName||"Context")+".Provider";case Mg:return(e._context.displayName||"Context")+".Consumer";case Md:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Bd:return t=e.displayName||null,t!==null?t:Fd(e.type)||"Memo";case bi:t=e._payload,e=e._init;try{return Fd(e(t))}catch{}}return null}var vu=Array.isArray,Ee=Sg.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,He=SE.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ra={pending:!1,data:null,method:null,action:null},Rd=[],ka=-1;function xr(e){return{current:e}}function qt(e){0>ka||(e.current=Rd[ka],Rd[ka]=null,ka--)}function gt(e,t){ka++,Rd[ka]=e.current,e.current=t}var Er=xr(null),yu=xr(null),Di=xr(null),Jl=xr(null);function es(e,t){switch(gt(Di,t),gt(yu,e),gt(Er,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Zy(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Zy(t),e=Ky(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}qt(Er),gt(Er,e)}function La(){qt(Er),qt(yu),qt(Di)}function Od(e){e.memoizedState!==null&>(Jl,e);var t=Er.current,n=Ky(t,e.type);t!==n&&(gt(yu,e),gt(Er,n))}function ts(e){yu.current===e&&(qt(Er),qt(yu)),Jl.current===e&&(qt(Jl),fl._currentValue=ra)}var zd=Object.prototype.hasOwnProperty,Ud=Lt.unstable_scheduleCallback,Id=Lt.unstable_cancelCallback,ME=Lt.unstable_shouldYield,TE=Lt.unstable_requestPaint,Ar=Lt.unstable_now,_E=Lt.unstable_getCurrentPriorityLevel,_g=Lt.unstable_ImmediatePriority,Bg=Lt.unstable_UserBlockingPriority,ns=Lt.unstable_NormalPriority,BE=Lt.unstable_LowPriority,Ng=Lt.unstable_IdlePriority,NE=Lt.log,FE=Lt.unstable_setDisableYieldValue,bu=null,Nn=null;function Si(e){if(typeof NE=="function"&&FE(e),Nn&&typeof Nn.setStrictMode=="function")try{Nn.setStrictMode(bu,e)}catch{}}var Fn=Math.clz32?Math.clz32:zE,RE=Math.log,OE=Math.LN2;function zE(e){return e>>>=0,e===0?32:31-(RE(e)/OE|0)|0}var rs=256,is=4194304;function ia(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function as(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var u=r&134217727;return u!==0?(r=u&~a,r!==0?i=ia(r):(o&=u,o!==0?i=ia(o):n||(n=u&~e,n!==0&&(i=ia(n))))):(u=r&~a,u!==0?i=ia(u):o!==0?i=ia(o):n||(n=r&~e,n!==0&&(i=ia(n)))),i===0?0:t!==0&&t!==i&&!(t&a)&&(a=i&-i,n=t&-t,a>=n||a===32&&(n&4194048)!==0)?t:i}function Du(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function UE(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fg(){var e=rs;return rs<<=1,!(rs&4194048)&&(rs=256),e}function Rg(){var e=is;return is<<=1,!(is&62914560)&&(is=4194304),e}function $d(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Su(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function IE(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var u=e.entanglements,l=e.expirationTimes,s=e.hiddenUpdates;for(n=o&~n;0<n;){var c=31-Fn(n),f=1<<c;u[c]=0,l[c]=-1;var d=s[c];if(d!==null)for(s[c]=null,c=0;c<d.length;c++){var h=d[c];h!==null&&(h.lane&=-536870913)}n&=~f}r!==0&&Og(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Og(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Fn(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&4194090}function zg(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function kd(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ld(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ug(){var e=He.p;return e!==0?e:(e=window.event,e===void 0?32:pb(e.type))}function $E(e,t){var n=He.p;try{return He.p=e,t()}finally{He.p=n}}var wi=Math.random().toString(36).slice(2),rn="__reactFiber$"+wi,vn="__reactProps$"+wi,ja="__reactContainer$"+wi,jd="__reactEvents$"+wi,kE="__reactListeners$"+wi,LE="__reactHandles$"+wi,Ig="__reactResources$"+wi,wu="__reactMarker$"+wi;function Pd(e){delete e[rn],delete e[vn],delete e[jd],delete e[kE],delete e[LE]}function Pa(e){var t=e[rn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ja]||n[rn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=eb(e);e!==null;){if(n=e[rn])return n;e=eb(e)}return t}e=n,n=e.parentNode}return null}function Ha(e){if(e=e[rn]||e[ja]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function xu(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(re(33))}function qa(e){var t=e[Ig];return t||(t=e[Ig]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Gt(e){e[wu]=!0}var $g=new Set,kg={};function aa(e,t){Ga(e,t),Ga(e+"Capture",t)}function Ga(e,t){for(kg[e]=t,e=0;e<t.length;e++)$g.add(t[e])}var jE=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Lg={},jg={};function PE(e){return zd.call(jg,e)?!0:zd.call(Lg,e)?!1:jE.test(e)?jg[e]=!0:(Lg[e]=!0,!1)}function os(e,t,n){if(PE(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function us(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Hr(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}var Hd,Pg;function Va(e){if(Hd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Hd=t&&t[1]||"",Pg=-1<n.stack.indexOf(`
|
|
42
|
+
*/var Rt=Sx,dp=M,Cx=Ax;function re(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function hp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function mp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function pp(e){if($o(e)!==e)throw Error(re(188))}function Tx(e){var t=e.alternate;if(!t){if(t=$o(e),t===null)throw Error(re(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return pp(i),e;if(a===r)return pp(i),t;a=a.sibling}throw Error(re(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,u=i.child;u;){if(u===n){o=!0,n=i,r=a;break}if(u===r){o=!0,r=i,n=a;break}u=u.sibling}if(!o){for(u=a.child;u;){if(u===n){o=!0,n=a,r=i;break}if(u===r){o=!0,r=a,n=i;break}u=u.sibling}if(!o)throw Error(re(189))}}if(n.alternate!==r)throw Error(re(190))}if(n.tag!==3)throw Error(re(188));return n.stateNode.current===n?e:t}function gp(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=gp(e),t!==null)return t;e=e.sibling}return null}var ut=Object.assign,Mx=Symbol.for("react.element"),Sl=Symbol.for("react.transitional.element"),ko=Symbol.for("react.portal"),va=Symbol.for("react.fragment"),vp=Symbol.for("react.strict_mode"),jf=Symbol.for("react.profiler"),_x=Symbol.for("react.provider"),yp=Symbol.for("react.consumer"),Mr=Symbol.for("react.context"),Hf=Symbol.for("react.forward_ref"),Pf=Symbol.for("react.suspense"),qf=Symbol.for("react.suspense_list"),Vf=Symbol.for("react.memo"),ti=Symbol.for("react.lazy"),Gf=Symbol.for("react.activity"),Bx=Symbol.for("react.memo_cache_sentinel"),bp=Symbol.iterator;function Lo(e){return e===null||typeof e!="object"?null:(e=bp&&e[bp]||e["@@iterator"],typeof e=="function"?e:null)}var Fx=Symbol.for("react.client.reference");function Yf(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Fx?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case va:return"Fragment";case jf:return"Profiler";case vp:return"StrictMode";case Pf:return"Suspense";case qf:return"SuspenseList";case Gf:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case ko:return"Portal";case Mr:return(e.displayName||"Context")+".Provider";case yp:return(e._context.displayName||"Context")+".Consumer";case Hf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Vf:return t=e.displayName||null,t!==null?t:Yf(e.type)||"Memo";case ti:t=e._payload,e=e._init;try{return Yf(e(t))}catch{}}return null}var jo=Array.isArray,we=dp.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$e=Cx.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ii={pending:!1,data:null,method:null,action:null},Xf=[],ya=-1;function cr(e){return{current:e}}function It(e){0>ya||(e.current=Xf[ya],Xf[ya]=null,ya--)}function ft(e,t){ya++,Xf[ya]=e.current,e.current=t}var fr=cr(null),Ho=cr(null),ni=cr(null),xl=cr(null);function wl(e,t){switch(ft(ni,t),ft(Ho,e),ft(fr,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?L1(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=L1(t),e=j1(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}It(fr),ft(fr,e)}function ba(){It(fr),It(Ho),It(ni)}function Zf(e){e.memoizedState!==null&&ft(xl,e);var t=fr.current,n=j1(t,e.type);t!==n&&(ft(Ho,e),ft(fr,n))}function El(e){Ho.current===e&&(It(fr),It(Ho)),xl.current===e&&(It(xl),zu._currentValue=Ii)}var Qf=Object.prototype.hasOwnProperty,Kf=Rt.unstable_scheduleCallback,Wf=Rt.unstable_cancelCallback,Nx=Rt.unstable_shouldYield,Rx=Rt.unstable_requestPaint,dr=Rt.unstable_now,Ox=Rt.unstable_getCurrentPriorityLevel,Dp=Rt.unstable_ImmediatePriority,Sp=Rt.unstable_UserBlockingPriority,Al=Rt.unstable_NormalPriority,zx=Rt.unstable_LowPriority,xp=Rt.unstable_IdlePriority,Ux=Rt.log,Ix=Rt.unstable_setDisableYieldValue,Po=null,xn=null;function ri(e){if(typeof Ux=="function"&&Ix(e),xn&&typeof xn.setStrictMode=="function")try{xn.setStrictMode(Po,e)}catch{}}var wn=Math.clz32?Math.clz32:Lx,$x=Math.log,kx=Math.LN2;function Lx(e){return e>>>=0,e===0?32:31-($x(e)/kx|0)|0}var Cl=256,Tl=4194304;function $i(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ml(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var u=r&134217727;return u!==0?(r=u&~a,r!==0?i=$i(r):(o&=u,o!==0?i=$i(o):n||(n=u&~e,n!==0&&(i=$i(n))))):(u=r&~a,u!==0?i=$i(u):o!==0?i=$i(o):n||(n=r&~e,n!==0&&(i=$i(n)))),i===0?0:t!==0&&t!==i&&!(t&a)&&(a=i&-i,n=t&-t,a>=n||a===32&&(n&4194048)!==0)?t:i}function qo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function jx(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wp(){var e=Cl;return Cl<<=1,!(Cl&4194048)&&(Cl=256),e}function Ep(){var e=Tl;return Tl<<=1,!(Tl&62914560)&&(Tl=4194304),e}function Jf(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Vo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Hx(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var u=e.entanglements,l=e.expirationTimes,s=e.hiddenUpdates;for(n=o&~n;0<n;){var c=31-wn(n),f=1<<c;u[c]=0,l[c]=-1;var d=s[c];if(d!==null)for(s[c]=null,c=0;c<d.length;c++){var h=d[c];h!==null&&(h.lane&=-536870913)}n&=~f}r!==0&&Ap(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ap(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-wn(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&4194090}function Cp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ed(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function td(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Tp(){var e=$e.p;return e!==0?e:(e=window.event,e===void 0?32:oy(e.type))}function Px(e,t){var n=$e.p;try{return $e.p=e,t()}finally{$e.p=n}}var ii=Math.random().toString(36).slice(2),Qt="__reactFiber$"+ii,ln="__reactProps$"+ii,Da="__reactContainer$"+ii,nd="__reactEvents$"+ii,qx="__reactListeners$"+ii,Vx="__reactHandles$"+ii,Mp="__reactResources$"+ii,Go="__reactMarker$"+ii;function rd(e){delete e[Qt],delete e[ln],delete e[nd],delete e[qx],delete e[Vx]}function Sa(e){var t=e[Qt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Da]||n[Qt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=V1(e);e!==null;){if(n=e[Qt])return n;e=V1(e)}return t}e=n,n=e.parentNode}return null}function xa(e){if(e=e[Qt]||e[Da]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Yo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(re(33))}function wa(e){var t=e[Mp];return t||(t=e[Mp]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function $t(e){e[Go]=!0}var _p=new Set,Bp={};function ki(e,t){Ea(e,t),Ea(e+"Capture",t)}function Ea(e,t){for(Bp[e]=t,e=0;e<t.length;e++)_p.add(t[e])}var Gx=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Fp={},Np={};function Yx(e){return Qf.call(Np,e)?!0:Qf.call(Fp,e)?!1:Gx.test(e)?Np[e]=!0:(Fp[e]=!0,!1)}function _l(e,t,n){if(Yx(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Bl(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function _r(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}var id,Rp;function Aa(e){if(id===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);id=t&&t[1]||"",Rp=-1<n.stack.indexOf(`
|
|
43
43
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+
|
|
44
|
+
`+id+e+Rp}var ad=!1;function od(e,t){if(!e||ad)return"";ad=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(h){var d=h}Reflect.construct(e,[],f)}else{try{f.call()}catch(h){d=h}e.call(f.prototype)}}else{try{throw Error()}catch(h){d=h}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(h){if(h&&d&&typeof h.stack=="string")return[h.stack,d.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),o=a[0],u=a[1];if(o&&u){var l=o.split(`
|
|
45
45
|
`),s=u.split(`
|
|
46
46
|
`);for(i=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;i<s.length&&!s[i].includes("DetermineComponentFrameRoot");)i++;if(r===l.length||i===s.length)for(r=l.length-1,i=s.length-1;1<=r&&0<=i&&l[r]!==s[i];)i--;for(;1<=r&&0<=i;r--,i--)if(l[r]!==s[i]){if(r!==1||i!==1)do if(r--,i--,0>i||l[r]!==s[i]){var c=`
|
|
47
|
-
`+l[r].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=r&&0<=i);break}}}finally{
|
|
47
|
+
`+l[r].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=r&&0<=i);break}}}finally{ad=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Aa(n):""}function Xx(e){switch(e.tag){case 26:case 27:case 5:return Aa(e.type);case 16:return Aa("Lazy");case 13:return Aa("Suspense");case 19:return Aa("SuspenseList");case 0:case 15:return od(e.type,!1);case 11:return od(e.type.render,!1);case 1:return od(e.type,!0);case 31:return Aa("Activity");default:return""}}function Op(e){try{var t="";do t+=Xx(e),e=e.return;while(e);return t}catch(n){return`
|
|
48
48
|
Error generating stack: `+n.message+`
|
|
49
|
-
`+n.stack}}function Xn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qE(e){var t=qg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ls(e){e._valueTracker||(e._valueTracker=qE(e))}function Gg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=qg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ss(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var GE=/[\n"\\]/g;function Zn(e){return e.replace(GE,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Vd(e,t,n,r,i,a,o,u){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Xn(t)):e.value!==""+Xn(t)&&(e.value=""+Xn(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?Yd(e,o,Xn(t)):n!=null?Yd(e,o,Xn(n)):r!=null&&e.removeAttribute("value"),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.name=""+Xn(u):e.removeAttribute("name")}function Vg(e,t,n,r,i,a,o,u){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null))return;n=n!=null?""+Xn(n):"",t=t!=null?""+Xn(t):n,u||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=u?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o)}function Yd(e,t,n){t==="number"&&ss(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ya(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Xn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Yg(e,t,n){if(t!=null&&(t=""+Xn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Xn(n):""}function Xg(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(re(92));if(vu(r)){if(1<r.length)throw Error(re(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=Xn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r)}function Xa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var VE=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Zg(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||VE.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Kg(e,t,n){if(t!=null&&typeof t!="object")throw Error(re(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Zg(e,i,r)}else for(var a in t)t.hasOwnProperty(a)&&Zg(e,a,t[a])}function Xd(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var YE=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),XE=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function cs(e){return XE.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Zd=null;function Kd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Za=null,Ka=null;function Qg(e){var t=Ha(e);if(t&&(e=t.stateNode)){var n=e[vn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Vd(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Zn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[vn]||null;if(!i)throw Error(re(90));Vd(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Gg(r)}break e;case"textarea":Yg(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ya(e,!!n.multiple,t,!1)}}}var Qd=!1;function Wg(e,t,n){if(Qd)return e(t,n);Qd=!0;try{var r=e(t);return r}finally{if(Qd=!1,(Za!==null||Ka!==null)&&(Zs(),Za&&(t=Za,e=Ka,Ka=Za=null,Qg(t),e)))for(t=0;t<e.length;t++)Qg(e[t])}}function Eu(e,t){var n=e.stateNode;if(n===null)return null;var r=n[vn]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(re(231,t,typeof n));return n}var qr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wd=!1;if(qr)try{var Au={};Object.defineProperty(Au,"passive",{get:function(){Wd=!0}}),window.addEventListener("test",Au,Au),window.removeEventListener("test",Au,Au)}catch{Wd=!1}var xi=null,Jd=null,fs=null;function Jg(){if(fs)return fs;var e,t=Jd,n=t.length,r,i="value"in xi?xi.value:xi.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return fs=i.slice(e,1<r?1-r:void 0)}function ds(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function hs(){return!0}function e1(){return!1}function yn(e){function t(n,r,i,a,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(n=e[u],this[u]=n?n(a):a[u]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?hs:e1,this.isPropagationStopped=e1,this}return dt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=hs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=hs)},persist:function(){},isPersistent:hs}),t}var oa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ms=yn(oa),Cu=dt({},oa,{view:0,detail:0}),ZE=yn(Cu),e0,t0,Mu,ps=dt({},Cu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:r0,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Mu&&(Mu&&e.type==="mousemove"?(e0=e.screenX-Mu.screenX,t0=e.screenY-Mu.screenY):t0=e0=0,Mu=e),e0)},movementY:function(e){return"movementY"in e?e.movementY:t0}}),t1=yn(ps),KE=dt({},ps,{dataTransfer:0}),QE=yn(KE),WE=dt({},Cu,{relatedTarget:0}),n0=yn(WE),JE=dt({},oa,{animationName:0,elapsedTime:0,pseudoElement:0}),eA=yn(JE),tA=dt({},oa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),nA=yn(tA),rA=dt({},oa,{data:0}),n1=yn(rA),iA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aA={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},oA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uA(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=oA[e])?!!t[e]:!1}function r0(){return uA}var lA=dt({},Cu,{key:function(e){if(e.key){var t=iA[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ds(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?aA[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:r0,charCode:function(e){return e.type==="keypress"?ds(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ds(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),sA=yn(lA),cA=dt({},ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),r1=yn(cA),fA=dt({},Cu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:r0}),dA=yn(fA),hA=dt({},oa,{propertyName:0,elapsedTime:0,pseudoElement:0}),mA=yn(hA),pA=dt({},ps,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),gA=yn(pA),vA=dt({},oa,{newState:0,oldState:0}),yA=yn(vA),bA=[9,13,27,32],i0=qr&&"CompositionEvent"in window,Tu=null;qr&&"documentMode"in document&&(Tu=document.documentMode);var DA=qr&&"TextEvent"in window&&!Tu,i1=qr&&(!i0||Tu&&8<Tu&&11>=Tu),a1=" ",o1=!1;function u1(e,t){switch(e){case"keyup":return bA.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function l1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qa=!1;function SA(e,t){switch(e){case"compositionend":return l1(t);case"keypress":return t.which!==32?null:(o1=!0,a1);case"textInput":return e=t.data,e===a1&&o1?null:e;default:return null}}function wA(e,t){if(Qa)return e==="compositionend"||!i0&&u1(e,t)?(e=Jg(),fs=Jd=xi=null,Qa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return i1&&t.locale!=="ko"?null:t.data;default:return null}}var xA={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function s1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xA[e.type]:t==="textarea"}function c1(e,t,n,r){Za?Ka?Ka.push(r):Ka=[r]:Za=r,t=tc(t,"onChange"),0<t.length&&(n=new ms("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var _u=null,Bu=null;function EA(e){qy(e,0)}function gs(e){var t=xu(e);if(Gg(t))return e}function f1(e,t){if(e==="change")return t}var d1=!1;if(qr){var a0;if(qr){var o0="oninput"in document;if(!o0){var h1=document.createElement("div");h1.setAttribute("oninput","return;"),o0=typeof h1.oninput=="function"}a0=o0}else a0=!1;d1=a0&&(!document.documentMode||9<document.documentMode)}function m1(){_u&&(_u.detachEvent("onpropertychange",p1),Bu=_u=null)}function p1(e){if(e.propertyName==="value"&&gs(Bu)){var t=[];c1(t,Bu,e,Kd(e)),Wg(EA,t)}}function AA(e,t,n){e==="focusin"?(m1(),_u=t,Bu=n,_u.attachEvent("onpropertychange",p1)):e==="focusout"&&m1()}function CA(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return gs(Bu)}function MA(e,t){if(e==="click")return gs(t)}function TA(e,t){if(e==="input"||e==="change")return gs(t)}function _A(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Rn=typeof Object.is=="function"?Object.is:_A;function Nu(e,t){if(Rn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!zd.call(t,i)||!Rn(e[i],t[i]))return!1}return!0}function g1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function v1(e,t){var n=g1(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=g1(n)}}function y1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?y1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function b1(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ss(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ss(e.document)}return t}function u0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var BA=qr&&"documentMode"in document&&11>=document.documentMode,Wa=null,l0=null,Fu=null,s0=!1;function D1(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;s0||Wa==null||Wa!==ss(r)||(r=Wa,"selectionStart"in r&&u0(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fu&&Nu(Fu,r)||(Fu=r,r=tc(l0,"onSelect"),0<r.length&&(t=new ms("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Wa)))}function ua(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ja={animationend:ua("Animation","AnimationEnd"),animationiteration:ua("Animation","AnimationIteration"),animationstart:ua("Animation","AnimationStart"),transitionrun:ua("Transition","TransitionRun"),transitionstart:ua("Transition","TransitionStart"),transitioncancel:ua("Transition","TransitionCancel"),transitionend:ua("Transition","TransitionEnd")},c0={},S1={};qr&&(S1=document.createElement("div").style,"AnimationEvent"in window||(delete Ja.animationend.animation,delete Ja.animationiteration.animation,delete Ja.animationstart.animation),"TransitionEvent"in window||delete Ja.transitionend.transition);function la(e){if(c0[e])return c0[e];if(!Ja[e])return e;var t=Ja[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in S1)return c0[e]=t[n];return e}var w1=la("animationend"),x1=la("animationiteration"),E1=la("animationstart"),NA=la("transitionrun"),FA=la("transitionstart"),RA=la("transitioncancel"),A1=la("transitionend"),C1=new Map,f0="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");f0.push("scrollEnd");function dr(e,t){C1.set(e,t),aa(t,[e])}var M1=new WeakMap;function Kn(e,t){if(typeof e=="object"&&e!==null){var n=M1.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Hg(t)},M1.set(e,t),t)}return{value:e,source:t,stack:Hg(t)}}var Qn=[],eo=0,d0=0;function vs(){for(var e=eo,t=d0=eo=0;t<e;){var n=Qn[t];Qn[t++]=null;var r=Qn[t];Qn[t++]=null;var i=Qn[t];Qn[t++]=null;var a=Qn[t];if(Qn[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&T1(n,i,a)}}function ys(e,t,n,r){Qn[eo++]=e,Qn[eo++]=t,Qn[eo++]=n,Qn[eo++]=r,d0|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function h0(e,t,n,r){return ys(e,t,n,r),bs(e)}function to(e,t){return ys(e,null,null,t),bs(e)}function T1(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Fn(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function bs(e){if(50<rl)throw rl=0,bh=null,Error(re(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var no={};function OA(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(e,t,n,r){return new OA(e,t,n,r)}function m0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gr(e,t){var n=e.alternate;return n===null?(n=On(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function _1(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ds(e,t,n,r,i,a){var o=0;if(r=e,typeof e=="function")m0(e)&&(o=1);else if(typeof e=="string")o=U3(e,n,Er.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Nd:return e=On(31,n,t,i),e.elementType=Nd,e.lanes=a,e;case $a:return sa(n.children,i,a,t);case Cg:o=8,i|=24;break;case Cd:return e=On(12,n,t,i|2),e.elementType=Cd,e.lanes=a,e;case Td:return e=On(13,n,t,i),e.elementType=Td,e.lanes=a,e;case _d:return e=On(19,n,t,i),e.elementType=_d,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case EE:case Pr:o=10;break e;case Mg:o=9;break e;case Md:o=11;break e;case Bd:o=14;break e;case bi:o=16,r=null;break e}o=29,n=Error(re(130,e===null?"null":typeof e,"")),r=null}return t=On(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function sa(e,t,n,r){return e=On(7,e,r,t),e.lanes=n,e}function p0(e,t,n){return e=On(6,e,null,t),e.lanes=n,e}function g0(e,t,n){return t=On(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ro=[],io=0,Ss=null,ws=0,Wn=[],Jn=0,ca=null,Vr=1,Yr="";function fa(e,t){ro[io++]=ws,ro[io++]=Ss,Ss=e,ws=t}function B1(e,t,n){Wn[Jn++]=Vr,Wn[Jn++]=Yr,Wn[Jn++]=ca,ca=e;var r=Vr;e=Yr;var i=32-Fn(r)-1;r&=~(1<<i),n+=1;var a=32-Fn(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Vr=1<<32-Fn(t)+i|n<<i|r,Yr=a+e}else Vr=1<<a|n<<i|r,Yr=e}function v0(e){e.return!==null&&(fa(e,1),B1(e,1,0))}function y0(e){for(;e===Ss;)Ss=ro[--io],ro[io]=null,ws=ro[--io],ro[io]=null;for(;e===ca;)ca=Wn[--Jn],Wn[Jn]=null,Yr=Wn[--Jn],Wn[Jn]=null,Vr=Wn[--Jn],Wn[Jn]=null}var hn=null,Et=null,qe=!1,da=null,Cr=!1,b0=Error(re(519));function ha(e){var t=Error(re(418,""));throw zu(Kn(t,e)),b0}function N1(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[rn]=e,t[vn]=r,n){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(n=0;n<al.length;n++)ze(al[n],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),Vg(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),ls(t);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),Xg(t,r.value,r.defaultValue,r.children),ls(t)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||Xy(t.textContent,n)?(r.popover!=null&&(ze("beforetoggle",t),ze("toggle",t)),r.onScroll!=null&&ze("scroll",t),r.onScrollEnd!=null&&ze("scrollend",t),r.onClick!=null&&(t.onclick=nc),t=!0):t=!1,t||ha(e)}function F1(e){for(hn=e.return;hn;)switch(hn.tag){case 5:case 13:Cr=!1;return;case 27:case 3:Cr=!0;return;default:hn=hn.return}}function Ru(e){if(e!==hn)return!1;if(!qe)return F1(e),qe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||zh(e.type,e.memoizedProps)),n=!n),n&&Et&&ha(e),F1(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(re(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){Et=mr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}Et=null}}else t===27?(t=Et,ki(e.type)?(e=kh,kh=null,Et=e):Et=t):Et=hn?mr(e.stateNode.nextSibling):null;return!0}function Ou(){Et=hn=null,qe=!1}function R1(){var e=da;return e!==null&&(Sn===null?Sn=e:Sn.push.apply(Sn,e),da=null),e}function zu(e){da===null?da=[e]:da.push(e)}var D0=xr(null),ma=null,Xr=null;function Ei(e,t,n){gt(D0,t._currentValue),t._currentValue=n}function Zr(e){e._currentValue=D0.current,qt(D0)}function S0(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function w0(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var o=i.child;a=a.firstContext;e:for(;a!==null;){var u=a;a=i;for(var l=0;l<t.length;l++)if(u.context===t[l]){a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),S0(a.return,n,e),r||(o=null);break e}a=u.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(re(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),S0(o,n,e),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function Uu(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(re(387));if(o=o.memoizedProps,o!==null){var u=i.type;Rn(i.pendingProps.value,o.value)||(e!==null?e.push(u):e=[u])}}else if(i===Jl.current){if(o=i.alternate,o===null)throw Error(re(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(fl):e=[fl])}i=i.return}e!==null&&w0(t,e,n,r),t.flags|=262144}function xs(e){for(e=e.firstContext;e!==null;){if(!Rn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function pa(e){ma=e,Xr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function an(e){return O1(ma,e)}function Es(e,t){return ma===null&&pa(e),O1(e,t)}function O1(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xr===null){if(e===null)throw Error(re(308));Xr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xr=Xr.next=t;return n}var zA=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},UA=Lt.unstable_scheduleCallback,IA=Lt.unstable_NormalPriority,jt={$$typeof:Pr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function x0(){return{controller:new zA,data:new Map,refCount:0}}function Iu(e){e.refCount--,e.refCount===0&&UA(IA,function(){e.controller.abort()})}var $u=null,E0=0,ao=0,oo=null;function $A(e,t){if($u===null){var n=$u=[];E0=0,ao=Ch(),oo={status:"pending",value:void 0,then:function(r){n.push(r)}}}return E0++,t.then(z1,z1),t}function z1(){if(--E0===0&&$u!==null){oo!==null&&(oo.status="fulfilled");var e=$u;$u=null,ao=0,oo=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function kA(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),r}var U1=Ee.S;Ee.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&$A(e,t),U1!==null&&U1(e,t)};var ga=xr(null);function A0(){var e=ga.current;return e!==null?e:lt.pooledCache}function As(e,t){t===null?gt(ga,ga.current):gt(ga,t.pool)}function I1(){var e=A0();return e===null?null:{parent:jt._currentValue,pool:e}}var ku=Error(re(460)),$1=Error(re(474)),Cs=Error(re(542)),C0={then:function(){}};function k1(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ms(){}function L1(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ms,Ms),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,P1(e),e;default:if(typeof t.status=="string")t.then(Ms,Ms);else{if(e=lt,e!==null&&100<e.shellSuspendCounter)throw Error(re(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,P1(e),e}throw Lu=t,ku}}var Lu=null;function j1(){if(Lu===null)throw Error(re(459));var e=Lu;return Lu=null,e}function P1(e){if(e===ku||e===Cs)throw Error(re(483))}var Ai=!1;function M0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function T0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ci(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Mi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ze&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=bs(e),T1(e,null,n),t}return ys(e,r,t,n),bs(e)}function ju(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zg(e,n)}}function _0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var B0=!1;function Pu(){if(B0){var e=oo;if(e!==null)throw e}}function Hu(e,t,n,r){B0=!1;var i=e.updateQueue;Ai=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,u=i.shared.pending;if(u!==null){i.shared.pending=null;var l=u,s=l.next;l.next=null,o===null?a=s:o.next=s,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,u=c.lastBaseUpdate,u!==o&&(u===null?c.firstBaseUpdate=s:u.next=s,c.lastBaseUpdate=l))}if(a!==null){var f=i.baseState;o=0,c=s=l=null,u=a;do{var d=u.lane&-536870913,h=d!==u.lane;if(h?(ke&d)===d:(r&d)===d){d!==0&&d===ao&&(B0=!0),c!==null&&(c=c.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var g=e,m=u;d=t;var D=n;switch(m.tag){case 1:if(g=m.payload,typeof g=="function"){f=g.call(D,f,d);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,d=typeof g=="function"?g.call(D,f,d):g,d==null)break e;f=dt({},f,d);break e;case 2:Ai=!0}}d=u.callback,d!==null&&(e.flags|=64,h&&(e.flags|=8192),h=i.callbacks,h===null?i.callbacks=[d]:h.push(d))}else h={lane:d,tag:u.tag,payload:u.payload,callback:u.callback,next:null},c===null?(s=c=h,l=f):c=c.next=h,o|=d;if(u=u.next,u===null){if(u=i.shared.pending,u===null)break;h=u,u=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=s,i.lastBaseUpdate=c,a===null&&(i.shared.lanes=0),zi|=o,e.lanes=o,e.memoizedState=f}}function H1(e,t){if(typeof e!="function")throw Error(re(191,e));e.call(t)}function q1(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)H1(n[e],t)}var uo=xr(null),Ts=xr(0);function G1(e,t){e=ni,gt(Ts,e),gt(uo,t),ni=e|t.baseLanes}function N0(){gt(Ts,ni),gt(uo,uo.current)}function F0(){ni=Ts.current,qt(uo),qt(Ts)}var Ti=0,Fe=null,tt=null,Rt=null,_s=!1,lo=!1,va=!1,Bs=0,qu=0,so=null,LA=0;function _t(){throw Error(re(321))}function R0(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Rn(e[n],t[n]))return!1;return!0}function O0(e,t,n,r,i,a){return Ti=a,Fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ee.H=e===null||e.memoizedState===null?Tv:_v,va=!1,a=n(r,i),va=!1,lo&&(a=Y1(t,n,r,i)),V1(e),a}function V1(e){Ee.H=Us;var t=tt!==null&&tt.next!==null;if(Ti=0,Rt=tt=Fe=null,_s=!1,qu=0,so=null,t)throw Error(re(300));e===null||Vt||(e=e.dependencies,e!==null&&xs(e)&&(Vt=!0))}function Y1(e,t,n,r){Fe=e;var i=0;do{if(lo&&(so=null),qu=0,lo=!1,25<=i)throw Error(re(301));if(i+=1,Rt=tt=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}Ee.H=YA,a=t(n,r)}while(lo);return a}function jA(){var e=Ee.H,t=e.useState()[0];return t=typeof t.then=="function"?Gu(t):t,e=e.useState()[0],(tt!==null?tt.memoizedState:null)!==e&&(Fe.flags|=1024),t}function z0(){var e=Bs!==0;return Bs=0,e}function U0(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function I0(e){if(_s){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_s=!1}Ti=0,Rt=tt=Fe=null,lo=!1,qu=Bs=0,so=null}function bn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?Fe.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function Ot(){if(tt===null){var e=Fe.alternate;e=e!==null?e.memoizedState:null}else e=tt.next;var t=Rt===null?Fe.memoizedState:Rt.next;if(t!==null)Rt=t,tt=e;else{if(e===null)throw Fe.alternate===null?Error(re(467)):Error(re(310));tt=e,e={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},Rt===null?Fe.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function $0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gu(e){var t=qu;return qu+=1,so===null&&(so=[]),e=L1(so,e,t),t=Fe,(Rt===null?t.memoizedState:Rt.next)===null&&(t=t.alternate,Ee.H=t===null||t.memoizedState===null?Tv:_v),e}function Ns(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Gu(e);if(e.$$typeof===Pr)return an(e)}throw Error(re(438,String(e)))}function k0(e){var t=null,n=Fe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Fe.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=$0(),Fe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=AE;return t.index++,n}function Kr(e,t){return typeof t=="function"?t(e):t}function Fs(e){var t=Ot();return L0(t,tt,e)}function L0(e,t,n){var r=e.queue;if(r===null)throw Error(re(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var u=o=null,l=null,s=t,c=!1;do{var f=s.lane&-536870913;if(f!==s.lane?(ke&f)===f:(Ti&f)===f){var d=s.revertLane;if(d===0)l!==null&&(l=l.next={lane:0,revertLane:0,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null}),f===ao&&(c=!0);else if((Ti&d)===d){s=s.next,d===ao&&(c=!0);continue}else f={lane:0,revertLane:s.revertLane,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null},l===null?(u=l=f,o=a):l=l.next=f,Fe.lanes|=d,zi|=d;f=s.action,va&&n(a,f),a=s.hasEagerState?s.eagerState:n(a,f)}else d={lane:f,revertLane:s.revertLane,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null},l===null?(u=l=d,o=a):l=l.next=d,Fe.lanes|=f,zi|=f;s=s.next}while(s!==null&&s!==t);if(l===null?o=a:l.next=u,!Rn(a,e.memoizedState)&&(Vt=!0,c&&(n=oo,n!==null)))throw n;e.memoizedState=a,e.baseState=o,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function j0(e){var t=Ot(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);Rn(a,t.memoizedState)||(Vt=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function X1(e,t,n){var r=Fe,i=Ot(),a=qe;if(a){if(n===void 0)throw Error(re(407));n=n()}else n=t();var o=!Rn((tt||i).memoizedState,n);o&&(i.memoizedState=n,Vt=!0),i=i.queue;var u=Q1.bind(null,r,i,e);if(Vu(2048,8,u,[e]),i.getSnapshot!==t||o||Rt!==null&&Rt.memoizedState.tag&1){if(r.flags|=2048,co(9,Rs(),K1.bind(null,r,i,n,t),null),lt===null)throw Error(re(349));a||Ti&124||Z1(r,t,n)}return n}function Z1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Fe.updateQueue,t===null?(t=$0(),Fe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function K1(e,t,n,r){t.value=n,t.getSnapshot=r,W1(t)&&J1(e)}function Q1(e,t,n){return n(function(){W1(t)&&J1(e)})}function W1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Rn(e,n)}catch{return!0}}function J1(e){var t=to(e,2);t!==null&&kn(t,e,2)}function P0(e){var t=bn();if(typeof e=="function"){var n=e;if(e=n(),va){Si(!0);try{n()}finally{Si(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kr,lastRenderedState:e},t}function ev(e,t,n,r){return e.baseState=n,L0(e,tt,typeof r=="function"?r:Kr)}function PA(e,t,n,r,i){if(zs(e))throw Error(re(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){a.listeners.push(o)}};Ee.T!==null?n(!0):a.isTransition=!1,r(a),n=t.pending,n===null?(a.next=t.pending=a,tv(t,a)):(a.next=n.next,t.pending=n.next=a)}}function tv(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=Ee.T,o={};Ee.T=o;try{var u=n(i,r),l=Ee.S;l!==null&&l(o,u),nv(e,t,u)}catch(s){H0(e,t,s)}finally{Ee.T=a}}else try{a=n(i,r),nv(e,t,a)}catch(s){H0(e,t,s)}}function nv(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){rv(e,t,r)},function(r){return H0(e,t,r)}):rv(e,t,n)}function rv(e,t,n){t.status="fulfilled",t.value=n,iv(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,tv(e,n)))}function H0(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,iv(t),t=t.next;while(t!==r)}e.action=null}function iv(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function av(e,t){return t}function ov(e,t){if(qe){var n=lt.formState;if(n!==null){e:{var r=Fe;if(qe){if(Et){t:{for(var i=Et,a=Cr;i.nodeType!==8;){if(!a){i=null;break t}if(i=mr(i.nextSibling),i===null){i=null;break t}}a=i.data,i=a==="F!"||a==="F"?i:null}if(i){Et=mr(i.nextSibling),r=i.data==="F!";break e}}ha(r)}r=!1}r&&(t=n[0])}}return n=bn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:av,lastRenderedState:t},n.queue=r,n=Av.bind(null,Fe,r),r.dispatch=n,r=P0(!1),a=X0.bind(null,Fe,!1,r.queue),r=bn(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=PA.bind(null,Fe,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function uv(e){var t=Ot();return lv(t,tt,e)}function lv(e,t,n){if(t=L0(e,t,av)[0],e=Fs(Kr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Gu(t)}catch(o){throw o===ku?Cs:o}else r=t;t=Ot();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Fe.flags|=2048,co(9,Rs(),HA.bind(null,i,n),null)),[r,a,e]}function HA(e,t){e.action=t}function sv(e){var t=Ot(),n=tt;if(n!==null)return lv(t,n,e);Ot(),t=t.memoizedState,n=Ot();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function co(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Fe.updateQueue,t===null&&(t=$0(),Fe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Rs(){return{destroy:void 0,resource:void 0}}function cv(){return Ot().memoizedState}function Os(e,t,n,r){var i=bn();r=r===void 0?null:r,Fe.flags|=e,i.memoizedState=co(1|t,Rs(),n,r)}function Vu(e,t,n,r){var i=Ot();r=r===void 0?null:r;var a=i.memoizedState.inst;tt!==null&&r!==null&&R0(r,tt.memoizedState.deps)?i.memoizedState=co(t,a,n,r):(Fe.flags|=e,i.memoizedState=co(1|t,a,n,r))}function fv(e,t){Os(8390656,8,e,t)}function dv(e,t){Vu(2048,8,e,t)}function hv(e,t){return Vu(4,2,e,t)}function mv(e,t){return Vu(4,4,e,t)}function pv(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gv(e,t,n){n=n!=null?n.concat([e]):null,Vu(4,4,pv.bind(null,t,e),n)}function q0(){}function vv(e,t){var n=Ot();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&R0(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function yv(e,t){var n=Ot();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&R0(t,r[1]))return r[0];if(r=e(),va){Si(!0);try{e()}finally{Si(!1)}}return n.memoizedState=[r,t],r}function G0(e,t,n){return n===void 0||Ti&1073741824?e.memoizedState=t:(e.memoizedState=n,e=Sy(),Fe.lanes|=e,zi|=e,n)}function bv(e,t,n,r){return Rn(n,t)?n:uo.current!==null?(e=G0(e,n,r),Rn(e,t)||(Vt=!0),e):Ti&42?(e=Sy(),Fe.lanes|=e,zi|=e,t):(Vt=!0,e.memoizedState=n)}function Dv(e,t,n,r,i){var a=He.p;He.p=a!==0&&8>a?a:8;var o=Ee.T,u={};Ee.T=u,X0(e,!1,t,n);try{var l=i(),s=Ee.S;if(s!==null&&s(u,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=kA(l,r);Yu(e,t,c,$n(e))}else Yu(e,t,r,$n(e))}catch(f){Yu(e,t,{then:function(){},status:"rejected",reason:f},$n())}finally{He.p=a,Ee.T=o}}function qA(){}function V0(e,t,n,r){if(e.tag!==5)throw Error(re(476));var i=Sv(e).queue;Dv(e,i,t,ra,n===null?qA:function(){return wv(e),n(r)})}function Sv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ra,baseState:ra,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kr,lastRenderedState:ra},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kr,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function wv(e){var t=Sv(e).next.queue;Yu(e,t,{},$n())}function Y0(){return an(fl)}function xv(){return Ot().memoizedState}function Ev(){return Ot().memoizedState}function GA(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=$n();e=Ci(n);var r=Mi(t,e,n);r!==null&&(kn(r,t,n),ju(r,t,n)),t={cache:x0()},e.payload=t;return}t=t.return}}function VA(e,t,n){var r=$n();n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},zs(e)?Cv(t,n):(n=h0(e,t,n,r),n!==null&&(kn(n,e,r),Mv(n,t,r)))}function Av(e,t,n){var r=$n();Yu(e,t,n,r)}function Yu(e,t,n,r){var i={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(zs(e))Cv(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,u=a(o,n);if(i.hasEagerState=!0,i.eagerState=u,Rn(u,o))return ys(e,t,i,0),lt===null&&vs(),!1}catch{}finally{}if(n=h0(e,t,i,r),n!==null)return kn(n,e,r),Mv(n,t,r),!0}return!1}function X0(e,t,n,r){if(r={lane:2,revertLane:Ch(),action:r,hasEagerState:!1,eagerState:null,next:null},zs(e)){if(t)throw Error(re(479))}else t=h0(e,n,r,2),t!==null&&kn(t,e,2)}function zs(e){var t=e.alternate;return e===Fe||t!==null&&t===Fe}function Cv(e,t){lo=_s=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Mv(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zg(e,n)}}var Us={readContext:an,use:Ns,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t,useHostTransitionStatus:_t,useFormState:_t,useActionState:_t,useOptimistic:_t,useMemoCache:_t,useCacheRefresh:_t},Tv={readContext:an,use:Ns,useCallback:function(e,t){return bn().memoizedState=[e,t===void 0?null:t],e},useContext:an,useEffect:fv,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Os(4194308,4,pv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Os(4194308,4,e,t)},useInsertionEffect:function(e,t){Os(4,2,e,t)},useMemo:function(e,t){var n=bn();t=t===void 0?null:t;var r=e();if(va){Si(!0);try{e()}finally{Si(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=bn();if(n!==void 0){var i=n(t);if(va){Si(!0);try{n(t)}finally{Si(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=VA.bind(null,Fe,e),[r.memoizedState,e]},useRef:function(e){var t=bn();return e={current:e},t.memoizedState=e},useState:function(e){e=P0(e);var t=e.queue,n=Av.bind(null,Fe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:q0,useDeferredValue:function(e,t){var n=bn();return G0(n,e,t)},useTransition:function(){var e=P0(!1);return e=Dv.bind(null,Fe,e.queue,!0,!1),bn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Fe,i=bn();if(qe){if(n===void 0)throw Error(re(407));n=n()}else{if(n=t(),lt===null)throw Error(re(349));ke&124||Z1(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,fv(Q1.bind(null,r,a,e),[e]),r.flags|=2048,co(9,Rs(),K1.bind(null,r,a,n,t),null),n},useId:function(){var e=bn(),t=lt.identifierPrefix;if(qe){var n=Yr,r=Vr;n=(r&~(1<<32-Fn(r)-1)).toString(32)+n,t="«"+t+"R"+n,n=Bs++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=LA++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Y0,useFormState:ov,useActionState:ov,useOptimistic:function(e){var t=bn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=X0.bind(null,Fe,!0,n),n.dispatch=t,[e,t]},useMemoCache:k0,useCacheRefresh:function(){return bn().memoizedState=GA.bind(null,Fe)}},_v={readContext:an,use:Ns,useCallback:vv,useContext:an,useEffect:dv,useImperativeHandle:gv,useInsertionEffect:hv,useLayoutEffect:mv,useMemo:yv,useReducer:Fs,useRef:cv,useState:function(){return Fs(Kr)},useDebugValue:q0,useDeferredValue:function(e,t){var n=Ot();return bv(n,tt.memoizedState,e,t)},useTransition:function(){var e=Fs(Kr)[0],t=Ot().memoizedState;return[typeof e=="boolean"?e:Gu(e),t]},useSyncExternalStore:X1,useId:xv,useHostTransitionStatus:Y0,useFormState:uv,useActionState:uv,useOptimistic:function(e,t){var n=Ot();return ev(n,tt,e,t)},useMemoCache:k0,useCacheRefresh:Ev},YA={readContext:an,use:Ns,useCallback:vv,useContext:an,useEffect:dv,useImperativeHandle:gv,useInsertionEffect:hv,useLayoutEffect:mv,useMemo:yv,useReducer:j0,useRef:cv,useState:function(){return j0(Kr)},useDebugValue:q0,useDeferredValue:function(e,t){var n=Ot();return tt===null?G0(n,e,t):bv(n,tt.memoizedState,e,t)},useTransition:function(){var e=j0(Kr)[0],t=Ot().memoizedState;return[typeof e=="boolean"?e:Gu(e),t]},useSyncExternalStore:X1,useId:xv,useHostTransitionStatus:Y0,useFormState:sv,useActionState:sv,useOptimistic:function(e,t){var n=Ot();return tt!==null?ev(n,tt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:k0,useCacheRefresh:Ev},fo=null,Xu=0;function Is(e){var t=Xu;return Xu+=1,fo===null&&(fo=[]),L1(fo,e,t)}function Zu(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function $s(e,t){throw t.$$typeof===xE?Error(re(525)):(e=Object.prototype.toString.call(t),Error(re(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Bv(e){var t=e._init;return t(e._payload)}function Nv(e){function t(p,v){if(e){var y=p.deletions;y===null?(p.deletions=[v],p.flags|=16):y.push(v)}}function n(p,v){if(!e)return null;for(;v!==null;)t(p,v),v=v.sibling;return null}function r(p){for(var v=new Map;p!==null;)p.key!==null?v.set(p.key,p):v.set(p.index,p),p=p.sibling;return v}function i(p,v){return p=Gr(p,v),p.index=0,p.sibling=null,p}function a(p,v,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<v?(p.flags|=67108866,v):y):(p.flags|=67108866,v)):(p.flags|=1048576,v)}function o(p){return e&&p.alternate===null&&(p.flags|=67108866),p}function u(p,v,y,w){return v===null||v.tag!==6?(v=p0(y,p.mode,w),v.return=p,v):(v=i(v,y),v.return=p,v)}function l(p,v,y,w){var E=y.type;return E===$a?c(p,v,y.props.children,w,y.key):v!==null&&(v.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===bi&&Bv(E)===v.type)?(v=i(v,y.props),Zu(v,y),v.return=p,v):(v=Ds(y.type,y.key,y.props,null,p.mode,w),Zu(v,y),v.return=p,v)}function s(p,v,y,w){return v===null||v.tag!==4||v.stateNode.containerInfo!==y.containerInfo||v.stateNode.implementation!==y.implementation?(v=g0(y,p.mode,w),v.return=p,v):(v=i(v,y.children||[]),v.return=p,v)}function c(p,v,y,w,E){return v===null||v.tag!==7?(v=sa(y,p.mode,w,E),v.return=p,v):(v=i(v,y),v.return=p,v)}function f(p,v,y){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=p0(""+v,p.mode,y),v.return=p,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Wl:return y=Ds(v.type,v.key,v.props,null,p.mode,y),Zu(y,v),y.return=p,y;case pu:return v=g0(v,p.mode,y),v.return=p,v;case bi:var w=v._init;return v=w(v._payload),f(p,v,y)}if(vu(v)||gu(v))return v=sa(v,p.mode,y,null),v.return=p,v;if(typeof v.then=="function")return f(p,Is(v),y);if(v.$$typeof===Pr)return f(p,Es(p,v),y);$s(p,v)}return null}function d(p,v,y,w){var E=v!==null?v.key:null;if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return E!==null?null:u(p,v,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Wl:return y.key===E?l(p,v,y,w):null;case pu:return y.key===E?s(p,v,y,w):null;case bi:return E=y._init,y=E(y._payload),d(p,v,y,w)}if(vu(y)||gu(y))return E!==null?null:c(p,v,y,w,null);if(typeof y.then=="function")return d(p,v,Is(y),w);if(y.$$typeof===Pr)return d(p,v,Es(p,y),w);$s(p,y)}return null}function h(p,v,y,w,E){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return p=p.get(y)||null,u(v,p,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Wl:return p=p.get(w.key===null?y:w.key)||null,l(v,p,w,E);case pu:return p=p.get(w.key===null?y:w.key)||null,s(v,p,w,E);case bi:var b=w._init;return w=b(w._payload),h(p,v,y,w,E)}if(vu(w)||gu(w))return p=p.get(y)||null,c(v,p,w,E,null);if(typeof w.then=="function")return h(p,v,y,Is(w),E);if(w.$$typeof===Pr)return h(p,v,y,Es(v,w),E);$s(v,w)}return null}function g(p,v,y,w){for(var E=null,b=null,S=v,A=v=0,C=null;S!==null&&A<y.length;A++){S.index>A?(C=S,S=null):C=S.sibling;var M=d(p,S,y[A],w);if(M===null){S===null&&(S=C);break}e&&S&&M.alternate===null&&t(p,S),v=a(M,v,A),b===null?E=M:b.sibling=M,b=M,S=C}if(A===y.length)return n(p,S),qe&&fa(p,A),E;if(S===null){for(;A<y.length;A++)S=f(p,y[A],w),S!==null&&(v=a(S,v,A),b===null?E=S:b.sibling=S,b=S);return qe&&fa(p,A),E}for(S=r(S);A<y.length;A++)C=h(S,p,A,y[A],w),C!==null&&(e&&C.alternate!==null&&S.delete(C.key===null?A:C.key),v=a(C,v,A),b===null?E=C:b.sibling=C,b=C);return e&&S.forEach(function(T){return t(p,T)}),qe&&fa(p,A),E}function m(p,v,y,w){if(y==null)throw Error(re(151));for(var E=null,b=null,S=v,A=v=0,C=null,M=y.next();S!==null&&!M.done;A++,M=y.next()){S.index>A?(C=S,S=null):C=S.sibling;var T=d(p,S,M.value,w);if(T===null){S===null&&(S=C);break}e&&S&&T.alternate===null&&t(p,S),v=a(T,v,A),b===null?E=T:b.sibling=T,b=T,S=C}if(M.done)return n(p,S),qe&&fa(p,A),E;if(S===null){for(;!M.done;A++,M=y.next())M=f(p,M.value,w),M!==null&&(v=a(M,v,A),b===null?E=M:b.sibling=M,b=M);return qe&&fa(p,A),E}for(S=r(S);!M.done;A++,M=y.next())M=h(S,p,A,M.value,w),M!==null&&(e&&M.alternate!==null&&S.delete(M.key===null?A:M.key),v=a(M,v,A),b===null?E=M:b.sibling=M,b=M);return e&&S.forEach(function(x){return t(p,x)}),qe&&fa(p,A),E}function D(p,v,y,w){if(typeof y=="object"&&y!==null&&y.type===$a&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Wl:e:{for(var E=y.key;v!==null;){if(v.key===E){if(E=y.type,E===$a){if(v.tag===7){n(p,v.sibling),w=i(v,y.props.children),w.return=p,p=w;break e}}else if(v.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===bi&&Bv(E)===v.type){n(p,v.sibling),w=i(v,y.props),Zu(w,y),w.return=p,p=w;break e}n(p,v);break}else t(p,v);v=v.sibling}y.type===$a?(w=sa(y.props.children,p.mode,w,y.key),w.return=p,p=w):(w=Ds(y.type,y.key,y.props,null,p.mode,w),Zu(w,y),w.return=p,p=w)}return o(p);case pu:e:{for(E=y.key;v!==null;){if(v.key===E)if(v.tag===4&&v.stateNode.containerInfo===y.containerInfo&&v.stateNode.implementation===y.implementation){n(p,v.sibling),w=i(v,y.children||[]),w.return=p,p=w;break e}else{n(p,v);break}else t(p,v);v=v.sibling}w=g0(y,p.mode,w),w.return=p,p=w}return o(p);case bi:return E=y._init,y=E(y._payload),D(p,v,y,w)}if(vu(y))return g(p,v,y,w);if(gu(y)){if(E=gu(y),typeof E!="function")throw Error(re(150));return y=E.call(y),m(p,v,y,w)}if(typeof y.then=="function")return D(p,v,Is(y),w);if(y.$$typeof===Pr)return D(p,v,Es(p,y),w);$s(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,v!==null&&v.tag===6?(n(p,v.sibling),w=i(v,y),w.return=p,p=w):(n(p,v),w=p0(y,p.mode,w),w.return=p,p=w),o(p)):n(p,v)}return function(p,v,y,w){try{Xu=0;var E=D(p,v,y,w);return fo=null,E}catch(S){if(S===ku||S===Cs)throw S;var b=On(29,S,null,p.mode);return b.lanes=w,b.return=p,b}finally{}}}var ho=Nv(!0),Fv=Nv(!1),er=xr(null),Mr=null;function _i(e){var t=e.alternate;gt(Pt,Pt.current&1),gt(er,e),Mr===null&&(t===null||uo.current!==null||t.memoizedState!==null)&&(Mr=e)}function Rv(e){if(e.tag===22){if(gt(Pt,Pt.current),gt(er,e),Mr===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Mr=e)}}else Bi()}function Bi(){gt(Pt,Pt.current),gt(er,er.current)}function Qr(e){qt(er),Mr===e&&(Mr=null),qt(Pt)}var Pt=xr(0);function ks(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||$h(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Z0(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:dt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var K0={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=$n(),i=Ci(r);i.payload=t,n!=null&&(i.callback=n),t=Mi(e,i,r),t!==null&&(kn(t,e,r),ju(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=$n(),i=Ci(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Mi(e,i,r),t!==null&&(kn(t,e,r),ju(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$n(),r=Ci(n);r.tag=2,t!=null&&(r.callback=t),t=Mi(e,r,n),t!==null&&(kn(t,e,n),ju(t,e,n))}};function Ov(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Nu(n,r)||!Nu(i,a):!0}function zv(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&K0.enqueueReplaceState(t,t.state,null)}function ya(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=dt({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}var Ls=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Uv(e){Ls(e)}function Iv(e){console.error(e)}function $v(e){Ls(e)}function js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function kv(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Q0(e,t,n){return n=Ci(n),n.tag=3,n.payload={element:null},n.callback=function(){js(e,t)},n}function Lv(e){return e=Ci(e),e.tag=3,e}function jv(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){kv(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){kv(t,n,r),typeof i!="function"&&(Ui===null?Ui=new Set([this]):Ui.add(this));var u=r.stack;this.componentDidCatch(r.value,{componentStack:u!==null?u:""})})}function XA(e,t,n,r,i){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&Uu(t,n,i,!0),n=er.current,n!==null){switch(n.tag){case 13:return Mr===null?Sh():n.alternate===null&&At===0&&(At=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===C0?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),xh(e,r,i)),!1;case 22:return n.flags|=65536,r===C0?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),xh(e,r,i)),!1}throw Error(re(435,n.tag))}return xh(e,r,i),Sh(),!1}if(qe)return t=er.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==b0&&(e=Error(re(422),{cause:r}),zu(Kn(e,n)))):(r!==b0&&(t=Error(re(423),{cause:r}),zu(Kn(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Kn(r,n),i=Q0(e.stateNode,r,i),_0(e,i),At!==4&&(At=2)),!1;var a=Error(re(520),{cause:r});if(a=Kn(a,n),nl===null?nl=[a]:nl.push(a),At!==4&&(At=2),t===null)return!0;r=Kn(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Q0(n.stateNode,r,e),_0(n,e),!1;case 1:if(t=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(Ui===null||!Ui.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Lv(i),jv(i,e,n,r),_0(n,i),!1}n=n.return}while(n!==null);return!1}var Pv=Error(re(461)),Vt=!1;function Wt(e,t,n,r){t.child=e===null?Fv(t,null,n,r):ho(t,e.child,n,r)}function Hv(e,t,n,r,i){n=n.render;var a=t.ref;if("ref"in r){var o={};for(var u in r)u!=="ref"&&(o[u]=r[u])}else o=r;return pa(t),r=O0(e,t,n,o,a,i),u=z0(),e!==null&&!Vt?(U0(e,t,i),Wr(e,t,i)):(qe&&u&&v0(t),t.flags|=1,Wt(e,t,r,i),t.child)}function qv(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!m0(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Gv(e,t,a,r,i)):(e=Ds(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ah(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:Nu,n(o,r)&&e.ref===t.ref)return Wr(e,t,i)}return t.flags|=1,e=Gr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Gv(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Nu(a,r)&&e.ref===t.ref)if(Vt=!1,t.pendingProps=r=a,ah(e,i))e.flags&131072&&(Vt=!0);else return t.lanes=e.lanes,Wr(e,t,i)}return W0(e,t,n,r,i)}function Vv(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden"){if(t.flags&128){if(r=a!==null?a.baseLanes|n:n,e!==null){for(i=t.child=e.child,a=0;i!==null;)a=a|i.lanes|i.childLanes,i=i.sibling;t.childLanes=a&~r}else t.childLanes=0,t.child=null;return Yv(e,t,r,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&As(t,a!==null?a.cachePool:null),a!==null?G1(t,a):N0(),Rv(t);else return t.lanes=t.childLanes=536870912,Yv(e,t,a!==null?a.baseLanes|n:n,n)}else a!==null?(As(t,a.cachePool),G1(t,a),Bi(),t.memoizedState=null):(e!==null&&As(t,null),N0(),Bi());return Wt(e,t,i,n),t.child}function Yv(e,t,n,r){var i=A0();return i=i===null?null:{parent:jt._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&As(t,null),N0(),Rv(t),e!==null&&Uu(e,t,r,!0),null}function Ps(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(re(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function W0(e,t,n,r,i){return pa(t),n=O0(e,t,n,r,void 0,i),r=z0(),e!==null&&!Vt?(U0(e,t,i),Wr(e,t,i)):(qe&&r&&v0(t),t.flags|=1,Wt(e,t,n,i),t.child)}function Xv(e,t,n,r,i,a){return pa(t),t.updateQueue=null,n=Y1(t,r,n,i),V1(e),r=z0(),e!==null&&!Vt?(U0(e,t,a),Wr(e,t,a)):(qe&&r&&v0(t),t.flags|=1,Wt(e,t,n,a),t.child)}function Zv(e,t,n,r,i){if(pa(t),t.stateNode===null){var a=no,o=n.contextType;typeof o=="object"&&o!==null&&(a=an(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=K0,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},M0(t),o=n.contextType,a.context=typeof o=="object"&&o!==null?an(o):no,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(Z0(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(o=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),o!==a.state&&K0.enqueueReplaceState(a,a.state,null),Hu(t,r,a,i),Pu(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var u=t.memoizedProps,l=ya(n,u);a.props=l;var s=a.context,c=n.contextType;o=no,typeof c=="object"&&c!==null&&(o=an(c));var f=n.getDerivedStateFromProps;c=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function",u=t.pendingProps!==u,c||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u||s!==o)&&zv(t,a,r,o),Ai=!1;var d=t.memoizedState;a.state=d,Hu(t,r,a,i),Pu(),s=t.memoizedState,u||d!==s||Ai?(typeof f=="function"&&(Z0(t,n,f,r),s=t.memoizedState),(l=Ai||Ov(t,n,l,r,d,s,o))?(c||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),a.props=r,a.state=s,a.context=o,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,T0(e,t),o=t.memoizedProps,c=ya(n,o),a.props=c,f=t.pendingProps,d=a.context,s=n.contextType,l=no,typeof s=="object"&&s!==null&&(l=an(s)),u=n.getDerivedStateFromProps,(s=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||d!==l)&&zv(t,a,r,l),Ai=!1,d=t.memoizedState,a.state=d,Hu(t,r,a,i),Pu();var h=t.memoizedState;o!==f||d!==h||Ai||e!==null&&e.dependencies!==null&&xs(e.dependencies)?(typeof u=="function"&&(Z0(t,n,u,r),h=t.memoizedState),(c=Ai||Ov(t,n,c,r,d,h,l)||e!==null&&e.dependencies!==null&&xs(e.dependencies))?(s||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,h,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,h,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=l,r=c):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Ps(e,t),r=(t.flags&128)!==0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ho(t,e.child,null,i),t.child=ho(t,null,n,i)):Wt(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Wr(e,t,i),e}function Kv(e,t,n,r){return Ou(),t.flags|=256,Wt(e,t,n,r),t.child}var J0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function eh(e){return{baseLanes:e,cachePool:I1()}}function th(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=tr),e}function Qv(e,t,n){var r=t.pendingProps,i=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(Pt.current&2)!==0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(qe){if(i?_i(t):Bi(),qe){var u=Et,l;if(l=u){e:{for(l=u,u=Cr;l.nodeType!==8;){if(!u){u=null;break e}if(l=mr(l.nextSibling),l===null){u=null;break e}}u=l}u!==null?(t.memoizedState={dehydrated:u,treeContext:ca!==null?{id:Vr,overflow:Yr}:null,retryLane:536870912,hydrationErrors:null},l=On(18,null,null,0),l.stateNode=u,l.return=t,t.child=l,hn=t,Et=null,l=!0):l=!1}l||ha(t)}if(u=t.memoizedState,u!==null&&(u=u.dehydrated,u!==null))return $h(u)?t.lanes=32:t.lanes=536870912,null;Qr(t)}return u=r.children,r=r.fallback,i?(Bi(),i=t.mode,u=Hs({mode:"hidden",children:u},i),r=sa(r,i,n,null),u.return=t,r.return=t,u.sibling=r,t.child=u,i=t.child,i.memoizedState=eh(n),i.childLanes=th(e,o,n),t.memoizedState=J0,r):(_i(t),nh(t,u))}if(l=e.memoizedState,l!==null&&(u=l.dehydrated,u!==null)){if(a)t.flags&256?(_i(t),t.flags&=-257,t=rh(e,t,n)):t.memoizedState!==null?(Bi(),t.child=e.child,t.flags|=128,t=null):(Bi(),i=r.fallback,u=t.mode,r=Hs({mode:"visible",children:r.children},u),i=sa(i,u,n,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,ho(t,e.child,null,n),r=t.child,r.memoizedState=eh(n),r.childLanes=th(e,o,n),t.memoizedState=J0,t=i);else if(_i(t),$h(u)){if(o=u.nextSibling&&u.nextSibling.dataset,o)var s=o.dgst;o=s,r=Error(re(419)),r.stack="",r.digest=o,zu({value:r,source:null,stack:null}),t=rh(e,t,n)}else if(Vt||Uu(e,t,n,!1),o=(n&e.childLanes)!==0,Vt||o){if(o=lt,o!==null&&(r=n&-n,r=r&42?1:kd(r),r=r&(o.suspendedLanes|n)?0:r,r!==0&&r!==l.retryLane))throw l.retryLane=r,to(e,r),kn(o,e,r),Pv;u.data==="$?"||Sh(),t=rh(e,t,n)}else u.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Et=mr(u.nextSibling),hn=t,qe=!0,da=null,Cr=!1,e!==null&&(Wn[Jn++]=Vr,Wn[Jn++]=Yr,Wn[Jn++]=ca,Vr=e.id,Yr=e.overflow,ca=t),t=nh(t,r.children),t.flags|=4096);return t}return i?(Bi(),i=r.fallback,u=t.mode,l=e.child,s=l.sibling,r=Gr(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,s!==null?i=Gr(s,i):(i=sa(i,u,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,u=e.child.memoizedState,u===null?u=eh(n):(l=u.cachePool,l!==null?(s=jt._currentValue,l=l.parent!==s?{parent:s,pool:s}:l):l=I1(),u={baseLanes:u.baseLanes|n,cachePool:l}),i.memoizedState=u,i.childLanes=th(e,o,n),t.memoizedState=J0,r):(_i(t),n=e.child,e=n.sibling,n=Gr(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function nh(e,t){return t=Hs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Hs(e,t){return e=On(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function rh(e,t,n){return ho(t,e.child,null,n),e=nh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),S0(e.return,t,n)}function ih(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function Jv(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Wt(e,t,r.children,n),r=Pt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Wv(e,n,t);else if(e.tag===19)Wv(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(gt(Pt,r),i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ks(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ih(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ks(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ih(t,!0,n,null,a);break;case"together":ih(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Wr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),zi|=t.lanes,!(n&t.childLanes))if(e!==null){if(Uu(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(re(153));if(t.child!==null){for(e=t.child,n=Gr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Gr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ah(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&xs(e)))}function ZA(e,t,n){switch(t.tag){case 3:es(t,t.stateNode.containerInfo),Ei(t,jt,e.memoizedState.cache),Ou();break;case 27:case 5:Od(t);break;case 4:es(t,t.stateNode.containerInfo);break;case 10:Ei(t,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(_i(t),t.flags|=128,null):n&t.child.childLanes?Qv(e,t,n):(_i(t),e=Wr(e,t,n),e!==null?e.sibling:null);_i(t);break;case 19:var i=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(Uu(e,t,n,!1),r=(n&t.childLanes)!==0),i){if(r)return Jv(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),gt(Pt,Pt.current),r)break;return null;case 22:case 23:return t.lanes=0,Vv(e,t,n);case 24:Ei(t,jt,e.memoizedState.cache)}return Wr(e,t,n)}function ey(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Vt=!0;else{if(!ah(e,n)&&!(t.flags&128))return Vt=!1,ZA(e,t,n);Vt=!!(e.flags&131072)}else Vt=!1,qe&&t.flags&1048576&&B1(t,ws,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,i=r._init;if(r=i(r._payload),t.type=r,typeof r=="function")m0(r)?(e=ya(r,e),t.tag=1,t=Zv(null,t,r,e,n)):(t.tag=0,t=W0(null,t,r,e,n));else{if(r!=null){if(i=r.$$typeof,i===Md){t.tag=11,t=Hv(null,t,r,e,n);break e}else if(i===Bd){t.tag=14,t=qv(null,t,r,e,n);break e}}throw t=Fd(r)||r,Error(re(306,t,""))}}return t;case 0:return W0(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=ya(r,t.pendingProps),Zv(e,t,r,i,n);case 3:e:{if(es(t,t.stateNode.containerInfo),e===null)throw Error(re(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,T0(e,t),Hu(t,r,null,n);var o=t.memoizedState;if(r=o.cache,Ei(t,jt,r),r!==a.cache&&w0(t,[jt],n,!0),Pu(),r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Kv(e,t,r,n);break e}else if(r!==i){i=Kn(Error(re(424)),t),zu(i),t=Kv(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Et=mr(e.firstChild),hn=t,qe=!0,da=null,Cr=!0,n=Fv(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ou(),r===i){t=Wr(e,t,n);break e}Wt(e,t,r,n)}t=t.child}return t;case 26:return Ps(e,t),e===null?(n=ib(t.type,null,t.pendingProps,null))?t.memoizedState=n:qe||(n=t.type,e=t.pendingProps,r=rc(Di.current).createElement(n),r[rn]=t,r[vn]=e,en(r,n,e),Gt(r),t.stateNode=r):t.memoizedState=ib(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Od(t),e===null&&qe&&(r=t.stateNode=tb(t.type,t.pendingProps,Di.current),hn=t,Cr=!0,i=Et,ki(t.type)?(kh=i,Et=mr(r.firstChild)):Et=i),Wt(e,t,t.pendingProps.children,n),Ps(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&qe&&((i=r=Et)&&(r=x3(r,t.type,t.pendingProps,Cr),r!==null?(t.stateNode=r,hn=t,Et=mr(r.firstChild),Cr=!1,i=!0):i=!1),i||ha(t)),Od(t),i=t.type,a=t.pendingProps,o=e!==null?e.memoizedProps:null,r=a.children,zh(i,a)?r=null:o!==null&&zh(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=O0(e,t,jA,null,null,n),fl._currentValue=i),Ps(e,t),Wt(e,t,r,n),t.child;case 6:return e===null&&qe&&((e=n=Et)&&(n=E3(n,t.pendingProps,Cr),n!==null?(t.stateNode=n,hn=t,Et=null,e=!0):e=!1),e||ha(t)),null;case 13:return Qv(e,t,n);case 4:return es(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ho(t,null,r,n):Wt(e,t,r,n),t.child;case 11:return Hv(e,t,t.type,t.pendingProps,n);case 7:return Wt(e,t,t.pendingProps,n),t.child;case 8:return Wt(e,t,t.pendingProps.children,n),t.child;case 12:return Wt(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ei(t,t.type,r.value),Wt(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,pa(t),i=an(i),r=r(i),t.flags|=1,Wt(e,t,r,n),t.child;case 14:return qv(e,t,t.type,t.pendingProps,n);case 15:return Gv(e,t,t.type,t.pendingProps,n);case 19:return Jv(e,t,n);case 31:return r=t.pendingProps,n=t.mode,r={mode:r.mode,children:r.children},e===null?(n=Hs(r,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=Gr(e.child,r),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return Vv(e,t,n);case 24:return pa(t),r=an(jt),e===null?(i=A0(),i===null&&(i=lt,a=x0(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},M0(t),Ei(t,jt,i)):(e.lanes&n&&(T0(e,t),Hu(t,null,null,n),Pu()),i=e.memoizedState,a=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ei(t,jt,r)):(r=a.cache,Ei(t,jt,r),r!==i.cache&&w0(t,[jt],n,!0))),Wt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(re(156,t.tag))}function Jr(e){e.flags|=4}function ty(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!sb(t)){if(t=er.current,t!==null&&((ke&4194048)===ke?Mr!==null:(ke&62914560)!==ke&&!(ke&536870912)||t!==Mr))throw Lu=C0,$1;e.flags|=8192}}function qs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Rg():536870912,e.lanes|=t,vo|=t)}function Ku(e,t){if(!qe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function KA(e,t,n){var r=t.pendingProps;switch(y0(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return St(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Zr(jt),La(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ru(t)?Jr(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,R1())),St(t),null;case 26:return n=t.memoizedState,e===null?(Jr(t),n!==null?(St(t),ty(t,n)):(St(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Jr(t),St(t),ty(t,n)):(St(t),t.flags&=-16777217):(e.memoizedProps!==r&&Jr(t),St(t),t.flags&=-16777217),null;case 27:ts(t),n=Di.current;var i=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Jr(t);else{if(!r){if(t.stateNode===null)throw Error(re(166));return St(t),null}e=Er.current,Ru(t)?N1(t):(e=tb(i,r,n),t.stateNode=e,Jr(t))}return St(t),null;case 5:if(ts(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Jr(t);else{if(!r){if(t.stateNode===null)throw Error(re(166));return St(t),null}if(e=Er.current,Ru(t))N1(t);else{switch(i=rc(Di.current),e){case 1:e=i.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=i.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e=typeof r.is=="string"?i.createElement(n,{is:r.is}):i.createElement(n)}}e[rn]=t,e[vn]=r;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=e;e:switch(en(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Jr(t)}}return St(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Jr(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(re(166));if(e=Di.current,Ru(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=hn,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[rn]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Xy(e.nodeValue,n)),e||ha(t)}else e=rc(e).createTextNode(r),e[rn]=t,t.stateNode=e}return St(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ru(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(re(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(re(317));i[rn]=t}else Ou(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;St(t),i=!1}else i=R1(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Qr(t),t):(Qr(t),null)}if(Qr(t),t.flags&128)return t.lanes=n,t;if(n=r!==null,e=e!==null&&e.memoizedState!==null,n){r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool);var a=null;r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),qs(t,t.updateQueue),St(t),null;case 4:return La(),e===null&&Bh(t.stateNode.containerInfo),St(t),null;case 10:return Zr(t.type),St(t),null;case 19:if(qt(Pt),i=t.memoizedState,i===null)return St(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)Ku(i,!1);else{if(At!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=ks(e),a!==null){for(t.flags|=128,Ku(i,!1),e=a.updateQueue,t.updateQueue=e,qs(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)_1(n,e),n=n.sibling;return gt(Pt,Pt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ar()>Ys&&(t.flags|=128,r=!0,Ku(i,!1),t.lanes=4194304)}else{if(!r)if(e=ks(a),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,qs(t,e),Ku(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!qe)return St(t),null}else 2*Ar()-i.renderingStartTime>Ys&&n!==536870912&&(t.flags|=128,r=!0,Ku(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(e=i.last,e!==null?e.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ar(),t.sibling=null,e=Pt.current,gt(Pt,r?e&1|2:e&1),t):(St(t),null);case 22:case 23:return Qr(t),F0(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),n=t.updateQueue,n!==null&&qs(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&qt(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Zr(jt),St(t),null;case 25:return null;case 30:return null}throw Error(re(156,t.tag))}function QA(e,t){switch(y0(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zr(jt),La(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ts(t),null;case 13:if(Qr(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));Ou()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qt(Pt),null;case 4:return La(),null;case 10:return Zr(t.type),null;case 22:case 23:return Qr(t),F0(),e!==null&&qt(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Zr(jt),null;case 25:return null;default:return null}}function ny(e,t){switch(y0(t),t.tag){case 3:Zr(jt),La();break;case 26:case 27:case 5:ts(t);break;case 4:La();break;case 13:Qr(t);break;case 19:qt(Pt);break;case 10:Zr(t.type);break;case 22:case 23:Qr(t),F0(),e!==null&&qt(ga);break;case 24:Zr(jt)}}function Qu(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(u){it(t,t.return,u)}}function Ni(e,t,n){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,u=o.destroy;if(u!==void 0){o.destroy=void 0,i=t;var l=n,s=u;try{s()}catch(c){it(i,l,c)}}}r=r.next}while(r!==a)}}catch(c){it(t,t.return,c)}}function ry(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{q1(t,n)}catch(r){it(e,e.return,r)}}}function iy(e,t,n){n.props=ya(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){it(e,t,r)}}function Wu(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(i){it(e,t,i)}}function Tr(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(i){it(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){it(e,t,i)}else n.current=null}function ay(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){it(e,e.return,i)}}function oh(e,t,n){try{var r=e.stateNode;y3(r,e.type,n,t),r[vn]=t}catch(i){it(e,e.return,i)}}function oy(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ki(e.type)||e.tag===4}function uh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||oy(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ki(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function lh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nc));else if(r!==4&&(r===27&&ki(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(lh(e,t,n),e=e.sibling;e!==null;)lh(e,t,n),e=e.sibling}function Gs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&ki(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Gs(e,t,n),e=e.sibling;e!==null;)Gs(e,t,n),e=e.sibling}function uy(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);en(t,r,n),t[rn]=e,t[vn]=n}catch(a){it(e,e.return,a)}}var ei=!1,Bt=!1,sh=!1,ly=typeof WeakSet=="function"?WeakSet:Set,Yt=null;function WA(e,t){if(e=e.containerInfo,Rh=sc,e=b1(e),u0(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,u=-1,l=-1,s=0,c=0,f=e,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(u=o+i),f!==a||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++s===i&&(u=o),d===a&&++c===r&&(l=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=u===-1||l===-1?null:{start:u,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Oh={focusedElem:e,selectionRange:n},sc=!1,Yt=t;Yt!==null;)if(t=Yt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Yt=e;else for(;Yt!==null;){switch(t=Yt,a=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var g=ya(n.type,i,n.elementType===n.type);e=r.getSnapshotBeforeUpdate(g,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(m){it(n,n.return,m)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Ih(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ih(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(re(163))}if(e=t.sibling,e!==null){e.return=t.return,Yt=e;break}Yt=t.return}}function sy(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Fi(e,n),r&4&&Qu(5,n);break;case 1:if(Fi(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){it(n,n.return,o)}else{var i=ya(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){it(n,n.return,o)}}r&64&&ry(n),r&512&&Wu(n,n.return);break;case 3:if(Fi(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{q1(e,t)}catch(o){it(n,n.return,o)}}break;case 27:t===null&&r&4&&uy(n);case 26:case 5:Fi(e,n),t===null&&r&4&&ay(n),r&512&&Wu(n,n.return);break;case 12:Fi(e,n);break;case 13:Fi(e,n),r&4&&dy(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=u3.bind(null,n),A3(e,n))));break;case 22:if(r=n.memoizedState!==null||ei,!r){t=t!==null&&t.memoizedState!==null||Bt,i=ei;var a=Bt;ei=r,(Bt=t)&&!a?Ri(e,n,(n.subtreeFlags&8772)!==0):Fi(e,n),ei=i,Bt=a}break;case 30:break;default:Fi(e,n)}}function cy(e){var t=e.alternate;t!==null&&(e.alternate=null,cy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pd(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var vt=null,Dn=!1;function ti(e,t,n){for(n=n.child;n!==null;)fy(e,t,n),n=n.sibling}function fy(e,t,n){if(Nn&&typeof Nn.onCommitFiberUnmount=="function")try{Nn.onCommitFiberUnmount(bu,n)}catch{}switch(n.tag){case 26:Bt||Tr(n,t),ti(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Bt||Tr(n,t);var r=vt,i=Dn;ki(n.type)&&(vt=n.stateNode,Dn=!1),ti(e,t,n),ul(n.stateNode),vt=r,Dn=i;break;case 5:Bt||Tr(n,t);case 6:if(r=vt,i=Dn,vt=null,ti(e,t,n),vt=r,Dn=i,vt!==null)if(Dn)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(n.stateNode)}catch(a){it(n,t,a)}else try{vt.removeChild(n.stateNode)}catch(a){it(n,t,a)}break;case 18:vt!==null&&(Dn?(e=vt,Jy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),pl(e)):Jy(vt,n.stateNode));break;case 4:r=vt,i=Dn,vt=n.stateNode.containerInfo,Dn=!0,ti(e,t,n),vt=r,Dn=i;break;case 0:case 11:case 14:case 15:Bt||Ni(2,n,t),Bt||Ni(4,n,t),ti(e,t,n);break;case 1:Bt||(Tr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&iy(n,t,r)),ti(e,t,n);break;case 21:ti(e,t,n);break;case 22:Bt=(r=Bt)||n.memoizedState!==null,ti(e,t,n),Bt=r;break;default:ti(e,t,n)}}function dy(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{pl(e)}catch(n){it(t,t.return,n)}}function JA(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ly),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ly),t;default:throw Error(re(435,e.tag))}}function ch(e,t){var n=JA(e);t.forEach(function(r){var i=l3.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}function zn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],a=e,o=t,u=o;e:for(;u!==null;){switch(u.tag){case 27:if(ki(u.type)){vt=u.stateNode,Dn=!1;break e}break;case 5:vt=u.stateNode,Dn=!1;break e;case 3:case 4:vt=u.stateNode.containerInfo,Dn=!0;break e}u=u.return}if(vt===null)throw Error(re(160));fy(a,o,i),vt=null,Dn=!1,a=i.alternate,a!==null&&(a.return=null),i.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)hy(t,e),t=t.sibling}var hr=null;function hy(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:zn(t,e),Un(e),r&4&&(Ni(3,e,e.return),Qu(3,e),Ni(5,e,e.return));break;case 1:zn(t,e),Un(e),r&512&&(Bt||n===null||Tr(n,n.return)),r&64&&ei&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=hr;if(zn(t,e),Un(e),r&512&&(Bt||n===null||Tr(n,n.return)),r&4){var a=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":a=i.getElementsByTagName("title")[0],(!a||a[wu]||a[rn]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=i.createElement(r),i.head.insertBefore(a,i.querySelector("head > title"))),en(a,r,n),a[rn]=e,Gt(a),r=a;break e;case"link":var o=ub("link","href",i).get(r+(n.href||""));if(o){for(var u=0;u<o.length;u++)if(a=o[u],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(u,1);break t}}a=i.createElement(r),en(a,r,n),i.head.appendChild(a);break;case"meta":if(o=ub("meta","content",i).get(r+(n.content||""))){for(u=0;u<o.length;u++)if(a=o[u],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(u,1);break t}}a=i.createElement(r),en(a,r,n),i.head.appendChild(a);break;default:throw Error(re(468,r))}a[rn]=e,Gt(a),r=a}e.stateNode=r}else lb(i,e.type,e.stateNode);else e.stateNode=ob(i,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?lb(i,e.type,e.stateNode):ob(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&oh(e,e.memoizedProps,n.memoizedProps)}break;case 27:zn(t,e),Un(e),r&512&&(Bt||n===null||Tr(n,n.return)),n!==null&&r&4&&oh(e,e.memoizedProps,n.memoizedProps);break;case 5:if(zn(t,e),Un(e),r&512&&(Bt||n===null||Tr(n,n.return)),e.flags&32){i=e.stateNode;try{Xa(i,"")}catch(h){it(e,e.return,h)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,oh(e,i,n!==null?n.memoizedProps:i)),r&1024&&(sh=!0);break;case 6:if(zn(t,e),Un(e),r&4){if(e.stateNode===null)throw Error(re(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(h){it(e,e.return,h)}}break;case 3:if(oc=null,i=hr,hr=ic(t.containerInfo),zn(t,e),hr=i,Un(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{pl(t.containerInfo)}catch(h){it(e,e.return,h)}sh&&(sh=!1,my(e));break;case 4:r=hr,hr=ic(e.stateNode.containerInfo),zn(t,e),Un(e),hr=r;break;case 12:zn(t,e),Un(e);break;case 13:zn(t,e),Un(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(gh=Ar()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ch(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,s=ei,c=Bt;if(ei=s||i,Bt=c||l,zn(t,e),Bt=c,ei=s,Un(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||ei||Bt||ba(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(a=l.stateNode,i)o=a.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{u=l.stateNode;var f=l.memoizedProps.style,d=f!=null&&f.hasOwnProperty("display")?f.display:null;u.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(h){it(l,l.return,h)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?"":l.memoizedProps}catch(h){it(l,l.return,h)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ch(e,n))));break;case 19:zn(t,e),Un(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ch(e,r)));break;case 30:break;case 21:break;default:zn(t,e),Un(e)}}function Un(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(oy(r)){n=r;break}r=r.return}if(n==null)throw Error(re(160));switch(n.tag){case 27:var i=n.stateNode,a=uh(e);Gs(e,a,i);break;case 5:var o=n.stateNode;n.flags&32&&(Xa(o,""),n.flags&=-33);var u=uh(e);Gs(e,u,o);break;case 3:case 4:var l=n.stateNode.containerInfo,s=uh(e);lh(e,s,l);break;default:throw Error(re(161))}}catch(c){it(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function my(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;my(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Fi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sy(e,t.alternate,t),t=t.sibling}function ba(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ni(4,t,t.return),ba(t);break;case 1:Tr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&iy(t,t.return,n),ba(t);break;case 27:ul(t.stateNode);case 26:case 5:Tr(t,t.return),ba(t);break;case 22:t.memoizedState===null&&ba(t);break;case 30:ba(t);break;default:ba(t)}e=e.sibling}}function Ri(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Ri(i,a,n),Qu(4,a);break;case 1:if(Ri(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(s){it(r,r.return,s)}if(r=a,i=r.updateQueue,i!==null){var u=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)H1(l[i],u)}catch(s){it(r,r.return,s)}}n&&o&64&&ry(a),Wu(a,a.return);break;case 27:uy(a);case 26:case 5:Ri(i,a,n),n&&r===null&&o&4&&ay(a),Wu(a,a.return);break;case 12:Ri(i,a,n);break;case 13:Ri(i,a,n),n&&o&4&&dy(i,a);break;case 22:a.memoizedState===null&&Ri(i,a,n),Wu(a,a.return);break;case 30:break;default:Ri(i,a,n)}t=t.sibling}}function fh(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Iu(n))}function dh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Iu(e))}function _r(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)py(e,t,n,r),t=t.sibling}function py(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:_r(e,t,n,r),i&2048&&Qu(9,t);break;case 1:_r(e,t,n,r);break;case 3:_r(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Iu(e)));break;case 12:if(i&2048){_r(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,u=a.onPostCommit;typeof u=="function"&&u(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){it(t,t.return,l)}}else _r(e,t,n,r);break;case 13:_r(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState!==null?a._visibility&2?_r(e,t,n,r):Ju(e,t):a._visibility&2?_r(e,t,n,r):(a._visibility|=2,mo(e,t,n,r,(t.subtreeFlags&10256)!==0)),i&2048&&fh(o,t);break;case 24:_r(e,t,n,r),i&2048&&dh(t.alternate,t);break;default:_r(e,t,n,r)}}function mo(e,t,n,r,i){for(i=i&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var a=e,o=t,u=n,l=r,s=o.flags;switch(o.tag){case 0:case 11:case 15:mo(a,o,u,l,i),Qu(8,o);break;case 23:break;case 22:var c=o.stateNode;o.memoizedState!==null?c._visibility&2?mo(a,o,u,l,i):Ju(a,o):(c._visibility|=2,mo(a,o,u,l,i)),i&&s&2048&&fh(o.alternate,o);break;case 24:mo(a,o,u,l,i),i&&s&2048&&dh(o.alternate,o);break;default:mo(a,o,u,l,i)}t=t.sibling}}function Ju(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ju(n,r),i&2048&&fh(r.alternate,r);break;case 24:Ju(n,r),i&2048&&dh(r.alternate,r);break;default:Ju(n,r)}t=t.sibling}}var el=8192;function po(e){if(e.subtreeFlags&el)for(e=e.child;e!==null;)gy(e),e=e.sibling}function gy(e){switch(e.tag){case 26:po(e),e.flags&el&&e.memoizedState!==null&&$3(hr,e.memoizedState,e.memoizedProps);break;case 5:po(e);break;case 3:case 4:var t=hr;hr=ic(e.stateNode.containerInfo),po(e),hr=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=el,el=16777216,po(e),el=t):po(e));break;default:po(e)}}function vy(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function tl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Yt=r,by(r,e)}vy(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yy(e),e=e.sibling}function yy(e){switch(e.tag){case 0:case 11:case 15:tl(e),e.flags&2048&&Ni(9,e,e.return);break;case 3:tl(e);break;case 12:tl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vs(e)):tl(e);break;default:tl(e)}}function Vs(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Yt=r,by(r,e)}vy(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ni(8,t,t.return),Vs(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Vs(t));break;default:Vs(t)}e=e.sibling}}function by(e,t){for(;Yt!==null;){var n=Yt;switch(n.tag){case 0:case 11:case 15:Ni(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Iu(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Yt=r;else e:for(n=e;Yt!==null;){r=Yt;var i=r.sibling,a=r.return;if(cy(r),r===n){Yt=null;break e}if(i!==null){i.return=a,Yt=i;break e}Yt=a}}}var e3={getCacheForType:function(e){var t=an(jt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},t3=typeof WeakMap=="function"?WeakMap:Map,Ze=0,lt=null,Oe=null,ke=0,Ke=0,In=null,Oi=!1,go=!1,hh=!1,ni=0,At=0,zi=0,Da=0,mh=0,tr=0,vo=0,nl=null,Sn=null,ph=!1,gh=0,Ys=1/0,Xs=null,Ui=null,Jt=0,Ii=null,yo=null,bo=0,vh=0,yh=null,Dy=null,rl=0,bh=null;function $n(){if(Ze&2&&ke!==0)return ke&-ke;if(Ee.T!==null){var e=ao;return e!==0?e:Ch()}return Ug()}function Sy(){tr===0&&(tr=!(ke&536870912)||qe?Fg():536870912);var e=er.current;return e!==null&&(e.flags|=32),tr}function kn(e,t,n){(e===lt&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)&&(Do(e,0),$i(e,ke,tr,!1)),Su(e,n),(!(Ze&2)||e!==lt)&&(e===lt&&(!(Ze&2)&&(Da|=n),At===4&&$i(e,ke,tr,!1)),Br(e))}function wy(e,t,n){if(Ze&6)throw Error(re(327));var r=!n&&(t&124)===0&&(t&e.expiredLanes)===0||Du(e,t),i=r?i3(e,t):wh(e,t,!0),a=r;do{if(i===0){go&&!r&&$i(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!n3(n)){i=wh(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var u=e;i=nl;var l=u.current.memoizedState.isDehydrated;if(l&&(Do(u,o).flags|=256),o=wh(u,o,!1),o!==2){if(hh&&!l){u.errorRecoveryDisabledLanes|=a,Da|=a,i=4;break e}a=Sn,Sn=i,a!==null&&(Sn===null?Sn=a:Sn.push.apply(Sn,a))}i=o}if(a=!1,i!==2)continue}}if(i===1){Do(e,0),$i(e,t,0,!0);break}e:{switch(r=e,a=i,a){case 0:case 1:throw Error(re(345));case 4:if((t&4194048)!==t)break;case 6:$i(r,t,tr,!Oi);break e;case 2:Sn=null;break;case 3:case 5:break;default:throw Error(re(329))}if((t&62914560)===t&&(i=gh+300-Ar(),10<i)){if($i(r,t,tr,!Oi),as(r,0,!0)!==0)break e;r.timeoutHandle=Qy(xy.bind(null,r,n,Sn,Xs,ph,t,tr,Da,vo,Oi,a,2,-0,0),i);break e}xy(r,n,Sn,Xs,ph,t,tr,Da,vo,Oi,a,0,-0,0)}}break}while(!0);Br(e)}function xy(e,t,n,r,i,a,o,u,l,s,c,f,d,h){if(e.timeoutHandle=-1,f=t.subtreeFlags,(f&8192||(f&16785408)===16785408)&&(cl={stylesheets:null,count:0,unsuspend:I3},gy(t),f=k3(),f!==null)){e.cancelPendingCommit=f(By.bind(null,e,t,a,n,r,i,o,u,l,c,1,d,h)),$i(e,a,o,!s);return}By(e,t,a,n,r,i,o,u,l)}function n3(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Rn(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function $i(e,t,n,r){t&=~mh,t&=~Da,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Fn(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Og(e,n,t)}function Zs(){return Ze&6?!0:(il(0),!1)}function Dh(){if(Oe!==null){if(Ke===0)var e=Oe.return;else e=Oe,Xr=ma=null,I0(e),fo=null,Xu=0,e=Oe;for(;e!==null;)ny(e.alternate,e),e=e.return;Oe=null}}function Do(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,D3(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Dh(),lt=e,Oe=n=Gr(e.current,null),ke=t,Ke=0,In=null,Oi=!1,go=Du(e,t),hh=!1,vo=tr=mh=Da=zi=At=0,Sn=nl=null,ph=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Fn(r),a=1<<i;t|=e[i],r&=~a}return ni=t,vs(),n}function Ey(e,t){Fe=null,Ee.H=Us,t===ku||t===Cs?(t=j1(),Ke=3):t===$1?(t=j1(),Ke=4):Ke=t===Pv?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,In=t,Oe===null&&(At=1,js(e,Kn(t,e.current)))}function Ay(){var e=Ee.H;return Ee.H=Us,e===null?Us:e}function Cy(){var e=Ee.A;return Ee.A=e3,e}function Sh(){At=4,Oi||(ke&4194048)!==ke&&er.current!==null||(go=!0),!(zi&134217727)&&!(Da&134217727)||lt===null||$i(lt,ke,tr,!1)}function wh(e,t,n){var r=Ze;Ze|=2;var i=Ay(),a=Cy();(lt!==e||ke!==t)&&(Xs=null,Do(e,t)),t=!1;var o=At;e:do try{if(Ke!==0&&Oe!==null){var u=Oe,l=In;switch(Ke){case 8:Dh(),o=6;break e;case 3:case 2:case 9:case 6:er.current===null&&(t=!0);var s=Ke;if(Ke=0,In=null,So(e,u,l,s),n&&go){o=0;break e}break;default:s=Ke,Ke=0,In=null,So(e,u,l,s)}}r3(),o=At;break}catch(c){Ey(e,c)}while(!0);return t&&e.shellSuspendCounter++,Xr=ma=null,Ze=r,Ee.H=i,Ee.A=a,Oe===null&&(lt=null,ke=0,vs()),o}function r3(){for(;Oe!==null;)My(Oe)}function i3(e,t){var n=Ze;Ze|=2;var r=Ay(),i=Cy();lt!==e||ke!==t?(Xs=null,Ys=Ar()+500,Do(e,t)):go=Du(e,t);e:do try{if(Ke!==0&&Oe!==null){t=Oe;var a=In;t:switch(Ke){case 1:Ke=0,In=null,So(e,t,a,1);break;case 2:case 9:if(k1(a)){Ke=0,In=null,Ty(t);break}t=function(){Ke!==2&&Ke!==9||lt!==e||(Ke=7),Br(e)},a.then(t,t);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:k1(a)?(Ke=0,In=null,Ty(t)):(Ke=0,In=null,So(e,t,a,7));break;case 5:var o=null;switch(Oe.tag){case 26:o=Oe.memoizedState;case 5:case 27:var u=Oe;if(!o||sb(o)){Ke=0,In=null;var l=u.sibling;if(l!==null)Oe=l;else{var s=u.return;s!==null?(Oe=s,Ks(s)):Oe=null}break t}}Ke=0,In=null,So(e,t,a,5);break;case 6:Ke=0,In=null,So(e,t,a,6);break;case 8:Dh(),At=6;break e;default:throw Error(re(462))}}a3();break}catch(c){Ey(e,c)}while(!0);return Xr=ma=null,Ee.H=r,Ee.A=i,Ze=n,Oe!==null?0:(lt=null,ke=0,vs(),At)}function a3(){for(;Oe!==null&&!ME();)My(Oe)}function My(e){var t=ey(e.alternate,e,ni);e.memoizedProps=e.pendingProps,t===null?Ks(e):Oe=t}function Ty(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Xv(n,t,t.pendingProps,t.type,void 0,ke);break;case 11:t=Xv(n,t,t.pendingProps,t.type.render,t.ref,ke);break;case 5:I0(t);default:ny(n,t),t=Oe=_1(t,ni),t=ey(n,t,ni)}e.memoizedProps=e.pendingProps,t===null?Ks(e):Oe=t}function So(e,t,n,r){Xr=ma=null,I0(t),fo=null,Xu=0;var i=t.return;try{if(XA(e,i,t,n,ke)){At=1,js(e,Kn(n,e.current)),Oe=null;return}}catch(a){if(i!==null)throw Oe=i,a;At=1,js(e,Kn(n,e.current)),Oe=null;return}t.flags&32768?(qe||r===1?e=!0:go||ke&536870912?e=!1:(Oi=e=!0,(r===2||r===9||r===3||r===6)&&(r=er.current,r!==null&&r.tag===13&&(r.flags|=16384))),_y(t,e)):Ks(t)}function Ks(e){var t=e;do{if(t.flags&32768){_y(t,Oi);return}e=t.return;var n=KA(t.alternate,t,ni);if(n!==null){Oe=n;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);At===0&&(At=5)}function _y(e,t){do{var n=QA(e.alternate,e);if(n!==null){n.flags&=32767,Oe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=n}while(e!==null);At=6,Oe=null}function By(e,t,n,r,i,a,o,u,l){e.cancelPendingCommit=null;do Qs();while(Jt!==0);if(Ze&6)throw Error(re(327));if(t!==null){if(t===e.current)throw Error(re(177));if(a=t.lanes|t.childLanes,a|=d0,IE(e,n,a,o,u,l),e===lt&&(Oe=lt=null,ke=0),yo=t,Ii=e,bo=n,vh=a,yh=i,Dy=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,s3(ns,function(){return zy(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=Ee.T,Ee.T=null,i=He.p,He.p=2,o=Ze,Ze|=4;try{WA(e,t,n)}finally{Ze=o,He.p=i,Ee.T=r}}Jt=1,Ny(),Fy(),Ry()}}function Ny(){if(Jt===1){Jt=0;var e=Ii,t=yo,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Ee.T,Ee.T=null;var r=He.p;He.p=2;var i=Ze;Ze|=4;try{hy(t,e);var a=Oh,o=b1(e.containerInfo),u=a.focusedElem,l=a.selectionRange;if(o!==u&&u&&u.ownerDocument&&y1(u.ownerDocument.documentElement,u)){if(l!==null&&u0(u)){var s=l.start,c=l.end;if(c===void 0&&(c=s),"selectionStart"in u)u.selectionStart=s,u.selectionEnd=Math.min(c,u.value.length);else{var f=u.ownerDocument||document,d=f&&f.defaultView||window;if(d.getSelection){var h=d.getSelection(),g=u.textContent.length,m=Math.min(l.start,g),D=l.end===void 0?m:Math.min(l.end,g);!h.extend&&m>D&&(o=D,D=m,m=o);var p=v1(u,m),v=v1(u,D);if(p&&v&&(h.rangeCount!==1||h.anchorNode!==p.node||h.anchorOffset!==p.offset||h.focusNode!==v.node||h.focusOffset!==v.offset)){var y=f.createRange();y.setStart(p.node,p.offset),h.removeAllRanges(),m>D?(h.addRange(y),h.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),h.addRange(y))}}}}for(f=[],h=u;h=h.parentNode;)h.nodeType===1&&f.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<f.length;u++){var w=f[u];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}sc=!!Rh,Oh=Rh=null}finally{Ze=i,He.p=r,Ee.T=n}}e.current=t,Jt=2}}function Fy(){if(Jt===2){Jt=0;var e=Ii,t=yo,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Ee.T,Ee.T=null;var r=He.p;He.p=2;var i=Ze;Ze|=4;try{sy(e,t.alternate,t)}finally{Ze=i,He.p=r,Ee.T=n}}Jt=3}}function Ry(){if(Jt===4||Jt===3){Jt=0,TE();var e=Ii,t=yo,n=bo,r=Dy;t.subtreeFlags&10256||t.flags&10256?Jt=5:(Jt=0,yo=Ii=null,Oy(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Ui=null),Ld(n),t=t.stateNode,Nn&&typeof Nn.onCommitFiberRoot=="function")try{Nn.onCommitFiberRoot(bu,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=Ee.T,i=He.p,He.p=2,Ee.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var u=r[o];a(u.value,{componentStack:u.stack})}}finally{Ee.T=t,He.p=i}}bo&3&&Qs(),Br(e),i=e.pendingLanes,n&4194090&&i&42?e===bh?rl++:(rl=0,bh=e):rl=0,il(0)}}function Oy(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Iu(t)))}function Qs(e){return Ny(),Fy(),Ry(),zy()}function zy(){if(Jt!==5)return!1;var e=Ii,t=vh;vh=0;var n=Ld(bo),r=Ee.T,i=He.p;try{He.p=32>n?32:n,Ee.T=null,n=yh,yh=null;var a=Ii,o=bo;if(Jt=0,yo=Ii=null,bo=0,Ze&6)throw Error(re(331));var u=Ze;if(Ze|=4,yy(a.current),py(a,a.current,o,n),Ze=u,il(0,!1),Nn&&typeof Nn.onPostCommitFiberRoot=="function")try{Nn.onPostCommitFiberRoot(bu,a)}catch{}return!0}finally{He.p=i,Ee.T=r,Oy(e,t)}}function Uy(e,t,n){t=Kn(n,t),t=Q0(e.stateNode,t,2),e=Mi(e,t,2),e!==null&&(Su(e,2),Br(e))}function it(e,t,n){if(e.tag===3)Uy(e,e,n);else for(;t!==null;){if(t.tag===3){Uy(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ui===null||!Ui.has(r))){e=Kn(n,e),n=Lv(2),r=Mi(t,n,2),r!==null&&(jv(n,r,t,e),Su(r,2),Br(r));break}}t=t.return}}function xh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new t3;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(hh=!0,i.add(n),e=o3.bind(null,e,t,n),t.then(e,e))}function o3(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,lt===e&&(ke&n)===n&&(At===4||At===3&&(ke&62914560)===ke&&300>Ar()-gh?!(Ze&2)&&Do(e,0):mh|=n,vo===ke&&(vo=0)),Br(e)}function Iy(e,t){t===0&&(t=Rg()),e=to(e,t),e!==null&&(Su(e,t),Br(e))}function u3(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Iy(e,n)}function l3(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(re(314))}r!==null&&r.delete(t),Iy(e,n)}function s3(e,t){return Ud(e,t)}var Ws=null,wo=null,Eh=!1,Js=!1,Ah=!1,Sa=0;function Br(e){e!==wo&&e.next===null&&(wo===null?Ws=wo=e:wo=wo.next=e),Js=!0,Eh||(Eh=!0,f3())}function il(e,t){if(!Ah&&Js){Ah=!0;do for(var n=!1,r=Ws;r!==null;){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,u=r.pingedLanes;a=(1<<31-Fn(42|e)+1)-1,a&=i&~(o&~u),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jy(r,a))}else a=ke,a=as(r,r===lt?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Du(r,a)||(n=!0,jy(r,a));r=r.next}while(n);Ah=!1}}function c3(){$y()}function $y(){Js=Eh=!1;var e=0;Sa!==0&&(b3()&&(e=Sa),Sa=0);for(var t=Ar(),n=null,r=Ws;r!==null;){var i=r.next,a=ky(r,t);a===0?(r.next=null,n===null?Ws=i:n.next=i,i===null&&(wo=n)):(n=r,(e!==0||a&3)&&(Js=!0)),r=i}il(e)}function ky(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Fn(a),u=1<<o,l=i[o];l===-1?(!(u&n)||u&r)&&(i[o]=UE(u,t)):l<=t&&(e.expiredLanes|=u),a&=~u}if(t=lt,n=ke,n=as(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Id(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Du(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Id(r),Ld(n)){case 2:case 8:n=Bg;break;case 32:n=ns;break;case 268435456:n=Ng;break;default:n=ns}return r=Ly.bind(null,e),n=Ud(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Id(r),e.callbackPriority=2,e.callbackNode=null,2}function Ly(e,t){if(Jt!==0&&Jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Qs()&&e.callbackNode!==n)return null;var r=ke;return r=as(e,e===lt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(wy(e,r,t),ky(e,Ar()),e.callbackNode!=null&&e.callbackNode===n?Ly.bind(null,e):null)}function jy(e,t){if(Qs())return null;wy(e,t,!0)}function f3(){S3(function(){Ze&6?Ud(_g,c3):$y()})}function Ch(){return Sa===0&&(Sa=Fg()),Sa}function Py(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:cs(""+e)}function Hy(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function d3(e,t,n,r,i){if(t==="submit"&&n&&n.stateNode===i){var a=Py((i[vn]||null).action),o=r.submitter;o&&(t=(t=o[vn]||null)?Py(t.formAction):o.getAttribute("formAction"),t!==null&&(a=t,o=null));var u=new ms("action","action",null,r,i);e.push({event:u,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Sa!==0){var l=o?Hy(i,o):new FormData(i);V0(n,{pending:!0,data:l,method:i.method,action:a},null,l)}}else typeof a=="function"&&(u.preventDefault(),l=o?Hy(i,o):new FormData(i),V0(n,{pending:!0,data:l,method:i.method,action:a},a,l))},currentTarget:i}]})}}for(var Mh=0;Mh<f0.length;Mh++){var Th=f0[Mh],h3=Th.toLowerCase(),m3=Th[0].toUpperCase()+Th.slice(1);dr(h3,"on"+m3)}dr(w1,"onAnimationEnd"),dr(x1,"onAnimationIteration"),dr(E1,"onAnimationStart"),dr("dblclick","onDoubleClick"),dr("focusin","onFocus"),dr("focusout","onBlur"),dr(NA,"onTransitionRun"),dr(FA,"onTransitionStart"),dr(RA,"onTransitionCancel"),dr(A1,"onTransitionEnd"),Ga("onMouseEnter",["mouseout","mouseover"]),Ga("onMouseLeave",["mouseout","mouseover"]),Ga("onPointerEnter",["pointerout","pointerover"]),Ga("onPointerLeave",["pointerout","pointerover"]),aa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),aa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),aa("onBeforeInput",["compositionend","keypress","textInput","paste"]),aa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),aa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),aa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var al="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),p3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(al));function qy(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var u=r[o],l=u.instance,s=u.currentTarget;if(u=u.listener,l!==a&&i.isPropagationStopped())break e;a=u,i.currentTarget=s;try{a(i)}catch(c){Ls(c)}i.currentTarget=null,a=l}else for(o=0;o<r.length;o++){if(u=r[o],l=u.instance,s=u.currentTarget,u=u.listener,l!==a&&i.isPropagationStopped())break e;a=u,i.currentTarget=s;try{a(i)}catch(c){Ls(c)}i.currentTarget=null,a=l}}}}function ze(e,t){var n=t[jd];n===void 0&&(n=t[jd]=new Set);var r=e+"__bubble";n.has(r)||(Gy(t,e,2,!1),n.add(r))}function _h(e,t,n){var r=0;t&&(r|=4),Gy(n,e,r,t)}var ec="_reactListening"+Math.random().toString(36).slice(2);function Bh(e){if(!e[ec]){e[ec]=!0,$g.forEach(function(n){n!=="selectionchange"&&(p3.has(n)||_h(n,!1,e),_h(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ec]||(t[ec]=!0,_h("selectionchange",!1,t))}}function Gy(e,t,n,r){switch(pb(t)){case 2:var i=P3;break;case 8:i=H3;break;default:i=qh}n=i.bind(null,t,n,e),i=void 0,!Wd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Nh(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var u=r.stateNode.containerInfo;if(u===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;u!==null;){if(o=Pa(u),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue e}u=u.parentNode}}r=r.return}Wg(function(){var s=a,c=Kd(n),f=[];e:{var d=C1.get(e);if(d!==void 0){var h=ms,g=e;switch(e){case"keypress":if(ds(n)===0)break e;case"keydown":case"keyup":h=sA;break;case"focusin":g="focus",h=n0;break;case"focusout":g="blur",h=n0;break;case"beforeblur":case"afterblur":h=n0;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=t1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=QE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=dA;break;case w1:case x1:case E1:h=eA;break;case A1:h=mA;break;case"scroll":case"scrollend":h=ZE;break;case"wheel":h=gA;break;case"copy":case"cut":case"paste":h=nA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=r1;break;case"toggle":case"beforetoggle":h=yA}var m=(t&4)!==0,D=!m&&(e==="scroll"||e==="scrollend"),p=m?d!==null?d+"Capture":null:d;m=[];for(var v=s,y;v!==null;){var w=v;if(y=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||y===null||p===null||(w=Eu(v,p),w!=null&&m.push(ol(v,w,y))),D)break;v=v.return}0<m.length&&(d=new h(d,g,null,n,c),f.push({event:d,listeners:m}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&n!==Zd&&(g=n.relatedTarget||n.fromElement)&&(Pa(g)||g[ja]))break e;if((h||d)&&(d=c.window===c?c:(d=c.ownerDocument)?d.defaultView||d.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=s,g=g?Pa(g):null,g!==null&&(D=mu(g),m=g.tag,g!==D||m!==5&&m!==27&&m!==6)&&(g=null)):(h=null,g=s),h!==g)){if(m=t1,w="onMouseLeave",p="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(m=r1,w="onPointerLeave",p="onPointerEnter",v="pointer"),D=h==null?d:xu(h),y=g==null?d:xu(g),d=new m(w,v+"leave",h,n,c),d.target=D,d.relatedTarget=y,w=null,Pa(c)===s&&(m=new m(p,v+"enter",g,n,c),m.target=y,m.relatedTarget=D,w=m),D=w,h&&g)t:{for(m=h,p=g,v=0,y=m;y;y=xo(y))v++;for(y=0,w=p;w;w=xo(w))y++;for(;0<v-y;)m=xo(m),v--;for(;0<y-v;)p=xo(p),y--;for(;v--;){if(m===p||p!==null&&m===p.alternate)break t;m=xo(m),p=xo(p)}m=null}else m=null;h!==null&&Vy(f,d,h,m,!1),g!==null&&D!==null&&Vy(f,D,g,m,!0)}}e:{if(d=s?xu(s):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var E=f1;else if(s1(d))if(d1)E=TA;else{E=CA;var b=AA}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?s&&Xd(s.elementType)&&(E=f1):E=MA;if(E&&(E=E(e,s))){c1(f,E,n,c);break e}b&&b(e,d,s),e==="focusout"&&s&&d.type==="number"&&s.memoizedProps.value!=null&&Yd(d,"number",d.value)}switch(b=s?xu(s):window,e){case"focusin":(s1(b)||b.contentEditable==="true")&&(Wa=b,l0=s,Fu=null);break;case"focusout":Fu=l0=Wa=null;break;case"mousedown":s0=!0;break;case"contextmenu":case"mouseup":case"dragend":s0=!1,D1(f,n,c);break;case"selectionchange":if(BA)break;case"keydown":case"keyup":D1(f,n,c)}var S;if(i0)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Qa?u1(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(i1&&n.locale!=="ko"&&(Qa||A!=="onCompositionStart"?A==="onCompositionEnd"&&Qa&&(S=Jg()):(xi=c,Jd="value"in xi?xi.value:xi.textContent,Qa=!0)),b=tc(s,A),0<b.length&&(A=new n1(A,e,null,n,c),f.push({event:A,listeners:b}),S?A.data=S:(S=l1(n),S!==null&&(A.data=S)))),(S=DA?SA(e,n):wA(e,n))&&(A=tc(s,"onBeforeInput"),0<A.length&&(b=new n1("onBeforeInput","beforeinput",null,n,c),f.push({event:b,listeners:A}),b.data=S)),d3(f,e,s,n,c)}qy(f,t)})}function ol(e,t,n){return{instance:e,listener:t,currentTarget:n}}function tc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Eu(e,n),i!=null&&r.unshift(ol(e,i,a)),i=Eu(e,t),i!=null&&r.push(ol(e,i,a))),e.tag===3)return r;e=e.return}return[]}function xo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Vy(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var u=n,l=u.alternate,s=u.stateNode;if(u=u.tag,l!==null&&l===r)break;u!==5&&u!==26&&u!==27||s===null||(l=s,i?(s=Eu(n,a),s!=null&&o.unshift(ol(n,s,l))):i||(s=Eu(n,a),s!=null&&o.push(ol(n,s,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var g3=/\r\n?/g,v3=/\u0000|\uFFFD/g;function Yy(e){return(typeof e=="string"?e:""+e).replace(g3,`
|
|
50
|
-
`).replace(v3,"")}function Xy(e,t){return t=Yy(t),Yy(e)===t}function nc(){}function nt(e,t,n,r,i,a){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Xa(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Xa(e,""+r);break;case"className":us(e,"class",r);break;case"tabIndex":us(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":us(e,n,r);break;case"style":Kg(e,r,a);break;case"data":if(t!=="object"){us(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=cs(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(t!=="input"&&nt(e,t,"name",i.name,i,null),nt(e,t,"formEncType",i.formEncType,i,null),nt(e,t,"formMethod",i.formMethod,i,null),nt(e,t,"formTarget",i.formTarget,i,null)):(nt(e,t,"encType",i.encType,i,null),nt(e,t,"method",i.method,i,null),nt(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=cs(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=nc);break;case"onScroll":r!=null&&ze("scroll",e);break;case"onScrollEnd":r!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(re(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(re(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=cs(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":ze("beforetoggle",e),ze("toggle",e),os(e,"popover",r);break;case"xlinkActuate":Hr(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Hr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Hr(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Hr(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Hr(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Hr(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Hr(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Hr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Hr(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":os(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=YE.get(n)||n,os(e,n,r))}}function Fh(e,t,n,r,i,a){switch(n){case"style":Kg(e,r,a);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(re(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(re(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Xa(e,r):(typeof r=="number"||typeof r=="bigint")&&Xa(e,""+r);break;case"onScroll":r!=null&&ze("scroll",e);break;case"onScrollEnd":r!=null&&ze("scrollend",e);break;case"onClick":r!=null&&(e.onclick=nc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!kg.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),a=e[vn]||null,a=a!=null?a[n]:null,typeof a=="function"&&e.removeEventListener(t,a,i),typeof r=="function")){typeof a!="function"&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):os(e,n,r)}}}function en(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(re(137,t));default:nt(e,t,a,o,n,null)}}i&&nt(e,t,"srcSet",n.srcSet,n,null),r&&nt(e,t,"src",n.src,n,null);return;case"input":ze("invalid",e);var u=a=o=i=null,l=null,s=null;for(r in n)if(n.hasOwnProperty(r)){var c=n[r];if(c!=null)switch(r){case"name":i=c;break;case"type":o=c;break;case"checked":l=c;break;case"defaultChecked":s=c;break;case"value":a=c;break;case"defaultValue":u=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(re(137,t));break;default:nt(e,t,r,c,n,null)}}Vg(e,a,u,l,s,o,i,!1),ls(e);return;case"select":ze("invalid",e),r=o=a=null;for(i in n)if(n.hasOwnProperty(i)&&(u=n[i],u!=null))switch(i){case"value":a=u;break;case"defaultValue":o=u;break;case"multiple":r=u;default:nt(e,t,i,u,n,null)}t=a,n=o,e.multiple=!!r,t!=null?Ya(e,!!r,t,!1):n!=null&&Ya(e,!!r,n,!0);return;case"textarea":ze("invalid",e),a=i=r=null;for(o in n)if(n.hasOwnProperty(o)&&(u=n[o],u!=null))switch(o){case"value":r=u;break;case"defaultValue":i=u;break;case"children":a=u;break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(re(91));break;default:nt(e,t,o,u,n,null)}Xg(e,r,i,a),ls(e);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:nt(e,t,l,r,n,null)}return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(r=0;r<al.length;r++)ze(al[r],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(s in n)if(n.hasOwnProperty(s)&&(r=n[s],r!=null))switch(s){case"children":case"dangerouslySetInnerHTML":throw Error(re(137,t));default:nt(e,t,s,r,n,null)}return;default:if(Xd(t)){for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!==void 0&&Fh(e,t,c,r,n,void 0));return}}for(u in n)n.hasOwnProperty(u)&&(r=n[u],r!=null&&nt(e,t,u,r,n,null))}function y3(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,a=null,o=null,u=null,l=null,s=null,c=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&f!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":l=f;default:r.hasOwnProperty(h)||nt(e,t,h,null,r,f)}}for(var d in r){var h=r[d];if(f=n[d],r.hasOwnProperty(d)&&(h!=null||f!=null))switch(d){case"type":a=h;break;case"name":i=h;break;case"checked":s=h;break;case"defaultChecked":c=h;break;case"value":o=h;break;case"defaultValue":u=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(re(137,t));break;default:h!==f&&nt(e,t,d,h,r,f)}}Vd(e,o,u,l,s,c,a,i);return;case"select":h=o=u=d=null;for(a in n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case"value":break;case"multiple":h=l;default:r.hasOwnProperty(a)||nt(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case"value":d=a;break;case"defaultValue":u=a;break;case"multiple":o=a;default:a!==l&&nt(e,t,i,a,r,l)}t=u,n=o,r=h,d!=null?Ya(e,!!n,d,!1):!!r!=!!n&&(t!=null?Ya(e,!!n,t,!0):Ya(e,!!n,n?[]:"",!1));return;case"textarea":h=d=null;for(u in n)if(i=n[u],n.hasOwnProperty(u)&&i!=null&&!r.hasOwnProperty(u))switch(u){case"value":break;case"children":break;default:nt(e,t,u,null,r,i)}for(o in r)if(i=r[o],a=n[o],r.hasOwnProperty(o)&&(i!=null||a!=null))switch(o){case"value":d=i;break;case"defaultValue":h=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(re(91));break;default:i!==a&&nt(e,t,o,i,r,a)}Yg(e,d,h);return;case"option":for(var g in n)if(d=n[g],n.hasOwnProperty(g)&&d!=null&&!r.hasOwnProperty(g))switch(g){case"selected":e.selected=!1;break;default:nt(e,t,g,null,r,d)}for(l in r)if(d=r[l],h=n[l],r.hasOwnProperty(l)&&d!==h&&(d!=null||h!=null))switch(l){case"selected":e.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:nt(e,t,l,d,r,h)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var m in n)d=n[m],n.hasOwnProperty(m)&&d!=null&&!r.hasOwnProperty(m)&&nt(e,t,m,null,r,d);for(s in r)if(d=r[s],h=n[s],r.hasOwnProperty(s)&&d!==h&&(d!=null||h!=null))switch(s){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(re(137,t));break;default:nt(e,t,s,d,r,h)}return;default:if(Xd(t)){for(var D in n)d=n[D],n.hasOwnProperty(D)&&d!==void 0&&!r.hasOwnProperty(D)&&Fh(e,t,D,void 0,r,d);for(c in r)d=r[c],h=n[c],!r.hasOwnProperty(c)||d===h||d===void 0&&h===void 0||Fh(e,t,c,d,r,h);return}}for(var p in n)d=n[p],n.hasOwnProperty(p)&&d!=null&&!r.hasOwnProperty(p)&&nt(e,t,p,null,r,d);for(f in r)d=r[f],h=n[f],!r.hasOwnProperty(f)||d===h||d==null&&h==null||nt(e,t,f,d,r,h)}var Rh=null,Oh=null;function rc(e){return e.nodeType===9?e:e.ownerDocument}function Zy(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ky(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function zh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Uh=null;function b3(){var e=window.event;return e&&e.type==="popstate"?e===Uh?!1:(Uh=e,!0):(Uh=null,!1)}var Qy=typeof setTimeout=="function"?setTimeout:void 0,D3=typeof clearTimeout=="function"?clearTimeout:void 0,Wy=typeof Promise=="function"?Promise:void 0,S3=typeof queueMicrotask=="function"?queueMicrotask:typeof Wy<"u"?function(e){return Wy.resolve(null).then(e).catch(w3)}:Qy;function w3(e){setTimeout(function(){throw e})}function ki(e){return e==="head"}function Jy(e,t){var n=t,r=0,i=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(0<r&&8>r){n=r;var o=e.ownerDocument;if(n&1&&ul(o.documentElement),n&2&&ul(o.body),n&4)for(n=o.head,ul(n),o=n.firstChild;o;){var u=o.nextSibling,l=o.nodeName;o[wu]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=u}}if(i===0){e.removeChild(a),pl(t);return}i--}else n==="$"||n==="$?"||n==="$!"?i++:r=n.charCodeAt(0)-48;else r=0;n=a}while(n);pl(t)}function Ih(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Ih(n),Pd(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function x3(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[wu])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(a!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=mr(e.nextSibling),e===null)break}return null}function E3(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=mr(e.nextSibling),e===null))return null;return e}function $h(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function A3(e,t){var n=e.ownerDocument;if(e.data!=="$?"||n.readyState==="complete")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function mr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var kh=null;function eb(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function tb(e,t,n){switch(t=rc(n),e){case"html":if(e=t.documentElement,!e)throw Error(re(452));return e;case"head":if(e=t.head,!e)throw Error(re(453));return e;case"body":if(e=t.body,!e)throw Error(re(454));return e;default:throw Error(re(451))}}function ul(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pd(e)}var nr=new Map,nb=new Set;function ic(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ri=He.d;He.d={f:C3,r:M3,D:T3,C:_3,L:B3,m:N3,X:R3,S:F3,M:O3};function C3(){var e=ri.f(),t=Zs();return e||t}function M3(e){var t=Ha(e);t!==null&&t.tag===5&&t.type==="form"?wv(t):ri.r(e)}var Eo=typeof document>"u"?null:document;function rb(e,t,n){var r=Eo;if(r&&typeof t=="string"&&t){var i=Zn(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),nb.has(i)||(nb.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),en(t,"link",e),Gt(t),r.head.appendChild(t)))}}function T3(e){ri.D(e),rb("dns-prefetch",e,null)}function _3(e,t){ri.C(e,t),rb("preconnect",e,t)}function B3(e,t,n){ri.L(e,t,n);var r=Eo;if(r&&e&&t){var i='link[rel="preload"][as="'+Zn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Zn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Zn(n.imageSizes)+'"]')):i+='[href="'+Zn(e)+'"]';var a=i;switch(t){case"style":a=Ao(e);break;case"script":a=Co(e)}nr.has(a)||(e=dt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),nr.set(a,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(ll(a))||t==="script"&&r.querySelector(sl(a))||(t=r.createElement("link"),en(t,"link",e),Gt(t),r.head.appendChild(t)))}}function N3(e,t){ri.m(e,t);var n=Eo;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Zn(r)+'"][href="'+Zn(e)+'"]',a=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Co(e)}if(!nr.has(a)&&(e=dt({rel:"modulepreload",href:e},t),nr.set(a,e),n.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(sl(a)))return}r=n.createElement("link"),en(r,"link",e),Gt(r),n.head.appendChild(r)}}}function F3(e,t,n){ri.S(e,t,n);var r=Eo;if(r&&e){var i=qa(r).hoistableStyles,a=Ao(e);t=t||"default";var o=i.get(a);if(!o){var u={loading:0,preload:null};if(o=r.querySelector(ll(a)))u.loading=5;else{e=dt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=nr.get(a))&&Lh(e,n);var l=o=r.createElement("link");Gt(l),en(l,"link",e),l._p=new Promise(function(s,c){l.onload=s,l.onerror=c}),l.addEventListener("load",function(){u.loading|=1}),l.addEventListener("error",function(){u.loading|=2}),u.loading|=4,ac(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:u},i.set(a,o)}}}function R3(e,t){ri.X(e,t);var n=Eo;if(n&&e){var r=qa(n).hoistableScripts,i=Co(e),a=r.get(i);a||(a=n.querySelector(sl(i)),a||(e=dt({src:e,async:!0},t),(t=nr.get(i))&&jh(e,t),a=n.createElement("script"),Gt(a),en(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}function O3(e,t){ri.M(e,t);var n=Eo;if(n&&e){var r=qa(n).hoistableScripts,i=Co(e),a=r.get(i);a||(a=n.querySelector(sl(i)),a||(e=dt({src:e,async:!0,type:"module"},t),(t=nr.get(i))&&jh(e,t),a=n.createElement("script"),Gt(a),en(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}function ib(e,t,n,r){var i=(i=Di.current)?ic(i):null;if(!i)throw Error(re(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ao(n.href),n=qa(i).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ao(n.href);var a=qa(i).hoistableStyles,o=a.get(e);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,o),(a=i.querySelector(ll(e)))&&!a._p&&(o.instance=a,o.state.loading=5),nr.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},nr.set(e,n),a||z3(i,e,n,o.state))),t&&r===null)throw Error(re(528,""));return o}if(t&&r!==null)throw Error(re(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Co(n),n=qa(i).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(re(444,e))}}function Ao(e){return'href="'+Zn(e)+'"'}function ll(e){return'link[rel="stylesheet"]['+e+"]"}function ab(e){return dt({},e,{"data-precedence":e.precedence,precedence:null})}function z3(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),en(t,"link",n),Gt(t),e.head.appendChild(t))}function Co(e){return'[src="'+Zn(e)+'"]'}function sl(e){return"script[async]"+e}function ob(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Zn(n.href)+'"]');if(r)return t.instance=r,Gt(r),r;var i=dt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Gt(r),en(r,"style",i),ac(r,n.precedence,e),t.instance=r;case"stylesheet":i=Ao(n.href);var a=e.querySelector(ll(i));if(a)return t.state.loading|=4,t.instance=a,Gt(a),a;r=ab(n),(i=nr.get(i))&&Lh(r,i),a=(e.ownerDocument||e).createElement("link"),Gt(a);var o=a;return o._p=new Promise(function(u,l){o.onload=u,o.onerror=l}),en(a,"link",r),t.state.loading|=4,ac(a,n.precedence,e),t.instance=a;case"script":return a=Co(n.src),(i=e.querySelector(sl(a)))?(t.instance=i,Gt(i),i):(r=n,(i=nr.get(a))&&(r=dt({},n),jh(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),Gt(i),en(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(re(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,ac(r,n.precedence,e));return t.instance}function ac(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var u=r[o];if(u.dataset.precedence===t)a=u;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Lh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function jh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var oc=null;function ub(e,t,n){if(oc===null){var r=new Map,i=oc=new Map;i.set(n,r)}else i=oc,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[wu]||a[rn]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var o=a.getAttribute(t)||"";o=e+o;var u=r.get(o);u?u.push(a):r.set(o,[a])}}return r}function lb(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function U3(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function sb(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var cl=null;function I3(){}function $3(e,t,n){if(cl===null)throw Error(re(475));var r=cl;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var i=Ao(n.href),a=e.querySelector(ll(i));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(r.count++,r=uc.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=a,Gt(a);return}a=e.ownerDocument||e,n=ab(n),(i=nr.get(i))&&Lh(n,i),a=a.createElement("link"),Gt(a);var o=a;o._p=new Promise(function(u,l){o.onload=u,o.onerror=l}),en(a,"link",n),t.instance=a}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(r.count++,t=uc.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}function k3(){if(cl===null)throw Error(re(475));var e=cl;return e.stylesheets&&e.count===0&&Ph(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&Ph(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function uc(){if(this.count--,this.count===0){if(this.stylesheets)Ph(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var lc=null;function Ph(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lc=new Map,t.forEach(L3,e),lc=null,uc.call(e))}function L3(e,t){if(!(t.state.loading&4)){var n=lc.get(e);if(n)var r=n.get(null);else{n=new Map,lc.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<i.length;a++){var o=i[a];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute("data-precedence"),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=uc.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var fl={$$typeof:Pr,Provider:null,Consumer:null,_currentValue:ra,_currentValue2:ra,_threadCount:0};function j3(e,t,n,r,i,a,o,u){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=$d(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$d(0),this.hiddenUpdates=$d(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=u,this.incompleteTransitions=new Map}function cb(e,t,n,r,i,a,o,u,l,s,c,f){return e=new j3(e,t,n,o,u,l,s,f),t=1,a===!0&&(t|=24),a=On(3,null,null,t),e.current=a,a.stateNode=e,t=x0(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},M0(a),e}function fb(e){return e?(e=no,e):no}function db(e,t,n,r,i,a){i=fb(i),r.context===null?r.context=i:r.pendingContext=i,r=Ci(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Mi(e,r,t),n!==null&&(kn(n,e,t),ju(n,e,t))}function hb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Hh(e,t){hb(e,t),(e=e.alternate)&&hb(e,t)}function mb(e){if(e.tag===13){var t=to(e,67108864);t!==null&&kn(t,e,67108864),Hh(e,67108864)}}var sc=!0;function P3(e,t,n,r){var i=Ee.T;Ee.T=null;var a=He.p;try{He.p=2,qh(e,t,n,r)}finally{He.p=a,Ee.T=i}}function H3(e,t,n,r){var i=Ee.T;Ee.T=null;var a=He.p;try{He.p=8,qh(e,t,n,r)}finally{He.p=a,Ee.T=i}}function qh(e,t,n,r){if(sc){var i=Gh(r);if(i===null)Nh(e,t,r,cc,n),gb(e,r);else if(G3(i,e,t,n,r))r.stopPropagation();else if(gb(e,r),t&4&&-1<q3.indexOf(e)){for(;i!==null;){var a=Ha(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ia(a.pendingLanes);if(o!==0){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;o;){var l=1<<31-Fn(o);u.entanglements[1]|=l,o&=~l}Br(a),!(Ze&6)&&(Ys=Ar()+500,il(0))}}break;case 13:u=to(a,2),u!==null&&kn(u,a,2),Zs(),Hh(a,2)}if(a=Gh(r),a===null&&Nh(e,t,r,cc,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Nh(e,t,r,null,n)}}function Gh(e){return e=Kd(e),Vh(e)}var cc=null;function Vh(e){if(cc=null,e=Pa(e),e!==null){var t=mu(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=xg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return cc=e,null}function pb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(_E()){case _g:return 2;case Bg:return 8;case ns:case BE:return 32;case Ng:return 268435456;default:return 32}default:return 32}}var Yh=!1,Li=null,ji=null,Pi=null,dl=new Map,hl=new Map,Hi=[],q3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function gb(e,t){switch(e){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":ji=null;break;case"mouseover":case"mouseout":Pi=null;break;case"pointerover":case"pointerout":dl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(t.pointerId)}}function ml(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ha(t),t!==null&&mb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function G3(e,t,n,r,i){switch(t){case"focusin":return Li=ml(Li,e,t,n,r,i),!0;case"dragenter":return ji=ml(ji,e,t,n,r,i),!0;case"mouseover":return Pi=ml(Pi,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return dl.set(a,ml(dl.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,hl.set(a,ml(hl.get(a)||null,e,t,n,r,i)),!0}return!1}function vb(e){var t=Pa(e.target);if(t!==null){var n=mu(t);if(n!==null){if(t=n.tag,t===13){if(t=xg(n),t!==null){e.blockedOn=t,$E(e.priority,function(){if(n.tag===13){var r=$n();r=kd(r);var i=to(n,r);i!==null&&kn(i,n,r),Hh(n,r)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function fc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Gh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zd=r,n.target.dispatchEvent(r),Zd=null}else return t=Ha(n),t!==null&&mb(t),e.blockedOn=n,!1;t.shift()}return!0}function yb(e,t,n){fc(e)&&n.delete(t)}function V3(){Yh=!1,Li!==null&&fc(Li)&&(Li=null),ji!==null&&fc(ji)&&(ji=null),Pi!==null&&fc(Pi)&&(Pi=null),dl.forEach(yb),hl.forEach(yb)}function dc(e,t){e.blockedOn===t&&(e.blockedOn=null,Yh||(Yh=!0,Lt.unstable_scheduleCallback(Lt.unstable_NormalPriority,V3)))}var hc=null;function bb(e){hc!==e&&(hc=e,Lt.unstable_scheduleCallback(Lt.unstable_NormalPriority,function(){hc===e&&(hc=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(Vh(r||n)===null)continue;break}var a=Ha(n);a!==null&&(e.splice(t,3),t-=3,V0(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function pl(e){function t(l){return dc(l,e)}Li!==null&&dc(Li,e),ji!==null&&dc(ji,e),Pi!==null&&dc(Pi,e),dl.forEach(t),hl.forEach(t);for(var n=0;n<Hi.length;n++){var r=Hi[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Hi.length&&(n=Hi[0],n.blockedOn===null);)vb(n),n.blockedOn===null&&Hi.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[vn]||null;if(typeof a=="function")o||bb(n);else if(o){var u=null;if(a&&a.hasAttribute("formAction")){if(i=a,o=a[vn]||null)u=o.formAction;else if(Vh(i)!==null)continue}else u=o.action;typeof u=="function"?n[r+1]=u:(n.splice(r,3),r-=3),bb(n)}}}function Xh(e){this._internalRoot=e}mc.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(re(409));var n=t.current,r=$n();db(n,r,e,t,null,null)},mc.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;db(e.current,2,null,e,null,null),Zs(),t[ja]=null}};function mc(e){this._internalRoot=e}mc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ug();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Hi.length&&t!==0&&t<Hi[n].priority;n++);Hi.splice(n,0,e),n===0&&vb(e)}};var Db=Sg.version;if(Db!=="19.1.1")throw Error(re(527,Db,"19.1.1"));He.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(re(188)):(e=Object.keys(e).join(","),Error(re(268,e)));return e=wE(t),e=e!==null?Ag(e):null,e=e===null?null:e.stateNode,e};var Y3={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:Ee,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pc.isDisabled&&pc.supportsFiber)try{bu=pc.inject(Y3),Nn=pc}catch{}}Kl.createRoot=function(e,t){if(!wg(e))throw Error(re(299));var n=!1,r="",i=Uv,a=Iv,o=$v,u=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(u=t.unstable_transitionCallbacks)),t=cb(e,1,!1,null,null,n,r,i,a,o,u,null),e[ja]=t.current,Bh(e),new Xh(t)},Kl.hydrateRoot=function(e,t,n){if(!wg(e))throw Error(re(299));var r=!1,i="",a=Uv,o=Iv,u=$v,l=null,s=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(u=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(l=n.unstable_transitionCallbacks),n.formState!==void 0&&(s=n.formState)),t=cb(e,1,!0,t,n??null,r,i,a,o,u,l,s),t.context=fb(null),n=t.current,r=$n(),r=kd(r),i=Ci(r),i.callback=null,Mi(n,i,r),n=r,t.current.lanes=n,Su(t,n),Br(t),e[ja]=t.current,Bh(e),new mc(t)},Kl.version="19.1.1";function Sb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sb)}catch(e){console.error(e)}}Sb(),pg.exports=Kl;var X3=pg.exports;const Z3=(e,t)=>t.type==="selectUnitMetrics"?{...e,selectedUnitMetrics:t.unitMetrics}:t.type==="initialize"?{...e,allUnitMetrics:[...new Set([...e.allUnitMetrics||[],...t.unitMetrics])].sort()}:e,wb=kt.createContext({}),Zh=()=>{const e=_.useContext(wb),t=_.useMemo(()=>e.unitMetricSelectionDispatch||(()=>{}),[e.unitMetricSelectionDispatch]);return{selectedUnitMetrics:e.unitMetricSelection?.selectedUnitMetrics||[],allUnitMetrics:e.unitMetricSelection?.allUnitMetrics||[],unitMetricSelectionDispatch:t}},Nt=e=>{if(typeof e=="number")return e;if(typeof e=="string"){const t=K3(e);try{const n=parseFloat(t);return isNaN(n)?0:n}catch{return 0}}else return 0},K3=e=>{let t=0;for(;t<e.length&&Q3(e[t]);)t++;return e.slice(t)},Q3=e=>isNaN(parseFloat(e)),Nr=e=>[...e].sort((t,n)=>{if(typeof t=="number"&&typeof n=="number")return t-n;{if(!isNaN(parseInt(t+""))&&!isNaN(parseInt(n+"")))return parseInt(t+"")-parseInt(n+"");const r=(t+"")[0],i=(n+"")[0];if(r===i){const a=(t+"").slice(1),o=(n+"").slice(1);return!isNaN(parseInt(a))&&!isNaN(parseInt(o))?parseInt(a)-parseInt(o):t<n?-1:t>n?1:0}else return t<n?-1:t>n?1:0}}),Mo=(e,t)=>{const{targetUnit:n}=t;if(n===void 0)throw Error("UNIQUE_SELECT for unit selection requires a target unit to be set.");return{...e,lastClickedId:n,selectedUnitIds:new Set(e.selectedUnitIds.has(n)?[]:[n]),currentUnitId:n}},W3=e=>{if(e.lastClickedId===void 0)return e.orderedUnitIds.length===0?e:Mo(e,{targetUnit:e.orderedUnitIds[0]});const t=e.orderedUnitIds.indexOf(e.lastClickedId);if(t<0)return e;const n=e.orderedUnitIds[t+1];return n===void 0?e:Mo(e,{targetUnit:n})},J3=e=>{if(e.lastClickedId===void 0)return e;const t=e.orderedUnitIds.indexOf(e.lastClickedId);if(t<0||t===0)return e;const n=e.orderedUnitIds[t-1];return n===void 0?e:Mo(e,{targetUnit:n})},eC=e=>e.orderedUnitIds.length===0?e:Mo(e,{targetUnit:e.orderedUnitIds[0]}),tC=e=>e.orderedUnitIds.length===0?e:Mo(e,{targetUnit:e.orderedUnitIds[e.orderedUnitIds.length-1]}),nC=(e,t)=>({...e,currentUnitId:(t.incomingSelectedUnitIds||[])[0],selectedUnitIds:new Set(t.incomingSelectedUnitIds??[])}),xb=e=>e.selectedUnitIds.size===0?"none":e.selectedUnitIds.size===e.orderedUnitIds.length?"all":!e.visibleUnitIds||e.visibleUnitIds.length===0||e.selectedUnitIds.size!==e.visibleUnitIds.length||e.visibleUnitIds.some(t=>!e.selectedUnitIds.has(t))?"partial":"all",Eb=(e,t)=>{if(t.targetUnit===void 0)throw new Error("Attempt to toggle unit with unset unitid.");const n=new Set([...e.selectedUnitIds]);n.has(t.targetUnit)?n.delete(t.targetUnit):n.add(t.targetUnit);let r=e.currentUnitId;return t.targetUnit===e.currentUnitId&&(r=[...n][0]),[...n].length===1&&(r=[...n][0]),{...e,selectedUnitIds:n,currentUnitId:r,lastClickedId:t.targetUnit}},rC=(e,t)=>{const{selectedUnitIds:n,lastClickedId:r,orderedUnitIds:i}=e,{targetUnit:a}=t;if(i.length===0)throw Error("Attempt to toggle range with no units initialized.");if(!r||!a)return console.warn(`Cannot toggle range with undefined limit: last-clicked ${r}, target ${a}`),e;const o=i.findIndex(s=>s===r),u=i.findIndex(s=>s===a);if(o===-1||u===-1)throw Error(`Requested to toggle unit range from ID ${r} to ID ${a} but one of these was not found.`);const l=i.slice(Math.min(o,u),Math.max(o,u)+1);return n.has(a)?l.forEach(s=>n.delete(s)):l.forEach(s=>n.add(s)),e.currentUnitId?n.has(e.currentUnitId)||(e.currentUnitId=[...n][0]):e.currentUnitId=[...n][0],{...e,lastClickedId:a,selectedUnitIds:new Set(n),currentUnitId:e.currentUnitId}},iC=e=>{const t=xb(e),n=t==="all"||t==="partial"?new Set:new Set(e.orderedUnitIds);return e.currentUnitId?n.has(e.currentUnitId)||(e.currentUnitId=[...n][0]):e.currentUnitId=[...n][0],{...e,selectedUnitIds:n}},aC=e=>t=>n=>{uC(t,e,n)},oC=e=>t=>n=>{lC(t,e,n)},uC=(e,t,n)=>{const r={type:n.ctrlKey?Kh:n.shiftKey?Wh:Qh,targetUnit:e};t(r)},lC=(e,t,n)=>{const r={type:n.shiftKey?Wh:n.ctrlKey?Qh:Kh,targetUnit:e};t(r)},gc=20,sC=(e,t)=>{if(t.newVisibleUnitIds&&t.newVisibleUnitIds.length>0)return{...e,visibleUnitIds:t.newVisibleUnitIds};const n=t.unitsPerPage||e.unitsPerPage||gc,r=t.pageNumber||e.page||1;if(n===e.unitsPerPage&&r===e.page)return e;const i=r!==e.page?r:1+Math.floor((e.unitsPerPage||gc)*(r-1)/n),a=n*(i-1);return{...e,page:i,unitsPerPage:n,visibleUnitIds:e.orderedUnitIds.slice(a,a+n)}},cC=(e,t)=>({...e,restrictedUnitIds:t.newRestrictedUnitIds,selectedUnitIds:t.newRestrictedUnitIds!==void 0&&e.selectedUnitIds!==void 0?new Set([...e.selectedUnitIds].filter(n=>!t.newRestrictedUnitIds||t.newRestrictedUnitIds.includes(n))):e.selectedUnitIds}),Ab=(e,t)=>{const n=(e.unitsPerPage||gc)*((e.page||1)-1);return e.visibleUnitIds&&e.visibleUnitIds.length>0?t.slice(n,n+(e.unitsPerPage||gc)):void 0},fC=(e,t)=>{const{newUnitOrder:n}=t,{orderedUnitIds:r}=e;if(!n||n.length===0)throw Error("Attempt to reset unit ordering to empty set.");const i=new Set(r);if(i.size>0&&(n.length!==i.size||n.some(o=>!i.has(o))))throw Error("Reordering units, but the set of units in the new and old ordering don't match.");if(r.every((o,u)=>o===n[u]))return e;const a=Ab(e,n);return{...e,orderedUnitIds:n,lastClickedId:void 0,visibleUnitIds:a,sortRules:[]}},dC=(e,t)=>{const{sortRules:n}=e,{newSortField:r,sortCallback:i}=t;if(r===void 0||i===void 0)throw Error("Attempt to update sort fields with undefined field or callback.");const a=hC(n||[],r,t.ascending),o=i(a),u=Ab(e,o);return{...e,sortRules:a,orderedUnitIds:o,visibleUnitIds:u,lastClickedId:void 0}},hC=(e,t,n)=>{const r=e.pop(),i=n===void 0?r?.columnName===t?!r.sortAscending:!0:n;return r&&r.columnName!==t&&e.push(r),[...e.filter(o=>o.columnName!==t),{columnName:t,sortAscending:i}]},mC="SET_SELECTION",Kh="UNIQUE_SELECT",Cb="UNIQUE_SELECT_NEXT",Mb="UNIQUE_SELECT_PREVIOUS",Tb="UNIQUE_SELECT_FIRST",_b="UNIQUE_SELECT_LAST",Qh="TOGGLE_UNIT",Wh="TOGGLE_RANGE",pC="TOGGLE_SELECT_ALL",gC="DESELECT_ALL",To="INITIALIZE_UNITS",vC="SET_UNIT_ORDER",yC="UPDATE_SORT_FIELDS",bC="SET_VISIBLE_UNITS",DC="SET_RESTRICTED_UNITS",SC="COPY_STATE",Bb={selectedUnitIds:new Set,currentUnitId:void 0,orderedUnitIds:[]},wC=(e,t)=>{const{type:n}=t;switch(n){case To:{const r=new Set(e.orderedUnitIds);if((t.newUnitOrder||[]).filter(i=>!r.has(i)).length===0)return e;if(t.newUnitOrder&&t.newUnitOrder.length>=1)return{...e,orderedUnitIds:Nr([...new Set([...t.newUnitOrder,...e.orderedUnitIds])])};throw Error("Attempt to initialize table ordering with no actual units passed.")}case mC:return nC(e,t);case Kh:return Mo(e,t);case Cb:return W3(e);case Mb:return J3(e);case Tb:return eC(e);case _b:return tC(e);case Qh:return Eb(e,t);case Wh:return e.lastClickedId?rC(e,t):Eb(e,t);case pC:return iC(e);case gC:return{...e,selectedUnitIds:new Set,currentUnitId:void 0};case vC:return fC(e,t);case yC:return dC(e,t);case bC:return sC(e,t);case DC:return cC(e,t);case SC:if(!t.sourceState)throw Error("Attempt to copy state but no source state was provided.");return{...t.sourceState};default:throw Error(`Invalid mode for unit selection reducer: ${n}`)}},xC=()=>_.useContext(Nb),Nb=kt.createContext({unitSelection:Bb,unitSelectionDispatch:()=>{}}),ii=()=>{const{unitSelection:e,unitSelectionDispatch:t}=xC(),n=_.useMemo(()=>aC(t),[t]),r=_.useMemo(()=>oC(t),[t]),i=_.useMemo(()=>EC(e.orderedUnitIds,e.restrictedUnitIds),[e.orderedUnitIds,e.restrictedUnitIds]),a=_.useMemo(()=>e.orderedUnitIds.filter(o=>e.selectedUnitIds.has(o)),[e.orderedUnitIds,e.selectedUnitIds]);return{selectedUnitIds:e.selectedUnitIds,currentUnitId:e.currentUnitId,orderedUnitIds:i,allOrderedUnitIds:e.orderedUnitIds,selectedUnitIdsArray:a,visibleUnitIds:e.visibleUnitIds,primarySortRule:e.sortRules&&e.sortRules.length>0?e.sortRules[e.sortRules.length-1]:void 0,page:e.page,unitsPerPage:e.unitsPerPage,checkboxClickHandlerGenerator:n,plotClickHandlerGenerator:r,unitIdSelectionDispatch:t,currentState:e,restrictedUnitIds:e.restrictedUnitIds}},EC=(e,t)=>{if(t===void 0)return e;const n=new Set(t);return e.filter(r=>n.has(r))},{min:AC,max:CC}=Math,wa=(e,t=0,n=1)=>AC(CC(t,e),n),Jh=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=wa(e[t],0,255)):t===3&&(e[t]=wa(e[t],0,1));return e},Fb={};for(let e of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])Fb[`[object ${e}]`]=e.toLowerCase();function Re(e){return Fb[Object.prototype.toString.call(e)]||"object"}const Te=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):Re(e[0])=="object"&&t?t.split("").filter(n=>e[0][n]!==void 0).map(n=>e[0][n]):e[0].slice(0),_o=e=>{if(e.length<2)return null;const t=e.length-1;return Re(e[t])=="string"?e[t].toLowerCase():null},{PI:vc,min:Rb,max:Ob}=Math,rr=e=>Math.round(e*100)/100,em=e=>Math.round(e*100)/100,ai=vc*2,tm=vc/3,MC=vc/180,TC=180/vc;function zb(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}const Me={format:{},autodetect:[]};class oe{constructor(...t){const n=this;if(Re(t[0])==="object"&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];let r=_o(t),i=!1;if(!r){i=!0,Me.sorted||(Me.autodetect=Me.autodetect.sort((a,o)=>o.p-a.p),Me.sorted=!0);for(let a of Me.autodetect)if(r=a.test(...t),r)break}if(Me.format[r]){const a=Me.format[r].apply(null,i?t:t.slice(0,-1));n._rgb=Jh(a)}else throw new Error("unknown format: "+t);n._rgb.length===3&&n._rgb.push(1)}toString(){return Re(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}}const _C="3.1.2",Ue=(...e)=>new oe(...e);Ue.version=_C;const Bo={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},BC=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,NC=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Ub=e=>{if(e.match(BC)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e,16),n=t>>16,r=t>>8&255,i=t&255;return[n,r,i,1]}if(e.match(NC)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e,16),n=t>>24&255,r=t>>16&255,i=t>>8&255,a=Math.round((t&255)/255*100)/100;return[n,r,i,a]}throw new Error(`unknown hex color: ${e}`)},{round:yc}=Math,Ib=(...e)=>{let[t,n,r,i]=Te(e,"rgba"),a=_o(e)||"auto";i===void 0&&(i=1),a==="auto"&&(a=i<1?"rgba":"rgb"),t=yc(t),n=yc(n),r=yc(r);let u="000000"+(t<<16|n<<8|r).toString(16);u=u.substr(u.length-6);let l="0"+yc(i*255).toString(16);switch(l=l.substr(l.length-2),a.toLowerCase()){case"rgba":return`#${u}${l}`;case"argb":return`#${l}${u}`;default:return`#${u}`}};oe.prototype.name=function(){const e=Ib(this._rgb,"rgb");for(let t of Object.keys(Bo))if(Bo[t]===e)return t.toLowerCase();return e},Me.format.named=e=>{if(e=e.toLowerCase(),Bo[e])return Ub(Bo[e]);throw new Error("unknown color name: "+e)},Me.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Re(e)==="string"&&Bo[e.toLowerCase()])return"named"}}),oe.prototype.alpha=function(e,t=!1){return e!==void 0&&Re(e)==="number"?t?(this._rgb[3]=e,this):new oe([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},oe.prototype.clipped=function(){return this._rgb._clipped||!1};const Fr={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},FC=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function oi(e){const t=FC.get(String(e).toLowerCase());if(!t)throw new Error("unknown Lab illuminant "+e);Fr.labWhitePoint=e,Fr.Xn=t[0],Fr.Zn=t[1]}function gl(){return Fr.labWhitePoint}const nm=(...e)=>{e=Te(e,"lab");const[t,n,r]=e,[i,a,o]=RC(t,n,r),[u,l,s]=$b(i,a,o);return[u,l,s,e.length>3?e[3]:1]},RC=(e,t,n)=>{const{kE:r,kK:i,kKE:a,Xn:o,Yn:u,Zn:l}=Fr,s=(e+16)/116,c=.002*t+s,f=s-.005*n,d=c*c*c,h=f*f*f,g=d>r?d:(116*c-16)/i,m=e>a?Math.pow((e+16)/116,3):e/i,D=h>r?h:(116*f-16)/i,p=g*o,v=m*u,y=D*l;return[p,v,y]},rm=e=>{const t=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*Math.pow(e,1/2.4)-.055)*t},$b=(e,t,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:i,MtxXYZ2RGB:a,RefWhiteRGB:o,Xn:u,Yn:l,Zn:s}=Fr,c=u*r.m00+l*r.m10+s*r.m20,f=u*r.m01+l*r.m11+s*r.m21,d=u*r.m02+l*r.m12+s*r.m22,h=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,g=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,m=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,D=(e*r.m00+t*r.m10+n*r.m20)*(h/c),p=(e*r.m01+t*r.m11+n*r.m21)*(g/f),v=(e*r.m02+t*r.m12+n*r.m22)*(m/d),y=D*i.m00+p*i.m10+v*i.m20,w=D*i.m01+p*i.m11+v*i.m21,E=D*i.m02+p*i.m12+v*i.m22,b=rm(y*a.m00+w*a.m10+E*a.m20),S=rm(y*a.m01+w*a.m11+E*a.m21),A=rm(y*a.m02+w*a.m12+E*a.m22);return[b*255,S*255,A*255]},im=(...e)=>{const[t,n,r,...i]=Te(e,"rgb"),[a,o,u]=kb(t,n,r),[l,s,c]=OC(a,o,u);return[l,s,c,...i.length>0&&i[0]<1?[i[0]]:[]]};function OC(e,t,n){const{Xn:r,Yn:i,Zn:a,kE:o,kK:u}=Fr,l=e/r,s=t/i,c=n/a,f=l>o?Math.pow(l,1/3):(u*l+16)/116,d=s>o?Math.pow(s,1/3):(u*s+16)/116,h=c>o?Math.pow(c,1/3):(u*c+16)/116;return[116*d-16,500*(f-d),200*(d-h)]}function am(e){const t=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4))*t}const kb=(e,t,n)=>{e=am(e/255),t=am(t/255),n=am(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:i,MtxAdaptMaI:a,Xn:o,Yn:u,Zn:l,As:s,Bs:c,Cs:f}=Fr;let d=e*r.m00+t*r.m10+n*r.m20,h=e*r.m01+t*r.m11+n*r.m21,g=e*r.m02+t*r.m12+n*r.m22;const m=o*i.m00+u*i.m10+l*i.m20,D=o*i.m01+u*i.m11+l*i.m21,p=o*i.m02+u*i.m12+l*i.m22;let v=d*i.m00+h*i.m10+g*i.m20,y=d*i.m01+h*i.m11+g*i.m21,w=d*i.m02+h*i.m12+g*i.m22;return v*=m/s,y*=D/c,w*=p/f,d=v*a.m00+y*a.m10+w*a.m20,h=v*a.m01+y*a.m11+w*a.m21,g=v*a.m02+y*a.m12+w*a.m22,[d,h,g]};oe.prototype.lab=function(){return im(this._rgb)},Object.assign(Ue,{lab:(...e)=>new oe(...e,"lab"),getLabWhitePoint:gl,setLabWhitePoint:oi}),Me.format.lab=nm,Me.autodetect.push({p:2,test:(...e)=>{if(e=Te(e,"lab"),Re(e)==="array"&&e.length===3)return"lab"}}),oe.prototype.darken=function(e=1){const t=this,n=t.lab();return n[0]-=Fr.Kn*e,new oe(n,"lab").alpha(t.alpha(),!0)},oe.prototype.brighten=function(e=1){return this.darken(-e)},oe.prototype.darker=oe.prototype.darken,oe.prototype.brighter=oe.prototype.brighten,oe.prototype.get=function(e){const[t,n]=e.split("."),r=this[t]();if(n){const i=t.indexOf(n)-(t.substr(0,2)==="ok"?2:0);if(i>-1)return r[i];throw new Error(`unknown channel ${n} in mode ${t}`)}else return r};const{pow:zC}=Math,UC=1e-7,IC=20;oe.prototype.luminance=function(e,t="rgb"){if(e!==void 0&&Re(e)==="number"){if(e===0)return new oe([0,0,0,this._rgb[3]],"rgb");if(e===1)return new oe([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=IC;const i=(o,u)=>{const l=o.interpolate(u,.5,t),s=l.luminance();return Math.abs(e-s)<UC||!r--?l:s>e?i(o,l):i(l,u)},a=(n>e?i(new oe([0,0,0]),this):i(this,new oe([255,255,255]))).rgb();return new oe([...a,this._rgb[3]])}return $C(...this._rgb.slice(0,3))};const $C=(e,t,n)=>(e=om(e),t=om(t),n=om(n),.2126*e+.7152*t+.0722*n),om=e=>(e/=255,e<=.03928?e/12.92:zC((e+.055)/1.055,2.4)),on={},No=(e,t,n=.5,...r)=>{let i=r[0]||"lrgb";if(!on[i]&&!r.length&&(i=Object.keys(on)[0]),!on[i])throw new Error(`interpolation mode ${i} is not defined`);return Re(e)!=="object"&&(e=new oe(e)),Re(t)!=="object"&&(t=new oe(t)),on[i](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};oe.prototype.mix=oe.prototype.interpolate=function(e,t=.5,...n){return No(this,e,t,...n)},oe.prototype.premultiply=function(e=!1){const t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new oe([t[0]*n,t[1]*n,t[2]*n,n],"rgb")};const{sin:kC,cos:LC}=Math,Lb=(...e)=>{let[t,n,r]=Te(e,"lch");return isNaN(r)&&(r=0),r=r*MC,[t,LC(r)*n,kC(r)*n]},um=(...e)=>{e=Te(e,"lch");const[t,n,r]=e,[i,a,o]=Lb(t,n,r),[u,l,s]=nm(i,a,o);return[u,l,s,e.length>3?e[3]:1]},jC=(...e)=>{const t=zb(Te(e,"hcl"));return um(...t)},{sqrt:PC,atan2:HC,round:qC}=Math,jb=(...e)=>{const[t,n,r]=Te(e,"lab"),i=PC(n*n+r*r);let a=(HC(r,n)*TC+360)%360;return qC(i*1e4)===0&&(a=Number.NaN),[t,i,a]},lm=(...e)=>{const[t,n,r,...i]=Te(e,"rgb"),[a,o,u]=im(t,n,r),[l,s,c]=jb(a,o,u);return[l,s,c,...i.length>0&&i[0]<1?[i[0]]:[]]};oe.prototype.lch=function(){return lm(this._rgb)},oe.prototype.hcl=function(){return zb(lm(this._rgb))},Object.assign(Ue,{lch:(...e)=>new oe(...e,"lch"),hcl:(...e)=>new oe(...e,"hcl")}),Me.format.lch=um,Me.format.hcl=jC,["lch","hcl"].forEach(e=>Me.autodetect.push({p:2,test:(...t)=>{if(t=Te(t,e),Re(t)==="array"&&t.length===3)return e}})),oe.prototype.saturate=function(e=1){const t=this,n=t.lch();return n[1]+=Fr.Kn*e,n[1]<0&&(n[1]=0),new oe(n,"lch").alpha(t.alpha(),!0)},oe.prototype.desaturate=function(e=1){return this.saturate(-e)},oe.prototype.set=function(e,t,n=!1){const[r,i]=e.split("."),a=this[r]();if(i){const o=r.indexOf(i)-(r.substr(0,2)==="ok"?2:0);if(o>-1){if(Re(t)=="string")switch(t.charAt(0)){case"+":a[o]+=+t;break;case"-":a[o]+=+t;break;case"*":a[o]*=+t.substr(1);break;case"/":a[o]/=+t.substr(1);break;default:a[o]=+t}else if(Re(t)==="number")a[o]=t;else throw new Error("unsupported value for Color.set");const u=new oe(a,r);return n?(this._rgb=u._rgb,this):u}throw new Error(`unknown channel ${i} in mode ${r}`)}else return a},oe.prototype.tint=function(e=.5,...t){return No(this,"white",e,...t)},oe.prototype.shade=function(e=.5,...t){return No(this,"black",e,...t)};const GC=(e,t,n)=>{const r=e._rgb,i=t._rgb;return new oe(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"rgb")};on.rgb=GC;const{sqrt:sm,pow:Fo}=Math,VC=(e,t,n)=>{const[r,i,a]=e._rgb,[o,u,l]=t._rgb;return new oe(sm(Fo(r,2)*(1-n)+Fo(o,2)*n),sm(Fo(i,2)*(1-n)+Fo(u,2)*n),sm(Fo(a,2)*(1-n)+Fo(l,2)*n),"rgb")};on.lrgb=VC;const YC=(e,t,n)=>{const r=e.lab(),i=t.lab();return new oe(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"lab")};on.lab=YC;const Ro=(e,t,n,r)=>{let i,a;r==="hsl"?(i=e.hsl(),a=t.hsl()):r==="hsv"?(i=e.hsv(),a=t.hsv()):r==="hcg"?(i=e.hcg(),a=t.hcg()):r==="hsi"?(i=e.hsi(),a=t.hsi()):r==="lch"||r==="hcl"?(r="hcl",i=e.hcl(),a=t.hcl()):r==="oklch"&&(i=e.oklch().reverse(),a=t.oklch().reverse());let o,u,l,s,c,f;(r.substr(0,1)==="h"||r==="oklch")&&([o,l,c]=i,[u,s,f]=a);let d,h,g,m;return!isNaN(o)&&!isNaN(u)?(u>o&&u-o>180?m=u-(o+360):u<o&&o-u>180?m=u+360-o:m=u-o,h=o+n*m):isNaN(o)?isNaN(u)?h=Number.NaN:(h=u,(c==1||c==0)&&r!="hsv"&&(d=s)):(h=o,(f==1||f==0)&&r!="hsv"&&(d=l)),d===void 0&&(d=l+n*(s-l)),g=c+n*(f-c),r==="oklch"?new oe([g,d,h],r):new oe([h,d,g],r)},Pb=(e,t,n)=>Ro(e,t,n,"lch");on.lch=Pb,on.hcl=Pb;const XC=e=>{if(Re(e)=="number"&&e>=0&&e<=16777215){const t=e>>16,n=e>>8&255,r=e&255;return[t,n,r,1]}throw new Error("unknown num color: "+e)},ZC=(...e)=>{const[t,n,r]=Te(e,"rgb");return(t<<16)+(n<<8)+r};oe.prototype.num=function(){return ZC(this._rgb)},Object.assign(Ue,{num:(...e)=>new oe(...e,"num")}),Me.format.num=XC,Me.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&Re(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return"num"}});const KC=(e,t,n)=>{const r=e.num(),i=t.num();return new oe(r+n*(i-r),"num")};on.num=KC;const{floor:QC}=Math,WC=(...e)=>{e=Te(e,"hcg");let[t,n,r]=e,i,a,o;r=r*255;const u=n*255;if(n===0)i=a=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;const l=QC(t),s=t-l,c=r*(1-n),f=c+u*(1-s),d=c+u*s,h=c+u;switch(l){case 0:[i,a,o]=[h,d,c];break;case 1:[i,a,o]=[f,h,c];break;case 2:[i,a,o]=[c,h,d];break;case 3:[i,a,o]=[c,f,h];break;case 4:[i,a,o]=[d,c,h];break;case 5:[i,a,o]=[h,c,f];break}}return[i,a,o,e.length>3?e[3]:1]},JC=(...e)=>{const[t,n,r]=Te(e,"rgb"),i=Rb(t,n,r),a=Ob(t,n,r),o=a-i,u=o*100/255,l=i/(255-o)*100;let s;return o===0?s=Number.NaN:(t===a&&(s=(n-r)/o),n===a&&(s=2+(r-t)/o),r===a&&(s=4+(t-n)/o),s*=60,s<0&&(s+=360)),[s,u,l]};oe.prototype.hcg=function(){return JC(this._rgb)};const e5=(...e)=>new oe(...e,"hcg");Ue.hcg=e5,Me.format.hcg=WC,Me.autodetect.push({p:1,test:(...e)=>{if(e=Te(e,"hcg"),Re(e)==="array"&&e.length===3)return"hcg"}});const t5=(e,t,n)=>Ro(e,t,n,"hcg");on.hcg=t5;const{cos:Oo}=Math,n5=(...e)=>{e=Te(e,"hsi");let[t,n,r]=e,i,a,o;return isNaN(t)&&(t=0),isNaN(n)&&(n=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(o=(1-n)/3,i=(1+n*Oo(ai*t)/Oo(tm-ai*t))/3,a=1-(o+i)):t<2/3?(t-=1/3,i=(1-n)/3,a=(1+n*Oo(ai*t)/Oo(tm-ai*t))/3,o=1-(i+a)):(t-=2/3,a=(1-n)/3,o=(1+n*Oo(ai*t)/Oo(tm-ai*t))/3,i=1-(a+o)),i=wa(r*i*3),a=wa(r*a*3),o=wa(r*o*3),[i*255,a*255,o*255,e.length>3?e[3]:1]},{min:r5,sqrt:i5,acos:a5}=Math,o5=(...e)=>{let[t,n,r]=Te(e,"rgb");t/=255,n/=255,r/=255;let i;const a=r5(t,n,r),o=(t+n+r)/3,u=o>0?1-a/o:0;return u===0?i=NaN:(i=(t-n+(t-r))/2,i/=i5((t-n)*(t-n)+(t-r)*(n-r)),i=a5(i),r>n&&(i=ai-i),i/=ai),[i*360,u,o]};oe.prototype.hsi=function(){return o5(this._rgb)};const u5=(...e)=>new oe(...e,"hsi");Ue.hsi=u5,Me.format.hsi=n5,Me.autodetect.push({p:2,test:(...e)=>{if(e=Te(e,"hsi"),Re(e)==="array"&&e.length===3)return"hsi"}});const l5=(e,t,n)=>Ro(e,t,n,"hsi");on.hsi=l5;const cm=(...e)=>{e=Te(e,"hsl");const[t,n,r]=e;let i,a,o;if(n===0)i=a=o=r*255;else{const u=[0,0,0],l=[0,0,0],s=r<.5?r*(1+n):r+n-r*n,c=2*r-s,f=t/360;u[0]=f+1/3,u[1]=f,u[2]=f-1/3;for(let d=0;d<3;d++)u[d]<0&&(u[d]+=1),u[d]>1&&(u[d]-=1),6*u[d]<1?l[d]=c+(s-c)*6*u[d]:2*u[d]<1?l[d]=s:3*u[d]<2?l[d]=c+(s-c)*(2/3-u[d])*6:l[d]=c;[i,a,o]=[l[0]*255,l[1]*255,l[2]*255]}return e.length>3?[i,a,o,e[3]]:[i,a,o,1]},Hb=(...e)=>{e=Te(e,"rgba");let[t,n,r]=e;t/=255,n/=255,r/=255;const i=Rb(t,n,r),a=Ob(t,n,r),o=(a+i)/2;let u,l;return a===i?(u=0,l=Number.NaN):u=o<.5?(a-i)/(a+i):(a-i)/(2-a-i),t==a?l=(n-r)/(a-i):n==a?l=2+(r-t)/(a-i):r==a&&(l=4+(t-n)/(a-i)),l*=60,l<0&&(l+=360),e.length>3&&e[3]!==void 0?[l,u,o,e[3]]:[l,u,o]};oe.prototype.hsl=function(){return Hb(this._rgb)};const s5=(...e)=>new oe(...e,"hsl");Ue.hsl=s5,Me.format.hsl=cm,Me.autodetect.push({p:2,test:(...e)=>{if(e=Te(e,"hsl"),Re(e)==="array"&&e.length===3)return"hsl"}});const c5=(e,t,n)=>Ro(e,t,n,"hsl");on.hsl=c5;const{floor:f5}=Math,d5=(...e)=>{e=Te(e,"hsv");let[t,n,r]=e,i,a,o;if(r*=255,n===0)i=a=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;const u=f5(t),l=t-u,s=r*(1-n),c=r*(1-n*l),f=r*(1-n*(1-l));switch(u){case 0:[i,a,o]=[r,f,s];break;case 1:[i,a,o]=[c,r,s];break;case 2:[i,a,o]=[s,r,f];break;case 3:[i,a,o]=[s,c,r];break;case 4:[i,a,o]=[f,s,r];break;case 5:[i,a,o]=[r,s,c];break}}return[i,a,o,e.length>3?e[3]:1]},{min:h5,max:m5}=Math,p5=(...e)=>{e=Te(e,"rgb");let[t,n,r]=e;const i=h5(t,n,r),a=m5(t,n,r),o=a-i;let u,l,s;return s=a/255,a===0?(u=Number.NaN,l=0):(l=o/a,t===a&&(u=(n-r)/o),n===a&&(u=2+(r-t)/o),r===a&&(u=4+(t-n)/o),u*=60,u<0&&(u+=360)),[u,l,s]};oe.prototype.hsv=function(){return p5(this._rgb)};const g5=(...e)=>new oe(...e,"hsv");Ue.hsv=g5,Me.format.hsv=d5,Me.autodetect.push({p:2,test:(...e)=>{if(e=Te(e,"hsv"),Re(e)==="array"&&e.length===3)return"hsv"}});const v5=(e,t,n)=>Ro(e,t,n,"hsv");on.hsv=v5;function bc(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(o=>[o]));let r=t[0].length,i=t[0].map((o,u)=>t.map(l=>l[u])),a=e.map(o=>i.map(u=>Array.isArray(o)?o.reduce((l,s,c)=>l+s*(u[c]||0),0):u.reduce((l,s)=>l+s*o,0)));return n===1&&(a=a[0]),r===1?a.map(o=>o[0]):a}const fm=(...e)=>{e=Te(e,"lab");const[t,n,r,...i]=e,[a,o,u]=y5([t,n,r]),[l,s,c]=$b(a,o,u);return[l,s,c,...i.length>0&&i[0]<1?[i[0]]:[]]};function y5(e){var t=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],r=bc(n,e);return bc(t,r.map(i=>i**3))}const dm=(...e)=>{const[t,n,r,...i]=Te(e,"rgb"),a=kb(t,n,r);return[...b5(a),...i.length>0&&i[0]<1?[i[0]]:[]]};function b5(e){const t=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],r=bc(t,e);return bc(n,r.map(i=>Math.cbrt(i)))}oe.prototype.oklab=function(){return dm(this._rgb)},Object.assign(Ue,{oklab:(...e)=>new oe(...e,"oklab")}),Me.format.oklab=fm,Me.autodetect.push({p:2,test:(...e)=>{if(e=Te(e,"oklab"),Re(e)==="array"&&e.length===3)return"oklab"}});const D5=(e,t,n)=>{const r=e.oklab(),i=t.oklab();return new oe(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"oklab")};on.oklab=D5;const S5=(e,t,n)=>Ro(e,t,n,"oklch");on.oklch=S5;const{pow:hm,sqrt:mm,PI:pm,cos:qb,sin:Gb,atan2:w5}=Math,x5=(e,t="lrgb",n=null)=>{const r=e.length;n||(n=Array.from(new Array(r)).map(()=>1));const i=r/n.reduce(function(f,d){return f+d});if(n.forEach((f,d)=>{n[d]*=i}),e=e.map(f=>new oe(f)),t==="lrgb")return E5(e,n);const a=e.shift(),o=a.get(t),u=[];let l=0,s=0;for(let f=0;f<o.length;f++)if(o[f]=(o[f]||0)*n[0],u.push(isNaN(o[f])?0:n[0]),t.charAt(f)==="h"&&!isNaN(o[f])){const d=o[f]/180*pm;l+=qb(d)*n[0],s+=Gb(d)*n[0]}let c=a.alpha()*n[0];e.forEach((f,d)=>{const h=f.get(t);c+=f.alpha()*n[d+1];for(let g=0;g<o.length;g++)if(!isNaN(h[g]))if(u[g]+=n[d+1],t.charAt(g)==="h"){const m=h[g]/180*pm;l+=qb(m)*n[d+1],s+=Gb(m)*n[d+1]}else o[g]+=h[g]*n[d+1]});for(let f=0;f<o.length;f++)if(t.charAt(f)==="h"){let d=w5(s/u[f],l/u[f])/pm*180;for(;d<0;)d+=360;for(;d>=360;)d-=360;o[f]=d}else o[f]=o[f]/u[f];return c/=r,new oe(o,t).alpha(c>.99999?1:c,!0)},E5=(e,t)=>{const n=e.length,r=[0,0,0,0];for(let i=0;i<e.length;i++){const a=e[i],o=t[i]/n,u=a._rgb;r[0]+=hm(u[0],2)*o,r[1]+=hm(u[1],2)*o,r[2]+=hm(u[2],2)*o,r[3]+=u[3]*o}return r[0]=mm(r[0]),r[1]=mm(r[1]),r[2]=mm(r[2]),r[3]>.9999999&&(r[3]=1),new oe(Jh(r))},{pow:A5}=Math;function Dc(e){let t="rgb",n=Ue("#ccc"),r=0,i=[0,1],a=[],o=[0,0],u=!1,l=[],s=!1,c=0,f=1,d=!1,h={},g=!0,m=1;const D=function(S){if(S=S||["#fff","#000"],S&&Re(S)==="string"&&Ue.brewer&&Ue.brewer[S.toLowerCase()]&&(S=Ue.brewer[S.toLowerCase()]),Re(S)==="array"){S.length===1&&(S=[S[0],S[0]]),S=S.slice(0);for(let A=0;A<S.length;A++)S[A]=Ue(S[A]);a.length=0;for(let A=0;A<S.length;A++)a.push(A/(S.length-1))}return E(),l=S},p=function(S){if(u!=null){const A=u.length-1;let C=0;for(;C<A&&S>=u[C];)C++;return C-1}return 0};let v=S=>S,y=S=>S;const w=function(S,A){let C,M;if(A==null&&(A=!1),isNaN(S)||S===null)return n;A?M=S:u&&u.length>2?M=p(S)/(u.length-2):f!==c?M=(S-c)/(f-c):M=1,M=y(M),A||(M=v(M)),m!==1&&(M=A5(M,m)),M=o[0]+M*(1-o[0]-o[1]),M=wa(M,0,1);const T=Math.floor(M*1e4);if(g&&h[T])C=h[T];else{if(Re(l)==="array")for(let x=0;x<a.length;x++){const N=a[x];if(M<=N){C=l[x];break}if(M>=N&&x===a.length-1){C=l[x];break}if(M>N&&M<a[x+1]){M=(M-N)/(a[x+1]-N),C=Ue.interpolate(l[x],l[x+1],M,t);break}}else Re(l)==="function"&&(C=l(M));g&&(h[T]=C)}return C};var E=()=>h={};D(e);const b=function(S){const A=Ue(w(S));return s&&A[s]?A[s]():A};return b.classes=function(S){if(S!=null){if(Re(S)==="array")u=S,i=[S[0],S[S.length-1]];else{const A=Ue.analyze(i);S===0?u=[A.min,A.max]:u=Ue.limits(A,"e",S)}return b}return u},b.domain=function(S){if(!arguments.length)return i;c=S[0],f=S[S.length-1],a=[];const A=l.length;if(S.length===A&&c!==f)for(let C of Array.from(S))a.push((C-c)/(f-c));else{for(let C=0;C<A;C++)a.push(C/(A-1));if(S.length>2){const C=S.map((T,x)=>x/(S.length-1)),M=S.map(T=>(T-c)/(f-c));M.every((T,x)=>C[x]===T)||(y=T=>{if(T<=0||T>=1)return T;let x=0;for(;T>=M[x+1];)x++;const N=(T-M[x])/(M[x+1]-M[x]);return C[x]+N*(C[x+1]-C[x])})}}return i=[c,f],b},b.mode=function(S){return arguments.length?(t=S,E(),b):t},b.range=function(S,A){return D(S),b},b.out=function(S){return s=S,b},b.spread=function(S){return arguments.length?(r=S,b):r},b.correctLightness=function(S){return S==null&&(S=!0),d=S,E(),d?v=function(A){const C=w(0,!0).lab()[0],M=w(1,!0).lab()[0],T=C>M;let x=w(A,!0).lab()[0];const N=C+(M-C)*A;let R=x-N,z=0,F=1,U=20;for(;Math.abs(R)>.01&&U-- >0;)(function(){return T&&(R*=-1),R<0?(z=A,A+=(F-A)*.5):(F=A,A+=(z-A)*.5),x=w(A,!0).lab()[0],R=x-N})();return A}:v=A=>A,b},b.padding=function(S){return S!=null?(Re(S)==="number"&&(S=[S,S]),o=S,b):o},b.colors=function(S,A){arguments.length<2&&(A="hex");let C=[];if(arguments.length===0)C=l.slice(0);else if(S===1)C=[b(.5)];else if(S>1){const M=i[0],T=i[1]-M;C=C5(0,S).map(x=>b(M+x/(S-1)*T))}else{e=[];let M=[];if(u&&u.length>2)for(let T=1,x=u.length,N=1<=x;N?T<x:T>x;N?T++:T--)M.push((u[T-1]+u[T])*.5);else M=i;C=M.map(T=>b(T))}return Ue[A]&&(C=C.map(M=>M[A]())),C},b.cache=function(S){return S!=null?(g=S,b):g},b.gamma=function(S){return S!=null?(m=S,b):m},b.nodata=function(S){return S!=null?(n=Ue(S),b):n},b}function C5(e,t,n){let r=[],i=e<t,a=t;for(let o=e;i?o<a:o>a;i?o++:o--)r.push(o);return r}const M5=function(e){let t=[1,1];for(let n=1;n<e;n++){let r=[1];for(let i=1;i<=t.length;i++)r[i]=(t[i]||0)+t[i-1];t=r}return t},T5=function(e){let t,n,r,i;if(e=e.map(a=>new oe(a)),e.length===2)[n,r]=e.map(a=>a.lab()),t=function(a){const o=[0,1,2].map(u=>n[u]+a*(r[u]-n[u]));return new oe(o,"lab")};else if(e.length===3)[n,r,i]=e.map(a=>a.lab()),t=function(a){const o=[0,1,2].map(u=>(1-a)*(1-a)*n[u]+2*(1-a)*a*r[u]+a*a*i[u]);return new oe(o,"lab")};else if(e.length===4){let a;[n,r,i,a]=e.map(o=>o.lab()),t=function(o){const u=[0,1,2].map(l=>(1-o)*(1-o)*(1-o)*n[l]+3*(1-o)*(1-o)*o*r[l]+3*(1-o)*o*o*i[l]+o*o*o*a[l]);return new oe(u,"lab")}}else if(e.length>=5){let a,o,u;a=e.map(l=>l.lab()),u=e.length-1,o=M5(u),t=function(l){const s=1-l,c=[0,1,2].map(f=>a.reduce((d,h,g)=>d+o[g]*s**(u-g)*l**g*h[f],0));return new oe(c,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return t},_5=e=>{const t=T5(e);return t.scale=()=>Dc(t),t},{round:Vb}=Math;oe.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Vb)},oe.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:Vb(t):t)},Object.assign(Ue,{rgb:(...e)=>new oe(...e,"rgb")}),Me.format.rgb=(...e)=>{const t=Te(e,"rgba");return t[3]===void 0&&(t[3]=1),t},Me.autodetect.push({p:3,test:(...e)=>{if(e=Te(e,"rgba"),Re(e)==="array"&&(e.length===3||e.length===4&&Re(e[3])=="number"&&e[3]>=0&&e[3]<=1))return"rgb"}});const pr=(e,t,n)=>{if(!pr[n])throw new Error("unknown blend mode "+n);return pr[n](e,t)},qi=e=>(t,n)=>{const r=Ue(n).rgb(),i=Ue(t).rgb();return Ue.rgb(e(r,i))},Gi=e=>(t,n)=>{const r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r},B5=e=>e,N5=(e,t)=>e*t/255,F5=(e,t)=>e>t?t:e,R5=(e,t)=>e>t?e:t,O5=(e,t)=>255*(1-(1-e/255)*(1-t/255)),z5=(e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),U5=(e,t)=>255*(1-(1-t/255)/(e/255)),I5=(e,t)=>e===255?255:(e=255*(t/255)/(1-e/255),e>255?255:e);pr.normal=qi(Gi(B5)),pr.multiply=qi(Gi(N5)),pr.screen=qi(Gi(O5)),pr.overlay=qi(Gi(z5)),pr.darken=qi(Gi(F5)),pr.lighten=qi(Gi(R5)),pr.dodge=qi(Gi(I5)),pr.burn=qi(Gi(U5));const{pow:$5,sin:k5,cos:L5}=Math;function j5(e=300,t=-1.5,n=1,r=1,i=[0,1]){let a=0,o;Re(i)==="array"?o=i[1]-i[0]:(o=0,i=[i,i]);const u=function(l){const s=ai*((e+120)/360+t*l),c=$5(i[0]+o*l,r),d=(a!==0?n[0]+l*a:n)*c*(1-c)/2,h=L5(s),g=k5(s),m=c+d*(-.14861*h+1.78277*g),D=c+d*(-.29227*h-.90649*g),p=c+d*(1.97294*h);return Ue(Jh([m*255,D*255,p*255,1]))};return u.start=function(l){return l==null?e:(e=l,u)},u.rotations=function(l){return l==null?t:(t=l,u)},u.gamma=function(l){return l==null?r:(r=l,u)},u.hue=function(l){return l==null?n:(n=l,Re(n)==="array"?(a=n[1]-n[0],a===0&&(n=n[1])):a=0,u)},u.lightness=function(l){return l==null?i:(Re(l)==="array"?(i=l,o=l[1]-l[0]):(i=[l,l],o=0),u)},u.scale=()=>Ue.scale(u),u.hue(n),u}const P5="0123456789abcdef",{floor:H5,random:q5}=Math,G5=()=>{let e="#";for(let t=0;t<6;t++)e+=P5.charAt(H5(q5()*16));return new oe(e,"hex")},{log:Yb,pow:V5,floor:Y5,abs:X5}=Math;function Xb(e,t=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Re(e)==="object"&&(e=Object.values(e)),e.forEach(r=>{t&&Re(r)==="object"&&(r=r[t]),r!=null&&!isNaN(r)&&(n.values.push(r),n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(r,i)=>Zb(n,r,i),n}function Zb(e,t="equal",n=7){Re(e)=="array"&&(e=Xb(e));const{min:r,max:i}=e,a=e.values.sort((u,l)=>u-l);if(n===1)return[r,i];const o=[];if(t.substr(0,1)==="c"&&(o.push(r),o.push(i)),t.substr(0,1)==="e"){o.push(r);for(let u=1;u<n;u++)o.push(r+u/n*(i-r));o.push(i)}else if(t.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const u=Math.LOG10E*Yb(r),l=Math.LOG10E*Yb(i);o.push(r);for(let s=1;s<n;s++)o.push(V5(10,u+s/n*(l-u)));o.push(i)}else if(t.substr(0,1)==="q"){o.push(r);for(let u=1;u<n;u++){const l=(a.length-1)*u/n,s=Y5(l);if(s===l)o.push(a[s]);else{const c=l-s;o.push(a[s]*(1-c)+a[s+1]*c)}}o.push(i)}else if(t.substr(0,1)==="k"){let u;const l=a.length,s=new Array(l),c=new Array(n);let f=!0,d=0,h=null;h=[],h.push(r);for(let D=1;D<n;D++)h.push(r+D/n*(i-r));for(h.push(i);f;){for(let p=0;p<n;p++)c[p]=0;for(let p=0;p<l;p++){const v=a[p];let y=Number.MAX_VALUE,w;for(let E=0;E<n;E++){const b=X5(h[E]-v);b<y&&(y=b,w=E),c[w]++,s[p]=w}}const D=new Array(n);for(let p=0;p<n;p++)D[p]=null;for(let p=0;p<l;p++)u=s[p],D[u]===null?D[u]=a[p]:D[u]+=a[p];for(let p=0;p<n;p++)D[p]*=1/c[p];f=!1;for(let p=0;p<n;p++)if(D[p]!==h[p]){f=!0;break}h=D,d++,d>200&&(f=!1)}const g={};for(let D=0;D<n;D++)g[D]=[];for(let D=0;D<l;D++)u=s[D],g[u].push(a[D]);let m=[];for(let D=0;D<n;D++)m.push(g[D][0]),m.push(g[D][g[D].length-1]);m=m.sort((D,p)=>D-p),o.push(m[0]);for(let D=1;D<m.length;D+=2){const p=m[D];!isNaN(p)&&o.indexOf(p)===-1&&o.push(p)}}return o}const Z5=(e,t)=>{e=new oe(e),t=new oe(t);const n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)};/**
|
|
51
|
-
* @license
|
|
52
|
-
*
|
|
53
|
-
* The APCA contrast prediction algorithm is based of the formulas published
|
|
54
|
-
* in the APCA-1.0.98G specification by Myndex. The specification is available at:
|
|
55
|
-
* https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
|
|
56
|
-
*
|
|
57
|
-
* Note that the APCA implementation is still beta, so please update to
|
|
58
|
-
* future versions of chroma.js when they become available.
|
|
59
|
-
*
|
|
60
|
-
* You can read more about the APCA Readability Criterion at
|
|
61
|
-
* https://readtech.org/ARC/
|
|
62
|
-
*/const Kb=.027,K5=5e-4,Q5=.1,Qb=1.14,Sc=.022,Wb=1.414,W5=(e,t)=>{e=new oe(e),t=new oe(t),e.alpha()<1&&(e=No(t,e,e.alpha(),"rgb"));const n=Jb(...e.rgb()),r=Jb(...t.rgb()),i=n>=Sc?n:n+Math.pow(Sc-n,Wb),a=r>=Sc?r:r+Math.pow(Sc-r,Wb),o=Math.pow(a,.56)-Math.pow(i,.57),u=Math.pow(a,.65)-Math.pow(i,.62),l=Math.abs(a-i)<K5?0:i<a?o*Qb:u*Qb;return(Math.abs(l)<Q5?0:l>0?l-Kb:l+Kb)*100};function Jb(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:ui,pow:zt,min:J5,max:e4,atan2:e2,abs:t2,cos:wc,sin:n2,exp:t4,PI:r2}=Math;function n4(e,t,n=1,r=1,i=1){var a=function(P){return 360*P/(2*r2)},o=function(P){return 2*r2*P/360};e=new oe(e),t=new oe(t);const[u,l,s]=Array.from(e.lab()),[c,f,d]=Array.from(t.lab()),h=(u+c)/2,g=ui(zt(l,2)+zt(s,2)),m=ui(zt(f,2)+zt(d,2)),D=(g+m)/2,p=.5*(1-ui(zt(D,7)/(zt(D,7)+zt(25,7)))),v=l*(1+p),y=f*(1+p),w=ui(zt(v,2)+zt(s,2)),E=ui(zt(y,2)+zt(d,2)),b=(w+E)/2,S=a(e2(s,v)),A=a(e2(d,y)),C=S>=0?S:S+360,M=A>=0?A:A+360,T=t2(C-M)>180?(C+M+360)/2:(C+M)/2,x=1-.17*wc(o(T-30))+.24*wc(o(2*T))+.32*wc(o(3*T+6))-.2*wc(o(4*T-63));let N=M-C;N=t2(N)<=180?N:M<=C?N+360:N-360,N=2*ui(w*E)*n2(o(N)/2);const R=c-u,z=E-w,F=1+.015*zt(h-50,2)/ui(20+zt(h-50,2)),U=1+.045*b,I=1+.015*b*x,L=30*t4(-zt((T-275)/25,2)),X=-(2*ui(zt(b,7)/(zt(b,7)+zt(25,7))))*n2(2*o(L)),$=ui(zt(R/(n*F),2)+zt(z/(r*U),2)+zt(N/(i*I),2)+X*(z/(r*U))*(N/(i*I)));return e4(0,J5(100,$))}function r4(e,t,n="lab"){e=new oe(e),t=new oe(t);const r=e.get(n),i=t.get(n);let a=0;for(let o in r){const u=(r[o]||0)-(i[o]||0);a+=u*u}return Math.sqrt(a)}const i4=(...e)=>{try{return new oe(...e),!0}catch{return!1}},a4={cool(){return Dc([Ue.hsl(180,1,.9),Ue.hsl(250,.7,.4)])},hot(){return Dc(["#000","#f00","#ff0","#fff"]).mode("rgb")}},gm={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},i2=Object.keys(gm),a2=new Map(i2.map(e=>[e.toLowerCase(),e])),o4=typeof Proxy=="function"?new Proxy(gm,{get(e,t){const n=t.toLowerCase();if(a2.has(n))return e[a2.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(i2)}}):gm,u4=(...e)=>{e=Te(e,"cmyk");const[t,n,r,i]=e,a=e.length>4?e[4]:1;return i===1?[0,0,0,a]:[t>=1?0:255*(1-t)*(1-i),n>=1?0:255*(1-n)*(1-i),r>=1?0:255*(1-r)*(1-i),a]},{max:o2}=Math,l4=(...e)=>{let[t,n,r]=Te(e,"rgb");t=t/255,n=n/255,r=r/255;const i=1-o2(t,o2(n,r)),a=i<1?1/(1-i):0,o=(1-t-i)*a,u=(1-n-i)*a,l=(1-r-i)*a;return[o,u,l,i]};oe.prototype.cmyk=function(){return l4(this._rgb)},Object.assign(Ue,{cmyk:(...e)=>new oe(...e,"cmyk")}),Me.format.cmyk=u4,Me.autodetect.push({p:2,test:(...e)=>{if(e=Te(e,"cmyk"),Re(e)==="array"&&e.length===4)return"cmyk"}});const s4=(...e)=>{const t=Te(e,"hsla");let n=_o(e)||"lsa";return t[0]=rr(t[0]||0)+"deg",t[1]=rr(t[1]*100)+"%",t[2]=rr(t[2]*100)+"%",n==="hsla"||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),n="hsla"):t.length=3,`${n.substr(0,3)}(${t.join(" ")})`},c4=(...e)=>{const t=Te(e,"lab");let n=_o(e)||"lab";return t[0]=rr(t[0])+"%",t[1]=rr(t[1]),t[2]=rr(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},f4=(...e)=>{const t=Te(e,"lch");let n=_o(e)||"lab";return t[0]=rr(t[0])+"%",t[1]=rr(t[1]),t[2]=isNaN(t[2])?"none":rr(t[2])+"deg",n==="lcha"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},d4=(...e)=>{const t=Te(e,"lab");return t[0]=rr(t[0]*100)+"%",t[1]=em(t[1]),t[2]=em(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},u2=(...e)=>{const[t,n,r,...i]=Te(e,"rgb"),[a,o,u]=dm(t,n,r),[l,s,c]=jb(a,o,u);return[l,s,c,...i.length>0&&i[0]<1?[i[0]]:[]]},h4=(...e)=>{const t=Te(e,"lch");return t[0]=rr(t[0]*100)+"%",t[1]=em(t[1]),t[2]=isNaN(t[2])?"none":rr(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:vm}=Math,m4=(...e)=>{const t=Te(e,"rgba");let n=_o(e)||"rgb";if(n.substr(0,3)==="hsl")return s4(Hb(t),n);if(n.substr(0,3)==="lab"){const r=gl();oi("d50");const i=c4(im(t),n);return oi(r),i}if(n.substr(0,3)==="lch"){const r=gl();oi("d50");const i=f4(lm(t),n);return oi(r),i}return n.substr(0,5)==="oklab"?d4(dm(t)):n.substr(0,5)==="oklch"?h4(u2(t)):(t[0]=vm(t[0]),t[1]=vm(t[1]),t[2]=vm(t[2]),(n==="rgba"||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),n="rgba"),`${n.substr(0,3)}(${t.slice(0,n==="rgb"?3:4).join(" ")})`)},l2=(...e)=>{e=Te(e,"lch");const[t,n,r,...i]=e,[a,o,u]=Lb(t,n,r),[l,s,c]=fm(a,o,u);return[l,s,c,...i.length>0&&i[0]<1?[i[0]]:[]]},li=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,gr=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,xc=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,ir=/\s*/.source,zo=/\s+/.source,ym=/\s*,\s*/.source,Ec=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,Uo=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,s2=new RegExp("^rgba?\\("+ir+[li,li,li].join(zo)+Uo+"\\)$"),c2=new RegExp("^rgb\\("+ir+[li,li,li].join(ym)+ir+"\\)$"),f2=new RegExp("^rgba\\("+ir+[li,li,li,gr].join(ym)+ir+"\\)$"),d2=new RegExp("^hsla?\\("+ir+[Ec,xc,xc].join(zo)+Uo+"\\)$"),h2=new RegExp("^hsl?\\("+ir+[Ec,xc,xc].join(ym)+ir+"\\)$"),m2=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,p2=new RegExp("^lab\\("+ir+[gr,gr,gr].join(zo)+Uo+"\\)$"),g2=new RegExp("^lch\\("+ir+[gr,gr,Ec].join(zo)+Uo+"\\)$"),v2=new RegExp("^oklab\\("+ir+[gr,gr,gr].join(zo)+Uo+"\\)$"),y2=new RegExp("^oklch\\("+ir+[gr,gr,Ec].join(zo)+Uo+"\\)$"),{round:b2}=Math,Io=e=>e.map((t,n)=>n<=2?wa(b2(t),0,255):t),Ut=(e,t=0,n=100,r=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,r?e=t+(e+1)*.5*(n-t):e=t+e*(n-t)),+e),mn=(e,t)=>e==="none"?t:e,bm=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(Me.format.named)try{return Me.format.named(e)}catch{}if((t=e.match(s2))||(t=e.match(c2))){let n=t.slice(1,4);for(let i=0;i<3;i++)n[i]=+Ut(mn(n[i],0),0,255);n=Io(n);const r=t[4]!==void 0?+Ut(t[4],0,1):1;return n[3]=r,n}if(t=e.match(f2)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+Ut(n[r],0,255);return n}if((t=e.match(d2))||(t=e.match(h2))){const n=t.slice(1,4);n[0]=+mn(n[0].replace("deg",""),0),n[1]=+Ut(mn(n[1],0),0,100)*.01,n[2]=+Ut(mn(n[2],0),0,100)*.01;const r=Io(cm(n)),i=t[4]!==void 0?+Ut(t[4],0,1):1;return r[3]=i,r}if(t=e.match(m2)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=cm(n);for(let i=0;i<3;i++)r[i]=b2(r[i]);return r[3]=+t[4],r}if(t=e.match(p2)){const n=t.slice(1,4);n[0]=Ut(mn(n[0],0),0,100),n[1]=Ut(mn(n[1],0),-125,125,!0),n[2]=Ut(mn(n[2],0),-125,125,!0);const r=gl();oi("d50");const i=Io(nm(n));oi(r);const a=t[4]!==void 0?+Ut(t[4],0,1):1;return i[3]=a,i}if(t=e.match(g2)){const n=t.slice(1,4);n[0]=Ut(n[0],0,100),n[1]=Ut(mn(n[1],0),0,150,!1),n[2]=+mn(n[2].replace("deg",""),0);const r=gl();oi("d50");const i=Io(um(n));oi(r);const a=t[4]!==void 0?+Ut(t[4],0,1):1;return i[3]=a,i}if(t=e.match(v2)){const n=t.slice(1,4);n[0]=Ut(mn(n[0],0),0,1),n[1]=Ut(mn(n[1],0),-.4,.4,!0),n[2]=Ut(mn(n[2],0),-.4,.4,!0);const r=Io(fm(n)),i=t[4]!==void 0?+Ut(t[4],0,1):1;return r[3]=i,r}if(t=e.match(y2)){const n=t.slice(1,4);n[0]=Ut(mn(n[0],0),0,1),n[1]=Ut(mn(n[1],0),0,.4,!1),n[2]=+mn(n[2].replace("deg",""),0);const r=Io(l2(n)),i=t[4]!==void 0?+Ut(t[4],0,1):1;return r[3]=i,r}};bm.test=e=>s2.test(e)||d2.test(e)||p2.test(e)||g2.test(e)||v2.test(e)||y2.test(e)||c2.test(e)||f2.test(e)||h2.test(e)||m2.test(e)||e==="transparent",oe.prototype.css=function(e){return m4(this._rgb,e)};const p4=(...e)=>new oe(...e,"css");Ue.css=p4,Me.format.css=bm,Me.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Re(e)==="string"&&bm.test(e))return"css"}}),Me.format.gl=(...e)=>{const t=Te(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const g4=(...e)=>new oe(...e,"gl");Ue.gl=g4,oe.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},oe.prototype.hex=function(e){return Ib(this._rgb,e)};const v4=(...e)=>new oe(...e,"hex");Ue.hex=v4,Me.format.hex=Ub,Me.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&Re(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:Ac}=Math,D2=e=>{const t=e/100;let n,r,i;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*Ac(r),i=t<20?0:-254.76935184120902+.8274096064007395*(i=t-10)+115.67994401066147*Ac(i)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*Ac(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*Ac(r),i=255),[n,r,i,1]},{round:y4}=Math,b4=(...e)=>{const t=Te(e,"rgb"),n=t[0],r=t[2];let i=1e3,a=4e4;const o=.4;let u;for(;a-i>o;){u=(a+i)*.5;const l=D2(u);l[2]/l[0]>=r/n?a=u:i=u}return y4(u)};oe.prototype.temp=oe.prototype.kelvin=oe.prototype.temperature=function(){return b4(this._rgb)};const Dm=(...e)=>new oe(...e,"temp");Object.assign(Ue,{temp:Dm,kelvin:Dm,temperature:Dm}),Me.format.temp=Me.format.kelvin=Me.format.temperature=D2,oe.prototype.oklch=function(){return u2(this._rgb)},Object.assign(Ue,{oklch:(...e)=>new oe(...e,"oklch")}),Me.format.oklch=l2,Me.autodetect.push({p:2,test:(...e)=>{if(e=Te(e,"oklch"),Re(e)==="array"&&e.length===3)return"oklch"}}),Object.assign(Ue,{analyze:Xb,average:x5,bezier:_5,blend:pr,brewer:o4,Color:oe,colors:Bo,contrast:Z5,contrastAPCA:W5,cubehelix:j5,deltaE:n4,distance:r4,input:Me,interpolate:No,limits:Zb,mix:No,random:G5,scale:Dc,scales:a4,valid:i4});const xa=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S2=xa.length;for(let e=0;e<S2;e++)xa.push(Ue(xa[e]).darken(2).hex());for(let e=0;e<S2;e++)xa.push(Ue(xa[e]).brighten(1.5).hex());const Sm=e=>xa[e%xa.length],Cc=e=>e!==null&&typeof e=="string",D4=e=>e!==null&&typeof e=="function",S4=e=>e!==null&&typeof e=="number",w4=e=>t=>{for(const n of e)if(n(t))return!0;return!1},x4=e=>t=>t===e,w2=e=>t=>{if(t!==null&&Array.isArray(t)){for(const n of t)if(!e(n))return!1;return!0}else return!1},Mc=(e,t,n)=>{const r=n||{};if(!e)return r.callback&&r.callback("x is undefined/null."),!1;if(typeof e!="object")return r.callback&&r.callback("x is not an Object."),!1;for(const i in e)if(!(i in t)&&!r.allowAdditionalFields)return r.callback&&r.callback(`Key not in spec: ${i}`),!1;for(const i in t){const a=t[i];if(D4(a)){if(!a(e[i]))return r.callback&&r.callback(`Problem validating: ${i}`),!1}else{if(!(i in e))return r.callback&&r.callback(`Key not in x: ${i}`),!1;if(!Mc(e[i],a,{callback:r.callback}))return r.callback&&r.callback(`Value of key > ${i} < itself failed validation.`),!1}}return!0},E4=(e,t)=>{if(t.type==="DRAG_MOUSE_DOWN"){const{point:n}=t;return{...e,isActive:!1,dragAnchor:n,dragPosition:n,dragRect:void 0}}else{if(t.type==="DRAG_MOUSE_UP")return{...e,isActive:!1,dragAnchor:void 0,dragPosition:void 0,dragRect:void 0};if(t.type==="DRAG_MOUSE_MOVE"){if(!e.dragAnchor)return e;const n=[Math.min(e.dragAnchor[0],t.point[0]),Math.min(e.dragAnchor[1],t.point[1]),Math.abs(e.dragAnchor[0]-t.point[0]),Math.abs(e.dragAnchor[1]-t.point[1])];return e.isActive?{...e,dragRect:n,dragPosition:[t.point[0],t.point[1]]}:n[2]>=10||n[3]>=10?{...e,isActive:!0,dragRect:n,dragPosition:[t.point[0],t.point[1]]}:e}else return t.type==="DRAG_MOUSE_LEAVE"?{...e}:(console.log("Error: unrecognized verb in dragSelectReducer."),e)}},Tc=(e,t,n,r)=>{const[i,a]=_.useReducer(E4,{}),o=_.useCallback(f=>{f.buttons&&a({type:"DRAG_MOUSE_MOVE",point:_c(f)})},[]),u=_.useCallback(f=>{a({type:"DRAG_MOUSE_DOWN",point:_c(f)})},[]),l=_.useCallback(f=>{i.isActive&&i.dragRect&&n(i.dragRect,{ctrlKey:f.ctrlKey,shiftKey:f.shiftKey}),i.isActive||r(_c(f),{ctrlKey:f.ctrlKey,shiftKey:f.shiftKey}),a({type:"DRAG_MOUSE_UP",point:_c(f)})},[i,n,r]),s=_.useCallback(()=>{a({type:"DRAG_MOUSE_LEAVE"})},[]),c=_.useCallback(f=>{if(f.clearRect(0,0,e,t),i.isActive&&i.dragRect){const d=i.dragRect;f.fillStyle=A4,f.fillRect(d[0],d[1],d[2],d[3])}},[e,t,i]);return{dragSelectState:i,onMouseDown:u,onMouseMove:o,onMouseUp:l,onMouseLeave:s,paintDragSelectLayer:c}},A4="rgba(196, 196, 196, 0.5)",_c=e=>{const t=e.currentTarget.getBoundingClientRect();return[e.clientX-t.x,e.clientY-t.y]},C4={position:"absolute",left:0,top:0},M4=e=>{if(!e||typeof e=="function")return;const t=e.current,n=t&&t.getContext("2d");if(n)return n},vr=e=>{const{width:t,height:n,vOffsetPx:r,hOffsetPx:i,draw:a,drawData:o}=e,u=_.useRef(null);_.useEffect(()=>{const f=M4(u);f&&f.canvas&&a(f,o)},[a,u,o]);const c={...C4,...r?{top:r}:{},...i?{left:i}:{}};return B.jsx("canvas",{ref:u,width:t,height:n,style:c})};function Vi(){return Vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vi.apply(null,arguments)}var x2={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function T4(e,t){if(Bc(e,t))return e[t];throw typeof e[t]=="function"&&B4(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function _4(e,t,n){if(Bc(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function Bc(e,t){return!N4(e)&&!Array.isArray(e)?!1:yl(F4,t)?!0:!(t in Object.prototype||t in Function.prototype)}function B4(e,t){return e==null||typeof e[t]!="function"||yl(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:yl(R4,t)?!0:!(t in Object.prototype||t in Function.prototype)}function N4(e){return typeof e=="object"&&e&&e.constructor===Object}var F4={length:!0,name:!0},R4={toString:!0,valueOf:!0,toLocaleString:!0};class O4{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(t=>this.has(t)).values()}get(t){return T4(this.wrappedObject,t)}set(t,n){return _4(this.wrappedObject,t,n),this}has(t){return Bc(this.wrappedObject,t)&&t in this.wrappedObject}entries(){return z4(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var n of this.keys())t(this.get(n),n,this)}delete(t){Bc(this.wrappedObject,t)&&delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}function z4(e,t){return{next:()=>{var n=e.next();return n.done?n:{value:t(n.value),done:!1}}}}function at(e){return typeof e=="number"}function wt(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function U4(e){return typeof e=="bigint"}function wm(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function xm(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function E2(e){return e&&e.constructor.prototype.isUnit===!0||!1}function yr(e){return typeof e=="string"}var yt=Array.isArray;function Xe(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function vl(e){return Array.isArray(e)||Xe(e)}function A2(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function C2(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function M2(e){return e&&e.constructor.prototype.isRange===!0||!1}function Em(e){return e&&e.constructor.prototype.isIndex===!0||!1}function I4(e){return typeof e=="boolean"}function $4(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function k4(e){return e&&e.constructor.prototype.isHelp===!0||!1}function L4(e){return typeof e=="function"}function j4(e){return e instanceof Date}function P4(e){return e instanceof RegExp}function Am(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!wm(e)&&!xm(e))}function H4(e){return e?e instanceof Map||e instanceof O4||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}function q4(e){return e===null}function G4(e){return e===void 0}function V4(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function Y4(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function X4(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Z4(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function K4(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function Q4(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function W4(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function J4(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function e6(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function t6(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function n6(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function r6(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function i6(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function a6(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function o6(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function u6(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function l6(e){return e&&e.constructor.prototype.isChain===!0||!1}function Ln(e){var t=typeof e;return t==="object"?e===null?"null":wt(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function Pe(e){var t=typeof e;if(t==="number"||t==="bigint"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(n){return Pe(n)});if(e instanceof Date)return new Date(e.valueOf());if(wt(e))return e;if(Am(e))return s6(e,Pe);if(t==="function")return e;throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function s6(e,t){var n={};for(var r in e)yl(e,r)&&(n[r]=t(e[r]));return n}function T2(e,t){for(var n in t)yl(t,n)&&(e[n]=t[n]);return e}function Yi(e,t){var n,r,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(r=0,i=e.length;r<i;r++)if(!Yi(e[r],t[r]))return!1;return!0}else{if(typeof e=="function")return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!Yi(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}else return e===t}}function yl(e,t){return e&&Object.hasOwnProperty.call(e,t)}function c6(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r],a=e[i];a!==void 0&&(n[i]=a)}return n}var f6=["Matrix","Array"],d6=["number","BigNumber","Fraction"],un=function(t){if(t)throw new Error(`The global config is readonly.
|
|
49
|
+
`+n.stack}}function kn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Zx(e){var t=zp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fl(e){e._valueTracker||(e._valueTracker=Zx(e))}function Up(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=zp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Nl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Qx=/[\n"\\]/g;function Ln(e){return e.replace(Qx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ud(e,t,n,r,i,a,o,u){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+kn(t)):e.value!==""+kn(t)&&(e.value=""+kn(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?ld(e,o,kn(t)):n!=null?ld(e,o,kn(n)):r!=null&&e.removeAttribute("value"),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.name=""+kn(u):e.removeAttribute("name")}function Ip(e,t,n,r,i,a,o,u){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null))return;n=n!=null?""+kn(n):"",t=t!=null?""+kn(t):n,u||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=u?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o)}function ld(e,t,n){t==="number"&&Nl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ca(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+kn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function $p(e,t,n){if(t!=null&&(t=""+kn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+kn(n):""}function kp(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(re(92));if(jo(r)){if(1<r.length)throw Error(re(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=kn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r)}function Ta(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kx=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Lp(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||Kx.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function jp(e,t,n){if(t!=null&&typeof t!="object")throw Error(re(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Lp(e,i,r)}else for(var a in t)t.hasOwnProperty(a)&&Lp(e,a,t[a])}function sd(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Wx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Jx=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Rl(e){return Jx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var cd=null;function fd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ma=null,_a=null;function Hp(e){var t=xa(e);if(t&&(e=t.stateNode)){var n=e[ln]||null;e:switch(e=t.stateNode,t.type){case"input":if(ud(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Ln(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[ln]||null;if(!i)throw Error(re(90));ud(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Up(r)}break e;case"textarea":$p(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ca(e,!!n.multiple,t,!1)}}}var dd=!1;function Pp(e,t,n){if(dd)return e(t,n);dd=!0;try{var r=e(t);return r}finally{if(dd=!1,(Ma!==null||_a!==null)&&(ys(),Ma&&(t=Ma,e=_a,_a=Ma=null,Hp(t),e)))for(t=0;t<e.length;t++)Hp(e[t])}}function Xo(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ln]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(re(231,t,typeof n));return n}var Br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hd=!1;if(Br)try{var Zo={};Object.defineProperty(Zo,"passive",{get:function(){hd=!0}}),window.addEventListener("test",Zo,Zo),window.removeEventListener("test",Zo,Zo)}catch{hd=!1}var ai=null,md=null,Ol=null;function qp(){if(Ol)return Ol;var e,t=md,n=t.length,r,i="value"in ai?ai.value:ai.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Ol=i.slice(e,1<r?1-r:void 0)}function zl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ul(){return!0}function Vp(){return!1}function sn(e){function t(n,r,i,a,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(n=e[u],this[u]=n?n(a):a[u]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Ul:Vp,this.isPropagationStopped=Vp,this}return ut(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ul)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ul)},persist:function(){},isPersistent:Ul}),t}var Li={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Il=sn(Li),Qo=ut({},Li,{view:0,detail:0}),ew=sn(Qo),pd,gd,Ko,$l=ut({},Qo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ko&&(Ko&&e.type==="mousemove"?(pd=e.screenX-Ko.screenX,gd=e.screenY-Ko.screenY):gd=pd=0,Ko=e),pd)},movementY:function(e){return"movementY"in e?e.movementY:gd}}),Gp=sn($l),tw=ut({},$l,{dataTransfer:0}),nw=sn(tw),rw=ut({},Qo,{relatedTarget:0}),vd=sn(rw),iw=ut({},Li,{animationName:0,elapsedTime:0,pseudoElement:0}),aw=sn(iw),ow=ut({},Li,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),uw=sn(ow),lw=ut({},Li,{data:0}),Yp=sn(lw),sw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cw={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},fw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fw[e])?!!t[e]:!1}function yd(){return dw}var hw=ut({},Qo,{key:function(e){if(e.key){var t=sw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yd,charCode:function(e){return e.type==="keypress"?zl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mw=sn(hw),pw=ut({},$l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xp=sn(pw),gw=ut({},Qo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yd}),vw=sn(gw),yw=ut({},Li,{propertyName:0,elapsedTime:0,pseudoElement:0}),bw=sn(yw),Dw=ut({},$l,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Sw=sn(Dw),xw=ut({},Li,{newState:0,oldState:0}),ww=sn(xw),Ew=[9,13,27,32],bd=Br&&"CompositionEvent"in window,Wo=null;Br&&"documentMode"in document&&(Wo=document.documentMode);var Aw=Br&&"TextEvent"in window&&!Wo,Zp=Br&&(!bd||Wo&&8<Wo&&11>=Wo),Qp=" ",Kp=!1;function Wp(e,t){switch(e){case"keyup":return Ew.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ba=!1;function Cw(e,t){switch(e){case"compositionend":return Jp(t);case"keypress":return t.which!==32?null:(Kp=!0,Qp);case"textInput":return e=t.data,e===Qp&&Kp?null:e;default:return null}}function Tw(e,t){if(Ba)return e==="compositionend"||!bd&&Wp(e,t)?(e=qp(),Ol=md=ai=null,Ba=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Zp&&t.locale!=="ko"?null:t.data;default:return null}}var Mw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function eg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mw[e.type]:t==="textarea"}function tg(e,t,n,r){Ma?_a?_a.push(r):_a=[r]:Ma=r,t=Es(t,"onChange"),0<t.length&&(n=new Il("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Jo=null,eu=null;function _w(e){z1(e,0)}function kl(e){var t=Yo(e);if(Up(t))return e}function ng(e,t){if(e==="change")return t}var rg=!1;if(Br){var Dd;if(Br){var Sd="oninput"in document;if(!Sd){var ig=document.createElement("div");ig.setAttribute("oninput","return;"),Sd=typeof ig.oninput=="function"}Dd=Sd}else Dd=!1;rg=Dd&&(!document.documentMode||9<document.documentMode)}function ag(){Jo&&(Jo.detachEvent("onpropertychange",og),eu=Jo=null)}function og(e){if(e.propertyName==="value"&&kl(eu)){var t=[];tg(t,eu,e,fd(e)),Pp(_w,t)}}function Bw(e,t,n){e==="focusin"?(ag(),Jo=t,eu=n,Jo.attachEvent("onpropertychange",og)):e==="focusout"&&ag()}function Fw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kl(eu)}function Nw(e,t){if(e==="click")return kl(t)}function Rw(e,t){if(e==="input"||e==="change")return kl(t)}function Ow(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var En=typeof Object.is=="function"?Object.is:Ow;function tu(e,t){if(En(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Qf.call(t,i)||!En(e[i],t[i]))return!1}return!0}function ug(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lg(e,t){var n=ug(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ug(n)}}function sg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nl(e.document)}return t}function xd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var zw=Br&&"documentMode"in document&&11>=document.documentMode,Fa=null,wd=null,nu=null,Ed=!1;function fg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ed||Fa==null||Fa!==Nl(r)||(r=Fa,"selectionStart"in r&&xd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),nu&&tu(nu,r)||(nu=r,r=Es(wd,"onSelect"),0<r.length&&(t=new Il("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Fa)))}function ji(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Na={animationend:ji("Animation","AnimationEnd"),animationiteration:ji("Animation","AnimationIteration"),animationstart:ji("Animation","AnimationStart"),transitionrun:ji("Transition","TransitionRun"),transitionstart:ji("Transition","TransitionStart"),transitioncancel:ji("Transition","TransitionCancel"),transitionend:ji("Transition","TransitionEnd")},Ad={},dg={};Br&&(dg=document.createElement("div").style,"AnimationEvent"in window||(delete Na.animationend.animation,delete Na.animationiteration.animation,delete Na.animationstart.animation),"TransitionEvent"in window||delete Na.transitionend.transition);function Hi(e){if(Ad[e])return Ad[e];if(!Na[e])return e;var t=Na[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in dg)return Ad[e]=t[n];return e}var hg=Hi("animationend"),mg=Hi("animationiteration"),pg=Hi("animationstart"),Uw=Hi("transitionrun"),Iw=Hi("transitionstart"),$w=Hi("transitioncancel"),gg=Hi("transitionend"),vg=new Map,Cd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Cd.push("scrollEnd");function tr(e,t){vg.set(e,t),ki(t,[e])}var yg=new WeakMap;function jn(e,t){if(typeof e=="object"&&e!==null){var n=yg.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Op(t)},yg.set(e,t),t)}return{value:e,source:t,stack:Op(t)}}var Hn=[],Ra=0,Td=0;function Ll(){for(var e=Ra,t=Td=Ra=0;t<e;){var n=Hn[t];Hn[t++]=null;var r=Hn[t];Hn[t++]=null;var i=Hn[t];Hn[t++]=null;var a=Hn[t];if(Hn[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&bg(n,i,a)}}function jl(e,t,n,r){Hn[Ra++]=e,Hn[Ra++]=t,Hn[Ra++]=n,Hn[Ra++]=r,Td|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Md(e,t,n,r){return jl(e,t,n,r),Hl(e)}function Oa(e,t){return jl(e,null,null,t),Hl(e)}function bg(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-wn(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Hl(e){if(50<Tu)throw Tu=0,O0=null,Error(re(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var za={};function kw(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function An(e,t,n,r){return new kw(e,t,n,r)}function _d(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fr(e,t){var n=e.alternate;return n===null?(n=An(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Dg(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Pl(e,t,n,r,i,a){var o=0;if(r=e,typeof e=="function")_d(e)&&(o=1);else if(typeof e=="string")o=jE(e,n,fr.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Gf:return e=An(31,n,t,i),e.elementType=Gf,e.lanes=a,e;case va:return Pi(n.children,i,a,t);case vp:o=8,i|=24;break;case jf:return e=An(12,n,t,i|2),e.elementType=jf,e.lanes=a,e;case Pf:return e=An(13,n,t,i),e.elementType=Pf,e.lanes=a,e;case qf:return e=An(19,n,t,i),e.elementType=qf,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _x:case Mr:o=10;break e;case yp:o=9;break e;case Hf:o=11;break e;case Vf:o=14;break e;case ti:o=16,r=null;break e}o=29,n=Error(re(130,e===null?"null":typeof e,"")),r=null}return t=An(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Pi(e,t,n,r){return e=An(7,e,r,t),e.lanes=n,e}function Bd(e,t,n){return e=An(6,e,null,t),e.lanes=n,e}function Fd(e,t,n){return t=An(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ua=[],Ia=0,ql=null,Vl=0,Pn=[],qn=0,qi=null,Nr=1,Rr="";function Vi(e,t){Ua[Ia++]=Vl,Ua[Ia++]=ql,ql=e,Vl=t}function Sg(e,t,n){Pn[qn++]=Nr,Pn[qn++]=Rr,Pn[qn++]=qi,qi=e;var r=Nr;e=Rr;var i=32-wn(r)-1;r&=~(1<<i),n+=1;var a=32-wn(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Nr=1<<32-wn(t)+i|n<<i|r,Rr=a+e}else Nr=1<<a|n<<i|r,Rr=e}function Nd(e){e.return!==null&&(Vi(e,1),Sg(e,1,0))}function Rd(e){for(;e===ql;)ql=Ua[--Ia],Ua[Ia]=null,Vl=Ua[--Ia],Ua[Ia]=null;for(;e===qi;)qi=Pn[--qn],Pn[qn]=null,Rr=Pn[--qn],Pn[qn]=null,Nr=Pn[--qn],Pn[qn]=null}var an=null,bt=null,ke=!1,Gi=null,hr=!1,Od=Error(re(519));function Yi(e){var t=Error(re(418,""));throw au(jn(t,e)),Od}function xg(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Qt]=e,t[ln]=r,n){case"dialog":Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":case"embed":Fe("load",t);break;case"video":case"audio":for(n=0;n<_u.length;n++)Fe(_u[n],t);break;case"source":Fe("error",t);break;case"img":case"image":case"link":Fe("error",t),Fe("load",t);break;case"details":Fe("toggle",t);break;case"input":Fe("invalid",t),Ip(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),Fl(t);break;case"select":Fe("invalid",t);break;case"textarea":Fe("invalid",t),kp(t,r.value,r.defaultValue,r.children),Fl(t)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||k1(t.textContent,n)?(r.popover!=null&&(Fe("beforetoggle",t),Fe("toggle",t)),r.onScroll!=null&&Fe("scroll",t),r.onScrollEnd!=null&&Fe("scrollend",t),r.onClick!=null&&(t.onclick=As),t=!0):t=!1,t||Yi(e)}function wg(e){for(an=e.return;an;)switch(an.tag){case 5:case 13:hr=!1;return;case 27:case 3:hr=!0;return;default:an=an.return}}function ru(e){if(e!==an)return!1;if(!ke)return wg(e),ke=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Q0(e.type,e.memoizedProps)),n=!n),n&&bt&&Yi(e),wg(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(re(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){bt=rr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}bt=null}}else t===27?(t=bt,Si(e.type)?(e=eh,eh=null,bt=e):bt=t):bt=an?rr(e.stateNode.nextSibling):null;return!0}function iu(){bt=an=null,ke=!1}function Eg(){var e=Gi;return e!==null&&(dn===null?dn=e:dn.push.apply(dn,e),Gi=null),e}function au(e){Gi===null?Gi=[e]:Gi.push(e)}var zd=cr(null),Xi=null,Or=null;function oi(e,t,n){ft(zd,t._currentValue),t._currentValue=n}function zr(e){e._currentValue=zd.current,It(zd)}function Ud(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Id(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var o=i.child;a=a.firstContext;e:for(;a!==null;){var u=a;a=i;for(var l=0;l<t.length;l++)if(u.context===t[l]){a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Ud(a.return,n,e),r||(o=null);break e}a=u.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(re(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Ud(o,n,e),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function ou(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(re(387));if(o=o.memoizedProps,o!==null){var u=i.type;En(i.pendingProps.value,o.value)||(e!==null?e.push(u):e=[u])}}else if(i===xl.current){if(o=i.alternate,o===null)throw Error(re(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(zu):e=[zu])}i=i.return}e!==null&&Id(t,e,n,r),t.flags|=262144}function Gl(e){for(e=e.firstContext;e!==null;){if(!En(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zi(e){Xi=e,Or=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Kt(e){return Ag(Xi,e)}function Yl(e,t){return Xi===null&&Zi(e),Ag(e,t)}function Ag(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Or===null){if(e===null)throw Error(re(308));Or=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Or=Or.next=t;return n}var Lw=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},jw=Rt.unstable_scheduleCallback,Hw=Rt.unstable_NormalPriority,Ot={$$typeof:Mr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $d(){return{controller:new Lw,data:new Map,refCount:0}}function uu(e){e.refCount--,e.refCount===0&&jw(Hw,function(){e.controller.abort()})}var lu=null,kd=0,$a=0,ka=null;function Pw(e,t){if(lu===null){var n=lu=[];kd=0,$a=j0(),ka={status:"pending",value:void 0,then:function(r){n.push(r)}}}return kd++,t.then(Cg,Cg),t}function Cg(){if(--kd===0&&lu!==null){ka!==null&&(ka.status="fulfilled");var e=lu;lu=null,$a=0,ka=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function qw(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),r}var Tg=we.S;we.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&Pw(e,t),Tg!==null&&Tg(e,t)};var Qi=cr(null);function Ld(){var e=Qi.current;return e!==null?e:rt.pooledCache}function Xl(e,t){t===null?ft(Qi,Qi.current):ft(Qi,t.pool)}function Mg(){var e=Ld();return e===null?null:{parent:Ot._currentValue,pool:e}}var su=Error(re(460)),_g=Error(re(474)),Zl=Error(re(542)),jd={then:function(){}};function Bg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ql(){}function Fg(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ql,Ql),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rg(e),e;default:if(typeof t.status=="string")t.then(Ql,Ql);else{if(e=rt,e!==null&&100<e.shellSuspendCounter)throw Error(re(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rg(e),e}throw cu=t,su}}var cu=null;function Ng(){if(cu===null)throw Error(re(459));var e=cu;return cu=null,e}function Rg(e){if(e===su||e===Zl)throw Error(re(483))}var ui=!1;function Hd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function li(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function si(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,qe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Hl(e),bg(e,null,n),t}return jl(e,r,t,n),Hl(e)}function fu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cp(e,n)}}function qd(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Vd=!1;function du(){if(Vd){var e=ka;if(e!==null)throw e}}function hu(e,t,n,r){Vd=!1;var i=e.updateQueue;ui=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,u=i.shared.pending;if(u!==null){i.shared.pending=null;var l=u,s=l.next;l.next=null,o===null?a=s:o.next=s,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,u=c.lastBaseUpdate,u!==o&&(u===null?c.firstBaseUpdate=s:u.next=s,c.lastBaseUpdate=l))}if(a!==null){var f=i.baseState;o=0,c=s=l=null,u=a;do{var d=u.lane&-536870913,h=d!==u.lane;if(h?(Oe&d)===d:(r&d)===d){d!==0&&d===$a&&(Vd=!0),c!==null&&(c=c.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var v=e,m=u;d=t;var D=n;switch(m.tag){case 1:if(v=m.payload,typeof v=="function"){f=v.call(D,f,d);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,d=typeof v=="function"?v.call(D,f,d):v,d==null)break e;f=ut({},f,d);break e;case 2:ui=!0}}d=u.callback,d!==null&&(e.flags|=64,h&&(e.flags|=8192),h=i.callbacks,h===null?i.callbacks=[d]:h.push(d))}else h={lane:d,tag:u.tag,payload:u.payload,callback:u.callback,next:null},c===null?(s=c=h,l=f):c=c.next=h,o|=d;if(u=u.next,u===null){if(u=i.shared.pending,u===null)break;h=u,u=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=s,i.lastBaseUpdate=c,a===null&&(i.shared.lanes=0),vi|=o,e.lanes=o,e.memoizedState=f}}function Og(e,t){if(typeof e!="function")throw Error(re(191,e));e.call(t)}function zg(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Og(n[e],t)}var La=cr(null),Kl=cr(0);function Ug(e,t){e=Hr,ft(Kl,e),ft(La,t),Hr=e|t.baseLanes}function Gd(){ft(Kl,Hr),ft(La,La.current)}function Yd(){Hr=Kl.current,It(La),It(Kl)}var ci=0,_e=null,Qe=null,Mt=null,Wl=!1,ja=!1,Ki=!1,Jl=0,mu=0,Ha=null,Vw=0;function Et(){throw Error(re(321))}function Xd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!En(e[n],t[n]))return!1;return!0}function Zd(e,t,n,r,i,a){return ci=a,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,we.H=e===null||e.memoizedState===null?bv:Dv,Ki=!1,a=n(r,i),Ki=!1,ja&&(a=$g(t,n,r,i)),Ig(e),a}function Ig(e){we.H=as;var t=Qe!==null&&Qe.next!==null;if(ci=0,Mt=Qe=_e=null,Wl=!1,mu=0,Ha=null,t)throw Error(re(300));e===null||kt||(e=e.dependencies,e!==null&&Gl(e)&&(kt=!0))}function $g(e,t,n,r){_e=e;var i=0;do{if(ja&&(Ha=null),mu=0,ja=!1,25<=i)throw Error(re(301));if(i+=1,Mt=Qe=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}we.H=Ww,a=t(n,r)}while(ja);return a}function Gw(){var e=we.H,t=e.useState()[0];return t=typeof t.then=="function"?pu(t):t,e=e.useState()[0],(Qe!==null?Qe.memoizedState:null)!==e&&(_e.flags|=1024),t}function Qd(){var e=Jl!==0;return Jl=0,e}function Kd(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Wd(e){if(Wl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wl=!1}ci=0,Mt=Qe=_e=null,ja=!1,mu=Jl=0,Ha=null}function cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?_e.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function _t(){if(Qe===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=Mt===null?_e.memoizedState:Mt.next;if(t!==null)Mt=t,Qe=e;else{if(e===null)throw _e.alternate===null?Error(re(467)):Error(re(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},Mt===null?_e.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function Jd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pu(e){var t=mu;return mu+=1,Ha===null&&(Ha=[]),e=Fg(Ha,e,t),t=_e,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,we.H=t===null||t.memoizedState===null?bv:Dv),e}function es(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pu(e);if(e.$$typeof===Mr)return Kt(e)}throw Error(re(438,String(e)))}function e0(e){var t=null,n=_e.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=_e.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Jd(),_e.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=Bx;return t.index++,n}function Ur(e,t){return typeof t=="function"?t(e):t}function ts(e){var t=_t();return t0(t,Qe,e)}function t0(e,t,n){var r=e.queue;if(r===null)throw Error(re(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var u=o=null,l=null,s=t,c=!1;do{var f=s.lane&-536870913;if(f!==s.lane?(Oe&f)===f:(ci&f)===f){var d=s.revertLane;if(d===0)l!==null&&(l=l.next={lane:0,revertLane:0,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null}),f===$a&&(c=!0);else if((ci&d)===d){s=s.next,d===$a&&(c=!0);continue}else f={lane:0,revertLane:s.revertLane,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null},l===null?(u=l=f,o=a):l=l.next=f,_e.lanes|=d,vi|=d;f=s.action,Ki&&n(a,f),a=s.hasEagerState?s.eagerState:n(a,f)}else d={lane:f,revertLane:s.revertLane,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null},l===null?(u=l=d,o=a):l=l.next=d,_e.lanes|=f,vi|=f;s=s.next}while(s!==null&&s!==t);if(l===null?o=a:l.next=u,!En(a,e.memoizedState)&&(kt=!0,c&&(n=ka,n!==null)))throw n;e.memoizedState=a,e.baseState=o,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function n0(e){var t=_t(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);En(a,t.memoizedState)||(kt=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function kg(e,t,n){var r=_e,i=_t(),a=ke;if(a){if(n===void 0)throw Error(re(407));n=n()}else n=t();var o=!En((Qe||i).memoizedState,n);o&&(i.memoizedState=n,kt=!0),i=i.queue;var u=Hg.bind(null,r,i,e);if(gu(2048,8,u,[e]),i.getSnapshot!==t||o||Mt!==null&&Mt.memoizedState.tag&1){if(r.flags|=2048,Pa(9,ns(),jg.bind(null,r,i,n,t),null),rt===null)throw Error(re(349));a||ci&124||Lg(r,t,n)}return n}function Lg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=_e.updateQueue,t===null?(t=Jd(),_e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jg(e,t,n,r){t.value=n,t.getSnapshot=r,Pg(t)&&qg(e)}function Hg(e,t,n){return n(function(){Pg(t)&&qg(e)})}function Pg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!En(e,n)}catch{return!0}}function qg(e){var t=Oa(e,2);t!==null&&Bn(t,e,2)}function r0(e){var t=cn();if(typeof e=="function"){var n=e;if(e=n(),Ki){ri(!0);try{n()}finally{ri(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:e},t}function Vg(e,t,n,r){return e.baseState=n,t0(e,Qe,typeof r=="function"?r:Ur)}function Yw(e,t,n,r,i){if(is(e))throw Error(re(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){a.listeners.push(o)}};we.T!==null?n(!0):a.isTransition=!1,r(a),n=t.pending,n===null?(a.next=t.pending=a,Gg(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Gg(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=we.T,o={};we.T=o;try{var u=n(i,r),l=we.S;l!==null&&l(o,u),Yg(e,t,u)}catch(s){i0(e,t,s)}finally{we.T=a}}else try{a=n(i,r),Yg(e,t,a)}catch(s){i0(e,t,s)}}function Yg(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){Xg(e,t,r)},function(r){return i0(e,t,r)}):Xg(e,t,n)}function Xg(e,t,n){t.status="fulfilled",t.value=n,Zg(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Gg(e,n)))}function i0(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,Zg(t),t=t.next;while(t!==r)}e.action=null}function Zg(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Qg(e,t){return t}function Kg(e,t){if(ke){var n=rt.formState;if(n!==null){e:{var r=_e;if(ke){if(bt){t:{for(var i=bt,a=hr;i.nodeType!==8;){if(!a){i=null;break t}if(i=rr(i.nextSibling),i===null){i=null;break t}}a=i.data,i=a==="F!"||a==="F"?i:null}if(i){bt=rr(i.nextSibling),r=i.data==="F!";break e}}Yi(r)}r=!1}r&&(t=n[0])}}return n=cn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qg,lastRenderedState:t},n.queue=r,n=gv.bind(null,_e,r),r.dispatch=n,r=r0(!1),a=s0.bind(null,_e,!1,r.queue),r=cn(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Yw.bind(null,_e,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Wg(e){var t=_t();return Jg(t,Qe,e)}function Jg(e,t,n){if(t=t0(e,t,Qg)[0],e=ts(Ur)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=pu(t)}catch(o){throw o===su?Zl:o}else r=t;t=_t();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(_e.flags|=2048,Pa(9,ns(),Xw.bind(null,i,n),null)),[r,a,e]}function Xw(e,t){e.action=t}function ev(e){var t=_t(),n=Qe;if(n!==null)return Jg(t,n,e);_t(),t=t.memoizedState,n=_t();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Pa(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=_e.updateQueue,t===null&&(t=Jd(),_e.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ns(){return{destroy:void 0,resource:void 0}}function tv(){return _t().memoizedState}function rs(e,t,n,r){var i=cn();r=r===void 0?null:r,_e.flags|=e,i.memoizedState=Pa(1|t,ns(),n,r)}function gu(e,t,n,r){var i=_t();r=r===void 0?null:r;var a=i.memoizedState.inst;Qe!==null&&r!==null&&Xd(r,Qe.memoizedState.deps)?i.memoizedState=Pa(t,a,n,r):(_e.flags|=e,i.memoizedState=Pa(1|t,a,n,r))}function nv(e,t){rs(8390656,8,e,t)}function rv(e,t){gu(2048,8,e,t)}function iv(e,t){return gu(4,2,e,t)}function av(e,t){return gu(4,4,e,t)}function ov(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function uv(e,t,n){n=n!=null?n.concat([e]):null,gu(4,4,ov.bind(null,t,e),n)}function a0(){}function lv(e,t){var n=_t();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Xd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function sv(e,t){var n=_t();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Xd(t,r[1]))return r[0];if(r=e(),Ki){ri(!0);try{e()}finally{ri(!1)}}return n.memoizedState=[r,t],r}function o0(e,t,n){return n===void 0||ci&1073741824?e.memoizedState=t:(e.memoizedState=n,e=d1(),_e.lanes|=e,vi|=e,n)}function cv(e,t,n,r){return En(n,t)?n:La.current!==null?(e=o0(e,n,r),En(e,t)||(kt=!0),e):ci&42?(e=d1(),_e.lanes|=e,vi|=e,t):(kt=!0,e.memoizedState=n)}function fv(e,t,n,r,i){var a=$e.p;$e.p=a!==0&&8>a?a:8;var o=we.T,u={};we.T=u,s0(e,!1,t,n);try{var l=i(),s=we.S;if(s!==null&&s(u,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=qw(l,r);vu(e,t,c,_n(e))}else vu(e,t,r,_n(e))}catch(f){vu(e,t,{then:function(){},status:"rejected",reason:f},_n())}finally{$e.p=a,we.T=o}}function Zw(){}function u0(e,t,n,r){if(e.tag!==5)throw Error(re(476));var i=dv(e).queue;fv(e,i,t,Ii,n===null?Zw:function(){return hv(e),n(r)})}function dv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ii,baseState:Ii,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:Ii},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function hv(e){var t=dv(e).next.queue;vu(e,t,{},_n())}function l0(){return Kt(zu)}function mv(){return _t().memoizedState}function pv(){return _t().memoizedState}function Qw(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_n();e=li(n);var r=si(t,e,n);r!==null&&(Bn(r,t,n),fu(r,t,n)),t={cache:$d()},e.payload=t;return}t=t.return}}function Kw(e,t,n){var r=_n();n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},is(e)?vv(t,n):(n=Md(e,t,n,r),n!==null&&(Bn(n,e,r),yv(n,t,r)))}function gv(e,t,n){var r=_n();vu(e,t,n,r)}function vu(e,t,n,r){var i={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(is(e))vv(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,u=a(o,n);if(i.hasEagerState=!0,i.eagerState=u,En(u,o))return jl(e,t,i,0),rt===null&&Ll(),!1}catch{}finally{}if(n=Md(e,t,i,r),n!==null)return Bn(n,e,r),yv(n,t,r),!0}return!1}function s0(e,t,n,r){if(r={lane:2,revertLane:j0(),action:r,hasEagerState:!1,eagerState:null,next:null},is(e)){if(t)throw Error(re(479))}else t=Md(e,n,r,2),t!==null&&Bn(t,e,2)}function is(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function vv(e,t){ja=Wl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yv(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cp(e,n)}}var as={readContext:Kt,use:es,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et},bv={readContext:Kt,use:es,useCallback:function(e,t){return cn().memoizedState=[e,t===void 0?null:t],e},useContext:Kt,useEffect:nv,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,rs(4194308,4,ov.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=cn();t=t===void 0?null:t;var r=e();if(Ki){ri(!0);try{e()}finally{ri(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=cn();if(n!==void 0){var i=n(t);if(Ki){ri(!0);try{n(t)}finally{ri(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Kw.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=cn();return e={current:e},t.memoizedState=e},useState:function(e){e=r0(e);var t=e.queue,n=gv.bind(null,_e,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:a0,useDeferredValue:function(e,t){var n=cn();return o0(n,e,t)},useTransition:function(){var e=r0(!1);return e=fv.bind(null,_e,e.queue,!0,!1),cn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=_e,i=cn();if(ke){if(n===void 0)throw Error(re(407));n=n()}else{if(n=t(),rt===null)throw Error(re(349));Oe&124||Lg(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,nv(Hg.bind(null,r,a,e),[e]),r.flags|=2048,Pa(9,ns(),jg.bind(null,r,a,n,t),null),n},useId:function(){var e=cn(),t=rt.identifierPrefix;if(ke){var n=Rr,r=Nr;n=(r&~(1<<32-wn(r)-1)).toString(32)+n,t="«"+t+"R"+n,n=Jl++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=Vw++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:l0,useFormState:Kg,useActionState:Kg,useOptimistic:function(e){var t=cn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=s0.bind(null,_e,!0,n),n.dispatch=t,[e,t]},useMemoCache:e0,useCacheRefresh:function(){return cn().memoizedState=Qw.bind(null,_e)}},Dv={readContext:Kt,use:es,useCallback:lv,useContext:Kt,useEffect:rv,useImperativeHandle:uv,useInsertionEffect:iv,useLayoutEffect:av,useMemo:sv,useReducer:ts,useRef:tv,useState:function(){return ts(Ur)},useDebugValue:a0,useDeferredValue:function(e,t){var n=_t();return cv(n,Qe.memoizedState,e,t)},useTransition:function(){var e=ts(Ur)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:pu(e),t]},useSyncExternalStore:kg,useId:mv,useHostTransitionStatus:l0,useFormState:Wg,useActionState:Wg,useOptimistic:function(e,t){var n=_t();return Vg(n,Qe,e,t)},useMemoCache:e0,useCacheRefresh:pv},Ww={readContext:Kt,use:es,useCallback:lv,useContext:Kt,useEffect:rv,useImperativeHandle:uv,useInsertionEffect:iv,useLayoutEffect:av,useMemo:sv,useReducer:n0,useRef:tv,useState:function(){return n0(Ur)},useDebugValue:a0,useDeferredValue:function(e,t){var n=_t();return Qe===null?o0(n,e,t):cv(n,Qe.memoizedState,e,t)},useTransition:function(){var e=n0(Ur)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:pu(e),t]},useSyncExternalStore:kg,useId:mv,useHostTransitionStatus:l0,useFormState:ev,useActionState:ev,useOptimistic:function(e,t){var n=_t();return Qe!==null?Vg(n,Qe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:e0,useCacheRefresh:pv},qa=null,yu=0;function os(e){var t=yu;return yu+=1,qa===null&&(qa=[]),Fg(qa,e,t)}function bu(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function us(e,t){throw t.$$typeof===Mx?Error(re(525)):(e=Object.prototype.toString.call(t),Error(re(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Sv(e){var t=e._init;return t(e._payload)}function xv(e){function t(p,g){if(e){var y=p.deletions;y===null?(p.deletions=[g],p.flags|=16):y.push(g)}}function n(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function r(p){for(var g=new Map;p!==null;)p.key!==null?g.set(p.key,p):g.set(p.index,p),p=p.sibling;return g}function i(p,g){return p=Fr(p,g),p.index=0,p.sibling=null,p}function a(p,g,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<g?(p.flags|=67108866,g):y):(p.flags|=67108866,g)):(p.flags|=1048576,g)}function o(p){return e&&p.alternate===null&&(p.flags|=67108866),p}function u(p,g,y,S){return g===null||g.tag!==6?(g=Bd(y,p.mode,S),g.return=p,g):(g=i(g,y),g.return=p,g)}function l(p,g,y,S){var w=y.type;return w===va?c(p,g,y.props.children,S,y.key):g!==null&&(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ti&&Sv(w)===g.type)?(g=i(g,y.props),bu(g,y),g.return=p,g):(g=Pl(y.type,y.key,y.props,null,p.mode,S),bu(g,y),g.return=p,g)}function s(p,g,y,S){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Fd(y,p.mode,S),g.return=p,g):(g=i(g,y.children||[]),g.return=p,g)}function c(p,g,y,S,w){return g===null||g.tag!==7?(g=Pi(y,p.mode,S,w),g.return=p,g):(g=i(g,y),g.return=p,g)}function f(p,g,y){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Bd(""+g,p.mode,y),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Sl:return y=Pl(g.type,g.key,g.props,null,p.mode,y),bu(y,g),y.return=p,y;case ko:return g=Fd(g,p.mode,y),g.return=p,g;case ti:var S=g._init;return g=S(g._payload),f(p,g,y)}if(jo(g)||Lo(g))return g=Pi(g,p.mode,y,null),g.return=p,g;if(typeof g.then=="function")return f(p,os(g),y);if(g.$$typeof===Mr)return f(p,Yl(p,g),y);us(p,g)}return null}function d(p,g,y,S){var w=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return w!==null?null:u(p,g,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Sl:return y.key===w?l(p,g,y,S):null;case ko:return y.key===w?s(p,g,y,S):null;case ti:return w=y._init,y=w(y._payload),d(p,g,y,S)}if(jo(y)||Lo(y))return w!==null?null:c(p,g,y,S,null);if(typeof y.then=="function")return d(p,g,os(y),S);if(y.$$typeof===Mr)return d(p,g,Yl(p,y),S);us(p,y)}return null}function h(p,g,y,S,w){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return p=p.get(y)||null,u(g,p,""+S,w);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Sl:return p=p.get(S.key===null?y:S.key)||null,l(g,p,S,w);case ko:return p=p.get(S.key===null?y:S.key)||null,s(g,p,S,w);case ti:var b=S._init;return S=b(S._payload),h(p,g,y,S,w)}if(jo(S)||Lo(S))return p=p.get(y)||null,c(g,p,S,w,null);if(typeof S.then=="function")return h(p,g,y,os(S),w);if(S.$$typeof===Mr)return h(p,g,y,Yl(g,S),w);us(g,S)}return null}function v(p,g,y,S){for(var w=null,b=null,E=g,C=g=0,A=null;E!==null&&C<y.length;C++){E.index>C?(A=E,E=null):A=E.sibling;var T=d(p,E,y[C],S);if(T===null){E===null&&(E=A);break}e&&E&&T.alternate===null&&t(p,E),g=a(T,g,C),b===null?w=T:b.sibling=T,b=T,E=A}if(C===y.length)return n(p,E),ke&&Vi(p,C),w;if(E===null){for(;C<y.length;C++)E=f(p,y[C],S),E!==null&&(g=a(E,g,C),b===null?w=E:b.sibling=E,b=E);return ke&&Vi(p,C),w}for(E=r(E);C<y.length;C++)A=h(E,p,C,y[C],S),A!==null&&(e&&A.alternate!==null&&E.delete(A.key===null?C:A.key),g=a(A,g,C),b===null?w=A:b.sibling=A,b=A);return e&&E.forEach(function(_){return t(p,_)}),ke&&Vi(p,C),w}function m(p,g,y,S){if(y==null)throw Error(re(151));for(var w=null,b=null,E=g,C=g=0,A=null,T=y.next();E!==null&&!T.done;C++,T=y.next()){E.index>C?(A=E,E=null):A=E.sibling;var _=d(p,E,T.value,S);if(_===null){E===null&&(E=A);break}e&&E&&_.alternate===null&&t(p,E),g=a(_,g,C),b===null?w=_:b.sibling=_,b=_,E=A}if(T.done)return n(p,E),ke&&Vi(p,C),w;if(E===null){for(;!T.done;C++,T=y.next())T=f(p,T.value,S),T!==null&&(g=a(T,g,C),b===null?w=T:b.sibling=T,b=T);return ke&&Vi(p,C),w}for(E=r(E);!T.done;C++,T=y.next())T=h(E,p,C,T.value,S),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?C:T.key),g=a(T,g,C),b===null?w=T:b.sibling=T,b=T);return e&&E.forEach(function(x){return t(p,x)}),ke&&Vi(p,C),w}function D(p,g,y,S){if(typeof y=="object"&&y!==null&&y.type===va&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Sl:e:{for(var w=y.key;g!==null;){if(g.key===w){if(w=y.type,w===va){if(g.tag===7){n(p,g.sibling),S=i(g,y.props.children),S.return=p,p=S;break e}}else if(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ti&&Sv(w)===g.type){n(p,g.sibling),S=i(g,y.props),bu(S,y),S.return=p,p=S;break e}n(p,g);break}else t(p,g);g=g.sibling}y.type===va?(S=Pi(y.props.children,p.mode,S,y.key),S.return=p,p=S):(S=Pl(y.type,y.key,y.props,null,p.mode,S),bu(S,y),S.return=p,p=S)}return o(p);case ko:e:{for(w=y.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(p,g.sibling),S=i(g,y.children||[]),S.return=p,p=S;break e}else{n(p,g);break}else t(p,g);g=g.sibling}S=Fd(y,p.mode,S),S.return=p,p=S}return o(p);case ti:return w=y._init,y=w(y._payload),D(p,g,y,S)}if(jo(y))return v(p,g,y,S);if(Lo(y)){if(w=Lo(y),typeof w!="function")throw Error(re(150));return y=w.call(y),m(p,g,y,S)}if(typeof y.then=="function")return D(p,g,os(y),S);if(y.$$typeof===Mr)return D(p,g,Yl(p,y),S);us(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,g!==null&&g.tag===6?(n(p,g.sibling),S=i(g,y),S.return=p,p=S):(n(p,g),S=Bd(y,p.mode,S),S.return=p,p=S),o(p)):n(p,g)}return function(p,g,y,S){try{yu=0;var w=D(p,g,y,S);return qa=null,w}catch(E){if(E===su||E===Zl)throw E;var b=An(29,E,null,p.mode);return b.lanes=S,b.return=p,b}finally{}}}var Va=xv(!0),wv=xv(!1),Vn=cr(null),mr=null;function fi(e){var t=e.alternate;ft(zt,zt.current&1),ft(Vn,e),mr===null&&(t===null||La.current!==null||t.memoizedState!==null)&&(mr=e)}function Ev(e){if(e.tag===22){if(ft(zt,zt.current),ft(Vn,e),mr===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(mr=e)}}else di()}function di(){ft(zt,zt.current),ft(Vn,Vn.current)}function Ir(e){It(Vn),mr===e&&(mr=null),It(zt)}var zt=cr(0);function ls(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||J0(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function c0(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ut({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var f0={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_n(),i=li(r);i.payload=t,n!=null&&(i.callback=n),t=si(e,i,r),t!==null&&(Bn(t,e,r),fu(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_n(),i=li(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=si(e,i,r),t!==null&&(Bn(t,e,r),fu(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_n(),r=li(n);r.tag=2,t!=null&&(r.callback=t),t=si(e,r,n),t!==null&&(Bn(t,e,n),fu(t,e,n))}};function Av(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!tu(n,r)||!tu(i,a):!0}function Cv(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&f0.enqueueReplaceState(t,t.state,null)}function Wi(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=ut({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}var ss=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Tv(e){ss(e)}function Mv(e){console.error(e)}function _v(e){ss(e)}function cs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Bv(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function d0(e,t,n){return n=li(n),n.tag=3,n.payload={element:null},n.callback=function(){cs(e,t)},n}function Fv(e){return e=li(e),e.tag=3,e}function Nv(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Bv(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Bv(t,n,r),typeof i!="function"&&(yi===null?yi=new Set([this]):yi.add(this));var u=r.stack;this.componentDidCatch(r.value,{componentStack:u!==null?u:""})})}function Jw(e,t,n,r,i){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&ou(t,n,i,!0),n=Vn.current,n!==null){switch(n.tag){case 13:return mr===null?U0():n.alternate===null&&Dt===0&&(Dt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===jd?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),$0(e,r,i)),!1;case 22:return n.flags|=65536,r===jd?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),$0(e,r,i)),!1}throw Error(re(435,n.tag))}return $0(e,r,i),U0(),!1}if(ke)return t=Vn.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Od&&(e=Error(re(422),{cause:r}),au(jn(e,n)))):(r!==Od&&(t=Error(re(423),{cause:r}),au(jn(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=jn(r,n),i=d0(e.stateNode,r,i),qd(e,i),Dt!==4&&(Dt=2)),!1;var a=Error(re(520),{cause:r});if(a=jn(a,n),Cu===null?Cu=[a]:Cu.push(a),Dt!==4&&(Dt=2),t===null)return!0;r=jn(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=d0(n.stateNode,r,e),qd(n,e),!1;case 1:if(t=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(yi===null||!yi.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Fv(i),Nv(i,e,n,r),qd(n,i),!1}n=n.return}while(n!==null);return!1}var Rv=Error(re(461)),kt=!1;function Vt(e,t,n,r){t.child=e===null?wv(t,null,n,r):Va(t,e.child,n,r)}function Ov(e,t,n,r,i){n=n.render;var a=t.ref;if("ref"in r){var o={};for(var u in r)u!=="ref"&&(o[u]=r[u])}else o=r;return Zi(t),r=Zd(e,t,n,o,a,i),u=Qd(),e!==null&&!kt?(Kd(e,t,i),$r(e,t,i)):(ke&&u&&Nd(t),t.flags|=1,Vt(e,t,r,i),t.child)}function zv(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!_d(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Uv(e,t,a,r,i)):(e=Pl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!D0(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:tu,n(o,r)&&e.ref===t.ref)return $r(e,t,i)}return t.flags|=1,e=Fr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Uv(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(tu(a,r)&&e.ref===t.ref)if(kt=!1,t.pendingProps=r=a,D0(e,i))e.flags&131072&&(kt=!0);else return t.lanes=e.lanes,$r(e,t,i)}return h0(e,t,n,r,i)}function Iv(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden"){if(t.flags&128){if(r=a!==null?a.baseLanes|n:n,e!==null){for(i=t.child=e.child,a=0;i!==null;)a=a|i.lanes|i.childLanes,i=i.sibling;t.childLanes=a&~r}else t.childLanes=0,t.child=null;return $v(e,t,r,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xl(t,a!==null?a.cachePool:null),a!==null?Ug(t,a):Gd(),Ev(t);else return t.lanes=t.childLanes=536870912,$v(e,t,a!==null?a.baseLanes|n:n,n)}else a!==null?(Xl(t,a.cachePool),Ug(t,a),di(),t.memoizedState=null):(e!==null&&Xl(t,null),Gd(),di());return Vt(e,t,i,n),t.child}function $v(e,t,n,r){var i=Ld();return i=i===null?null:{parent:Ot._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&Xl(t,null),Gd(),Ev(t),e!==null&&ou(e,t,r,!0),null}function fs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(re(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function h0(e,t,n,r,i){return Zi(t),n=Zd(e,t,n,r,void 0,i),r=Qd(),e!==null&&!kt?(Kd(e,t,i),$r(e,t,i)):(ke&&r&&Nd(t),t.flags|=1,Vt(e,t,n,i),t.child)}function kv(e,t,n,r,i,a){return Zi(t),t.updateQueue=null,n=$g(t,r,n,i),Ig(e),r=Qd(),e!==null&&!kt?(Kd(e,t,a),$r(e,t,a)):(ke&&r&&Nd(t),t.flags|=1,Vt(e,t,n,a),t.child)}function Lv(e,t,n,r,i){if(Zi(t),t.stateNode===null){var a=za,o=n.contextType;typeof o=="object"&&o!==null&&(a=Kt(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=f0,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Hd(t),o=n.contextType,a.context=typeof o=="object"&&o!==null?Kt(o):za,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(c0(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(o=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),o!==a.state&&f0.enqueueReplaceState(a,a.state,null),hu(t,r,a,i),du(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var u=t.memoizedProps,l=Wi(n,u);a.props=l;var s=a.context,c=n.contextType;o=za,typeof c=="object"&&c!==null&&(o=Kt(c));var f=n.getDerivedStateFromProps;c=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function",u=t.pendingProps!==u,c||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u||s!==o)&&Cv(t,a,r,o),ui=!1;var d=t.memoizedState;a.state=d,hu(t,r,a,i),du(),s=t.memoizedState,u||d!==s||ui?(typeof f=="function"&&(c0(t,n,f,r),s=t.memoizedState),(l=ui||Av(t,n,l,r,d,s,o))?(c||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),a.props=r,a.state=s,a.context=o,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Pd(e,t),o=t.memoizedProps,c=Wi(n,o),a.props=c,f=t.pendingProps,d=a.context,s=n.contextType,l=za,typeof s=="object"&&s!==null&&(l=Kt(s)),u=n.getDerivedStateFromProps,(s=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||d!==l)&&Cv(t,a,r,l),ui=!1,d=t.memoizedState,a.state=d,hu(t,r,a,i),du();var h=t.memoizedState;o!==f||d!==h||ui||e!==null&&e.dependencies!==null&&Gl(e.dependencies)?(typeof u=="function"&&(c0(t,n,u,r),h=t.memoizedState),(c=ui||Av(t,n,c,r,d,h,l)||e!==null&&e.dependencies!==null&&Gl(e.dependencies))?(s||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,h,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,h,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=l,r=c):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,fs(e,t),r=(t.flags&128)!==0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Va(t,e.child,null,i),t.child=Va(t,null,n,i)):Vt(e,t,n,i),t.memoizedState=a.state,e=t.child):e=$r(e,t,i),e}function jv(e,t,n,r){return iu(),t.flags|=256,Vt(e,t,n,r),t.child}var m0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function p0(e){return{baseLanes:e,cachePool:Mg()}}function g0(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Gn),e}function Hv(e,t,n){var r=t.pendingProps,i=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(zt.current&2)!==0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(i?fi(t):di(),ke){var u=bt,l;if(l=u){e:{for(l=u,u=hr;l.nodeType!==8;){if(!u){u=null;break e}if(l=rr(l.nextSibling),l===null){u=null;break e}}u=l}u!==null?(t.memoizedState={dehydrated:u,treeContext:qi!==null?{id:Nr,overflow:Rr}:null,retryLane:536870912,hydrationErrors:null},l=An(18,null,null,0),l.stateNode=u,l.return=t,t.child=l,an=t,bt=null,l=!0):l=!1}l||Yi(t)}if(u=t.memoizedState,u!==null&&(u=u.dehydrated,u!==null))return J0(u)?t.lanes=32:t.lanes=536870912,null;Ir(t)}return u=r.children,r=r.fallback,i?(di(),i=t.mode,u=ds({mode:"hidden",children:u},i),r=Pi(r,i,n,null),u.return=t,r.return=t,u.sibling=r,t.child=u,i=t.child,i.memoizedState=p0(n),i.childLanes=g0(e,o,n),t.memoizedState=m0,r):(fi(t),v0(t,u))}if(l=e.memoizedState,l!==null&&(u=l.dehydrated,u!==null)){if(a)t.flags&256?(fi(t),t.flags&=-257,t=y0(e,t,n)):t.memoizedState!==null?(di(),t.child=e.child,t.flags|=128,t=null):(di(),i=r.fallback,u=t.mode,r=ds({mode:"visible",children:r.children},u),i=Pi(i,u,n,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,Va(t,e.child,null,n),r=t.child,r.memoizedState=p0(n),r.childLanes=g0(e,o,n),t.memoizedState=m0,t=i);else if(fi(t),J0(u)){if(o=u.nextSibling&&u.nextSibling.dataset,o)var s=o.dgst;o=s,r=Error(re(419)),r.stack="",r.digest=o,au({value:r,source:null,stack:null}),t=y0(e,t,n)}else if(kt||ou(e,t,n,!1),o=(n&e.childLanes)!==0,kt||o){if(o=rt,o!==null&&(r=n&-n,r=r&42?1:ed(r),r=r&(o.suspendedLanes|n)?0:r,r!==0&&r!==l.retryLane))throw l.retryLane=r,Oa(e,r),Bn(o,e,r),Rv;u.data==="$?"||U0(),t=y0(e,t,n)}else u.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,bt=rr(u.nextSibling),an=t,ke=!0,Gi=null,hr=!1,e!==null&&(Pn[qn++]=Nr,Pn[qn++]=Rr,Pn[qn++]=qi,Nr=e.id,Rr=e.overflow,qi=t),t=v0(t,r.children),t.flags|=4096);return t}return i?(di(),i=r.fallback,u=t.mode,l=e.child,s=l.sibling,r=Fr(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,s!==null?i=Fr(s,i):(i=Pi(i,u,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,u=e.child.memoizedState,u===null?u=p0(n):(l=u.cachePool,l!==null?(s=Ot._currentValue,l=l.parent!==s?{parent:s,pool:s}:l):l=Mg(),u={baseLanes:u.baseLanes|n,cachePool:l}),i.memoizedState=u,i.childLanes=g0(e,o,n),t.memoizedState=m0,r):(fi(t),n=e.child,e=n.sibling,n=Fr(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function v0(e,t){return t=ds({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ds(e,t){return e=An(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function y0(e,t,n){return Va(t,e.child,null,n),e=v0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ud(e.return,t,n)}function b0(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function qv(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Vt(e,t,r.children,n),r=zt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pv(e,n,t);else if(e.tag===19)Pv(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(ft(zt,r),i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ls(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),b0(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ls(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}b0(t,!0,n,null,a);break;case"together":b0(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $r(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vi|=t.lanes,!(n&t.childLanes))if(e!==null){if(ou(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(re(153));if(t.child!==null){for(e=t.child,n=Fr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function D0(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Gl(e)))}function eE(e,t,n){switch(t.tag){case 3:wl(t,t.stateNode.containerInfo),oi(t,Ot,e.memoizedState.cache),iu();break;case 27:case 5:Zf(t);break;case 4:wl(t,t.stateNode.containerInfo);break;case 10:oi(t,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(fi(t),t.flags|=128,null):n&t.child.childLanes?Hv(e,t,n):(fi(t),e=$r(e,t,n),e!==null?e.sibling:null);fi(t);break;case 19:var i=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(ou(e,t,n,!1),r=(n&t.childLanes)!==0),i){if(r)return qv(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ft(zt,zt.current),r)break;return null;case 22:case 23:return t.lanes=0,Iv(e,t,n);case 24:oi(t,Ot,e.memoizedState.cache)}return $r(e,t,n)}function Vv(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)kt=!0;else{if(!D0(e,n)&&!(t.flags&128))return kt=!1,eE(e,t,n);kt=!!(e.flags&131072)}else kt=!1,ke&&t.flags&1048576&&Sg(t,Vl,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,i=r._init;if(r=i(r._payload),t.type=r,typeof r=="function")_d(r)?(e=Wi(r,e),t.tag=1,t=Lv(null,t,r,e,n)):(t.tag=0,t=h0(null,t,r,e,n));else{if(r!=null){if(i=r.$$typeof,i===Hf){t.tag=11,t=Ov(null,t,r,e,n);break e}else if(i===Vf){t.tag=14,t=zv(null,t,r,e,n);break e}}throw t=Yf(r)||r,Error(re(306,t,""))}}return t;case 0:return h0(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Wi(r,t.pendingProps),Lv(e,t,r,i,n);case 3:e:{if(wl(t,t.stateNode.containerInfo),e===null)throw Error(re(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,Pd(e,t),hu(t,r,null,n);var o=t.memoizedState;if(r=o.cache,oi(t,Ot,r),r!==a.cache&&Id(t,[Ot],n,!0),du(),r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=jv(e,t,r,n);break e}else if(r!==i){i=jn(Error(re(424)),t),au(i),t=jv(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(bt=rr(e.firstChild),an=t,ke=!0,Gi=null,hr=!0,n=wv(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(iu(),r===i){t=$r(e,t,n);break e}Vt(e,t,r,n)}t=t.child}return t;case 26:return fs(e,t),e===null?(n=Z1(t.type,null,t.pendingProps,null))?t.memoizedState=n:ke||(n=t.type,e=t.pendingProps,r=Cs(ni.current).createElement(n),r[Qt]=t,r[ln]=e,Yt(r,n,e),$t(r),t.stateNode=r):t.memoizedState=Z1(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Zf(t),e===null&&ke&&(r=t.stateNode=G1(t.type,t.pendingProps,ni.current),an=t,hr=!0,i=bt,Si(t.type)?(eh=i,bt=rr(r.firstChild)):bt=i),Vt(e,t,t.pendingProps.children,n),fs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((i=r=bt)&&(r=ME(r,t.type,t.pendingProps,hr),r!==null?(t.stateNode=r,an=t,bt=rr(r.firstChild),hr=!1,i=!0):i=!1),i||Yi(t)),Zf(t),i=t.type,a=t.pendingProps,o=e!==null?e.memoizedProps:null,r=a.children,Q0(i,a)?r=null:o!==null&&Q0(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=Zd(e,t,Gw,null,null,n),zu._currentValue=i),fs(e,t),Vt(e,t,r,n),t.child;case 6:return e===null&&ke&&((e=n=bt)&&(n=_E(n,t.pendingProps,hr),n!==null?(t.stateNode=n,an=t,bt=null,e=!0):e=!1),e||Yi(t)),null;case 13:return Hv(e,t,n);case 4:return wl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Va(t,null,r,n):Vt(e,t,r,n),t.child;case 11:return Ov(e,t,t.type,t.pendingProps,n);case 7:return Vt(e,t,t.pendingProps,n),t.child;case 8:return Vt(e,t,t.pendingProps.children,n),t.child;case 12:return Vt(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,oi(t,t.type,r.value),Vt(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Zi(t),i=Kt(i),r=r(i),t.flags|=1,Vt(e,t,r,n),t.child;case 14:return zv(e,t,t.type,t.pendingProps,n);case 15:return Uv(e,t,t.type,t.pendingProps,n);case 19:return qv(e,t,n);case 31:return r=t.pendingProps,n=t.mode,r={mode:r.mode,children:r.children},e===null?(n=ds(r,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=Fr(e.child,r),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return Iv(e,t,n);case 24:return Zi(t),r=Kt(Ot),e===null?(i=Ld(),i===null&&(i=rt,a=$d(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},Hd(t),oi(t,Ot,i)):(e.lanes&n&&(Pd(e,t),hu(t,null,null,n),du()),i=e.memoizedState,a=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),oi(t,Ot,r)):(r=a.cache,oi(t,Ot,r),r!==i.cache&&Id(t,[Ot],n,!0))),Vt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(re(156,t.tag))}function kr(e){e.flags|=4}function Gv(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ey(t)){if(t=Vn.current,t!==null&&((Oe&4194048)===Oe?mr!==null:(Oe&62914560)!==Oe&&!(Oe&536870912)||t!==mr))throw cu=jd,_g;e.flags|=8192}}function hs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ep():536870912,e.lanes|=t,Za|=t)}function Du(e,t){if(!ke)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function tE(e,t,n){var r=t.pendingProps;switch(Rd(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return gt(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),zr(Ot),ba(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ru(t)?kr(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Eg())),gt(t),null;case 26:return n=t.memoizedState,e===null?(kr(t),n!==null?(gt(t),Gv(t,n)):(gt(t),t.flags&=-16777217)):n?n!==e.memoizedState?(kr(t),gt(t),Gv(t,n)):(gt(t),t.flags&=-16777217):(e.memoizedProps!==r&&kr(t),gt(t),t.flags&=-16777217),null;case 27:El(t),n=ni.current;var i=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kr(t);else{if(!r){if(t.stateNode===null)throw Error(re(166));return gt(t),null}e=fr.current,ru(t)?xg(t):(e=G1(i,r,n),t.stateNode=e,kr(t))}return gt(t),null;case 5:if(El(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kr(t);else{if(!r){if(t.stateNode===null)throw Error(re(166));return gt(t),null}if(e=fr.current,ru(t))xg(t);else{switch(i=Cs(ni.current),e){case 1:e=i.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=i.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e=typeof r.is=="string"?i.createElement(n,{is:r.is}):i.createElement(n)}}e[Qt]=t,e[ln]=r;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=e;e:switch(Yt(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&kr(t)}}return gt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kr(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(re(166));if(e=ni.current,ru(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=an,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Qt]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||k1(e.nodeValue,n)),e||Yi(t)}else e=Cs(e).createTextNode(r),e[Qt]=t,t.stateNode=e}return gt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ru(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(re(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(re(317));i[Qt]=t}else iu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gt(t),i=!1}else i=Eg(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Ir(t),t):(Ir(t),null)}if(Ir(t),t.flags&128)return t.lanes=n,t;if(n=r!==null,e=e!==null&&e.memoizedState!==null,n){r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool);var a=null;r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),hs(t,t.updateQueue),gt(t),null;case 4:return ba(),e===null&&V0(t.stateNode.containerInfo),gt(t),null;case 10:return zr(t.type),gt(t),null;case 19:if(It(zt),i=t.memoizedState,i===null)return gt(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)Du(i,!1);else{if(Dt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=ls(e),a!==null){for(t.flags|=128,Du(i,!1),e=a.updateQueue,t.updateQueue=e,hs(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Dg(n,e),n=n.sibling;return ft(zt,zt.current&1|2),t.child}e=e.sibling}i.tail!==null&&dr()>gs&&(t.flags|=128,r=!0,Du(i,!1),t.lanes=4194304)}else{if(!r)if(e=ls(a),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,hs(t,e),Du(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ke)return gt(t),null}else 2*dr()-i.renderingStartTime>gs&&n!==536870912&&(t.flags|=128,r=!0,Du(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(e=i.last,e!==null?e.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=dr(),t.sibling=null,e=zt.current,ft(zt,r?e&1|2:e&1),t):(gt(t),null);case 22:case 23:return Ir(t),Yd(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),n=t.updateQueue,n!==null&&hs(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&It(Qi),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),zr(Ot),gt(t),null;case 25:return null;case 30:return null}throw Error(re(156,t.tag))}function nE(e,t){switch(Rd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zr(Ot),ba(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return El(t),null;case 13:if(Ir(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));iu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return It(zt),null;case 4:return ba(),null;case 10:return zr(t.type),null;case 22:case 23:return Ir(t),Yd(),e!==null&&It(Qi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zr(Ot),null;case 25:return null;default:return null}}function Yv(e,t){switch(Rd(t),t.tag){case 3:zr(Ot),ba();break;case 26:case 27:case 5:El(t);break;case 4:ba();break;case 13:Ir(t);break;case 19:It(zt);break;case 10:zr(t.type);break;case 22:case 23:Ir(t),Yd(),e!==null&&It(Qi);break;case 24:zr(Ot)}}function Su(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(u){Je(t,t.return,u)}}function hi(e,t,n){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,u=o.destroy;if(u!==void 0){o.destroy=void 0,i=t;var l=n,s=u;try{s()}catch(c){Je(i,l,c)}}}r=r.next}while(r!==a)}}catch(c){Je(t,t.return,c)}}function Xv(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{zg(t,n)}catch(r){Je(e,e.return,r)}}}function Zv(e,t,n){n.props=Wi(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Je(e,t,r)}}function xu(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(i){Je(e,t,i)}}function pr(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(i){Je(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Je(e,t,i)}else n.current=null}function Qv(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){Je(e,e.return,i)}}function S0(e,t,n){try{var r=e.stateNode;wE(r,e.type,n,t),r[ln]=t}catch(i){Je(e,e.return,i)}}function Kv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Si(e.type)||e.tag===4}function x0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Si(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function w0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=As));else if(r!==4&&(r===27&&Si(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(w0(e,t,n),e=e.sibling;e!==null;)w0(e,t,n),e=e.sibling}function ms(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Si(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ms(e,t,n),e=e.sibling;e!==null;)ms(e,t,n),e=e.sibling}function Wv(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Yt(t,r,n),t[Qt]=e,t[ln]=n}catch(a){Je(e,e.return,a)}}var Lr=!1,At=!1,E0=!1,Jv=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function rE(e,t){if(e=e.containerInfo,X0=Ns,e=cg(e),xd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,u=-1,l=-1,s=0,c=0,f=e,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(u=o+i),f!==a||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++s===i&&(u=o),d===a&&++c===r&&(l=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=u===-1||l===-1?null:{start:u,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Z0={focusedElem:e,selectionRange:n},Ns=!1,Lt=t;Lt!==null;)if(t=Lt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Lt=e;else for(;Lt!==null;){switch(t=Lt,a=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var v=Wi(n.type,i,n.elementType===n.type);e=r.getSnapshotBeforeUpdate(v,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(m){Je(n,n.return,m)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)W0(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":W0(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(re(163))}if(e=t.sibling,e!==null){e.return=t.return,Lt=e;break}Lt=t.return}}function e1(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:mi(e,n),r&4&&Su(5,n);break;case 1:if(mi(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){Je(n,n.return,o)}else{var i=Wi(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Je(n,n.return,o)}}r&64&&Xv(n),r&512&&xu(n,n.return);break;case 3:if(mi(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{zg(e,t)}catch(o){Je(n,n.return,o)}}break;case 27:t===null&&r&4&&Wv(n);case 26:case 5:mi(e,n),t===null&&r&4&&Qv(n),r&512&&xu(n,n.return);break;case 12:mi(e,n);break;case 13:mi(e,n),r&4&&r1(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=dE.bind(null,n),BE(e,n))));break;case 22:if(r=n.memoizedState!==null||Lr,!r){t=t!==null&&t.memoizedState!==null||At,i=Lr;var a=At;Lr=r,(At=t)&&!a?pi(e,n,(n.subtreeFlags&8772)!==0):mi(e,n),Lr=i,At=a}break;case 30:break;default:mi(e,n)}}function t1(e){var t=e.alternate;t!==null&&(e.alternate=null,t1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&rd(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var dt=null,fn=!1;function jr(e,t,n){for(n=n.child;n!==null;)n1(e,t,n),n=n.sibling}function n1(e,t,n){if(xn&&typeof xn.onCommitFiberUnmount=="function")try{xn.onCommitFiberUnmount(Po,n)}catch{}switch(n.tag){case 26:At||pr(n,t),jr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:At||pr(n,t);var r=dt,i=fn;Si(n.type)&&(dt=n.stateNode,fn=!1),jr(e,t,n),Fu(n.stateNode),dt=r,fn=i;break;case 5:At||pr(n,t);case 6:if(r=dt,i=fn,dt=null,jr(e,t,n),dt=r,fn=i,dt!==null)if(fn)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(n.stateNode)}catch(a){Je(n,t,a)}else try{dt.removeChild(n.stateNode)}catch(a){Je(n,t,a)}break;case 18:dt!==null&&(fn?(e=dt,q1(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ku(e)):q1(dt,n.stateNode));break;case 4:r=dt,i=fn,dt=n.stateNode.containerInfo,fn=!0,jr(e,t,n),dt=r,fn=i;break;case 0:case 11:case 14:case 15:At||hi(2,n,t),At||hi(4,n,t),jr(e,t,n);break;case 1:At||(pr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&Zv(n,t,r)),jr(e,t,n);break;case 21:jr(e,t,n);break;case 22:At=(r=At)||n.memoizedState!==null,jr(e,t,n),At=r;break;default:jr(e,t,n)}}function r1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ku(e)}catch(n){Je(t,t.return,n)}}function iE(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Jv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Jv),t;default:throw Error(re(435,e.tag))}}function A0(e,t){var n=iE(e);t.forEach(function(r){var i=hE.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}function Cn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],a=e,o=t,u=o;e:for(;u!==null;){switch(u.tag){case 27:if(Si(u.type)){dt=u.stateNode,fn=!1;break e}break;case 5:dt=u.stateNode,fn=!1;break e;case 3:case 4:dt=u.stateNode.containerInfo,fn=!0;break e}u=u.return}if(dt===null)throw Error(re(160));n1(a,o,i),dt=null,fn=!1,a=i.alternate,a!==null&&(a.return=null),i.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)i1(t,e),t=t.sibling}var nr=null;function i1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Cn(t,e),Tn(e),r&4&&(hi(3,e,e.return),Su(3,e),hi(5,e,e.return));break;case 1:Cn(t,e),Tn(e),r&512&&(At||n===null||pr(n,n.return)),r&64&&Lr&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=nr;if(Cn(t,e),Tn(e),r&512&&(At||n===null||pr(n,n.return)),r&4){var a=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":a=i.getElementsByTagName("title")[0],(!a||a[Go]||a[Qt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=i.createElement(r),i.head.insertBefore(a,i.querySelector("head > title"))),Yt(a,r,n),a[Qt]=e,$t(a),r=a;break e;case"link":var o=W1("link","href",i).get(r+(n.href||""));if(o){for(var u=0;u<o.length;u++)if(a=o[u],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(u,1);break t}}a=i.createElement(r),Yt(a,r,n),i.head.appendChild(a);break;case"meta":if(o=W1("meta","content",i).get(r+(n.content||""))){for(u=0;u<o.length;u++)if(a=o[u],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(u,1);break t}}a=i.createElement(r),Yt(a,r,n),i.head.appendChild(a);break;default:throw Error(re(468,r))}a[Qt]=e,$t(a),r=a}e.stateNode=r}else J1(i,e.type,e.stateNode);else e.stateNode=K1(i,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?J1(i,e.type,e.stateNode):K1(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&S0(e,e.memoizedProps,n.memoizedProps)}break;case 27:Cn(t,e),Tn(e),r&512&&(At||n===null||pr(n,n.return)),n!==null&&r&4&&S0(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Cn(t,e),Tn(e),r&512&&(At||n===null||pr(n,n.return)),e.flags&32){i=e.stateNode;try{Ta(i,"")}catch(h){Je(e,e.return,h)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,S0(e,i,n!==null?n.memoizedProps:i)),r&1024&&(E0=!0);break;case 6:if(Cn(t,e),Tn(e),r&4){if(e.stateNode===null)throw Error(re(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(h){Je(e,e.return,h)}}break;case 3:if(_s=null,i=nr,nr=Ts(t.containerInfo),Cn(t,e),nr=i,Tn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ku(t.containerInfo)}catch(h){Je(e,e.return,h)}E0&&(E0=!1,a1(e));break;case 4:r=nr,nr=Ts(e.stateNode.containerInfo),Cn(t,e),Tn(e),nr=r;break;case 12:Cn(t,e),Tn(e);break;case 13:Cn(t,e),Tn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(F0=dr()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,A0(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,s=Lr,c=At;if(Lr=s||i,At=c||l,Cn(t,e),At=c,Lr=s,Tn(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Lr||At||Ji(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(a=l.stateNode,i)o=a.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{u=l.stateNode;var f=l.memoizedProps.style,d=f!=null&&f.hasOwnProperty("display")?f.display:null;u.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(h){Je(l,l.return,h)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?"":l.memoizedProps}catch(h){Je(l,l.return,h)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,A0(e,n))));break;case 19:Cn(t,e),Tn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,A0(e,r)));break;case 30:break;case 21:break;default:Cn(t,e),Tn(e)}}function Tn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kv(r)){n=r;break}r=r.return}if(n==null)throw Error(re(160));switch(n.tag){case 27:var i=n.stateNode,a=x0(e);ms(e,a,i);break;case 5:var o=n.stateNode;n.flags&32&&(Ta(o,""),n.flags&=-33);var u=x0(e);ms(e,u,o);break;case 3:case 4:var l=n.stateNode.containerInfo,s=x0(e);w0(e,s,l);break;default:throw Error(re(161))}}catch(c){Je(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function a1(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;a1(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function mi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)e1(e,t.alternate,t),t=t.sibling}function Ji(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:hi(4,t,t.return),Ji(t);break;case 1:pr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Zv(t,t.return,n),Ji(t);break;case 27:Fu(t.stateNode);case 26:case 5:pr(t,t.return),Ji(t);break;case 22:t.memoizedState===null&&Ji(t);break;case 30:Ji(t);break;default:Ji(t)}e=e.sibling}}function pi(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:pi(i,a,n),Su(4,a);break;case 1:if(pi(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(s){Je(r,r.return,s)}if(r=a,i=r.updateQueue,i!==null){var u=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Og(l[i],u)}catch(s){Je(r,r.return,s)}}n&&o&64&&Xv(a),xu(a,a.return);break;case 27:Wv(a);case 26:case 5:pi(i,a,n),n&&r===null&&o&4&&Qv(a),xu(a,a.return);break;case 12:pi(i,a,n);break;case 13:pi(i,a,n),n&&o&4&&r1(i,a);break;case 22:a.memoizedState===null&&pi(i,a,n),xu(a,a.return);break;case 30:break;default:pi(i,a,n)}t=t.sibling}}function C0(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&uu(n))}function T0(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&uu(e))}function gr(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)o1(e,t,n,r),t=t.sibling}function o1(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:gr(e,t,n,r),i&2048&&Su(9,t);break;case 1:gr(e,t,n,r);break;case 3:gr(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&uu(e)));break;case 12:if(i&2048){gr(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,u=a.onPostCommit;typeof u=="function"&&u(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){Je(t,t.return,l)}}else gr(e,t,n,r);break;case 13:gr(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState!==null?a._visibility&2?gr(e,t,n,r):wu(e,t):a._visibility&2?gr(e,t,n,r):(a._visibility|=2,Ga(e,t,n,r,(t.subtreeFlags&10256)!==0)),i&2048&&C0(o,t);break;case 24:gr(e,t,n,r),i&2048&&T0(t.alternate,t);break;default:gr(e,t,n,r)}}function Ga(e,t,n,r,i){for(i=i&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var a=e,o=t,u=n,l=r,s=o.flags;switch(o.tag){case 0:case 11:case 15:Ga(a,o,u,l,i),Su(8,o);break;case 23:break;case 22:var c=o.stateNode;o.memoizedState!==null?c._visibility&2?Ga(a,o,u,l,i):wu(a,o):(c._visibility|=2,Ga(a,o,u,l,i)),i&&s&2048&&C0(o.alternate,o);break;case 24:Ga(a,o,u,l,i),i&&s&2048&&T0(o.alternate,o);break;default:Ga(a,o,u,l,i)}t=t.sibling}}function wu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:wu(n,r),i&2048&&C0(r.alternate,r);break;case 24:wu(n,r),i&2048&&T0(r.alternate,r);break;default:wu(n,r)}t=t.sibling}}var Eu=8192;function Ya(e){if(e.subtreeFlags&Eu)for(e=e.child;e!==null;)u1(e),e=e.sibling}function u1(e){switch(e.tag){case 26:Ya(e),e.flags&Eu&&e.memoizedState!==null&&PE(nr,e.memoizedState,e.memoizedProps);break;case 5:Ya(e);break;case 3:case 4:var t=nr;nr=Ts(e.stateNode.containerInfo),Ya(e),nr=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=Eu,Eu=16777216,Ya(e),Eu=t):Ya(e));break;default:Ya(e)}}function l1(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Au(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Lt=r,c1(r,e)}l1(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)s1(e),e=e.sibling}function s1(e){switch(e.tag){case 0:case 11:case 15:Au(e),e.flags&2048&&hi(9,e,e.return);break;case 3:Au(e);break;case 12:Au(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ps(e)):Au(e);break;default:Au(e)}}function ps(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Lt=r,c1(r,e)}l1(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:hi(8,t,t.return),ps(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ps(t));break;default:ps(t)}e=e.sibling}}function c1(e,t){for(;Lt!==null;){var n=Lt;switch(n.tag){case 0:case 11:case 15:hi(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:uu(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Lt=r;else e:for(n=e;Lt!==null;){r=Lt;var i=r.sibling,a=r.return;if(t1(r),r===n){Lt=null;break e}if(i!==null){i.return=a,Lt=i;break e}Lt=a}}}var aE={getCacheForType:function(e){var t=Kt(Ot),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},oE=typeof WeakMap=="function"?WeakMap:Map,qe=0,rt=null,Be=null,Oe=0,Ve=0,Mn=null,gi=!1,Xa=!1,M0=!1,Hr=0,Dt=0,vi=0,ea=0,_0=0,Gn=0,Za=0,Cu=null,dn=null,B0=!1,F0=0,gs=1/0,vs=null,yi=null,Gt=0,bi=null,Qa=null,Ka=0,N0=0,R0=null,f1=null,Tu=0,O0=null;function _n(){if(qe&2&&Oe!==0)return Oe&-Oe;if(we.T!==null){var e=$a;return e!==0?e:j0()}return Tp()}function d1(){Gn===0&&(Gn=!(Oe&536870912)||ke?wp():536870912);var e=Vn.current;return e!==null&&(e.flags|=32),Gn}function Bn(e,t,n){(e===rt&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)&&(Wa(e,0),Di(e,Oe,Gn,!1)),Vo(e,n),(!(qe&2)||e!==rt)&&(e===rt&&(!(qe&2)&&(ea|=n),Dt===4&&Di(e,Oe,Gn,!1)),vr(e))}function h1(e,t,n){if(qe&6)throw Error(re(327));var r=!n&&(t&124)===0&&(t&e.expiredLanes)===0||qo(e,t),i=r?sE(e,t):I0(e,t,!0),a=r;do{if(i===0){Xa&&!r&&Di(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!uE(n)){i=I0(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var u=e;i=Cu;var l=u.current.memoizedState.isDehydrated;if(l&&(Wa(u,o).flags|=256),o=I0(u,o,!1),o!==2){if(M0&&!l){u.errorRecoveryDisabledLanes|=a,ea|=a,i=4;break e}a=dn,dn=i,a!==null&&(dn===null?dn=a:dn.push.apply(dn,a))}i=o}if(a=!1,i!==2)continue}}if(i===1){Wa(e,0),Di(e,t,0,!0);break}e:{switch(r=e,a=i,a){case 0:case 1:throw Error(re(345));case 4:if((t&4194048)!==t)break;case 6:Di(r,t,Gn,!gi);break e;case 2:dn=null;break;case 3:case 5:break;default:throw Error(re(329))}if((t&62914560)===t&&(i=F0+300-dr(),10<i)){if(Di(r,t,Gn,!gi),Ml(r,0,!0)!==0)break e;r.timeoutHandle=H1(m1.bind(null,r,n,dn,vs,B0,t,Gn,ea,Za,gi,a,2,-0,0),i);break e}m1(r,n,dn,vs,B0,t,Gn,ea,Za,gi,a,0,-0,0)}}break}while(!0);vr(e)}function m1(e,t,n,r,i,a,o,u,l,s,c,f,d,h){if(e.timeoutHandle=-1,f=t.subtreeFlags,(f&8192||(f&16785408)===16785408)&&(Ou={stylesheets:null,count:0,unsuspend:HE},u1(t),f=qE(),f!==null)){e.cancelPendingCommit=f(S1.bind(null,e,t,a,n,r,i,o,u,l,c,1,d,h)),Di(e,a,o,!s);return}S1(e,t,a,n,r,i,o,u,l)}function uE(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!En(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Di(e,t,n,r){t&=~_0,t&=~ea,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-wn(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ap(e,n,t)}function ys(){return qe&6?!0:(Mu(0),!1)}function z0(){if(Be!==null){if(Ve===0)var e=Be.return;else e=Be,Or=Xi=null,Wd(e),qa=null,yu=0,e=Be;for(;e!==null;)Yv(e.alternate,e),e=e.return;Be=null}}function Wa(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,AE(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),z0(),rt=e,Be=n=Fr(e.current,null),Oe=t,Ve=0,Mn=null,gi=!1,Xa=qo(e,t),M0=!1,Za=Gn=_0=ea=vi=Dt=0,dn=Cu=null,B0=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-wn(r),a=1<<i;t|=e[i],r&=~a}return Hr=t,Ll(),n}function p1(e,t){_e=null,we.H=as,t===su||t===Zl?(t=Ng(),Ve=3):t===_g?(t=Ng(),Ve=4):Ve=t===Rv?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Mn=t,Be===null&&(Dt=1,cs(e,jn(t,e.current)))}function g1(){var e=we.H;return we.H=as,e===null?as:e}function v1(){var e=we.A;return we.A=aE,e}function U0(){Dt=4,gi||(Oe&4194048)!==Oe&&Vn.current!==null||(Xa=!0),!(vi&134217727)&&!(ea&134217727)||rt===null||Di(rt,Oe,Gn,!1)}function I0(e,t,n){var r=qe;qe|=2;var i=g1(),a=v1();(rt!==e||Oe!==t)&&(vs=null,Wa(e,t)),t=!1;var o=Dt;e:do try{if(Ve!==0&&Be!==null){var u=Be,l=Mn;switch(Ve){case 8:z0(),o=6;break e;case 3:case 2:case 9:case 6:Vn.current===null&&(t=!0);var s=Ve;if(Ve=0,Mn=null,Ja(e,u,l,s),n&&Xa){o=0;break e}break;default:s=Ve,Ve=0,Mn=null,Ja(e,u,l,s)}}lE(),o=Dt;break}catch(c){p1(e,c)}while(!0);return t&&e.shellSuspendCounter++,Or=Xi=null,qe=r,we.H=i,we.A=a,Be===null&&(rt=null,Oe=0,Ll()),o}function lE(){for(;Be!==null;)y1(Be)}function sE(e,t){var n=qe;qe|=2;var r=g1(),i=v1();rt!==e||Oe!==t?(vs=null,gs=dr()+500,Wa(e,t)):Xa=qo(e,t);e:do try{if(Ve!==0&&Be!==null){t=Be;var a=Mn;t:switch(Ve){case 1:Ve=0,Mn=null,Ja(e,t,a,1);break;case 2:case 9:if(Bg(a)){Ve=0,Mn=null,b1(t);break}t=function(){Ve!==2&&Ve!==9||rt!==e||(Ve=7),vr(e)},a.then(t,t);break e;case 3:Ve=7;break e;case 4:Ve=5;break e;case 7:Bg(a)?(Ve=0,Mn=null,b1(t)):(Ve=0,Mn=null,Ja(e,t,a,7));break;case 5:var o=null;switch(Be.tag){case 26:o=Be.memoizedState;case 5:case 27:var u=Be;if(!o||ey(o)){Ve=0,Mn=null;var l=u.sibling;if(l!==null)Be=l;else{var s=u.return;s!==null?(Be=s,bs(s)):Be=null}break t}}Ve=0,Mn=null,Ja(e,t,a,5);break;case 6:Ve=0,Mn=null,Ja(e,t,a,6);break;case 8:z0(),Dt=6;break e;default:throw Error(re(462))}}cE();break}catch(c){p1(e,c)}while(!0);return Or=Xi=null,we.H=r,we.A=i,qe=n,Be!==null?0:(rt=null,Oe=0,Ll(),Dt)}function cE(){for(;Be!==null&&!Nx();)y1(Be)}function y1(e){var t=Vv(e.alternate,e,Hr);e.memoizedProps=e.pendingProps,t===null?bs(e):Be=t}function b1(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=kv(n,t,t.pendingProps,t.type,void 0,Oe);break;case 11:t=kv(n,t,t.pendingProps,t.type.render,t.ref,Oe);break;case 5:Wd(t);default:Yv(n,t),t=Be=Dg(t,Hr),t=Vv(n,t,Hr)}e.memoizedProps=e.pendingProps,t===null?bs(e):Be=t}function Ja(e,t,n,r){Or=Xi=null,Wd(t),qa=null,yu=0;var i=t.return;try{if(Jw(e,i,t,n,Oe)){Dt=1,cs(e,jn(n,e.current)),Be=null;return}}catch(a){if(i!==null)throw Be=i,a;Dt=1,cs(e,jn(n,e.current)),Be=null;return}t.flags&32768?(ke||r===1?e=!0:Xa||Oe&536870912?e=!1:(gi=e=!0,(r===2||r===9||r===3||r===6)&&(r=Vn.current,r!==null&&r.tag===13&&(r.flags|=16384))),D1(t,e)):bs(t)}function bs(e){var t=e;do{if(t.flags&32768){D1(t,gi);return}e=t.return;var n=tE(t.alternate,t,Hr);if(n!==null){Be=n;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);Dt===0&&(Dt=5)}function D1(e,t){do{var n=nE(e.alternate,e);if(n!==null){n.flags&=32767,Be=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=n}while(e!==null);Dt=6,Be=null}function S1(e,t,n,r,i,a,o,u,l){e.cancelPendingCommit=null;do Ds();while(Gt!==0);if(qe&6)throw Error(re(327));if(t!==null){if(t===e.current)throw Error(re(177));if(a=t.lanes|t.childLanes,a|=Td,Hx(e,n,a,o,u,l),e===rt&&(Be=rt=null,Oe=0),Qa=t,bi=e,Ka=n,N0=a,R0=i,f1=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,mE(Al,function(){return C1(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=we.T,we.T=null,i=$e.p,$e.p=2,o=qe,qe|=4;try{rE(e,t,n)}finally{qe=o,$e.p=i,we.T=r}}Gt=1,x1(),w1(),E1()}}function x1(){if(Gt===1){Gt=0;var e=bi,t=Qa,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=we.T,we.T=null;var r=$e.p;$e.p=2;var i=qe;qe|=4;try{i1(t,e);var a=Z0,o=cg(e.containerInfo),u=a.focusedElem,l=a.selectionRange;if(o!==u&&u&&u.ownerDocument&&sg(u.ownerDocument.documentElement,u)){if(l!==null&&xd(u)){var s=l.start,c=l.end;if(c===void 0&&(c=s),"selectionStart"in u)u.selectionStart=s,u.selectionEnd=Math.min(c,u.value.length);else{var f=u.ownerDocument||document,d=f&&f.defaultView||window;if(d.getSelection){var h=d.getSelection(),v=u.textContent.length,m=Math.min(l.start,v),D=l.end===void 0?m:Math.min(l.end,v);!h.extend&&m>D&&(o=D,D=m,m=o);var p=lg(u,m),g=lg(u,D);if(p&&g&&(h.rangeCount!==1||h.anchorNode!==p.node||h.anchorOffset!==p.offset||h.focusNode!==g.node||h.focusOffset!==g.offset)){var y=f.createRange();y.setStart(p.node,p.offset),h.removeAllRanges(),m>D?(h.addRange(y),h.extend(g.node,g.offset)):(y.setEnd(g.node,g.offset),h.addRange(y))}}}}for(f=[],h=u;h=h.parentNode;)h.nodeType===1&&f.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<f.length;u++){var S=f[u];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}Ns=!!X0,Z0=X0=null}finally{qe=i,$e.p=r,we.T=n}}e.current=t,Gt=2}}function w1(){if(Gt===2){Gt=0;var e=bi,t=Qa,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=we.T,we.T=null;var r=$e.p;$e.p=2;var i=qe;qe|=4;try{e1(e,t.alternate,t)}finally{qe=i,$e.p=r,we.T=n}}Gt=3}}function E1(){if(Gt===4||Gt===3){Gt=0,Rx();var e=bi,t=Qa,n=Ka,r=f1;t.subtreeFlags&10256||t.flags&10256?Gt=5:(Gt=0,Qa=bi=null,A1(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(yi=null),td(n),t=t.stateNode,xn&&typeof xn.onCommitFiberRoot=="function")try{xn.onCommitFiberRoot(Po,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=we.T,i=$e.p,$e.p=2,we.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var u=r[o];a(u.value,{componentStack:u.stack})}}finally{we.T=t,$e.p=i}}Ka&3&&Ds(),vr(e),i=e.pendingLanes,n&4194090&&i&42?e===O0?Tu++:(Tu=0,O0=e):Tu=0,Mu(0)}}function A1(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,uu(t)))}function Ds(e){return x1(),w1(),E1(),C1()}function C1(){if(Gt!==5)return!1;var e=bi,t=N0;N0=0;var n=td(Ka),r=we.T,i=$e.p;try{$e.p=32>n?32:n,we.T=null,n=R0,R0=null;var a=bi,o=Ka;if(Gt=0,Qa=bi=null,Ka=0,qe&6)throw Error(re(331));var u=qe;if(qe|=4,s1(a.current),o1(a,a.current,o,n),qe=u,Mu(0,!1),xn&&typeof xn.onPostCommitFiberRoot=="function")try{xn.onPostCommitFiberRoot(Po,a)}catch{}return!0}finally{$e.p=i,we.T=r,A1(e,t)}}function T1(e,t,n){t=jn(n,t),t=d0(e.stateNode,t,2),e=si(e,t,2),e!==null&&(Vo(e,2),vr(e))}function Je(e,t,n){if(e.tag===3)T1(e,e,n);else for(;t!==null;){if(t.tag===3){T1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(yi===null||!yi.has(r))){e=jn(n,e),n=Fv(2),r=si(t,n,2),r!==null&&(Nv(n,r,t,e),Vo(r,2),vr(r));break}}t=t.return}}function $0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new oE;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(M0=!0,i.add(n),e=fE.bind(null,e,t,n),t.then(e,e))}function fE(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,rt===e&&(Oe&n)===n&&(Dt===4||Dt===3&&(Oe&62914560)===Oe&&300>dr()-F0?!(qe&2)&&Wa(e,0):_0|=n,Za===Oe&&(Za=0)),vr(e)}function M1(e,t){t===0&&(t=Ep()),e=Oa(e,t),e!==null&&(Vo(e,t),vr(e))}function dE(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),M1(e,n)}function hE(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(re(314))}r!==null&&r.delete(t),M1(e,n)}function mE(e,t){return Kf(e,t)}var Ss=null,eo=null,k0=!1,xs=!1,L0=!1,ta=0;function vr(e){e!==eo&&e.next===null&&(eo===null?Ss=eo=e:eo=eo.next=e),xs=!0,k0||(k0=!0,gE())}function Mu(e,t){if(!L0&&xs){L0=!0;do for(var n=!1,r=Ss;r!==null;){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,u=r.pingedLanes;a=(1<<31-wn(42|e)+1)-1,a&=i&~(o&~u),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,N1(r,a))}else a=Oe,a=Ml(r,r===rt?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||qo(r,a)||(n=!0,N1(r,a));r=r.next}while(n);L0=!1}}function pE(){_1()}function _1(){xs=k0=!1;var e=0;ta!==0&&(EE()&&(e=ta),ta=0);for(var t=dr(),n=null,r=Ss;r!==null;){var i=r.next,a=B1(r,t);a===0?(r.next=null,n===null?Ss=i:n.next=i,i===null&&(eo=n)):(n=r,(e!==0||a&3)&&(xs=!0)),r=i}Mu(e)}function B1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-wn(a),u=1<<o,l=i[o];l===-1?(!(u&n)||u&r)&&(i[o]=jx(u,t)):l<=t&&(e.expiredLanes|=u),a&=~u}if(t=rt,n=Oe,n=Ml(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Wf(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||qo(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Wf(r),td(n)){case 2:case 8:n=Sp;break;case 32:n=Al;break;case 268435456:n=xp;break;default:n=Al}return r=F1.bind(null,e),n=Kf(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Wf(r),e.callbackPriority=2,e.callbackNode=null,2}function F1(e,t){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ds()&&e.callbackNode!==n)return null;var r=Oe;return r=Ml(e,e===rt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(h1(e,r,t),B1(e,dr()),e.callbackNode!=null&&e.callbackNode===n?F1.bind(null,e):null)}function N1(e,t){if(Ds())return null;h1(e,t,!0)}function gE(){CE(function(){qe&6?Kf(Dp,pE):_1()})}function j0(){return ta===0&&(ta=wp()),ta}function R1(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Rl(""+e)}function O1(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vE(e,t,n,r,i){if(t==="submit"&&n&&n.stateNode===i){var a=R1((i[ln]||null).action),o=r.submitter;o&&(t=(t=o[ln]||null)?R1(t.formAction):o.getAttribute("formAction"),t!==null&&(a=t,o=null));var u=new Il("action","action",null,r,i);e.push({event:u,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ta!==0){var l=o?O1(i,o):new FormData(i);u0(n,{pending:!0,data:l,method:i.method,action:a},null,l)}}else typeof a=="function"&&(u.preventDefault(),l=o?O1(i,o):new FormData(i),u0(n,{pending:!0,data:l,method:i.method,action:a},a,l))},currentTarget:i}]})}}for(var H0=0;H0<Cd.length;H0++){var P0=Cd[H0],yE=P0.toLowerCase(),bE=P0[0].toUpperCase()+P0.slice(1);tr(yE,"on"+bE)}tr(hg,"onAnimationEnd"),tr(mg,"onAnimationIteration"),tr(pg,"onAnimationStart"),tr("dblclick","onDoubleClick"),tr("focusin","onFocus"),tr("focusout","onBlur"),tr(Uw,"onTransitionRun"),tr(Iw,"onTransitionStart"),tr($w,"onTransitionCancel"),tr(gg,"onTransitionEnd"),Ea("onMouseEnter",["mouseout","mouseover"]),Ea("onMouseLeave",["mouseout","mouseover"]),Ea("onPointerEnter",["pointerout","pointerover"]),Ea("onPointerLeave",["pointerout","pointerover"]),ki("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ki("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ki("onBeforeInput",["compositionend","keypress","textInput","paste"]),ki("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ki("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ki("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _u="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),DE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_u));function z1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var u=r[o],l=u.instance,s=u.currentTarget;if(u=u.listener,l!==a&&i.isPropagationStopped())break e;a=u,i.currentTarget=s;try{a(i)}catch(c){ss(c)}i.currentTarget=null,a=l}else for(o=0;o<r.length;o++){if(u=r[o],l=u.instance,s=u.currentTarget,u=u.listener,l!==a&&i.isPropagationStopped())break e;a=u,i.currentTarget=s;try{a(i)}catch(c){ss(c)}i.currentTarget=null,a=l}}}}function Fe(e,t){var n=t[nd];n===void 0&&(n=t[nd]=new Set);var r=e+"__bubble";n.has(r)||(U1(t,e,2,!1),n.add(r))}function q0(e,t,n){var r=0;t&&(r|=4),U1(n,e,r,t)}var ws="_reactListening"+Math.random().toString(36).slice(2);function V0(e){if(!e[ws]){e[ws]=!0,_p.forEach(function(n){n!=="selectionchange"&&(DE.has(n)||q0(n,!1,e),q0(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ws]||(t[ws]=!0,q0("selectionchange",!1,t))}}function U1(e,t,n,r){switch(oy(t)){case 2:var i=YE;break;case 8:i=XE;break;default:i=ah}n=i.bind(null,t,n,e),i=void 0,!hd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function G0(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var u=r.stateNode.containerInfo;if(u===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;u!==null;){if(o=Sa(u),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue e}u=u.parentNode}}r=r.return}Pp(function(){var s=a,c=fd(n),f=[];e:{var d=vg.get(e);if(d!==void 0){var h=Il,v=e;switch(e){case"keypress":if(zl(n)===0)break e;case"keydown":case"keyup":h=mw;break;case"focusin":v="focus",h=vd;break;case"focusout":v="blur",h=vd;break;case"beforeblur":case"afterblur":h=vd;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Gp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=nw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=vw;break;case hg:case mg:case pg:h=aw;break;case gg:h=bw;break;case"scroll":case"scrollend":h=ew;break;case"wheel":h=Sw;break;case"copy":case"cut":case"paste":h=uw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Xp;break;case"toggle":case"beforetoggle":h=ww}var m=(t&4)!==0,D=!m&&(e==="scroll"||e==="scrollend"),p=m?d!==null?d+"Capture":null:d;m=[];for(var g=s,y;g!==null;){var S=g;if(y=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||y===null||p===null||(S=Xo(g,p),S!=null&&m.push(Bu(g,S,y))),D)break;g=g.return}0<m.length&&(d=new h(d,v,null,n,c),f.push({event:d,listeners:m}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&n!==cd&&(v=n.relatedTarget||n.fromElement)&&(Sa(v)||v[Da]))break e;if((h||d)&&(d=c.window===c?c:(d=c.ownerDocument)?d.defaultView||d.parentWindow:window,h?(v=n.relatedTarget||n.toElement,h=s,v=v?Sa(v):null,v!==null&&(D=$o(v),m=v.tag,v!==D||m!==5&&m!==27&&m!==6)&&(v=null)):(h=null,v=s),h!==v)){if(m=Gp,S="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(m=Xp,S="onPointerLeave",p="onPointerEnter",g="pointer"),D=h==null?d:Yo(h),y=v==null?d:Yo(v),d=new m(S,g+"leave",h,n,c),d.target=D,d.relatedTarget=y,S=null,Sa(c)===s&&(m=new m(p,g+"enter",v,n,c),m.target=y,m.relatedTarget=D,S=m),D=S,h&&v)t:{for(m=h,p=v,g=0,y=m;y;y=to(y))g++;for(y=0,S=p;S;S=to(S))y++;for(;0<g-y;)m=to(m),g--;for(;0<y-g;)p=to(p),y--;for(;g--;){if(m===p||p!==null&&m===p.alternate)break t;m=to(m),p=to(p)}m=null}else m=null;h!==null&&I1(f,d,h,m,!1),v!==null&&D!==null&&I1(f,D,v,m,!0)}}e:{if(d=s?Yo(s):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var w=ng;else if(eg(d))if(rg)w=Rw;else{w=Fw;var b=Bw}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?s&&sd(s.elementType)&&(w=ng):w=Nw;if(w&&(w=w(e,s))){tg(f,w,n,c);break e}b&&b(e,d,s),e==="focusout"&&s&&d.type==="number"&&s.memoizedProps.value!=null&&ld(d,"number",d.value)}switch(b=s?Yo(s):window,e){case"focusin":(eg(b)||b.contentEditable==="true")&&(Fa=b,wd=s,nu=null);break;case"focusout":nu=wd=Fa=null;break;case"mousedown":Ed=!0;break;case"contextmenu":case"mouseup":case"dragend":Ed=!1,fg(f,n,c);break;case"selectionchange":if(zw)break;case"keydown":case"keyup":fg(f,n,c)}var E;if(bd)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Ba?Wp(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Zp&&n.locale!=="ko"&&(Ba||C!=="onCompositionStart"?C==="onCompositionEnd"&&Ba&&(E=qp()):(ai=c,md="value"in ai?ai.value:ai.textContent,Ba=!0)),b=Es(s,C),0<b.length&&(C=new Yp(C,e,null,n,c),f.push({event:C,listeners:b}),E?C.data=E:(E=Jp(n),E!==null&&(C.data=E)))),(E=Aw?Cw(e,n):Tw(e,n))&&(C=Es(s,"onBeforeInput"),0<C.length&&(b=new Yp("onBeforeInput","beforeinput",null,n,c),f.push({event:b,listeners:C}),b.data=E)),vE(f,e,s,n,c)}z1(f,t)})}function Bu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Es(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Xo(e,n),i!=null&&r.unshift(Bu(e,i,a)),i=Xo(e,t),i!=null&&r.push(Bu(e,i,a))),e.tag===3)return r;e=e.return}return[]}function to(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function I1(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var u=n,l=u.alternate,s=u.stateNode;if(u=u.tag,l!==null&&l===r)break;u!==5&&u!==26&&u!==27||s===null||(l=s,i?(s=Xo(n,a),s!=null&&o.unshift(Bu(n,s,l))):i||(s=Xo(n,a),s!=null&&o.push(Bu(n,s,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var SE=/\r\n?/g,xE=/\u0000|\uFFFD/g;function $1(e){return(typeof e=="string"?e:""+e).replace(SE,`
|
|
50
|
+
`).replace(xE,"")}function k1(e,t){return t=$1(t),$1(e)===t}function As(){}function Ke(e,t,n,r,i,a){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Ta(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Ta(e,""+r);break;case"className":Bl(e,"class",r);break;case"tabIndex":Bl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Bl(e,n,r);break;case"style":jp(e,r,a);break;case"data":if(t!=="object"){Bl(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Rl(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(t!=="input"&&Ke(e,t,"name",i.name,i,null),Ke(e,t,"formEncType",i.formEncType,i,null),Ke(e,t,"formMethod",i.formMethod,i,null),Ke(e,t,"formTarget",i.formTarget,i,null)):(Ke(e,t,"encType",i.encType,i,null),Ke(e,t,"method",i.method,i,null),Ke(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Rl(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=As);break;case"onScroll":r!=null&&Fe("scroll",e);break;case"onScrollEnd":r!=null&&Fe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(re(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(re(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=Rl(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Fe("beforetoggle",e),Fe("toggle",e),_l(e,"popover",r);break;case"xlinkActuate":_r(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":_r(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":_r(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":_r(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":_r(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":_r(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":_r(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":_r(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":_r(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":_l(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Wx.get(n)||n,_l(e,n,r))}}function Y0(e,t,n,r,i,a){switch(n){case"style":jp(e,r,a);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(re(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(re(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Ta(e,r):(typeof r=="number"||typeof r=="bigint")&&Ta(e,""+r);break;case"onScroll":r!=null&&Fe("scroll",e);break;case"onScrollEnd":r!=null&&Fe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=As);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Bp.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),a=e[ln]||null,a=a!=null?a[n]:null,typeof a=="function"&&e.removeEventListener(t,a,i),typeof r=="function")){typeof a!="function"&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):_l(e,n,r)}}}function Yt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",e),Fe("load",e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(re(137,t));default:Ke(e,t,a,o,n,null)}}i&&Ke(e,t,"srcSet",n.srcSet,n,null),r&&Ke(e,t,"src",n.src,n,null);return;case"input":Fe("invalid",e);var u=a=o=i=null,l=null,s=null;for(r in n)if(n.hasOwnProperty(r)){var c=n[r];if(c!=null)switch(r){case"name":i=c;break;case"type":o=c;break;case"checked":l=c;break;case"defaultChecked":s=c;break;case"value":a=c;break;case"defaultValue":u=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(re(137,t));break;default:Ke(e,t,r,c,n,null)}}Ip(e,a,u,l,s,o,i,!1),Fl(e);return;case"select":Fe("invalid",e),r=o=a=null;for(i in n)if(n.hasOwnProperty(i)&&(u=n[i],u!=null))switch(i){case"value":a=u;break;case"defaultValue":o=u;break;case"multiple":r=u;default:Ke(e,t,i,u,n,null)}t=a,n=o,e.multiple=!!r,t!=null?Ca(e,!!r,t,!1):n!=null&&Ca(e,!!r,n,!0);return;case"textarea":Fe("invalid",e),a=i=r=null;for(o in n)if(n.hasOwnProperty(o)&&(u=n[o],u!=null))switch(o){case"value":r=u;break;case"defaultValue":i=u;break;case"children":a=u;break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(re(91));break;default:Ke(e,t,o,u,n,null)}kp(e,r,i,a),Fl(e);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ke(e,t,l,r,n,null)}return;case"dialog":Fe("beforetoggle",e),Fe("toggle",e),Fe("cancel",e),Fe("close",e);break;case"iframe":case"object":Fe("load",e);break;case"video":case"audio":for(r=0;r<_u.length;r++)Fe(_u[r],e);break;case"image":Fe("error",e),Fe("load",e);break;case"details":Fe("toggle",e);break;case"embed":case"source":case"link":Fe("error",e),Fe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(s in n)if(n.hasOwnProperty(s)&&(r=n[s],r!=null))switch(s){case"children":case"dangerouslySetInnerHTML":throw Error(re(137,t));default:Ke(e,t,s,r,n,null)}return;default:if(sd(t)){for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!==void 0&&Y0(e,t,c,r,n,void 0));return}}for(u in n)n.hasOwnProperty(u)&&(r=n[u],r!=null&&Ke(e,t,u,r,n,null))}function wE(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,a=null,o=null,u=null,l=null,s=null,c=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&f!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":l=f;default:r.hasOwnProperty(h)||Ke(e,t,h,null,r,f)}}for(var d in r){var h=r[d];if(f=n[d],r.hasOwnProperty(d)&&(h!=null||f!=null))switch(d){case"type":a=h;break;case"name":i=h;break;case"checked":s=h;break;case"defaultChecked":c=h;break;case"value":o=h;break;case"defaultValue":u=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(re(137,t));break;default:h!==f&&Ke(e,t,d,h,r,f)}}ud(e,o,u,l,s,c,a,i);return;case"select":h=o=u=d=null;for(a in n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case"value":break;case"multiple":h=l;default:r.hasOwnProperty(a)||Ke(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case"value":d=a;break;case"defaultValue":u=a;break;case"multiple":o=a;default:a!==l&&Ke(e,t,i,a,r,l)}t=u,n=o,r=h,d!=null?Ca(e,!!n,d,!1):!!r!=!!n&&(t!=null?Ca(e,!!n,t,!0):Ca(e,!!n,n?[]:"",!1));return;case"textarea":h=d=null;for(u in n)if(i=n[u],n.hasOwnProperty(u)&&i!=null&&!r.hasOwnProperty(u))switch(u){case"value":break;case"children":break;default:Ke(e,t,u,null,r,i)}for(o in r)if(i=r[o],a=n[o],r.hasOwnProperty(o)&&(i!=null||a!=null))switch(o){case"value":d=i;break;case"defaultValue":h=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(re(91));break;default:i!==a&&Ke(e,t,o,i,r,a)}$p(e,d,h);return;case"option":for(var v in n)if(d=n[v],n.hasOwnProperty(v)&&d!=null&&!r.hasOwnProperty(v))switch(v){case"selected":e.selected=!1;break;default:Ke(e,t,v,null,r,d)}for(l in r)if(d=r[l],h=n[l],r.hasOwnProperty(l)&&d!==h&&(d!=null||h!=null))switch(l){case"selected":e.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Ke(e,t,l,d,r,h)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var m in n)d=n[m],n.hasOwnProperty(m)&&d!=null&&!r.hasOwnProperty(m)&&Ke(e,t,m,null,r,d);for(s in r)if(d=r[s],h=n[s],r.hasOwnProperty(s)&&d!==h&&(d!=null||h!=null))switch(s){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(re(137,t));break;default:Ke(e,t,s,d,r,h)}return;default:if(sd(t)){for(var D in n)d=n[D],n.hasOwnProperty(D)&&d!==void 0&&!r.hasOwnProperty(D)&&Y0(e,t,D,void 0,r,d);for(c in r)d=r[c],h=n[c],!r.hasOwnProperty(c)||d===h||d===void 0&&h===void 0||Y0(e,t,c,d,r,h);return}}for(var p in n)d=n[p],n.hasOwnProperty(p)&&d!=null&&!r.hasOwnProperty(p)&&Ke(e,t,p,null,r,d);for(f in r)d=r[f],h=n[f],!r.hasOwnProperty(f)||d===h||d==null&&h==null||Ke(e,t,f,d,r,h)}var X0=null,Z0=null;function Cs(e){return e.nodeType===9?e:e.ownerDocument}function L1(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function j1(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Q0(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var K0=null;function EE(){var e=window.event;return e&&e.type==="popstate"?e===K0?!1:(K0=e,!0):(K0=null,!1)}var H1=typeof setTimeout=="function"?setTimeout:void 0,AE=typeof clearTimeout=="function"?clearTimeout:void 0,P1=typeof Promise=="function"?Promise:void 0,CE=typeof queueMicrotask=="function"?queueMicrotask:typeof P1<"u"?function(e){return P1.resolve(null).then(e).catch(TE)}:H1;function TE(e){setTimeout(function(){throw e})}function Si(e){return e==="head"}function q1(e,t){var n=t,r=0,i=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(0<r&&8>r){n=r;var o=e.ownerDocument;if(n&1&&Fu(o.documentElement),n&2&&Fu(o.body),n&4)for(n=o.head,Fu(n),o=n.firstChild;o;){var u=o.nextSibling,l=o.nodeName;o[Go]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=u}}if(i===0){e.removeChild(a),ku(t);return}i--}else n==="$"||n==="$?"||n==="$!"?i++:r=n.charCodeAt(0)-48;else r=0;n=a}while(n);ku(t)}function W0(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":W0(n),rd(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function ME(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Go])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(a!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=rr(e.nextSibling),e===null)break}return null}function _E(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=rr(e.nextSibling),e===null))return null;return e}function J0(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function BE(e,t){var n=e.ownerDocument;if(e.data!=="$?"||n.readyState==="complete")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function rr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var eh=null;function V1(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function G1(e,t,n){switch(t=Cs(n),e){case"html":if(e=t.documentElement,!e)throw Error(re(452));return e;case"head":if(e=t.head,!e)throw Error(re(453));return e;case"body":if(e=t.body,!e)throw Error(re(454));return e;default:throw Error(re(451))}}function Fu(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);rd(e)}var Yn=new Map,Y1=new Set;function Ts(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pr=$e.d;$e.d={f:FE,r:NE,D:RE,C:OE,L:zE,m:UE,X:$E,S:IE,M:kE};function FE(){var e=Pr.f(),t=ys();return e||t}function NE(e){var t=xa(e);t!==null&&t.tag===5&&t.type==="form"?hv(t):Pr.r(e)}var no=typeof document>"u"?null:document;function X1(e,t,n){var r=no;if(r&&typeof t=="string"&&t){var i=Ln(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),Y1.has(i)||(Y1.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),Yt(t,"link",e),$t(t),r.head.appendChild(t)))}}function RE(e){Pr.D(e),X1("dns-prefetch",e,null)}function OE(e,t){Pr.C(e,t),X1("preconnect",e,t)}function zE(e,t,n){Pr.L(e,t,n);var r=no;if(r&&e&&t){var i='link[rel="preload"][as="'+Ln(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Ln(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Ln(n.imageSizes)+'"]')):i+='[href="'+Ln(e)+'"]';var a=i;switch(t){case"style":a=ro(e);break;case"script":a=io(e)}Yn.has(a)||(e=ut({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Yn.set(a,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(Nu(a))||t==="script"&&r.querySelector(Ru(a))||(t=r.createElement("link"),Yt(t,"link",e),$t(t),r.head.appendChild(t)))}}function UE(e,t){Pr.m(e,t);var n=no;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Ln(r)+'"][href="'+Ln(e)+'"]',a=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=io(e)}if(!Yn.has(a)&&(e=ut({rel:"modulepreload",href:e},t),Yn.set(a,e),n.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ru(a)))return}r=n.createElement("link"),Yt(r,"link",e),$t(r),n.head.appendChild(r)}}}function IE(e,t,n){Pr.S(e,t,n);var r=no;if(r&&e){var i=wa(r).hoistableStyles,a=ro(e);t=t||"default";var o=i.get(a);if(!o){var u={loading:0,preload:null};if(o=r.querySelector(Nu(a)))u.loading=5;else{e=ut({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Yn.get(a))&&th(e,n);var l=o=r.createElement("link");$t(l),Yt(l,"link",e),l._p=new Promise(function(s,c){l.onload=s,l.onerror=c}),l.addEventListener("load",function(){u.loading|=1}),l.addEventListener("error",function(){u.loading|=2}),u.loading|=4,Ms(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:u},i.set(a,o)}}}function $E(e,t){Pr.X(e,t);var n=no;if(n&&e){var r=wa(n).hoistableScripts,i=io(e),a=r.get(i);a||(a=n.querySelector(Ru(i)),a||(e=ut({src:e,async:!0},t),(t=Yn.get(i))&&nh(e,t),a=n.createElement("script"),$t(a),Yt(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}function kE(e,t){Pr.M(e,t);var n=no;if(n&&e){var r=wa(n).hoistableScripts,i=io(e),a=r.get(i);a||(a=n.querySelector(Ru(i)),a||(e=ut({src:e,async:!0,type:"module"},t),(t=Yn.get(i))&&nh(e,t),a=n.createElement("script"),$t(a),Yt(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}function Z1(e,t,n,r){var i=(i=ni.current)?Ts(i):null;if(!i)throw Error(re(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ro(n.href),n=wa(i).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ro(n.href);var a=wa(i).hoistableStyles,o=a.get(e);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,o),(a=i.querySelector(Nu(e)))&&!a._p&&(o.instance=a,o.state.loading=5),Yn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Yn.set(e,n),a||LE(i,e,n,o.state))),t&&r===null)throw Error(re(528,""));return o}if(t&&r!==null)throw Error(re(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=io(n),n=wa(i).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(re(444,e))}}function ro(e){return'href="'+Ln(e)+'"'}function Nu(e){return'link[rel="stylesheet"]['+e+"]"}function Q1(e){return ut({},e,{"data-precedence":e.precedence,precedence:null})}function LE(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Yt(t,"link",n),$t(t),e.head.appendChild(t))}function io(e){return'[src="'+Ln(e)+'"]'}function Ru(e){return"script[async]"+e}function K1(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Ln(n.href)+'"]');if(r)return t.instance=r,$t(r),r;var i=ut({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),$t(r),Yt(r,"style",i),Ms(r,n.precedence,e),t.instance=r;case"stylesheet":i=ro(n.href);var a=e.querySelector(Nu(i));if(a)return t.state.loading|=4,t.instance=a,$t(a),a;r=Q1(n),(i=Yn.get(i))&&th(r,i),a=(e.ownerDocument||e).createElement("link"),$t(a);var o=a;return o._p=new Promise(function(u,l){o.onload=u,o.onerror=l}),Yt(a,"link",r),t.state.loading|=4,Ms(a,n.precedence,e),t.instance=a;case"script":return a=io(n.src),(i=e.querySelector(Ru(a)))?(t.instance=i,$t(i),i):(r=n,(i=Yn.get(a))&&(r=ut({},n),nh(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),$t(i),Yt(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(re(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Ms(r,n.precedence,e));return t.instance}function Ms(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var u=r[o];if(u.dataset.precedence===t)a=u;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function th(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function nh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var _s=null;function W1(e,t,n){if(_s===null){var r=new Map,i=_s=new Map;i.set(n,r)}else i=_s,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Go]||a[Qt]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var o=a.getAttribute(t)||"";o=e+o;var u=r.get(o);u?u.push(a):r.set(o,[a])}}return r}function J1(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function jE(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ey(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var Ou=null;function HE(){}function PE(e,t,n){if(Ou===null)throw Error(re(475));var r=Ou;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var i=ro(n.href),a=e.querySelector(Nu(i));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(r.count++,r=Bs.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=a,$t(a);return}a=e.ownerDocument||e,n=Q1(n),(i=Yn.get(i))&&th(n,i),a=a.createElement("link"),$t(a);var o=a;o._p=new Promise(function(u,l){o.onload=u,o.onerror=l}),Yt(a,"link",n),t.instance=a}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(r.count++,t=Bs.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}function qE(){if(Ou===null)throw Error(re(475));var e=Ou;return e.stylesheets&&e.count===0&&rh(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&rh(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function Bs(){if(this.count--,this.count===0){if(this.stylesheets)rh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Fs=null;function rh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Fs=new Map,t.forEach(VE,e),Fs=null,Bs.call(e))}function VE(e,t){if(!(t.state.loading&4)){var n=Fs.get(e);if(n)var r=n.get(null);else{n=new Map,Fs.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<i.length;a++){var o=i[a];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute("data-precedence"),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Bs.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var zu={$$typeof:Mr,Provider:null,Consumer:null,_currentValue:Ii,_currentValue2:Ii,_threadCount:0};function GE(e,t,n,r,i,a,o,u){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Jf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jf(0),this.hiddenUpdates=Jf(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=u,this.incompleteTransitions=new Map}function ty(e,t,n,r,i,a,o,u,l,s,c,f){return e=new GE(e,t,n,o,u,l,s,f),t=1,a===!0&&(t|=24),a=An(3,null,null,t),e.current=a,a.stateNode=e,t=$d(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Hd(a),e}function ny(e){return e?(e=za,e):za}function ry(e,t,n,r,i,a){i=ny(i),r.context===null?r.context=i:r.pendingContext=i,r=li(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=si(e,r,t),n!==null&&(Bn(n,e,t),fu(n,e,t))}function iy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ih(e,t){iy(e,t),(e=e.alternate)&&iy(e,t)}function ay(e){if(e.tag===13){var t=Oa(e,67108864);t!==null&&Bn(t,e,67108864),ih(e,67108864)}}var Ns=!0;function YE(e,t,n,r){var i=we.T;we.T=null;var a=$e.p;try{$e.p=2,ah(e,t,n,r)}finally{$e.p=a,we.T=i}}function XE(e,t,n,r){var i=we.T;we.T=null;var a=$e.p;try{$e.p=8,ah(e,t,n,r)}finally{$e.p=a,we.T=i}}function ah(e,t,n,r){if(Ns){var i=oh(r);if(i===null)G0(e,t,r,Rs,n),uy(e,r);else if(QE(i,e,t,n,r))r.stopPropagation();else if(uy(e,r),t&4&&-1<ZE.indexOf(e)){for(;i!==null;){var a=xa(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=$i(a.pendingLanes);if(o!==0){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;o;){var l=1<<31-wn(o);u.entanglements[1]|=l,o&=~l}vr(a),!(qe&6)&&(gs=dr()+500,Mu(0))}}break;case 13:u=Oa(a,2),u!==null&&Bn(u,a,2),ys(),ih(a,2)}if(a=oh(r),a===null&&G0(e,t,r,Rs,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else G0(e,t,r,null,n)}}function oh(e){return e=fd(e),uh(e)}var Rs=null;function uh(e){if(Rs=null,e=Sa(e),e!==null){var t=$o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=mp(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Rs=e,null}function oy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ox()){case Dp:return 2;case Sp:return 8;case Al:case zx:return 32;case xp:return 268435456;default:return 32}default:return 32}}var lh=!1,xi=null,wi=null,Ei=null,Uu=new Map,Iu=new Map,Ai=[],ZE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function uy(e,t){switch(e){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":wi=null;break;case"mouseover":case"mouseout":Ei=null;break;case"pointerover":case"pointerout":Uu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Iu.delete(t.pointerId)}}function $u(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=xa(t),t!==null&&ay(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function QE(e,t,n,r,i){switch(t){case"focusin":return xi=$u(xi,e,t,n,r,i),!0;case"dragenter":return wi=$u(wi,e,t,n,r,i),!0;case"mouseover":return Ei=$u(Ei,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return Uu.set(a,$u(Uu.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Iu.set(a,$u(Iu.get(a)||null,e,t,n,r,i)),!0}return!1}function ly(e){var t=Sa(e.target);if(t!==null){var n=$o(t);if(n!==null){if(t=n.tag,t===13){if(t=mp(n),t!==null){e.blockedOn=t,Px(e.priority,function(){if(n.tag===13){var r=_n();r=ed(r);var i=Oa(n,r);i!==null&&Bn(i,n,r),ih(n,r)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Os(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=oh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cd=r,n.target.dispatchEvent(r),cd=null}else return t=xa(n),t!==null&&ay(t),e.blockedOn=n,!1;t.shift()}return!0}function sy(e,t,n){Os(e)&&n.delete(t)}function KE(){lh=!1,xi!==null&&Os(xi)&&(xi=null),wi!==null&&Os(wi)&&(wi=null),Ei!==null&&Os(Ei)&&(Ei=null),Uu.forEach(sy),Iu.forEach(sy)}function zs(e,t){e.blockedOn===t&&(e.blockedOn=null,lh||(lh=!0,Rt.unstable_scheduleCallback(Rt.unstable_NormalPriority,KE)))}var Us=null;function cy(e){Us!==e&&(Us=e,Rt.unstable_scheduleCallback(Rt.unstable_NormalPriority,function(){Us===e&&(Us=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(uh(r||n)===null)continue;break}var a=xa(n);a!==null&&(e.splice(t,3),t-=3,u0(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function ku(e){function t(l){return zs(l,e)}xi!==null&&zs(xi,e),wi!==null&&zs(wi,e),Ei!==null&&zs(Ei,e),Uu.forEach(t),Iu.forEach(t);for(var n=0;n<Ai.length;n++){var r=Ai[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ai.length&&(n=Ai[0],n.blockedOn===null);)ly(n),n.blockedOn===null&&Ai.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ln]||null;if(typeof a=="function")o||cy(n);else if(o){var u=null;if(a&&a.hasAttribute("formAction")){if(i=a,o=a[ln]||null)u=o.formAction;else if(uh(i)!==null)continue}else u=o.action;typeof u=="function"?n[r+1]=u:(n.splice(r,3),r-=3),cy(n)}}}function sh(e){this._internalRoot=e}Is.prototype.render=sh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(re(409));var n=t.current,r=_n();ry(n,r,e,t,null,null)},Is.prototype.unmount=sh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ry(e.current,2,null,e,null,null),ys(),t[Da]=null}};function Is(e){this._internalRoot=e}Is.prototype.unstable_scheduleHydration=function(e){if(e){var t=Tp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ai.length&&t!==0&&t<Ai[n].priority;n++);Ai.splice(n,0,e),n===0&&ly(e)}};var fy=dp.version;if(fy!=="19.1.1")throw Error(re(527,fy,"19.1.1"));$e.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(re(188)):(e=Object.keys(e).join(","),Error(re(268,e)));return e=Tx(t),e=e!==null?gp(e):null,e=e===null?null:e.stateNode,e};var WE={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:we,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $s=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$s.isDisabled&&$s.supportsFiber)try{Po=$s.inject(WE),xn=$s}catch{}}bl.createRoot=function(e,t){if(!hp(e))throw Error(re(299));var n=!1,r="",i=Tv,a=Mv,o=_v,u=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(u=t.unstable_transitionCallbacks)),t=ty(e,1,!1,null,null,n,r,i,a,o,u,null),e[Da]=t.current,V0(e),new sh(t)},bl.hydrateRoot=function(e,t,n){if(!hp(e))throw Error(re(299));var r=!1,i="",a=Tv,o=Mv,u=_v,l=null,s=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(u=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(l=n.unstable_transitionCallbacks),n.formState!==void 0&&(s=n.formState)),t=ty(e,1,!0,t,n??null,r,i,a,o,u,l,s),t.context=ny(null),n=t.current,r=_n(),r=ed(r),i=li(r),i.callback=null,si(n,i,r),n=r,t.current.lanes=n,Vo(t,n),vr(t),e[Da]=t.current,V0(e),new Is(t)},bl.version="19.1.1";function dy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dy)}catch(e){console.error(e)}}dy(),op.exports=bl;var JE=op.exports;const eA=(e,t)=>t.type==="selectUnitMetrics"?{...e,selectedUnitMetrics:t.unitMetrics}:t.type==="initialize"?{...e,allUnitMetrics:[...new Set([...e.allUnitMetrics||[],...t.unitMetrics])].sort()}:e,hy=Nt.createContext({}),ch=()=>{const e=M.useContext(hy),t=M.useMemo(()=>e.unitMetricSelectionDispatch||(()=>{}),[e.unitMetricSelectionDispatch]);return{selectedUnitMetrics:e.unitMetricSelection?.selectedUnitMetrics||[],allUnitMetrics:e.unitMetricSelection?.allUnitMetrics||[],unitMetricSelectionDispatch:t}},Ct=e=>{if(typeof e=="number")return e;if(typeof e=="string"){const t=tA(e);try{const n=parseFloat(t);return isNaN(n)?0:n}catch{return 0}}else return 0},tA=e=>{let t=0;for(;t<e.length&&nA(e[t]);)t++;return e.slice(t)},nA=e=>isNaN(parseFloat(e)),yr=e=>[...e].sort((t,n)=>{if(typeof t=="number"&&typeof n=="number")return t-n;{if(!isNaN(parseInt(t+""))&&!isNaN(parseInt(n+"")))return parseInt(t+"")-parseInt(n+"");const r=(t+"")[0],i=(n+"")[0];if(r===i){const a=(t+"").slice(1),o=(n+"").slice(1);return!isNaN(parseInt(a))&&!isNaN(parseInt(o))?parseInt(a)-parseInt(o):t<n?-1:t>n?1:0}else return t<n?-1:t>n?1:0}}),ao=(e,t)=>{const{targetUnit:n}=t;if(n===void 0)throw Error("UNIQUE_SELECT for unit selection requires a target unit to be set.");return{...e,lastClickedId:n,selectedUnitIds:new Set(e.selectedUnitIds.has(n)?[]:[n]),currentUnitId:n}},rA=e=>{if(e.lastClickedId===void 0)return e.orderedUnitIds.length===0?e:ao(e,{targetUnit:e.orderedUnitIds[0]});const t=e.orderedUnitIds.indexOf(e.lastClickedId);if(t<0)return e;const n=e.orderedUnitIds[t+1];return n===void 0?e:ao(e,{targetUnit:n})},iA=e=>{if(e.lastClickedId===void 0)return e;const t=e.orderedUnitIds.indexOf(e.lastClickedId);if(t<0||t===0)return e;const n=e.orderedUnitIds[t-1];return n===void 0?e:ao(e,{targetUnit:n})},aA=e=>e.orderedUnitIds.length===0?e:ao(e,{targetUnit:e.orderedUnitIds[0]}),oA=e=>e.orderedUnitIds.length===0?e:ao(e,{targetUnit:e.orderedUnitIds[e.orderedUnitIds.length-1]}),uA=(e,t)=>({...e,currentUnitId:(t.incomingSelectedUnitIds||[])[0],selectedUnitIds:new Set(t.incomingSelectedUnitIds??[])}),my=e=>e.selectedUnitIds.size===0?"none":e.selectedUnitIds.size===e.orderedUnitIds.length?"all":!e.visibleUnitIds||e.visibleUnitIds.length===0||e.selectedUnitIds.size!==e.visibleUnitIds.length||e.visibleUnitIds.some(t=>!e.selectedUnitIds.has(t))?"partial":"all",py=(e,t)=>{if(t.targetUnit===void 0)throw new Error("Attempt to toggle unit with unset unitid.");const n=new Set([...e.selectedUnitIds]);n.has(t.targetUnit)?n.delete(t.targetUnit):n.add(t.targetUnit);let r=e.currentUnitId;return t.targetUnit===e.currentUnitId&&(r=[...n][0]),[...n].length===1&&(r=[...n][0]),{...e,selectedUnitIds:n,currentUnitId:r,lastClickedId:t.targetUnit}},lA=(e,t)=>{const{selectedUnitIds:n,lastClickedId:r,orderedUnitIds:i}=e,{targetUnit:a}=t;if(i.length===0)throw Error("Attempt to toggle range with no units initialized.");if(!r||!a)return console.warn(`Cannot toggle range with undefined limit: last-clicked ${r}, target ${a}`),e;const o=i.findIndex(s=>s===r),u=i.findIndex(s=>s===a);if(o===-1||u===-1)throw Error(`Requested to toggle unit range from ID ${r} to ID ${a} but one of these was not found.`);const l=i.slice(Math.min(o,u),Math.max(o,u)+1);return n.has(a)?l.forEach(s=>n.delete(s)):l.forEach(s=>n.add(s)),e.currentUnitId?n.has(e.currentUnitId)||(e.currentUnitId=[...n][0]):e.currentUnitId=[...n][0],{...e,lastClickedId:a,selectedUnitIds:new Set(n),currentUnitId:e.currentUnitId}},sA=e=>{const t=my(e),n=t==="all"||t==="partial"?new Set:new Set(e.orderedUnitIds);return e.currentUnitId?n.has(e.currentUnitId)||(e.currentUnitId=[...n][0]):e.currentUnitId=[...n][0],{...e,selectedUnitIds:n}},cA=e=>t=>n=>{dA(t,e,n)},fA=e=>t=>n=>{hA(t,e,n)},dA=(e,t,n)=>{const r={type:n.ctrlKey?fh:n.shiftKey?hh:dh,targetUnit:e};t(r)},hA=(e,t,n)=>{const r={type:n.shiftKey?hh:n.ctrlKey?dh:fh,targetUnit:e};t(r)},ks=20,mA=(e,t)=>{if(t.newVisibleUnitIds&&t.newVisibleUnitIds.length>0)return{...e,visibleUnitIds:t.newVisibleUnitIds};const n=t.unitsPerPage||e.unitsPerPage||ks,r=t.pageNumber||e.page||1;if(n===e.unitsPerPage&&r===e.page)return e;const i=r!==e.page?r:1+Math.floor((e.unitsPerPage||ks)*(r-1)/n),a=n*(i-1);return{...e,page:i,unitsPerPage:n,visibleUnitIds:e.orderedUnitIds.slice(a,a+n)}},pA=(e,t)=>({...e,restrictedUnitIds:t.newRestrictedUnitIds,selectedUnitIds:t.newRestrictedUnitIds!==void 0&&e.selectedUnitIds!==void 0?new Set([...e.selectedUnitIds].filter(n=>!t.newRestrictedUnitIds||t.newRestrictedUnitIds.includes(n))):e.selectedUnitIds}),gy=(e,t)=>{const n=(e.unitsPerPage||ks)*((e.page||1)-1);return e.visibleUnitIds&&e.visibleUnitIds.length>0?t.slice(n,n+(e.unitsPerPage||ks)):void 0},gA=(e,t)=>{const{newUnitOrder:n}=t,{orderedUnitIds:r}=e;if(!n||n.length===0)throw Error("Attempt to reset unit ordering to empty set.");const i=new Set(r);if(i.size>0&&(n.length!==i.size||n.some(o=>!i.has(o))))throw Error("Reordering units, but the set of units in the new and old ordering don't match.");if(r.every((o,u)=>o===n[u]))return e;const a=gy(e,n);return{...e,orderedUnitIds:n,lastClickedId:void 0,visibleUnitIds:a,sortRules:[]}},vA=(e,t)=>{const{sortRules:n}=e,{newSortField:r,sortCallback:i}=t;if(r===void 0||i===void 0)throw Error("Attempt to update sort fields with undefined field or callback.");const a=yA(n||[],r,t.ascending),o=i(a),u=gy(e,o);return{...e,sortRules:a,orderedUnitIds:o,visibleUnitIds:u,lastClickedId:void 0}},yA=(e,t,n)=>{const r=e.pop(),i=n===void 0?r?.columnName===t?!r.sortAscending:!0:n;return r&&r.columnName!==t&&e.push(r),[...e.filter(o=>o.columnName!==t),{columnName:t,sortAscending:i}]},bA="SET_SELECTION",fh="UNIQUE_SELECT",vy="UNIQUE_SELECT_NEXT",yy="UNIQUE_SELECT_PREVIOUS",by="UNIQUE_SELECT_FIRST",Dy="UNIQUE_SELECT_LAST",dh="TOGGLE_UNIT",hh="TOGGLE_RANGE",DA="TOGGLE_SELECT_ALL",SA="DESELECT_ALL",oo="INITIALIZE_UNITS",xA="SET_UNIT_ORDER",wA="UPDATE_SORT_FIELDS",EA="SET_VISIBLE_UNITS",AA="SET_RESTRICTED_UNITS",CA="COPY_STATE",Sy={selectedUnitIds:new Set,currentUnitId:void 0,orderedUnitIds:[]},TA=(e,t)=>{const{type:n}=t;switch(n){case oo:{const r=new Set(e.orderedUnitIds);if((t.newUnitOrder||[]).filter(i=>!r.has(i)).length===0)return e;if(t.newUnitOrder&&t.newUnitOrder.length>=1)return{...e,orderedUnitIds:yr([...new Set([...t.newUnitOrder,...e.orderedUnitIds])])};throw Error("Attempt to initialize table ordering with no actual units passed.")}case bA:return uA(e,t);case fh:return ao(e,t);case vy:return rA(e);case yy:return iA(e);case by:return aA(e);case Dy:return oA(e);case dh:return py(e,t);case hh:return e.lastClickedId?lA(e,t):py(e,t);case DA:return sA(e);case SA:return{...e,selectedUnitIds:new Set,currentUnitId:void 0};case xA:return gA(e,t);case wA:return vA(e,t);case EA:return mA(e,t);case AA:return pA(e,t);case CA:if(!t.sourceState)throw Error("Attempt to copy state but no source state was provided.");return{...t.sourceState};default:throw Error(`Invalid mode for unit selection reducer: ${n}`)}},MA=()=>M.useContext(xy),xy=Nt.createContext({unitSelection:Sy,unitSelectionDispatch:()=>{}}),qr=()=>{const{unitSelection:e,unitSelectionDispatch:t}=MA(),n=M.useMemo(()=>cA(t),[t]),r=M.useMemo(()=>fA(t),[t]),i=M.useMemo(()=>_A(e.orderedUnitIds,e.restrictedUnitIds),[e.orderedUnitIds,e.restrictedUnitIds]),a=M.useMemo(()=>e.orderedUnitIds.filter(o=>e.selectedUnitIds.has(o)),[e.orderedUnitIds,e.selectedUnitIds]);return{selectedUnitIds:e.selectedUnitIds,currentUnitId:e.currentUnitId,orderedUnitIds:i,allOrderedUnitIds:e.orderedUnitIds,selectedUnitIdsArray:a,visibleUnitIds:e.visibleUnitIds,primarySortRule:e.sortRules&&e.sortRules.length>0?e.sortRules[e.sortRules.length-1]:void 0,page:e.page,unitsPerPage:e.unitsPerPage,checkboxClickHandlerGenerator:n,plotClickHandlerGenerator:r,unitIdSelectionDispatch:t,currentState:e,restrictedUnitIds:e.restrictedUnitIds}},_A=(e,t)=>{if(t===void 0)return e;const n=new Set(t);return e.filter(r=>n.has(r))};function wy(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)throw new Error(`Invalid hex color: ${e}`);return{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}}function Ey(e,t,n){const r=i=>{const a=Math.round(Math.max(0,Math.min(255,i))).toString(16);return a.length===1?"0"+a:a};return`#${r(e)}${r(t)}${r(n)}`}function BA(e,t){const{r:n,g:r,b:i}=wy(e),a=1/t;return Ey(n*a,r*a,i*a)}function FA(e,t){const{r:n,g:r,b:i}=wy(e),a=t,o=n+(255-n)*(a-1)/a,u=r+(255-r)*(a-1)/a,l=i+(255-i)*(a-1)/a;return Ey(o,u,l)}const na=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Ay=na.length;for(let e=0;e<Ay;e++)na.push(BA(na[e],2));for(let e=0;e<Ay;e++)na.push(FA(na[e],1.5));const mh=e=>na[e%na.length],Ls=e=>e!==null&&typeof e=="string",NA=e=>e!==null&&typeof e=="function",RA=e=>e!==null&&typeof e=="number",OA=e=>t=>{for(const n of e)if(n(t))return!0;return!1},zA=e=>t=>t===e,Cy=e=>t=>{if(t!==null&&Array.isArray(t)){for(const n of t)if(!e(n))return!1;return!0}else return!1},js=(e,t,n)=>{const r=n||{};if(!e)return r.callback&&r.callback("x is undefined/null."),!1;if(typeof e!="object")return r.callback&&r.callback("x is not an Object."),!1;for(const i in e)if(!(i in t)&&!r.allowAdditionalFields)return r.callback&&r.callback(`Key not in spec: ${i}`),!1;for(const i in t){const a=t[i];if(NA(a)){if(!a(e[i]))return r.callback&&r.callback(`Problem validating: ${i}`),!1}else{if(!(i in e))return r.callback&&r.callback(`Key not in x: ${i}`),!1;if(!js(e[i],a,{callback:r.callback}))return r.callback&&r.callback(`Value of key > ${i} < itself failed validation.`),!1}}return!0},UA=(e,t)=>{if(t.type==="DRAG_MOUSE_DOWN"){const{point:n}=t;return{...e,isActive:!1,dragAnchor:n,dragPosition:n,dragRect:void 0}}else{if(t.type==="DRAG_MOUSE_UP")return{...e,isActive:!1,dragAnchor:void 0,dragPosition:void 0,dragRect:void 0};if(t.type==="DRAG_MOUSE_MOVE"){if(!e.dragAnchor)return e;const n=[Math.min(e.dragAnchor[0],t.point[0]),Math.min(e.dragAnchor[1],t.point[1]),Math.abs(e.dragAnchor[0]-t.point[0]),Math.abs(e.dragAnchor[1]-t.point[1])];return e.isActive?{...e,dragRect:n,dragPosition:[t.point[0],t.point[1]]}:n[2]>=10||n[3]>=10?{...e,isActive:!0,dragRect:n,dragPosition:[t.point[0],t.point[1]]}:e}else return t.type==="DRAG_MOUSE_LEAVE"?{...e}:(console.log("Error: unrecognized verb in dragSelectReducer."),e)}},Hs=(e,t,n,r)=>{const[i,a]=M.useReducer(UA,{}),o=M.useCallback(f=>{f.buttons&&a({type:"DRAG_MOUSE_MOVE",point:Ps(f)})},[]),u=M.useCallback(f=>{a({type:"DRAG_MOUSE_DOWN",point:Ps(f)})},[]),l=M.useCallback(f=>{i.isActive&&i.dragRect&&n(i.dragRect,{ctrlKey:f.ctrlKey,shiftKey:f.shiftKey}),i.isActive||r(Ps(f),{ctrlKey:f.ctrlKey,shiftKey:f.shiftKey}),a({type:"DRAG_MOUSE_UP",point:Ps(f)})},[i,n,r]),s=M.useCallback(()=>{a({type:"DRAG_MOUSE_LEAVE"})},[]),c=M.useCallback(f=>{if(f.clearRect(0,0,e,t),i.isActive&&i.dragRect){const d=i.dragRect;f.fillStyle=IA,f.fillRect(d[0],d[1],d[2],d[3])}},[e,t,i]);return{dragSelectState:i,onMouseDown:u,onMouseMove:o,onMouseUp:l,onMouseLeave:s,paintDragSelectLayer:c}},IA="rgba(196, 196, 196, 0.5)",Ps=e=>{const t=e.currentTarget.getBoundingClientRect();return[e.clientX-t.x,e.clientY-t.y]},$A={position:"absolute",left:0,top:0},kA=e=>{if(!e||typeof e=="function")return;const t=e.current,n=t&&t.getContext("2d");if(n)return n},ir=e=>{const{width:t,height:n,vOffsetPx:r,hOffsetPx:i,draw:a,drawData:o}=e,u=M.useRef(null);M.useEffect(()=>{const f=kA(u);f&&f.canvas&&a(f,o)},[a,u,o]);const c={...$A,...r?{top:r}:{},...i?{left:i}:{}};return B.jsx("canvas",{ref:u,width:t,height:n,style:c})};function Ci(){return Ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ci.apply(null,arguments)}var Ty={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function LA(e,t){if(qs(e,t))return e[t];throw typeof e[t]=="function"&&HA(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function jA(e,t,n){if(qs(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function qs(e,t){return!PA(e)&&!Array.isArray(e)?!1:ju(qA,t)?!0:!(t in Object.prototype||t in Function.prototype)}function HA(e,t){return e==null||typeof e[t]!="function"||ju(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:ju(VA,t)?!0:!(t in Object.prototype||t in Function.prototype)}function PA(e){return typeof e=="object"&&e&&e.constructor===Object}var qA={length:!0,name:!0},VA={toString:!0,valueOf:!0,toLocaleString:!0};class GA{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(t=>this.has(t)).values()}get(t){return LA(this.wrappedObject,t)}set(t,n){return jA(this.wrappedObject,t,n),this}has(t){return qs(this.wrappedObject,t)&&t in this.wrappedObject}entries(){return YA(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var n of this.keys())t(this.get(n),n,this)}delete(t){qs(this.wrappedObject,t)&&delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}function YA(e,t){return{next:()=>{var n=e.next();return n.done?n:{value:t(n.value),done:!1}}}}function et(e){return typeof e=="number"}function vt(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function XA(e){return typeof e=="bigint"}function ph(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function gh(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function My(e){return e&&e.constructor.prototype.isUnit===!0||!1}function ar(e){return typeof e=="string"}var ht=Array.isArray;function Pe(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function Lu(e){return Array.isArray(e)||Pe(e)}function _y(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function By(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function Fy(e){return e&&e.constructor.prototype.isRange===!0||!1}function vh(e){return e&&e.constructor.prototype.isIndex===!0||!1}function ZA(e){return typeof e=="boolean"}function QA(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function KA(e){return e&&e.constructor.prototype.isHelp===!0||!1}function WA(e){return typeof e=="function"}function JA(e){return e instanceof Date}function eC(e){return e instanceof RegExp}function yh(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!ph(e)&&!gh(e))}function tC(e){return e?e instanceof Map||e instanceof GA||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}function nC(e){return e===null}function rC(e){return e===void 0}function iC(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function aC(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function oC(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function uC(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function lC(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function sC(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function cC(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function fC(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function dC(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function hC(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function mC(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function pC(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function gC(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function vC(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function yC(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function bC(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function DC(e){return e&&e.constructor.prototype.isChain===!0||!1}function Fn(e){var t=typeof e;return t==="object"?e===null?"null":vt(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function Ie(e){var t=typeof e;if(t==="number"||t==="bigint"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(n){return Ie(n)});if(e instanceof Date)return new Date(e.valueOf());if(vt(e))return e;if(yh(e))return SC(e,Ie);if(t==="function")return e;throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function SC(e,t){var n={};for(var r in e)ju(e,r)&&(n[r]=t(e[r]));return n}function Ny(e,t){for(var n in t)ju(t,n)&&(e[n]=t[n]);return e}function Ti(e,t){var n,r,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(r=0,i=e.length;r<i;r++)if(!Ti(e[r],t[r]))return!1;return!0}else{if(typeof e=="function")return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!Ti(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}else return e===t}}function ju(e,t){return e&&Object.hasOwnProperty.call(e,t)}function xC(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r],a=e[i];a!==void 0&&(n[i]=a)}return n}var wC=["Matrix","Array"],EC=["number","BigNumber","Fraction"],Wt=function(t){if(t)throw new Error(`The global config is readonly.
|
|
63
51
|
Please create a mathjs instance if you want to change the default configuration.
|
|
64
52
|
Example:
|
|
65
53
|
|
|
66
54
|
import { create, all } from 'mathjs';
|
|
67
55
|
const mathjs = create(all);
|
|
68
56
|
mathjs.config({ number: 'BigNumber' });
|
|
69
|
-
`);return Object.freeze(x2)};Vi(un,x2,{MATRIX_OPTIONS:f6,NUMBER_OPTIONS:d6});function _2(){return!0}function ar(){return!1}function $o(){}const B2="Argument is not a typed-function.";function N2(){function e(O){return typeof O=="object"&&O!==null&&O.constructor===Object}const t=[{name:"number",test:function(O){return typeof O=="number"}},{name:"string",test:function(O){return typeof O=="string"}},{name:"boolean",test:function(O){return typeof O=="boolean"}},{name:"Function",test:function(O){return typeof O=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(O){return O instanceof Date}},{name:"RegExp",test:function(O){return O instanceof RegExp}},{name:"Object",test:e},{name:"null",test:function(O){return O===null}},{name:"undefined",test:function(O){return O===void 0}}],n={name:"any",test:_2,isAny:!0};let r,i,a=0,o={createCount:0};function u(O){const k=r.get(O);if(k)return k;let G='Unknown type "'+O+'"';const Z=O.toLowerCase();let ae;for(ae of i)if(ae.toLowerCase()===Z){G+='. Did you mean "'+ae+'" ?';break}throw new TypeError(G)}function l(O){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const G=k?u(k).index:i.length,Z=[];for(let J=0;J<O.length;++J){if(!O[J]||typeof O[J].name!="string"||typeof O[J].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const pe=O[J].name;if(r.has(pe))throw new TypeError('Duplicate type name "'+pe+'"');Z.push(pe),r.set(pe,{name:pe,test:O[J].test,isAny:O[J].isAny,index:G+J,conversionsTo:[]})}const ae=i.slice(G);i=i.slice(0,G).concat(Z).concat(ae);for(let J=G+Z.length;J<i.length;++J)r.get(i[J]).index=J}function s(){r=new Map,i=[],a=0,l([n],!1)}s(),l(t);function c(){let O;for(O of i)r.get(O).conversionsTo=[];a=0}function f(O){const k=i.filter(G=>{const Z=r.get(G);return!Z.isAny&&Z.test(O)});return k.length?k:["any"]}function d(O){return O&&typeof O=="function"&&"_typedFunctionData"in O}function h(O,k,G){if(!d(O))throw new TypeError(B2);const Z=G&&G.exact,ae=Array.isArray(k)?k.join(","):k,J=w(ae),pe=D(J);if(!Z||pe in O.signatures){const rt=O._typedFunctionData.signatureMap.get(pe);if(rt)return rt}const se=J.length;let me;if(Z){me=[];let rt;for(rt in O.signatures)me.push(O._typedFunctionData.signatureMap.get(rt))}else me=O._typedFunctionData.signatures;for(let rt=0;rt<se;++rt){const ft=J[rt],$t=[];let _n;for(_n of me){const gn=A(_n.params,rt);if(!(!gn||ft.restParam&&!gn.restParam)){if(!gn.hasAny){const Sr=y(gn);if(ft.types.some(wr=>!Sr.has(wr.name)))continue}$t.push(_n)}}if(me=$t,me.length===0)break}let le;for(le of me)if(le.params.length<=se)return le;throw new TypeError("Signature not found (signature: "+(O.name||"unnamed")+"("+D(J,", ")+"))")}function g(O,k,G){return h(O,k,G).implementation}function m(O,k){const G=u(k);if(G.test(O))return O;const Z=G.conversionsTo;if(Z.length===0)throw new Error("There are no conversions to "+k+" defined.");for(let ae=0;ae<Z.length;ae++)if(u(Z[ae].from).test(O))return Z[ae].convert(O);throw new Error("Cannot convert "+O+" to "+k)}function D(O){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return O.map(G=>G.name).join(k)}function p(O){const k=O.indexOf("...")===0,Z=(k?O.length>3?O.slice(3):"any":O).split("|").map(se=>u(se.trim()));let ae=!1,J=k?"...":"";return{types:Z.map(function(se){return ae=se.isAny||ae,J+=se.name+"|",{name:se.name,typeIndex:se.index,test:se.test,isAny:se.isAny,conversion:null,conversionIndex:-1}}),name:J.slice(0,-1),hasAny:ae,hasConversion:!1,restParam:k}}function v(O){const k=O.types.map(pe=>pe.name),G=U(k);let Z=O.hasAny,ae=O.name;const J=G.map(function(pe){const se=u(pe.from);return Z=se.isAny||Z,ae+="|"+pe.from,{name:pe.from,typeIndex:se.index,test:se.test,isAny:se.isAny,conversion:pe,conversionIndex:pe.index}});return{types:O.types.concat(J),name:ae,hasAny:Z,hasConversion:J.length>0,restParam:O.restParam}}function y(O){return O.typeSet||(O.typeSet=new Set,O.types.forEach(k=>O.typeSet.add(k.name))),O.typeSet}function w(O){const k=[];if(typeof O!="string")throw new TypeError("Signatures must be strings");const G=O.trim();if(G==="")return k;const Z=G.split(",");for(let ae=0;ae<Z.length;++ae){const J=p(Z[ae].trim());if(J.restParam&&ae!==Z.length-1)throw new SyntaxError('Unexpected rest parameter "'+Z[ae]+'": only allowed for the last parameter');if(J.types.length===0)return null;k.push(J)}return k}function E(O){const k=ee(O);return k?k.restParam:!1}function b(O){if(!O||O.types.length===0)return _2;if(O.types.length===1)return u(O.types[0].name).test;if(O.types.length===2){const k=u(O.types[0].name).test,G=u(O.types[1].name).test;return function(ae){return k(ae)||G(ae)}}else{const k=O.types.map(function(G){return u(G.name).test});return function(Z){for(let ae=0;ae<k.length;ae++)if(k[ae](Z))return!0;return!1}}}function S(O){let k,G,Z;if(E(O)){k=te(O).map(b);const ae=k.length,J=b(ee(O)),pe=function(se){for(let me=ae;me<se.length;me++)if(!J(se[me]))return!1;return!0};return function(me){for(let le=0;le<k.length;le++)if(!k[le](me[le]))return!1;return pe(me)&&me.length>=ae+1}}else return O.length===0?function(J){return J.length===0}:O.length===1?(G=b(O[0]),function(J){return G(J[0])&&J.length===1}):O.length===2?(G=b(O[0]),Z=b(O[1]),function(J){return G(J[0])&&Z(J[1])&&J.length===2}):(k=O.map(b),function(J){for(let pe=0;pe<k.length;pe++)if(!k[pe](J[pe]))return!1;return J.length===k.length})}function A(O,k){return k<O.length?O[k]:E(O)?ee(O):null}function C(O,k){const G=A(O,k);return G?y(G):new Set}function M(O){return O.conversion===null||O.conversion===void 0}function T(O,k){const G=new Set;return O.forEach(Z=>{const ae=C(Z.params,k);let J;for(J of ae)G.add(J)}),G.has("any")?["any"]:Array.from(G)}function x(O,k,G){let Z,ae;const J=O||"unnamed";let pe=G,se;for(se=0;se<k.length;se++){const ft=[];if(pe.forEach($t=>{const _n=A($t.params,se),gn=b(_n);(se<$t.params.length||E($t.params))&&gn(k[se])&&ft.push($t)}),ft.length===0){if(ae=T(pe,se),ae.length>0){const $t=f(k[se]);return Z=new TypeError("Unexpected type of argument in function "+J+" (expected: "+ae.join(" or ")+", actual: "+$t.join(" | ")+", index: "+se+")"),Z.data={category:"wrongType",fn:J,index:se,actual:$t,expected:ae},Z}}else pe=ft}const me=pe.map(function(ft){return E(ft.params)?1/0:ft.params.length});if(k.length<Math.min.apply(null,me))return ae=T(pe,se),Z=new TypeError("Too few arguments in function "+J+" (expected: "+ae.join(" or ")+", index: "+k.length+")"),Z.data={category:"tooFewArgs",fn:J,index:k.length,expected:ae},Z;const le=Math.max.apply(null,me);if(k.length>le)return Z=new TypeError("Too many arguments in function "+J+" (expected: "+le+", actual: "+k.length+")"),Z.data={category:"tooManyArgs",fn:J,index:k.length,expectedLength:le},Z;const rt=[];for(let ft=0;ft<k.length;++ft)rt.push(f(k[ft]).join("|"));return Z=new TypeError('Arguments of type "'+rt.join(", ")+'" do not match any of the defined signatures of function '+J+"."),Z.data={category:"mismatch",actual:rt},Z}function N(O){let k=i.length+1;for(let G=0;G<O.types.length;G++)M(O.types[G])&&(k=Math.min(k,O.types[G].typeIndex));return k}function R(O){let k=a+1;for(let G=0;G<O.types.length;G++)M(O.types[G])||(k=Math.min(k,O.types[G].conversionIndex));return k}function z(O,k){if(O.hasAny){if(!k.hasAny)return 1}else if(k.hasAny)return-1;if(O.restParam){if(!k.restParam)return 1}else if(k.restParam)return-1;if(O.hasConversion){if(!k.hasConversion)return 1}else if(k.hasConversion)return-1;const G=N(O)-N(k);if(G<0)return-1;if(G>0)return 1;const Z=R(O)-R(k);return Z<0?-1:Z>0?1:0}function F(O,k){const G=O.params,Z=k.params,ae=ee(G),J=ee(Z),pe=E(G),se=E(Z);if(pe&&ae.hasAny){if(!se||!J.hasAny)return 1}else if(se&&J.hasAny)return-1;let me=0,le=0,rt;for(rt of G)rt.hasAny&&++me,rt.hasConversion&&++le;let ft=0,$t=0;for(rt of Z)rt.hasAny&&++ft,rt.hasConversion&&++$t;if(me!==ft)return me-ft;if(pe&&ae.hasConversion){if(!se||!J.hasConversion)return 1}else if(se&&J.hasConversion)return-1;if(le!==$t)return le-$t;if(pe){if(!se)return 1}else if(se)return-1;const _n=(G.length-Z.length)*(pe?-1:1);if(_n!==0)return _n;const gn=[];let Sr=0;for(let du=0;du<G.length;++du){const vd=z(G[du],Z[du]);gn.push(vd),Sr+=vd}if(Sr!==0)return Sr;let wr;for(wr of gn)if(wr!==0)return wr;return 0}function U(O){if(O.length===0)return[];const k=O.map(u);O.length>1&&k.sort((ae,J)=>ae.index-J.index);let G=k[0].conversionsTo;if(O.length===1)return G;G=G.concat([]);const Z=new Set(O);for(let ae=1;ae<k.length;++ae){let J;for(J of k[ae].conversionsTo)Z.has(J.from)||(G.push(J),Z.add(J.from))}return G}function I(O,k){let G=k;if(O.some(ae=>ae.hasConversion)){const ae=E(O),J=O.map(L);G=function(){const se=[],me=ae?arguments.length-1:arguments.length;for(let le=0;le<me;le++)se[le]=J[le](arguments[le]);return ae&&(se[me]=arguments[me].map(J[me])),k.apply(this,se)}}let Z=G;if(E(O)){const ae=O.length-1;Z=function(){return G.apply(this,ne(arguments,0,ae).concat([ne(arguments,ae)]))}}return Z}function L(O){let k,G,Z,ae;const J=[],pe=[];switch(O.types.forEach(function(se){se.conversion&&(J.push(u(se.conversion.from).test),pe.push(se.conversion.convert))}),pe.length){case 0:return function(me){return me};case 1:return k=J[0],Z=pe[0],function(me){return k(me)?Z(me):me};case 2:return k=J[0],G=J[1],Z=pe[0],ae=pe[1],function(me){return k(me)?Z(me):G(me)?ae(me):me};default:return function(me){for(let le=0;le<pe.length;le++)if(J[le](me))return pe[le](me);return me}}}function V(O){function k(G,Z,ae){if(Z<G.length){const J=G[Z];let pe=[];if(J.restParam){const se=J.types.filter(M);se.length<J.types.length&&pe.push({types:se,name:"..."+se.map(me=>me.name).join("|"),hasAny:se.some(me=>me.isAny),hasConversion:!1,restParam:!0}),pe.push(J)}else pe=J.types.map(function(se){return{types:[se],name:se.name,hasAny:se.isAny,hasConversion:se.conversion,restParam:!1}});return W(pe,function(se){return k(G,Z+1,ae.concat([se]))})}else return[ae]}return k(O,0,[])}function X(O,k){const G=Math.max(O.length,k.length);for(let se=0;se<G;se++){const me=C(O,se),le=C(k,se);let rt=!1,ft;for(ft of le)if(me.has(ft)){rt=!0;break}if(!rt)return!1}const Z=O.length,ae=k.length,J=E(O),pe=E(k);return J?pe?Z===ae:ae>=Z:pe?Z>=ae:Z===ae}function $(O){return O.map(k=>we(k)?ye(k.referToSelf.callback):Se(k)?he(k.referTo.references,k.referTo.callback):k)}function P(O,k,G){const Z=[];let ae;for(ae of O){let J=G[ae];if(typeof J!="number")throw new TypeError('No definition for referenced signature "'+ae+'"');if(J=k[J],typeof J!="function")return!1;Z.push(J)}return Z}function H(O,k,G){const Z=$(O),ae=new Array(Z.length).fill(!1);let J=!0;for(;J;){J=!1;let pe=!0;for(let se=0;se<Z.length;++se){if(ae[se])continue;const me=Z[se];if(we(me))Z[se]=me.referToSelf.callback(G),Z[se].referToSelf=me.referToSelf,ae[se]=!0,pe=!1;else if(Se(me)){const le=P(me.referTo.references,Z,k);le?(Z[se]=me.referTo.callback.apply(this,le),Z[se].referTo=me.referTo,ae[se]=!0,pe=!1):J=!0}}if(pe&&J)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return Z}function j(O){const k=/\bthis(\(|\.signatures\b)/;Object.keys(O).forEach(G=>{const Z=O[G];if(k.test(Z.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function q(O,k){if(o.createCount++,Object.keys(k).length===0)throw new SyntaxError("No signatures provided");o.warnAgainstDeprecatedThis&&j(k);const G=[],Z=[],ae={},J=[];let pe;for(pe in k){if(!Object.prototype.hasOwnProperty.call(k,pe))continue;const et=w(pe);if(!et)continue;G.forEach(function(Yl){if(X(Yl,et))throw new TypeError('Conflicting signatures "'+D(Yl)+'" and "'+D(et)+'".')}),G.push(et);const Bn=Z.length;Z.push(k[pe]);const CI=et.map(v);let yd;for(yd of V(CI)){const Yl=D(yd);J.push({params:yd,name:Yl,fn:Bn}),yd.every(MI=>!MI.hasConversion)&&(ae[Yl]=Bn)}}J.sort(F);const se=H(Z,ae,Vl);let me;for(me in ae)Object.prototype.hasOwnProperty.call(ae,me)&&(ae[me]=se[ae[me]]);const le=[],rt=new Map;for(me of J)rt.has(me.name)||(me.fn=se[me.fn],le.push(me),rt.set(me.name,me));const ft=le[0]&&le[0].params.length<=2&&!E(le[0].params),$t=le[1]&&le[1].params.length<=2&&!E(le[1].params),_n=le[2]&&le[2].params.length<=2&&!E(le[2].params),gn=le[3]&&le[3].params.length<=2&&!E(le[3].params),Sr=le[4]&&le[4].params.length<=2&&!E(le[4].params),wr=le[5]&&le[5].params.length<=2&&!E(le[5].params),du=ft&&$t&&_n&&gn&&Sr&≀for(let et=0;et<le.length;++et)le[et].test=S(le[et].params);const vd=ft?b(le[0].params[0]):ar,WU=$t?b(le[1].params[0]):ar,JU=_n?b(le[2].params[0]):ar,eI=gn?b(le[3].params[0]):ar,tI=Sr?b(le[4].params[0]):ar,nI=wr?b(le[5].params[0]):ar,rI=ft?b(le[0].params[1]):ar,iI=$t?b(le[1].params[1]):ar,aI=_n?b(le[2].params[1]):ar,oI=gn?b(le[3].params[1]):ar,uI=Sr?b(le[4].params[1]):ar,lI=wr?b(le[5].params[1]):ar;for(let et=0;et<le.length;++et)le[et].implementation=I(le[et].params,le[et].fn);const sI=ft?le[0].implementation:$o,cI=$t?le[1].implementation:$o,fI=_n?le[2].implementation:$o,dI=gn?le[3].implementation:$o,hI=Sr?le[4].implementation:$o,mI=wr?le[5].implementation:$o,pI=ft?le[0].params.length:-1,gI=$t?le[1].params.length:-1,vI=_n?le[2].params.length:-1,yI=gn?le[3].params.length:-1,bI=Sr?le[4].params.length:-1,DI=wr?le[5].params.length:-1,SI=du?6:0,wI=le.length,xI=le.map(et=>et.test),EI=le.map(et=>et.implementation),AI=function(){for(let Bn=SI;Bn<wI;Bn++)if(xI[Bn](arguments))return EI[Bn].apply(this,arguments);return o.onMismatch(O,arguments,le)};function Vl(et,Bn){return arguments.length===pI&&vd(et)&&rI(Bn)?sI.apply(this,arguments):arguments.length===gI&&WU(et)&&iI(Bn)?cI.apply(this,arguments):arguments.length===vI&&JU(et)&&aI(Bn)?fI.apply(this,arguments):arguments.length===yI&&eI(et)&&oI(Bn)?dI.apply(this,arguments):arguments.length===bI&&tI(et)&&uI(Bn)?hI.apply(this,arguments):arguments.length===DI&&nI(et)&&lI(Bn)?mI.apply(this,arguments):AI.apply(this,arguments)}try{Object.defineProperty(Vl,"name",{value:O})}catch{}return Vl.signatures=ae,Vl._typedFunctionData={signatures:le,signatureMap:rt},Vl}function Y(O,k,G){throw x(O,k,G)}function te(O){return ne(O,0,O.length-1)}function ee(O){return O[O.length-1]}function ne(O,k,G){return Array.prototype.slice.call(O,k,G)}function ue(O,k){for(let G=0;G<O.length;G++)if(k(O[G]))return O[G]}function W(O,k){return Array.prototype.concat.apply([],O.map(k))}function fe(){const O=te(arguments).map(G=>D(w(G))),k=ee(arguments);if(typeof k!="function")throw new TypeError("Callback function expected as last argument");return he(O,k)}function he(O,k){return{referTo:{references:O,callback:k}}}function ye(O){if(typeof O!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:O}}}function Se(O){return O&&typeof O.referTo=="object"&&Array.isArray(O.referTo.references)&&typeof O.referTo.callback=="function"}function we(O){return O&&typeof O.referToSelf=="object"&&typeof O.referToSelf.callback=="function"}function Ae(O,k){if(!O)return k;if(k&&k!==O){const G=new Error("Function names do not match (expected: "+O+", actual: "+k+")");throw G.data={actual:k,expected:O},G}return O}function $e(O){let k;for(const G in O)Object.prototype.hasOwnProperty.call(O,G)&&(d(O[G])||typeof O[G].signature=="string")&&(k=Ae(k,O[G].name));return k}function _e(O,k){let G;for(G in k)if(Object.prototype.hasOwnProperty.call(k,G)){if(G in O&&k[G]!==O[G]){const Z=new Error('Signature "'+G+'" is defined twice');throw Z.data={signature:G,sourceFunction:k[G],destFunction:O[G]},Z}O[G]=k[G]}}const Ie=o;o=function(O){const k=typeof O=="string",G=k?1:0;let Z=k?O:"";const ae={};for(let J=G;J<arguments.length;++J){const pe=arguments[J];let se={},me;if(typeof pe=="function"?(me=pe.name,typeof pe.signature=="string"?se[pe.signature]=pe:d(pe)&&(se=pe.signatures)):e(pe)&&(se=pe,k||(me=$e(pe))),Object.keys(se).length===0){const le=new TypeError("Argument to 'typed' at index "+J+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw le.data={index:J,argument:pe},le}k||(Z=Ae(Z,me)),_e(ae,se)}return q(Z||"",ae)},o.create=N2,o.createCount=Ie.createCount,o.onMismatch=Y,o.throwMismatchError=Y,o.createError=x,o.clear=s,o.clearConversions=c,o.addTypes=l,o._findType=u,o.referTo=fe,o.referToSelf=ye,o.convert=m,o.findSignature=h,o.find=g,o.isTypedFunction=d,o.warnAgainstDeprecatedThis=!0,o.addType=function(O,k){let G="any";k!==!1&&r.has("Object")&&(G="Object"),o.addTypes([O],G)};function ge(O){if(!O||typeof O.from!="string"||typeof O.to!="string"||typeof O.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(O.to===O.from)throw new SyntaxError('Illegal to define conversion from "'+O.from+'" to itself.')}return o.addConversion=function(O){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};ge(O);const G=u(O.to),Z=G.conversionsTo.find(ae=>ae.from===O.from);if(Z)if(k&&k.override)o.removeConversion({from:Z.from,to:O.to,convert:Z.convert});else throw new Error('There is already a conversion from "'+O.from+'" to "'+G.name+'"');G.conversionsTo.push({from:O.from,convert:O.convert,index:a++})},o.addConversions=function(O,k){O.forEach(G=>o.addConversion(G,k))},o.removeConversion=function(O){ge(O);const k=u(O.to),G=ue(k.conversionsTo,ae=>ae.from===O.from);if(!G)throw new Error("Attempt to remove nonexistent conversion from "+O.from+" to "+O.to);if(G.convert!==O.convert)throw new Error("Conversion to remove does not match existing conversion");const Z=k.conversionsTo.indexOf(G);k.conversionsTo.splice(Z,1)},o.resolve=function(O,k){if(!d(O))throw new TypeError(B2);const G=O._typedFunctionData.signatures;for(let Z=0;Z<G.length;++Z)if(G[Z].test(k))return G[Z];return null},o}const Nc=N2();function ce(e,t,n,r){function i(a){var o=c6(a,t.map(p6));return h6(e,t,a),n(o)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function h6(e,t,n){var r=t.filter(a=>!m6(a)).every(a=>n[a]!==void 0);if(!r){var i=t.filter(a=>n[a]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function m6(e){return e&&e[0]==="?"}function p6(e){return e&&e[0]==="?"?e.slice(1):e}function st(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function g6(e,t){if(t.number==="bigint")try{BigInt(e)}catch{return t.numberFallback}return t.number}var v6=Math.sign||function(e){return e>0?1:e<0?-1:0};function Cm(e,t,n){var r={2:"0b",8:"0o",16:"0x"},i=r[t],a="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!st(n))throw new Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!st(e))throw new Error("Value must be an integer");e<0&&(e=e+2**n),a="i".concat(n)}var o="";return e<0&&(e=-e,o="-"),"".concat(o).concat(i).concat(e.toString(t)).concat(a)}function Mm(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:n,precision:r,wordSize:i}=F2(t);switch(n){case"fixed":return b6(e,r);case"exponential":return R2(e,r);case"engineering":return y6(e,r);case"bin":return Cm(e,2,i);case"oct":return Cm(e,8,i);case"hex":return Cm(e,16,i);case"auto":return D6(e,r,t).replace(/((\.\d*?)(0+))($|e)/,function(){var a=arguments[2],o=arguments[4];return a!=="."?a+o:o});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function F2(e){var t="auto",n,r;if(e!==void 0)if(at(e))n=e;else if(wt(e))n=e.toNumber();else if(Am(e))e.precision!==void 0&&(n=O2(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(r=O2(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(t=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:t,precision:n,wordSize:r}}function Fc(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var n=t[1],r=t[2],i=parseFloat(t[4]||"0"),a=r.indexOf(".");i+=a!==-1?a-1:r.length-1;var o=r.replace(".","").replace(/^0*/,function(u){return i-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return o.length===0&&(o.push(0),i++),{sign:n,coefficients:o,exponent:i}}function y6(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Fc(e),r=Rc(n,t),i=r.exponent,a=r.coefficients,o=i%3===0?i:i<0?i-3-i%3:i-i%3;if(at(t))for(;t>a.length||i-o+1>a.length;)a.push(0);else for(var u=Math.abs(i-o)-(a.length-1),l=0;l<u;l++)a.push(0);for(var s=Math.abs(i-o),c=1;s>0;)c++,s--;var f=a.slice(c).join(""),d=at(t)&&f.length||f.match(/[1-9]/)?"."+f:"",h=a.slice(0,c).join("")+d+"e"+(i>=0?"+":"")+o.toString();return r.sign+h}function b6(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Fc(e),r=typeof t=="number"?Rc(n,n.exponent+1+t):n,i=r.coefficients,a=r.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(ko(o-i.length))),a<0&&(i=ko(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,a===0?"0.":"."),r.sign+i.join("")}function R2(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Fc(e),r=t?Rc(n,t):n,i=r.coefficients,a=r.exponent;i.length<t&&(i=i.concat(ko(t-i.length)));var o=i.shift();return r.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function D6(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=z2(n?.lowerExp,-3),i=z2(n?.upperExp,5),a=Fc(e),o=t?Rc(a,t):a;if(o.exponent<r||o.exponent>=i)return R2(e,t);var u=o.coefficients,l=o.exponent;u.length<t&&(u=u.concat(ko(t-u.length))),u=u.concat(ko(l-u.length+1+(u.length<t?t-u.length:0))),u=ko(-l).concat(u);var s=l>0?l:0;return s<u.length-1&&u.splice(s+1,0,"."),o.sign+u.join("")}function Rc(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t){var i=r.splice(t,r.length-t);if(i[0]>=5){var a=t-1;for(r[a]++;r[a]===10;)r.pop(),a===0&&(r.unshift(0),n.exponent++,a++),a--,r[a]++}}return n}function ko(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function S6(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}function si(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-8,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return isNaN(e)||isNaN(t)?!1:!isFinite(e)||!isFinite(t)?e===t:e===t?!0:Math.abs(e-t)<=Math.max(n*Math.max(Math.abs(e),Math.abs(t)),r)}function O2(e,t){if(at(e))return e;if(wt(e))return e.toNumber();t()}function z2(e,t){return at(e)?e:wt(e)?e.toNumber():t}var U2=function(){return U2=Nc.create,Nc},w6=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],x6=ce("typed",w6,function(t){var{BigNumber:n,Complex:r,DenseMatrix:i,Fraction:a}=t,o=U2();return o.clear(),o.addTypes([{name:"number",test:at},{name:"Complex",test:wm},{name:"BigNumber",test:wt},{name:"bigint",test:U4},{name:"Fraction",test:xm},{name:"Unit",test:E2},{name:"identifier",test:u=>yr&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(u)},{name:"string",test:yr},{name:"Chain",test:l6},{name:"Array",test:yt},{name:"Matrix",test:Xe},{name:"DenseMatrix",test:A2},{name:"SparseMatrix",test:C2},{name:"Range",test:M2},{name:"Index",test:Em},{name:"boolean",test:I4},{name:"ResultSet",test:$4},{name:"Help",test:k4},{name:"function",test:L4},{name:"Date",test:j4},{name:"RegExp",test:P4},{name:"null",test:q4},{name:"undefined",test:G4},{name:"AccessorNode",test:V4},{name:"ArrayNode",test:Y4},{name:"AssignmentNode",test:X4},{name:"BlockNode",test:Z4},{name:"ConditionalNode",test:K4},{name:"ConstantNode",test:Q4},{name:"FunctionNode",test:J4},{name:"FunctionAssignmentNode",test:W4},{name:"IndexNode",test:e6},{name:"Node",test:t6},{name:"ObjectNode",test:n6},{name:"OperatorNode",test:r6},{name:"ParenthesisNode",test:i6},{name:"RangeNode",test:a6},{name:"RelationalNode",test:o6},{name:"SymbolNode",test:u6},{name:"Map",test:H4},{name:"Object",test:Am}]),o.addConversions([{from:"number",to:"BigNumber",convert:function(l){if(n||Oc(l),S6(l)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+l+"). Use function bignumber(x) to convert to BigNumber.");return new n(l)}},{from:"number",to:"Complex",convert:function(l){return r||zc(l),new r(l,0)}},{from:"BigNumber",to:"Complex",convert:function(l){return r||zc(l),new r(l.toNumber(),0)}},{from:"bigint",to:"number",convert:function(l){if(l>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+l+")");return Number(l)}},{from:"bigint",to:"BigNumber",convert:function(l){return n||Oc(l),new n(l.toString())}},{from:"bigint",to:"Fraction",convert:function(l){return a||Uc(l),new a(l)}},{from:"Fraction",to:"BigNumber",convert:function(l){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(l){return r||zc(l),new r(l.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(l){a||Uc(l);var s=new a(l);if(s.valueOf()!==l)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+l+"). Use function fraction(x) to convert to Fraction.");return s}},{from:"string",to:"number",convert:function(l){var s=Number(l);if(isNaN(s))throw new Error('Cannot convert "'+l+'" to a number');return s}},{from:"string",to:"BigNumber",convert:function(l){n||Oc(l);try{return new n(l)}catch{throw new Error('Cannot convert "'+l+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(l){try{return BigInt(l)}catch{throw new Error('Cannot convert "'+l+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(l){a||Uc(l);try{return new a(l)}catch{throw new Error('Cannot convert "'+l+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(l){r||zc(l);try{return new r(l)}catch{throw new Error('Cannot convert "'+l+'" to Complex')}}},{from:"boolean",to:"number",convert:function(l){return+l}},{from:"boolean",to:"BigNumber",convert:function(l){return n||Oc(l),new n(+l)}},{from:"boolean",to:"bigint",convert:function(l){return BigInt(+l)}},{from:"boolean",to:"Fraction",convert:function(l){return a||Uc(l),new a(+l)}},{from:"boolean",to:"string",convert:function(l){return String(l)}},{from:"Array",to:"Matrix",convert:function(l){return i||E6(),new i(l)}},{from:"Matrix",to:"Array",convert:function(l){return l.valueOf()}}]),o.onMismatch=(u,l,s)=>{var c=o.createError(u,l,s);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&vl(l[0])&&s.some(d=>!d.params.includes(","))){var f=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw f.data=c.data,f}throw c},o.onMismatch=(u,l,s)=>{var c=o.createError(u,l,s);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&vl(l[0])&&s.some(d=>!d.params.includes(","))){var f=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw f.data=c.data,f}throw c},o});function Oc(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function zc(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function E6(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Uc(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}/*!
|
|
57
|
+
`);return Object.freeze(Ty)};Ci(Wt,Ty,{MATRIX_OPTIONS:wC,NUMBER_OPTIONS:EC});function Ry(){return!0}function Xn(){return!1}function uo(){}const Oy="Argument is not a typed-function.";function zy(){function e(O){return typeof O=="object"&&O!==null&&O.constructor===Object}const t=[{name:"number",test:function(O){return typeof O=="number"}},{name:"string",test:function(O){return typeof O=="string"}},{name:"boolean",test:function(O){return typeof O=="boolean"}},{name:"Function",test:function(O){return typeof O=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(O){return O instanceof Date}},{name:"RegExp",test:function(O){return O instanceof RegExp}},{name:"Object",test:e},{name:"null",test:function(O){return O===null}},{name:"undefined",test:function(O){return O===void 0}}],n={name:"any",test:Ry,isAny:!0};let r,i,a=0,o={createCount:0};function u(O){const $=r.get(O);if($)return $;let V='Unknown type "'+O+'"';const Z=O.toLowerCase();let ae;for(ae of i)if(ae.toLowerCase()===Z){V+='. Did you mean "'+ae+'" ?';break}throw new TypeError(V)}function l(O){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const V=$?u($).index:i.length,Z=[];for(let J=0;J<O.length;++J){if(!O[J]||typeof O[J].name!="string"||typeof O[J].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const me=O[J].name;if(r.has(me))throw new TypeError('Duplicate type name "'+me+'"');Z.push(me),r.set(me,{name:me,test:O[J].test,isAny:O[J].isAny,index:V+J,conversionsTo:[]})}const ae=i.slice(V);i=i.slice(0,V).concat(Z).concat(ae);for(let J=V+Z.length;J<i.length;++J)r.get(i[J]).index=J}function s(){r=new Map,i=[],a=0,l([n],!1)}s(),l(t);function c(){let O;for(O of i)r.get(O).conversionsTo=[];a=0}function f(O){const $=i.filter(V=>{const Z=r.get(V);return!Z.isAny&&Z.test(O)});return $.length?$:["any"]}function d(O){return O&&typeof O=="function"&&"_typedFunctionData"in O}function h(O,$,V){if(!d(O))throw new TypeError(Oy);const Z=V&&V.exact,ae=Array.isArray($)?$.join(","):$,J=S(ae),me=D(J);if(!Z||me in O.signatures){const We=O._typedFunctionData.signatureMap.get(me);if(We)return We}const le=J.length;let he;if(Z){he=[];let We;for(We in O.signatures)he.push(O._typedFunctionData.signatureMap.get(We))}else he=O._typedFunctionData.signatures;for(let We=0;We<le;++We){const ot=J[We],Ft=[];let Dn;for(Dn of he){const un=C(Dn.params,We);if(!(!un||ot.restParam&&!un.restParam)){if(!un.hasAny){const lr=y(un);if(ot.types.some(sr=>!lr.has(sr.name)))continue}Ft.push(Dn)}}if(he=Ft,he.length===0)break}let ue;for(ue of he)if(ue.params.length<=le)return ue;throw new TypeError("Signature not found (signature: "+(O.name||"unnamed")+"("+D(J,", ")+"))")}function v(O,$,V){return h(O,$,V).implementation}function m(O,$){const V=u($);if(V.test(O))return O;const Z=V.conversionsTo;if(Z.length===0)throw new Error("There are no conversions to "+$+" defined.");for(let ae=0;ae<Z.length;ae++)if(u(Z[ae].from).test(O))return Z[ae].convert(O);throw new Error("Cannot convert "+O+" to "+$)}function D(O){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return O.map(V=>V.name).join($)}function p(O){const $=O.indexOf("...")===0,Z=($?O.length>3?O.slice(3):"any":O).split("|").map(le=>u(le.trim()));let ae=!1,J=$?"...":"";return{types:Z.map(function(le){return ae=le.isAny||ae,J+=le.name+"|",{name:le.name,typeIndex:le.index,test:le.test,isAny:le.isAny,conversion:null,conversionIndex:-1}}),name:J.slice(0,-1),hasAny:ae,hasConversion:!1,restParam:$}}function g(O){const $=O.types.map(me=>me.name),V=U($);let Z=O.hasAny,ae=O.name;const J=V.map(function(me){const le=u(me.from);return Z=le.isAny||Z,ae+="|"+me.from,{name:me.from,typeIndex:le.index,test:le.test,isAny:le.isAny,conversion:me,conversionIndex:me.index}});return{types:O.types.concat(J),name:ae,hasAny:Z,hasConversion:J.length>0,restParam:O.restParam}}function y(O){return O.typeSet||(O.typeSet=new Set,O.types.forEach($=>O.typeSet.add($.name))),O.typeSet}function S(O){const $=[];if(typeof O!="string")throw new TypeError("Signatures must be strings");const V=O.trim();if(V==="")return $;const Z=V.split(",");for(let ae=0;ae<Z.length;++ae){const J=p(Z[ae].trim());if(J.restParam&&ae!==Z.length-1)throw new SyntaxError('Unexpected rest parameter "'+Z[ae]+'": only allowed for the last parameter');if(J.types.length===0)return null;$.push(J)}return $}function w(O){const $=te(O);return $?$.restParam:!1}function b(O){if(!O||O.types.length===0)return Ry;if(O.types.length===1)return u(O.types[0].name).test;if(O.types.length===2){const $=u(O.types[0].name).test,V=u(O.types[1].name).test;return function(ae){return $(ae)||V(ae)}}else{const $=O.types.map(function(V){return u(V.name).test});return function(Z){for(let ae=0;ae<$.length;ae++)if($[ae](Z))return!0;return!1}}}function E(O){let $,V,Z;if(w(O)){$=ee(O).map(b);const ae=$.length,J=b(te(O)),me=function(le){for(let he=ae;he<le.length;he++)if(!J(le[he]))return!1;return!0};return function(he){for(let ue=0;ue<$.length;ue++)if(!$[ue](he[ue]))return!1;return me(he)&&he.length>=ae+1}}else return O.length===0?function(J){return J.length===0}:O.length===1?(V=b(O[0]),function(J){return V(J[0])&&J.length===1}):O.length===2?(V=b(O[0]),Z=b(O[1]),function(J){return V(J[0])&&Z(J[1])&&J.length===2}):($=O.map(b),function(J){for(let me=0;me<$.length;me++)if(!$[me](J[me]))return!1;return J.length===$.length})}function C(O,$){return $<O.length?O[$]:w(O)?te(O):null}function A(O,$){const V=C(O,$);return V?y(V):new Set}function T(O){return O.conversion===null||O.conversion===void 0}function _(O,$){const V=new Set;return O.forEach(Z=>{const ae=A(Z.params,$);let J;for(J of ae)V.add(J)}),V.has("any")?["any"]:Array.from(V)}function x(O,$,V){let Z,ae;const J=O||"unnamed";let me=V,le;for(le=0;le<$.length;le++){const ot=[];if(me.forEach(Ft=>{const Dn=C(Ft.params,le),un=b(Dn);(le<Ft.params.length||w(Ft.params))&&un($[le])&&ot.push(Ft)}),ot.length===0){if(ae=_(me,le),ae.length>0){const Ft=f($[le]);return Z=new TypeError("Unexpected type of argument in function "+J+" (expected: "+ae.join(" or ")+", actual: "+Ft.join(" | ")+", index: "+le+")"),Z.data={category:"wrongType",fn:J,index:le,actual:Ft,expected:ae},Z}}else me=ot}const he=me.map(function(ot){return w(ot.params)?1/0:ot.params.length});if($.length<Math.min.apply(null,he))return ae=_(me,le),Z=new TypeError("Too few arguments in function "+J+" (expected: "+ae.join(" or ")+", index: "+$.length+")"),Z.data={category:"tooFewArgs",fn:J,index:$.length,expected:ae},Z;const ue=Math.max.apply(null,he);if($.length>ue)return Z=new TypeError("Too many arguments in function "+J+" (expected: "+ue+", actual: "+$.length+")"),Z.data={category:"tooManyArgs",fn:J,index:$.length,expectedLength:ue},Z;const We=[];for(let ot=0;ot<$.length;++ot)We.push(f($[ot]).join("|"));return Z=new TypeError('Arguments of type "'+We.join(", ")+'" do not match any of the defined signatures of function '+J+"."),Z.data={category:"mismatch",actual:We},Z}function F(O){let $=i.length+1;for(let V=0;V<O.types.length;V++)T(O.types[V])&&($=Math.min($,O.types[V].typeIndex));return $}function R(O){let $=a+1;for(let V=0;V<O.types.length;V++)T(O.types[V])||($=Math.min($,O.types[V].conversionIndex));return $}function z(O,$){if(O.hasAny){if(!$.hasAny)return 1}else if($.hasAny)return-1;if(O.restParam){if(!$.restParam)return 1}else if($.restParam)return-1;if(O.hasConversion){if(!$.hasConversion)return 1}else if($.hasConversion)return-1;const V=F(O)-F($);if(V<0)return-1;if(V>0)return 1;const Z=R(O)-R($);return Z<0?-1:Z>0?1:0}function N(O,$){const V=O.params,Z=$.params,ae=te(V),J=te(Z),me=w(V),le=w(Z);if(me&&ae.hasAny){if(!le||!J.hasAny)return 1}else if(le&&J.hasAny)return-1;let he=0,ue=0,We;for(We of V)We.hasAny&&++he,We.hasConversion&&++ue;let ot=0,Ft=0;for(We of Z)We.hasAny&&++ot,We.hasConversion&&++Ft;if(he!==ot)return he-ot;if(me&&ae.hasConversion){if(!le||!J.hasConversion)return 1}else if(le&&J.hasConversion)return-1;if(ue!==Ft)return ue-Ft;if(me){if(!le)return 1}else if(le)return-1;const Dn=(V.length-Z.length)*(me?-1:1);if(Dn!==0)return Dn;const un=[];let lr=0;for(let Uo=0;Uo<V.length;++Uo){const Nf=z(V[Uo],Z[Uo]);un.push(Nf),lr+=Nf}if(lr!==0)return lr;let sr;for(sr of un)if(sr!==0)return sr;return 0}function U(O){if(O.length===0)return[];const $=O.map(u);O.length>1&&$.sort((ae,J)=>ae.index-J.index);let V=$[0].conversionsTo;if(O.length===1)return V;V=V.concat([]);const Z=new Set(O);for(let ae=1;ae<$.length;++ae){let J;for(J of $[ae].conversionsTo)Z.has(J.from)||(V.push(J),Z.add(J.from))}return V}function I(O,$){let V=$;if(O.some(ae=>ae.hasConversion)){const ae=w(O),J=O.map(L);V=function(){const le=[],he=ae?arguments.length-1:arguments.length;for(let ue=0;ue<he;ue++)le[ue]=J[ue](arguments[ue]);return ae&&(le[he]=arguments[he].map(J[he])),$.apply(this,le)}}let Z=V;if(w(O)){const ae=O.length-1;Z=function(){return V.apply(this,ne(arguments,0,ae).concat([ne(arguments,ae)]))}}return Z}function L(O){let $,V,Z,ae;const J=[],me=[];switch(O.types.forEach(function(le){le.conversion&&(J.push(u(le.conversion.from).test),me.push(le.conversion.convert))}),me.length){case 0:return function(he){return he};case 1:return $=J[0],Z=me[0],function(he){return $(he)?Z(he):he};case 2:return $=J[0],V=J[1],Z=me[0],ae=me[1],function(he){return $(he)?Z(he):V(he)?ae(he):he};default:return function(he){for(let ue=0;ue<me.length;ue++)if(J[ue](he))return me[ue](he);return he}}}function G(O){function $(V,Z,ae){if(Z<V.length){const J=V[Z];let me=[];if(J.restParam){const le=J.types.filter(T);le.length<J.types.length&&me.push({types:le,name:"..."+le.map(he=>he.name).join("|"),hasAny:le.some(he=>he.isAny),hasConversion:!1,restParam:!0}),me.push(J)}else me=J.types.map(function(le){return{types:[le],name:le.name,hasAny:le.isAny,hasConversion:le.conversion,restParam:!1}});return W(me,function(le){return $(V,Z+1,ae.concat([le]))})}else return[ae]}return $(O,0,[])}function X(O,$){const V=Math.max(O.length,$.length);for(let le=0;le<V;le++){const he=A(O,le),ue=A($,le);let We=!1,ot;for(ot of ue)if(he.has(ot)){We=!0;break}if(!We)return!1}const Z=O.length,ae=$.length,J=w(O),me=w($);return J?me?Z===ae:ae>=Z:me?Z>=ae:Z===ae}function P(O){return O.map($=>Se($)?ve($.referToSelf.callback):De($)?de($.referTo.references,$.referTo.callback):$)}function j(O,$,V){const Z=[];let ae;for(ae of O){let J=V[ae];if(typeof J!="number")throw new TypeError('No definition for referenced signature "'+ae+'"');if(J=$[J],typeof J!="function")return!1;Z.push(J)}return Z}function H(O,$,V){const Z=P(O),ae=new Array(Z.length).fill(!1);let J=!0;for(;J;){J=!1;let me=!0;for(let le=0;le<Z.length;++le){if(ae[le])continue;const he=Z[le];if(Se(he))Z[le]=he.referToSelf.callback(V),Z[le].referToSelf=he.referToSelf,ae[le]=!0,me=!1;else if(De(he)){const ue=j(he.referTo.references,Z,$);ue?(Z[le]=he.referTo.callback.apply(this,ue),Z[le].referTo=he.referTo,ae[le]=!0,me=!1):J=!0}}if(me&&J)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return Z}function k(O){const $=/\bthis(\(|\.signatures\b)/;Object.keys(O).forEach(V=>{const Z=O[V];if($.test(Z.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function q(O,$){if(o.createCount++,Object.keys($).length===0)throw new SyntaxError("No signatures provided");o.warnAgainstDeprecatedThis&&k($);const V=[],Z=[],ae={},J=[];let me;for(me in $){if(!Object.prototype.hasOwnProperty.call($,me))continue;const Ze=S(me);if(!Ze)continue;V.forEach(function(gl){if(X(gl,Ze))throw new TypeError('Conflicting signatures "'+D(gl)+'" and "'+D(Ze)+'".')}),V.push(Ze);const Sn=Z.length;Z.push($[me]);const IR=Ze.map(g);let Rf;for(Rf of G(IR)){const gl=D(Rf);J.push({params:Rf,name:gl,fn:Sn}),Rf.every($R=>!$R.hasConversion)&&(ae[gl]=Sn)}}J.sort(N);const le=H(Z,ae,pl);let he;for(he in ae)Object.prototype.hasOwnProperty.call(ae,he)&&(ae[he]=le[ae[he]]);const ue=[],We=new Map;for(he of J)We.has(he.name)||(he.fn=le[he.fn],ue.push(he),We.set(he.name,he));const ot=ue[0]&&ue[0].params.length<=2&&!w(ue[0].params),Ft=ue[1]&&ue[1].params.length<=2&&!w(ue[1].params),Dn=ue[2]&&ue[2].params.length<=2&&!w(ue[2].params),un=ue[3]&&ue[3].params.length<=2&&!w(ue[3].params),lr=ue[4]&&ue[4].params.length<=2&&!w(ue[4].params),sr=ue[5]&&ue[5].params.length<=2&&!w(ue[5].params),Uo=ot&&Ft&&Dn&&un&&lr&&sr;for(let Ze=0;Ze<ue.length;++Ze)ue[Ze].test=E(ue[Ze].params);const Nf=ot?b(ue[0].params[0]):Xn,sR=Ft?b(ue[1].params[0]):Xn,cR=Dn?b(ue[2].params[0]):Xn,fR=un?b(ue[3].params[0]):Xn,dR=lr?b(ue[4].params[0]):Xn,hR=sr?b(ue[5].params[0]):Xn,mR=ot?b(ue[0].params[1]):Xn,pR=Ft?b(ue[1].params[1]):Xn,gR=Dn?b(ue[2].params[1]):Xn,vR=un?b(ue[3].params[1]):Xn,yR=lr?b(ue[4].params[1]):Xn,bR=sr?b(ue[5].params[1]):Xn;for(let Ze=0;Ze<ue.length;++Ze)ue[Ze].implementation=I(ue[Ze].params,ue[Ze].fn);const DR=ot?ue[0].implementation:uo,SR=Ft?ue[1].implementation:uo,xR=Dn?ue[2].implementation:uo,wR=un?ue[3].implementation:uo,ER=lr?ue[4].implementation:uo,AR=sr?ue[5].implementation:uo,CR=ot?ue[0].params.length:-1,TR=Ft?ue[1].params.length:-1,MR=Dn?ue[2].params.length:-1,_R=un?ue[3].params.length:-1,BR=lr?ue[4].params.length:-1,FR=sr?ue[5].params.length:-1,NR=Uo?6:0,RR=ue.length,OR=ue.map(Ze=>Ze.test),zR=ue.map(Ze=>Ze.implementation),UR=function(){for(let Sn=NR;Sn<RR;Sn++)if(OR[Sn](arguments))return zR[Sn].apply(this,arguments);return o.onMismatch(O,arguments,ue)};function pl(Ze,Sn){return arguments.length===CR&&Nf(Ze)&&mR(Sn)?DR.apply(this,arguments):arguments.length===TR&&sR(Ze)&&pR(Sn)?SR.apply(this,arguments):arguments.length===MR&&cR(Ze)&&gR(Sn)?xR.apply(this,arguments):arguments.length===_R&&fR(Ze)&&vR(Sn)?wR.apply(this,arguments):arguments.length===BR&&dR(Ze)&&yR(Sn)?ER.apply(this,arguments):arguments.length===FR&&hR(Ze)&&bR(Sn)?AR.apply(this,arguments):UR.apply(this,arguments)}try{Object.defineProperty(pl,"name",{value:O})}catch{}return pl.signatures=ae,pl._typedFunctionData={signatures:ue,signatureMap:We},pl}function Y(O,$,V){throw x(O,$,V)}function ee(O){return ne(O,0,O.length-1)}function te(O){return O[O.length-1]}function ne(O,$,V){return Array.prototype.slice.call(O,$,V)}function oe(O,$){for(let V=0;V<O.length;V++)if($(O[V]))return O[V]}function W(O,$){return Array.prototype.concat.apply([],O.map($))}function ce(){const O=ee(arguments).map(V=>D(S(V))),$=te(arguments);if(typeof $!="function")throw new TypeError("Callback function expected as last argument");return de(O,$)}function de(O,$){return{referTo:{references:O,callback:$}}}function ve(O){if(typeof O!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:O}}}function De(O){return O&&typeof O.referTo=="object"&&Array.isArray(O.referTo.references)&&typeof O.referTo.callback=="function"}function Se(O){return O&&typeof O.referToSelf=="object"&&typeof O.referToSelf.callback=="function"}function Ee(O,$){if(!O)return $;if($&&$!==O){const V=new Error("Function names do not match (expected: "+O+", actual: "+$+")");throw V.data={actual:$,expected:O},V}return O}function Re(O){let $;for(const V in O)Object.prototype.hasOwnProperty.call(O,V)&&(d(O[V])||typeof O[V].signature=="string")&&($=Ee($,O[V].name));return $}function Ce(O,$){let V;for(V in $)if(Object.prototype.hasOwnProperty.call($,V)){if(V in O&&$[V]!==O[V]){const Z=new Error('Signature "'+V+'" is defined twice');throw Z.data={signature:V,sourceFunction:$[V],destFunction:O[V]},Z}O[V]=$[V]}}const Ne=o;o=function(O){const $=typeof O=="string",V=$?1:0;let Z=$?O:"";const ae={};for(let J=V;J<arguments.length;++J){const me=arguments[J];let le={},he;if(typeof me=="function"?(he=me.name,typeof me.signature=="string"?le[me.signature]=me:d(me)&&(le=me.signatures)):e(me)&&(le=me,$||(he=Re(me))),Object.keys(le).length===0){const ue=new TypeError("Argument to 'typed' at index "+J+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw ue.data={index:J,argument:me},ue}$||(Z=Ee(Z,he)),Ce(ae,le)}return q(Z||"",ae)},o.create=zy,o.createCount=Ne.createCount,o.onMismatch=Y,o.throwMismatchError=Y,o.createError=x,o.clear=s,o.clearConversions=c,o.addTypes=l,o._findType=u,o.referTo=ce,o.referToSelf=ve,o.convert=m,o.findSignature=h,o.find=v,o.isTypedFunction=d,o.warnAgainstDeprecatedThis=!0,o.addType=function(O,$){let V="any";$!==!1&&r.has("Object")&&(V="Object"),o.addTypes([O],V)};function pe(O){if(!O||typeof O.from!="string"||typeof O.to!="string"||typeof O.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(O.to===O.from)throw new SyntaxError('Illegal to define conversion from "'+O.from+'" to itself.')}return o.addConversion=function(O){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};pe(O);const V=u(O.to),Z=V.conversionsTo.find(ae=>ae.from===O.from);if(Z)if($&&$.override)o.removeConversion({from:Z.from,to:O.to,convert:Z.convert});else throw new Error('There is already a conversion from "'+O.from+'" to "'+V.name+'"');V.conversionsTo.push({from:O.from,convert:O.convert,index:a++})},o.addConversions=function(O,$){O.forEach(V=>o.addConversion(V,$))},o.removeConversion=function(O){pe(O);const $=u(O.to),V=oe($.conversionsTo,ae=>ae.from===O.from);if(!V)throw new Error("Attempt to remove nonexistent conversion from "+O.from+" to "+O.to);if(V.convert!==O.convert)throw new Error("Conversion to remove does not match existing conversion");const Z=$.conversionsTo.indexOf(V);$.conversionsTo.splice(Z,1)},o.resolve=function(O,$){if(!d(O))throw new TypeError(Oy);const V=O._typedFunctionData.signatures;for(let Z=0;Z<V.length;++Z)if(V[Z].test($))return V[Z];return null},o}const Vs=zy();function se(e,t,n,r){function i(a){var o=xC(a,t.map(TC));return AC(e,t,a),n(o)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function AC(e,t,n){var r=t.filter(a=>!CC(a)).every(a=>n[a]!==void 0);if(!r){var i=t.filter(a=>n[a]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function CC(e){return e&&e[0]==="?"}function TC(e){return e&&e[0]==="?"?e.slice(1):e}function it(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function MC(e,t){if(t.number==="bigint")try{BigInt(e)}catch{return t.numberFallback}return t.number}var _C=Math.sign||function(e){return e>0?1:e<0?-1:0};function bh(e,t,n){var r={2:"0b",8:"0o",16:"0x"},i=r[t],a="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!it(n))throw new Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!it(e))throw new Error("Value must be an integer");e<0&&(e=e+2**n),a="i".concat(n)}var o="";return e<0&&(e=-e,o="-"),"".concat(o).concat(i).concat(e.toString(t)).concat(a)}function Dh(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:n,precision:r,wordSize:i}=Uy(t);switch(n){case"fixed":return FC(e,r);case"exponential":return Iy(e,r);case"engineering":return BC(e,r);case"bin":return bh(e,2,i);case"oct":return bh(e,8,i);case"hex":return bh(e,16,i);case"auto":return NC(e,r,t).replace(/((\.\d*?)(0+))($|e)/,function(){var a=arguments[2],o=arguments[4];return a!=="."?a+o:o});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Uy(e){var t="auto",n,r;if(e!==void 0)if(et(e))n=e;else if(vt(e))n=e.toNumber();else if(yh(e))e.precision!==void 0&&(n=$y(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(r=$y(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(t=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:t,precision:n,wordSize:r}}function Gs(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var n=t[1],r=t[2],i=parseFloat(t[4]||"0"),a=r.indexOf(".");i+=a!==-1?a-1:r.length-1;var o=r.replace(".","").replace(/^0*/,function(u){return i-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return o.length===0&&(o.push(0),i++),{sign:n,coefficients:o,exponent:i}}function BC(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Gs(e),r=Ys(n,t),i=r.exponent,a=r.coefficients,o=i%3===0?i:i<0?i-3-i%3:i-i%3;if(et(t))for(;t>a.length||i-o+1>a.length;)a.push(0);else for(var u=Math.abs(i-o)-(a.length-1),l=0;l<u;l++)a.push(0);for(var s=Math.abs(i-o),c=1;s>0;)c++,s--;var f=a.slice(c).join(""),d=et(t)&&f.length||f.match(/[1-9]/)?"."+f:"",h=a.slice(0,c).join("")+d+"e"+(i>=0?"+":"")+o.toString();return r.sign+h}function FC(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Gs(e),r=typeof t=="number"?Ys(n,n.exponent+1+t):n,i=r.coefficients,a=r.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(lo(o-i.length))),a<0&&(i=lo(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,a===0?"0.":"."),r.sign+i.join("")}function Iy(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Gs(e),r=t?Ys(n,t):n,i=r.coefficients,a=r.exponent;i.length<t&&(i=i.concat(lo(t-i.length)));var o=i.shift();return r.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function NC(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=ky(n?.lowerExp,-3),i=ky(n?.upperExp,5),a=Gs(e),o=t?Ys(a,t):a;if(o.exponent<r||o.exponent>=i)return Iy(e,t);var u=o.coefficients,l=o.exponent;u.length<t&&(u=u.concat(lo(t-u.length))),u=u.concat(lo(l-u.length+1+(u.length<t?t-u.length:0))),u=lo(-l).concat(u);var s=l>0?l:0;return s<u.length-1&&u.splice(s+1,0,"."),o.sign+u.join("")}function Ys(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t){var i=r.splice(t,r.length-t);if(i[0]>=5){var a=t-1;for(r[a]++;r[a]===10;)r.pop(),a===0&&(r.unshift(0),n.exponent++,a++),a--,r[a]++}}return n}function lo(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function RC(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}function Vr(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-8,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return isNaN(e)||isNaN(t)?!1:!isFinite(e)||!isFinite(t)?e===t:e===t?!0:Math.abs(e-t)<=Math.max(n*Math.max(Math.abs(e),Math.abs(t)),r)}function $y(e,t){if(et(e))return e;if(vt(e))return e.toNumber();t()}function ky(e,t){return et(e)?e:vt(e)?e.toNumber():t}var Ly=function(){return Ly=Vs.create,Vs},OC=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],zC=se("typed",OC,function(t){var{BigNumber:n,Complex:r,DenseMatrix:i,Fraction:a}=t,o=Ly();return o.clear(),o.addTypes([{name:"number",test:et},{name:"Complex",test:ph},{name:"BigNumber",test:vt},{name:"bigint",test:XA},{name:"Fraction",test:gh},{name:"Unit",test:My},{name:"identifier",test:u=>ar&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(u)},{name:"string",test:ar},{name:"Chain",test:DC},{name:"Array",test:ht},{name:"Matrix",test:Pe},{name:"DenseMatrix",test:_y},{name:"SparseMatrix",test:By},{name:"Range",test:Fy},{name:"Index",test:vh},{name:"boolean",test:ZA},{name:"ResultSet",test:QA},{name:"Help",test:KA},{name:"function",test:WA},{name:"Date",test:JA},{name:"RegExp",test:eC},{name:"null",test:nC},{name:"undefined",test:rC},{name:"AccessorNode",test:iC},{name:"ArrayNode",test:aC},{name:"AssignmentNode",test:oC},{name:"BlockNode",test:uC},{name:"ConditionalNode",test:lC},{name:"ConstantNode",test:sC},{name:"FunctionNode",test:fC},{name:"FunctionAssignmentNode",test:cC},{name:"IndexNode",test:dC},{name:"Node",test:hC},{name:"ObjectNode",test:mC},{name:"OperatorNode",test:pC},{name:"ParenthesisNode",test:gC},{name:"RangeNode",test:vC},{name:"RelationalNode",test:yC},{name:"SymbolNode",test:bC},{name:"Map",test:tC},{name:"Object",test:yh}]),o.addConversions([{from:"number",to:"BigNumber",convert:function(l){if(n||Xs(l),RC(l)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+l+"). Use function bignumber(x) to convert to BigNumber.");return new n(l)}},{from:"number",to:"Complex",convert:function(l){return r||Zs(l),new r(l,0)}},{from:"BigNumber",to:"Complex",convert:function(l){return r||Zs(l),new r(l.toNumber(),0)}},{from:"bigint",to:"number",convert:function(l){if(l>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+l+")");return Number(l)}},{from:"bigint",to:"BigNumber",convert:function(l){return n||Xs(l),new n(l.toString())}},{from:"bigint",to:"Fraction",convert:function(l){return a||Qs(l),new a(l)}},{from:"Fraction",to:"BigNumber",convert:function(l){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(l){return r||Zs(l),new r(l.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(l){a||Qs(l);var s=new a(l);if(s.valueOf()!==l)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+l+"). Use function fraction(x) to convert to Fraction.");return s}},{from:"string",to:"number",convert:function(l){var s=Number(l);if(isNaN(s))throw new Error('Cannot convert "'+l+'" to a number');return s}},{from:"string",to:"BigNumber",convert:function(l){n||Xs(l);try{return new n(l)}catch{throw new Error('Cannot convert "'+l+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(l){try{return BigInt(l)}catch{throw new Error('Cannot convert "'+l+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(l){a||Qs(l);try{return new a(l)}catch{throw new Error('Cannot convert "'+l+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(l){r||Zs(l);try{return new r(l)}catch{throw new Error('Cannot convert "'+l+'" to Complex')}}},{from:"boolean",to:"number",convert:function(l){return+l}},{from:"boolean",to:"BigNumber",convert:function(l){return n||Xs(l),new n(+l)}},{from:"boolean",to:"bigint",convert:function(l){return BigInt(+l)}},{from:"boolean",to:"Fraction",convert:function(l){return a||Qs(l),new a(+l)}},{from:"boolean",to:"string",convert:function(l){return String(l)}},{from:"Array",to:"Matrix",convert:function(l){return i||UC(),new i(l)}},{from:"Matrix",to:"Array",convert:function(l){return l.valueOf()}}]),o.onMismatch=(u,l,s)=>{var c=o.createError(u,l,s);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&Lu(l[0])&&s.some(d=>!d.params.includes(","))){var f=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw f.data=c.data,f}throw c},o.onMismatch=(u,l,s)=>{var c=o.createError(u,l,s);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&Lu(l[0])&&s.some(d=>!d.params.includes(","))){var f=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw f.data=c.data,f}throw c},o});function Xs(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Zs(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function UC(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Qs(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}/*!
|
|
70
58
|
* decimal.js v10.6.0
|
|
71
59
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
72
60
|
* https://github.com/MikeMcl/decimal.js
|
|
73
61
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
74
62
|
* MIT Licence
|
|
75
|
-
*/var Lo=9e15,Xi=1e9,Tm="0123456789abcdef",Ic="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",$c="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",_m={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Lo,maxE:Lo,crypto:!1},I2,ci,Ce=!0,kc="[DecimalError] ",Zi=kc+"Invalid argument: ",$2=kc+"Precision limit exceeded",k2=kc+"crypto unavailable",L2="[object Decimal]",ln=Math.floor,Ht=Math.pow,A6=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,C6=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,M6=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,j2=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,br=1e7,xe=7,T6=9007199254740991,_6=Ic.length-1,Bm=$c.length-1,ie={toStringTag:L2};ie.absoluteValue=ie.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),De(e)},ie.ceil=function(){return De(new this.constructor(this),this.e+1,2)},ie.clampedTo=ie.clamp=function(e,t){var n,r=this,i=r.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Zi+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new i(r)},ie.comparedTo=ie.cmp=function(e){var t,n,r,i,a=this,o=a.d,u=(e=new a.constructor(e)).d,l=a.s,s=e.s;if(!o||!u)return!l||!s?NaN:l!==s?l:o===u?0:!o^l<0?1:-1;if(!o[0]||!u[0])return o[0]?l:u[0]?-s:0;if(l!==s)return l;if(a.e!==e.e)return a.e>e.e^l<0?1:-1;for(r=o.length,i=u.length,t=0,n=r<i?r:i;t<n;++t)if(o[t]!==u[t])return o[t]>u[t]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1},ie.cosine=ie.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+xe,r.rounding=1,n=B6(r,Y2(r,n)),r.precision=e,r.rounding=t,De(ci==2||ci==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)},ie.cubeRoot=ie.cbrt=function(){var e,t,n,r,i,a,o,u,l,s,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(Ce=!1,a=c.s*Ht(c.s*c,1/3),!a||Math.abs(a)==1/0?(n=tn(c.d),e=c.e,(a=(e-n.length+1)%3)&&(n+=a==1||a==-2?"0":"00"),a=Ht(n,1/3),e=ln((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?n="5e"+e:(n=a.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new f(n),r.s=c.s):r=new f(a.toString()),o=(e=f.precision)+3;;)if(u=r,l=u.times(u).times(u),s=l.plus(c),r=ot(s.plus(c).times(u),s.plus(l),o+2,1),tn(u.d).slice(0,o)===(n=tn(r.d)).slice(0,o))if(n=n.slice(o-3,o+1),n=="9999"||!i&&n=="4999"){if(!i&&(De(u,e+1,0),u.times(u).times(u).eq(c))){r=u;break}o+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(De(r,e+1,1),t=!r.times(r).times(r).eq(c));break}return Ce=!0,De(r,e,f.rounding,t)},ie.decimalPlaces=ie.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-ln(this.e/xe))*xe,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},ie.dividedBy=ie.div=function(e){return ot(this,new this.constructor(e))},ie.dividedToIntegerBy=ie.divToInt=function(e){var t=this,n=t.constructor;return De(ot(t,new n(e),0,1,1),n.precision,n.rounding)},ie.equals=ie.eq=function(e){return this.cmp(e)===0},ie.floor=function(){return De(new this.constructor(this),this.e+1,3)},ie.greaterThan=ie.gt=function(e){return this.cmp(e)>0},ie.greaterThanOrEqualTo=ie.gte=function(e){var t=this.cmp(e);return t==1||t===0},ie.hyperbolicCosine=ie.cosh=function(){var e,t,n,r,i,a=this,o=a.constructor,u=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return u;n=o.precision,r=o.rounding,o.precision=n+Math.max(a.e,a.sd())+4,o.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),t=(1/qc(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),a=jo(o,1,a.times(t),new o(1),!0);for(var l,s=e,c=new o(8);s--;)l=a.times(a),a=u.minus(l.times(c.minus(l.times(c))));return De(a,o.precision=n,o.rounding=r,!0)},ie.hyperbolicSine=ie.sinh=function(){var e,t,n,r,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,r=i.d.length,r<3)i=jo(a,2,i,i,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,i=i.times(1/qc(5,e)),i=jo(a,2,i,i,!0);for(var o,u=new a(5),l=new a(16),s=new a(20);e--;)o=i.times(i),i=i.times(u.plus(o.times(l.times(o).plus(s))))}return a.precision=t,a.rounding=n,De(i,t,n,!0)},ie.hyperbolicTangent=ie.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,ot(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},ie.inverseCosine=ie.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return n!==-1?n===0?e.isNeg()?Or(t,r,i):new t(0):new t(NaN):e.isZero()?Or(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2))},ie.inverseHyperbolicCosine=ie.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,Ce=!1,n=n.times(n).minus(1).sqrt().plus(n),Ce=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},ie.inverseHyperbolicSine=ie.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,Ce=!1,n=n.times(n).plus(1).sqrt().plus(n),Ce=!0,r.precision=e,r.rounding=t,n.ln())},ie.inverseHyperbolicTangent=ie.atanh=function(){var e,t,n,r,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?De(new a(i),e,t,!0):(a.precision=n=r-i.e,i=ot(i.plus(1),new a(1).minus(i),n+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},ie.inverseSine=ie.asin=function(){var e,t,n,r,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),n=a.precision,r=a.rounding,t!==-1?t===0?(e=Or(a,n+4,r).times(.5),e.s=i.s,e):new a(NaN):(a.precision=n+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,i.times(2)))},ie.inverseTangent=ie.atan=function(){var e,t,n,r,i,a,o,u,l,s=this,c=s.constructor,f=c.precision,d=c.rounding;if(s.isFinite()){if(s.isZero())return new c(s);if(s.abs().eq(1)&&f+4<=Bm)return o=Or(c,f+4,d).times(.25),o.s=s.s,o}else{if(!s.s)return new c(NaN);if(f+4<=Bm)return o=Or(c,f+4,d).times(.5),o.s=s.s,o}for(c.precision=u=f+10,c.rounding=1,n=Math.min(28,u/xe+2|0),e=n;e;--e)s=s.div(s.times(s).plus(1).sqrt().plus(1));for(Ce=!1,t=Math.ceil(u/xe),r=1,l=s.times(s),o=new c(s),i=s;e!==-1;)if(i=i.times(l),a=o.minus(i.div(r+=2)),i=i.times(l),o=a.plus(i.div(r+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===a.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),Ce=!0,De(o,c.precision=f,c.rounding=d,!0)},ie.isFinite=function(){return!!this.d},ie.isInteger=ie.isInt=function(){return!!this.d&&ln(this.e/xe)>this.d.length-2},ie.isNaN=function(){return!this.s},ie.isNegative=ie.isNeg=function(){return this.s<0},ie.isPositive=ie.isPos=function(){return this.s>0},ie.isZero=function(){return!!this.d&&this.d[0]===0},ie.lessThan=ie.lt=function(e){return this.cmp(e)<0},ie.lessThanOrEqualTo=ie.lte=function(e){return this.cmp(e)<1},ie.logarithm=ie.log=function(e){var t,n,r,i,a,o,u,l,s=this,c=s.constructor,f=c.precision,d=c.rounding,h=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(n=s.d,s.s<0||!n||!n[0]||s.eq(1))return new c(n&&!n[0]?-1/0:s.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)a=!0;else{for(i=n[0];i%10===0;)i/=10;a=i!==1}if(Ce=!1,u=f+h,o=Qi(s,u),r=t?Pc(c,u+10):Qi(e,u),l=ot(o,r,u,1),bl(l.d,i=f,d))do if(u+=10,o=Qi(s,u),r=t?Pc(c,u+10):Qi(e,u),l=ot(o,r,u,1),!a){+tn(l.d).slice(i+1,i+15)+1==1e14&&(l=De(l,f+1,0));break}while(bl(l.d,i+=10,d));return Ce=!0,De(l,f,d)},ie.minus=ie.sub=function(e){var t,n,r,i,a,o,u,l,s,c,f,d,h=this,g=h.constructor;if(e=new g(e),!h.d||!e.d)return!h.s||!e.s?e=new g(NaN):h.d?e.s=-e.s:e=new g(e.d||h.s!==e.s?h:NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(s=h.d,d=e.d,u=g.precision,l=g.rounding,!s[0]||!d[0]){if(d[0])e.s=-e.s;else if(s[0])e=new g(h);else return new g(l===3?-0:0);return Ce?De(e,u,l):e}if(n=ln(e.e/xe),c=ln(h.e/xe),s=s.slice(),a=c-n,a){for(f=a<0,f?(t=s,a=-a,o=d.length):(t=d,n=c,o=s.length),r=Math.max(Math.ceil(u/xe),o)+2,a>r&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for(r=s.length,o=d.length,f=r<o,f&&(o=r),r=0;r<o;r++)if(s[r]!=d[r]){f=s[r]<d[r];break}a=0}for(f&&(t=s,s=d,d=t,e.s=-e.s),o=s.length,r=d.length-o;r>0;--r)s[o++]=0;for(r=d.length;r>a;){if(s[--r]<d[r]){for(i=r;i&&s[--i]===0;)s[i]=br-1;--s[i],s[r]+=br}s[r]-=d[r]}for(;s[--o]===0;)s.pop();for(;s[0]===0;s.shift())--n;return s[0]?(e.d=s,e.e=jc(s,n),Ce?De(e,u,l):e):new g(l===3?-0:0)},ie.modulo=ie.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?De(new r(n),r.precision,r.rounding):(Ce=!1,r.modulo==9?(t=ot(n,e.abs(),0,3,1),t.s*=e.s):t=ot(n,e,0,r.modulo,1),t=t.times(e),Ce=!0,n.minus(t))},ie.naturalExponential=ie.exp=function(){return Nm(this)},ie.naturalLogarithm=ie.ln=function(){return Qi(this)},ie.negated=ie.neg=function(){var e=new this.constructor(this);return e.s=-e.s,De(e)},ie.plus=ie.add=function(e){var t,n,r,i,a,o,u,l,s,c,f=this,d=f.constructor;if(e=new d(e),!f.d||!e.d)return!f.s||!e.s?e=new d(NaN):f.d||(e=new d(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(s=f.d,c=e.d,u=d.precision,l=d.rounding,!s[0]||!c[0])return c[0]||(e=new d(f)),Ce?De(e,u,l):e;if(a=ln(f.e/xe),r=ln(e.e/xe),s=s.slice(),i=a-r,i){for(i<0?(n=s,i=-i,o=c.length):(n=c,r=a,o=s.length),a=Math.ceil(u/xe),o=a>o?a+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=s.length,i=c.length,o-i<0&&(i=o,n=c,c=s,s=n),t=0;i;)t=(s[--i]=s[i]+c[i]+t)/br|0,s[i]%=br;for(t&&(s.unshift(t),++r),o=s.length;s[--o]==0;)s.pop();return e.d=s,e.e=jc(s,r),Ce?De(e,u,l):e},ie.precision=ie.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Zi+e);return n.d?(t=P2(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},ie.round=function(){var e=this,t=e.constructor;return De(new t(e),e.e+1,t.rounding)},ie.sine=ie.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+xe,r.rounding=1,n=F6(r,Y2(r,n)),r.precision=e,r.rounding=t,De(ci>2?n.neg():n,e,t,!0)):new r(NaN)},ie.squareRoot=ie.sqrt=function(){var e,t,n,r,i,a,o=this,u=o.d,l=o.e,s=o.s,c=o.constructor;if(s!==1||!u||!u[0])return new c(!s||s<0&&(!u||u[0])?NaN:u?o:1/0);for(Ce=!1,s=Math.sqrt(+o),s==0||s==1/0?(t=tn(u),(t.length+l)%2==0&&(t+="0"),s=Math.sqrt(t),l=ln((l+1)/2)-(l<0||l%2),s==1/0?t="5e"+l:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),r=new c(t)):r=new c(s.toString()),n=(l=c.precision)+3;;)if(a=r,r=a.plus(ot(o,a,n+2,1)).times(.5),tn(a.d).slice(0,n)===(t=tn(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!i&&t=="4999"){if(!i&&(De(a,l+1,0),a.times(a).eq(o))){r=a;break}n+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(De(r,l+1,1),e=!r.times(r).eq(o));break}return Ce=!0,De(r,l,c.rounding,e)},ie.tangent=ie.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=ot(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,De(ci==2||ci==4?n.neg():n,e,t,!0)):new r(NaN)},ie.times=ie.mul=function(e){var t,n,r,i,a,o,u,l,s,c=this,f=c.constructor,d=c.d,h=(e=new f(e)).d;if(e.s*=c.s,!d||!d[0]||!h||!h[0])return new f(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:!d||!h?e.s/0:e.s*0);for(n=ln(c.e/xe)+ln(e.e/xe),l=d.length,s=h.length,l<s&&(a=d,d=h,h=a,o=l,l=s,s=o),a=[],o=l+s,r=o;r--;)a.push(0);for(r=s;--r>=0;){for(t=0,i=l+r;i>r;)u=a[i]+h[r]*d[i-r-1]+t,a[i--]=u%br|0,t=u/br|0;a[i]=(a[i]+t)%br|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=jc(a,n),Ce?De(e,f.precision,f.rounding):e},ie.toBinary=function(e,t){return Fm(this,2,e,t)},ie.toDecimalPlaces=ie.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(wn(e,0,Xi),t===void 0?t=r.rounding:wn(t,0,8),De(n,e+n.e+1,t))},ie.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Rr(r,!0):(wn(e,0,Xi),t===void 0?t=i.rounding:wn(t,0,8),r=De(new i(r),e+1,t),n=Rr(r,!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},ie.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?n=Rr(i):(wn(e,0,Xi),t===void 0?t=a.rounding:wn(t,0,8),r=De(new a(i),e+i.e+1,t),n=Rr(r,!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},ie.toFraction=function(e){var t,n,r,i,a,o,u,l,s,c,f,d,h=this,g=h.d,m=h.constructor;if(!g)return new m(h);if(s=n=new m(1),r=l=new m(0),t=new m(r),a=t.e=P2(g)-h.e-1,o=a%xe,t.d[0]=Ht(10,o<0?xe+o:o),e==null)e=a>0?t:s;else{if(u=new m(e),!u.isInt()||u.lt(s))throw Error(Zi+u);e=u.gt(t)?a>0?t:s:u}for(Ce=!1,u=new m(tn(g)),c=m.precision,m.precision=a=g.length*xe*2;f=ot(u,t,0,1,1),i=n.plus(f.times(r)),i.cmp(e)!=1;)n=r,r=i,i=s,s=l.plus(f.times(i)),l=i,i=t,t=u.minus(f.times(i)),u=i;return i=ot(e.minus(n),r,0,1,1),l=l.plus(i.times(s)),n=n.plus(i.times(r)),l.s=s.s=h.s,d=ot(s,r,a,1).minus(h).abs().cmp(ot(l,n,a,1).minus(h).abs())<1?[s,r]:[l,n],m.precision=c,Ce=!0,d},ie.toHexadecimal=ie.toHex=function(e,t){return Fm(this,16,e,t)},ie.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:wn(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(Ce=!1,n=ot(n,e,0,t,1).times(e),Ce=!0,De(n)):(e.s=n.s,n=e),n},ie.toNumber=function(){return+this},ie.toOctal=function(e,t){return Fm(this,8,e,t)},ie.toPower=ie.pow=function(e){var t,n,r,i,a,o,u=this,l=u.constructor,s=+(e=new l(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new l(Ht(+u,s));if(u=new l(u),u.eq(1))return u;if(r=l.precision,a=l.rounding,e.eq(1))return De(u,r,a);if(t=ln(e.e/xe),t>=e.d.length-1&&(n=s<0?-s:s)<=T6)return i=H2(l,u,n,r),e.s<0?new l(1).div(i):De(i,r,a);if(o=u.s,o<0){if(t<e.d.length-1)return new l(NaN);if(e.d[t]&1||(o=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=o,u}return n=Ht(+u,s),t=n==0||!isFinite(n)?ln(s*(Math.log("0."+tn(u.d))/Math.LN10+u.e+1)):new l(n+"").e,t>l.maxE+1||t<l.minE-1?new l(t>0?o/0:0):(Ce=!1,l.rounding=u.s=1,n=Math.min(12,(t+"").length),i=Nm(e.times(Qi(u,r+n)),r),i.d&&(i=De(i,r+5,1),bl(i.d,r,a)&&(t=r+10,i=De(Nm(e.times(Qi(u,t+n)),t),t+5,1),+tn(i.d).slice(r+1,r+15)+1==1e14&&(i=De(i,r+1,0)))),i.s=o,Ce=!0,l.rounding=a,De(i,r,a))},ie.toPrecision=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Rr(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(wn(e,1,Xi),t===void 0?t=i.rounding:wn(t,0,8),r=De(new i(r),e,t),n=Rr(r,e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},ie.toSignificantDigits=ie.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(wn(e,1,Xi),t===void 0?t=r.rounding:wn(t,0,8)),De(new r(n),e,t)},ie.toString=function(){var e=this,t=e.constructor,n=Rr(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},ie.truncated=ie.trunc=function(){return De(new this.constructor(this),this.e+1,1)},ie.valueOf=ie.toJSON=function(){var e=this,t=e.constructor,n=Rr(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function tn(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=xe-r.length,n&&(a+=Ki(n)),a+=r;o=e[t],r=o+"",n=xe-r.length,n&&(a+=Ki(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}function wn(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Zi+e)}function bl(e,t,n,r){var i,a,o,u;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=xe,i=0):(i=Math.ceil((t+1)/xe),t%=xe),a=Ht(10,xe-t),u=e[i]%a|0,r==null?t<3?(t==0?u=u/100|0:t==1&&(u=u/10|0),o=n<4&&u==99999||n>3&&u==49999||u==5e4||u==0):o=(n<4&&u+1==a||n>3&&u+1==a/2)&&(e[i+1]/a/100|0)==Ht(10,t-2)-1||(u==a/2||u==0)&&(e[i+1]/a/100|0)==0:t<4?(t==0?u=u/1e3|0:t==1?u=u/100|0:t==2&&(u=u/10|0),o=(r||n<4)&&u==9999||!r&&n>3&&u==4999):o=((r||n<4)&&u+1==a||!r&&n>3&&u+1==a/2)&&(e[i+1]/a/1e3|0)==Ht(10,t-3)-1,o}function Lc(e,t,n){for(var r,i=[0],a,o=0,u=e.length;o<u;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=Tm.indexOf(e.charAt(o++)),r=0;r<i.length;r++)i[r]>n-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function B6(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),i=(1/qc(4,n)).toString()):(n=16,i="2.3283064365386962890625e-10"),e.precision+=n,t=jo(e,1,t.times(i),new e(1));for(var a=n;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var ot=function(){function e(r,i,a){var o,u=0,l=r.length;for(r=r.slice();l--;)o=r[l]*i+u,r[l]=o%a|0,u=o/a|0;return u&&r.unshift(u),r}function t(r,i,a,o){var u,l;if(a!=o)l=a>o?1:-1;else for(u=l=0;u<a;u++)if(r[u]!=i[u]){l=r[u]>i[u]?1:-1;break}return l}function n(r,i,a,o){for(var u=0;a--;)r[a]-=u,u=r[a]<i[a]?1:0,r[a]=u*o+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o,u,l){var s,c,f,d,h,g,m,D,p,v,y,w,E,b,S,A,C,M,T,x,N=r.constructor,R=r.s==i.s?1:-1,z=r.d,F=i.d;if(!z||!z[0]||!F||!F[0])return new N(!r.s||!i.s||(z?F&&z[0]==F[0]:!F)?NaN:z&&z[0]==0||!F?R*0:R/0);for(l?(h=1,c=r.e-i.e):(l=br,h=xe,c=ln(r.e/h)-ln(i.e/h)),T=F.length,C=z.length,p=new N(R),v=p.d=[],f=0;F[f]==(z[f]||0);f++);if(F[f]>(z[f]||0)&&c--,a==null?(b=a=N.precision,o=N.rounding):u?b=a+(r.e-i.e)+1:b=a,b<0)v.push(1),g=!0;else{if(b=b/h+2|0,f=0,T==1){for(d=0,F=F[0],b++;(f<C||d)&&b--;f++)S=d*l+(z[f]||0),v[f]=S/F|0,d=S%F|0;g=d||f<C}else{for(d=l/(F[0]+1)|0,d>1&&(F=e(F,d,l),z=e(z,d,l),T=F.length,C=z.length),A=T,y=z.slice(0,T),w=y.length;w<T;)y[w++]=0;x=F.slice(),x.unshift(0),M=F[0],F[1]>=l/2&&++M;do d=0,s=t(F,y,T,w),s<0?(E=y[0],T!=w&&(E=E*l+(y[1]||0)),d=E/M|0,d>1?(d>=l&&(d=l-1),m=e(F,d,l),D=m.length,w=y.length,s=t(m,y,D,w),s==1&&(d--,n(m,T<D?x:F,D,l))):(d==0&&(s=d=1),m=F.slice()),D=m.length,D<w&&m.unshift(0),n(y,m,w,l),s==-1&&(w=y.length,s=t(F,y,T,w),s<1&&(d++,n(y,T<w?x:F,w,l))),w=y.length):s===0&&(d++,y=[0]),v[f++]=d,s&&y[0]?y[w++]=z[A]||0:(y=[z[A]],w=1);while((A++<C||y[0]!==void 0)&&b--);g=y[0]!==void 0}v[0]||v.shift()}if(h==1)p.e=c,I2=g;else{for(f=1,d=v[0];d>=10;d/=10)f++;p.e=f+c*h-1,De(p,u?a+p.e+1:a,o,g)}return p}}();function De(e,t,n,r){var i,a,o,u,l,s,c,f,d,h=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(i=1,u=f[0];u>=10;u/=10)i++;if(a=t-i,a<0)a+=xe,o=t,c=f[d=0],l=c/Ht(10,i-o-1)%10|0;else if(d=Math.ceil((a+1)/xe),u=f.length,d>=u)if(r){for(;u++<=d;)f.push(0);c=l=0,i=1,a%=xe,o=a-xe+1}else break e;else{for(c=u=f[d],i=1;u>=10;u/=10)i++;a%=xe,o=a-xe+i,l=o<0?0:c/Ht(10,i-o-1)%10|0}if(r=r||t<0||f[d+1]!==void 0||(o<0?c:c%Ht(10,i-o-1)),s=n<4?(l||r)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||r||n==6&&(a>0?o>0?c/Ht(10,i-o):0:f[d-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,s?(t-=e.e+1,f[0]=Ht(10,(xe-t%xe)%xe),e.e=-t||0):f[0]=e.e=0,e;if(a==0?(f.length=d,u=1,d--):(f.length=d+1,u=Ht(10,xe-a),f[d]=o>0?(c/Ht(10,i-o)%Ht(10,o)|0)*u:0),s)for(;;)if(d==0){for(a=1,o=f[0];o>=10;o/=10)a++;for(o=f[0]+=u,u=1;o>=10;o/=10)u++;a!=u&&(e.e++,f[0]==br&&(f[0]=1));break}else{if(f[d]+=u,f[d]!=br)break;f[d--]=0,u=1}for(a=f.length;f[--a]===0;)f.pop()}return Ce&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e<h.minE&&(e.e=0,e.d=[0])),e}function Rr(e,t,n){if(!e.isFinite())return V2(e);var r,i=e.e,a=tn(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Ki(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+Ki(-i-1)+a,n&&(r=n-o)>0&&(a+=Ki(r))):i>=o?(a+=Ki(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Ki(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Ki(r))),a}function jc(e,t){var n=e[0];for(t*=xe;n>=10;n/=10)t++;return t}function Pc(e,t,n){if(t>_6)throw Ce=!0,n&&(e.precision=n),Error($2);return De(new e(Ic),t,1,!0)}function Or(e,t,n){if(t>Bm)throw Error($2);return De(new e($c),t,n,!0)}function P2(e){var t=e.length-1,n=t*xe+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Ki(e){for(var t="";e--;)t+="0";return t}function H2(e,t,n,r){var i,a=new e(1),o=Math.ceil(r/xe+4);for(Ce=!1;;){if(n%2&&(a=a.times(t),X2(a.d,o)&&(i=!0)),n=ln(n/2),n===0){n=a.d.length-1,i&&a.d[n]===0&&++a.d[n];break}t=t.times(t),X2(t.d,o)}return Ce=!0,a}function q2(e){return e.d[e.d.length-1]&1}function G2(e,t,n){for(var r,i,a=new e(t[0]),o=0;++o<t.length;){if(i=new e(t[o]),!i.s){a=i;break}r=a.cmp(i),(r===n||r===0&&a.s===n)&&(a=i)}return a}function Nm(e,t){var n,r,i,a,o,u,l,s=0,c=0,f=0,d=e.constructor,h=d.rounding,g=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(Ce=!1,l=g):l=t,u=new d(.03125);e.e>-2;)e=e.times(u),f+=5;for(r=Math.log(Ht(2,f))/Math.LN10*2+5|0,l+=r,n=a=o=new d(1),d.precision=l;;){if(a=De(a.times(e),l,1),n=n.times(++c),u=o.plus(ot(a,n,l,1)),tn(u.d).slice(0,l)===tn(o.d).slice(0,l)){for(i=f;i--;)o=De(o.times(o),l,1);if(t==null)if(s<3&&bl(o.d,l-r,h,s))d.precision=l+=10,n=a=u=new d(1),c=0,s++;else return De(o,d.precision=g,h,Ce=!0);else return d.precision=g,o}o=u}}function Qi(e,t){var n,r,i,a,o,u,l,s,c,f,d,h=1,g=10,m=e,D=m.d,p=m.constructor,v=p.rounding,y=p.precision;if(m.s<0||!D||!D[0]||!m.e&&D[0]==1&&D.length==1)return new p(D&&!D[0]?-1/0:m.s!=1?NaN:D?0:m);if(t==null?(Ce=!1,c=y):c=t,p.precision=c+=g,n=tn(D),r=n.charAt(0),Math.abs(a=m.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=tn(m.d),r=n.charAt(0),h++;a=m.e,r>1?(m=new p("0."+n),a++):m=new p(r+"."+n.slice(1))}else return s=Pc(p,c+2,y).times(a+""),m=Qi(new p(r+"."+n.slice(1)),c-g).plus(s),p.precision=y,t==null?De(m,y,v,Ce=!0):m;for(f=m,l=o=m=ot(m.minus(1),m.plus(1),c,1),d=De(m.times(m),c,1),i=3;;){if(o=De(o.times(d),c,1),s=l.plus(ot(o,new p(i),c,1)),tn(s.d).slice(0,c)===tn(l.d).slice(0,c))if(l=l.times(2),a!==0&&(l=l.plus(Pc(p,c+2,y).times(a+""))),l=ot(l,new p(h),c,1),t==null)if(bl(l.d,c-g,v,u))p.precision=c+=g,s=o=m=ot(f.minus(1),f.plus(1),c,1),d=De(m.times(m),c,1),i=u=1;else return De(l,p.precision=y,v,Ce=!0);else return p.precision=y,l;l=s,i+=2}}function V2(e){return String(e.s*e.s/0)}function Hc(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(r,i),t){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%xe,n<0&&(r+=xe),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=xe;r<i;)e.d.push(+t.slice(r,r+=xe));t=t.slice(r),r=xe-t.length}else r-=i;for(;r--;)t+="0";e.d.push(+t),Ce&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function N6(e,t){var n,r,i,a,o,u,l,s,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),j2.test(t))return Hc(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(C6.test(t))n=16,t=t.toLowerCase();else if(A6.test(t))n=2;else if(M6.test(t))n=8;else throw Error(Zi+t);for(a=t.search(/p/i),a>0?(l=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf("."),o=a>=0,r=e.constructor,o&&(t=t.replace(".",""),u=t.length,a=u-a,i=H2(r,new r(n),a,a*2)),s=Lc(t,n,br),c=s.length-1,a=c;s[a]===0;--a)s.pop();return a<0?new r(e.s*0):(e.e=jc(s,c),e.d=s,Ce=!1,o&&(e=ot(e,i,u*4)),l&&(e=e.times(Math.abs(l)<54?Ht(2,l):Po.pow(2,l))),Ce=!0,e)}function F6(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:jo(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/qc(5,n)),t=jo(e,2,t,t);for(var i,a=new e(5),o=new e(16),u=new e(20);n--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(u))));return t}function jo(e,t,n,r,i){var a,o,u,l,s=e.precision,c=Math.ceil(s/xe);for(Ce=!1,l=n.times(n),u=new e(r);;){if(o=ot(u.times(l),new e(t++*t++),s,1),u=i?r.plus(o):r.minus(o),r=ot(o.times(l),new e(t++*t++),s,1),o=u.plus(r),o.d[c]!==void 0){for(a=c;o.d[a]===u.d[a]&&a--;);if(a==-1)break}a=u,u=r,r=o,o=a}return Ce=!0,o.d.length=c+1,o}function qc(e,t){for(var n=e;--t;)n*=e;return n}function Y2(e,t){var n,r=t.s<0,i=Or(e,e.precision,1),a=i.times(.5);if(t=t.abs(),t.lte(a))return ci=r?4:1,t;if(n=t.divToInt(i),n.isZero())ci=r?3:2;else{if(t=t.minus(n.times(i)),t.lte(a))return ci=q2(n)?r?2:3:r?4:1,t;ci=q2(n)?r?1:4:r?3:2}return t.minus(i).abs()}function Fm(e,t,n,r){var i,a,o,u,l,s,c,f,d,h=e.constructor,g=n!==void 0;if(g?(wn(n,1,Xi),r===void 0?r=h.rounding:wn(r,0,8)):(n=h.precision,r=h.rounding),!e.isFinite())c=V2(e);else{for(c=Rr(e),o=c.indexOf("."),g?(i=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):i=t,o>=0&&(c=c.replace(".",""),d=new h(1),d.e=c.length-o,d.d=Lc(Rr(d),10,i),d.e=d.d.length),f=Lc(c,10,i),a=l=f.length;f[--l]==0;)f.pop();if(!f[0])c=g?"0p+0":"0";else{if(o<0?a--:(e=new h(e),e.d=f,e.e=a,e=ot(e,d,n,r,0,i),f=e.d,a=e.e,s=I2),o=f[n],u=i/2,s=s||f[n+1]!==void 0,s=r<4?(o!==void 0||s)&&(r===0||r===(e.s<0?3:2)):o>u||o===u&&(r===4||s||r===6&&f[n-1]&1||r===(e.s<0?8:7)),f.length=n,s)for(;++f[--n]>i-1;)f[n]=0,n||(++a,f.unshift(1));for(l=f.length;!f[l-1];--l);for(o=0,c="";o<l;o++)c+=Tm.charAt(f[o]);if(g){if(l>1)if(t==16||t==8){for(o=t==16?4:3,--l;l%o;l++)c+="0";for(f=Lc(c,i,t),l=f.length;!f[l-1];--l);for(o=1,c="1.";o<l;o++)c+=Tm.charAt(f[o])}else c=c.charAt(0)+"."+c.slice(1);c=c+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)c="0"+c;c="0."+c}else if(++a>l)for(a-=l;a--;)c+="0";else a<l&&(c=c.slice(0,a)+"."+c.slice(a))}c=(t==16?"0x":t==2?"0b":t==8?"0o":"")+c}return e.s<0?"-"+c:c}function X2(e,t){if(e.length>t)return e.length=t,!0}function R6(e){return new this(e).abs()}function O6(e){return new this(e).acos()}function z6(e){return new this(e).acosh()}function U6(e,t){return new this(e).plus(t)}function I6(e){return new this(e).asin()}function $6(e){return new this(e).asinh()}function k6(e){return new this(e).atan()}function L6(e){return new this(e).atanh()}function j6(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,a=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=Or(this,a,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?Or(this,r,i):new this(0),n.s=e.s):!e.d||t.isZero()?(n=Or(this,a,1).times(.5),n.s=e.s):t.s<0?(this.precision=a,this.rounding=1,n=this.atan(ot(e,t,a,1)),t=Or(this,a,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(ot(e,t,a,1)),n}function P6(e){return new this(e).cbrt()}function H6(e){return De(e=new this(e),e.e+1,2)}function q6(e,t,n){return new this(e).clamp(t,n)}function G6(e){if(!e||typeof e!="object")throw Error(kc+"Object expected");var t,n,r,i=e.defaults===!0,a=["precision",1,Xi,"rounding",0,8,"toExpNeg",-Lo,0,"toExpPos",0,Lo,"maxE",0,Lo,"minE",-Lo,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(n=a[t],i&&(this[n]=_m[n]),(r=e[n])!==void 0)if(ln(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(Zi+n+": "+r);if(n="crypto",i&&(this[n]=_m[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(k2);else this[n]=!1;else throw Error(Zi+n+": "+r);return this}function V6(e){return new this(e).cos()}function Y6(e){return new this(e).cosh()}function Z2(e){var t,n,r;function i(a){var o,u,l,s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,K2(a)){s.s=a.s,Ce?!a.d||a.e>i.maxE?(s.e=NaN,s.d=null):a.e<i.minE?(s.e=0,s.d=[0]):(s.e=a.e,s.d=a.d.slice()):(s.e=a.e,s.d=a.d?a.d.slice():a.d);return}if(l=typeof a,l==="number"){if(a===0){s.s=1/a<0?-1:1,s.e=0,s.d=[0];return}if(a<0?(a=-a,s.s=-1):s.s=1,a===~~a&&a<1e7){for(o=0,u=a;u>=10;u/=10)o++;Ce?o>i.maxE?(s.e=NaN,s.d=null):o<i.minE?(s.e=0,s.d=[0]):(s.e=o,s.d=[a]):(s.e=o,s.d=[a]);return}if(a*0!==0){a||(s.s=NaN),s.e=NaN,s.d=null;return}return Hc(s,a.toString())}if(l==="string")return(u=a.charCodeAt(0))===45?(a=a.slice(1),s.s=-1):(u===43&&(a=a.slice(1)),s.s=1),j2.test(a)?Hc(s,a):N6(s,a);if(l==="bigint")return a<0?(a=-a,s.s=-1):s.s=1,Hc(s,a.toString());throw Error(Zi+a)}if(i.prototype=ie,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=G6,i.clone=Z2,i.isDecimal=K2,i.abs=R6,i.acos=O6,i.acosh=z6,i.add=U6,i.asin=I6,i.asinh=$6,i.atan=k6,i.atanh=L6,i.atan2=j6,i.cbrt=P6,i.ceil=H6,i.clamp=q6,i.cos=V6,i.cosh=Y6,i.div=X6,i.exp=Z6,i.floor=K6,i.hypot=Q6,i.ln=W6,i.log=J6,i.log10=t8,i.log2=e8,i.max=n8,i.min=r8,i.mod=i8,i.mul=a8,i.pow=o8,i.random=u8,i.round=l8,i.sign=s8,i.sin=c8,i.sinh=f8,i.sqrt=d8,i.sub=h8,i.sum=m8,i.tan=p8,i.tanh=g8,i.trunc=v8,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function X6(e,t){return new this(e).div(t)}function Z6(e){return new this(e).exp()}function K6(e){return De(e=new this(e),e.e+1,3)}function Q6(){var e,t,n=new this(0);for(Ce=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return Ce=!0,new this(1/0);n=t}return Ce=!0,n.sqrt()}function K2(e){return e instanceof Po||e&&e.toStringTag===L2||!1}function W6(e){return new this(e).ln()}function J6(e,t){return new this(e).log(t)}function e8(e){return new this(e).log(2)}function t8(e){return new this(e).log(10)}function n8(){return G2(this,arguments,-1)}function r8(){return G2(this,arguments,1)}function i8(e,t){return new this(e).mod(t)}function a8(e,t){return new this(e).mul(t)}function o8(e,t){return new this(e).pow(t)}function u8(e){var t,n,r,i,a=0,o=new this(1),u=[];if(e===void 0?e=this.precision:wn(e,1,Xi),r=Math.ceil(e/xe),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));a<r;)i=t[a],i>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:u[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);a<r;)i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,a):(u.push(i%1e7),a+=4);a=r/4}else throw Error(k2);else for(;a<r;)u[a++]=Math.random()*1e7|0;for(r=u[--a],e%=xe,r&&e&&(i=Ht(10,xe-e),u[a]=(r/i|0)*i);u[a]===0;a--)u.pop();if(a<0)n=0,u=[0];else{for(n=-1;u[0]===0;n-=xe)u.shift();for(r=1,i=u[0];i>=10;i/=10)r++;r<xe&&(n-=xe-r)}return o.e=n,o.d=u,o}function l8(e){return De(e=new this(e),e.e+1,this.rounding)}function s8(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function c8(e){return new this(e).sin()}function f8(e){return new this(e).sinh()}function d8(e){return new this(e).sqrt()}function h8(e,t){return new this(e).sub(t)}function m8(){var e=0,t=arguments,n=new this(t[e]);for(Ce=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return Ce=!0,De(n,this.precision,this.rounding)}function p8(e){return new this(e).tan()}function g8(e){return new this(e).tanh()}function v8(e){return De(e=new this(e),e.e+1,1)}ie[Symbol.for("nodejs.util.inspect.custom")]=ie.toString,ie[Symbol.toStringTag]="Decimal";var Po=ie.constructor=Z2(_m);Ic=new Po(Ic),$c=new Po($c);var y8="BigNumber",b8=["?on","config"],D8=ce(y8,b8,e=>{var{on:t,config:n}=e,r=Po.clone({precision:n.precision,modulo:Po.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(i){return new r(i.value)},t&&t("config",function(i,a){i.precision!==a.precision&&r.config({precision:i.precision})}),r},{isClass:!0});const sn=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},or=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},S8=function(e){const t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;const n=e*e;return n*(n*(n*(n*(n*(n*(n*(n/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},Rm=function(e,t){return e=Math.abs(e),t=Math.abs(t),e<t&&([e,t]=[t,e]),e<1e8?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},Ho=function(){throw SyntaxError("Invalid Param")};function Om(e,t){const n=Math.abs(e),r=Math.abs(t);return e===0?Math.log(r):t===0?Math.log(n):n<3e3&&r<3e3?Math.log(e*e+t*t)*.5:(e=e*.5,t=t*.5,.5*Math.log(e*e+t*t)+Math.LN2)}const w8={re:0,im:0},Ea=function(e,t){const n=w8;if(e==null)n.re=n.im=0;else if(t!==void 0)n.re=e,n.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)n.re=e.re,n.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return K.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return K.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else e.length===2?(n.re=e[0],n.im=e[1]):Ho();break;case"string":n.im=n.re=0;const r=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);let i=1,a=0;r===null&&Ho();for(let o=0;o<r.length;o++){const u=r[o];u===" "||u===" "||u===`
|
|
76
|
-
`||(u==="+"?i++:u==="-"?a++:u==="i"||u==="I"?(i+a===0&&Ho(),r[o+1]!==" "&&!isNaN(r[o+1])?(n.im+=parseFloat((a%2?"-":"")+r[o+1]),o++):n.im+=parseFloat((a%2?"-":"")+"1"),i=a=0):((i+a===0||isNaN(u))&&Ho(),r[o+1]==="i"||r[o+1]==="I"?(n.im+=parseFloat((a%2?"-":"")+u),o++):n.re+=parseFloat((a%2?"-":"")+u),i=a=0))}i+a>0&&Ho();break;case"number":n.im=0,n.re=e;break;default:Ho()}return isNaN(n.re)||isNaN(n.im),n};function K(e,t){if(!(this instanceof K))return new K(e,t);const n=Ea(e,t);this.re=n.re,this.im=n.im}K.prototype={re:0,im:0,sign:function(){const e=Rm(this.re,this.im);return new K(this.re/e,this.im/e)},add:function(e,t){const n=Ea(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?K.NAN:K.INFINITY:new K(this.re+n.re,this.im+n.im)},sub:function(e,t){const n=Ea(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?K.NAN:K.INFINITY:new K(this.re-n.re,this.im-n.im)},mul:function(e,t){const n=Ea(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;return r&&o||i&&a?K.NAN:r||i?K.INFINITY:n.im===0&&this.im===0?new K(this.re*n.re,0):new K(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){const n=Ea(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;if(a&&o||r&&i)return K.NAN;if(o||r)return K.INFINITY;if(a||i)return K.ZERO;if(n.im===0)return new K(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){const u=n.re/n.im,l=n.re*u+n.im;return new K((this.re*u+this.im)/l,(this.im*u-this.re)/l)}else{const u=n.im/n.re,l=n.im*u+n.re;return new K((this.re+this.im*u)/l,(this.im-this.re*u)/l)}},pow:function(e,t){const n=Ea(e,t),r=this.re===0&&this.im===0;if(n.re===0&&n.im===0)return K.ONE;if(n.im===0){if(this.im===0&&this.re>0)return new K(Math.pow(this.re,n.re),0);if(this.re===0)switch((n.re%4+4)%4){case 0:return new K(Math.pow(this.im,n.re),0);case 1:return new K(0,Math.pow(this.im,n.re));case 2:return new K(-Math.pow(this.im,n.re),0);case 3:return new K(0,-Math.pow(this.im,n.re))}}if(r&&n.re>0)return K.ZERO;const a=Math.atan2(this.im,this.re),o=Om(this.re,this.im);let u=Math.exp(n.re*o-n.im*a),l=n.im*o+n.re*a;return new K(u*Math.cos(l),u*Math.sin(l))},sqrt:function(){const e=this.re,t=this.im;if(t===0)return e>=0?new K(Math.sqrt(e),0):new K(0,Math.sqrt(-e));const n=Rm(e,t);let r=Math.sqrt(.5*(n+Math.abs(e))),i=Math.abs(t)/(2*r);return e>=0?new K(r,t<0?-i:i):new K(i,t<0?-r:r)},exp:function(){const e=Math.exp(this.re);return this.im===0?new K(e,0):new K(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){const e=this.re,t=this.im;return new K(Math.expm1(e)*Math.cos(t)+S8(t),Math.exp(e)*Math.sin(t))},log:function(){const e=this.re,t=this.im;return t===0&&e>0?new K(Math.log(e),0):new K(Om(e,t),Math.atan2(t,e))},abs:function(){return Rm(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){const e=this.re,t=this.im;return new K(Math.sin(e)*sn(t),Math.cos(e)*or(t))},cos:function(){const e=this.re,t=this.im;return new K(Math.cos(e)*sn(t),-Math.sin(e)*or(t))},tan:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)+sn(t);return new K(Math.sin(e)/n,or(t)/n)},cot:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)-sn(t);return new K(-Math.sin(e)/n,or(t)/n)},sec:function(){const e=this.re,t=this.im,n=.5*sn(2*t)+.5*Math.cos(2*e);return new K(Math.cos(e)*sn(t)/n,Math.sin(e)*or(t)/n)},csc:function(){const e=this.re,t=this.im,n=.5*sn(2*t)-.5*Math.cos(2*e);return new K(Math.sin(e)*sn(t)/n,-Math.cos(e)*or(t)/n)},asin:function(){const e=this.re,t=this.im,n=new K(t*t-e*e+1,-2*e*t).sqrt(),r=new K(n.re-t,n.im+e).log();return new K(r.im,-r.re)},acos:function(){const e=this.re,t=this.im,n=new K(t*t-e*e+1,-2*e*t).sqrt(),r=new K(n.re-t,n.im+e).log();return new K(Math.PI/2-r.im,r.re)},atan:function(){const e=this.re,t=this.im;if(e===0){if(t===1)return new K(0,1/0);if(t===-1)return new K(0,-1/0)}const n=e*e+(1-t)*(1-t),r=new K((1-t*t-e*e)/n,-2*e/n).log();return new K(-.5*r.im,.5*r.re)},acot:function(){const e=this.re,t=this.im;if(t===0)return new K(Math.atan2(1,e),0);const n=e*e+t*t;return n!==0?new K(e/n,-t/n).atan():new K(e!==0?e/0:0,t!==0?-t/0:0).atan()},asec:function(){const e=this.re,t=this.im;if(e===0&&t===0)return new K(0,1/0);const n=e*e+t*t;return n!==0?new K(e/n,-t/n).acos():new K(e!==0?e/0:0,t!==0?-t/0:0).acos()},acsc:function(){const e=this.re,t=this.im;if(e===0&&t===0)return new K(Math.PI/2,1/0);const n=e*e+t*t;return n!==0?new K(e/n,-t/n).asin():new K(e!==0?e/0:0,t!==0?-t/0:0).asin()},sinh:function(){const e=this.re,t=this.im;return new K(or(e)*Math.cos(t),sn(e)*Math.sin(t))},cosh:function(){const e=this.re,t=this.im;return new K(sn(e)*Math.cos(t),or(e)*Math.sin(t))},tanh:function(){const e=2*this.re,t=2*this.im,n=sn(e)+Math.cos(t);return new K(or(e)/n,Math.sin(t)/n)},coth:function(){const e=2*this.re,t=2*this.im,n=sn(e)-Math.cos(t);return new K(or(e)/n,-Math.sin(t)/n)},csch:function(){const e=this.re,t=this.im,n=Math.cos(2*t)-sn(2*e);return new K(-2*or(e)*Math.cos(t)/n,2*sn(e)*Math.sin(t)/n)},sech:function(){const e=this.re,t=this.im,n=Math.cos(2*t)+sn(2*e);return new K(2*sn(e)*Math.cos(t)/n,-2*or(e)*Math.sin(t)/n)},asinh:function(){let e=this.im;this.im=-this.re,this.re=e;const t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){const e=this.acos();if(e.im<=0){const t=e.re;e.re=-e.im,e.im=t}else{const t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){const e=this.re,t=this.im,n=e>1&&t===0,r=1-e,i=1+e,a=r*r+t*t,o=a!==0?new K((i*r-t*t)/a,(t*r+i*t)/a):new K(e!==-1?e/0:0,t!==0?t/0:0),u=o.re;return o.re=Om(o.re,o.im)/2,o.im=Math.atan2(o.im,u)/2,n&&(o.im=-o.im),o},acoth:function(){const e=this.re,t=this.im;if(e===0&&t===0)return new K(0,Math.PI/2);const n=e*e+t*t;return n!==0?new K(e/n,-t/n).atanh():new K(e!==0?e/0:0,t!==0?-t/0:0).atanh()},acsch:function(){const e=this.re,t=this.im;if(t===0)return new K(e!==0?Math.log(e+Math.sqrt(e*e+1)):1/0,0);const n=e*e+t*t;return n!==0?new K(e/n,-t/n).asinh():new K(e!==0?e/0:0,t!==0?-t/0:0).asinh()},asech:function(){const e=this.re,t=this.im;if(this.isZero())return K.INFINITY;const n=e*e+t*t;return n!==0?new K(e/n,-t/n).acosh():new K(e!==0?e/0:0,t!==0?-t/0:0).acosh()},inverse:function(){if(this.isZero())return K.INFINITY;if(this.isInfinite())return K.ZERO;const e=this.re,t=this.im,n=e*e+t*t;return new K(e/n,-t/n)},conjugate:function(){return new K(this.re,-this.im)},neg:function(){return new K(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new K(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new K(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new K(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){const n=Ea(e,t);return Math.abs(n.re-this.re)<=K.EPSILON&&Math.abs(n.im-this.im)<=K.EPSILON},clone:function(){return new K(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<K.EPSILON&&(e=0),Math.abs(t)<K.EPSILON&&(t=0),t===0?n+e:(e!==0?(n+=e,n+=" ",t<0?(t=-t,n+="-"):n+="+",n+=" "):t<0&&(t=-t,n+="-"),t!==1&&(n+=t),n+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},K.ZERO=new K(0,0),K.ONE=new K(1,0),K.I=new K(0,1),K.PI=new K(Math.PI,0),K.E=new K(Math.E,0),K.INFINITY=new K(1/0,1/0),K.NAN=new K(NaN,NaN),K.EPSILON=1e-15;var x8="Complex",E8=[],A8=ce(x8,E8,()=>(Object.defineProperty(K,"name",{value:"Complex"}),K.prototype.constructor=K,K.prototype.type="Complex",K.prototype.isComplex=!0,K.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},K.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},K.prototype.format=function(e){var t="",n=this.im,r=this.re,i=Mm(this.re,e),a=Mm(this.im,e),o=at(e)?e:e?e.precision:null;if(o!==null){var u=Math.pow(10,-o);Math.abs(r/n)<u&&(r=0),Math.abs(n/r)<u&&(n=0)}return n===0?t=i:r===0?n===1?t="i":n===-1?t="-i":t=a+"i":n<0?n===-1?t=i+" - i":t=i+" - "+a.substring(1)+"i":n===1?t=i+" + i":t=i+" + "+a+"i",t},K.fromPolar=function(e){switch(arguments.length){case 1:{var t=arguments[0];if(typeof t=="object")return K(t);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var n=arguments[0],r=arguments[1];if(at(n)){if(E2(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),at(r))return new K({r:n,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}else throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},K.prototype.valueOf=K.prototype.toString,K.fromJSON=function(e){return new K(e)},K.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},K),{isClass:!0});typeof BigInt>"u"&&(BigInt=function(e){if(isNaN(e))throw new Error("");return e});const ve=BigInt(0),Ne=BigInt(1),Xt=BigInt(2),Dl=BigInt(3),qo=BigInt(5),xn=BigInt(10);BigInt(Number.MAX_SAFE_INTEGER);const C8=2e3,de={s:Ne,n:ve,d:Ne};function fi(e,t){try{e=BigInt(e)}catch{throw Wi()}return e*t}function Dr(e){return typeof e=="bigint"?e:Math.floor(e)}function bt(e,t){if(t===ve)throw zm();const n=Object.create(ur.prototype);n.s=e<ve?-Ne:Ne,e=e<ve?-e:e;const r=Aa(e,t);return n.n=e/r,n.d=t/r,n}const M8=[Xt*Xt,Xt,Xt*Xt,Xt,Xt*Xt,Xt*Dl,Xt,Xt*Dl];function Go(e){const t=Object.create(null);if(e<=Ne)return t[e]=Ne,t;const n=r=>{t[r]=(t[r]||ve)+Ne};for(;e%Xt===ve;)n(Xt),e/=Xt;for(;e%Dl===ve;)n(Dl),e/=Dl;for(;e%qo===ve;)n(qo),e/=qo;for(let r=0,i=Xt+qo;i*i<=e;){for(;e%i===ve;)n(i),e/=i;i+=M8[r],r=r+1&7}return e>Ne&&n(e),t}const Zt=function(e,t){let n=ve,r=Ne,i=Ne;if(e!=null)if(t!==void 0){if(typeof e=="bigint")n=e;else{if(isNaN(e))throw Wi();if(e%1!==0)throw Q2();n=BigInt(e)}if(typeof t=="bigint")r=t;else{if(isNaN(t))throw Wi();if(t%1!==0)throw Q2();r=BigInt(t)}i=n*r}else if(typeof e=="object"){if("d"in e&&"n"in e)n=BigInt(e.n),r=BigInt(e.d),"s"in e&&(n*=BigInt(e.s));else if(0 in e)n=BigInt(e[0]),1 in e&&(r=BigInt(e[1]));else if(typeof e=="bigint")n=e;else throw Wi();i=n*r}else if(typeof e=="number"){if(isNaN(e))throw Wi();if(e<0&&(i=-Ne,e=-e),e%1===0)n=BigInt(e);else{let a=1,o=0,u=1,l=1,s=1,c=1e7;for(e>=1&&(a=10**Math.floor(1+Math.log10(e)),e/=a);u<=c&&s<=c;){let f=(o+l)/(u+s);if(e===f){u+s<=c?(n=o+l,r=u+s):s>u?(n=l,r=s):(n=o,r=u);break}else e>f?(o+=l,u+=s):(l+=o,s+=u),u>c?(n=l,r=s):(n=o,r=u)}n=BigInt(n)*BigInt(a),r=BigInt(r)}}else if(typeof e=="string"){let a=0,o=ve,u=ve,l=ve,s=Ne,c=Ne,f=e.replace(/_/g,"").match(/\d+|./g);if(f===null)throw Wi();if(f[a]==="-"?(i=-Ne,a++):f[a]==="+"&&a++,f.length===a+1?u=fi(f[a++],i):f[a+1]==="."||f[a]==="."?(f[a]!=="."&&(o=fi(f[a++],i)),a++,(a+1===f.length||f[a+1]==="("&&f[a+3]===")"||f[a+1]==="'"&&f[a+3]==="'")&&(u=fi(f[a],i),s=xn**BigInt(f[a].length),a++),(f[a]==="("&&f[a+2]===")"||f[a]==="'"&&f[a+2]==="'")&&(l=fi(f[a+1],i),c=xn**BigInt(f[a+1].length)-Ne,a+=3)):f[a+1]==="/"||f[a+1]===":"?(u=fi(f[a],i),s=fi(f[a+2],Ne),a+=3):f[a+3]==="/"&&f[a+1]===" "&&(o=fi(f[a],i),u=fi(f[a+2],i),s=fi(f[a+4],Ne),a+=5),f.length<=a)r=s*c,i=n=l+r*o+c*u;else throw Wi()}else if(typeof e=="bigint")n=e,i=e,r=Ne;else throw Wi();if(r===ve)throw zm();de.s=i<ve?-Ne:Ne,de.n=n<ve?-n:n,de.d=r<ve?-r:r};function T8(e,t,n){let r=Ne;for(;t>ve;e=e*e%n,t>>=Ne)t&Ne&&(r=r*e%n);return r}function _8(e,t){for(;t%Xt===ve;t/=Xt);for(;t%qo===ve;t/=qo);if(t===Ne)return ve;let n=xn%t,r=1;for(;n!==Ne;r++)if(n=n*xn%t,r>C8)return ve;return BigInt(r)}function B8(e,t,n){let r=Ne,i=T8(xn,n,t);for(let a=0;a<300;a++){if(r===i)return BigInt(a);r=r*xn%t,i=i*xn%t}return 0}function Aa(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function ur(e,t){if(Zt(e,t),this instanceof ur)e=Aa(de.d,de.n),this.s=de.s,this.n=de.n/e,this.d=de.d/e;else return bt(de.s*de.n,de.d)}const zm=function(){return new Error("Division by Zero")},Wi=function(){return new Error("Invalid argument")},Q2=function(){return new Error("Parameters must be integer")};ur.prototype={s:Ne,n:ve,d:Ne,abs:function(){return bt(this.n,this.d)},neg:function(){return bt(-this.s*this.n,this.d)},add:function(e,t){return Zt(e,t),bt(this.s*this.n*de.d+de.s*this.d*de.n,this.d*de.d)},sub:function(e,t){return Zt(e,t),bt(this.s*this.n*de.d-de.s*this.d*de.n,this.d*de.d)},mul:function(e,t){return Zt(e,t),bt(this.s*de.s*this.n*de.n,this.d*de.d)},div:function(e,t){return Zt(e,t),bt(this.s*de.s*this.n*de.d,this.d*de.n)},clone:function(){return bt(this.s*this.n,this.d)},mod:function(e,t){if(e===void 0)return bt(this.s*this.n%this.d,Ne);if(Zt(e,t),ve===de.n*this.d)throw zm();return bt(this.s*(de.d*this.n)%(de.n*this.d),de.d*this.d)},gcd:function(e,t){return Zt(e,t),bt(Aa(de.n,this.n)*Aa(de.d,this.d),de.d*this.d)},lcm:function(e,t){return Zt(e,t),de.n===ve&&this.n===ve?bt(ve,Ne):bt(de.n*this.n,Aa(de.n,this.n)*Aa(de.d,this.d))},inverse:function(){return bt(this.s*this.d,this.n)},pow:function(e,t){if(Zt(e,t),de.d===Ne)return de.s<ve?bt((this.s*this.d)**de.n,this.n**de.n):bt((this.s*this.n)**de.n,this.d**de.n);if(this.s<ve)return null;let n=Go(this.n),r=Go(this.d),i=Ne,a=Ne;for(let o in n)if(o!=="1"){if(o==="0"){i=ve;break}if(n[o]*=de.n,n[o]%de.d===ve)n[o]/=de.d;else return null;i*=BigInt(o)**n[o]}for(let o in r)if(o!=="1"){if(r[o]*=de.n,r[o]%de.d===ve)r[o]/=de.d;else return null;a*=BigInt(o)**r[o]}return de.s<ve?bt(a,i):bt(i,a)},log:function(e,t){if(Zt(e,t),this.s<=ve||de.s<=ve)return null;const n=Object.create(null),r=Go(de.n),i=Go(de.d),a=Go(this.n),o=Go(this.d);for(const s in i)r[s]=(r[s]||ve)-i[s];for(const s in o)a[s]=(a[s]||ve)-o[s];for(const s in r)s!=="1"&&(n[s]=!0);for(const s in a)s!=="1"&&(n[s]=!0);let u=null,l=null;for(const s in n){const c=r[s]||ve,f=a[s]||ve;if(c===ve){if(f!==ve)return null;continue}let d=f,h=c;const g=Aa(d,h);if(d/=g,h/=g,u===null&&l===null)u=d,l=h;else if(d*l!==u*h)return null}return u!==null&&l!==null?bt(u,l):null},equals:function(e,t){return Zt(e,t),this.s*this.n*de.d===de.s*de.n*this.d},lt:function(e,t){return Zt(e,t),this.s*this.n*de.d<de.s*de.n*this.d},lte:function(e,t){return Zt(e,t),this.s*this.n*de.d<=de.s*de.n*this.d},gt:function(e,t){return Zt(e,t),this.s*this.n*de.d>de.s*de.n*this.d},gte:function(e,t){return Zt(e,t),this.s*this.n*de.d>=de.s*de.n*this.d},compare:function(e,t){Zt(e,t);let n=this.s*this.n*de.d-de.s*de.n*this.d;return(ve<n)-(n<ve)},ceil:function(e){return e=xn**BigInt(e||0),bt(Dr(this.s*e*this.n/this.d)+(e*this.n%this.d>ve&&this.s>=ve?Ne:ve),e)},floor:function(e){return e=xn**BigInt(e||0),bt(Dr(this.s*e*this.n/this.d)-(e*this.n%this.d>ve&&this.s<ve?Ne:ve),e)},round:function(e){return e=xn**BigInt(e||0),bt(Dr(this.s*e*this.n/this.d)+this.s*((this.s>=ve?Ne:ve)+Xt*(e*this.n%this.d)>this.d?Ne:ve),e)},roundTo:function(e,t){Zt(e,t);const n=this.n*de.d,r=this.d*de.n,i=n%r;let a=Dr(n/r);return i+i>=r&&a++,bt(this.s*a*de.n,de.d)},divisible:function(e,t){return Zt(e,t),de.n===ve?!1:this.n*de.d%(de.n*this.d)===ve},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(e=15){let t=this.n,n=this.d,r=_8(t,n),i=B8(t,n,r),a=this.s<ve?"-":"";if(a+=Dr(t/n),t%=n,t*=xn,t&&(a+="."),r){for(let o=i;o--;)a+=Dr(t/n),t%=n,t*=xn;a+="(";for(let o=r;o--;)a+=Dr(t/n),t%=n,t*=xn;a+=")"}else for(let o=e;t&&o--;)a+=Dr(t/n),t%=n,t*=xn;return a},toFraction:function(e=!1){let t=this.n,n=this.d,r=this.s<ve?"-":"";if(n===Ne)r+=t;else{const i=Dr(t/n);e&&i>ve&&(r+=i,r+=" ",t%=n),r+=t,r+="/",r+=n}return r},toLatex:function(e=!1){let t=this.n,n=this.d,r=this.s<ve?"-":"";if(n===Ne)r+=t;else{const i=Dr(t/n);e&&i>ve&&(r+=i,t%=n),r+="\\frac{",r+=t,r+="}{",r+=n,r+="}"}return r},toContinued:function(){let e=this.n,t=this.d;const n=[];for(;t;){n.push(Dr(e/t));const r=e%t;e=t,t=r}return n},simplify:function(e=.001){const t=BigInt(Math.ceil(1/e)),n=this.abs(),r=n.toContinued();for(let i=1;i<r.length;i++){let a=bt(r[i-1],Ne);for(let u=i-2;u>=0;u--)a=a.inverse().add(r[u]);let o=a.sub(n);if(o.n*t<o.d)return a.mul(this.s)}return this}};var N8="Fraction",F8=[],R8=ce(N8,F8,()=>(Object.defineProperty(ur,"name",{value:"Fraction"}),ur.prototype.constructor=ur,ur.prototype.type="Fraction",ur.prototype.isFraction=!0,ur.prototype.toJSON=function(){return{mathjs:"Fraction",n:String(this.s*this.n),d:String(this.d)}},ur.fromJSON=function(e){return new ur(e)},ur),{isClass:!0}),O8="Matrix",z8=[],U8=ce(O8,z8,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,n){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,n,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,n,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,n){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,n){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function Um(e,t,n){var r=e.constructor,i=new r(2),a="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!st(n))throw new Error("size must be an integer");if(e.greaterThan(i.pow(n-1).sub(1))||e.lessThan(i.pow(n-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(n))),a="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(a);case 8:return"".concat(e.toOctal()).concat(a);case 16:return"".concat(e.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(t," not supported "))}}function I8(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:n,precision:r,wordSize:i}=F2(t);switch(n){case"fixed":return k8(e,r);case"exponential":return W2(e,r);case"engineering":return $8(e,r);case"bin":return Um(e,2,i);case"oct":return Um(e,8,i);case"hex":return Um(e,16,i);case"auto":{var a=J2(t?.lowerExp,-3),o=J2(t?.upperExp,5);if(e.isZero())return"0";var u,l=e.toSignificantDigits(r),s=l.e;return s>=a&&s<o?u=l.toFixed():u=W2(e,r),u.replace(/((\.\d*?)(0+))($|e)/,function(){var c=arguments[2],f=arguments[4];return c!=="."?c+f:f})}default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function $8(e,t){var n=e.e,r=n%3===0?n:n<0?n-3-n%3:n-n%3,i=e.mul(Math.pow(10,-r)),a=i.toPrecision(t);if(a.includes("e")){var o=e.constructor;a=new o(a).toFixed()}return a+"e"+(n>=0?"+":"")+r.toString()}function W2(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function k8(e,t){return e.toFixed(t)}function J2(e,t){return at(e)?e:wt(e)?e.toNumber():t}function ht(e,t){var n=L8(e,t);return t&&typeof t=="object"&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function L8(e,t){if(typeof e=="number")return Mm(e,t);if(wt(e))return I8(e,t);if(j8(e))return!t||t.fraction!=="decimal"?"".concat(e.s*e.n,"/").concat(e.d):e.toString();if(Array.isArray(e))return nD(e,t);if(yr(e))return eD(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var n=Object.keys(e).map(r=>eD(r)+": "+ht(e[r],t));return"{"+n.join(", ")+"}"}return String(e)}function eD(e){for(var t=String(e),n="",r=0;r<t.length;){var i=t.charAt(r);n+=i in tD?tD[i]:i,r++}return'"'+n+'"'}var tD={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function nD(e,t){if(Array.isArray(e)){for(var n="[",r=e.length,i=0;i<r;i++)i!==0&&(n+=", "),n+=nD(e[i],t);return n+="]",n}else return ht(e,t)}function j8(e){return e&&typeof e=="object"&&typeof e.s=="bigint"&&typeof e.n=="bigint"&&typeof e.d=="bigint"||!1}function Ge(e,t,n){if(!(this instanceof Ge))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}Ge.prototype=new RangeError,Ge.prototype.constructor=RangeError,Ge.prototype.name="DimensionError",Ge.prototype.isDimensionError=!0;function Ji(e,t,n){if(!(this instanceof Ji))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),this.min!==void 0&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":this.max!==void 0&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Ji.prototype=new RangeError,Ji.prototype.constructor=RangeError,Ji.prototype.name="IndexError",Ji.prototype.isIndexError=!0;function mt(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function rD(e,t,n){var r,i=e.length;if(i!==t[n])throw new Ge(i,t[n]);if(n<t.length-1){var a=n+1;for(r=0;r<i;r++){var o=e[r];if(!Array.isArray(o))throw new Ge(t.length-1,t.length,"<");rD(e[r],t,a)}}else for(r=0;r<i;r++)if(Array.isArray(e[r]))throw new Ge(t.length+1,t.length,">")}function iD(e,t){var n=t.length===0;if(n){if(Array.isArray(e))throw new Ge(e.length,0)}else rD(e,t,0)}function xt(e,t){if(e!==void 0){if(!at(e)||!st(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new Ji(e,t)}}function Gc(e,t,n){if(!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Error("Resizing to scalar is not supported");t.forEach(function(i){if(!at(i)||!st(i)||i<0)throw new TypeError("Invalid size, must contain positive integers (size: "+ht(t)+")")}),(at(e)||wt(e))&&(e=[e]);var r=n!==void 0?n:0;return Im(e,t,0,r),e}function Im(e,t,n,r){var i,a,o=e.length,u=t[n],l=Math.min(o,u);if(e.length=u,n<t.length-1){var s=n+1;for(i=0;i<l;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),Im(a,t,s,r);for(i=l;i<u;i++)a=[],e[i]=a,Im(a,t,s,r)}else{for(i=0;i<l;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=l;i<u;i++)e[i]=r}}function $m(e,t){var n=Lm(e,!0),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Ge(0,r,"!=");t=km(t,r);var i=aD(t);if(r!==i)throw new Ge(i,r,"!=");try{return P8(n,t)}catch(a){throw a instanceof Ge?new Ge(i,r,"!="):a}}function km(e,t){var n=aD(e),r=e.slice(),i=-1,a=e.indexOf(i),o=e.indexOf(i,a+1)>=0;if(o)throw new Error("More than one wildcard in sizes");var u=a>=0,l=t%n===0;if(u)if(l)r[a]=-t/n;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);return r}function aD(e){return e.reduce((t,n)=>t*n,1)}function P8(e,t){for(var n=e,r,i=t.length-1;i>0;i--){var a=t[i];r=[];for(var o=n.length/a,u=0;u<o;u++)r.push(n.slice(u*a,(u+1)*a));n=r}return n}function oD(e,t,n,r){var i=r||mt(e);if(n)for(var a=0;a<n;a++)e=[e],i.unshift(1);for(e=uD(e,t,0);i.length<t;)i.push(1);return e}function uD(e,t,n){var r,i;if(Array.isArray(e)){var a=n+1;for(r=0,i=e.length;r<i;r++)e[r]=uD(e[r],t,a)}else for(var o=n;o<t;o++)e=[e];return e}function Lm(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!Array.isArray(e))return e;if(typeof t!="boolean")throw new TypeError("Boolean expected for second argument of flatten");var n=[];return t?i(e):r(e),n;function r(a){for(var o=0;o<a.length;o++){var u=a[o];Array.isArray(u)?r(u):n.push(u)}}function i(a){if(Array.isArray(a[0]))for(var o=0;o<a.length;o++)i(a[o]);else for(var u=0;u<a.length;u++)n.push(a[u])}}function Vc(e,t){for(var n,r=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(i===0&&o&&(r=a.length),o&&a.length!==r)return;var u=o?Vc(a,t):t(a);if(n===void 0)n=u;else if(n!==u)return"mixed"}return n}function lD(e,t,n,r){if(r<n){if(e.length!==t.length)throw new Ge(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=lD(e[a],t[a],n,r+1);return i}else return e.concat(t)}function sD(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(n,r){return lD(n,r,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function cD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.map(d=>d.length),i=Math.max(...r),a=new Array(i).fill(null),o=0;o<t.length;o++)for(var u=t[o],l=r[o],s=0;s<l;s++){var c=i-l+s;u[s]>a[c]&&(a[c]=u[s])}for(var f=0;f<t.length;f++)fD(t[f],a);return a}function fD(e,t){for(var n=t.length,r=e.length,i=0;i<r;i++){var a=n-r+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw new Error("shape mismatch: mismatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(r," with size ").concat(e[i]," to size ").concat(t[a]))}}function jm(e,t){var n=mt(e);if(Yi(n,t))return e;fD(n,t);var r=cD(n,t),i=r.length,a=[...Array(i-n.length).fill(1),...n],o=G8(e);n.length<i&&(o=$m(o,a),n=mt(o));for(var u=0;u<i;u++)n[u]<r[u]&&(o=H8(o,r[u],u),n=mt(o));return o}function H8(e,t,n){return sD(...Array(t).fill(e),n)}function dD(e,t){if(!Array.isArray(e))throw new Error("Array expected");var n=mt(e);if(t.length!==n.length)throw new Ge(t.length,n.length);for(var r=0;r<t.length;r++)xt(t[r],n[r]);return t.reduce((i,a)=>i[a],e)}function hD(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e.length===0)return[];if(n)return a(e);var r=[];return i(e,0);function i(o,u){if(Array.isArray(o)){for(var l=o.length,s=Array(l),c=0;c<l;c++)r[u]=c,s[c]=i(o[c],u+1);return s}else return t(o,r.slice(0,u),e)}function a(o){if(Array.isArray(o)){for(var u=o.length,l=Array(u),s=0;s<u;s++)l[s]=a(o[s]);return l}else return t(o)}}function q8(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e.length===0)return;if(n){a(e);return}var r=[];i(e,0);function i(o,u){if(Array.isArray(o))for(var l=o.length,s=0;s<l;s++)r[u]=s,i(o[s],u+1);else t(o,r.slice(0,u),e)}function a(o){if(Array.isArray(o))for(var u=o.length,l=0;l<u;l++)a(o[l]);else t(o)}}function G8(e){return Vi([],e)}function Yc(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Nc.isTypedFunction(e)){var i;if(r)i=1;else{var a=(t.isMatrix?t.size():mt(t)).map(()=>0),o=t.isMatrix?t.get(a):dD(t,a);i=X8(e,o,a,t)}var u;if(t.isMatrix&&t.dataType!=="mixed"&&t.dataType!==void 0){var l=V8(e,i);u=l!==void 0?l:e}else u=e;return i>=1&&i<=3?{isUnary:i===1,fn:function(){for(var c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];return mD(u,f.slice(0,i),n,e.name)}}:{isUnary:!1,fn:function(){for(var c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];return mD(u,f,n,e.name)}}}return r===void 0?{isUnary:Y8(e),fn:e}:{isUnary:r,fn:e}}function V8(e,t){var n=[];if(Object.entries(e.signatures).forEach(r=>{var[i,a]=r;i.split(",").length===t&&n.push(a)}),n.length===1)return n[0]}function Y8(e){if(e.length!==1)return!1;var t=e.toString();if(/arguments/.test(t))return!1;var n=t.match(/\(.*?\)/);return!/\.\.\./.test(n)}function X8(e,t,n,r){for(var i=[t,n,r],a=3;a>0;a--){var o=i.slice(0,a);if(Nc.resolve(e,o)!==null)return a}}function mD(e,t,n,r){try{return e(...t)}catch(i){Z8(i,t,n,r)}}function Z8(e,t,n,r){var i;if(e instanceof TypeError&&((i=e.data)===null||i===void 0?void 0:i.category)==="wrongType"){var a=[];throw a.push("value: ".concat(Ln(t[0]))),t.length>=2&&a.push("index: ".concat(Ln(t[1]))),t.length>=3&&a.push("array: ".concat(Ln(t[2]))),new TypeError("Function ".concat(n," cannot apply callback arguments ")+"".concat(r,"(").concat(a.join(", "),") at index ").concat(JSON.stringify(t[1])))}else throw new TypeError("Function ".concat(n," cannot apply callback arguments ")+"to function ".concat(r,": ").concat(e.message))}var K8="DenseMatrix",Q8=["Matrix"],W8=ce(K8,Q8,e=>{var{Matrix:t}=e;function n(c,f){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!yr(f))throw new Error("Invalid datatype: "+f);if(Xe(c))c.type==="DenseMatrix"?(this._data=Pe(c._data),this._size=Pe(c._size),this._datatype=f||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=f||c._datatype);else if(c&&yt(c.data)&&yt(c.size))this._data=c.data,this._size=c.size,iD(this._data,this._size),this._datatype=f||c.datatype;else if(yt(c))this._data=s(c),this._size=mt(this._data),iD(this._data,this._size),this._datatype=f;else{if(c)throw new TypeError("Unsupported type of data ("+Ln(c)+")");this._data=[],this._size=[0],this._datatype=f}}n.prototype=new t,n.prototype.createDenseMatrix=function(c,f){return new n(c,f)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Vc(this._data,Ln)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(c,f){return new n(c,f)},n.prototype.subset=function(c,f,d){switch(arguments.length){case 1:return r(this,c);case 2:case 3:return a(this,c,f,d);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(c){return dD(this._data,c)},n.prototype.set=function(c,f,d){if(!yt(c))throw new TypeError("Array expected");if(c.length<this._size.length)throw new Ge(c.length,this._size.length,"<");var h,g,m,D=c.map(function(v){return v+1});l(this,D,d);var p=this._data;for(h=0,g=c.length-1;h<g;h++)m=c[h],xt(m,p.length),p=p[m];return m=c[c.length-1],xt(m,p.length),p[m]=f,this};function r(c,f){if(!Em(f))throw new TypeError("Invalid index");var d=f.isScalar();if(d)return c.get(f.min());var h=f.size();if(h.length!==c._size.length)throw new Ge(h.length,c._size.length);for(var g=f.min(),m=f.max(),D=0,p=c._size.length;D<p;D++)xt(g[D],c._size[D]),xt(m[D],c._size[D]);var v=new n([]),y=i(c._data,f);return v._size=y.size,v._datatype=c._datatype,v._data=y.data,v}function i(c,f){var d=f.size().length-1,h=Array(d);return{data:g(c),size:h};function g(m){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=f.dimension(D);return h[D]=p.size()[0],D<d?p.map(v=>(xt(v,m.length),g(m[v],D+1))).valueOf():p.map(v=>(xt(v,m.length),m[v])).valueOf()}}function a(c,f,d,h){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var g=f.size(),m=f.isScalar(),D;if(Xe(d)?(D=d.size(),d=d.valueOf()):D=mt(d),m){if(D.length!==0)throw new TypeError("Scalar expected");c.set(f.min(),d,h)}else{if(!Yi(D,g))try{D.length===0?d=jm([d],g):d=jm(d,g),D=mt(d)}catch{}if(g.length<c._size.length)throw new Ge(g.length,c._size.length,"<");if(D.length<g.length){for(var p=0,v=0;g[p]===1&&D[p]===1;)p++;for(;g[p]===1;)v++,p++;d=oD(d,g.length,v,D)}if(!Yi(g,D))throw new Ge(g,D,">");var y=f.max().map(function(w){return w+1});l(c,y,h),o(c._data,f,d)}return c}function o(c,f,d){var h=f.size().length-1;g(c,d);function g(m,D){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,v=f.dimension(p);p<h?v.forEach((y,w)=>{xt(y,m.length),g(m[y],D[w[0]],p+1)}):v.forEach((y,w)=>{xt(y,m.length),m[y]=D[w[0]]})}}n.prototype.resize=function(c,f,d){if(!vl(c))throw new TypeError("Array or Matrix expected");var h=c.valueOf().map(m=>Array.isArray(m)&&m.length===1?m[0]:m),g=d?this.clone():this;return u(g,h,f)};function u(c,f,d){if(f.length===0){for(var h=c._data;yt(h);)h=h[0];return h}return c._size=f.slice(0),c._data=Gc(c._data,c._size,d),c}n.prototype.reshape=function(c,f){var d=f?this.clone():this;d._data=$m(d._data,c);var h=d._size.reduce((g,m)=>g*m);return d._size=km(c,h),d};function l(c,f,d){for(var h=c._size.slice(0),g=!1;h.length<f.length;)h.push(0),g=!0;for(var m=0,D=f.length;m<D;m++)f[m]>h[m]&&(h[m]=f[m],g=!0);g&&u(c,h,d)}n.prototype.clone=function(){var c=new n({data:Pe(this._data),size:Pe(this._size),datatype:this._datatype});return c},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=this,h=d._size.length-1;if(h<0)return d.clone();var g=Yc(c,d,"map",f),m=g.fn,D=d.create(void 0,d._datatype);if(D._size=d._size,f||g.isUnary)return D._data=b(d._data),D;if(h===0){for(var p=d.valueOf(),v=Array(p.length),y=0;y<p.length;y++)v[y]=m(p[y],[y],d);return D._data=v,D}var w=[];return D._data=E(d._data),D;function E(S){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=Array(S.length);if(A<h)for(var M=0;M<S.length;M++)w[A]=M,C[M]=E(S[M],A+1);else for(var T=0;T<S.length;T++)w[A]=T,C[T]=m(S[T],w.slice(),d);return C}function b(S){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=Array(S.length);if(A<h)for(var M=0;M<S.length;M++)C[M]=b(S[M],A+1);else for(var T=0;T<S.length;T++)C[T]=m(S[T]);return C}},n.prototype.forEach=function(c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=this,h=d._size.length-1;if(h<0)return;var g=Yc(c,d,"map",f),m=g.fn;if(f||g.isUnary){y(d._data);return}if(h===0){for(var D=0;D<d._data.length;D++)m(d._data[D],[D],d);return}var p=[];v(d._data);function v(w){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(E<h)for(var b=0;b<w.length;b++)p[E]=b,v(w[b],E+1);else for(var S=0;S<w.length;S++)p[E]=S,m(w[S],p.slice(),d)}function y(w){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(E<h)for(var b=0;b<w.length;b++)y(w[b],E+1);else for(var S=0;S<w.length;S++)m(w[S])}},n.prototype[Symbol.iterator]=function*(){var c=this._size.length-1;if(!(c<0)){if(c===0){for(var f=0;f<this._data.length;f++)yield{value:this._data[f],index:[f]};return}for(var d=Array(c+1).fill(0),h=this._size.reduce((v,y)=>v*y,1),g=0;g<h;g++){for(var m=this._data,D=0;D<c;D++)m=m[d[D]];yield{value:m[d[c]],index:d.slice()};for(var p=c;p>=0&&(d[p]++,!(d[p]<this._size[p]));p--)d[p]=0}}},n.prototype.rows=function(){var c=[],f=this.size();if(f.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var d=this._data;for(var h of d)c.push(new n([h],this._datatype));return c},n.prototype.columns=function(){var c=this,f=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var h=this._data,g=function(p){var v=h.map(y=>[y[p]]);f.push(new n(v,c._datatype))},m=0;m<d[1];m++)g(m);return f},n.prototype.toArray=function(){return Pe(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(c){return ht(this._data,c)},n.prototype.toString=function(){return ht(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(c){if(c){if(wt(c)&&(c=c.toNumber()),!at(c)||!st(c))throw new TypeError("The parameter k must be an integer number")}else c=0;for(var f=c>0?c:0,d=c<0?-c:0,h=this._size[0],g=this._size[1],m=Math.min(h-d,g-f),D=[],p=0;p<m;p++)D[p]=this._data[p+d][p+f];return new n({data:D,size:[m],datatype:this._datatype})},n.diagonal=function(c,f,d,h){if(!yt(c))throw new TypeError("Array expected, size parameter");if(c.length!==2)throw new Error("Only two dimensions matrix are supported");if(c=c.map(function(S){if(wt(S)&&(S=S.toNumber()),!at(S)||!st(S)||S<1)throw new Error("Size values must be positive integers");return S}),d){if(wt(d)&&(d=d.toNumber()),!at(d)||!st(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var g=d>0?d:0,m=d<0?-d:0,D=c[0],p=c[1],v=Math.min(D-m,p-g),y;if(yt(f)){if(f.length!==v)throw new Error("Invalid value array length");y=function(A){return f[A]}}else if(Xe(f)){var w=f.size();if(w.length!==1||w[0]!==v)throw new Error("Invalid matrix length");y=function(A){return f.get([A])}}else y=function(){return f};h||(h=wt(y(0))?y(0).mul(0):0);var E=[];if(c.length>0){E=Gc(E,c,h);for(var b=0;b<v;b++)E[b+m][b+g]=y(b)}return new n({data:E,size:[D,p]})},n.fromJSON=function(c){return new n(c)},n.prototype.swapRows=function(c,f){if(!at(c)||!st(c)||!at(f)||!st(f))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return xt(c,this._size[0]),xt(f,this._size[0]),n._swapRows(c,f,this._data),this},n._swapRows=function(c,f,d){var h=d[c];d[c]=d[f],d[f]=h};function s(c){return Xe(c)?s(c.valueOf()):yt(c)?c.map(s):c}return n},{isClass:!0});function J8(e){var t=e.length,n=e[0].length,r,i,a=[];for(i=0;i<n;i++){var o=[];for(r=0;r<t;r++)o.push(e[r][i]);a.push(o)}return a}function pD(e){for(var t=0;t<e.length;t++)if(vl(e[t]))return!0;return!1}function gD(e,t){Xe(e)?e.forEach(n=>t(n),!1,!0):q8(e,t,!0)}function En(e,t,n){if(!n)return Xe(e)?e.map(i=>t(i),!1,!0):hD(e,t,!0);var r=i=>i===0?i:t(i);return Xe(e)?e.map(i=>r(i),!1,!0):hD(e,r,!0)}function vD(e,t,n){var r=Array.isArray(e)?mt(e):e.size();if(t<0||t>=r.length)throw new Ji(t,r.length);return Xe(e)?e.create(Xc(e.valueOf(),t,n),e.datatype()):Xc(e,t,n)}function Xc(e,t,n){var r,i,a,o;if(t<=0)if(Array.isArray(e[0])){for(o=J8(e),i=[],r=0;r<o.length;r++)i[r]=Xc(o[r],t-1,n);return i}else{for(a=e[0],r=1;r<e.length;r++)a=n(a,e[r]);return a}else{for(i=[],r=0;r<e.length;r++)i[r]=Xc(e[r],t-1,n);return i}}var yD="isInteger",eM=["typed"],tM=ce(yD,eM,e=>{var{typed:t}=e;return t(yD,{number:st,BigNumber:function(r){return r.isInt()},bigint:function(r){return!0},Fraction:function(r){return r.d===1n},"Array | Matrix":t.referToSelf(n=>r=>En(r,n))})}),Pm="number",Zc="number, number";function bD(e){return Math.abs(e)}bD.signature=Pm;function DD(e,t){return e+t}DD.signature=Zc;function SD(e,t){return e-t}SD.signature=Zc;function wD(e,t){return e*t}wD.signature=Zc;function xD(e){return-e}xD.signature=Pm;function Hm(e){return v6(e)}Hm.signature=Pm;function ED(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}ED.signature=Zc;var AD="number";function CD(e){return e>0}CD.signature=AD;function MD(e){return Number.isNaN(e)}MD.signature=AD;function Vo(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return e.isNaN()||t.isNaN()?!1:!e.isFinite()||!t.isFinite()?e.eq(t):e.eq(t)?!0:e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(n),r))}var TD="isPositive",nM=["typed","config"],rM=ce(TD,nM,e=>{var{typed:t,config:n}=e;return t(TD,{number:r=>si(r,0,n.relTol,n.absTol)?!1:CD(r),BigNumber:r=>Vo(r,new r.constructor(0),n.relTol,n.absTol)?!1:!r.isNeg()&&!r.isZero()&&!r.isNaN(),bigint:r=>r>0n,Fraction:r=>r.s>0n&&r.n>0n,Unit:t.referToSelf(r=>i=>t.find(r,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(r=>i=>En(i,r))})}),_D="isZero",iM=["typed","equalScalar"],aM=ce(_D,iM,e=>{var{typed:t,equalScalar:n}=e;return t(_D,{"number | BigNumber | Complex | Fraction":r=>n(r,0),bigint:r=>r===0n,Unit:t.referToSelf(r=>i=>t.find(r,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(r=>i=>En(i,r))})}),BD="isNaN",oM=["typed"],uM=ce(BD,oM,e=>{var{typed:t}=e;return t(BD,{number:MD,BigNumber:function(r){return r.isNaN()},bigint:function(r){return!1},Fraction:function(r){return!1},Complex:function(r){return r.isNaN()},Unit:function(r){return Number.isNaN(r.value)},"Array | Matrix":t.referToSelf(n=>r=>En(r,n))})});function lM(e,t,n,r){return si(e.re,t.re,n,r)&&si(e.im,t.im,n,r)}var Sl=ce("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(n=>(r,i)=>{if(!r.equalBase(i))throw new Error("Cannot compare units with different base");return t.find(n,[r.valueType(),i.valueType()])(r.value,i.value)})}}),Kc="equalScalar",sM=["typed","config"],cM=ce(Kc,sM,e=>{var{typed:t,config:n}=e,r=Sl({typed:t});return t(Kc,{"boolean, boolean":function(a,o){return a===o},"number, number":function(a,o){return si(a,o,n.relTol,n.absTol)},"BigNumber, BigNumber":function(a,o){return a.eq(o)||Vo(a,o,n.relTol,n.absTol)},"bigint, bigint":function(a,o){return a===o},"Fraction, Fraction":function(a,o){return a.equals(o)},"Complex, Complex":function(a,o){return lM(a,o,n.relTol,n.absTol)}},r)});ce(Kc,["typed","config"],e=>{var{typed:t,config:n}=e;return t(Kc,{"number, number":function(i,a){return si(i,a,n.relTol,n.absTol)}})});var fM="SparseMatrix",dM=["typed","equalScalar","Matrix"],hM=ce(fM,dM,e=>{var{typed:t,equalScalar:n,Matrix:r}=e;function i(m,D){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(D&&!yr(D))throw new Error("Invalid datatype: "+D);if(Xe(m))a(this,m,D);else if(m&&yt(m.index)&&yt(m.ptr)&&yt(m.size))this._values=m.values,this._index=m.index,this._ptr=m.ptr,this._size=m.size,this._datatype=D||m.datatype;else if(yt(m))o(this,m,D);else{if(m)throw new TypeError("Unsupported type of data ("+Ln(m)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=D}}function a(m,D,p){D.type==="SparseMatrix"?(m._values=D._values?Pe(D._values):void 0,m._index=Pe(D._index),m._ptr=Pe(D._ptr),m._size=Pe(D._size),m._datatype=p||D._datatype):o(m,D.valueOf(),p||D._datatype)}function o(m,D,p){m._values=[],m._index=[],m._ptr=[],m._datatype=p;var v=D.length,y=0,w=n,E=0;if(yr(p)&&(w=t.find(n,[p,p])||n,E=t.convert(0,p)),v>0){var b=0;do{m._ptr.push(m._index.length);for(var S=0;S<v;S++){var A=D[S];if(yt(A)){if(b===0&&y<A.length&&(y=A.length),b<A.length){var C=A[b];w(C,E)||(m._values.push(C),m._index.push(S))}}else b===0&&y<1&&(y=1),w(A,E)||(m._values.push(A),m._index.push(S))}b++}while(b<y)}m._ptr.push(m._index.length),m._size=[v,y]}i.prototype=new r,i.prototype.createSparseMatrix=function(m,D){return new i(m,D)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return Vc(this._values,Ln)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(m,D){return new i(m,D)},i.prototype.density=function(){var m=this._size[0],D=this._size[1];return m!==0&&D!==0?this._index.length/(m*D):0},i.prototype.subset=function(m,D,p){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return u(this,m);case 2:case 3:return l(this,m,D,p);default:throw new SyntaxError("Wrong number of arguments")}};function u(m,D){if(!Em(D))throw new TypeError("Invalid index");var p=D.isScalar();if(p)return m.get(D.min());var v=D.size();if(v.length!==m._size.length)throw new Ge(v.length,m._size.length);var y,w,E,b,S=D.min(),A=D.max();for(y=0,w=m._size.length;y<w;y++)xt(S[y],m._size[y]),xt(A[y],m._size[y]);var C=m._values,M=m._index,T=m._ptr,x=D.dimension(0),N=D.dimension(1),R=[],z=[];x.forEach(function(L,V){z[L]=V[0],R[L]=!0});var F=C?[]:void 0,U=[],I=[];return N.forEach(function(L){for(I.push(U.length),E=T[L],b=T[L+1];E<b;E++)y=M[E],R[y]===!0&&(U.push(z[y]),F&&F.push(C[E]))}),I.push(U.length),new i({values:F,index:U,ptr:I,size:v,datatype:m._datatype})}function l(m,D,p,v){if(!D||D.isIndex!==!0)throw new TypeError("Invalid index");var y=D.size(),w=D.isScalar(),E;if(Xe(p)?(E=p.size(),p=p.toArray()):E=mt(p),w){if(E.length!==0)throw new TypeError("Scalar expected");m.set(D.min(),p,v)}else{if(y.length!==1&&y.length!==2)throw new Ge(y.length,m._size.length,"<");if(E.length<y.length){for(var b=0,S=0;y[b]===1&&E[b]===1;)b++;for(;y[b]===1;)S++,b++;p=oD(p,y.length,S,E)}if(!Yi(y,E))throw new Ge(y,E,">");if(y.length===1){var A=D.dimension(0);A.forEach(function(T,x){xt(T),m.set([T,0],p[x[0]],v)})}else{var C=D.dimension(0),M=D.dimension(1);C.forEach(function(T,x){xt(T),M.forEach(function(N,R){xt(N),m.set([T,N],p[x[0]][R[0]],v)})})}}return m}i.prototype.get=function(m){if(!yt(m))throw new TypeError("Array expected");if(m.length!==this._size.length)throw new Ge(m.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var D=m[0],p=m[1];xt(D,this._size[0]),xt(p,this._size[1]);var v=s(D,this._ptr[p],this._ptr[p+1],this._index);return v<this._ptr[p+1]&&this._index[v]===D?this._values[v]:0},i.prototype.set=function(m,D,p){if(!yt(m))throw new TypeError("Array expected");if(m.length!==this._size.length)throw new Ge(m.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var v=m[0],y=m[1],w=this._size[0],E=this._size[1],b=n,S=0;yr(this._datatype)&&(b=t.find(n,[this._datatype,this._datatype])||n,S=t.convert(0,this._datatype)),(v>w-1||y>E-1)&&(d(this,Math.max(v+1,w),Math.max(y+1,E),p),w=this._size[0],E=this._size[1]),xt(v,w),xt(y,E);var A=s(v,this._ptr[y],this._ptr[y+1],this._index);return A<this._ptr[y+1]&&this._index[A]===v?b(D,S)?c(A,y,this._values,this._index,this._ptr):this._values[A]=D:b(D,S)||f(A,v,y,D,this._values,this._index,this._ptr),this};function s(m,D,p,v){if(p-D===0)return p;for(var y=D;y<p;y++)if(v[y]===m)return y;return D}function c(m,D,p,v,y){p.splice(m,1),v.splice(m,1);for(var w=D+1;w<y.length;w++)y[w]--}function f(m,D,p,v,y,w,E){y.splice(m,0,v),w.splice(m,0,D);for(var b=p+1;b<E.length;b++)E[b]++}i.prototype.resize=function(m,D,p){if(!vl(m))throw new TypeError("Array or Matrix expected");var v=m.valueOf().map(w=>Array.isArray(w)&&w.length===1?w[0]:w);if(v.length!==2)throw new Error("Only two dimensions matrix are supported");v.forEach(function(w){if(!at(w)||!st(w)||w<0)throw new TypeError("Invalid size, must contain positive integers (size: "+ht(v)+")")});var y=p?this.clone():this;return d(y,v[0],v[1],D)};function d(m,D,p,v){var y=v||0,w=n,E=0;yr(m._datatype)&&(w=t.find(n,[m._datatype,m._datatype])||n,E=t.convert(0,m._datatype),y=t.convert(y,m._datatype));var b=!w(y,E),S=m._size[0],A=m._size[1],C,M,T;if(p>A){for(M=A;M<p;M++)if(m._ptr[M]=m._values.length,b)for(C=0;C<S;C++)m._values.push(y),m._index.push(C);m._ptr[p]=m._values.length}else p<A&&(m._ptr.splice(p+1,A-p),m._values.splice(m._ptr[p],m._values.length),m._index.splice(m._ptr[p],m._index.length));if(A=p,D>S){if(b){var x=0;for(M=0;M<A;M++){m._ptr[M]=m._ptr[M]+x,T=m._ptr[M+1]+x;var N=0;for(C=S;C<D;C++,N++)m._values.splice(T+N,0,y),m._index.splice(T+N,0,C),x++}m._ptr[A]=m._values.length}}else if(D<S){var R=0;for(M=0;M<A;M++){m._ptr[M]=m._ptr[M]-R;var z=m._ptr[M],F=m._ptr[M+1]-R;for(T=z;T<F;T++)C=m._index[T],C>D-1&&(m._values.splice(T,1),m._index.splice(T,1),R++)}m._ptr[M]=m._values.length}return m._size[0]=D,m._size[1]=p,m}i.prototype.reshape=function(m,D){if(!yt(m))throw new TypeError("Array expected");if(m.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");m.forEach(function(L){if(!at(L)||!st(L)||L<=-2||L===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+ht(m)+")")});var p=this._size[0]*this._size[1];m=km(m,p);var v=m[0]*m[1];if(p!==v)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var y=D?this.clone():this;if(this._size[0]===m[0]&&this._size[1]===m[1])return y;for(var w=[],E=0;E<y._ptr.length;E++)for(var b=0;b<y._ptr[E+1]-y._ptr[E];b++)w.push(E);for(var S=y._values.slice(),A=y._index.slice(),C=0;C<y._index.length;C++){var M=A[C],T=w[C],x=M*y._size[1]+T;w[C]=x%m[1],A[C]=Math.floor(x/m[1])}y._values.length=0,y._index.length=0,y._ptr.length=m[1]+1,y._size=m.slice();for(var N=0;N<y._ptr.length;N++)y._ptr[N]=0;for(var R=0;R<S.length;R++){var z=A[R],F=w[R],U=S[R],I=s(z,y._ptr[F],y._ptr[F+1],y._index);f(I,z,F,U,y._values,y._index,y._ptr)}return y},i.prototype.clone=function(){var m=new i({values:this._values?Pe(this._values):void 0,index:Pe(this._index),ptr:Pe(this._ptr),size:Pe(this._size),datatype:this._datatype});return m},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(m,D){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var p=this,v=this._size[0],y=this._size[1],w=Yc(m,p,"map"),E=function(S,A,C){return w.fn(S,[A,C],p)};return h(this,0,v-1,0,y-1,E,D)};function h(m,D,p,v,y,w,E){var b=[],S=[],A=[],C=n,M=0;yr(m._datatype)&&(C=t.find(n,[m._datatype,m._datatype])||n,M=t.convert(0,m._datatype));for(var T=function(P,H,j){var q=w(P,H,j);C(q,M)||(b.push(q),S.push(H))},x=v;x<=y;x++){A.push(b.length);var N=m._ptr[x],R=m._ptr[x+1];if(E)for(var z=N;z<R;z++){var F=m._index[z];F>=D&&F<=p&&T(m._values[z],F-D,x-v)}else{for(var U={},I=N;I<R;I++){var L=m._index[I];U[L]=m._values[I]}for(var V=D;V<=p;V++){var X=V in U?U[V]:0;T(X,V-D,x-v)}}}return A.push(b.length),new i({values:b,index:S,ptr:A,size:[p-D+1,y-v+1]})}i.prototype.forEach=function(m,D){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var p=this,v=this._size[0],y=this._size[1],w=Yc(m,p,"forEach"),E=0;E<y;E++){var b=this._ptr[E],S=this._ptr[E+1];if(D)for(var A=b;A<S;A++){var C=this._index[A];w.fn(this._values[A],[C,E],p)}else{for(var M={},T=b;T<S;T++){var x=this._index[T];M[x]=this._values[T]}for(var N=0;N<v;N++){var R=N in M?M[N]:0;w.fn(R,[N,E],p)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var m=this._size[1],D=0;D<m;D++)for(var p=this._ptr[D],v=this._ptr[D+1],y=p;y<v;y++){var w=this._index[y];yield{value:this._values[y],index:[w,D]}}},i.prototype.toArray=function(){return g(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return g(this._values,this._index,this._ptr,this._size,!1)};function g(m,D,p,v,y){var w=v[0],E=v[1],b=[],S,A;for(S=0;S<w;S++)for(b[S]=[],A=0;A<E;A++)b[S][A]=0;for(A=0;A<E;A++)for(var C=p[A],M=p[A+1],T=C;T<M;T++)S=D[T],b[S][A]=m?y?Pe(m[T]):m[T]:1;return b}return i.prototype.format=function(m){for(var D=this._size[0],p=this._size[1],v=this.density(),y="Sparse Matrix ["+ht(D,m)+" x "+ht(p,m)+"] density: "+ht(v,m)+`
|
|
77
|
-
`,
|
|
78
|
-
(`+ht(A,m)+", "+ht(w,m)+") ==> "+(this._values?ht(this._values[S],m):"X")}return y},i.prototype.toString=function(){return ht(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(m){if(m){if(wt(m)&&(m=m.toNumber()),!at(m)||!st(m))throw new TypeError("The parameter k must be an integer number")}else m=0;var D=m>0?m:0,p=m<0?-m:0,v=this._size[0],y=this._size[1],w=Math.min(v-p,y-D),E=[],b=[],S=[];S[0]=0;for(var A=D;A<y&&E.length<w;A++)for(var C=this._ptr[A],M=this._ptr[A+1],T=C;T<M;T++){var x=this._index[T];if(x===A-D+p){E.push(this._values[T]),b[E.length-1]=x-p;break}}return S.push(E.length),new i({values:E,index:b,ptr:S,size:[w,1]})},i.fromJSON=function(m){return new i(m)},i.diagonal=function(m,D,p,v,y){if(!yt(m))throw new TypeError("Array expected, size parameter");if(m.length!==2)throw new Error("Only two dimensions matrix are supported");if(m=m.map(function(L){if(wt(L)&&(L=L.toNumber()),!at(L)||!st(L)||L<1)throw new Error("Size values must be positive integers");return L}),p){if(wt(p)&&(p=p.toNumber()),!at(p)||!st(p))throw new TypeError("The parameter k must be an integer number")}else p=0;var w=n,E=0;yr(y)&&(w=t.find(n,[y,y])||n,E=t.convert(0,y));var b=p>0?p:0,S=p<0?-p:0,A=m[0],C=m[1],M=Math.min(A-S,C-b),T;if(yt(D)){if(D.length!==M)throw new Error("Invalid value array length");T=function(V){return D[V]}}else if(Xe(D)){var x=D.size();if(x.length!==1||x[0]!==M)throw new Error("Invalid matrix length");T=function(V){return D.get([V])}}else T=function(){return D};for(var N=[],R=[],z=[],F=0;F<C;F++){z.push(N.length);var U=F-b;if(U>=0&&U<M){var I=T(U);w(I,E)||(R.push(U+S),N.push(I))}}return z.push(N.length),new i({values:N,index:R,ptr:z,size:[A,C]})},i.prototype.swapRows=function(m,D){if(!at(m)||!st(m)||!at(D)||!st(D))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return xt(m,this._size[0]),xt(D,this._size[0]),i._swapRows(m,D,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(m,D,p,v,y){for(var w=v[m],E=v[m+1],b=w;b<E;b++)y(p[b],D[b])},i._swapRows=function(m,D,p,v,y,w){for(var E=0;E<p;E++){var b=w[E],S=w[E+1],A=s(m,b,S,y),C=s(D,b,S,y);if(A<S&&C<S&&y[A]===m&&y[C]===D){if(v){var M=v[A];v[A]=v[C],v[C]=M}continue}if(A<S&&y[A]===m&&(C>=S||y[C]!==D)){var T=v?v[A]:void 0;y.splice(C,0,D),v&&v.splice(C,0,T),y.splice(C<=A?A+1:A,1),v&&v.splice(C<=A?A+1:A,1);continue}if(C<S&&y[C]===D&&(A>=S||y[A]!==m)){var x=v?v[C]:void 0;y.splice(A,0,m),v&&v.splice(A,0,x),y.splice(A<=C?C+1:C,1),v&&v.splice(A<=C?C+1:C,1)}}},i},{isClass:!0}),mM="number",pM=["typed"];function gM(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var n={"0b":2,"0o":8,"0x":16}[t[1]],r=t[2],i=t[3];return{input:e,radix:n,integerPart:r,fractionalPart:i}}else return null}function vM(e){for(var t=parseInt(e.integerPart,e.radix),n=0,r=0;r<e.fractionalPart.length;r++){var i=parseInt(e.fractionalPart[r],e.radix);n+=i/Math.pow(e.radix,r+1)}var a=t+n;if(isNaN(a))throw new SyntaxError('String "'+e.input+'" is not a valid number');return a}var yM=ce(mM,pM,e=>{var{typed:t}=e,n=t("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var a=gM(i);if(a)return vM(a);var o=0,u=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);u&&(o=Number(u[2]),i=u[1]);var l=Number(i);if(isNaN(l))throw new SyntaxError('String "'+i+'" is not a valid number');if(u){if(l>2**o-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));l>=2**(o-1)&&(l=l-2**o)}return l},BigNumber:function(i){return i.toNumber()},bigint:function(i){return Number(i)},Fraction:function(i){return i.valueOf()},Unit:t.referToSelf(r=>i=>{var a=i.clone();return a.value=r(i.value),a}),null:function(i){return 0},"Unit, string | Unit":function(i,a){return i.toNumber(a)},"Array | Matrix":t.referToSelf(r=>i=>En(i,r))});return n.fromJSON=function(r){return parseFloat(r.value)},n}),bM="bignumber",DM=["typed","BigNumber"],SM=ce(bM,DM,e=>{var{typed:t,BigNumber:n}=e;return t("bignumber",{"":function(){return new n(0)},number:function(i){return new n(i+"")},string:function(i){var a=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(a){var o=a[2],u=n(a[1]),l=new n(2).pow(Number(o));if(u.gt(l.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var s=new n(2).pow(Number(o)-1);return u.gte(s)?u.sub(l):u}return new n(i)},BigNumber:function(i){return i},bigint:function(i){return new n(i.toString())},Unit:t.referToSelf(r=>i=>{var a=i.clone();return a.value=r(i.value),a}),Fraction:function(i){return new n(String(i.n)).div(String(i.d)).times(String(i.s))},null:function(i){return new n(0)},"Array | Matrix":t.referToSelf(r=>i=>En(i,r))})}),wM="complex",xM=["typed","Complex"],EM=ce(wM,xM,e=>{var{typed:t,Complex:n}=e;return t("complex",{"":function(){return n.ZERO},number:function(i){return new n(i,0)},"number, number":function(i,a){return new n(i,a)},"BigNumber, BigNumber":function(i,a){return new n(i.toNumber(),a.toNumber())},Fraction:function(i){return new n(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return n(i)},null:function(i){return n(0)},Object:function(i){if("re"in i&&"im"in i)return new n(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new n(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(r=>i=>En(i,r))})}),AM="fraction",CM=["typed","Fraction"],MM=ce(AM,CM,e=>{var{typed:t,Fraction:n}=e;return t("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new n(i)},string:function(i){return new n(i)},"number, number":function(i,a){return new n(i,a)},"bigint, bigint":function(i,a){return new n(i,a)},null:function(i){return new n(0)},BigNumber:function(i){return new n(i.toString())},bigint:function(i){return new n(i.toString())},Fraction:function(i){return i},Unit:t.referToSelf(r=>i=>{var a=i.clone();return a.value=r(i.value),a}),Object:function(i){return new n(i)},"Array | Matrix":t.referToSelf(r=>i=>En(i,r))})}),ND="matrix",TM=["typed","Matrix","DenseMatrix","SparseMatrix"],_M=ce(ND,TM,e=>{var{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(ND,{"":function(){return a([])},string:function(u){return a([],u)},"string, string":function(u,l){return a([],u,l)},Array:function(u){return a(u)},Matrix:function(u){return a(u,u.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(o,u,l){if(u==="dense"||u==="default"||u===void 0)return new r(o,l);if(u==="sparse")return new i(o,l);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}}),FD="matrixFromColumns",BM=["typed","matrix","flatten","size"],NM=ce(FD,BM,e=>{var{typed:t,matrix:n,flatten:r,size:i}=e;return t(FD,{"...Array":function(l){return a(l)},"...Matrix":function(l){return n(a(l.map(s=>s.toArray())))}});function a(u){if(u.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var l=o(u[0]),s=[],c=0;c<l;c++)s[c]=[];for(var f of u){var d=o(f);if(d!==l)throw new TypeError("The vectors had different length: "+(l|0)+" ≠ "+(d|0));for(var h=r(f),g=0;g<l;g++)s[g].push(h[g])}return s}function o(u){var l=i(u);if(l.length===1)return l[0];if(l.length===2){if(l[0]===1)return l[1];if(l[1]===1)return l[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),RD="unaryMinus",FM=["typed"],RM=ce(RD,FM,e=>{var{typed:t}=e;return t(RD,{number:xD,"Complex | BigNumber | Fraction":n=>n.neg(),bigint:n=>-n,Unit:t.referToSelf(n=>r=>{var i=r.clone();return i.value=t.find(n,i.valueType())(r.value),i}),"Array | Matrix":t.referToSelf(n=>r=>En(r,n,!0))})}),OD="abs",OM=["typed"],zM=ce(OD,OM,e=>{var{typed:t}=e;return t(OD,{number:bD,"Complex | BigNumber | Fraction | Unit":n=>n.abs(),bigint:n=>n<0n?-n:n,"Array | Matrix":t.referToSelf(n=>r=>En(r,n,!0))})}),zD="addScalar",UM=["typed"],IM=ce(zD,UM,e=>{var{typed:t}=e;return t(zD,{"number, number":DD,"Complex, Complex":function(r,i){return r.add(i)},"BigNumber, BigNumber":function(r,i){return r.plus(i)},"bigint, bigint":function(r,i){return r+i},"Fraction, Fraction":function(r,i){return r.add(i)},"Unit, Unit":t.referToSelf(n=>(r,i)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(i))throw new Error("Units do not match");var a=r.clone();return a.value=t.find(n,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),UD="subtractScalar",$M=["typed"],kM=ce(UD,$M,e=>{var{typed:t}=e;return t(UD,{"number, number":SD,"Complex, Complex":function(r,i){return r.sub(i)},"BigNumber, BigNumber":function(r,i){return r.minus(i)},"bigint, bigint":function(r,i){return r-i},"Fraction, Fraction":function(r,i){return r.sub(i)},"Unit, Unit":t.referToSelf(n=>(r,i)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(i))throw new Error("Units do not match");var a=r.clone();return a.value=t.find(n,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),LM="matAlgo11xS0s",jM=["typed","equalScalar"],ID=ce(LM,jM,e=>{var{typed:t,equalScalar:n}=e;return function(i,a,o,u){var l=i._values,s=i._index,c=i._ptr,f=i._size,d=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=f[0],g=f[1],m,D=n,p=0,v=o;typeof d=="string"&&(m=d,D=t.find(n,[m,m]),p=t.convert(0,m),a=t.convert(a,m),v=t.find(o,[m,m]));for(var y=[],w=[],E=[],b=0;b<g;b++){E[b]=w.length;for(var S=c[b],A=c[b+1],C=S;C<A;C++){var M=s[C],T=u?v(a,l[C]):v(l[C],a);D(T,p)||(w.push(M),y.push(T))}}return E[g]=w.length,i.createSparseMatrix({values:y,index:w,ptr:E,size:[h,g],datatype:m})}}),PM="matAlgo12xSfs",HM=["typed","DenseMatrix"],Yo=ce(PM,HM,e=>{var{typed:t,DenseMatrix:n}=e;return function(i,a,o,u){var l=i._values,s=i._index,c=i._ptr,f=i._size,d=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=f[0],g=f[1],m,D=o;typeof d=="string"&&(m=d,a=t.convert(a,m),D=t.find(o,[m,m]));for(var p=[],v=[],y=[],w=0;w<g;w++){for(var E=w+1,b=c[w],S=c[w+1],A=b;A<S;A++){var C=s[A];v[C]=l[A],y[C]=E}for(var M=0;M<h;M++)w===0&&(p[M]=[]),y[M]===E?p[M][w]=u?D(a,v[M]):D(v[M],a):p[M][w]=u?D(a,0):D(0,a)}return new n({data:p,size:[h,g],datatype:m})}}),qM="matAlgo14xDs",GM=["typed"],qm=ce(qM,GM,e=>{var{typed:t}=e;return function(i,a,o,u){var l=i._data,s=i._size,c=i._datatype,f,d=o;typeof c=="string"&&(f=c,a=t.convert(a,f),d=t.find(o,[f,f]));var h=s.length>0?n(d,0,s,s[0],l,a,u):[];return i.createDenseMatrix({data:h,size:Pe(s),datatype:f})};function n(r,i,a,o,u,l,s){var c=[];if(i===a.length-1)for(var f=0;f<o;f++)c[f]=s?r(l,u[f]):r(u[f],l);else for(var d=0;d<o;d++)c[d]=n(r,i+1,a,a[i+1],u[d],l,s);return c}}),VM="matAlgo03xDSf",YM=["typed"],Xo=ce(VM,YM,e=>{var{typed:t}=e;return function(r,i,a,o){var u=r._data,l=r._size,s=r._datatype||r.getDataType(),c=i._values,f=i._index,d=i._ptr,h=i._size,g=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==h.length)throw new Ge(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=l[0],D=l[1],p,v=0,y=a;typeof s=="string"&&s===g&&s!=="mixed"&&(p=s,v=t.convert(0,p),y=t.find(a,[p,p]));for(var w=[],E=0;E<m;E++)w[E]=[];for(var b=[],S=[],A=0;A<D;A++){for(var C=A+1,M=d[A],T=d[A+1],x=M;x<T;x++){var N=f[x];b[N]=o?y(c[x],u[N][A]):y(u[N][A],c[x]),S[N]=C}for(var R=0;R<m;R++)S[R]===C?w[R][A]=b[R]:w[R][A]=o?y(v,u[R][A]):y(u[R][A],v)}return r.createDenseMatrix({data:w,size:[m,D],datatype:s===r._datatype&&g===i._datatype?p:void 0})}}),XM="matAlgo05xSfSf",ZM=["typed","equalScalar"],KM=ce(XM,ZM,e=>{var{typed:t,equalScalar:n}=e;return function(i,a,o){var u=i._values,l=i._index,s=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,g=a._ptr,m=a._size,D=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Ge(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var p=c[0],v=c[1],y,w=n,E=0,b=o;typeof f=="string"&&f===D&&f!=="mixed"&&(y=f,w=t.find(n,[y,y]),E=t.convert(0,y),b=t.find(o,[y,y]));var S=u&&d?[]:void 0,A=[],C=[],M=S?[]:void 0,T=S?[]:void 0,x=[],N=[],R,z,F,U;for(z=0;z<v;z++){C[z]=A.length;var I=z+1;for(F=s[z],U=s[z+1];F<U;F++)R=l[F],A.push(R),x[R]=I,M&&(M[R]=u[F]);for(F=g[z],U=g[z+1];F<U;F++)R=h[F],x[R]!==I&&A.push(R),N[R]=I,T&&(T[R]=d[F]);if(S)for(F=C[z];F<A.length;){R=A[F];var L=x[R],V=N[R];if(L===I||V===I){var X=L===I?M[R]:E,$=V===I?T[R]:E,P=b(X,$);w(P,E)?A.splice(F,1):(S.push(P),F++)}}}return C[v]=A.length,i.createSparseMatrix({values:S,index:A,ptr:C,size:[p,v],datatype:f===i._datatype&&D===a._datatype?y:void 0})}}),QM="matAlgo13xDD",WM=["typed"],JM=ce(QM,WM,e=>{var{typed:t}=e;return function(i,a,o){var u=i._data,l=i._size,s=i._datatype,c=a._data,f=a._size,d=a._datatype,h=[];if(l.length!==f.length)throw new Ge(l.length,f.length);for(var g=0;g<l.length;g++){if(l[g]!==f[g])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+f+")");h[g]=l[g]}var m,D=o;typeof s=="string"&&s===d&&(m=s,D=t.find(o,[m,m]));var p=h.length>0?n(D,0,h,h[0],u,c):[];return i.createDenseMatrix({data:p,size:h,datatype:m})};function n(r,i,a,o,u,l){var s=[];if(i===a.length-1)for(var c=0;c<o;c++)s[c]=r(u[c],l[c]);else for(var f=0;f<o;f++)s[f]=n(r,i+1,a,a[i+1],u[f],l[f]);return s}});function Kt(e,t){if(Yi(e.size(),t.size()))return[e,t];var n=cD(e.size(),t.size());return[e,t].map(r=>eT(r,n))}function eT(e,t){return Yi(e.size(),t)?e:e.create(jm(e.valueOf(),t),e.datatype())}var tT="matrixAlgorithmSuite",nT=["typed","matrix"],Ca=ce(tT,nT,e=>{var{typed:t,matrix:n}=e,r=JM({typed:t}),i=qm({typed:t});return function(o){var u=o.elop,l=o.SD||o.DS,s;u?(s={"DenseMatrix, DenseMatrix":(h,g)=>r(...Kt(h,g),u),"Array, Array":(h,g)=>r(...Kt(n(h),n(g)),u).valueOf(),"Array, DenseMatrix":(h,g)=>r(...Kt(n(h),g),u),"DenseMatrix, Array":(h,g)=>r(...Kt(h,n(g)),u)},o.SS&&(s["SparseMatrix, SparseMatrix"]=(h,g)=>o.SS(...Kt(h,g),u,!1)),o.DS&&(s["DenseMatrix, SparseMatrix"]=(h,g)=>o.DS(...Kt(h,g),u,!1),s["Array, SparseMatrix"]=(h,g)=>o.DS(...Kt(n(h),g),u,!1)),l&&(s["SparseMatrix, DenseMatrix"]=(h,g)=>l(...Kt(g,h),u,!0),s["SparseMatrix, Array"]=(h,g)=>l(...Kt(n(g),h),u,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf(h=>(g,m)=>r(...Kt(g,m),h)),"Array, Array":t.referToSelf(h=>(g,m)=>r(...Kt(n(g),n(m)),h).valueOf()),"Array, DenseMatrix":t.referToSelf(h=>(g,m)=>r(...Kt(n(g),m),h)),"DenseMatrix, Array":t.referToSelf(h=>(g,m)=>r(...Kt(g,n(m)),h))},o.SS&&(s["SparseMatrix, SparseMatrix"]=t.referToSelf(h=>(g,m)=>o.SS(...Kt(g,m),h,!1))),o.DS&&(s["DenseMatrix, SparseMatrix"]=t.referToSelf(h=>(g,m)=>o.DS(...Kt(g,m),h,!1)),s["Array, SparseMatrix"]=t.referToSelf(h=>(g,m)=>o.DS(...Kt(n(g),m),h,!1))),l&&(s["SparseMatrix, DenseMatrix"]=t.referToSelf(h=>(g,m)=>l(...Kt(m,g),h,!0)),s["SparseMatrix, Array"]=t.referToSelf(h=>(g,m)=>l(...Kt(n(m),g),h,!0))));var c=o.scalar||"any",f=o.Ds||o.Ss;f&&(u?(s["DenseMatrix,"+c]=(h,g)=>i(h,g,u,!1),s[c+", DenseMatrix"]=(h,g)=>i(g,h,u,!0),s["Array,"+c]=(h,g)=>i(n(h),g,u,!1).valueOf(),s[c+", Array"]=(h,g)=>i(n(g),h,u,!0).valueOf()):(s["DenseMatrix,"+c]=t.referToSelf(h=>(g,m)=>i(g,m,h,!1)),s[c+", DenseMatrix"]=t.referToSelf(h=>(g,m)=>i(m,g,h,!0)),s["Array,"+c]=t.referToSelf(h=>(g,m)=>i(n(g),m,h,!1).valueOf()),s[c+", Array"]=t.referToSelf(h=>(g,m)=>i(n(m),g,h,!0).valueOf())));var d=o.sS!==void 0?o.sS:o.Ss;return u?(o.Ss&&(s["SparseMatrix,"+c]=(h,g)=>o.Ss(h,g,u,!1)),d&&(s[c+", SparseMatrix"]=(h,g)=>d(g,h,u,!0))):(o.Ss&&(s["SparseMatrix,"+c]=t.referToSelf(h=>(g,m)=>o.Ss(g,m,h,!1))),d&&(s[c+", SparseMatrix"]=t.referToSelf(h=>(g,m)=>d(m,g,h,!0)))),u&&u.signatures&&T2(s,u.signatures),s}}),rT="matAlgo01xDSid",iT=["typed"],$D=ce(rT,iT,e=>{var{typed:t}=e;return function(r,i,a,o){var u=r._data,l=r._size,s=r._datatype||r.getDataType(),c=i._values,f=i._index,d=i._ptr,h=i._size,g=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==h.length)throw new Ge(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=l[0],D=l[1],p=typeof s=="string"&&s!=="mixed"&&s===g?s:void 0,v=p?t.find(a,[p,p]):a,y,w,E=[];for(y=0;y<m;y++)E[y]=[];var b=[],S=[];for(w=0;w<D;w++){for(var A=w+1,C=d[w],M=d[w+1],T=C;T<M;T++)y=f[T],b[y]=o?v(c[T],u[y][w]):v(u[y][w],c[T]),S[y]=A;for(y=0;y<m;y++)S[y]===A?E[y][w]=b[y]:E[y][w]=u[y][w]}return r.createDenseMatrix({data:E,size:[m,D],datatype:s===r._datatype&&g===i._datatype?p:void 0})}}),aT="matAlgo04xSidSid",oT=["typed","equalScalar"],uT=ce(aT,oT,e=>{var{typed:t,equalScalar:n}=e;return function(i,a,o){var u=i._values,l=i._index,s=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,g=a._ptr,m=a._size,D=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Ge(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var p=c[0],v=c[1],y,w=n,E=0,b=o;typeof f=="string"&&f===D&&f!=="mixed"&&(y=f,w=t.find(n,[y,y]),E=t.convert(0,y),b=t.find(o,[y,y]));var S=u&&d?[]:void 0,A=[],C=[],M=u&&d?[]:void 0,T=u&&d?[]:void 0,x=[],N=[],R,z,F,U,I;for(z=0;z<v;z++){C[z]=A.length;var L=z+1;for(U=s[z],I=s[z+1],F=U;F<I;F++)R=l[F],A.push(R),x[R]=L,M&&(M[R]=u[F]);for(U=g[z],I=g[z+1],F=U;F<I;F++)if(R=h[F],x[R]===L){if(M){var V=b(M[R],d[F]);w(V,E)?x[R]=null:M[R]=V}}else A.push(R),N[R]=L,T&&(T[R]=d[F]);if(M&&T)for(F=C[z];F<A.length;)R=A[F],x[R]===L?(S[F]=M[R],F++):N[R]===L?(S[F]=T[R],F++):A.splice(F,1)}return C[v]=A.length,i.createSparseMatrix({values:S,index:A,ptr:C,size:[p,v],datatype:f===i._datatype&&D===a._datatype?y:void 0})}}),lT="matAlgo10xSids",sT=["typed","DenseMatrix"],kD=ce(lT,sT,e=>{var{typed:t,DenseMatrix:n}=e;return function(i,a,o,u){var l=i._values,s=i._index,c=i._ptr,f=i._size,d=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=f[0],g=f[1],m,D=o;typeof d=="string"&&(m=d,a=t.convert(a,m),D=t.find(o,[m,m]));for(var p=[],v=[],y=[],w=0;w<g;w++){for(var E=w+1,b=c[w],S=c[w+1],A=b;A<S;A++){var C=s[A];v[C]=l[A],y[C]=E}for(var M=0;M<h;M++)w===0&&(p[M]=[]),y[M]===E?p[M][w]=u?D(a,v[M]):D(v[M],a):p[M][w]=a}return new n({data:p,size:[h,g],datatype:m})}}),cT="multiplyScalar",fT=["typed"],dT=ce(cT,fT,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":wD,"Complex, Complex":function(r,i){return r.mul(i)},"BigNumber, BigNumber":function(r,i){return r.times(i)},"bigint, bigint":function(r,i){return r*i},"Fraction, Fraction":function(r,i){return r.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(n,r)=>r.multiply(n),"Unit, number | Fraction | BigNumber | Complex | Unit":(n,r)=>n.multiply(r)})}),LD="multiply",hT=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],mT=ce(LD,hT,e=>{var{typed:t,matrix:n,addScalar:r,multiplyScalar:i,equalScalar:a,dot:o}=e,u=ID({typed:t,equalScalar:a}),l=qm({typed:t});function s(E,b){switch(E.length){case 1:switch(b.length){case 1:if(E[0]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(E[0]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+E[0]+") must match Matrix rows ("+b[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+b.length+" dimensions)")}break;case 2:switch(b.length){case 1:if(E[1]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+E[1]+") must match Vector length ("+b[0]+")");break;case 2:if(E[1]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+E[1]+") must match Matrix B rows ("+b[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+b.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+E.length+" dimensions)")}}function c(E,b,S){if(S===0)throw new Error("Cannot multiply two empty vectors");return o(E,b)}function f(E,b){if(b.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return d(E,b)}function d(E,b){var S=E._data,A=E._size,C=E._datatype||E.getDataType(),M=b._data,T=b._size,x=b._datatype||b.getDataType(),N=A[0],R=T[1],z,F=r,U=i;C&&x&&C===x&&typeof C=="string"&&C!=="mixed"&&(z=C,F=t.find(r,[z,z]),U=t.find(i,[z,z]));for(var I=[],L=0;L<R;L++){for(var V=U(S[0],M[0][L]),X=1;X<N;X++)V=F(V,U(S[X],M[X][L]));I[L]=V}return E.createDenseMatrix({data:I,size:[R],datatype:C===E._datatype&&x===b._datatype?z:void 0})}var h=t("_multiplyMatrixVector",{"DenseMatrix, any":m,"SparseMatrix, any":v}),g=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":D,"DenseMatrix, SparseMatrix":p,"SparseMatrix, DenseMatrix":y,"SparseMatrix, SparseMatrix":w});function m(E,b){var S=E._data,A=E._size,C=E._datatype||E.getDataType(),M=b._data,T=b._datatype||b.getDataType(),x=A[0],N=A[1],R,z=r,F=i;C&&T&&C===T&&typeof C=="string"&&C!=="mixed"&&(R=C,z=t.find(r,[R,R]),F=t.find(i,[R,R]));for(var U=[],I=0;I<x;I++){for(var L=S[I],V=F(L[0],M[0]),X=1;X<N;X++)V=z(V,F(L[X],M[X]));U[I]=V}return E.createDenseMatrix({data:U,size:[x],datatype:C===E._datatype&&T===b._datatype?R:void 0})}function D(E,b){var S=E._data,A=E._size,C=E._datatype||E.getDataType(),M=b._data,T=b._size,x=b._datatype||b.getDataType(),N=A[0],R=A[1],z=T[1],F,U=r,I=i;C&&x&&C===x&&typeof C=="string"&&C!=="mixed"&&C!=="mixed"&&(F=C,U=t.find(r,[F,F]),I=t.find(i,[F,F]));for(var L=[],V=0;V<N;V++){var X=S[V];L[V]=[];for(var $=0;$<z;$++){for(var P=I(X[0],M[0][$]),H=1;H<R;H++)P=U(P,I(X[H],M[H][$]));L[V][$]=P}}return E.createDenseMatrix({data:L,size:[N,z],datatype:C===E._datatype&&x===b._datatype?F:void 0})}function p(E,b){var S=E._data,A=E._size,C=E._datatype||E.getDataType(),M=b._values,T=b._index,x=b._ptr,N=b._size,R=b._datatype||b._data===void 0?b._datatype:b.getDataType();if(!M)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var z=A[0],F=N[1],U,I=r,L=i,V=a,X=0;C&&R&&C===R&&typeof C=="string"&&C!=="mixed"&&(U=C,I=t.find(r,[U,U]),L=t.find(i,[U,U]),V=t.find(a,[U,U]),X=t.convert(0,U));for(var $=[],P=[],H=[],j=b.createSparseMatrix({values:$,index:P,ptr:H,size:[z,F],datatype:C===E._datatype&&R===b._datatype?U:void 0}),q=0;q<F;q++){H[q]=P.length;var Y=x[q],te=x[q+1];if(te>Y)for(var ee=0,ne=0;ne<z;ne++){for(var ue=ne+1,W=void 0,fe=Y;fe<te;fe++){var he=T[fe];ee!==ue?(W=L(S[ne][he],M[fe]),ee=ue):W=I(W,L(S[ne][he],M[fe]))}ee===ue&&!V(W,X)&&(P.push(ne),$.push(W))}}return H[F]=P.length,j}function v(E,b){var S=E._values,A=E._index,C=E._ptr,M=E._datatype||E._data===void 0?E._datatype:E.getDataType();if(!S)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var T=b._data,x=b._datatype||b.getDataType(),N=E._size[0],R=b._size[0],z=[],F=[],U=[],I,L=r,V=i,X=a,$=0;M&&x&&M===x&&typeof M=="string"&&M!=="mixed"&&(I=M,L=t.find(r,[I,I]),V=t.find(i,[I,I]),X=t.find(a,[I,I]),$=t.convert(0,I));var P=[],H=[];U[0]=0;for(var j=0;j<R;j++){var q=T[j];if(!X(q,$))for(var Y=C[j],te=C[j+1],ee=Y;ee<te;ee++){var ne=A[ee];H[ne]?P[ne]=L(P[ne],V(q,S[ee])):(H[ne]=!0,F.push(ne),P[ne]=V(q,S[ee]))}}for(var ue=F.length,W=0;W<ue;W++){var fe=F[W];z[W]=P[fe]}return U[1]=F.length,E.createSparseMatrix({values:z,index:F,ptr:U,size:[N,1],datatype:M===E._datatype&&x===b._datatype?I:void 0})}function y(E,b){var S=E._values,A=E._index,C=E._ptr,M=E._datatype||E._data===void 0?E._datatype:E.getDataType();if(!S)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var T=b._data,x=b._datatype||b.getDataType(),N=E._size[0],R=b._size[0],z=b._size[1],F,U=r,I=i,L=a,V=0;M&&x&&M===x&&typeof M=="string"&&M!=="mixed"&&(F=M,U=t.find(r,[F,F]),I=t.find(i,[F,F]),L=t.find(a,[F,F]),V=t.convert(0,F));for(var X=[],$=[],P=[],H=E.createSparseMatrix({values:X,index:$,ptr:P,size:[N,z],datatype:M===E._datatype&&x===b._datatype?F:void 0}),j=[],q=[],Y=0;Y<z;Y++){P[Y]=$.length;for(var te=Y+1,ee=0;ee<R;ee++){var ne=T[ee][Y];if(!L(ne,V))for(var ue=C[ee],W=C[ee+1],fe=ue;fe<W;fe++){var he=A[fe];q[he]!==te?(q[he]=te,$.push(he),j[he]=I(ne,S[fe])):j[he]=U(j[he],I(ne,S[fe]))}}for(var ye=P[Y],Se=$.length,we=ye;we<Se;we++){var Ae=$[we];X[we]=j[Ae]}}return P[z]=$.length,H}function w(E,b){var S=E._values,A=E._index,C=E._ptr,M=E._datatype||E._data===void 0?E._datatype:E.getDataType(),T=b._values,x=b._index,N=b._ptr,R=b._datatype||b._data===void 0?b._datatype:b.getDataType(),z=E._size[0],F=b._size[1],U=S&&T,I,L=r,V=i;M&&R&&M===R&&typeof M=="string"&&M!=="mixed"&&(I=M,L=t.find(r,[I,I]),V=t.find(i,[I,I]));for(var X=U?[]:void 0,$=[],P=[],H=E.createSparseMatrix({values:X,index:$,ptr:P,size:[z,F],datatype:M===E._datatype&&R===b._datatype?I:void 0}),j=U?[]:void 0,q=[],Y,te,ee,ne,ue,W,fe,he,ye=0;ye<F;ye++){P[ye]=$.length;var Se=ye+1;for(ue=N[ye],W=N[ye+1],ne=ue;ne<W;ne++)if(he=x[ne],U)for(te=C[he],ee=C[he+1],Y=te;Y<ee;Y++)fe=A[Y],q[fe]!==Se?(q[fe]=Se,$.push(fe),j[fe]=V(T[ne],S[Y])):j[fe]=L(j[fe],V(T[ne],S[Y]));else for(te=C[he],ee=C[he+1],Y=te;Y<ee;Y++)fe=A[Y],q[fe]!==Se&&(q[fe]=Se,$.push(fe));if(U)for(var we=P[ye],Ae=$.length,$e=we;$e<Ae;$e++){var _e=$[$e];X[$e]=j[_e]}}return P[F]=$.length,H}return t(LD,i,{"Array, Array":t.referTo("Matrix, Matrix",E=>(b,S)=>{s(mt(b),mt(S));var A=E(n(b),n(S));return Xe(A)?A.valueOf():A}),"Matrix, Matrix":function(b,S){var A=b.size(),C=S.size();return s(A,C),A.length===1?C.length===1?c(b,S,A[0]):f(b,S):C.length===1?h(b,S):g(b,S)},"Matrix, Array":t.referTo("Matrix,Matrix",E=>(b,S)=>E(b,n(S))),"Array, Matrix":t.referToSelf(E=>(b,S)=>E(n(b,S.storage()),S)),"SparseMatrix, any":function(b,S){return u(b,S,i,!1)},"DenseMatrix, any":function(b,S){return l(b,S,i,!1)},"any, SparseMatrix":function(b,S){return u(S,b,i,!0)},"any, DenseMatrix":function(b,S){return l(S,b,i,!0)},"Array, any":function(b,S){return l(n(b),S,i,!1).valueOf()},"any, Array":function(b,S){return l(n(S),b,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(E=>(b,S,A)=>{for(var C=E(b,S),M=0;M<A.length;M++)C=E(C,A[M]);return C})})}),jD="sign",pT=["typed","BigNumber","Fraction","complex"],gT=ce(jD,pT,e=>{var{typed:t,BigNumber:n,complex:r,Fraction:i}=e;return t(jD,{number:Hm,Complex:function(o){return o.im===0?r(Hm(o.re)):o.sign()},BigNumber:function(o){return new n(o.cmp(0))},bigint:function(o){return o>0n?1n:o<0n?-1n:0n},Fraction:function(o){return o.n===0n?new i(0):new i(o.s)},"Array | Matrix":t.referToSelf(a=>o=>En(o,a,!0)),Unit:t.referToSelf(a=>o=>{if(!o._isDerived()&&o.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return t.find(a,o.valueType())(o.value)})})}),vT="sqrt",yT=["config","typed","Complex"],bT=ce(vT,yT,e=>{var{config:t,typed:n,Complex:r}=e;return n("sqrt",{number:i,Complex:function(o){return o.sqrt()},BigNumber:function(o){return!o.isNegative()||t.predictable?o.sqrt():i(o.toNumber())},Unit:function(o){return o.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||t.predictable?Math.sqrt(a):new r(a,0).sqrt()}}),PD="subtract",DT=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],ST=ce(PD,DT,e=>{var{typed:t,matrix:n,equalScalar:r,subtractScalar:i,unaryMinus:a,DenseMatrix:o,concat:u}=e,l=$D({typed:t}),s=Xo({typed:t}),c=KM({typed:t,equalScalar:r}),f=kD({typed:t,DenseMatrix:o}),d=Yo({typed:t,DenseMatrix:o}),h=Ca({typed:t,matrix:n,concat:u});return t(PD,{"any, any":i},h({elop:i,SS:c,DS:l,SD:s,Ss:d,sS:f}))}),wT="matAlgo07xSSf",xT=["typed","SparseMatrix"],wl=ce(wT,xT,e=>{var{typed:t,SparseMatrix:n}=e;return function(a,o,u){var l=a._size,s=a._datatype||a._data===void 0?a._datatype:a.getDataType(),c=o._size,f=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(l.length!==c.length)throw new Ge(l.length,c.length);if(l[0]!==c[0]||l[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+c+")");var d=l[0],h=l[1],g,m=0,D=u;typeof s=="string"&&s===f&&s!=="mixed"&&(g=s,m=t.convert(0,g),D=t.find(u,[g,g]));for(var p=[],v=[],y=new Array(h+1).fill(0),w=[],E=[],b=[],S=[],A=0;A<h;A++){var C=A+1,M=0;r(a,A,b,w,C),r(o,A,S,E,C);for(var T=0;T<d;T++){var x=b[T]===C?w[T]:m,N=S[T]===C?E[T]:m,R=D(x,N);R!==0&&R!==!1&&(v.push(T),p.push(R),M++)}y[A+1]=y[A]+M}return new n({values:p,index:v,ptr:y,size:[d,h],datatype:s===a._datatype&&f===o._datatype?g:void 0})};function r(i,a,o,u,l){for(var s=i._values,c=i._index,f=i._ptr,d=f[a],h=f[a+1];d<h;d++){var g=c[d];o[g]=l,u[g]=s[d]}}}),HD="conj",ET=["typed"],AT=ce(HD,ET,e=>{var{typed:t}=e;return t(HD,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.conjugate(),Unit:t.referToSelf(n=>r=>new r.constructor(n(r.toNumeric()),r.formatUnits())),"Array | Matrix":t.referToSelf(n=>r=>En(r,n))})}),qD="im",CT=["typed"],MT=ce(qD,CT,e=>{var{typed:t}=e;return t(qD,{number:()=>0,"BigNumber | Fraction":n=>n.mul(0),Complex:n=>n.im,"Array | Matrix":t.referToSelf(n=>r=>En(r,n))})}),GD="re",TT=["typed"],_T=ce(GD,TT,e=>{var{typed:t}=e;return t(GD,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.re,"Array | Matrix":t.referToSelf(n=>r=>En(r,n))})}),VD="concat",BT=["typed","matrix","isInteger"],NT=ce(VD,BT,e=>{var{typed:t,matrix:n,isInteger:r}=e;return t(VD,{"...Array | Matrix | number | BigNumber":function(a){var o,u=a.length,l=-1,s,c=!1,f=[];for(o=0;o<u;o++){var d=a[o];if(Xe(d)&&(c=!0),at(d)||wt(d)){if(o!==u-1)throw new Error("Dimension must be specified as last argument");if(s=l,l=d.valueOf(),!r(l))throw new TypeError("Integer number expected for dimension");if(l<0||o>0&&l>s)throw new Ji(l,s+1)}else{var h=Pe(d).valueOf(),g=mt(h);if(f[o]=h,s=l,l=g.length-1,o>0&&l!==s)throw new Ge(s+1,l+1)}}if(f.length===0)throw new SyntaxError("At least one matrix expected");for(var m=f.shift();f.length;)m=sD(m,f.shift(),l);return c?n(m):m},"...string":function(a){return a.join("")}})}),YD="column",FT=["typed","Index","matrix","range"],RT=ce(YD,FT,e=>{var{typed:t,Index:n,matrix:r,range:i}=e;return t(YD,{"Matrix, number":a,"Array, number":function(u,l){return a(r(Pe(u)),l).valueOf()}});function a(o,u){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");xt(u,o.size()[1]);var l=i(0,o.size()[0]),s=new n(l,u),c=o.subset(s);return Xe(c)?c:r([[c]])}}),XD="diag",OT=["typed","matrix","DenseMatrix","SparseMatrix"],zT=ce(XD,OT,e=>{var{typed:t,matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(XD,{Array:function(s){return a(s,0,mt(s),null)},"Array, number":function(s,c){return a(s,c,mt(s),null)},"Array, BigNumber":function(s,c){return a(s,c.toNumber(),mt(s),null)},"Array, string":function(s,c){return a(s,0,mt(s),c)},"Array, number, string":function(s,c,f){return a(s,c,mt(s),f)},"Array, BigNumber, string":function(s,c,f){return a(s,c.toNumber(),mt(s),f)},Matrix:function(s){return a(s,0,s.size(),s.storage())},"Matrix, number":function(s,c){return a(s,c,s.size(),s.storage())},"Matrix, BigNumber":function(s,c){return a(s,c.toNumber(),s.size(),s.storage())},"Matrix, string":function(s,c){return a(s,0,s.size(),c)},"Matrix, number, string":function(s,c,f){return a(s,c,s.size(),f)},"Matrix, BigNumber, string":function(s,c,f){return a(s,c.toNumber(),s.size(),f)}});function a(l,s,c,f){if(!st(s))throw new TypeError("Second parameter in function diag must be an integer");var d=s>0?s:0,h=s<0?-s:0;switch(c.length){case 1:return o(l,s,f,c[0],h,d);case 2:return u(l,s,f,c,h,d)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function o(l,s,c,f,d,h){var g=[f+d,f+h];if(c&&c!=="sparse"&&c!=="dense")throw new TypeError("Unknown matrix type ".concat(c,'"'));var m=c==="sparse"?i.diagonal(g,l,s):r.diagonal(g,l,s);return c!==null?m:m.valueOf()}function u(l,s,c,f,d,h){if(Xe(l)){var g=l.diagonal(s);return c!==null?c!==g.storage()?n(g,c):g:g.valueOf()}for(var m=Math.min(f[0]-d,f[1]-h),D=[],p=0;p<m;p++)D[p]=l[p+d][p+h];return c!==null?n(D):D}}),ZD="flatten",UT=["typed"],IT=ce(ZD,UT,e=>{var{typed:t}=e;return t(ZD,{Array:function(r){return Lm(r)},Matrix:function(r){return r.create(Lm(r.valueOf(),!0),r.datatype())}})}),KD="getMatrixDataType",$T=["typed"],kT=ce(KD,$T,e=>{var{typed:t}=e;return t(KD,{Array:function(r){return Vc(r,Ln)},Matrix:function(r){return r.getDataType()}})}),QD="identity",LT=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],jT=ce(QD,LT,e=>{var{typed:t,config:n,matrix:r,BigNumber:i,DenseMatrix:a,SparseMatrix:o}=e;return t(QD,{"":function(){return n.matrix==="Matrix"?r([]):[]},string:function(c){return r(c)},"number | BigNumber":function(c){return l(c,c,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(c,f){return l(c,c,f)},"number | BigNumber, number | BigNumber":function(c,f){return l(c,f,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(c,f,d){return l(c,f,d)},Array:function(c){return u(c)},"Array, string":function(c,f){return u(c,f)},Matrix:function(c){return u(c.valueOf(),c.storage())},"Matrix, string":function(c,f){return u(c.valueOf(),f)}});function u(s,c){switch(s.length){case 0:return c?r(c):[];case 1:return l(s[0],s[0],c);case 2:return l(s[0],s[1],c);default:throw new Error("Vector containing two values expected")}}function l(s,c,f){var d=wt(s)||wt(c)?i:null;if(wt(s)&&(s=s.toNumber()),wt(c)&&(c=c.toNumber()),!st(s)||s<1)throw new Error("Parameters in function identity must be positive integers");if(!st(c)||c<1)throw new Error("Parameters in function identity must be positive integers");var h=d?new i(1):1,g=d?new d(0):0,m=[s,c];if(f){if(f==="sparse")return o.diagonal(m,h,0,g);if(f==="dense")return a.diagonal(m,h,0,g);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var D=Gc([],m,g),p=s<c?s:c,v=0;v<p;v++)D[v][v]=h;return D}});function WD(){throw new Error('No "bignumber" implementation available')}function PT(){throw new Error('No "fraction" implementation available')}function JD(){throw new Error('No "matrix" implementation available')}var eS="range",HT=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],qT=ce(eS,HT,e=>{var{typed:t,config:n,matrix:r,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:l,add:s,isPositive:c}=e;return t(eS,{string:d,"string, boolean":d,number:function(D){throw new TypeError("Too few arguments to function range(): ".concat(D))},boolean:function(D){throw new TypeError("Unexpected type of argument 1 to function range(): ".concat(D,", number|bigint|BigNumber|Fraction"))},"number, number":function(D,p){return f(h(D,p,1,!1))},"number, number, number":function(D,p,v){return f(h(D,p,v,!1))},"number, number, boolean":function(D,p,v){return f(h(D,p,1,v))},"number, number, number, boolean":function(D,p,v,y){return f(h(D,p,v,y))},"bigint, bigint|number":function(D,p){return f(h(D,p,1n,!1))},"number, bigint":function(D,p){return f(h(BigInt(D),p,1n,!1))},"bigint, bigint|number, bigint|number":function(D,p,v){return f(h(D,p,BigInt(v),!1))},"number, bigint, bigint|number":function(D,p,v){return f(h(BigInt(D),p,BigInt(v),!1))},"bigint, bigint|number, boolean":function(D,p,v){return f(h(D,p,1n,v))},"number, bigint, boolean":function(D,p,v){return f(h(BigInt(D),p,1n,v))},"bigint, bigint|number, bigint|number, boolean":function(D,p,v,y){return f(h(D,p,BigInt(v),y))},"number, bigint, bigint|number, boolean":function(D,p,v,y){return f(h(BigInt(D),p,BigInt(v),y))},"BigNumber, BigNumber":function(D,p){var v=D.constructor;return f(h(D,p,new v(1),!1))},"BigNumber, BigNumber, BigNumber":function(D,p,v){return f(h(D,p,v,!1))},"BigNumber, BigNumber, boolean":function(D,p,v){var y=D.constructor;return f(h(D,p,new y(1),v))},"BigNumber, BigNumber, BigNumber, boolean":function(D,p,v,y){return f(h(D,p,v,y))},"Fraction, Fraction":function(D,p){return f(h(D,p,1,!1))},"Fraction, Fraction, Fraction":function(D,p,v){return f(h(D,p,v,!1))},"Fraction, Fraction, boolean":function(D,p,v){return f(h(D,p,1,v))},"Fraction, Fraction, Fraction, boolean":function(D,p,v,y){return f(h(D,p,v,y))},"Unit, Unit, Unit":function(D,p,v){return f(h(D,p,v,!1))},"Unit, Unit, Unit, boolean":function(D,p,v,y){return f(h(D,p,v,y))}});function f(m){return n.matrix==="Matrix"?r?r(m):JD():m}function d(m,D){var p=g(m);if(!p)throw new SyntaxError('String "'+m+'" is no valid range');return n.number==="BigNumber"?(i===void 0&&WD(),f(h(i(p.start),i(p.end),i(p.step)))):f(h(p.start,p.end,p.step,D))}function h(m,D,p,v){for(var y=[],w=c(p)?v?o:a:v?l:u,E=m;w(E,D);)y.push(E),E=s(E,p);return y}function g(m){var D=m.split(":"),p=D.map(function(y){return Number(y)}),v=p.some(function(y){return isNaN(y)});if(v)return null;switch(p.length){case 2:return{start:p[0],end:p[1],step:1};case 3:return{start:p[0],end:p[2],step:p[1]};default:return null}}}),tS="reshape",GT=["typed","isInteger","matrix"],VT=ce(tS,GT,e=>{var{typed:t,isInteger:n}=e;return t(tS,{"Matrix, Array":function(i,a){return i.reshape(a,!0)},"Array, Array":function(i,a){return a.forEach(function(o){if(!n(o))throw new TypeError("Invalid size for dimension: "+o)}),$m(i,a)}})}),nS="size",YT=["typed","config","?matrix"],XT=ce(nS,YT,e=>{var{typed:t,config:n,matrix:r}=e;return t(nS,{Matrix:function(a){return a.create(a.size(),"number")},Array:mt,string:function(a){return n.matrix==="Array"?[a.length]:r([a.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(a){return n.matrix==="Array"?[]:r?r([],"dense","number"):JD()}})}),rS="transpose",ZT=["typed","matrix"],KT=ce(rS,ZT,e=>{var{typed:t,matrix:n}=e;return t(rS,{Array:o=>r(n(o)).valueOf(),Matrix:r,any:Pe});function r(o){var u=o.size(),l;switch(u.length){case 1:l=o.clone();break;case 2:{var s=u[0],c=u[1];if(c===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+ht(u)+")");switch(o.storage()){case"dense":l=i(o,s,c);break;case"sparse":l=a(o,s,c);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+ht(u)+")")}return l}function i(o,u,l){for(var s=o._data,c=[],f,d=0;d<l;d++){f=c[d]=[];for(var h=0;h<u;h++)f[h]=Pe(s[h][d])}return o.createDenseMatrix({data:c,size:[l,u],datatype:o._datatype})}function a(o,u,l){for(var s=o._values,c=o._index,f=o._ptr,d=s?[]:void 0,h=[],g=[],m=[],D=0;D<u;D++)m[D]=0;var p,v,y;for(p=0,v=c.length;p<v;p++)m[c[p]]++;for(var w=0,E=0;E<u;E++)g.push(w),w+=m[E],m[E]=g[E];for(g.push(w),y=0;y<l;y++)for(var b=f[y],S=f[y+1],A=b;A<S;A++){var C=m[c[A]]++;h[C]=y,s&&(d[C]=Pe(s[A]))}return o.createSparseMatrix({values:d,index:h,ptr:g,size:[l,u],datatype:o._datatype})}}),iS="ctranspose",QT=["typed","transpose","conj"],WT=ce(iS,QT,e=>{var{typed:t,transpose:n,conj:r}=e;return t(iS,{any:function(a){return r(n(a))}})}),aS="zeros",JT=["typed","config","matrix","BigNumber"],e_=ce(aS,JT,e=>{var{typed:t,config:n,matrix:r,BigNumber:i}=e;return t(aS,{"":function(){return n.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(s){var c=s[s.length-1];if(typeof c=="string"){var f=s.pop();return a(s,f)}else return n.matrix==="Array"?a(s):a(s,"default")},Array:a,Matrix:function(s){var c=s.storage();return a(s.valueOf(),c)},"Array | Matrix, string":function(s,c){return a(s.valueOf(),c)}});function a(l,s){var c=o(l),f=c?new i(0):0;if(u(l),s){var d=r(s);return l.length>0?d.resize(l,f):d}else{var h=[];return l.length>0?Gc(h,l,f):h}}function o(l){var s=!1;return l.forEach(function(c,f,d){wt(c)&&(s=!0,d[f]=c.toNumber())}),s}function u(l){l.forEach(function(s){if(typeof s!="number"||!st(s)||s<0)throw new Error("Parameters in function zeros must be positive integers")})}});function Qc(e,t,n){var r;return String(e).includes("Unexpected type")?(r=arguments.length>2?" (type: "+Ln(n)+", value: "+JSON.stringify(n)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+r)):String(e).includes("complex numbers")?(r=arguments.length>2?" (type: "+Ln(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+r)):e}var t_="numeric",n_=["number","?bignumber","?fraction"],r_=ce(t_,n_,e=>{var{number:t,bignumber:n,fraction:r}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:o=>t(o),BigNumber:n?o=>n(o):WD,bigint:o=>BigInt(o),Fraction:r?o=>r(o):PT};return function(u){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",s=arguments.length>2?arguments[2]:void 0;if(s!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var c=Ln(u);if(!(c in i))throw new TypeError("Cannot convert "+u+' of type "'+c+'"; valid input types are '+Object.keys(i).join(", "));if(!(l in a))throw new TypeError("Cannot convert "+u+' to type "'+l+'"; valid output types are '+Object.keys(a).join(", "));return l===c?u:a[l](u)}}),oS="divideScalar",i_=["typed","numeric"],a_=ce(oS,i_,e=>{var{typed:t,numeric:n}=e;return t(oS,{"number, number":function(i,a){return i/a},"Complex, Complex":function(i,a){return i.div(a)},"BigNumber, BigNumber":function(i,a){return i.div(a)},"bigint, bigint":function(i,a){return i/a},"Fraction, Fraction":function(i,a){return i.div(a)},"Unit, number | Complex | Fraction | BigNumber | Unit":(r,i)=>r.divide(i),"number | Fraction | Complex | BigNumber, Unit":(r,i)=>i.divideInto(r)})}),uS="pow",o_=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],u_=ce(uS,o_,e=>{var{typed:t,config:n,identity:r,multiply:i,matrix:a,inv:o,number:u,fraction:l,Complex:s}=e;return t(uS,{"number, number":c,"Complex, Complex":function(g,m){return g.pow(m)},"BigNumber, BigNumber":function(g,m){return m.isInteger()||g>=0||n.predictable?g.pow(m):new s(g.toNumber(),0).pow(m.toNumber(),0)},"bigint, bigint":(h,g)=>h**g,"Fraction, Fraction":function(g,m){var D=g.pow(m);if(D!=null)return D;if(n.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c(g.valueOf(),m.valueOf())},"Array, number":f,"Array, BigNumber":function(g,m){return f(g,m.toNumber())},"Matrix, number":d,"Matrix, BigNumber":function(g,m){return d(g,m.toNumber())},"Unit, number | BigNumber":function(g,m){return g.pow(m)}});function c(h,g){if(n.predictable&&!st(g)&&h<0)try{var m=l(g),D=u(m);if((g===D||Math.abs((g-D)/g)<1e-14)&&m.d%2n===1n)return(m.n%2n===0n?1:-1)*Math.pow(-h,g)}catch{}return n.predictable&&(h<-1&&g===1/0||h>-1&&h<0&&g===-1/0)?NaN:st(g)||h>=0||n.predictable?ED(h,g):h*h<1&&g===1/0||h*h>1&&g===-1/0?0:new s(h,0).pow(g,0)}function f(h,g){if(!st(g))throw new TypeError("For A^b, b must be an integer (value is "+g+")");var m=mt(h);if(m.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+m.length+" dimensions)");if(m[0]!==m[1])throw new Error("For A^b, A must be square (size is "+m[0]+"x"+m[1]+")");if(g<0)try{return f(o(h),-g)}catch(v){throw v.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+g+")"):v}for(var D=r(m[0]).valueOf(),p=h;g>=1;)(g&1)===1&&(D=i(p,D)),g>>=1,p=i(p,p);return D}function d(h,g){return a(f(h.valueOf(),g))}});function lS(e){var{DenseMatrix:t}=e;return function(r,i,a){var o=r.size();if(o.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+ht(o)+")");var u=o[0],l=o[1];if(u!==l)throw new RangeError("Matrix must be square (size: "+ht(o)+")");var s=[];if(Xe(i)){var c=i.size(),f=i._data;if(c.length===1){if(c[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var d=0;d<u;d++)s[d]=[f[d]];return new t({data:s,size:[u,1],datatype:i._datatype})}if(c.length===2){if(c[0]!==u||c[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(A2(i)){if(a){s=[];for(var h=0;h<u;h++)s[h]=[f[h][0]];return new t({data:s,size:[u,1],datatype:i._datatype})}return i}if(C2(i)){for(var g=0;g<u;g++)s[g]=[0];for(var m=i._values,D=i._index,p=i._ptr,v=p[1],y=p[0];y<v;y++){var w=D[y];s[w][0]=m[y]}return new t({data:s,size:[u,1],datatype:i._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(yt(i)){var E=mt(i);if(E.length===1){if(E[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var b=0;b<u;b++)s[b]=[i[b]];return new t({data:s,size:[u,1]})}if(E.length===2){if(E[0]!==u||E[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var S=0;S<u;S++)s[S]=[i[S][0]];return new t({data:s,size:[u,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var sS="usolve",l_=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],s_=ce(sS,l_,e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,l=lS({DenseMatrix:u});return t(sS,{"SparseMatrix, Array | Matrix":function(d,h){return c(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return s(d,h)},"Array, Array | Matrix":function(d,h){var g=n(d),m=s(g,h);return m.valueOf()}});function s(f,d){d=l(f,d,!0);for(var h=d._data,g=f._size[0],m=f._size[1],D=[],p=f._data,v=m-1;v>=0;v--){var y=h[v][0]||0,w=void 0;if(o(y,0))w=0;else{var E=p[v][v];if(o(E,0))throw new Error("Linear system cannot be solved since matrix is singular");w=r(y,E);for(var b=v-1;b>=0;b--)h[b]=[a(h[b][0]||0,i(w,p[b][v]))]}D[v]=[w]}return new u({data:D,size:[g,1]})}function c(f,d){d=l(f,d,!0);for(var h=d._data,g=f._size[0],m=f._size[1],D=f._values,p=f._index,v=f._ptr,y=[],w=m-1;w>=0;w--){var E=h[w][0]||0;if(o(E,0))y[w]=[0];else{for(var b=0,S=[],A=[],C=v[w],M=v[w+1],T=M-1;T>=C;T--){var x=p[T];x===w?b=D[T]:x<w&&(S.push(D[T]),A.push(x))}if(o(b,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var N=r(E,b),R=0,z=A.length;R<z;R++){var F=A[R];h[F]=[a(h[F][0],i(N,S[R]))]}y[w]=[N]}}return new u({data:y,size:[g,1]})}}),cS="usolveAll",c_=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],f_=ce(cS,c_,e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,l=lS({DenseMatrix:u});return t(cS,{"SparseMatrix, Array | Matrix":function(d,h){return c(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return s(d,h)},"Array, Array | Matrix":function(d,h){var g=n(d),m=s(g,h);return m.map(D=>D.valueOf())}});function s(f,d){for(var h=[l(f,d,!0)._data.map(A=>A[0])],g=f._data,m=f._size[0],D=f._size[1],p=D-1;p>=0;p--)for(var v=h.length,y=0;y<v;y++){var w=h[y];if(o(g[p][p],0))if(o(w[p],0)){if(y===0){var b=[...w];b[p]=1;for(var S=p-1;S>=0;S--)b[S]=a(b[S],g[S][p]);h.push(b)}}else{if(y===0)return[];h.splice(y,1),y-=1,v-=1}else{w[p]=r(w[p],g[p][p]);for(var E=p-1;E>=0;E--)w[E]=a(w[E],i(w[p],g[E][p]))}}return h.map(A=>new u({data:A.map(C=>[C]),size:[m,1]}))}function c(f,d){for(var h=[l(f,d,!0)._data.map(X=>X[0])],g=f._size[0],m=f._size[1],D=f._values,p=f._index,v=f._ptr,y=m-1;y>=0;y--)for(var w=h.length,E=0;E<w;E++){for(var b=h[E],S=[],A=[],C=v[y],M=v[y+1],T=0,x=M-1;x>=C;x--){var N=p[x];N===y?T=D[x]:N<y&&(S.push(D[x]),A.push(N))}if(o(T,0))if(o(b[y],0)){if(E===0){var U=[...b];U[y]=1;for(var I=0,L=A.length;I<L;I++){var V=A[I];U[V]=a(U[V],S[I])}h.push(U)}}else{if(E===0)return[];h.splice(E,1),E-=1,w-=1}else{b[y]=r(b[y],T);for(var R=0,z=A.length;R<z;R++){var F=A[R];b[F]=a(b[F],i(b[y],S[R]))}}}return h.map(X=>new u({data:X.map($=>[$]),size:[g,1]}))}}),Wc="equal",d_=["typed","matrix","equalScalar","DenseMatrix","concat","SparseMatrix"],h_=ce(Wc,d_,e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:a,SparseMatrix:o}=e,u=Xo({typed:t}),l=wl({typed:t,SparseMatrix:o}),s=Yo({typed:t,DenseMatrix:i}),c=Ca({typed:t,matrix:n,concat:a});return t(Wc,m_({typed:t,equalScalar:r}),c({elop:r,SS:l,DS:u,Ss:s}))}),m_=ce(Wc,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Wc,{"any, any":function(i,a){return i===null?a===null:a===null?i===null:i===void 0?a===void 0:a===void 0?i===void 0:n(i,a)}})}),Jc="smaller",p_=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],g_=ce(Jc,p_,e=>{var{typed:t,config:n,bignumber:r,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:u}=e,l=Xo({typed:t}),s=wl({typed:t,SparseMatrix:u}),c=Yo({typed:t,DenseMatrix:a}),f=Ca({typed:t,matrix:i,concat:o}),d=Sl({typed:t});function h(g,m){return g.lt(m)&&!Vo(g,m,n.relTol,n.absTol)}return t(Jc,v_({typed:t,config:n}),{"boolean, boolean":(g,m)=>g<m,"BigNumber, BigNumber":h,"bigint, bigint":(g,m)=>g<m,"Fraction, Fraction":(g,m)=>g.compare(m)===-1,"Fraction, BigNumber":function(m,D){return h(r(m),D)},"BigNumber, Fraction":function(m,D){return h(m,r(D))},"Complex, Complex":function(m,D){throw new TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:s,DS:l,Ss:c}))}),v_=ce(Jc,["typed","config"],e=>{var{typed:t,config:n}=e;return t(Jc,{"number, number":function(i,a){return i<a&&!si(i,a,n.relTol,n.absTol)}})}),ef="smallerEq",y_=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],b_=ce(ef,y_,e=>{var{typed:t,config:n,matrix:r,DenseMatrix:i,concat:a,SparseMatrix:o}=e,u=Xo({typed:t}),l=wl({typed:t,SparseMatrix:o}),s=Yo({typed:t,DenseMatrix:i}),c=Ca({typed:t,matrix:r,concat:a}),f=Sl({typed:t});return t(ef,D_({typed:t,config:n}),{"boolean, boolean":(d,h)=>d<=h,"BigNumber, BigNumber":function(h,g){return h.lte(g)||Vo(h,g,n.relTol,n.absTol)},"bigint, bigint":(d,h)=>d<=h,"Fraction, Fraction":(d,h)=>d.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:u,Ss:s}))}),D_=ce(ef,["typed","config"],e=>{var{typed:t,config:n}=e;return t(ef,{"number, number":function(i,a){return i<=a||si(i,a,n.relTol,n.absTol)}})}),tf="larger",S_=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],w_=ce(tf,S_,e=>{var{typed:t,config:n,bignumber:r,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:u}=e,l=Xo({typed:t}),s=wl({typed:t,SparseMatrix:u}),c=Yo({typed:t,DenseMatrix:a}),f=Ca({typed:t,matrix:i,concat:o}),d=Sl({typed:t});function h(g,m){return g.gt(m)&&!Vo(g,m,n.relTol,n.absTol)}return t(tf,x_({typed:t,config:n}),{"boolean, boolean":(g,m)=>g>m,"BigNumber, BigNumber":h,"bigint, bigint":(g,m)=>g>m,"Fraction, Fraction":(g,m)=>g.compare(m)===1,"Fraction, BigNumber":function(m,D){return h(r(m),D)},"BigNumber, Fraction":function(m,D){return h(m,r(D))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:s,DS:l,Ss:c}))}),x_=ce(tf,["typed","config"],e=>{var{typed:t,config:n}=e;return t(tf,{"number, number":function(i,a){return i>a&&!si(i,a,n.relTol,n.absTol)}})}),nf="largerEq",E_=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],A_=ce(nf,E_,e=>{var{typed:t,config:n,matrix:r,DenseMatrix:i,concat:a,SparseMatrix:o}=e,u=Xo({typed:t}),l=wl({typed:t,SparseMatrix:o}),s=Yo({typed:t,DenseMatrix:i}),c=Ca({typed:t,matrix:r,concat:a}),f=Sl({typed:t});return t(nf,C_({typed:t,config:n}),{"boolean, boolean":(d,h)=>d>=h,"BigNumber, BigNumber":function(h,g){return h.gte(g)||Vo(h,g,n.relTol,n.absTol)},"bigint, bigint":function(h,g){return h>=g},"Fraction, Fraction":(d,h)=>d.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:u,Ss:s}))}),C_=ce(nf,["typed","config"],e=>{var{typed:t,config:n}=e;return t(nf,{"number, number":function(i,a){return i>=a||si(i,a,n.relTol,n.absTol)}})}),fS="min",M_=["typed","config","numeric","smaller","isNaN"],T_=ce(fS,M_,e=>{var{typed:t,config:n,numeric:r,smaller:i,isNaN:a}=e;return t(fS,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(s,c){return vD(s,c.valueOf(),o)},"...":function(s){if(pD(s))throw new TypeError("Scalar values expected in function min");return u(s)}});function o(l,s){try{return i(l,s)?l:s}catch(c){throw Qc(c,"min",s)}}function u(l){var s;if(gD(l,function(c){try{(a(c)||s===void 0||i(c,s))&&(s=c)}catch(f){throw Qc(f,"min",c)}}),s===void 0)throw new Error("Cannot calculate min of an empty array");return typeof s=="string"&&(s=r(s,g6(s,n))),s}}),__="ImmutableDenseMatrix",B_=["smaller","DenseMatrix"],N_=ce(__,B_,e=>{var{smaller:t,DenseMatrix:n}=e;function r(i,a){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!yr(a))throw new Error("Invalid datatype: "+a);if(Xe(i)||yt(i)){var o=new n(i,a);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(i&&yt(i.data)&&yt(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+Ln(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return r.prototype=new n,r.prototype.type="ImmutableDenseMatrix",r.prototype.isImmutableDenseMatrix=!0,r.prototype.subset=function(i){switch(arguments.length){case 1:{var a=n.prototype.subset.call(this,i);return Xe(a)?new r({data:a._data,size:a._size,datatype:a._datatype}):a}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},r.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},r.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},r.prototype.clone=function(){return new r({data:Pe(this._data),size:Pe(this._size),datatype:this._datatype})},r.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.fromJSON=function(i){return new r(i)},r.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},r.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||t(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},r.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||t(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},r},{isClass:!0}),F_="Index",R_=["ImmutableDenseMatrix","getMatrixDataType"],O_=ce(F_,R_,e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:n}=e;function r(a){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var o=0,u=arguments.length;o<u;o++){var l=arguments[o],s=yt(l),c=Xe(l),f=typeof l,d=null;if(M2(l))this._dimensions.push(l),this._isScalar=!1;else if(s||c){var h=void 0;n(l)==="boolean"?(s&&(h=i(dS(l).valueOf())),c&&(h=i(dS(l._data).valueOf())),d=l.valueOf().length):h=i(l.valueOf()),this._dimensions.push(h);var g=h.size();(g.length!==1||g[0]!==1||d!==null)&&(this._isScalar=!1)}else if(f==="number")this._dimensions.push(i([l]));else if(f==="bigint")this._dimensions.push(i([Number(l)]));else if(f==="string")this._dimensions.push(l);else throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");this._sourceSize.push(d)}}r.prototype.type="Index",r.prototype.isIndex=!0;function i(a){for(var o=0,u=a.length;o<u;o++)if(typeof a[o]!="number"||!st(a[o]))throw new TypeError("Index parameters must be positive integer numbers");return new t(a)}return r.prototype.clone=function(){var a=new r;return a._dimensions=Pe(this._dimensions),a._isScalar=this._isScalar,a._sourceSize=this._sourceSize,a},r.create=function(a){var o=new r;return r.apply(o,a),o},r.prototype.size=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];a[o]=typeof l=="string"?1:l.size()[0]}return a},r.prototype.max=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];a[o]=typeof l=="string"?l:l.max()}return a},r.prototype.min=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];a[o]=typeof l=="string"?l:l.min()}return a},r.prototype.forEach=function(a){for(var o=0,u=this._dimensions.length;o<u;o++)a(this._dimensions[o],o,this)},r.prototype.dimension=function(a){return typeof a!="number"?null:this._dimensions[a]||null},r.prototype.isObjectProperty=function(){return this._dimensions.length===1&&typeof this._dimensions[0]=="string"},r.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},r.prototype.isScalar=function(){return this._isScalar},r.prototype.toArray=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];a.push(typeof l=="string"?l:l.toArray())}return a},r.prototype.valueOf=r.prototype.toArray,r.prototype.toString=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];typeof l=="string"?a.push(JSON.stringify(l)):a.push(l.toString())}return"["+a.join(", ")+"]"},r.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},r.fromJSON=function(a){return r.create(a.dimensions)},r},{isClass:!0});function dS(e){var t=[];return e.forEach((n,r)=>{n&&t.push(r)}),t}var z_="atan",U_=["typed"],I_=ce(z_,U_,e=>{var{typed:t}=e;return t("atan",{number:function(r){return Math.atan(r)},Complex:function(r){return r.atan()},BigNumber:function(r){return r.atan()}})}),hS=ce("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(n=>r=>{if(!r.hasBase(r.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(n,r.valueType())(r.value)})}}),mS="cos",$_=["typed"],k_=ce(mS,$_,e=>{var{typed:t}=e,n=hS({typed:t});return t(mS,{number:Math.cos,"Complex | BigNumber":r=>r.cos()},n)}),pS="sin",L_=["typed"],j_=ce(pS,L_,e=>{var{typed:t}=e,n=hS({typed:t});return t(pS,{number:Math.sin,"Complex | BigNumber":r=>r.sin()},n)}),gS="add",P_=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],H_=ce(gS,P_,e=>{var{typed:t,matrix:n,addScalar:r,equalScalar:i,DenseMatrix:a,SparseMatrix:o,concat:u}=e,l=$D({typed:t}),s=uT({typed:t,equalScalar:i}),c=kD({typed:t,DenseMatrix:a}),f=Ca({typed:t,matrix:n,concat:u});return t(gS,{"any, any":r,"any, any, ...any":t.referToSelf(d=>(h,g,m)=>{for(var D=d(h,g),p=0;p<m.length;p++)D=d(D,m[p]);return D})},f({elop:r,DS:l,SS:s,Ss:c}))}),vS="norm",q_=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],G_=ce(vS,q_,e=>{var{typed:t,abs:n,add:r,pow:i,conj:a,sqrt:o,multiply:u,equalScalar:l,larger:s,smaller:c,matrix:f,ctranspose:d,eigs:h}=e;return t(vS,{number:Math.abs,Complex:function(A){return A.abs()},BigNumber:function(A){return A.abs()},boolean:function(A){return Math.abs(A)},Array:function(A){return b(f(A),2)},Matrix:function(A){return b(A,2)},"Array, number | BigNumber | string":function(A,C){return b(f(A),C)},"Matrix, number | BigNumber | string":function(A,C){return b(A,C)}});function g(S){var A=0;return S.forEach(function(C){var M=n(C);s(M,A)&&(A=M)},!0),A}function m(S){var A;return S.forEach(function(C){var M=n(C);(!A||c(M,A))&&(A=M)},!0),A||0}function D(S,A){if(A===Number.POSITIVE_INFINITY||A==="inf")return g(S);if(A===Number.NEGATIVE_INFINITY||A==="-inf")return m(S);if(A==="fro")return b(S,2);if(typeof A=="number"&&!isNaN(A)){if(!l(A,0)){var C=0;return S.forEach(function(M){C=r(i(n(M),A),C)},!0),i(C,1/A)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function p(S){var A=0;return S.forEach(function(C,M){A=r(A,u(C,a(C)))}),n(o(A))}function v(S){var A=[],C=0;return S.forEach(function(M,T){var x=T[1],N=r(A[x]||0,n(M));s(N,C)&&(C=N),A[x]=N},!0),C}function y(S){var A=S.size();if(A[0]!==A[1])throw new RangeError("Invalid matrix dimensions");var C=d(S),M=u(C,S),T=h(M).values.toArray(),x=T[T.length-1];return n(o(x))}function w(S){var A=[],C=0;return S.forEach(function(M,T){var x=T[0],N=r(A[x]||0,n(M));s(N,C)&&(C=N),A[x]=N},!0),C}function E(S,A){if(A===1)return v(S);if(A===Number.POSITIVE_INFINITY||A==="inf")return w(S);if(A==="fro")return p(S);if(A===2)return y(S);throw new Error("Unsupported parameter value "+A)}function b(S,A){var C=S.size();if(C.length===1)return D(S,A);if(C.length===2){if(C[0]&&C[1])return E(S,A);throw new RangeError("Invalid matrix dimensions")}}}),yS="dot",V_=["typed","addScalar","multiplyScalar","conj","size"],Y_=ce(yS,V_,e=>{var{typed:t,addScalar:n,multiplyScalar:r,conj:i,size:a}=e;return t(yS,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":l});function o(c,f){var d=s(c),h=s(f),g,m;if(d.length===1)g=d[0];else if(d.length===2&&d[1]===1)g=d[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+d.join(", ")+")");if(h.length===1)m=h[0];else if(h.length===2&&h[1]===1)m=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(g!==m)throw new RangeError("Vectors must have equal length ("+g+" != "+m+")");if(g===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return g}function u(c,f){var d=o(c,f),h=Xe(c)?c._data:c,g=Xe(c)?c._datatype||c.getDataType():void 0,m=Xe(f)?f._data:f,D=Xe(f)?f._datatype||f.getDataType():void 0,p=s(c).length===2,v=s(f).length===2,y=n,w=r;if(g&&D&&g===D&&typeof g=="string"&&g!=="mixed"){var E=g;y=t.find(n,[E,E]),w=t.find(r,[E,E])}if(!p&&!v){for(var b=w(i(h[0]),m[0]),S=1;S<d;S++)b=y(b,w(i(h[S]),m[S]));return b}if(!p&&v){for(var A=w(i(h[0]),m[0][0]),C=1;C<d;C++)A=y(A,w(i(h[C]),m[C][0]));return A}if(p&&!v){for(var M=w(i(h[0][0]),m[0]),T=1;T<d;T++)M=y(M,w(i(h[T][0]),m[T]));return M}if(p&&v){for(var x=w(i(h[0][0]),m[0][0]),N=1;N<d;N++)x=y(x,w(i(h[N][0]),m[N][0]));return x}}function l(c,f){o(c,f);for(var d=c._index,h=c._values,g=f._index,m=f._values,D=0,p=n,v=r,y=0,w=0;y<d.length&&w<g.length;){var E=d[y],b=g[w];if(E<b){y++;continue}if(E>b){w++;continue}E===b&&(D=p(D,v(h[y],m[w])),y++,w++)}return D}function s(c){return Xe(c)?c.size():a(c)}}),bS="qr",X_=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],Z_=ce(bS,X_,e=>{var{typed:t,matrix:n,zeros:r,identity:i,isZero:a,equal:o,sign:u,sqrt:l,conj:s,unaryMinus:c,addScalar:f,divideScalar:d,multiplyScalar:h,subtractScalar:g,complex:m}=e;return Vi(t(bS,{DenseMatrix:function(w){return p(w)},SparseMatrix:function(w){return v()},Array:function(w){var E=n(w),b=p(E);return{Q:b.Q.valueOf(),R:b.R.valueOf()}}}),{_denseQRimpl:D});function D(y){var w=y._size[0],E=y._size[1],b=i([w],"dense"),S=b._data,A=y.clone(),C=A._data,M,T,x,N=r([w],"");for(x=0;x<Math.min(E,w);++x){var R=C[x][x],z=c(o(R,0)?1:u(R)),F=s(z),U=0;for(M=x;M<w;M++)U=f(U,h(C[M][x],s(C[M][x])));var I=h(z,l(U));if(!a(I)){var L=g(R,I);for(N[x]=1,M=x+1;M<w;M++)N[M]=d(C[M][x],L);var V=c(s(d(L,I))),X=void 0;for(T=x;T<E;T++){for(X=0,M=x;M<w;M++)X=f(X,h(s(N[M]),C[M][T]));for(X=h(X,V),M=x;M<w;M++)C[M][T]=h(g(C[M][T],h(N[M],X)),F)}for(M=0;M<w;M++){for(X=0,T=x;T<w;T++)X=f(X,h(S[M][T],N[T]));for(X=h(X,V),T=x;T<w;++T)S[M][T]=d(g(S[M][T],h(X,s(N[T]))),F)}}}return{Q:b,R:A,toString:function(){return"Q: "+this.Q.toString()+`
|
|
79
|
-
R: `+this.R.toString()}}}function p(y){var w=D(y),E=w.R._data;if(y._data.length>0)for(var b=E[0][0].type==="Complex"?m(0):0,S=0;S<E.length;++S)for(var A=0;A<S&&A<(E[0]||[]).length;++A)E[S][A]=b;return w}function v(y){throw new Error("qr not implemented for sparse matrices yet")}}),DS="det",K_=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],Q_=ce(DS,K_,e=>{var{typed:t,matrix:n,subtractScalar:r,multiply:i,divideScalar:a,isZero:o,unaryMinus:u}=e;return t(DS,{any:function(c){return Pe(c)},"Array | Matrix":function(c){var f;switch(Xe(c)?f=c.size():Array.isArray(c)?(c=n(c),f=c.size()):f=[],f.length){case 0:return Pe(c);case 1:if(f[0]===1)return Pe(c.valueOf()[0]);if(f[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+ht(f)+")");case 2:{var d=f[0],h=f[1];if(d===h)return l(c.clone().valueOf(),d);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+ht(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ht(f)+")")}}});function l(s,c,f){if(c===1)return Pe(s[0][0]);if(c===2)return r(i(s[0][0],s[1][1]),i(s[1][0],s[0][1]));for(var d=!1,h=new Array(c).fill(0).map((S,A)=>A),g=0;g<c;g++){var m=h[g];if(o(s[m][g])){var D=void 0;for(D=g+1;D<c;D++)if(!o(s[h[D]][g])){m=h[D],h[D]=h[g],h[g]=m,d=!d;break}if(D===c)return s[m][g]}for(var p=s[m][g],v=g===0?1:s[h[g-1]][g-1],y=g+1;y<c;y++)for(var w=h[y],E=g+1;E<c;E++)s[w][E]=a(r(i(s[w][E],p),i(s[w][g],s[m][E])),v)}var b=s[h[c-1]][c-1];return d?u(b):b}}),SS="inv",W_=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],J_=ce(SS,W_,e=>{var{typed:t,matrix:n,divideScalar:r,addScalar:i,multiply:a,unaryMinus:o,det:u,identity:l,abs:s}=e;return t(SS,{"Array | Matrix":function(d){var h=Xe(d)?d.size():mt(d);switch(h.length){case 1:if(h[0]===1)return Xe(d)?n([r(1,d.valueOf()[0])]):[r(1,d[0])];throw new RangeError("Matrix must be square (size: "+ht(h)+")");case 2:{var g=h[0],m=h[1];if(g===m)return Xe(d)?n(c(d.valueOf(),g,m),d.storage()):c(d,g,m);throw new RangeError("Matrix must be square (size: "+ht(h)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ht(h)+")")}},any:function(d){return r(1,d)}});function c(f,d,h){var g,m,D,p,v;if(d===1){if(p=f[0][0],p===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,p)]]}else if(d===2){var y=u(f);if(y===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(f[1][1],y),r(o(f[0][1]),y)],[r(o(f[1][0]),y),r(f[0][0],y)]]}else{var w=f.concat();for(g=0;g<d;g++)w[g]=w[g].concat();for(var E=l(d).valueOf(),b=0;b<h;b++){var S=s(w[b][b]),A=b;for(g=b+1;g<d;)s(w[g][b])>S&&(S=s(w[g][b]),A=g),g++;if(S===0)throw Error("Cannot calculate inverse, determinant is zero");g=A,g!==b&&(v=w[b],w[b]=w[g],w[g]=v,v=E[b],E[b]=E[g],E[g]=v);var C=w[b],M=E[b];for(g=0;g<d;g++){var T=w[g],x=E[g];if(g!==b){if(T[b]!==0){for(D=r(o(T[b]),C[b]),m=b;m<h;m++)T[m]=i(T[m],a(D,C[m]));for(m=0;m<h;m++)x[m]=i(x[m],a(D,M[m]))}}else{for(D=C[b],m=b;m<h;m++)T[m]=r(T[m],D);for(m=0;m<h;m++)x[m]=r(x[m],D)}}}return E}}});function e9(e){var{addScalar:t,subtract:n,flatten:r,multiply:i,multiplyScalar:a,divideScalar:o,sqrt:u,abs:l,bignumber:s,diag:c,size:f,reshape:d,inv:h,qr:g,usolve:m,usolveAll:D,equal:p,complex:v,larger:y,smaller:w,matrixFromColumns:E,dot:b}=e;function S($,P,H,j){var q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,Y=A($,P,H,j,q);C($,P,H,j,q,Y);var{values:te,C:ee}=M($,P,H,j,q);if(q){var ne=T($,P,ee,Y,te,H,j);return{values:te,eigenvectors:ne}}return{values:te}}function A($,P,H,j,q){var Y=j==="BigNumber",te=j==="Complex",ee=Y?s(0):0,ne=Y?s(1):te?v(1):1,ue=Y?s(1):1,W=Y?s(10):2,fe=a(W,W),he;q&&(he=Array(P).fill(ne));for(var ye=!1;!ye;){ye=!0;for(var Se=0;Se<P;Se++){for(var we=ee,Ae=ee,$e=0;$e<P;$e++)Se!==$e&&(we=t(we,l($[$e][Se])),Ae=t(Ae,l($[Se][$e])));if(!p(we,0)&&!p(Ae,0)){for(var _e=ue,Ie=we,ge=o(Ae,W),O=a(Ae,W);w(Ie,ge);)Ie=a(Ie,fe),_e=a(_e,W);for(;y(Ie,O);)Ie=o(Ie,fe),_e=o(_e,W);var k=w(o(t(Ie,Ae),_e),a(t(we,Ae),.95));if(k){ye=!1;for(var G=o(1,_e),Z=0;Z<P;Z++)Se!==Z&&($[Se][Z]=a($[Se][Z],G),$[Z][Se]=a($[Z][Se],_e));q&&(he[Se]=a(he[Se],G))}}}}return q?c(he):null}function C($,P,H,j,q,Y){var te=j==="BigNumber",ee=j==="Complex",ne=te?s(0):ee?v(0):0;te&&(H=s(H));for(var ue=0;ue<P-2;ue++){for(var W=0,fe=ne,he=ue+1;he<P;he++){var ye=$[he][ue];w(l(fe),l(ye))&&(fe=ye,W=he)}if(!w(l(fe),H)){if(W!==ue+1){var Se=$[W];$[W]=$[ue+1],$[ue+1]=Se;for(var we=0;we<P;we++){var Ae=$[we][W];$[we][W]=$[we][ue+1],$[we][ue+1]=Ae}if(q){var $e=Y[W];Y[W]=Y[ue+1],Y[ue+1]=$e}}for(var _e=ue+2;_e<P;_e++){var Ie=o($[_e][ue],fe);if(Ie!==0){for(var ge=0;ge<P;ge++)$[_e][ge]=n($[_e][ge],a(Ie,$[ue+1][ge]));for(var O=0;O<P;O++)$[O][ue+1]=t($[O][ue+1],a(Ie,$[O][_e]));if(q)for(var k=0;k<P;k++)Y[_e][k]=n(Y[_e][k],a(Ie,Y[ue+1][k]))}}}}return Y}function M($,P,H,j,q){var Y=j==="BigNumber",te=j==="Complex",ee=Y?s(1):te?v(1):1;Y&&(H=s(H));for(var ne=Pe($),ue=[],W=P,fe=[],he=q?c(Array(P).fill(ee)):void 0,ye=q?c(Array(W).fill(ee)):void 0,Se=0;Se<=100;){Se+=1;for(var we=ne[W-1][W-1],Ae=0;Ae<W;Ae++)ne[Ae][Ae]=n(ne[Ae][Ae],we);var{Q:$e,R:_e}=g(ne);ne=i(_e,$e);for(var Ie=0;Ie<W;Ie++)ne[Ie][Ie]=t(ne[Ie][Ie],we);if(q&&(ye=i(ye,$e)),W===1||w(l(ne[W-1][W-2]),H)){Se=0,ue.push(ne[W-1][W-1]),q&&(fe.unshift([[1]]),R(ye,P),he=i(he,ye),W>1&&(ye=c(Array(W-1).fill(ee)))),W-=1,ne.pop();for(var ge=0;ge<W;ge++)ne[ge].pop()}else if(W===2||w(l(ne[W-2][W-3]),H)){Se=0;var O=x(ne[W-2][W-2],ne[W-2][W-1],ne[W-1][W-2],ne[W-1][W-1]);ue.push(...O),q&&(fe.unshift(N(ne[W-2][W-2],ne[W-2][W-1],ne[W-1][W-2],ne[W-1][W-1],O[0],O[1],H,j)),R(ye,P),he=i(he,ye),W>2&&(ye=c(Array(W-2).fill(ee)))),W-=2,ne.pop(),ne.pop();for(var k=0;k<W;k++)ne[k].pop(),ne[k].pop()}if(W===0)break}if(ue.sort((ae,J)=>+n(l(ae),l(J))),Se>100){var G=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+ue.join(", "));throw G.values=ue,G.vectors=[],G}var Z=q?i(he,z(fe,P)):void 0;return{values:ue,C:Z}}function T($,P,H,j,q,Y,te){var ee=h(H),ne=i(ee,$,H),ue=te==="BigNumber",W=te==="Complex",fe=ue?s(0):W?v(0):0,he=ue?s(1):W?v(1):1,ye=[],Se=[];for(var we of q){var Ae=F(ye,we,p);Ae===-1?(ye.push(we),Se.push(1)):Se[Ae]+=1}for(var $e=[],_e=ye.length,Ie=Array(P).fill(fe),ge=c(Array(P).fill(he)),O=function(){var Z=ye[k],ae=n(ne,i(Z,ge)),J=D(ae,Ie);for(J.shift();J.length<Se[k];){var pe=U(ae,P,J,Y,te);if(pe===null)break;J.push(pe)}var se=i(h(j),H);J=J.map(me=>i(se,me)),$e.push(...J.map(me=>({value:Z,vector:r(me)})))},k=0;k<_e;k++)O();return $e}function x($,P,H,j){var q=t($,j),Y=n(a($,j),a(P,H)),te=a(q,.5),ee=a(u(n(a(q,q),a(4,Y))),.5);return[t(te,ee),n(te,ee)]}function N($,P,H,j,q,Y,te,ee){var ne=ee==="BigNumber",ue=ee==="Complex",W=ne?s(0):ue?v(0):0,fe=ne?s(1):ue?v(1):1;if(w(l(H),te))return[[fe,W],[W,fe]];if(y(l(n(q,Y)),te))return[[n(q,j),n(Y,j)],[H,H]];var he=n($,q),ye=n(j,q);return w(l(P),te)&&w(l(ye),te)?[[he,fe],[H,W]]:[[P,W],[ye,fe]]}function R($,P){for(var H=0;H<$.length;H++)$[H].push(...Array(P-$[H].length).fill(0));for(var j=$.length;j<P;j++)$.push(Array(P).fill(0)),$[j][j]=1;return $}function z($,P){for(var H=[],j=0;j<P;j++)H[j]=Array(P).fill(0);var q=0;for(var Y of $){for(var te=Y.length,ee=0;ee<te;ee++)for(var ne=0;ne<te;ne++)H[q+ee][q+ne]=Y[ee][ne];q+=te}return H}function F($,P,H){for(var j=0;j<$.length;j++)if(H($[j],P))return j;return-1}function U($,P,H,j,q){for(var Y=q==="BigNumber"?s(1e3):1e3,te,ee=0;ee<5;++ee){te=I(P,H,q);try{te=m($,te)}catch{continue}if(y(V(te),Y))break}if(ee>=5)return null;for(ee=0;;){var ne=m($,te);if(w(V(L(te,[ne])),j))break;if(++ee>=10)return null;te=X(ne)}return te}function I($,P,H){var j=H==="BigNumber",q=H==="Complex",Y=Array($).fill(0).map(te=>2*Math.random()-1);return j&&(Y=Y.map(te=>s(te))),q&&(Y=Y.map(te=>v(te))),Y=L(Y,P),X(Y,H)}function L($,P){var H=f($);for(var j of P)j=d(j,H),$=n($,i(o(b(j,$),b(j,j)),j));return $}function V($){return l(u(b($,$)))}function X($,P){var H=P==="BigNumber",j=P==="Complex",q=H?s(1):j?v(1):1;return i(o(q,V($)),$)}return S}function t9(e){var{config:t,addScalar:n,subtract:r,abs:i,atan:a,cos:o,sin:u,multiplyScalar:l,inv:s,bignumber:c,multiply:f,add:d}=e;function h(C,M){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.relTol,x=arguments.length>3?arguments[3]:void 0,N=arguments.length>4?arguments[4]:void 0;if(x==="number")return g(C,T,N);if(x==="BigNumber")return m(C,T,N);throw TypeError("Unsupported data type: "+x)}function g(C,M,T){var x=C.length,N=Math.abs(M/x),R,z;if(T){z=new Array(x);for(var F=0;F<x;F++)z[F]=Array(x).fill(0),z[F][F]=1}for(var U=b(C);Math.abs(U[1])>=Math.abs(N);){var I=U[0][0],L=U[0][1];R=D(C[I][I],C[L][L],C[I][L]),C=E(C,R,I,L),T&&(z=v(z,R,I,L)),U=b(C)}for(var V=Array(x).fill(0),X=0;X<x;X++)V[X]=C[X][X];return A(Pe(V),z,T)}function m(C,M,T){var x=C.length,N=i(M/x),R,z;if(T){z=new Array(x);for(var F=0;F<x;F++)z[F]=Array(x).fill(0),z[F][F]=1}for(var U=S(C);i(U[1])>=i(N);){var I=U[0][0],L=U[0][1];R=p(C[I][I],C[L][L],C[I][L]),C=w(C,R,I,L),T&&(z=y(z,R,I,L)),U=S(C)}for(var V=Array(x).fill(0),X=0;X<x;X++)V[X]=C[X][X];return A(Pe(V),z,T)}function D(C,M,T){var x=M-C;return Math.abs(x)<=t.relTol?Math.PI/4:.5*Math.atan(2*T/(M-C))}function p(C,M,T){var x=r(M,C);return i(x)<=t.relTol?c(-1).acos().div(4):l(.5,a(f(2,T,s(x))))}function v(C,M,T,x){for(var N=C.length,R=Math.cos(M),z=Math.sin(M),F=Array(N).fill(0),U=Array(N).fill(0),I=0;I<N;I++)F[I]=R*C[I][T]-z*C[I][x],U[I]=z*C[I][T]+R*C[I][x];for(var L=0;L<N;L++)C[L][T]=F[L],C[L][x]=U[L];return C}function y(C,M,T,x){for(var N=C.length,R=o(M),z=u(M),F=Array(N).fill(c(0)),U=Array(N).fill(c(0)),I=0;I<N;I++)F[I]=r(l(R,C[I][T]),l(z,C[I][x])),U[I]=n(l(z,C[I][T]),l(R,C[I][x]));for(var L=0;L<N;L++)C[L][T]=F[L],C[L][x]=U[L];return C}function w(C,M,T,x){for(var N=C.length,R=c(o(M)),z=c(u(M)),F=l(R,R),U=l(z,z),I=Array(N).fill(c(0)),L=Array(N).fill(c(0)),V=f(c(2),R,z,C[T][x]),X=n(r(l(F,C[T][T]),V),l(U,C[x][x])),$=d(l(U,C[T][T]),V,l(F,C[x][x])),P=0;P<N;P++)I[P]=r(l(R,C[T][P]),l(z,C[x][P])),L[P]=n(l(z,C[T][P]),l(R,C[x][P]));C[T][T]=X,C[x][x]=$,C[T][x]=c(0),C[x][T]=c(0);for(var H=0;H<N;H++)H!==T&&H!==x&&(C[T][H]=I[H],C[H][T]=I[H],C[x][H]=L[H],C[H][x]=L[H]);return C}function E(C,M,T,x){for(var N=C.length,R=Math.cos(M),z=Math.sin(M),F=R*R,U=z*z,I=Array(N).fill(0),L=Array(N).fill(0),V=F*C[T][T]-2*R*z*C[T][x]+U*C[x][x],X=U*C[T][T]+2*R*z*C[T][x]+F*C[x][x],$=0;$<N;$++)I[$]=R*C[T][$]-z*C[x][$],L[$]=z*C[T][$]+R*C[x][$];C[T][T]=V,C[x][x]=X,C[T][x]=0,C[x][T]=0;for(var P=0;P<N;P++)P!==T&&P!==x&&(C[T][P]=I[P],C[P][T]=I[P],C[x][P]=L[P],C[P][x]=L[P]);return C}function b(C){for(var M=C.length,T=0,x=[0,1],N=0;N<M;N++)for(var R=N+1;R<M;R++)Math.abs(T)<Math.abs(C[N][R])&&(T=Math.abs(C[N][R]),x=[N,R]);return[x,T]}function S(C){for(var M=C.length,T=0,x=[0,1],N=0;N<M;N++)for(var R=N+1;R<M;R++)i(T)<i(C[N][R])&&(T=i(C[N][R]),x=[N,R]);return[x,T]}function A(C,M,T){var x=C.length,N=Array(x),R;if(T){R=Array(x);for(var z=0;z<x;z++)R[z]=Array(x)}for(var F=0;F<x;F++){for(var U=0,I=C[0],L=0;L<C.length;L++)i(C[L])<i(I)&&(U=L,I=C[U]);if(N[F]=C.splice(U,1)[0],T)for(var V=0;V<x;V++)R[F][V]=M[V][U],M[V].splice(U,1)}if(!T)return{values:N};var X=R.map(($,P)=>({value:N[P],vector:$}));return{values:N,eigenvectors:X}}return h}var n9="eigs",r9=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],i9=ce(n9,r9,e=>{var{config:t,typed:n,matrix:r,addScalar:i,subtract:a,equal:o,abs:u,atan:l,cos:s,sin:c,multiplyScalar:f,divideScalar:d,inv:h,bignumber:g,multiply:m,add:D,larger:p,column:v,flatten:y,number:w,complex:E,sqrt:b,diag:S,size:A,reshape:C,qr:M,usolve:T,usolveAll:x,im:N,re:R,smaller:z,matrixFromColumns:F,dot:U}=e,I=t9({config:t,addScalar:i,subtract:a,abs:u,atan:l,cos:s,sin:c,multiplyScalar:f,inv:h,bignumber:g,multiply:m,add:D}),L=e9({addScalar:i,subtract:a,multiply:m,multiplyScalar:f,flatten:y,divideScalar:d,sqrt:b,abs:u,bignumber:g,diag:S,size:A,reshape:C,qr:M,inv:h,usolve:T,usolveAll:x,equal:o,complex:E,larger:p,smaller:z,matrixFromColumns:F,dot:U});return n("eigs",{Array:function(Y){return V(r(Y))},"Array, number|BigNumber":function(Y,te){return V(r(Y),{precision:te})},"Array, Object"(q,Y){return V(r(q),Y)},Matrix:function(Y){return V(Y,{matricize:!0})},"Matrix, number|BigNumber":function(Y,te){return V(Y,{precision:te,matricize:!0})},"Matrix, Object":function(Y,te){var ee={matricize:!0};return Vi(ee,te),V(Y,ee)}});function V(q){var Y,te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee="eigenvectors"in te?te.eigenvectors:!0,ne=(Y=te.precision)!==null&&Y!==void 0?Y:t.relTol,ue=X(q,ne,ee);return te.matricize&&(ue.values=r(ue.values),ee&&(ue.eigenvectors=ue.eigenvectors.map(W=>{var{value:fe,vector:he}=W;return{value:fe,vector:r(he)}}))),ee&&Object.defineProperty(ue,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),ue}function X(q,Y,te){var ee=q.toArray(),ne=q.size();if(ne.length!==2||ne[0]!==ne[1])throw new RangeError("Matrix must be square (size: ".concat(ht(ne),")"));var ue=ne[0];if(P(ee,ue,Y)&&(H(ee,ue),$(ee,ue,Y))){var W=j(q,ee,ue);return I(ee,ue,Y,W,te)}var fe=j(q,ee,ue);return L(ee,ue,Y,fe,te)}function $(q,Y,te){for(var ee=0;ee<Y;ee++)for(var ne=ee;ne<Y;ne++)if(p(g(u(a(q[ee][ne],q[ne][ee]))),te))return!1;return!0}function P(q,Y,te){for(var ee=0;ee<Y;ee++)for(var ne=0;ne<Y;ne++)if(p(g(u(N(q[ee][ne]))),te))return!1;return!0}function H(q,Y){for(var te=0;te<Y;te++)for(var ee=0;ee<Y;ee++)q[te][ee]=R(q[te][ee])}function j(q,Y,te){var ee=q.datatype();if(ee==="number"||ee==="BigNumber"||ee==="Complex")return ee;for(var ne=!1,ue=!1,W=!1,fe=0;fe<te;fe++)for(var he=0;he<te;he++){var ye=Y[fe][he];if(at(ye)||xm(ye))ne=!0;else if(wt(ye))ue=!0;else if(wm(ye))W=!0;else throw TypeError("Unsupported type in Matrix: "+Ln(ye))}if(ue&&W&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),W){for(var Se=0;Se<te;Se++)for(var we=0;we<te;we++)Y[Se][we]=E(Y[Se][we]);return"Complex"}if(ue){for(var Ae=0;Ae<te;Ae++)for(var $e=0;$e<te;$e++)Y[Ae][$e]=g(Y[Ae][$e]);return"BigNumber"}if(ne){for(var _e=0;_e<te;_e++)for(var Ie=0;Ie<te;Ie++)Y[_e][Ie]=w(Y[_e][Ie]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}}),a9="divide",o9=["typed","matrix","multiply","equalScalar","divideScalar","inv"],u9=ce(a9,o9,e=>{var{typed:t,matrix:n,multiply:r,equalScalar:i,divideScalar:a,inv:o}=e,u=ID({typed:t,equalScalar:i}),l=qm({typed:t});return t("divide",T2({"Array | Matrix, Array | Matrix":function(c,f){return r(c,o(f))},"DenseMatrix, any":function(c,f){return l(c,f,a,!1)},"SparseMatrix, any":function(c,f){return u(c,f,a,!1)},"Array, any":function(c,f){return l(n(c),f,a,!1).valueOf()},"any, Array | Matrix":function(c,f){return r(c,o(f))}},a.signatures))}),wS="mean",l9=["typed","add","divide"],s9=ce(wS,l9,e=>{var{typed:t,add:n,divide:r}=e;return t(wS,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(u){if(pD(u))throw new TypeError("Scalar values expected in function mean");return a(u)}});function i(o,u){try{var l=vD(o,u,n),s=Array.isArray(o)?mt(o):o.size();return r(l,s[u])}catch(c){throw Qc(c,"mean")}}function a(o){var u,l=0;if(gD(o,function(s){try{u=u===void 0?s:n(u,s),l++}catch(c){throw Qc(c,"mean",s)}}),l===0)throw new Error("Cannot calculate the mean of an empty array");return r(u,l)}}),xl=D8({config:un}),rf=A8({}),Gm=R8({}),Vm=U8({}),An=W8({Matrix:Vm}),be=x6({BigNumber:xl,Complex:rf,DenseMatrix:An,Fraction:Gm}),El=zM({typed:be}),Zo=IM({typed:be}),c9=I_({typed:be}),Ym=EM({Complex:rf,typed:be}),af=AT({typed:be}),f9=k_({typed:be}),zr=cM({config:un,typed:be}),xS=IT({typed:be}),d9=kT({typed:be}),h9=MT({typed:be}),ES=tM({typed:be}),m9=rM({config:un,typed:be}),AS=aM({equalScalar:zr,typed:be}),Ko=dT({typed:be}),Xm=yM({typed:be}),p9=_T({typed:be}),g9=gT({BigNumber:xl,Fraction:Gm,complex:Ym,typed:be}),v9=j_({typed:be}),di=hM({Matrix:Vm,equalScalar:zr,typed:be}),Al=kM({typed:be}),Cl=SM({BigNumber:xl,typed:be}),y9=uM({typed:be}),Le=_M({DenseMatrix:An,Matrix:Vm,SparseMatrix:di,typed:be}),b9=VT({isInteger:ES,matrix:Le,typed:be}),Zm=bT({Complex:rf,config:un,typed:be}),D9=KT({matrix:Le,typed:be}),S9=e_({BigNumber:xl,config:un,matrix:Le,typed:be}),Ma=NT({isInteger:ES,matrix:Le,typed:be}),w9=WT({conj:af,transpose:D9,typed:be}),x9=zT({DenseMatrix:An,SparseMatrix:di,matrix:Le,typed:be}),CS=h_({DenseMatrix:An,SparseMatrix:di,concat:Ma,equalScalar:zr,matrix:Le,typed:be}),MS=MM({Fraction:Gm,typed:be}),Km=jT({BigNumber:xl,DenseMatrix:An,SparseMatrix:di,config:un,matrix:Le,typed:be}),E9=A_({DenseMatrix:An,SparseMatrix:di,concat:Ma,config:un,matrix:Le,typed:be}),TS=r_({bignumber:Cl,fraction:MS,number:Xm}),Qm=XT({matrix:Le,config:un,typed:be}),Ml=g_({DenseMatrix:An,SparseMatrix:di,bignumber:Cl,concat:Ma,config:un,matrix:Le,typed:be}),of=RM({typed:be}),uf=H_({DenseMatrix:An,SparseMatrix:di,addScalar:Zo,concat:Ma,equalScalar:zr,matrix:Le,typed:be}),Ta=a_({numeric:TS,typed:be}),A9=N_({DenseMatrix:An,smaller:Ml}),C9=O_({ImmutableDenseMatrix:A9,getMatrixDataType:d9}),Wm=w_({DenseMatrix:An,SparseMatrix:di,bignumber:Cl,concat:Ma,config:un,matrix:Le,typed:be}),M9=NM({flatten:xS,matrix:Le,size:Qm,typed:be}),T9=T_({config:un,isNaN:y9,numeric:TS,smaller:Ml,typed:be}),_9=Z_({addScalar:Zo,complex:Ym,conj:af,divideScalar:Ta,equal:CS,identity:Km,isZero:AS,matrix:Le,multiplyScalar:Ko,sign:g9,sqrt:Zm,subtractScalar:Al,typed:be,unaryMinus:of,zeros:S9}),B9=b_({DenseMatrix:An,SparseMatrix:di,concat:Ma,config:un,matrix:Le,typed:be}),N9=ST({DenseMatrix:An,concat:Ma,equalScalar:zr,matrix:Le,subtractScalar:Al,typed:be,unaryMinus:of}),F9=s_({DenseMatrix:An,divideScalar:Ta,equalScalar:zr,matrix:Le,multiplyScalar:Ko,subtractScalar:Al,typed:be}),_S=Y_({addScalar:Zo,conj:af,multiplyScalar:Ko,size:Qm,typed:be}),ea=mT({addScalar:Zo,dot:_S,equalScalar:zr,matrix:Le,multiplyScalar:Ko,typed:be}),R9=qT({bignumber:Cl,matrix:Le,add:uf,config:un,isPositive:m9,larger:Wm,largerEq:E9,smaller:Ml,smallerEq:B9,typed:be}),O9=f_({DenseMatrix:An,divideScalar:Ta,equalScalar:zr,matrix:Le,multiplyScalar:Ko,subtractScalar:Al,typed:be}),z9=RT({Index:C9,matrix:Le,range:R9,typed:be}),U9=Q_({divideScalar:Ta,isZero:AS,matrix:Le,multiply:ea,subtractScalar:Al,typed:be,unaryMinus:of}),Jm=J_({abs:El,addScalar:Zo,det:U9,divideScalar:Ta,identity:Km,matrix:Le,multiply:ea,typed:be,unaryMinus:of}),I9=u_({Complex:rf,config:un,fraction:MS,identity:Km,inv:Jm,matrix:Le,multiply:ea,number:Xm,typed:be}),$9=u9({divideScalar:Ta,equalScalar:zr,inv:Jm,matrix:Le,multiply:ea,typed:be}),k9=i9({abs:El,add:uf,addScalar:Zo,atan:c9,bignumber:Cl,column:z9,complex:Ym,config:un,cos:f9,diag:x9,divideScalar:Ta,dot:_S,equal:CS,flatten:xS,im:h9,inv:Jm,larger:Wm,matrix:Le,matrixFromColumns:M9,multiply:ea,multiplyScalar:Ko,number:Xm,qr:_9,re:p9,reshape:b9,sin:v9,size:Qm,smaller:Ml,sqrt:Zm,subtract:N9,typed:be,usolve:F9,usolveAll:O9}),L9=s9({add:uf,divide:$9,typed:be}),BS=G_({abs:El,add:uf,conj:af,ctranspose:w9,eigs:k9,equalScalar:zr,larger:Wm,matrix:Le,multiply:ea,pow:I9,smaller:Ml,sqrt:Zm,typed:be});Le([[0,0,0],[0,0,0]]);const lf=e=>El(e.xmax-e.xmin),NS=e=>El(e.ymax-e.ymin),FS=(e,t)=>[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.abs(e[0]-t[0]),Math.abs(e[1]-t[1])],RS=e=>({xmin:e[0],ymin:e[1],xmax:e[0]+e[2],ymax:e[1]+e[3]}),ep=(e,t)=>!(e.xmax<t.xmin||e.xmin>t.xmax||e.ymax<t.ymin||e.ymin>t.ymax),j9=(e,t)=>t.xmin<e[0]&&e[0]<t.xmax&&Math.min(t.ymin,t.ymax)<e[1]&&e[1]<Math.max(t.ymax,t.ymin),tp=(e,t)=>{t.length===2&&(t=[t[0],t[1],1]);const n=Le(e),r=Le(t);return ea(n,r).toArray()},P9=(e,t)=>e.map((n,r)=>[n,t[r]]),np=(e,t)=>{const n=Le(e),r=Le([t.map(o=>o[0]),t.map(o=>o[1]),t.map(()=>1)]),[i,a]=ea(n,r).toArray();return P9(i,a)},H9="rgba(196, 196, 196, 0.5)",OS="COMPUTE_DRAG",zS="END_DRAG",US="RESET_DRAG",q9="PARTIAL",IS=e=>{const t=e.currentTarget.getBoundingClientRect(),n=[e.clientX-t.x,e.clientY-t.y],r=e.buttons===1,i=e.shiftKey;return{type:q9,mouseButtonIsDown:r,point:n,shift:i}},G9=(e,t)=>{const{dragAnchor:n,dragRect:r}=e,{type:i,mouseButtonIsDown:a,point:o,shift:u}=t,l=4;switch(i){case US:return{isActive:!1};case zS:return{isActive:!1,dragRect:n&&o?FS(n,o):void 0,shift:u};case OS:if(!a)return{isActive:!1};if(!o)throw Error("ASSERTION FAILED: COMPUTE_DRAG but the mousemove event had no location.");return n?r||Math.abs(o[0]-n[0])>l||Math.abs(o[1]-n[1])>l?{...e,isActive:!0,dragRect:FS(n,o)}:e:{isActive:!1,dragAnchor:o};default:throw Error(`Invalid mode for drag reducer: ${i}`)}},V9=(e,t,n)=>{if(!t||!e||typeof e=="function")return;const r=e.current,i=r&&r.getContext("2d");if(i&&(i.clearRect(0,0,i.canvas.width,i.canvas.height),t.isActive)){const a=t.dragRect||[0,0,0,0];i.fillStyle=n??H9,i.fillRect(a[0],a[1],a[2],a[3])}},$S=e=>{const{nextDragStateUpdate:t,nextFrame:n,reducer:r,reducerOtherProps:i}=e;if(t.current===null)window.cancelAnimationFrame(n.current),n.current=0;else{r({...i,dragAction:t.current});const a=()=>$S(e);n.current=requestAnimationFrame(a)}t.current=null},Y9=(e,t)=>{const{nextDragStateUpdate:n,nextFrame:r}=t,i={...IS(e),type:OS};return i.mouseButtonIsDown?(n.current=i,r.current===0&&$S(t),!0):!1},X9=(e,t)=>{const{nextDragStateUpdate:n,reducer:r,reducerOtherProps:i}=t;n.current=null,r({...i,dragAction:{type:US}})},Z9=(e,t)=>{const{nextDragStateUpdate:n,reducer:r,reducerOtherProps:i}=t;n.current=null,r({...i,dragAction:{...IS(e),type:zS}})},K9=e=>{const{width:t,height:n,newState:r,dragStyle:i}=e,a=_.useRef(null),o=_.useMemo(()=>B.jsx("canvas",{ref:a,width:t,height:n,style:{position:"absolute",left:0,top:0}}),[t,n]);return V9(a,r,i),o},Q9=e=>{const t=e([0,0]),n=e([1,0]),r=e([0,1]);return[[n[0]-t[0],r[0]-t[0],t[0]],[n[1]-t[1],r[1]-t[1],t[1]],[0,0,1]]},W9=(e,t)=>{e.clearRect(0,0,t.width,t.height);for(const n of t.pixelVerticalLines||[])e.strokeStyle=n.color,e.beginPath(),e.moveTo(n.x,t.margins.top-20),e.lineTo(n.x,t.height-t.margins.bottom),e.stroke();t.barBoxes.forEach(n=>{e.fillStyle=n.color,e.fillRect(n.x1,n.y1,n.x2-n.x1,n.y2-n.y1)}),t.xLabel&&(e.textBaseline="bottom",e.textAlign="center",e.fillStyle="black",e.fillText(t.xLabel,t.width/2,t.height-3));for(const n of t.pixelTicks||[])e.strokeStyle="black",e.beginPath(),e.moveTo(n.x,t.height-t.margins.bottom),e.lineTo(n.x,t.height-t.margins.bottom+6),e.stroke(),e.textBaseline="top",e.textAlign="center",e.fillStyle="black",e.fillText(n.label,n.x,t.height-t.margins.bottom+8)},J9=e=>B.jsx(vr,{width:e.width,height:e.height,draw:W9,drawData:e}),e7={},t7=({bars:e,ticks:t,verticalLines:n,xLabel:r,onSelectRect:i,width:a,height:o})=>{const{xMin:u,xMax:l}=_.useMemo(()=>e.length>0?{xMin:e[0].xStart,xMax:e[e.length-1].xEnd}:{xMin:0,xMax:1},[e]),s=_.useMemo(()=>Math.max(...e.map(b=>b.height)),[e]),{barBoxes:c,margins:f,pixelTicks:d,pixelVerticalLines:h}=_.useMemo(()=>{const b={left:3,right:3,top:5,bottom:3+(r?13:0)+(t?13:0)},S=a-b.left-b.right,A=o-b.top-b.bottom,C=e.map(x=>({key:x.key,x1:b.left+(x.xStart-u)/(l-u)*S,x2:b.left+(x.xEnd-u)/(l-u)*S,y1:b.top+A*(1-x.height/s),y2:b.top+A,tooltip:x.tooltip,color:x.color})),M=t?t.map(x=>({x:b.left+(x.x-u)/(l-u)*S,label:`${x.label}`})):void 0,T=n?n.map(x=>({x:b.left+(x.x-u)/(l-u)*S,color:x.color})):void 0;return{barBoxes:C,margins:b,pixelTicks:M,pixelVerticalLines:T}},[e,t,n,u,l,s,a,o,r]),g=_.useCallback((b,{ctrlKey:S,shiftKey:A})=>{const C=[],M={x:b[0],y:b[1],width:b[2],height:b[3]};for(const T of c)T.x1<=M.x+M.width&&T.x2>=M.x&&C.push(T.key);i&&i(M,C,{ctrlKey:S,shiftKey:A})},[c,i]),m=_.useCallback(()=>{},[]),{onMouseMove:D,onMouseDown:p,onMouseUp:v,onMouseLeave:y,paintDragSelectLayer:w}=Tc(a,o,g,m),E=_.useMemo(()=>B.jsx(vr,{width:a,height:o,draw:w,drawData:e7}),[a,o,w]);return B.jsxs("div",{style:{width:a,height:o,position:"relative"},onMouseDown:p,onMouseMove:D,onMouseUp:v,onMouseLeave:y,children:[B.jsx(J9,{barBoxes:c,margins:f,pixelTicks:d,pixelVerticalLines:h,xLabel:r,width:a,height:o}),E]})},n7=(e={})=>{const[t,n]=_.useState(!1),[r,i]=_.useState(!1),a=_.useRef(null);return _.useEffect(()=>{const o=a.current;if(!o)return;const u=new IntersectionObserver(([l])=>{const s=l.isIntersecting;n(s),s&&!r&&i(!0)},{threshold:e.threshold||0,root:e.root||null,rootMargin:e.rootMargin||"0px"});return u.observe(o),()=>{u.unobserve(o)}},[e.threshold,e.root,e.rootMargin,r]),{elementRef:a,isVisible:t,hasBeenVisible:r}},r7=({children:e,width:t,height:n})=>{const{elementRef:r,isVisible:i}=n7({threshold:.1});return B.jsx("div",{ref:r,style:{position:"relative",width:t,height:n},children:i?e:B.jsx("span",{children:"Not visible"})})},i7=()=>{},a7=e=>{const{rowStart:t,maxItems:n,plotIds:r,selectedPlotKeys:i,currentPlotKey:a,plotsDict:o,hideBorderColorPlotKeys:u}=e,l=n||r.length,s=r.slice(t,t+l);return B.jsx("div",{style:{display:"flex",flexWrap:"wrap"},children:s.filter(c=>o[c]).map(c=>{let f="plotWrapperStyle";return u?.has(c)?f=f+" plotUnselectableStyle":f=f+" "+(a===c?"plotCurrentStyle":i?.has(c)?"plotSelectedStyle":"plotUnselectedStyle"),B.jsx("div",{style:{flex:"0 0 auto"},children:B.jsx("div",{className:f,children:o[c]})},c)})},t)},sf=({plots:e,plotComponent:t,selectedPlotKeys:n,currentPlotKey:r,numPlotsPerRow:i})=>{const a=t,o=_.useMemo(()=>{const c=new Set;for(const f of e)f.hideBorderColor&&c.add(f.key);return c},[e]),u=_.useMemo(()=>Object.assign({},...e.map(f=>{const d=f.label!==void 0?20:0,h=B.jsx("div",{"data-key":f.key,onClick:f.clickHandler||i7,children:B.jsx(r7,{width:f.props.width,height:f.props.height,children:B.jsxs("span",{children:[f.label!==void 0&&B.jsx("div",{className:"plotLabelStyle",style:{maxWidth:f.props.width,height:d,userSelect:"none"},children:B.jsx("span",{style:{color:f.labelColor},children:f.label||B.jsx("span",{children:" "})})}),B.jsx(a,{...f.props,height:f.props.height?f.props.height-d:f.props.height})]})})});return{[f.key]:h}})),[e,a]),l=Array(e.length).fill(0).map((c,f)=>f).filter(c=>c%(i||e.length)===0),s=_.useMemo(()=>e.map(c=>c.key),[e]);return B.jsx("div",{className:"PlotGrid",style:{display:"flex",flexDirection:"column"},children:l.map(c=>B.jsx(a7,{rowStart:c,maxItems:i,plotIds:s,selectedPlotKeys:n,currentPlotKey:r,hideBorderColorPlotKeys:o,plotsDict:u},`row-${c}`))})},cf=({width:e,height:t,children:n,disableScroll:r})=>{const i=_.useMemo(()=>({width:e-20,height:t,position:"relative",overflowY:r?"hidden":"auto"}),[e,t,r]);return B.jsx("div",{style:i,children:n})};var kS={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},LS=kt.createContext&&kt.createContext(kS),o7=["attr","size","title"];function u7(e,t){if(e==null)return{};var n=l7(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function l7(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ff(){return ff=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ff.apply(this,arguments)}function jS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function df(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jS(Object(n),!0).forEach(function(r){s7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s7(e,t,n){return t=c7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c7(e){var t=f7(e,"string");return typeof t=="symbol"?t:t+""}function f7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PS(e){return e&&e.map((t,n)=>kt.createElement(t.tag,df({key:n},t.attr),PS(t.child)))}function Ur(e){return t=>kt.createElement(d7,ff({attr:df({},e.attr)},t),PS(e.child))}function d7(e){var t=n=>{var{attr:r,size:i,title:a}=e,o=u7(e,o7),u=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),kt.createElement("svg",ff({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:l,style:df(df({color:e.color||n.color},n.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&kt.createElement("title",null,a),e.children)};return LS!==void 0?kt.createElement(LS.Consumer,null,n=>t(n)):t(kS)}function h7(e){return Ur({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"},child:[]}]})(e)}function m7(e){return Ur({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(e)}function p7(e){return Ur({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"},child:[]}]})(e)}function g7(e){return Ur({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"},child:[]}]})(e)}function hf(e){return Ur({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function v7(e){return Ur({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"},child:[]}]})(e)}function mf(e){return Ur({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function y7(e){return Ur({attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function HS(e){return Ur({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"},child:[]}]})(e)}function qS(e){return Ur({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"},child:[]}]})(e)}let b7=0,D7=1,rp;const Ir=e=>{rp===void 0&&(rp=GS.length);const t=(b7+e*D7)%rp;return GS[t]},GS=["#00ff00","#ff00ff","#0080ff","#ff8000","#80bf80","#470ba7","#c80b32","#fd7ee5","#027d30","#00ffff","#00ff80","#9c5a86","#808000","#8ed7fa","#80ff00","#6e52ff","#0000ff","#119c9b","#feb982","#56333d","#fb2b97","#8000ff","#c3f1a2","#b3bd25","#45bc2d","#1c4b88","#49f3c0","#a90c9c","#c436ea","#13055b","#7f93d0","#c4552d","#ee7381","#800000","#58fe60","#4f825e","#21bde8","#d7b8e0","#1e40ee","#324a01","#fc2b03","#723cb9","#3a6ac1","#aef14e","#14c568","#bd9c9b","#f9c506","#b579fa","#810e5e","#b38d4d","#854810","#02ea3a","#0b3b3c","#f90161","#07c304","#fe4c54","#be02ea","#0521bb","#338b05","#4989ff","#52b8b3","#be3271","#f1a441","#0b776b","#0ccfac","#cd61bd","#85fc95","#fe43fe","#bd810d","#cce9e6","#644179","#fedfbe","#80bd00","#99c4bd","#48e5fa","#400626","#bcfc01","#866b3f","#5422e9","#ea03bd","#69809a","#bfca76","#40e60e","#f1da52","#3d5f3b","#63b3f8","#7cd83d","#b52f02","#9364ca","#80a740","#3ce183","#a6a9f6","#fba2bb","#e3763f","#ae3cae","#91414a","#1e94cf","#06f6c9"],Tl={black:"#000",white:"#fff"},Qo={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},Wo={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Jo={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},eu={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},tu={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},_l={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},S7={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function _a(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const w7="$$material";function x7(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function E7(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var A7=function(){function e(n){var r=this;this._insertTag=function(i){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,a),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(E7(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=x7(i);try{a.insertRule(r,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e}(),cn="-ms-",pf="-moz-",Ve="-webkit-",VS="comm",ip="rule",ap="decl",C7="@import",YS="@keyframes",M7="@layer",T7=Math.abs,gf=String.fromCharCode,_7=Object.assign;function B7(e,t){return nn(e,0)^45?(((t<<2^nn(e,0))<<2^nn(e,1))<<2^nn(e,2))<<2^nn(e,3):0}function XS(e){return e.trim()}function N7(e,t){return(e=t.exec(e))?e[0]:e}function Ye(e,t,n){return e.replace(t,n)}function op(e,t){return e.indexOf(t)}function nn(e,t){return e.charCodeAt(t)|0}function Bl(e,t,n){return e.slice(t,n)}function $r(e){return e.length}function up(e){return e.length}function vf(e,t){return t.push(e),e}function F7(e,t){return e.map(t).join("")}var yf=1,nu=1,ZS=0,Cn=0,It=0,ru="";function bf(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:yf,column:nu,length:o,return:""}}function Nl(e,t){return _7(bf("",null,null,"",null,null,0),e,{length:-e.length},t)}function R7(){return It}function O7(){return It=Cn>0?nn(ru,--Cn):0,nu--,It===10&&(nu=1,yf--),It}function jn(){return It=Cn<ZS?nn(ru,Cn++):0,nu++,It===10&&(nu=1,yf++),It}function kr(){return nn(ru,Cn)}function Df(){return Cn}function Fl(e,t){return Bl(ru,e,t)}function Rl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function KS(e){return yf=nu=1,ZS=$r(ru=e),Cn=0,[]}function QS(e){return ru="",e}function Sf(e){return XS(Fl(Cn-1,lp(e===91?e+2:e===40?e+1:e)))}function z7(e){for(;(It=kr())&&It<33;)jn();return Rl(e)>2||Rl(It)>3?"":" "}function U7(e,t){for(;--t&&jn()&&!(It<48||It>102||It>57&&It<65||It>70&&It<97););return Fl(e,Df()+(t<6&&kr()==32&&jn()==32))}function lp(e){for(;jn();)switch(It){case e:return Cn;case 34:case 39:e!==34&&e!==39&&lp(It);break;case 40:e===41&&lp(e);break;case 92:jn();break}return Cn}function I7(e,t){for(;jn()&&e+It!==57;)if(e+It===84&&kr()===47)break;return"/*"+Fl(t,Cn-1)+"*"+gf(e===47?e:jn())}function $7(e){for(;!Rl(kr());)jn();return Fl(e,Cn)}function k7(e){return QS(wf("",null,null,null,[""],e=KS(e),0,[0],e))}function wf(e,t,n,r,i,a,o,u,l){for(var s=0,c=0,f=o,d=0,h=0,g=0,m=1,D=1,p=1,v=0,y="",w=i,E=a,b=r,S=y;D;)switch(g=v,v=jn()){case 40:if(g!=108&&nn(S,f-1)==58){op(S+=Ye(Sf(v),"&","&\f"),"&\f")!=-1&&(p=-1);break}case 34:case 39:case 91:S+=Sf(v);break;case 9:case 10:case 13:case 32:S+=z7(g);break;case 92:S+=U7(Df()-1,7);continue;case 47:switch(kr()){case 42:case 47:vf(L7(I7(jn(),Df()),t,n),l);break;default:S+="/"}break;case 123*m:u[s++]=$r(S)*p;case 125*m:case 59:case 0:switch(v){case 0:case 125:D=0;case 59+c:p==-1&&(S=Ye(S,/\f/g,"")),h>0&&$r(S)-f&&vf(h>32?JS(S+";",r,n,f-1):JS(Ye(S," ","")+";",r,n,f-2),l);break;case 59:S+=";";default:if(vf(b=WS(S,t,n,s,c,i,u,y,w=[],E=[],f),a),v===123)if(c===0)wf(S,t,b,b,w,a,f,u,E);else switch(d===99&&nn(S,3)===110?100:d){case 100:case 108:case 109:case 115:wf(e,b,b,r&&vf(WS(e,b,b,0,0,i,u,y,i,w=[],f),E),i,E,f,u,r?w:E);break;default:wf(S,b,b,b,[""],E,0,u,E)}}s=c=h=0,m=p=1,y=S="",f=o;break;case 58:f=1+$r(S),h=g;default:if(m<1){if(v==123)--m;else if(v==125&&m++==0&&O7()==125)continue}switch(S+=gf(v),v*m){case 38:p=c>0?1:(S+="\f",-1);break;case 44:u[s++]=($r(S)-1)*p,p=1;break;case 64:kr()===45&&(S+=Sf(jn())),d=kr(),c=f=$r(y=S+=$7(Df())),v++;break;case 45:g===45&&$r(S)==2&&(m=0)}}return a}function WS(e,t,n,r,i,a,o,u,l,s,c){for(var f=i-1,d=i===0?a:[""],h=up(d),g=0,m=0,D=0;g<r;++g)for(var p=0,v=Bl(e,f+1,f=T7(m=o[g])),y=e;p<h;++p)(y=XS(m>0?d[p]+" "+v:Ye(v,/&\f/g,d[p])))&&(l[D++]=y);return bf(e,t,n,i===0?ip:u,l,s,c)}function L7(e,t,n){return bf(e,t,n,VS,gf(R7()),Bl(e,2,-2),0)}function JS(e,t,n,r){return bf(e,t,n,ap,Bl(e,0,r),Bl(e,r+1,-1),r)}function iu(e,t){for(var n="",r=up(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function j7(e,t,n,r){switch(e.type){case M7:if(e.children.length)break;case C7:case ap:return e.return=e.return||e.value;case VS:return"";case YS:return e.return=e.value+"{"+iu(e.children,r)+"}";case ip:e.value=e.props.join(",")}return $r(n=iu(e.children,r))?e.return=e.value+"{"+n+"}":""}function P7(e){var t=up(e);return function(n,r,i,a){for(var o="",u=0;u<t;u++)o+=e[u](n,r,i,a)||"";return o}}function H7(e){return function(t){t.root||(t=t.return)&&e(t)}}function ew(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var q7=function(t,n,r){for(var i=0,a=0;i=a,a=kr(),i===38&&a===12&&(n[r]=1),!Rl(a);)jn();return Fl(t,Cn)},G7=function(t,n){var r=-1,i=44;do switch(Rl(i)){case 0:i===38&&kr()===12&&(n[r]=1),t[r]+=q7(Cn-1,n,r);break;case 2:t[r]+=Sf(i);break;case 4:if(i===44){t[++r]=kr()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=gf(i)}while(i=jn());return t},V7=function(t,n){return QS(G7(KS(t),n))},tw=new WeakMap,Y7=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!tw.get(r))&&!i){tw.set(t,!0);for(var a=[],o=V7(n,a),u=r.props,l=0,s=0;l<o.length;l++)for(var c=0;c<u.length;c++,s++)t.props[s]=a[l]?o[l].replace(/&\f/g,u[c]):u[c]+" "+o[l]}}},X7=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function nw(e,t){switch(B7(e,t)){case 5103:return Ve+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ve+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ve+e+pf+e+cn+e+e;case 6828:case 4268:return Ve+e+cn+e+e;case 6165:return Ve+e+cn+"flex-"+e+e;case 5187:return Ve+e+Ye(e,/(\w+).+(:[^]+)/,Ve+"box-$1$2"+cn+"flex-$1$2")+e;case 5443:return Ve+e+cn+"flex-item-"+Ye(e,/flex-|-self/,"")+e;case 4675:return Ve+e+cn+"flex-line-pack"+Ye(e,/align-content|flex-|-self/,"")+e;case 5548:return Ve+e+cn+Ye(e,"shrink","negative")+e;case 5292:return Ve+e+cn+Ye(e,"basis","preferred-size")+e;case 6060:return Ve+"box-"+Ye(e,"-grow","")+Ve+e+cn+Ye(e,"grow","positive")+e;case 4554:return Ve+Ye(e,/([^-])(transform)/g,"$1"+Ve+"$2")+e;case 6187:return Ye(Ye(Ye(e,/(zoom-|grab)/,Ve+"$1"),/(image-set)/,Ve+"$1"),e,"")+e;case 5495:case 3959:return Ye(e,/(image-set\([^]*)/,Ve+"$1$`$1");case 4968:return Ye(Ye(e,/(.+:)(flex-)?(.*)/,Ve+"box-pack:$3"+cn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ve+e+e;case 4095:case 3583:case 4068:case 2532:return Ye(e,/(.+)-inline(.+)/,Ve+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if($r(e)-1-t>6)switch(nn(e,t+1)){case 109:if(nn(e,t+4)!==45)break;case 102:return Ye(e,/(.+:)(.+)-([^]+)/,"$1"+Ve+"$2-$3$1"+pf+(nn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~op(e,"stretch")?nw(Ye(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(nn(e,t+1)!==115)break;case 6444:switch(nn(e,$r(e)-3-(~op(e,"!important")&&10))){case 107:return Ye(e,":",":"+Ve)+e;case 101:return Ye(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ve+(nn(e,14)===45?"inline-":"")+"box$3$1"+Ve+"$2$3$1"+cn+"$2box$3")+e}break;case 5936:switch(nn(e,t+11)){case 114:return Ve+e+cn+Ye(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ve+e+cn+Ye(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ve+e+cn+Ye(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ve+e+cn+e+e}return e}var Z7=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case ap:t.return=nw(t.value,t.length);break;case YS:return iu([Nl(t,{value:Ye(t.value,"@","@"+Ve)})],i);case ip:if(t.length)return F7(t.props,function(a){switch(N7(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return iu([Nl(t,{props:[Ye(a,/:(read-\w+)/,":"+pf+"$1")]})],i);case"::placeholder":return iu([Nl(t,{props:[Ye(a,/:(plac\w+)/,":"+Ve+"input-$1")]}),Nl(t,{props:[Ye(a,/:(plac\w+)/,":"+pf+"$1")]}),Nl(t,{props:[Ye(a,/:(plac\w+)/,cn+"input-$1")]})],i)}return""})}},K7=[Z7],Q7=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var D=m.getAttribute("data-emotion");D.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||K7,a={},o,u=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var D=m.getAttribute("data-emotion").split(" "),p=1;p<D.length;p++)a[D[p]]=!0;u.push(m)});var l,s=[Y7,X7];{var c,f=[j7,H7(function(m){c.insert(m)})],d=P7(s.concat(i,f)),h=function(D){return iu(k7(D),d)};l=function(D,p,v,y){c=v,h(D?D+"{"+p.styles+"}":p.styles),y&&(g.inserted[p.name]=!0)}}var g={key:n,sheet:new A7({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return g.sheet.hydrate(u),g},rw={exports:{}},Qe={};/** @license React v16.13.1
|
|
63
|
+
*/var so=9e15,Mi=1e9,Sh="0123456789abcdef",Ks="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ws="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",xh={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-so,maxE:so,crypto:!1},jy,Gr,Ae=!0,Js="[DecimalError] ",_i=Js+"Invalid argument: ",Hy=Js+"Precision limit exceeded",Py=Js+"crypto unavailable",qy="[object Decimal]",Jt=Math.floor,Ut=Math.pow,IC=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,$C=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,kC=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Vy=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,or=1e7,xe=7,LC=9007199254740991,jC=Ks.length-1,wh=Ws.length-1,ie={toStringTag:qy};ie.absoluteValue=ie.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),be(e)},ie.ceil=function(){return be(new this.constructor(this),this.e+1,2)},ie.clampedTo=ie.clamp=function(e,t){var n,r=this,i=r.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(_i+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new i(r)},ie.comparedTo=ie.cmp=function(e){var t,n,r,i,a=this,o=a.d,u=(e=new a.constructor(e)).d,l=a.s,s=e.s;if(!o||!u)return!l||!s?NaN:l!==s?l:o===u?0:!o^l<0?1:-1;if(!o[0]||!u[0])return o[0]?l:u[0]?-s:0;if(l!==s)return l;if(a.e!==e.e)return a.e>e.e^l<0?1:-1;for(r=o.length,i=u.length,t=0,n=r<i?r:i;t<n;++t)if(o[t]!==u[t])return o[t]>u[t]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1},ie.cosine=ie.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+xe,r.rounding=1,n=HC(r,Ky(r,n)),r.precision=e,r.rounding=t,be(Gr==2||Gr==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)},ie.cubeRoot=ie.cbrt=function(){var e,t,n,r,i,a,o,u,l,s,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(Ae=!1,a=c.s*Ut(c.s*c,1/3),!a||Math.abs(a)==1/0?(n=Xt(c.d),e=c.e,(a=(e-n.length+1)%3)&&(n+=a==1||a==-2?"0":"00"),a=Ut(n,1/3),e=Jt((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?n="5e"+e:(n=a.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new f(n),r.s=c.s):r=new f(a.toString()),o=(e=f.precision)+3;;)if(u=r,l=u.times(u).times(u),s=l.plus(c),r=tt(s.plus(c).times(u),s.plus(l),o+2,1),Xt(u.d).slice(0,o)===(n=Xt(r.d)).slice(0,o))if(n=n.slice(o-3,o+1),n=="9999"||!i&&n=="4999"){if(!i&&(be(u,e+1,0),u.times(u).times(u).eq(c))){r=u;break}o+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(be(r,e+1,1),t=!r.times(r).times(r).eq(c));break}return Ae=!0,be(r,e,f.rounding,t)},ie.decimalPlaces=ie.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-Jt(this.e/xe))*xe,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},ie.dividedBy=ie.div=function(e){return tt(this,new this.constructor(e))},ie.dividedToIntegerBy=ie.divToInt=function(e){var t=this,n=t.constructor;return be(tt(t,new n(e),0,1,1),n.precision,n.rounding)},ie.equals=ie.eq=function(e){return this.cmp(e)===0},ie.floor=function(){return be(new this.constructor(this),this.e+1,3)},ie.greaterThan=ie.gt=function(e){return this.cmp(e)>0},ie.greaterThanOrEqualTo=ie.gte=function(e){var t=this.cmp(e);return t==1||t===0},ie.hyperbolicCosine=ie.cosh=function(){var e,t,n,r,i,a=this,o=a.constructor,u=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return u;n=o.precision,r=o.rounding,o.precision=n+Math.max(a.e,a.sd())+4,o.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),t=(1/ic(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),a=co(o,1,a.times(t),new o(1),!0);for(var l,s=e,c=new o(8);s--;)l=a.times(a),a=u.minus(l.times(c.minus(l.times(c))));return be(a,o.precision=n,o.rounding=r,!0)},ie.hyperbolicSine=ie.sinh=function(){var e,t,n,r,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,r=i.d.length,r<3)i=co(a,2,i,i,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,i=i.times(1/ic(5,e)),i=co(a,2,i,i,!0);for(var o,u=new a(5),l=new a(16),s=new a(20);e--;)o=i.times(i),i=i.times(u.plus(o.times(l.times(o).plus(s))))}return a.precision=t,a.rounding=n,be(i,t,n,!0)},ie.hyperbolicTangent=ie.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,tt(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},ie.inverseCosine=ie.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return n!==-1?n===0?e.isNeg()?Dr(t,r,i):new t(0):new t(NaN):e.isZero()?Dr(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2))},ie.inverseHyperbolicCosine=ie.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,Ae=!1,n=n.times(n).minus(1).sqrt().plus(n),Ae=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},ie.inverseHyperbolicSine=ie.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,Ae=!1,n=n.times(n).plus(1).sqrt().plus(n),Ae=!0,r.precision=e,r.rounding=t,n.ln())},ie.inverseHyperbolicTangent=ie.atanh=function(){var e,t,n,r,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?be(new a(i),e,t,!0):(a.precision=n=r-i.e,i=tt(i.plus(1),new a(1).minus(i),n+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},ie.inverseSine=ie.asin=function(){var e,t,n,r,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),n=a.precision,r=a.rounding,t!==-1?t===0?(e=Dr(a,n+4,r).times(.5),e.s=i.s,e):new a(NaN):(a.precision=n+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,i.times(2)))},ie.inverseTangent=ie.atan=function(){var e,t,n,r,i,a,o,u,l,s=this,c=s.constructor,f=c.precision,d=c.rounding;if(s.isFinite()){if(s.isZero())return new c(s);if(s.abs().eq(1)&&f+4<=wh)return o=Dr(c,f+4,d).times(.25),o.s=s.s,o}else{if(!s.s)return new c(NaN);if(f+4<=wh)return o=Dr(c,f+4,d).times(.5),o.s=s.s,o}for(c.precision=u=f+10,c.rounding=1,n=Math.min(28,u/xe+2|0),e=n;e;--e)s=s.div(s.times(s).plus(1).sqrt().plus(1));for(Ae=!1,t=Math.ceil(u/xe),r=1,l=s.times(s),o=new c(s),i=s;e!==-1;)if(i=i.times(l),a=o.minus(i.div(r+=2)),i=i.times(l),o=a.plus(i.div(r+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===a.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),Ae=!0,be(o,c.precision=f,c.rounding=d,!0)},ie.isFinite=function(){return!!this.d},ie.isInteger=ie.isInt=function(){return!!this.d&&Jt(this.e/xe)>this.d.length-2},ie.isNaN=function(){return!this.s},ie.isNegative=ie.isNeg=function(){return this.s<0},ie.isPositive=ie.isPos=function(){return this.s>0},ie.isZero=function(){return!!this.d&&this.d[0]===0},ie.lessThan=ie.lt=function(e){return this.cmp(e)<0},ie.lessThanOrEqualTo=ie.lte=function(e){return this.cmp(e)<1},ie.logarithm=ie.log=function(e){var t,n,r,i,a,o,u,l,s=this,c=s.constructor,f=c.precision,d=c.rounding,h=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(n=s.d,s.s<0||!n||!n[0]||s.eq(1))return new c(n&&!n[0]?-1/0:s.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)a=!0;else{for(i=n[0];i%10===0;)i/=10;a=i!==1}if(Ae=!1,u=f+h,o=Fi(s,u),r=t?nc(c,u+10):Fi(e,u),l=tt(o,r,u,1),Hu(l.d,i=f,d))do if(u+=10,o=Fi(s,u),r=t?nc(c,u+10):Fi(e,u),l=tt(o,r,u,1),!a){+Xt(l.d).slice(i+1,i+15)+1==1e14&&(l=be(l,f+1,0));break}while(Hu(l.d,i+=10,d));return Ae=!0,be(l,f,d)},ie.minus=ie.sub=function(e){var t,n,r,i,a,o,u,l,s,c,f,d,h=this,v=h.constructor;if(e=new v(e),!h.d||!e.d)return!h.s||!e.s?e=new v(NaN):h.d?e.s=-e.s:e=new v(e.d||h.s!==e.s?h:NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(s=h.d,d=e.d,u=v.precision,l=v.rounding,!s[0]||!d[0]){if(d[0])e.s=-e.s;else if(s[0])e=new v(h);else return new v(l===3?-0:0);return Ae?be(e,u,l):e}if(n=Jt(e.e/xe),c=Jt(h.e/xe),s=s.slice(),a=c-n,a){for(f=a<0,f?(t=s,a=-a,o=d.length):(t=d,n=c,o=s.length),r=Math.max(Math.ceil(u/xe),o)+2,a>r&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for(r=s.length,o=d.length,f=r<o,f&&(o=r),r=0;r<o;r++)if(s[r]!=d[r]){f=s[r]<d[r];break}a=0}for(f&&(t=s,s=d,d=t,e.s=-e.s),o=s.length,r=d.length-o;r>0;--r)s[o++]=0;for(r=d.length;r>a;){if(s[--r]<d[r]){for(i=r;i&&s[--i]===0;)s[i]=or-1;--s[i],s[r]+=or}s[r]-=d[r]}for(;s[--o]===0;)s.pop();for(;s[0]===0;s.shift())--n;return s[0]?(e.d=s,e.e=tc(s,n),Ae?be(e,u,l):e):new v(l===3?-0:0)},ie.modulo=ie.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?be(new r(n),r.precision,r.rounding):(Ae=!1,r.modulo==9?(t=tt(n,e.abs(),0,3,1),t.s*=e.s):t=tt(n,e,0,r.modulo,1),t=t.times(e),Ae=!0,n.minus(t))},ie.naturalExponential=ie.exp=function(){return Eh(this)},ie.naturalLogarithm=ie.ln=function(){return Fi(this)},ie.negated=ie.neg=function(){var e=new this.constructor(this);return e.s=-e.s,be(e)},ie.plus=ie.add=function(e){var t,n,r,i,a,o,u,l,s,c,f=this,d=f.constructor;if(e=new d(e),!f.d||!e.d)return!f.s||!e.s?e=new d(NaN):f.d||(e=new d(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(s=f.d,c=e.d,u=d.precision,l=d.rounding,!s[0]||!c[0])return c[0]||(e=new d(f)),Ae?be(e,u,l):e;if(a=Jt(f.e/xe),r=Jt(e.e/xe),s=s.slice(),i=a-r,i){for(i<0?(n=s,i=-i,o=c.length):(n=c,r=a,o=s.length),a=Math.ceil(u/xe),o=a>o?a+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=s.length,i=c.length,o-i<0&&(i=o,n=c,c=s,s=n),t=0;i;)t=(s[--i]=s[i]+c[i]+t)/or|0,s[i]%=or;for(t&&(s.unshift(t),++r),o=s.length;s[--o]==0;)s.pop();return e.d=s,e.e=tc(s,r),Ae?be(e,u,l):e},ie.precision=ie.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(_i+e);return n.d?(t=Gy(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},ie.round=function(){var e=this,t=e.constructor;return be(new t(e),e.e+1,t.rounding)},ie.sine=ie.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+xe,r.rounding=1,n=qC(r,Ky(r,n)),r.precision=e,r.rounding=t,be(Gr>2?n.neg():n,e,t,!0)):new r(NaN)},ie.squareRoot=ie.sqrt=function(){var e,t,n,r,i,a,o=this,u=o.d,l=o.e,s=o.s,c=o.constructor;if(s!==1||!u||!u[0])return new c(!s||s<0&&(!u||u[0])?NaN:u?o:1/0);for(Ae=!1,s=Math.sqrt(+o),s==0||s==1/0?(t=Xt(u),(t.length+l)%2==0&&(t+="0"),s=Math.sqrt(t),l=Jt((l+1)/2)-(l<0||l%2),s==1/0?t="5e"+l:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),r=new c(t)):r=new c(s.toString()),n=(l=c.precision)+3;;)if(a=r,r=a.plus(tt(o,a,n+2,1)).times(.5),Xt(a.d).slice(0,n)===(t=Xt(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!i&&t=="4999"){if(!i&&(be(a,l+1,0),a.times(a).eq(o))){r=a;break}n+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(be(r,l+1,1),e=!r.times(r).eq(o));break}return Ae=!0,be(r,l,c.rounding,e)},ie.tangent=ie.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=tt(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,be(Gr==2||Gr==4?n.neg():n,e,t,!0)):new r(NaN)},ie.times=ie.mul=function(e){var t,n,r,i,a,o,u,l,s,c=this,f=c.constructor,d=c.d,h=(e=new f(e)).d;if(e.s*=c.s,!d||!d[0]||!h||!h[0])return new f(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:!d||!h?e.s/0:e.s*0);for(n=Jt(c.e/xe)+Jt(e.e/xe),l=d.length,s=h.length,l<s&&(a=d,d=h,h=a,o=l,l=s,s=o),a=[],o=l+s,r=o;r--;)a.push(0);for(r=s;--r>=0;){for(t=0,i=l+r;i>r;)u=a[i]+h[r]*d[i-r-1]+t,a[i--]=u%or|0,t=u/or|0;a[i]=(a[i]+t)%or|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=tc(a,n),Ae?be(e,f.precision,f.rounding):e},ie.toBinary=function(e,t){return Ah(this,2,e,t)},ie.toDecimalPlaces=ie.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(hn(e,0,Mi),t===void 0?t=r.rounding:hn(t,0,8),be(n,e+n.e+1,t))},ie.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=br(r,!0):(hn(e,0,Mi),t===void 0?t=i.rounding:hn(t,0,8),r=be(new i(r),e+1,t),n=br(r,!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},ie.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?n=br(i):(hn(e,0,Mi),t===void 0?t=a.rounding:hn(t,0,8),r=be(new a(i),e+i.e+1,t),n=br(r,!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},ie.toFraction=function(e){var t,n,r,i,a,o,u,l,s,c,f,d,h=this,v=h.d,m=h.constructor;if(!v)return new m(h);if(s=n=new m(1),r=l=new m(0),t=new m(r),a=t.e=Gy(v)-h.e-1,o=a%xe,t.d[0]=Ut(10,o<0?xe+o:o),e==null)e=a>0?t:s;else{if(u=new m(e),!u.isInt()||u.lt(s))throw Error(_i+u);e=u.gt(t)?a>0?t:s:u}for(Ae=!1,u=new m(Xt(v)),c=m.precision,m.precision=a=v.length*xe*2;f=tt(u,t,0,1,1),i=n.plus(f.times(r)),i.cmp(e)!=1;)n=r,r=i,i=s,s=l.plus(f.times(i)),l=i,i=t,t=u.minus(f.times(i)),u=i;return i=tt(e.minus(n),r,0,1,1),l=l.plus(i.times(s)),n=n.plus(i.times(r)),l.s=s.s=h.s,d=tt(s,r,a,1).minus(h).abs().cmp(tt(l,n,a,1).minus(h).abs())<1?[s,r]:[l,n],m.precision=c,Ae=!0,d},ie.toHexadecimal=ie.toHex=function(e,t){return Ah(this,16,e,t)},ie.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:hn(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(Ae=!1,n=tt(n,e,0,t,1).times(e),Ae=!0,be(n)):(e.s=n.s,n=e),n},ie.toNumber=function(){return+this},ie.toOctal=function(e,t){return Ah(this,8,e,t)},ie.toPower=ie.pow=function(e){var t,n,r,i,a,o,u=this,l=u.constructor,s=+(e=new l(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new l(Ut(+u,s));if(u=new l(u),u.eq(1))return u;if(r=l.precision,a=l.rounding,e.eq(1))return be(u,r,a);if(t=Jt(e.e/xe),t>=e.d.length-1&&(n=s<0?-s:s)<=LC)return i=Yy(l,u,n,r),e.s<0?new l(1).div(i):be(i,r,a);if(o=u.s,o<0){if(t<e.d.length-1)return new l(NaN);if(e.d[t]&1||(o=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=o,u}return n=Ut(+u,s),t=n==0||!isFinite(n)?Jt(s*(Math.log("0."+Xt(u.d))/Math.LN10+u.e+1)):new l(n+"").e,t>l.maxE+1||t<l.minE-1?new l(t>0?o/0:0):(Ae=!1,l.rounding=u.s=1,n=Math.min(12,(t+"").length),i=Eh(e.times(Fi(u,r+n)),r),i.d&&(i=be(i,r+5,1),Hu(i.d,r,a)&&(t=r+10,i=be(Eh(e.times(Fi(u,t+n)),t),t+5,1),+Xt(i.d).slice(r+1,r+15)+1==1e14&&(i=be(i,r+1,0)))),i.s=o,Ae=!0,l.rounding=a,be(i,r,a))},ie.toPrecision=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=br(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(hn(e,1,Mi),t===void 0?t=i.rounding:hn(t,0,8),r=be(new i(r),e,t),n=br(r,e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},ie.toSignificantDigits=ie.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(hn(e,1,Mi),t===void 0?t=r.rounding:hn(t,0,8)),be(new r(n),e,t)},ie.toString=function(){var e=this,t=e.constructor,n=br(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},ie.truncated=ie.trunc=function(){return be(new this.constructor(this),this.e+1,1)},ie.valueOf=ie.toJSON=function(){var e=this,t=e.constructor,n=br(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function Xt(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=xe-r.length,n&&(a+=Bi(n)),a+=r;o=e[t],r=o+"",n=xe-r.length,n&&(a+=Bi(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}function hn(e,t,n){if(e!==~~e||e<t||e>n)throw Error(_i+e)}function Hu(e,t,n,r){var i,a,o,u;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=xe,i=0):(i=Math.ceil((t+1)/xe),t%=xe),a=Ut(10,xe-t),u=e[i]%a|0,r==null?t<3?(t==0?u=u/100|0:t==1&&(u=u/10|0),o=n<4&&u==99999||n>3&&u==49999||u==5e4||u==0):o=(n<4&&u+1==a||n>3&&u+1==a/2)&&(e[i+1]/a/100|0)==Ut(10,t-2)-1||(u==a/2||u==0)&&(e[i+1]/a/100|0)==0:t<4?(t==0?u=u/1e3|0:t==1?u=u/100|0:t==2&&(u=u/10|0),o=(r||n<4)&&u==9999||!r&&n>3&&u==4999):o=((r||n<4)&&u+1==a||!r&&n>3&&u+1==a/2)&&(e[i+1]/a/1e3|0)==Ut(10,t-3)-1,o}function ec(e,t,n){for(var r,i=[0],a,o=0,u=e.length;o<u;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=Sh.indexOf(e.charAt(o++)),r=0;r<i.length;r++)i[r]>n-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function HC(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),i=(1/ic(4,n)).toString()):(n=16,i="2.3283064365386962890625e-10"),e.precision+=n,t=co(e,1,t.times(i),new e(1));for(var a=n;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var tt=function(){function e(r,i,a){var o,u=0,l=r.length;for(r=r.slice();l--;)o=r[l]*i+u,r[l]=o%a|0,u=o/a|0;return u&&r.unshift(u),r}function t(r,i,a,o){var u,l;if(a!=o)l=a>o?1:-1;else for(u=l=0;u<a;u++)if(r[u]!=i[u]){l=r[u]>i[u]?1:-1;break}return l}function n(r,i,a,o){for(var u=0;a--;)r[a]-=u,u=r[a]<i[a]?1:0,r[a]=u*o+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o,u,l){var s,c,f,d,h,v,m,D,p,g,y,S,w,b,E,C,A,T,_,x,F=r.constructor,R=r.s==i.s?1:-1,z=r.d,N=i.d;if(!z||!z[0]||!N||!N[0])return new F(!r.s||!i.s||(z?N&&z[0]==N[0]:!N)?NaN:z&&z[0]==0||!N?R*0:R/0);for(l?(h=1,c=r.e-i.e):(l=or,h=xe,c=Jt(r.e/h)-Jt(i.e/h)),_=N.length,A=z.length,p=new F(R),g=p.d=[],f=0;N[f]==(z[f]||0);f++);if(N[f]>(z[f]||0)&&c--,a==null?(b=a=F.precision,o=F.rounding):u?b=a+(r.e-i.e)+1:b=a,b<0)g.push(1),v=!0;else{if(b=b/h+2|0,f=0,_==1){for(d=0,N=N[0],b++;(f<A||d)&&b--;f++)E=d*l+(z[f]||0),g[f]=E/N|0,d=E%N|0;v=d||f<A}else{for(d=l/(N[0]+1)|0,d>1&&(N=e(N,d,l),z=e(z,d,l),_=N.length,A=z.length),C=_,y=z.slice(0,_),S=y.length;S<_;)y[S++]=0;x=N.slice(),x.unshift(0),T=N[0],N[1]>=l/2&&++T;do d=0,s=t(N,y,_,S),s<0?(w=y[0],_!=S&&(w=w*l+(y[1]||0)),d=w/T|0,d>1?(d>=l&&(d=l-1),m=e(N,d,l),D=m.length,S=y.length,s=t(m,y,D,S),s==1&&(d--,n(m,_<D?x:N,D,l))):(d==0&&(s=d=1),m=N.slice()),D=m.length,D<S&&m.unshift(0),n(y,m,S,l),s==-1&&(S=y.length,s=t(N,y,_,S),s<1&&(d++,n(y,_<S?x:N,S,l))),S=y.length):s===0&&(d++,y=[0]),g[f++]=d,s&&y[0]?y[S++]=z[C]||0:(y=[z[C]],S=1);while((C++<A||y[0]!==void 0)&&b--);v=y[0]!==void 0}g[0]||g.shift()}if(h==1)p.e=c,jy=v;else{for(f=1,d=g[0];d>=10;d/=10)f++;p.e=f+c*h-1,be(p,u?a+p.e+1:a,o,v)}return p}}();function be(e,t,n,r){var i,a,o,u,l,s,c,f,d,h=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(i=1,u=f[0];u>=10;u/=10)i++;if(a=t-i,a<0)a+=xe,o=t,c=f[d=0],l=c/Ut(10,i-o-1)%10|0;else if(d=Math.ceil((a+1)/xe),u=f.length,d>=u)if(r){for(;u++<=d;)f.push(0);c=l=0,i=1,a%=xe,o=a-xe+1}else break e;else{for(c=u=f[d],i=1;u>=10;u/=10)i++;a%=xe,o=a-xe+i,l=o<0?0:c/Ut(10,i-o-1)%10|0}if(r=r||t<0||f[d+1]!==void 0||(o<0?c:c%Ut(10,i-o-1)),s=n<4?(l||r)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||r||n==6&&(a>0?o>0?c/Ut(10,i-o):0:f[d-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,s?(t-=e.e+1,f[0]=Ut(10,(xe-t%xe)%xe),e.e=-t||0):f[0]=e.e=0,e;if(a==0?(f.length=d,u=1,d--):(f.length=d+1,u=Ut(10,xe-a),f[d]=o>0?(c/Ut(10,i-o)%Ut(10,o)|0)*u:0),s)for(;;)if(d==0){for(a=1,o=f[0];o>=10;o/=10)a++;for(o=f[0]+=u,u=1;o>=10;o/=10)u++;a!=u&&(e.e++,f[0]==or&&(f[0]=1));break}else{if(f[d]+=u,f[d]!=or)break;f[d--]=0,u=1}for(a=f.length;f[--a]===0;)f.pop()}return Ae&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e<h.minE&&(e.e=0,e.d=[0])),e}function br(e,t,n){if(!e.isFinite())return Qy(e);var r,i=e.e,a=Xt(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Bi(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+Bi(-i-1)+a,n&&(r=n-o)>0&&(a+=Bi(r))):i>=o?(a+=Bi(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Bi(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Bi(r))),a}function tc(e,t){var n=e[0];for(t*=xe;n>=10;n/=10)t++;return t}function nc(e,t,n){if(t>jC)throw Ae=!0,n&&(e.precision=n),Error(Hy);return be(new e(Ks),t,1,!0)}function Dr(e,t,n){if(t>wh)throw Error(Hy);return be(new e(Ws),t,n,!0)}function Gy(e){var t=e.length-1,n=t*xe+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Bi(e){for(var t="";e--;)t+="0";return t}function Yy(e,t,n,r){var i,a=new e(1),o=Math.ceil(r/xe+4);for(Ae=!1;;){if(n%2&&(a=a.times(t),Wy(a.d,o)&&(i=!0)),n=Jt(n/2),n===0){n=a.d.length-1,i&&a.d[n]===0&&++a.d[n];break}t=t.times(t),Wy(t.d,o)}return Ae=!0,a}function Xy(e){return e.d[e.d.length-1]&1}function Zy(e,t,n){for(var r,i,a=new e(t[0]),o=0;++o<t.length;){if(i=new e(t[o]),!i.s){a=i;break}r=a.cmp(i),(r===n||r===0&&a.s===n)&&(a=i)}return a}function Eh(e,t){var n,r,i,a,o,u,l,s=0,c=0,f=0,d=e.constructor,h=d.rounding,v=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(Ae=!1,l=v):l=t,u=new d(.03125);e.e>-2;)e=e.times(u),f+=5;for(r=Math.log(Ut(2,f))/Math.LN10*2+5|0,l+=r,n=a=o=new d(1),d.precision=l;;){if(a=be(a.times(e),l,1),n=n.times(++c),u=o.plus(tt(a,n,l,1)),Xt(u.d).slice(0,l)===Xt(o.d).slice(0,l)){for(i=f;i--;)o=be(o.times(o),l,1);if(t==null)if(s<3&&Hu(o.d,l-r,h,s))d.precision=l+=10,n=a=u=new d(1),c=0,s++;else return be(o,d.precision=v,h,Ae=!0);else return d.precision=v,o}o=u}}function Fi(e,t){var n,r,i,a,o,u,l,s,c,f,d,h=1,v=10,m=e,D=m.d,p=m.constructor,g=p.rounding,y=p.precision;if(m.s<0||!D||!D[0]||!m.e&&D[0]==1&&D.length==1)return new p(D&&!D[0]?-1/0:m.s!=1?NaN:D?0:m);if(t==null?(Ae=!1,c=y):c=t,p.precision=c+=v,n=Xt(D),r=n.charAt(0),Math.abs(a=m.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=Xt(m.d),r=n.charAt(0),h++;a=m.e,r>1?(m=new p("0."+n),a++):m=new p(r+"."+n.slice(1))}else return s=nc(p,c+2,y).times(a+""),m=Fi(new p(r+"."+n.slice(1)),c-v).plus(s),p.precision=y,t==null?be(m,y,g,Ae=!0):m;for(f=m,l=o=m=tt(m.minus(1),m.plus(1),c,1),d=be(m.times(m),c,1),i=3;;){if(o=be(o.times(d),c,1),s=l.plus(tt(o,new p(i),c,1)),Xt(s.d).slice(0,c)===Xt(l.d).slice(0,c))if(l=l.times(2),a!==0&&(l=l.plus(nc(p,c+2,y).times(a+""))),l=tt(l,new p(h),c,1),t==null)if(Hu(l.d,c-v,g,u))p.precision=c+=v,s=o=m=tt(f.minus(1),f.plus(1),c,1),d=be(m.times(m),c,1),i=u=1;else return be(l,p.precision=y,g,Ae=!0);else return p.precision=y,l;l=s,i+=2}}function Qy(e){return String(e.s*e.s/0)}function rc(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(r,i),t){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%xe,n<0&&(r+=xe),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=xe;r<i;)e.d.push(+t.slice(r,r+=xe));t=t.slice(r),r=xe-t.length}else r-=i;for(;r--;)t+="0";e.d.push(+t),Ae&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function PC(e,t){var n,r,i,a,o,u,l,s,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Vy.test(t))return rc(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if($C.test(t))n=16,t=t.toLowerCase();else if(IC.test(t))n=2;else if(kC.test(t))n=8;else throw Error(_i+t);for(a=t.search(/p/i),a>0?(l=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf("."),o=a>=0,r=e.constructor,o&&(t=t.replace(".",""),u=t.length,a=u-a,i=Yy(r,new r(n),a,a*2)),s=ec(t,n,or),c=s.length-1,a=c;s[a]===0;--a)s.pop();return a<0?new r(e.s*0):(e.e=tc(s,c),e.d=s,Ae=!1,o&&(e=tt(e,i,u*4)),l&&(e=e.times(Math.abs(l)<54?Ut(2,l):fo.pow(2,l))),Ae=!0,e)}function qC(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:co(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/ic(5,n)),t=co(e,2,t,t);for(var i,a=new e(5),o=new e(16),u=new e(20);n--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(u))));return t}function co(e,t,n,r,i){var a,o,u,l,s=e.precision,c=Math.ceil(s/xe);for(Ae=!1,l=n.times(n),u=new e(r);;){if(o=tt(u.times(l),new e(t++*t++),s,1),u=i?r.plus(o):r.minus(o),r=tt(o.times(l),new e(t++*t++),s,1),o=u.plus(r),o.d[c]!==void 0){for(a=c;o.d[a]===u.d[a]&&a--;);if(a==-1)break}a=u,u=r,r=o,o=a}return Ae=!0,o.d.length=c+1,o}function ic(e,t){for(var n=e;--t;)n*=e;return n}function Ky(e,t){var n,r=t.s<0,i=Dr(e,e.precision,1),a=i.times(.5);if(t=t.abs(),t.lte(a))return Gr=r?4:1,t;if(n=t.divToInt(i),n.isZero())Gr=r?3:2;else{if(t=t.minus(n.times(i)),t.lte(a))return Gr=Xy(n)?r?2:3:r?4:1,t;Gr=Xy(n)?r?1:4:r?3:2}return t.minus(i).abs()}function Ah(e,t,n,r){var i,a,o,u,l,s,c,f,d,h=e.constructor,v=n!==void 0;if(v?(hn(n,1,Mi),r===void 0?r=h.rounding:hn(r,0,8)):(n=h.precision,r=h.rounding),!e.isFinite())c=Qy(e);else{for(c=br(e),o=c.indexOf("."),v?(i=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):i=t,o>=0&&(c=c.replace(".",""),d=new h(1),d.e=c.length-o,d.d=ec(br(d),10,i),d.e=d.d.length),f=ec(c,10,i),a=l=f.length;f[--l]==0;)f.pop();if(!f[0])c=v?"0p+0":"0";else{if(o<0?a--:(e=new h(e),e.d=f,e.e=a,e=tt(e,d,n,r,0,i),f=e.d,a=e.e,s=jy),o=f[n],u=i/2,s=s||f[n+1]!==void 0,s=r<4?(o!==void 0||s)&&(r===0||r===(e.s<0?3:2)):o>u||o===u&&(r===4||s||r===6&&f[n-1]&1||r===(e.s<0?8:7)),f.length=n,s)for(;++f[--n]>i-1;)f[n]=0,n||(++a,f.unshift(1));for(l=f.length;!f[l-1];--l);for(o=0,c="";o<l;o++)c+=Sh.charAt(f[o]);if(v){if(l>1)if(t==16||t==8){for(o=t==16?4:3,--l;l%o;l++)c+="0";for(f=ec(c,i,t),l=f.length;!f[l-1];--l);for(o=1,c="1.";o<l;o++)c+=Sh.charAt(f[o])}else c=c.charAt(0)+"."+c.slice(1);c=c+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)c="0"+c;c="0."+c}else if(++a>l)for(a-=l;a--;)c+="0";else a<l&&(c=c.slice(0,a)+"."+c.slice(a))}c=(t==16?"0x":t==2?"0b":t==8?"0o":"")+c}return e.s<0?"-"+c:c}function Wy(e,t){if(e.length>t)return e.length=t,!0}function VC(e){return new this(e).abs()}function GC(e){return new this(e).acos()}function YC(e){return new this(e).acosh()}function XC(e,t){return new this(e).plus(t)}function ZC(e){return new this(e).asin()}function QC(e){return new this(e).asinh()}function KC(e){return new this(e).atan()}function WC(e){return new this(e).atanh()}function JC(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,a=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=Dr(this,a,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?Dr(this,r,i):new this(0),n.s=e.s):!e.d||t.isZero()?(n=Dr(this,a,1).times(.5),n.s=e.s):t.s<0?(this.precision=a,this.rounding=1,n=this.atan(tt(e,t,a,1)),t=Dr(this,a,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(tt(e,t,a,1)),n}function e3(e){return new this(e).cbrt()}function t3(e){return be(e=new this(e),e.e+1,2)}function n3(e,t,n){return new this(e).clamp(t,n)}function r3(e){if(!e||typeof e!="object")throw Error(Js+"Object expected");var t,n,r,i=e.defaults===!0,a=["precision",1,Mi,"rounding",0,8,"toExpNeg",-so,0,"toExpPos",0,so,"maxE",0,so,"minE",-so,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(n=a[t],i&&(this[n]=xh[n]),(r=e[n])!==void 0)if(Jt(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(_i+n+": "+r);if(n="crypto",i&&(this[n]=xh[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(Py);else this[n]=!1;else throw Error(_i+n+": "+r);return this}function i3(e){return new this(e).cos()}function a3(e){return new this(e).cosh()}function Jy(e){var t,n,r;function i(a){var o,u,l,s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,eb(a)){s.s=a.s,Ae?!a.d||a.e>i.maxE?(s.e=NaN,s.d=null):a.e<i.minE?(s.e=0,s.d=[0]):(s.e=a.e,s.d=a.d.slice()):(s.e=a.e,s.d=a.d?a.d.slice():a.d);return}if(l=typeof a,l==="number"){if(a===0){s.s=1/a<0?-1:1,s.e=0,s.d=[0];return}if(a<0?(a=-a,s.s=-1):s.s=1,a===~~a&&a<1e7){for(o=0,u=a;u>=10;u/=10)o++;Ae?o>i.maxE?(s.e=NaN,s.d=null):o<i.minE?(s.e=0,s.d=[0]):(s.e=o,s.d=[a]):(s.e=o,s.d=[a]);return}if(a*0!==0){a||(s.s=NaN),s.e=NaN,s.d=null;return}return rc(s,a.toString())}if(l==="string")return(u=a.charCodeAt(0))===45?(a=a.slice(1),s.s=-1):(u===43&&(a=a.slice(1)),s.s=1),Vy.test(a)?rc(s,a):PC(s,a);if(l==="bigint")return a<0?(a=-a,s.s=-1):s.s=1,rc(s,a.toString());throw Error(_i+a)}if(i.prototype=ie,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=r3,i.clone=Jy,i.isDecimal=eb,i.abs=VC,i.acos=GC,i.acosh=YC,i.add=XC,i.asin=ZC,i.asinh=QC,i.atan=KC,i.atanh=WC,i.atan2=JC,i.cbrt=e3,i.ceil=t3,i.clamp=n3,i.cos=i3,i.cosh=a3,i.div=o3,i.exp=u3,i.floor=l3,i.hypot=s3,i.ln=c3,i.log=f3,i.log10=h3,i.log2=d3,i.max=m3,i.min=p3,i.mod=g3,i.mul=v3,i.pow=y3,i.random=b3,i.round=D3,i.sign=S3,i.sin=x3,i.sinh=w3,i.sqrt=E3,i.sub=A3,i.sum=C3,i.tan=T3,i.tanh=M3,i.trunc=_3,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function o3(e,t){return new this(e).div(t)}function u3(e){return new this(e).exp()}function l3(e){return be(e=new this(e),e.e+1,3)}function s3(){var e,t,n=new this(0);for(Ae=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return Ae=!0,new this(1/0);n=t}return Ae=!0,n.sqrt()}function eb(e){return e instanceof fo||e&&e.toStringTag===qy||!1}function c3(e){return new this(e).ln()}function f3(e,t){return new this(e).log(t)}function d3(e){return new this(e).log(2)}function h3(e){return new this(e).log(10)}function m3(){return Zy(this,arguments,-1)}function p3(){return Zy(this,arguments,1)}function g3(e,t){return new this(e).mod(t)}function v3(e,t){return new this(e).mul(t)}function y3(e,t){return new this(e).pow(t)}function b3(e){var t,n,r,i,a=0,o=new this(1),u=[];if(e===void 0?e=this.precision:hn(e,1,Mi),r=Math.ceil(e/xe),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));a<r;)i=t[a],i>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:u[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);a<r;)i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,a):(u.push(i%1e7),a+=4);a=r/4}else throw Error(Py);else for(;a<r;)u[a++]=Math.random()*1e7|0;for(r=u[--a],e%=xe,r&&e&&(i=Ut(10,xe-e),u[a]=(r/i|0)*i);u[a]===0;a--)u.pop();if(a<0)n=0,u=[0];else{for(n=-1;u[0]===0;n-=xe)u.shift();for(r=1,i=u[0];i>=10;i/=10)r++;r<xe&&(n-=xe-r)}return o.e=n,o.d=u,o}function D3(e){return be(e=new this(e),e.e+1,this.rounding)}function S3(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function x3(e){return new this(e).sin()}function w3(e){return new this(e).sinh()}function E3(e){return new this(e).sqrt()}function A3(e,t){return new this(e).sub(t)}function C3(){var e=0,t=arguments,n=new this(t[e]);for(Ae=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return Ae=!0,be(n,this.precision,this.rounding)}function T3(e){return new this(e).tan()}function M3(e){return new this(e).tanh()}function _3(e){return be(e=new this(e),e.e+1,1)}ie[Symbol.for("nodejs.util.inspect.custom")]=ie.toString,ie[Symbol.toStringTag]="Decimal";var fo=ie.constructor=Jy(xh);Ks=new fo(Ks),Ws=new fo(Ws);var B3="BigNumber",F3=["?on","config"],N3=se(B3,F3,e=>{var{on:t,config:n}=e,r=fo.clone({precision:n.precision,modulo:fo.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(i){return new r(i.value)},t&&t("config",function(i,a){i.precision!==a.precision&&r.config({precision:i.precision})}),r},{isClass:!0});const en=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},Zn=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},R3=function(e){const t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;const n=e*e;return n*(n*(n*(n*(n*(n*(n*(n/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},Ch=function(e,t){return e=Math.abs(e),t=Math.abs(t),e<t&&([e,t]=[t,e]),e<1e8?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},ho=function(){throw SyntaxError("Invalid Param")};function Th(e,t){const n=Math.abs(e),r=Math.abs(t);return e===0?Math.log(r):t===0?Math.log(n):n<3e3&&r<3e3?Math.log(e*e+t*t)*.5:(e=e*.5,t=t*.5,.5*Math.log(e*e+t*t)+Math.LN2)}const O3={re:0,im:0},ra=function(e,t){const n=O3;if(e==null)n.re=n.im=0;else if(t!==void 0)n.re=e,n.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)n.re=e.re,n.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return Q.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return Q.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else e.length===2?(n.re=e[0],n.im=e[1]):ho();break;case"string":n.im=n.re=0;const r=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);let i=1,a=0;r===null&&ho();for(let o=0;o<r.length;o++){const u=r[o];u===" "||u===" "||u===`
|
|
64
|
+
`||(u==="+"?i++:u==="-"?a++:u==="i"||u==="I"?(i+a===0&&ho(),r[o+1]!==" "&&!isNaN(r[o+1])?(n.im+=parseFloat((a%2?"-":"")+r[o+1]),o++):n.im+=parseFloat((a%2?"-":"")+"1"),i=a=0):((i+a===0||isNaN(u))&&ho(),r[o+1]==="i"||r[o+1]==="I"?(n.im+=parseFloat((a%2?"-":"")+u),o++):n.re+=parseFloat((a%2?"-":"")+u),i=a=0))}i+a>0&&ho();break;case"number":n.im=0,n.re=e;break;default:ho()}return isNaN(n.re)||isNaN(n.im),n};function Q(e,t){if(!(this instanceof Q))return new Q(e,t);const n=ra(e,t);this.re=n.re,this.im=n.im}Q.prototype={re:0,im:0,sign:function(){const e=Ch(this.re,this.im);return new Q(this.re/e,this.im/e)},add:function(e,t){const n=ra(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?Q.NAN:Q.INFINITY:new Q(this.re+n.re,this.im+n.im)},sub:function(e,t){const n=ra(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?Q.NAN:Q.INFINITY:new Q(this.re-n.re,this.im-n.im)},mul:function(e,t){const n=ra(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;return r&&o||i&&a?Q.NAN:r||i?Q.INFINITY:n.im===0&&this.im===0?new Q(this.re*n.re,0):new Q(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){const n=ra(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;if(a&&o||r&&i)return Q.NAN;if(o||r)return Q.INFINITY;if(a||i)return Q.ZERO;if(n.im===0)return new Q(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){const u=n.re/n.im,l=n.re*u+n.im;return new Q((this.re*u+this.im)/l,(this.im*u-this.re)/l)}else{const u=n.im/n.re,l=n.im*u+n.re;return new Q((this.re+this.im*u)/l,(this.im-this.re*u)/l)}},pow:function(e,t){const n=ra(e,t),r=this.re===0&&this.im===0;if(n.re===0&&n.im===0)return Q.ONE;if(n.im===0){if(this.im===0&&this.re>0)return new Q(Math.pow(this.re,n.re),0);if(this.re===0)switch((n.re%4+4)%4){case 0:return new Q(Math.pow(this.im,n.re),0);case 1:return new Q(0,Math.pow(this.im,n.re));case 2:return new Q(-Math.pow(this.im,n.re),0);case 3:return new Q(0,-Math.pow(this.im,n.re))}}if(r&&n.re>0)return Q.ZERO;const a=Math.atan2(this.im,this.re),o=Th(this.re,this.im);let u=Math.exp(n.re*o-n.im*a),l=n.im*o+n.re*a;return new Q(u*Math.cos(l),u*Math.sin(l))},sqrt:function(){const e=this.re,t=this.im;if(t===0)return e>=0?new Q(Math.sqrt(e),0):new Q(0,Math.sqrt(-e));const n=Ch(e,t);let r=Math.sqrt(.5*(n+Math.abs(e))),i=Math.abs(t)/(2*r);return e>=0?new Q(r,t<0?-i:i):new Q(i,t<0?-r:r)},exp:function(){const e=Math.exp(this.re);return this.im===0?new Q(e,0):new Q(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){const e=this.re,t=this.im;return new Q(Math.expm1(e)*Math.cos(t)+R3(t),Math.exp(e)*Math.sin(t))},log:function(){const e=this.re,t=this.im;return t===0&&e>0?new Q(Math.log(e),0):new Q(Th(e,t),Math.atan2(t,e))},abs:function(){return Ch(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){const e=this.re,t=this.im;return new Q(Math.sin(e)*en(t),Math.cos(e)*Zn(t))},cos:function(){const e=this.re,t=this.im;return new Q(Math.cos(e)*en(t),-Math.sin(e)*Zn(t))},tan:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)+en(t);return new Q(Math.sin(e)/n,Zn(t)/n)},cot:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)-en(t);return new Q(-Math.sin(e)/n,Zn(t)/n)},sec:function(){const e=this.re,t=this.im,n=.5*en(2*t)+.5*Math.cos(2*e);return new Q(Math.cos(e)*en(t)/n,Math.sin(e)*Zn(t)/n)},csc:function(){const e=this.re,t=this.im,n=.5*en(2*t)-.5*Math.cos(2*e);return new Q(Math.sin(e)*en(t)/n,-Math.cos(e)*Zn(t)/n)},asin:function(){const e=this.re,t=this.im,n=new Q(t*t-e*e+1,-2*e*t).sqrt(),r=new Q(n.re-t,n.im+e).log();return new Q(r.im,-r.re)},acos:function(){const e=this.re,t=this.im,n=new Q(t*t-e*e+1,-2*e*t).sqrt(),r=new Q(n.re-t,n.im+e).log();return new Q(Math.PI/2-r.im,r.re)},atan:function(){const e=this.re,t=this.im;if(e===0){if(t===1)return new Q(0,1/0);if(t===-1)return new Q(0,-1/0)}const n=e*e+(1-t)*(1-t),r=new Q((1-t*t-e*e)/n,-2*e/n).log();return new Q(-.5*r.im,.5*r.re)},acot:function(){const e=this.re,t=this.im;if(t===0)return new Q(Math.atan2(1,e),0);const n=e*e+t*t;return n!==0?new Q(e/n,-t/n).atan():new Q(e!==0?e/0:0,t!==0?-t/0:0).atan()},asec:function(){const e=this.re,t=this.im;if(e===0&&t===0)return new Q(0,1/0);const n=e*e+t*t;return n!==0?new Q(e/n,-t/n).acos():new Q(e!==0?e/0:0,t!==0?-t/0:0).acos()},acsc:function(){const e=this.re,t=this.im;if(e===0&&t===0)return new Q(Math.PI/2,1/0);const n=e*e+t*t;return n!==0?new Q(e/n,-t/n).asin():new Q(e!==0?e/0:0,t!==0?-t/0:0).asin()},sinh:function(){const e=this.re,t=this.im;return new Q(Zn(e)*Math.cos(t),en(e)*Math.sin(t))},cosh:function(){const e=this.re,t=this.im;return new Q(en(e)*Math.cos(t),Zn(e)*Math.sin(t))},tanh:function(){const e=2*this.re,t=2*this.im,n=en(e)+Math.cos(t);return new Q(Zn(e)/n,Math.sin(t)/n)},coth:function(){const e=2*this.re,t=2*this.im,n=en(e)-Math.cos(t);return new Q(Zn(e)/n,-Math.sin(t)/n)},csch:function(){const e=this.re,t=this.im,n=Math.cos(2*t)-en(2*e);return new Q(-2*Zn(e)*Math.cos(t)/n,2*en(e)*Math.sin(t)/n)},sech:function(){const e=this.re,t=this.im,n=Math.cos(2*t)+en(2*e);return new Q(2*en(e)*Math.cos(t)/n,-2*Zn(e)*Math.sin(t)/n)},asinh:function(){let e=this.im;this.im=-this.re,this.re=e;const t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){const e=this.acos();if(e.im<=0){const t=e.re;e.re=-e.im,e.im=t}else{const t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){const e=this.re,t=this.im,n=e>1&&t===0,r=1-e,i=1+e,a=r*r+t*t,o=a!==0?new Q((i*r-t*t)/a,(t*r+i*t)/a):new Q(e!==-1?e/0:0,t!==0?t/0:0),u=o.re;return o.re=Th(o.re,o.im)/2,o.im=Math.atan2(o.im,u)/2,n&&(o.im=-o.im),o},acoth:function(){const e=this.re,t=this.im;if(e===0&&t===0)return new Q(0,Math.PI/2);const n=e*e+t*t;return n!==0?new Q(e/n,-t/n).atanh():new Q(e!==0?e/0:0,t!==0?-t/0:0).atanh()},acsch:function(){const e=this.re,t=this.im;if(t===0)return new Q(e!==0?Math.log(e+Math.sqrt(e*e+1)):1/0,0);const n=e*e+t*t;return n!==0?new Q(e/n,-t/n).asinh():new Q(e!==0?e/0:0,t!==0?-t/0:0).asinh()},asech:function(){const e=this.re,t=this.im;if(this.isZero())return Q.INFINITY;const n=e*e+t*t;return n!==0?new Q(e/n,-t/n).acosh():new Q(e!==0?e/0:0,t!==0?-t/0:0).acosh()},inverse:function(){if(this.isZero())return Q.INFINITY;if(this.isInfinite())return Q.ZERO;const e=this.re,t=this.im,n=e*e+t*t;return new Q(e/n,-t/n)},conjugate:function(){return new Q(this.re,-this.im)},neg:function(){return new Q(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new Q(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new Q(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new Q(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){const n=ra(e,t);return Math.abs(n.re-this.re)<=Q.EPSILON&&Math.abs(n.im-this.im)<=Q.EPSILON},clone:function(){return new Q(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<Q.EPSILON&&(e=0),Math.abs(t)<Q.EPSILON&&(t=0),t===0?n+e:(e!==0?(n+=e,n+=" ",t<0?(t=-t,n+="-"):n+="+",n+=" "):t<0&&(t=-t,n+="-"),t!==1&&(n+=t),n+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},Q.ZERO=new Q(0,0),Q.ONE=new Q(1,0),Q.I=new Q(0,1),Q.PI=new Q(Math.PI,0),Q.E=new Q(Math.E,0),Q.INFINITY=new Q(1/0,1/0),Q.NAN=new Q(NaN,NaN),Q.EPSILON=1e-15;var z3="Complex",U3=[],I3=se(z3,U3,()=>(Object.defineProperty(Q,"name",{value:"Complex"}),Q.prototype.constructor=Q,Q.prototype.type="Complex",Q.prototype.isComplex=!0,Q.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Q.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Q.prototype.format=function(e){var t="",n=this.im,r=this.re,i=Dh(this.re,e),a=Dh(this.im,e),o=et(e)?e:e?e.precision:null;if(o!==null){var u=Math.pow(10,-o);Math.abs(r/n)<u&&(r=0),Math.abs(n/r)<u&&(n=0)}return n===0?t=i:r===0?n===1?t="i":n===-1?t="-i":t=a+"i":n<0?n===-1?t=i+" - i":t=i+" - "+a.substring(1)+"i":n===1?t=i+" + i":t=i+" + "+a+"i",t},Q.fromPolar=function(e){switch(arguments.length){case 1:{var t=arguments[0];if(typeof t=="object")return Q(t);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var n=arguments[0],r=arguments[1];if(et(n)){if(My(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),et(r))return new Q({r:n,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}else throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Q.prototype.valueOf=Q.prototype.toString,Q.fromJSON=function(e){return new Q(e)},Q.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},Q),{isClass:!0});typeof BigInt>"u"&&(BigInt=function(e){if(isNaN(e))throw new Error("");return e});const ge=BigInt(0),Me=BigInt(1),jt=BigInt(2),Pu=BigInt(3),mo=BigInt(5),mn=BigInt(10);BigInt(Number.MAX_SAFE_INTEGER);const $3=2e3,fe={s:Me,n:ge,d:Me};function Yr(e,t){try{e=BigInt(e)}catch{throw Ni()}return e*t}function ur(e){return typeof e=="bigint"?e:Math.floor(e)}function mt(e,t){if(t===ge)throw Mh();const n=Object.create(Qn.prototype);n.s=e<ge?-Me:Me,e=e<ge?-e:e;const r=ia(e,t);return n.n=e/r,n.d=t/r,n}const k3=[jt*jt,jt,jt*jt,jt,jt*jt,jt*Pu,jt,jt*Pu];function po(e){const t=Object.create(null);if(e<=Me)return t[e]=Me,t;const n=r=>{t[r]=(t[r]||ge)+Me};for(;e%jt===ge;)n(jt),e/=jt;for(;e%Pu===ge;)n(Pu),e/=Pu;for(;e%mo===ge;)n(mo),e/=mo;for(let r=0,i=jt+mo;i*i<=e;){for(;e%i===ge;)n(i),e/=i;i+=k3[r],r=r+1&7}return e>Me&&n(e),t}const Ht=function(e,t){let n=ge,r=Me,i=Me;if(e!=null)if(t!==void 0){if(typeof e=="bigint")n=e;else{if(isNaN(e))throw Ni();if(e%1!==0)throw tb();n=BigInt(e)}if(typeof t=="bigint")r=t;else{if(isNaN(t))throw Ni();if(t%1!==0)throw tb();r=BigInt(t)}i=n*r}else if(typeof e=="object"){if("d"in e&&"n"in e)n=BigInt(e.n),r=BigInt(e.d),"s"in e&&(n*=BigInt(e.s));else if(0 in e)n=BigInt(e[0]),1 in e&&(r=BigInt(e[1]));else if(typeof e=="bigint")n=e;else throw Ni();i=n*r}else if(typeof e=="number"){if(isNaN(e))throw Ni();if(e<0&&(i=-Me,e=-e),e%1===0)n=BigInt(e);else{let a=1,o=0,u=1,l=1,s=1,c=1e7;for(e>=1&&(a=10**Math.floor(1+Math.log10(e)),e/=a);u<=c&&s<=c;){let f=(o+l)/(u+s);if(e===f){u+s<=c?(n=o+l,r=u+s):s>u?(n=l,r=s):(n=o,r=u);break}else e>f?(o+=l,u+=s):(l+=o,s+=u),u>c?(n=l,r=s):(n=o,r=u)}n=BigInt(n)*BigInt(a),r=BigInt(r)}}else if(typeof e=="string"){let a=0,o=ge,u=ge,l=ge,s=Me,c=Me,f=e.replace(/_/g,"").match(/\d+|./g);if(f===null)throw Ni();if(f[a]==="-"?(i=-Me,a++):f[a]==="+"&&a++,f.length===a+1?u=Yr(f[a++],i):f[a+1]==="."||f[a]==="."?(f[a]!=="."&&(o=Yr(f[a++],i)),a++,(a+1===f.length||f[a+1]==="("&&f[a+3]===")"||f[a+1]==="'"&&f[a+3]==="'")&&(u=Yr(f[a],i),s=mn**BigInt(f[a].length),a++),(f[a]==="("&&f[a+2]===")"||f[a]==="'"&&f[a+2]==="'")&&(l=Yr(f[a+1],i),c=mn**BigInt(f[a+1].length)-Me,a+=3)):f[a+1]==="/"||f[a+1]===":"?(u=Yr(f[a],i),s=Yr(f[a+2],Me),a+=3):f[a+3]==="/"&&f[a+1]===" "&&(o=Yr(f[a],i),u=Yr(f[a+2],i),s=Yr(f[a+4],Me),a+=5),f.length<=a)r=s*c,i=n=l+r*o+c*u;else throw Ni()}else if(typeof e=="bigint")n=e,i=e,r=Me;else throw Ni();if(r===ge)throw Mh();fe.s=i<ge?-Me:Me,fe.n=n<ge?-n:n,fe.d=r<ge?-r:r};function L3(e,t,n){let r=Me;for(;t>ge;e=e*e%n,t>>=Me)t&Me&&(r=r*e%n);return r}function j3(e,t){for(;t%jt===ge;t/=jt);for(;t%mo===ge;t/=mo);if(t===Me)return ge;let n=mn%t,r=1;for(;n!==Me;r++)if(n=n*mn%t,r>$3)return ge;return BigInt(r)}function H3(e,t,n){let r=Me,i=L3(mn,n,t);for(let a=0;a<300;a++){if(r===i)return BigInt(a);r=r*mn%t,i=i*mn%t}return 0}function ia(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function Qn(e,t){if(Ht(e,t),this instanceof Qn)e=ia(fe.d,fe.n),this.s=fe.s,this.n=fe.n/e,this.d=fe.d/e;else return mt(fe.s*fe.n,fe.d)}const Mh=function(){return new Error("Division by Zero")},Ni=function(){return new Error("Invalid argument")},tb=function(){return new Error("Parameters must be integer")};Qn.prototype={s:Me,n:ge,d:Me,abs:function(){return mt(this.n,this.d)},neg:function(){return mt(-this.s*this.n,this.d)},add:function(e,t){return Ht(e,t),mt(this.s*this.n*fe.d+fe.s*this.d*fe.n,this.d*fe.d)},sub:function(e,t){return Ht(e,t),mt(this.s*this.n*fe.d-fe.s*this.d*fe.n,this.d*fe.d)},mul:function(e,t){return Ht(e,t),mt(this.s*fe.s*this.n*fe.n,this.d*fe.d)},div:function(e,t){return Ht(e,t),mt(this.s*fe.s*this.n*fe.d,this.d*fe.n)},clone:function(){return mt(this.s*this.n,this.d)},mod:function(e,t){if(e===void 0)return mt(this.s*this.n%this.d,Me);if(Ht(e,t),ge===fe.n*this.d)throw Mh();return mt(this.s*(fe.d*this.n)%(fe.n*this.d),fe.d*this.d)},gcd:function(e,t){return Ht(e,t),mt(ia(fe.n,this.n)*ia(fe.d,this.d),fe.d*this.d)},lcm:function(e,t){return Ht(e,t),fe.n===ge&&this.n===ge?mt(ge,Me):mt(fe.n*this.n,ia(fe.n,this.n)*ia(fe.d,this.d))},inverse:function(){return mt(this.s*this.d,this.n)},pow:function(e,t){if(Ht(e,t),fe.d===Me)return fe.s<ge?mt((this.s*this.d)**fe.n,this.n**fe.n):mt((this.s*this.n)**fe.n,this.d**fe.n);if(this.s<ge)return null;let n=po(this.n),r=po(this.d),i=Me,a=Me;for(let o in n)if(o!=="1"){if(o==="0"){i=ge;break}if(n[o]*=fe.n,n[o]%fe.d===ge)n[o]/=fe.d;else return null;i*=BigInt(o)**n[o]}for(let o in r)if(o!=="1"){if(r[o]*=fe.n,r[o]%fe.d===ge)r[o]/=fe.d;else return null;a*=BigInt(o)**r[o]}return fe.s<ge?mt(a,i):mt(i,a)},log:function(e,t){if(Ht(e,t),this.s<=ge||fe.s<=ge)return null;const n=Object.create(null),r=po(fe.n),i=po(fe.d),a=po(this.n),o=po(this.d);for(const s in i)r[s]=(r[s]||ge)-i[s];for(const s in o)a[s]=(a[s]||ge)-o[s];for(const s in r)s!=="1"&&(n[s]=!0);for(const s in a)s!=="1"&&(n[s]=!0);let u=null,l=null;for(const s in n){const c=r[s]||ge,f=a[s]||ge;if(c===ge){if(f!==ge)return null;continue}let d=f,h=c;const v=ia(d,h);if(d/=v,h/=v,u===null&&l===null)u=d,l=h;else if(d*l!==u*h)return null}return u!==null&&l!==null?mt(u,l):null},equals:function(e,t){return Ht(e,t),this.s*this.n*fe.d===fe.s*fe.n*this.d},lt:function(e,t){return Ht(e,t),this.s*this.n*fe.d<fe.s*fe.n*this.d},lte:function(e,t){return Ht(e,t),this.s*this.n*fe.d<=fe.s*fe.n*this.d},gt:function(e,t){return Ht(e,t),this.s*this.n*fe.d>fe.s*fe.n*this.d},gte:function(e,t){return Ht(e,t),this.s*this.n*fe.d>=fe.s*fe.n*this.d},compare:function(e,t){Ht(e,t);let n=this.s*this.n*fe.d-fe.s*fe.n*this.d;return(ge<n)-(n<ge)},ceil:function(e){return e=mn**BigInt(e||0),mt(ur(this.s*e*this.n/this.d)+(e*this.n%this.d>ge&&this.s>=ge?Me:ge),e)},floor:function(e){return e=mn**BigInt(e||0),mt(ur(this.s*e*this.n/this.d)-(e*this.n%this.d>ge&&this.s<ge?Me:ge),e)},round:function(e){return e=mn**BigInt(e||0),mt(ur(this.s*e*this.n/this.d)+this.s*((this.s>=ge?Me:ge)+jt*(e*this.n%this.d)>this.d?Me:ge),e)},roundTo:function(e,t){Ht(e,t);const n=this.n*fe.d,r=this.d*fe.n,i=n%r;let a=ur(n/r);return i+i>=r&&a++,mt(this.s*a*fe.n,fe.d)},divisible:function(e,t){return Ht(e,t),fe.n===ge?!1:this.n*fe.d%(fe.n*this.d)===ge},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(e=15){let t=this.n,n=this.d,r=j3(t,n),i=H3(t,n,r),a=this.s<ge?"-":"";if(a+=ur(t/n),t%=n,t*=mn,t&&(a+="."),r){for(let o=i;o--;)a+=ur(t/n),t%=n,t*=mn;a+="(";for(let o=r;o--;)a+=ur(t/n),t%=n,t*=mn;a+=")"}else for(let o=e;t&&o--;)a+=ur(t/n),t%=n,t*=mn;return a},toFraction:function(e=!1){let t=this.n,n=this.d,r=this.s<ge?"-":"";if(n===Me)r+=t;else{const i=ur(t/n);e&&i>ge&&(r+=i,r+=" ",t%=n),r+=t,r+="/",r+=n}return r},toLatex:function(e=!1){let t=this.n,n=this.d,r=this.s<ge?"-":"";if(n===Me)r+=t;else{const i=ur(t/n);e&&i>ge&&(r+=i,t%=n),r+="\\frac{",r+=t,r+="}{",r+=n,r+="}"}return r},toContinued:function(){let e=this.n,t=this.d;const n=[];for(;t;){n.push(ur(e/t));const r=e%t;e=t,t=r}return n},simplify:function(e=.001){const t=BigInt(Math.ceil(1/e)),n=this.abs(),r=n.toContinued();for(let i=1;i<r.length;i++){let a=mt(r[i-1],Me);for(let u=i-2;u>=0;u--)a=a.inverse().add(r[u]);let o=a.sub(n);if(o.n*t<o.d)return a.mul(this.s)}return this}};var P3="Fraction",q3=[],V3=se(P3,q3,()=>(Object.defineProperty(Qn,"name",{value:"Fraction"}),Qn.prototype.constructor=Qn,Qn.prototype.type="Fraction",Qn.prototype.isFraction=!0,Qn.prototype.toJSON=function(){return{mathjs:"Fraction",n:String(this.s*this.n),d:String(this.d)}},Qn.fromJSON=function(e){return new Qn(e)},Qn),{isClass:!0}),G3="Matrix",Y3=[],X3=se(G3,Y3,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,n){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,n,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,n,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,n){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,n){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function _h(e,t,n){var r=e.constructor,i=new r(2),a="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!it(n))throw new Error("size must be an integer");if(e.greaterThan(i.pow(n-1).sub(1))||e.lessThan(i.pow(n-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(n))),a="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(a);case 8:return"".concat(e.toOctal()).concat(a);case 16:return"".concat(e.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(t," not supported "))}}function Z3(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:n,precision:r,wordSize:i}=Uy(t);switch(n){case"fixed":return K3(e,r);case"exponential":return nb(e,r);case"engineering":return Q3(e,r);case"bin":return _h(e,2,i);case"oct":return _h(e,8,i);case"hex":return _h(e,16,i);case"auto":{var a=rb(t?.lowerExp,-3),o=rb(t?.upperExp,5);if(e.isZero())return"0";var u,l=e.toSignificantDigits(r),s=l.e;return s>=a&&s<o?u=l.toFixed():u=nb(e,r),u.replace(/((\.\d*?)(0+))($|e)/,function(){var c=arguments[2],f=arguments[4];return c!=="."?c+f:f})}default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Q3(e,t){var n=e.e,r=n%3===0?n:n<0?n-3-n%3:n-n%3,i=e.mul(Math.pow(10,-r)),a=i.toPrecision(t);if(a.includes("e")){var o=e.constructor;a=new o(a).toFixed()}return a+"e"+(n>=0?"+":"")+r.toString()}function nb(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function K3(e,t){return e.toFixed(t)}function rb(e,t){return et(e)?e:vt(e)?e.toNumber():t}function lt(e,t){var n=W3(e,t);return t&&typeof t=="object"&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function W3(e,t){if(typeof e=="number")return Dh(e,t);if(vt(e))return Z3(e,t);if(J3(e))return!t||t.fraction!=="decimal"?"".concat(e.s*e.n,"/").concat(e.d):e.toString();if(Array.isArray(e))return ob(e,t);if(ar(e))return ib(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var n=Object.keys(e).map(r=>ib(r)+": "+lt(e[r],t));return"{"+n.join(", ")+"}"}return String(e)}function ib(e){for(var t=String(e),n="",r=0;r<t.length;){var i=t.charAt(r);n+=i in ab?ab[i]:i,r++}return'"'+n+'"'}var ab={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function ob(e,t){if(Array.isArray(e)){for(var n="[",r=e.length,i=0;i<r;i++)i!==0&&(n+=", "),n+=ob(e[i],t);return n+="]",n}else return lt(e,t)}function J3(e){return e&&typeof e=="object"&&typeof e.s=="bigint"&&typeof e.n=="bigint"&&typeof e.d=="bigint"||!1}function Le(e,t,n){if(!(this instanceof Le))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}Le.prototype=new RangeError,Le.prototype.constructor=RangeError,Le.prototype.name="DimensionError",Le.prototype.isDimensionError=!0;function Ri(e,t,n){if(!(this instanceof Ri))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),this.min!==void 0&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":this.max!==void 0&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Ri.prototype=new RangeError,Ri.prototype.constructor=RangeError,Ri.prototype.name="IndexError",Ri.prototype.isIndexError=!0;function st(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function ub(e,t,n){var r,i=e.length;if(i!==t[n])throw new Le(i,t[n]);if(n<t.length-1){var a=n+1;for(r=0;r<i;r++){var o=e[r];if(!Array.isArray(o))throw new Le(t.length-1,t.length,"<");ub(e[r],t,a)}}else for(r=0;r<i;r++)if(Array.isArray(e[r]))throw new Le(t.length+1,t.length,">")}function lb(e,t){var n=t.length===0;if(n){if(Array.isArray(e))throw new Le(e.length,0)}else ub(e,t,0)}function yt(e,t){if(e!==void 0){if(!et(e)||!it(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new Ri(e,t)}}function ac(e,t,n){if(!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Error("Resizing to scalar is not supported");t.forEach(function(i){if(!et(i)||!it(i)||i<0)throw new TypeError("Invalid size, must contain positive integers (size: "+lt(t)+")")}),(et(e)||vt(e))&&(e=[e]);var r=n!==void 0?n:0;return Bh(e,t,0,r),e}function Bh(e,t,n,r){var i,a,o=e.length,u=t[n],l=Math.min(o,u);if(e.length=u,n<t.length-1){var s=n+1;for(i=0;i<l;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),Bh(a,t,s,r);for(i=l;i<u;i++)a=[],e[i]=a,Bh(a,t,s,r)}else{for(i=0;i<l;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=l;i<u;i++)e[i]=r}}function Fh(e,t){var n=Rh(e,!0),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Le(0,r,"!=");t=Nh(t,r);var i=sb(t);if(r!==i)throw new Le(i,r,"!=");try{return eT(n,t)}catch(a){throw a instanceof Le?new Le(i,r,"!="):a}}function Nh(e,t){var n=sb(e),r=e.slice(),i=-1,a=e.indexOf(i),o=e.indexOf(i,a+1)>=0;if(o)throw new Error("More than one wildcard in sizes");var u=a>=0,l=t%n===0;if(u)if(l)r[a]=-t/n;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);return r}function sb(e){return e.reduce((t,n)=>t*n,1)}function eT(e,t){for(var n=e,r,i=t.length-1;i>0;i--){var a=t[i];r=[];for(var o=n.length/a,u=0;u<o;u++)r.push(n.slice(u*a,(u+1)*a));n=r}return n}function cb(e,t,n,r){var i=r||st(e);if(n)for(var a=0;a<n;a++)e=[e],i.unshift(1);for(e=fb(e,t,0);i.length<t;)i.push(1);return e}function fb(e,t,n){var r,i;if(Array.isArray(e)){var a=n+1;for(r=0,i=e.length;r<i;r++)e[r]=fb(e[r],t,a)}else for(var o=n;o<t;o++)e=[e];return e}function Rh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!Array.isArray(e))return e;if(typeof t!="boolean")throw new TypeError("Boolean expected for second argument of flatten");var n=[];return t?i(e):r(e),n;function r(a){for(var o=0;o<a.length;o++){var u=a[o];Array.isArray(u)?r(u):n.push(u)}}function i(a){if(Array.isArray(a[0]))for(var o=0;o<a.length;o++)i(a[o]);else for(var u=0;u<a.length;u++)n.push(a[u])}}function oc(e,t){for(var n,r=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(i===0&&o&&(r=a.length),o&&a.length!==r)return;var u=o?oc(a,t):t(a);if(n===void 0)n=u;else if(n!==u)return"mixed"}return n}function db(e,t,n,r){if(r<n){if(e.length!==t.length)throw new Le(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=db(e[a],t[a],n,r+1);return i}else return e.concat(t)}function hb(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(n,r){return db(n,r,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function mb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.map(d=>d.length),i=Math.max(...r),a=new Array(i).fill(null),o=0;o<t.length;o++)for(var u=t[o],l=r[o],s=0;s<l;s++){var c=i-l+s;u[s]>a[c]&&(a[c]=u[s])}for(var f=0;f<t.length;f++)pb(t[f],a);return a}function pb(e,t){for(var n=t.length,r=e.length,i=0;i<r;i++){var a=n-r+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw new Error("shape mismatch: mismatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(r," with size ").concat(e[i]," to size ").concat(t[a]))}}function Oh(e,t){var n=st(e);if(Ti(n,t))return e;pb(n,t);var r=mb(n,t),i=r.length,a=[...Array(i-n.length).fill(1),...n],o=rT(e);n.length<i&&(o=Fh(o,a),n=st(o));for(var u=0;u<i;u++)n[u]<r[u]&&(o=tT(o,r[u],u),n=st(o));return o}function tT(e,t,n){return hb(...Array(t).fill(e),n)}function gb(e,t){if(!Array.isArray(e))throw new Error("Array expected");var n=st(e);if(t.length!==n.length)throw new Le(t.length,n.length);for(var r=0;r<t.length;r++)yt(t[r],n[r]);return t.reduce((i,a)=>i[a],e)}function vb(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e.length===0)return[];if(n)return a(e);var r=[];return i(e,0);function i(o,u){if(Array.isArray(o)){for(var l=o.length,s=Array(l),c=0;c<l;c++)r[u]=c,s[c]=i(o[c],u+1);return s}else return t(o,r.slice(0,u),e)}function a(o){if(Array.isArray(o)){for(var u=o.length,l=Array(u),s=0;s<u;s++)l[s]=a(o[s]);return l}else return t(o)}}function nT(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e.length===0)return;if(n){a(e);return}var r=[];i(e,0);function i(o,u){if(Array.isArray(o))for(var l=o.length,s=0;s<l;s++)r[u]=s,i(o[s],u+1);else t(o,r.slice(0,u),e)}function a(o){if(Array.isArray(o))for(var u=o.length,l=0;l<u;l++)a(o[l]);else t(o)}}function rT(e){return Ci([],e)}function uc(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Vs.isTypedFunction(e)){var i;if(r)i=1;else{var a=(t.isMatrix?t.size():st(t)).map(()=>0),o=t.isMatrix?t.get(a):gb(t,a);i=oT(e,o,a,t)}var u;if(t.isMatrix&&t.dataType!=="mixed"&&t.dataType!==void 0){var l=iT(e,i);u=l!==void 0?l:e}else u=e;return i>=1&&i<=3?{isUnary:i===1,fn:function(){for(var c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];return yb(u,f.slice(0,i),n,e.name)}}:{isUnary:!1,fn:function(){for(var c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];return yb(u,f,n,e.name)}}}return r===void 0?{isUnary:aT(e),fn:e}:{isUnary:r,fn:e}}function iT(e,t){var n=[];if(Object.entries(e.signatures).forEach(r=>{var[i,a]=r;i.split(",").length===t&&n.push(a)}),n.length===1)return n[0]}function aT(e){if(e.length!==1)return!1;var t=e.toString();if(/arguments/.test(t))return!1;var n=t.match(/\(.*?\)/);return!/\.\.\./.test(n)}function oT(e,t,n,r){for(var i=[t,n,r],a=3;a>0;a--){var o=i.slice(0,a);if(Vs.resolve(e,o)!==null)return a}}function yb(e,t,n,r){try{return e(...t)}catch(i){uT(i,t,n,r)}}function uT(e,t,n,r){var i;if(e instanceof TypeError&&((i=e.data)===null||i===void 0?void 0:i.category)==="wrongType"){var a=[];throw a.push("value: ".concat(Fn(t[0]))),t.length>=2&&a.push("index: ".concat(Fn(t[1]))),t.length>=3&&a.push("array: ".concat(Fn(t[2]))),new TypeError("Function ".concat(n," cannot apply callback arguments ")+"".concat(r,"(").concat(a.join(", "),") at index ").concat(JSON.stringify(t[1])))}else throw new TypeError("Function ".concat(n," cannot apply callback arguments ")+"to function ".concat(r,": ").concat(e.message))}var lT="DenseMatrix",sT=["Matrix"],cT=se(lT,sT,e=>{var{Matrix:t}=e;function n(c,f){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!ar(f))throw new Error("Invalid datatype: "+f);if(Pe(c))c.type==="DenseMatrix"?(this._data=Ie(c._data),this._size=Ie(c._size),this._datatype=f||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=f||c._datatype);else if(c&&ht(c.data)&&ht(c.size))this._data=c.data,this._size=c.size,lb(this._data,this._size),this._datatype=f||c.datatype;else if(ht(c))this._data=s(c),this._size=st(this._data),lb(this._data,this._size),this._datatype=f;else{if(c)throw new TypeError("Unsupported type of data ("+Fn(c)+")");this._data=[],this._size=[0],this._datatype=f}}n.prototype=new t,n.prototype.createDenseMatrix=function(c,f){return new n(c,f)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return oc(this._data,Fn)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(c,f){return new n(c,f)},n.prototype.subset=function(c,f,d){switch(arguments.length){case 1:return r(this,c);case 2:case 3:return a(this,c,f,d);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(c){return gb(this._data,c)},n.prototype.set=function(c,f,d){if(!ht(c))throw new TypeError("Array expected");if(c.length<this._size.length)throw new Le(c.length,this._size.length,"<");var h,v,m,D=c.map(function(g){return g+1});l(this,D,d);var p=this._data;for(h=0,v=c.length-1;h<v;h++)m=c[h],yt(m,p.length),p=p[m];return m=c[c.length-1],yt(m,p.length),p[m]=f,this};function r(c,f){if(!vh(f))throw new TypeError("Invalid index");var d=f.isScalar();if(d)return c.get(f.min());var h=f.size();if(h.length!==c._size.length)throw new Le(h.length,c._size.length);for(var v=f.min(),m=f.max(),D=0,p=c._size.length;D<p;D++)yt(v[D],c._size[D]),yt(m[D],c._size[D]);var g=new n([]),y=i(c._data,f);return g._size=y.size,g._datatype=c._datatype,g._data=y.data,g}function i(c,f){var d=f.size().length-1,h=Array(d);return{data:v(c),size:h};function v(m){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=f.dimension(D);return h[D]=p.size()[0],D<d?p.map(g=>(yt(g,m.length),v(m[g],D+1))).valueOf():p.map(g=>(yt(g,m.length),m[g])).valueOf()}}function a(c,f,d,h){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var v=f.size(),m=f.isScalar(),D;if(Pe(d)?(D=d.size(),d=d.valueOf()):D=st(d),m){if(D.length!==0)throw new TypeError("Scalar expected");c.set(f.min(),d,h)}else{if(!Ti(D,v))try{D.length===0?d=Oh([d],v):d=Oh(d,v),D=st(d)}catch{}if(v.length<c._size.length)throw new Le(v.length,c._size.length,"<");if(D.length<v.length){for(var p=0,g=0;v[p]===1&&D[p]===1;)p++;for(;v[p]===1;)g++,p++;d=cb(d,v.length,g,D)}if(!Ti(v,D))throw new Le(v,D,">");var y=f.max().map(function(S){return S+1});l(c,y,h),o(c._data,f,d)}return c}function o(c,f,d){var h=f.size().length-1;v(c,d);function v(m,D){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=f.dimension(p);p<h?g.forEach((y,S)=>{yt(y,m.length),v(m[y],D[S[0]],p+1)}):g.forEach((y,S)=>{yt(y,m.length),m[y]=D[S[0]]})}}n.prototype.resize=function(c,f,d){if(!Lu(c))throw new TypeError("Array or Matrix expected");var h=c.valueOf().map(m=>Array.isArray(m)&&m.length===1?m[0]:m),v=d?this.clone():this;return u(v,h,f)};function u(c,f,d){if(f.length===0){for(var h=c._data;ht(h);)h=h[0];return h}return c._size=f.slice(0),c._data=ac(c._data,c._size,d),c}n.prototype.reshape=function(c,f){var d=f?this.clone():this;d._data=Fh(d._data,c);var h=d._size.reduce((v,m)=>v*m);return d._size=Nh(c,h),d};function l(c,f,d){for(var h=c._size.slice(0),v=!1;h.length<f.length;)h.push(0),v=!0;for(var m=0,D=f.length;m<D;m++)f[m]>h[m]&&(h[m]=f[m],v=!0);v&&u(c,h,d)}n.prototype.clone=function(){var c=new n({data:Ie(this._data),size:Ie(this._size),datatype:this._datatype});return c},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=this,h=d._size.length-1;if(h<0)return d.clone();var v=uc(c,d,"map",f),m=v.fn,D=d.create(void 0,d._datatype);if(D._size=d._size,f||v.isUnary)return D._data=b(d._data),D;if(h===0){for(var p=d.valueOf(),g=Array(p.length),y=0;y<p.length;y++)g[y]=m(p[y],[y],d);return D._data=g,D}var S=[];return D._data=w(d._data),D;function w(E){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=Array(E.length);if(C<h)for(var T=0;T<E.length;T++)S[C]=T,A[T]=w(E[T],C+1);else for(var _=0;_<E.length;_++)S[C]=_,A[_]=m(E[_],S.slice(),d);return A}function b(E){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=Array(E.length);if(C<h)for(var T=0;T<E.length;T++)A[T]=b(E[T],C+1);else for(var _=0;_<E.length;_++)A[_]=m(E[_]);return A}},n.prototype.forEach=function(c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=this,h=d._size.length-1;if(h<0)return;var v=uc(c,d,"map",f),m=v.fn;if(f||v.isUnary){y(d._data);return}if(h===0){for(var D=0;D<d._data.length;D++)m(d._data[D],[D],d);return}var p=[];g(d._data);function g(S){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(w<h)for(var b=0;b<S.length;b++)p[w]=b,g(S[b],w+1);else for(var E=0;E<S.length;E++)p[w]=E,m(S[E],p.slice(),d)}function y(S){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(w<h)for(var b=0;b<S.length;b++)y(S[b],w+1);else for(var E=0;E<S.length;E++)m(S[E])}},n.prototype[Symbol.iterator]=function*(){var c=this._size.length-1;if(!(c<0)){if(c===0){for(var f=0;f<this._data.length;f++)yield{value:this._data[f],index:[f]};return}for(var d=Array(c+1).fill(0),h=this._size.reduce((g,y)=>g*y,1),v=0;v<h;v++){for(var m=this._data,D=0;D<c;D++)m=m[d[D]];yield{value:m[d[c]],index:d.slice()};for(var p=c;p>=0&&(d[p]++,!(d[p]<this._size[p]));p--)d[p]=0}}},n.prototype.rows=function(){var c=[],f=this.size();if(f.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var d=this._data;for(var h of d)c.push(new n([h],this._datatype));return c},n.prototype.columns=function(){var c=this,f=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var h=this._data,v=function(p){var g=h.map(y=>[y[p]]);f.push(new n(g,c._datatype))},m=0;m<d[1];m++)v(m);return f},n.prototype.toArray=function(){return Ie(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(c){return lt(this._data,c)},n.prototype.toString=function(){return lt(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(c){if(c){if(vt(c)&&(c=c.toNumber()),!et(c)||!it(c))throw new TypeError("The parameter k must be an integer number")}else c=0;for(var f=c>0?c:0,d=c<0?-c:0,h=this._size[0],v=this._size[1],m=Math.min(h-d,v-f),D=[],p=0;p<m;p++)D[p]=this._data[p+d][p+f];return new n({data:D,size:[m],datatype:this._datatype})},n.diagonal=function(c,f,d,h){if(!ht(c))throw new TypeError("Array expected, size parameter");if(c.length!==2)throw new Error("Only two dimensions matrix are supported");if(c=c.map(function(E){if(vt(E)&&(E=E.toNumber()),!et(E)||!it(E)||E<1)throw new Error("Size values must be positive integers");return E}),d){if(vt(d)&&(d=d.toNumber()),!et(d)||!it(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var v=d>0?d:0,m=d<0?-d:0,D=c[0],p=c[1],g=Math.min(D-m,p-v),y;if(ht(f)){if(f.length!==g)throw new Error("Invalid value array length");y=function(C){return f[C]}}else if(Pe(f)){var S=f.size();if(S.length!==1||S[0]!==g)throw new Error("Invalid matrix length");y=function(C){return f.get([C])}}else y=function(){return f};h||(h=vt(y(0))?y(0).mul(0):0);var w=[];if(c.length>0){w=ac(w,c,h);for(var b=0;b<g;b++)w[b+m][b+v]=y(b)}return new n({data:w,size:[D,p]})},n.fromJSON=function(c){return new n(c)},n.prototype.swapRows=function(c,f){if(!et(c)||!it(c)||!et(f)||!it(f))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return yt(c,this._size[0]),yt(f,this._size[0]),n._swapRows(c,f,this._data),this},n._swapRows=function(c,f,d){var h=d[c];d[c]=d[f],d[f]=h};function s(c){return Pe(c)?s(c.valueOf()):ht(c)?c.map(s):c}return n},{isClass:!0});function fT(e){var t=e.length,n=e[0].length,r,i,a=[];for(i=0;i<n;i++){var o=[];for(r=0;r<t;r++)o.push(e[r][i]);a.push(o)}return a}function bb(e){for(var t=0;t<e.length;t++)if(Lu(e[t]))return!0;return!1}function Db(e,t){Pe(e)?e.forEach(n=>t(n),!1,!0):nT(e,t,!0)}function pn(e,t,n){if(!n)return Pe(e)?e.map(i=>t(i),!1,!0):vb(e,t,!0);var r=i=>i===0?i:t(i);return Pe(e)?e.map(i=>r(i),!1,!0):vb(e,r,!0)}function Sb(e,t,n){var r=Array.isArray(e)?st(e):e.size();if(t<0||t>=r.length)throw new Ri(t,r.length);return Pe(e)?e.create(lc(e.valueOf(),t,n),e.datatype()):lc(e,t,n)}function lc(e,t,n){var r,i,a,o;if(t<=0)if(Array.isArray(e[0])){for(o=fT(e),i=[],r=0;r<o.length;r++)i[r]=lc(o[r],t-1,n);return i}else{for(a=e[0],r=1;r<e.length;r++)a=n(a,e[r]);return a}else{for(i=[],r=0;r<e.length;r++)i[r]=lc(e[r],t-1,n);return i}}var xb="isInteger",dT=["typed"],hT=se(xb,dT,e=>{var{typed:t}=e;return t(xb,{number:it,BigNumber:function(r){return r.isInt()},bigint:function(r){return!0},Fraction:function(r){return r.d===1n},"Array | Matrix":t.referToSelf(n=>r=>pn(r,n))})}),zh="number",sc="number, number";function wb(e){return Math.abs(e)}wb.signature=zh;function Eb(e,t){return e+t}Eb.signature=sc;function Ab(e,t){return e-t}Ab.signature=sc;function Cb(e,t){return e*t}Cb.signature=sc;function Tb(e){return-e}Tb.signature=zh;function Uh(e){return _C(e)}Uh.signature=zh;function Mb(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}Mb.signature=sc;var _b="number";function Bb(e){return e>0}Bb.signature=_b;function Fb(e){return Number.isNaN(e)}Fb.signature=_b;function go(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return e.isNaN()||t.isNaN()?!1:!e.isFinite()||!t.isFinite()?e.eq(t):e.eq(t)?!0:e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(n),r))}var Nb="isPositive",mT=["typed","config"],pT=se(Nb,mT,e=>{var{typed:t,config:n}=e;return t(Nb,{number:r=>Vr(r,0,n.relTol,n.absTol)?!1:Bb(r),BigNumber:r=>go(r,new r.constructor(0),n.relTol,n.absTol)?!1:!r.isNeg()&&!r.isZero()&&!r.isNaN(),bigint:r=>r>0n,Fraction:r=>r.s>0n&&r.n>0n,Unit:t.referToSelf(r=>i=>t.find(r,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(r=>i=>pn(i,r))})}),Rb="isZero",gT=["typed","equalScalar"],vT=se(Rb,gT,e=>{var{typed:t,equalScalar:n}=e;return t(Rb,{"number | BigNumber | Complex | Fraction":r=>n(r,0),bigint:r=>r===0n,Unit:t.referToSelf(r=>i=>t.find(r,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(r=>i=>pn(i,r))})}),Ob="isNaN",yT=["typed"],bT=se(Ob,yT,e=>{var{typed:t}=e;return t(Ob,{number:Fb,BigNumber:function(r){return r.isNaN()},bigint:function(r){return!1},Fraction:function(r){return!1},Complex:function(r){return r.isNaN()},Unit:function(r){return Number.isNaN(r.value)},"Array | Matrix":t.referToSelf(n=>r=>pn(r,n))})});function DT(e,t,n,r){return Vr(e.re,t.re,n,r)&&Vr(e.im,t.im,n,r)}var qu=se("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(n=>(r,i)=>{if(!r.equalBase(i))throw new Error("Cannot compare units with different base");return t.find(n,[r.valueType(),i.valueType()])(r.value,i.value)})}}),cc="equalScalar",ST=["typed","config"],xT=se(cc,ST,e=>{var{typed:t,config:n}=e,r=qu({typed:t});return t(cc,{"boolean, boolean":function(a,o){return a===o},"number, number":function(a,o){return Vr(a,o,n.relTol,n.absTol)},"BigNumber, BigNumber":function(a,o){return a.eq(o)||go(a,o,n.relTol,n.absTol)},"bigint, bigint":function(a,o){return a===o},"Fraction, Fraction":function(a,o){return a.equals(o)},"Complex, Complex":function(a,o){return DT(a,o,n.relTol,n.absTol)}},r)});se(cc,["typed","config"],e=>{var{typed:t,config:n}=e;return t(cc,{"number, number":function(i,a){return Vr(i,a,n.relTol,n.absTol)}})});var wT="SparseMatrix",ET=["typed","equalScalar","Matrix"],AT=se(wT,ET,e=>{var{typed:t,equalScalar:n,Matrix:r}=e;function i(m,D){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(D&&!ar(D))throw new Error("Invalid datatype: "+D);if(Pe(m))a(this,m,D);else if(m&&ht(m.index)&&ht(m.ptr)&&ht(m.size))this._values=m.values,this._index=m.index,this._ptr=m.ptr,this._size=m.size,this._datatype=D||m.datatype;else if(ht(m))o(this,m,D);else{if(m)throw new TypeError("Unsupported type of data ("+Fn(m)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=D}}function a(m,D,p){D.type==="SparseMatrix"?(m._values=D._values?Ie(D._values):void 0,m._index=Ie(D._index),m._ptr=Ie(D._ptr),m._size=Ie(D._size),m._datatype=p||D._datatype):o(m,D.valueOf(),p||D._datatype)}function o(m,D,p){m._values=[],m._index=[],m._ptr=[],m._datatype=p;var g=D.length,y=0,S=n,w=0;if(ar(p)&&(S=t.find(n,[p,p])||n,w=t.convert(0,p)),g>0){var b=0;do{m._ptr.push(m._index.length);for(var E=0;E<g;E++){var C=D[E];if(ht(C)){if(b===0&&y<C.length&&(y=C.length),b<C.length){var A=C[b];S(A,w)||(m._values.push(A),m._index.push(E))}}else b===0&&y<1&&(y=1),S(C,w)||(m._values.push(C),m._index.push(E))}b++}while(b<y)}m._ptr.push(m._index.length),m._size=[g,y]}i.prototype=new r,i.prototype.createSparseMatrix=function(m,D){return new i(m,D)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return oc(this._values,Fn)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(m,D){return new i(m,D)},i.prototype.density=function(){var m=this._size[0],D=this._size[1];return m!==0&&D!==0?this._index.length/(m*D):0},i.prototype.subset=function(m,D,p){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return u(this,m);case 2:case 3:return l(this,m,D,p);default:throw new SyntaxError("Wrong number of arguments")}};function u(m,D){if(!vh(D))throw new TypeError("Invalid index");var p=D.isScalar();if(p)return m.get(D.min());var g=D.size();if(g.length!==m._size.length)throw new Le(g.length,m._size.length);var y,S,w,b,E=D.min(),C=D.max();for(y=0,S=m._size.length;y<S;y++)yt(E[y],m._size[y]),yt(C[y],m._size[y]);var A=m._values,T=m._index,_=m._ptr,x=D.dimension(0),F=D.dimension(1),R=[],z=[];x.forEach(function(L,G){z[L]=G[0],R[L]=!0});var N=A?[]:void 0,U=[],I=[];return F.forEach(function(L){for(I.push(U.length),w=_[L],b=_[L+1];w<b;w++)y=T[w],R[y]===!0&&(U.push(z[y]),N&&N.push(A[w]))}),I.push(U.length),new i({values:N,index:U,ptr:I,size:g,datatype:m._datatype})}function l(m,D,p,g){if(!D||D.isIndex!==!0)throw new TypeError("Invalid index");var y=D.size(),S=D.isScalar(),w;if(Pe(p)?(w=p.size(),p=p.toArray()):w=st(p),S){if(w.length!==0)throw new TypeError("Scalar expected");m.set(D.min(),p,g)}else{if(y.length!==1&&y.length!==2)throw new Le(y.length,m._size.length,"<");if(w.length<y.length){for(var b=0,E=0;y[b]===1&&w[b]===1;)b++;for(;y[b]===1;)E++,b++;p=cb(p,y.length,E,w)}if(!Ti(y,w))throw new Le(y,w,">");if(y.length===1){var C=D.dimension(0);C.forEach(function(_,x){yt(_),m.set([_,0],p[x[0]],g)})}else{var A=D.dimension(0),T=D.dimension(1);A.forEach(function(_,x){yt(_),T.forEach(function(F,R){yt(F),m.set([_,F],p[x[0]][R[0]],g)})})}}return m}i.prototype.get=function(m){if(!ht(m))throw new TypeError("Array expected");if(m.length!==this._size.length)throw new Le(m.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var D=m[0],p=m[1];yt(D,this._size[0]),yt(p,this._size[1]);var g=s(D,this._ptr[p],this._ptr[p+1],this._index);return g<this._ptr[p+1]&&this._index[g]===D?this._values[g]:0},i.prototype.set=function(m,D,p){if(!ht(m))throw new TypeError("Array expected");if(m.length!==this._size.length)throw new Le(m.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var g=m[0],y=m[1],S=this._size[0],w=this._size[1],b=n,E=0;ar(this._datatype)&&(b=t.find(n,[this._datatype,this._datatype])||n,E=t.convert(0,this._datatype)),(g>S-1||y>w-1)&&(d(this,Math.max(g+1,S),Math.max(y+1,w),p),S=this._size[0],w=this._size[1]),yt(g,S),yt(y,w);var C=s(g,this._ptr[y],this._ptr[y+1],this._index);return C<this._ptr[y+1]&&this._index[C]===g?b(D,E)?c(C,y,this._values,this._index,this._ptr):this._values[C]=D:b(D,E)||f(C,g,y,D,this._values,this._index,this._ptr),this};function s(m,D,p,g){if(p-D===0)return p;for(var y=D;y<p;y++)if(g[y]===m)return y;return D}function c(m,D,p,g,y){p.splice(m,1),g.splice(m,1);for(var S=D+1;S<y.length;S++)y[S]--}function f(m,D,p,g,y,S,w){y.splice(m,0,g),S.splice(m,0,D);for(var b=p+1;b<w.length;b++)w[b]++}i.prototype.resize=function(m,D,p){if(!Lu(m))throw new TypeError("Array or Matrix expected");var g=m.valueOf().map(S=>Array.isArray(S)&&S.length===1?S[0]:S);if(g.length!==2)throw new Error("Only two dimensions matrix are supported");g.forEach(function(S){if(!et(S)||!it(S)||S<0)throw new TypeError("Invalid size, must contain positive integers (size: "+lt(g)+")")});var y=p?this.clone():this;return d(y,g[0],g[1],D)};function d(m,D,p,g){var y=g||0,S=n,w=0;ar(m._datatype)&&(S=t.find(n,[m._datatype,m._datatype])||n,w=t.convert(0,m._datatype),y=t.convert(y,m._datatype));var b=!S(y,w),E=m._size[0],C=m._size[1],A,T,_;if(p>C){for(T=C;T<p;T++)if(m._ptr[T]=m._values.length,b)for(A=0;A<E;A++)m._values.push(y),m._index.push(A);m._ptr[p]=m._values.length}else p<C&&(m._ptr.splice(p+1,C-p),m._values.splice(m._ptr[p],m._values.length),m._index.splice(m._ptr[p],m._index.length));if(C=p,D>E){if(b){var x=0;for(T=0;T<C;T++){m._ptr[T]=m._ptr[T]+x,_=m._ptr[T+1]+x;var F=0;for(A=E;A<D;A++,F++)m._values.splice(_+F,0,y),m._index.splice(_+F,0,A),x++}m._ptr[C]=m._values.length}}else if(D<E){var R=0;for(T=0;T<C;T++){m._ptr[T]=m._ptr[T]-R;var z=m._ptr[T],N=m._ptr[T+1]-R;for(_=z;_<N;_++)A=m._index[_],A>D-1&&(m._values.splice(_,1),m._index.splice(_,1),R++)}m._ptr[T]=m._values.length}return m._size[0]=D,m._size[1]=p,m}i.prototype.reshape=function(m,D){if(!ht(m))throw new TypeError("Array expected");if(m.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");m.forEach(function(L){if(!et(L)||!it(L)||L<=-2||L===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+lt(m)+")")});var p=this._size[0]*this._size[1];m=Nh(m,p);var g=m[0]*m[1];if(p!==g)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var y=D?this.clone():this;if(this._size[0]===m[0]&&this._size[1]===m[1])return y;for(var S=[],w=0;w<y._ptr.length;w++)for(var b=0;b<y._ptr[w+1]-y._ptr[w];b++)S.push(w);for(var E=y._values.slice(),C=y._index.slice(),A=0;A<y._index.length;A++){var T=C[A],_=S[A],x=T*y._size[1]+_;S[A]=x%m[1],C[A]=Math.floor(x/m[1])}y._values.length=0,y._index.length=0,y._ptr.length=m[1]+1,y._size=m.slice();for(var F=0;F<y._ptr.length;F++)y._ptr[F]=0;for(var R=0;R<E.length;R++){var z=C[R],N=S[R],U=E[R],I=s(z,y._ptr[N],y._ptr[N+1],y._index);f(I,z,N,U,y._values,y._index,y._ptr)}return y},i.prototype.clone=function(){var m=new i({values:this._values?Ie(this._values):void 0,index:Ie(this._index),ptr:Ie(this._ptr),size:Ie(this._size),datatype:this._datatype});return m},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(m,D){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var p=this,g=this._size[0],y=this._size[1],S=uc(m,p,"map"),w=function(E,C,A){return S.fn(E,[C,A],p)};return h(this,0,g-1,0,y-1,w,D)};function h(m,D,p,g,y,S,w){var b=[],E=[],C=[],A=n,T=0;ar(m._datatype)&&(A=t.find(n,[m._datatype,m._datatype])||n,T=t.convert(0,m._datatype));for(var _=function(j,H,k){var q=S(j,H,k);A(q,T)||(b.push(q),E.push(H))},x=g;x<=y;x++){C.push(b.length);var F=m._ptr[x],R=m._ptr[x+1];if(w)for(var z=F;z<R;z++){var N=m._index[z];N>=D&&N<=p&&_(m._values[z],N-D,x-g)}else{for(var U={},I=F;I<R;I++){var L=m._index[I];U[L]=m._values[I]}for(var G=D;G<=p;G++){var X=G in U?U[G]:0;_(X,G-D,x-g)}}}return C.push(b.length),new i({values:b,index:E,ptr:C,size:[p-D+1,y-g+1]})}i.prototype.forEach=function(m,D){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var p=this,g=this._size[0],y=this._size[1],S=uc(m,p,"forEach"),w=0;w<y;w++){var b=this._ptr[w],E=this._ptr[w+1];if(D)for(var C=b;C<E;C++){var A=this._index[C];S.fn(this._values[C],[A,w],p)}else{for(var T={},_=b;_<E;_++){var x=this._index[_];T[x]=this._values[_]}for(var F=0;F<g;F++){var R=F in T?T[F]:0;S.fn(R,[F,w],p)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var m=this._size[1],D=0;D<m;D++)for(var p=this._ptr[D],g=this._ptr[D+1],y=p;y<g;y++){var S=this._index[y];yield{value:this._values[y],index:[S,D]}}},i.prototype.toArray=function(){return v(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return v(this._values,this._index,this._ptr,this._size,!1)};function v(m,D,p,g,y){var S=g[0],w=g[1],b=[],E,C;for(E=0;E<S;E++)for(b[E]=[],C=0;C<w;C++)b[E][C]=0;for(C=0;C<w;C++)for(var A=p[C],T=p[C+1],_=A;_<T;_++)E=D[_],b[E][C]=m?y?Ie(m[_]):m[_]:1;return b}return i.prototype.format=function(m){for(var D=this._size[0],p=this._size[1],g=this.density(),y="Sparse Matrix ["+lt(D,m)+" x "+lt(p,m)+"] density: "+lt(g,m)+`
|
|
65
|
+
`,S=0;S<p;S++)for(var w=this._ptr[S],b=this._ptr[S+1],E=w;E<b;E++){var C=this._index[E];y+=`
|
|
66
|
+
(`+lt(C,m)+", "+lt(S,m)+") ==> "+(this._values?lt(this._values[E],m):"X")}return y},i.prototype.toString=function(){return lt(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(m){if(m){if(vt(m)&&(m=m.toNumber()),!et(m)||!it(m))throw new TypeError("The parameter k must be an integer number")}else m=0;var D=m>0?m:0,p=m<0?-m:0,g=this._size[0],y=this._size[1],S=Math.min(g-p,y-D),w=[],b=[],E=[];E[0]=0;for(var C=D;C<y&&w.length<S;C++)for(var A=this._ptr[C],T=this._ptr[C+1],_=A;_<T;_++){var x=this._index[_];if(x===C-D+p){w.push(this._values[_]),b[w.length-1]=x-p;break}}return E.push(w.length),new i({values:w,index:b,ptr:E,size:[S,1]})},i.fromJSON=function(m){return new i(m)},i.diagonal=function(m,D,p,g,y){if(!ht(m))throw new TypeError("Array expected, size parameter");if(m.length!==2)throw new Error("Only two dimensions matrix are supported");if(m=m.map(function(L){if(vt(L)&&(L=L.toNumber()),!et(L)||!it(L)||L<1)throw new Error("Size values must be positive integers");return L}),p){if(vt(p)&&(p=p.toNumber()),!et(p)||!it(p))throw new TypeError("The parameter k must be an integer number")}else p=0;var S=n,w=0;ar(y)&&(S=t.find(n,[y,y])||n,w=t.convert(0,y));var b=p>0?p:0,E=p<0?-p:0,C=m[0],A=m[1],T=Math.min(C-E,A-b),_;if(ht(D)){if(D.length!==T)throw new Error("Invalid value array length");_=function(G){return D[G]}}else if(Pe(D)){var x=D.size();if(x.length!==1||x[0]!==T)throw new Error("Invalid matrix length");_=function(G){return D.get([G])}}else _=function(){return D};for(var F=[],R=[],z=[],N=0;N<A;N++){z.push(F.length);var U=N-b;if(U>=0&&U<T){var I=_(U);S(I,w)||(R.push(U+E),F.push(I))}}return z.push(F.length),new i({values:F,index:R,ptr:z,size:[C,A]})},i.prototype.swapRows=function(m,D){if(!et(m)||!it(m)||!et(D)||!it(D))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return yt(m,this._size[0]),yt(D,this._size[0]),i._swapRows(m,D,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(m,D,p,g,y){for(var S=g[m],w=g[m+1],b=S;b<w;b++)y(p[b],D[b])},i._swapRows=function(m,D,p,g,y,S){for(var w=0;w<p;w++){var b=S[w],E=S[w+1],C=s(m,b,E,y),A=s(D,b,E,y);if(C<E&&A<E&&y[C]===m&&y[A]===D){if(g){var T=g[C];g[C]=g[A],g[A]=T}continue}if(C<E&&y[C]===m&&(A>=E||y[A]!==D)){var _=g?g[C]:void 0;y.splice(A,0,D),g&&g.splice(A,0,_),y.splice(A<=C?C+1:C,1),g&&g.splice(A<=C?C+1:C,1);continue}if(A<E&&y[A]===D&&(C>=E||y[C]!==m)){var x=g?g[A]:void 0;y.splice(C,0,m),g&&g.splice(C,0,x),y.splice(C<=A?A+1:A,1),g&&g.splice(C<=A?A+1:A,1)}}},i},{isClass:!0}),CT="number",TT=["typed"];function MT(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var n={"0b":2,"0o":8,"0x":16}[t[1]],r=t[2],i=t[3];return{input:e,radix:n,integerPart:r,fractionalPart:i}}else return null}function _T(e){for(var t=parseInt(e.integerPart,e.radix),n=0,r=0;r<e.fractionalPart.length;r++){var i=parseInt(e.fractionalPart[r],e.radix);n+=i/Math.pow(e.radix,r+1)}var a=t+n;if(isNaN(a))throw new SyntaxError('String "'+e.input+'" is not a valid number');return a}var BT=se(CT,TT,e=>{var{typed:t}=e,n=t("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var a=MT(i);if(a)return _T(a);var o=0,u=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);u&&(o=Number(u[2]),i=u[1]);var l=Number(i);if(isNaN(l))throw new SyntaxError('String "'+i+'" is not a valid number');if(u){if(l>2**o-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));l>=2**(o-1)&&(l=l-2**o)}return l},BigNumber:function(i){return i.toNumber()},bigint:function(i){return Number(i)},Fraction:function(i){return i.valueOf()},Unit:t.referToSelf(r=>i=>{var a=i.clone();return a.value=r(i.value),a}),null:function(i){return 0},"Unit, string | Unit":function(i,a){return i.toNumber(a)},"Array | Matrix":t.referToSelf(r=>i=>pn(i,r))});return n.fromJSON=function(r){return parseFloat(r.value)},n}),FT="bignumber",NT=["typed","BigNumber"],RT=se(FT,NT,e=>{var{typed:t,BigNumber:n}=e;return t("bignumber",{"":function(){return new n(0)},number:function(i){return new n(i+"")},string:function(i){var a=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(a){var o=a[2],u=n(a[1]),l=new n(2).pow(Number(o));if(u.gt(l.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var s=new n(2).pow(Number(o)-1);return u.gte(s)?u.sub(l):u}return new n(i)},BigNumber:function(i){return i},bigint:function(i){return new n(i.toString())},Unit:t.referToSelf(r=>i=>{var a=i.clone();return a.value=r(i.value),a}),Fraction:function(i){return new n(String(i.n)).div(String(i.d)).times(String(i.s))},null:function(i){return new n(0)},"Array | Matrix":t.referToSelf(r=>i=>pn(i,r))})}),OT="complex",zT=["typed","Complex"],UT=se(OT,zT,e=>{var{typed:t,Complex:n}=e;return t("complex",{"":function(){return n.ZERO},number:function(i){return new n(i,0)},"number, number":function(i,a){return new n(i,a)},"BigNumber, BigNumber":function(i,a){return new n(i.toNumber(),a.toNumber())},Fraction:function(i){return new n(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return n(i)},null:function(i){return n(0)},Object:function(i){if("re"in i&&"im"in i)return new n(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new n(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(r=>i=>pn(i,r))})}),IT="fraction",$T=["typed","Fraction"],kT=se(IT,$T,e=>{var{typed:t,Fraction:n}=e;return t("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new n(i)},string:function(i){return new n(i)},"number, number":function(i,a){return new n(i,a)},"bigint, bigint":function(i,a){return new n(i,a)},null:function(i){return new n(0)},BigNumber:function(i){return new n(i.toString())},bigint:function(i){return new n(i.toString())},Fraction:function(i){return i},Unit:t.referToSelf(r=>i=>{var a=i.clone();return a.value=r(i.value),a}),Object:function(i){return new n(i)},"Array | Matrix":t.referToSelf(r=>i=>pn(i,r))})}),zb="matrix",LT=["typed","Matrix","DenseMatrix","SparseMatrix"],jT=se(zb,LT,e=>{var{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(zb,{"":function(){return a([])},string:function(u){return a([],u)},"string, string":function(u,l){return a([],u,l)},Array:function(u){return a(u)},Matrix:function(u){return a(u,u.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(o,u,l){if(u==="dense"||u==="default"||u===void 0)return new r(o,l);if(u==="sparse")return new i(o,l);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}}),Ub="matrixFromColumns",HT=["typed","matrix","flatten","size"],PT=se(Ub,HT,e=>{var{typed:t,matrix:n,flatten:r,size:i}=e;return t(Ub,{"...Array":function(l){return a(l)},"...Matrix":function(l){return n(a(l.map(s=>s.toArray())))}});function a(u){if(u.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var l=o(u[0]),s=[],c=0;c<l;c++)s[c]=[];for(var f of u){var d=o(f);if(d!==l)throw new TypeError("The vectors had different length: "+(l|0)+" ≠ "+(d|0));for(var h=r(f),v=0;v<l;v++)s[v].push(h[v])}return s}function o(u){var l=i(u);if(l.length===1)return l[0];if(l.length===2){if(l[0]===1)return l[1];if(l[1]===1)return l[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),Ib="unaryMinus",qT=["typed"],VT=se(Ib,qT,e=>{var{typed:t}=e;return t(Ib,{number:Tb,"Complex | BigNumber | Fraction":n=>n.neg(),bigint:n=>-n,Unit:t.referToSelf(n=>r=>{var i=r.clone();return i.value=t.find(n,i.valueType())(r.value),i}),"Array | Matrix":t.referToSelf(n=>r=>pn(r,n,!0))})}),$b="abs",GT=["typed"],YT=se($b,GT,e=>{var{typed:t}=e;return t($b,{number:wb,"Complex | BigNumber | Fraction | Unit":n=>n.abs(),bigint:n=>n<0n?-n:n,"Array | Matrix":t.referToSelf(n=>r=>pn(r,n,!0))})}),kb="addScalar",XT=["typed"],ZT=se(kb,XT,e=>{var{typed:t}=e;return t(kb,{"number, number":Eb,"Complex, Complex":function(r,i){return r.add(i)},"BigNumber, BigNumber":function(r,i){return r.plus(i)},"bigint, bigint":function(r,i){return r+i},"Fraction, Fraction":function(r,i){return r.add(i)},"Unit, Unit":t.referToSelf(n=>(r,i)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(i))throw new Error("Units do not match");var a=r.clone();return a.value=t.find(n,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),Lb="subtractScalar",QT=["typed"],KT=se(Lb,QT,e=>{var{typed:t}=e;return t(Lb,{"number, number":Ab,"Complex, Complex":function(r,i){return r.sub(i)},"BigNumber, BigNumber":function(r,i){return r.minus(i)},"bigint, bigint":function(r,i){return r-i},"Fraction, Fraction":function(r,i){return r.sub(i)},"Unit, Unit":t.referToSelf(n=>(r,i)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(i))throw new Error("Units do not match");var a=r.clone();return a.value=t.find(n,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),WT="matAlgo11xS0s",JT=["typed","equalScalar"],jb=se(WT,JT,e=>{var{typed:t,equalScalar:n}=e;return function(i,a,o,u){var l=i._values,s=i._index,c=i._ptr,f=i._size,d=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=f[0],v=f[1],m,D=n,p=0,g=o;typeof d=="string"&&(m=d,D=t.find(n,[m,m]),p=t.convert(0,m),a=t.convert(a,m),g=t.find(o,[m,m]));for(var y=[],S=[],w=[],b=0;b<v;b++){w[b]=S.length;for(var E=c[b],C=c[b+1],A=E;A<C;A++){var T=s[A],_=u?g(a,l[A]):g(l[A],a);D(_,p)||(S.push(T),y.push(_))}}return w[v]=S.length,i.createSparseMatrix({values:y,index:S,ptr:w,size:[h,v],datatype:m})}}),eM="matAlgo12xSfs",tM=["typed","DenseMatrix"],vo=se(eM,tM,e=>{var{typed:t,DenseMatrix:n}=e;return function(i,a,o,u){var l=i._values,s=i._index,c=i._ptr,f=i._size,d=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=f[0],v=f[1],m,D=o;typeof d=="string"&&(m=d,a=t.convert(a,m),D=t.find(o,[m,m]));for(var p=[],g=[],y=[],S=0;S<v;S++){for(var w=S+1,b=c[S],E=c[S+1],C=b;C<E;C++){var A=s[C];g[A]=l[C],y[A]=w}for(var T=0;T<h;T++)S===0&&(p[T]=[]),y[T]===w?p[T][S]=u?D(a,g[T]):D(g[T],a):p[T][S]=u?D(a,0):D(0,a)}return new n({data:p,size:[h,v],datatype:m})}}),nM="matAlgo14xDs",rM=["typed"],Ih=se(nM,rM,e=>{var{typed:t}=e;return function(i,a,o,u){var l=i._data,s=i._size,c=i._datatype,f,d=o;typeof c=="string"&&(f=c,a=t.convert(a,f),d=t.find(o,[f,f]));var h=s.length>0?n(d,0,s,s[0],l,a,u):[];return i.createDenseMatrix({data:h,size:Ie(s),datatype:f})};function n(r,i,a,o,u,l,s){var c=[];if(i===a.length-1)for(var f=0;f<o;f++)c[f]=s?r(l,u[f]):r(u[f],l);else for(var d=0;d<o;d++)c[d]=n(r,i+1,a,a[i+1],u[d],l,s);return c}}),iM="matAlgo03xDSf",aM=["typed"],yo=se(iM,aM,e=>{var{typed:t}=e;return function(r,i,a,o){var u=r._data,l=r._size,s=r._datatype||r.getDataType(),c=i._values,f=i._index,d=i._ptr,h=i._size,v=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==h.length)throw new Le(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=l[0],D=l[1],p,g=0,y=a;typeof s=="string"&&s===v&&s!=="mixed"&&(p=s,g=t.convert(0,p),y=t.find(a,[p,p]));for(var S=[],w=0;w<m;w++)S[w]=[];for(var b=[],E=[],C=0;C<D;C++){for(var A=C+1,T=d[C],_=d[C+1],x=T;x<_;x++){var F=f[x];b[F]=o?y(c[x],u[F][C]):y(u[F][C],c[x]),E[F]=A}for(var R=0;R<m;R++)E[R]===A?S[R][C]=b[R]:S[R][C]=o?y(g,u[R][C]):y(u[R][C],g)}return r.createDenseMatrix({data:S,size:[m,D],datatype:s===r._datatype&&v===i._datatype?p:void 0})}}),oM="matAlgo05xSfSf",uM=["typed","equalScalar"],lM=se(oM,uM,e=>{var{typed:t,equalScalar:n}=e;return function(i,a,o){var u=i._values,l=i._index,s=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,v=a._ptr,m=a._size,D=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Le(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var p=c[0],g=c[1],y,S=n,w=0,b=o;typeof f=="string"&&f===D&&f!=="mixed"&&(y=f,S=t.find(n,[y,y]),w=t.convert(0,y),b=t.find(o,[y,y]));var E=u&&d?[]:void 0,C=[],A=[],T=E?[]:void 0,_=E?[]:void 0,x=[],F=[],R,z,N,U;for(z=0;z<g;z++){A[z]=C.length;var I=z+1;for(N=s[z],U=s[z+1];N<U;N++)R=l[N],C.push(R),x[R]=I,T&&(T[R]=u[N]);for(N=v[z],U=v[z+1];N<U;N++)R=h[N],x[R]!==I&&C.push(R),F[R]=I,_&&(_[R]=d[N]);if(E)for(N=A[z];N<C.length;){R=C[N];var L=x[R],G=F[R];if(L===I||G===I){var X=L===I?T[R]:w,P=G===I?_[R]:w,j=b(X,P);S(j,w)?C.splice(N,1):(E.push(j),N++)}}}return A[g]=C.length,i.createSparseMatrix({values:E,index:C,ptr:A,size:[p,g],datatype:f===i._datatype&&D===a._datatype?y:void 0})}}),sM="matAlgo13xDD",cM=["typed"],fM=se(sM,cM,e=>{var{typed:t}=e;return function(i,a,o){var u=i._data,l=i._size,s=i._datatype,c=a._data,f=a._size,d=a._datatype,h=[];if(l.length!==f.length)throw new Le(l.length,f.length);for(var v=0;v<l.length;v++){if(l[v]!==f[v])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+f+")");h[v]=l[v]}var m,D=o;typeof s=="string"&&s===d&&(m=s,D=t.find(o,[m,m]));var p=h.length>0?n(D,0,h,h[0],u,c):[];return i.createDenseMatrix({data:p,size:h,datatype:m})};function n(r,i,a,o,u,l){var s=[];if(i===a.length-1)for(var c=0;c<o;c++)s[c]=r(u[c],l[c]);else for(var f=0;f<o;f++)s[f]=n(r,i+1,a,a[i+1],u[f],l[f]);return s}});function Pt(e,t){if(Ti(e.size(),t.size()))return[e,t];var n=mb(e.size(),t.size());return[e,t].map(r=>dM(r,n))}function dM(e,t){return Ti(e.size(),t)?e:e.create(Oh(e.valueOf(),t),e.datatype())}var hM="matrixAlgorithmSuite",mM=["typed","matrix"],aa=se(hM,mM,e=>{var{typed:t,matrix:n}=e,r=fM({typed:t}),i=Ih({typed:t});return function(o){var u=o.elop,l=o.SD||o.DS,s;u?(s={"DenseMatrix, DenseMatrix":(h,v)=>r(...Pt(h,v),u),"Array, Array":(h,v)=>r(...Pt(n(h),n(v)),u).valueOf(),"Array, DenseMatrix":(h,v)=>r(...Pt(n(h),v),u),"DenseMatrix, Array":(h,v)=>r(...Pt(h,n(v)),u)},o.SS&&(s["SparseMatrix, SparseMatrix"]=(h,v)=>o.SS(...Pt(h,v),u,!1)),o.DS&&(s["DenseMatrix, SparseMatrix"]=(h,v)=>o.DS(...Pt(h,v),u,!1),s["Array, SparseMatrix"]=(h,v)=>o.DS(...Pt(n(h),v),u,!1)),l&&(s["SparseMatrix, DenseMatrix"]=(h,v)=>l(...Pt(v,h),u,!0),s["SparseMatrix, Array"]=(h,v)=>l(...Pt(n(v),h),u,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf(h=>(v,m)=>r(...Pt(v,m),h)),"Array, Array":t.referToSelf(h=>(v,m)=>r(...Pt(n(v),n(m)),h).valueOf()),"Array, DenseMatrix":t.referToSelf(h=>(v,m)=>r(...Pt(n(v),m),h)),"DenseMatrix, Array":t.referToSelf(h=>(v,m)=>r(...Pt(v,n(m)),h))},o.SS&&(s["SparseMatrix, SparseMatrix"]=t.referToSelf(h=>(v,m)=>o.SS(...Pt(v,m),h,!1))),o.DS&&(s["DenseMatrix, SparseMatrix"]=t.referToSelf(h=>(v,m)=>o.DS(...Pt(v,m),h,!1)),s["Array, SparseMatrix"]=t.referToSelf(h=>(v,m)=>o.DS(...Pt(n(v),m),h,!1))),l&&(s["SparseMatrix, DenseMatrix"]=t.referToSelf(h=>(v,m)=>l(...Pt(m,v),h,!0)),s["SparseMatrix, Array"]=t.referToSelf(h=>(v,m)=>l(...Pt(n(m),v),h,!0))));var c=o.scalar||"any",f=o.Ds||o.Ss;f&&(u?(s["DenseMatrix,"+c]=(h,v)=>i(h,v,u,!1),s[c+", DenseMatrix"]=(h,v)=>i(v,h,u,!0),s["Array,"+c]=(h,v)=>i(n(h),v,u,!1).valueOf(),s[c+", Array"]=(h,v)=>i(n(v),h,u,!0).valueOf()):(s["DenseMatrix,"+c]=t.referToSelf(h=>(v,m)=>i(v,m,h,!1)),s[c+", DenseMatrix"]=t.referToSelf(h=>(v,m)=>i(m,v,h,!0)),s["Array,"+c]=t.referToSelf(h=>(v,m)=>i(n(v),m,h,!1).valueOf()),s[c+", Array"]=t.referToSelf(h=>(v,m)=>i(n(m),v,h,!0).valueOf())));var d=o.sS!==void 0?o.sS:o.Ss;return u?(o.Ss&&(s["SparseMatrix,"+c]=(h,v)=>o.Ss(h,v,u,!1)),d&&(s[c+", SparseMatrix"]=(h,v)=>d(v,h,u,!0))):(o.Ss&&(s["SparseMatrix,"+c]=t.referToSelf(h=>(v,m)=>o.Ss(v,m,h,!1))),d&&(s[c+", SparseMatrix"]=t.referToSelf(h=>(v,m)=>d(m,v,h,!0)))),u&&u.signatures&&Ny(s,u.signatures),s}}),pM="matAlgo01xDSid",gM=["typed"],Hb=se(pM,gM,e=>{var{typed:t}=e;return function(r,i,a,o){var u=r._data,l=r._size,s=r._datatype||r.getDataType(),c=i._values,f=i._index,d=i._ptr,h=i._size,v=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==h.length)throw new Le(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=l[0],D=l[1],p=typeof s=="string"&&s!=="mixed"&&s===v?s:void 0,g=p?t.find(a,[p,p]):a,y,S,w=[];for(y=0;y<m;y++)w[y]=[];var b=[],E=[];for(S=0;S<D;S++){for(var C=S+1,A=d[S],T=d[S+1],_=A;_<T;_++)y=f[_],b[y]=o?g(c[_],u[y][S]):g(u[y][S],c[_]),E[y]=C;for(y=0;y<m;y++)E[y]===C?w[y][S]=b[y]:w[y][S]=u[y][S]}return r.createDenseMatrix({data:w,size:[m,D],datatype:s===r._datatype&&v===i._datatype?p:void 0})}}),vM="matAlgo04xSidSid",yM=["typed","equalScalar"],bM=se(vM,yM,e=>{var{typed:t,equalScalar:n}=e;return function(i,a,o){var u=i._values,l=i._index,s=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,v=a._ptr,m=a._size,D=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Le(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var p=c[0],g=c[1],y,S=n,w=0,b=o;typeof f=="string"&&f===D&&f!=="mixed"&&(y=f,S=t.find(n,[y,y]),w=t.convert(0,y),b=t.find(o,[y,y]));var E=u&&d?[]:void 0,C=[],A=[],T=u&&d?[]:void 0,_=u&&d?[]:void 0,x=[],F=[],R,z,N,U,I;for(z=0;z<g;z++){A[z]=C.length;var L=z+1;for(U=s[z],I=s[z+1],N=U;N<I;N++)R=l[N],C.push(R),x[R]=L,T&&(T[R]=u[N]);for(U=v[z],I=v[z+1],N=U;N<I;N++)if(R=h[N],x[R]===L){if(T){var G=b(T[R],d[N]);S(G,w)?x[R]=null:T[R]=G}}else C.push(R),F[R]=L,_&&(_[R]=d[N]);if(T&&_)for(N=A[z];N<C.length;)R=C[N],x[R]===L?(E[N]=T[R],N++):F[R]===L?(E[N]=_[R],N++):C.splice(N,1)}return A[g]=C.length,i.createSparseMatrix({values:E,index:C,ptr:A,size:[p,g],datatype:f===i._datatype&&D===a._datatype?y:void 0})}}),DM="matAlgo10xSids",SM=["typed","DenseMatrix"],Pb=se(DM,SM,e=>{var{typed:t,DenseMatrix:n}=e;return function(i,a,o,u){var l=i._values,s=i._index,c=i._ptr,f=i._size,d=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=f[0],v=f[1],m,D=o;typeof d=="string"&&(m=d,a=t.convert(a,m),D=t.find(o,[m,m]));for(var p=[],g=[],y=[],S=0;S<v;S++){for(var w=S+1,b=c[S],E=c[S+1],C=b;C<E;C++){var A=s[C];g[A]=l[C],y[A]=w}for(var T=0;T<h;T++)S===0&&(p[T]=[]),y[T]===w?p[T][S]=u?D(a,g[T]):D(g[T],a):p[T][S]=a}return new n({data:p,size:[h,v],datatype:m})}}),xM="multiplyScalar",wM=["typed"],EM=se(xM,wM,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":Cb,"Complex, Complex":function(r,i){return r.mul(i)},"BigNumber, BigNumber":function(r,i){return r.times(i)},"bigint, bigint":function(r,i){return r*i},"Fraction, Fraction":function(r,i){return r.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(n,r)=>r.multiply(n),"Unit, number | Fraction | BigNumber | Complex | Unit":(n,r)=>n.multiply(r)})}),qb="multiply",AM=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],CM=se(qb,AM,e=>{var{typed:t,matrix:n,addScalar:r,multiplyScalar:i,equalScalar:a,dot:o}=e,u=jb({typed:t,equalScalar:a}),l=Ih({typed:t});function s(w,b){switch(w.length){case 1:switch(b.length){case 1:if(w[0]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(w[0]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+w[0]+") must match Matrix rows ("+b[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+b.length+" dimensions)")}break;case 2:switch(b.length){case 1:if(w[1]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+w[1]+") must match Vector length ("+b[0]+")");break;case 2:if(w[1]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+w[1]+") must match Matrix B rows ("+b[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+b.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+w.length+" dimensions)")}}function c(w,b,E){if(E===0)throw new Error("Cannot multiply two empty vectors");return o(w,b)}function f(w,b){if(b.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return d(w,b)}function d(w,b){var E=w._data,C=w._size,A=w._datatype||w.getDataType(),T=b._data,_=b._size,x=b._datatype||b.getDataType(),F=C[0],R=_[1],z,N=r,U=i;A&&x&&A===x&&typeof A=="string"&&A!=="mixed"&&(z=A,N=t.find(r,[z,z]),U=t.find(i,[z,z]));for(var I=[],L=0;L<R;L++){for(var G=U(E[0],T[0][L]),X=1;X<F;X++)G=N(G,U(E[X],T[X][L]));I[L]=G}return w.createDenseMatrix({data:I,size:[R],datatype:A===w._datatype&&x===b._datatype?z:void 0})}var h=t("_multiplyMatrixVector",{"DenseMatrix, any":m,"SparseMatrix, any":g}),v=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":D,"DenseMatrix, SparseMatrix":p,"SparseMatrix, DenseMatrix":y,"SparseMatrix, SparseMatrix":S});function m(w,b){var E=w._data,C=w._size,A=w._datatype||w.getDataType(),T=b._data,_=b._datatype||b.getDataType(),x=C[0],F=C[1],R,z=r,N=i;A&&_&&A===_&&typeof A=="string"&&A!=="mixed"&&(R=A,z=t.find(r,[R,R]),N=t.find(i,[R,R]));for(var U=[],I=0;I<x;I++){for(var L=E[I],G=N(L[0],T[0]),X=1;X<F;X++)G=z(G,N(L[X],T[X]));U[I]=G}return w.createDenseMatrix({data:U,size:[x],datatype:A===w._datatype&&_===b._datatype?R:void 0})}function D(w,b){var E=w._data,C=w._size,A=w._datatype||w.getDataType(),T=b._data,_=b._size,x=b._datatype||b.getDataType(),F=C[0],R=C[1],z=_[1],N,U=r,I=i;A&&x&&A===x&&typeof A=="string"&&A!=="mixed"&&A!=="mixed"&&(N=A,U=t.find(r,[N,N]),I=t.find(i,[N,N]));for(var L=[],G=0;G<F;G++){var X=E[G];L[G]=[];for(var P=0;P<z;P++){for(var j=I(X[0],T[0][P]),H=1;H<R;H++)j=U(j,I(X[H],T[H][P]));L[G][P]=j}}return w.createDenseMatrix({data:L,size:[F,z],datatype:A===w._datatype&&x===b._datatype?N:void 0})}function p(w,b){var E=w._data,C=w._size,A=w._datatype||w.getDataType(),T=b._values,_=b._index,x=b._ptr,F=b._size,R=b._datatype||b._data===void 0?b._datatype:b.getDataType();if(!T)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var z=C[0],N=F[1],U,I=r,L=i,G=a,X=0;A&&R&&A===R&&typeof A=="string"&&A!=="mixed"&&(U=A,I=t.find(r,[U,U]),L=t.find(i,[U,U]),G=t.find(a,[U,U]),X=t.convert(0,U));for(var P=[],j=[],H=[],k=b.createSparseMatrix({values:P,index:j,ptr:H,size:[z,N],datatype:A===w._datatype&&R===b._datatype?U:void 0}),q=0;q<N;q++){H[q]=j.length;var Y=x[q],ee=x[q+1];if(ee>Y)for(var te=0,ne=0;ne<z;ne++){for(var oe=ne+1,W=void 0,ce=Y;ce<ee;ce++){var de=_[ce];te!==oe?(W=L(E[ne][de],T[ce]),te=oe):W=I(W,L(E[ne][de],T[ce]))}te===oe&&!G(W,X)&&(j.push(ne),P.push(W))}}return H[N]=j.length,k}function g(w,b){var E=w._values,C=w._index,A=w._ptr,T=w._datatype||w._data===void 0?w._datatype:w.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var _=b._data,x=b._datatype||b.getDataType(),F=w._size[0],R=b._size[0],z=[],N=[],U=[],I,L=r,G=i,X=a,P=0;T&&x&&T===x&&typeof T=="string"&&T!=="mixed"&&(I=T,L=t.find(r,[I,I]),G=t.find(i,[I,I]),X=t.find(a,[I,I]),P=t.convert(0,I));var j=[],H=[];U[0]=0;for(var k=0;k<R;k++){var q=_[k];if(!X(q,P))for(var Y=A[k],ee=A[k+1],te=Y;te<ee;te++){var ne=C[te];H[ne]?j[ne]=L(j[ne],G(q,E[te])):(H[ne]=!0,N.push(ne),j[ne]=G(q,E[te]))}}for(var oe=N.length,W=0;W<oe;W++){var ce=N[W];z[W]=j[ce]}return U[1]=N.length,w.createSparseMatrix({values:z,index:N,ptr:U,size:[F,1],datatype:T===w._datatype&&x===b._datatype?I:void 0})}function y(w,b){var E=w._values,C=w._index,A=w._ptr,T=w._datatype||w._data===void 0?w._datatype:w.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var _=b._data,x=b._datatype||b.getDataType(),F=w._size[0],R=b._size[0],z=b._size[1],N,U=r,I=i,L=a,G=0;T&&x&&T===x&&typeof T=="string"&&T!=="mixed"&&(N=T,U=t.find(r,[N,N]),I=t.find(i,[N,N]),L=t.find(a,[N,N]),G=t.convert(0,N));for(var X=[],P=[],j=[],H=w.createSparseMatrix({values:X,index:P,ptr:j,size:[F,z],datatype:T===w._datatype&&x===b._datatype?N:void 0}),k=[],q=[],Y=0;Y<z;Y++){j[Y]=P.length;for(var ee=Y+1,te=0;te<R;te++){var ne=_[te][Y];if(!L(ne,G))for(var oe=A[te],W=A[te+1],ce=oe;ce<W;ce++){var de=C[ce];q[de]!==ee?(q[de]=ee,P.push(de),k[de]=I(ne,E[ce])):k[de]=U(k[de],I(ne,E[ce]))}}for(var ve=j[Y],De=P.length,Se=ve;Se<De;Se++){var Ee=P[Se];X[Se]=k[Ee]}}return j[z]=P.length,H}function S(w,b){var E=w._values,C=w._index,A=w._ptr,T=w._datatype||w._data===void 0?w._datatype:w.getDataType(),_=b._values,x=b._index,F=b._ptr,R=b._datatype||b._data===void 0?b._datatype:b.getDataType(),z=w._size[0],N=b._size[1],U=E&&_,I,L=r,G=i;T&&R&&T===R&&typeof T=="string"&&T!=="mixed"&&(I=T,L=t.find(r,[I,I]),G=t.find(i,[I,I]));for(var X=U?[]:void 0,P=[],j=[],H=w.createSparseMatrix({values:X,index:P,ptr:j,size:[z,N],datatype:T===w._datatype&&R===b._datatype?I:void 0}),k=U?[]:void 0,q=[],Y,ee,te,ne,oe,W,ce,de,ve=0;ve<N;ve++){j[ve]=P.length;var De=ve+1;for(oe=F[ve],W=F[ve+1],ne=oe;ne<W;ne++)if(de=x[ne],U)for(ee=A[de],te=A[de+1],Y=ee;Y<te;Y++)ce=C[Y],q[ce]!==De?(q[ce]=De,P.push(ce),k[ce]=G(_[ne],E[Y])):k[ce]=L(k[ce],G(_[ne],E[Y]));else for(ee=A[de],te=A[de+1],Y=ee;Y<te;Y++)ce=C[Y],q[ce]!==De&&(q[ce]=De,P.push(ce));if(U)for(var Se=j[ve],Ee=P.length,Re=Se;Re<Ee;Re++){var Ce=P[Re];X[Re]=k[Ce]}}return j[N]=P.length,H}return t(qb,i,{"Array, Array":t.referTo("Matrix, Matrix",w=>(b,E)=>{s(st(b),st(E));var C=w(n(b),n(E));return Pe(C)?C.valueOf():C}),"Matrix, Matrix":function(b,E){var C=b.size(),A=E.size();return s(C,A),C.length===1?A.length===1?c(b,E,C[0]):f(b,E):A.length===1?h(b,E):v(b,E)},"Matrix, Array":t.referTo("Matrix,Matrix",w=>(b,E)=>w(b,n(E))),"Array, Matrix":t.referToSelf(w=>(b,E)=>w(n(b,E.storage()),E)),"SparseMatrix, any":function(b,E){return u(b,E,i,!1)},"DenseMatrix, any":function(b,E){return l(b,E,i,!1)},"any, SparseMatrix":function(b,E){return u(E,b,i,!0)},"any, DenseMatrix":function(b,E){return l(E,b,i,!0)},"Array, any":function(b,E){return l(n(b),E,i,!1).valueOf()},"any, Array":function(b,E){return l(n(E),b,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(w=>(b,E,C)=>{for(var A=w(b,E),T=0;T<C.length;T++)A=w(A,C[T]);return A})})}),Vb="sign",TM=["typed","BigNumber","Fraction","complex"],MM=se(Vb,TM,e=>{var{typed:t,BigNumber:n,complex:r,Fraction:i}=e;return t(Vb,{number:Uh,Complex:function(o){return o.im===0?r(Uh(o.re)):o.sign()},BigNumber:function(o){return new n(o.cmp(0))},bigint:function(o){return o>0n?1n:o<0n?-1n:0n},Fraction:function(o){return o.n===0n?new i(0):new i(o.s)},"Array | Matrix":t.referToSelf(a=>o=>pn(o,a,!0)),Unit:t.referToSelf(a=>o=>{if(!o._isDerived()&&o.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return t.find(a,o.valueType())(o.value)})})}),_M="sqrt",BM=["config","typed","Complex"],FM=se(_M,BM,e=>{var{config:t,typed:n,Complex:r}=e;return n("sqrt",{number:i,Complex:function(o){return o.sqrt()},BigNumber:function(o){return!o.isNegative()||t.predictable?o.sqrt():i(o.toNumber())},Unit:function(o){return o.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||t.predictable?Math.sqrt(a):new r(a,0).sqrt()}}),Gb="subtract",NM=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],RM=se(Gb,NM,e=>{var{typed:t,matrix:n,equalScalar:r,subtractScalar:i,unaryMinus:a,DenseMatrix:o,concat:u}=e,l=Hb({typed:t}),s=yo({typed:t}),c=lM({typed:t,equalScalar:r}),f=Pb({typed:t,DenseMatrix:o}),d=vo({typed:t,DenseMatrix:o}),h=aa({typed:t,matrix:n,concat:u});return t(Gb,{"any, any":i},h({elop:i,SS:c,DS:l,SD:s,Ss:d,sS:f}))}),OM="matAlgo07xSSf",zM=["typed","SparseMatrix"],Vu=se(OM,zM,e=>{var{typed:t,SparseMatrix:n}=e;return function(a,o,u){var l=a._size,s=a._datatype||a._data===void 0?a._datatype:a.getDataType(),c=o._size,f=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(l.length!==c.length)throw new Le(l.length,c.length);if(l[0]!==c[0]||l[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+c+")");var d=l[0],h=l[1],v,m=0,D=u;typeof s=="string"&&s===f&&s!=="mixed"&&(v=s,m=t.convert(0,v),D=t.find(u,[v,v]));for(var p=[],g=[],y=new Array(h+1).fill(0),S=[],w=[],b=[],E=[],C=0;C<h;C++){var A=C+1,T=0;r(a,C,b,S,A),r(o,C,E,w,A);for(var _=0;_<d;_++){var x=b[_]===A?S[_]:m,F=E[_]===A?w[_]:m,R=D(x,F);R!==0&&R!==!1&&(g.push(_),p.push(R),T++)}y[C+1]=y[C]+T}return new n({values:p,index:g,ptr:y,size:[d,h],datatype:s===a._datatype&&f===o._datatype?v:void 0})};function r(i,a,o,u,l){for(var s=i._values,c=i._index,f=i._ptr,d=f[a],h=f[a+1];d<h;d++){var v=c[d];o[v]=l,u[v]=s[d]}}}),Yb="conj",UM=["typed"],IM=se(Yb,UM,e=>{var{typed:t}=e;return t(Yb,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.conjugate(),Unit:t.referToSelf(n=>r=>new r.constructor(n(r.toNumeric()),r.formatUnits())),"Array | Matrix":t.referToSelf(n=>r=>pn(r,n))})}),Xb="im",$M=["typed"],kM=se(Xb,$M,e=>{var{typed:t}=e;return t(Xb,{number:()=>0,"BigNumber | Fraction":n=>n.mul(0),Complex:n=>n.im,"Array | Matrix":t.referToSelf(n=>r=>pn(r,n))})}),Zb="re",LM=["typed"],jM=se(Zb,LM,e=>{var{typed:t}=e;return t(Zb,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.re,"Array | Matrix":t.referToSelf(n=>r=>pn(r,n))})}),Qb="concat",HM=["typed","matrix","isInteger"],PM=se(Qb,HM,e=>{var{typed:t,matrix:n,isInteger:r}=e;return t(Qb,{"...Array | Matrix | number | BigNumber":function(a){var o,u=a.length,l=-1,s,c=!1,f=[];for(o=0;o<u;o++){var d=a[o];if(Pe(d)&&(c=!0),et(d)||vt(d)){if(o!==u-1)throw new Error("Dimension must be specified as last argument");if(s=l,l=d.valueOf(),!r(l))throw new TypeError("Integer number expected for dimension");if(l<0||o>0&&l>s)throw new Ri(l,s+1)}else{var h=Ie(d).valueOf(),v=st(h);if(f[o]=h,s=l,l=v.length-1,o>0&&l!==s)throw new Le(s+1,l+1)}}if(f.length===0)throw new SyntaxError("At least one matrix expected");for(var m=f.shift();f.length;)m=hb(m,f.shift(),l);return c?n(m):m},"...string":function(a){return a.join("")}})}),Kb="column",qM=["typed","Index","matrix","range"],VM=se(Kb,qM,e=>{var{typed:t,Index:n,matrix:r,range:i}=e;return t(Kb,{"Matrix, number":a,"Array, number":function(u,l){return a(r(Ie(u)),l).valueOf()}});function a(o,u){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");yt(u,o.size()[1]);var l=i(0,o.size()[0]),s=new n(l,u),c=o.subset(s);return Pe(c)?c:r([[c]])}}),Wb="diag",GM=["typed","matrix","DenseMatrix","SparseMatrix"],YM=se(Wb,GM,e=>{var{typed:t,matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(Wb,{Array:function(s){return a(s,0,st(s),null)},"Array, number":function(s,c){return a(s,c,st(s),null)},"Array, BigNumber":function(s,c){return a(s,c.toNumber(),st(s),null)},"Array, string":function(s,c){return a(s,0,st(s),c)},"Array, number, string":function(s,c,f){return a(s,c,st(s),f)},"Array, BigNumber, string":function(s,c,f){return a(s,c.toNumber(),st(s),f)},Matrix:function(s){return a(s,0,s.size(),s.storage())},"Matrix, number":function(s,c){return a(s,c,s.size(),s.storage())},"Matrix, BigNumber":function(s,c){return a(s,c.toNumber(),s.size(),s.storage())},"Matrix, string":function(s,c){return a(s,0,s.size(),c)},"Matrix, number, string":function(s,c,f){return a(s,c,s.size(),f)},"Matrix, BigNumber, string":function(s,c,f){return a(s,c.toNumber(),s.size(),f)}});function a(l,s,c,f){if(!it(s))throw new TypeError("Second parameter in function diag must be an integer");var d=s>0?s:0,h=s<0?-s:0;switch(c.length){case 1:return o(l,s,f,c[0],h,d);case 2:return u(l,s,f,c,h,d)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function o(l,s,c,f,d,h){var v=[f+d,f+h];if(c&&c!=="sparse"&&c!=="dense")throw new TypeError("Unknown matrix type ".concat(c,'"'));var m=c==="sparse"?i.diagonal(v,l,s):r.diagonal(v,l,s);return c!==null?m:m.valueOf()}function u(l,s,c,f,d,h){if(Pe(l)){var v=l.diagonal(s);return c!==null?c!==v.storage()?n(v,c):v:v.valueOf()}for(var m=Math.min(f[0]-d,f[1]-h),D=[],p=0;p<m;p++)D[p]=l[p+d][p+h];return c!==null?n(D):D}}),Jb="flatten",XM=["typed"],ZM=se(Jb,XM,e=>{var{typed:t}=e;return t(Jb,{Array:function(r){return Rh(r)},Matrix:function(r){return r.create(Rh(r.valueOf(),!0),r.datatype())}})}),eD="getMatrixDataType",QM=["typed"],KM=se(eD,QM,e=>{var{typed:t}=e;return t(eD,{Array:function(r){return oc(r,Fn)},Matrix:function(r){return r.getDataType()}})}),tD="identity",WM=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],JM=se(tD,WM,e=>{var{typed:t,config:n,matrix:r,BigNumber:i,DenseMatrix:a,SparseMatrix:o}=e;return t(tD,{"":function(){return n.matrix==="Matrix"?r([]):[]},string:function(c){return r(c)},"number | BigNumber":function(c){return l(c,c,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(c,f){return l(c,c,f)},"number | BigNumber, number | BigNumber":function(c,f){return l(c,f,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(c,f,d){return l(c,f,d)},Array:function(c){return u(c)},"Array, string":function(c,f){return u(c,f)},Matrix:function(c){return u(c.valueOf(),c.storage())},"Matrix, string":function(c,f){return u(c.valueOf(),f)}});function u(s,c){switch(s.length){case 0:return c?r(c):[];case 1:return l(s[0],s[0],c);case 2:return l(s[0],s[1],c);default:throw new Error("Vector containing two values expected")}}function l(s,c,f){var d=vt(s)||vt(c)?i:null;if(vt(s)&&(s=s.toNumber()),vt(c)&&(c=c.toNumber()),!it(s)||s<1)throw new Error("Parameters in function identity must be positive integers");if(!it(c)||c<1)throw new Error("Parameters in function identity must be positive integers");var h=d?new i(1):1,v=d?new d(0):0,m=[s,c];if(f){if(f==="sparse")return o.diagonal(m,h,0,v);if(f==="dense")return a.diagonal(m,h,0,v);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var D=ac([],m,v),p=s<c?s:c,g=0;g<p;g++)D[g][g]=h;return D}});function nD(){throw new Error('No "bignumber" implementation available')}function e4(){throw new Error('No "fraction" implementation available')}function rD(){throw new Error('No "matrix" implementation available')}var iD="range",t4=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],n4=se(iD,t4,e=>{var{typed:t,config:n,matrix:r,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:l,add:s,isPositive:c}=e;return t(iD,{string:d,"string, boolean":d,number:function(D){throw new TypeError("Too few arguments to function range(): ".concat(D))},boolean:function(D){throw new TypeError("Unexpected type of argument 1 to function range(): ".concat(D,", number|bigint|BigNumber|Fraction"))},"number, number":function(D,p){return f(h(D,p,1,!1))},"number, number, number":function(D,p,g){return f(h(D,p,g,!1))},"number, number, boolean":function(D,p,g){return f(h(D,p,1,g))},"number, number, number, boolean":function(D,p,g,y){return f(h(D,p,g,y))},"bigint, bigint|number":function(D,p){return f(h(D,p,1n,!1))},"number, bigint":function(D,p){return f(h(BigInt(D),p,1n,!1))},"bigint, bigint|number, bigint|number":function(D,p,g){return f(h(D,p,BigInt(g),!1))},"number, bigint, bigint|number":function(D,p,g){return f(h(BigInt(D),p,BigInt(g),!1))},"bigint, bigint|number, boolean":function(D,p,g){return f(h(D,p,1n,g))},"number, bigint, boolean":function(D,p,g){return f(h(BigInt(D),p,1n,g))},"bigint, bigint|number, bigint|number, boolean":function(D,p,g,y){return f(h(D,p,BigInt(g),y))},"number, bigint, bigint|number, boolean":function(D,p,g,y){return f(h(BigInt(D),p,BigInt(g),y))},"BigNumber, BigNumber":function(D,p){var g=D.constructor;return f(h(D,p,new g(1),!1))},"BigNumber, BigNumber, BigNumber":function(D,p,g){return f(h(D,p,g,!1))},"BigNumber, BigNumber, boolean":function(D,p,g){var y=D.constructor;return f(h(D,p,new y(1),g))},"BigNumber, BigNumber, BigNumber, boolean":function(D,p,g,y){return f(h(D,p,g,y))},"Fraction, Fraction":function(D,p){return f(h(D,p,1,!1))},"Fraction, Fraction, Fraction":function(D,p,g){return f(h(D,p,g,!1))},"Fraction, Fraction, boolean":function(D,p,g){return f(h(D,p,1,g))},"Fraction, Fraction, Fraction, boolean":function(D,p,g,y){return f(h(D,p,g,y))},"Unit, Unit, Unit":function(D,p,g){return f(h(D,p,g,!1))},"Unit, Unit, Unit, boolean":function(D,p,g,y){return f(h(D,p,g,y))}});function f(m){return n.matrix==="Matrix"?r?r(m):rD():m}function d(m,D){var p=v(m);if(!p)throw new SyntaxError('String "'+m+'" is no valid range');return n.number==="BigNumber"?(i===void 0&&nD(),f(h(i(p.start),i(p.end),i(p.step)))):f(h(p.start,p.end,p.step,D))}function h(m,D,p,g){for(var y=[],S=c(p)?g?o:a:g?l:u,w=m;S(w,D);)y.push(w),w=s(w,p);return y}function v(m){var D=m.split(":"),p=D.map(function(y){return Number(y)}),g=p.some(function(y){return isNaN(y)});if(g)return null;switch(p.length){case 2:return{start:p[0],end:p[1],step:1};case 3:return{start:p[0],end:p[2],step:p[1]};default:return null}}}),aD="reshape",r4=["typed","isInteger","matrix"],i4=se(aD,r4,e=>{var{typed:t,isInteger:n}=e;return t(aD,{"Matrix, Array":function(i,a){return i.reshape(a,!0)},"Array, Array":function(i,a){return a.forEach(function(o){if(!n(o))throw new TypeError("Invalid size for dimension: "+o)}),Fh(i,a)}})}),oD="size",a4=["typed","config","?matrix"],o4=se(oD,a4,e=>{var{typed:t,config:n,matrix:r}=e;return t(oD,{Matrix:function(a){return a.create(a.size(),"number")},Array:st,string:function(a){return n.matrix==="Array"?[a.length]:r([a.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(a){return n.matrix==="Array"?[]:r?r([],"dense","number"):rD()}})}),uD="transpose",u4=["typed","matrix"],l4=se(uD,u4,e=>{var{typed:t,matrix:n}=e;return t(uD,{Array:o=>r(n(o)).valueOf(),Matrix:r,any:Ie});function r(o){var u=o.size(),l;switch(u.length){case 1:l=o.clone();break;case 2:{var s=u[0],c=u[1];if(c===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+lt(u)+")");switch(o.storage()){case"dense":l=i(o,s,c);break;case"sparse":l=a(o,s,c);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+lt(u)+")")}return l}function i(o,u,l){for(var s=o._data,c=[],f,d=0;d<l;d++){f=c[d]=[];for(var h=0;h<u;h++)f[h]=Ie(s[h][d])}return o.createDenseMatrix({data:c,size:[l,u],datatype:o._datatype})}function a(o,u,l){for(var s=o._values,c=o._index,f=o._ptr,d=s?[]:void 0,h=[],v=[],m=[],D=0;D<u;D++)m[D]=0;var p,g,y;for(p=0,g=c.length;p<g;p++)m[c[p]]++;for(var S=0,w=0;w<u;w++)v.push(S),S+=m[w],m[w]=v[w];for(v.push(S),y=0;y<l;y++)for(var b=f[y],E=f[y+1],C=b;C<E;C++){var A=m[c[C]]++;h[A]=y,s&&(d[A]=Ie(s[C]))}return o.createSparseMatrix({values:d,index:h,ptr:v,size:[l,u],datatype:o._datatype})}}),lD="ctranspose",s4=["typed","transpose","conj"],c4=se(lD,s4,e=>{var{typed:t,transpose:n,conj:r}=e;return t(lD,{any:function(a){return r(n(a))}})}),sD="zeros",f4=["typed","config","matrix","BigNumber"],d4=se(sD,f4,e=>{var{typed:t,config:n,matrix:r,BigNumber:i}=e;return t(sD,{"":function(){return n.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(s){var c=s[s.length-1];if(typeof c=="string"){var f=s.pop();return a(s,f)}else return n.matrix==="Array"?a(s):a(s,"default")},Array:a,Matrix:function(s){var c=s.storage();return a(s.valueOf(),c)},"Array | Matrix, string":function(s,c){return a(s.valueOf(),c)}});function a(l,s){var c=o(l),f=c?new i(0):0;if(u(l),s){var d=r(s);return l.length>0?d.resize(l,f):d}else{var h=[];return l.length>0?ac(h,l,f):h}}function o(l){var s=!1;return l.forEach(function(c,f,d){vt(c)&&(s=!0,d[f]=c.toNumber())}),s}function u(l){l.forEach(function(s){if(typeof s!="number"||!it(s)||s<0)throw new Error("Parameters in function zeros must be positive integers")})}});function fc(e,t,n){var r;return String(e).includes("Unexpected type")?(r=arguments.length>2?" (type: "+Fn(n)+", value: "+JSON.stringify(n)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+r)):String(e).includes("complex numbers")?(r=arguments.length>2?" (type: "+Fn(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+r)):e}var h4="numeric",m4=["number","?bignumber","?fraction"],p4=se(h4,m4,e=>{var{number:t,bignumber:n,fraction:r}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:o=>t(o),BigNumber:n?o=>n(o):nD,bigint:o=>BigInt(o),Fraction:r?o=>r(o):e4};return function(u){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",s=arguments.length>2?arguments[2]:void 0;if(s!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var c=Fn(u);if(!(c in i))throw new TypeError("Cannot convert "+u+' of type "'+c+'"; valid input types are '+Object.keys(i).join(", "));if(!(l in a))throw new TypeError("Cannot convert "+u+' to type "'+l+'"; valid output types are '+Object.keys(a).join(", "));return l===c?u:a[l](u)}}),cD="divideScalar",g4=["typed","numeric"],v4=se(cD,g4,e=>{var{typed:t,numeric:n}=e;return t(cD,{"number, number":function(i,a){return i/a},"Complex, Complex":function(i,a){return i.div(a)},"BigNumber, BigNumber":function(i,a){return i.div(a)},"bigint, bigint":function(i,a){return i/a},"Fraction, Fraction":function(i,a){return i.div(a)},"Unit, number | Complex | Fraction | BigNumber | Unit":(r,i)=>r.divide(i),"number | Fraction | Complex | BigNumber, Unit":(r,i)=>i.divideInto(r)})}),fD="pow",y4=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],b4=se(fD,y4,e=>{var{typed:t,config:n,identity:r,multiply:i,matrix:a,inv:o,number:u,fraction:l,Complex:s}=e;return t(fD,{"number, number":c,"Complex, Complex":function(v,m){return v.pow(m)},"BigNumber, BigNumber":function(v,m){return m.isInteger()||v>=0||n.predictable?v.pow(m):new s(v.toNumber(),0).pow(m.toNumber(),0)},"bigint, bigint":(h,v)=>h**v,"Fraction, Fraction":function(v,m){var D=v.pow(m);if(D!=null)return D;if(n.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c(v.valueOf(),m.valueOf())},"Array, number":f,"Array, BigNumber":function(v,m){return f(v,m.toNumber())},"Matrix, number":d,"Matrix, BigNumber":function(v,m){return d(v,m.toNumber())},"Unit, number | BigNumber":function(v,m){return v.pow(m)}});function c(h,v){if(n.predictable&&!it(v)&&h<0)try{var m=l(v),D=u(m);if((v===D||Math.abs((v-D)/v)<1e-14)&&m.d%2n===1n)return(m.n%2n===0n?1:-1)*Math.pow(-h,v)}catch{}return n.predictable&&(h<-1&&v===1/0||h>-1&&h<0&&v===-1/0)?NaN:it(v)||h>=0||n.predictable?Mb(h,v):h*h<1&&v===1/0||h*h>1&&v===-1/0?0:new s(h,0).pow(v,0)}function f(h,v){if(!it(v))throw new TypeError("For A^b, b must be an integer (value is "+v+")");var m=st(h);if(m.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+m.length+" dimensions)");if(m[0]!==m[1])throw new Error("For A^b, A must be square (size is "+m[0]+"x"+m[1]+")");if(v<0)try{return f(o(h),-v)}catch(g){throw g.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+v+")"):g}for(var D=r(m[0]).valueOf(),p=h;v>=1;)(v&1)===1&&(D=i(p,D)),v>>=1,p=i(p,p);return D}function d(h,v){return a(f(h.valueOf(),v))}});function dD(e){var{DenseMatrix:t}=e;return function(r,i,a){var o=r.size();if(o.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+lt(o)+")");var u=o[0],l=o[1];if(u!==l)throw new RangeError("Matrix must be square (size: "+lt(o)+")");var s=[];if(Pe(i)){var c=i.size(),f=i._data;if(c.length===1){if(c[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var d=0;d<u;d++)s[d]=[f[d]];return new t({data:s,size:[u,1],datatype:i._datatype})}if(c.length===2){if(c[0]!==u||c[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(_y(i)){if(a){s=[];for(var h=0;h<u;h++)s[h]=[f[h][0]];return new t({data:s,size:[u,1],datatype:i._datatype})}return i}if(By(i)){for(var v=0;v<u;v++)s[v]=[0];for(var m=i._values,D=i._index,p=i._ptr,g=p[1],y=p[0];y<g;y++){var S=D[y];s[S][0]=m[y]}return new t({data:s,size:[u,1],datatype:i._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(ht(i)){var w=st(i);if(w.length===1){if(w[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var b=0;b<u;b++)s[b]=[i[b]];return new t({data:s,size:[u,1]})}if(w.length===2){if(w[0]!==u||w[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var E=0;E<u;E++)s[E]=[i[E][0]];return new t({data:s,size:[u,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var hD="usolve",D4=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],S4=se(hD,D4,e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,l=dD({DenseMatrix:u});return t(hD,{"SparseMatrix, Array | Matrix":function(d,h){return c(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return s(d,h)},"Array, Array | Matrix":function(d,h){var v=n(d),m=s(v,h);return m.valueOf()}});function s(f,d){d=l(f,d,!0);for(var h=d._data,v=f._size[0],m=f._size[1],D=[],p=f._data,g=m-1;g>=0;g--){var y=h[g][0]||0,S=void 0;if(o(y,0))S=0;else{var w=p[g][g];if(o(w,0))throw new Error("Linear system cannot be solved since matrix is singular");S=r(y,w);for(var b=g-1;b>=0;b--)h[b]=[a(h[b][0]||0,i(S,p[b][g]))]}D[g]=[S]}return new u({data:D,size:[v,1]})}function c(f,d){d=l(f,d,!0);for(var h=d._data,v=f._size[0],m=f._size[1],D=f._values,p=f._index,g=f._ptr,y=[],S=m-1;S>=0;S--){var w=h[S][0]||0;if(o(w,0))y[S]=[0];else{for(var b=0,E=[],C=[],A=g[S],T=g[S+1],_=T-1;_>=A;_--){var x=p[_];x===S?b=D[_]:x<S&&(E.push(D[_]),C.push(x))}if(o(b,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var F=r(w,b),R=0,z=C.length;R<z;R++){var N=C[R];h[N]=[a(h[N][0],i(F,E[R]))]}y[S]=[F]}}return new u({data:y,size:[v,1]})}}),mD="usolveAll",x4=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],w4=se(mD,x4,e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,l=dD({DenseMatrix:u});return t(mD,{"SparseMatrix, Array | Matrix":function(d,h){return c(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return s(d,h)},"Array, Array | Matrix":function(d,h){var v=n(d),m=s(v,h);return m.map(D=>D.valueOf())}});function s(f,d){for(var h=[l(f,d,!0)._data.map(C=>C[0])],v=f._data,m=f._size[0],D=f._size[1],p=D-1;p>=0;p--)for(var g=h.length,y=0;y<g;y++){var S=h[y];if(o(v[p][p],0))if(o(S[p],0)){if(y===0){var b=[...S];b[p]=1;for(var E=p-1;E>=0;E--)b[E]=a(b[E],v[E][p]);h.push(b)}}else{if(y===0)return[];h.splice(y,1),y-=1,g-=1}else{S[p]=r(S[p],v[p][p]);for(var w=p-1;w>=0;w--)S[w]=a(S[w],i(S[p],v[w][p]))}}return h.map(C=>new u({data:C.map(A=>[A]),size:[m,1]}))}function c(f,d){for(var h=[l(f,d,!0)._data.map(X=>X[0])],v=f._size[0],m=f._size[1],D=f._values,p=f._index,g=f._ptr,y=m-1;y>=0;y--)for(var S=h.length,w=0;w<S;w++){for(var b=h[w],E=[],C=[],A=g[y],T=g[y+1],_=0,x=T-1;x>=A;x--){var F=p[x];F===y?_=D[x]:F<y&&(E.push(D[x]),C.push(F))}if(o(_,0))if(o(b[y],0)){if(w===0){var U=[...b];U[y]=1;for(var I=0,L=C.length;I<L;I++){var G=C[I];U[G]=a(U[G],E[I])}h.push(U)}}else{if(w===0)return[];h.splice(w,1),w-=1,S-=1}else{b[y]=r(b[y],_);for(var R=0,z=C.length;R<z;R++){var N=C[R];b[N]=a(b[N],i(b[y],E[R]))}}}return h.map(X=>new u({data:X.map(P=>[P]),size:[v,1]}))}}),dc="equal",E4=["typed","matrix","equalScalar","DenseMatrix","concat","SparseMatrix"],A4=se(dc,E4,e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:a,SparseMatrix:o}=e,u=yo({typed:t}),l=Vu({typed:t,SparseMatrix:o}),s=vo({typed:t,DenseMatrix:i}),c=aa({typed:t,matrix:n,concat:a});return t(dc,C4({typed:t,equalScalar:r}),c({elop:r,SS:l,DS:u,Ss:s}))}),C4=se(dc,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(dc,{"any, any":function(i,a){return i===null?a===null:a===null?i===null:i===void 0?a===void 0:a===void 0?i===void 0:n(i,a)}})}),hc="smaller",T4=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],M4=se(hc,T4,e=>{var{typed:t,config:n,bignumber:r,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:u}=e,l=yo({typed:t}),s=Vu({typed:t,SparseMatrix:u}),c=vo({typed:t,DenseMatrix:a}),f=aa({typed:t,matrix:i,concat:o}),d=qu({typed:t});function h(v,m){return v.lt(m)&&!go(v,m,n.relTol,n.absTol)}return t(hc,_4({typed:t,config:n}),{"boolean, boolean":(v,m)=>v<m,"BigNumber, BigNumber":h,"bigint, bigint":(v,m)=>v<m,"Fraction, Fraction":(v,m)=>v.compare(m)===-1,"Fraction, BigNumber":function(m,D){return h(r(m),D)},"BigNumber, Fraction":function(m,D){return h(m,r(D))},"Complex, Complex":function(m,D){throw new TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:s,DS:l,Ss:c}))}),_4=se(hc,["typed","config"],e=>{var{typed:t,config:n}=e;return t(hc,{"number, number":function(i,a){return i<a&&!Vr(i,a,n.relTol,n.absTol)}})}),mc="smallerEq",B4=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],F4=se(mc,B4,e=>{var{typed:t,config:n,matrix:r,DenseMatrix:i,concat:a,SparseMatrix:o}=e,u=yo({typed:t}),l=Vu({typed:t,SparseMatrix:o}),s=vo({typed:t,DenseMatrix:i}),c=aa({typed:t,matrix:r,concat:a}),f=qu({typed:t});return t(mc,N4({typed:t,config:n}),{"boolean, boolean":(d,h)=>d<=h,"BigNumber, BigNumber":function(h,v){return h.lte(v)||go(h,v,n.relTol,n.absTol)},"bigint, bigint":(d,h)=>d<=h,"Fraction, Fraction":(d,h)=>d.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:u,Ss:s}))}),N4=se(mc,["typed","config"],e=>{var{typed:t,config:n}=e;return t(mc,{"number, number":function(i,a){return i<=a||Vr(i,a,n.relTol,n.absTol)}})}),pc="larger",R4=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],O4=se(pc,R4,e=>{var{typed:t,config:n,bignumber:r,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:u}=e,l=yo({typed:t}),s=Vu({typed:t,SparseMatrix:u}),c=vo({typed:t,DenseMatrix:a}),f=aa({typed:t,matrix:i,concat:o}),d=qu({typed:t});function h(v,m){return v.gt(m)&&!go(v,m,n.relTol,n.absTol)}return t(pc,z4({typed:t,config:n}),{"boolean, boolean":(v,m)=>v>m,"BigNumber, BigNumber":h,"bigint, bigint":(v,m)=>v>m,"Fraction, Fraction":(v,m)=>v.compare(m)===1,"Fraction, BigNumber":function(m,D){return h(r(m),D)},"BigNumber, Fraction":function(m,D){return h(m,r(D))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:s,DS:l,Ss:c}))}),z4=se(pc,["typed","config"],e=>{var{typed:t,config:n}=e;return t(pc,{"number, number":function(i,a){return i>a&&!Vr(i,a,n.relTol,n.absTol)}})}),gc="largerEq",U4=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],I4=se(gc,U4,e=>{var{typed:t,config:n,matrix:r,DenseMatrix:i,concat:a,SparseMatrix:o}=e,u=yo({typed:t}),l=Vu({typed:t,SparseMatrix:o}),s=vo({typed:t,DenseMatrix:i}),c=aa({typed:t,matrix:r,concat:a}),f=qu({typed:t});return t(gc,$4({typed:t,config:n}),{"boolean, boolean":(d,h)=>d>=h,"BigNumber, BigNumber":function(h,v){return h.gte(v)||go(h,v,n.relTol,n.absTol)},"bigint, bigint":function(h,v){return h>=v},"Fraction, Fraction":(d,h)=>d.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:u,Ss:s}))}),$4=se(gc,["typed","config"],e=>{var{typed:t,config:n}=e;return t(gc,{"number, number":function(i,a){return i>=a||Vr(i,a,n.relTol,n.absTol)}})}),pD="min",k4=["typed","config","numeric","smaller","isNaN"],L4=se(pD,k4,e=>{var{typed:t,config:n,numeric:r,smaller:i,isNaN:a}=e;return t(pD,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(s,c){return Sb(s,c.valueOf(),o)},"...":function(s){if(bb(s))throw new TypeError("Scalar values expected in function min");return u(s)}});function o(l,s){try{return i(l,s)?l:s}catch(c){throw fc(c,"min",s)}}function u(l){var s;if(Db(l,function(c){try{(a(c)||s===void 0||i(c,s))&&(s=c)}catch(f){throw fc(f,"min",c)}}),s===void 0)throw new Error("Cannot calculate min of an empty array");return typeof s=="string"&&(s=r(s,MC(s,n))),s}}),j4="ImmutableDenseMatrix",H4=["smaller","DenseMatrix"],P4=se(j4,H4,e=>{var{smaller:t,DenseMatrix:n}=e;function r(i,a){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!ar(a))throw new Error("Invalid datatype: "+a);if(Pe(i)||ht(i)){var o=new n(i,a);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(i&&ht(i.data)&&ht(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+Fn(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return r.prototype=new n,r.prototype.type="ImmutableDenseMatrix",r.prototype.isImmutableDenseMatrix=!0,r.prototype.subset=function(i){switch(arguments.length){case 1:{var a=n.prototype.subset.call(this,i);return Pe(a)?new r({data:a._data,size:a._size,datatype:a._datatype}):a}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},r.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},r.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},r.prototype.clone=function(){return new r({data:Ie(this._data),size:Ie(this._size),datatype:this._datatype})},r.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.fromJSON=function(i){return new r(i)},r.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},r.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||t(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},r.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||t(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},r},{isClass:!0}),q4="Index",V4=["ImmutableDenseMatrix","getMatrixDataType"],G4=se(q4,V4,e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:n}=e;function r(a){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var o=0,u=arguments.length;o<u;o++){var l=arguments[o],s=ht(l),c=Pe(l),f=typeof l,d=null;if(Fy(l))this._dimensions.push(l),this._isScalar=!1;else if(s||c){var h=void 0;n(l)==="boolean"?(s&&(h=i(gD(l).valueOf())),c&&(h=i(gD(l._data).valueOf())),d=l.valueOf().length):h=i(l.valueOf()),this._dimensions.push(h);var v=h.size();(v.length!==1||v[0]!==1||d!==null)&&(this._isScalar=!1)}else if(f==="number")this._dimensions.push(i([l]));else if(f==="bigint")this._dimensions.push(i([Number(l)]));else if(f==="string")this._dimensions.push(l);else throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");this._sourceSize.push(d)}}r.prototype.type="Index",r.prototype.isIndex=!0;function i(a){for(var o=0,u=a.length;o<u;o++)if(typeof a[o]!="number"||!it(a[o]))throw new TypeError("Index parameters must be positive integer numbers");return new t(a)}return r.prototype.clone=function(){var a=new r;return a._dimensions=Ie(this._dimensions),a._isScalar=this._isScalar,a._sourceSize=this._sourceSize,a},r.create=function(a){var o=new r;return r.apply(o,a),o},r.prototype.size=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];a[o]=typeof l=="string"?1:l.size()[0]}return a},r.prototype.max=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];a[o]=typeof l=="string"?l:l.max()}return a},r.prototype.min=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];a[o]=typeof l=="string"?l:l.min()}return a},r.prototype.forEach=function(a){for(var o=0,u=this._dimensions.length;o<u;o++)a(this._dimensions[o],o,this)},r.prototype.dimension=function(a){return typeof a!="number"?null:this._dimensions[a]||null},r.prototype.isObjectProperty=function(){return this._dimensions.length===1&&typeof this._dimensions[0]=="string"},r.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},r.prototype.isScalar=function(){return this._isScalar},r.prototype.toArray=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];a.push(typeof l=="string"?l:l.toArray())}return a},r.prototype.valueOf=r.prototype.toArray,r.prototype.toString=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var l=this._dimensions[o];typeof l=="string"?a.push(JSON.stringify(l)):a.push(l.toString())}return"["+a.join(", ")+"]"},r.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},r.fromJSON=function(a){return r.create(a.dimensions)},r},{isClass:!0});function gD(e){var t=[];return e.forEach((n,r)=>{n&&t.push(r)}),t}var Y4="atan",X4=["typed"],Z4=se(Y4,X4,e=>{var{typed:t}=e;return t("atan",{number:function(r){return Math.atan(r)},Complex:function(r){return r.atan()},BigNumber:function(r){return r.atan()}})}),vD=se("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(n=>r=>{if(!r.hasBase(r.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(n,r.valueType())(r.value)})}}),yD="cos",Q4=["typed"],K4=se(yD,Q4,e=>{var{typed:t}=e,n=vD({typed:t});return t(yD,{number:Math.cos,"Complex | BigNumber":r=>r.cos()},n)}),bD="sin",W4=["typed"],J4=se(bD,W4,e=>{var{typed:t}=e,n=vD({typed:t});return t(bD,{number:Math.sin,"Complex | BigNumber":r=>r.sin()},n)}),DD="add",e5=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],t5=se(DD,e5,e=>{var{typed:t,matrix:n,addScalar:r,equalScalar:i,DenseMatrix:a,SparseMatrix:o,concat:u}=e,l=Hb({typed:t}),s=bM({typed:t,equalScalar:i}),c=Pb({typed:t,DenseMatrix:a}),f=aa({typed:t,matrix:n,concat:u});return t(DD,{"any, any":r,"any, any, ...any":t.referToSelf(d=>(h,v,m)=>{for(var D=d(h,v),p=0;p<m.length;p++)D=d(D,m[p]);return D})},f({elop:r,DS:l,SS:s,Ss:c}))}),SD="norm",n5=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],r5=se(SD,n5,e=>{var{typed:t,abs:n,add:r,pow:i,conj:a,sqrt:o,multiply:u,equalScalar:l,larger:s,smaller:c,matrix:f,ctranspose:d,eigs:h}=e;return t(SD,{number:Math.abs,Complex:function(C){return C.abs()},BigNumber:function(C){return C.abs()},boolean:function(C){return Math.abs(C)},Array:function(C){return b(f(C),2)},Matrix:function(C){return b(C,2)},"Array, number | BigNumber | string":function(C,A){return b(f(C),A)},"Matrix, number | BigNumber | string":function(C,A){return b(C,A)}});function v(E){var C=0;return E.forEach(function(A){var T=n(A);s(T,C)&&(C=T)},!0),C}function m(E){var C;return E.forEach(function(A){var T=n(A);(!C||c(T,C))&&(C=T)},!0),C||0}function D(E,C){if(C===Number.POSITIVE_INFINITY||C==="inf")return v(E);if(C===Number.NEGATIVE_INFINITY||C==="-inf")return m(E);if(C==="fro")return b(E,2);if(typeof C=="number"&&!isNaN(C)){if(!l(C,0)){var A=0;return E.forEach(function(T){A=r(i(n(T),C),A)},!0),i(A,1/C)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function p(E){var C=0;return E.forEach(function(A,T){C=r(C,u(A,a(A)))}),n(o(C))}function g(E){var C=[],A=0;return E.forEach(function(T,_){var x=_[1],F=r(C[x]||0,n(T));s(F,A)&&(A=F),C[x]=F},!0),A}function y(E){var C=E.size();if(C[0]!==C[1])throw new RangeError("Invalid matrix dimensions");var A=d(E),T=u(A,E),_=h(T).values.toArray(),x=_[_.length-1];return n(o(x))}function S(E){var C=[],A=0;return E.forEach(function(T,_){var x=_[0],F=r(C[x]||0,n(T));s(F,A)&&(A=F),C[x]=F},!0),A}function w(E,C){if(C===1)return g(E);if(C===Number.POSITIVE_INFINITY||C==="inf")return S(E);if(C==="fro")return p(E);if(C===2)return y(E);throw new Error("Unsupported parameter value "+C)}function b(E,C){var A=E.size();if(A.length===1)return D(E,C);if(A.length===2){if(A[0]&&A[1])return w(E,C);throw new RangeError("Invalid matrix dimensions")}}}),xD="dot",i5=["typed","addScalar","multiplyScalar","conj","size"],a5=se(xD,i5,e=>{var{typed:t,addScalar:n,multiplyScalar:r,conj:i,size:a}=e;return t(xD,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":l});function o(c,f){var d=s(c),h=s(f),v,m;if(d.length===1)v=d[0];else if(d.length===2&&d[1]===1)v=d[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+d.join(", ")+")");if(h.length===1)m=h[0];else if(h.length===2&&h[1]===1)m=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(v!==m)throw new RangeError("Vectors must have equal length ("+v+" != "+m+")");if(v===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return v}function u(c,f){var d=o(c,f),h=Pe(c)?c._data:c,v=Pe(c)?c._datatype||c.getDataType():void 0,m=Pe(f)?f._data:f,D=Pe(f)?f._datatype||f.getDataType():void 0,p=s(c).length===2,g=s(f).length===2,y=n,S=r;if(v&&D&&v===D&&typeof v=="string"&&v!=="mixed"){var w=v;y=t.find(n,[w,w]),S=t.find(r,[w,w])}if(!p&&!g){for(var b=S(i(h[0]),m[0]),E=1;E<d;E++)b=y(b,S(i(h[E]),m[E]));return b}if(!p&&g){for(var C=S(i(h[0]),m[0][0]),A=1;A<d;A++)C=y(C,S(i(h[A]),m[A][0]));return C}if(p&&!g){for(var T=S(i(h[0][0]),m[0]),_=1;_<d;_++)T=y(T,S(i(h[_][0]),m[_]));return T}if(p&&g){for(var x=S(i(h[0][0]),m[0][0]),F=1;F<d;F++)x=y(x,S(i(h[F][0]),m[F][0]));return x}}function l(c,f){o(c,f);for(var d=c._index,h=c._values,v=f._index,m=f._values,D=0,p=n,g=r,y=0,S=0;y<d.length&&S<v.length;){var w=d[y],b=v[S];if(w<b){y++;continue}if(w>b){S++;continue}w===b&&(D=p(D,g(h[y],m[S])),y++,S++)}return D}function s(c){return Pe(c)?c.size():a(c)}}),wD="qr",o5=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],u5=se(wD,o5,e=>{var{typed:t,matrix:n,zeros:r,identity:i,isZero:a,equal:o,sign:u,sqrt:l,conj:s,unaryMinus:c,addScalar:f,divideScalar:d,multiplyScalar:h,subtractScalar:v,complex:m}=e;return Ci(t(wD,{DenseMatrix:function(S){return p(S)},SparseMatrix:function(S){return g()},Array:function(S){var w=n(S),b=p(w);return{Q:b.Q.valueOf(),R:b.R.valueOf()}}}),{_denseQRimpl:D});function D(y){var S=y._size[0],w=y._size[1],b=i([S],"dense"),E=b._data,C=y.clone(),A=C._data,T,_,x,F=r([S],"");for(x=0;x<Math.min(w,S);++x){var R=A[x][x],z=c(o(R,0)?1:u(R)),N=s(z),U=0;for(T=x;T<S;T++)U=f(U,h(A[T][x],s(A[T][x])));var I=h(z,l(U));if(!a(I)){var L=v(R,I);for(F[x]=1,T=x+1;T<S;T++)F[T]=d(A[T][x],L);var G=c(s(d(L,I))),X=void 0;for(_=x;_<w;_++){for(X=0,T=x;T<S;T++)X=f(X,h(s(F[T]),A[T][_]));for(X=h(X,G),T=x;T<S;T++)A[T][_]=h(v(A[T][_],h(F[T],X)),N)}for(T=0;T<S;T++){for(X=0,_=x;_<S;_++)X=f(X,h(E[T][_],F[_]));for(X=h(X,G),_=x;_<S;++_)E[T][_]=d(v(E[T][_],h(X,s(F[_]))),N)}}}return{Q:b,R:C,toString:function(){return"Q: "+this.Q.toString()+`
|
|
67
|
+
R: `+this.R.toString()}}}function p(y){var S=D(y),w=S.R._data;if(y._data.length>0)for(var b=w[0][0].type==="Complex"?m(0):0,E=0;E<w.length;++E)for(var C=0;C<E&&C<(w[0]||[]).length;++C)w[E][C]=b;return S}function g(y){throw new Error("qr not implemented for sparse matrices yet")}}),ED="det",l5=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],s5=se(ED,l5,e=>{var{typed:t,matrix:n,subtractScalar:r,multiply:i,divideScalar:a,isZero:o,unaryMinus:u}=e;return t(ED,{any:function(c){return Ie(c)},"Array | Matrix":function(c){var f;switch(Pe(c)?f=c.size():Array.isArray(c)?(c=n(c),f=c.size()):f=[],f.length){case 0:return Ie(c);case 1:if(f[0]===1)return Ie(c.valueOf()[0]);if(f[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lt(f)+")");case 2:{var d=f[0],h=f[1];if(d===h)return l(c.clone().valueOf(),d);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+lt(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lt(f)+")")}}});function l(s,c,f){if(c===1)return Ie(s[0][0]);if(c===2)return r(i(s[0][0],s[1][1]),i(s[1][0],s[0][1]));for(var d=!1,h=new Array(c).fill(0).map((E,C)=>C),v=0;v<c;v++){var m=h[v];if(o(s[m][v])){var D=void 0;for(D=v+1;D<c;D++)if(!o(s[h[D]][v])){m=h[D],h[D]=h[v],h[v]=m,d=!d;break}if(D===c)return s[m][v]}for(var p=s[m][v],g=v===0?1:s[h[v-1]][v-1],y=v+1;y<c;y++)for(var S=h[y],w=v+1;w<c;w++)s[S][w]=a(r(i(s[S][w],p),i(s[S][v],s[m][w])),g)}var b=s[h[c-1]][c-1];return d?u(b):b}}),AD="inv",c5=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],f5=se(AD,c5,e=>{var{typed:t,matrix:n,divideScalar:r,addScalar:i,multiply:a,unaryMinus:o,det:u,identity:l,abs:s}=e;return t(AD,{"Array | Matrix":function(d){var h=Pe(d)?d.size():st(d);switch(h.length){case 1:if(h[0]===1)return Pe(d)?n([r(1,d.valueOf()[0])]):[r(1,d[0])];throw new RangeError("Matrix must be square (size: "+lt(h)+")");case 2:{var v=h[0],m=h[1];if(v===m)return Pe(d)?n(c(d.valueOf(),v,m),d.storage()):c(d,v,m);throw new RangeError("Matrix must be square (size: "+lt(h)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lt(h)+")")}},any:function(d){return r(1,d)}});function c(f,d,h){var v,m,D,p,g;if(d===1){if(p=f[0][0],p===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,p)]]}else if(d===2){var y=u(f);if(y===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(f[1][1],y),r(o(f[0][1]),y)],[r(o(f[1][0]),y),r(f[0][0],y)]]}else{var S=f.concat();for(v=0;v<d;v++)S[v]=S[v].concat();for(var w=l(d).valueOf(),b=0;b<h;b++){var E=s(S[b][b]),C=b;for(v=b+1;v<d;)s(S[v][b])>E&&(E=s(S[v][b]),C=v),v++;if(E===0)throw Error("Cannot calculate inverse, determinant is zero");v=C,v!==b&&(g=S[b],S[b]=S[v],S[v]=g,g=w[b],w[b]=w[v],w[v]=g);var A=S[b],T=w[b];for(v=0;v<d;v++){var _=S[v],x=w[v];if(v!==b){if(_[b]!==0){for(D=r(o(_[b]),A[b]),m=b;m<h;m++)_[m]=i(_[m],a(D,A[m]));for(m=0;m<h;m++)x[m]=i(x[m],a(D,T[m]))}}else{for(D=A[b],m=b;m<h;m++)_[m]=r(_[m],D);for(m=0;m<h;m++)x[m]=r(x[m],D)}}}return w}}});function d5(e){var{addScalar:t,subtract:n,flatten:r,multiply:i,multiplyScalar:a,divideScalar:o,sqrt:u,abs:l,bignumber:s,diag:c,size:f,reshape:d,inv:h,qr:v,usolve:m,usolveAll:D,equal:p,complex:g,larger:y,smaller:S,matrixFromColumns:w,dot:b}=e;function E(P,j,H,k){var q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,Y=C(P,j,H,k,q);A(P,j,H,k,q,Y);var{values:ee,C:te}=T(P,j,H,k,q);if(q){var ne=_(P,j,te,Y,ee,H,k);return{values:ee,eigenvectors:ne}}return{values:ee}}function C(P,j,H,k,q){var Y=k==="BigNumber",ee=k==="Complex",te=Y?s(0):0,ne=Y?s(1):ee?g(1):1,oe=Y?s(1):1,W=Y?s(10):2,ce=a(W,W),de;q&&(de=Array(j).fill(ne));for(var ve=!1;!ve;){ve=!0;for(var De=0;De<j;De++){for(var Se=te,Ee=te,Re=0;Re<j;Re++)De!==Re&&(Se=t(Se,l(P[Re][De])),Ee=t(Ee,l(P[De][Re])));if(!p(Se,0)&&!p(Ee,0)){for(var Ce=oe,Ne=Se,pe=o(Ee,W),O=a(Ee,W);S(Ne,pe);)Ne=a(Ne,ce),Ce=a(Ce,W);for(;y(Ne,O);)Ne=o(Ne,ce),Ce=o(Ce,W);var $=S(o(t(Ne,Ee),Ce),a(t(Se,Ee),.95));if($){ve=!1;for(var V=o(1,Ce),Z=0;Z<j;Z++)De!==Z&&(P[De][Z]=a(P[De][Z],V),P[Z][De]=a(P[Z][De],Ce));q&&(de[De]=a(de[De],V))}}}}return q?c(de):null}function A(P,j,H,k,q,Y){var ee=k==="BigNumber",te=k==="Complex",ne=ee?s(0):te?g(0):0;ee&&(H=s(H));for(var oe=0;oe<j-2;oe++){for(var W=0,ce=ne,de=oe+1;de<j;de++){var ve=P[de][oe];S(l(ce),l(ve))&&(ce=ve,W=de)}if(!S(l(ce),H)){if(W!==oe+1){var De=P[W];P[W]=P[oe+1],P[oe+1]=De;for(var Se=0;Se<j;Se++){var Ee=P[Se][W];P[Se][W]=P[Se][oe+1],P[Se][oe+1]=Ee}if(q){var Re=Y[W];Y[W]=Y[oe+1],Y[oe+1]=Re}}for(var Ce=oe+2;Ce<j;Ce++){var Ne=o(P[Ce][oe],ce);if(Ne!==0){for(var pe=0;pe<j;pe++)P[Ce][pe]=n(P[Ce][pe],a(Ne,P[oe+1][pe]));for(var O=0;O<j;O++)P[O][oe+1]=t(P[O][oe+1],a(Ne,P[O][Ce]));if(q)for(var $=0;$<j;$++)Y[Ce][$]=n(Y[Ce][$],a(Ne,Y[oe+1][$]))}}}}return Y}function T(P,j,H,k,q){var Y=k==="BigNumber",ee=k==="Complex",te=Y?s(1):ee?g(1):1;Y&&(H=s(H));for(var ne=Ie(P),oe=[],W=j,ce=[],de=q?c(Array(j).fill(te)):void 0,ve=q?c(Array(W).fill(te)):void 0,De=0;De<=100;){De+=1;for(var Se=ne[W-1][W-1],Ee=0;Ee<W;Ee++)ne[Ee][Ee]=n(ne[Ee][Ee],Se);var{Q:Re,R:Ce}=v(ne);ne=i(Ce,Re);for(var Ne=0;Ne<W;Ne++)ne[Ne][Ne]=t(ne[Ne][Ne],Se);if(q&&(ve=i(ve,Re)),W===1||S(l(ne[W-1][W-2]),H)){De=0,oe.push(ne[W-1][W-1]),q&&(ce.unshift([[1]]),R(ve,j),de=i(de,ve),W>1&&(ve=c(Array(W-1).fill(te)))),W-=1,ne.pop();for(var pe=0;pe<W;pe++)ne[pe].pop()}else if(W===2||S(l(ne[W-2][W-3]),H)){De=0;var O=x(ne[W-2][W-2],ne[W-2][W-1],ne[W-1][W-2],ne[W-1][W-1]);oe.push(...O),q&&(ce.unshift(F(ne[W-2][W-2],ne[W-2][W-1],ne[W-1][W-2],ne[W-1][W-1],O[0],O[1],H,k)),R(ve,j),de=i(de,ve),W>2&&(ve=c(Array(W-2).fill(te)))),W-=2,ne.pop(),ne.pop();for(var $=0;$<W;$++)ne[$].pop(),ne[$].pop()}if(W===0)break}if(oe.sort((ae,J)=>+n(l(ae),l(J))),De>100){var V=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+oe.join(", "));throw V.values=oe,V.vectors=[],V}var Z=q?i(de,z(ce,j)):void 0;return{values:oe,C:Z}}function _(P,j,H,k,q,Y,ee){var te=h(H),ne=i(te,P,H),oe=ee==="BigNumber",W=ee==="Complex",ce=oe?s(0):W?g(0):0,de=oe?s(1):W?g(1):1,ve=[],De=[];for(var Se of q){var Ee=N(ve,Se,p);Ee===-1?(ve.push(Se),De.push(1)):De[Ee]+=1}for(var Re=[],Ce=ve.length,Ne=Array(j).fill(ce),pe=c(Array(j).fill(de)),O=function(){var Z=ve[$],ae=n(ne,i(Z,pe)),J=D(ae,Ne);for(J.shift();J.length<De[$];){var me=U(ae,j,J,Y,ee);if(me===null)break;J.push(me)}var le=i(h(k),H);J=J.map(he=>i(le,he)),Re.push(...J.map(he=>({value:Z,vector:r(he)})))},$=0;$<Ce;$++)O();return Re}function x(P,j,H,k){var q=t(P,k),Y=n(a(P,k),a(j,H)),ee=a(q,.5),te=a(u(n(a(q,q),a(4,Y))),.5);return[t(ee,te),n(ee,te)]}function F(P,j,H,k,q,Y,ee,te){var ne=te==="BigNumber",oe=te==="Complex",W=ne?s(0):oe?g(0):0,ce=ne?s(1):oe?g(1):1;if(S(l(H),ee))return[[ce,W],[W,ce]];if(y(l(n(q,Y)),ee))return[[n(q,k),n(Y,k)],[H,H]];var de=n(P,q),ve=n(k,q);return S(l(j),ee)&&S(l(ve),ee)?[[de,ce],[H,W]]:[[j,W],[ve,ce]]}function R(P,j){for(var H=0;H<P.length;H++)P[H].push(...Array(j-P[H].length).fill(0));for(var k=P.length;k<j;k++)P.push(Array(j).fill(0)),P[k][k]=1;return P}function z(P,j){for(var H=[],k=0;k<j;k++)H[k]=Array(j).fill(0);var q=0;for(var Y of P){for(var ee=Y.length,te=0;te<ee;te++)for(var ne=0;ne<ee;ne++)H[q+te][q+ne]=Y[te][ne];q+=ee}return H}function N(P,j,H){for(var k=0;k<P.length;k++)if(H(P[k],j))return k;return-1}function U(P,j,H,k,q){for(var Y=q==="BigNumber"?s(1e3):1e3,ee,te=0;te<5;++te){ee=I(j,H,q);try{ee=m(P,ee)}catch{continue}if(y(G(ee),Y))break}if(te>=5)return null;for(te=0;;){var ne=m(P,ee);if(S(G(L(ee,[ne])),k))break;if(++te>=10)return null;ee=X(ne)}return ee}function I(P,j,H){var k=H==="BigNumber",q=H==="Complex",Y=Array(P).fill(0).map(ee=>2*Math.random()-1);return k&&(Y=Y.map(ee=>s(ee))),q&&(Y=Y.map(ee=>g(ee))),Y=L(Y,j),X(Y,H)}function L(P,j){var H=f(P);for(var k of j)k=d(k,H),P=n(P,i(o(b(k,P),b(k,k)),k));return P}function G(P){return l(u(b(P,P)))}function X(P,j){var H=j==="BigNumber",k=j==="Complex",q=H?s(1):k?g(1):1;return i(o(q,G(P)),P)}return E}function h5(e){var{config:t,addScalar:n,subtract:r,abs:i,atan:a,cos:o,sin:u,multiplyScalar:l,inv:s,bignumber:c,multiply:f,add:d}=e;function h(A,T){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.relTol,x=arguments.length>3?arguments[3]:void 0,F=arguments.length>4?arguments[4]:void 0;if(x==="number")return v(A,_,F);if(x==="BigNumber")return m(A,_,F);throw TypeError("Unsupported data type: "+x)}function v(A,T,_){var x=A.length,F=Math.abs(T/x),R,z;if(_){z=new Array(x);for(var N=0;N<x;N++)z[N]=Array(x).fill(0),z[N][N]=1}for(var U=b(A);Math.abs(U[1])>=Math.abs(F);){var I=U[0][0],L=U[0][1];R=D(A[I][I],A[L][L],A[I][L]),A=w(A,R,I,L),_&&(z=g(z,R,I,L)),U=b(A)}for(var G=Array(x).fill(0),X=0;X<x;X++)G[X]=A[X][X];return C(Ie(G),z,_)}function m(A,T,_){var x=A.length,F=i(T/x),R,z;if(_){z=new Array(x);for(var N=0;N<x;N++)z[N]=Array(x).fill(0),z[N][N]=1}for(var U=E(A);i(U[1])>=i(F);){var I=U[0][0],L=U[0][1];R=p(A[I][I],A[L][L],A[I][L]),A=S(A,R,I,L),_&&(z=y(z,R,I,L)),U=E(A)}for(var G=Array(x).fill(0),X=0;X<x;X++)G[X]=A[X][X];return C(Ie(G),z,_)}function D(A,T,_){var x=T-A;return Math.abs(x)<=t.relTol?Math.PI/4:.5*Math.atan(2*_/(T-A))}function p(A,T,_){var x=r(T,A);return i(x)<=t.relTol?c(-1).acos().div(4):l(.5,a(f(2,_,s(x))))}function g(A,T,_,x){for(var F=A.length,R=Math.cos(T),z=Math.sin(T),N=Array(F).fill(0),U=Array(F).fill(0),I=0;I<F;I++)N[I]=R*A[I][_]-z*A[I][x],U[I]=z*A[I][_]+R*A[I][x];for(var L=0;L<F;L++)A[L][_]=N[L],A[L][x]=U[L];return A}function y(A,T,_,x){for(var F=A.length,R=o(T),z=u(T),N=Array(F).fill(c(0)),U=Array(F).fill(c(0)),I=0;I<F;I++)N[I]=r(l(R,A[I][_]),l(z,A[I][x])),U[I]=n(l(z,A[I][_]),l(R,A[I][x]));for(var L=0;L<F;L++)A[L][_]=N[L],A[L][x]=U[L];return A}function S(A,T,_,x){for(var F=A.length,R=c(o(T)),z=c(u(T)),N=l(R,R),U=l(z,z),I=Array(F).fill(c(0)),L=Array(F).fill(c(0)),G=f(c(2),R,z,A[_][x]),X=n(r(l(N,A[_][_]),G),l(U,A[x][x])),P=d(l(U,A[_][_]),G,l(N,A[x][x])),j=0;j<F;j++)I[j]=r(l(R,A[_][j]),l(z,A[x][j])),L[j]=n(l(z,A[_][j]),l(R,A[x][j]));A[_][_]=X,A[x][x]=P,A[_][x]=c(0),A[x][_]=c(0);for(var H=0;H<F;H++)H!==_&&H!==x&&(A[_][H]=I[H],A[H][_]=I[H],A[x][H]=L[H],A[H][x]=L[H]);return A}function w(A,T,_,x){for(var F=A.length,R=Math.cos(T),z=Math.sin(T),N=R*R,U=z*z,I=Array(F).fill(0),L=Array(F).fill(0),G=N*A[_][_]-2*R*z*A[_][x]+U*A[x][x],X=U*A[_][_]+2*R*z*A[_][x]+N*A[x][x],P=0;P<F;P++)I[P]=R*A[_][P]-z*A[x][P],L[P]=z*A[_][P]+R*A[x][P];A[_][_]=G,A[x][x]=X,A[_][x]=0,A[x][_]=0;for(var j=0;j<F;j++)j!==_&&j!==x&&(A[_][j]=I[j],A[j][_]=I[j],A[x][j]=L[j],A[j][x]=L[j]);return A}function b(A){for(var T=A.length,_=0,x=[0,1],F=0;F<T;F++)for(var R=F+1;R<T;R++)Math.abs(_)<Math.abs(A[F][R])&&(_=Math.abs(A[F][R]),x=[F,R]);return[x,_]}function E(A){for(var T=A.length,_=0,x=[0,1],F=0;F<T;F++)for(var R=F+1;R<T;R++)i(_)<i(A[F][R])&&(_=i(A[F][R]),x=[F,R]);return[x,_]}function C(A,T,_){var x=A.length,F=Array(x),R;if(_){R=Array(x);for(var z=0;z<x;z++)R[z]=Array(x)}for(var N=0;N<x;N++){for(var U=0,I=A[0],L=0;L<A.length;L++)i(A[L])<i(I)&&(U=L,I=A[U]);if(F[N]=A.splice(U,1)[0],_)for(var G=0;G<x;G++)R[N][G]=T[G][U],T[G].splice(U,1)}if(!_)return{values:F};var X=R.map((P,j)=>({value:F[j],vector:P}));return{values:F,eigenvectors:X}}return h}var m5="eigs",p5=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],g5=se(m5,p5,e=>{var{config:t,typed:n,matrix:r,addScalar:i,subtract:a,equal:o,abs:u,atan:l,cos:s,sin:c,multiplyScalar:f,divideScalar:d,inv:h,bignumber:v,multiply:m,add:D,larger:p,column:g,flatten:y,number:S,complex:w,sqrt:b,diag:E,size:C,reshape:A,qr:T,usolve:_,usolveAll:x,im:F,re:R,smaller:z,matrixFromColumns:N,dot:U}=e,I=h5({config:t,addScalar:i,subtract:a,abs:u,atan:l,cos:s,sin:c,multiplyScalar:f,inv:h,bignumber:v,multiply:m,add:D}),L=d5({addScalar:i,subtract:a,multiply:m,multiplyScalar:f,flatten:y,divideScalar:d,sqrt:b,abs:u,bignumber:v,diag:E,size:C,reshape:A,qr:T,inv:h,usolve:_,usolveAll:x,equal:o,complex:w,larger:p,smaller:z,matrixFromColumns:N,dot:U});return n("eigs",{Array:function(Y){return G(r(Y))},"Array, number|BigNumber":function(Y,ee){return G(r(Y),{precision:ee})},"Array, Object"(q,Y){return G(r(q),Y)},Matrix:function(Y){return G(Y,{matricize:!0})},"Matrix, number|BigNumber":function(Y,ee){return G(Y,{precision:ee,matricize:!0})},"Matrix, Object":function(Y,ee){var te={matricize:!0};return Ci(te,ee),G(Y,te)}});function G(q){var Y,ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te="eigenvectors"in ee?ee.eigenvectors:!0,ne=(Y=ee.precision)!==null&&Y!==void 0?Y:t.relTol,oe=X(q,ne,te);return ee.matricize&&(oe.values=r(oe.values),te&&(oe.eigenvectors=oe.eigenvectors.map(W=>{var{value:ce,vector:de}=W;return{value:ce,vector:r(de)}}))),te&&Object.defineProperty(oe,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),oe}function X(q,Y,ee){var te=q.toArray(),ne=q.size();if(ne.length!==2||ne[0]!==ne[1])throw new RangeError("Matrix must be square (size: ".concat(lt(ne),")"));var oe=ne[0];if(j(te,oe,Y)&&(H(te,oe),P(te,oe,Y))){var W=k(q,te,oe);return I(te,oe,Y,W,ee)}var ce=k(q,te,oe);return L(te,oe,Y,ce,ee)}function P(q,Y,ee){for(var te=0;te<Y;te++)for(var ne=te;ne<Y;ne++)if(p(v(u(a(q[te][ne],q[ne][te]))),ee))return!1;return!0}function j(q,Y,ee){for(var te=0;te<Y;te++)for(var ne=0;ne<Y;ne++)if(p(v(u(F(q[te][ne]))),ee))return!1;return!0}function H(q,Y){for(var ee=0;ee<Y;ee++)for(var te=0;te<Y;te++)q[ee][te]=R(q[ee][te])}function k(q,Y,ee){var te=q.datatype();if(te==="number"||te==="BigNumber"||te==="Complex")return te;for(var ne=!1,oe=!1,W=!1,ce=0;ce<ee;ce++)for(var de=0;de<ee;de++){var ve=Y[ce][de];if(et(ve)||gh(ve))ne=!0;else if(vt(ve))oe=!0;else if(ph(ve))W=!0;else throw TypeError("Unsupported type in Matrix: "+Fn(ve))}if(oe&&W&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),W){for(var De=0;De<ee;De++)for(var Se=0;Se<ee;Se++)Y[De][Se]=w(Y[De][Se]);return"Complex"}if(oe){for(var Ee=0;Ee<ee;Ee++)for(var Re=0;Re<ee;Re++)Y[Ee][Re]=v(Y[Ee][Re]);return"BigNumber"}if(ne){for(var Ce=0;Ce<ee;Ce++)for(var Ne=0;Ne<ee;Ne++)Y[Ce][Ne]=S(Y[Ce][Ne]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}}),v5="divide",y5=["typed","matrix","multiply","equalScalar","divideScalar","inv"],b5=se(v5,y5,e=>{var{typed:t,matrix:n,multiply:r,equalScalar:i,divideScalar:a,inv:o}=e,u=jb({typed:t,equalScalar:i}),l=Ih({typed:t});return t("divide",Ny({"Array | Matrix, Array | Matrix":function(c,f){return r(c,o(f))},"DenseMatrix, any":function(c,f){return l(c,f,a,!1)},"SparseMatrix, any":function(c,f){return u(c,f,a,!1)},"Array, any":function(c,f){return l(n(c),f,a,!1).valueOf()},"any, Array | Matrix":function(c,f){return r(c,o(f))}},a.signatures))}),CD="mean",D5=["typed","add","divide"],S5=se(CD,D5,e=>{var{typed:t,add:n,divide:r}=e;return t(CD,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(u){if(bb(u))throw new TypeError("Scalar values expected in function mean");return a(u)}});function i(o,u){try{var l=Sb(o,u,n),s=Array.isArray(o)?st(o):o.size();return r(l,s[u])}catch(c){throw fc(c,"mean")}}function a(o){var u,l=0;if(Db(o,function(s){try{u=u===void 0?s:n(u,s),l++}catch(c){throw fc(c,"mean",s)}}),l===0)throw new Error("Cannot calculate the mean of an empty array");return r(u,l)}}),Gu=N3({config:Wt}),vc=I3({}),$h=V3({}),kh=X3({}),gn=cT({Matrix:kh}),ye=zC({BigNumber:Gu,Complex:vc,DenseMatrix:gn,Fraction:$h}),Yu=YT({typed:ye}),bo=ZT({typed:ye}),x5=Z4({typed:ye}),Lh=UT({Complex:vc,typed:ye}),yc=IM({typed:ye}),w5=K4({typed:ye}),Sr=xT({config:Wt,typed:ye}),TD=ZM({typed:ye}),E5=KM({typed:ye}),A5=kM({typed:ye}),MD=hT({typed:ye}),C5=pT({config:Wt,typed:ye}),_D=vT({equalScalar:Sr,typed:ye}),Do=EM({typed:ye}),jh=BT({typed:ye}),T5=jM({typed:ye}),M5=MM({BigNumber:Gu,Fraction:$h,complex:Lh,typed:ye}),_5=J4({typed:ye}),Xr=AT({Matrix:kh,equalScalar:Sr,typed:ye}),Xu=KT({typed:ye}),Zu=RT({BigNumber:Gu,typed:ye}),B5=bT({typed:ye}),ze=jT({DenseMatrix:gn,Matrix:kh,SparseMatrix:Xr,typed:ye}),F5=i4({isInteger:MD,matrix:ze,typed:ye}),Hh=FM({Complex:vc,config:Wt,typed:ye}),N5=l4({matrix:ze,typed:ye}),R5=d4({BigNumber:Gu,config:Wt,matrix:ze,typed:ye}),oa=PM({isInteger:MD,matrix:ze,typed:ye}),O5=c4({conj:yc,transpose:N5,typed:ye}),z5=YM({DenseMatrix:gn,SparseMatrix:Xr,matrix:ze,typed:ye}),BD=A4({DenseMatrix:gn,SparseMatrix:Xr,concat:oa,equalScalar:Sr,matrix:ze,typed:ye}),FD=kT({Fraction:$h,typed:ye}),Ph=JM({BigNumber:Gu,DenseMatrix:gn,SparseMatrix:Xr,config:Wt,matrix:ze,typed:ye}),U5=I4({DenseMatrix:gn,SparseMatrix:Xr,concat:oa,config:Wt,matrix:ze,typed:ye}),ND=p4({bignumber:Zu,fraction:FD,number:jh}),qh=o4({matrix:ze,config:Wt,typed:ye}),Qu=M4({DenseMatrix:gn,SparseMatrix:Xr,bignumber:Zu,concat:oa,config:Wt,matrix:ze,typed:ye}),bc=VT({typed:ye}),Dc=t5({DenseMatrix:gn,SparseMatrix:Xr,addScalar:bo,concat:oa,equalScalar:Sr,matrix:ze,typed:ye}),ua=v4({numeric:ND,typed:ye}),I5=P4({DenseMatrix:gn,smaller:Qu}),$5=G4({ImmutableDenseMatrix:I5,getMatrixDataType:E5}),Vh=O4({DenseMatrix:gn,SparseMatrix:Xr,bignumber:Zu,concat:oa,config:Wt,matrix:ze,typed:ye}),k5=PT({flatten:TD,matrix:ze,size:qh,typed:ye}),L5=L4({config:Wt,isNaN:B5,numeric:ND,smaller:Qu,typed:ye}),j5=u5({addScalar:bo,complex:Lh,conj:yc,divideScalar:ua,equal:BD,identity:Ph,isZero:_D,matrix:ze,multiplyScalar:Do,sign:M5,sqrt:Hh,subtractScalar:Xu,typed:ye,unaryMinus:bc,zeros:R5}),H5=F4({DenseMatrix:gn,SparseMatrix:Xr,concat:oa,config:Wt,matrix:ze,typed:ye}),P5=RM({DenseMatrix:gn,concat:oa,equalScalar:Sr,matrix:ze,subtractScalar:Xu,typed:ye,unaryMinus:bc}),q5=S4({DenseMatrix:gn,divideScalar:ua,equalScalar:Sr,matrix:ze,multiplyScalar:Do,subtractScalar:Xu,typed:ye}),RD=a5({addScalar:bo,conj:yc,multiplyScalar:Do,size:qh,typed:ye}),Oi=CM({addScalar:bo,dot:RD,equalScalar:Sr,matrix:ze,multiplyScalar:Do,typed:ye}),V5=n4({bignumber:Zu,matrix:ze,add:Dc,config:Wt,isPositive:C5,larger:Vh,largerEq:U5,smaller:Qu,smallerEq:H5,typed:ye}),G5=w4({DenseMatrix:gn,divideScalar:ua,equalScalar:Sr,matrix:ze,multiplyScalar:Do,subtractScalar:Xu,typed:ye}),Y5=VM({Index:$5,matrix:ze,range:V5,typed:ye}),X5=s5({divideScalar:ua,isZero:_D,matrix:ze,multiply:Oi,subtractScalar:Xu,typed:ye,unaryMinus:bc}),Gh=f5({abs:Yu,addScalar:bo,det:X5,divideScalar:ua,identity:Ph,matrix:ze,multiply:Oi,typed:ye,unaryMinus:bc}),Z5=b4({Complex:vc,config:Wt,fraction:FD,identity:Ph,inv:Gh,matrix:ze,multiply:Oi,number:jh,typed:ye}),Q5=b5({divideScalar:ua,equalScalar:Sr,inv:Gh,matrix:ze,multiply:Oi,typed:ye}),K5=g5({abs:Yu,add:Dc,addScalar:bo,atan:x5,bignumber:Zu,column:Y5,complex:Lh,config:Wt,cos:w5,diag:z5,divideScalar:ua,dot:RD,equal:BD,flatten:TD,im:A5,inv:Gh,larger:Vh,matrix:ze,matrixFromColumns:k5,multiply:Oi,multiplyScalar:Do,number:jh,qr:j5,re:T5,reshape:F5,sin:_5,size:qh,smaller:Qu,sqrt:Hh,subtract:P5,typed:ye,usolve:q5,usolveAll:G5}),W5=S5({add:Dc,divide:Q5,typed:ye}),OD=r5({abs:Yu,add:Dc,conj:yc,ctranspose:O5,eigs:K5,equalScalar:Sr,larger:Vh,matrix:ze,multiply:Oi,pow:Z5,smaller:Qu,sqrt:Hh,typed:ye});ze([[0,0,0],[0,0,0]]);const Sc=e=>Yu(e.xmax-e.xmin),zD=e=>Yu(e.ymax-e.ymin),UD=(e,t)=>[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.abs(e[0]-t[0]),Math.abs(e[1]-t[1])],ID=e=>({xmin:e[0],ymin:e[1],xmax:e[0]+e[2],ymax:e[1]+e[3]}),Yh=(e,t)=>!(e.xmax<t.xmin||e.xmin>t.xmax||e.ymax<t.ymin||e.ymin>t.ymax),J5=(e,t)=>t.xmin<e[0]&&e[0]<t.xmax&&Math.min(t.ymin,t.ymax)<e[1]&&e[1]<Math.max(t.ymax,t.ymin),Xh=(e,t)=>{t.length===2&&(t=[t[0],t[1],1]);const n=ze(e),r=ze(t);return Oi(n,r).toArray()},e_=(e,t)=>e.map((n,r)=>[n,t[r]]),Zh=(e,t)=>{const n=ze(e),r=ze([t.map(o=>o[0]),t.map(o=>o[1]),t.map(()=>1)]),[i,a]=Oi(n,r).toArray();return e_(i,a)},t_="rgba(196, 196, 196, 0.5)",$D="COMPUTE_DRAG",kD="END_DRAG",LD="RESET_DRAG",n_="PARTIAL",jD=e=>{const t=e.currentTarget.getBoundingClientRect(),n=[e.clientX-t.x,e.clientY-t.y],r=e.buttons===1,i=e.shiftKey;return{type:n_,mouseButtonIsDown:r,point:n,shift:i}},r_=(e,t)=>{const{dragAnchor:n,dragRect:r}=e,{type:i,mouseButtonIsDown:a,point:o,shift:u}=t,l=4;switch(i){case LD:return{isActive:!1};case kD:return{isActive:!1,dragRect:n&&o?UD(n,o):void 0,shift:u};case $D:if(!a)return{isActive:!1};if(!o)throw Error("ASSERTION FAILED: COMPUTE_DRAG but the mousemove event had no location.");return n?r||Math.abs(o[0]-n[0])>l||Math.abs(o[1]-n[1])>l?{...e,isActive:!0,dragRect:UD(n,o)}:e:{isActive:!1,dragAnchor:o};default:throw Error(`Invalid mode for drag reducer: ${i}`)}},i_=(e,t,n)=>{if(!t||!e||typeof e=="function")return;const r=e.current,i=r&&r.getContext("2d");if(i&&(i.clearRect(0,0,i.canvas.width,i.canvas.height),t.isActive)){const a=t.dragRect||[0,0,0,0];i.fillStyle=n??t_,i.fillRect(a[0],a[1],a[2],a[3])}},HD=e=>{const{nextDragStateUpdate:t,nextFrame:n,reducer:r,reducerOtherProps:i}=e;if(t.current===null)window.cancelAnimationFrame(n.current),n.current=0;else{r({...i,dragAction:t.current});const a=()=>HD(e);n.current=requestAnimationFrame(a)}t.current=null},a_=(e,t)=>{const{nextDragStateUpdate:n,nextFrame:r}=t,i={...jD(e),type:$D};return i.mouseButtonIsDown?(n.current=i,r.current===0&&HD(t),!0):!1},o_=(e,t)=>{const{nextDragStateUpdate:n,reducer:r,reducerOtherProps:i}=t;n.current=null,r({...i,dragAction:{type:LD}})},u_=(e,t)=>{const{nextDragStateUpdate:n,reducer:r,reducerOtherProps:i}=t;n.current=null,r({...i,dragAction:{...jD(e),type:kD}})},l_=e=>{const{width:t,height:n,newState:r,dragStyle:i}=e,a=M.useRef(null),o=M.useMemo(()=>B.jsx("canvas",{ref:a,width:t,height:n,style:{position:"absolute",left:0,top:0}}),[t,n]);return i_(a,r,i),o},s_=e=>{const t=e([0,0]),n=e([1,0]),r=e([0,1]);return[[n[0]-t[0],r[0]-t[0],t[0]],[n[1]-t[1],r[1]-t[1],t[1]],[0,0,1]]},c_=(e,t)=>{e.clearRect(0,0,t.width,t.height);for(const n of t.pixelVerticalLines||[])e.strokeStyle=n.color,e.beginPath(),e.moveTo(n.x,t.margins.top-20),e.lineTo(n.x,t.height-t.margins.bottom),e.stroke();t.barBoxes.forEach(n=>{e.fillStyle=n.color,e.fillRect(n.x1,n.y1,n.x2-n.x1,n.y2-n.y1)}),t.xLabel&&(e.textBaseline="bottom",e.textAlign="center",e.fillStyle="black",e.fillText(t.xLabel,t.width/2,t.height-3));for(const n of t.pixelTicks||[])e.strokeStyle="black",e.beginPath(),e.moveTo(n.x,t.height-t.margins.bottom),e.lineTo(n.x,t.height-t.margins.bottom+6),e.stroke(),e.textBaseline="top",e.textAlign="center",e.fillStyle="black",e.fillText(n.label,n.x,t.height-t.margins.bottom+8)},f_=e=>B.jsx(ir,{width:e.width,height:e.height,draw:c_,drawData:e}),d_={},h_=({bars:e,ticks:t,verticalLines:n,xLabel:r,onSelectRect:i,width:a,height:o})=>{const{xMin:u,xMax:l}=M.useMemo(()=>e.length>0?{xMin:e[0].xStart,xMax:e[e.length-1].xEnd}:{xMin:0,xMax:1},[e]),s=M.useMemo(()=>Math.max(...e.map(b=>b.height)),[e]),{barBoxes:c,margins:f,pixelTicks:d,pixelVerticalLines:h}=M.useMemo(()=>{const b={left:3,right:3,top:5,bottom:3+(r?13:0)+(t?13:0)},E=a-b.left-b.right,C=o-b.top-b.bottom,A=e.map(x=>({key:x.key,x1:b.left+(x.xStart-u)/(l-u)*E,x2:b.left+(x.xEnd-u)/(l-u)*E,y1:b.top+C*(1-x.height/s),y2:b.top+C,tooltip:x.tooltip,color:x.color})),T=t?t.map(x=>({x:b.left+(x.x-u)/(l-u)*E,label:`${x.label}`})):void 0,_=n?n.map(x=>({x:b.left+(x.x-u)/(l-u)*E,color:x.color})):void 0;return{barBoxes:A,margins:b,pixelTicks:T,pixelVerticalLines:_}},[e,t,n,u,l,s,a,o,r]),v=M.useCallback((b,{ctrlKey:E,shiftKey:C})=>{const A=[],T={x:b[0],y:b[1],width:b[2],height:b[3]};for(const _ of c)_.x1<=T.x+T.width&&_.x2>=T.x&&A.push(_.key);i&&i(T,A,{ctrlKey:E,shiftKey:C})},[c,i]),m=M.useCallback(()=>{},[]),{onMouseMove:D,onMouseDown:p,onMouseUp:g,onMouseLeave:y,paintDragSelectLayer:S}=Hs(a,o,v,m),w=M.useMemo(()=>B.jsx(ir,{width:a,height:o,draw:S,drawData:d_}),[a,o,S]);return B.jsxs("div",{style:{width:a,height:o,position:"relative"},onMouseDown:p,onMouseMove:D,onMouseUp:g,onMouseLeave:y,children:[B.jsx(f_,{barBoxes:c,margins:f,pixelTicks:d,pixelVerticalLines:h,xLabel:r,width:a,height:o}),w]})},m_=(e={})=>{const[t,n]=M.useState(!1),[r,i]=M.useState(!1),a=M.useRef(null);return M.useEffect(()=>{const o=a.current;if(!o)return;const u=new IntersectionObserver(([l])=>{const s=l.isIntersecting;n(s),s&&!r&&i(!0)},{threshold:e.threshold||0,root:e.root||null,rootMargin:e.rootMargin||"0px"});return u.observe(o),()=>{u.unobserve(o)}},[e.threshold,e.root,e.rootMargin,r]),{elementRef:a,isVisible:t,hasBeenVisible:r}},p_=({children:e,width:t,height:n})=>{const{elementRef:r,isVisible:i}=m_({threshold:.1});return B.jsx("div",{ref:r,style:{position:"relative",width:t,height:n},children:i?e:B.jsx("span",{children:"Not visible"})})},g_=()=>{},v_=e=>{const{rowStart:t,maxItems:n,plotIds:r,selectedPlotKeys:i,currentPlotKey:a,plotsDict:o,hideBorderColorPlotKeys:u}=e,l=n||r.length,s=r.slice(t,t+l);return B.jsx("div",{style:{display:"flex",flexWrap:"wrap"},children:s.filter(c=>o[c]).map(c=>{let f="plotWrapperStyle";return u?.has(c)?f=f+" plotUnselectableStyle":f=f+" "+(a===c?"plotCurrentStyle":i?.has(c)?"plotSelectedStyle":"plotUnselectedStyle"),B.jsx("div",{style:{flex:"0 0 auto"},children:B.jsx("div",{className:f,children:o[c]})},c)})},t)},xc=({plots:e,plotComponent:t,selectedPlotKeys:n,currentPlotKey:r,numPlotsPerRow:i})=>{const a=t,o=M.useMemo(()=>{const c=new Set;for(const f of e)f.hideBorderColor&&c.add(f.key);return c},[e]),u=M.useMemo(()=>Object.assign({},...e.map(f=>{const d=f.label!==void 0?20:0,h=B.jsx("div",{"data-key":f.key,onClick:f.clickHandler||g_,children:B.jsx(p_,{width:f.props.width,height:f.props.height,children:B.jsxs("span",{children:[f.label!==void 0&&B.jsx("div",{className:"plotLabelStyle",style:{maxWidth:f.props.width,height:d,userSelect:"none"},children:B.jsx("span",{style:{color:f.labelColor},children:f.label||B.jsx("span",{children:" "})})}),B.jsx(a,{...f.props,height:f.props.height?f.props.height-d:f.props.height})]})})});return{[f.key]:h}})),[e,a]),l=Array(e.length).fill(0).map((c,f)=>f).filter(c=>c%(i||e.length)===0),s=M.useMemo(()=>e.map(c=>c.key),[e]);return B.jsx("div",{className:"PlotGrid",style:{display:"flex",flexDirection:"column"},children:l.map(c=>B.jsx(v_,{rowStart:c,maxItems:i,plotIds:s,selectedPlotKeys:n,currentPlotKey:r,hideBorderColorPlotKeys:o,plotsDict:u},`row-${c}`))})},wc=({width:e,height:t,children:n,disableScroll:r})=>{const i=M.useMemo(()=>({width:e-20,height:t,position:"relative",overflowY:r?"hidden":"auto"}),[e,t,r]);return B.jsx("div",{style:i,children:n})};var PD={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},qD=Nt.createContext&&Nt.createContext(PD),y_=["attr","size","title"];function b_(e,t){if(e==null)return{};var n=D_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function D_(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ec(){return Ec=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ec.apply(this,arguments)}function VD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ac(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VD(Object(n),!0).forEach(function(r){S_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function S_(e,t,n){return t=x_(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x_(e){var t=w_(e,"string");return typeof t=="symbol"?t:t+""}function w_(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GD(e){return e&&e.map((t,n)=>Nt.createElement(t.tag,Ac({key:n},t.attr),GD(t.child)))}function xr(e){return t=>Nt.createElement(E_,Ec({attr:Ac({},e.attr)},t),GD(e.child))}function E_(e){var t=n=>{var{attr:r,size:i,title:a}=e,o=b_(e,y_),u=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),Nt.createElement("svg",Ec({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:l,style:Ac(Ac({color:e.color||n.color},n.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&Nt.createElement("title",null,a),e.children)};return qD!==void 0?Nt.createElement(qD.Consumer,null,n=>t(n)):t(PD)}function A_(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"},child:[]}]})(e)}function C_(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(e)}function T_(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"},child:[]}]})(e)}function M_(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"},child:[]}]})(e)}function Cc(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function __(e){return xr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"},child:[]}]})(e)}function Tc(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function B_(e){return xr({attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function YD(e){return xr({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"},child:[]}]})(e)}function XD(e){return xr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"},child:[]}]})(e)}let F_=0,N_=1,Qh;const wr=e=>{Qh===void 0&&(Qh=ZD.length);const t=(F_+e*N_)%Qh;return ZD[t]},ZD=["#00ff00","#ff00ff","#0080ff","#ff8000","#80bf80","#470ba7","#c80b32","#fd7ee5","#027d30","#00ffff","#00ff80","#9c5a86","#808000","#8ed7fa","#80ff00","#6e52ff","#0000ff","#119c9b","#feb982","#56333d","#fb2b97","#8000ff","#c3f1a2","#b3bd25","#45bc2d","#1c4b88","#49f3c0","#a90c9c","#c436ea","#13055b","#7f93d0","#c4552d","#ee7381","#800000","#58fe60","#4f825e","#21bde8","#d7b8e0","#1e40ee","#324a01","#fc2b03","#723cb9","#3a6ac1","#aef14e","#14c568","#bd9c9b","#f9c506","#b579fa","#810e5e","#b38d4d","#854810","#02ea3a","#0b3b3c","#f90161","#07c304","#fe4c54","#be02ea","#0521bb","#338b05","#4989ff","#52b8b3","#be3271","#f1a441","#0b776b","#0ccfac","#cd61bd","#85fc95","#fe43fe","#bd810d","#cce9e6","#644179","#fedfbe","#80bd00","#99c4bd","#48e5fa","#400626","#bcfc01","#866b3f","#5422e9","#ea03bd","#69809a","#bfca76","#40e60e","#f1da52","#3d5f3b","#63b3f8","#7cd83d","#b52f02","#9364ca","#80a740","#3ce183","#a6a9f6","#fba2bb","#e3763f","#ae3cae","#91414a","#1e94cf","#06f6c9"],Ku={black:"#000",white:"#fff"},So={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},xo={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},wo={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Eo={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Ao={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},Wu={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},R_={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function la(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const O_="$$material";function z_(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function U_(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var I_=function(){function e(n){var r=this;this._insertTag=function(i){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,a),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(U_(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=z_(i);try{a.insertRule(r,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e}(),tn="-ms-",Mc="-moz-",je="-webkit-",QD="comm",Kh="rule",Wh="decl",$_="@import",KD="@keyframes",k_="@layer",L_=Math.abs,_c=String.fromCharCode,j_=Object.assign;function H_(e,t){return Zt(e,0)^45?(((t<<2^Zt(e,0))<<2^Zt(e,1))<<2^Zt(e,2))<<2^Zt(e,3):0}function WD(e){return e.trim()}function P_(e,t){return(e=t.exec(e))?e[0]:e}function He(e,t,n){return e.replace(t,n)}function Jh(e,t){return e.indexOf(t)}function Zt(e,t){return e.charCodeAt(t)|0}function Ju(e,t,n){return e.slice(t,n)}function Er(e){return e.length}function em(e){return e.length}function Bc(e,t){return t.push(e),e}function q_(e,t){return e.map(t).join("")}var Fc=1,Co=1,JD=0,vn=0,Bt=0,To="";function Nc(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:Fc,column:Co,length:o,return:""}}function el(e,t){return j_(Nc("",null,null,"",null,null,0),e,{length:-e.length},t)}function V_(){return Bt}function G_(){return Bt=vn>0?Zt(To,--vn):0,Co--,Bt===10&&(Co=1,Fc--),Bt}function Nn(){return Bt=vn<JD?Zt(To,vn++):0,Co++,Bt===10&&(Co=1,Fc++),Bt}function Ar(){return Zt(To,vn)}function Rc(){return vn}function tl(e,t){return Ju(To,e,t)}function nl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function e2(e){return Fc=Co=1,JD=Er(To=e),vn=0,[]}function t2(e){return To="",e}function Oc(e){return WD(tl(vn-1,tm(e===91?e+2:e===40?e+1:e)))}function Y_(e){for(;(Bt=Ar())&&Bt<33;)Nn();return nl(e)>2||nl(Bt)>3?"":" "}function X_(e,t){for(;--t&&Nn()&&!(Bt<48||Bt>102||Bt>57&&Bt<65||Bt>70&&Bt<97););return tl(e,Rc()+(t<6&&Ar()==32&&Nn()==32))}function tm(e){for(;Nn();)switch(Bt){case e:return vn;case 34:case 39:e!==34&&e!==39&&tm(Bt);break;case 40:e===41&&tm(e);break;case 92:Nn();break}return vn}function Z_(e,t){for(;Nn()&&e+Bt!==57;)if(e+Bt===84&&Ar()===47)break;return"/*"+tl(t,vn-1)+"*"+_c(e===47?e:Nn())}function Q_(e){for(;!nl(Ar());)Nn();return tl(e,vn)}function K_(e){return t2(zc("",null,null,null,[""],e=e2(e),0,[0],e))}function zc(e,t,n,r,i,a,o,u,l){for(var s=0,c=0,f=o,d=0,h=0,v=0,m=1,D=1,p=1,g=0,y="",S=i,w=a,b=r,E=y;D;)switch(v=g,g=Nn()){case 40:if(v!=108&&Zt(E,f-1)==58){Jh(E+=He(Oc(g),"&","&\f"),"&\f")!=-1&&(p=-1);break}case 34:case 39:case 91:E+=Oc(g);break;case 9:case 10:case 13:case 32:E+=Y_(v);break;case 92:E+=X_(Rc()-1,7);continue;case 47:switch(Ar()){case 42:case 47:Bc(W_(Z_(Nn(),Rc()),t,n),l);break;default:E+="/"}break;case 123*m:u[s++]=Er(E)*p;case 125*m:case 59:case 0:switch(g){case 0:case 125:D=0;case 59+c:p==-1&&(E=He(E,/\f/g,"")),h>0&&Er(E)-f&&Bc(h>32?r2(E+";",r,n,f-1):r2(He(E," ","")+";",r,n,f-2),l);break;case 59:E+=";";default:if(Bc(b=n2(E,t,n,s,c,i,u,y,S=[],w=[],f),a),g===123)if(c===0)zc(E,t,b,b,S,a,f,u,w);else switch(d===99&&Zt(E,3)===110?100:d){case 100:case 108:case 109:case 115:zc(e,b,b,r&&Bc(n2(e,b,b,0,0,i,u,y,i,S=[],f),w),i,w,f,u,r?S:w);break;default:zc(E,b,b,b,[""],w,0,u,w)}}s=c=h=0,m=p=1,y=E="",f=o;break;case 58:f=1+Er(E),h=v;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&G_()==125)continue}switch(E+=_c(g),g*m){case 38:p=c>0?1:(E+="\f",-1);break;case 44:u[s++]=(Er(E)-1)*p,p=1;break;case 64:Ar()===45&&(E+=Oc(Nn())),d=Ar(),c=f=Er(y=E+=Q_(Rc())),g++;break;case 45:v===45&&Er(E)==2&&(m=0)}}return a}function n2(e,t,n,r,i,a,o,u,l,s,c){for(var f=i-1,d=i===0?a:[""],h=em(d),v=0,m=0,D=0;v<r;++v)for(var p=0,g=Ju(e,f+1,f=L_(m=o[v])),y=e;p<h;++p)(y=WD(m>0?d[p]+" "+g:He(g,/&\f/g,d[p])))&&(l[D++]=y);return Nc(e,t,n,i===0?Kh:u,l,s,c)}function W_(e,t,n){return Nc(e,t,n,QD,_c(V_()),Ju(e,2,-2),0)}function r2(e,t,n,r){return Nc(e,t,n,Wh,Ju(e,0,r),Ju(e,r+1,-1),r)}function Mo(e,t){for(var n="",r=em(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function J_(e,t,n,r){switch(e.type){case k_:if(e.children.length)break;case $_:case Wh:return e.return=e.return||e.value;case QD:return"";case KD:return e.return=e.value+"{"+Mo(e.children,r)+"}";case Kh:e.value=e.props.join(",")}return Er(n=Mo(e.children,r))?e.return=e.value+"{"+n+"}":""}function e8(e){var t=em(e);return function(n,r,i,a){for(var o="",u=0;u<t;u++)o+=e[u](n,r,i,a)||"";return o}}function t8(e){return function(t){t.root||(t=t.return)&&e(t)}}function i2(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var n8=function(t,n,r){for(var i=0,a=0;i=a,a=Ar(),i===38&&a===12&&(n[r]=1),!nl(a);)Nn();return tl(t,vn)},r8=function(t,n){var r=-1,i=44;do switch(nl(i)){case 0:i===38&&Ar()===12&&(n[r]=1),t[r]+=n8(vn-1,n,r);break;case 2:t[r]+=Oc(i);break;case 4:if(i===44){t[++r]=Ar()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=_c(i)}while(i=Nn());return t},i8=function(t,n){return t2(r8(e2(t),n))},a2=new WeakMap,a8=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!a2.get(r))&&!i){a2.set(t,!0);for(var a=[],o=i8(n,a),u=r.props,l=0,s=0;l<o.length;l++)for(var c=0;c<u.length;c++,s++)t.props[s]=a[l]?o[l].replace(/&\f/g,u[c]):u[c]+" "+o[l]}}},o8=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function o2(e,t){switch(H_(e,t)){case 5103:return je+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return je+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return je+e+Mc+e+tn+e+e;case 6828:case 4268:return je+e+tn+e+e;case 6165:return je+e+tn+"flex-"+e+e;case 5187:return je+e+He(e,/(\w+).+(:[^]+)/,je+"box-$1$2"+tn+"flex-$1$2")+e;case 5443:return je+e+tn+"flex-item-"+He(e,/flex-|-self/,"")+e;case 4675:return je+e+tn+"flex-line-pack"+He(e,/align-content|flex-|-self/,"")+e;case 5548:return je+e+tn+He(e,"shrink","negative")+e;case 5292:return je+e+tn+He(e,"basis","preferred-size")+e;case 6060:return je+"box-"+He(e,"-grow","")+je+e+tn+He(e,"grow","positive")+e;case 4554:return je+He(e,/([^-])(transform)/g,"$1"+je+"$2")+e;case 6187:return He(He(He(e,/(zoom-|grab)/,je+"$1"),/(image-set)/,je+"$1"),e,"")+e;case 5495:case 3959:return He(e,/(image-set\([^]*)/,je+"$1$`$1");case 4968:return He(He(e,/(.+:)(flex-)?(.*)/,je+"box-pack:$3"+tn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+je+e+e;case 4095:case 3583:case 4068:case 2532:return He(e,/(.+)-inline(.+)/,je+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Er(e)-1-t>6)switch(Zt(e,t+1)){case 109:if(Zt(e,t+4)!==45)break;case 102:return He(e,/(.+:)(.+)-([^]+)/,"$1"+je+"$2-$3$1"+Mc+(Zt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Jh(e,"stretch")?o2(He(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Zt(e,t+1)!==115)break;case 6444:switch(Zt(e,Er(e)-3-(~Jh(e,"!important")&&10))){case 107:return He(e,":",":"+je)+e;case 101:return He(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+je+(Zt(e,14)===45?"inline-":"")+"box$3$1"+je+"$2$3$1"+tn+"$2box$3")+e}break;case 5936:switch(Zt(e,t+11)){case 114:return je+e+tn+He(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return je+e+tn+He(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return je+e+tn+He(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return je+e+tn+e+e}return e}var u8=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Wh:t.return=o2(t.value,t.length);break;case KD:return Mo([el(t,{value:He(t.value,"@","@"+je)})],i);case Kh:if(t.length)return q_(t.props,function(a){switch(P_(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Mo([el(t,{props:[He(a,/:(read-\w+)/,":"+Mc+"$1")]})],i);case"::placeholder":return Mo([el(t,{props:[He(a,/:(plac\w+)/,":"+je+"input-$1")]}),el(t,{props:[He(a,/:(plac\w+)/,":"+Mc+"$1")]}),el(t,{props:[He(a,/:(plac\w+)/,tn+"input-$1")]})],i)}return""})}},l8=[u8],s8=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var D=m.getAttribute("data-emotion");D.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||l8,a={},o,u=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var D=m.getAttribute("data-emotion").split(" "),p=1;p<D.length;p++)a[D[p]]=!0;u.push(m)});var l,s=[a8,o8];{var c,f=[J_,t8(function(m){c.insert(m)})],d=e8(s.concat(i,f)),h=function(D){return Mo(K_(D),d)};l=function(D,p,g,y){c=g,h(D?D+"{"+p.styles+"}":p.styles),y&&(v.inserted[p.name]=!0)}}var v={key:n,sheet:new I_({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return v.sheet.hydrate(u),v},u2={exports:{}},Ge={};/** @license React v16.13.1
|
|
80
68
|
* react-is.production.min.js
|
|
81
69
|
*
|
|
82
70
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
83
71
|
*
|
|
84
72
|
* This source code is licensed under the MIT license found in the
|
|
85
73
|
* LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/var Qt=typeof Symbol=="function"&&Symbol.for,sp=Qt?Symbol.for("react.element"):60103,cp=Qt?Symbol.for("react.portal"):60106,xf=Qt?Symbol.for("react.fragment"):60107,Ef=Qt?Symbol.for("react.strict_mode"):60108,Af=Qt?Symbol.for("react.profiler"):60114,Cf=Qt?Symbol.for("react.provider"):60109,Mf=Qt?Symbol.for("react.context"):60110,fp=Qt?Symbol.for("react.async_mode"):60111,Tf=Qt?Symbol.for("react.concurrent_mode"):60111,_f=Qt?Symbol.for("react.forward_ref"):60112,Bf=Qt?Symbol.for("react.suspense"):60113,W7=Qt?Symbol.for("react.suspense_list"):60120,Nf=Qt?Symbol.for("react.memo"):60115,Ff=Qt?Symbol.for("react.lazy"):60116,J7=Qt?Symbol.for("react.block"):60121,eB=Qt?Symbol.for("react.fundamental"):60117,tB=Qt?Symbol.for("react.responder"):60118,nB=Qt?Symbol.for("react.scope"):60119;function Pn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case sp:switch(e=e.type,e){case fp:case Tf:case xf:case Af:case Ef:case Bf:return e;default:switch(e=e&&e.$$typeof,e){case Mf:case _f:case Ff:case Nf:case Cf:return e;default:return t}}case cp:return t}}}function iw(e){return Pn(e)===Tf}Qe.AsyncMode=fp,Qe.ConcurrentMode=Tf,Qe.ContextConsumer=Mf,Qe.ContextProvider=Cf,Qe.Element=sp,Qe.ForwardRef=_f,Qe.Fragment=xf,Qe.Lazy=Ff,Qe.Memo=Nf,Qe.Portal=cp,Qe.Profiler=Af,Qe.StrictMode=Ef,Qe.Suspense=Bf,Qe.isAsyncMode=function(e){return iw(e)||Pn(e)===fp},Qe.isConcurrentMode=iw,Qe.isContextConsumer=function(e){return Pn(e)===Mf},Qe.isContextProvider=function(e){return Pn(e)===Cf},Qe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===sp},Qe.isForwardRef=function(e){return Pn(e)===_f},Qe.isFragment=function(e){return Pn(e)===xf},Qe.isLazy=function(e){return Pn(e)===Ff},Qe.isMemo=function(e){return Pn(e)===Nf},Qe.isPortal=function(e){return Pn(e)===cp},Qe.isProfiler=function(e){return Pn(e)===Af},Qe.isStrictMode=function(e){return Pn(e)===Ef},Qe.isSuspense=function(e){return Pn(e)===Bf},Qe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===xf||e===Tf||e===Af||e===Ef||e===Bf||e===W7||typeof e=="object"&&e!==null&&(e.$$typeof===Ff||e.$$typeof===Nf||e.$$typeof===Cf||e.$$typeof===Mf||e.$$typeof===_f||e.$$typeof===eB||e.$$typeof===tB||e.$$typeof===nB||e.$$typeof===J7)},Qe.typeOf=Pn,rw.exports=Qe;var rB=rw.exports,aw=rB,iB={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},aB={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ow={};ow[aw.ForwardRef]=iB,ow[aw.Memo]=aB;var oB=!0;function uw(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var dp=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||oB===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},lw=function(t,n,r){dp(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+i:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function uB(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var lB={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},sB=/[A-Z]|^ms/g,cB=/_EMO_([^_]+?)_([^]*?)_EMO_/g,sw=function(t){return t.charCodeAt(1)===45},cw=function(t){return t!=null&&typeof t!="boolean"},hp=ew(function(e){return sw(e)?e:e.replace(sB,"-$&").toLowerCase()}),fw=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(cB,function(r,i,a){return Lr={name:i,styles:a,next:Lr},i})}return lB[t]!==1&&!sw(t)&&typeof n=="number"&&n!==0?n+"px":n};function Ol(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Lr={name:i.name,styles:i.styles,next:Lr},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)Lr={name:o.name,styles:o.styles,next:Lr},o=o.next;var u=a.styles+";";return u}return fB(e,t,n)}case"function":{if(e!==void 0){var l=Lr,s=n(e);return Lr=l,Ol(e,t,s)}break}}var c=n;if(t==null)return c;var f=t[c];return f!==void 0?f:c}function fB(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Ol(e,t,n[i])+";";else for(var a in n){var o=n[a];if(typeof o!="object"){var u=o;t!=null&&t[u]!==void 0?r+=a+"{"+t[u]+"}":cw(u)&&(r+=hp(a)+":"+fw(a,u)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var l=0;l<o.length;l++)cw(o[l])&&(r+=hp(a)+":"+fw(a,o[l])+";");else{var s=Ol(e,t,o);switch(a){case"animation":case"animationName":{r+=hp(a)+":"+s+";";break}default:r+=a+"{"+s+"}"}}}return r}var dw=/label:\s*([^\s;{]+)\s*(;|$)/g,Lr;function Rf(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";Lr=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,i+=Ol(n,t,a);else{var o=a;i+=o[0]}for(var u=1;u<e.length;u++)if(i+=Ol(n,t,e[u]),r){var l=a;i+=l[u]}dw.lastIndex=0;for(var s="",c;(c=dw.exec(i))!==null;)s+="-"+c[1];var f=uB(i)+s;return{name:f,styles:i,next:Lr}}var dB=function(t){return t()},hB=Ad.useInsertionEffect?Ad.useInsertionEffect:!1,hw=hB||dB,mw=_.createContext(typeof HTMLElement<"u"?Q7({key:"css"}):null);mw.Provider;var pw=function(t){return _.forwardRef(function(n,r){var i=_.useContext(mw);return t(n,i,r)})},gw=_.createContext({}),mp={}.hasOwnProperty,pp="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",mB=function(t,n){var r={};for(var i in n)mp.call(n,i)&&(r[i]=n[i]);return r[pp]=t,r},pB=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return dp(n,r,i),hw(function(){return lw(n,r,i)}),null},gB=pw(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var i=e[pp],a=[r],o="";typeof e.className=="string"?o=uw(t.registered,a,e.className):e.className!=null&&(o=e.className+" ");var u=Rf(a,void 0,_.useContext(gw));o+=t.key+"-"+u.name;var l={};for(var s in e)mp.call(e,s)&&s!=="css"&&s!==pp&&(l[s]=e[s]);return l.className=o,n&&(l.ref=n),_.createElement(_.Fragment,null,_.createElement(pB,{cache:t,serialized:u,isStringTag:typeof i=="string"}),_.createElement(i,l))}),vB=gB,vw=function(t,n){var r=arguments;if(n==null||!mp.call(n,"css"))return _.createElement.apply(void 0,r);var i=r.length,a=new Array(i);a[0]=vB,a[1]=mB(t,n);for(var o=2;o<i;o++)a[o]=r[o];return _.createElement.apply(null,a)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(vw||(vw={}));function gp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Rf(t)}function zl(){var e=gp.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var yB=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,bB=ew(function(e){return yB.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),DB=bB,SB=function(t){return t!=="theme"},yw=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?DB:SB},bw=function(t,n,r){var i;if(n){var a=n.shouldForwardProp;i=t.__emotion_forwardProp&&a?function(o){return t.__emotion_forwardProp(o)&&a(o)}:a}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},wB=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return dp(n,r,i),hw(function(){return lw(n,r,i)}),null},xB=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,a,o;n!==void 0&&(a=n.label,o=n.target);var u=bw(t,n,r),l=u||yw(i),s=!l("as");return function(){var c=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(a!==void 0&&f.push("label:"+a+";"),c[0]==null||c[0].raw===void 0)f.push.apply(f,c);else{var d=c[0];f.push(d[0]);for(var h=c.length,g=1;g<h;g++)f.push(c[g],d[g])}var m=pw(function(D,p,v){var y=s&&D.as||i,w="",E=[],b=D;if(D.theme==null){b={};for(var S in D)b[S]=D[S];b.theme=_.useContext(gw)}typeof D.className=="string"?w=uw(p.registered,E,D.className):D.className!=null&&(w=D.className+" ");var A=Rf(f.concat(E),p.registered,b);w+=p.key+"-"+A.name,o!==void 0&&(w+=" "+o);var C=s&&u===void 0?yw(y):l,M={};for(var T in D)s&&T==="as"||C(T)&&(M[T]=D[T]);return M.className=w,v&&(M.ref=v),_.createElement(_.Fragment,null,_.createElement(wB,{cache:p,serialized:A,isStringTag:typeof y=="string"}),_.createElement(y,M))});return m.displayName=a!==void 0?a:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=i,m.__emotion_styles=f,m.__emotion_forwardProp=u,Object.defineProperty(m,"toString",{value:function(){return"."+o}}),m.withComponent=function(D,p){var v=e(D,Vi({},n,p,{shouldForwardProp:bw(m,p,!0)}));return v.apply(void 0,f)},m}},EB=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],vp=xB.bind(null);EB.forEach(function(e){vp[e]=vp(e)});function AB(e,t){return vp(e,t)}function CB(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Dw=[];function Ba(e){return Dw[0]=e,Rf(Dw)}var Sw={exports:{}},ut={};/**
|
|
74
|
+
*/var qt=typeof Symbol=="function"&&Symbol.for,nm=qt?Symbol.for("react.element"):60103,rm=qt?Symbol.for("react.portal"):60106,Uc=qt?Symbol.for("react.fragment"):60107,Ic=qt?Symbol.for("react.strict_mode"):60108,$c=qt?Symbol.for("react.profiler"):60114,kc=qt?Symbol.for("react.provider"):60109,Lc=qt?Symbol.for("react.context"):60110,im=qt?Symbol.for("react.async_mode"):60111,jc=qt?Symbol.for("react.concurrent_mode"):60111,Hc=qt?Symbol.for("react.forward_ref"):60112,Pc=qt?Symbol.for("react.suspense"):60113,c8=qt?Symbol.for("react.suspense_list"):60120,qc=qt?Symbol.for("react.memo"):60115,Vc=qt?Symbol.for("react.lazy"):60116,f8=qt?Symbol.for("react.block"):60121,d8=qt?Symbol.for("react.fundamental"):60117,h8=qt?Symbol.for("react.responder"):60118,m8=qt?Symbol.for("react.scope"):60119;function Rn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case nm:switch(e=e.type,e){case im:case jc:case Uc:case $c:case Ic:case Pc:return e;default:switch(e=e&&e.$$typeof,e){case Lc:case Hc:case Vc:case qc:case kc:return e;default:return t}}case rm:return t}}}function l2(e){return Rn(e)===jc}Ge.AsyncMode=im,Ge.ConcurrentMode=jc,Ge.ContextConsumer=Lc,Ge.ContextProvider=kc,Ge.Element=nm,Ge.ForwardRef=Hc,Ge.Fragment=Uc,Ge.Lazy=Vc,Ge.Memo=qc,Ge.Portal=rm,Ge.Profiler=$c,Ge.StrictMode=Ic,Ge.Suspense=Pc,Ge.isAsyncMode=function(e){return l2(e)||Rn(e)===im},Ge.isConcurrentMode=l2,Ge.isContextConsumer=function(e){return Rn(e)===Lc},Ge.isContextProvider=function(e){return Rn(e)===kc},Ge.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===nm},Ge.isForwardRef=function(e){return Rn(e)===Hc},Ge.isFragment=function(e){return Rn(e)===Uc},Ge.isLazy=function(e){return Rn(e)===Vc},Ge.isMemo=function(e){return Rn(e)===qc},Ge.isPortal=function(e){return Rn(e)===rm},Ge.isProfiler=function(e){return Rn(e)===$c},Ge.isStrictMode=function(e){return Rn(e)===Ic},Ge.isSuspense=function(e){return Rn(e)===Pc},Ge.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Uc||e===jc||e===$c||e===Ic||e===Pc||e===c8||typeof e=="object"&&e!==null&&(e.$$typeof===Vc||e.$$typeof===qc||e.$$typeof===kc||e.$$typeof===Lc||e.$$typeof===Hc||e.$$typeof===d8||e.$$typeof===h8||e.$$typeof===m8||e.$$typeof===f8)},Ge.typeOf=Rn,u2.exports=Ge;var p8=u2.exports,s2=p8,g8={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},v8={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c2={};c2[s2.ForwardRef]=g8,c2[s2.Memo]=v8;var y8=!0;function f2(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var am=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||y8===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},d2=function(t,n,r){am(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+i:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function b8(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var D8={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},S8=/[A-Z]|^ms/g,x8=/_EMO_([^_]+?)_([^]*?)_EMO_/g,h2=function(t){return t.charCodeAt(1)===45},m2=function(t){return t!=null&&typeof t!="boolean"},om=i2(function(e){return h2(e)?e:e.replace(S8,"-$&").toLowerCase()}),p2=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(x8,function(r,i,a){return Cr={name:i,styles:a,next:Cr},i})}return D8[t]!==1&&!h2(t)&&typeof n=="number"&&n!==0?n+"px":n};function rl(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Cr={name:i.name,styles:i.styles,next:Cr},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)Cr={name:o.name,styles:o.styles,next:Cr},o=o.next;var u=a.styles+";";return u}return w8(e,t,n)}case"function":{if(e!==void 0){var l=Cr,s=n(e);return Cr=l,rl(e,t,s)}break}}var c=n;if(t==null)return c;var f=t[c];return f!==void 0?f:c}function w8(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=rl(e,t,n[i])+";";else for(var a in n){var o=n[a];if(typeof o!="object"){var u=o;t!=null&&t[u]!==void 0?r+=a+"{"+t[u]+"}":m2(u)&&(r+=om(a)+":"+p2(a,u)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var l=0;l<o.length;l++)m2(o[l])&&(r+=om(a)+":"+p2(a,o[l])+";");else{var s=rl(e,t,o);switch(a){case"animation":case"animationName":{r+=om(a)+":"+s+";";break}default:r+=a+"{"+s+"}"}}}return r}var g2=/label:\s*([^\s;{]+)\s*(;|$)/g,Cr;function Gc(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";Cr=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,i+=rl(n,t,a);else{var o=a;i+=o[0]}for(var u=1;u<e.length;u++)if(i+=rl(n,t,e[u]),r){var l=a;i+=l[u]}g2.lastIndex=0;for(var s="",c;(c=g2.exec(i))!==null;)s+="-"+c[1];var f=b8(i)+s;return{name:f,styles:i,next:Cr}}var E8=function(t){return t()},A8=Lf.useInsertionEffect?Lf.useInsertionEffect:!1,v2=A8||E8,y2=M.createContext(typeof HTMLElement<"u"?s8({key:"css"}):null);y2.Provider;var b2=function(t){return M.forwardRef(function(n,r){var i=M.useContext(y2);return t(n,i,r)})},D2=M.createContext({}),um={}.hasOwnProperty,lm="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",C8=function(t,n){var r={};for(var i in n)um.call(n,i)&&(r[i]=n[i]);return r[lm]=t,r},T8=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return am(n,r,i),v2(function(){return d2(n,r,i)}),null},M8=b2(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var i=e[lm],a=[r],o="";typeof e.className=="string"?o=f2(t.registered,a,e.className):e.className!=null&&(o=e.className+" ");var u=Gc(a,void 0,M.useContext(D2));o+=t.key+"-"+u.name;var l={};for(var s in e)um.call(e,s)&&s!=="css"&&s!==lm&&(l[s]=e[s]);return l.className=o,n&&(l.ref=n),M.createElement(M.Fragment,null,M.createElement(T8,{cache:t,serialized:u,isStringTag:typeof i=="string"}),M.createElement(i,l))}),_8=M8,S2=function(t,n){var r=arguments;if(n==null||!um.call(n,"css"))return M.createElement.apply(void 0,r);var i=r.length,a=new Array(i);a[0]=_8,a[1]=C8(t,n);for(var o=2;o<i;o++)a[o]=r[o];return M.createElement.apply(null,a)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(S2||(S2={}));function sm(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Gc(t)}function il(){var e=sm.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var B8=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,F8=i2(function(e){return B8.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),N8=F8,R8=function(t){return t!=="theme"},x2=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?N8:R8},w2=function(t,n,r){var i;if(n){var a=n.shouldForwardProp;i=t.__emotion_forwardProp&&a?function(o){return t.__emotion_forwardProp(o)&&a(o)}:a}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},O8=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return am(n,r,i),v2(function(){return d2(n,r,i)}),null},z8=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,a,o;n!==void 0&&(a=n.label,o=n.target);var u=w2(t,n,r),l=u||x2(i),s=!l("as");return function(){var c=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(a!==void 0&&f.push("label:"+a+";"),c[0]==null||c[0].raw===void 0)f.push.apply(f,c);else{var d=c[0];f.push(d[0]);for(var h=c.length,v=1;v<h;v++)f.push(c[v],d[v])}var m=b2(function(D,p,g){var y=s&&D.as||i,S="",w=[],b=D;if(D.theme==null){b={};for(var E in D)b[E]=D[E];b.theme=M.useContext(D2)}typeof D.className=="string"?S=f2(p.registered,w,D.className):D.className!=null&&(S=D.className+" ");var C=Gc(f.concat(w),p.registered,b);S+=p.key+"-"+C.name,o!==void 0&&(S+=" "+o);var A=s&&u===void 0?x2(y):l,T={};for(var _ in D)s&&_==="as"||A(_)&&(T[_]=D[_]);return T.className=S,g&&(T.ref=g),M.createElement(M.Fragment,null,M.createElement(O8,{cache:p,serialized:C,isStringTag:typeof y=="string"}),M.createElement(y,T))});return m.displayName=a!==void 0?a:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=i,m.__emotion_styles=f,m.__emotion_forwardProp=u,Object.defineProperty(m,"toString",{value:function(){return"."+o}}),m.withComponent=function(D,p){var g=e(D,Ci({},n,p,{shouldForwardProp:w2(m,p,!0)}));return g.apply(void 0,f)},m}},U8=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],cm=z8.bind(null);U8.forEach(function(e){cm[e]=cm(e)});function I8(e,t){return cm(e,t)}function $8(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const E2=[];function sa(e){return E2[0]=e,Gc(E2)}var A2={exports:{}},nt={};/**
|
|
87
75
|
* @license React
|
|
88
76
|
* react-is.production.js
|
|
89
77
|
*
|
|
@@ -91,14 +79,14 @@ R: `+this.R.toString()}}}function p(y){var w=D(y),E=w.R._data;if(y._data.length>
|
|
|
91
79
|
*
|
|
92
80
|
* This source code is licensed under the MIT license found in the
|
|
93
81
|
* LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/var yp=Symbol.for("react.transitional.element"),bp=Symbol.for("react.portal"),Of=Symbol.for("react.fragment"),zf=Symbol.for("react.strict_mode"),Uf=Symbol.for("react.profiler"),If=Symbol.for("react.consumer"),$f=Symbol.for("react.context"),kf=Symbol.for("react.forward_ref"),Lf=Symbol.for("react.suspense"),jf=Symbol.for("react.suspense_list"),Pf=Symbol.for("react.memo"),Hf=Symbol.for("react.lazy"),MB=Symbol.for("react.view_transition"),TB=Symbol.for("react.client.reference");function lr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case yp:switch(e=e.type,e){case Of:case Uf:case zf:case Lf:case jf:case MB:return e;default:switch(e=e&&e.$$typeof,e){case $f:case kf:case Hf:case Pf:return e;case If:return e;default:return t}}case bp:return t}}}ut.ContextConsumer=If,ut.ContextProvider=$f,ut.Element=yp,ut.ForwardRef=kf,ut.Fragment=Of,ut.Lazy=Hf,ut.Memo=Pf,ut.Portal=bp,ut.Profiler=Uf,ut.StrictMode=zf,ut.Suspense=Lf,ut.SuspenseList=jf,ut.isContextConsumer=function(e){return lr(e)===If},ut.isContextProvider=function(e){return lr(e)===$f},ut.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===yp},ut.isForwardRef=function(e){return lr(e)===kf},ut.isFragment=function(e){return lr(e)===Of},ut.isLazy=function(e){return lr(e)===Hf},ut.isMemo=function(e){return lr(e)===Pf},ut.isPortal=function(e){return lr(e)===bp},ut.isProfiler=function(e){return lr(e)===Uf},ut.isStrictMode=function(e){return lr(e)===zf},ut.isSuspense=function(e){return lr(e)===Lf},ut.isSuspenseList=function(e){return lr(e)===jf},ut.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Of||e===Uf||e===zf||e===Lf||e===jf||typeof e=="object"&&e!==null&&(e.$$typeof===Hf||e.$$typeof===Pf||e.$$typeof===$f||e.$$typeof===If||e.$$typeof===kf||e.$$typeof===TB||e.getModuleId!==void 0)},ut.typeOf=lr,Sw.exports=ut;var ww=Sw.exports;function hi(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function xw(e){if(_.isValidElement(e)||ww.isValidElementType(e)||!hi(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=xw(e[n])}),t}function Hn(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return hi(e)&&hi(t)&&Object.keys(t).forEach(i=>{_.isValidElement(t[i])||ww.isValidElementType(t[i])?r[i]=t[i]:hi(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&hi(e[i])?r[i]=Hn(e[i],t[i],n):n.clone?r[i]=hi(t[i])?xw(t[i]):t[i]:r[i]=t[i]}),r}const _B=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function BB(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=e,a=_B(t),o=Object.keys(a);function u(d){return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof t[d]=="number"?t[d]:d)-r/100}${n})`}function s(d,h){const g=o.indexOf(h);return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n}) and (max-width:${(g!==-1&&typeof t[o[g]]=="number"?t[o[g]]:h)-r/100}${n})`}function c(d){return o.indexOf(d)+1<o.length?s(d,o[o.indexOf(d)+1]):u(d)}function f(d){const h=o.indexOf(d);return h===0?u(o[1]):h===o.length-1?l(o[h]):s(d,o[o.indexOf(d)+1]).replace("@media","@media not all and")}return{keys:o,values:a,up:u,down:l,between:s,only:c,not:f,unit:n,...i}}function Ew(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,i)=>{const a=/min-width:\s*([0-9.]+)/;return+(r.match(a)?.[1]||0)-+(i.match(a)?.[1]||0)});return n.length?n.reduce((r,i)=>{const a=t[i];return delete r[i],r[i]=a,r},{...t}):t}function NB(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function FB(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,a=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(a)}function RB(e){const t=(a,o)=>a.replace("@media",o?`@container ${o}`:"@container");function n(a,o){a.up=(...u)=>t(e.breakpoints.up(...u),o),a.down=(...u)=>t(e.breakpoints.down(...u),o),a.between=(...u)=>t(e.breakpoints.between(...u),o),a.only=(...u)=>t(e.breakpoints.only(...u),o),a.not=(...u)=>{const l=t(e.breakpoints.not(...u),o);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=a=>(n(r,a),r);return n(i),{...e,containerQueries:i}}const OB={borderRadius:4};function Ul(e,t){return t?Hn(e,t,{clone:!1}):e}const qf={xs:0,sm:600,md:900,lg:1200,xl:1536},Aw={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${qf[e]}px)`},zB={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:qf[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function mi(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const a=r.breakpoints||Aw;return t.reduce((o,u,l)=>(o[a.up(a.keys[l])]=n(t[l]),o),{})}if(typeof t=="object"){const a=r.breakpoints||Aw;return Object.keys(t).reduce((o,u)=>{if(NB(a.keys,u)){const l=FB(r.containerQueries?r:zB,u);l&&(o[l]=n(t[u],u))}else if(Object.keys(a.values||qf).includes(u)){const l=a.up(u);o[l]=n(t[u],u)}else{const l=u;o[l]=t[l]}return o},{})}return n(t)}function UB(e={}){return e.keys?.reduce((n,r)=>{const i=e.up(r);return n[i]={},n},{})||{}}function Cw(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function je(e){if(typeof e!="string")throw new Error(_a(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Gf(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,a)=>i&&i[a]?i[a]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function Vf(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=Gf(e,n)||r,t&&(i=t(i,r,e)),i}function Ft(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,a=o=>{if(o[t]==null)return null;const u=o[t],l=o.theme,s=Gf(l,r)||{};return mi(o,u,f=>{let d=Vf(s,i,f);return f===d&&typeof f=="string"&&(d=Vf(s,i,`${t}${f==="default"?"":je(f)}`,f)),n===!1?d:{[n]:d}})};return a.propTypes={},a.filterProps=[t],a}function IB(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const $B={m:"margin",p:"padding"},kB={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Mw={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},LB=IB(e=>{if(e.length>2)if(Mw[e])e=Mw[e];else return[e];const[t,n]=e.split(""),r=$B[t],i=kB[n]||"";return Array.isArray(i)?i.map(a=>r+a):[r+i]}),Dp=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Sp=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Dp,...Sp];function Il(e,t,n,r){const i=Gf(e,t,!0)??n;return typeof i=="number"||typeof i=="string"?a=>typeof a=="string"?a:typeof i=="string"?i.startsWith("var(")&&a===0?0:i.startsWith("var(")&&a===1?i:`calc(${a} * ${i})`:i*a:Array.isArray(i)?a=>{if(typeof a=="string")return a;const o=Math.abs(a),u=i[o];return a>=0?u:typeof u=="number"?-u:typeof u=="string"&&u.startsWith("var(")?`calc(-1 * ${u})`:`-${u}`}:typeof i=="function"?i:()=>{}}function wp(e){return Il(e,"spacing",8)}function $l(e,t){return typeof t=="string"||t==null?t:e(t)}function jB(e,t){return n=>e.reduce((r,i)=>(r[i]=$l(t,n),r),{})}function PB(e,t,n,r){if(!t.includes(n))return null;const i=LB(n),a=jB(i,r),o=e[n];return mi(e,o,a)}function Tw(e,t){const n=wp(e.theme);return Object.keys(e).map(r=>PB(e,t,r,n)).reduce(Ul,{})}function Ct(e){return Tw(e,Dp)}Ct.propTypes={},Ct.filterProps=Dp;function Mt(e){return Tw(e,Sp)}Mt.propTypes={},Mt.filterProps=Sp;function _w(e=8,t=wp({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(a=>{const o=t(a);return typeof o=="number"?`${o}px`:o}).join(" ");return n.mui=!0,n}function Yf(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(a=>{r[a]=i}),r),{}),n=r=>Object.keys(r).reduce((i,a)=>t[a]?Ul(i,t[a](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function sr(e){return typeof e!="number"?e:`${e}px solid`}function cr(e,t){return Ft({prop:e,themeKey:"borders",transform:t})}const HB=cr("border",sr),qB=cr("borderTop",sr),GB=cr("borderRight",sr),VB=cr("borderBottom",sr),YB=cr("borderLeft",sr),XB=cr("borderColor"),ZB=cr("borderTopColor"),KB=cr("borderRightColor"),QB=cr("borderBottomColor"),WB=cr("borderLeftColor"),JB=cr("outline",sr),eN=cr("outlineColor"),Xf=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Il(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:$l(t,r)});return mi(e,e.borderRadius,n)}return null};Xf.propTypes={},Xf.filterProps=["borderRadius"],Yf(HB,qB,GB,VB,YB,XB,ZB,KB,QB,WB,Xf,JB,eN);const Zf=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Il(e.theme,"spacing",8),n=r=>({gap:$l(t,r)});return mi(e,e.gap,n)}return null};Zf.propTypes={},Zf.filterProps=["gap"];const Kf=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Il(e.theme,"spacing",8),n=r=>({columnGap:$l(t,r)});return mi(e,e.columnGap,n)}return null};Kf.propTypes={},Kf.filterProps=["columnGap"];const Qf=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Il(e.theme,"spacing",8),n=r=>({rowGap:$l(t,r)});return mi(e,e.rowGap,n)}return null};Qf.propTypes={},Qf.filterProps=["rowGap"];const tN=Ft({prop:"gridColumn"}),nN=Ft({prop:"gridRow"}),rN=Ft({prop:"gridAutoFlow"}),iN=Ft({prop:"gridAutoColumns"}),aN=Ft({prop:"gridAutoRows"}),oN=Ft({prop:"gridTemplateColumns"}),uN=Ft({prop:"gridTemplateRows"}),lN=Ft({prop:"gridTemplateAreas"}),sN=Ft({prop:"gridArea"});Yf(Zf,Kf,Qf,tN,nN,rN,iN,aN,oN,uN,lN,sN);function au(e,t){return t==="grey"?t:e}const cN=Ft({prop:"color",themeKey:"palette",transform:au}),fN=Ft({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:au}),dN=Ft({prop:"backgroundColor",themeKey:"palette",transform:au});Yf(cN,fN,dN);function qn(e){return e<=1&&e!==0?`${e*100}%`:e}const hN=Ft({prop:"width",transform:qn}),xp=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const r=e.theme?.breakpoints?.values?.[n]||qf[n];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:qn(n)}};return mi(e,e.maxWidth,t)}return null};xp.filterProps=["maxWidth"];const mN=Ft({prop:"minWidth",transform:qn}),pN=Ft({prop:"height",transform:qn}),gN=Ft({prop:"maxHeight",transform:qn}),vN=Ft({prop:"minHeight",transform:qn});Ft({prop:"size",cssProperty:"width",transform:qn}),Ft({prop:"size",cssProperty:"height",transform:qn});const yN=Ft({prop:"boxSizing"});Yf(hN,xp,mN,pN,gN,vN,yN);const Wf={border:{themeKey:"borders",transform:sr},borderTop:{themeKey:"borders",transform:sr},borderRight:{themeKey:"borders",transform:sr},borderBottom:{themeKey:"borders",transform:sr},borderLeft:{themeKey:"borders",transform:sr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:sr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Xf},color:{themeKey:"palette",transform:au},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:au},backgroundColor:{themeKey:"palette",transform:au},p:{style:Mt},pt:{style:Mt},pr:{style:Mt},pb:{style:Mt},pl:{style:Mt},px:{style:Mt},py:{style:Mt},padding:{style:Mt},paddingTop:{style:Mt},paddingRight:{style:Mt},paddingBottom:{style:Mt},paddingLeft:{style:Mt},paddingX:{style:Mt},paddingY:{style:Mt},paddingInline:{style:Mt},paddingInlineStart:{style:Mt},paddingInlineEnd:{style:Mt},paddingBlock:{style:Mt},paddingBlockStart:{style:Mt},paddingBlockEnd:{style:Mt},m:{style:Ct},mt:{style:Ct},mr:{style:Ct},mb:{style:Ct},ml:{style:Ct},mx:{style:Ct},my:{style:Ct},margin:{style:Ct},marginTop:{style:Ct},marginRight:{style:Ct},marginBottom:{style:Ct},marginLeft:{style:Ct},marginX:{style:Ct},marginY:{style:Ct},marginInline:{style:Ct},marginInlineStart:{style:Ct},marginInlineEnd:{style:Ct},marginBlock:{style:Ct},marginBlockStart:{style:Ct},marginBlockEnd:{style:Ct},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Zf},rowGap:{style:Qf},columnGap:{style:Kf},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:qn},maxWidth:{style:xp},minWidth:{transform:qn},height:{transform:qn},maxHeight:{transform:qn},minHeight:{transform:qn},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function bN(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function DN(e,t){return typeof e=="function"?e(t):e}function SN(){function e(n,r,i,a){const o={[n]:r,theme:i},u=a[n];if(!u)return{[n]:r};const{cssProperty:l=n,themeKey:s,transform:c,style:f}=u;if(r==null)return null;if(s==="typography"&&r==="inherit")return{[n]:r};const d=Gf(i,s)||{};return f?f(o):mi(o,r,g=>{let m=Vf(d,c,g);return g===m&&typeof g=="string"&&(m=Vf(d,c,`${n}${g==="default"?"":je(g)}`,g)),l===!1?m:{[l]:m}})}function t(n){const{sx:r,theme:i={},nested:a}=n||{};if(!r)return null;const o=i.unstable_sxConfig??Wf;function u(l){let s=l;if(typeof l=="function")s=l(i);else if(typeof l!="object")return l;if(!s)return null;const c=UB(i.breakpoints),f=Object.keys(c);let d=c;return Object.keys(s).forEach(h=>{const g=DN(s[h],i);if(g!=null)if(typeof g=="object")if(o[h])d=Ul(d,e(h,g,i,o));else{const m=mi({theme:i},g,D=>({[h]:D}));bN(m,g)?d[h]=t({sx:g,theme:i,nested:!0}):d=Ul(d,m)}else d=Ul(d,e(h,g,i,o))}),!a&&i.modularCssLayers?{"@layer sx":Ew(i,Cw(f,d))}:Ew(i,Cw(f,d))}return Array.isArray(r)?r.map(u):u(r)}return t}const ou=SN();ou.filterProps=["sx"];function wN(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let r=n.getColorSchemeSelector(e);return r==="&"?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function Bw(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:a={},...o}=e,u=BB(n),l=_w(i);let s=Hn({breakpoints:u,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...OB,...a}},o);return s=RB(s),s.applyStyles=wN,s=t.reduce((c,f)=>Hn(c,f),s),s.unstable_sxConfig={...Wf,...o?.unstable_sxConfig},s.unstable_sx=function(f){return ou({sx:f,theme:this})},s}const Nw=e=>e,xN=(()=>{let e=Nw;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Nw}}})();function Fw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Fw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ct(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Fw(e))&&(r&&(r+=" "),r+=t);return r}const EN={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Mn(e,t,n="Mui"){const r=EN[t];return r?`${n}-${r}`:`${xN.generate(e)}-${t}`}function Tn(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=Mn(e,i,n)}),r}function Rw(e){const{variants:t,...n}=e,r={variants:t,style:Ba(n),isProcessed:!0};return r.style===n||t&&t.forEach(i=>{typeof i.style!="function"&&(i.style=Ba(i.style))}),r}const AN=Bw();function Ep(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Na(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function CN(e){return e?(t,n)=>n[e]:null}function MN(e,t,n){e.theme=BN(e.theme)?n:e.theme[t]||e.theme}function Jf(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(i=>Jf(e,i,n));if(Array.isArray(r?.variants)){let i;if(r.isProcessed)i=n?Na(r.style,n):r.style;else{const{variants:a,...o}=r;i=n?Na(Ba(o),n):o}return Ow(e,r.variants,[i],n)}return r?.isProcessed?n?Na(Ba(r.style),n):r.style:n?Na(Ba(r),n):r}function Ow(e,t,n=[],r=void 0){let i;e:for(let a=0;a<t.length;a+=1){const o=t[a];if(typeof o.props=="function"){if(i??={...e,...e.ownerState,ownerState:e.ownerState},!o.props(i))continue}else for(const u in o.props)if(e[u]!==o.props[u]&&e.ownerState?.[u]!==o.props[u])continue e;typeof o.style=="function"?(i??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?Na(Ba(o.style(i)),r):o.style(i))):n.push(r?Na(Ba(o.style),r):o.style)}return n}function TN(e={}){const{themeId:t,defaultTheme:n=AN,rootShouldForwardProp:r=Ep,slotShouldForwardProp:i=Ep}=e;function a(u){MN(u,t,n)}return(u,l={})=>{CB(u,b=>b.filter(S=>S!==ou));const{name:s,slot:c,skipVariantsResolver:f,skipSx:d,overridesResolver:h=CN(FN(c)),...g}=l,m=s&&s.startsWith("Mui")||c?"components":"custom",D=f!==void 0?f:c&&c!=="Root"&&c!=="root"||!1,p=d||!1;let v=Ep;c==="Root"||c==="root"?v=r:c?v=i:NN(u)&&(v=void 0);const y=AB(u,{shouldForwardProp:v,label:_N(),...g}),w=b=>{if(b.__emotion_real===b)return b;if(typeof b=="function")return function(A){return Jf(A,b,A.theme.modularCssLayers?m:void 0)};if(hi(b)){const S=Rw(b);return function(C){return S.variants?Jf(C,S,C.theme.modularCssLayers?m:void 0):C.theme.modularCssLayers?Na(S.style,m):S.style}}return b},E=(...b)=>{const S=[],A=b.map(w),C=[];if(S.push(a),s&&h&&C.push(function(N){const z=N.theme.components?.[s]?.styleOverrides;if(!z)return null;const F={};for(const U in z)F[U]=Jf(N,z[U],N.theme.modularCssLayers?"theme":void 0);return h(N,F)}),s&&!D&&C.push(function(N){const z=N.theme?.components?.[s]?.variants;return z?Ow(N,z,[],N.theme.modularCssLayers?"theme":void 0):null}),p||C.push(ou),Array.isArray(A[0])){const x=A.shift(),N=new Array(S.length).fill(""),R=new Array(C.length).fill("");let z;z=[...N,...x,...R],z.raw=[...N,...x.raw,...R],S.unshift(z)}const M=[...S,...A,...C],T=y(...M);return u.muiName&&(T.muiName=u.muiName),T};return y.withConfig&&(E.withConfig=y.withConfig),E}}function _N(e,t){return void 0}function BN(e){for(const t in e)return!1;return!0}function NN(e){return typeof e=="string"&&e.charCodeAt(0)>96}function FN(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Ap(e,t,n=!1){const r={...t};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const a=i;if(a==="components"||a==="slots")r[a]={...e[a],...r[a]};else if(a==="componentsProps"||a==="slotProps"){const o=e[a],u=t[a];if(!u)r[a]=o||{};else if(!o)r[a]=u;else{r[a]={...u};for(const l in o)if(Object.prototype.hasOwnProperty.call(o,l)){const s=l;r[a][s]=Ap(o[s],u[s],n)}}}else a==="className"&&n&&t.className?r.className=ct(e?.className,t?.className):a==="style"&&n&&t.style?r.style={...e?.style,...t?.style}:r[a]===void 0&&(r[a]=e[a])}return r}const RN=typeof window<"u"?_.useLayoutEffect:_.useEffect;function ON(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Cp(e,t=0,n=1){return ON(e,t,n)}function zN(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function ta(e){if(e.type)return e;if(e.charAt(0)==="#")return ta(zN(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(_a(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(_a(10,i))}else r=r.split(",");return r=r.map(a=>parseFloat(a)),{type:n,values:r,colorSpace:i}}const UN=e=>{const t=ta(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},kl=(e,t)=>{try{return UN(e)}catch{return e}};function ed(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,a)=>a<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function zw(e){e=ta(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),o=(s,c=(s+n/30)%12)=>i-a*Math.max(Math.min(c-3,9-c,1),-1);let u="rgb";const l=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type==="hsla"&&(u+="a",l.push(t[3])),ed({type:u,values:l})}function Mp(e){e=ta(e);let t=e.type==="hsl"||e.type==="hsla"?ta(zw(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function IN(e,t){const n=Mp(e),r=Mp(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Uw(e,t){return e=ta(e),t=Cp(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,ed(e)}function Fa(e,t,n){try{return Uw(e,t)}catch{return e}}function td(e,t){if(e=ta(e),t=Cp(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return ed(e)}function We(e,t,n){try{return td(e,t)}catch{return e}}function nd(e,t){if(e=ta(e),t=Cp(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return ed(e)}function Je(e,t,n){try{return nd(e,t)}catch{return e}}function $N(e,t=.15){return Mp(e)>.5?td(e,t):nd(e,t)}function rd(e,t,n){try{return $N(e,t)}catch{return e}}const kN=_.createContext(void 0);function LN(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?Ap(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?Ap(i,r,t.components.mergeClassNameAndStyle):r}function jN({props:e,name:t}){const n=_.useContext(kN);return LN({props:e,name:t,theme:{components:n}})}let Iw=0;function PN(e){const[t,n]=_.useState(e),r=e||t;return _.useEffect(()=>{t==null&&(Iw+=1,n(`mui-${Iw}`))},[t]),r}const $w={...Ad}.useId;function HN(e){if($w!==void 0){const t=$w();return e??t}return PN(e)}const kw={theme:void 0};function qN(e){let t,n;return function(i){let a=t;return(a===void 0||i.theme!==n)&&(kw.theme=i.theme,a=Rw(e(kw)),t=a,n=i.theme),a}}function GN(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const Lw=(e,t,n,r=[])=>{let i=e;t.forEach((a,o)=>{o===t.length-1?Array.isArray(i)?i[Number(a)]=n:i&&typeof i=="object"&&(i[a]=n):i&&typeof i=="object"&&(i[a]||(i[a]=r.includes(a)?[]:{}),i=i[a])})},VN=(e,t,n)=>{function r(i,a=[],o=[]){Object.entries(i).forEach(([u,l])=>{(!n||n&&!n([...a,u]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...a,u],Array.isArray(l)?[...o,u]:o):t([...a,u],l,o))})}r(e)},YN=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Tp(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},a={},o={};return VN(e,(u,l,s)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(u,l))){const c=`--${n?`${n}-`:""}${u.join("-")}`,f=YN(u,l);Object.assign(i,{[c]:f}),Lw(a,u,`var(${c})`,s),Lw(o,u,`var(${c}, ${f})`,s)}},u=>u[0]==="vars"),{css:i,vars:a,varsWithDefaults:o}}function XN(e,t={}){const{getSelector:n=p,disableCssColorScheme:r,colorSchemeSelector:i,enableContrastVars:a}=t,{colorSchemes:o={},components:u,defaultColorScheme:l="light",...s}=e,{vars:c,css:f,varsWithDefaults:d}=Tp(s,t);let h=d;const g={},{[l]:m,...D}=o;if(Object.entries(D||{}).forEach(([w,E])=>{const{vars:b,css:S,varsWithDefaults:A}=Tp(E,t);h=Hn(h,A),g[w]={css:S,vars:b}}),m){const{css:w,vars:E,varsWithDefaults:b}=Tp(m,t);h=Hn(h,b),g[l]={css:w,vars:E}}function p(w,E){let b=i;if(i==="class"&&(b=".%s"),i==="data"&&(b="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(b=`[${i}="%s"]`),w){if(b==="media")return e.defaultColorScheme===w?":root":{[`@media (prefers-color-scheme: ${o[w]?.palette?.mode||w})`]:{":root":E}};if(b)return e.defaultColorScheme===w?`:root, ${b.replace("%s",String(w))}`:b.replace("%s",String(w))}return":root"}return{vars:h,generateThemeVars:()=>{let w={...c};return Object.entries(g).forEach(([,{vars:E}])=>{w=Hn(w,E)}),w},generateStyleSheets:()=>{const w=[],E=e.defaultColorScheme||"light";function b(C,M){Object.keys(M).length&&w.push(typeof C=="string"?{[C]:{...M}}:C)}b(n(void 0,{...f}),f);const{[E]:S,...A}=g;if(S){const{css:C}=S,M=o[E]?.palette?.mode,T=!r&&M?{colorScheme:M,...C}:{...C};b(n(E,{...T}),T)}return Object.entries(A).forEach(([C,{css:M}])=>{const T=o[C]?.palette?.mode,x=!r&&T?{colorScheme:T,...M}:{...M};b(n(C,{...x}),x)}),a&&w.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),w}}}function ZN(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}function Gn(e,t,n=void 0){const r={};for(const i in e){const a=e[i];let o="",u=!0;for(let l=0;l<a.length;l+=1){const s=a[l];s&&(o+=(u===!0?"":" ")+t(s),u=!1,n&&n[s]&&(o+=" "+n[s]))}r[i]=o}return r}function jw(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Tl.white,default:Tl.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const Pw=jw();function Hw(){return{text:{primary:Tl.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Tl.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const _p=Hw();function qw(e,t,n,r){const i=r.light||r,a=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=nd(e.main,i):t==="dark"&&(e.dark=td(e.main,a)))}function Gw(e,t,n,r,i){const a=i.light||i,o=i.dark||i*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(a*100).toFixed(0)}%)`:n==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(o*100).toFixed(0)}%)`))}function KN(e="light"){return e==="dark"?{main:Jo[200],light:Jo[50],dark:Jo[400]}:{main:Jo[700],light:Jo[400],dark:Jo[800]}}function QN(e="light"){return e==="dark"?{main:Wo[200],light:Wo[50],dark:Wo[400]}:{main:Wo[500],light:Wo[300],dark:Wo[700]}}function WN(e="light"){return e==="dark"?{main:Qo[500],light:Qo[300],dark:Qo[700]}:{main:Qo[700],light:Qo[400],dark:Qo[800]}}function JN(e="light"){return e==="dark"?{main:eu[400],light:eu[300],dark:eu[700]}:{main:eu[700],light:eu[500],dark:eu[900]}}function eF(e="light"){return e==="dark"?{main:tu[400],light:tu[300],dark:tu[700]}:{main:tu[800],light:tu[500],dark:tu[900]}}function tF(e="light"){return e==="dark"?{main:_l[400],light:_l[300],dark:_l[700]}:{main:"#ed6c02",light:_l[500],dark:_l[900]}}function nF(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Bp(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:i,...a}=e,o=e.primary||KN(t),u=e.secondary||QN(t),l=e.error||WN(t),s=e.info||JN(t),c=e.success||eF(t),f=e.warning||tF(t);function d(D){return i?nF(D):IN(D,_p.text.primary)>=n?_p.text.primary:Pw.text.primary}const h=({color:D,name:p,mainShade:v=500,lightShade:y=300,darkShade:w=700})=>{if(D={...D},!D.main&&D[v]&&(D.main=D[v]),!D.hasOwnProperty("main"))throw new Error(_a(11,p?` (${p})`:"",v));if(typeof D.main!="string")throw new Error(_a(12,p?` (${p})`:"",JSON.stringify(D.main)));return i?(Gw(i,D,"light",y,r),Gw(i,D,"dark",w,r)):(qw(D,"light",y,r),qw(D,"dark",w,r)),D.contrastText||(D.contrastText=d(D.main)),D};let g;return t==="light"?g=jw():t==="dark"&&(g=Hw()),Hn({common:{...Tl},mode:t,primary:h({color:o,name:"primary"}),secondary:h({color:u,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:l,name:"error"}),warning:h({color:f,name:"warning"}),info:h({color:s,name:"info"}),success:h({color:c,name:"success"}),grey:S7,contrastThreshold:n,getContrastText:d,augmentColor:h,tonalOffset:r,...g},a)}function rF(e){const t={};return Object.entries(e).forEach(r=>{const[i,a]=r;typeof a=="object"&&(t[i]=`${a.fontStyle?`${a.fontStyle} `:""}${a.fontVariant?`${a.fontVariant} `:""}${a.fontWeight?`${a.fontWeight} `:""}${a.fontStretch?`${a.fontStretch} `:""}${a.fontSize||""}${a.lineHeight?`/${a.lineHeight} `:""}${a.fontFamily||""}`)}),t}function iF(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function aF(e){return Math.round(e*1e5)/1e5}const Vw={textTransform:"uppercase"},Yw='"Roboto", "Helvetica", "Arial", sans-serif';function oF(e,t){const{fontFamily:n=Yw,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:u=700,htmlFontSize:l=16,allVariants:s,pxToRem:c,...f}=typeof t=="function"?t(e):t,d=r/14,h=c||(D=>`${D/l*d}rem`),g=(D,p,v,y,w)=>({fontFamily:n,fontWeight:D,fontSize:h(p),lineHeight:v,...n===Yw?{letterSpacing:`${aF(y/p)}em`}:{},...w,...s}),m={h1:g(i,96,1.167,-1.5),h2:g(i,60,1.2,-.5),h3:g(a,48,1.167,0),h4:g(a,34,1.235,.25),h5:g(a,24,1.334,0),h6:g(o,20,1.6,.15),subtitle1:g(a,16,1.75,.15),subtitle2:g(o,14,1.57,.1),body1:g(a,16,1.5,.15),body2:g(a,14,1.43,.15),button:g(o,14,1.75,.4,Vw),caption:g(a,12,1.66,.4),overline:g(a,12,2.66,1,Vw),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Hn({htmlFontSize:l,pxToRem:h,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:u,...m},f,{clone:!1})}const uF=.2,lF=.14,sF=.12;function Dt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${uF})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${lF})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${sF})`].join(",")}const cF=["none",Dt(0,2,1,-1,0,1,1,0,0,1,3,0),Dt(0,3,1,-2,0,2,2,0,0,1,5,0),Dt(0,3,3,-2,0,3,4,0,0,1,8,0),Dt(0,2,4,-1,0,4,5,0,0,1,10,0),Dt(0,3,5,-1,0,5,8,0,0,1,14,0),Dt(0,3,5,-1,0,6,10,0,0,1,18,0),Dt(0,4,5,-2,0,7,10,1,0,2,16,1),Dt(0,5,5,-3,0,8,10,1,0,3,14,2),Dt(0,5,6,-3,0,9,12,1,0,3,16,2),Dt(0,6,6,-3,0,10,14,1,0,4,18,3),Dt(0,6,7,-4,0,11,15,1,0,4,20,3),Dt(0,7,8,-4,0,12,17,2,0,5,22,4),Dt(0,7,8,-4,0,13,19,2,0,5,24,4),Dt(0,7,9,-4,0,14,21,2,0,5,26,4),Dt(0,8,9,-5,0,15,22,2,0,6,28,5),Dt(0,8,10,-5,0,16,24,2,0,6,30,5),Dt(0,8,11,-5,0,17,26,2,0,6,32,5),Dt(0,9,11,-5,0,18,28,2,0,7,34,6),Dt(0,9,12,-6,0,19,29,2,0,7,36,6),Dt(0,10,13,-6,0,20,31,3,0,8,38,7),Dt(0,10,13,-6,0,21,33,3,0,8,40,7),Dt(0,10,14,-6,0,22,35,3,0,8,42,7),Dt(0,11,14,-7,0,23,36,3,0,9,44,8),Dt(0,11,15,-7,0,24,38,3,0,9,46,8)],fF={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},dF={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Xw(e){return`${Math.round(e)}ms`}function hF(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function mF(e){const t={...fF,...e.easing},n={...dF,...e.duration};return{getAutoHeightDuration:hF,create:(i=["all"],a={})=>{const{duration:o=n.standard,easing:u=t.easeInOut,delay:l=0,...s}=a;return(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof o=="string"?o:Xw(o)} ${u} ${typeof l=="string"?l:Xw(l)}`).join(",")},...e,easing:t,duration:n}}const pF={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function gF(e){return hi(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Zw(e={}){const t={...e};function n(r){const i=Object.entries(r);for(let a=0;a<i.length;a++){const[o,u]=i[a];!gF(u)||o.startsWith("unstable_")?delete r[o]:hi(u)&&(r[o]={...u},n(r[o]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
82
|
+
*/var fm=Symbol.for("react.transitional.element"),dm=Symbol.for("react.portal"),Yc=Symbol.for("react.fragment"),Xc=Symbol.for("react.strict_mode"),Zc=Symbol.for("react.profiler"),Qc=Symbol.for("react.consumer"),Kc=Symbol.for("react.context"),Wc=Symbol.for("react.forward_ref"),Jc=Symbol.for("react.suspense"),ef=Symbol.for("react.suspense_list"),tf=Symbol.for("react.memo"),nf=Symbol.for("react.lazy"),k8=Symbol.for("react.view_transition"),L8=Symbol.for("react.client.reference");function Kn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case fm:switch(e=e.type,e){case Yc:case Zc:case Xc:case Jc:case ef:case k8:return e;default:switch(e=e&&e.$$typeof,e){case Kc:case Wc:case nf:case tf:return e;case Qc:return e;default:return t}}case dm:return t}}}nt.ContextConsumer=Qc,nt.ContextProvider=Kc,nt.Element=fm,nt.ForwardRef=Wc,nt.Fragment=Yc,nt.Lazy=nf,nt.Memo=tf,nt.Portal=dm,nt.Profiler=Zc,nt.StrictMode=Xc,nt.Suspense=Jc,nt.SuspenseList=ef,nt.isContextConsumer=function(e){return Kn(e)===Qc},nt.isContextProvider=function(e){return Kn(e)===Kc},nt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===fm},nt.isForwardRef=function(e){return Kn(e)===Wc},nt.isFragment=function(e){return Kn(e)===Yc},nt.isLazy=function(e){return Kn(e)===nf},nt.isMemo=function(e){return Kn(e)===tf},nt.isPortal=function(e){return Kn(e)===dm},nt.isProfiler=function(e){return Kn(e)===Zc},nt.isStrictMode=function(e){return Kn(e)===Xc},nt.isSuspense=function(e){return Kn(e)===Jc},nt.isSuspenseList=function(e){return Kn(e)===ef},nt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Yc||e===Zc||e===Xc||e===Jc||e===ef||typeof e=="object"&&e!==null&&(e.$$typeof===nf||e.$$typeof===tf||e.$$typeof===Kc||e.$$typeof===Qc||e.$$typeof===Wc||e.$$typeof===L8||e.getModuleId!==void 0)},nt.typeOf=Kn,A2.exports=nt;var C2=A2.exports;function Zr(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function T2(e){if(M.isValidElement(e)||C2.isValidElementType(e)||!Zr(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=T2(e[n])}),t}function On(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return Zr(e)&&Zr(t)&&Object.keys(t).forEach(i=>{M.isValidElement(t[i])||C2.isValidElementType(t[i])?r[i]=t[i]:Zr(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Zr(e[i])?r[i]=On(e[i],t[i],n):n.clone?r[i]=Zr(t[i])?T2(t[i]):t[i]:r[i]=t[i]}),r}const j8=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function H8(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=e,a=j8(t),o=Object.keys(a);function u(d){return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof t[d]=="number"?t[d]:d)-r/100}${n})`}function s(d,h){const v=o.indexOf(h);return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n}) and (max-width:${(v!==-1&&typeof t[o[v]]=="number"?t[o[v]]:h)-r/100}${n})`}function c(d){return o.indexOf(d)+1<o.length?s(d,o[o.indexOf(d)+1]):u(d)}function f(d){const h=o.indexOf(d);return h===0?u(o[1]):h===o.length-1?l(o[h]):s(d,o[o.indexOf(d)+1]).replace("@media","@media not all and")}return{keys:o,values:a,up:u,down:l,between:s,only:c,not:f,unit:n,...i}}function M2(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,i)=>{const a=/min-width:\s*([0-9.]+)/;return+(r.match(a)?.[1]||0)-+(i.match(a)?.[1]||0)});return n.length?n.reduce((r,i)=>{const a=t[i];return delete r[i],r[i]=a,r},{...t}):t}function P8(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function q8(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,a=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(a)}function V8(e){const t=(a,o)=>a.replace("@media",o?`@container ${o}`:"@container");function n(a,o){a.up=(...u)=>t(e.breakpoints.up(...u),o),a.down=(...u)=>t(e.breakpoints.down(...u),o),a.between=(...u)=>t(e.breakpoints.between(...u),o),a.only=(...u)=>t(e.breakpoints.only(...u),o),a.not=(...u)=>{const l=t(e.breakpoints.not(...u),o);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=a=>(n(r,a),r);return n(i),{...e,containerQueries:i}}const G8={borderRadius:4};function al(e,t){return t?On(e,t,{clone:!1}):e}const rf={xs:0,sm:600,md:900,lg:1200,xl:1536},_2={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${rf[e]}px)`},Y8={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:rf[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Qr(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const a=r.breakpoints||_2;return t.reduce((o,u,l)=>(o[a.up(a.keys[l])]=n(t[l]),o),{})}if(typeof t=="object"){const a=r.breakpoints||_2;return Object.keys(t).reduce((o,u)=>{if(P8(a.keys,u)){const l=q8(r.containerQueries?r:Y8,u);l&&(o[l]=n(t[u],u))}else if(Object.keys(a.values||rf).includes(u)){const l=a.up(u);o[l]=n(t[u],u)}else{const l=u;o[l]=t[l]}return o},{})}return n(t)}function X8(e={}){return e.keys?.reduce((n,r)=>{const i=e.up(r);return n[i]={},n},{})||{}}function B2(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Ue(e){if(typeof e!="string")throw new Error(la(7));return e.charAt(0).toUpperCase()+e.slice(1)}function af(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,a)=>i&&i[a]?i[a]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function of(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=af(e,n)||r,t&&(i=t(i,r,e)),i}function Tt(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,a=o=>{if(o[t]==null)return null;const u=o[t],l=o.theme,s=af(l,r)||{};return Qr(o,u,f=>{let d=of(s,i,f);return f===d&&typeof f=="string"&&(d=of(s,i,`${t}${f==="default"?"":Ue(f)}`,f)),n===!1?d:{[n]:d}})};return a.propTypes={},a.filterProps=[t],a}function Z8(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const Q8={m:"margin",p:"padding"},K8={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},F2={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},W8=Z8(e=>{if(e.length>2)if(F2[e])e=F2[e];else return[e];const[t,n]=e.split(""),r=Q8[t],i=K8[n]||"";return Array.isArray(i)?i.map(a=>r+a):[r+i]}),hm=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],mm=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...hm,...mm];function ol(e,t,n,r){const i=af(e,t,!0)??n;return typeof i=="number"||typeof i=="string"?a=>typeof a=="string"?a:typeof i=="string"?i.startsWith("var(")&&a===0?0:i.startsWith("var(")&&a===1?i:`calc(${a} * ${i})`:i*a:Array.isArray(i)?a=>{if(typeof a=="string")return a;const o=Math.abs(a),u=i[o];return a>=0?u:typeof u=="number"?-u:typeof u=="string"&&u.startsWith("var(")?`calc(-1 * ${u})`:`-${u}`}:typeof i=="function"?i:()=>{}}function pm(e){return ol(e,"spacing",8)}function ul(e,t){return typeof t=="string"||t==null?t:e(t)}function J8(e,t){return n=>e.reduce((r,i)=>(r[i]=ul(t,n),r),{})}function e6(e,t,n,r){if(!t.includes(n))return null;const i=W8(n),a=J8(i,r),o=e[n];return Qr(e,o,a)}function N2(e,t){const n=pm(e.theme);return Object.keys(e).map(r=>e6(e,t,r,n)).reduce(al,{})}function St(e){return N2(e,hm)}St.propTypes={},St.filterProps=hm;function xt(e){return N2(e,mm)}xt.propTypes={},xt.filterProps=mm;function R2(e=8,t=pm({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(a=>{const o=t(a);return typeof o=="number"?`${o}px`:o}).join(" ");return n.mui=!0,n}function uf(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(a=>{r[a]=i}),r),{}),n=r=>Object.keys(r).reduce((i,a)=>t[a]?al(i,t[a](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Wn(e){return typeof e!="number"?e:`${e}px solid`}function Jn(e,t){return Tt({prop:e,themeKey:"borders",transform:t})}const t6=Jn("border",Wn),n6=Jn("borderTop",Wn),r6=Jn("borderRight",Wn),i6=Jn("borderBottom",Wn),a6=Jn("borderLeft",Wn),o6=Jn("borderColor"),u6=Jn("borderTopColor"),l6=Jn("borderRightColor"),s6=Jn("borderBottomColor"),c6=Jn("borderLeftColor"),f6=Jn("outline",Wn),d6=Jn("outlineColor"),lf=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=ol(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:ul(t,r)});return Qr(e,e.borderRadius,n)}return null};lf.propTypes={},lf.filterProps=["borderRadius"],uf(t6,n6,r6,i6,a6,o6,u6,l6,s6,c6,lf,f6,d6);const sf=e=>{if(e.gap!==void 0&&e.gap!==null){const t=ol(e.theme,"spacing",8),n=r=>({gap:ul(t,r)});return Qr(e,e.gap,n)}return null};sf.propTypes={},sf.filterProps=["gap"];const cf=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=ol(e.theme,"spacing",8),n=r=>({columnGap:ul(t,r)});return Qr(e,e.columnGap,n)}return null};cf.propTypes={},cf.filterProps=["columnGap"];const ff=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=ol(e.theme,"spacing",8),n=r=>({rowGap:ul(t,r)});return Qr(e,e.rowGap,n)}return null};ff.propTypes={},ff.filterProps=["rowGap"];const h6=Tt({prop:"gridColumn"}),m6=Tt({prop:"gridRow"}),p6=Tt({prop:"gridAutoFlow"}),g6=Tt({prop:"gridAutoColumns"}),v6=Tt({prop:"gridAutoRows"}),y6=Tt({prop:"gridTemplateColumns"}),b6=Tt({prop:"gridTemplateRows"}),D6=Tt({prop:"gridTemplateAreas"}),S6=Tt({prop:"gridArea"});uf(sf,cf,ff,h6,m6,p6,g6,v6,y6,b6,D6,S6);function _o(e,t){return t==="grey"?t:e}const x6=Tt({prop:"color",themeKey:"palette",transform:_o}),w6=Tt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:_o}),E6=Tt({prop:"backgroundColor",themeKey:"palette",transform:_o});uf(x6,w6,E6);function zn(e){return e<=1&&e!==0?`${e*100}%`:e}const A6=Tt({prop:"width",transform:zn}),gm=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const r=e.theme?.breakpoints?.values?.[n]||rf[n];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:zn(n)}};return Qr(e,e.maxWidth,t)}return null};gm.filterProps=["maxWidth"];const C6=Tt({prop:"minWidth",transform:zn}),T6=Tt({prop:"height",transform:zn}),M6=Tt({prop:"maxHeight",transform:zn}),_6=Tt({prop:"minHeight",transform:zn});Tt({prop:"size",cssProperty:"width",transform:zn}),Tt({prop:"size",cssProperty:"height",transform:zn});const B6=Tt({prop:"boxSizing"});uf(A6,gm,C6,T6,M6,_6,B6);const df={border:{themeKey:"borders",transform:Wn},borderTop:{themeKey:"borders",transform:Wn},borderRight:{themeKey:"borders",transform:Wn},borderBottom:{themeKey:"borders",transform:Wn},borderLeft:{themeKey:"borders",transform:Wn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Wn},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:lf},color:{themeKey:"palette",transform:_o},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:_o},backgroundColor:{themeKey:"palette",transform:_o},p:{style:xt},pt:{style:xt},pr:{style:xt},pb:{style:xt},pl:{style:xt},px:{style:xt},py:{style:xt},padding:{style:xt},paddingTop:{style:xt},paddingRight:{style:xt},paddingBottom:{style:xt},paddingLeft:{style:xt},paddingX:{style:xt},paddingY:{style:xt},paddingInline:{style:xt},paddingInlineStart:{style:xt},paddingInlineEnd:{style:xt},paddingBlock:{style:xt},paddingBlockStart:{style:xt},paddingBlockEnd:{style:xt},m:{style:St},mt:{style:St},mr:{style:St},mb:{style:St},ml:{style:St},mx:{style:St},my:{style:St},margin:{style:St},marginTop:{style:St},marginRight:{style:St},marginBottom:{style:St},marginLeft:{style:St},marginX:{style:St},marginY:{style:St},marginInline:{style:St},marginInlineStart:{style:St},marginInlineEnd:{style:St},marginBlock:{style:St},marginBlockStart:{style:St},marginBlockEnd:{style:St},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:sf},rowGap:{style:ff},columnGap:{style:cf},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:zn},maxWidth:{style:gm},minWidth:{transform:zn},height:{transform:zn},maxHeight:{transform:zn},minHeight:{transform:zn},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function F6(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function N6(e,t){return typeof e=="function"?e(t):e}function R6(){function e(n,r,i,a){const o={[n]:r,theme:i},u=a[n];if(!u)return{[n]:r};const{cssProperty:l=n,themeKey:s,transform:c,style:f}=u;if(r==null)return null;if(s==="typography"&&r==="inherit")return{[n]:r};const d=af(i,s)||{};return f?f(o):Qr(o,r,v=>{let m=of(d,c,v);return v===m&&typeof v=="string"&&(m=of(d,c,`${n}${v==="default"?"":Ue(v)}`,v)),l===!1?m:{[l]:m}})}function t(n){const{sx:r,theme:i={},nested:a}=n||{};if(!r)return null;const o=i.unstable_sxConfig??df;function u(l){let s=l;if(typeof l=="function")s=l(i);else if(typeof l!="object")return l;if(!s)return null;const c=X8(i.breakpoints),f=Object.keys(c);let d=c;return Object.keys(s).forEach(h=>{const v=N6(s[h],i);if(v!=null)if(typeof v=="object")if(o[h])d=al(d,e(h,v,i,o));else{const m=Qr({theme:i},v,D=>({[h]:D}));F6(m,v)?d[h]=t({sx:v,theme:i,nested:!0}):d=al(d,m)}else d=al(d,e(h,v,i,o))}),!a&&i.modularCssLayers?{"@layer sx":M2(i,B2(f,d))}:M2(i,B2(f,d))}return Array.isArray(r)?r.map(u):u(r)}return t}const Bo=R6();Bo.filterProps=["sx"];function O6(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let r=n.getColorSchemeSelector(e);return r==="&"?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function O2(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:a={},...o}=e,u=H8(n),l=R2(i);let s=On({breakpoints:u,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...G8,...a}},o);return s=V8(s),s.applyStyles=O6,s=t.reduce((c,f)=>On(c,f),s),s.unstable_sxConfig={...df,...o?.unstable_sxConfig},s.unstable_sx=function(f){return Bo({sx:f,theme:this})},s}const z2=e=>e,z6=(()=>{let e=z2;return{configure(t){e=t},generate(t){return e(t)},reset(){e=z2}}})();function U2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=U2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function at(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=U2(e))&&(r&&(r+=" "),r+=t);return r}const U6={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function yn(e,t,n="Mui"){const r=U6[t];return r?`${n}-${r}`:`${z6.generate(e)}-${t}`}function bn(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=yn(e,i,n)}),r}function I2(e){const{variants:t,...n}=e,r={variants:t,style:sa(n),isProcessed:!0};return r.style===n||t&&t.forEach(i=>{typeof i.style!="function"&&(i.style=sa(i.style))}),r}const I6=O2();function vm(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function ca(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function $6(e){return e?(t,n)=>n[e]:null}function k6(e,t,n){e.theme=H6(e.theme)?n:e.theme[t]||e.theme}function hf(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(i=>hf(e,i,n));if(Array.isArray(r?.variants)){let i;if(r.isProcessed)i=n?ca(r.style,n):r.style;else{const{variants:a,...o}=r;i=n?ca(sa(o),n):o}return $2(e,r.variants,[i],n)}return r?.isProcessed?n?ca(sa(r.style),n):r.style:n?ca(sa(r),n):r}function $2(e,t,n=[],r=void 0){let i;e:for(let a=0;a<t.length;a+=1){const o=t[a];if(typeof o.props=="function"){if(i??={...e,...e.ownerState,ownerState:e.ownerState},!o.props(i))continue}else for(const u in o.props)if(e[u]!==o.props[u]&&e.ownerState?.[u]!==o.props[u])continue e;typeof o.style=="function"?(i??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?ca(sa(o.style(i)),r):o.style(i))):n.push(r?ca(sa(o.style),r):o.style)}return n}function L6(e={}){const{themeId:t,defaultTheme:n=I6,rootShouldForwardProp:r=vm,slotShouldForwardProp:i=vm}=e;function a(u){k6(u,t,n)}return(u,l={})=>{$8(u,b=>b.filter(E=>E!==Bo));const{name:s,slot:c,skipVariantsResolver:f,skipSx:d,overridesResolver:h=$6(q6(c)),...v}=l,m=s&&s.startsWith("Mui")||c?"components":"custom",D=f!==void 0?f:c&&c!=="Root"&&c!=="root"||!1,p=d||!1;let g=vm;c==="Root"||c==="root"?g=r:c?g=i:P6(u)&&(g=void 0);const y=I8(u,{shouldForwardProp:g,label:j6(),...v}),S=b=>{if(b.__emotion_real===b)return b;if(typeof b=="function")return function(C){return hf(C,b,C.theme.modularCssLayers?m:void 0)};if(Zr(b)){const E=I2(b);return function(A){return E.variants?hf(A,E,A.theme.modularCssLayers?m:void 0):A.theme.modularCssLayers?ca(E.style,m):E.style}}return b},w=(...b)=>{const E=[],C=b.map(S),A=[];if(E.push(a),s&&h&&A.push(function(F){const z=F.theme.components?.[s]?.styleOverrides;if(!z)return null;const N={};for(const U in z)N[U]=hf(F,z[U],F.theme.modularCssLayers?"theme":void 0);return h(F,N)}),s&&!D&&A.push(function(F){const z=F.theme?.components?.[s]?.variants;return z?$2(F,z,[],F.theme.modularCssLayers?"theme":void 0):null}),p||A.push(Bo),Array.isArray(C[0])){const x=C.shift(),F=new Array(E.length).fill(""),R=new Array(A.length).fill("");let z;z=[...F,...x,...R],z.raw=[...F,...x.raw,...R],E.unshift(z)}const T=[...E,...C,...A],_=y(...T);return u.muiName&&(_.muiName=u.muiName),_};return y.withConfig&&(w.withConfig=y.withConfig),w}}function j6(e,t){return void 0}function H6(e){for(const t in e)return!1;return!0}function P6(e){return typeof e=="string"&&e.charCodeAt(0)>96}function q6(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function ym(e,t,n=!1){const r={...t};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const a=i;if(a==="components"||a==="slots")r[a]={...e[a],...r[a]};else if(a==="componentsProps"||a==="slotProps"){const o=e[a],u=t[a];if(!u)r[a]=o||{};else if(!o)r[a]=u;else{r[a]={...u};for(const l in o)if(Object.prototype.hasOwnProperty.call(o,l)){const s=l;r[a][s]=ym(o[s],u[s],n)}}}else a==="className"&&n&&t.className?r.className=at(e?.className,t?.className):a==="style"&&n&&t.style?r.style={...e?.style,...t?.style}:r[a]===void 0&&(r[a]=e[a])}return r}const V6=typeof window<"u"?M.useLayoutEffect:M.useEffect;function G6(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function bm(e,t=0,n=1){return G6(e,t,n)}function Y6(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function zi(e){if(e.type)return e;if(e.charAt(0)==="#")return zi(Y6(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(la(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(la(10,i))}else r=r.split(",");return r=r.map(a=>parseFloat(a)),{type:n,values:r,colorSpace:i}}const X6=e=>{const t=zi(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},ll=(e,t)=>{try{return X6(e)}catch{return e}};function mf(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,a)=>a<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function k2(e){e=zi(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),o=(s,c=(s+n/30)%12)=>i-a*Math.max(Math.min(c-3,9-c,1),-1);let u="rgb";const l=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type==="hsla"&&(u+="a",l.push(t[3])),mf({type:u,values:l})}function Dm(e){e=zi(e);let t=e.type==="hsl"||e.type==="hsla"?zi(k2(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Z6(e,t){const n=Dm(e),r=Dm(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function L2(e,t){return e=zi(e),t=bm(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,mf(e)}function fa(e,t,n){try{return L2(e,t)}catch{return e}}function pf(e,t){if(e=zi(e),t=bm(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return mf(e)}function Ye(e,t,n){try{return pf(e,t)}catch{return e}}function gf(e,t){if(e=zi(e),t=bm(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return mf(e)}function Xe(e,t,n){try{return gf(e,t)}catch{return e}}function Q6(e,t=.15){return Dm(e)>.5?pf(e,t):gf(e,t)}function vf(e,t,n){try{return Q6(e,t)}catch{return e}}const K6=M.createContext(void 0);function W6(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?ym(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?ym(i,r,t.components.mergeClassNameAndStyle):r}function J6({props:e,name:t}){const n=M.useContext(K6);return W6({props:e,name:t,theme:{components:n}})}let j2=0;function e9(e){const[t,n]=M.useState(e),r=e||t;return M.useEffect(()=>{t==null&&(j2+=1,n(`mui-${j2}`))},[t]),r}const H2={...Lf}.useId;function t9(e){if(H2!==void 0){const t=H2();return e??t}return e9(e)}const P2={theme:void 0};function n9(e){let t,n;return function(i){let a=t;return(a===void 0||i.theme!==n)&&(P2.theme=i.theme,a=I2(e(P2)),t=a,n=i.theme),a}}function r9(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const q2=(e,t,n,r=[])=>{let i=e;t.forEach((a,o)=>{o===t.length-1?Array.isArray(i)?i[Number(a)]=n:i&&typeof i=="object"&&(i[a]=n):i&&typeof i=="object"&&(i[a]||(i[a]=r.includes(a)?[]:{}),i=i[a])})},i9=(e,t,n)=>{function r(i,a=[],o=[]){Object.entries(i).forEach(([u,l])=>{(!n||n&&!n([...a,u]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...a,u],Array.isArray(l)?[...o,u]:o):t([...a,u],l,o))})}r(e)},a9=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Sm(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},a={},o={};return i9(e,(u,l,s)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(u,l))){const c=`--${n?`${n}-`:""}${u.join("-")}`,f=a9(u,l);Object.assign(i,{[c]:f}),q2(a,u,`var(${c})`,s),q2(o,u,`var(${c}, ${f})`,s)}},u=>u[0]==="vars"),{css:i,vars:a,varsWithDefaults:o}}function o9(e,t={}){const{getSelector:n=p,disableCssColorScheme:r,colorSchemeSelector:i,enableContrastVars:a}=t,{colorSchemes:o={},components:u,defaultColorScheme:l="light",...s}=e,{vars:c,css:f,varsWithDefaults:d}=Sm(s,t);let h=d;const v={},{[l]:m,...D}=o;if(Object.entries(D||{}).forEach(([S,w])=>{const{vars:b,css:E,varsWithDefaults:C}=Sm(w,t);h=On(h,C),v[S]={css:E,vars:b}}),m){const{css:S,vars:w,varsWithDefaults:b}=Sm(m,t);h=On(h,b),v[l]={css:S,vars:w}}function p(S,w){let b=i;if(i==="class"&&(b=".%s"),i==="data"&&(b="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(b=`[${i}="%s"]`),S){if(b==="media")return e.defaultColorScheme===S?":root":{[`@media (prefers-color-scheme: ${o[S]?.palette?.mode||S})`]:{":root":w}};if(b)return e.defaultColorScheme===S?`:root, ${b.replace("%s",String(S))}`:b.replace("%s",String(S))}return":root"}return{vars:h,generateThemeVars:()=>{let S={...c};return Object.entries(v).forEach(([,{vars:w}])=>{S=On(S,w)}),S},generateStyleSheets:()=>{const S=[],w=e.defaultColorScheme||"light";function b(A,T){Object.keys(T).length&&S.push(typeof A=="string"?{[A]:{...T}}:A)}b(n(void 0,{...f}),f);const{[w]:E,...C}=v;if(E){const{css:A}=E,T=o[w]?.palette?.mode,_=!r&&T?{colorScheme:T,...A}:{...A};b(n(w,{..._}),_)}return Object.entries(C).forEach(([A,{css:T}])=>{const _=o[A]?.palette?.mode,x=!r&&_?{colorScheme:_,...T}:{...T};b(n(A,{...x}),x)}),a&&S.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),S}}}function u9(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}function Un(e,t,n=void 0){const r={};for(const i in e){const a=e[i];let o="",u=!0;for(let l=0;l<a.length;l+=1){const s=a[l];s&&(o+=(u===!0?"":" ")+t(s),u=!1,n&&n[s]&&(o+=" "+n[s]))}r[i]=o}return r}function V2(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Ku.white,default:Ku.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const G2=V2();function Y2(){return{text:{primary:Ku.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Ku.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const xm=Y2();function X2(e,t,n,r){const i=r.light||r,a=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=gf(e.main,i):t==="dark"&&(e.dark=pf(e.main,a)))}function Z2(e,t,n,r,i){const a=i.light||i,o=i.dark||i*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(a*100).toFixed(0)}%)`:n==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(o*100).toFixed(0)}%)`))}function l9(e="light"){return e==="dark"?{main:wo[200],light:wo[50],dark:wo[400]}:{main:wo[700],light:wo[400],dark:wo[800]}}function s9(e="light"){return e==="dark"?{main:xo[200],light:xo[50],dark:xo[400]}:{main:xo[500],light:xo[300],dark:xo[700]}}function c9(e="light"){return e==="dark"?{main:So[500],light:So[300],dark:So[700]}:{main:So[700],light:So[400],dark:So[800]}}function f9(e="light"){return e==="dark"?{main:Eo[400],light:Eo[300],dark:Eo[700]}:{main:Eo[700],light:Eo[500],dark:Eo[900]}}function d9(e="light"){return e==="dark"?{main:Ao[400],light:Ao[300],dark:Ao[700]}:{main:Ao[800],light:Ao[500],dark:Ao[900]}}function h9(e="light"){return e==="dark"?{main:Wu[400],light:Wu[300],dark:Wu[700]}:{main:"#ed6c02",light:Wu[500],dark:Wu[900]}}function m9(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function wm(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:i,...a}=e,o=e.primary||l9(t),u=e.secondary||s9(t),l=e.error||c9(t),s=e.info||f9(t),c=e.success||d9(t),f=e.warning||h9(t);function d(D){return i?m9(D):Z6(D,xm.text.primary)>=n?xm.text.primary:G2.text.primary}const h=({color:D,name:p,mainShade:g=500,lightShade:y=300,darkShade:S=700})=>{if(D={...D},!D.main&&D[g]&&(D.main=D[g]),!D.hasOwnProperty("main"))throw new Error(la(11,p?` (${p})`:"",g));if(typeof D.main!="string")throw new Error(la(12,p?` (${p})`:"",JSON.stringify(D.main)));return i?(Z2(i,D,"light",y,r),Z2(i,D,"dark",S,r)):(X2(D,"light",y,r),X2(D,"dark",S,r)),D.contrastText||(D.contrastText=d(D.main)),D};let v;return t==="light"?v=V2():t==="dark"&&(v=Y2()),On({common:{...Ku},mode:t,primary:h({color:o,name:"primary"}),secondary:h({color:u,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:l,name:"error"}),warning:h({color:f,name:"warning"}),info:h({color:s,name:"info"}),success:h({color:c,name:"success"}),grey:R_,contrastThreshold:n,getContrastText:d,augmentColor:h,tonalOffset:r,...v},a)}function p9(e){const t={};return Object.entries(e).forEach(r=>{const[i,a]=r;typeof a=="object"&&(t[i]=`${a.fontStyle?`${a.fontStyle} `:""}${a.fontVariant?`${a.fontVariant} `:""}${a.fontWeight?`${a.fontWeight} `:""}${a.fontStretch?`${a.fontStretch} `:""}${a.fontSize||""}${a.lineHeight?`/${a.lineHeight} `:""}${a.fontFamily||""}`)}),t}function g9(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function v9(e){return Math.round(e*1e5)/1e5}const Q2={textTransform:"uppercase"},K2='"Roboto", "Helvetica", "Arial", sans-serif';function y9(e,t){const{fontFamily:n=K2,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:u=700,htmlFontSize:l=16,allVariants:s,pxToRem:c,...f}=typeof t=="function"?t(e):t,d=r/14,h=c||(D=>`${D/l*d}rem`),v=(D,p,g,y,S)=>({fontFamily:n,fontWeight:D,fontSize:h(p),lineHeight:g,...n===K2?{letterSpacing:`${v9(y/p)}em`}:{},...S,...s}),m={h1:v(i,96,1.167,-1.5),h2:v(i,60,1.2,-.5),h3:v(a,48,1.167,0),h4:v(a,34,1.235,.25),h5:v(a,24,1.334,0),h6:v(o,20,1.6,.15),subtitle1:v(a,16,1.75,.15),subtitle2:v(o,14,1.57,.1),body1:v(a,16,1.5,.15),body2:v(a,14,1.43,.15),button:v(o,14,1.75,.4,Q2),caption:v(a,12,1.66,.4),overline:v(a,12,2.66,1,Q2),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return On({htmlFontSize:l,pxToRem:h,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:u,...m},f,{clone:!1})}const b9=.2,D9=.14,S9=.12;function pt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${b9})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${D9})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${S9})`].join(",")}const x9=["none",pt(0,2,1,-1,0,1,1,0,0,1,3,0),pt(0,3,1,-2,0,2,2,0,0,1,5,0),pt(0,3,3,-2,0,3,4,0,0,1,8,0),pt(0,2,4,-1,0,4,5,0,0,1,10,0),pt(0,3,5,-1,0,5,8,0,0,1,14,0),pt(0,3,5,-1,0,6,10,0,0,1,18,0),pt(0,4,5,-2,0,7,10,1,0,2,16,1),pt(0,5,5,-3,0,8,10,1,0,3,14,2),pt(0,5,6,-3,0,9,12,1,0,3,16,2),pt(0,6,6,-3,0,10,14,1,0,4,18,3),pt(0,6,7,-4,0,11,15,1,0,4,20,3),pt(0,7,8,-4,0,12,17,2,0,5,22,4),pt(0,7,8,-4,0,13,19,2,0,5,24,4),pt(0,7,9,-4,0,14,21,2,0,5,26,4),pt(0,8,9,-5,0,15,22,2,0,6,28,5),pt(0,8,10,-5,0,16,24,2,0,6,30,5),pt(0,8,11,-5,0,17,26,2,0,6,32,5),pt(0,9,11,-5,0,18,28,2,0,7,34,6),pt(0,9,12,-6,0,19,29,2,0,7,36,6),pt(0,10,13,-6,0,20,31,3,0,8,38,7),pt(0,10,13,-6,0,21,33,3,0,8,40,7),pt(0,10,14,-6,0,22,35,3,0,8,42,7),pt(0,11,14,-7,0,23,36,3,0,9,44,8),pt(0,11,15,-7,0,24,38,3,0,9,46,8)],w9={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},E9={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function W2(e){return`${Math.round(e)}ms`}function A9(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function C9(e){const t={...w9,...e.easing},n={...E9,...e.duration};return{getAutoHeightDuration:A9,create:(i=["all"],a={})=>{const{duration:o=n.standard,easing:u=t.easeInOut,delay:l=0,...s}=a;return(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof o=="string"?o:W2(o)} ${u} ${typeof l=="string"?l:W2(l)}`).join(",")},...e,easing:t,duration:n}}const T9={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function M9(e){return Zr(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function J2(e={}){const t={...e};function n(r){const i=Object.entries(r);for(let a=0;a<i.length;a++){const[o,u]=i[a];!M9(u)||o.startsWith("unstable_")?delete r[o]:Zr(u)&&(r[o]={...u},n(r[o]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
95
83
|
|
|
96
84
|
const theme = ${JSON.stringify(t,null,2)};
|
|
97
85
|
|
|
98
86
|
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
99
87
|
theme.transitions = createTransitions(theme.transitions || {});
|
|
100
88
|
|
|
101
|
-
export default theme;`}function Kw(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const vF=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;r<t.length;r+=1)n+=+t[r];return n};function yF(e){Object.assign(e,{alpha(t,n){const r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:Uw(t,vF(n))},lighten(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${Kw(n)})`:nd(t,n)},darken(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${Kw(n)})`:td(t,n)}})}function Np(e={},...t){const{breakpoints:n,mixins:r={},spacing:i,palette:a={},transitions:o={},typography:u={},shape:l,colorSpace:s,...c}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(_a(20));const f=Bp({...a,colorSpace:s}),d=Bw(e);let h=Hn(d,{mixins:iF(d.breakpoints,r),palette:f,shadows:cF.slice(),typography:oF(f,u),transitions:mF(o),zIndex:{...pF}});return h=Hn(h,c),h=t.reduce((g,m)=>Hn(g,m),h),h.unstable_sxConfig={...Wf,...c?.unstable_sxConfig},h.unstable_sx=function(m){return ou({sx:m,theme:this})},h.toRuntimeSource=Zw,yF(h),h}function bF(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const DF=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=bF(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Qw(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function Ww(e){return e==="dark"?DF:[]}function SF(e){const{palette:t={mode:"light"},opacity:n,overlays:r,colorSpace:i,...a}=e,o=Bp({...t,colorSpace:i});return{palette:o,opacity:{...Qw(o.mode),...n},overlays:r||Ww(o.mode),...a}}function wF(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const xF=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],EF=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let a=i;if(i==="class"&&(a=".%s"),i==="data"&&(a="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(a=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const o={};return xF(e.cssVarPrefix).forEach(u=>{o[u]=n[u],delete n[u]}),a==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:o}}:a?{[a.replace("%s",t)]:o,[`${r}, ${a.replace("%s",t)}`]:n}:{[r]:{...n,...o}}}if(a&&a!=="media")return`${r}, ${a.replace("%s",String(t))}`}else if(t){if(a==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(a)return a.replace("%s",String(t))}return r};function AF(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function Q(e,t,n){!e[t]&&n&&(e[t]=n)}function Ll(e){return typeof e!="string"||!e.startsWith("hsl")?e:zw(e)}function pi(e,t){`${t}Channel`in e||(e[`${t}Channel`]=kl(Ll(e[t])))}function CF(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const jr=e=>{try{return e()}catch{}},MF=(e="mui")=>GN(e);function Fp(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;const a=i==="dark"?"dark":"light";if(!r){t[i]=SF({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}const{palette:o,...u}=Np({...r,palette:{mode:a,...n?.palette},colorSpace:e});return t[i]={...n,palette:o,opacity:{...Qw(a),...n?.opacity},overlays:n?.overlays||Ww(a)},u}function TF(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:a="mui",nativeColor:o=!1,shouldSkipGeneratingVar:u=wF,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:s=":root",...c}=e,f=Object.keys(n)[0],d=r||(n.light&&f!=="light"?"light":f),h=MF(a),{[d]:g,light:m,dark:D,...p}=n,v={...p};let y=g;if((d==="dark"&&!("dark"in n)||d==="light"&&!("light"in n))&&(y=!0),!y)throw new Error(_a(21,d));let w;o&&(w="oklch");const E=Fp(w,v,y,c,d);m&&!v.light&&Fp(w,v,m,void 0,"light"),D&&!v.dark&&Fp(w,v,D,void 0,"dark");let b={defaultColorScheme:d,...E,cssVarPrefix:a,colorSchemeSelector:l,rootSelector:s,getCssVar:h,colorSchemes:v,font:{...rF(E.typography),...E.font},spacing:CF(c.spacing)};Object.keys(b.colorSchemes).forEach(T=>{const x=b.colorSchemes[T].palette,N=z=>{const F=z.split("-"),U=F[1],I=F[2];return h(z,x[U][I])};x.mode==="light"&&(Q(x.common,"background","#fff"),Q(x.common,"onBackground","#000")),x.mode==="dark"&&(Q(x.common,"background","#000"),Q(x.common,"onBackground","#fff"));function R(z,F,U){if(w){let I;return z===Fa&&(I=`transparent ${((1-U)*100).toFixed(0)}%`),z===We&&(I=`#000 ${(U*100).toFixed(0)}%`),z===Je&&(I=`#fff ${(U*100).toFixed(0)}%`),`color-mix(in ${w}, ${F}, ${I})`}return z(F,U)}if(AF(x,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),x.mode==="light"){Q(x.Alert,"errorColor",R(We,x.error.light,.6)),Q(x.Alert,"infoColor",R(We,x.info.light,.6)),Q(x.Alert,"successColor",R(We,x.success.light,.6)),Q(x.Alert,"warningColor",R(We,x.warning.light,.6)),Q(x.Alert,"errorFilledBg",N("palette-error-main")),Q(x.Alert,"infoFilledBg",N("palette-info-main")),Q(x.Alert,"successFilledBg",N("palette-success-main")),Q(x.Alert,"warningFilledBg",N("palette-warning-main")),Q(x.Alert,"errorFilledColor",jr(()=>x.getContrastText(x.error.main))),Q(x.Alert,"infoFilledColor",jr(()=>x.getContrastText(x.info.main))),Q(x.Alert,"successFilledColor",jr(()=>x.getContrastText(x.success.main))),Q(x.Alert,"warningFilledColor",jr(()=>x.getContrastText(x.warning.main))),Q(x.Alert,"errorStandardBg",R(Je,x.error.light,.9)),Q(x.Alert,"infoStandardBg",R(Je,x.info.light,.9)),Q(x.Alert,"successStandardBg",R(Je,x.success.light,.9)),Q(x.Alert,"warningStandardBg",R(Je,x.warning.light,.9)),Q(x.Alert,"errorIconColor",N("palette-error-main")),Q(x.Alert,"infoIconColor",N("palette-info-main")),Q(x.Alert,"successIconColor",N("palette-success-main")),Q(x.Alert,"warningIconColor",N("palette-warning-main")),Q(x.AppBar,"defaultBg",N("palette-grey-100")),Q(x.Avatar,"defaultBg",N("palette-grey-400")),Q(x.Button,"inheritContainedBg",N("palette-grey-300")),Q(x.Button,"inheritContainedHoverBg",N("palette-grey-A100")),Q(x.Chip,"defaultBorder",N("palette-grey-400")),Q(x.Chip,"defaultAvatarColor",N("palette-grey-700")),Q(x.Chip,"defaultIconColor",N("palette-grey-700")),Q(x.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),Q(x.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),Q(x.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),Q(x.LinearProgress,"primaryBg",R(Je,x.primary.main,.62)),Q(x.LinearProgress,"secondaryBg",R(Je,x.secondary.main,.62)),Q(x.LinearProgress,"errorBg",R(Je,x.error.main,.62)),Q(x.LinearProgress,"infoBg",R(Je,x.info.main,.62)),Q(x.LinearProgress,"successBg",R(Je,x.success.main,.62)),Q(x.LinearProgress,"warningBg",R(Je,x.warning.main,.62)),Q(x.Skeleton,"bg",w?R(Fa,x.text.primary,.11):`rgba(${N("palette-text-primaryChannel")} / 0.11)`),Q(x.Slider,"primaryTrack",R(Je,x.primary.main,.62)),Q(x.Slider,"secondaryTrack",R(Je,x.secondary.main,.62)),Q(x.Slider,"errorTrack",R(Je,x.error.main,.62)),Q(x.Slider,"infoTrack",R(Je,x.info.main,.62)),Q(x.Slider,"successTrack",R(Je,x.success.main,.62)),Q(x.Slider,"warningTrack",R(Je,x.warning.main,.62));const z=w?R(We,x.background.default,.6825):rd(x.background.default,.8);Q(x.SnackbarContent,"bg",z),Q(x.SnackbarContent,"color",jr(()=>w?_p.text.primary:x.getContrastText(z))),Q(x.SpeedDialAction,"fabHoverBg",rd(x.background.paper,.15)),Q(x.StepConnector,"border",N("palette-grey-400")),Q(x.StepContent,"border",N("palette-grey-400")),Q(x.Switch,"defaultColor",N("palette-common-white")),Q(x.Switch,"defaultDisabledColor",N("palette-grey-100")),Q(x.Switch,"primaryDisabledColor",R(Je,x.primary.main,.62)),Q(x.Switch,"secondaryDisabledColor",R(Je,x.secondary.main,.62)),Q(x.Switch,"errorDisabledColor",R(Je,x.error.main,.62)),Q(x.Switch,"infoDisabledColor",R(Je,x.info.main,.62)),Q(x.Switch,"successDisabledColor",R(Je,x.success.main,.62)),Q(x.Switch,"warningDisabledColor",R(Je,x.warning.main,.62)),Q(x.TableCell,"border",R(Je,R(Fa,x.divider,1),.88)),Q(x.Tooltip,"bg",R(Fa,x.grey[700],.92))}if(x.mode==="dark"){Q(x.Alert,"errorColor",R(Je,x.error.light,.6)),Q(x.Alert,"infoColor",R(Je,x.info.light,.6)),Q(x.Alert,"successColor",R(Je,x.success.light,.6)),Q(x.Alert,"warningColor",R(Je,x.warning.light,.6)),Q(x.Alert,"errorFilledBg",N("palette-error-dark")),Q(x.Alert,"infoFilledBg",N("palette-info-dark")),Q(x.Alert,"successFilledBg",N("palette-success-dark")),Q(x.Alert,"warningFilledBg",N("palette-warning-dark")),Q(x.Alert,"errorFilledColor",jr(()=>x.getContrastText(x.error.dark))),Q(x.Alert,"infoFilledColor",jr(()=>x.getContrastText(x.info.dark))),Q(x.Alert,"successFilledColor",jr(()=>x.getContrastText(x.success.dark))),Q(x.Alert,"warningFilledColor",jr(()=>x.getContrastText(x.warning.dark))),Q(x.Alert,"errorStandardBg",R(We,x.error.light,.9)),Q(x.Alert,"infoStandardBg",R(We,x.info.light,.9)),Q(x.Alert,"successStandardBg",R(We,x.success.light,.9)),Q(x.Alert,"warningStandardBg",R(We,x.warning.light,.9)),Q(x.Alert,"errorIconColor",N("palette-error-main")),Q(x.Alert,"infoIconColor",N("palette-info-main")),Q(x.Alert,"successIconColor",N("palette-success-main")),Q(x.Alert,"warningIconColor",N("palette-warning-main")),Q(x.AppBar,"defaultBg",N("palette-grey-900")),Q(x.AppBar,"darkBg",N("palette-background-paper")),Q(x.AppBar,"darkColor",N("palette-text-primary")),Q(x.Avatar,"defaultBg",N("palette-grey-600")),Q(x.Button,"inheritContainedBg",N("palette-grey-800")),Q(x.Button,"inheritContainedHoverBg",N("palette-grey-700")),Q(x.Chip,"defaultBorder",N("palette-grey-700")),Q(x.Chip,"defaultAvatarColor",N("palette-grey-300")),Q(x.Chip,"defaultIconColor",N("palette-grey-300")),Q(x.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),Q(x.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),Q(x.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),Q(x.LinearProgress,"primaryBg",R(We,x.primary.main,.5)),Q(x.LinearProgress,"secondaryBg",R(We,x.secondary.main,.5)),Q(x.LinearProgress,"errorBg",R(We,x.error.main,.5)),Q(x.LinearProgress,"infoBg",R(We,x.info.main,.5)),Q(x.LinearProgress,"successBg",R(We,x.success.main,.5)),Q(x.LinearProgress,"warningBg",R(We,x.warning.main,.5)),Q(x.Skeleton,"bg",w?R(Fa,x.text.primary,.13):`rgba(${N("palette-text-primaryChannel")} / 0.13)`),Q(x.Slider,"primaryTrack",R(We,x.primary.main,.5)),Q(x.Slider,"secondaryTrack",R(We,x.secondary.main,.5)),Q(x.Slider,"errorTrack",R(We,x.error.main,.5)),Q(x.Slider,"infoTrack",R(We,x.info.main,.5)),Q(x.Slider,"successTrack",R(We,x.success.main,.5)),Q(x.Slider,"warningTrack",R(We,x.warning.main,.5));const z=w?R(Je,x.background.default,.985):rd(x.background.default,.98);Q(x.SnackbarContent,"bg",z),Q(x.SnackbarContent,"color",jr(()=>w?Pw.text.primary:x.getContrastText(z))),Q(x.SpeedDialAction,"fabHoverBg",rd(x.background.paper,.15)),Q(x.StepConnector,"border",N("palette-grey-600")),Q(x.StepContent,"border",N("palette-grey-600")),Q(x.Switch,"defaultColor",N("palette-grey-300")),Q(x.Switch,"defaultDisabledColor",N("palette-grey-600")),Q(x.Switch,"primaryDisabledColor",R(We,x.primary.main,.55)),Q(x.Switch,"secondaryDisabledColor",R(We,x.secondary.main,.55)),Q(x.Switch,"errorDisabledColor",R(We,x.error.main,.55)),Q(x.Switch,"infoDisabledColor",R(We,x.info.main,.55)),Q(x.Switch,"successDisabledColor",R(We,x.success.main,.55)),Q(x.Switch,"warningDisabledColor",R(We,x.warning.main,.55)),Q(x.TableCell,"border",R(We,R(Fa,x.divider,1),.68)),Q(x.Tooltip,"bg",R(Fa,x.grey[700],.92))}pi(x.background,"default"),pi(x.background,"paper"),pi(x.common,"background"),pi(x.common,"onBackground"),pi(x,"divider"),Object.keys(x).forEach(z=>{const F=x[z];z!=="tonalOffset"&&F&&typeof F=="object"&&(F.main&&Q(x[z],"mainChannel",kl(Ll(F.main))),F.light&&Q(x[z],"lightChannel",kl(Ll(F.light))),F.dark&&Q(x[z],"darkChannel",kl(Ll(F.dark))),F.contrastText&&Q(x[z],"contrastTextChannel",kl(Ll(F.contrastText))),z==="text"&&(pi(x[z],"primary"),pi(x[z],"secondary")),z==="action"&&(F.active&&pi(x[z],"active"),F.selected&&pi(x[z],"selected")))})}),b=t.reduce((T,x)=>Hn(T,x),b);const S={prefix:a,disableCssColorScheme:i,shouldSkipGeneratingVar:u,getSelector:EF(b),enableContrastVars:o},{vars:A,generateThemeVars:C,generateStyleSheets:M}=XN(b,S);return b.vars=A,Object.entries(b.colorSchemes[b.defaultColorScheme]).forEach(([T,x])=>{b[T]=x}),b.generateThemeVars=C,b.generateStyleSheets=M,b.generateSpacing=function(){return _w(c.spacing,wp(this))},b.getColorSchemeSelector=ZN(l),b.spacing=b.generateSpacing(),b.shouldSkipGeneratingVar=u,b.unstable_sxConfig={...Wf,...c?.unstable_sxConfig},b.unstable_sx=function(x){return ou({sx:x,theme:this})},b.toRuntimeSource=Zw,b}function Jw(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Bp({...n===!0?{}:n.palette,mode:t})})}function _F(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...o}=e,u=a||"light",l=i?.[u],s={...i,...n?{[u]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return Np(e,...t);let c=n;"palette"in e||s[u]&&(s[u]!==!0?c=s[u].palette:u==="dark"&&(c={mode:"dark"}));const f=Np({...e,palette:c},...t);return f.defaultColorScheme=u,f.colorSchemes=s,f.palette.mode==="light"&&(f.colorSchemes.light={...s.light!==!0&&s.light,palette:f.palette},Jw(f,"dark",s.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...s.dark!==!0&&s.dark,palette:f.palette},Jw(f,"light",s.light)),f}return!n&&!("light"in s)&&u==="light"&&(s.light=!0),TF({...o,colorSchemes:s,defaultColorScheme:u,...typeof r!="boolean"&&r},...t)}const BF=_F();function NF(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Rp=e=>NF(e)&&e!=="classes",Tt=TN({themeId:w7,defaultTheme:BF,rootShouldForwardProp:Rp}),Vn=qN;function Yn(e){return jN(e)}function FF(e){return Mn("MuiSvgIcon",e)}Tn("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const RF=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${je(t)}`,`fontSize${je(n)}`]};return Gn(i,FF,r)},OF=Tt("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${je(n.color)}`],t[`fontSize${je(n.fontSize)}`]]}})(Vn(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),Op=_.forwardRef(function(t,n){const r=Yn({props:t,name:"MuiSvgIcon"}),{children:i,className:a,color:o="inherit",component:u="svg",fontSize:l="medium",htmlColor:s,inheritViewBox:c=!1,titleAccess:f,viewBox:d="0 0 24 24",...h}=r,g=_.isValidElement(i)&&i.type==="svg",m={...r,color:o,component:u,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:c,viewBox:d,hasSvgAsChild:g},D={};c||(D.viewBox=d);const p=RF(m);return B.jsxs(OF,{as:u,className:ct(p.root,a),focusable:"false",color:s,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...D,...h,...g&&i.props,ownerState:m,children:[g?i.props.children:i,f?B.jsx("title",{children:f}):null]})});Op.muiName="SvgIcon";function zp(e,t){function n(r,i){return B.jsx(Op,{"data-testid":void 0,ref:i,...r,children:e})}return n.muiName=Op.muiName,_.memo(_.forwardRef(n))}function zF(e){const{controlled:t,default:n}=e,{current:r}=_.useRef(t!==void 0),[i,a]=_.useState(n),o=r?t:i,u=_.useCallback(l=>{r||a(l)},[]);return[o,u]}function id(e){const t=_.useRef(e);return RN(()=>{t.current=e}),_.useRef((...n)=>(0,t.current)(...n)).current}function Up(...e){const t=_.useRef(void 0),n=_.useCallback(r=>{const i=e.map(a=>{if(a==null)return null;if(typeof a=="function"){const o=a,u=o(r);return typeof u=="function"?u:()=>{o(null)}}return a.current=r,()=>{a.current=null}});return()=>{i.forEach(a=>a?.())}},e);return _.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}function UF(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function IF(e,t){if(!e)return t;function n(o,u){const l={};return Object.keys(u).forEach(s=>{UF(s,u[s])&&typeof o[s]=="function"&&(l[s]=(...c)=>{o[s](...c),u[s](...c)})}),l}if(typeof e=="function"||typeof t=="function")return o=>{const u=typeof t=="function"?t(o):t,l=typeof e=="function"?e({...o,...u}):e,s=ct(o?.className,u?.className,l?.className),c=n(l,u);return{...u,...l,...c,...!!s&&{className:s},...u?.style&&l?.style&&{style:{...u.style,...l.style}},...u?.sx&&l?.sx&&{sx:[...Array.isArray(u.sx)?u.sx:[u.sx],...Array.isArray(l.sx)?l.sx:[l.sx]]}}};const r=t,i=n(e,r),a=ct(r?.className,e?.className);return{...t,...e,...i,...!!a&&{className:a},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function $F(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ip(e,t){return Ip=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Ip(e,t)}function kF(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ip(e,t)}const ex=kt.createContext(null);function LF(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $p(e,t){var n=function(a){return t&&_.isValidElement(a)?t(a):a},r=Object.create(null);return e&&_.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function jF(e,t){e=e||{},t=t||{};function n(c){return c in t?t[c]:e[c]}var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,u={};for(var l in t){if(r[l])for(o=0;o<r[l].length;o++){var s=r[l][o];u[r[l][o]]=n(s)}u[l]=n(l)}for(o=0;o<i.length;o++)u[i[o]]=n(i[o]);return u}function Ra(e,t,n){return n[t]!=null?n[t]:e.props[t]}function PF(e,t){return $p(e.children,function(n){return _.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Ra(n,"appear",e),enter:Ra(n,"enter",e),exit:Ra(n,"exit",e)})})}function HF(e,t,n){var r=$p(e.children),i=jF(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if(_.isValidElement(o)){var u=a in t,l=a in r,s=t[a],c=_.isValidElement(s)&&!s.props.in;l&&(!u||c)?i[a]=_.cloneElement(o,{onExited:n.bind(null,o),in:!0,exit:Ra(o,"exit",e),enter:Ra(o,"enter",e)}):!l&&u&&!c?i[a]=_.cloneElement(o,{in:!1}):l&&u&&_.isValidElement(s)&&(i[a]=_.cloneElement(o,{onExited:n.bind(null,o),in:s.props.in,exit:Ra(o,"exit",e),enter:Ra(o,"enter",e)}))}}),i}var qF=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},GF={component:"div",childFactory:function(t){return t}},kp=function(e){kF(t,e);function t(r,i){var a;a=e.call(this,r,i)||this;var o=a.handleExited.bind(LF(a));return a.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},a}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(i,a){var o=a.children,u=a.handleExited,l=a.firstRender;return{children:l?PF(i,u):HF(i,o,u),firstRender:!1}},n.handleExited=function(i,a){var o=$p(this.props.children);i.key in o||(i.props.onExited&&i.props.onExited(a),this.mounted&&this.setState(function(u){var l=Vi({},u.children);return delete l[i.key],{children:l}}))},n.render=function(){var i=this.props,a=i.component,o=i.childFactory,u=$F(i,["component","childFactory"]),l=this.state.contextValue,s=qF(this.state.children).map(o);return delete u.appear,delete u.enter,delete u.exit,a===null?kt.createElement(ex.Provider,{value:l},s):kt.createElement(ex.Provider,{value:l},kt.createElement(a,u,s))},t}(kt.Component);kp.propTypes={},kp.defaultProps=GF;const tx={};function nx(e,t){const n=_.useRef(tx);return n.current===tx&&(n.current=e(t)),n}const VF=[];function YF(e){_.useEffect(e,VF)}class Lp{static create(){return new Lp}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function XF(){const e=nx(Lp.create).current;return YF(e.disposeEffect),e}function ZF(e){return typeof e=="string"}function KF(e,t,n){return e===void 0||ZF(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function QF(e,t,n){return typeof e=="function"?e(t,n):e}function WF(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function rx(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function JF(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){const h=ct(n?.className,a,i?.className,r?.className),g={...n?.style,...i?.style,...r?.style},m={...n,...i,...r};return h.length>0&&(m.className=h),Object.keys(g).length>0&&(m.style=g),{props:m,internalRef:void 0}}const o=WF({...i,...r}),u=rx(r),l=rx(i),s=t(o),c=ct(s?.className,n?.className,a,i?.className,r?.className),f={...s?.style,...n?.style,...i?.style,...r?.style},d={...s,...n,...l,...u};return c.length>0&&(d.className=c),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:s.ref}}function uu(e,t){const{className:n,elementType:r,ownerState:i,externalForwardedProps:a,internalForwardedProps:o,shouldForwardComponentProp:u=!1,...l}=t,{component:s,slots:c={[e]:void 0},slotProps:f={[e]:void 0},...d}=a,h=c[e]||r,g=QF(f[e],i),{props:{component:m,...D},internalRef:p}=JF({className:n,...l,externalForwardedProps:e==="root"?d:void 0,externalSlotProps:g}),v=Up(p,g?.ref,t.ref),y=e==="root"?m||s:m,w=KF(h,{...e==="root"&&!s&&!c[e]&&o,...e!=="root"&&!c[e]&&o,...D,...y&&!u&&{as:y},...y&&u&&{component:y},ref:v},i);return[h,w]}function ix(e){try{return e.matches(":focus-visible")}catch{}return!1}class ad{static create(){return new ad}static use(){const t=nx(ad.create).current,[n,r]=_.useState(!1);return t.shouldMount=n,t.setShouldMount=r,_.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=tR(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function eR(){return ad.use()}function tR(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function nR(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:a,rippleSize:o,in:u,onExited:l,timeout:s}=e,[c,f]=_.useState(!1),d=ct(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:o,height:o,top:-(o/2)+a,left:-(o/2)+i},g=ct(n.child,c&&n.childLeaving,r&&n.childPulsate);return!u&&!c&&f(!0),_.useEffect(()=>{if(!u&&l!=null){const m=setTimeout(l,s);return()=>{clearTimeout(m)}}},[l,u,s]),B.jsx("span",{className:d,style:h,children:B.jsx("span",{className:g})})}const fr=Tn("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),jp=550,rR=80,iR=zl`
|
|
89
|
+
export default theme;`}function eS(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const _9=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;r<t.length;r+=1)n+=+t[r];return n};function B9(e){Object.assign(e,{alpha(t,n){const r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:L2(t,_9(n))},lighten(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${eS(n)})`:gf(t,n)},darken(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${eS(n)})`:pf(t,n)}})}function Em(e={},...t){const{breakpoints:n,mixins:r={},spacing:i,palette:a={},transitions:o={},typography:u={},shape:l,colorSpace:s,...c}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(la(20));const f=wm({...a,colorSpace:s}),d=O2(e);let h=On(d,{mixins:g9(d.breakpoints,r),palette:f,shadows:x9.slice(),typography:y9(f,u),transitions:C9(o),zIndex:{...T9}});return h=On(h,c),h=t.reduce((v,m)=>On(v,m),h),h.unstable_sxConfig={...df,...c?.unstable_sxConfig},h.unstable_sx=function(m){return Bo({sx:m,theme:this})},h.toRuntimeSource=J2,B9(h),h}function F9(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const N9=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=F9(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function tS(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function nS(e){return e==="dark"?N9:[]}function R9(e){const{palette:t={mode:"light"},opacity:n,overlays:r,colorSpace:i,...a}=e,o=wm({...t,colorSpace:i});return{palette:o,opacity:{...tS(o.mode),...n},overlays:r||nS(o.mode),...a}}function O9(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const z9=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],U9=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let a=i;if(i==="class"&&(a=".%s"),i==="data"&&(a="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(a=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const o={};return z9(e.cssVarPrefix).forEach(u=>{o[u]=n[u],delete n[u]}),a==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:o}}:a?{[a.replace("%s",t)]:o,[`${r}, ${a.replace("%s",t)}`]:n}:{[r]:{...n,...o}}}if(a&&a!=="media")return`${r}, ${a.replace("%s",String(t))}`}else if(t){if(a==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(a)return a.replace("%s",String(t))}return r};function I9(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function K(e,t,n){!e[t]&&n&&(e[t]=n)}function sl(e){return typeof e!="string"||!e.startsWith("hsl")?e:k2(e)}function Kr(e,t){`${t}Channel`in e||(e[`${t}Channel`]=ll(sl(e[t])))}function $9(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Tr=e=>{try{return e()}catch{}},k9=(e="mui")=>r9(e);function Am(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;const a=i==="dark"?"dark":"light";if(!r){t[i]=R9({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}const{palette:o,...u}=Em({...r,palette:{mode:a,...n?.palette},colorSpace:e});return t[i]={...n,palette:o,opacity:{...tS(a),...n?.opacity},overlays:n?.overlays||nS(a)},u}function L9(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:a="mui",nativeColor:o=!1,shouldSkipGeneratingVar:u=O9,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:s=":root",...c}=e,f=Object.keys(n)[0],d=r||(n.light&&f!=="light"?"light":f),h=k9(a),{[d]:v,light:m,dark:D,...p}=n,g={...p};let y=v;if((d==="dark"&&!("dark"in n)||d==="light"&&!("light"in n))&&(y=!0),!y)throw new Error(la(21,d));let S;o&&(S="oklch");const w=Am(S,g,y,c,d);m&&!g.light&&Am(S,g,m,void 0,"light"),D&&!g.dark&&Am(S,g,D,void 0,"dark");let b={defaultColorScheme:d,...w,cssVarPrefix:a,colorSchemeSelector:l,rootSelector:s,getCssVar:h,colorSchemes:g,font:{...p9(w.typography),...w.font},spacing:$9(c.spacing)};Object.keys(b.colorSchemes).forEach(_=>{const x=b.colorSchemes[_].palette,F=z=>{const N=z.split("-"),U=N[1],I=N[2];return h(z,x[U][I])};x.mode==="light"&&(K(x.common,"background","#fff"),K(x.common,"onBackground","#000")),x.mode==="dark"&&(K(x.common,"background","#000"),K(x.common,"onBackground","#fff"));function R(z,N,U){if(S){let I;return z===fa&&(I=`transparent ${((1-U)*100).toFixed(0)}%`),z===Ye&&(I=`#000 ${(U*100).toFixed(0)}%`),z===Xe&&(I=`#fff ${(U*100).toFixed(0)}%`),`color-mix(in ${S}, ${N}, ${I})`}return z(N,U)}if(I9(x,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),x.mode==="light"){K(x.Alert,"errorColor",R(Ye,x.error.light,.6)),K(x.Alert,"infoColor",R(Ye,x.info.light,.6)),K(x.Alert,"successColor",R(Ye,x.success.light,.6)),K(x.Alert,"warningColor",R(Ye,x.warning.light,.6)),K(x.Alert,"errorFilledBg",F("palette-error-main")),K(x.Alert,"infoFilledBg",F("palette-info-main")),K(x.Alert,"successFilledBg",F("palette-success-main")),K(x.Alert,"warningFilledBg",F("palette-warning-main")),K(x.Alert,"errorFilledColor",Tr(()=>x.getContrastText(x.error.main))),K(x.Alert,"infoFilledColor",Tr(()=>x.getContrastText(x.info.main))),K(x.Alert,"successFilledColor",Tr(()=>x.getContrastText(x.success.main))),K(x.Alert,"warningFilledColor",Tr(()=>x.getContrastText(x.warning.main))),K(x.Alert,"errorStandardBg",R(Xe,x.error.light,.9)),K(x.Alert,"infoStandardBg",R(Xe,x.info.light,.9)),K(x.Alert,"successStandardBg",R(Xe,x.success.light,.9)),K(x.Alert,"warningStandardBg",R(Xe,x.warning.light,.9)),K(x.Alert,"errorIconColor",F("palette-error-main")),K(x.Alert,"infoIconColor",F("palette-info-main")),K(x.Alert,"successIconColor",F("palette-success-main")),K(x.Alert,"warningIconColor",F("palette-warning-main")),K(x.AppBar,"defaultBg",F("palette-grey-100")),K(x.Avatar,"defaultBg",F("palette-grey-400")),K(x.Button,"inheritContainedBg",F("palette-grey-300")),K(x.Button,"inheritContainedHoverBg",F("palette-grey-A100")),K(x.Chip,"defaultBorder",F("palette-grey-400")),K(x.Chip,"defaultAvatarColor",F("palette-grey-700")),K(x.Chip,"defaultIconColor",F("palette-grey-700")),K(x.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),K(x.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),K(x.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),K(x.LinearProgress,"primaryBg",R(Xe,x.primary.main,.62)),K(x.LinearProgress,"secondaryBg",R(Xe,x.secondary.main,.62)),K(x.LinearProgress,"errorBg",R(Xe,x.error.main,.62)),K(x.LinearProgress,"infoBg",R(Xe,x.info.main,.62)),K(x.LinearProgress,"successBg",R(Xe,x.success.main,.62)),K(x.LinearProgress,"warningBg",R(Xe,x.warning.main,.62)),K(x.Skeleton,"bg",S?R(fa,x.text.primary,.11):`rgba(${F("palette-text-primaryChannel")} / 0.11)`),K(x.Slider,"primaryTrack",R(Xe,x.primary.main,.62)),K(x.Slider,"secondaryTrack",R(Xe,x.secondary.main,.62)),K(x.Slider,"errorTrack",R(Xe,x.error.main,.62)),K(x.Slider,"infoTrack",R(Xe,x.info.main,.62)),K(x.Slider,"successTrack",R(Xe,x.success.main,.62)),K(x.Slider,"warningTrack",R(Xe,x.warning.main,.62));const z=S?R(Ye,x.background.default,.6825):vf(x.background.default,.8);K(x.SnackbarContent,"bg",z),K(x.SnackbarContent,"color",Tr(()=>S?xm.text.primary:x.getContrastText(z))),K(x.SpeedDialAction,"fabHoverBg",vf(x.background.paper,.15)),K(x.StepConnector,"border",F("palette-grey-400")),K(x.StepContent,"border",F("palette-grey-400")),K(x.Switch,"defaultColor",F("palette-common-white")),K(x.Switch,"defaultDisabledColor",F("palette-grey-100")),K(x.Switch,"primaryDisabledColor",R(Xe,x.primary.main,.62)),K(x.Switch,"secondaryDisabledColor",R(Xe,x.secondary.main,.62)),K(x.Switch,"errorDisabledColor",R(Xe,x.error.main,.62)),K(x.Switch,"infoDisabledColor",R(Xe,x.info.main,.62)),K(x.Switch,"successDisabledColor",R(Xe,x.success.main,.62)),K(x.Switch,"warningDisabledColor",R(Xe,x.warning.main,.62)),K(x.TableCell,"border",R(Xe,R(fa,x.divider,1),.88)),K(x.Tooltip,"bg",R(fa,x.grey[700],.92))}if(x.mode==="dark"){K(x.Alert,"errorColor",R(Xe,x.error.light,.6)),K(x.Alert,"infoColor",R(Xe,x.info.light,.6)),K(x.Alert,"successColor",R(Xe,x.success.light,.6)),K(x.Alert,"warningColor",R(Xe,x.warning.light,.6)),K(x.Alert,"errorFilledBg",F("palette-error-dark")),K(x.Alert,"infoFilledBg",F("palette-info-dark")),K(x.Alert,"successFilledBg",F("palette-success-dark")),K(x.Alert,"warningFilledBg",F("palette-warning-dark")),K(x.Alert,"errorFilledColor",Tr(()=>x.getContrastText(x.error.dark))),K(x.Alert,"infoFilledColor",Tr(()=>x.getContrastText(x.info.dark))),K(x.Alert,"successFilledColor",Tr(()=>x.getContrastText(x.success.dark))),K(x.Alert,"warningFilledColor",Tr(()=>x.getContrastText(x.warning.dark))),K(x.Alert,"errorStandardBg",R(Ye,x.error.light,.9)),K(x.Alert,"infoStandardBg",R(Ye,x.info.light,.9)),K(x.Alert,"successStandardBg",R(Ye,x.success.light,.9)),K(x.Alert,"warningStandardBg",R(Ye,x.warning.light,.9)),K(x.Alert,"errorIconColor",F("palette-error-main")),K(x.Alert,"infoIconColor",F("palette-info-main")),K(x.Alert,"successIconColor",F("palette-success-main")),K(x.Alert,"warningIconColor",F("palette-warning-main")),K(x.AppBar,"defaultBg",F("palette-grey-900")),K(x.AppBar,"darkBg",F("palette-background-paper")),K(x.AppBar,"darkColor",F("palette-text-primary")),K(x.Avatar,"defaultBg",F("palette-grey-600")),K(x.Button,"inheritContainedBg",F("palette-grey-800")),K(x.Button,"inheritContainedHoverBg",F("palette-grey-700")),K(x.Chip,"defaultBorder",F("palette-grey-700")),K(x.Chip,"defaultAvatarColor",F("palette-grey-300")),K(x.Chip,"defaultIconColor",F("palette-grey-300")),K(x.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),K(x.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),K(x.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),K(x.LinearProgress,"primaryBg",R(Ye,x.primary.main,.5)),K(x.LinearProgress,"secondaryBg",R(Ye,x.secondary.main,.5)),K(x.LinearProgress,"errorBg",R(Ye,x.error.main,.5)),K(x.LinearProgress,"infoBg",R(Ye,x.info.main,.5)),K(x.LinearProgress,"successBg",R(Ye,x.success.main,.5)),K(x.LinearProgress,"warningBg",R(Ye,x.warning.main,.5)),K(x.Skeleton,"bg",S?R(fa,x.text.primary,.13):`rgba(${F("palette-text-primaryChannel")} / 0.13)`),K(x.Slider,"primaryTrack",R(Ye,x.primary.main,.5)),K(x.Slider,"secondaryTrack",R(Ye,x.secondary.main,.5)),K(x.Slider,"errorTrack",R(Ye,x.error.main,.5)),K(x.Slider,"infoTrack",R(Ye,x.info.main,.5)),K(x.Slider,"successTrack",R(Ye,x.success.main,.5)),K(x.Slider,"warningTrack",R(Ye,x.warning.main,.5));const z=S?R(Xe,x.background.default,.985):vf(x.background.default,.98);K(x.SnackbarContent,"bg",z),K(x.SnackbarContent,"color",Tr(()=>S?G2.text.primary:x.getContrastText(z))),K(x.SpeedDialAction,"fabHoverBg",vf(x.background.paper,.15)),K(x.StepConnector,"border",F("palette-grey-600")),K(x.StepContent,"border",F("palette-grey-600")),K(x.Switch,"defaultColor",F("palette-grey-300")),K(x.Switch,"defaultDisabledColor",F("palette-grey-600")),K(x.Switch,"primaryDisabledColor",R(Ye,x.primary.main,.55)),K(x.Switch,"secondaryDisabledColor",R(Ye,x.secondary.main,.55)),K(x.Switch,"errorDisabledColor",R(Ye,x.error.main,.55)),K(x.Switch,"infoDisabledColor",R(Ye,x.info.main,.55)),K(x.Switch,"successDisabledColor",R(Ye,x.success.main,.55)),K(x.Switch,"warningDisabledColor",R(Ye,x.warning.main,.55)),K(x.TableCell,"border",R(Ye,R(fa,x.divider,1),.68)),K(x.Tooltip,"bg",R(fa,x.grey[700],.92))}Kr(x.background,"default"),Kr(x.background,"paper"),Kr(x.common,"background"),Kr(x.common,"onBackground"),Kr(x,"divider"),Object.keys(x).forEach(z=>{const N=x[z];z!=="tonalOffset"&&N&&typeof N=="object"&&(N.main&&K(x[z],"mainChannel",ll(sl(N.main))),N.light&&K(x[z],"lightChannel",ll(sl(N.light))),N.dark&&K(x[z],"darkChannel",ll(sl(N.dark))),N.contrastText&&K(x[z],"contrastTextChannel",ll(sl(N.contrastText))),z==="text"&&(Kr(x[z],"primary"),Kr(x[z],"secondary")),z==="action"&&(N.active&&Kr(x[z],"active"),N.selected&&Kr(x[z],"selected")))})}),b=t.reduce((_,x)=>On(_,x),b);const E={prefix:a,disableCssColorScheme:i,shouldSkipGeneratingVar:u,getSelector:U9(b),enableContrastVars:o},{vars:C,generateThemeVars:A,generateStyleSheets:T}=o9(b,E);return b.vars=C,Object.entries(b.colorSchemes[b.defaultColorScheme]).forEach(([_,x])=>{b[_]=x}),b.generateThemeVars=A,b.generateStyleSheets=T,b.generateSpacing=function(){return R2(c.spacing,pm(this))},b.getColorSchemeSelector=u9(l),b.spacing=b.generateSpacing(),b.shouldSkipGeneratingVar=u,b.unstable_sxConfig={...df,...c?.unstable_sxConfig},b.unstable_sx=function(x){return Bo({sx:x,theme:this})},b.toRuntimeSource=J2,b}function rS(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:wm({...n===!0?{}:n.palette,mode:t})})}function j9(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...o}=e,u=a||"light",l=i?.[u],s={...i,...n?{[u]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return Em(e,...t);let c=n;"palette"in e||s[u]&&(s[u]!==!0?c=s[u].palette:u==="dark"&&(c={mode:"dark"}));const f=Em({...e,palette:c},...t);return f.defaultColorScheme=u,f.colorSchemes=s,f.palette.mode==="light"&&(f.colorSchemes.light={...s.light!==!0&&s.light,palette:f.palette},rS(f,"dark",s.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...s.dark!==!0&&s.dark,palette:f.palette},rS(f,"light",s.light)),f}return!n&&!("light"in s)&&u==="light"&&(s.light=!0),L9({...o,colorSchemes:s,defaultColorScheme:u,...typeof r!="boolean"&&r},...t)}const H9=j9();function P9(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Cm=e=>P9(e)&&e!=="classes",wt=L6({themeId:O_,defaultTheme:H9,rootShouldForwardProp:Cm}),In=n9;function $n(e){return J6(e)}function q9(e){return yn("MuiSvgIcon",e)}bn("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const V9=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Ue(t)}`,`fontSize${Ue(n)}`]};return Un(i,q9,r)},G9=wt("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Ue(n.color)}`],t[`fontSize${Ue(n.fontSize)}`]]}})(In(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),Tm=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiSvgIcon"}),{children:i,className:a,color:o="inherit",component:u="svg",fontSize:l="medium",htmlColor:s,inheritViewBox:c=!1,titleAccess:f,viewBox:d="0 0 24 24",...h}=r,v=M.isValidElement(i)&&i.type==="svg",m={...r,color:o,component:u,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:c,viewBox:d,hasSvgAsChild:v},D={};c||(D.viewBox=d);const p=V9(m);return B.jsxs(G9,{as:u,className:at(p.root,a),focusable:"false",color:s,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...D,...h,...v&&i.props,ownerState:m,children:[v?i.props.children:i,f?B.jsx("title",{children:f}):null]})});Tm.muiName="SvgIcon";function Mm(e,t){function n(r,i){return B.jsx(Tm,{"data-testid":void 0,ref:i,...r,children:e})}return n.muiName=Tm.muiName,M.memo(M.forwardRef(n))}function Y9(e){const{controlled:t,default:n}=e,{current:r}=M.useRef(t!==void 0),[i,a]=M.useState(n),o=r?t:i,u=M.useCallback(l=>{r||a(l)},[]);return[o,u]}function yf(e){const t=M.useRef(e);return V6(()=>{t.current=e}),M.useRef((...n)=>(0,t.current)(...n)).current}function _m(...e){const t=M.useRef(void 0),n=M.useCallback(r=>{const i=e.map(a=>{if(a==null)return null;if(typeof a=="function"){const o=a,u=o(r);return typeof u=="function"?u:()=>{o(null)}}return a.current=r,()=>{a.current=null}});return()=>{i.forEach(a=>a?.())}},e);return M.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}function X9(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function Z9(e,t){if(!e)return t;function n(o,u){const l={};return Object.keys(u).forEach(s=>{X9(s,u[s])&&typeof o[s]=="function"&&(l[s]=(...c)=>{o[s](...c),u[s](...c)})}),l}if(typeof e=="function"||typeof t=="function")return o=>{const u=typeof t=="function"?t(o):t,l=typeof e=="function"?e({...o,...u}):e,s=at(o?.className,u?.className,l?.className),c=n(l,u);return{...u,...l,...c,...!!s&&{className:s},...u?.style&&l?.style&&{style:{...u.style,...l.style}},...u?.sx&&l?.sx&&{sx:[...Array.isArray(u.sx)?u.sx:[u.sx],...Array.isArray(l.sx)?l.sx:[l.sx]]}}};const r=t,i=n(e,r),a=at(r?.className,e?.className);return{...t,...e,...i,...!!a&&{className:a},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function Q9(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Bm(e,t){return Bm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Bm(e,t)}function K9(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Bm(e,t)}const iS=Nt.createContext(null);function W9(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fm(e,t){var n=function(a){return t&&M.isValidElement(a)?t(a):a},r=Object.create(null);return e&&M.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function J9(e,t){e=e||{},t=t||{};function n(c){return c in t?t[c]:e[c]}var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,u={};for(var l in t){if(r[l])for(o=0;o<r[l].length;o++){var s=r[l][o];u[r[l][o]]=n(s)}u[l]=n(l)}for(o=0;o<i.length;o++)u[i[o]]=n(i[o]);return u}function da(e,t,n){return n[t]!=null?n[t]:e.props[t]}function eB(e,t){return Fm(e.children,function(n){return M.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:da(n,"appear",e),enter:da(n,"enter",e),exit:da(n,"exit",e)})})}function tB(e,t,n){var r=Fm(e.children),i=J9(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if(M.isValidElement(o)){var u=a in t,l=a in r,s=t[a],c=M.isValidElement(s)&&!s.props.in;l&&(!u||c)?i[a]=M.cloneElement(o,{onExited:n.bind(null,o),in:!0,exit:da(o,"exit",e),enter:da(o,"enter",e)}):!l&&u&&!c?i[a]=M.cloneElement(o,{in:!1}):l&&u&&M.isValidElement(s)&&(i[a]=M.cloneElement(o,{onExited:n.bind(null,o),in:s.props.in,exit:da(o,"exit",e),enter:da(o,"enter",e)}))}}),i}var nB=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},rB={component:"div",childFactory:function(t){return t}},Nm=function(e){K9(t,e);function t(r,i){var a;a=e.call(this,r,i)||this;var o=a.handleExited.bind(W9(a));return a.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},a}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(i,a){var o=a.children,u=a.handleExited,l=a.firstRender;return{children:l?eB(i,u):tB(i,o,u),firstRender:!1}},n.handleExited=function(i,a){var o=Fm(this.props.children);i.key in o||(i.props.onExited&&i.props.onExited(a),this.mounted&&this.setState(function(u){var l=Ci({},u.children);return delete l[i.key],{children:l}}))},n.render=function(){var i=this.props,a=i.component,o=i.childFactory,u=Q9(i,["component","childFactory"]),l=this.state.contextValue,s=nB(this.state.children).map(o);return delete u.appear,delete u.enter,delete u.exit,a===null?Nt.createElement(iS.Provider,{value:l},s):Nt.createElement(iS.Provider,{value:l},Nt.createElement(a,u,s))},t}(Nt.Component);Nm.propTypes={},Nm.defaultProps=rB;const aS={};function oS(e,t){const n=M.useRef(aS);return n.current===aS&&(n.current=e(t)),n}const iB=[];function aB(e){M.useEffect(e,iB)}class Rm{static create(){return new Rm}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function oB(){const e=oS(Rm.create).current;return aB(e.disposeEffect),e}function uB(e){return typeof e=="string"}function lB(e,t,n){return e===void 0||uB(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function sB(e,t,n){return typeof e=="function"?e(t,n):e}function cB(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function uS(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function fB(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){const h=at(n?.className,a,i?.className,r?.className),v={...n?.style,...i?.style,...r?.style},m={...n,...i,...r};return h.length>0&&(m.className=h),Object.keys(v).length>0&&(m.style=v),{props:m,internalRef:void 0}}const o=cB({...i,...r}),u=uS(r),l=uS(i),s=t(o),c=at(s?.className,n?.className,a,i?.className,r?.className),f={...s?.style,...n?.style,...i?.style,...r?.style},d={...s,...n,...l,...u};return c.length>0&&(d.className=c),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:s.ref}}function Fo(e,t){const{className:n,elementType:r,ownerState:i,externalForwardedProps:a,internalForwardedProps:o,shouldForwardComponentProp:u=!1,...l}=t,{component:s,slots:c={[e]:void 0},slotProps:f={[e]:void 0},...d}=a,h=c[e]||r,v=sB(f[e],i),{props:{component:m,...D},internalRef:p}=fB({className:n,...l,externalForwardedProps:e==="root"?d:void 0,externalSlotProps:v}),g=_m(p,v?.ref,t.ref),y=e==="root"?m||s:m,S=lB(h,{...e==="root"&&!s&&!c[e]&&o,...e!=="root"&&!c[e]&&o,...D,...y&&!u&&{as:y},...y&&u&&{component:y},ref:g},i);return[h,S]}function lS(e){try{return e.matches(":focus-visible")}catch{}return!1}class bf{static create(){return new bf}static use(){const t=oS(bf.create).current,[n,r]=M.useState(!1);return t.shouldMount=n,t.setShouldMount=r,M.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=hB(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function dB(){return bf.use()}function hB(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function mB(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:a,rippleSize:o,in:u,onExited:l,timeout:s}=e,[c,f]=M.useState(!1),d=at(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:o,height:o,top:-(o/2)+a,left:-(o/2)+i},v=at(n.child,c&&n.childLeaving,r&&n.childPulsate);return!u&&!c&&f(!0),M.useEffect(()=>{if(!u&&l!=null){const m=setTimeout(l,s);return()=>{clearTimeout(m)}}},[l,u,s]),B.jsx("span",{className:d,style:h,children:B.jsx("span",{className:v})})}const er=bn("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Om=550,pB=80,gB=il`
|
|
102
90
|
0% {
|
|
103
91
|
transform: scale(0);
|
|
104
92
|
opacity: 0.1;
|
|
@@ -108,7 +96,7 @@ export default theme;`}function Kw(e){return typeof e=="number"?`${(e*100).toFix
|
|
|
108
96
|
transform: scale(1);
|
|
109
97
|
opacity: 0.3;
|
|
110
98
|
}
|
|
111
|
-
`,
|
|
99
|
+
`,vB=il`
|
|
112
100
|
0% {
|
|
113
101
|
opacity: 1;
|
|
114
102
|
}
|
|
@@ -116,7 +104,7 @@ export default theme;`}function Kw(e){return typeof e=="number"?`${(e*100).toFix
|
|
|
116
104
|
100% {
|
|
117
105
|
opacity: 0;
|
|
118
106
|
}
|
|
119
|
-
`,
|
|
107
|
+
`,yB=il`
|
|
120
108
|
0% {
|
|
121
109
|
transform: scale(1);
|
|
122
110
|
}
|
|
@@ -128,23 +116,23 @@ export default theme;`}function Kw(e){return typeof e=="number"?`${(e*100).toFix
|
|
|
128
116
|
100% {
|
|
129
117
|
transform: scale(1);
|
|
130
118
|
}
|
|
131
|
-
`,
|
|
119
|
+
`,bB=wt("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),DB=wt(mB,{name:"MuiTouchRipple",slot:"Ripple"})`
|
|
132
120
|
opacity: 0;
|
|
133
121
|
position: absolute;
|
|
134
122
|
|
|
135
|
-
&.${
|
|
123
|
+
&.${er.rippleVisible} {
|
|
136
124
|
opacity: 0.3;
|
|
137
125
|
transform: scale(1);
|
|
138
|
-
animation-name: ${
|
|
139
|
-
animation-duration: ${
|
|
126
|
+
animation-name: ${gB};
|
|
127
|
+
animation-duration: ${Om}ms;
|
|
140
128
|
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
|
141
129
|
}
|
|
142
130
|
|
|
143
|
-
&.${
|
|
131
|
+
&.${er.ripplePulsate} {
|
|
144
132
|
animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
|
|
145
133
|
}
|
|
146
134
|
|
|
147
|
-
& .${
|
|
135
|
+
& .${er.child} {
|
|
148
136
|
opacity: 1;
|
|
149
137
|
display: block;
|
|
150
138
|
width: 100%;
|
|
@@ -153,25 +141,25 @@ export default theme;`}function Kw(e){return typeof e=="number"?`${(e*100).toFix
|
|
|
153
141
|
background-color: currentColor;
|
|
154
142
|
}
|
|
155
143
|
|
|
156
|
-
& .${
|
|
144
|
+
& .${er.childLeaving} {
|
|
157
145
|
opacity: 0;
|
|
158
|
-
animation-name: ${
|
|
159
|
-
animation-duration: ${
|
|
146
|
+
animation-name: ${vB};
|
|
147
|
+
animation-duration: ${Om}ms;
|
|
160
148
|
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
|
161
149
|
}
|
|
162
150
|
|
|
163
|
-
& .${
|
|
151
|
+
& .${er.childPulsate} {
|
|
164
152
|
position: absolute;
|
|
165
153
|
/* @noflip */
|
|
166
154
|
left: 0px;
|
|
167
155
|
top: 0;
|
|
168
|
-
animation-name: ${
|
|
156
|
+
animation-name: ${yB};
|
|
169
157
|
animation-duration: 2500ms;
|
|
170
158
|
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
|
171
159
|
animation-iteration-count: infinite;
|
|
172
160
|
animation-delay: 200ms;
|
|
173
161
|
}
|
|
174
|
-
`,
|
|
162
|
+
`,SB=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTouchRipple"}),{center:i=!1,classes:a={},className:o,...u}=r,[l,s]=M.useState([]),c=M.useRef(0),f=M.useRef(null);M.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=M.useRef(!1),h=oB(),v=M.useRef(null),m=M.useRef(null),D=M.useCallback(S=>{const{pulsate:w,rippleX:b,rippleY:E,rippleSize:C,cb:A}=S;s(T=>[...T,B.jsx(DB,{classes:{ripple:at(a.ripple,er.ripple),rippleVisible:at(a.rippleVisible,er.rippleVisible),ripplePulsate:at(a.ripplePulsate,er.ripplePulsate),child:at(a.child,er.child),childLeaving:at(a.childLeaving,er.childLeaving),childPulsate:at(a.childPulsate,er.childPulsate)},timeout:Om,pulsate:w,rippleX:b,rippleY:E,rippleSize:C},c.current)]),c.current+=1,f.current=A},[a]),p=M.useCallback((S={},w={},b=()=>{})=>{const{pulsate:E=!1,center:C=i||w.pulsate,fakeElement:A=!1}=w;if(S?.type==="mousedown"&&d.current){d.current=!1;return}S?.type==="touchstart"&&(d.current=!0);const T=A?null:m.current,_=T?T.getBoundingClientRect():{width:0,height:0,left:0,top:0};let x,F,R;if(C||S===void 0||S.clientX===0&&S.clientY===0||!S.clientX&&!S.touches)x=Math.round(_.width/2),F=Math.round(_.height/2);else{const{clientX:z,clientY:N}=S.touches&&S.touches.length>0?S.touches[0]:S;x=Math.round(z-_.left),F=Math.round(N-_.top)}if(C)R=Math.sqrt((2*_.width**2+_.height**2)/3),R%2===0&&(R+=1);else{const z=Math.max(Math.abs((T?T.clientWidth:0)-x),x)*2+2,N=Math.max(Math.abs((T?T.clientHeight:0)-F),F)*2+2;R=Math.sqrt(z**2+N**2)}S?.touches?v.current===null&&(v.current=()=>{D({pulsate:E,rippleX:x,rippleY:F,rippleSize:R,cb:b})},h.start(pB,()=>{v.current&&(v.current(),v.current=null)})):D({pulsate:E,rippleX:x,rippleY:F,rippleSize:R,cb:b})},[i,D,h]),g=M.useCallback(()=>{p({},{pulsate:!0})},[p]),y=M.useCallback((S,w)=>{if(h.clear(),S?.type==="touchend"&&v.current){v.current(),v.current=null,h.start(0,()=>{y(S,w)});return}v.current=null,s(b=>b.length>0?b.slice(1):b),f.current=w},[h]);return M.useImperativeHandle(n,()=>({pulsate:g,start:p,stop:y}),[g,p,y]),B.jsx(bB,{className:at(er.root,a.root,o),ref:m,...u,children:B.jsx(Nm,{component:null,exit:!0,children:l})})});function xB(e){return yn("MuiButtonBase",e)}const wB=bn("MuiButtonBase",["root","disabled","focusVisible"]),EB=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,o=Un({root:["root",t&&"disabled",n&&"focusVisible"]},xB,i);return n&&r&&(o.root+=` ${r}`),o},AB=wt("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${wB.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),sS=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiButtonBase"}),{action:i,centerRipple:a=!1,children:o,className:u,component:l="button",disabled:s=!1,disableRipple:c=!1,disableTouchRipple:f=!1,focusRipple:d=!1,focusVisibleClassName:h,LinkComponent:v="a",onBlur:m,onClick:D,onContextMenu:p,onDragLeave:g,onFocus:y,onFocusVisible:S,onKeyDown:w,onKeyUp:b,onMouseDown:E,onMouseLeave:C,onMouseUp:A,onTouchEnd:T,onTouchMove:_,onTouchStart:x,tabIndex:F=0,TouchRippleProps:R,touchRippleRef:z,type:N,...U}=r,I=M.useRef(null),L=dB(),G=_m(L.ref,z),[X,P]=M.useState(!1);s&&X&&P(!1),M.useImperativeHandle(i,()=>({focusVisible:()=>{P(!0),I.current.focus()}}),[]);const j=L.shouldMount&&!c&&!s;M.useEffect(()=>{X&&d&&!c&&L.pulsate()},[c,d,X,L]);const H=Wr(L,"start",E,f),k=Wr(L,"stop",p,f),q=Wr(L,"stop",g,f),Y=Wr(L,"stop",A,f),ee=Wr(L,"stop",pe=>{X&&pe.preventDefault(),C&&C(pe)},f),te=Wr(L,"start",x,f),ne=Wr(L,"stop",T,f),oe=Wr(L,"stop",_,f),W=Wr(L,"stop",pe=>{lS(pe.target)||P(!1),m&&m(pe)},!1),ce=yf(pe=>{I.current||(I.current=pe.currentTarget),lS(pe.target)&&(P(!0),S&&S(pe)),y&&y(pe)}),de=()=>{const pe=I.current;return l&&l!=="button"&&!(pe.tagName==="A"&&pe.href)},ve=yf(pe=>{d&&!pe.repeat&&X&&pe.key===" "&&L.stop(pe,()=>{L.start(pe)}),pe.target===pe.currentTarget&&de()&&pe.key===" "&&pe.preventDefault(),w&&w(pe),pe.target===pe.currentTarget&&de()&&pe.key==="Enter"&&!s&&(pe.preventDefault(),D&&D(pe))}),De=yf(pe=>{d&&pe.key===" "&&X&&!pe.defaultPrevented&&L.stop(pe,()=>{L.pulsate(pe)}),b&&b(pe),D&&pe.target===pe.currentTarget&&de()&&pe.key===" "&&!pe.defaultPrevented&&D(pe)});let Se=l;Se==="button"&&(U.href||U.to)&&(Se=v);const Ee={};Se==="button"?(Ee.type=N===void 0?"button":N,Ee.disabled=s):(!U.href&&!U.to&&(Ee.role="button"),s&&(Ee["aria-disabled"]=s));const Re=_m(n,I),Ce={...r,centerRipple:a,component:l,disabled:s,disableRipple:c,disableTouchRipple:f,focusRipple:d,tabIndex:F,focusVisible:X},Ne=EB(Ce);return B.jsxs(AB,{as:Se,className:at(Ne.root,u),ownerState:Ce,onBlur:W,onClick:D,onContextMenu:k,onFocus:ce,onKeyDown:ve,onKeyUp:De,onMouseDown:H,onMouseLeave:ee,onMouseUp:Y,onDragLeave:q,onTouchEnd:ne,onTouchMove:oe,onTouchStart:te,ref:Re,tabIndex:s?-1:F,type:N,...Ee,...U,children:[o,j?B.jsx(SB,{ref:G,center:a,...R}):null]})});function Wr(e,t,n,r=!1){return yf(i=>(n&&n(i),r||e[t](i),!0))}function CB(e){return typeof e.main=="string"}function TB(e,t=[]){if(!CB(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function No(e=[]){return([,t])=>t&&TB(t,e)}function MB(e){return yn("MuiCircularProgress",e)}bn("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Ui=44,zm=il`
|
|
175
163
|
0% {
|
|
176
164
|
transform: rotate(0deg);
|
|
177
165
|
}
|
|
@@ -179,7 +167,7 @@ export default theme;`}function Kw(e){return typeof e=="number"?`${(e*100).toFix
|
|
|
179
167
|
100% {
|
|
180
168
|
transform: rotate(360deg);
|
|
181
169
|
}
|
|
182
|
-
`,
|
|
170
|
+
`,Um=il`
|
|
183
171
|
0% {
|
|
184
172
|
stroke-dasharray: 1px, 200px;
|
|
185
173
|
stroke-dashoffset: 0;
|
|
@@ -194,10 +182,10 @@ export default theme;`}function Kw(e){return typeof e=="number"?`${(e*100).toFix
|
|
|
194
182
|
stroke-dasharray: 1px, 200px;
|
|
195
183
|
stroke-dashoffset: -126px;
|
|
196
184
|
}
|
|
197
|
-
`,
|
|
198
|
-
animation: ${
|
|
199
|
-
`:null,
|
|
200
|
-
animation: ${
|
|
201
|
-
`:null,bR=e=>{const{classes:t,variant:n,color:r,disableShrink:i}=e,a={root:["root",n,`color${je(r)}`],svg:["svg"],circle:["circle",`circle${je(n)}`,i&&"circleDisableShrink"]};return Gn(a,gR,t)},DR=Tt("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${je(n.color)}`]]}})(Vn(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:vR||{animation:`${Pp} 1.4s linear infinite`}},...Object.entries(e.palette).filter(lu()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),SR=Tt("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),wR=Tt("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${je(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(Vn(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:yR||{animation:`${Hp} 1.4s ease-in-out infinite`}}]}))),xR=_.forwardRef(function(t,n){const r=Yn({props:t,name:"MuiCircularProgress"}),{className:i,color:a="primary",disableShrink:o=!1,size:u=40,style:l,thickness:s=3.6,value:c=0,variant:f="indeterminate",...d}=r,h={...r,color:a,disableShrink:o,size:u,thickness:s,value:c,variant:f},g=bR(h),m={},D={},p={};if(f==="determinate"){const v=2*Math.PI*((na-s)/2);m.strokeDasharray=v.toFixed(3),p["aria-valuenow"]=Math.round(c),m.strokeDashoffset=`${((100-c)/100*v).toFixed(3)}px`,D.transform="rotate(-90deg)"}return B.jsx(DR,{className:ct(g.root,i),style:{width:u,height:u,...D,...l},ownerState:h,ref:n,role:"progressbar",...p,...d,children:B.jsx(SR,{className:g.svg,ownerState:h,viewBox:`${na/2} ${na/2} ${na} ${na}`,children:B.jsx(wR,{className:g.circle,style:m,ownerState:h,cx:na,cy:na,r:(na-s)/2,fill:"none",strokeWidth:s})})})});function ER(e){return Mn("MuiIconButton",e)}const ox=Tn("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),AR=e=>{const{classes:t,disabled:n,color:r,edge:i,size:a,loading:o}=e,u={root:["root",o&&"loading",n&&"disabled",r!=="default"&&`color${je(r)}`,i&&`edge${je(i)}`,`size${je(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Gn(u,ER,t)},CR=Tt(ax,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${je(n.color)}`],n.edge&&t[`edge${je(n.edge)}`],t[`size${je(n.size)}`]]}})(Vn(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),Vn(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(lu()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(lu()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${ox.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${ox.loading}`]:{color:"transparent"}}))),MR=Tt("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),jl=_.forwardRef(function(t,n){const r=Yn({props:t,name:"MuiIconButton"}),{edge:i=!1,children:a,className:o,color:u="default",disabled:l=!1,disableFocusRipple:s=!1,size:c="medium",id:f,loading:d=null,loadingIndicator:h,...g}=r,m=HN(f),D=h??B.jsx(xR,{"aria-labelledby":m,color:"inherit",size:16}),p={...r,edge:i,color:u,disabled:l,disableFocusRipple:s,loading:d,loadingIndicator:D,size:c},v=AR(p);return B.jsxs(CR,{id:d?m:f,className:ct(v.root,o),centerRipple:!0,focusRipple:!s,disabled:l||d,ref:n,...g,ownerState:p,children:[typeof d=="boolean"&&B.jsx("span",{className:v.loadingWrapper,style:{display:"contents"},children:B.jsx(MR,{className:v.loadingIndicator,ownerState:p,children:d&&D})}),a]})});function TR({props:e,states:t,muiFormControl:n}){return t.reduce((r,i)=>(r[i]=e[i],n&&typeof e[i]>"u"&&(r[i]=n[i]),r),{})}const _R=_.createContext(void 0);function ux(){return _.useContext(_R)}function BR(e){return Mn("PrivateSwitchBase",e)}Tn("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const NR=e=>{const{classes:t,checked:n,disabled:r,edge:i}=e,a={root:["root",n&&"checked",r&&"disabled",i&&`edge${je(i)}`],input:["input"]};return Gn(a,BR,t)},FR=Tt(ax,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),RR=Tt("input",{name:"MuiSwitchBase",shouldForwardProp:Rp})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),lx=_.forwardRef(function(t,n){const{autoFocus:r,checked:i,checkedIcon:a,defaultChecked:o,disabled:u,disableFocusRipple:l=!1,edge:s=!1,icon:c,id:f,inputProps:d,inputRef:h,name:g,onBlur:m,onChange:D,onFocus:p,readOnly:v,required:y=!1,tabIndex:w,type:E,value:b,slots:S={},slotProps:A={},...C}=t,[M,T]=zF({controlled:i,default:!!o}),x=ux(),N=j=>{p&&p(j),x&&x.onFocus&&x.onFocus(j)},R=j=>{m&&m(j),x&&x.onBlur&&x.onBlur(j)},z=j=>{if(j.nativeEvent.defaultPrevented)return;const q=j.target.checked;T(q),D&&D(j,q)};let F=u;x&&typeof F>"u"&&(F=x.disabled);const U=E==="checkbox"||E==="radio",I={...t,checked:M,disabled:F,disableFocusRipple:l,edge:s},L=NR(I),V={slots:S,slotProps:{input:d,...A}},[X,$]=uu("root",{ref:n,elementType:FR,className:L.root,shouldForwardComponentProp:!0,externalForwardedProps:{...V,component:"span",...C},getSlotProps:j=>({...j,onFocus:q=>{j.onFocus?.(q),N(q)},onBlur:q=>{j.onBlur?.(q),R(q)}}),ownerState:I,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:F,role:void 0,tabIndex:null}}),[P,H]=uu("input",{ref:h,elementType:RR,className:L.input,externalForwardedProps:V,getSlotProps:j=>({...j,onChange:q=>{j.onChange?.(q),z(q)}}),ownerState:I,additionalProps:{autoFocus:r,checked:i,defaultChecked:o,disabled:F,id:U?f:void 0,name:g,readOnly:v,required:y,tabIndex:w,type:E,...E==="checkbox"&&b===void 0?{}:{value:b}}});return B.jsxs(X,{...$,children:[B.jsx(P,{...H}),M?a:c]})}),OR=zp(B.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),zR=zp(B.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),UR=zp(B.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function IR(e){return Mn("MuiCheckbox",e)}const qp=Tn("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),$R=e=>{const{classes:t,indeterminate:n,color:r,size:i}=e,a={root:["root",n&&"indeterminate",`color${je(r)}`,`size${je(i)}`]},o=Gn(a,IR,t);return{...t,...o}},kR=Tt(lx,{shouldForwardProp:e=>Rp(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${je(n.size)}`],n.color!=="default"&&t[`color${je(n.color)}`]]}})(Vn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(lu()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(lu()).map(([t])=>({props:{color:t},style:{[`&.${qp.checked}, &.${qp.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${qp.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),LR=B.jsx(zR,{}),jR=B.jsx(OR,{}),PR=B.jsx(UR,{}),sx=_.forwardRef(function(t,n){const r=Yn({props:t,name:"MuiCheckbox"}),{checkedIcon:i=LR,color:a="primary",icon:o=jR,indeterminate:u=!1,indeterminateIcon:l=PR,inputProps:s,size:c="medium",disableRipple:f=!1,className:d,slots:h={},slotProps:g={},...m}=r,D=u?l:o,p=u?l:i,v={...r,disableRipple:f,color:a,indeterminate:u,size:c},y=$R(v),w=g.input??s,[E,b]=uu("root",{ref:n,elementType:kR,className:ct(y.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:h,slotProps:g,...m},ownerState:v,additionalProps:{type:"checkbox",icon:_.cloneElement(D,{fontSize:D.props.fontSize??c}),checkedIcon:_.cloneElement(p,{fontSize:p.props.fontSize??c}),disableRipple:f,slots:h,slotProps:{input:IF(typeof w=="function"?w(v):w,{"data-indeterminate":u})}}});return B.jsx(E,{...b,classes:y})});function HR(e){return Mn("MuiFormGroup",e)}Tn("MuiFormGroup",["root","row","error"]);const qR=e=>{const{classes:t,row:n,error:r}=e;return Gn({root:["root",n&&"row",r&&"error"]},HR,t)},GR=Tt("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),VR=_.forwardRef(function(t,n){const r=Yn({props:t,name:"MuiFormGroup"}),{className:i,row:a=!1,...o}=r,u=ux(),l=TR({props:r,muiFormControl:u,states:["error"]}),s={...r,row:a,error:l.error},c=qR(s);return B.jsx(GR,{className:ct(c.root,i),ownerState:s,ref:n,...o})});function YR(e){return Mn("MuiSwitch",e)}const pn=Tn("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),XR=e=>{const{classes:t,edge:n,size:r,color:i,checked:a,disabled:o}=e,u={root:["root",n&&`edge${je(n)}`,`size${je(r)}`],switchBase:["switchBase",`color${je(i)}`,a&&"checked",o&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=Gn(u,YR,t);return{...t,...l}},ZR=Tt("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${je(n.edge)}`],t[`size${je(n.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${pn.thumb}`]:{width:16,height:16},[`& .${pn.switchBase}`]:{padding:4,[`&.${pn.checked}`]:{transform:"translateX(16px)"}}}}]}),KR=Tt(lx,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${pn.input}`]:t.input},n.color!=="default"&&t[`color${je(n.color)}`]]}})(Vn(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${pn.checked}`]:{transform:"translateX(20px)"},[`&.${pn.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${pn.checked} + .${pn.track}`]:{opacity:.5},[`&.${pn.disabled} + .${pn.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${pn.input}`]:{left:"-100%",width:"300%"}})),Vn(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(lu(["light"])).map(([t])=>({props:{color:t},style:{[`&.${pn.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${pn.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${pn.checked} + .${pn.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),QR=Tt("span",{name:"MuiSwitch",slot:"Track"})(Vn(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),WR=Tt("span",{name:"MuiSwitch",slot:"Thumb"})(Vn(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),cx=_.forwardRef(function(t,n){const r=Yn({props:t,name:"MuiSwitch"}),{className:i,color:a="primary",edge:o=!1,size:u="medium",sx:l,slots:s={},slotProps:c={},...f}=r,d={...r,color:a,edge:o,size:u},h=XR(d),g={slots:s,slotProps:c},[m,D]=uu("root",{className:ct(h.root,i),elementType:ZR,externalForwardedProps:g,ownerState:d,additionalProps:{sx:l}}),[p,v]=uu("thumb",{className:h.thumb,elementType:WR,externalForwardedProps:g,ownerState:d}),y=B.jsx(p,{...v}),[w,E]=uu("track",{className:h.track,elementType:QR,externalForwardedProps:g,ownerState:d});return B.jsxs(m,{...D,children:[B.jsx(KR,{type:"checkbox",icon:y,checkedIcon:y,ref:n,ownerState:d,...f,classes:{...h,root:h.switchBase},slots:{...s.switchBase&&{root:s.switchBase},...s.input&&{input:s.input}},slotProps:{...c.switchBase&&{root:typeof c.switchBase=="function"?c.switchBase(d):c.switchBase},input:{role:"switch"},...c.input&&{input:typeof c.input=="function"?c.input(d):c.input}}}),B.jsx(w,{...E})]})}),fx=_.createContext();function JR(e){return Mn("MuiTable",e)}Tn("MuiTable",["root","stickyHeader"]);const eO=e=>{const{classes:t,stickyHeader:n}=e;return Gn({root:["root",n&&"stickyHeader"]},JR,t)},tO=Tt("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(Vn(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:t})=>t.stickyHeader,style:{borderCollapse:"separate"}}]}))),dx="table",nO=_.forwardRef(function(t,n){const r=Yn({props:t,name:"MuiTable"}),{className:i,component:a=dx,padding:o="normal",size:u="medium",stickyHeader:l=!1,...s}=r,c={...r,component:a,padding:o,size:u,stickyHeader:l},f=eO(c),d=_.useMemo(()=>({padding:o,size:u,stickyHeader:l}),[o,u,l]);return B.jsx(fx.Provider,{value:d,children:B.jsx(tO,{as:a,role:a===dx?null:"table",ref:n,className:ct(f.root,i),ownerState:c,...s})})}),od=_.createContext();function rO(e){return Mn("MuiTableBody",e)}Tn("MuiTableBody",["root"]);const iO=e=>{const{classes:t}=e;return Gn({root:["root"]},rO,t)},aO=Tt("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),oO={variant:"body"},hx="tbody",uO=_.forwardRef(function(t,n){const r=Yn({props:t,name:"MuiTableBody"}),{className:i,component:a=hx,...o}=r,u={...r,component:a},l=iO(u);return B.jsx(od.Provider,{value:oO,children:B.jsx(aO,{className:ct(l.root,i),as:a,ref:n,role:a===hx?null:"rowgroup",ownerState:u,...o})})});function lO(e){return Mn("MuiTableCell",e)}const sO=Tn("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),cO=e=>{const{classes:t,variant:n,align:r,padding:i,size:a,stickyHeader:o}=e,u={root:["root",n,o&&"stickyHeader",r!=="inherit"&&`align${je(r)}`,i!=="normal"&&`padding${je(i)}`,`size${je(a)}`]};return Gn(u,lO,t)},fO=Tt("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${je(n.size)}`],n.padding!=="normal"&&t[`padding${je(n.padding)}`],n.align!=="inherit"&&t[`align${je(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(Vn(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid
|
|
202
|
-
${e.palette.mode==="light"?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${sO.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:t})=>t.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),ud=_.forwardRef(function(t,n){const r=Yn({props:t,name:"MuiTableCell"}),{align:i="inherit",className:a,component:o,padding:u,scope:l,size:s,sortDirection:c,variant:f,...d}=r,h=_.useContext(fx),g=_.useContext(od),m=g&&g.variant==="head";let D;o?D=o:D=m?"th":"td";let p=l;D==="td"?p=void 0:!p&&m&&(p="col");const v=f||g&&g.variant,y={...r,align:i,component:D,padding:u||(h&&h.padding?h.padding:"normal"),size:s||(h&&h.size?h.size:"medium"),sortDirection:c,stickyHeader:v==="head"&&h&&h.stickyHeader,variant:v},w=cO(y);let E=null;return c&&(E=c==="asc"?"ascending":"descending"),B.jsx(fO,{as:D,ref:n,className:ct(w.root,a),"aria-sort":E,scope:p,ownerState:y,...d})});function dO(e){return Mn("MuiTableHead",e)}Tn("MuiTableHead",["root"]);const hO=e=>{const{classes:t}=e;return Gn({root:["root"]},dO,t)},mO=Tt("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),pO={variant:"head"},mx="thead",gO=_.forwardRef(function(t,n){const r=Yn({props:t,name:"MuiTableHead"}),{className:i,component:a=mx,...o}=r,u={...r,component:a},l=hO(u);return B.jsx(od.Provider,{value:pO,children:B.jsx(mO,{as:a,className:ct(l.root,i),ref:n,role:a===mx?null:"rowgroup",ownerState:u,...o})})});function vO(e){return Mn("MuiTableRow",e)}const px=Tn("MuiTableRow",["root","selected","hover","head","footer"]),yO=e=>{const{classes:t,selected:n,hover:r,head:i,footer:a}=e;return Gn({root:["root",n&&"selected",r&&"hover",i&&"head",a&&"footer"]},vO,t)},bO=Tt("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(Vn(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${px.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${px.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)}}}))),gx="tr",vx=_.forwardRef(function(t,n){const r=Yn({props:t,name:"MuiTableRow"}),{className:i,component:a=gx,hover:o=!1,selected:u=!1,...l}=r,s=_.useContext(od),c={...r,component:a,hover:o,selected:u,head:s&&s.variant==="head",footer:s&&s.variant==="footer"},f=yO(c);return B.jsx(bO,{as:a,ref:n,className:ct(f.root,i),role:a===gx?null:"row",ownerState:c,...l})}),DO={paddingLeft:0,paddingRight:0,paddingTop:1,paddingBottom:1},Pl=35,SO=e=>{const t=e.selected?"secondary":"inherit";return B.jsx("span",{title:e.title,children:e.icon?B.jsx(jl,{title:e.title,onClick:e.onClick,color:t,style:DO,disabled:!!e.disabled,sx:{fontSize:18},children:e.icon},e.elementIndex):B.jsx("button",{title:e.title,onClick:e.onClick,disabled:!!e.disabled,style:{padding:0,margin:0,fontSize:10},children:e.text},e.elementIndex)},e.elementIndex+"-span")},wO=e=>e.useHorizontalLayout?B.jsx(B.Fragment,{}):B.jsx("hr",{},e.elementIndex),xO=e=>{const t=Number.isFinite(e.content)?e.content:0,n=e.contentSigFigs||0,r=Math.abs(t-Math.round(t))*10**(n+1)<1,i=Number.isFinite(e.content)?r&&!e.contentAlwaysShowDecimal?Math.round(t)+"":t.toFixed(e.contentSigFigs||2):e.content||"",a=e.useHorizontalLayout?"span":"div";return kt.createElement(a,{key:e.elementIndex,title:e.title,style:{textAlign:"left",fontWeight:"bold",cursor:"default",fontSize:10}},i)},EO=e=>{switch(e.subtype){case"checkbox":return B.jsx(AO,{...e});case"slider":return B.jsx(CO,{...e});default:return B.jsxs("span",{children:["ERROR: Bad toggle subtype ",e.subtype]},e.elementIndex)}},AO=e=>B.jsx(sx,{checked:e.selected,onClick:e.onClick,style:{padding:0,paddingLeft:0},title:e.title,disabled:e.disabled},e.elementIndex),CO=e=>B.jsx(VR,{children:B.jsx(cx,{checked:e.selected,size:"small",style:{left:-3},onChange:e.onClick,disabled:e.disabled,title:e.title})},e.elementIndex),MO=e=>{switch(e.type){case"button":return B.jsx(SO,{...e});case"divider":return B.jsx(wO,{...e});case"text":return B.jsx(xO,{...e});case"toggle":return B.jsx(EO,{...e});default:return B.jsx("span",{},e.elementIndex)}},TO=e=>(e||[]).map((t,n)=>({type:t.type||"button",subtype:t.subtype,title:t.title,onClick:t.callback,icon:t.icon||"",text:t.text||"",selected:t.selected,disabled:t.disabled,content:t.content,contentSigFigs:t.contentSigFigs,contentAlwaysShowDecimal:t.boolean,elementIndex:n})),Hl=e=>{const t=_.useMemo(()=>TO(e.customActions),[e.customActions]),n=_.useMemo(()=>t.map((a,o)=>B.jsx(MO,{...a,useHorizontalLayout:e.useHorizontalLayout},o)),[t,e.useHorizontalLayout]),r=_.useMemo(()=>({width:e.width,height:e.height,top:e.top??0,paddingTop:e.topPadding??0}),[e.width,e.height,e.top,e.topPadding]),i=e.useHorizontalLayout?"HorizontalToolbar":"VerticalToolbar";return B.jsx("div",{className:i,style:{...r},children:n})},ld={onlyShowSelected:!1},sd=({options:e,setOptions:t,onRedistributeUnitColors:n})=>B.jsxs("div",{children:[B.jsx(cx,{checked:e.onlyShowSelected,onClick:()=>{t({...e,onlyShowSelected:!e.onlyShowSelected})}}),B.jsx("span",{style:{position:"relative",top:2,overflow:"hidden"},children:"only show selected"})," ",n&&B.jsx("button",{onClick:n,title:"Redistribute unit colors",children:"rc"})]}),_O=(e,t)=>{const n=t-e;let r;n<=30?r=10:n<=120?r=20:n<=300?r=50:n<=600?r=100:n<=1e3?r=150:r=100;const i=[];let a=Math.ceil(e/r);for(;a*r<=t;)i.push(a*r),a++;return i},yx=({binEdgesSec:e,binCounts:t,color:n,width:r,height:i,hideXAxis:a})=>{const o=_.useMemo(()=>(t||[]).map((c,f)=>{const d=(e||[])[f]*1e3,h=(e||[])[f+1]*1e3;return{key:f,xStart:d,xEnd:h,height:c,tooltip:`[${d}, ${h}]: ${c}`,color:n}}),[t,e,n]),{xMin:u,xMax:l}=_.useMemo(()=>o.length>0?{xMin:o[0].xStart,xMax:o[o.length-1].xEnd}:{xMin:0,xMax:1},[o]),s=_.useMemo(()=>_O(u,l).map(f=>({x:f,label:`${f}`})),[u,l]);return t?B.jsx(t7,{bars:o,ticks:a?void 0:s,width:r,height:i,xLabel:a?void 0:"dt (msec)"}):B.jsx("div",{style:{position:"relative",width:r,height:i,color:"orange"}})},BO=10,NO=4,FO=2,su=kt.forwardRef((e,t)=>{const{width:n,height:r,initialPosition:i,onChange:a,adjustable:o=!0,positionFromRight:u=!1,direction:l="horizontal"}=e,s=l==="horizontal"?n:r,[c,f]=_.useState(i),[d,h]=_.useState(!1),[g,m]=_.useState({x:0,y:0}),[D,p]=_.useState(0),v=_.useRef(null);if(_.useEffect(()=>{c>s-4?f(s-4):c<4&&s>20&&f(4)},[c,n,s]),!e.children)throw Error("Unexpected: no props.children");let y,w;if(!Array.isArray(e.children))y=e.children,w=null;else{const V=e.children.filter(X=>X!==void 0);y=V[0]||null,w=V[1]||null}if(y||(y=w,w=null),!y)throw Error("Splitter must have at least one child.");if(!w)return B.jsx(y.type,{...y.props,width:n,height:r});const E=u?s-c:c,b=o?e.gripThickness??BO:0,S=o?e.gripInnerThickness??NO:0,A=o?e.gripMargin??FO:0,C=E-b/2-A,M=s-C-b-2*A,T={top:0,left:0,width:n,height:r,overflow:"hidden"},x={left:0,top:0,width:l==="horizontal"?C:n,height:l==="horizontal"?r:C,zIndex:0,overflowY:l==="horizontal"?"auto":"hidden",overflowX:l==="horizontal"?"hidden":"auto"},N={left:l==="horizontal"?C+b+2*A:0,top:l==="horizontal"?0:C+b+2*A,width:l==="horizontal"?M:n,height:l==="horizontal"?r:M,zIndex:0,overflowY:l==="horizontal"?"auto":"hidden",overflowX:l==="horizontal"?"hidden":"auto"},R={left:0,top:0,width:l==="horizontal"?b+2*A:n,height:l==="horizontal"?r:b+2*A,backgroundColor:"transparent",cursor:l==="horizontal"?"col-resize":"row-resize",zIndex:9998},z={left:l==="horizontal"?A:0,top:l==="horizontal"?0:A,width:l==="horizontal"?b:n,height:l==="horizontal"?r:b,background:"rgb(230, 230, 230)",cursor:l==="horizontal"?"col-resize":"row-resize"},F={top:l==="horizontal"?0:(b-S)/2,left:l==="horizontal"?(b-S)/2:0,width:l==="horizontal"?S:n,height:l==="horizontal"?r:S,background:"gray",cursor:l==="horizontal"?"col-resize":"row-resize"},U=_.useCallback(V=>{V.preventDefault(),h(!0),m({x:V.clientX,y:V.clientY}),p(E)},[E]),I=_.useCallback(V=>{if(!d)return;const X=V.clientX-g.x,$=V.clientY-g.y;let H=D+(l==="horizontal"?X:$);const j=4,q=s-4;H=Math.max(j,Math.min(q,H));const Y=u?s-H:H;f(Y),a&&a(Y)},[d,g,D,l,s,u,a]),L=_.useCallback(()=>{h(!1)},[]);return _.useEffect(()=>{if(d)return document.addEventListener("mousemove",I),document.addEventListener("mouseup",L),()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",L)}},[d,I,L]),B.jsxs("div",{className:"splitter",style:{...T,position:"relative"},children:[B.jsx("div",{style:{...x,position:"absolute"},className:"SplitterChild",children:B.jsx(y.type,{...y.props,width:l==="horizontal"?C:n,height:l==="horizontal"?r:C})},"child1"),o&&B.jsx("div",{ref:v,style:{...R,position:"absolute",left:l==="horizontal"?E-b/2-A:0,top:l==="horizontal"?0:E-b/2-A},onMouseDown:U,children:B.jsx("div",{style:{...z,position:"absolute"},children:B.jsx("div",{style:{...F,position:"absolute"}})})},"drag"),B.jsx("div",{style:{...N,position:"absolute"},className:"SplitterChild",children:B.jsx(w.type,{ref:t,...w.props,width:l==="horizontal"?M:n,height:l==="horizontal"?r:M})},"child2")]})}),RO=({data:e,width:t,height:n})=>{const[r,i]=_.useState(ld),{selectedUnitIds:a,orderedUnitIds:o,plotClickHandlerGenerator:u,unitIdSelectionDispatch:l}=ii(),[s,c]=_.useState(1),[f,d]=_.useState(!1);_.useEffect(()=>{l({type:To,newUnitOrder:Nr(e.autocorrelograms.map(v=>v.unitId))})},[e.autocorrelograms,l]);const h=_.useMemo(()=>e.autocorrelograms.filter(v=>r.onlyShowSelected?a.has(v.unitId):!0).map(v=>({unitId:v.unitId,key:v.unitId,label:`Unit ${v.unitId}`,labelColor:Ir(Nt(v.unitId)),clickHandler:r.onlyShowSelected?void 0:u(v.unitId),props:{binEdgesSec:v.binEdgesSec,binCounts:v.binCounts,color:Ir(Nt(v.unitId)),width:120*s,height:120*s,hideXAxis:!f}})),[e.autocorrelograms,u,r.onlyShowSelected,a,f,s]),g=_.useMemo(()=>o&&o.length>0?o.map(v=>h.filter(y=>y.unitId===v)[0]).filter(v=>v!==void 0):h,[h,o]),m=_.useMemo(()=>{const v=[{type:"button",callback:()=>c(w=>w*1.3),title:"Increase box size",icon:B.jsx(mf,{})},{type:"button",callback:()=>c(w=>w/1.3),title:"Decrease box size",icon:B.jsx(hf,{})}],y={type:"toggle",subtype:"checkbox",callback:()=>d(w=>!w),title:"Show X Axis",selected:f===!0};return[...v,{type:"divider"},y]},[f]),D=30,p=Pl;return B.jsxs("div",{children:[B.jsxs(su,{width:t,height:n-D,initialPosition:p,adjustable:!1,children:[B.jsx(Hl,{width:p,height:n,customActions:m}),B.jsx(cf,{width:0,height:0,children:B.jsx(sf,{plots:g,plotComponent:yx,selectedPlotKeys:r.onlyShowSelected?void 0:a})})]}),B.jsx("div",{style:{position:"absolute",top:n-D,height:D,overflow:"hidden"},children:B.jsx(sd,{options:r,setOptions:i})})]})},cd=e=>{const[t,n]=_.useState(e.stateRef.current);return _.useEffect(()=>{n(e.stateRef.current);const r=e.onChange(i=>{n(i)});return()=>{r()}},[e.onChange]),t===void 0?{state:void 0,dispatch:void 0}:{state:t,dispatch:e.dispatch}},OO=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=_.useState(null);return _.useEffect(()=>{let o=!1;return(async()=>{const l=[],s=e.attrs.num_autocorrelograms||0;if(s===0){o||a({type:"Autocorrelograms",autocorrelograms:[]});return}const c=await e.getDatasetData("bin_edges_sec",{}),f=await e.getDatasetData("bin_counts",{});if(!c||!f){console.error("Failed to load autocorrelograms data");return}const d=Array.from(c),h=new Int32Array(f),g=d.length-1,m=e.attrs.autocorrelograms;for(let D=0;D<s;D++){const p=m[D],v=D*g,y=Array.from(h.slice(v,v+g));l.push({unitId:p.unit_id,binEdgesSec:d,binCounts:y})}o||a({type:"Autocorrelograms",autocorrelograms:l})})(),()=>{o=!0}},[e]),i?B.jsx(vi,{context:t.unitSelection,children:B.jsx(RO,{data:i,width:n,height:r})}):B.jsx("div",{children:"Loading..."})},vi=({context:e,children:t})=>{const{state:n,dispatch:r}=cd(e);return r?B.jsx(Nb.Provider,{value:{unitSelection:n,unitSelectionDispatch:r},children:t}):B.jsx(B.Fragment,{children:"Waiting for context..."})},zO=e=>{const{unitId:t,mergeGroup:n}=e,r=Ir(Nt(t)),i=n?n.map(a=>`${a}`).join(", "):"";return B.jsxs("span",{children:[B.jsx("div",{className:"unitLabel",style:{backgroundColor:r}})," ",`${t}`,n&&n.length>0&&B.jsx("span",{children:` (${i})`},"mergeGroup")]})},UO=(e,t)=>((t||{}).mergeGroups||[]).filter(r=>r.includes(e))[0]||null,IO=e=>{const{selectedUnitIds:t,currentUnitId:n,selectionDispatch:r,rows:i,columns:a,orderedUnitIds:o,visibleUnitIds:u,primarySortRule:l,height:s,selectionDisabled:c,hideSelectionColumn:f}=e,[d,h]=_.useState(l),g=_.useMemo(()=>u&&u.length>0?u:o,[u,o]),m=_.useMemo(()=>xb({selectedUnitIds:t,orderedUnitIds:o,visibleUnitIds:g}),[t,o,g]),D=_.useCallback((w,E)=>{const b=d?.columnName===w?!d?.sortAscending:!0;h({columnName:w,sortAscending:b}),r&&r({type:"UPDATE_SORT_FIELDS",newSortField:w,ascending:b})},[d,r]),p=_.useCallback(()=>{r&&r(m==="all"?{type:"DESELECT_ALL"}:{type:"TOGGLE_SELECT_ALL"})},[m,r]),v=_.useMemo(()=>{const w=g.map(b=>i.get(b)).filter(b=>b!==void 0);if(!d)return w;const E=a.find(b=>b.columnName===d.columnName);return E?[...w].sort((b,S)=>{const A=b.data[d.columnName]?.sortValue,C=S.data[d.columnName]?.sortValue,M=E.sort(A,C);return d.sortAscending?M:-M}):w},[g,i,d,a]),y=w=>d?.columnName!==w?"":d.sortAscending?"↑":"↓";return B.jsx("div",{className:"compact-table-container",style:{height:s?`${s}px`:"100%",overflow:"auto"},children:B.jsxs("table",{className:"compact-table",children:[B.jsx("thead",{children:B.jsxs("tr",{children:[!f&&B.jsx("th",{className:"compact-table-header",children:B.jsx("input",{type:"checkbox",checked:m==="all",ref:w=>{w&&(w.indeterminate=m==="partial")},onChange:p,disabled:c})}),a.map(w=>B.jsxs("th",{className:"compact-table-header",onClick:()=>D(w.columnName,w),title:w.tooltip,style:{cursor:"pointer"},children:[w.label,B.jsx("span",{className:"sort-indicator",children:y(w.columnName)})]},w.columnName))]})}),B.jsx("tbody",{children:v.map(w=>B.jsxs("tr",{className:`compact-table-row ${t.has(w.rowId)?"selected":""} ${n===w.rowId?"current":""}`,children:[!f&&B.jsx("td",{className:"compact-table-cell",children:B.jsx("input",{type:"checkbox",checked:t.has(w.rowId),onChange:E=>{w.checkboxFn&&w.checkboxFn(E)},disabled:c})}),a.map(E=>B.jsx("td",{className:"compact-table-cell",children:E.dataElement(w.data[E.columnName]?.value)},E.columnName))]},w.rowId))})]})})},$O={},Gp=(e,t)=>{if(t.type!=="REOPEN_CURATION"&&e.isClosed&&console.log(`WARNING: Applying curation action to a closed sorting curation:
|
|
203
|
-
Action: ${t.type}`),t.type==="SET_CURATION")return t.curation;if(t.type==="CLOSE_CURATION")return{...e,isClosed:!0};if(t.type==="REOPEN_CURATION")return{...e,isClosed:!1};if(t.type==="ADD_UNIT_LABEL"){const n=typeof t.unitId=="object"?t.unitId:[t.unitId],r={...e.labelsByUnit||{}};let i=!1;for(const a of n){const o=r[a+""]||[];o.includes(t.label)||(i=!0,r[a+""]=[...o,t.label].sort())}return i?{...e,labelsByUnit:r}:e}else if(t.type==="TOGGLE_UNIT_LABEL"){const n=typeof t.unitId=="object"?t.unitId:[t.unitId];let r=!0;for(const i of n)((e.labelsByUnit||{})[i+""]||[]).includes(t.label)||(r=!1);return r?Gp(e,{type:"REMOVE_UNIT_LABEL",unitId:t.unitId,label:t.label}):Gp(e,{type:"ADD_UNIT_LABEL",unitId:t.unitId,label:t.label})}else if(t.type==="REMOVE_UNIT_LABEL"){const n=typeof t.unitId=="object"?t.unitId:[t.unitId],r={...e.labelsByUnit||{}};let i=!1;for(const a of n){const o=r[a+""]||[];o.includes(t.label)&&(i=!0,r[a+""]=o.filter(u=>u!==t.label))}return i?{...e,labelsByUnit:r}:e}else{if(t.type==="MERGE_UNITS")return{...e,mergeGroups:Dx([...e.mergeGroups||[],t.unitIds])};if(t.type==="UNMERGE_UNITS")return{...e,mergeGroups:Dx((e.mergeGroups||[]).map(n=>n.filter(r=>!t.unitIds.includes(r))))};if(t.type==="SET_LABEL_CHOICES")return{...e,labelChoices:t.labelChoices}}return e},kO={sortingCuration:$O,sortingCurationDispatch:e=>{console.warn("No sortingCurationDispatch function provided.")}},bx=kt.createContext(kO),Vp=()=>{const e=_.useContext(bx);if(!e)throw Error("useSortingCuration must be used within a SortingCurationContext.Provider");return e},LO=(e,t)=>e.filter(n=>t.includes(n)),jO=(e,t)=>[...e,...t.filter(n=>!e.includes(n))].sort(),Dx=e=>{const t=e.map(r=>[...r]);let n=!0;for(;n;){n=!1;for(let r=0;r<t.length;r++){const i=t[r];for(let a=r+1;a<t.length;a++){const o=t[a];LO(i,o).length>0&&(t[r]=jO(i,o),t[a]=[],n=!0)}}}return t.filter(r=>r.length>=2)},Sx=({data:e,width:t,height:n})=>{const[r,i]=_.useState({...ld,onlyShowSelected:!1}),{selectedUnitIds:a,currentUnitId:o,orderedUnitIds:u,visibleUnitIds:l,primarySortRule:s,checkboxClickHandlerGenerator:c,unitIdSelectionDispatch:f}=ii(),{sortingCuration:d}=Vp(),h=_.useMemo(()=>r.onlyShowSelected?l?l.filter(E=>a.has(E)):[...a]:l,[l,a,r.onlyShowSelected]),g=_.useMemo(()=>{const E=[];return E.push({columnName:"_unitId",label:"Unit",tooltip:"Unit ID",sort:(b,S)=>Nt(b)-Nt(S),dataElement:b=>B.jsx(zO,{unitId:b.unitId,mergeGroup:b.mergeGroup}),calculating:!1}),d&&E.push({columnName:"_labels",label:"Labels",tooltip:"Curation labels",sort:(b,S)=>b<S?-1:b>S?1:0,dataElement:b=>B.jsx("span",{children:b.join(", ")}),calculating:!1}),e.similarityScores&&E.push({columnName:"_similarity",label:"Similarity",tooltip:"Similarity with current unit",sort:(b,S)=>{if(b.unitId===o)return 1;if(S.unitId===o)return-1;const A=b.score,C=S.score;return A===void 0&&C!==void 0?-1:A!==void 0&&C===void 0?1:A===void 0&&C===void 0?0:A!==void 0&&C!==void 0?A<C?-1:A>C?1:0:0},dataElement:b=>B.jsx("span",{children:b}),calculating:!1,onlyAllowDescendingSort:!0}),e.columns.filter(b=>b.key!=="unitId").forEach(b=>{E.push({columnName:b.key,label:b.label,tooltip:b.label,sort:b.dtype==="str"?(S,A)=>S<A?-1:S>A?1:0:b.dtype==="int"?(S,A)=>S-A:b.dtype=="bool"?(S,A)=>(S?1:0)-(A?1:0):b.dtype==="float"?(S,A)=>S-A:(S,A)=>S-A,dataElement:S=>B.jsx("span",{children:S}),calculating:!1})}),E},[e.columns,o,d,e.similarityScores]),m=_.useMemo(()=>{for(let b=0;b<0;b++)u.push("never-added");const E={};if(e.similarityScores&&o!==void 0)for(const b of e.similarityScores)b.unitId1===o?E[b.unitId2]=b.similarity:b.unitId2===o&&(E[b.unitId1]=b.similarity);return e.rows.map(b=>{const S=(d?.labelsByUnit||{})[`${b.unitId}`]||[],A={value:{unitId:b.unitId,mergeGroup:UO(b.unitId,d)},sortValue:b.unitId},C=E[b.unitId],M={_unitId:A,_labels:{value:S,sortValue:S.join(", ")},_similarity:{value:C!==void 0?C.toFixed(3):void 0,sortValue:{unitId:b.unitId,score:C}}};for(const T of e.columns){const x=`${b.values[T.key]!==void 0?b.values[T.key]:""}`;M[T.key]={value:x,sortValue:b.values[T.key]}}return{rowId:b.unitId,data:M,checkboxFn:c(b.unitId)}})},[e.rows,e.columns,o,e.similarityScores,d,c,u]);_.useEffect(()=>{f({type:To,newUnitOrder:Nr(m.map(E=>E.rowId))})},[m,f]);const D=_.useMemo(()=>{const E=new Map;return m.forEach(b=>E.set(b.rowId,b)),E},[m]),p=30,v=_.useMemo(()=>({width:t-20,height:n-p,top:0,position:"relative",overflowY:"auto"}),[t,n]),y=_.useCallback(E=>{if(E.ctrlKey)return E.key==="ArrowDown"?f({type:Cb}):E.key==="ArrowUp"?f({type:Mb}):E.key==="Home"?f({type:Tb}):E.key==="End"&&f({type:_b}),!1},[f]),w=_.useCallback(()=>{f({type:"REDISTRIBUTE_UNIT_COLORS"})},[f]);return B.jsxs("div",{children:[B.jsx("div",{style:v,onKeyDown:y,children:B.jsx(IO,{columns:g,rows:D,orderedUnitIds:u,visibleUnitIds:h,selectedUnitIds:a,currentUnitId:o,selectionDispatch:f,primarySortRule:s})}),B.jsx("div",{style:{position:"absolute",top:n-p,height:p,overflow:"hidden"},children:B.jsx(sd,{options:r,setOptions:i,onRedistributeUnitColors:w})})]})},PO=({defaultLabelOptions:e,width:t,height:n})=>{const{selectedUnitIdsArray:r}=ii(),{sortingCuration:i,sortingCurationDispatch:a}=Vp(),{labelChoices:o=[],labelsByUnit:u={},mergeGroups:l=[],isClosed:s=!1}=i,[c,f]=_.useState(""),[d,h]=_.useState(!1),g=_.useMemo(()=>o.length===0&&e.length>0?(a({type:"SET_LABEL_CHOICES",labelChoices:e}),e):o,[o,e,a]),m=_.useCallback($=>{if(r.length===0)return"none";const P=r.filter(H=>(u[H.toString()]||[]).includes($));return P.length===0?"none":P.length===r.length?"full":"partial"},[r,u]),D=_.useCallback($=>{r.length===0||s||a({type:"TOGGLE_UNIT_LABEL",unitId:r,label:$})},[r,s,a]),p=_.useCallback(()=>{const $=c.trim();$&&!g.includes($)&&(a({type:"SET_LABEL_CHOICES",labelChoices:[...g,$]}),f(""))},[c,g,a]),v=_.useCallback($=>Object.values(u).some(P=>P.includes($)),[u]),y=_.useCallback($=>{v($)||a({type:"SET_LABEL_CHOICES",labelChoices:g.filter(P=>P!==$)})},[g,a,v]),w=_.useCallback($=>l.find(P=>P.includes($)),[l]),E=_.useMemo(()=>{if(r.length===0)return{canMerge:!1,canUnmerge:!1,groupsInvolved:[],unmergedUnits:[]};const $=new Set,P=[];r.forEach(q=>{const Y=w(q);Y?$.add(Y):P.push(q)});const H=r.length>=2,j=$.size>0;return{canMerge:H,canUnmerge:j,groupsInvolved:Array.from($),unmergedUnits:P}},[r,w]),b=_.useCallback(()=>{r.length<2||s||a({type:"MERGE_UNITS",unitIds:r})},[r,s,a]),S=_.useCallback(()=>{r.length===0||s||a({type:"UNMERGE_UNITS",unitIds:r})},[r,s,a]),A=_.useCallback(()=>{a(s?{type:"REOPEN_CURATION"}:{type:"CLOSE_CURATION"})},[s,a]),C=_.useMemo(()=>r.length===0?"No units selected":r.length<=5?`Units: ${r.join(", ")}`:`${r.length} units selected`,[r]),M={width:t,height:n,padding:"8px",fontSize:"12px",fontFamily:"Arial, sans-serif",border:"1px solid #ddd",borderRadius:"4px",backgroundColor:"#fafafa",overflow:"auto",display:"flex",flexDirection:"column",gap:"8px"},T={marginBottom:"6px"},x={fontWeight:"bold",marginBottom:"4px",fontSize:"11px",color:"#333"},N={display:"inline-flex",alignItems:"center",padding:"2px 6px",margin:"2px",backgroundColor:"#e0e0e0",borderRadius:"12px",fontSize:"10px",border:"1px solid #ccc"},R={marginLeft:"4px",cursor:"pointer",color:"#666",fontWeight:"bold"},z={padding:"2px 4px",fontSize:"10px",border:"1px solid #ccc",borderRadius:"2px",marginRight:"4px",flex:1},F={padding:"2px 6px",fontSize:"10px",border:"1px solid #ccc",borderRadius:"2px",backgroundColor:"#f0f0f0",cursor:"pointer"},U={display:"inline-flex",alignItems:"center",margin:"2px 8px 2px 0",cursor:r.length>0&&!s?"pointer":"default",opacity:r.length>0&&!s?1:.5},I={...T,textAlign:"center"},L={...F,backgroundColor:s?"#f8d7da":"#d4edda",borderColor:s?"#f5c6cb":"#c3e6cb",color:s?"#721c24":"#155724"},V={display:"flex",alignItems:"center",cursor:"pointer",fontSize:"11px",fontWeight:"bold",color:"#333",marginBottom:"4px"},X={marginRight:"4px",fontSize:"10px",transform:d?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.2s"};return B.jsxs("div",{style:M,children:[B.jsxs("div",{style:T,children:[B.jsx("div",{style:x,children:"Selected Units"}),B.jsx("div",{style:{fontSize:"10px",color:"#666"},children:C})]}),B.jsxs("div",{style:T,children:[B.jsx("div",{style:x,children:"Label Assignment"}),g.map($=>{const P=m($);return B.jsxs("div",{style:U,onClick:()=>D($),children:[B.jsx("input",{type:"checkbox",checked:P==="full",ref:H=>{H&&(H.indeterminate=P==="partial")},onChange:()=>{},style:{marginRight:"4px"},disabled:r.length===0||s}),B.jsx("span",{style:{fontSize:"10px"},children:$})]},$)}),r.length===0&&B.jsx("div",{style:{fontSize:"10px",color:"#999",fontStyle:"italic"},children:"Select units to assign labels"})]}),B.jsxs("div",{style:T,children:[B.jsx("div",{style:x,children:"Unit Merging"}),r.length>0&&E.groupsInvolved.length>0&&B.jsxs("div",{style:{marginBottom:"6px"},children:[B.jsx("div",{style:{fontSize:"10px",color:"#666",marginBottom:"2px"},children:"Merge groups involving selected units:"}),E.groupsInvolved.map(($,P)=>{const H={...N,backgroundColor:"#e3f2fd",borderColor:"#90caf9",color:"#1565c0"};return B.jsx("span",{style:H,children:$.join(", ")},P)})]}),B.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center",flexWrap:"wrap"},children:[B.jsx("button",{onClick:b,style:{...F,backgroundColor:E.canMerge&&!s?"#d4edda":"#f8f9fa",borderColor:E.canMerge&&!s?"#c3e6cb":"#dee2e6",color:E.canMerge&&!s?"#155724":"#6c757d",cursor:E.canMerge&&!s?"pointer":"default"},disabled:!E.canMerge||s,title:s?"Cannot merge when curation is closed":r.length<2?"Select 2 or more units to merge":"Merge selected units",children:"Merge Selected"}),B.jsx("button",{onClick:S,style:{...F,backgroundColor:E.canUnmerge&&!s?"#fff3cd":"#f8f9fa",borderColor:E.canUnmerge&&!s?"#ffeaa7":"#dee2e6",color:E.canUnmerge&&!s?"#856404":"#6c757d",cursor:E.canUnmerge&&!s?"pointer":"default"},disabled:!E.canUnmerge||s,title:s?"Cannot unmerge when curation is closed":E.canUnmerge?"Unmerge selected units":"Select units that are part of merge groups to unmerge",children:"Unmerge Selected"})]}),r.length>0&&B.jsxs("div",{style:{fontSize:"10px",color:"#666",marginTop:"4px"},children:[E.groupsInvolved.length>0&&B.jsxs("div",{children:["Selected units in ",E.groupsInvolved.length," merge group(s)"]}),E.unmergedUnits.length>0&&B.jsxs("div",{children:[E.unmergedUnits.length," unmerged unit(s) selected"]})]}),r.length===0&&B.jsx("div",{style:{fontSize:"10px",color:"#999",fontStyle:"italic",marginTop:"4px"},children:"Select units to merge or unmerge"})]}),B.jsxs("div",{style:T,children:[B.jsxs("div",{style:V,onClick:()=>h(!d),children:[B.jsx("span",{style:X,children:"▶"}),"Manage Label Choices"]}),d&&B.jsxs("div",{children:[B.jsx("div",{style:{marginBottom:"4px"},children:g.map($=>{const P=v($);return B.jsxs("span",{style:N,children:[$,!s&&!P&&B.jsx("span",{style:R,onClick:()=>y($),title:"Remove label choice",children:"×"})]},$)})}),!s&&B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("input",{type:"text",value:c,onChange:$=>f($.target.value),onKeyPress:$=>$.key==="Enter"&&p(),placeholder:"Add label...",style:z}),B.jsx("button",{onClick:p,style:F,disabled:!c.trim(),children:"Add"})]})]})]}),B.jsxs("div",{style:I,children:[B.jsx("button",{onClick:A,style:L,children:s?"Reopen Curation":"Finalize Curation"}),B.jsxs("div",{style:{fontSize:"10px",color:"#666",marginTop:"2px"},children:["Status: ",s?"Closed":"Open"]})]})]})},HO=({zarrGroup:e,contexts:t,width:n,height:r})=>B.jsx(vi,{context:t.unitSelection,children:B.jsx(wx,{context:t.sortingCuration,children:B.jsx(qO,{zarrGroup:e,contexts:t,width:n,height:r})})}),qO=({zarrGroup:e,width:t,height:n})=>{const r=e.attrs.default_label_options||[],i=GO(e),{sortingCuration:a,sortingCurationDispatch:o}=Vp();_.useEffect(()=>{o({type:"SET_CURATION",curation:i||{}})},[i]);const u=_.useCallback(()=>{if(i===null||!e.createDataset||VO(a,i))return;const s=new TextEncoder().encode(JSON.stringify(a));e.createDataset("curation",s,{shape:[s.length],dtype:"uint8",attrs:{}})},[a,e,i]),l=_.useRef(u);return _.useEffect(()=>{l.current=u},[u]),_.useEffect(()=>{const s=setInterval(()=>{l.current()},500);return()=>{clearInterval(s)}},[u]),i?B.jsx(PO,{defaultLabelOptions:r,width:t,height:n}):B.jsx("div",{children:"Loading..."})},GO=e=>{const[t,n]=_.useState(null);return _.useEffect(()=>{let r=!1;return(async()=>{try{const a=await e.getDatasetData("curation",{});if(a&&a.length>0){const o=new Uint8Array(a),u=new TextDecoder("utf-8").decode(o),l=JSON.parse(u);r||n(l)}else r||n({})}catch(a){console.error("Error loading sorting curation:",a),r||n({})}})(),()=>{r=!0}},[e]),t},wx=({context:e,children:t})=>{const{state:n,dispatch:r}=cd(e);return r?B.jsx(bx.Provider,{value:{sortingCuration:n,sortingCurationDispatch:r},children:t}):B.jsx(B.Fragment,{children:"Waiting for context..."})},VO=(e,t)=>{if(e.isClosed!==t.isClosed)return!1;const n=e.labelChoices||[],r=t.labelChoices||[];if(n.length!==r.length||!n.every((c,f)=>c===r[f]))return!1;const i=e.labelsByUnit||{},a=t.labelsByUnit||{},o=Object.keys(i),u=Object.keys(a);if(o.length!==u.length||!o.every(c=>u.includes(c)))return!1;for(const c of o){const f=i[c]||[],d=a[c]||[];if(f.length!==d.length||!f.every((h,g)=>h===d[g]))return!1}const l=e.mergeGroups||[],s=t.mergeGroups||[];if(l.length!==s.length)return!1;for(let c=0;c<l.length;c++){const f=l[c],d=s[c];if(f.length!==d.length||!f.every((h,g)=>h===d[g]))return!1}return!0},YO=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=_.useState(null),[o,u]=_.useState(null),[l,s]=_.useState(!0);return _.useEffect(()=>{let c=!1;return(async()=>{try{s(!0),u(null);const d=e.attrs.columns||[],h=await e.getDatasetData("rows_data",{});if(!h||h.length===0)throw new Error("Empty rows data");const g=new Uint8Array(h),m=new TextDecoder("utf-8").decode(g),D=JSON.parse(m);let p;try{const v=await e.getDatasetData("similarity_scores_data",{});if(v&&v.length>0){const y=new Uint8Array(v),w=new TextDecoder("utf-8").decode(y);p=JSON.parse(w)}}catch{console.debug("No similarity scores found")}if(c)return;a({type:"UnitsTable",columns:d,rows:D,similarityScores:p})}catch(d){console.error("Error loading units table data:",d),u(`Failed to load units table data: ${d instanceof Error?d.message:String(d)}`)}finally{s(!1)}})(),()=>{c=!0}},[e]),o?B.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading units table data..."}):i?B.jsx(vi,{context:t.unitSelection,children:B.jsx(wx,{context:t.sortingCuration,children:B.jsx(Sx,{data:i,width:n,height:r})})}):B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No units table data available"})},XO=e=>{const{ampScaleFactor:t,setAmpScaleFactor:n}=e,r=()=>{n(t*1.2)},i=()=>{n(t/1.2)},a=()=>{n(1)};return[{type:"button",callback:r,title:"Scale amplitude up [shift + mouse-wheel]",icon:B.jsx(g7,{}),keyCode:38},{type:"button",callback:a,title:"Reset scale amplitude",icon:B.jsx(qS,{})},{type:"button",callback:i,title:"Scale amplitude down [shift + mouse-wheel]",icon:B.jsx(h7,{}),keyCode:40}]},xx={forward:[[1,0,0],[0,1,0]],inverse:[[1,0,0],[0,1,0]]},Oa=(e,t)=>({x:t.x*e.forward[0][0]+t.y*e.forward[0][1]+e.forward[0][2],y:t.x*e.forward[1][0]+t.y*e.forward[1][1]+e.forward[1][2]}),Yp=(e,t)=>({x:t.x*e.inverse[0][0]+t.y*e.inverse[0][1]+e.inverse[0][2],y:t.x*e.inverse[1][0]+t.y*e.inverse[1][1]+e.inverse[1][2]}),ZO=(e,t)=>({forward:Ex(e.forward,t.forward),inverse:Ex(t.inverse,e.inverse)}),KO=e=>({forward:[...e.map(t=>[...t])],inverse:WO(e)}),QO=e=>({forward:e.inverse,inverse:e.forward}),Xp=e=>e.forward[0][0]*e.forward[1][1]-e.forward[0][1]*e.forward[1][0],Ex=(e,t)=>[[e[0][0]*t[0][0]+e[0][1]*t[1][0],e[0][0]*t[0][1]+e[0][1]*t[1][1],e[0][0]*t[0][2]+e[0][1]*t[1][2]+e[0][2]],[e[1][0]*t[0][0]+e[1][1]*t[1][0],e[1][0]*t[0][1]+e[1][1]*t[1][1],e[1][0]*t[0][2]+e[1][1]*t[1][2]+e[1][2]]],WO=e=>{const t=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],n=[e[0][2],e[1][2]],r=t[0][0]*t[1][1]-t[0][1]*t[1][0],i=[[t[1][1]/r,-t[0][1]/r],[-t[1][0]/r,t[0][0]/r]],a=[i[0][0]*n[0]+i[0][1]*n[1],i[1][0]*n[0]+i[1][1]*n[1]];return[[i[0][0],i[0][1],-a[0]],[i[1][0],i[1][1],-a[1]]]},Zp=(e,t,n={})=>{const r=n.shift!==void 0?n.shift:!0,i=n.shift!==void 0?n.alt:!1,[a,o]=_.useState(xx),u=_.useCallback(l=>{if(r&&!l.shiftKey||!r&&l.shiftKey||i&&!l.altKey||!i&&l.altKey)return;const s=l.currentTarget.getBoundingClientRect(),c={x:l.clientX-s.x,y:l.clientY-s.y},f=l.deltaY,d=1.3;let h=KO([[d,0,(1-d)*c.x],[0,d,(1-d)*c.y]]);f>0&&(h=QO(h));let g=ZO(h,a);const m=Oa(g,{x:0,y:0}),D=Oa(g,{x:e,y:t});return 0<=m.x&&m.x<e&&0<=m.y&&m.y<t&&0<=D.x&&D.x<e&&0<=D.y&&D.y<t&&(g=xx),o(g),!1},[a,t,e,r,i]);return{affineTransform:a,handleWheel:u}},ql={border:"rgb(30, 30, 30)",base:"rgb(0, 0, 255)",selected:"rgb(50, 200, 50)",hover:"rgb(128, 128, 255)",selectedHover:"rgb(200, 200, 196)",dragged:"rgb(0, 0, 196)",draggedSelected:"rgb(180, 180, 150)",dragRect:"rgba(196, 196, 196, 0.5)",textLight:"rgb(228, 228, 228)",textDark:"rgb(32, 32, 32)"},JO=2*Math.PI,ez=(e,t)=>{const{layoutMode:n,affineTransform:r}=t;if(e.save(),r){const i=r.forward;e.transform(i[0][0],i[1][0],i[0][1],i[1][1],i[0][2],i[1][2])}n==="geom"?nz(e,t):tz(e,t),e.restore()},tz=(e,t)=>{const{pixelElectrodes:n,pixelRadius:r,showLabels:i,xMargin:a}=t,o=r>5&&i,u=t.colors??ql,l=o?2*r:0;e.clearRect(0,0,e.canvas.width,e.canvas.height);const s=a+l,c=e.canvas.width-a;if(e.beginPath(),n.forEach(f=>{e.moveTo(s,f.pixelY),e.lineTo(c,f.pixelY)}),e.strokeStyle=u.border,e.stroke(),o){const f=s-.5*r;e.font=`${r-3}px Arial`,e.fillStyle=u.textDark,e.textAlign="right",e.textBaseline="middle",n.forEach(d=>{e.fillText(`${d.e.label}`,f,d.pixelY)})}},nz=(e,t)=>{const{pixelElectrodes:n,selectedElectrodeIds:r,hoveredElectrodeId:i,draggedElectrodeIds:a,pixelRadius:o,showLabels:u,offsetLabels:l}=t,s=o>5&&u,c=t.colors??ql,f=n.map(d=>{const h=r.includes(d.e.id),g=(i??-1)===d.e.id,m=a.includes(d.e.id),D=h?m?c.draggedSelected:g?c.selectedHover:c.selected:m?c.dragged:g?c.hover:c.base;return{...d,color:D,textColor:h||g&&!m?c.textDark:c.textLight}});if(e.clearRect(0,0,e.canvas.width,e.canvas.height),f.forEach(d=>{e.fillStyle=d.color,e.beginPath(),e.ellipse(d.pixelX,d.pixelY,o,o,0,0,JO),e.fill()}),s){e.font=`${o}px Arial`,e.textAlign=l?"right":"center",e.textBaseline="middle";const d=l?1.4*o:0;f.forEach(h=>{e.fillStyle=l?c.textDark:h.textColor,e.fillText(`${h.e.label}`,h.pixelX-d,h.pixelY)})}},fd=e=>e.reduce((t,n)=>t<=n?t:n,1/0),dd=e=>e.reduce((t,n)=>t>=n?t:n,-1/0),cu=10,Gl=10,rz=(e,t)=>{const n=t||{};return t&&(Object.keys(n).length!==e.length||e.some(i=>!n[`${i}`]))?(console.warn("Attempt to compute electrode locations with mismatched lists. Skipping..."),[]):e.map(i=>{const a=n[`${i}`]||[i,0];return{id:i,label:`${i}`,x:a[0],y:a[1]}})},Ax=new Map,Cx=e=>{const t=JSON.stringify(e),n=Ax.get(t);if(n!==void 0)return n;let r=Number.MAX_VALUE;e.forEach(a=>{e.forEach(o=>{const u=BS([a.x-o.x,a.y-o.y]);u!==0&&(r=Math.min(r,u))})});const i=.45*r;return Ax.set(t,i),i},Mx=(e,t)=>({xmin:fd(e.map(n=>n.x))-t,xmax:dd(e.map(n=>n.x))+t,ymin:fd(e.map(n=>n.y))-t,ymax:dd(e.map(n=>n.y))+t}),iz=e=>{const t=Cx(e),n=Mx(e,t),r=lf(n),i=NS(n),a={x:r/2+n.xmin,y:i/2+n.ymin};return{boxAspect:r/i,boxCenter:a}},az=e=>{const t={xmin:fd(e.map(n=>n.x)),xmax:dd(e.map(n=>n.x)),ymin:fd(e.map(n=>n.y)),ymax:dd(e.map(n=>n.y))};return t.xmin===t.xmax&&t.ymin===t.ymax?e.map((n,r)=>({...n,x:r,y:0})):e},oz=(e,t)=>Q9(n=>{const r=cu+n[0]*(e-2*cu),i=Gl+n[1]*(t-2*Gl);return[r,i]}),uz=(e,t)=>{const n=e.map((a,o)=>({e:a,ind:o})).sort((a,o)=>-a.e.y+o.e.y).map(a=>a.ind),r=[];for(let a=0;a<e.length;a++)r.push([0,0]);for(let a=0;a<n.length;a++){const o=n[a];r[o]=[.5,(.5+a)/(1+e.length)]}const i=np(t,r);return e.map((a,o)=>{const[u,l]=i[o];return{e:a,pixelX:u,pixelY:l}})},lz=(e,t,n,r,i)=>{const a=e-cu*2,o=t-Gl*2,u=lf(i),l=NS(i);return T9(a/u,o/l,r/n)},sz=(e,t,n,r)=>{const i=lf(r),a=(e-i*n)/2,o=[n,0,a-r.xmin*n],u=[0,-n,(t+n*(r.ymin+r.ymax))/2];return[o,u,[0,0,1]]},cz=(e,t,n,r={})=>{const i=(e-cu*2)/(t-Gl*2),a=az(n),{boxAspect:o}=iz(a);return r.disableAutoRotate||o===1||i===1||o>1==i>1?{electrodes:n,rotated:!1}:{electrodes:n.map(u=>({...u,x:u.y,y:-u.x})),rotated:!0}},fz=(e,t)=>{const n=e.map(i=>[i.x,i.y]),r=np(t,n);return e.map((i,a)=>{const[o,u]=r[a];return{e:i,pixelX:o,pixelY:u}})},Tx=(e,t,n)=>{for(const r of e)if(BS([r.pixelX-n[0],r.pixelY-n[1]])<t)return r.e.id},_x=(e,t,n)=>{const r=t.xmin-n,i=t.xmax+n,a=t.ymin-n,o=t.ymax+n;return e.filter(u=>u.pixelX>r&&u.pixelX<i&&u.pixelY>a&&u.pixelY<o).map(u=>u.e.id)},Kp=(e,t,n,r="geom",i=Fx,a)=>{if(r==="vertical"){const m=oz(e,t),D=uz(n,m),p=(t-2*Gl)/(1+n.length);return{transform:m,convertedElectrodes:D,pixelRadius:p}}const{electrodes:o,rotated:u}=cz(e,t,n,{disableAutoRotate:a.disableAutoRotate}),l=Cx(o),s=Mx(o,l),c=lz(e,t,l,i,s),f=l*c;let d=sz(e,t,c,s);const h=(e-lf(s)*c)/2,g=fz(o,d);return u&&(d=[[-d[0][1],d[0][0],d[0][2]],[-d[1][1],d[1][0],d[1][2]],[-d[2][1],d[2][0],d[2][2]]]),{transform:d,convertedElectrodes:g,pixelRadius:f,xMargin:h}},Bx={isActive:!1},dz=(e,t)=>{if(t.type==="INITIALIZE"){const{width:n,height:r,electrodes:i,layoutMode:a,maxElectrodePixelRadius:o}=t,{convertedElectrodes:u,pixelRadius:l,xMargin:s}=Kp(n,r,i,a,o,{disableAutoRotate:t.disableAutoRotate});return{...e,convertedElectrodes:u,pixelRadius:l,draggedElectrodeIds:[],hoveredElectrodeId:void 0,dragState:Bx,xMarginWidth:s??cu}}else if(t.type==="DRAGUPDATE"){const n=G9(e.dragState,t.dragAction);if(!n.isActive&&n.dragRect){const r=RS(n.dragRect),i=_x(e.convertedElectrodes,r,e.pixelRadius),a=t.dragAction.shift?[...i,...t.selectedElectrodeIds||[]]:i;return{...e,draggedElectrodeIds:[],hoveredElectrodeId:void 0,pendingSelectedElectrodeIds:a,dragState:Bx}}else if(n.dragRect){const r=RS(n.dragRect),i=_x(e.convertedElectrodes,r,e.pixelRadius);return i.length===e.draggedElectrodeIds.length&&i.filter(a=>!e.draggedElectrodeIds.includes(a)).length===0?{...e,hoveredElectrodeId:void 0,dragState:n}:{...e,hoveredElectrodeId:void 0,draggedElectrodeIds:i,dragState:n}}else return{...e,dragState:n}}else if(t.type==="UPDATEHOVER"){const n=Tx(e.convertedElectrodes,e.pixelRadius,t.point);return n===e.hoveredElectrodeId?e:{...e,hoveredElectrodeId:n}}else if(t.type==="UPDATECLICK"){const n=Tx(e.convertedElectrodes,e.pixelRadius,t.point);if(n===void 0)return!(t.shift||t.ctrl)&&t.selectedElectrodeIds.length>0?{...e,pendingSelectedElectrodeIds:[]}:e;const r=t.ctrl?t.selectedElectrodeIds.includes(n)?t.selectedElectrodeIds.filter(i=>i!==n):[...t.selectedElectrodeIds,n]:t.shift?[...t.selectedElectrodeIds,n]:[n];return{...e,hoveredElectrodeId:void 0,pendingSelectedElectrodeIds:r}}else return console.log("Error: unrecognized verb in electrode geometry reducer."),e},Nx=!1,Fx=25,Rx={showLabels:!0,maxElectrodePixelRadius:Fx},hz=e=>{const t=e.currentTarget.getBoundingClientRect();return[e.clientX-t.x,e.clientY-t.y]},mz=()=>({selectedElectrodeIds:[],setSelectedElectrodeIds:e=>{}}),Ox=e=>{const{width:t,height:n,electrodes:r,disableAutoRotate:i,affineTransform:a}=e,{selectedElectrodeIds:o,setSelectedElectrodeIds:u}=mz(),l=e.disableSelection??!1,s=e.offsetLabels??!1,c=e.colors??ql,f=e.layoutMode??"geom",d=e.maxElectrodePixelRadius||Rx.maxElectrodePixelRadius,[h,g]=_.useReducer(dz,{convertedElectrodes:[],pixelRadius:-1,draggedElectrodeIds:[],pendingSelectedElectrodeIds:o||[],dragState:{isActive:!1},xMarginWidth:-1}),{affineTransform:m,handleWheel:D}=Zp(t,n,{shift:!0,alt:!1}),p=_.useMemo(()=>{const M=h.convertedElectrodes.map(T=>{const x=Oa(m,{x:T.pixelX,y:T.pixelY});return{...T,pixelX:x.x,pixelY:x.y}});return{...h,convertedElectrodes:M,pixelRadius:h.pixelRadius*Math.sqrt(Xp(m))}},[m,h]),v=_.useMemo(()=>M=>{const T=hz(M),x=Yp(m,{x:T[0],y:T[1]});return[x.x,x.y]},[m]);_.useEffect(()=>{g({type:"INITIALIZE",electrodes:r,width:t,height:n,maxElectrodePixelRadius:d,layoutMode:f,disableAutoRotate:i})},[t,n,r,f,d,i]),_.useEffect(()=>{u(h.pendingSelectedElectrodeIds)},[u,h.pendingSelectedElectrodeIds]);const y=_.useRef(null),w=_.useRef(0),E=l||B.jsx(K9,{width:t,height:n,newState:h.dragState}),b=_.useCallback(M=>{if(!Y9(M,{nextDragStateUpdate:y,nextFrame:w,reducer:g,reducerOtherProps:{type:"DRAGUPDATE"}})){const x=v(M);g({type:"UPDATEHOVER",point:x})}},[v]),S=_.useCallback(M=>{X9(M,{nextDragStateUpdate:y,reducer:g,reducerOtherProps:{type:"DRAGUPDATE"}})},[]),A=_.useCallback(M=>{if(h.dragState.isActive)Z9(M,{nextDragStateUpdate:y,reducer:g,reducerOtherProps:{type:"DRAGUPDATE",selectedElectrodeIds:o}});else{const T=v(M);g({type:"UPDATECLICK",point:T,shift:M.shiftKey,ctrl:M.ctrlKey,selectedElectrodeIds:o||[]})}},[h.dragState.isActive,o,v]),C=_.useMemo(()=>{const M={pixelElectrodes:p.convertedElectrodes,selectedElectrodeIds:o||[],hoveredElectrodeId:h.hoveredElectrodeId,draggedElectrodeIds:h.draggedElectrodeIds,pixelRadius:p.pixelRadius,showLabels:e.showLabels??Rx.showLabels,offsetLabels:s,layoutMode:e.layoutMode??"geom",xMargin:h.xMarginWidth,colors:c,affineTransform:a};return B.jsx(vr,{width:t,height:n,draw:ez,drawData:M})},[t,n,p.convertedElectrodes,o,h.hoveredElectrodeId,h.draggedElectrodeIds,p.pixelRadius,e.showLabels,s,e.layoutMode,h.xMarginWidth,c,a]);return _.useMemo(()=>Nx,[h.convertedElectrodes,o,h.hoveredElectrodeId,h.draggedElectrodeIds,h.pixelRadius,e.showLabels,s,e.layoutMode,h.xMarginWidth,t,n,c]),B.jsxs("div",{style:{width:t,height:n,position:"relative"},onMouseMove:b,onMouseUp:A,onMouseDown:S,onWheel:D,children:[E,Nx,C]})},pz=e=>1/e,za=(e,t,n,r,i)=>{const a=[];return n.forEach((o,u)=>{for(const l of t){const s=l.electrodeIndices.indexOf(u);if(s>=0){let c;const f=l.waveformStdDev,d=l.waveformPercentiles;if(r==="normal"?c=l.waveform[s]:r==="lower"?c=f?l.waveform[s].map((h,g)=>l.waveform[s][g]-f[s][g]):void 0:r==="upper"?c=f?l.waveform[s].map((h,g)=>l.waveform[s][g]+f[s][g]):void 0:r==="percentile1"?c=d?l.waveform[s].map((h,g)=>d[0][s][g]):void 0:r==="percentile2"?c=d?l.waveform[s].map((h,g)=>d[1][s][g]):void 0:r==="percentile3"?c=d&&2<d.length?l.waveform[s].map((h,g)=>d[2][s][g]):void 0:r==="percentile4"&&(c=d&&3<d.length?l.waveform[s].map((h,g)=>d[3][s][g]):void 0),c){const h=c.map((m,D)=>[(c?.length||0)/2+(D-(c?.length||0)/2)*i,m]),g=np(e,h);a.push({pointsInPaintBox:g,offsetFromParentCenter:[o.pixelX,o.pixelY],color:l.waveformColors.base})}}}}),a},gz=(e,t)=>{const{pixelSpacePaths:n,pixelSpacePathsLower:r,pixelSpacePathsUpper:i,pixelSpacePathsPercentile1:a,pixelSpacePathsPercentile2:o,pixelSpacePathsPercentile3:u,pixelSpacePathsPercentile4:l,xMargin:s,waveformWidth:c,affineTransform:f,useUnitColors:d}=t;if(!n||n.length===0)return;if(e.resetTransform(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.save(),f){const v=f.forward;e.transform(v[0][0],v[1][0],v[0][1],v[1][1],v[0][2],v[1][2])}e.translate(s,0);const h=e.getTransform();r&&i&&r.forEach((v,y)=>{const w=r[y],E=i[y];e.fillStyle="#dddddd",e.strokeStyle="#bbbbbb",e.lineWidth=1,e.translate(w.offsetFromParentCenter[0],w.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(w.pointsInPaintBox[0][0],w.pointsInPaintBox[0][1]);for(let b=0;b<w.pointsInPaintBox.length;b++)e.lineTo(w.pointsInPaintBox[b][0],w.pointsInPaintBox[b][1]);for(let b=E.pointsInPaintBox.length-1;b>=0;b--)e.lineTo(E.pointsInPaintBox[b][0],E.pointsInPaintBox[b][1]);e.fill(),e.stroke(),e.setTransform(h)});let g,m,D,p;a&&o&&u&&l?(g=a,m=o,D=u,p=l):a&&o&&!u&&!l?(g=void 0,m=a,D=o,p=void 0):(g=void 0,m=void 0,D=void 0,p=void 0),g&&g.length>0&&p&&p.length>0&&g.forEach((v,y)=>{if(!g||!p)throw Error("unexpected");const w=g[y],E=p[y];e.fillStyle="#dddddd",e.strokeStyle="#dddddd",e.lineWidth=1,e.translate(w.offsetFromParentCenter[0],w.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(w.pointsInPaintBox[0][0],w.pointsInPaintBox[0][1]);for(let b=0;b<w.pointsInPaintBox.length;b++)e.lineTo(w.pointsInPaintBox[b][0],w.pointsInPaintBox[b][1]);for(let b=E.pointsInPaintBox.length-1;b>=0;b--)e.lineTo(E.pointsInPaintBox[b][0],E.pointsInPaintBox[b][1]);e.fill(),e.stroke(),e.setTransform(h)}),m&&m.length>0&&m.length>0&&D&&D.length>0&&m.forEach((v,y)=>{if(!m||!D)throw Error("unexpected");const w=m[y],E=D[y];e.fillStyle="#bbbbbb",e.strokeStyle="#bbbbbb",e.lineWidth=1,e.translate(w.offsetFromParentCenter[0],w.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(w.pointsInPaintBox[0][0],w.pointsInPaintBox[0][1]);for(let b=0;b<w.pointsInPaintBox.length;b++)e.lineTo(w.pointsInPaintBox[b][0],w.pointsInPaintBox[b][1]);for(let b=E.pointsInPaintBox.length-1;b>=0;b--)e.lineTo(E.pointsInPaintBox[b][0],E.pointsInPaintBox[b][1]);e.fill(),e.stroke(),e.setTransform(h)}),n.forEach(v=>{e.strokeStyle=d?v.color:"black",e.lineWidth=c,e.translate(v.offsetFromParentCenter[0],v.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(v.pointsInPaintBox[0][0],v.pointsInPaintBox[0][1]),v.pointsInPaintBox.forEach(y=>{e.lineTo(y[0],y[1])}),e.stroke(),e.setTransform(h)}),e.restore()},vz=e=>{const{electrodes:t,waveforms:n,oneElectrodeHeight:r,oneElectrodeWidth:i,yScale:a,horizontalStretchFactor:o,width:u,height:l,layoutMode:s,waveformWidth:c,affineTransform:f,useUnitColors:d}=e;return _.useMemo(()=>{const g=n.length>0&&n[0].waveform.length>0?n[0].waveform[0].length:0,m=i/g,D=-i*(.5+1/g),p=a*r/2,v=Le([[m,0,D],[0,-p,0],[0,0,1]]).toArray(),y=za(v,n,t,"normal",o),w=za(v,n,t,"lower",o),E=za(v,n,t,"upper",o);let b=za(v,n,t,"percentile1",o),S=za(v,n,t,"percentile2",o),A=za(v,n,t,"percentile3",o),C=za(v,n,t,"percentile4",o);b.length===0&&(b=void 0),S.length===0&&(S=void 0),A.length===0&&(A=void 0),C.length===0&&(C=void 0);const M=s==="vertical"?(u-i)/2:0,T={pixelSpacePaths:y,pixelSpacePathsLower:w,pixelSpacePathsUpper:E,pixelSpacePathsPercentile1:b,pixelSpacePathsPercentile2:S,pixelSpacePathsPercentile3:A,pixelSpacePathsPercentile4:C,xMargin:M,waveformWidth:c,affineTransform:f,useUnitColors:d};return B.jsx(vr,{width:u,height:l,draw:gz,drawData:T})},[n,t,a,u,l,i,r,s,c,f,o,d])},yz={colors:{border:"rgb(120, 100, 120)",base:"rgb(240, 240, 240)",selected:"rgb(196, 196, 128)",hover:"rgb(128, 128, 255)",selectedHover:"rgb(200, 200, 196)",dragged:"rgb(0, 0, 196)",draggedSelected:"rgb(180, 180, 150)",dragRect:"rgba(196, 196, 196, 0.5)",textLight:"rgb(162, 162, 162)",textDark:"rgb(32, 150, 150)"}},bz=e=>{const t=e.colors??yz.colors,{electrodes:n,waveforms:r,ampScaleFactor:i,horizontalStretchFactor:a,layoutMode:o,hideElectrodes:u,width:l,height:s,showChannelIds:c,useUnitColors:f,waveformWidth:d,disableAutoRotate:h}=e,g=1e3,{handleWheel:m,affineTransform:D}=Zp(l,s,{shift:!0,alt:!0}),p=_.useMemo(()=>B.jsx(Ox,{electrodes:n,width:l,height:s,layoutMode:o,colors:t,showLabels:c,maxElectrodePixelRadius:g,disableSelection:!0,disableAutoRotate:h,affineTransform:D}),[n,l,s,o,t,c,h,D]),{convertedElectrodes:v,pixelRadius:y,xMargin:w}=Kp(l,s,n,o,g,{disableAutoRotate:h}),E=w||cu,b=_.useMemo(()=>pz(e.peakAmplitude),[e.peakAmplitude]),S=_.useMemo(()=>i*b,[i,b]),A=o==="geom"?y*2:s/n.length,C=o==="geom"?y*2:l-E-(c?2*y:0),M=B.jsx(vz,{electrodes:v,waveforms:r,oneElectrodeHeight:A,oneElectrodeWidth:C,horizontalStretchFactor:a,yScale:S,width:l,height:s,layoutMode:o,waveformWidth:d,affineTransform:D,useUnitColors:f});return B.jsxs("div",{style:{width:l,height:s,position:"relative"},onWheel:m,children:[!u&&p,M]})},Dz=({allChannelIds:e,channelIds:t,units:n,layoutMode:r,hideElectrodes:i,channelLocations:a,samplingFrequency:o,peakAmplitude:u,ampScaleFactor:l,horizontalStretchFactor:s,showChannelIds:c,useUnitColors:f,showReferenceProbe:d,disableAutoRotate:h,width:g,height:m})=>{const D=_.useMemo(()=>{const E=a||{};return t.map(b=>({id:b,label:`${b}`,x:E[`${b}`]!==void 0?E[`${b}`][0]:Nt(b),y:E[`${b}`]!==void 0?E[`${b}`][1]:0}))},[t,a]),p=_.useMemo(()=>{const E=a||{};return e.map(b=>({id:b,label:`${b}`,x:E[`${b}`]!==void 0?E[`${b}`][0]:Nt(b),y:E[`${b}`]!==void 0?E[`${b}`][1]:0}))},[e,a]),v=g/4,y=_.useMemo(()=>n.map(E=>{const b={base:E.waveformColor},S=[];for(const A of E.channelIds)S.push(D.map(C=>C.id).indexOf(A));return{electrodeIndices:S,waveform:E.waveform,waveformStdDev:E.waveformStdDev,waveformPercentiles:E.waveformPercentiles,waveformColors:b}}),[D,n]),w=B.jsx(bz,{waveforms:y,electrodes:D,ampScaleFactor:l,horizontalStretchFactor:s,layoutMode:a?r:"vertical",hideElectrodes:i,width:d?g-v:g,height:m,showLabels:!0,peakAmplitude:u,samplingFrequency:o,showChannelIds:c,useUnitColors:f,waveformWidth:2,disableAutoRotate:h});return d?B.jsxs("div",{style:{position:"relative",width:g,height:m},children:[B.jsx("div",{style:{position:"absolute",left:0,top:0,width:v,height:m},children:B.jsx(Ox,{electrodes:p,disableSelection:!1,width:v,height:m})}),B.jsx("div",{style:{position:"absolute",left:v,top:0,width:g-v,height:m},children:w})]}):w},Sz=({data:e,width:t,height:n})=>{const r=_.useMemo(()=>{const j=[];for(const q of e.averageWaveforms)for(const Y of q.channelIds)j.includes(Y)||j.push(Y);return Nr(j)},[e.averageWaveforms]),[i,a]=_.useState({...ld,onlyShowSelected:!1}),{selectedUnitIds:o,currentUnitId:u,orderedUnitIds:l,plotClickHandlerGenerator:s,unitIdSelectionDispatch:c}=ii(),[f,d]=_.useState(1),[h,g]=_.useState("geom"),[m,D]=_.useState(!0),[p,v]=_.useState(!1),[y,w]=_.useState(e.showReferenceProbe||!1),[E,b]=_.useState(!1),[S,A]=_.useState(1),[C,M]=_.useState(!0),[T,x]=_.useState(!0);_.useEffect(()=>{c({type:To,newUnitOrder:Nr(e.averageWaveforms.map(j=>j.unitId))})},[e.averageWaveforms,c]);const[N,R]=_.useState(2),z=_.useMemo(()=>{let j=0;return e.averageWaveforms.forEach(q=>{q.waveform.forEach(Y=>{Y.forEach(te=>{const ee=Math.abs(te);ee>j&&(j=ee)})})}),j},[e.averageWaveforms]),F=_.useMemo(()=>e.averageWaveforms.filter(j=>i.onlyShowSelected?o.has(j.unitId):!0).map(j=>{const q=[{channelIds:j.channelIds,waveform:xz(j.waveform),waveformStdDev:m&&!E?j.waveformStdDev:void 0,waveformPercentiles:m&&!E&&j.waveformPercentiles?Ez(j.waveformPercentiles,j.waveform):void 0,waveformColor:Ir(Nt(j.unitId))}],Y={allChannelIds:r,channelIds:j.channelIds,units:q,layoutMode:h,hideElectrodes:C,channelLocations:e.channelLocations,samplingFrequency:e.samplingFrequency,peakAmplitude:z,ampScaleFactor:f,horizontalStretchFactor:S,showChannelIds:p,useUnitColors:T,width:120*N+(y?120*N/4:0),height:120*N,showReferenceProbe:y,disableAutoRotate:!0};return{unitId:j.unitId,key:j.unitId,label:`Unit ${j.unitId}`,labelColor:Ir(Nt(j.unitId)),clickHandler:i.onlyShowSelected?void 0:s(j.unitId),props:Y}}),[e.averageWaveforms,e.channelLocations,e.samplingFrequency,r,z,h,f,s,i.onlyShowSelected,o,N,m,p,y,E,S,C,T]),U=_.useMemo(()=>l?l.map(j=>F.filter(q=>q.unitId===j)[0]).filter(j=>j!==void 0):F,[F,l]),I=_.useMemo(()=>E?wz(U):U,[U,E]),L=_.useMemo(()=>[{type:"button",callback:()=>{A(j=>j*1.1)},title:"Increase horizontal stretch [alt + mouse-wheel]",icon:B.jsx(p7,{})},{type:"button",callback:()=>{A(1)},title:"Reset scale amplitude",icon:B.jsx(qS,{})},{type:"button",callback:()=>{A(j=>j/1.1)},title:"Decrease horizontal stretch [alt + mouse-wheel]",icon:B.jsx(m7,{})}],[]),V=_.useMemo(()=>{const j=XO({ampScaleFactor:f,setAmpScaleFactor:d}),q={type:"toggle",subtype:"checkbox",callback:()=>g(he=>he==="geom"?"vertical":"geom"),title:"Show electrode geometry",selected:h==="geom"},Y={type:"toggle",subtype:"checkbox",callback:()=>M(he=>!he),title:"Show electrodes",selected:!C},te=[{type:"button",callback:()=>R(he=>he*1.3),title:"Increase box size",icon:B.jsx(mf,{})},{type:"button",callback:()=>R(he=>he/1.3),title:"Decrease box size",icon:B.jsx(hf,{})}],ee={type:"toggle",subtype:"checkbox",callback:()=>D(he=>!he),title:"Show waveform stdev",selected:m===!0},ne={type:"toggle",subtype:"checkbox",callback:()=>v(he=>!he),title:"Show channel IDs",selected:p===!0},ue={type:"toggle",subtype:"checkbox",callback:()=>w(he=>!he),title:"Show reference probes",selected:y===!0},W={type:"toggle",subtype:"checkbox",callback:()=>b(he=>!he),title:"Show overlapping",selected:E===!0},fe={type:"toggle",subtype:"checkbox",callback:()=>x(he=>!he),title:"Use unit colors",selected:T===!0};return[{type:"divider"},...te,{type:"divider"},...j,{type:"divider"},...L,{type:"divider"},q,Y,{type:"divider"},ee,{type:"divider"},ne,{type:"divider"},ue,{type:"divider"},W,{type:"divider"},fe]},[h,f,m,p,E,y,L,C,T]),X=_.useCallback(j=>{j.shiftKey&&!j.altKey?j.deltaY<0?d(q=>q*1.3):d(q=>q/1.3):j.altKey&&!j.shiftKey&&(j.deltaY<0?A(q=>q*1.1):A(q=>q/1.1))},[]),$=30,P=_.useCallback(j=>{j&&j.addEventListener("wheel",q=>{(q.shiftKey||q.altKey)&&q.preventDefault()})},[]),H=Pl;return B.jsxs("div",{ref:j=>P(j),onWheel:X,children:[B.jsxs(su,{width:t,height:n-$,initialPosition:H,adjustable:!1,children:[B.jsx(Hl,{width:H,height:n,customActions:V}),B.jsx(cf,{width:0,height:0,children:B.jsx(sf,{plots:I,plotComponent:Dz,selectedPlotKeys:i.onlyShowSelected?void 0:o,currentPlotKey:u})})]}),B.jsx("div",{style:{position:"absolute",top:n-$,height:$,overflow:"hidden"},children:B.jsx(sd,{options:i,setOptions:a})})]})},wz=e=>{if(e.length===0)return e;const t={...e[0],props:{...e[0].props}},n=t.props;t.key="overlapping",t.label="Overlapping",t.labelColor="black",t.unitId="overlapping",n.height*=3;const r=new Set;for(const a of e)for(const o of a.props.channelIds)r.add(o);const i=Nr([...r]);return n.channelIds=i,n.units=e.map(a=>a.props.units[0]),[t]},xz=e=>e.map(t=>{const n=zx(t);return t.map(r=>r-n)}),Ez=(e,t)=>{const n=[];for(let r=0;r<e.length;r++)n.push(e[r].map((i,a)=>{const o=zx(t[a]);return i.map(u=>u-o)}));return n},zx=e=>e.length>0?L9(e):0,Az=e=>B.jsx(vi,{context:e.contexts.unitSelection,children:B.jsx(Cz,{...e})}),Cz=({zarrGroup:e,width:t,height:n})=>{const[r,i]=_.useState(null);return _.useEffect(()=>{let a=!1;return(async()=>{const u=[],l=e.attrs.num_average_waveforms||0,s=e.attrs.average_waveforms,c=s.length;c!==l&&console.warn(`numUnits (${c}) !== numAverageWaveforms (${l})`);for(let f=0;f<l;f++){const d=`waveform_${f}`,h=await e.getGroup(d);if(!h){console.warn(`No group for ${d}`);continue}if(h.datasets.find(v=>v.name==="waveform")===void 0){console.warn(`No waveform dataset for ${d}`);continue}const g=await e.getDataset(`${d}/waveform`);if(!g){console.warn(`Could not load waveform dataset for ${d}`);continue}const m=g.shape,D=await e.getDatasetData(`${d}/waveform`,{});let p;if(h.datasets.find(v=>v.name==="waveform_std_dev")===void 0?p=void 0:p=await e.getDatasetData(`${d}/waveform_std_dev`,{}),D){const v=s.find(y=>y.name===d);v&&u.push({unitId:v.unit_id,channelIds:v.channel_ids,waveform:Ux(D,m),waveformStdDev:p?Ux(p,m):void 0})}}a||i({type:"AverageWaveforms",averageWaveforms:u})})(),()=>{a=!0}},[e]),r?B.jsx(Sz,{data:r,width:t,height:n}):B.jsx("div",{children:"Loading..."})},Ux=(e,t)=>{if(t.length!==2)throw Error("shape.length should be 2");const[n,r]=t;if(e.length!==n*r)throw Error(`data.length does not match shape. Expected ${n*r}, got ${e.length}`);const i=[];for(let a=0;a<r;a++){const o=[];for(let u=0;u<n;u++)o.push(e[u*r+a]);i.push(o)}return i},Ix=20,Mz=({data:e,width:t,height:n})=>{const[r,i]=_.useState(!1),{selectedUnitIds:a}=ii(),o=_.useMemo(()=>Nr([...a]),[a]),u=e.hideUnitSelector,l=_.useMemo(()=>{const p=e.crossCorrelograms.filter(y=>o.includes(y.unitId1)&&o.includes(y.unitId2)),v=[];for(const y of o)for(const w of o){const E=p.filter(b=>b.unitId1===y&&b.unitId2===w)[0];E?v.push(E):v.push(void 0)}return v},[e.crossCorrelograms,o]),s=u?0:100,c=Pl,f=t-s-c,d=n,h=_.useMemo(()=>{const p=o.length,{plotWidth:v,plotHeight:y}=$x(f,d,p);return l.map((w,E)=>({key:`${E}`,unitId:w?w.unitId1:0,label:w?v>80?`Unit ${w.unitId1}/${w.unitId2}`:`${w.unitId1}/${w.unitId2}`:"",labelColor:"black",clickHandler:void 0,props:{binEdgesSec:w?w.binEdgesSec:void 0,binCounts:w?w.binCounts:void 0,color:w?.unitId1===w?.unitId2?Ir(Nt(w?.unitId1)):"gray",width:v,height:y,hideXAxis:!r}}))},[l,f,d,o,r]),g=_.useMemo(()=>[{type:"toggle",subtype:"checkbox",callback:()=>i(v=>!v),title:"Show X Axis",selected:r===!0}],[r]),m=_.useMemo(()=>{const p=new Set;e.crossCorrelograms.forEach(y=>{p.add(y.unitId1),p.add(y.unitId2)});const v=Nr(Array.from(p));return{type:"UnitsTable",columns:[],rows:v.map(y=>({unitId:y,values:{}}))}},[e.crossCorrelograms]),D=B.jsxs(su,{width:t-s,height:n,initialPosition:c,adjustable:!1,children:[B.jsx(Hl,{width:c,height:n,customActions:g}),B.jsx(cf,{width:0,height:0,disableScroll:!0,children:o.length>Ix?B.jsxs("div",{children:["Not showing cross-correlogram matrix. Too many units selected (max ="," ",Ix,")."]}):o.length===0?B.jsx("div",{children:"Select one or more units to view cross-correlograms."}):B.jsx(sf,{plots:h,plotComponent:yx,selectedPlotKeys:void 0,numPlotsPerRow:o.length})})]});return u?D:B.jsxs("div",{style:{position:"relative",width:t,height:n},children:[B.jsx("div",{style:{position:"absolute",left:0,top:0,width:s,height:n,borderRight:"1px solid #ccc",boxSizing:"border-box",padding:10,backgroundColor:"#f9f9f9"},children:B.jsx(Sx,{data:m,width:s,height:n})}),B.jsx("div",{style:{position:"absolute",left:s,top:0,width:t-s,height:n},children:D})]})},$x=(e,t,n)=>{const r=Math.min((e-30-(n-1)*7)/n,(t-30-(n-1)*7)/n);return{plotWidth:r,plotHeight:r}},Tz=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=_.useState(null);return _.useEffect(()=>{let o=!1;return(async()=>{const l=[],s=e.attrs.num_cross_correlograms||0;if(s===0){o||a({type:"CrossCorrelograms",crossCorrelograms:[],hideUnitSelector:e.attrs.hide_unit_selector||!1});return}const c=await e.getDatasetData("bin_edges_sec",{}),f=await e.getDatasetData("bin_counts",{});if(!c||!f){console.error("Failed to load cross-correlograms data");return}const d=Array.from(c),h=new Int32Array(f),g=d.length-1,m=e.attrs.cross_correlograms;for(let p=0;p<s;p++){const v=m[p],y=p*g,w=Array.from(h.slice(y,y+g));l.push({unitId1:v.unit_id1,unitId2:v.unit_id2,binEdgesSec:d,binCounts:w})}const D=e.attrs.hide_unit_selector||!1;o||a({type:"CrossCorrelograms",crossCorrelograms:l,hideUnitSelector:D})})(),()=>{o=!0}},[e]),i?B.jsx(vi,{context:t.unitSelection,children:B.jsx(Mz,{data:i,width:n,height:r})}):B.jsx("div",{children:"Loading..."})},_z=1.4,Bz=(e,t,n,r)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: * Attempt to call zoomTime() with uninitialized state ${e}.`),{visibleStartTimeSec:e.visibleStartTimeSec,visibleEndTimeSec:e.visibleEndTimeSec};const i=e.endTimeSec-e.startTimeSec,a=e.visibleEndTimeSec-e.visibleStartTimeSec;if(a===i&&t==="out")return{visibleStartTimeSec:e.startTimeSec,visibleEndTimeSec:e.endTimeSec};let o=n??_z;o=t==="in"?1/o:o;const u=Math.min(a*o,i);if(u>=i)return{...e,visibleStartTimeSec:e.startTimeSec,visibleEndTimeSec:e.endTimeSec};const l=r!==void 0?r:e.currentTime??e.visibleStartTimeSec+a/2,s=(l-e.visibleStartTimeSec)/a;let c=Math.max(l-s*u,e.startTimeSec);const f=Math.min(c+u,e.endTimeSec);return c=f-u,{visibleStartTimeSec:c,visibleEndTimeSec:f}},kx=(e,t)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: Attempt to call panTime() with uninitialized state ${e}.`),e;const n=e.visibleEndTimeSec-e.visibleStartTimeSec;let r=e.visibleStartTimeSec,i=e.visibleEndTimeSec;if(t>0)i=Math.min(e.visibleEndTimeSec+t,e.endTimeSec),r=Math.max(i-n,e.startTimeSec);else if(t<0)r=Math.max(e.visibleStartTimeSec+t,e.startTimeSec),i=Math.min(r+n,e.endTimeSec);else return e;const o=!0?e.currentTime:void 0;return r===e.visibleStartTimeSec&&i===e.visibleEndTimeSec?e:{...e,visibleStartTimeSec:r,visibleEndTimeSec:i,currentTimeSec:o}},Nz=(e,t)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: * Attempt to call panTime() with uninitialized state ${e}.`),{visibleStartTimeSec:e.visibleStartTimeSec,visibleEndTimeSec:e.visibleEndTimeSec};const n=e.visibleEndTimeSec-e.visibleStartTimeSec,r=t.panAmountPct/100*n*(t.type==="back"?-1:1);return kx(e,r)},Fz=(e,t)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: Attempt to call panTime() with uninitialized state ${e}.`),e;const n=t.deltaT;return kx(e,n)},Lx=kt.createContext(void 0),hd=()=>{const e=_.useContext(Lx);if(!e)throw new Error("useTimeseriesSelection must be used within a TimeseriesSelectionContext");const t=e.dispatch,n=_.useCallback(u=>{t({type:"initializeTimeseries",startTimeSec:u.startTimeSec,endTimeSec:u.endTimeSec,initialVisibleStartTimeSec:u.initialVisibleStartTimeSec,initialVisibleEndTimeSec:u.initialVisibleEndTimeSec})},[t]),r=_.useCallback((u,l)=>{t({type:"setVisibleTimeRange",visibleStartTimeSec:u,visibleEndTimeSec:l})},[t]),i=_.useCallback(u=>{t({type:"setCurrentTime",currentTime:u})},[t]),a=_.useCallback(u=>{t({type:"zoomVisibleTimeRange",factor:u})},[t]),o=_.useCallback(u=>{t({type:"translateVisibleTimeRangeFrac",frac:u})},[t]);if(e===void 0)throw new Error("useTimeseriesSelection must be used within a TimeseriesSelectionContext.Provider");return{initializeTimeseriesSelection:n,setVisibleTimeRange:r,setCurrentTime:i,zoomVisibleTimeRange:a,translateVisibleTimeRangeFrac:o,timeseriesSelection:e.timeseriesSelection,startTimeSec:e.timeseriesSelection.startTimeSec,endTimeSec:e.timeseriesSelection.endTimeSec,visibleStartTimeSec:e.timeseriesSelection.visibleStartTimeSec,visibleEndTimeSec:e.timeseriesSelection.visibleEndTimeSec,currentTime:e.timeseriesSelection.currentTime}},md=()=>{const{visibleStartTimeSec:e,visibleEndTimeSec:t,currentTime:n,setCurrentTime:r,startTimeSec:i,endTimeSec:a,setVisibleTimeRange:o}=hd(),u=_.useCallback((d,h,g)=>{const m=Bz({visibleStartTimeSec:e,visibleEndTimeSec:t,currentTime:n,startTimeSec:i,endTimeSec:a},d,h,g);m.visibleStartTimeSec!==void 0&&m.visibleEndTimeSec!==void 0&&o(m.visibleStartTimeSec,m.visibleEndTimeSec)},[e,t,n,i,a,o]),l=_.useCallback((d,h)=>{const g=Nz({visibleStartTimeSec:e,visibleEndTimeSec:t,startTimeSec:i,endTimeSec:a,currentTime:n},{type:d,panAmountPct:h??10});g.visibleStartTimeSec!==void 0&&g.visibleEndTimeSec!==void 0&&o(g.visibleStartTimeSec,g.visibleEndTimeSec)},[e,t,i,a,n,o]),s=_.useCallback(d=>{const h=Fz({visibleStartTimeSec:e,visibleEndTimeSec:t,startTimeSec:i,endTimeSec:a,currentTime:n},{deltaT:d});h.visibleStartTimeSec!==void 0&&h.visibleEndTimeSec!==void 0&&o(h.visibleStartTimeSec,h.visibleEndTimeSec)},[e,t,i,a,n,o]),c=_.useCallback(d=>{if(e===void 0||t===void 0)return;const h=t-e,g=d,m=g+h;o(g,m)},[e,t,o]),f=_.useCallback((d,h)=>{if(e===void 0||t===void 0)return;const g=e+d*(t-e);r(g)},[e,t,r]);return{visibleStartTimeSec:e,visibleEndTimeSec:t,setVisibleTimeRange:o,zoomTimeseriesSelection:u,panTimeseriesSelection:l,panTimeseriesSelectionDeltaT:s,panTimeseriesSelectionVisibleStartTimeSec:c,setCurrentTimeFraction:f}},jx=()=>{const[e,t]=_.useState(!1),n=_.useMemo(()=>[{id:"only-show-selected",label:"Only Show Selected",tooltip:"Toggle visibility of only selected units",icon:e?"👁️":"👁️🗨️",isActive:e,onClick:()=>t(r=>!r)}],[e]);return{onlyShowSelected:e,customToolbarActions:n}},Rz=[{name:"1ms",secondsPerTick:.001,countPerLargerUnit:10,scale_appropriate_label:e=>`${e%1e3} ms`},{name:"10ms",secondsPerTick:.01,countPerLargerUnit:10,scale_appropriate_label:e=>`${e*10%1e3} ms`},{name:"100ms",secondsPerTick:.1,countPerLargerUnit:10,scale_appropriate_label:e=>`${e*100%1e3} ms`},{name:"1s",secondsPerTick:1,countPerLargerUnit:10,scale_appropriate_label:e=>`${e%60} s`},{name:"10s",secondsPerTick:10,countPerLargerUnit:6,scale_appropriate_label:e=>`${e*10%60} s`},{name:"1min",secondsPerTick:60,countPerLargerUnit:10,scale_appropriate_label:e=>`${e%60} min`},{name:"10min",secondsPerTick:60*10,countPerLargerUnit:6,scale_appropriate_label:e=>`${e*10%60} min`},{name:"1hr",secondsPerTick:60*60,countPerLargerUnit:6,scale_appropriate_label:e=>`${e%24} hr`},{name:"6hr",secondsPerTick:60*60*6,countPerLargerUnit:4,scale_appropriate_label:e=>`${e*6%24} hr`},{name:"1day",secondsPerTick:60*60*24,countPerLargerUnit:10,scale_appropriate_label:e=>`${e} day`},{name:"10day",secondsPerTick:60*60*24*10,countPerLargerUnit:1e4,scale_appropriate_label:e=>`${10*e} day`}],Oz=(e,t,n,r)=>_.useMemo(()=>{if(t===void 0||n===void 0)return[];if(n<=t)return[];const i=[],a=e/(n-t);for(const o of Rz){const u=a*o.secondsPerTick;if(u<=50)continue;const l=Math.ceil(t/o.secondsPerTick),s=Math.floor(n/o.secondsPerTick),c=u>200||s-l<5;for(let f=l;f<=s;f++){if(f%o.countPerLargerUnit===0)continue;const d=f*o.secondsPerTick;i.push({value:d,label:o.scale_appropriate_label(f),major:c,xPixelPosition:r(d)})}}return i},[t,n,r,e]),zz=e=>{if(!e||typeof e=="function")return;const t=e.current,n=t&&t.getContext("2d");if(n)return n},Uz={position:"absolute",left:0,top:0},Px=e=>{const{width:t,height:n,draw:r,drawData:i}=e,a=_.useRef(null);return _.useEffect(()=>{const o=zz(a);o&&o.canvas&&r(o,i)},[r,a,i]),B.jsx("canvas",{ref:a,width:t,height:n,style:Uz})},Iz=(e,t)=>{const{width:n,height:r,margins:i,timeTicks:a,gridlineOpts:o,yTickSet:u,yLabel:l}=t;e.clearRect(0,0,e.canvas.width,e.canvas.height);const s=r-i.bottom;$z(e,a,s,i.top,{hideGridlines:o?.hideX},t.hideTimeAxisLabels),e.strokeStyle="lightgray",Qp(e,i.left,s,n-i.right,s),u&&kz(e,u,s,i.left,n-i.right,i.top,{hideGridlines:o?.hideY}),l&&Lz(e,l,i.left,i.bottom,i.top,e.canvas.height)},$z=(e,t,n,r,i,a)=>{const o=a||!1;if(!t||t.length===0)return;const u=2,l=n+(o?0:5);e.textAlign="center",e.textBaseline="top",t.forEach(s=>{e.strokeStyle=s.major?"gray":"lightgray";const c=i.hideGridlines?n:r;Qp(e,s.xPixelPosition,l,s.xPixelPosition,c),o||(e.fillStyle=s.major?"black":"gray",e.fillText(s.label,s.xPixelPosition,l+u))})},kz=(e,t,n,r,i,a,o)=>{const l=r-5,s=l-2,{ticks:c}=t;e.fillStyle="black",e.textAlign="right",e.textBaseline="middle",c.forEach(f=>{if(!f.pixelValue)return;const d=f.pixelValue;e.strokeStyle=f.isMajor?"gray":"lightgray",e.fillStyle=f.isMajor?"black":"gray";const h=o.hideGridlines?r:i;Qp(e,l,d,h,d),e.fillText(f.label,s,d)})},Lz=(e,t,n,r,i,a)=>{e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(15,(a-r-i)/2+i),e.fillStyle="black",e.font="13px sans-serif",e.rotate(-Math.PI/2),e.fillText(t,0,0),e.restore()},Qp=(e,t,n,r,i)=>{e.beginPath(),e.moveTo(t,n),e.lineTo(r,i),e.stroke()},jz={},Pz=e=>{const{width:t,height:n}=e,r=_.useCallback(i=>{Iz(i,e)},[e]);return B.jsx("span",{className:"TSV2AxesLayer",children:B.jsx(Px,{width:t,height:n,draw:r,drawData:jz})})},Hz=(e,t)=>{const{margins:n,currentTimePixels:r,currentTimeIntervalPixels:i}=t;if(e.clearRect(0,0,e.canvas.width,e.canvas.height),i!==void 0){e.fillStyle="rgba(255, 225, 225, 0.4)",e.strokeStyle="rgba(150, 50, 50, 0.9)";const a=i[0],o=n.top,u=i[1]-i[0],l=e.canvas.height-n.bottom-n.top;e.fillRect(a,o,u,l),e.strokeRect(a,o,u,l)}if(r!==void 0&&i===void 0){e.fillStyle="rgba(255, 255, 0, 0.1)";const a=4;e.fillRect(r-a/2,n.top,a,e.canvas.height-n.bottom-n.top),e.strokeStyle="rgba(200, 200, 0, 0.4)",e.lineWidth=1,e.beginPath(),e.moveTo(r,n.top),e.lineTo(r,e.canvas.height-n.bottom),e.stroke()}},qz=e=>{const{width:t,height:n,timeRange:r,currentTimePixels:i,currentTimeIntervalPixels:a,margins:o}=e,u=_.useMemo(()=>({width:t,height:n,timeRange:r,currentTimePixels:i,currentTimeIntervalPixels:a,margins:o}),[t,n,r,i,a,o]);return B.jsx(Px,{width:t,height:n,draw:Hz,drawData:u})},Gz=({width:e,height:t,selectionRect:n})=>{if(!n)return null;const{startX:r,endX:i}=n,a=Math.abs(i-r),o=Math.min(r,i);return B.jsx("div",{style:{position:"absolute",top:0,left:0,width:e,height:t,pointerEvents:"none",zIndex:10},children:B.jsx("div",{style:{position:"absolute",left:o,top:0,width:a,height:t,backgroundColor:"rgba(0, 123, 255, 0.2)",border:"1px solid rgba(0, 123, 255, 0.6)",borderRadius:"2px"}})})},Vz=e=>{const{pixelToTime:t,visibleStartTimeSec:n,setCurrentTime:r,onMouseDown:i,onMouseUp:a,onMouseMove:o,onMouseOut:u,onCanvasClick:l,interactionMode:s}=e,{panTimeseriesSelectionVisibleStartTimeSec:c,setVisibleTimeRange:f}=md(),[d,h]=_.useState(!1),[g,m]=_.useState(void 0),[D,p]=_.useState(null),v=_.useRef({mouseDownAchorX:null,mouseDownAnchorTime:null,mouseDownAnchorVisibleStartTime:null,mouseDownAnchorPixelToTime:null,moved:!1,selectionStartX:null,selectionEndX:null}),y=_.useCallback(S=>{if(h(!0),!S.shiftKey&&!S.ctrlKey&&!S.altKey){const A=S.clientX-S.currentTarget.getBoundingClientRect().x;s==="select-zoom"?(v.current.selectionStartX=A,v.current.selectionEndX=A,p({startX:A,endX:A})):(v.current.mouseDownAchorX=A,v.current.mouseDownAnchorTime=t(A),v.current.mouseDownAnchorVisibleStartTime=n||null,v.current.mouseDownAnchorPixelToTime=t),v.current.moved=!1}else i&&i(S)},[t,i,n,s]),w=_.useCallback(S=>{if(!S.shiftKey&&!S.ctrlKey&&!S.altKey){const A=S.clientX-S.currentTarget.getBoundingClientRect().x;if(s==="select-zoom"&&v.current.selectionStartX!==null){const C=Math.min(v.current.selectionStartX,A),M=Math.max(v.current.selectionStartX,A);if(Math.abs(M-C)>5){const T=t(C),x=t(M);f(T,x)}else if(!v.current.moved){const T=t(A);if(r(T),l){const x=S.clientY-S.currentTarget.getBoundingClientRect().y;l(A,x)}}p(null),v.current.selectionStartX=null,v.current.selectionEndX=null}else if(v.current.mouseDownAchorX=null,v.current.mouseDownAnchorTime=null,v.current.mouseDownAnchorPixelToTime=null,!v.current.moved){const C=t(A);if(r(C),l){const M=S.clientY-S.currentTarget.getBoundingClientRect().y;l(A,M)}}}else a&&a(S)},[a,t,r,s,f]),E=_.useCallback(S=>{const A=S.clientX-S.currentTarget.getBoundingClientRect().x,C=t(A);if(m(C),!S.shiftKey&&!S.ctrlKey&&!S.altKey){if(s==="select-zoom"&&v.current.selectionStartX!==null)v.current.selectionEndX=A,p({startX:Math.min(v.current.selectionStartX,A),endX:Math.max(v.current.selectionStartX,A)}),v.current.moved=!0;else if(s==="pan"&&v.current.mouseDownAchorX!==null&&v.current.mouseDownAnchorPixelToTime!==null){const M=v.current.mouseDownAnchorPixelToTime(A),T=v.current.mouseDownAnchorTime,x=v.current.mouseDownAnchorVisibleStartTime;if(T!==null&&x!==null){const N=M-T,R=A-v.current.mouseDownAchorX;if(Math.abs(R)>2||Math.abs(N)>.01){const z=x-N;c(z),S.preventDefault(),S.stopPropagation(),v.current.moved=!0}}}}o&&o(S)},[t,o,s,c]),b=_.useCallback(S=>{m(void 0),h(!1),p(null),v.current.selectionStartX=null,v.current.selectionEndX=null,u&&u(S)},[u]);return{isViewClicked:d,hoverTime:g,selectionRect:D,handleMouseDown:y,handleMouseUp:w,handleMouseMove:E,handleMouseOut:b}},Yz=({width:e,height:t,leftMargin:n,customToolbarActions:r,hideTimeAxisLabels:i,hideNavToolbar:a})=>{const o=r&&r.length>0,u=_.useMemo(()=>({left:n||60,right:20,top:10,bottom:i?10:30}),[n,i]);let l=0;a||(l+=40),o&&(l+=40);const s=e,c=t-l;return{margins:u,canvasWidth:s,canvasHeight:c}},Xz=23,Zz=60,Kz=(e,t,n,r)=>{const i=Math.ceil((t-r)/n);return isNaN(i)||i<1?[]:Array(i).fill(0).map((a,o)=>r+o*n).filter(a=>a>e)},Qz=(e,t)=>{let n=0;const r=Math.trunc(Math.log10(t));if(Math.trunc(Math.log10(e))!==r)return n;const i=Math.trunc(Math.log10(t-e));if(r<=i)return n;const a=i+1,o=Math.pow(10,-a),u=Math.trunc(t*o).toString(),l=Math.trunc(e*o).toString();for(const[s,c]of[...u].entries()){if(c!==l[s]){n=n*Math.pow(10,s-a);break}n=n*10+parseInt(c)}return n*Math.pow(10,a)},Wz=(e,t)=>Math.floor(e*Math.pow(10,-(t+1)))*Math.pow(10,t+1),Jz=(e,t,n)=>{const r=e-t,i=Math.trunc(r*Math.pow(10,-n)),a=i%10===0;return{label:Math.abs(n)>3?`${(i/10).toFixed(1)}e${n+1}`:`${Math.round(i*Math.pow(10,n)*1e9)/1e9}`,isMajor:a,dataValue:e}},eU=(e,t,n,r,i)=>{const a=Kz(t,n,r,e).map(l=>Math.round(l*1e9)/1e9),o=Qz(t,n);return a.map(l=>Jz(l,o,i))},Hx={ticks:[],datamin:0,datamax:0},tU=(e,t)=>{const n=Math.floor(Math.log10(e/t)),r=Math.pow(10,n),i=[1,2,5,10],o=i.map(u=>e/(r*u)).findIndex(u=>u<t);return o===3?{step:1,scale:n+1}:{step:i[o],scale:n}},nU=e=>{const{datamin:t,datamax:n,userSpecifiedZoom:r}=e;let{pixelHeight:i}=e;i<=1&&(i=1);const a=r??1;return _.useMemo(()=>{if(t===void 0||n===void 0||t===n)return Hx;const o=t/a,u=n/a,l=u-o,s=i/Zz,c=i/Xz,f=tU(l,c),d=f.step*Math.pow(10,f.scale);if(l/d<s)return console.warn("Error: Unable to compute valid y-axis step size. Suppressing display."),Hx;const h=Wz(o,f.scale);return{ticks:eU(h,o,u,d,f.scale),datamin:o,datamax:u}},[n,t,a,i])},rU=e=>{const t=Math.round(e*1e3),n=Math.floor(t/(1e3*60*60)),r=Math.floor(t%(1e3*60*60)/(1e3*60)),i=Math.floor(t%(1e3*60)/1e3),a=t%1e3;return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}.${a.toString().padStart(3,"0")}`},iU=({width:e,height:t,interactionMode:n,onInteractionModeChange:r,currentTime:i,onZoomToFit:a})=>{const{zoomTimeseriesSelection:o,panTimeseriesSelection:u}=md(),l=_.useCallback(()=>{o("in",1.2)},[o]),s=_.useCallback(()=>{o("out",1.2)},[o]),c=_.useCallback(()=>{u("back",10)},[u]),f=_.useCallback(()=>{u("forward",10)},[u]),d=_.useCallback(h=>{r(h)},[r]);return B.jsxs("div",{style:{width:e,height:t,backgroundColor:"#f8f9fa",borderTop:"1px solid #dee2e6",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"13px",fontFamily:"system-ui, -apple-system, sans-serif"},children:[B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[B.jsx("button",{onClick:()=>d("pan"),style:{padding:"4px 8px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:n==="pan"?"#007bff":"#ffffff",color:n==="pan"?"#ffffff":"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease"},title:"Pan mode: Drag to pan, wheel to zoom",children:"🖱️ Pan"}),B.jsx("button",{onClick:()=>d("select-zoom"),style:{padding:"4px 8px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:n==="select-zoom"?"#007bff":"#ffffff",color:n==="select-zoom"?"#ffffff":"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease"},title:"Select zoom mode: Drag to select region and zoom in",children:"🔍 Select"})]}),B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[B.jsx("button",{onClick:c,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Pan left",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"⬅️"}),B.jsx("button",{onClick:s,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Zoom out",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"🔍➖"}),B.jsx("button",{onClick:l,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Zoom in",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"🔍➕"}),B.jsx("button",{onClick:f,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Pan right",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"➡️"}),B.jsx("div",{style:{width:"1px",height:"20px",backgroundColor:"#dee2e6",margin:"0 4px"}}),B.jsx("button",{onClick:a,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Reset zoom to show all data",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"🏠"})]}),B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[B.jsx("span",{style:{color:"#6c757d",fontWeight:"500"},children:"Time:"}),B.jsx("span",{style:{padding:"4px 8px",backgroundColor:"#e9ecef",borderRadius:"4px",fontFamily:"Monaco, Consolas, monospace",fontSize:"12px",fontWeight:"600",color:"#495057",minWidth:"120px",textAlign:"center"},children:i!==void 0?rU(i):"--:--:--.---"})]})]})},aU=({width:e,height:t,customActions:n})=>!n||n.length===0?null:B.jsx("div",{style:{width:e,height:t,backgroundColor:"#f8f9fa",borderTop:"1px solid #dee2e6",display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"0 12px",fontSize:"13px",fontFamily:"system-ui, -apple-system, sans-serif"},children:B.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:n.map(r=>r.component?B.jsx("div",{style:{display:"flex",alignItems:"center"},children:r.component},r.id):B.jsxs("button",{onClick:r.onClick,style:{padding:"4px 8px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:r.isActive?"#007bff":"#ffffff",color:r.isActive?"#ffffff":"#495057",cursor:r.onClick?"pointer":"default",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:r.tooltip||r.label,onMouseEnter:i=>{!r.isActive&&r.onClick&&(i.currentTarget.style.backgroundColor="#e9ecef")},onMouseLeave:i=>{!r.isActive&&r.onClick&&(i.currentTarget.style.backgroundColor="#ffffff")},children:[r.icon&&B.jsx("span",{children:r.icon}),r.label]},r.id))})}),oU=e=>{if(!e||!e.current)return;e.current.querySelectorAll("canvas").forEach(n=>{n.addEventListener("wheel",r=>{r.preventDefault()})})},qx=({width:e,height:t,onCanvasElement:n,gridlineOpts:r,onKeyDown:i,onMouseDown:a,onMouseMove:o,onMouseOut:u,onMouseUp:l,yAxisInfo:s,shiftZoom:c,requireClickToZoom:f,leftMargin:d,customToolbarActions:h,onCanvasClick:g,hideNavToolbar:m=!1,hideTimeAxisLabels:D=!1})=>{const{visibleStartTimeSec:p,visibleEndTimeSec:v,zoomTimeseriesSelection:y,panTimeseriesSelection:w,setVisibleTimeRange:E}=md(),{currentTime:b,setCurrentTime:S,startTimeSec:A,endTimeSec:C}=hd(),M=_.useMemo(()=>[p,v],[p,v]),{margins:T,canvasWidth:x,canvasHeight:N}=Yz({width:e,height:t,leftMargin:d,customToolbarActions:h,hideNavToolbar:m}),R=_.useMemo(()=>p===void 0||v===void 0?()=>0:v<=p?()=>0:O=>T.left+(O-p)/(v-p)*(x-T.left-T.right),[x,p,v,T]),z=_.useMemo(()=>p===void 0||v===void 0?()=>0:v<=p?()=>0:O=>p+(O-T.left)/(x-T.left-T.right)*(v-p),[x,p,v,T]),F=_.useMemo(()=>{const O=s?.yMin||0,k=s?.yMax||0;return k<=O?()=>0:G=>N-T.bottom-(G-O)/(k-O)*(N-T.top-T.bottom)},[s,N,T]),U=Oz(x,p,v,R),I=nU({datamin:s?.yMin||0,datamax:s?.yMax||0,pixelHeight:N-T.left-T.right}),L=_.useMemo(()=>({datamin:I.datamin,datamax:I.datamax,ticks:I.ticks.map(O=>({...O,pixelValue:F(O.dataValue)}))}),[I,F]),V=N,X=_.useMemo(()=>B.jsx(Pz,{width:x,height:V,timeRange:M,margins:T,timeTicks:U,yTickSet:s?.showTicks?L:void 0,yLabel:s?.yLabel,gridlineOpts:r,hideTimeAxisLabels:D}),[r,x,V,M,T,U,s?.showTicks,s?.yLabel,L]),$=_.useMemo(()=>b!==void 0?R(b):void 0,[b,R]),P=_.useMemo(()=>B.jsx(qz,{width:x,height:V,timeRange:M,margins:T,currentTimePixels:$}),[x,V,M,T,$]),H=_.useRef(null),[j,q]=_.useState("pan"),{isViewClicked:Y,hoverTime:te,selectionRect:ee,handleMouseDown:ne,handleMouseUp:ue,handleMouseMove:W,handleMouseOut:fe}=Vz({pixelToTime:z,visibleStartTimeSec:p,setCurrentTime:S,onMouseDown:a,onMouseUp:l,onMouseMove:o,onMouseOut:u,onCanvasClick:g,interactionMode:j});_.useEffect(()=>{(f===!1||Y)&&oU(H)},[f,Y]);const he=_.useCallback(O=>{if(c&&!O.shiftKey||O.deltaY===0||f!==!1&&!Y)return;const k=-O.deltaY/100;y(k>0?"in":"out",1.2,te)},[c,y,te,f,Y]),ye=_.useCallback(O=>{O.key==="="?y("in"):O.key==="-"?y("out"):O.key==="ArrowRight"?w("forward"):O.key==="ArrowLeft"&&w("back"),i&&i(O)},[i,y,w]),Se=_.useCallback(()=>{A!==void 0&&C!==void 0&&E(A,C)},[A,C,E]),we=_.useMemo(()=>B.jsx(Gz,{width:x,height:V,selectionRect:ee}),[x,V,ee]),[Ae,$e]=_.useState(null);_.useEffect(()=>{Ae&&n(Ae,x,N,T)},[Ae,x,N,T]);const _e=_.useMemo(()=>B.jsxs("div",{style:{position:"relative",overflow:"hidden",width:x,height:V},onWheel:!f||Y?he:void 0,onMouseDown:ne,onMouseUp:ue,onMouseMove:W,onMouseOut:fe,tabIndex:0,onKeyDown:ye,children:[X,B.jsx("canvas",{style:{position:"absolute",width:x,height:V},ref:O=>$e(O),width:x,height:V}),P,we]}),[n,X,P,we,x,V,ye,he,ne,ue,W,fe,f,Y]),Ie=_.useMemo(()=>B.jsx(iU,{width:e,height:40,interactionMode:j,onInteractionModeChange:q,currentTime:b,onZoomToFit:Se}),[e,j,q,b,Se]),ge=_.useMemo(()=>B.jsx(aU,{width:e,height:40,customActions:h}),[e,h]);return B.jsxs("div",{className:"time-scroll-view-3",ref:H,style:{position:"absolute",width:e,height:t,background:"white"},children:[_e,!m&&B.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0},children:[Ie,ge]})]})},Gx=15,uU={hideX:!1,hideY:!0},lU={showTicks:!1,yMin:void 0,yMax:void 0},sU=({dataClient:e,width:t,height:n})=>{const{visibleStartTimeSec:r,visibleEndTimeSec:i}=md(),{initializeTimeseriesSelection:a}=hd(),{selectedUnitIds:o,unitIdSelectionDispatch:u}=ii(),[l,s]=_.useState(void 0),c=_.useRef(null),[f,d]=_.useState(null),[h,g]=_.useState(null),[m,D]=_.useState(!1),[p,v]=_.useState(null),[y,w]=_.useState(null),E=_.useMemo(()=>r===void 0||i===void 0?"raster":i-r>120?"heatmap":"raster",[r,i]),b=e.metadata.unitIds;_.useEffect(()=>{e.metadata&&a({startTimeSec:e.metadata.startTimeSec,endTimeSec:e.metadata.endTimeSec,initialVisibleStartTimeSec:e.metadata.startTimeSec,initialVisibleEndTimeSec:e.metadata.endTimeSec})},[a,e.metadata]),_.useEffect(()=>{let H=!1;const j=async()=>{if(!(r===void 0||i===void 0))try{if(E==="raster"){const q=await e.getDataForRange({startTimeSec:r,endTimeSec:i});if(H)return;g(q),w(null)}else{const q=e.getSpikeCountsForRange({startTimeSec:r,endTimeSec:i});if(H)return;w(q),g(null)}v(null)}catch(q){if(H)return;console.error("Error loading data:",q),v(`Error loading data: ${q}`)}};return D(!0),j().finally(()=>{H||D(!1)}),()=>{H=!0}},[e,r,i,E]);const{onlyShowSelected:S,customToolbarActions:A}=jx(),[C,M]=_.useState(t),[T,x]=_.useState(n),[N,R]=_.useState(null),z=_.useCallback(()=>{if(!N||!c.current||!f||!y||!e.metadata||r===void 0||i===void 0)return;if(f.clearRect(0,0,C,T),m&&(f.fillStyle="rgba(0, 0, 0, 0.02)",f.fillRect(0,0,C,T),f.fillStyle="black",f.font="16px Arial",f.textAlign="center",f.fillText("Loading...",C/2,T/2)),p){f.fillStyle="rgba(255, 0, 0, 0.1)",f.fillRect(0,0,C,T),f.fillStyle="red",f.font="14px Arial",f.textAlign="center",f.fillText(p,C/2,T/2);return}const j=T-N.top-N.bottom,q=C-N.left-N.right,Y=i-r;let te;if(S){let ue=0;b.forEach((W,fe)=>{o.has(W)&&ue++}),te=ue}else b.forEach((ue,W)=>{}),te=b.length;const ee=j/(te||1);f.save(),f.beginPath(),f.rect(N.left,N.top,q,j),f.clip();let ne=1;if(y.counts.forEach(ue=>{S?F.forEach(W=>{const fe=ue[W];fe>ne&&(ne=fe)}):ue.forEach(W=>{W>ne&&(ne=W)})}),y.counts.forEach((ue,W)=>{const fe=y.binEdges[W],he=y.binEdges[W+1],ye=N.left+(fe-r)/Y*q,Se=N.left+(he-r)/Y*q;if(S)for(let we=0;we<F.length;we++){const Ae=F[we],_e=ue[Ae]/ne,Ie=N.top+(F.length-1-we)*ee,ge=Vx(_e);f.fillStyle=ge,f.fillRect(ye,Ie,Se-ye+.5,ee)}else ue.forEach((we,Ae)=>{const $e=we/ne,_e=N.top+(b.length-1-Ae)*ee,Ie=Vx($e);f.fillStyle=Ie,f.fillRect(ye,_e,Se-ye+.5,ee)})}),f.restore(),ee>=Gx){f.globalAlpha=1;const ue=S?U:b;ue.forEach((W,fe)=>{const ye=N.top+(ue.length-1-fe)*ee+ee/2,Se=Sm(Nt(W));f.fillStyle=Se,f.font="12px Arial",f.textAlign="right",f.fillText(`Unit ${W}`,N.left-5,ye)})}},[C,T,N,y,r,i,e.metadata,m,p,f,o,S]),F=_.useMemo(()=>{const H=[];return S&&b.forEach((j,q)=>{o.has(j)&&H.push(q)}),H},[S,o,b]),U=_.useMemo(()=>F.map(H=>b[H]),[F,b]);console.log(o,F,U);const I=_.useCallback(()=>{if(!N||!c.current||!f||!h||!e.metadata||r===void 0||i===void 0)return;if(f.clearRect(0,0,C,T),m&&(f.fillStyle="rgba(0, 0, 0, 0.02)",f.fillRect(0,0,C,T),f.fillStyle="black",f.font="16px Arial",f.textAlign="center",f.fillText("Loading...",C/2,T/2)),p){f.fillStyle="rgba(255, 0, 0, 0.1)",f.fillRect(0,0,C,T),f.fillStyle="red",f.font="14px Arial",f.textAlign="center",f.fillText(p,C/2,T/2);return}const j=T-N.top-N.bottom,q=C-N.left-N.right,Y=i-r,te=e.metadata.unitIds,ee={};let ne;if(S){for(let W=0;W<F.length;W++){const fe=F[W];ee[fe]=W}ne=F.length}else te.forEach((W,fe)=>{ee[fe]=fe}),ne=te.length;const ue=j/(ne||1);f.save(),f.beginPath(),f.rect(N.left,N.top,q,j),f.clip();for(let W=0;W<h.timestamps.length;W++){const fe=h.timestamps[W],he=ee[h.unitIndices[W]];if(he===void 0)continue;const ye=te[h.unitIndices[W]],Se=N.top+(ne-1-he)*ue+ue/2,we=Sm(Nt(ye)),Ae=l===ye,$e=o.has(ye);f.strokeStyle=we,f.lineWidth=Ae||$e?2:1,f.globalAlpha=$e?1:Ae?.8:.6;const _e=N.left+(fe-r)/Y*q;f.beginPath(),f.moveTo(_e,Se-ue*.4),f.lineTo(_e,Se+ue*.4),f.stroke()}if(f.restore(),ue>=Gx){f.globalAlpha=1;const W=S?U:te;W.forEach((fe,he)=>{const Se=N.top+(W.length-1-he)*ue+ue/2,we=Sm(Nt(fe));f.fillStyle=we,f.font="12px Arial",f.textAlign="right",f.fillText(`Unit ${fe}`,N.left-5,Se)})}},[C,T,N,h,r,i,l,e.metadata,m,p,f,o,S]);_.useEffect(()=>{E==="heatmap"&&y?z():I()},[I,z,E,y]);const L=_.useCallback(()=>{},[]),V=_.useCallback(H=>{if(!N||!e.metadata)return;const j=e.metadata.unitIds,q=j.length,Y=1-(H.y-N.top)/(T-N.top-N.bottom),te=Math.round(Y*q-.5);if(0<=te&&te<q)return j[te]},[T,N,e.metadata]),X=_.useCallback(H=>{const j=H.currentTarget.getBoundingClientRect(),q={x:H.clientX-j.x,y:H.clientY-j.y},Y=V(q);H.shiftKey||H.ctrlKey?u({type:"TOGGLE_UNIT",targetUnit:Y}):u({type:"UNIQUE_SELECT",targetUnit:Y})},[V,u]),$=_.useCallback(H=>{const j=H.currentTarget.getBoundingClientRect(),q={x:H.clientX-j.x,y:H.clientY-j.y},Y=V(q);Y!==void 0&&s(Y)},[V]),P=_.useCallback(()=>{s(void 0)},[]);return e.metadata?B.jsx(qx,{width:t,height:n,customToolbarActions:A,onCanvasElement:(H,j,q,Y)=>{c.current=H;const te=H?.getContext("2d");d(te),M(j),x(q),R(Y)},gridlineOpts:uU,onKeyDown:L,onMouseDown:X,onMouseMove:$,onMouseOut:P,yAxisInfo:lU}):B.jsx("div",{children:"Loading metadata..."})},Vx=e=>{if(e===0)return"rgb(255,255,255)";const t=Math.max(0,Math.min(1,.7*(1-e))),n=Math.round(t*255);return`rgb(${n}, ${n}, ${n})`};class Wp{constructor(t,n,r,i,a,o){this.zarrGroup=t,this.metadata=n,this.referenceTimes=r,this.referenceIndices=i,this.counts2dArray=a,this.binEdges=o,this.zarrGroup=t}static async create(t){const n={startTimeSec:t.attrs.start_time_sec,endTimeSec:t.attrs.end_time_sec,unitIds:t.attrs.unit_ids||[],totalSpikes:t.attrs.total_spikes||0},r=await t.getDatasetData("reference_times",{}),i=await t.getDatasetData("reference_indices",{});if(!r||!i)throw new Error(`Reference arrays not found in Zarr group: ${t.path}`);const a=await t.getDatasetData("spike_counts_1sec",{}).catch(()=>{});if(!a)throw new Error(`Spike counts data not found in Zarr group: ${t.path}`);const o=Math.ceil(n.endTimeSec-n.startTimeSec),u=n.unitIds.length,l=Array(o);for(let f=0;f<o;f++){l[f]=Array(u);for(let d=0;d<u;d++){const h=f*u+d;l[f][d]=h<a.length?a[h]:0}}const s=Array(o+1);for(let f=0;f<=o;f++)s[f]=n.startTimeSec+f;return new Wp(t,n,r,i,l,s)}async getDataForRange(t){const n=this.findStartIndex(this.referenceTimes,this.referenceIndices,t.startTimeSec),r=this.findEndIndex(this.referenceTimes,this.referenceIndices,t.endTimeSec);if(n>=r)return{timestamps:[],unitIndices:[]};const i=await this.zarrGroup.getDatasetData("timestamps",{slice:[[n,r]]}),a=await this.zarrGroup.getDatasetData("unit_indices",{slice:[[n,r]]});return{timestamps:Array.from(i),unitIndices:Array.from(a)}}findStartIndex(t,n,r){let i=0;for(;i+1<t.length&&t[i+1]<r;)i++;return n[i]}getSpikeCountsForRange(t){const{startTimeSec:n,endTimeSec:r}=t,i=Math.floor(n-this.metadata.startTimeSec),a=Math.ceil(r-this.metadata.startTimeSec);let o=1;for(;(a-i)/o>500;)o+=1;const u=this.counts2dArray.slice(i,a),l=this.binEdges.slice(i,a+1);if(o===1)return{binEdges:l,counts:u};{const s=[],c=[];for(let f=0;f<u.length;f+=o){const d=Array(this.metadata.unitIds.length).fill(0);for(let h=0;h<o;h++)if(f+h<u.length)for(let g=0;g<d.length;g++)d[g]+=u[f+h][g];s.push(d),c.push(l[f])}return l.length>0&&c.push(l[Math.min(l.length-1,c.length*o)]),{binEdges:c,counts:s}}}findEndIndex(t,n,r){let i=t.length-1;for(;i-1>=0&&t[i-1]>r;)i--;return n[i]}}const cU=({zarrGroup:e,contexts:t,width:n,height:r})=>{const i=fU(e);return i?B.jsx(Yx,{context:t.timeseriesSelection,children:B.jsx(vi,{context:t.unitSelection,children:B.jsx(sU,{dataClient:i,width:n,height:r})})}):null},Yx=({context:e,children:t})=>{const{state:n,dispatch:r}=cd(e);return r?B.jsx(Lx.Provider,{value:{timeseriesSelection:n,dispatch:r},children:t}):B.jsx(B.Fragment,{children:"Waiting for context..."})},fU=e=>{const[t,n]=_.useState(null);return _.useEffect(()=>{let r=!0;return Wp.create(e).then(i=>{r&&n(i)}),()=>{r=!1}},[e]),t},dU=({dataClient:e,width:t,height:n})=>{const{selectedUnitIds:r,unitIdSelectionDispatch:i}=ii(),{initializeTimeseriesSelection:a,visibleStartTimeSec:o,visibleEndTimeSec:u}=hd(),[l,s]=_.useState(null),[c,f]=_.useState(null),[d,h]=_.useState(!1),[g,m]=_.useState(null),D=Pl,{onlyShowSelected:p,customToolbarActions:v}=jx(),[y,w]=_.useState(t),[E,b]=_.useState(n),[S,A]=_.useState(null),C=e.metadata;_.useEffect(()=>{C&&i({type:To,newUnitOrder:Nr(C.unitIds)})},[C,i]),_.useEffect(()=>{C&&a({startTimeSec:C.startTimeSec,endTimeSec:C.endTimeSec,initialVisibleStartTimeSec:C.startTimeSec,initialVisibleEndTimeSec:C.endTimeSec})},[a,C]),_.useEffect(()=>{let x=!1;const N=async()=>{if(o!==void 0&&u!==void 0){let R=1e4;for(;;){const z=await e.getDataForRange({startTimeSec:o,endTimeSec:u},{maxNumEvents:R});if(x)return;if(z&&f(z),z.subsampleFactor>1){if(R===1e6)break;R=Math.max(R*3,z.timestamps.length*3),R>1e6&&(R=1e6)}else break}}};return h(!0),m(null),N().catch(R=>{x||m(`Failed to load data: ${R}`),m(`Failed to load data: ${R}`)}).finally(()=>{h(!1)}),()=>{x=!0}},[o,u,e]);const M=_.useMemo(()=>{if(!c||!C||c.amplitudes.length===0)return{yMin:0,yMax:10};let x=1/0,N=-1/0;for(let z=0;z<c.amplitudes.length;z++){const F=C.unitIds[c.unitIndices[z]];if(p?r.has(F):!0){const I=c.amplitudes[z];I<x&&(x=I),I>N&&(N=I)}}if(x===1/0)return{yMin:0,yMax:10};const R=(N-x)*.1;return{yMin:x-R,yMax:N+R}},[c,C,p,r]);_.useEffect(()=>{if(!l||!c||!C||!S||u===void 0||o===void 0)return;let x=!1;return(async()=>{if(x)return;if(l.clearRect(0,0,y,E),d&&(l.fillStyle="rgba(0, 0, 0, 0.1)",l.fillRect(0,0,y,E),l.fillStyle="black",l.font="16px Arial",l.textAlign="center",l.fillText("Loading...",y/2,E/2)),g){l.fillStyle="rgba(255, 0, 0, 0.1)",l.fillRect(0,0,y,E),l.fillStyle="red",l.font="14px Arial",l.textAlign="center",l.fillText(g,y/2,E/2);return}l.save(),l.beginPath(),l.rect(S.left,S.top,y-S.left-S.right,E-S.top-S.bottom),l.clip();const R=F=>S.left+(F-o)/(u-o)*(y-S.left-S.right),z=F=>E-S.bottom-(F-M.yMin)/(M.yMax-M.yMin)*(E-S.top-S.bottom);for(let F=0;F<c.timestamps.length;F++){const U=c.timestamps[F],I=c.amplitudes[F],L=C.unitIds[c.unitIndices[F]];if(U<o||U>u||!(p?r.has(L):!0))continue;const X=Ir(Nt(L)),P=r.has(L)?1:.3;l.fillStyle=X,l.globalAlpha=P;const H=R(U),j=z(I);l.beginPath(),l.arc(H,j,2,0,Math.PI*2),l.fill()}l.globalAlpha=1,c.subsampleFactor>1&&(l.fillStyle="#2196F3",l.font="12px Arial",l.textAlign="left",l.fillText(`Subsampled ${c.subsampleFactor}x`,S.left+10,S.top+20)),l.restore()})(),()=>{x=!0}},[l,c,C,o,u,y,E,S,M,r,p,d,g]);const T=_.useMemo(()=>({showTicks:!0,yMin:M.yMin,yMax:M.yMax,yLabel:"Amplitude"}),[M]);return C?B.jsx("div",{children:B.jsxs(su,{width:t,height:n,initialPosition:D,adjustable:!1,children:[B.jsx(Hl,{width:D,height:n}),B.jsx(qx,{width:t-D,height:n,onCanvasElement:(x,N,R,z)=>{if(!x)return;const F=x.getContext("2d");s(F),w(N),b(R),A(z)},yAxisInfo:T,customToolbarActions:v})]})}):B.jsx("div",{children:"Loading metadata..."})};class pd{constructor(t,n,r={},i,a){this.zarrGroup=t,this.metadata=n,this.subsampleClients=r,this.referenceTimes=i,this.referenceIndices=a,this.zarrGroup=t}static async create(t){const n={startTimeSec:t.attrs.start_time_sec,endTimeSec:t.attrs.end_time_sec,unitIds:t.attrs.unit_ids||[],totalSpikes:t.attrs.total_spikes||0},r={},i=t.subgroups.find(u=>u.name==="subsampled_data"),a=await t.getDatasetData("reference_times",{}),o=await t.getDatasetData("reference_indices",{});if(!a||!o)throw new Error(`Reference arrays not found in Zarr group: ${t.path}`);if(i){const u=await t.getGroup(i.name);if(!u)throw new Error(`Failed to load subsampled_data group at ${i.name} in ${t.path}`);let l=4;for(;;){const s=u.subgroups.find(d=>d.name===`factor_${l}`);if(!s)break;const c=await t.getGroup(s.name);if(!c)throw new Error(`Failed to load subsampled group at ${s.name} in ${t.path}`);const f=await pd.create(c);r[l]=f,l*=4}}return new pd(t,n,r,a,o)}async getDataForRange(t,n){const r=this.findStartIndex(this.referenceTimes,this.referenceIndices,t.startTimeSec),i=this.findEndIndex(this.referenceTimes,this.referenceIndices,t.endTimeSec);if(r>=i)return{timestamps:[],unitIndices:[],amplitudes:[],subsampleFactor:1};if(n.maxNumEvents>0&&i-r>n.maxNumEvents){let s=4;for(;s*4 in this.subsampleClients&&(i-r)/s>n.maxNumEvents;)s*=4;if(s in this.subsampleClients){const f=await this.subsampleClients[s].getDataForRange(t,{maxNumEvents:0});return f.subsampleFactor=s,f}}const a=await this.zarrGroup.getDatasetData("timestamps",{slice:[[r,i]]}),o=await this.zarrGroup.getDatasetData("unit_indices",{slice:[[r,i]]}),u=await this.zarrGroup.getDatasetData("amplitudes",{slice:[[r,i]]});return{timestamps:Array.from(a),unitIndices:Array.from(o),amplitudes:Array.from(u),subsampleFactor:1}}findStartIndex(t,n,r){let i=0;for(;i+1<t.length&&t[i+1]<r;)i++;return n[i]}findEndIndex(t,n,r){let i=t.length-1;for(;i-1>=0&&t[i-1]>r;)i--;return n[i]}}const hU=({zarrGroup:e,contexts:t,width:n,height:r})=>{const i=mU(e);return i?B.jsx(Yx,{context:t.timeseriesSelection,children:B.jsx(vi,{context:t.unitSelection,children:B.jsx(dU,{dataClient:i,width:n,height:r})})}):null},mU=e=>{const[t,n]=_.useState(null);return _.useEffect(()=>{let r=!0;return pd.create(e).then(i=>{r&&n(i)}),()=>{r=!1}},[e]),t},pU=25,Jp=2*Math.PI,gU={maxElectrodePixelRadius:pU},eg={},fu=8,vU=()=>({selectedElectrodeIds:[]}),yU=e=>{const{width:t,height:n,electrodes:r,units:i,disableAutoRotate:a,onlyShowSelected:o}=e,{selectedElectrodeIds:u}=vU(),{selectedUnitIds:l,unitIdSelectionDispatch:s}=ii(),{affineTransform:c,handleWheel:f}=Zp(t,n,{shift:!0,alt:!1}),d=_.useMemo(()=>new Set([...l]),[l]),h=i.filter(U=>o?d.has(U.unitId):!0).sort((U,I)=>d.has(U.unitId)&&!d.has(I.unitId)?1:!d.has(U.unitId)&&d.has(I.unitId)?-1:Nt(U.unitId)-Nt(I.unitId)),g=e.maxElectrodePixelRadius||gU.maxElectrodePixelRadius,m=e.colors??ql,D=e.showLabels??!1,p=e.offsetLabels??!1,{convertedElectrodes:v,pixelRadius:y,transform:w}=_.useMemo(()=>Kp(t,n,r,"geom",g,{disableAutoRotate:a}),[r,n,g,t,a]),E=Math.sqrt(Xp(c)),b=_.useCallback((U,I)=>{const L=y*E,V=v.map(X=>{const $=(u||[]).includes(X.e.id),P=!1,H=!1,j=$?H?m.draggedSelected:P?m.selectedHover:m.selected:H?m.dragged:P?m.hover:m.base;return{...X,color:j,textColor:$||P&&!H?m.textDark:m.textLight}});if(U.clearRect(0,0,U.canvas.width,U.canvas.height),V.forEach(X=>{const $=Oa(c,{x:X.pixelX,y:X.pixelY});U.fillStyle=X.color,U.beginPath(),U.ellipse($.x,$.y,L,L,0,0,Jp),U.fill()}),U.strokeStyle=ql.border,v.forEach(X=>{const $=Oa(c,{x:X.pixelX,y:X.pixelY});U.beginPath(),U.ellipse($.x,$.y,L,L,0,0,Jp),U.stroke()}),D){U.font=`${L}px Arial`,U.textAlign=p?"right":"center",U.textBaseline="middle";const X=p?1.4*L:0;V.forEach($=>{const P=Oa(c,{x:$.pixelX,y:$.pixelY});U.fillStyle=p?m.textDark:$.textColor,U.fillText(`${$.e.label}`,P.x-X,P.y)})}},[m,p,v,y,u,D,c,E]),S=_.useCallback((U,I)=>{const L=fu;U.clearRect(0,0,U.canvas.width,U.canvas.height);const V=(X,$,P)=>{U.fillStyle=P,U.strokeStyle="black",U.beginPath(),U.ellipse(X,$,L,L,0,0,Jp),U.fill(),U.stroke()};for(let X of h){const $=tp(w,[X.x,X.y]),P=Oa(c,{x:$[0],y:$[1]}),H=l.size===0||l.has(X.unitId)?Ir(Nt(X.unitId)):"rgb(220, 220, 220)";V(P.x,P.y,H)}},[w,h,l,c]),A=_.useMemo(()=>B.jsx(vr,{width:t,height:n,draw:b,drawData:eg}),[t,n,b]),C=_.useMemo(()=>B.jsx(vr,{width:t,height:n,draw:S,drawData:eg}),[t,n,S]),M=_.useCallback((U,{ctrlKey:I})=>{const L=bU(c,U),V=Xp(c),X=fu/Math.sqrt(V),$=[];for(let P of h){const H=tp(w,[P.x,P.y]);ep(gd([H[0]-X,H[1]-X,X*2,X*2]),gd(L))&&(gd([H[0]-X,H[1]-X,X*2,X*2]),$.push(P.unitId))}if(I)for(let P of $)s({type:"TOGGLE_UNIT",targetUnit:P});else s({type:"SET_SELECTION",incomingSelectedUnitIds:$})},[w,s,h,c]),T=_.useCallback((U,{ctrlKey:I})=>{let L=!1;for(let V of h){const X=tp(w,[V.x,V.y]);j9(U,gd([X[0]-fu,X[1]-fu,fu*2,fu*2]))&&(L=!0,s(I?{type:"TOGGLE_UNIT",targetUnit:V.unitId}:{type:"SET_SELECTION",incomingSelectedUnitIds:[V.unitId]}))}L||s({type:"SET_SELECTION",incomingSelectedUnitIds:[]})},[w,s,h]),{onMouseMove:x,onMouseDown:N,onMouseUp:R,paintDragSelectLayer:z}=Tc(t,n,M,T),F=_.useMemo(()=>B.jsx(vr,{width:t,height:n,draw:z,drawData:eg}),[t,n,z]);return t>0&&n>0?B.jsxs("div",{style:{width:t,height:n,position:"relative"},onMouseMove:x,onMouseUp:R,onMouseDown:N,onWheel:f,children:[A,C,F]}):B.jsx("div",{})},gd=e=>({xmin:e[0],ymin:e[1],xmax:e[0]+e[2],ymax:e[1]+e[3]}),bU=(e,t)=>{const n=Yp(e,{x:t[0],y:t[1]}),r=Yp(e,{x:t[0]+t[2],y:t[1]+t[3]});return[n.x,n.y,r.x-n.x,r.y-n.y]},DU=e=>{const{data:t,width:n,height:r}=e,[i,a]=_.useState({...ld,onlyShowSelected:!1}),o=30,u=Object.keys(t.channelLocations),l=rz(u,t.channelLocations),s=_.useMemo(()=>({width:n-20,height:r-o,top:0,position:"absolute"}),[n,r]);return B.jsxs("div",{children:[B.jsx("div",{style:s,children:B.jsx(yU,{width:n-20,height:r-o,electrodes:l,units:t.units,disableAutoRotate:t.disableAutoRotate,onlyShowSelected:i.onlyShowSelected})}),B.jsx("div",{style:{position:"absolute",top:r-o,height:o,overflow:"hidden"},children:B.jsx(sd,{options:i,setOptions:a})})]})},SU=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=_.useState(null),[o,u]=_.useState(null),[l,s]=_.useState(!0);return _.useEffect(()=>{let c=!1;return(async()=>{try{s(!0),u(null);const d=e.attrs.disable_auto_rotate||!1,h=e.attrs.unit_ids,g=e.attrs.channel_locations,m=await e.getDatasetData("coords",{});if(!m||m.length===0)throw new Error("Empty coords data");const D=new Float32Array(m);if(D.length!==h.length*2)throw new Error(`Expected coords length ${h.length*2}, got ${D.length}`);const p=[];for(let v=0;v<h.length;v++)p.push({unitId:h[v],x:D[v*2],y:D[v*2+1]});if(c)return;a({type:"UnitLocations",channelLocations:g,units:p,disableAutoRotate:d})}catch(d){console.error("Error loading unit locations data:",d),u(`Failed to load unit locations data: ${d instanceof Error?d.message:String(d)}`)}finally{s(!1)}})(),()=>{c=!0}},[e]),o?B.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading unit locations data..."}):i?B.jsx(vi,{context:t.unitSelection,children:B.jsx(DU,{data:i,width:n,height:r})}):B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No unit locations data available"})},wU=({rows:e,columns:t,onDeleteRow:n=void 0,deleteRowLabel:r=void 0,onEditRow:i=void 0,editRowLabel:a=void 0,selectionMode:o="none",selectedRowKeys:u=[],onSelectedRowKeysChanged:l=void 0,selectionDisabled:s})=>{const c=_.useMemo(()=>{const p={};return u.forEach(v=>{p[v]=!0}),p},[u]),[f,d]=_.useState(null),h=_.useCallback(p=>{l&&(o==="single"?!(p in c)||!c[p]?l([p+""]):l([]):o==="multiple"&&l(Object.keys(c).filter(v=>v!=p&&c[v]).concat(c[p]?[]:[p.toString()])))},[l,o,c]),g=_.useCallback(p=>{d(p)},[]),m=_.useCallback((p,v)=>{v&&n&&n(p),d(null)},[n]),D=_.useCallback(p=>{i&&i(p)},[i]);return B.jsxs(nO,{className:"NiceTable",children:[B.jsx(gO,{children:B.jsxs(vx,{children:[B.jsx(ud,{style:{width:0}},"_first"),t.map(p=>B.jsx(ud,{children:p.element?p.element:B.jsx("span",{children:p.label})},p.key))]})}),B.jsx(uO,{children:e.map(p=>B.jsxs(vx,{children:[B.jsxs(ud,{children:[n&&(f===p.key?B.jsx(EU,{title:r||"",onConfirmDeleteRow:m,rowKey:p.key}):B.jsx(xU,{title:r||"",onDeleteRow:g,rowKey:p.key})),i&&B.jsx(AU,{title:a||"",onEditRow:D,rowKey:p.key}),o!=="none"&&B.jsx(sx,{checked:c[p.key]||!1,onClick:()=>h(p.key),disabled:s})]}),t.map(v=>B.jsx(ud,{children:B.jsx("span",{children:CU(p.columnValues[v.key])})},v.key))]},p.key))})]})},xU=({title:e,rowKey:t,onDeleteRow:n})=>{const r=_.useCallback(()=>{n&&n(t)},[n,t]);return B.jsx(jl,{title:e,onClick:r,children:B.jsx(HS,{})})},EU=({title:e,rowKey:t,onConfirmDeleteRow:n})=>{const r=_.useCallback(()=>{n&&n(t,!0)},[n,t]),i=_.useCallback(()=>{n&&n(t,!1)},[n,t]);return B.jsxs("span",{children:["Confirm delete?",B.jsx(jl,{title:e,onClick:r,children:B.jsx(HS,{})}),B.jsx(jl,{title:"Cancel",onClick:i,children:B.jsx(y7,{})})]})},AU=({title:e,rowKey:t,onEditRow:n})=>B.jsx(jl,{title:e,onClick:()=>n&&n(t),children:B.jsx(v7,{})}),CU=e=>e==0?e:e?typeof e=="object"?e.element?e.element:e.text||"":e:"",MU=({width:e,height:t})=>{const{selectedUnitMetrics:n,allUnitMetrics:r,unitMetricSelectionDispatch:i}=Zh(),a=_.useMemo(()=>[{key:"metric",label:"Metric"}],[]),o=_.useMemo(()=>(r||[]).map(l=>({key:l,columnValues:{metric:l}})),[r]),u=_.useCallback(l=>{i({type:"selectUnitMetrics",unitMetrics:l})},[i]);return B.jsx("div",{style:{position:"absolute",width:e,height:t},children:B.jsx(wU,{rows:o,columns:a,selectedRowKeys:n,onSelectedRowKeysChanged:u,selectionMode:"multiple"})})},TU=(e,t)=>{e.clearRect(0,0,t.width,t.height);for(const n of t.pixelVerticalLines||[])e.strokeStyle=n.color,e.beginPath(),e.moveTo(n.x,t.margins.top-20),e.lineTo(n.x,t.height-t.margins.bottom),e.stroke();t.barBoxes.forEach(n=>{e.fillStyle=n.color,e.fillRect(n.x1,n.y1,n.x2-n.x1,n.y2-n.y1)}),t.xLabel&&(e.textBaseline="bottom",e.textAlign="center",e.fillStyle="black",e.fillText(t.xLabel,t.width/2,t.height-3));for(const n of t.pixelTicks||[])e.strokeStyle="black",e.beginPath(),e.moveTo(n.x,t.height-t.margins.bottom),e.lineTo(n.x,t.height-t.margins.bottom+6),e.stroke(),e.textBaseline="top",e.textAlign="center",e.fillStyle="black",e.fillText(n.label,n.x,t.height-t.margins.bottom+8)},_U=e=>B.jsx(vr,{width:e.width,height:e.height,draw:TU,drawData:e}),BU={},NU=({bars:e,range:t,ticks:n,verticalLines:r,xLabel:i,onSelectRect:a,width:o,height:u})=>{const{xMin:l,xMax:s}=_.useMemo(()=>t?{xMin:t.min,xMax:t.max}:e.length>0?{xMin:e[0].xStart,xMax:e[e.length-1].xEnd}:{xMin:0,xMax:1},[e,t]),c=_.useMemo(()=>Math.max(...e.map(S=>S.height)),[e]),{barBoxes:f,margins:d,pixelTicks:h,pixelVerticalLines:g}=_.useMemo(()=>{const S={left:3,right:3,top:5,bottom:3+(i?18:0)+(n?18:0)},A=o-S.left-S.right,C=u-S.top-S.bottom,M=e.map(N=>({key:N.key,x1:S.left+(N.xStart-l)/(s-l)*A,x2:S.left+(N.xEnd-l)/(s-l)*A,y1:S.top+C*(1-N.height/c),y2:S.top+C,tooltip:N.tooltip,color:N.color})),T=n?n.map(N=>({x:S.left+(N.x-l)/(s-l)*A,label:`${N.label}`})):void 0,x=r?r.map(N=>({x:S.left+(N.x-l)/(s-l)*A,color:N.color})):void 0;return{barBoxes:M,margins:S,pixelTicks:T,pixelVerticalLines:x}},[e,n,r,l,s,c,o,u,i]),m=_.useCallback((S,{ctrlKey:A,shiftKey:C})=>{const M=[],T={x:S[0],y:S[1],width:S[2],height:S[3]};for(const z of f)z.x1<=T.x+T.width&&z.x2>=T.x&&M.push(z.key);const x=o-d.left-d.right,N=(T.x-d.left)/x*(s-l)+l,R=(T.x+T.width-d.left)/x*(s-l)+l;a&&a(T,M,{ctrlKey:A,shiftKey:C,xMin:N,xMax:R})},[f,a,d.left,d.right,o,l,s]),D=_.useCallback(()=>{},[]),{onMouseMove:p,onMouseDown:v,onMouseUp:y,onMouseLeave:w,paintDragSelectLayer:E}=Tc(o,u,m,D),b=_.useMemo(()=>B.jsx(vr,{width:o,height:u,draw:E,drawData:BU}),[o,u,E]);return B.jsxs("div",{style:{width:o,height:u,position:"relative"},onMouseDown:v,onMouseMove:p,onMouseUp:y,onMouseLeave:w,children:[B.jsx(_U,{barBoxes:f,margins:d,pixelTicks:h,pixelVerticalLines:g,xLabel:i,width:o,height:u}),b]})},FU=(e,t)=>{const n=t-e;let r;n<=30?r=10:n<=120?r=20:n<=300?r=50:n<=600?r=100:n<=1e3?r=150:r=100;const i=[];let a=Math.ceil(e/r);for(;a*r<=t;)i.push(a*r),a++;return i},RU=({metric:e,metricRange:t,units:n,selectedUnitIds:r,setSelectedUnitIds:i,numBins:a,onZoomToRect:o,width:u,height:l})=>{const{bars:s,ticks:c,verticalLines:f}=_.useMemo(()=>{const h=n.map(p=>p.values[e.key]).filter(p=>p!==void 0).map(p=>p),g=n.filter(p=>r.has(p.unitId)).map(p=>p.values[e.key]).filter(p=>p!==void 0).map(p=>p),D=n.filter(p=>r.has(p.unitId)).map(p=>({unitId:p.unitId,value:p.values[e.key]})).filter(p=>p.value!==void 0).map(p=>p.unitId).map(p=>Ir(Nt(p)));return OU(h,g,D,a||10)},[n,e,r,a]),d=_.useCallback((h,g,{ctrlKey:m,shiftKey:D,xMin:p,xMax:v})=>{if(D){o&&o({x:p,y:h.y,width:v-p,height:h.height});return}if(g.length===0)return;const y=[];for(const S of g){const A=s[S];y.push(A)}const w=Math.min(...y.map(S=>S.xStart)),E=Math.max(...y.map(S=>S.xEnd)),b=[];for(const S of n){const A=S.values[e.key];A!==void 0&&w<=A&&A<=E&&b.push(S.unitId)}i(m||D?[...new Set([...r,...b])]:b)},[s,e,r,i,n,o]);return B.jsx(NU,{width:u,height:l,bars:s,range:t,ticks:c,verticalLines:f,onSelectRect:d})},OU=(e,t,n,r)=>{if(e.length===0)return{bars:[],ticks:[],verticalLines:[]};let i=Math.min(...e),a=Math.max(...e);if(a<=i)return{bars:[],ticks:[],verticalLines:[]};i-=(a-i)/r/2,a+=(a-i)/r/2;const o=[];for(let f=0;f<r;f++)o.push(0);for(const f of e){const d=Math.min(Math.floor((f-i)/(a-i)*r),r-1);o[d]++}const u=[];for(let f=0;f<r;f++)u.push(0);for(const f of t){const d=Math.min(Math.floor((f-i)/(a-i)*r),r-1);u[d]++}const l=[];t.forEach((f,d)=>{l.push({x:f,color:n[d]})});const c=zU(i,a).map(f=>({x:f,label:`${f}`}));return{bars:[...o.map((f,d)=>({key:d,xStart:i+d*(a-i)/r,xEnd:i+(d+1)*(a-i)/r,height:f,tooltip:"",color:"gray"}))],ticks:c,verticalLines:l}},zU=(e,t)=>{const n=t-e;if(n<=0)return[];let r=1;for(;n*r<100;)r*=10;for(;n*r>=1e3;)r/=10;return FU(e*r,t*r).map(i=>i/r)},UU=(e,t)=>{e.clearRect(0,0,t.width,t.height),t.markers.forEach(n=>{const r=t.coord2Pixel({x:n.x,y:n.y});e.fillStyle=n.color,e.strokeStyle="black",e.beginPath(),e.ellipse(r.x,r.y,n.radius,n.radius,0,0,2*Math.PI),e.fill(),e.stroke()})},IU=e=>B.jsx(vr,{width:e.width,height:e.height,draw:UU,drawData:e}),$U={},kU=({markers:e,xRange:t,yRange:n,onSelectRect:r,onClickPoint:i,width:a,height:o})=>{const{margins:u}=_.useMemo(()=>({margins:{left:20,right:20,top:20,bottom:20}}),[]),{xMin:l,xMax:s,yMin:c,yMax:f}=_.useMemo(()=>{let b,S,A,C;return t?(b=t.min,S=t.max):e.length>0?(b=Math.min(...e.map(M=>M.x)),S=Math.max(...e.map(M=>M.x))):(b=0,S=1),n?(A=n.min,C=n.max):e.length>0?(A=Math.min(...e.map(M=>M.y)),C=Math.max(...e.map(M=>M.y))):(A=0,C=1),{xMin:b,xMax:S,yMin:A,yMax:C}},[e,t,n]),{coord2Pixel:d,pixel2Coord:h}=_.useMemo(()=>{const b=a-u.left-u.right,S=o-u.top-u.bottom;return{coord2Pixel:M=>({x:u.left+(M.x-l)/(s-l)*b,y:u.top+(1-(M.y-c)/(f-c))*S}),pixel2Coord:M=>({x:l+(M.x-u.left)/b*(s-l),y:c+(1-(M.y-u.top)/S)*(f-c)})}},[a,o,u,l,s,c,f]),g=_.useCallback((b,{ctrlKey:S,shiftKey:A})=>{const C={x:b[0],y:b[1],width:b[2],height:b[3]},M=[];for(const x of e){const N=d({x:x.x,y:x.y}),R={xmin:N.x-x.radius,ymin:N.y-x.radius,xmax:N.x+x.radius,ymax:N.y+x.radius};ep({xmin:C.x,xmax:C.x+C.width,ymin:C.y,ymax:C.y+C.height},R)&&M.push(x.key)}const T=LU(h,C);r&&r(T,M,{ctrlKey:S,shiftKey:A})},[r,h,e,d]),m=_.useCallback((b,{ctrlKey:S,shiftKey:A})=>{const C={x:b[0],y:b[1]},M={x:C.x,y:C.y,width:1,height:1};let T;for(const x of e){const N=d({x:x.x,y:x.y}),R={xmin:N.x-x.radius,ymin:N.y-x.radius,xmax:N.x+x.radius,ymax:N.y+x.radius};ep({xmin:M.x,xmax:M.x+M.width,ymin:M.y,ymax:M.y+M.height},R)&&(T=x.key)}i&&i(h(C),T,{ctrlKey:S,shiftKey:A})},[d,e,i,h]),{onMouseMove:D,onMouseDown:p,onMouseUp:v,onMouseLeave:y,paintDragSelectLayer:w}=Tc(a,o,g,m),E=_.useMemo(()=>B.jsx(vr,{width:a,height:o,draw:w,drawData:$U}),[a,o,w]);return B.jsxs("div",{style:{width:a,height:o,position:"relative"},onMouseDown:p,onMouseMove:D,onMouseUp:v,onMouseLeave:y,children:[B.jsx(IU,{markers:e,margins:u,coord2Pixel:d,width:a,height:o}),E]})},LU=(e,t)=>{const n=e({x:t.x,y:t.y}),r=e({x:t.x+t.width,y:t.y+t.height});return{x:Math.min(n.x,r.x),y:Math.min(n.y,r.y),width:Math.abs(r.x-n.x),height:Math.abs(r.y-n.y)}},jU=({metric1:e,metric2:t,metric1Range:n,metric2Range:r,units:i,selectedUnitIds:a,setSelectedUnitIds:o,onZoomToRect:u,width:l,height:s})=>{const f=_.useMemo(()=>{const g=[];for(const m of i){const D=m.values[e.key],p=m.values[t.key];D!==void 0&&p!==void 0&&g.push({key:m.unitId,x:D,y:p,color:a.has(m.unitId)?Ir(Nt(m.unitId)):"lightgray",radius:6,tooltip:`Unit ${m.unitId}`})}return g},[i,e,t,a]),d=_.useCallback((g,m,{ctrlKey:D,shiftKey:p})=>{if(p){u&&u(g);return}let v=m;D&&(v=[...new Set([...m,...a])]),o(v)},[o,a,u]),h=_.useCallback((g,m,{ctrlKey:D,shiftKey:p})=>{let v;if(D||p){const y=new Set([...a]);m!==void 0&&(y.has(m)?y.delete(m):y.add(m)),v=[...y]}else m===void 0?v=[]:v=[m];o(v)},[o,a]);return B.jsx(kU,{width:l,height:s,markers:f,xRange:n,yRange:r,onSelectRect:d,onClickPoint:h})},PU=({type:e,metric1:t,metric2:n,metric1Range:r,metric2Range:i,units:a,selectedUnitIds:o,setSelectedUnitIds:u,numHistogramBins:l,onZoomToRect:s,width:c,height:f})=>{if(e==="histogram"){if(!t)throw Error("Unexpected: metric1 not defined");return B.jsx(RU,{metric:t,metricRange:r,units:a,selectedUnitIds:o,setSelectedUnitIds:u,numBins:l,onZoomToRect:s,width:c,height:f})}else if(e==="scatter"){if(!t)throw Error("Unexpected: metric1 not defined");if(!n)throw Error("Unexpected: metric2 not defined");return B.jsx(jU,{metric1:t,metric2:n,metric1Range:r,metric2Range:i,units:a,selectedUnitIds:o,setSelectedUnitIds:u,onZoomToRect:s,width:c,height:f})}else{if(e==="bottom-label")return B.jsx("div",{style:{width:c,textAlign:"center"},children:t?.label||B.jsx("span",{children:" "})});if(e==="left-label")return B.jsx("div",{style:{width:c,height:f,overflow:"hidden",writingMode:"vertical-lr",transform:"rotate(-180deg)",textAlign:"center"},children:t?.label||B.jsx("span",{children:" "})});throw Error(`Unexpected type: ${e}`)}},HU=({data:e,width:t,height:n})=>{const{units:r,metrics:i}=e,{selectedUnitIds:a,unitIdSelectionDispatch:o}=ii(),{selectedUnitMetrics:u}=Zh(),[l,s]=_.useState(1),[c,f]=_.useState(10),[d,h]=_.useState({}),g=_.useMemo(()=>r.sort((v,y)=>a.has(v.unitId)&&!a.has(y.unitId)?1:!a.has(v.unitId)&&a.has(y.unitId)?-1:Nt(v.unitId)-Nt(y.unitId)),[r,a]);_.useEffect(()=>{o({type:To,newUnitOrder:Nr(g.map(v=>v.unitId))})},[g,o]);const m=_.useMemo(()=>{const v=u.length===0?[{type:"text",content:"Box size",title:"Set box size"},{type:"button",callback:()=>s(E=>E*1.3),title:"Increase box size",icon:B.jsx(mf,{})},{type:"button",callback:()=>s(E=>E/1.3),title:"Decrease box size",icon:B.jsx(hf,{})}]:[],y=[{type:"text",content:"# bins",title:""},{type:"button",callback:()=>f(E=>E+5),title:"Increase num. histogram bins",icon:B.jsx(mf,{})},{type:"button",callback:()=>f(E=>Math.max(5,E-5)),title:"Decrease num. histogram bins",icon:B.jsx(hf,{})}],w={type:"button",callback:()=>h({}),title:"Reset zoom",text:"reset"};return[...v,{type:"divider"},...y,{type:"divider"},w]},[u.length]),D=Pl,p=_.useMemo(()=>{const v=y=>{o({type:"SET_SELECTION",incomingSelectedUnitIds:y})};if(u.length===0)return i.map(y=>{const w={type:"histogram",metric1:y,metric2:y,metric1Range:d[y.key],metric2Range:d[y.key],units:g,width:400*l,height:400*l,numHistogramBins:c,selectedUnitIds:a,setSelectedUnitIds:v,onZoomToRect:b=>{h({...d,[y.key]:{min:b.x,max:b.x+b.width}})}};return{key:y.key,label:y.label,unitId:"",labelColor:"black",props:w}});{const{plotWidth:E,plotHeight:b}=$x(t-D-30-10,n-30-10,u.length),S=[];for(const A of u){const C=i.filter(M=>M.key===A)[0];{const M={type:"left-label",metric1:C,metric2:C,units:g,numHistogramBins:c,width:30,height:b,selectedUnitIds:a,setSelectedUnitIds:v};S.push({key:`left-label-${A}`,label:void 0,unitId:"",labelColor:"black",props:M,hideBorderColor:!0})}for(const M of u){const T=i.filter(x=>x.key===M)[0];if(C&&T){const x={type:A===M?"histogram":"scatter",metric1:T,metric2:C,metric1Range:d[T.key],metric2Range:d[C.key],units:g,numHistogramBins:c,width:E,height:b,selectedUnitIds:a,setSelectedUnitIds:v,onZoomToRect:N=>{h(A!==M?{...d,[T.key]:{min:N.x,max:N.x+N.width},[C.key]:{min:N.y,max:N.y+N.height}}:{...d,[C.key]:{min:N.x,max:N.x+N.width}})}};S.push({key:`${M}-${A}`,label:x.type==="histogram"?A:void 0,unitId:"",labelColor:"black",props:x})}}}{const A={type:"bottom-label",metric1:void 0,metric2:void 0,units:g,numHistogramBins:c,width:30,height:30,selectedUnitIds:a,setSelectedUnitIds:v};S.push({key:"left-bottom-label",label:void 0,unitId:"",labelColor:"black",props:A,hideBorderColor:!0})}for(const A of u){const C=i.filter(T=>T.key===A)[0],M={type:"bottom-label",metric1:C,metric2:C,units:g,numHistogramBins:c,width:E,height:30,selectedUnitIds:a,setSelectedUnitIds:v};S.push({key:`bottom-label-${A}`,label:void 0,unitId:"",labelColor:"black",props:M,hideBorderColor:!0})}return S}},[i,a,g,l,u,c,t,n,o,d,D]);return B.jsxs(su,{width:t,height:n,initialPosition:D,adjustable:!1,children:[B.jsx(Hl,{width:D,height:n,customActions:m}),B.jsx(cf,{width:0,height:0,disableScroll:u.length>0,children:B.jsx(sf,{plots:p,plotComponent:PU,numPlotsPerRow:u.length===0?void 0:u.length+1})})]})},qU=({data:e,width:t,height:n})=>{const{metrics:r}=e,{unitMetricSelectionDispatch:i}=Zh();return _.useEffect(()=>{i({type:"initialize",unitMetrics:r.map(a=>a.key)})},[r,i]),B.jsxs(su,{width:t,height:n,initialPosition:200,adjustable:!0,children:[B.jsx(MU,{width:0,height:0}),B.jsx(HU,{data:e,width:0,height:0})]})},GU=e=>Mc(e,{key:Cc,label:Cc,dtype:Cc}),VU=e=>Mc(e,{unitId:w4([S4,Cc]),values:()=>!0}),YU=e=>Mc(e,{type:x4("UnitMetricsGraph"),metrics:w2(GU),units:w2(VU)}),XU=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=_.useState(null),[o,u]=_.useState(null),[l,s]=_.useState(!0);return _.useEffect(()=>{let c=!1;return(async()=>{try{s(!0),u(null);const d=e.attrs.metrics||[],h=await e.getDatasetData("units_data",{});if(!h||h.length===0)throw new Error("Empty units data");const g=new Uint8Array(h),m=new TextDecoder("utf-8").decode(g),D=JSON.parse(m);if(c)return;const p={type:"UnitMetricsGraph",metrics:d,units:D.map(v=>({unitId:v.unit_id,values:v.values}))};if(!YU(p))throw new Error("Invalid view data structure");a(p)}catch(d){console.error("Error loading unit metrics graph data:",d),u(`Failed to load unit metrics graph data: ${d instanceof Error?d.message:String(d)}`)}finally{s(!1)}})(),()=>{c=!0}},[e]),o?B.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading unit metrics data..."}):i?B.jsx(ZU,{context:t.unitMetricSelection,children:B.jsx(vi,{context:t.unitSelection,children:B.jsx(qU,{data:i,width:n,height:r})})}):B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No unit metrics data available"})},ZU=({context:e,children:t})=>{const{state:n,dispatch:r}=cd(e);return r?B.jsx(wb.Provider,{value:{unitMetricSelection:n,unitMetricSelectionDispatch:r},children:t}):B.jsx(B.Fragment,{children:"Waiting for unit metric selection context..."})},Xx=()=>{const e={current:{}},t=[];return{stateRef:e,dispatch:i=>{e.current=Z3(e.current,i),t.forEach(a=>{a(e.current)})},onChange:i=>(t.push(i),()=>{const a=t.indexOf(i);a>=0&&t.splice(a,1)}),createNew:Xx}},Zx=()=>{const e={current:Bb},t=[];return{stateRef:e,dispatch:i=>{e.current=wC(e.current,i),t.forEach(a=>{a(e.current)})},onChange:i=>(t.push(i),()=>{const a=t.indexOf(i);a>=0&&t.splice(a,1)}),createNew:Zx}},Kx=()=>{const e={current:{}},t=[];return{stateRef:e,dispatch:i=>{e.current=Gp(e.current,i),t.forEach(a=>{a(e.current)})},onChange:i=>(t.push(i),()=>{const a=t.indexOf(i);a>=0&&t.splice(a,1)}),createNew:Kx}},KU=({zarrGroup:e,width:t,height:n,onResize:r,onDataChange:i,contexts:a,component:o})=>{const[u,l]=_.useState(t),[s,c]=_.useState(n),[f,d]=_.useState(e);return _.useEffect(()=>{r((h,g)=>{l(h),c(g)}),i(h=>{d(h)})},[r,i]),B.jsx(o,{zarrGroup:f,width:u,height:s,contexts:a})},QU=e=>t=>{const{container:n,zarrGroup:r,width:i,height:a,onResize:o,onDataChange:u,contexts:l}=t;X3.createRoot(n).render(B.jsx(KU,{zarrGroup:r,width:i,height:a,onResize:o,onDataChange:u,contexts:l,component:e}))};(()=>{const e=[{name:"spike_sorting.Autocorrelograms",component:OO},{name:"spike_sorting.AverageWaveforms",component:Az},{name:"spike_sorting.CrossCorrelograms",component:Tz},{name:"spike_sorting.RasterPlot",component:cU},{name:"spike_sorting.SpikeAmplitudes",component:hU},{name:"spike_sorting.UnitLocations",component:SU},{name:"spike_sorting.UnitMetricsGraph",component:XU},{name:"spike_sorting.UnitsTable",component:YO},{name:"spike_sorting.SortingCuration",component:HO}],t=window.figpack_p1.registerFPViewComponent;for(const i of e)t({name:i.name,render:QU(i.component)});const n=window.figpack_p1.registerFPViewContextCreator;n({name:"unitSelection",create:Zx}),n({name:"unitMetricSelection",create:Xx}),n({name:"sortingCuration",create:Kx});const r=window.figpack_p1.registerFPExtension;r({name:"figpack-spike-sorting"})})()})();
|
|
185
|
+
`,_B=typeof zm!="string"?sm`
|
|
186
|
+
animation: ${zm} 1.4s linear infinite;
|
|
187
|
+
`:null,BB=typeof Um!="string"?sm`
|
|
188
|
+
animation: ${Um} 1.4s ease-in-out infinite;
|
|
189
|
+
`:null,FB=e=>{const{classes:t,variant:n,color:r,disableShrink:i}=e,a={root:["root",n,`color${Ue(r)}`],svg:["svg"],circle:["circle",`circle${Ue(n)}`,i&&"circleDisableShrink"]};return Un(a,MB,t)},NB=wt("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Ue(n.color)}`]]}})(In(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:_B||{animation:`${zm} 1.4s linear infinite`}},...Object.entries(e.palette).filter(No()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),RB=wt("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),OB=wt("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Ue(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(In(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:BB||{animation:`${Um} 1.4s ease-in-out infinite`}}]}))),zB=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiCircularProgress"}),{className:i,color:a="primary",disableShrink:o=!1,size:u=40,style:l,thickness:s=3.6,value:c=0,variant:f="indeterminate",...d}=r,h={...r,color:a,disableShrink:o,size:u,thickness:s,value:c,variant:f},v=FB(h),m={},D={},p={};if(f==="determinate"){const g=2*Math.PI*((Ui-s)/2);m.strokeDasharray=g.toFixed(3),p["aria-valuenow"]=Math.round(c),m.strokeDashoffset=`${((100-c)/100*g).toFixed(3)}px`,D.transform="rotate(-90deg)"}return B.jsx(NB,{className:at(v.root,i),style:{width:u,height:u,...D,...l},ownerState:h,ref:n,role:"progressbar",...p,...d,children:B.jsx(RB,{className:v.svg,ownerState:h,viewBox:`${Ui/2} ${Ui/2} ${Ui} ${Ui}`,children:B.jsx(OB,{className:v.circle,style:m,ownerState:h,cx:Ui,cy:Ui,r:(Ui-s)/2,fill:"none",strokeWidth:s})})})});function UB(e){return yn("MuiIconButton",e)}const cS=bn("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),IB=e=>{const{classes:t,disabled:n,color:r,edge:i,size:a,loading:o}=e,u={root:["root",o&&"loading",n&&"disabled",r!=="default"&&`color${Ue(r)}`,i&&`edge${Ue(i)}`,`size${Ue(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Un(u,UB,t)},$B=wt(sS,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${Ue(n.color)}`],n.edge&&t[`edge${Ue(n.edge)}`],t[`size${Ue(n.size)}`]]}})(In(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),In(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(No()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(No()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${cS.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${cS.loading}`]:{color:"transparent"}}))),kB=wt("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),cl=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiIconButton"}),{edge:i=!1,children:a,className:o,color:u="default",disabled:l=!1,disableFocusRipple:s=!1,size:c="medium",id:f,loading:d=null,loadingIndicator:h,...v}=r,m=t9(f),D=h??B.jsx(zB,{"aria-labelledby":m,color:"inherit",size:16}),p={...r,edge:i,color:u,disabled:l,disableFocusRipple:s,loading:d,loadingIndicator:D,size:c},g=IB(p);return B.jsxs($B,{id:d?m:f,className:at(g.root,o),centerRipple:!0,focusRipple:!s,disabled:l||d,ref:n,...v,ownerState:p,children:[typeof d=="boolean"&&B.jsx("span",{className:g.loadingWrapper,style:{display:"contents"},children:B.jsx(kB,{className:g.loadingIndicator,ownerState:p,children:d&&D})}),a]})});function LB({props:e,states:t,muiFormControl:n}){return t.reduce((r,i)=>(r[i]=e[i],n&&typeof e[i]>"u"&&(r[i]=n[i]),r),{})}const jB=M.createContext(void 0);function fS(){return M.useContext(jB)}function HB(e){return yn("PrivateSwitchBase",e)}bn("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const PB=e=>{const{classes:t,checked:n,disabled:r,edge:i}=e,a={root:["root",n&&"checked",r&&"disabled",i&&`edge${Ue(i)}`],input:["input"]};return Un(a,HB,t)},qB=wt(sS,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),VB=wt("input",{name:"MuiSwitchBase",shouldForwardProp:Cm})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),dS=M.forwardRef(function(t,n){const{autoFocus:r,checked:i,checkedIcon:a,defaultChecked:o,disabled:u,disableFocusRipple:l=!1,edge:s=!1,icon:c,id:f,inputProps:d,inputRef:h,name:v,onBlur:m,onChange:D,onFocus:p,readOnly:g,required:y=!1,tabIndex:S,type:w,value:b,slots:E={},slotProps:C={},...A}=t,[T,_]=Y9({controlled:i,default:!!o}),x=fS(),F=k=>{p&&p(k),x&&x.onFocus&&x.onFocus(k)},R=k=>{m&&m(k),x&&x.onBlur&&x.onBlur(k)},z=k=>{if(k.nativeEvent.defaultPrevented)return;const q=k.target.checked;_(q),D&&D(k,q)};let N=u;x&&typeof N>"u"&&(N=x.disabled);const U=w==="checkbox"||w==="radio",I={...t,checked:T,disabled:N,disableFocusRipple:l,edge:s},L=PB(I),G={slots:E,slotProps:{input:d,...C}},[X,P]=Fo("root",{ref:n,elementType:qB,className:L.root,shouldForwardComponentProp:!0,externalForwardedProps:{...G,component:"span",...A},getSlotProps:k=>({...k,onFocus:q=>{k.onFocus?.(q),F(q)},onBlur:q=>{k.onBlur?.(q),R(q)}}),ownerState:I,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:N,role:void 0,tabIndex:null}}),[j,H]=Fo("input",{ref:h,elementType:VB,className:L.input,externalForwardedProps:G,getSlotProps:k=>({...k,onChange:q=>{k.onChange?.(q),z(q)}}),ownerState:I,additionalProps:{autoFocus:r,checked:i,defaultChecked:o,disabled:N,id:U?f:void 0,name:v,readOnly:g,required:y,tabIndex:S,type:w,...w==="checkbox"&&b===void 0?{}:{value:b}}});return B.jsxs(X,{...P,children:[B.jsx(j,{...H}),T?a:c]})}),GB=Mm(B.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),YB=Mm(B.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),XB=Mm(B.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function ZB(e){return yn("MuiCheckbox",e)}const Im=bn("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),QB=e=>{const{classes:t,indeterminate:n,color:r,size:i}=e,a={root:["root",n&&"indeterminate",`color${Ue(r)}`,`size${Ue(i)}`]},o=Un(a,ZB,t);return{...t,...o}},KB=wt(dS,{shouldForwardProp:e=>Cm(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Ue(n.size)}`],n.color!=="default"&&t[`color${Ue(n.color)}`]]}})(In(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(No()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(No()).map(([t])=>({props:{color:t},style:{[`&.${Im.checked}, &.${Im.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${Im.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),WB=B.jsx(YB,{}),JB=B.jsx(GB,{}),eF=B.jsx(XB,{}),hS=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiCheckbox"}),{checkedIcon:i=WB,color:a="primary",icon:o=JB,indeterminate:u=!1,indeterminateIcon:l=eF,inputProps:s,size:c="medium",disableRipple:f=!1,className:d,slots:h={},slotProps:v={},...m}=r,D=u?l:o,p=u?l:i,g={...r,disableRipple:f,color:a,indeterminate:u,size:c},y=QB(g),S=v.input??s,[w,b]=Fo("root",{ref:n,elementType:KB,className:at(y.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:h,slotProps:v,...m},ownerState:g,additionalProps:{type:"checkbox",icon:M.cloneElement(D,{fontSize:D.props.fontSize??c}),checkedIcon:M.cloneElement(p,{fontSize:p.props.fontSize??c}),disableRipple:f,slots:h,slotProps:{input:Z9(typeof S=="function"?S(g):S,{"data-indeterminate":u})}}});return B.jsx(w,{...b,classes:y})});function tF(e){return yn("MuiFormGroup",e)}bn("MuiFormGroup",["root","row","error"]);const nF=e=>{const{classes:t,row:n,error:r}=e;return Un({root:["root",n&&"row",r&&"error"]},tF,t)},rF=wt("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),iF=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiFormGroup"}),{className:i,row:a=!1,...o}=r,u=fS(),l=LB({props:r,muiFormControl:u,states:["error"]}),s={...r,row:a,error:l.error},c=nF(s);return B.jsx(rF,{className:at(c.root,i),ownerState:s,ref:n,...o})});function aF(e){return yn("MuiSwitch",e)}const on=bn("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),oF=e=>{const{classes:t,edge:n,size:r,color:i,checked:a,disabled:o}=e,u={root:["root",n&&`edge${Ue(n)}`,`size${Ue(r)}`],switchBase:["switchBase",`color${Ue(i)}`,a&&"checked",o&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=Un(u,aF,t);return{...t,...l}},uF=wt("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${Ue(n.edge)}`],t[`size${Ue(n.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${on.thumb}`]:{width:16,height:16},[`& .${on.switchBase}`]:{padding:4,[`&.${on.checked}`]:{transform:"translateX(16px)"}}}}]}),lF=wt(dS,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${on.input}`]:t.input},n.color!=="default"&&t[`color${Ue(n.color)}`]]}})(In(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${on.checked}`]:{transform:"translateX(20px)"},[`&.${on.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${on.checked} + .${on.track}`]:{opacity:.5},[`&.${on.disabled} + .${on.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${on.input}`]:{left:"-100%",width:"300%"}})),In(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(No(["light"])).map(([t])=>({props:{color:t},style:{[`&.${on.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${on.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${on.checked} + .${on.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),sF=wt("span",{name:"MuiSwitch",slot:"Track"})(In(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),cF=wt("span",{name:"MuiSwitch",slot:"Thumb"})(In(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),mS=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiSwitch"}),{className:i,color:a="primary",edge:o=!1,size:u="medium",sx:l,slots:s={},slotProps:c={},...f}=r,d={...r,color:a,edge:o,size:u},h=oF(d),v={slots:s,slotProps:c},[m,D]=Fo("root",{className:at(h.root,i),elementType:uF,externalForwardedProps:v,ownerState:d,additionalProps:{sx:l}}),[p,g]=Fo("thumb",{className:h.thumb,elementType:cF,externalForwardedProps:v,ownerState:d}),y=B.jsx(p,{...g}),[S,w]=Fo("track",{className:h.track,elementType:sF,externalForwardedProps:v,ownerState:d});return B.jsxs(m,{...D,children:[B.jsx(lF,{type:"checkbox",icon:y,checkedIcon:y,ref:n,ownerState:d,...f,classes:{...h,root:h.switchBase},slots:{...s.switchBase&&{root:s.switchBase},...s.input&&{input:s.input}},slotProps:{...c.switchBase&&{root:typeof c.switchBase=="function"?c.switchBase(d):c.switchBase},input:{role:"switch"},...c.input&&{input:typeof c.input=="function"?c.input(d):c.input}}}),B.jsx(S,{...w})]})}),pS=M.createContext();function fF(e){return yn("MuiTable",e)}bn("MuiTable",["root","stickyHeader"]);const dF=e=>{const{classes:t,stickyHeader:n}=e;return Un({root:["root",n&&"stickyHeader"]},fF,t)},hF=wt("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(In(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:t})=>t.stickyHeader,style:{borderCollapse:"separate"}}]}))),gS="table",mF=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTable"}),{className:i,component:a=gS,padding:o="normal",size:u="medium",stickyHeader:l=!1,...s}=r,c={...r,component:a,padding:o,size:u,stickyHeader:l},f=dF(c),d=M.useMemo(()=>({padding:o,size:u,stickyHeader:l}),[o,u,l]);return B.jsx(pS.Provider,{value:d,children:B.jsx(hF,{as:a,role:a===gS?null:"table",ref:n,className:at(f.root,i),ownerState:c,...s})})}),Df=M.createContext();function pF(e){return yn("MuiTableBody",e)}bn("MuiTableBody",["root"]);const gF=e=>{const{classes:t}=e;return Un({root:["root"]},pF,t)},vF=wt("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),yF={variant:"body"},vS="tbody",bF=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTableBody"}),{className:i,component:a=vS,...o}=r,u={...r,component:a},l=gF(u);return B.jsx(Df.Provider,{value:yF,children:B.jsx(vF,{className:at(l.root,i),as:a,ref:n,role:a===vS?null:"rowgroup",ownerState:u,...o})})});function DF(e){return yn("MuiTableCell",e)}const SF=bn("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),xF=e=>{const{classes:t,variant:n,align:r,padding:i,size:a,stickyHeader:o}=e,u={root:["root",n,o&&"stickyHeader",r!=="inherit"&&`align${Ue(r)}`,i!=="normal"&&`padding${Ue(i)}`,`size${Ue(a)}`]};return Un(u,DF,t)},wF=wt("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${Ue(n.size)}`],n.padding!=="normal"&&t[`padding${Ue(n.padding)}`],n.align!=="inherit"&&t[`align${Ue(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(In(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid
|
|
190
|
+
${e.palette.mode==="light"?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${SF.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:t})=>t.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),Sf=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTableCell"}),{align:i="inherit",className:a,component:o,padding:u,scope:l,size:s,sortDirection:c,variant:f,...d}=r,h=M.useContext(pS),v=M.useContext(Df),m=v&&v.variant==="head";let D;o?D=o:D=m?"th":"td";let p=l;D==="td"?p=void 0:!p&&m&&(p="col");const g=f||v&&v.variant,y={...r,align:i,component:D,padding:u||(h&&h.padding?h.padding:"normal"),size:s||(h&&h.size?h.size:"medium"),sortDirection:c,stickyHeader:g==="head"&&h&&h.stickyHeader,variant:g},S=xF(y);let w=null;return c&&(w=c==="asc"?"ascending":"descending"),B.jsx(wF,{as:D,ref:n,className:at(S.root,a),"aria-sort":w,scope:p,ownerState:y,...d})});function EF(e){return yn("MuiTableHead",e)}bn("MuiTableHead",["root"]);const AF=e=>{const{classes:t}=e;return Un({root:["root"]},EF,t)},CF=wt("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),TF={variant:"head"},yS="thead",MF=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTableHead"}),{className:i,component:a=yS,...o}=r,u={...r,component:a},l=AF(u);return B.jsx(Df.Provider,{value:TF,children:B.jsx(CF,{as:a,className:at(l.root,i),ref:n,role:a===yS?null:"rowgroup",ownerState:u,...o})})});function _F(e){return yn("MuiTableRow",e)}const bS=bn("MuiTableRow",["root","selected","hover","head","footer"]),BF=e=>{const{classes:t,selected:n,hover:r,head:i,footer:a}=e;return Un({root:["root",n&&"selected",r&&"hover",i&&"head",a&&"footer"]},_F,t)},FF=wt("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(In(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${bS.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${bS.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)}}}))),DS="tr",SS=M.forwardRef(function(t,n){const r=$n({props:t,name:"MuiTableRow"}),{className:i,component:a=DS,hover:o=!1,selected:u=!1,...l}=r,s=M.useContext(Df),c={...r,component:a,hover:o,selected:u,head:s&&s.variant==="head",footer:s&&s.variant==="footer"},f=BF(c);return B.jsx(FF,{as:a,ref:n,className:at(f.root,i),role:a===DS?null:"row",ownerState:c,...l})}),NF={paddingLeft:0,paddingRight:0,paddingTop:1,paddingBottom:1},fl=35,RF=e=>{const t=e.selected?"secondary":"inherit";return B.jsx("span",{title:e.title,children:e.icon?B.jsx(cl,{title:e.title,onClick:e.onClick,color:t,style:NF,disabled:!!e.disabled,sx:{fontSize:18},children:e.icon},e.elementIndex):B.jsx("button",{title:e.title,onClick:e.onClick,disabled:!!e.disabled,style:{padding:0,margin:0,fontSize:10},children:e.text},e.elementIndex)},e.elementIndex+"-span")},OF=e=>e.useHorizontalLayout?B.jsx(B.Fragment,{}):B.jsx("hr",{},e.elementIndex),zF=e=>{const t=Number.isFinite(e.content)?e.content:0,n=e.contentSigFigs||0,r=Math.abs(t-Math.round(t))*10**(n+1)<1,i=Number.isFinite(e.content)?r&&!e.contentAlwaysShowDecimal?Math.round(t)+"":t.toFixed(e.contentSigFigs||2):e.content||"",a=e.useHorizontalLayout?"span":"div";return Nt.createElement(a,{key:e.elementIndex,title:e.title,style:{textAlign:"left",fontWeight:"bold",cursor:"default",fontSize:10}},i)},UF=e=>{switch(e.subtype){case"checkbox":return B.jsx(IF,{...e});case"slider":return B.jsx($F,{...e});default:return B.jsxs("span",{children:["ERROR: Bad toggle subtype ",e.subtype]},e.elementIndex)}},IF=e=>B.jsx(hS,{checked:e.selected,onClick:e.onClick,style:{padding:0,paddingLeft:0},title:e.title,disabled:e.disabled},e.elementIndex),$F=e=>B.jsx(iF,{children:B.jsx(mS,{checked:e.selected,size:"small",style:{left:-3},onChange:e.onClick,disabled:e.disabled,title:e.title})},e.elementIndex),kF=e=>{switch(e.type){case"button":return B.jsx(RF,{...e});case"divider":return B.jsx(OF,{...e});case"text":return B.jsx(zF,{...e});case"toggle":return B.jsx(UF,{...e});default:return B.jsx("span",{},e.elementIndex)}},LF=e=>(e||[]).map((t,n)=>({type:t.type||"button",subtype:t.subtype,title:t.title,onClick:t.callback,icon:t.icon||"",text:t.text||"",selected:t.selected,disabled:t.disabled,content:t.content,contentSigFigs:t.contentSigFigs,contentAlwaysShowDecimal:t.boolean,elementIndex:n})),dl=e=>{const t=M.useMemo(()=>LF(e.customActions),[e.customActions]),n=M.useMemo(()=>t.map((a,o)=>B.jsx(kF,{...a,useHorizontalLayout:e.useHorizontalLayout},o)),[t,e.useHorizontalLayout]),r=M.useMemo(()=>({width:e.width,height:e.height,top:e.top??0,paddingTop:e.topPadding??0}),[e.width,e.height,e.top,e.topPadding]),i=e.useHorizontalLayout?"HorizontalToolbar":"VerticalToolbar";return B.jsx("div",{className:i,style:{...r},children:n})},xf={onlyShowSelected:!1},wf=({options:e,setOptions:t,onRedistributeUnitColors:n})=>B.jsxs("div",{children:[B.jsx(mS,{checked:e.onlyShowSelected,onClick:()=>{t({...e,onlyShowSelected:!e.onlyShowSelected})}}),B.jsx("span",{style:{position:"relative",top:2,overflow:"hidden"},children:"only show selected"})," ",n&&B.jsx("button",{onClick:n,title:"Redistribute unit colors",children:"rc"})]}),jF=(e,t)=>{const n=t-e;let r;n<=30?r=10:n<=120?r=20:n<=300?r=50:n<=600?r=100:n<=1e3?r=150:r=100;const i=[];let a=Math.ceil(e/r);for(;a*r<=t;)i.push(a*r),a++;return i},xS=({binEdgesSec:e,binCounts:t,color:n,width:r,height:i,hideXAxis:a})=>{const o=M.useMemo(()=>(t||[]).map((c,f)=>{const d=(e||[])[f]*1e3,h=(e||[])[f+1]*1e3;return{key:f,xStart:d,xEnd:h,height:c,tooltip:`[${d}, ${h}]: ${c}`,color:n}}),[t,e,n]),{xMin:u,xMax:l}=M.useMemo(()=>o.length>0?{xMin:o[0].xStart,xMax:o[o.length-1].xEnd}:{xMin:0,xMax:1},[o]),s=M.useMemo(()=>jF(u,l).map(f=>({x:f,label:`${f}`})),[u,l]);return t?B.jsx(h_,{bars:o,ticks:a?void 0:s,width:r,height:i,xLabel:a?void 0:"dt (msec)"}):B.jsx("div",{style:{position:"relative",width:r,height:i,color:"orange"}})},HF=10,PF=4,qF=2,Ro=Nt.forwardRef((e,t)=>{const{width:n,height:r,initialPosition:i,onChange:a,adjustable:o=!0,positionFromRight:u=!1,direction:l="horizontal"}=e,s=l==="horizontal"?n:r,[c,f]=M.useState(i),[d,h]=M.useState(!1),[v,m]=M.useState({x:0,y:0}),[D,p]=M.useState(0),g=M.useRef(null);if(M.useEffect(()=>{c>s-4?f(s-4):c<4&&s>20&&f(4)},[c,n,s]),!e.children)throw Error("Unexpected: no props.children");let y,S;if(!Array.isArray(e.children))y=e.children,S=null;else{const G=e.children.filter(X=>X!==void 0);y=G[0]||null,S=G[1]||null}if(y||(y=S,S=null),!y)throw Error("Splitter must have at least one child.");const w=u?s-c:c,b=o?e.gripThickness??HF:0,E=o?e.gripInnerThickness??PF:0,C=o?e.gripMargin??qF:0,A=w-b/2-C,T=s-A-b-2*C,_={top:0,left:0,width:n,height:r,overflow:"hidden"},x={left:0,top:0,width:l==="horizontal"?A:n,height:l==="horizontal"?r:A,zIndex:0,overflowY:l==="horizontal"?"auto":"hidden",overflowX:l==="horizontal"?"hidden":"auto"},F={left:l==="horizontal"?A+b+2*C:0,top:l==="horizontal"?0:A+b+2*C,width:l==="horizontal"?T:n,height:l==="horizontal"?r:T,zIndex:0,overflowY:l==="horizontal"?"auto":"hidden",overflowX:l==="horizontal"?"hidden":"auto"},R={left:0,top:0,width:l==="horizontal"?b+2*C:n,height:l==="horizontal"?r:b+2*C,backgroundColor:"transparent",cursor:l==="horizontal"?"col-resize":"row-resize",zIndex:9998},z={left:l==="horizontal"?C:0,top:l==="horizontal"?0:C,width:l==="horizontal"?b:n,height:l==="horizontal"?r:b,background:"rgb(230, 230, 230)",cursor:l==="horizontal"?"col-resize":"row-resize"},N={top:l==="horizontal"?0:(b-E)/2,left:l==="horizontal"?(b-E)/2:0,width:l==="horizontal"?E:n,height:l==="horizontal"?r:E,background:"gray",cursor:l==="horizontal"?"col-resize":"row-resize"},U=M.useCallback(G=>{G.preventDefault(),h(!0),m({x:G.clientX,y:G.clientY}),p(w)},[w]),I=M.useCallback(G=>{if(!d)return;const X=G.clientX-v.x,P=G.clientY-v.y;let H=D+(l==="horizontal"?X:P);const k=4,q=s-4;H=Math.max(k,Math.min(q,H));const Y=u?s-H:H;f(Y),a&&a(Y)},[d,v,D,l,s,u,a]),L=M.useCallback(()=>{h(!1)},[]);return M.useEffect(()=>{if(d)return document.addEventListener("mousemove",I),document.addEventListener("mouseup",L),()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",L)}},[d,I,L]),S?B.jsxs("div",{className:"splitter",style:{..._,position:"relative"},children:[B.jsx("div",{style:{...x,position:"absolute"},className:"SplitterChild",children:B.jsx(y.type,{...y.props,width:l==="horizontal"?A:n,height:l==="horizontal"?r:A})},"child1"),o&&B.jsx("div",{ref:g,style:{...R,position:"absolute",left:l==="horizontal"?w-b/2-C:0,top:l==="horizontal"?0:w-b/2-C},onMouseDown:U,children:B.jsx("div",{style:{...z,position:"absolute"},children:B.jsx("div",{style:{...N,position:"absolute"}})})},"drag"),B.jsx("div",{style:{...F,position:"absolute"},className:"SplitterChild",children:B.jsx(S.type,{ref:t,...S.props,width:l==="horizontal"?T:n,height:l==="horizontal"?r:T})},"child2")]}):B.jsx(y.type,{...y.props,width:n,height:r})}),VF=({data:e,width:t,height:n})=>{const[r,i]=M.useState(xf),{selectedUnitIds:a,orderedUnitIds:o,plotClickHandlerGenerator:u,unitIdSelectionDispatch:l}=qr(),[s,c]=M.useState(1),[f,d]=M.useState(!1);M.useEffect(()=>{l({type:oo,newUnitOrder:yr(e.autocorrelograms.map(g=>g.unitId))})},[e.autocorrelograms,l]);const h=M.useMemo(()=>e.autocorrelograms.filter(g=>r.onlyShowSelected?a.has(g.unitId):!0).map(g=>({unitId:g.unitId,key:g.unitId,label:`Unit ${g.unitId}`,labelColor:wr(Ct(g.unitId)),clickHandler:r.onlyShowSelected?void 0:u(g.unitId),props:{binEdgesSec:g.binEdgesSec,binCounts:g.binCounts,color:wr(Ct(g.unitId)),width:120*s,height:120*s,hideXAxis:!f}})),[e.autocorrelograms,u,r.onlyShowSelected,a,f,s]),v=M.useMemo(()=>o&&o.length>0?o.map(g=>h.filter(y=>y.unitId===g)[0]).filter(g=>g!==void 0):h,[h,o]),m=M.useMemo(()=>{const g=[{type:"button",callback:()=>c(S=>S*1.3),title:"Increase box size",icon:B.jsx(Tc,{})},{type:"button",callback:()=>c(S=>S/1.3),title:"Decrease box size",icon:B.jsx(Cc,{})}],y={type:"toggle",subtype:"checkbox",callback:()=>d(S=>!S),title:"Show X Axis",selected:f===!0};return[...g,{type:"divider"},y]},[f]),D=30,p=fl;return B.jsxs("div",{children:[B.jsxs(Ro,{width:t,height:n-D,initialPosition:p,adjustable:!1,children:[B.jsx(dl,{width:p,height:n,customActions:m}),B.jsx(wc,{width:0,height:0,children:B.jsx(xc,{plots:v,plotComponent:xS,selectedPlotKeys:r.onlyShowSelected?void 0:a})})]}),B.jsx("div",{style:{position:"absolute",top:n-D,height:D,overflow:"hidden"},children:B.jsx(wf,{options:r,setOptions:i})})]})},Ef=e=>{const[t,n]=M.useState(e?.stateRef.current),r=e?.stateRef,i=e?.onChange;return M.useEffect(()=>{n(r?.current);const a=i?.(o=>{n(o)});return()=>{a&&a()}},[i,r]),t===void 0?{state:void 0,dispatch:void 0}:{state:t,dispatch:e?.dispatch}},GF=(e,t,n)=>{const{state:r,dispatch:i}=Ef(e?.figureAnnotations);M.useEffect(()=>{i&&n&&i({type:"reportViewWithAnnotations"})},[i,n]);const a=M.useMemo(()=>r?.annotations[t],[r,t]),o=M.useMemo(()=>r?.editingAnnotations?(u,l)=>{i&&i({type:"setAnnotation",path:t,key:u,value:l})}:void 0,[i,t,r?.editingAnnotations]);return{annotations:a,setAnnotation:o}},YF=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=M.useState(null);return M.useEffect(()=>{let o=!1;return(async()=>{const l=[],s=e.attrs.num_autocorrelograms||0;if(s===0){o||a({type:"Autocorrelograms",autocorrelograms:[]});return}const c=await e.getDatasetData("bin_edges_sec",{}),f=await e.getDatasetData("bin_counts",{});if(!c||!f){console.error("Failed to load autocorrelograms data");return}const d=Array.from(c),h=new Int32Array(f),v=d.length-1,m=e.attrs.autocorrelograms;for(let D=0;D<s;D++){const p=m[D],g=D*v,y=Array.from(h.slice(g,g+v));l.push({unitId:p.unit_id,binEdgesSec:d,binCounts:y})}o||a({type:"Autocorrelograms",autocorrelograms:l})})(),()=>{o=!0}},[e]),i?B.jsx(Jr,{context:t.unitSelection,children:B.jsx(VF,{data:i,width:n,height:r})}):B.jsx("div",{children:"Loading..."})},Jr=({context:e,children:t})=>{const{state:n,dispatch:r}=Ef(e);return!r||!n?B.jsx(B.Fragment,{children:"Waiting for context..."}):B.jsx(xy.Provider,{value:{unitSelection:n,unitSelectionDispatch:r},children:t})},XF=e=>{const{unitId:t,mergeGroup:n}=e,r=wr(Ct(t)),i=n?n.map(a=>`${a}`).join(", "):"";return B.jsxs("span",{children:[B.jsx("div",{className:"unitLabel",style:{backgroundColor:r}})," ",`${t}`,n&&n.length>0&&B.jsx("span",{children:` (${i})`},"mergeGroup")]})},ZF=(e,t)=>((t||{}).mergeGroups||[]).filter(r=>r.includes(e))[0]||null,QF=e=>{const{selectedUnitIds:t,currentUnitId:n,selectionDispatch:r,rows:i,columns:a,orderedUnitIds:o,visibleUnitIds:u,primarySortRule:l,height:s,selectionDisabled:c,hideSelectionColumn:f}=e,[d,h]=M.useState(l),v=M.useMemo(()=>u&&u.length>0?u:o,[u,o]),m=M.useMemo(()=>my({selectedUnitIds:t,orderedUnitIds:o,visibleUnitIds:v}),[t,o,v]),D=M.useCallback((S,w)=>{const b=d?.columnName===S?!d?.sortAscending:!0;h({columnName:S,sortAscending:b}),r&&r({type:"UPDATE_SORT_FIELDS",newSortField:S,ascending:b})},[d,r]),p=M.useCallback(()=>{r&&r(m==="all"?{type:"DESELECT_ALL"}:{type:"TOGGLE_SELECT_ALL"})},[m,r]),g=M.useMemo(()=>{const S=v.map(b=>i.get(b)).filter(b=>b!==void 0);if(!d)return S;const w=a.find(b=>b.columnName===d.columnName);return w?[...S].sort((b,E)=>{const C=b.data[d.columnName]?.sortValue,A=E.data[d.columnName]?.sortValue,T=w.sort(C,A);return d.sortAscending?T:-T}):S},[v,i,d,a]),y=S=>d?.columnName!==S?"":d.sortAscending?"↑":"↓";return B.jsx("div",{className:"compact-table-container",style:{height:s?`${s}px`:"100%",overflow:"auto"},children:B.jsxs("table",{className:"compact-table",children:[B.jsx("thead",{children:B.jsxs("tr",{children:[!f&&B.jsx("th",{className:"compact-table-header",children:B.jsx("input",{type:"checkbox",checked:m==="all",ref:S=>{S&&(S.indeterminate=m==="partial")},onChange:p,disabled:c})}),a.map(S=>B.jsxs("th",{className:"compact-table-header",onClick:()=>D(S.columnName,S),title:S.tooltip,style:{cursor:"pointer"},children:[S.label,B.jsx("span",{className:"sort-indicator",children:y(S.columnName)})]},S.columnName))]})}),B.jsx("tbody",{children:g.map(S=>B.jsxs("tr",{className:`compact-table-row ${t.has(S.rowId)?"selected":""} ${n===S.rowId?"current":""}`,children:[!f&&B.jsx("td",{className:"compact-table-cell",children:B.jsx("input",{type:"checkbox",checked:t.has(S.rowId),onChange:w=>{S.checkboxFn&&S.checkboxFn(w)},disabled:c})}),a.map(w=>B.jsx("td",{className:"compact-table-cell",children:w.dataElement(S.data[w.columnName]?.value)},w.columnName))]},S.rowId))})]})})},KF={},Af=(e,t)=>{if(t.type!=="REOPEN_CURATION"&&e.isClosed&&console.log(`WARNING: Applying curation action to a closed sorting curation:
|
|
191
|
+
Action: ${t.type}`),t.type==="SET_CURATION")return t.curation;if(t.type==="CLOSE_CURATION")return{...e,isClosed:!0};if(t.type==="REOPEN_CURATION")return{...e,isClosed:!1};if(t.type==="ADD_UNIT_LABEL"){const n=typeof t.unitId=="object"?t.unitId:[t.unitId],r={...e.labelsByUnit||{}};let i=!1;for(const a of n){const o=r[a+""]||[];o.includes(t.label)||(i=!0,r[a+""]=[...o,t.label].sort())}return i?{...e,labelsByUnit:r}:e}else if(t.type==="TOGGLE_UNIT_LABEL"){const n=typeof t.unitId=="object"?t.unitId:[t.unitId];let r=!0;for(const i of n)((e.labelsByUnit||{})[i+""]||[]).includes(t.label)||(r=!1);return r?Af(e,{type:"REMOVE_UNIT_LABEL",unitId:t.unitId,label:t.label}):Af(e,{type:"ADD_UNIT_LABEL",unitId:t.unitId,label:t.label})}else if(t.type==="REMOVE_UNIT_LABEL"){const n=typeof t.unitId=="object"?t.unitId:[t.unitId],r={...e.labelsByUnit||{}};let i=!1;for(const a of n){const o=r[a+""]||[];o.includes(t.label)&&(i=!0,r[a+""]=o.filter(u=>u!==t.label))}return i?{...e,labelsByUnit:r}:e}else{if(t.type==="MERGE_UNITS")return{...e,mergeGroups:AS([...e.mergeGroups||[],t.unitIds])};if(t.type==="UNMERGE_UNITS")return{...e,mergeGroups:AS((e.mergeGroups||[]).map(n=>n.filter(r=>!t.unitIds.includes(r))))};if(t.type==="SET_LABEL_CHOICES")return{...e,labelChoices:t.labelChoices}}return e},WF={sortingCuration:KF,sortingCurationDispatch:e=>{console.warn("No sortingCurationDispatch function provided.")},curating:!1},wS=Nt.createContext(WF),ES=()=>{const e=M.useContext(wS);if(!e)throw Error("useSortingCuration must be used within a SortingCurationContext.Provider");return e},JF=(e,t)=>e.filter(n=>t.includes(n)),eN=(e,t)=>[...e,...t.filter(n=>!e.includes(n))].sort(),AS=e=>{const t=e.map(r=>[...r]);let n=!0;for(;n;){n=!1;for(let r=0;r<t.length;r++){const i=t[r];for(let a=r+1;a<t.length;a++){const o=t[a];JF(i,o).length>0&&(t[r]=eN(i,o),t[a]=[],n=!0)}}}return t.filter(r=>r.length>=2)},CS=({data:e,width:t,height:n})=>{const[r,i]=M.useState({...xf,onlyShowSelected:!1}),{selectedUnitIds:a,currentUnitId:o,orderedUnitIds:u,visibleUnitIds:l,primarySortRule:s,checkboxClickHandlerGenerator:c,unitIdSelectionDispatch:f}=qr(),{sortingCuration:d}=ES(),h=M.useMemo(()=>r.onlyShowSelected?l?l.filter(w=>a.has(w)):[...a]:l,[l,a,r.onlyShowSelected]),v=M.useMemo(()=>{const w=[];return w.push({columnName:"_unitId",label:"Unit",tooltip:"Unit ID",sort:(b,E)=>Ct(b)-Ct(E),dataElement:b=>B.jsx(XF,{unitId:b.unitId,mergeGroup:b.mergeGroup}),calculating:!1}),d&&w.push({columnName:"_labels",label:"Labels",tooltip:"Curation labels",sort:(b,E)=>b<E?-1:b>E?1:0,dataElement:b=>B.jsx("span",{children:b.join(", ")}),calculating:!1}),e.similarityScores&&w.push({columnName:"_similarity",label:"Similarity",tooltip:"Similarity with current unit",sort:(b,E)=>{if(b.unitId===o)return 1;if(E.unitId===o)return-1;const C=b.score,A=E.score;return C===void 0&&A!==void 0?-1:C!==void 0&&A===void 0?1:C===void 0&&A===void 0?0:C!==void 0&&A!==void 0?C<A?-1:C>A?1:0:0},dataElement:b=>B.jsx("span",{children:b}),calculating:!1,onlyAllowDescendingSort:!0}),e.columns.filter(b=>b.key!=="unitId").forEach(b=>{w.push({columnName:b.key,label:b.label,tooltip:b.label,sort:b.dtype==="str"?(E,C)=>E<C?-1:E>C?1:0:b.dtype==="int"?(E,C)=>E-C:b.dtype=="bool"?(E,C)=>(E?1:0)-(C?1:0):b.dtype==="float"?(E,C)=>E-C:(E,C)=>E-C,dataElement:E=>B.jsx("span",{children:E}),calculating:!1})}),w},[e.columns,o,d,e.similarityScores]),m=M.useMemo(()=>{for(let b=0;b<0;b++)u.push("never-added");const w={};if(e.similarityScores&&o!==void 0)for(const b of e.similarityScores)b.unitId1===o?w[b.unitId2]=b.similarity:b.unitId2===o&&(w[b.unitId1]=b.similarity);return e.rows.map(b=>{const E=(d?.labelsByUnit||{})[`${b.unitId}`]||[],C={value:{unitId:b.unitId,mergeGroup:ZF(b.unitId,d)},sortValue:b.unitId},A=w[b.unitId],T={_unitId:C,_labels:{value:E,sortValue:E.join(", ")},_similarity:{value:A!==void 0?A.toFixed(3):void 0,sortValue:{unitId:b.unitId,score:A}}};for(const _ of e.columns){const x=`${b.values[_.key]!==void 0?b.values[_.key]:""}`;T[_.key]={value:x,sortValue:b.values[_.key]}}return{rowId:b.unitId,data:T,checkboxFn:c(b.unitId)}})},[e.rows,e.columns,o,e.similarityScores,d,c,u]);M.useEffect(()=>{f({type:oo,newUnitOrder:yr(m.map(w=>w.rowId))})},[m,f]);const D=M.useMemo(()=>{const w=new Map;return m.forEach(b=>w.set(b.rowId,b)),w},[m]),p=30,g=M.useMemo(()=>({width:t-20,height:n-p,top:0,position:"relative",overflowY:"auto"}),[t,n]),y=M.useCallback(w=>{if(w.ctrlKey)return w.key==="ArrowDown"?f({type:vy}):w.key==="ArrowUp"?f({type:yy}):w.key==="Home"?f({type:by}):w.key==="End"&&f({type:Dy}),!1},[f]),S=M.useCallback(()=>{f({type:"REDISTRIBUTE_UNIT_COLORS"})},[f]);return B.jsxs("div",{children:[B.jsx("div",{style:g,onKeyDown:y,children:B.jsx(QF,{columns:v,rows:D,orderedUnitIds:u,visibleUnitIds:h,selectedUnitIds:a,currentUnitId:o,selectionDispatch:f,primarySortRule:s})}),B.jsx("div",{style:{position:"absolute",top:n-p,height:p,overflow:"hidden"},children:B.jsx(wf,{options:r,setOptions:i,onRedistributeUnitColors:S})})]})},tN=({defaultLabelOptions:e,width:t,height:n})=>{const{selectedUnitIdsArray:r}=qr(),{sortingCuration:i,sortingCurationDispatch:a,curating:o}=ES(),{labelChoices:u=[],labelsByUnit:l={},mergeGroups:s=[],isClosed:c=!1}=i,[f,d]=M.useState(""),[h,v]=M.useState(!1),m=M.useMemo(()=>u.length===0&&e.length>0&&o?(a({type:"SET_LABEL_CHOICES",labelChoices:e}),e):u,[u,e,a,o]);M.useEffect(()=>{},[m]);const D=M.useCallback(j=>{if(r.length===0)return"none";const H=r.filter(k=>(l[k.toString()]||[]).includes(j));return H.length===0?"none":H.length===r.length?"full":"partial"},[r,l]),p=M.useCallback(j=>{o&&(r.length===0||c||a({type:"TOGGLE_UNIT_LABEL",unitId:r,label:j}))},[r,c,a,o]),g=M.useCallback(()=>{if(!o)return;const j=f.trim();j&&!m.includes(j)&&(a({type:"SET_LABEL_CHOICES",labelChoices:[...m,j]}),d(""))},[f,m,a,o]),y=M.useCallback(j=>Object.values(l).some(H=>H.includes(j)),[l]),S=M.useCallback(j=>{o&&(y(j)||a({type:"SET_LABEL_CHOICES",labelChoices:m.filter(H=>H!==j)}))},[m,a,y,o]),w=M.useCallback(j=>s.find(H=>H.includes(j)),[s]),b=M.useMemo(()=>{if(r.length===0)return{canMerge:!1,canUnmerge:!1,groupsInvolved:[],unmergedUnits:[]};const j=new Set,H=[];r.forEach(Y=>{const ee=w(Y);ee?j.add(ee):H.push(Y)});const k=r.length>=2,q=j.size>0;return{canMerge:k,canUnmerge:q,groupsInvolved:Array.from(j),unmergedUnits:H}},[r,w]),E=M.useCallback(()=>{o&&(r.length<2||c||a({type:"MERGE_UNITS",unitIds:r}))},[r,c,a,o]),C=M.useCallback(()=>{o&&(r.length===0||c||a({type:"UNMERGE_UNITS",unitIds:r}))},[r,c,a,o]),A=M.useCallback(()=>{o&&a(c?{type:"REOPEN_CURATION"}:{type:"CLOSE_CURATION"})},[c,a,o]),T=M.useMemo(()=>r.length===0?"No units selected":r.length<=5?`Units: ${r.join(", ")}`:`${r.length} units selected`,[r]),_={width:t,height:n,padding:"8px",fontSize:"12px",fontFamily:"Arial, sans-serif",border:"1px solid #ddd",borderRadius:"4px",backgroundColor:"#fafafa",overflow:"auto",display:"flex",flexDirection:"column",gap:"8px"},x={marginBottom:"6px"},F={fontWeight:"bold",marginBottom:"4px",fontSize:"11px",color:"#333"},R={display:"inline-flex",alignItems:"center",padding:"2px 6px",margin:"2px",backgroundColor:"#e0e0e0",borderRadius:"12px",fontSize:"10px",border:"1px solid #ccc"},z={marginLeft:"4px",cursor:"pointer",color:"#666",fontWeight:"bold"},N={padding:"2px 4px",fontSize:"10px",border:"1px solid #ccc",borderRadius:"2px",marginRight:"4px",flex:1},U={padding:"2px 6px",fontSize:"10px",border:"1px solid #ccc",borderRadius:"2px",backgroundColor:"#f0f0f0",cursor:"pointer"},I={display:"inline-flex",alignItems:"center",margin:"2px 8px 2px 0",cursor:r.length>0&&!c?"pointer":"default",opacity:r.length>0&&!c?1:.5},L={...x,textAlign:"center"},G={...U,backgroundColor:c?"#f8d7da":"#d4edda",borderColor:c?"#f5c6cb":"#c3e6cb",color:c?"#721c24":"#155724"},X={display:"flex",alignItems:"center",cursor:"pointer",fontSize:"11px",fontWeight:"bold",color:"#333",marginBottom:"4px"},P={marginRight:"4px",fontSize:"10px",transform:h?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.2s"};return B.jsxs("div",{style:_,children:[B.jsxs("div",{style:x,children:[B.jsx("div",{style:F,children:"Selected Units"}),B.jsx("div",{style:{fontSize:"10px",color:"#666"},children:T})]}),B.jsxs("div",{style:x,children:[B.jsx("div",{style:F,children:"Label Assignment"}),m.map(j=>{const H=D(j);return B.jsxs("div",{style:I,onClick:o?()=>p(j):void 0,children:[B.jsx("input",{type:"checkbox",checked:H==="full",ref:k=>{k&&(k.indeterminate=H==="partial")},onChange:()=>{},style:{marginRight:"4px"},disabled:r.length===0||c}),B.jsx("span",{style:{fontSize:"10px"},children:j})]},j)}),r.length===0&&B.jsx("div",{style:{fontSize:"10px",color:"#999",fontStyle:"italic"},children:"Select units to assign labels"})]}),B.jsxs("div",{style:x,children:[B.jsx("div",{style:F,children:"Unit Merging"}),r.length>0&&b.groupsInvolved.length>0&&B.jsxs("div",{style:{marginBottom:"6px"},children:[B.jsx("div",{style:{fontSize:"10px",color:"#666",marginBottom:"2px"},children:"Merge groups involving selected units:"}),b.groupsInvolved.map((j,H)=>{const k={...R,backgroundColor:"#e3f2fd",borderColor:"#90caf9",color:"#1565c0"};return B.jsx("span",{style:k,children:j.join(", ")},H)})]}),B.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center",flexWrap:"wrap"},children:[B.jsx("button",{onClick:o?E:void 0,style:{...U,backgroundColor:b.canMerge&&!c?"#d4edda":"#f8f9fa",borderColor:b.canMerge&&!c?"#c3e6cb":"#dee2e6",color:b.canMerge&&!c?"#155724":"#6c757d",cursor:b.canMerge&&!c?"pointer":"default"},disabled:!b.canMerge||c,title:c?"Cannot merge when curation is closed":r.length<2?"Select 2 or more units to merge":"Merge selected units",children:"Merge Selected"}),B.jsx("button",{onClick:o?C:void 0,style:{...U,backgroundColor:b.canUnmerge&&!c?"#fff3cd":"#f8f9fa",borderColor:b.canUnmerge&&!c?"#ffeaa7":"#dee2e6",color:b.canUnmerge&&!c?"#856404":"#6c757d",cursor:b.canUnmerge&&!c?"pointer":"default"},disabled:!b.canUnmerge||c,title:c?"Cannot unmerge when curation is closed":b.canUnmerge?"Unmerge selected units":"Select units that are part of merge groups to unmerge",children:"Unmerge Selected"})]}),r.length>0&&B.jsxs("div",{style:{fontSize:"10px",color:"#666",marginTop:"4px"},children:[b.groupsInvolved.length>0&&B.jsxs("div",{children:["Selected units in"," ",b.groupsInvolved.length," merge group(s)"]}),b.unmergedUnits.length>0&&B.jsxs("div",{children:[b.unmergedUnits.length," unmerged unit(s) selected"]})]}),r.length===0&&B.jsx("div",{style:{fontSize:"10px",color:"#999",fontStyle:"italic",marginTop:"4px"},children:"Select units to merge or unmerge"})]}),B.jsxs("div",{style:x,children:[B.jsxs("div",{style:X,onClick:()=>v(!h),children:[B.jsx("span",{style:P,children:"▶"}),"Manage Label Choices"]}),h&&B.jsxs("div",{children:[B.jsx("div",{style:{marginBottom:"4px"},children:m.map(j=>{const H=y(j);return B.jsxs("span",{style:R,children:[j,!c&&!H&&B.jsx("span",{style:z,onClick:o?()=>S(j):void 0,title:"Remove label choice",children:"×"})]},j)})}),!c&&B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("input",{type:"text",value:f,onChange:j=>d(j.target.value),onKeyPress:j=>j.key==="Enter"&&o&&g(),placeholder:"Add label...",style:N}),B.jsx("button",{onClick:o?g:void 0,style:U,disabled:!f.trim(),children:"Add"})]})]})]}),B.jsxs("div",{style:L,children:[B.jsx("button",{onClick:o?A:void 0,style:G,children:c?"Reopen Curation":"Finalize Curation"}),B.jsxs("div",{style:{fontSize:"10px",color:"#666",marginTop:"2px"},children:["Status: ",c?"Closed":"Open"]})]})]})},nN=({zarrGroup:e,contexts:t,width:n,height:r})=>B.jsx(Jr,{context:t.unitSelection,children:B.jsx(TS,{contexts:t,editable:!0,children:B.jsx(rN,{zarrGroup:e,contexts:t,width:n,height:r})})}),rN=({zarrGroup:e,width:t,height:n})=>{const r=e.attrs.default_label_options||[];return B.jsx(tN,{defaultLabelOptions:r,width:t,height:n})},TS=({contexts:e,children:t,editable:n})=>{const{annotations:r,setAnnotation:i}=GF(e,"/",n),a=M.useMemo(()=>{try{return JSON.parse(r?.sorting_curation||"{}")}catch(u){return console.error("Error parsing sorting_curation:",u),{}}},[r]),o=M.useMemo(()=>u=>{if(!i)return;const l=Af(a,u);i("sorting_curation",JSON.stringify(l))},[i,a]);return B.jsx(wS.Provider,{value:{sortingCuration:a,sortingCurationDispatch:o,curating:!!i},children:t})},iN=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=M.useState(null),[o,u]=M.useState(null),[l,s]=M.useState(!0);return M.useEffect(()=>{let c=!1;return(async()=>{try{s(!0),u(null);const d=e.attrs.columns||[],h=await e.getDatasetData("rows_data",{});if(!h||h.length===0)throw new Error("Empty rows data");const v=new Uint8Array(h),m=new TextDecoder("utf-8").decode(v),D=JSON.parse(m);let p;try{const g=await e.getDatasetData("similarity_scores_data",{});if(g&&g.length>0){const y=new Uint8Array(g),S=new TextDecoder("utf-8").decode(y);p=JSON.parse(S)}}catch(g){console.warn("No similarity scores data found: "+g)}if(c)return;a({type:"UnitsTable",columns:d,rows:D,similarityScores:p})}catch(d){console.error("Error loading units table data:",d),u(`Failed to load units table data: ${d instanceof Error?d.message:String(d)}`)}finally{s(!1)}})(),()=>{c=!0}},[e]),o?B.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading units table data..."}):i?B.jsx(Jr,{context:t.unitSelection,children:B.jsx(TS,{contexts:t,editable:!1,children:B.jsx(CS,{data:i,width:n,height:r})})}):B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No units table data available"})},aN=e=>{const{ampScaleFactor:t,setAmpScaleFactor:n}=e,r=()=>{n(t*1.2)},i=()=>{n(t/1.2)},a=()=>{n(1)};return[{type:"button",callback:r,title:"Scale amplitude up [shift + mouse-wheel]",icon:B.jsx(M_,{}),keyCode:38},{type:"button",callback:a,title:"Reset scale amplitude",icon:B.jsx(XD,{})},{type:"button",callback:i,title:"Scale amplitude down [shift + mouse-wheel]",icon:B.jsx(A_,{}),keyCode:40}]},MS={forward:[[1,0,0],[0,1,0]],inverse:[[1,0,0],[0,1,0]]},ha=(e,t)=>({x:t.x*e.forward[0][0]+t.y*e.forward[0][1]+e.forward[0][2],y:t.x*e.forward[1][0]+t.y*e.forward[1][1]+e.forward[1][2]}),$m=(e,t)=>({x:t.x*e.inverse[0][0]+t.y*e.inverse[0][1]+e.inverse[0][2],y:t.x*e.inverse[1][0]+t.y*e.inverse[1][1]+e.inverse[1][2]}),oN=(e,t)=>({forward:_S(e.forward,t.forward),inverse:_S(t.inverse,e.inverse)}),uN=e=>({forward:[...e.map(t=>[...t])],inverse:sN(e)}),lN=e=>({forward:e.inverse,inverse:e.forward}),km=e=>e.forward[0][0]*e.forward[1][1]-e.forward[0][1]*e.forward[1][0],_S=(e,t)=>[[e[0][0]*t[0][0]+e[0][1]*t[1][0],e[0][0]*t[0][1]+e[0][1]*t[1][1],e[0][0]*t[0][2]+e[0][1]*t[1][2]+e[0][2]],[e[1][0]*t[0][0]+e[1][1]*t[1][0],e[1][0]*t[0][1]+e[1][1]*t[1][1],e[1][0]*t[0][2]+e[1][1]*t[1][2]+e[1][2]]],sN=e=>{const t=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],n=[e[0][2],e[1][2]],r=t[0][0]*t[1][1]-t[0][1]*t[1][0],i=[[t[1][1]/r,-t[0][1]/r],[-t[1][0]/r,t[0][0]/r]],a=[i[0][0]*n[0]+i[0][1]*n[1],i[1][0]*n[0]+i[1][1]*n[1]];return[[i[0][0],i[0][1],-a[0]],[i[1][0],i[1][1],-a[1]]]},Lm=(e,t,n={})=>{const r=n.shift!==void 0?n.shift:!0,i=n.shift!==void 0?n.alt:!1,[a,o]=M.useState(MS),u=M.useCallback(l=>{if(r&&!l.shiftKey||!r&&l.shiftKey||i&&!l.altKey||!i&&l.altKey)return;const s=l.currentTarget.getBoundingClientRect(),c={x:l.clientX-s.x,y:l.clientY-s.y},f=l.deltaY,d=1.3;let h=uN([[d,0,(1-d)*c.x],[0,d,(1-d)*c.y]]);f>0&&(h=lN(h));let v=oN(h,a);const m=ha(v,{x:0,y:0}),D=ha(v,{x:e,y:t});return 0<=m.x&&m.x<e&&0<=m.y&&m.y<t&&0<=D.x&&D.x<e&&0<=D.y&&D.y<t&&(v=MS),o(v),!1},[a,t,e,r,i]);return{affineTransform:a,handleWheel:u}},hl={border:"rgb(30, 30, 30)",base:"rgb(0, 0, 255)",selected:"rgb(50, 200, 50)",hover:"rgb(128, 128, 255)",selectedHover:"rgb(200, 200, 196)",dragged:"rgb(0, 0, 196)",draggedSelected:"rgb(180, 180, 150)",dragRect:"rgba(196, 196, 196, 0.5)",textLight:"rgb(228, 228, 228)",textDark:"rgb(32, 32, 32)"},cN=2*Math.PI,fN=(e,t)=>{const{layoutMode:n,affineTransform:r}=t;if(e.save(),r){const i=r.forward;e.transform(i[0][0],i[1][0],i[0][1],i[1][1],i[0][2],i[1][2])}n==="geom"?hN(e,t):dN(e,t),e.restore()},dN=(e,t)=>{const{pixelElectrodes:n,pixelRadius:r,showLabels:i,xMargin:a}=t,o=r>5&&i,u=t.colors??hl,l=o?2*r:0;e.clearRect(0,0,e.canvas.width,e.canvas.height);const s=a+l,c=e.canvas.width-a;if(e.beginPath(),n.forEach(f=>{e.moveTo(s,f.pixelY),e.lineTo(c,f.pixelY)}),e.strokeStyle=u.border,e.stroke(),o){const f=s-.5*r;e.font=`${r-3}px Arial`,e.fillStyle=u.textDark,e.textAlign="right",e.textBaseline="middle",n.forEach(d=>{e.fillText(`${d.e.label}`,f,d.pixelY)})}},hN=(e,t)=>{const{pixelElectrodes:n,selectedElectrodeIds:r,hoveredElectrodeId:i,draggedElectrodeIds:a,pixelRadius:o,showLabels:u,offsetLabels:l}=t,s=o>5&&u,c=t.colors??hl,f=n.map(d=>{const h=r.includes(d.e.id),v=(i??-1)===d.e.id,m=a.includes(d.e.id),D=h?m?c.draggedSelected:v?c.selectedHover:c.selected:m?c.dragged:v?c.hover:c.base;return{...d,color:D,textColor:h||v&&!m?c.textDark:c.textLight}});if(e.clearRect(0,0,e.canvas.width,e.canvas.height),f.forEach(d=>{e.fillStyle=d.color,e.beginPath(),e.ellipse(d.pixelX,d.pixelY,o,o,0,0,cN),e.fill()}),s){e.font=`${o}px Arial`,e.textAlign=l?"right":"center",e.textBaseline="middle";const d=l?1.4*o:0;f.forEach(h=>{e.fillStyle=l?c.textDark:h.textColor,e.fillText(`${h.e.label}`,h.pixelX-d,h.pixelY)})}},Cf=e=>e.reduce((t,n)=>t<=n?t:n,1/0),Tf=e=>e.reduce((t,n)=>t>=n?t:n,-1/0),Oo=10,ml=10,mN=(e,t)=>{const n=t||{};return t&&(Object.keys(n).length!==e.length||e.some(i=>!n[`${i}`]))?(console.warn("Attempt to compute electrode locations with mismatched lists. Skipping..."),[]):e.map(i=>{const a=n[`${i}`]||[i,0];return{id:i,label:`${i}`,x:a[0],y:a[1]}})},BS=new Map,FS=e=>{const t=JSON.stringify(e),n=BS.get(t);if(n!==void 0)return n;let r=Number.MAX_VALUE;e.forEach(a=>{e.forEach(o=>{const u=OD([a.x-o.x,a.y-o.y]);u!==0&&(r=Math.min(r,u))})});const i=.45*r;return BS.set(t,i),i},NS=(e,t)=>({xmin:Cf(e.map(n=>n.x))-t,xmax:Tf(e.map(n=>n.x))+t,ymin:Cf(e.map(n=>n.y))-t,ymax:Tf(e.map(n=>n.y))+t}),pN=e=>{const t=FS(e),n=NS(e,t),r=Sc(n),i=zD(n),a={x:r/2+n.xmin,y:i/2+n.ymin};return{boxAspect:r/i,boxCenter:a}},gN=e=>{const t={xmin:Cf(e.map(n=>n.x)),xmax:Tf(e.map(n=>n.x)),ymin:Cf(e.map(n=>n.y)),ymax:Tf(e.map(n=>n.y))};return t.xmin===t.xmax&&t.ymin===t.ymax?e.map((n,r)=>({...n,x:r,y:0})):e},vN=(e,t)=>s_(n=>{const r=Oo+n[0]*(e-2*Oo),i=ml+n[1]*(t-2*ml);return[r,i]}),yN=(e,t)=>{const n=e.map((a,o)=>({e:a,ind:o})).sort((a,o)=>-a.e.y+o.e.y).map(a=>a.ind),r=[];for(let a=0;a<e.length;a++)r.push([0,0]);for(let a=0;a<n.length;a++){const o=n[a];r[o]=[.5,(.5+a)/(1+e.length)]}const i=Zh(t,r);return e.map((a,o)=>{const[u,l]=i[o];return{e:a,pixelX:u,pixelY:l}})},bN=(e,t,n,r,i)=>{const a=e-Oo*2,o=t-ml*2,u=Sc(i),l=zD(i);return L5(a/u,o/l,r/n)},DN=(e,t,n,r)=>{const i=Sc(r),a=(e-i*n)/2,o=[n,0,a-r.xmin*n],u=[0,-n,(t+n*(r.ymin+r.ymax))/2];return[o,u,[0,0,1]]},SN=(e,t,n,r={})=>{const i=(e-Oo*2)/(t-ml*2),a=gN(n),{boxAspect:o}=pN(a);return r.disableAutoRotate||o===1||i===1||o>1==i>1?{electrodes:n,rotated:!1}:{electrodes:n.map(u=>({...u,x:u.y,y:-u.x})),rotated:!0}},xN=(e,t)=>{const n=e.map(i=>[i.x,i.y]),r=Zh(t,n);return e.map((i,a)=>{const[o,u]=r[a];return{e:i,pixelX:o,pixelY:u}})},RS=(e,t,n)=>{for(const r of e)if(OD([r.pixelX-n[0],r.pixelY-n[1]])<t)return r.e.id},OS=(e,t,n)=>{const r=t.xmin-n,i=t.xmax+n,a=t.ymin-n,o=t.ymax+n;return e.filter(u=>u.pixelX>r&&u.pixelX<i&&u.pixelY>a&&u.pixelY<o).map(u=>u.e.id)},jm=(e,t,n,r="geom",i=IS,a)=>{if(r==="vertical"){const m=vN(e,t),D=yN(n,m),p=(t-2*ml)/(1+n.length);return{transform:m,convertedElectrodes:D,pixelRadius:p}}const{electrodes:o,rotated:u}=SN(e,t,n,{disableAutoRotate:a.disableAutoRotate}),l=FS(o),s=NS(o,l),c=bN(e,t,l,i,s),f=l*c;let d=DN(e,t,c,s);const h=(e-Sc(s)*c)/2,v=xN(o,d);return u&&(d=[[-d[0][1],d[0][0],d[0][2]],[-d[1][1],d[1][0],d[1][2]],[-d[2][1],d[2][0],d[2][2]]]),{transform:d,convertedElectrodes:v,pixelRadius:f,xMargin:h}},zS={isActive:!1},wN=(e,t)=>{if(t.type==="INITIALIZE"){const{width:n,height:r,electrodes:i,layoutMode:a,maxElectrodePixelRadius:o}=t,{convertedElectrodes:u,pixelRadius:l,xMargin:s}=jm(n,r,i,a,o,{disableAutoRotate:t.disableAutoRotate});return{...e,convertedElectrodes:u,pixelRadius:l,draggedElectrodeIds:[],hoveredElectrodeId:void 0,dragState:zS,xMarginWidth:s??Oo}}else if(t.type==="DRAGUPDATE"){const n=r_(e.dragState,t.dragAction);if(!n.isActive&&n.dragRect){const r=ID(n.dragRect),i=OS(e.convertedElectrodes,r,e.pixelRadius),a=t.dragAction.shift?[...i,...t.selectedElectrodeIds||[]]:i;return{...e,draggedElectrodeIds:[],hoveredElectrodeId:void 0,pendingSelectedElectrodeIds:a,dragState:zS}}else if(n.dragRect){const r=ID(n.dragRect),i=OS(e.convertedElectrodes,r,e.pixelRadius);return i.length===e.draggedElectrodeIds.length&&i.filter(a=>!e.draggedElectrodeIds.includes(a)).length===0?{...e,hoveredElectrodeId:void 0,dragState:n}:{...e,hoveredElectrodeId:void 0,draggedElectrodeIds:i,dragState:n}}else return{...e,dragState:n}}else if(t.type==="UPDATEHOVER"){const n=RS(e.convertedElectrodes,e.pixelRadius,t.point);return n===e.hoveredElectrodeId?e:{...e,hoveredElectrodeId:n}}else if(t.type==="UPDATECLICK"){const n=RS(e.convertedElectrodes,e.pixelRadius,t.point);if(n===void 0)return!(t.shift||t.ctrl)&&t.selectedElectrodeIds.length>0?{...e,pendingSelectedElectrodeIds:[]}:e;const r=t.ctrl?t.selectedElectrodeIds.includes(n)?t.selectedElectrodeIds.filter(i=>i!==n):[...t.selectedElectrodeIds,n]:t.shift?[...t.selectedElectrodeIds,n]:[n];return{...e,hoveredElectrodeId:void 0,pendingSelectedElectrodeIds:r}}else return console.log("Error: unrecognized verb in electrode geometry reducer."),e},US=!1,IS=25,$S={showLabels:!0,maxElectrodePixelRadius:IS},EN=e=>{const t=e.currentTarget.getBoundingClientRect();return[e.clientX-t.x,e.clientY-t.y]},AN=()=>({selectedElectrodeIds:[],setSelectedElectrodeIds:e=>{}}),kS=e=>{const{width:t,height:n,electrodes:r,disableAutoRotate:i,affineTransform:a}=e,{selectedElectrodeIds:o,setSelectedElectrodeIds:u}=AN(),l=e.disableSelection??!1,s=e.offsetLabels??!1,c=e.colors??hl,f=e.layoutMode??"geom",d=e.maxElectrodePixelRadius||$S.maxElectrodePixelRadius,[h,v]=M.useReducer(wN,{convertedElectrodes:[],pixelRadius:-1,draggedElectrodeIds:[],pendingSelectedElectrodeIds:o||[],dragState:{isActive:!1},xMarginWidth:-1}),{affineTransform:m,handleWheel:D}=Lm(t,n,{shift:!0,alt:!1}),p=M.useMemo(()=>{const T=h.convertedElectrodes.map(_=>{const x=ha(m,{x:_.pixelX,y:_.pixelY});return{..._,pixelX:x.x,pixelY:x.y}});return{...h,convertedElectrodes:T,pixelRadius:h.pixelRadius*Math.sqrt(km(m))}},[m,h]),g=M.useMemo(()=>T=>{const _=EN(T),x=$m(m,{x:_[0],y:_[1]});return[x.x,x.y]},[m]);M.useEffect(()=>{v({type:"INITIALIZE",electrodes:r,width:t,height:n,maxElectrodePixelRadius:d,layoutMode:f,disableAutoRotate:i})},[t,n,r,f,d,i]),M.useEffect(()=>{u(h.pendingSelectedElectrodeIds)},[u,h.pendingSelectedElectrodeIds]);const y=M.useRef(null),S=M.useRef(0),w=l||B.jsx(l_,{width:t,height:n,newState:h.dragState}),b=M.useCallback(T=>{if(!a_(T,{nextDragStateUpdate:y,nextFrame:S,reducer:v,reducerOtherProps:{type:"DRAGUPDATE"}})){const x=g(T);v({type:"UPDATEHOVER",point:x})}},[g]),E=M.useCallback(T=>{o_(T,{nextDragStateUpdate:y,reducer:v,reducerOtherProps:{type:"DRAGUPDATE"}})},[]),C=M.useCallback(T=>{if(h.dragState.isActive)u_(T,{nextDragStateUpdate:y,reducer:v,reducerOtherProps:{type:"DRAGUPDATE",selectedElectrodeIds:o}});else{const _=g(T);v({type:"UPDATECLICK",point:_,shift:T.shiftKey,ctrl:T.ctrlKey,selectedElectrodeIds:o||[]})}},[h.dragState.isActive,o,g]),A=M.useMemo(()=>{const T={pixelElectrodes:p.convertedElectrodes,selectedElectrodeIds:o||[],hoveredElectrodeId:h.hoveredElectrodeId,draggedElectrodeIds:h.draggedElectrodeIds,pixelRadius:p.pixelRadius,showLabels:e.showLabels??$S.showLabels,offsetLabels:s,layoutMode:e.layoutMode??"geom",xMargin:h.xMarginWidth,colors:c,affineTransform:a};return B.jsx(ir,{width:t,height:n,draw:fN,drawData:T})},[t,n,p.convertedElectrodes,o,h.hoveredElectrodeId,h.draggedElectrodeIds,p.pixelRadius,e.showLabels,s,e.layoutMode,h.xMarginWidth,c,a]);return M.useMemo(()=>US,[h.convertedElectrodes,o,h.hoveredElectrodeId,h.draggedElectrodeIds,h.pixelRadius,e.showLabels,s,e.layoutMode,h.xMarginWidth,t,n,c]),B.jsxs("div",{style:{width:t,height:n,position:"relative"},onMouseMove:b,onMouseUp:C,onMouseDown:E,onWheel:D,children:[w,US,A]})},CN=e=>1/e,ma=(e,t,n,r,i)=>{const a=[];return n.forEach((o,u)=>{for(const l of t){const s=l.electrodeIndices.indexOf(u);if(s>=0){let c;const f=l.waveformStdDev,d=l.waveformPercentiles;if(r==="normal"?c=l.waveform[s]:r==="lower"?c=f?l.waveform[s].map((h,v)=>l.waveform[s][v]-f[s][v]):void 0:r==="upper"?c=f?l.waveform[s].map((h,v)=>l.waveform[s][v]+f[s][v]):void 0:r==="percentile1"?c=d?l.waveform[s].map((h,v)=>d[0][s][v]):void 0:r==="percentile2"?c=d?l.waveform[s].map((h,v)=>d[1][s][v]):void 0:r==="percentile3"?c=d&&2<d.length?l.waveform[s].map((h,v)=>d[2][s][v]):void 0:r==="percentile4"&&(c=d&&3<d.length?l.waveform[s].map((h,v)=>d[3][s][v]):void 0),c){const h=c.map((m,D)=>[(c?.length||0)/2+(D-(c?.length||0)/2)*i,m]),v=Zh(e,h);a.push({pointsInPaintBox:v,offsetFromParentCenter:[o.pixelX,o.pixelY],color:l.waveformColors.base})}}}}),a},TN=(e,t)=>{const{pixelSpacePaths:n,pixelSpacePathsLower:r,pixelSpacePathsUpper:i,pixelSpacePathsPercentile1:a,pixelSpacePathsPercentile2:o,pixelSpacePathsPercentile3:u,pixelSpacePathsPercentile4:l,xMargin:s,waveformWidth:c,affineTransform:f,useUnitColors:d}=t;if(!n||n.length===0)return;if(e.resetTransform(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.save(),f){const g=f.forward;e.transform(g[0][0],g[1][0],g[0][1],g[1][1],g[0][2],g[1][2])}e.translate(s,0);const h=e.getTransform();r&&i&&r.forEach((g,y)=>{const S=r[y],w=i[y];e.fillStyle="#dddddd",e.strokeStyle="#bbbbbb",e.lineWidth=1,e.translate(S.offsetFromParentCenter[0],S.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(S.pointsInPaintBox[0][0],S.pointsInPaintBox[0][1]);for(let b=0;b<S.pointsInPaintBox.length;b++)e.lineTo(S.pointsInPaintBox[b][0],S.pointsInPaintBox[b][1]);for(let b=w.pointsInPaintBox.length-1;b>=0;b--)e.lineTo(w.pointsInPaintBox[b][0],w.pointsInPaintBox[b][1]);e.fill(),e.stroke(),e.setTransform(h)});let v,m,D,p;a&&o&&u&&l?(v=a,m=o,D=u,p=l):a&&o&&!u&&!l?(v=void 0,m=a,D=o,p=void 0):(v=void 0,m=void 0,D=void 0,p=void 0),v&&v.length>0&&p&&p.length>0&&v.forEach((g,y)=>{if(!v||!p)throw Error("unexpected");const S=v[y],w=p[y];e.fillStyle="#dddddd",e.strokeStyle="#dddddd",e.lineWidth=1,e.translate(S.offsetFromParentCenter[0],S.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(S.pointsInPaintBox[0][0],S.pointsInPaintBox[0][1]);for(let b=0;b<S.pointsInPaintBox.length;b++)e.lineTo(S.pointsInPaintBox[b][0],S.pointsInPaintBox[b][1]);for(let b=w.pointsInPaintBox.length-1;b>=0;b--)e.lineTo(w.pointsInPaintBox[b][0],w.pointsInPaintBox[b][1]);e.fill(),e.stroke(),e.setTransform(h)}),m&&m.length>0&&m.length>0&&D&&D.length>0&&m.forEach((g,y)=>{if(!m||!D)throw Error("unexpected");const S=m[y],w=D[y];e.fillStyle="#bbbbbb",e.strokeStyle="#bbbbbb",e.lineWidth=1,e.translate(S.offsetFromParentCenter[0],S.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(S.pointsInPaintBox[0][0],S.pointsInPaintBox[0][1]);for(let b=0;b<S.pointsInPaintBox.length;b++)e.lineTo(S.pointsInPaintBox[b][0],S.pointsInPaintBox[b][1]);for(let b=w.pointsInPaintBox.length-1;b>=0;b--)e.lineTo(w.pointsInPaintBox[b][0],w.pointsInPaintBox[b][1]);e.fill(),e.stroke(),e.setTransform(h)}),n.forEach(g=>{e.strokeStyle=d?g.color:"black",e.lineWidth=c,e.translate(g.offsetFromParentCenter[0],g.offsetFromParentCenter[1]),e.beginPath(),e.moveTo(g.pointsInPaintBox[0][0],g.pointsInPaintBox[0][1]),g.pointsInPaintBox.forEach(y=>{e.lineTo(y[0],y[1])}),e.stroke(),e.setTransform(h)}),e.restore()},MN=e=>{const{electrodes:t,waveforms:n,oneElectrodeHeight:r,oneElectrodeWidth:i,yScale:a,horizontalStretchFactor:o,width:u,height:l,layoutMode:s,waveformWidth:c,affineTransform:f,useUnitColors:d}=e;return M.useMemo(()=>{const v=n.length>0&&n[0].waveform.length>0?n[0].waveform[0].length:0,m=i/v,D=-i*(.5+1/v),p=a*r/2,g=ze([[m,0,D],[0,-p,0],[0,0,1]]).toArray(),y=ma(g,n,t,"normal",o),S=ma(g,n,t,"lower",o),w=ma(g,n,t,"upper",o);let b=ma(g,n,t,"percentile1",o),E=ma(g,n,t,"percentile2",o),C=ma(g,n,t,"percentile3",o),A=ma(g,n,t,"percentile4",o);b.length===0&&(b=void 0),E.length===0&&(E=void 0),C.length===0&&(C=void 0),A.length===0&&(A=void 0);const T=s==="vertical"?(u-i)/2:0,_={pixelSpacePaths:y,pixelSpacePathsLower:S,pixelSpacePathsUpper:w,pixelSpacePathsPercentile1:b,pixelSpacePathsPercentile2:E,pixelSpacePathsPercentile3:C,pixelSpacePathsPercentile4:A,xMargin:T,waveformWidth:c,affineTransform:f,useUnitColors:d};return B.jsx(ir,{width:u,height:l,draw:TN,drawData:_})},[n,t,a,u,l,i,r,s,c,f,o,d])},_N={colors:{border:"rgb(120, 100, 120)",base:"rgb(240, 240, 240)",selected:"rgb(196, 196, 128)",hover:"rgb(128, 128, 255)",selectedHover:"rgb(200, 200, 196)",dragged:"rgb(0, 0, 196)",draggedSelected:"rgb(180, 180, 150)",dragRect:"rgba(196, 196, 196, 0.5)",textLight:"rgb(162, 162, 162)",textDark:"rgb(32, 150, 150)"}},BN=e=>{const t=e.colors??_N.colors,{electrodes:n,waveforms:r,ampScaleFactor:i,horizontalStretchFactor:a,layoutMode:o,hideElectrodes:u,width:l,height:s,showChannelIds:c,useUnitColors:f,waveformWidth:d,disableAutoRotate:h}=e,v=1e3,{handleWheel:m,affineTransform:D}=Lm(l,s,{shift:!0,alt:!0}),p=M.useMemo(()=>B.jsx(kS,{electrodes:n,width:l,height:s,layoutMode:o,colors:t,showLabels:c,maxElectrodePixelRadius:v,disableSelection:!0,disableAutoRotate:h,affineTransform:D}),[n,l,s,o,t,c,h,D]),{convertedElectrodes:g,pixelRadius:y,xMargin:S}=jm(l,s,n,o,v,{disableAutoRotate:h}),w=S||Oo,b=M.useMemo(()=>CN(e.peakAmplitude),[e.peakAmplitude]),E=M.useMemo(()=>i*b,[i,b]),C=o==="geom"?y*2:s/n.length,A=o==="geom"?y*2:l-w-(c?2*y:0),T=B.jsx(MN,{electrodes:g,waveforms:r,oneElectrodeHeight:C,oneElectrodeWidth:A,horizontalStretchFactor:a,yScale:E,width:l,height:s,layoutMode:o,waveformWidth:d,affineTransform:D,useUnitColors:f});return B.jsxs("div",{style:{width:l,height:s,position:"relative"},onWheel:m,children:[!u&&p,T]})},FN=({allChannelIds:e,channelIds:t,units:n,layoutMode:r,hideElectrodes:i,channelLocations:a,samplingFrequency:o,peakAmplitude:u,ampScaleFactor:l,horizontalStretchFactor:s,showChannelIds:c,useUnitColors:f,showReferenceProbe:d,disableAutoRotate:h,width:v,height:m})=>{const D=M.useMemo(()=>{const w=a||{};return t.map(b=>({id:b,label:`${b}`,x:w[`${b}`]!==void 0?w[`${b}`][0]:Ct(b),y:w[`${b}`]!==void 0?w[`${b}`][1]:0}))},[t,a]),p=M.useMemo(()=>{const w=a||{};return e.map(b=>({id:b,label:`${b}`,x:w[`${b}`]!==void 0?w[`${b}`][0]:Ct(b),y:w[`${b}`]!==void 0?w[`${b}`][1]:0}))},[e,a]),g=v/4,y=M.useMemo(()=>n.map(w=>{const b={base:w.waveformColor},E=[];for(const C of w.channelIds)E.push(D.map(A=>A.id).indexOf(C));return{electrodeIndices:E,waveform:w.waveform,waveformStdDev:w.waveformStdDev,waveformPercentiles:w.waveformPercentiles,waveformColors:b}}),[D,n]),S=B.jsx(BN,{waveforms:y,electrodes:D,ampScaleFactor:l,horizontalStretchFactor:s,layoutMode:a?r:"vertical",hideElectrodes:i,width:d?v-g:v,height:m,showLabels:!0,peakAmplitude:u,samplingFrequency:o,showChannelIds:c,useUnitColors:f,waveformWidth:2,disableAutoRotate:h});return d?B.jsxs("div",{style:{position:"relative",width:v,height:m},children:[B.jsx("div",{style:{position:"absolute",left:0,top:0,width:g,height:m},children:B.jsx(kS,{electrodes:p,disableSelection:!1,width:g,height:m})}),B.jsx("div",{style:{position:"absolute",left:g,top:0,width:v-g,height:m},children:S})]}):S},NN=({data:e,width:t,height:n})=>{const r=M.useMemo(()=>{const k=[];for(const q of e.averageWaveforms)for(const Y of q.channelIds)k.includes(Y)||k.push(Y);return yr(k)},[e.averageWaveforms]),[i,a]=M.useState({...xf,onlyShowSelected:!1}),{selectedUnitIds:o,currentUnitId:u,orderedUnitIds:l,plotClickHandlerGenerator:s,unitIdSelectionDispatch:c}=qr(),[f,d]=M.useState(1),[h,v]=M.useState("geom"),[m,D]=M.useState(!0),[p,g]=M.useState(!1),[y,S]=M.useState(e.showReferenceProbe||!1),[w,b]=M.useState(!1),[E,C]=M.useState(1),[A,T]=M.useState(!0),[_,x]=M.useState(!0);M.useEffect(()=>{c({type:oo,newUnitOrder:yr(e.averageWaveforms.map(k=>k.unitId))})},[e.averageWaveforms,c]);const[F,R]=M.useState(2),z=M.useMemo(()=>{let k=0;return e.averageWaveforms.forEach(q=>{q.waveform.forEach(Y=>{Y.forEach(ee=>{const te=Math.abs(ee);te>k&&(k=te)})})}),k},[e.averageWaveforms]),N=M.useMemo(()=>e.averageWaveforms.filter(k=>i.onlyShowSelected?o.has(k.unitId):!0).map(k=>{const q=[{channelIds:k.channelIds,waveform:ON(k.waveform),waveformStdDev:m&&!w?k.waveformStdDev:void 0,waveformPercentiles:m&&!w&&k.waveformPercentiles?zN(k.waveformPercentiles,k.waveform):void 0,waveformColor:wr(Ct(k.unitId))}],Y={allChannelIds:r,channelIds:k.channelIds,units:q,layoutMode:h,hideElectrodes:A,channelLocations:e.channelLocations,samplingFrequency:e.samplingFrequency,peakAmplitude:z,ampScaleFactor:f,horizontalStretchFactor:E,showChannelIds:p,useUnitColors:_,width:120*F+(y?120*F/4:0),height:120*F,showReferenceProbe:y,disableAutoRotate:!0};return{unitId:k.unitId,key:k.unitId,label:`Unit ${k.unitId}`,labelColor:wr(Ct(k.unitId)),clickHandler:i.onlyShowSelected?void 0:s(k.unitId),props:Y}}),[e.averageWaveforms,e.channelLocations,e.samplingFrequency,r,z,h,f,s,i.onlyShowSelected,o,F,m,p,y,w,E,A,_]),U=M.useMemo(()=>l?l.map(k=>N.filter(q=>q.unitId===k)[0]).filter(k=>k!==void 0):N,[N,l]),I=M.useMemo(()=>w?RN(U):U,[U,w]),L=M.useMemo(()=>[{type:"button",callback:()=>{C(k=>k*1.1)},title:"Increase horizontal stretch [alt + mouse-wheel]",icon:B.jsx(T_,{})},{type:"button",callback:()=>{C(1)},title:"Reset scale amplitude",icon:B.jsx(XD,{})},{type:"button",callback:()=>{C(k=>k/1.1)},title:"Decrease horizontal stretch [alt + mouse-wheel]",icon:B.jsx(C_,{})}],[]),G=M.useMemo(()=>{const k=aN({ampScaleFactor:f,setAmpScaleFactor:d}),q={type:"toggle",subtype:"checkbox",callback:()=>v(de=>de==="geom"?"vertical":"geom"),title:"Show electrode geometry",selected:h==="geom"},Y={type:"toggle",subtype:"checkbox",callback:()=>T(de=>!de),title:"Show electrodes",selected:!A},ee=[{type:"button",callback:()=>R(de=>de*1.3),title:"Increase box size",icon:B.jsx(Tc,{})},{type:"button",callback:()=>R(de=>de/1.3),title:"Decrease box size",icon:B.jsx(Cc,{})}],te={type:"toggle",subtype:"checkbox",callback:()=>D(de=>!de),title:"Show waveform stdev",selected:m===!0},ne={type:"toggle",subtype:"checkbox",callback:()=>g(de=>!de),title:"Show channel IDs",selected:p===!0},oe={type:"toggle",subtype:"checkbox",callback:()=>S(de=>!de),title:"Show reference probes",selected:y===!0},W={type:"toggle",subtype:"checkbox",callback:()=>b(de=>!de),title:"Show overlapping",selected:w===!0},ce={type:"toggle",subtype:"checkbox",callback:()=>x(de=>!de),title:"Use unit colors",selected:_===!0};return[{type:"divider"},...ee,{type:"divider"},...k,{type:"divider"},...L,{type:"divider"},q,Y,{type:"divider"},te,{type:"divider"},ne,{type:"divider"},oe,{type:"divider"},W,{type:"divider"},ce]},[h,f,m,p,w,y,L,A,_]),X=M.useCallback(k=>{k.shiftKey&&!k.altKey?k.deltaY<0?d(q=>q*1.3):d(q=>q/1.3):k.altKey&&!k.shiftKey&&(k.deltaY<0?C(q=>q*1.1):C(q=>q/1.1))},[]),P=30,j=M.useCallback(k=>{k&&k.addEventListener("wheel",q=>{(q.shiftKey||q.altKey)&&q.preventDefault()})},[]),H=fl;return B.jsxs("div",{ref:k=>j(k),onWheel:X,children:[B.jsxs(Ro,{width:t,height:n-P,initialPosition:H,adjustable:!1,children:[B.jsx(dl,{width:H,height:n,customActions:G}),B.jsx(wc,{width:0,height:0,children:B.jsx(xc,{plots:I,plotComponent:FN,selectedPlotKeys:i.onlyShowSelected?void 0:o,currentPlotKey:u})})]}),B.jsx("div",{style:{position:"absolute",top:n-P,height:P,overflow:"hidden"},children:B.jsx(wf,{options:i,setOptions:a})})]})},RN=e=>{if(e.length===0)return e;const t={...e[0],props:{...e[0].props}},n=t.props;t.key="overlapping",t.label="Overlapping",t.labelColor="black",t.unitId="overlapping",n.height*=3;const r=new Set;for(const a of e)for(const o of a.props.channelIds)r.add(o);const i=yr([...r]);return n.channelIds=i,n.units=e.map(a=>a.props.units[0]),[t]},ON=e=>e.map(t=>{const n=LS(t);return t.map(r=>r-n)}),zN=(e,t)=>{const n=[];for(let r=0;r<e.length;r++)n.push(e[r].map((i,a)=>{const o=LS(t[a]);return i.map(u=>u-o)}));return n},LS=e=>e.length>0?W5(e):0,UN=e=>B.jsx(Jr,{context:e.contexts.unitSelection,children:B.jsx(IN,{...e})}),IN=({zarrGroup:e,width:t,height:n})=>{const[r,i]=M.useState(null);return M.useEffect(()=>{let a=!1;return(async()=>{const u=[],l=e.attrs.num_average_waveforms||0,s=e.attrs.average_waveforms,c=s.length;c!==l&&console.warn(`numUnits (${c}) !== numAverageWaveforms (${l})`);for(let f=0;f<l;f++){const d=`waveform_${f}`,h=await e.getGroup(d);if(!h){console.warn(`No group for ${d}`);continue}if(h.datasets.find(g=>g.name==="waveform")===void 0){console.warn(`No waveform dataset for ${d}`);continue}const v=await e.getDataset(`${d}/waveform`);if(!v){console.warn(`Could not load waveform dataset for ${d}`);continue}const m=v.shape,D=await e.getDatasetData(`${d}/waveform`,{});let p;if(h.datasets.find(g=>g.name==="waveform_std_dev")===void 0?p=void 0:p=await e.getDatasetData(`${d}/waveform_std_dev`,{}),D){const g=s.find(y=>y.name===d);g&&u.push({unitId:g.unit_id,channelIds:g.channel_ids,waveform:jS(D,m),waveformStdDev:p?jS(p,m):void 0})}}a||i({type:"AverageWaveforms",averageWaveforms:u})})(),()=>{a=!0}},[e]),r?B.jsx(NN,{data:r,width:t,height:n}):B.jsx("div",{children:"Loading..."})},jS=(e,t)=>{if(t.length!==2)throw Error("shape.length should be 2");const[n,r]=t;if(e.length!==n*r)throw Error(`data.length does not match shape. Expected ${n*r}, got ${e.length}`);const i=[];for(let a=0;a<r;a++){const o=[];for(let u=0;u<n;u++)o.push(e[u*r+a]);i.push(o)}return i},HS=20,$N=({data:e,width:t,height:n})=>{const[r,i]=M.useState(!1),{selectedUnitIds:a}=qr(),o=M.useMemo(()=>yr([...a]),[a]),u=e.hideUnitSelector,l=M.useMemo(()=>{const p=e.crossCorrelograms.filter(y=>o.includes(y.unitId1)&&o.includes(y.unitId2)),g=[];for(const y of o)for(const S of o){const w=p.filter(b=>b.unitId1===y&&b.unitId2===S)[0];w?g.push(w):g.push(void 0)}return g},[e.crossCorrelograms,o]),s=u?0:100,c=fl,f=t-s-c,d=n,h=M.useMemo(()=>{const p=o.length,{plotWidth:g,plotHeight:y}=PS(f,d,p);return l.map((S,w)=>({key:`${w}`,unitId:S?S.unitId1:0,label:S?g>80?`Unit ${S.unitId1}/${S.unitId2}`:`${S.unitId1}/${S.unitId2}`:"",labelColor:"black",clickHandler:void 0,props:{binEdgesSec:S?S.binEdgesSec:void 0,binCounts:S?S.binCounts:void 0,color:S?.unitId1===S?.unitId2?wr(Ct(S?.unitId1)):"gray",width:g,height:y,hideXAxis:!r}}))},[l,f,d,o,r]),v=M.useMemo(()=>[{type:"toggle",subtype:"checkbox",callback:()=>i(g=>!g),title:"Show X Axis",selected:r===!0}],[r]),m=M.useMemo(()=>{const p=new Set;e.crossCorrelograms.forEach(y=>{p.add(y.unitId1),p.add(y.unitId2)});const g=yr(Array.from(p));return{type:"UnitsTable",columns:[],rows:g.map(y=>({unitId:y,values:{}}))}},[e.crossCorrelograms]),D=B.jsxs(Ro,{width:t-s,height:n,initialPosition:c,adjustable:!1,children:[B.jsx(dl,{width:c,height:n,customActions:v}),B.jsx(wc,{width:0,height:0,disableScroll:!0,children:o.length>HS?B.jsxs("div",{children:["Not showing cross-correlogram matrix. Too many units selected (max ="," ",HS,")."]}):o.length===0?B.jsx("div",{children:"Select one or more units to view cross-correlograms."}):B.jsx(xc,{plots:h,plotComponent:xS,selectedPlotKeys:void 0,numPlotsPerRow:o.length})})]});return u?D:B.jsxs("div",{style:{position:"relative",width:t,height:n},children:[B.jsx("div",{style:{position:"absolute",left:0,top:0,width:s,height:n,borderRight:"1px solid #ccc",boxSizing:"border-box",padding:10,backgroundColor:"#f9f9f9"},children:B.jsx(CS,{data:m,width:s,height:n})}),B.jsx("div",{style:{position:"absolute",left:s,top:0,width:t-s,height:n},children:D})]})},PS=(e,t,n)=>{const r=Math.min((e-30-(n-1)*7)/n,(t-30-(n-1)*7)/n);return{plotWidth:r,plotHeight:r}},kN=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=M.useState(null);return M.useEffect(()=>{let o=!1;return(async()=>{const l=[],s=e.attrs.num_cross_correlograms||0;if(s===0){o||a({type:"CrossCorrelograms",crossCorrelograms:[],hideUnitSelector:e.attrs.hide_unit_selector||!1});return}const c=await e.getDatasetData("bin_edges_sec",{}),f=await e.getDatasetData("bin_counts",{});if(!c||!f){console.error("Failed to load cross-correlograms data");return}const d=Array.from(c),h=new Int32Array(f),v=d.length-1,m=e.attrs.cross_correlograms;for(let p=0;p<s;p++){const g=m[p],y=p*v,S=Array.from(h.slice(y,y+v));l.push({unitId1:g.unit_id1,unitId2:g.unit_id2,binEdgesSec:d,binCounts:S})}const D=e.attrs.hide_unit_selector||!1;o||a({type:"CrossCorrelograms",crossCorrelograms:l,hideUnitSelector:D})})(),()=>{o=!0}},[e]),i?B.jsx(Jr,{context:t.unitSelection,children:B.jsx($N,{data:i,width:n,height:r})}):B.jsx("div",{children:"Loading..."})},LN=1.4,jN=(e,t,n,r)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: * Attempt to call zoomTime() with uninitialized state ${e}.`),{visibleStartTimeSec:e.visibleStartTimeSec,visibleEndTimeSec:e.visibleEndTimeSec};const i=e.endTimeSec-e.startTimeSec,a=e.visibleEndTimeSec-e.visibleStartTimeSec;if(a===i&&t==="out")return{visibleStartTimeSec:e.startTimeSec,visibleEndTimeSec:e.endTimeSec};let o=n??LN;o=t==="in"?1/o:o;const u=Math.min(a*o,i);if(u>=i)return{...e,visibleStartTimeSec:e.startTimeSec,visibleEndTimeSec:e.endTimeSec};const l=r!==void 0?r:e.currentTime??e.visibleStartTimeSec+a/2,s=(l-e.visibleStartTimeSec)/a;let c=Math.max(l-s*u,e.startTimeSec);const f=Math.min(c+u,e.endTimeSec);return c=f-u,{visibleStartTimeSec:c,visibleEndTimeSec:f}},qS=(e,t)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: Attempt to call panTime() with uninitialized state ${e}.`),e;const n=e.visibleEndTimeSec-e.visibleStartTimeSec;let r=e.visibleStartTimeSec,i=e.visibleEndTimeSec;if(t>0)i=Math.min(e.visibleEndTimeSec+t,e.endTimeSec),r=Math.max(i-n,e.startTimeSec);else if(t<0)r=Math.max(e.visibleStartTimeSec+t,e.startTimeSec),i=Math.min(r+n,e.endTimeSec);else return e;const o=!0?e.currentTime:void 0;return r===e.visibleStartTimeSec&&i===e.visibleEndTimeSec?e:{...e,visibleStartTimeSec:r,visibleEndTimeSec:i,currentTimeSec:o}},HN=(e,t)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: * Attempt to call panTime() with uninitialized state ${e}.`),{visibleStartTimeSec:e.visibleStartTimeSec,visibleEndTimeSec:e.visibleEndTimeSec};const n=e.visibleEndTimeSec-e.visibleStartTimeSec,r=t.panAmountPct/100*n*(t.type==="back"?-1:1);return qS(e,r)},PN=(e,t)=>{if(e.visibleStartTimeSec===void 0||e.visibleEndTimeSec===void 0||e.startTimeSec===void 0||e.endTimeSec===void 0)return console.warn(`WARNING: Attempt to call panTime() with uninitialized state ${e}.`),e;const n=t.deltaT;return qS(e,n)},VS=Nt.createContext(void 0),Mf=()=>{const e=M.useContext(VS);if(!e)throw new Error("useTimeseriesSelection must be used within a TimeseriesSelectionContext");const t=e.dispatch,n=M.useCallback(u=>{t({type:"initializeTimeseries",startTimeSec:u.startTimeSec,endTimeSec:u.endTimeSec,initialVisibleStartTimeSec:u.initialVisibleStartTimeSec,initialVisibleEndTimeSec:u.initialVisibleEndTimeSec})},[t]),r=M.useCallback((u,l)=>{t({type:"setVisibleTimeRange",visibleStartTimeSec:u,visibleEndTimeSec:l})},[t]),i=M.useCallback(u=>{t({type:"setCurrentTime",currentTime:u})},[t]),a=M.useCallback(u=>{t({type:"zoomVisibleTimeRange",factor:u})},[t]),o=M.useCallback(u=>{t({type:"translateVisibleTimeRangeFrac",frac:u})},[t]);if(e===void 0)throw new Error("useTimeseriesSelection must be used within a TimeseriesSelectionContext.Provider");return{initializeTimeseriesSelection:n,setVisibleTimeRange:r,setCurrentTime:i,zoomVisibleTimeRange:a,translateVisibleTimeRangeFrac:o,timeseriesSelection:e.timeseriesSelection,startTimeSec:e.timeseriesSelection.startTimeSec,endTimeSec:e.timeseriesSelection.endTimeSec,visibleStartTimeSec:e.timeseriesSelection.visibleStartTimeSec,visibleEndTimeSec:e.timeseriesSelection.visibleEndTimeSec,currentTime:e.timeseriesSelection.currentTime}},_f=()=>{const{visibleStartTimeSec:e,visibleEndTimeSec:t,currentTime:n,setCurrentTime:r,startTimeSec:i,endTimeSec:a,setVisibleTimeRange:o}=Mf(),u=M.useCallback((d,h,v)=>{const m=jN({visibleStartTimeSec:e,visibleEndTimeSec:t,currentTime:n,startTimeSec:i,endTimeSec:a},d,h,v);m.visibleStartTimeSec!==void 0&&m.visibleEndTimeSec!==void 0&&o(m.visibleStartTimeSec,m.visibleEndTimeSec)},[e,t,n,i,a,o]),l=M.useCallback((d,h)=>{const v=HN({visibleStartTimeSec:e,visibleEndTimeSec:t,startTimeSec:i,endTimeSec:a,currentTime:n},{type:d,panAmountPct:h??10});v.visibleStartTimeSec!==void 0&&v.visibleEndTimeSec!==void 0&&o(v.visibleStartTimeSec,v.visibleEndTimeSec)},[e,t,i,a,n,o]),s=M.useCallback(d=>{const h=PN({visibleStartTimeSec:e,visibleEndTimeSec:t,startTimeSec:i,endTimeSec:a,currentTime:n},{deltaT:d});h.visibleStartTimeSec!==void 0&&h.visibleEndTimeSec!==void 0&&o(h.visibleStartTimeSec,h.visibleEndTimeSec)},[e,t,i,a,n,o]),c=M.useCallback(d=>{if(e===void 0||t===void 0)return;const h=t-e,v=d,m=v+h;o(v,m)},[e,t,o]),f=M.useCallback((d,h)=>{if(e===void 0||t===void 0)return;const v=e+d*(t-e);r(v)},[e,t,r]);return{visibleStartTimeSec:e,visibleEndTimeSec:t,setVisibleTimeRange:o,zoomTimeseriesSelection:u,panTimeseriesSelection:l,panTimeseriesSelectionDeltaT:s,panTimeseriesSelectionVisibleStartTimeSec:c,setCurrentTimeFraction:f}},GS=()=>{const[e,t]=M.useState(!1),n=M.useMemo(()=>[{id:"only-show-selected",label:"Only Show Selected",tooltip:"Toggle visibility of only selected units",icon:e?"👁️":"👁️🗨️",isActive:e,onClick:()=>t(r=>!r)}],[e]);return{onlyShowSelected:e,customToolbarActions:n}},qN=[{name:"1ms",secondsPerTick:.001,countPerLargerUnit:10,scale_appropriate_label:e=>`${e%1e3} ms`},{name:"10ms",secondsPerTick:.01,countPerLargerUnit:10,scale_appropriate_label:e=>`${e*10%1e3} ms`},{name:"100ms",secondsPerTick:.1,countPerLargerUnit:10,scale_appropriate_label:e=>`${e*100%1e3} ms`},{name:"1s",secondsPerTick:1,countPerLargerUnit:10,scale_appropriate_label:e=>`${e%60} s`},{name:"10s",secondsPerTick:10,countPerLargerUnit:6,scale_appropriate_label:e=>`${e*10%60} s`},{name:"1min",secondsPerTick:60,countPerLargerUnit:10,scale_appropriate_label:e=>`${e%60} min`},{name:"10min",secondsPerTick:60*10,countPerLargerUnit:6,scale_appropriate_label:e=>`${e*10%60} min`},{name:"1hr",secondsPerTick:60*60,countPerLargerUnit:6,scale_appropriate_label:e=>`${e%24} hr`},{name:"6hr",secondsPerTick:60*60*6,countPerLargerUnit:4,scale_appropriate_label:e=>`${e*6%24} hr`},{name:"1day",secondsPerTick:60*60*24,countPerLargerUnit:10,scale_appropriate_label:e=>`${e} day`},{name:"10day",secondsPerTick:60*60*24*10,countPerLargerUnit:1e4,scale_appropriate_label:e=>`${10*e} day`}],VN=(e,t,n,r)=>M.useMemo(()=>{if(t===void 0||n===void 0)return[];if(n<=t)return[];const i=[],a=e/(n-t);for(const o of qN){const u=a*o.secondsPerTick;if(u<=50)continue;const l=Math.ceil(t/o.secondsPerTick),s=Math.floor(n/o.secondsPerTick),c=u>200||s-l<5;for(let f=l;f<=s;f++){if(f%o.countPerLargerUnit===0)continue;const d=f*o.secondsPerTick;i.push({value:d,label:o.scale_appropriate_label(f),major:c,xPixelPosition:r(d)})}}return i},[t,n,r,e]),GN=e=>{if(!e||typeof e=="function")return;const t=e.current,n=t&&t.getContext("2d");if(n)return n},YN={position:"absolute",left:0,top:0},YS=e=>{const{width:t,height:n,draw:r,drawData:i}=e,a=M.useRef(null);return M.useEffect(()=>{const o=GN(a);o&&o.canvas&&r(o,i)},[r,a,i]),B.jsx("canvas",{ref:a,width:t,height:n,style:YN})},XN=(e,t)=>{const{width:n,height:r,margins:i,timeTicks:a,gridlineOpts:o,yTickSet:u,yLabel:l}=t;e.clearRect(0,0,e.canvas.width,e.canvas.height);const s=r-i.bottom;ZN(e,a,s,i.top,{hideGridlines:o?.hideX},t.hideTimeAxisLabels),e.strokeStyle="lightgray",Hm(e,i.left,s,n-i.right,s),u&&QN(e,u,s,i.left,n-i.right,i.top,{hideGridlines:o?.hideY}),l&&KN(e,l,i.left,i.bottom,i.top,e.canvas.height)},ZN=(e,t,n,r,i,a)=>{const o=a||!1;if(!t||t.length===0)return;const u=2,l=n+(o?0:5);e.textAlign="center",e.textBaseline="top",t.forEach(s=>{e.strokeStyle=s.major?"gray":"lightgray";const c=i.hideGridlines?n:r;Hm(e,s.xPixelPosition,l,s.xPixelPosition,c),o||(e.fillStyle=s.major?"black":"gray",e.fillText(s.label,s.xPixelPosition,l+u))})},QN=(e,t,n,r,i,a,o)=>{const l=r-5,s=l-2,{ticks:c}=t;e.fillStyle="black",e.textAlign="right",e.textBaseline="middle",c.forEach(f=>{if(!f.pixelValue)return;const d=f.pixelValue;e.strokeStyle=f.isMajor?"gray":"lightgray",e.fillStyle=f.isMajor?"black":"gray";const h=o.hideGridlines?r:i;Hm(e,l,d,h,d),e.fillText(f.label,s,d)})},KN=(e,t,n,r,i,a)=>{e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(15,(a-r-i)/2+i),e.fillStyle="black",e.font="13px sans-serif",e.rotate(-Math.PI/2),e.fillText(t,0,0),e.restore()},Hm=(e,t,n,r,i)=>{e.beginPath(),e.moveTo(t,n),e.lineTo(r,i),e.stroke()},WN={},JN=e=>{const{width:t,height:n}=e,r=M.useCallback(i=>{XN(i,e)},[e]);return B.jsx("span",{className:"TSV2AxesLayer",children:B.jsx(YS,{width:t,height:n,draw:r,drawData:WN})})},e7=(e,t)=>{const{margins:n,currentTimePixels:r,currentTimeIntervalPixels:i}=t;if(e.clearRect(0,0,e.canvas.width,e.canvas.height),i!==void 0){e.fillStyle="rgba(255, 225, 225, 0.4)",e.strokeStyle="rgba(150, 50, 50, 0.9)";const a=i[0],o=n.top,u=i[1]-i[0],l=e.canvas.height-n.bottom-n.top;e.fillRect(a,o,u,l),e.strokeRect(a,o,u,l)}if(r!==void 0&&i===void 0){e.fillStyle="rgba(255, 255, 0, 0.1)";const a=4;e.fillRect(r-a/2,n.top,a,e.canvas.height-n.bottom-n.top),e.strokeStyle="rgba(200, 200, 0, 0.4)",e.lineWidth=1,e.beginPath(),e.moveTo(r,n.top),e.lineTo(r,e.canvas.height-n.bottom),e.stroke()}},t7=e=>{const{width:t,height:n,timeRange:r,currentTimePixels:i,currentTimeIntervalPixels:a,margins:o}=e,u=M.useMemo(()=>({width:t,height:n,timeRange:r,currentTimePixels:i,currentTimeIntervalPixels:a,margins:o}),[t,n,r,i,a,o]);return B.jsx(YS,{width:t,height:n,draw:e7,drawData:u})},n7=({width:e,height:t,selectionRect:n})=>{if(!n)return null;const{startX:r,endX:i}=n,a=Math.abs(i-r),o=Math.min(r,i);return B.jsx("div",{style:{position:"absolute",top:0,left:0,width:e,height:t,pointerEvents:"none",zIndex:10},children:B.jsx("div",{style:{position:"absolute",left:o,top:0,width:a,height:t,backgroundColor:"rgba(0, 123, 255, 0.2)",border:"1px solid rgba(0, 123, 255, 0.6)",borderRadius:"2px"}})})},r7=e=>{const{pixelToTime:t,visibleStartTimeSec:n,setCurrentTime:r,onMouseDown:i,onMouseUp:a,onMouseMove:o,onMouseOut:u,onCanvasClick:l,interactionMode:s}=e,{panTimeseriesSelectionVisibleStartTimeSec:c,setVisibleTimeRange:f}=_f(),[d,h]=M.useState(!1),[v,m]=M.useState(void 0),[D,p]=M.useState(null),g=M.useRef({mouseDownAchorX:null,mouseDownAnchorTime:null,mouseDownAnchorVisibleStartTime:null,mouseDownAnchorPixelToTime:null,moved:!1,selectionStartX:null,selectionEndX:null}),y=M.useCallback(E=>{if(h(!0),!E.shiftKey&&!E.ctrlKey&&!E.altKey){const C=E.clientX-E.currentTarget.getBoundingClientRect().x;s==="select-zoom"?(g.current.selectionStartX=C,g.current.selectionEndX=C,p({startX:C,endX:C})):(g.current.mouseDownAchorX=C,g.current.mouseDownAnchorTime=t(C),g.current.mouseDownAnchorVisibleStartTime=n||null,g.current.mouseDownAnchorPixelToTime=t),g.current.moved=!1}else i&&i(E)},[t,i,n,s]),S=M.useCallback(E=>{if(!E.shiftKey&&!E.ctrlKey&&!E.altKey){const C=E.clientX-E.currentTarget.getBoundingClientRect().x;if(s==="select-zoom"&&g.current.selectionStartX!==null){const A=Math.min(g.current.selectionStartX,C),T=Math.max(g.current.selectionStartX,C);if(Math.abs(T-A)>5){const _=t(A),x=t(T);f(_,x)}else if(!g.current.moved){const _=t(C);if(r(_),l){const x=E.clientY-E.currentTarget.getBoundingClientRect().y;l(C,x)}}p(null),g.current.selectionStartX=null,g.current.selectionEndX=null}else if(g.current.mouseDownAchorX=null,g.current.mouseDownAnchorTime=null,g.current.mouseDownAnchorPixelToTime=null,!g.current.moved){const A=t(C);if(r(A),l){const T=E.clientY-E.currentTarget.getBoundingClientRect().y;l(C,T)}}}else a&&a(E)},[a,t,r,s,f,l]),w=M.useCallback(E=>{const C=E.clientX-E.currentTarget.getBoundingClientRect().x,A=t(C);if(m(A),!E.shiftKey&&!E.ctrlKey&&!E.altKey){if(s==="select-zoom"&&g.current.selectionStartX!==null)g.current.selectionEndX=C,p({startX:Math.min(g.current.selectionStartX,C),endX:Math.max(g.current.selectionStartX,C)}),g.current.moved=!0;else if(s==="pan"&&g.current.mouseDownAchorX!==null&&g.current.mouseDownAnchorPixelToTime!==null){const T=g.current.mouseDownAnchorPixelToTime(C),_=g.current.mouseDownAnchorTime,x=g.current.mouseDownAnchorVisibleStartTime;if(_!==null&&x!==null){const F=T-_,R=C-g.current.mouseDownAchorX;if(Math.abs(R)>2||Math.abs(F)>.01){const z=x-F;c(z),E.preventDefault(),E.stopPropagation(),g.current.moved=!0}}}}o&&o(E)},[t,o,s,c]),b=M.useCallback(E=>{m(void 0),h(!1),p(null),g.current.selectionStartX=null,g.current.selectionEndX=null,u&&u(E)},[u]);return{isViewClicked:d,hoverTime:v,selectionRect:D,handleMouseDown:y,handleMouseUp:S,handleMouseMove:w,handleMouseOut:b}},i7=({width:e,height:t,leftMargin:n,customToolbarActions:r,hideTimeAxisLabels:i,hideNavToolbar:a})=>{const o=r&&r.length>0,u=M.useMemo(()=>({left:n||60,right:20,top:10,bottom:i?10:30}),[n,i]);let l=0;a||(l+=40),o&&(l+=40);const s=e,c=t-l;return{margins:u,canvasWidth:s,canvasHeight:c}},a7=23,o7=60,u7=(e,t,n,r)=>{const i=Math.ceil((t-r)/n);return isNaN(i)||i<1?[]:Array(i).fill(0).map((a,o)=>r+o*n).filter(a=>a>e)},l7=(e,t)=>{let n=0;const r=Math.trunc(Math.log10(t));if(Math.trunc(Math.log10(e))!==r)return n;const i=Math.trunc(Math.log10(t-e));if(r<=i)return n;const a=i+1,o=Math.pow(10,-a),u=Math.trunc(t*o).toString(),l=Math.trunc(e*o).toString();for(const[s,c]of[...u].entries()){if(c!==l[s]){n=n*Math.pow(10,s-a);break}n=n*10+parseInt(c)}return n*Math.pow(10,a)},s7=(e,t)=>Math.floor(e*Math.pow(10,-(t+1)))*Math.pow(10,t+1),c7=(e,t,n)=>{const r=e-0,i=Math.trunc(r*Math.pow(10,-n)),a=i%10===0;return{label:Math.abs(n)>3?`${(i/10).toFixed(1)}e${n+1}`:`${Math.round(i*Math.pow(10,n)*1e9)/1e9}`,isMajor:a,dataValue:e}},f7=(e,t,n,r,i)=>{const a=u7(t,n,r,e).map(l=>Math.round(l*1e9)/1e9),o=l7(t,n);return a.map(l=>c7(l,o,i))},XS={ticks:[],datamin:0,datamax:0},d7=(e,t)=>{const n=Math.floor(Math.log10(e/t)),r=Math.pow(10,n),i=[1,2,5,10],o=i.map(u=>e/(r*u)).findIndex(u=>u<t);return o===3?{step:1,scale:n+1}:{step:i[o],scale:n}},h7=e=>{const{datamin:t,datamax:n,userSpecifiedZoom:r}=e;let{pixelHeight:i}=e;i<=1&&(i=1);const a=r??1;return M.useMemo(()=>{if(t===void 0||n===void 0||t===n)return XS;const o=t/a,u=n/a,l=u-o,s=i/o7,c=i/a7,f=d7(l,c),d=f.step*Math.pow(10,f.scale);if(l/d<s)return console.warn("Error: Unable to compute valid y-axis step size. Suppressing display."),XS;const h=s7(o,f.scale);return{ticks:f7(h,o,u,d,f.scale),datamin:o,datamax:u}},[n,t,a,i])},m7=e=>{const t=Math.round(e*1e3),n=Math.floor(t/(1e3*60*60)),r=Math.floor(t%(1e3*60*60)/(1e3*60)),i=Math.floor(t%(1e3*60)/1e3),a=t%1e3;return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}.${a.toString().padStart(3,"0")}`},p7=({width:e,height:t,interactionMode:n,onInteractionModeChange:r,currentTime:i,onZoomToFit:a})=>{const{zoomTimeseriesSelection:o,panTimeseriesSelection:u}=_f(),l=M.useCallback(()=>{o("in",1.2)},[o]),s=M.useCallback(()=>{o("out",1.2)},[o]),c=M.useCallback(()=>{u("back",10)},[u]),f=M.useCallback(()=>{u("forward",10)},[u]),d=M.useCallback(h=>{r(h)},[r]);return B.jsxs("div",{style:{width:e,height:t,backgroundColor:"#f8f9fa",borderTop:"1px solid #dee2e6",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"13px",fontFamily:"system-ui, -apple-system, sans-serif"},children:[B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[B.jsx("button",{onClick:()=>d("pan"),style:{padding:"4px 8px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:n==="pan"?"#007bff":"#ffffff",color:n==="pan"?"#ffffff":"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease"},title:"Pan mode: Drag to pan, wheel to zoom",children:"🖱️ Pan"}),B.jsx("button",{onClick:()=>d("select-zoom"),style:{padding:"4px 8px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:n==="select-zoom"?"#007bff":"#ffffff",color:n==="select-zoom"?"#ffffff":"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease"},title:"Select zoom mode: Drag to select region and zoom in",children:"🔍 Select"})]}),B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[B.jsx("button",{onClick:c,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Pan left",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"⬅️"}),B.jsx("button",{onClick:s,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Zoom out",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"🔍➖"}),B.jsx("button",{onClick:l,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Zoom in",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"🔍➕"}),B.jsx("button",{onClick:f,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Pan right",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"➡️"}),B.jsx("div",{style:{width:"1px",height:"20px",backgroundColor:"#dee2e6",margin:"0 4px"}}),B.jsx("button",{onClick:a,style:{padding:"6px 10px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"#ffffff",color:"#495057",cursor:"pointer",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:"Reset zoom to show all data",onMouseEnter:h=>{h.currentTarget.style.backgroundColor="#e9ecef"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="#ffffff"},children:"🏠"})]}),B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[B.jsx("span",{style:{color:"#6c757d",fontWeight:"500"},children:"Time:"}),B.jsx("span",{style:{padding:"4px 8px",backgroundColor:"#e9ecef",borderRadius:"4px",fontFamily:"Monaco, Consolas, monospace",fontSize:"12px",fontWeight:"600",color:"#495057",minWidth:"120px",textAlign:"center"},children:i!==void 0?m7(i):"--:--:--.---"})]})]})},g7=({width:e,height:t,customActions:n})=>!n||n.length===0?null:B.jsx("div",{style:{width:e,height:t,backgroundColor:"#f8f9fa",borderTop:"1px solid #dee2e6",display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"0 12px",fontSize:"13px",fontFamily:"system-ui, -apple-system, sans-serif"},children:B.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:n.map(r=>r.component?B.jsx("div",{style:{display:"flex",alignItems:"center"},children:r.component},r.id):B.jsxs("button",{onClick:r.onClick,style:{padding:"4px 8px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:r.isActive?"#007bff":"#ffffff",color:r.isActive?"#ffffff":"#495057",cursor:r.onClick?"pointer":"default",fontSize:"12px",fontWeight:"500",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"4px"},title:r.tooltip||r.label,onMouseEnter:i=>{!r.isActive&&r.onClick&&(i.currentTarget.style.backgroundColor="#e9ecef")},onMouseLeave:i=>{!r.isActive&&r.onClick&&(i.currentTarget.style.backgroundColor="#ffffff")},children:[r.icon&&B.jsx("span",{children:r.icon}),r.label]},r.id))})}),v7=e=>{if(!e||!e.current)return;e.current.querySelectorAll("canvas").forEach(n=>{n.addEventListener("wheel",r=>{r.preventDefault()})})},ZS=({width:e,height:t,onCanvasElement:n,gridlineOpts:r,onKeyDown:i,onMouseDown:a,onMouseMove:o,onMouseOut:u,onMouseUp:l,yAxisInfo:s,shiftZoom:c,requireClickToZoom:f,leftMargin:d,customToolbarActions:h,onCanvasClick:v,hideNavToolbar:m=!1,hideTimeAxisLabels:D=!1})=>{const{visibleStartTimeSec:p,visibleEndTimeSec:g,zoomTimeseriesSelection:y,panTimeseriesSelection:S,setVisibleTimeRange:w}=_f(),{currentTime:b,setCurrentTime:E,startTimeSec:C,endTimeSec:A}=Mf(),T=M.useMemo(()=>[p,g],[p,g]),{margins:_,canvasWidth:x,canvasHeight:F}=i7({width:e,height:t,leftMargin:d,customToolbarActions:h,hideNavToolbar:m}),R=M.useMemo(()=>p===void 0||g===void 0?()=>0:g<=p?()=>0:O=>_.left+(O-p)/(g-p)*(x-_.left-_.right),[x,p,g,_]),z=M.useMemo(()=>p===void 0||g===void 0?()=>0:g<=p?()=>0:O=>p+(O-_.left)/(x-_.left-_.right)*(g-p),[x,p,g,_]),N=M.useMemo(()=>{const O=s?.yMin||0,$=s?.yMax||0;return $<=O?()=>0:V=>F-_.bottom-(V-O)/($-O)*(F-_.top-_.bottom)},[s,F,_]),U=VN(x,p,g,R),I=h7({datamin:s?.yMin||0,datamax:s?.yMax||0,pixelHeight:F-_.left-_.right}),L=M.useMemo(()=>({datamin:I.datamin,datamax:I.datamax,ticks:I.ticks.map(O=>({...O,pixelValue:N(O.dataValue)}))}),[I,N]),G=F,X=M.useMemo(()=>B.jsx(JN,{width:x,height:G,timeRange:T,margins:_,timeTicks:U,yTickSet:s?.showTicks?L:void 0,yLabel:s?.yLabel,gridlineOpts:r,hideTimeAxisLabels:D}),[x,G,T,_,U,s,L,D,r]),P=M.useMemo(()=>b!==void 0?R(b):void 0,[b,R]),j=M.useMemo(()=>B.jsx(t7,{width:x,height:G,timeRange:T,margins:_,currentTimePixels:P}),[x,G,T,_,P]),H=M.useRef(null),[k,q]=M.useState("pan"),{isViewClicked:Y,hoverTime:ee,selectionRect:te,handleMouseDown:ne,handleMouseUp:oe,handleMouseMove:W,handleMouseOut:ce}=r7({pixelToTime:z,visibleStartTimeSec:p,setCurrentTime:E,onMouseDown:a,onMouseUp:l,onMouseMove:o,onMouseOut:u,onCanvasClick:v,interactionMode:k});M.useEffect(()=>{(f===!1||Y)&&v7(H)},[f,Y]);const de=M.useCallback(O=>{if(c&&!O.shiftKey||O.deltaY===0||f!==!1&&!Y)return;const $=-O.deltaY/100;y($>0?"in":"out",1.2,ee)},[c,y,ee,f,Y]),ve=M.useCallback(O=>{O.key==="="?y("in"):O.key==="-"?y("out"):O.key==="ArrowRight"?S("forward"):O.key==="ArrowLeft"&&S("back"),i&&i(O)},[i,y,S]),De=M.useCallback(()=>{C!==void 0&&A!==void 0&&w(C,A)},[C,A,w]),Se=M.useMemo(()=>B.jsx(n7,{width:x,height:G,selectionRect:te}),[x,G,te]),[Ee,Re]=M.useState(null);M.useEffect(()=>{Ee&&n(Ee,x,F,_)},[Ee,x,F,_,n]);const Ce=M.useMemo(()=>B.jsxs("div",{style:{position:"relative",overflow:"hidden",width:x,height:G},onWheel:!f||Y?de:void 0,onMouseDown:ne,onMouseUp:oe,onMouseMove:W,onMouseOut:ce,tabIndex:0,onKeyDown:ve,children:[X,B.jsx("canvas",{style:{position:"absolute",width:x,height:G},ref:O=>Re(O),width:x,height:G}),j,Se]}),[x,G,ve,de,ne,oe,W,ce,f,Y,X,j,Se]),Ne=M.useMemo(()=>B.jsx(p7,{width:e,height:40,interactionMode:k,onInteractionModeChange:q,currentTime:b,onZoomToFit:De}),[e,k,q,b,De]),pe=M.useMemo(()=>B.jsx(g7,{width:e,height:40,customActions:h}),[e,h]);return B.jsxs("div",{className:"time-scroll-view-3",ref:H,style:{position:"absolute",width:e,height:t,background:"white"},children:[Ce,!m&&B.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0},children:[Ne,pe]})]})},QS=15,y7={hideX:!1,hideY:!0},b7={showTicks:!1,yMin:void 0,yMax:void 0},D7=({dataClient:e,width:t,height:n})=>{const{visibleStartTimeSec:r,visibleEndTimeSec:i}=_f(),{initializeTimeseriesSelection:a}=Mf(),{selectedUnitIds:o,unitIdSelectionDispatch:u}=qr(),[l,s]=M.useState(void 0),c=M.useRef(null),[f,d]=M.useState(null),[h,v]=M.useState(null),[m,D]=M.useState(!1),[p,g]=M.useState(null),[y,S]=M.useState(null),w=M.useMemo(()=>r===void 0||i===void 0?"raster":i-r>120?"heatmap":"raster",[r,i]),b=e.metadata.unitIds;M.useEffect(()=>{e.metadata&&a({startTimeSec:e.metadata.startTimeSec,endTimeSec:e.metadata.endTimeSec,initialVisibleStartTimeSec:e.metadata.startTimeSec,initialVisibleEndTimeSec:e.metadata.endTimeSec})},[a,e.metadata]),M.useEffect(()=>{let H=!1;const k=async()=>{if(!(r===void 0||i===void 0))try{if(w==="raster"){const q=await e.getDataForRange({startTimeSec:r,endTimeSec:i});if(H)return;v(q),S(null)}else{const q=e.getSpikeCountsForRange({startTimeSec:r,endTimeSec:i});if(H)return;S(q),v(null)}g(null)}catch(q){if(H)return;console.error("Error loading data:",q),g(`Error loading data: ${q}`)}};return D(!0),k().finally(()=>{H||D(!1)}),()=>{H=!0}},[e,r,i,w]);const{onlyShowSelected:E,customToolbarActions:C}=GS(),[A,T]=M.useState(t),[_,x]=M.useState(n),[F,R]=M.useState(null),z=M.useMemo(()=>{const H=[];return E&&b.forEach((k,q)=>{o.has(k)&&H.push(q)}),H},[E,o,b]),N=M.useMemo(()=>z.map(H=>b[H]),[z,b]),U=M.useCallback(()=>{if(!F||!c.current||!f||!y||!e.metadata||r===void 0||i===void 0)return;if(f.clearRect(0,0,A,_),m&&(f.fillStyle="rgba(0, 0, 0, 0.02)",f.fillRect(0,0,A,_),f.fillStyle="black",f.font="16px Arial",f.textAlign="center",f.fillText("Loading...",A/2,_/2)),p){f.fillStyle="rgba(255, 0, 0, 0.1)",f.fillRect(0,0,A,_),f.fillStyle="red",f.font="14px Arial",f.textAlign="center",f.fillText(p,A/2,_/2);return}const k=_-F.top-F.bottom,q=A-F.left-F.right,Y=i-r;let ee;if(E){let oe=0;b.forEach((W,ce)=>{o.has(W)&&oe++}),ee=oe}else b.forEach((oe,W)=>{}),ee=b.length;const te=k/(ee||1);f.save(),f.beginPath(),f.rect(F.left,F.top,q,k),f.clip();let ne=1;if(y.counts.forEach(oe=>{E?z.forEach(W=>{const ce=oe[W];ce>ne&&(ne=ce)}):oe.forEach(W=>{W>ne&&(ne=W)})}),y.counts.forEach((oe,W)=>{const ce=y.binEdges[W],de=y.binEdges[W+1],ve=F.left+(ce-r)/Y*q,De=F.left+(de-r)/Y*q;if(E)for(let Se=0;Se<z.length;Se++){const Ee=z[Se],Ce=oe[Ee]/ne,Ne=F.top+(z.length-1-Se)*te,pe=KS(Ce);f.fillStyle=pe,f.fillRect(ve,Ne,De-ve+.5,te)}else oe.forEach((Se,Ee)=>{const Re=Se/ne,Ce=F.top+(b.length-1-Ee)*te,Ne=KS(Re);f.fillStyle=Ne,f.fillRect(ve,Ce,De-ve+.5,te)})}),f.restore(),te>=QS){f.globalAlpha=1;const oe=E?N:b;oe.forEach((W,ce)=>{const ve=F.top+(oe.length-1-ce)*te+te/2,De=mh(Ct(W));f.fillStyle=De,f.font="12px Arial",f.textAlign="right",f.fillText(`Unit ${W}`,F.left-5,ve)})}},[A,_,F,y,r,i,e.metadata,m,p,f,o,E,b,z,N]);console.log(o,z,N);const I=M.useCallback(()=>{if(!F||!c.current||!f||!h||!e.metadata||r===void 0||i===void 0)return;if(f.clearRect(0,0,A,_),m&&(f.fillStyle="rgba(0, 0, 0, 0.02)",f.fillRect(0,0,A,_),f.fillStyle="black",f.font="16px Arial",f.textAlign="center",f.fillText("Loading...",A/2,_/2)),p){f.fillStyle="rgba(255, 0, 0, 0.1)",f.fillRect(0,0,A,_),f.fillStyle="red",f.font="14px Arial",f.textAlign="center",f.fillText(p,A/2,_/2);return}const k=_-F.top-F.bottom,q=A-F.left-F.right,Y=i-r,ee=e.metadata.unitIds,te={};let ne;if(E){for(let W=0;W<z.length;W++){const ce=z[W];te[ce]=W}ne=z.length}else ee.forEach((W,ce)=>{te[ce]=ce}),ne=ee.length;const oe=k/(ne||1);f.save(),f.beginPath(),f.rect(F.left,F.top,q,k),f.clip();for(let W=0;W<h.timestamps.length;W++){const ce=h.timestamps[W],de=te[h.unitIndices[W]];if(de===void 0)continue;const ve=ee[h.unitIndices[W]],De=F.top+(ne-1-de)*oe+oe/2,Se=mh(Ct(ve)),Ee=l===ve,Re=o.has(ve);f.strokeStyle=Se,f.lineWidth=Ee||Re?2:1,f.globalAlpha=Re?1:Ee?.8:.6;const Ce=F.left+(ce-r)/Y*q;f.beginPath(),f.moveTo(Ce,De-oe*.4),f.lineTo(Ce,De+oe*.4),f.stroke()}if(f.restore(),oe>=QS){f.globalAlpha=1;const W=E?N:ee;W.forEach((ce,de)=>{const De=F.top+(W.length-1-de)*oe+oe/2,Se=mh(Ct(ce));f.fillStyle=Se,f.font="12px Arial",f.textAlign="right",f.fillText(`Unit ${ce}`,F.left-5,De)})}},[A,_,F,h,e.metadata,r,i,m,p,l,o,E,f,N,z]);M.useEffect(()=>{w==="heatmap"&&y?U():I()},[I,U,w,y]);const L=M.useCallback(()=>{},[]),G=M.useCallback(H=>{if(!F||!e.metadata)return;const k=e.metadata.unitIds,q=k.length,Y=1-(H.y-F.top)/(_-F.top-F.bottom),ee=Math.round(Y*q-.5);if(0<=ee&&ee<q)return k[ee]},[_,F,e.metadata]),X=M.useCallback(H=>{const k=H.currentTarget.getBoundingClientRect(),q={x:H.clientX-k.x,y:H.clientY-k.y},Y=G(q);H.shiftKey||H.ctrlKey?u({type:"TOGGLE_UNIT",targetUnit:Y}):u({type:"UNIQUE_SELECT",targetUnit:Y})},[G,u]),P=M.useCallback(H=>{const k=H.currentTarget.getBoundingClientRect(),q={x:H.clientX-k.x,y:H.clientY-k.y},Y=G(q);Y!==void 0&&s(Y)},[G]),j=M.useCallback(()=>{s(void 0)},[]);return e.metadata?B.jsx(ZS,{width:t,height:n,customToolbarActions:C,onCanvasElement:(H,k,q,Y)=>{c.current=H;const ee=H?.getContext("2d");d(ee),T(k),x(q),R(Y)},gridlineOpts:y7,onKeyDown:L,onMouseDown:X,onMouseMove:P,onMouseOut:j,yAxisInfo:b7}):B.jsx("div",{children:"Loading metadata..."})},KS=e=>{if(e===0)return"rgb(255,255,255)";const t=Math.max(0,Math.min(1,.7*(1-e))),n=Math.round(t*255);return`rgb(${n}, ${n}, ${n})`};class Pm{constructor(t,n,r,i,a,o){this.zarrGroup=t,this.metadata=n,this.referenceTimes=r,this.referenceIndices=i,this.counts2dArray=a,this.binEdges=o,this.zarrGroup=t}static async create(t){const n={startTimeSec:t.attrs.start_time_sec,endTimeSec:t.attrs.end_time_sec,unitIds:t.attrs.unit_ids||[],totalSpikes:t.attrs.total_spikes||0},r=await t.getDatasetData("reference_times",{}),i=await t.getDatasetData("reference_indices",{});if(!r||!i)throw new Error(`Reference arrays not found in Zarr group: ${t.path}`);const a=await t.getDatasetData("spike_counts_1sec",{}).catch(()=>{});if(!a)throw new Error(`Spike counts data not found in Zarr group: ${t.path}`);const o=Math.ceil(n.endTimeSec-n.startTimeSec),u=n.unitIds.length,l=Array(o);for(let f=0;f<o;f++){l[f]=Array(u);for(let d=0;d<u;d++){const h=f*u+d;l[f][d]=h<a.length?a[h]:0}}const s=Array(o+1);for(let f=0;f<=o;f++)s[f]=n.startTimeSec+f;return new Pm(t,n,r,i,l,s)}async getDataForRange(t){const n=this.findStartIndex(this.referenceTimes,this.referenceIndices,t.startTimeSec),r=this.findEndIndex(this.referenceTimes,this.referenceIndices,t.endTimeSec);if(n>=r)return{timestamps:[],unitIndices:[]};const i=await this.zarrGroup.getDatasetData("timestamps",{slice:[[n,r]]}),a=await this.zarrGroup.getDatasetData("unit_indices",{slice:[[n,r]]});return{timestamps:Array.from(i),unitIndices:Array.from(a)}}findStartIndex(t,n,r){let i=0;for(;i+1<t.length&&t[i+1]<r;)i++;return n[i]}getSpikeCountsForRange(t){const{startTimeSec:n,endTimeSec:r}=t,i=Math.floor(n-this.metadata.startTimeSec),a=Math.ceil(r-this.metadata.startTimeSec);let o=1;for(;(a-i)/o>500;)o+=1;const u=this.counts2dArray.slice(i,a),l=this.binEdges.slice(i,a+1);if(o===1)return{binEdges:l,counts:u};{const s=[],c=[];for(let f=0;f<u.length;f+=o){const d=Array(this.metadata.unitIds.length).fill(0);for(let h=0;h<o;h++)if(f+h<u.length)for(let v=0;v<d.length;v++)d[v]+=u[f+h][v];s.push(d),c.push(l[f])}return l.length>0&&c.push(l[Math.min(l.length-1,c.length*o)]),{binEdges:c,counts:s}}}findEndIndex(t,n,r){let i=t.length-1;for(;i-1>=0&&t[i-1]>r;)i--;return n[i]}}const S7=({zarrGroup:e,contexts:t,width:n,height:r})=>{const i=x7(e);return i?B.jsx(WS,{context:t.timeseriesSelection,children:B.jsx(Jr,{context:t.unitSelection,children:B.jsx(D7,{dataClient:i,width:n,height:r})})}):null},WS=({context:e,children:t})=>{const{state:n,dispatch:r}=Ef(e);return!r||!n?B.jsx(B.Fragment,{children:"Waiting for context..."}):B.jsx(VS.Provider,{value:{timeseriesSelection:n,dispatch:r},children:t})},x7=e=>{const[t,n]=M.useState(null);return M.useEffect(()=>{let r=!0;return Pm.create(e).then(i=>{r&&n(i)}),()=>{r=!1}},[e]),t},w7=({dataClient:e,width:t,height:n})=>{const{selectedUnitIds:r,unitIdSelectionDispatch:i}=qr(),{initializeTimeseriesSelection:a,visibleStartTimeSec:o,visibleEndTimeSec:u}=Mf(),[l,s]=M.useState(null),[c,f]=M.useState(null),[d,h]=M.useState(!1),[v,m]=M.useState(null),D=fl,{onlyShowSelected:p,customToolbarActions:g}=GS(),[y,S]=M.useState(t),[w,b]=M.useState(n),[E,C]=M.useState(null),A=e.metadata;M.useEffect(()=>{A&&i({type:oo,newUnitOrder:yr(A.unitIds)})},[A,i]),M.useEffect(()=>{A&&a({startTimeSec:A.startTimeSec,endTimeSec:A.endTimeSec,initialVisibleStartTimeSec:A.startTimeSec,initialVisibleEndTimeSec:A.endTimeSec})},[a,A]),M.useEffect(()=>{let x=!1;const F=async()=>{if(o!==void 0&&u!==void 0){let R=1e4;for(;;){const z=await e.getDataForRange({startTimeSec:o,endTimeSec:u},{maxNumEvents:R});if(x)return;if(z&&f(z),z.subsampleFactor>1){if(R===1e6)break;R=Math.max(R*3,z.timestamps.length*3),R>1e6&&(R=1e6)}else break}}};return h(!0),m(null),F().catch(R=>{x||m(`Failed to load data: ${R}`),m(`Failed to load data: ${R}`)}).finally(()=>{h(!1)}),()=>{x=!0}},[o,u,e]);const T=M.useMemo(()=>{if(!c||!A||c.amplitudes.length===0)return{yMin:0,yMax:10};let x=1/0,F=-1/0;for(let z=0;z<c.amplitudes.length;z++){const N=A.unitIds[c.unitIndices[z]];if(p?r.has(N):!0){const I=c.amplitudes[z];I<x&&(x=I),I>F&&(F=I)}}if(x===1/0)return{yMin:0,yMax:10};const R=(F-x)*.1;return{yMin:x-R,yMax:F+R}},[c,A,p,r]);M.useEffect(()=>{if(!l||!c||!A||!E||u===void 0||o===void 0)return;let x=!1;return(async()=>{if(x)return;if(l.clearRect(0,0,y,w),d&&(l.fillStyle="rgba(0, 0, 0, 0.1)",l.fillRect(0,0,y,w),l.fillStyle="black",l.font="16px Arial",l.textAlign="center",l.fillText("Loading...",y/2,w/2)),v){l.fillStyle="rgba(255, 0, 0, 0.1)",l.fillRect(0,0,y,w),l.fillStyle="red",l.font="14px Arial",l.textAlign="center",l.fillText(v,y/2,w/2);return}l.save(),l.beginPath(),l.rect(E.left,E.top,y-E.left-E.right,w-E.top-E.bottom),l.clip();const R=N=>E.left+(N-o)/(u-o)*(y-E.left-E.right),z=N=>w-E.bottom-(N-T.yMin)/(T.yMax-T.yMin)*(w-E.top-E.bottom);for(let N=0;N<c.timestamps.length;N++){const U=c.timestamps[N],I=c.amplitudes[N],L=A.unitIds[c.unitIndices[N]];if(U<o||U>u||!(p?r.has(L):!0))continue;const X=wr(Ct(L)),j=r.has(L)?1:.3;l.fillStyle=X,l.globalAlpha=j;const H=R(U),k=z(I);l.beginPath(),l.arc(H,k,2,0,Math.PI*2),l.fill()}l.globalAlpha=1,c.subsampleFactor>1&&(l.fillStyle="#2196F3",l.font="12px Arial",l.textAlign="left",l.fillText(`Subsampled ${c.subsampleFactor}x`,E.left+10,E.top+20)),l.restore()})(),()=>{x=!0}},[l,c,A,o,u,y,w,E,T,r,p,d,v]);const _=M.useMemo(()=>({showTicks:!0,yMin:T.yMin,yMax:T.yMax,yLabel:"Amplitude"}),[T]);return A?B.jsx("div",{children:B.jsxs(Ro,{width:t,height:n,initialPosition:D,adjustable:!1,children:[B.jsx(dl,{width:D,height:n}),B.jsx(ZS,{width:t-D,height:n,onCanvasElement:(x,F,R,z)=>{if(!x)return;const N=x.getContext("2d");s(N),S(F),b(R),C(z)},yAxisInfo:_,customToolbarActions:g})]})}):B.jsx("div",{children:"Loading metadata..."})};class Bf{constructor(t,n,r={},i,a){this.zarrGroup=t,this.metadata=n,this.subsampleClients=r,this.referenceTimes=i,this.referenceIndices=a,this.zarrGroup=t}static async create(t){const n={startTimeSec:t.attrs.start_time_sec,endTimeSec:t.attrs.end_time_sec,unitIds:t.attrs.unit_ids||[],totalSpikes:t.attrs.total_spikes||0},r={},i=t.subgroups.find(u=>u.name==="subsampled_data"),a=await t.getDatasetData("reference_times",{}),o=await t.getDatasetData("reference_indices",{});if(!a||!o)throw new Error(`Reference arrays not found in Zarr group: ${t.path}`);if(i){const u=await t.getGroup(i.name);if(!u)throw new Error(`Failed to load subsampled_data group at ${i.name} in ${t.path}`);let l=4;for(;;){const s=u.subgroups.find(d=>d.name===`factor_${l}`);if(!s)break;const c=await u.getGroup(s.name);if(!c)throw console.warn(u.subgroups),new Error(`Failed to load subsampled group at ${s.name} in ${t.path}`);const f=await Bf.create(c);r[l]=f,l*=4}}return new Bf(t,n,r,a,o)}async getDataForRange(t,n){const r=this.findStartIndex(this.referenceTimes,this.referenceIndices,t.startTimeSec),i=this.findEndIndex(this.referenceTimes,this.referenceIndices,t.endTimeSec);if(r>=i)return{timestamps:[],unitIndices:[],amplitudes:[],subsampleFactor:1};if(n.maxNumEvents>0&&i-r>n.maxNumEvents){let s=4;for(;s*4 in this.subsampleClients&&(i-r)/s>n.maxNumEvents;)s*=4;if(s in this.subsampleClients){const f=await this.subsampleClients[s].getDataForRange(t,{maxNumEvents:0});return f.subsampleFactor=s,f}}const a=await this.zarrGroup.getDatasetData("timestamps",{slice:[[r,i]]}),o=await this.zarrGroup.getDatasetData("unit_indices",{slice:[[r,i]]}),u=await this.zarrGroup.getDatasetData("amplitudes",{slice:[[r,i]]});return{timestamps:Array.from(a),unitIndices:Array.from(o),amplitudes:Array.from(u),subsampleFactor:1}}findStartIndex(t,n,r){let i=0;for(;i+1<t.length&&t[i+1]<r;)i++;return n[i]}findEndIndex(t,n,r){let i=t.length-1;for(;i-1>=0&&t[i-1]>r;)i--;return n[i]}}const E7=({zarrGroup:e,contexts:t,width:n,height:r})=>{const i=A7(e);return i?B.jsx(WS,{context:t.timeseriesSelection,children:B.jsx(Jr,{context:t.unitSelection,children:B.jsx(w7,{dataClient:i,width:n,height:r})})}):null},A7=e=>{const[t,n]=M.useState(null);return M.useEffect(()=>{let r=!0;return Bf.create(e).then(i=>{r&&n(i)}),()=>{r=!1}},[e]),t},C7=25,qm=2*Math.PI,T7={maxElectrodePixelRadius:C7},Vm={},zo=8,M7=()=>({selectedElectrodeIds:[]}),_7=e=>{const{width:t,height:n,electrodes:r,units:i,disableAutoRotate:a,onlyShowSelected:o}=e,{selectedElectrodeIds:u}=M7(),{selectedUnitIds:l,unitIdSelectionDispatch:s}=qr(),{affineTransform:c,handleWheel:f}=Lm(t,n,{shift:!0,alt:!1}),d=M.useMemo(()=>new Set([...l]),[l]),h=i.filter(U=>o?d.has(U.unitId):!0).sort((U,I)=>d.has(U.unitId)&&!d.has(I.unitId)?1:!d.has(U.unitId)&&d.has(I.unitId)?-1:Ct(U.unitId)-Ct(I.unitId)),v=e.maxElectrodePixelRadius||T7.maxElectrodePixelRadius,m=e.colors??hl,D=e.showLabels??!1,p=e.offsetLabels??!1,{convertedElectrodes:g,pixelRadius:y,transform:S}=M.useMemo(()=>jm(t,n,r,"geom",v,{disableAutoRotate:a}),[r,n,v,t,a]),w=Math.sqrt(km(c)),b=M.useCallback((U,I)=>{const L=y*w,G=g.map(X=>{const P=(u||[]).includes(X.e.id),j=!1,H=!1,k=P?H?m.draggedSelected:j?m.selectedHover:m.selected:H?m.dragged:j?m.hover:m.base;return{...X,color:k,textColor:P||j&&!H?m.textDark:m.textLight}});if(U.clearRect(0,0,U.canvas.width,U.canvas.height),G.forEach(X=>{const P=ha(c,{x:X.pixelX,y:X.pixelY});U.fillStyle=X.color,U.beginPath(),U.ellipse(P.x,P.y,L,L,0,0,qm),U.fill()}),U.strokeStyle=hl.border,g.forEach(X=>{const P=ha(c,{x:X.pixelX,y:X.pixelY});U.beginPath(),U.ellipse(P.x,P.y,L,L,0,0,qm),U.stroke()}),D){U.font=`${L}px Arial`,U.textAlign=p?"right":"center",U.textBaseline="middle";const X=p?1.4*L:0;G.forEach(P=>{const j=ha(c,{x:P.pixelX,y:P.pixelY});U.fillStyle=p?m.textDark:P.textColor,U.fillText(`${P.e.label}`,j.x-X,j.y)})}},[m,p,g,y,u,D,c,w]),E=M.useCallback((U,I)=>{const L=zo;U.clearRect(0,0,U.canvas.width,U.canvas.height);const G=(X,P,j)=>{U.fillStyle=j,U.strokeStyle="black",U.beginPath(),U.ellipse(X,P,L,L,0,0,qm),U.fill(),U.stroke()};for(const X of h){const P=Xh(S,[X.x,X.y]),j=ha(c,{x:P[0],y:P[1]}),H=l.size===0||l.has(X.unitId)?wr(Ct(X.unitId)):"rgb(220, 220, 220)";G(j.x,j.y,H)}},[S,h,l,c]),C=M.useMemo(()=>B.jsx(ir,{width:t,height:n,draw:b,drawData:Vm}),[t,n,b]),A=M.useMemo(()=>B.jsx(ir,{width:t,height:n,draw:E,drawData:Vm}),[t,n,E]),T=M.useCallback((U,{ctrlKey:I})=>{const L=B7(c,U),G=km(c),X=zo/Math.sqrt(G),P=[];for(const j of h){const H=Xh(S,[j.x,j.y]);Yh(Ff([H[0]-X,H[1]-X,X*2,X*2]),Ff(L))&&(Ff([H[0]-X,H[1]-X,X*2,X*2]),P.push(j.unitId))}if(I)for(const j of P)s({type:"TOGGLE_UNIT",targetUnit:j});else s({type:"SET_SELECTION",incomingSelectedUnitIds:P})},[S,s,h,c]),_=M.useCallback((U,{ctrlKey:I})=>{let L=!1;for(const G of h){const X=Xh(S,[G.x,G.y]);J5(U,Ff([X[0]-zo,X[1]-zo,zo*2,zo*2]))&&(L=!0,s(I?{type:"TOGGLE_UNIT",targetUnit:G.unitId}:{type:"SET_SELECTION",incomingSelectedUnitIds:[G.unitId]}))}L||s({type:"SET_SELECTION",incomingSelectedUnitIds:[]})},[S,s,h]),{onMouseMove:x,onMouseDown:F,onMouseUp:R,paintDragSelectLayer:z}=Hs(t,n,T,_),N=M.useMemo(()=>B.jsx(ir,{width:t,height:n,draw:z,drawData:Vm}),[t,n,z]);return t>0&&n>0?B.jsxs("div",{style:{width:t,height:n,position:"relative"},onMouseMove:x,onMouseUp:R,onMouseDown:F,onWheel:f,children:[C,A,N]}):B.jsx("div",{})},Ff=e=>({xmin:e[0],ymin:e[1],xmax:e[0]+e[2],ymax:e[1]+e[3]}),B7=(e,t)=>{const n=$m(e,{x:t[0],y:t[1]}),r=$m(e,{x:t[0]+t[2],y:t[1]+t[3]});return[n.x,n.y,r.x-n.x,r.y-n.y]},F7=e=>{const{data:t,width:n,height:r}=e,[i,a]=M.useState({...xf,onlyShowSelected:!1}),o=30,u=Object.keys(t.channelLocations),l=mN(u,t.channelLocations),s=M.useMemo(()=>({width:n-20,height:r-o,top:0,position:"absolute"}),[n,r]);return B.jsxs("div",{children:[B.jsx("div",{style:s,children:B.jsx(_7,{width:n-20,height:r-o,electrodes:l,units:t.units,disableAutoRotate:t.disableAutoRotate,onlyShowSelected:i.onlyShowSelected})}),B.jsx("div",{style:{position:"absolute",top:r-o,height:o,overflow:"hidden"},children:B.jsx(wf,{options:i,setOptions:a})})]})},N7=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=M.useState(null),[o,u]=M.useState(null),[l,s]=M.useState(!0);return M.useEffect(()=>{let c=!1;return(async()=>{try{s(!0),u(null);const d=e.attrs.disable_auto_rotate||!1,h=e.attrs.unit_ids,v=e.attrs.channel_locations,m=await e.getDatasetData("coords",{});if(!m||m.length===0)throw new Error("Empty coords data");const D=new Float32Array(m);if(D.length!==h.length*2)throw new Error(`Expected coords length ${h.length*2}, got ${D.length}`);const p=[];for(let g=0;g<h.length;g++)p.push({unitId:h[g],x:D[g*2],y:D[g*2+1]});if(c)return;a({type:"UnitLocations",channelLocations:v,units:p,disableAutoRotate:d})}catch(d){console.error("Error loading unit locations data:",d),u(`Failed to load unit locations data: ${d instanceof Error?d.message:String(d)}`)}finally{s(!1)}})(),()=>{c=!0}},[e]),o?B.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading unit locations data..."}):i?B.jsx(Jr,{context:t.unitSelection,children:B.jsx(F7,{data:i,width:n,height:r})}):B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No unit locations data available"})},R7=({rows:e,columns:t,onDeleteRow:n=void 0,deleteRowLabel:r=void 0,onEditRow:i=void 0,editRowLabel:a=void 0,selectionMode:o="none",selectedRowKeys:u=[],onSelectedRowKeysChanged:l=void 0,selectionDisabled:s})=>{const c=M.useMemo(()=>{const p={};return u.forEach(g=>{p[g]=!0}),p},[u]),[f,d]=M.useState(null),h=M.useCallback(p=>{l&&(o==="single"?!(p in c)||!c[p]?l([p+""]):l([]):o==="multiple"&&l(Object.keys(c).filter(g=>g!=p&&c[g]).concat(c[p]?[]:[p.toString()])))},[l,o,c]),v=M.useCallback(p=>{d(p)},[]),m=M.useCallback((p,g)=>{g&&n&&n(p),d(null)},[n]),D=M.useCallback(p=>{i&&i(p)},[i]);return B.jsxs(mF,{className:"NiceTable",children:[B.jsx(MF,{children:B.jsxs(SS,{children:[B.jsx(Sf,{style:{width:0}},"_first"),t.map(p=>B.jsx(Sf,{children:p.element?p.element:B.jsx("span",{children:p.label})},p.key))]})}),B.jsx(bF,{children:e.map(p=>B.jsxs(SS,{children:[B.jsxs(Sf,{children:[n&&(f===p.key?B.jsx(z7,{title:r||"",onConfirmDeleteRow:m,rowKey:p.key}):B.jsx(O7,{title:r||"",onDeleteRow:v,rowKey:p.key})),i&&B.jsx(U7,{title:a||"",onEditRow:D,rowKey:p.key}),o!=="none"&&B.jsx(hS,{checked:c[p.key]||!1,onClick:()=>h(p.key),disabled:s})]}),t.map(g=>B.jsx(Sf,{children:B.jsx("span",{children:I7(p.columnValues[g.key])})},g.key))]},p.key))})]})},O7=({title:e,rowKey:t,onDeleteRow:n})=>{const r=M.useCallback(()=>{n&&n(t)},[n,t]);return B.jsx(cl,{title:e,onClick:r,children:B.jsx(YD,{})})},z7=({title:e,rowKey:t,onConfirmDeleteRow:n})=>{const r=M.useCallback(()=>{n&&n(t,!0)},[n,t]),i=M.useCallback(()=>{n&&n(t,!1)},[n,t]);return B.jsxs("span",{children:["Confirm delete?",B.jsx(cl,{title:e,onClick:r,children:B.jsx(YD,{})}),B.jsx(cl,{title:"Cancel",onClick:i,children:B.jsx(B_,{})})]})},U7=({title:e,rowKey:t,onEditRow:n})=>B.jsx(cl,{title:e,onClick:()=>n&&n(t),children:B.jsx(__,{})}),I7=e=>e==0?e:e?typeof e=="object"?e.element?e.element:e.text||"":e:"",$7=({width:e,height:t})=>{const{selectedUnitMetrics:n,allUnitMetrics:r,unitMetricSelectionDispatch:i}=ch(),a=M.useMemo(()=>[{key:"metric",label:"Metric"}],[]),o=M.useMemo(()=>(r||[]).map(l=>({key:l,columnValues:{metric:l}})),[r]),u=M.useCallback(l=>{i({type:"selectUnitMetrics",unitMetrics:l})},[i]);return B.jsx("div",{style:{position:"absolute",width:e,height:t},children:B.jsx(R7,{rows:o,columns:a,selectedRowKeys:n,onSelectedRowKeysChanged:u,selectionMode:"multiple"})})},k7=(e,t)=>{e.clearRect(0,0,t.width,t.height);for(const n of t.pixelVerticalLines||[])e.strokeStyle=n.color,e.beginPath(),e.moveTo(n.x,t.margins.top-20),e.lineTo(n.x,t.height-t.margins.bottom),e.stroke();t.barBoxes.forEach(n=>{e.fillStyle=n.color,e.fillRect(n.x1,n.y1,n.x2-n.x1,n.y2-n.y1)}),t.xLabel&&(e.textBaseline="bottom",e.textAlign="center",e.fillStyle="black",e.fillText(t.xLabel,t.width/2,t.height-3));for(const n of t.pixelTicks||[])e.strokeStyle="black",e.beginPath(),e.moveTo(n.x,t.height-t.margins.bottom),e.lineTo(n.x,t.height-t.margins.bottom+6),e.stroke(),e.textBaseline="top",e.textAlign="center",e.fillStyle="black",e.fillText(n.label,n.x,t.height-t.margins.bottom+8)},L7=e=>B.jsx(ir,{width:e.width,height:e.height,draw:k7,drawData:e}),j7={},H7=({bars:e,range:t,ticks:n,verticalLines:r,xLabel:i,onSelectRect:a,width:o,height:u})=>{const{xMin:l,xMax:s}=M.useMemo(()=>t?{xMin:t.min,xMax:t.max}:e.length>0?{xMin:e[0].xStart,xMax:e[e.length-1].xEnd}:{xMin:0,xMax:1},[e,t]),c=M.useMemo(()=>Math.max(...e.map(E=>E.height)),[e]),{barBoxes:f,margins:d,pixelTicks:h,pixelVerticalLines:v}=M.useMemo(()=>{const E={left:3,right:3,top:5,bottom:3+(i?18:0)+(n?18:0)},C=o-E.left-E.right,A=u-E.top-E.bottom,T=e.map(F=>({key:F.key,x1:E.left+(F.xStart-l)/(s-l)*C,x2:E.left+(F.xEnd-l)/(s-l)*C,y1:E.top+A*(1-F.height/c),y2:E.top+A,tooltip:F.tooltip,color:F.color})),_=n?n.map(F=>({x:E.left+(F.x-l)/(s-l)*C,label:`${F.label}`})):void 0,x=r?r.map(F=>({x:E.left+(F.x-l)/(s-l)*C,color:F.color})):void 0;return{barBoxes:T,margins:E,pixelTicks:_,pixelVerticalLines:x}},[e,n,r,l,s,c,o,u,i]),m=M.useCallback((E,{ctrlKey:C,shiftKey:A})=>{const T=[],_={x:E[0],y:E[1],width:E[2],height:E[3]};for(const z of f)z.x1<=_.x+_.width&&z.x2>=_.x&&T.push(z.key);const x=o-d.left-d.right,F=(_.x-d.left)/x*(s-l)+l,R=(_.x+_.width-d.left)/x*(s-l)+l;a&&a(_,T,{ctrlKey:C,shiftKey:A,xMin:F,xMax:R})},[f,a,d.left,d.right,o,l,s]),D=M.useCallback(()=>{},[]),{onMouseMove:p,onMouseDown:g,onMouseUp:y,onMouseLeave:S,paintDragSelectLayer:w}=Hs(o,u,m,D),b=M.useMemo(()=>B.jsx(ir,{width:o,height:u,draw:w,drawData:j7}),[o,u,w]);return B.jsxs("div",{style:{width:o,height:u,position:"relative"},onMouseDown:g,onMouseMove:p,onMouseUp:y,onMouseLeave:S,children:[B.jsx(L7,{barBoxes:f,margins:d,pixelTicks:h,pixelVerticalLines:v,xLabel:i,width:o,height:u}),b]})},P7=(e,t)=>{const n=t-e;let r;n<=30?r=10:n<=120?r=20:n<=300?r=50:n<=600?r=100:n<=1e3?r=150:r=100;const i=[];let a=Math.ceil(e/r);for(;a*r<=t;)i.push(a*r),a++;return i},q7=({metric:e,metricRange:t,units:n,selectedUnitIds:r,setSelectedUnitIds:i,numBins:a,onZoomToRect:o,width:u,height:l})=>{const{bars:s,ticks:c,verticalLines:f}=M.useMemo(()=>{const h=n.map(p=>p.values[e.key]).filter(p=>p!==void 0).map(p=>p),v=n.filter(p=>r.has(p.unitId)).map(p=>p.values[e.key]).filter(p=>p!==void 0).map(p=>p),D=n.filter(p=>r.has(p.unitId)).map(p=>({unitId:p.unitId,value:p.values[e.key]})).filter(p=>p.value!==void 0).map(p=>p.unitId).map(p=>wr(Ct(p)));return V7(h,v,D,a||10)},[n,e,r,a]),d=M.useCallback((h,v,{ctrlKey:m,shiftKey:D,xMin:p,xMax:g})=>{if(D){o&&o({x:p,y:h.y,width:g-p,height:h.height});return}if(v.length===0)return;const y=[];for(const E of v){const C=s[E];y.push(C)}const S=Math.min(...y.map(E=>E.xStart)),w=Math.max(...y.map(E=>E.xEnd)),b=[];for(const E of n){const C=E.values[e.key];C!==void 0&&S<=C&&C<=w&&b.push(E.unitId)}i(m||D?[...new Set([...r,...b])]:b)},[s,e,r,i,n,o]);return B.jsx(H7,{width:u,height:l,bars:s,range:t,ticks:c,verticalLines:f,onSelectRect:d})},V7=(e,t,n,r)=>{if(e.length===0)return{bars:[],ticks:[],verticalLines:[]};let i=Math.min(...e),a=Math.max(...e);if(a<=i)return{bars:[],ticks:[],verticalLines:[]};i-=(a-i)/r/2,a+=(a-i)/r/2;const o=[];for(let f=0;f<r;f++)o.push(0);for(const f of e){const d=Math.min(Math.floor((f-i)/(a-i)*r),r-1);o[d]++}const u=[];for(let f=0;f<r;f++)u.push(0);for(const f of t){const d=Math.min(Math.floor((f-i)/(a-i)*r),r-1);u[d]++}const l=[];t.forEach((f,d)=>{l.push({x:f,color:n[d]})});const c=G7(i,a).map(f=>({x:f,label:`${f}`}));return{bars:[...o.map((f,d)=>({key:d,xStart:i+d*(a-i)/r,xEnd:i+(d+1)*(a-i)/r,height:f,tooltip:"",color:"gray"}))],ticks:c,verticalLines:l}},G7=(e,t)=>{const n=t-e;if(n<=0)return[];let r=1;for(;n*r<100;)r*=10;for(;n*r>=1e3;)r/=10;return P7(e*r,t*r).map(i=>i/r)},Y7=(e,t)=>{e.clearRect(0,0,t.width,t.height),t.markers.forEach(n=>{const r=t.coord2Pixel({x:n.x,y:n.y});e.fillStyle=n.color,e.strokeStyle="black",e.beginPath(),e.ellipse(r.x,r.y,n.radius,n.radius,0,0,2*Math.PI),e.fill(),e.stroke()})},X7=e=>B.jsx(ir,{width:e.width,height:e.height,draw:Y7,drawData:e}),Z7={},Q7=({markers:e,xRange:t,yRange:n,onSelectRect:r,onClickPoint:i,width:a,height:o})=>{const{margins:u}=M.useMemo(()=>({margins:{left:20,right:20,top:20,bottom:20}}),[]),{xMin:l,xMax:s,yMin:c,yMax:f}=M.useMemo(()=>{let b,E,C,A;return t?(b=t.min,E=t.max):e.length>0?(b=Math.min(...e.map(T=>T.x)),E=Math.max(...e.map(T=>T.x))):(b=0,E=1),n?(C=n.min,A=n.max):e.length>0?(C=Math.min(...e.map(T=>T.y)),A=Math.max(...e.map(T=>T.y))):(C=0,A=1),{xMin:b,xMax:E,yMin:C,yMax:A}},[e,t,n]),{coord2Pixel:d,pixel2Coord:h}=M.useMemo(()=>{const b=a-u.left-u.right,E=o-u.top-u.bottom;return{coord2Pixel:T=>({x:u.left+(T.x-l)/(s-l)*b,y:u.top+(1-(T.y-c)/(f-c))*E}),pixel2Coord:T=>({x:l+(T.x-u.left)/b*(s-l),y:c+(1-(T.y-u.top)/E)*(f-c)})}},[a,o,u,l,s,c,f]),v=M.useCallback((b,{ctrlKey:E,shiftKey:C})=>{const A={x:b[0],y:b[1],width:b[2],height:b[3]},T=[];for(const x of e){const F=d({x:x.x,y:x.y}),R={xmin:F.x-x.radius,ymin:F.y-x.radius,xmax:F.x+x.radius,ymax:F.y+x.radius};Yh({xmin:A.x,xmax:A.x+A.width,ymin:A.y,ymax:A.y+A.height},R)&&T.push(x.key)}const _=K7(h,A);r&&r(_,T,{ctrlKey:E,shiftKey:C})},[r,h,e,d]),m=M.useCallback((b,{ctrlKey:E,shiftKey:C})=>{const A={x:b[0],y:b[1]},T={x:A.x,y:A.y,width:1,height:1};let _;for(const x of e){const F=d({x:x.x,y:x.y}),R={xmin:F.x-x.radius,ymin:F.y-x.radius,xmax:F.x+x.radius,ymax:F.y+x.radius};Yh({xmin:T.x,xmax:T.x+T.width,ymin:T.y,ymax:T.y+T.height},R)&&(_=x.key)}i&&i(h(A),_,{ctrlKey:E,shiftKey:C})},[d,e,i,h]),{onMouseMove:D,onMouseDown:p,onMouseUp:g,onMouseLeave:y,paintDragSelectLayer:S}=Hs(a,o,v,m),w=M.useMemo(()=>B.jsx(ir,{width:a,height:o,draw:S,drawData:Z7}),[a,o,S]);return B.jsxs("div",{style:{width:a,height:o,position:"relative"},onMouseDown:p,onMouseMove:D,onMouseUp:g,onMouseLeave:y,children:[B.jsx(X7,{markers:e,margins:u,coord2Pixel:d,width:a,height:o}),w]})},K7=(e,t)=>{const n=e({x:t.x,y:t.y}),r=e({x:t.x+t.width,y:t.y+t.height});return{x:Math.min(n.x,r.x),y:Math.min(n.y,r.y),width:Math.abs(r.x-n.x),height:Math.abs(r.y-n.y)}},W7=({metric1:e,metric2:t,metric1Range:n,metric2Range:r,units:i,selectedUnitIds:a,setSelectedUnitIds:o,onZoomToRect:u,width:l,height:s})=>{const f=M.useMemo(()=>{const v=[];for(const m of i){const D=m.values[e.key],p=m.values[t.key];D!==void 0&&p!==void 0&&v.push({key:m.unitId,x:D,y:p,color:a.has(m.unitId)?wr(Ct(m.unitId)):"lightgray",radius:6,tooltip:`Unit ${m.unitId}`})}return v},[i,e,t,a]),d=M.useCallback((v,m,{ctrlKey:D,shiftKey:p})=>{if(p){u&&u(v);return}let g=m;D&&(g=[...new Set([...m,...a])]),o(g)},[o,a,u]),h=M.useCallback((v,m,{ctrlKey:D,shiftKey:p})=>{let g;if(D||p){const y=new Set([...a]);m!==void 0&&(y.has(m)?y.delete(m):y.add(m)),g=[...y]}else m===void 0?g=[]:g=[m];o(g)},[o,a]);return B.jsx(Q7,{width:l,height:s,markers:f,xRange:n,yRange:r,onSelectRect:d,onClickPoint:h})},J7=({type:e,metric1:t,metric2:n,metric1Range:r,metric2Range:i,units:a,selectedUnitIds:o,setSelectedUnitIds:u,numHistogramBins:l,onZoomToRect:s,width:c,height:f})=>{if(e==="histogram"){if(!t)throw Error("Unexpected: metric1 not defined");return B.jsx(q7,{metric:t,metricRange:r,units:a,selectedUnitIds:o,setSelectedUnitIds:u,numBins:l,onZoomToRect:s,width:c,height:f})}else if(e==="scatter"){if(!t)throw Error("Unexpected: metric1 not defined");if(!n)throw Error("Unexpected: metric2 not defined");return B.jsx(W7,{metric1:t,metric2:n,metric1Range:r,metric2Range:i,units:a,selectedUnitIds:o,setSelectedUnitIds:u,onZoomToRect:s,width:c,height:f})}else{if(e==="bottom-label")return B.jsx("div",{style:{width:c,textAlign:"center"},children:t?.label||B.jsx("span",{children:" "})});if(e==="left-label")return B.jsx("div",{style:{width:c,height:f,overflow:"hidden",writingMode:"vertical-lr",transform:"rotate(-180deg)",textAlign:"center"},children:t?.label||B.jsx("span",{children:" "})});throw Error(`Unexpected type: ${e}`)}},eR=({data:e,width:t,height:n})=>{const{units:r,metrics:i}=e,{selectedUnitIds:a,unitIdSelectionDispatch:o}=qr(),{selectedUnitMetrics:u}=ch(),[l,s]=M.useState(1),[c,f]=M.useState(10),[d,h]=M.useState({}),v=M.useMemo(()=>r.sort((g,y)=>a.has(g.unitId)&&!a.has(y.unitId)?1:!a.has(g.unitId)&&a.has(y.unitId)?-1:Ct(g.unitId)-Ct(y.unitId)),[r,a]);M.useEffect(()=>{o({type:oo,newUnitOrder:yr(v.map(g=>g.unitId))})},[v,o]);const m=M.useMemo(()=>{const g=u.length===0?[{type:"text",content:"Box size",title:"Set box size"},{type:"button",callback:()=>s(w=>w*1.3),title:"Increase box size",icon:B.jsx(Tc,{})},{type:"button",callback:()=>s(w=>w/1.3),title:"Decrease box size",icon:B.jsx(Cc,{})}]:[],y=[{type:"text",content:"# bins",title:""},{type:"button",callback:()=>f(w=>w+5),title:"Increase num. histogram bins",icon:B.jsx(Tc,{})},{type:"button",callback:()=>f(w=>Math.max(5,w-5)),title:"Decrease num. histogram bins",icon:B.jsx(Cc,{})}],S={type:"button",callback:()=>h({}),title:"Reset zoom",text:"reset"};return[...g,{type:"divider"},...y,{type:"divider"},S]},[u.length]),D=fl,p=M.useMemo(()=>{const g=y=>{o({type:"SET_SELECTION",incomingSelectedUnitIds:y})};if(u.length===0)return i.map(y=>{const S={type:"histogram",metric1:y,metric2:y,metric1Range:d[y.key],metric2Range:d[y.key],units:v,width:400*l,height:400*l,numHistogramBins:c,selectedUnitIds:a,setSelectedUnitIds:g,onZoomToRect:b=>{h({...d,[y.key]:{min:b.x,max:b.x+b.width}})}};return{key:y.key,label:y.label,unitId:"",labelColor:"black",props:S}});{const{plotWidth:w,plotHeight:b}=PS(t-D-30-10,n-30-10,u.length),E=[];for(const C of u){const A=i.filter(T=>T.key===C)[0];{const T={type:"left-label",metric1:A,metric2:A,units:v,numHistogramBins:c,width:30,height:b,selectedUnitIds:a,setSelectedUnitIds:g};E.push({key:`left-label-${C}`,label:void 0,unitId:"",labelColor:"black",props:T,hideBorderColor:!0})}for(const T of u){const _=i.filter(x=>x.key===T)[0];if(A&&_){const x={type:C===T?"histogram":"scatter",metric1:_,metric2:A,metric1Range:d[_.key],metric2Range:d[A.key],units:v,numHistogramBins:c,width:w,height:b,selectedUnitIds:a,setSelectedUnitIds:g,onZoomToRect:F=>{h(C!==T?{...d,[_.key]:{min:F.x,max:F.x+F.width},[A.key]:{min:F.y,max:F.y+F.height}}:{...d,[A.key]:{min:F.x,max:F.x+F.width}})}};E.push({key:`${T}-${C}`,label:x.type==="histogram"?C:void 0,unitId:"",labelColor:"black",props:x})}}}{const C={type:"bottom-label",metric1:void 0,metric2:void 0,units:v,numHistogramBins:c,width:30,height:30,selectedUnitIds:a,setSelectedUnitIds:g};E.push({key:"left-bottom-label",label:void 0,unitId:"",labelColor:"black",props:C,hideBorderColor:!0})}for(const C of u){const A=i.filter(_=>_.key===C)[0],T={type:"bottom-label",metric1:A,metric2:A,units:v,numHistogramBins:c,width:w,height:30,selectedUnitIds:a,setSelectedUnitIds:g};E.push({key:`bottom-label-${C}`,label:void 0,unitId:"",labelColor:"black",props:T,hideBorderColor:!0})}return E}},[i,a,v,l,u,c,t,n,o,d,D]);return B.jsxs(Ro,{width:t,height:n,initialPosition:D,adjustable:!1,children:[B.jsx(dl,{width:D,height:n,customActions:m}),B.jsx(wc,{width:0,height:0,disableScroll:u.length>0,children:B.jsx(xc,{plots:p,plotComponent:J7,numPlotsPerRow:u.length===0?void 0:u.length+1})})]})},tR=({data:e,width:t,height:n})=>{const{metrics:r}=e,{unitMetricSelectionDispatch:i}=ch();return M.useEffect(()=>{i({type:"initialize",unitMetrics:r.map(a=>a.key)})},[r,i]),B.jsxs(Ro,{width:t,height:n,initialPosition:200,adjustable:!0,children:[B.jsx($7,{width:0,height:0}),B.jsx(eR,{data:e,width:0,height:0})]})},nR=e=>js(e,{key:Ls,label:Ls,dtype:Ls}),rR=e=>js(e,{unitId:OA([RA,Ls]),values:()=>!0}),iR=e=>js(e,{type:zA("UnitMetricsGraph"),metrics:Cy(nR),units:Cy(rR)}),aR=({zarrGroup:e,contexts:t,width:n,height:r})=>{const[i,a]=M.useState(null),[o,u]=M.useState(null),[l,s]=M.useState(!0);return M.useEffect(()=>{let c=!1;return(async()=>{try{s(!0),u(null);const d=e.attrs.metrics||[],h=await e.getDatasetData("units_data",{});if(!h||h.length===0)throw new Error("Empty units data");const v=new Uint8Array(h),m=new TextDecoder("utf-8").decode(v),D=JSON.parse(m);if(c)return;const p={type:"UnitMetricsGraph",metrics:d,units:D.map(g=>({unitId:g.unit_id,values:g.values}))};if(!iR(p))throw new Error("Invalid view data structure");a(p)}catch(d){console.error("Error loading unit metrics graph data:",d),u(`Failed to load unit metrics graph data: ${d instanceof Error?d.message:String(d)}`)}finally{s(!1)}})(),()=>{c=!0}},[e]),o?B.jsxs("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:["Error: ",o]}):l?B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"Loading unit metrics data..."}):i?B.jsx(oR,{context:t.unitMetricSelection,children:B.jsx(Jr,{context:t.unitSelection,children:B.jsx(tR,{data:i,width:n,height:r})})}):B.jsx("div",{style:{width:n,height:r,display:"flex",alignItems:"center",justifyContent:"center",color:"#666",backgroundColor:"#f5f5f5"},children:"No unit metrics data available"})},oR=({context:e,children:t})=>{const{state:n,dispatch:r}=Ef(e);return!r||!n?B.jsx(B.Fragment,{children:"Waiting for unit metric selection context..."}):B.jsx(hy.Provider,{value:{unitMetricSelection:n,unitMetricSelectionDispatch:r},children:t})},JS=()=>{const e={current:{}},t=[];return{stateRef:e,dispatch:i=>{e.current=eA(e.current,i),t.forEach(a=>{a(e.current)})},onChange:i=>(t.push(i),()=>{const a=t.indexOf(i);a>=0&&t.splice(a,1)}),createNew:JS}},ex=()=>{const e={current:Sy},t=[];return{stateRef:e,dispatch:i=>{e.current=TA(e.current,i),t.forEach(a=>{a(e.current)})},onChange:i=>(t.push(i),()=>{const a=t.indexOf(i);a>=0&&t.splice(a,1)}),createNew:ex}},tx=()=>{const e={current:{}},t=[];return{stateRef:e,dispatch:i=>{e.current=Af(e.current,i),t.forEach(a=>{a(e.current)})},onChange:i=>(t.push(i),()=>{const a=t.indexOf(i);a>=0&&t.splice(a,1)}),createNew:tx}},uR=({zarrGroup:e,width:t,height:n,onResize:r,onDataChange:i,contexts:a,component:o})=>{const[u,l]=M.useState(t),[s,c]=M.useState(n),[f,d]=M.useState(e);return M.useEffect(()=>{r((h,v)=>{l(h),c(v)}),i(h=>{d(h)})},[r,i]),B.jsx(o,{zarrGroup:f,width:u,height:s,contexts:a})},lR=e=>t=>{const{container:n,zarrGroup:r,width:i,height:a,onResize:o,onDataChange:u,contexts:l}=t;JE.createRoot(n).render(B.jsx(uR,{zarrGroup:r,width:i,height:a,onResize:o,onDataChange:u,contexts:l,component:e}))};(()=>{const e=[{name:"spike_sorting.Autocorrelograms",component:YF},{name:"spike_sorting.AverageWaveforms",component:UN},{name:"spike_sorting.CrossCorrelograms",component:kN},{name:"spike_sorting.RasterPlot",component:S7},{name:"spike_sorting.SpikeAmplitudes",component:E7},{name:"spike_sorting.UnitLocations",component:N7},{name:"spike_sorting.UnitMetricsGraph",component:aR},{name:"spike_sorting.UnitsTable",component:iN},{name:"spike_sorting.SortingCuration",component:nN}],t=window.figpack_p1.registerFPViewComponent;for(const i of e)t({name:i.name,render:lR(i.component)});const n=window.figpack_p1.registerFPViewContextCreator;n({name:"unitSelection",create:ex}),n({name:"unitMetricSelection",create:JS}),n({name:"sortingCuration",create:tx});const r=window.figpack_p1.registerFPExtension;r({name:"figpack-spike-sorting"})})()})();
|